diff --git a/.eslintrc.js b/.eslintrc.js index 90e789d38e58..44e26a9ec927 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -291,6 +291,7 @@ module.exports = { 'src/legacy/**/*', '(src)/plugins/**/(public|server)/**/*', 'examples/**/*', + 'plugins-extra/**/*', ], from: [ 'src/core/public/**/*', @@ -322,6 +323,7 @@ module.exports = { 'src/legacy/**/*', '(src)/plugins/**/(public|server)/**/*', 'examples/**/*', + 'plugins-extra/**/*', '!(src)/**/*.test.*', ], from: [ @@ -338,13 +340,16 @@ module.exports = { '!(src)/plugins/**/server/**/*', 'examples/**/*', + 'plugins-extra/**/*', '!examples/**/server/**/*', + '!plugins-extra/**/server/**/*', ], from: [ 'src/core/server', 'src/core/server/**/*', '(src)/plugins/*/server/**/*', 'examples/**/server/**/*', + 'plugins-extra/**/server/*', ], errorMessage: 'Server modules cannot be imported into client modules or shared modules.', diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index 8caf4ebf6af9..bb0db0ce5ffb 100644 --- a/config/opensearch_dashboards.yml +++ b/config/opensearch_dashboards.yml @@ -334,3 +334,25 @@ # Set the value to true to enable enhancements for the data plugin # data.enhancements.enabled: false +# Set the value to true to enable enhancements for the data plugin +data.enhancements.enabled: true +# # uiSettings: +# # overrides:o +# # "timepicker:quickRanges": [] +opensearch_alerting.enabled: false +opensearch_security.enabled: false +# ql_dashboards.enabled: false + +# opensearch.hosts: [https://localhost:9200]fea +# opensearch.ssl.verificationMode: none +# opensearch.username: kibanaserver +# opensearch.password: kibanaserver +# opensearch.requestHeadersWhitelist: [authorization, securitytenant] + +# opensearch_security.multitenancy.enabled: true +# opensearch_security.multitenancy.tenants.preferred: [Private, Global] +# opensearch_security.readonly_mode.roles: [kibana_read_only] +# # Use this setting if you are running opensearch-dashboards without https +# opensearch_security.cookie.secure: false + + diff --git a/package.json b/package.json index e55a565294dd..41290d7f6b7c 100644 --- a/package.json +++ b/package.json @@ -121,6 +121,7 @@ "packages": [ "packages/*", "examples/*", + "plugins-extra/*", "test/plugin_functional/plugins/*", "test/interpreter_functional/plugins/*" ], diff --git a/packages/osd-config/src/__mocks__/env.ts b/packages/osd-config/src/__mocks__/env.ts index a9225b1e5989..3d946a9bcc99 100644 --- a/packages/osd-config/src/__mocks__/env.ts +++ b/packages/osd-config/src/__mocks__/env.ts @@ -49,6 +49,7 @@ export function getEnvOptions(options: DeepPartial = {}): EnvOptions disableOptimizer: true, cache: true, dist: false, + extraPlugins: false, runExamples: false, ...(options.cliArgs || {}), }, diff --git a/packages/osd-config/src/env.ts b/packages/osd-config/src/env.ts index e27498c341a0..e0287aeed288 100644 --- a/packages/osd-config/src/env.ts +++ b/packages/osd-config/src/env.ts @@ -52,6 +52,7 @@ export interface CliArgs { basePath: boolean; /** @deprecated use disableOptimizer to know if the @osd/optimizer is disabled in development */ optimize?: boolean; + extraPlugins: boolean; runExamples: boolean; disableOptimizer: boolean; cache: boolean; @@ -133,6 +134,7 @@ export class Env { this.pluginSearchPaths = [ resolve(this.homeDir, 'src', 'plugins'), resolve(this.homeDir, 'plugins'), + ...(options.cliArgs.extraPlugins ? [resolve(this.homeDir, 'plugins-extra')] : []), ...(options.cliArgs.runExamples ? [resolve(this.homeDir, 'examples')] : []), resolve(this.homeDir, '..', 'opensearch-dashboards-extra'), ]; diff --git a/packages/osd-optimizer/src/cli.ts b/packages/osd-optimizer/src/cli.ts index 04a91d2d9d50..8356376df2e9 100644 --- a/packages/osd-optimizer/src/cli.ts +++ b/packages/osd-optimizer/src/cli.ts @@ -64,6 +64,11 @@ run( throw createFlagError('expected --dist to have no value'); } + const extraPlugins = flags.extraPlugins ?? false; + if (typeof extraPlugins !== 'boolean') { + throw createFlagError('expected --extraPlugins to have no value'); + } + const examples = flags.examples ?? false; if (typeof examples !== 'boolean') { throw createFlagError('expected --no-examples to have no value'); @@ -117,6 +122,7 @@ run( maxWorkerCount, dist: dist || updateLimits, cache, + extraPlugins: extraPlugins && !(validateLimits || updateLimits), examples: examples && !(validateLimits || updateLimits), profileWebpack, extraPluginScanDirs, @@ -153,6 +159,7 @@ run( boolean: [ 'core', 'watch', + 'extraPlugins', 'examples', 'dist', 'cache', @@ -165,6 +172,7 @@ run( string: ['workers', 'scan-dir', 'filter'], default: { core: true, + extraPlugins: false, examples: true, cache: true, 'inspect-workers': true, @@ -177,6 +185,7 @@ run( --no-core disable generating the core bundle --no-cache disable the cache --filter comma-separated list of bundle id filters, results from multiple flags are merged, * and ! are supported + --extra-plugins build the extra plugins --no-examples don't build the example plugins --dist create bundles that are suitable for inclusion in the OpenSearch Dashboards distributable, enabled when running with --update-limits --scan-dir add a directory to the list of directories scanned for plugins (specify as many times as necessary) diff --git a/packages/osd-optimizer/src/node/node_auto_tranpilation.ts b/packages/osd-optimizer/src/node/node_auto_tranpilation.ts index 87fcde1ce9d3..cbe14f31e4b9 100644 --- a/packages/osd-optimizer/src/node/node_auto_tranpilation.ts +++ b/packages/osd-optimizer/src/node/node_auto_tranpilation.ts @@ -64,6 +64,10 @@ const IGNORE_PATTERNS = [ // is `x-pack` and `b` is not `node_modules` /[\/\\]node_modules[\/\\](?!x-pack[\/\\](?!node_modules)([^\/\\]+))([^\/\\]+[\/\\][^\/\\]+)/, + // ignore paths matching `/node_modules/{a}/{b}`, unless `a` + // is `plugins-extra` and `b` is not `node_modules` + /[\/\\]node_modules[\/\\](?!plugins-extra[\/\\](?!node_modules)([^\/\\]+))([^\/\\]+[\/\\][^\/\\]+)/, + // ignore any path in the packages, unless it is in the package's // root `src` directory, in any test or __tests__ directory, or it // ends with .test.js, .test.ts, or .test.tsx diff --git a/packages/osd-optimizer/src/optimizer/optimizer_config.ts b/packages/osd-optimizer/src/optimizer/optimizer_config.ts index c9a760dc2bfa..7d859d712e93 100644 --- a/packages/osd-optimizer/src/optimizer/optimizer_config.ts +++ b/packages/osd-optimizer/src/optimizer/optimizer_config.ts @@ -96,6 +96,8 @@ interface Options { /** set to true to inspecting workers when the parent process is being inspected */ inspectWorkers?: boolean; + /** include extra plugins in default scan dirs */ + extraPlugins?: boolean; /** include examples in default scan dirs */ examples?: boolean; /** absolute paths to specific plugins that should be built */ @@ -153,6 +155,7 @@ export class OptimizerConfig { static parseOptions(options: Options): ParsedOptions { const watch = !!options.watch; const dist = !!options.dist; + const extraPlugins = !!options.extraPlugins; const examples = !!options.examples; const profileWebpack = !!options.profileWebpack; const inspectWorkers = !!options.inspectWorkers; @@ -178,6 +181,7 @@ export class OptimizerConfig { const pluginScanDirs = options.pluginScanDirs || [ Path.resolve(repoRoot, 'src/plugins'), Path.resolve(repoRoot, 'plugins'), + ...(extraPlugins ? [Path.resolve('plugins-extra')] : []), ...(examples ? [Path.resolve('examples')] : []), Path.resolve(repoRoot, 'opensearch-dashboards-extra'), ]; diff --git a/packages/osd-plugin-generator/src/ask_questions.ts b/packages/osd-plugin-generator/src/ask_questions.ts index 785d95ca4903..b1ff3f105540 100644 --- a/packages/osd-plugin-generator/src/ask_questions.ts +++ b/packages/osd-plugin-generator/src/ask_questions.ts @@ -42,6 +42,10 @@ export interface Answers { } export const INTERNAL_PLUGIN_LOCATIONS: Array<{ name: string; value: string }> = [ + { + name: 'OpenSearch Dashboards Extra', + value: Path.resolve(REPO_ROOT, 'plugins-extra'), + }, { name: 'OpenSearch Dashboards Example', value: Path.resolve(REPO_ROOT, 'examples'), diff --git a/packages/osd-plugin-generator/src/plugin_types.ts b/packages/osd-plugin-generator/src/plugin_types.ts index c2059fb70988..6eef69ec9475 100644 --- a/packages/osd-plugin-generator/src/plugin_types.ts +++ b/packages/osd-plugin-generator/src/plugin_types.ts @@ -42,6 +42,10 @@ export const PLUGIN_TYPE_OPTIONS: Array<{ name: string; value: PluginType }> = [ name: 'Installable plugin', value: { thirdParty: true, installDir: Path.resolve(REPO_ROOT, 'plugins') }, }, + { + name: 'OpenSearch Dashboards Extra', + value: { thirdParty: false, installDir: Path.resolve(REPO_ROOT, 'plugins-extra') }, + }, { name: 'OpenSearch Dashboards Example', value: { thirdParty: false, installDir: Path.resolve(REPO_ROOT, 'examples') }, diff --git a/packages/osd-plugin-helpers/src/load_opensearch_dashboards_platform_plugin.ts b/packages/osd-plugin-helpers/src/load_opensearch_dashboards_platform_plugin.ts index 3079b57fc975..5a5a067f5baf 100644 --- a/packages/osd-plugin-helpers/src/load_opensearch_dashboards_platform_plugin.ts +++ b/packages/osd-plugin-helpers/src/load_opensearch_dashboards_platform_plugin.ts @@ -43,10 +43,11 @@ export function loadOpenSearchDashboardsPlatformPlugin(pluginDir: string) { const parentDir = Path.resolve(pluginDir, '..'); const isFixture = pluginDir.includes('__fixtures__'); + const isExtra = Path.basename(parentDir) === 'plugins-extra'; const isExample = Path.basename(parentDir) === 'examples'; const isRootPlugin = parentDir === Path.resolve(REPO_ROOT, 'plugins'); - if (isFixture || isExample || isRootPlugin) { + if (isFixture || isExtra || isExample || isRootPlugin) { return parseOpenSearchDashboardsPlatformPlugin( Path.resolve(pluginDir, 'opensearch_dashboards.json') ); diff --git a/packages/osd-pm/dist/index.js b/packages/osd-pm/dist/index.js index 0301d50fdb26..e665054143c1 100644 --- a/packages/osd-pm/dist/index.js +++ b/packages/osd-pm/dist/index.js @@ -735,245 +735,245 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} /***/ }), @@ -1653,224 +1653,224 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __createBinding(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -} - -function __exportStar(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); -} - -function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} /***/ }), @@ -8252,158 +8252,158 @@ convert.rgb.gray = function (rgb) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; /***/ }), @@ -10741,58 +10741,58 @@ mkdirP.sync = function sync (p, opts, made) { /* 142 */ /***/ (function(module, exports) { -exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair -exports.convertToSetCommand = convertToSetCommand -exports.convertToSetCommands = convertToSetCommands - -function convertToSetCommand(key, value) { - var line = "" - key = key || "" - key = key.trim() - value = value || "" - value = value.trim() - if(key && value && value.length > 0) { - line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n" - } - return line -} - -function extractVariableValuePairs(declarations) { - var pairs = {} - declarations.map(function(declaration) { - var split = declaration.split("=") - pairs[split[0]]=split[1] - }) - return pairs -} - -function convertToSetCommands(variableString) { - var variableValuePairs = extractVariableValuePairs(variableString.split(" ")) - var variableDeclarationsAsBatch = "" - Object.keys(variableValuePairs).forEach(function (key) { - variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key]) - }) - return variableDeclarationsAsBatch -} - -function replaceDollarWithPercentPair(value) { - var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g - var result = "" - var startIndex = 0 - value = value || "" - do { - var match = dollarExpressions.exec(value) - if(match) { - var betweenMatches = value.substring(startIndex, match.index) || "" - result += betweenMatches + "%" + match[1] + "%" - startIndex = dollarExpressions.lastIndex - } - } while (dollarExpressions.lastIndex > 0) - result += value.substr(startIndex) - return result -} - - +exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair +exports.convertToSetCommand = convertToSetCommand +exports.convertToSetCommands = convertToSetCommands + +function convertToSetCommand(key, value) { + var line = "" + key = key || "" + key = key.trim() + value = value || "" + value = value.trim() + if(key && value && value.length > 0) { + line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n" + } + return line +} + +function extractVariableValuePairs(declarations) { + var pairs = {} + declarations.map(function(declaration) { + var split = declaration.split("=") + pairs[split[0]]=split[1] + }) + return pairs +} + +function convertToSetCommands(variableString) { + var variableValuePairs = extractVariableValuePairs(variableString.split(" ")) + var variableDeclarationsAsBatch = "" + Object.keys(variableValuePairs).forEach(function (key) { + variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key]) + }) + return variableDeclarationsAsBatch +} + +function replaceDollarWithPercentPair(value) { + var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g + var result = "" + var startIndex = 0 + value = value || "" + do { + var match = dollarExpressions.exec(value) + if(match) { + var betweenMatches = value.substring(startIndex, match.index) || "" + result += betweenMatches + "%" + match[1] + "%" + startIndex = dollarExpressions.lastIndex + } + } while (dollarExpressions.lastIndex > 0) + result += value.substr(startIndex) + return result +} + + /***/ }), @@ -17556,158 +17556,158 @@ convert.rgb.gray = function (rgb) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; /***/ }), @@ -28902,6 +28902,7 @@ function getProjectPaths({ projectPaths.push((0, _path.resolve)(rootPath, 'test/interpreter_functional/plugins/*')); projectPaths.push((0, _path.resolve)(rootPath, 'examples/*')); if (!skipOpenSearchDashboardsPlugins) { + projectPaths.push((0, _path.resolve)(rootPath, 'plugins-extra/*')); projectPaths.push((0, _path.resolve)(rootPath, '../opensearch-dashboards-extra/*')); projectPaths.push((0, _path.resolve)(rootPath, '../opensearch-dashboards-extra/*/packages/*')); projectPaths.push((0, _path.resolve)(rootPath, '../opensearch-dashboards-extra/*/plugins/*')); @@ -58954,77 +58955,77 @@ module.exports.generateTasks = pkg.generateTasks; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var optionsManager = __webpack_require__(572); -var taskManager = __webpack_require__(573); -var reader_async_1 = __webpack_require__(712); -var reader_stream_1 = __webpack_require__(736); -var reader_sync_1 = __webpack_require__(737); -var arrayUtils = __webpack_require__(739); -var streamUtils = __webpack_require__(740); -/** - * Synchronous API. - */ -function sync(source, opts) { - assertPatternsInput(source); - var works = getWorks(source, reader_sync_1.default, opts); - return arrayUtils.flatten(works); -} -exports.sync = sync; -/** - * Asynchronous API. - */ -function async(source, opts) { - try { - assertPatternsInput(source); - } - catch (error) { - return Promise.reject(error); - } - var works = getWorks(source, reader_async_1.default, opts); - return Promise.all(works).then(arrayUtils.flatten); -} -exports.async = async; -/** - * Stream API. - */ -function stream(source, opts) { - assertPatternsInput(source); - var works = getWorks(source, reader_stream_1.default, opts); - return streamUtils.merge(works); -} -exports.stream = stream; -/** - * Return a set of tasks based on provided patterns. - */ -function generateTasks(source, opts) { - assertPatternsInput(source); - var patterns = [].concat(source); - var options = optionsManager.prepare(opts); - return taskManager.generate(patterns, options); -} -exports.generateTasks = generateTasks; -/** - * Returns a set of works based on provided tasks and class of the reader. - */ -function getWorks(source, _Reader, opts) { - var patterns = [].concat(source); - var options = optionsManager.prepare(opts); - var tasks = taskManager.generate(patterns, options); - var reader = new _Reader(options); - return tasks.map(reader.read, reader); -} -function assertPatternsInput(source) { - if ([].concat(source).every(isString)) { - return; - } - throw new TypeError('Patterns must be a string or an array of strings'); -} -function isString(source) { - /* tslint:disable-next-line strict-type-predicates */ - return typeof source === 'string'; -} + +Object.defineProperty(exports, "__esModule", { value: true }); +var optionsManager = __webpack_require__(572); +var taskManager = __webpack_require__(573); +var reader_async_1 = __webpack_require__(712); +var reader_stream_1 = __webpack_require__(736); +var reader_sync_1 = __webpack_require__(737); +var arrayUtils = __webpack_require__(739); +var streamUtils = __webpack_require__(740); +/** + * Synchronous API. + */ +function sync(source, opts) { + assertPatternsInput(source); + var works = getWorks(source, reader_sync_1.default, opts); + return arrayUtils.flatten(works); +} +exports.sync = sync; +/** + * Asynchronous API. + */ +function async(source, opts) { + try { + assertPatternsInput(source); + } + catch (error) { + return Promise.reject(error); + } + var works = getWorks(source, reader_async_1.default, opts); + return Promise.all(works).then(arrayUtils.flatten); +} +exports.async = async; +/** + * Stream API. + */ +function stream(source, opts) { + assertPatternsInput(source); + var works = getWorks(source, reader_stream_1.default, opts); + return streamUtils.merge(works); +} +exports.stream = stream; +/** + * Return a set of tasks based on provided patterns. + */ +function generateTasks(source, opts) { + assertPatternsInput(source); + var patterns = [].concat(source); + var options = optionsManager.prepare(opts); + return taskManager.generate(patterns, options); +} +exports.generateTasks = generateTasks; +/** + * Returns a set of works based on provided tasks and class of the reader. + */ +function getWorks(source, _Reader, opts) { + var patterns = [].concat(source); + var options = optionsManager.prepare(opts); + var tasks = taskManager.generate(patterns, options); + var reader = new _Reader(options); + return tasks.map(reader.read, reader); +} +function assertPatternsInput(source) { + if ([].concat(source).every(isString)) { + return; + } + throw new TypeError('Patterns must be a string or an array of strings'); +} +function isString(source) { + /* tslint:disable-next-line strict-type-predicates */ + return typeof source === 'string'; +} /***/ }), @@ -59032,37 +59033,37 @@ function isString(source) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -function prepare(options) { - var opts = __assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, brace: true, noglobstar: false, globstar: true, noext: false, extension: true, nocase: false, case: true, matchBase: false, transform: null }, options); - if (opts.onlyDirectories) { - opts.onlyFiles = false; - } - opts.brace = !opts.nobrace; - opts.globstar = !opts.noglobstar; - opts.extension = !opts.noext; - opts.case = !opts.nocase; - if (options) { - opts.brace = ('brace' in options ? options.brace : opts.brace); - opts.globstar = ('globstar' in options ? options.globstar : opts.globstar); - opts.extension = ('extension' in options ? options.extension : opts.extension); - opts.case = ('case' in options ? options.case : opts.case); - } - return opts; -} -exports.prepare = prepare; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +function prepare(options) { + var opts = __assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, brace: true, noglobstar: false, globstar: true, noext: false, extension: true, nocase: false, case: true, matchBase: false, transform: null }, options); + if (opts.onlyDirectories) { + opts.onlyFiles = false; + } + opts.brace = !opts.nobrace; + opts.globstar = !opts.noglobstar; + opts.extension = !opts.noext; + opts.case = !opts.nocase; + if (options) { + opts.brace = ('brace' in options ? options.brace : opts.brace); + opts.globstar = ('globstar' in options ? options.globstar : opts.globstar); + opts.extension = ('extension' in options ? options.extension : opts.extension); + opts.case = ('case' in options ? options.case : opts.case); + } + return opts; +} +exports.prepare = prepare; /***/ }), @@ -59070,96 +59071,96 @@ exports.prepare = prepare; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var patternUtils = __webpack_require__(574); -/** - * Generate tasks based on parent directory of each pattern. - */ -function generate(patterns, options) { - var unixPatterns = patterns.map(patternUtils.unixifyPattern); - var unixIgnore = options.ignore.map(patternUtils.unixifyPattern); - var positivePatterns = getPositivePatterns(unixPatterns); - var negativePatterns = getNegativePatternsAsPositive(unixPatterns, unixIgnore); - /** - * When the `case` option is disabled, all patterns must be marked as dynamic, because we cannot check filepath - * directly (without read directory). - */ - var staticPatterns = !options.case ? [] : positivePatterns.filter(patternUtils.isStaticPattern); - var dynamicPatterns = !options.case ? positivePatterns : positivePatterns.filter(patternUtils.isDynamicPattern); - var staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - var dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); -} -exports.generate = generate; -/** - * Convert patterns to tasks based on parent directory of each pattern. - */ -function convertPatternsToTasks(positive, negative, dynamic) { - var positivePatternsGroup = groupPatternsByBaseDirectory(positive); - // When we have a global group – there is no reason to divide the patterns into independent tasks. - // In this case, the global task covers the rest. - if ('.' in positivePatternsGroup) { - var task = convertPatternGroupToTask('.', positive, negative, dynamic); - return [task]; - } - return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic); -} -exports.convertPatternsToTasks = convertPatternsToTasks; -/** - * Return only positive patterns. - */ -function getPositivePatterns(patterns) { - return patternUtils.getPositivePatterns(patterns); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Return only negative patterns. - */ -function getNegativePatternsAsPositive(patterns, ignore) { - var negative = patternUtils.getNegativePatterns(patterns).concat(ignore); - var positive = negative.map(patternUtils.convertToPositivePattern); - return positive; -} -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -/** - * Group patterns by base directory of each pattern. - */ -function groupPatternsByBaseDirectory(patterns) { - return patterns.reduce(function (collection, pattern) { - var base = patternUtils.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, {}); -} -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -/** - * Convert group of patterns to tasks. - */ -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map(function (base) { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -/** - * Create a task for positive and negative patterns. - */ -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - base: base, - dynamic: dynamic, - positive: positive, - negative: negative, - patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern)) - }; -} -exports.convertPatternGroupToTask = convertPatternGroupToTask; + +Object.defineProperty(exports, "__esModule", { value: true }); +var patternUtils = __webpack_require__(574); +/** + * Generate tasks based on parent directory of each pattern. + */ +function generate(patterns, options) { + var unixPatterns = patterns.map(patternUtils.unixifyPattern); + var unixIgnore = options.ignore.map(patternUtils.unixifyPattern); + var positivePatterns = getPositivePatterns(unixPatterns); + var negativePatterns = getNegativePatternsAsPositive(unixPatterns, unixIgnore); + /** + * When the `case` option is disabled, all patterns must be marked as dynamic, because we cannot check filepath + * directly (without read directory). + */ + var staticPatterns = !options.case ? [] : positivePatterns.filter(patternUtils.isStaticPattern); + var dynamicPatterns = !options.case ? positivePatterns : positivePatterns.filter(patternUtils.isDynamicPattern); + var staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + var dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +exports.generate = generate; +/** + * Convert patterns to tasks based on parent directory of each pattern. + */ +function convertPatternsToTasks(positive, negative, dynamic) { + var positivePatternsGroup = groupPatternsByBaseDirectory(positive); + // When we have a global group – there is no reason to divide the patterns into independent tasks. + // In this case, the global task covers the rest. + if ('.' in positivePatternsGroup) { + var task = convertPatternGroupToTask('.', positive, negative, dynamic); + return [task]; + } + return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic); +} +exports.convertPatternsToTasks = convertPatternsToTasks; +/** + * Return only positive patterns. + */ +function getPositivePatterns(patterns) { + return patternUtils.getPositivePatterns(patterns); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Return only negative patterns. + */ +function getNegativePatternsAsPositive(patterns, ignore) { + var negative = patternUtils.getNegativePatterns(patterns).concat(ignore); + var positive = negative.map(patternUtils.convertToPositivePattern); + return positive; +} +exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +/** + * Group patterns by base directory of each pattern. + */ +function groupPatternsByBaseDirectory(patterns) { + return patterns.reduce(function (collection, pattern) { + var base = patternUtils.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, {}); +} +exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +/** + * Convert group of patterns to tasks. + */ +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map(function (base) { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +/** + * Create a task for positive and negative patterns. + */ +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + base: base, + dynamic: dynamic, + positive: positive, + negative: negative, + patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern)) + }; +} +exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), @@ -59167,154 +59168,154 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -var globParent = __webpack_require__(358); -var isGlob = __webpack_require__(359); -var micromatch = __webpack_require__(575); -var GLOBSTAR = '**'; -/** - * Return true for static pattern. - */ -function isStaticPattern(pattern) { - return !isDynamicPattern(pattern); -} -exports.isStaticPattern = isStaticPattern; -/** - * Return true for pattern that looks like glob. - */ -function isDynamicPattern(pattern) { - return isGlob(pattern, { strict: false }); -} -exports.isDynamicPattern = isDynamicPattern; -/** - * Convert a windows «path» to a unix-style «path». - */ -function unixifyPattern(pattern) { - return pattern.replace(/\\/g, '/'); -} -exports.unixifyPattern = unixifyPattern; -/** - * Returns negative pattern as positive pattern. - */ -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -/** - * Returns positive pattern as negative pattern. - */ -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -/** - * Return true if provided pattern is negative pattern. - */ -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -/** - * Return true if provided pattern is positive pattern. - */ -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -/** - * Extracts negative patterns from array of patterns. - */ -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -/** - * Extracts positive patterns from array of patterns. - */ -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Extract base directory from provided pattern. - */ -function getBaseDirectory(pattern) { - return globParent(pattern); -} -exports.getBaseDirectory = getBaseDirectory; -/** - * Return true if provided pattern has globstar. - */ -function hasGlobStar(pattern) { - return pattern.indexOf(GLOBSTAR) !== -1; -} -exports.hasGlobStar = hasGlobStar; -/** - * Return true if provided pattern ends with slash and globstar. - */ -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -/** - * Returns «true» when pattern ends with a slash and globstar or the last partial of the pattern is static pattern. - */ -function isAffectDepthOfReadingPattern(pattern) { - var basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -/** - * Return naive depth of provided pattern without depth of the base directory. - */ -function getNaiveDepth(pattern) { - var base = getBaseDirectory(pattern); - var patternDepth = pattern.split('/').length; - var patternBaseDepth = base.split('/').length; - /** - * This is a hack for pattern that has no base directory. - * - * This is related to the `*\something\*` pattern. - */ - if (base === '.') { - return patternDepth - patternBaseDepth; - } - return patternDepth - patternBaseDepth - 1; -} -exports.getNaiveDepth = getNaiveDepth; -/** - * Return max naive depth of provided patterns without depth of the base directory. - */ -function getMaxNaivePatternsDepth(patterns) { - return patterns.reduce(function (max, pattern) { - var depth = getNaiveDepth(pattern); - return depth > max ? depth : max; - }, 0); -} -exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth; -/** - * Make RegExp for provided pattern. - */ -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -/** - * Convert patterns to regexps. - */ -function convertPatternsToRe(patterns, options) { - return patterns.map(function (pattern) { return makeRe(pattern, options); }); -} -exports.convertPatternsToRe = convertPatternsToRe; -/** - * Returns true if the entry match any of the given RegExp's. - */ -function matchAny(entry, patternsRe) { - return patternsRe.some(function (patternRe) { return patternRe.test(entry); }); -} -exports.matchAny = matchAny; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +var globParent = __webpack_require__(358); +var isGlob = __webpack_require__(359); +var micromatch = __webpack_require__(575); +var GLOBSTAR = '**'; +/** + * Return true for static pattern. + */ +function isStaticPattern(pattern) { + return !isDynamicPattern(pattern); +} +exports.isStaticPattern = isStaticPattern; +/** + * Return true for pattern that looks like glob. + */ +function isDynamicPattern(pattern) { + return isGlob(pattern, { strict: false }); +} +exports.isDynamicPattern = isDynamicPattern; +/** + * Convert a windows «path» to a unix-style «path». + */ +function unixifyPattern(pattern) { + return pattern.replace(/\\/g, '/'); +} +exports.unixifyPattern = unixifyPattern; +/** + * Returns negative pattern as positive pattern. + */ +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; +} +exports.convertToPositivePattern = convertToPositivePattern; +/** + * Returns positive pattern as negative pattern. + */ +function convertToNegativePattern(pattern) { + return '!' + pattern; +} +exports.convertToNegativePattern = convertToNegativePattern; +/** + * Return true if provided pattern is negative pattern. + */ +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +exports.isNegativePattern = isNegativePattern; +/** + * Return true if provided pattern is positive pattern. + */ +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +exports.isPositivePattern = isPositivePattern; +/** + * Extracts negative patterns from array of patterns. + */ +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +exports.getNegativePatterns = getNegativePatterns; +/** + * Extracts positive patterns from array of patterns. + */ +function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Extract base directory from provided pattern. + */ +function getBaseDirectory(pattern) { + return globParent(pattern); +} +exports.getBaseDirectory = getBaseDirectory; +/** + * Return true if provided pattern has globstar. + */ +function hasGlobStar(pattern) { + return pattern.indexOf(GLOBSTAR) !== -1; +} +exports.hasGlobStar = hasGlobStar; +/** + * Return true if provided pattern ends with slash and globstar. + */ +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR); +} +exports.endsWithSlashGlobStar = endsWithSlashGlobStar; +/** + * Returns «true» when pattern ends with a slash and globstar or the last partial of the pattern is static pattern. + */ +function isAffectDepthOfReadingPattern(pattern) { + var basename = path.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +/** + * Return naive depth of provided pattern without depth of the base directory. + */ +function getNaiveDepth(pattern) { + var base = getBaseDirectory(pattern); + var patternDepth = pattern.split('/').length; + var patternBaseDepth = base.split('/').length; + /** + * This is a hack for pattern that has no base directory. + * + * This is related to the `*\something\*` pattern. + */ + if (base === '.') { + return patternDepth - patternBaseDepth; + } + return patternDepth - patternBaseDepth - 1; +} +exports.getNaiveDepth = getNaiveDepth; +/** + * Return max naive depth of provided patterns without depth of the base directory. + */ +function getMaxNaivePatternsDepth(patterns) { + return patterns.reduce(function (max, pattern) { + var depth = getNaiveDepth(pattern); + return depth > max ? depth : max; + }, 0); +} +exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth; +/** + * Make RegExp for provided pattern. + */ +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +exports.makeRe = makeRe; +/** + * Convert patterns to regexps. + */ +function convertPatternsToRe(patterns, options) { + return patterns.map(function (pattern) { return makeRe(pattern, options); }); +} +exports.convertPatternsToRe = convertPatternsToRe; +/** + * Returns true if the entry match any of the given RegExp's. + */ +function matchAny(entry, patternsRe) { + return patternsRe.some(function (patternRe) { return patternRe.test(entry); }); +} +exports.matchAny = matchAny; /***/ }), @@ -66508,181 +66509,181 @@ module.exports.namespace = namespace; /* 617 */ /***/ (function(module, exports, __webpack_require__) { - -/** - * Expose `Emitter`. - */ - -if (true) { - module.exports = Emitter; -} - -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -function Emitter(obj) { - if (obj) return mixin(obj); -}; - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - - // Remove event specific arrays for event types that no - // one is subscribed for to avoid memory leak. - if (callbacks.length === 0) { - delete this._callbacks['$' + event]; - } - - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - - var args = new Array(arguments.length - 1) - , callbacks = this._callbacks['$' + event]; - - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; + +/** + * Expose `Emitter`. + */ + +if (true) { + module.exports = Emitter; +} + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = +Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = +Emitter.prototype.removeListener = +Emitter.prototype.removeAllListeners = +Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + + // Remove event specific arrays for event types that no + // one is subscribed for to avoid memory leak. + if (callbacks.length === 0) { + delete this._callbacks['$' + event]; + } + + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + + var args = new Array(arguments.length - 1) + , callbacks = this._callbacks['$' + event]; + + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; /***/ }), @@ -73501,23 +73502,23 @@ module.exports = function (encodedURI) { /* 673 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2014 Simon Lydell -// X11 (“MIT”) Licensed. (See LICENSE.) - -var path = __webpack_require__(4) - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix +// Copyright 2014 Simon Lydell +// X11 (“MIT”) Licensed. (See LICENSE.) + +var path = __webpack_require__(4) + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix /***/ }), @@ -79573,81 +79574,81 @@ module.exports = function defineProperty(obj, key, val) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var readdir = __webpack_require__(713); -var reader_1 = __webpack_require__(726); -var fs_stream_1 = __webpack_require__(730); -var ReaderAsync = /** @class */ (function (_super) { - __extends(ReaderAsync, _super); - function ReaderAsync() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ReaderAsync.prototype, "fsAdapter", { - /** - * Returns FileSystem adapter. - */ - get: function () { - return new fs_stream_1.default(this.options); - }, - enumerable: true, - configurable: true - }); - /** - * Use async API to read entries for Task. - */ - ReaderAsync.prototype.read = function (task) { - var _this = this; - var root = this.getRootDirectory(task); - var options = this.getReaderOptions(task); - var entries = []; - return new Promise(function (resolve, reject) { - var stream = _this.api(root, task, options); - stream.on('error', function (err) { - _this.isEnoentCodeError(err) ? resolve([]) : reject(err); - stream.pause(); - }); - stream.on('data', function (entry) { return entries.push(_this.transform(entry)); }); - stream.on('end', function () { return resolve(entries); }); - }); - }; - /** - * Returns founded paths. - */ - ReaderAsync.prototype.api = function (root, task, options) { - if (task.dynamic) { - return this.dynamicApi(root, options); - } - return this.staticApi(task, options); - }; - /** - * Api for dynamic tasks. - */ - ReaderAsync.prototype.dynamicApi = function (root, options) { - return readdir.readdirStreamStat(root, options); - }; - /** - * Api for static tasks. - */ - ReaderAsync.prototype.staticApi = function (task, options) { - return this.fsAdapter.read(task.patterns, options.filter); - }; - return ReaderAsync; -}(reader_1.default)); -exports.default = ReaderAsync; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var readdir = __webpack_require__(713); +var reader_1 = __webpack_require__(726); +var fs_stream_1 = __webpack_require__(730); +var ReaderAsync = /** @class */ (function (_super) { + __extends(ReaderAsync, _super); + function ReaderAsync() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderAsync.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_stream_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use async API to read entries for Task. + */ + ReaderAsync.prototype.read = function (task) { + var _this = this; + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + var entries = []; + return new Promise(function (resolve, reject) { + var stream = _this.api(root, task, options); + stream.on('error', function (err) { + _this.isEnoentCodeError(err) ? resolve([]) : reject(err); + stream.pause(); + }); + stream.on('data', function (entry) { return entries.push(_this.transform(entry)); }); + stream.on('end', function () { return resolve(entries); }); + }); + }; + /** + * Returns founded paths. + */ + ReaderAsync.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderAsync.prototype.dynamicApi = function (root, options) { + return readdir.readdirStreamStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderAsync.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderAsync; +}(reader_1.default)); +exports.default = ReaderAsync; /***/ }), @@ -80888,74 +80889,74 @@ function readdirStream (dir, options, internalOptions) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -var deep_1 = __webpack_require__(727); -var entry_1 = __webpack_require__(729); -var pathUtil = __webpack_require__(728); -var Reader = /** @class */ (function () { - function Reader(options) { - this.options = options; - this.micromatchOptions = this.getMicromatchOptions(); - this.entryFilter = new entry_1.default(options, this.micromatchOptions); - this.deepFilter = new deep_1.default(options, this.micromatchOptions); - } - /** - * Returns root path to scanner. - */ - Reader.prototype.getRootDirectory = function (task) { - return path.resolve(this.options.cwd, task.base); - }; - /** - * Returns options for reader. - */ - Reader.prototype.getReaderOptions = function (task) { - return { - basePath: task.base === '.' ? '' : task.base, - filter: this.entryFilter.getFilter(task.positive, task.negative), - deep: this.deepFilter.getFilter(task.positive, task.negative), - sep: '/' - }; - }; - /** - * Returns options for micromatch. - */ - Reader.prototype.getMicromatchOptions = function () { - return { - dot: this.options.dot, - nobrace: !this.options.brace, - noglobstar: !this.options.globstar, - noext: !this.options.extension, - nocase: !this.options.case, - matchBase: this.options.matchBase - }; - }; - /** - * Returns transformed entry. - */ - Reader.prototype.transform = function (entry) { - if (this.options.absolute) { - entry.path = pathUtil.makeAbsolute(this.options.cwd, entry.path); - } - if (this.options.markDirectories && entry.isDirectory()) { - entry.path += '/'; - } - var item = this.options.stats ? entry : entry.path; - if (this.options.transform === null) { - return item; - } - return this.options.transform(item); - }; - /** - * Returns true if error has ENOENT code. - */ - Reader.prototype.isEnoentCodeError = function (err) { - return err.code === 'ENOENT'; - }; - return Reader; -}()); -exports.default = Reader; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +var deep_1 = __webpack_require__(727); +var entry_1 = __webpack_require__(729); +var pathUtil = __webpack_require__(728); +var Reader = /** @class */ (function () { + function Reader(options) { + this.options = options; + this.micromatchOptions = this.getMicromatchOptions(); + this.entryFilter = new entry_1.default(options, this.micromatchOptions); + this.deepFilter = new deep_1.default(options, this.micromatchOptions); + } + /** + * Returns root path to scanner. + */ + Reader.prototype.getRootDirectory = function (task) { + return path.resolve(this.options.cwd, task.base); + }; + /** + * Returns options for reader. + */ + Reader.prototype.getReaderOptions = function (task) { + return { + basePath: task.base === '.' ? '' : task.base, + filter: this.entryFilter.getFilter(task.positive, task.negative), + deep: this.deepFilter.getFilter(task.positive, task.negative), + sep: '/' + }; + }; + /** + * Returns options for micromatch. + */ + Reader.prototype.getMicromatchOptions = function () { + return { + dot: this.options.dot, + nobrace: !this.options.brace, + noglobstar: !this.options.globstar, + noext: !this.options.extension, + nocase: !this.options.case, + matchBase: this.options.matchBase + }; + }; + /** + * Returns transformed entry. + */ + Reader.prototype.transform = function (entry) { + if (this.options.absolute) { + entry.path = pathUtil.makeAbsolute(this.options.cwd, entry.path); + } + if (this.options.markDirectories && entry.isDirectory()) { + entry.path += '/'; + } + var item = this.options.stats ? entry : entry.path; + if (this.options.transform === null) { + return item; + } + return this.options.transform(item); + }; + /** + * Returns true if error has ENOENT code. + */ + Reader.prototype.isEnoentCodeError = function (err) { + return err.code === 'ENOENT'; + }; + return Reader; +}()); +exports.default = Reader; /***/ }), @@ -80963,89 +80964,89 @@ exports.default = Reader; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var pathUtils = __webpack_require__(728); -var patternUtils = __webpack_require__(574); -var DeepFilter = /** @class */ (function () { - function DeepFilter(options, micromatchOptions) { - this.options = options; - this.micromatchOptions = micromatchOptions; - } - /** - * Returns filter for directories. - */ - DeepFilter.prototype.getFilter = function (positive, negative) { - var _this = this; - var maxPatternDepth = this.getMaxPatternDepth(positive); - var negativeRe = this.getNegativePatternsRe(negative); - return function (entry) { return _this.filter(entry, negativeRe, maxPatternDepth); }; - }; - /** - * Returns max depth of the provided patterns. - */ - DeepFilter.prototype.getMaxPatternDepth = function (patterns) { - var globstar = patterns.some(patternUtils.hasGlobStar); - return globstar ? Infinity : patternUtils.getMaxNaivePatternsDepth(patterns); - }; - /** - * Returns RegExp's for patterns that can affect the depth of reading. - */ - DeepFilter.prototype.getNegativePatternsRe = function (patterns) { - var affectDepthOfReadingPatterns = patterns.filter(patternUtils.isAffectDepthOfReadingPattern); - return patternUtils.convertPatternsToRe(affectDepthOfReadingPatterns, this.micromatchOptions); - }; - /** - * Returns «true» for directory that should be read. - */ - DeepFilter.prototype.filter = function (entry, negativeRe, maxPatternDepth) { - if (this.isSkippedByDeepOption(entry.depth)) { - return false; - } - if (this.isSkippedByMaxPatternDepth(entry.depth, maxPatternDepth)) { - return false; - } - if (this.isSkippedSymlinkedDirectory(entry)) { - return false; - } - if (this.isSkippedDotDirectory(entry)) { - return false; - } - return this.isSkippedByNegativePatterns(entry, negativeRe); - }; - /** - * Returns «true» when the «deep» option is disabled or number and depth of the entry is greater that the option value. - */ - DeepFilter.prototype.isSkippedByDeepOption = function (entryDepth) { - return !this.options.deep || (typeof this.options.deep === 'number' && entryDepth >= this.options.deep); - }; - /** - * Returns «true» when depth parameter is not an Infinity and entry depth greater that the parameter value. - */ - DeepFilter.prototype.isSkippedByMaxPatternDepth = function (entryDepth, maxPatternDepth) { - return maxPatternDepth !== Infinity && entryDepth >= maxPatternDepth; - }; - /** - * Returns «true» for symlinked directory if the «followSymlinkedDirectories» option is disabled. - */ - DeepFilter.prototype.isSkippedSymlinkedDirectory = function (entry) { - return !this.options.followSymlinkedDirectories && entry.isSymbolicLink(); - }; - /** - * Returns «true» for a directory whose name starts with a period if «dot» option is disabled. - */ - DeepFilter.prototype.isSkippedDotDirectory = function (entry) { - return !this.options.dot && pathUtils.isDotDirectory(entry.path); - }; - /** - * Returns «true» for a directory whose path math to any negative pattern. - */ - DeepFilter.prototype.isSkippedByNegativePatterns = function (entry, negativeRe) { - return !patternUtils.matchAny(entry.path, negativeRe); - }; - return DeepFilter; -}()); -exports.default = DeepFilter; + +Object.defineProperty(exports, "__esModule", { value: true }); +var pathUtils = __webpack_require__(728); +var patternUtils = __webpack_require__(574); +var DeepFilter = /** @class */ (function () { + function DeepFilter(options, micromatchOptions) { + this.options = options; + this.micromatchOptions = micromatchOptions; + } + /** + * Returns filter for directories. + */ + DeepFilter.prototype.getFilter = function (positive, negative) { + var _this = this; + var maxPatternDepth = this.getMaxPatternDepth(positive); + var negativeRe = this.getNegativePatternsRe(negative); + return function (entry) { return _this.filter(entry, negativeRe, maxPatternDepth); }; + }; + /** + * Returns max depth of the provided patterns. + */ + DeepFilter.prototype.getMaxPatternDepth = function (patterns) { + var globstar = patterns.some(patternUtils.hasGlobStar); + return globstar ? Infinity : patternUtils.getMaxNaivePatternsDepth(patterns); + }; + /** + * Returns RegExp's for patterns that can affect the depth of reading. + */ + DeepFilter.prototype.getNegativePatternsRe = function (patterns) { + var affectDepthOfReadingPatterns = patterns.filter(patternUtils.isAffectDepthOfReadingPattern); + return patternUtils.convertPatternsToRe(affectDepthOfReadingPatterns, this.micromatchOptions); + }; + /** + * Returns «true» for directory that should be read. + */ + DeepFilter.prototype.filter = function (entry, negativeRe, maxPatternDepth) { + if (this.isSkippedByDeepOption(entry.depth)) { + return false; + } + if (this.isSkippedByMaxPatternDepth(entry.depth, maxPatternDepth)) { + return false; + } + if (this.isSkippedSymlinkedDirectory(entry)) { + return false; + } + if (this.isSkippedDotDirectory(entry)) { + return false; + } + return this.isSkippedByNegativePatterns(entry, negativeRe); + }; + /** + * Returns «true» when the «deep» option is disabled or number and depth of the entry is greater that the option value. + */ + DeepFilter.prototype.isSkippedByDeepOption = function (entryDepth) { + return !this.options.deep || (typeof this.options.deep === 'number' && entryDepth >= this.options.deep); + }; + /** + * Returns «true» when depth parameter is not an Infinity and entry depth greater that the parameter value. + */ + DeepFilter.prototype.isSkippedByMaxPatternDepth = function (entryDepth, maxPatternDepth) { + return maxPatternDepth !== Infinity && entryDepth >= maxPatternDepth; + }; + /** + * Returns «true» for symlinked directory if the «followSymlinkedDirectories» option is disabled. + */ + DeepFilter.prototype.isSkippedSymlinkedDirectory = function (entry) { + return !this.options.followSymlinkedDirectories && entry.isSymbolicLink(); + }; + /** + * Returns «true» for a directory whose name starts with a period if «dot» option is disabled. + */ + DeepFilter.prototype.isSkippedDotDirectory = function (entry) { + return !this.options.dot && pathUtils.isDotDirectory(entry.path); + }; + /** + * Returns «true» for a directory whose path math to any negative pattern. + */ + DeepFilter.prototype.isSkippedByNegativePatterns = function (entry, negativeRe) { + return !patternUtils.matchAny(entry.path, negativeRe); + }; + return DeepFilter; +}()); +exports.default = DeepFilter; /***/ }), @@ -81053,30 +81054,30 @@ exports.default = DeepFilter; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -/** - * Returns «true» if the last partial of the path starting with a period. - */ -function isDotDirectory(filepath) { - return path.basename(filepath).startsWith('.'); -} -exports.isDotDirectory = isDotDirectory; -/** - * Convert a windows-like path to a unix-style path. - */ -function normalize(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.normalize = normalize; -/** - * Returns normalized absolute path of provided filepath. - */ -function makeAbsolute(cwd, filepath) { - return normalize(path.resolve(cwd, filepath)); -} -exports.makeAbsolute = makeAbsolute; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +/** + * Returns «true» if the last partial of the path starting with a period. + */ +function isDotDirectory(filepath) { + return path.basename(filepath).startsWith('.'); +} +exports.isDotDirectory = isDotDirectory; +/** + * Convert a windows-like path to a unix-style path. + */ +function normalize(filepath) { + return filepath.replace(/\\/g, '/'); +} +exports.normalize = normalize; +/** + * Returns normalized absolute path of provided filepath. + */ +function makeAbsolute(cwd, filepath) { + return normalize(path.resolve(cwd, filepath)); +} +exports.makeAbsolute = makeAbsolute; /***/ }), @@ -81084,91 +81085,91 @@ exports.makeAbsolute = makeAbsolute; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var pathUtils = __webpack_require__(728); -var patternUtils = __webpack_require__(574); -var EntryFilter = /** @class */ (function () { - function EntryFilter(options, micromatchOptions) { - this.options = options; - this.micromatchOptions = micromatchOptions; - this.index = new Map(); - } - /** - * Returns filter for directories. - */ - EntryFilter.prototype.getFilter = function (positive, negative) { - var _this = this; - var positiveRe = patternUtils.convertPatternsToRe(positive, this.micromatchOptions); - var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); - return function (entry) { return _this.filter(entry, positiveRe, negativeRe); }; - }; - /** - * Returns true if entry must be added to result. - */ - EntryFilter.prototype.filter = function (entry, positiveRe, negativeRe) { - // Exclude duplicate results - if (this.options.unique) { - if (this.isDuplicateEntry(entry)) { - return false; - } - this.createIndexRecord(entry); - } - // Filter files and directories by options - if (this.onlyFileFilter(entry) || this.onlyDirectoryFilter(entry)) { - return false; - } - if (this.isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) { - return false; - } - return this.isMatchToPatterns(entry.path, positiveRe) && !this.isMatchToPatterns(entry.path, negativeRe); - }; - /** - * Return true if the entry already has in the cross reader index. - */ - EntryFilter.prototype.isDuplicateEntry = function (entry) { - return this.index.has(entry.path); - }; - /** - * Create record in the cross reader index. - */ - EntryFilter.prototype.createIndexRecord = function (entry) { - this.index.set(entry.path, undefined); - }; - /** - * Returns true for non-files if the «onlyFiles» option is enabled. - */ - EntryFilter.prototype.onlyFileFilter = function (entry) { - return this.options.onlyFiles && !entry.isFile(); - }; - /** - * Returns true for non-directories if the «onlyDirectories» option is enabled. - */ - EntryFilter.prototype.onlyDirectoryFilter = function (entry) { - return this.options.onlyDirectories && !entry.isDirectory(); - }; - /** - * Return true when `absolute` option is enabled and matched to the negative patterns. - */ - EntryFilter.prototype.isSkippedByAbsoluteNegativePatterns = function (entry, negativeRe) { - if (!this.options.absolute) { - return false; - } - var fullpath = pathUtils.makeAbsolute(this.options.cwd, entry.path); - return this.isMatchToPatterns(fullpath, negativeRe); - }; - /** - * Return true when entry match to provided patterns. - * - * First, just trying to apply patterns to the path. - * Second, trying to apply patterns to the path with final slash (need to micromatch to support «directory/**» patterns). - */ - EntryFilter.prototype.isMatchToPatterns = function (filepath, patternsRe) { - return patternUtils.matchAny(filepath, patternsRe) || patternUtils.matchAny(filepath + '/', patternsRe); - }; - return EntryFilter; -}()); -exports.default = EntryFilter; + +Object.defineProperty(exports, "__esModule", { value: true }); +var pathUtils = __webpack_require__(728); +var patternUtils = __webpack_require__(574); +var EntryFilter = /** @class */ (function () { + function EntryFilter(options, micromatchOptions) { + this.options = options; + this.micromatchOptions = micromatchOptions; + this.index = new Map(); + } + /** + * Returns filter for directories. + */ + EntryFilter.prototype.getFilter = function (positive, negative) { + var _this = this; + var positiveRe = patternUtils.convertPatternsToRe(positive, this.micromatchOptions); + var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); + return function (entry) { return _this.filter(entry, positiveRe, negativeRe); }; + }; + /** + * Returns true if entry must be added to result. + */ + EntryFilter.prototype.filter = function (entry, positiveRe, negativeRe) { + // Exclude duplicate results + if (this.options.unique) { + if (this.isDuplicateEntry(entry)) { + return false; + } + this.createIndexRecord(entry); + } + // Filter files and directories by options + if (this.onlyFileFilter(entry) || this.onlyDirectoryFilter(entry)) { + return false; + } + if (this.isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) { + return false; + } + return this.isMatchToPatterns(entry.path, positiveRe) && !this.isMatchToPatterns(entry.path, negativeRe); + }; + /** + * Return true if the entry already has in the cross reader index. + */ + EntryFilter.prototype.isDuplicateEntry = function (entry) { + return this.index.has(entry.path); + }; + /** + * Create record in the cross reader index. + */ + EntryFilter.prototype.createIndexRecord = function (entry) { + this.index.set(entry.path, undefined); + }; + /** + * Returns true for non-files if the «onlyFiles» option is enabled. + */ + EntryFilter.prototype.onlyFileFilter = function (entry) { + return this.options.onlyFiles && !entry.isFile(); + }; + /** + * Returns true for non-directories if the «onlyDirectories» option is enabled. + */ + EntryFilter.prototype.onlyDirectoryFilter = function (entry) { + return this.options.onlyDirectories && !entry.isDirectory(); + }; + /** + * Return true when `absolute` option is enabled and matched to the negative patterns. + */ + EntryFilter.prototype.isSkippedByAbsoluteNegativePatterns = function (entry, negativeRe) { + if (!this.options.absolute) { + return false; + } + var fullpath = pathUtils.makeAbsolute(this.options.cwd, entry.path); + return this.isMatchToPatterns(fullpath, negativeRe); + }; + /** + * Return true when entry match to provided patterns. + * + * First, just trying to apply patterns to the path. + * Second, trying to apply patterns to the path with final slash (need to micromatch to support «directory/**» patterns). + */ + EntryFilter.prototype.isMatchToPatterns = function (filepath, patternsRe) { + return patternUtils.matchAny(filepath, patternsRe) || patternUtils.matchAny(filepath + '/', patternsRe); + }; + return EntryFilter; +}()); +exports.default = EntryFilter; /***/ }), @@ -81176,70 +81177,70 @@ exports.default = EntryFilter; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var stream = __webpack_require__(138); -var fsStat = __webpack_require__(731); -var fs_1 = __webpack_require__(735); -var FileSystemStream = /** @class */ (function (_super) { - __extends(FileSystemStream, _super); - function FileSystemStream() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Use stream API to read entries for Task. - */ - FileSystemStream.prototype.read = function (patterns, filter) { - var _this = this; - var filepaths = patterns.map(this.getFullEntryPath, this); - var transform = new stream.Transform({ objectMode: true }); - transform._transform = function (index, _enc, done) { - return _this.getEntry(filepaths[index], patterns[index]).then(function (entry) { - if (entry !== null && filter(entry)) { - transform.push(entry); - } - if (index === filepaths.length - 1) { - transform.end(); - } - done(); - }); - }; - for (var i = 0; i < filepaths.length; i++) { - transform.write(i); - } - return transform; - }; - /** - * Return entry for the provided path. - */ - FileSystemStream.prototype.getEntry = function (filepath, pattern) { - var _this = this; - return this.getStat(filepath) - .then(function (stat) { return _this.makeEntry(stat, pattern); }) - .catch(function () { return null; }); - }; - /** - * Return fs.Stats for the provided path. - */ - FileSystemStream.prototype.getStat = function (filepath) { - return fsStat.stat(filepath, { throwErrorOnBrokenSymlinks: false }); - }; - return FileSystemStream; -}(fs_1.default)); -exports.default = FileSystemStream; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var stream = __webpack_require__(138); +var fsStat = __webpack_require__(731); +var fs_1 = __webpack_require__(735); +var FileSystemStream = /** @class */ (function (_super) { + __extends(FileSystemStream, _super); + function FileSystemStream() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Use stream API to read entries for Task. + */ + FileSystemStream.prototype.read = function (patterns, filter) { + var _this = this; + var filepaths = patterns.map(this.getFullEntryPath, this); + var transform = new stream.Transform({ objectMode: true }); + transform._transform = function (index, _enc, done) { + return _this.getEntry(filepaths[index], patterns[index]).then(function (entry) { + if (entry !== null && filter(entry)) { + transform.push(entry); + } + if (index === filepaths.length - 1) { + transform.end(); + } + done(); + }); + }; + for (var i = 0; i < filepaths.length; i++) { + transform.write(i); + } + return transform; + }; + /** + * Return entry for the provided path. + */ + FileSystemStream.prototype.getEntry = function (filepath, pattern) { + var _this = this; + return this.getStat(filepath) + .then(function (stat) { return _this.makeEntry(stat, pattern); }) + .catch(function () { return null; }); + }; + /** + * Return fs.Stats for the provided path. + */ + FileSystemStream.prototype.getStat = function (filepath) { + return fsStat.stat(filepath, { throwErrorOnBrokenSymlinks: false }); + }; + return FileSystemStream; +}(fs_1.default)); +exports.default = FileSystemStream; /***/ }), @@ -81379,30 +81380,30 @@ exports.isFollowedSymlink = isFollowedSymlink; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -var FileSystem = /** @class */ (function () { - function FileSystem(options) { - this.options = options; - } - /** - * Return full path to entry. - */ - FileSystem.prototype.getFullEntryPath = function (filepath) { - return path.resolve(this.options.cwd, filepath); - }; - /** - * Return an implementation of the Entry interface. - */ - FileSystem.prototype.makeEntry = function (stat, pattern) { - stat.path = pattern; - stat.depth = pattern.split('/').length; - return stat; - }; - return FileSystem; -}()); -exports.default = FileSystem; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +var FileSystem = /** @class */ (function () { + function FileSystem(options) { + this.options = options; + } + /** + * Return full path to entry. + */ + FileSystem.prototype.getFullEntryPath = function (filepath) { + return path.resolve(this.options.cwd, filepath); + }; + /** + * Return an implementation of the Entry interface. + */ + FileSystem.prototype.makeEntry = function (stat, pattern) { + stat.path = pattern; + stat.depth = pattern.split('/').length; + return stat; + }; + return FileSystem; +}()); +exports.default = FileSystem; /***/ }), @@ -81410,89 +81411,89 @@ exports.default = FileSystem; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var stream = __webpack_require__(138); -var readdir = __webpack_require__(713); -var reader_1 = __webpack_require__(726); -var fs_stream_1 = __webpack_require__(730); -var TransformStream = /** @class */ (function (_super) { - __extends(TransformStream, _super); - function TransformStream(reader) { - var _this = _super.call(this, { objectMode: true }) || this; - _this.reader = reader; - return _this; - } - TransformStream.prototype._transform = function (entry, _encoding, callback) { - callback(null, this.reader.transform(entry)); - }; - return TransformStream; -}(stream.Transform)); -var ReaderStream = /** @class */ (function (_super) { - __extends(ReaderStream, _super); - function ReaderStream() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ReaderStream.prototype, "fsAdapter", { - /** - * Returns FileSystem adapter. - */ - get: function () { - return new fs_stream_1.default(this.options); - }, - enumerable: true, - configurable: true - }); - /** - * Use stream API to read entries for Task. - */ - ReaderStream.prototype.read = function (task) { - var _this = this; - var root = this.getRootDirectory(task); - var options = this.getReaderOptions(task); - var transform = new TransformStream(this); - var readable = this.api(root, task, options); - return readable - .on('error', function (err) { return _this.isEnoentCodeError(err) ? null : transform.emit('error', err); }) - .pipe(transform); - }; - /** - * Returns founded paths. - */ - ReaderStream.prototype.api = function (root, task, options) { - if (task.dynamic) { - return this.dynamicApi(root, options); - } - return this.staticApi(task, options); - }; - /** - * Api for dynamic tasks. - */ - ReaderStream.prototype.dynamicApi = function (root, options) { - return readdir.readdirStreamStat(root, options); - }; - /** - * Api for static tasks. - */ - ReaderStream.prototype.staticApi = function (task, options) { - return this.fsAdapter.read(task.patterns, options.filter); - }; - return ReaderStream; -}(reader_1.default)); -exports.default = ReaderStream; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var stream = __webpack_require__(138); +var readdir = __webpack_require__(713); +var reader_1 = __webpack_require__(726); +var fs_stream_1 = __webpack_require__(730); +var TransformStream = /** @class */ (function (_super) { + __extends(TransformStream, _super); + function TransformStream(reader) { + var _this = _super.call(this, { objectMode: true }) || this; + _this.reader = reader; + return _this; + } + TransformStream.prototype._transform = function (entry, _encoding, callback) { + callback(null, this.reader.transform(entry)); + }; + return TransformStream; +}(stream.Transform)); +var ReaderStream = /** @class */ (function (_super) { + __extends(ReaderStream, _super); + function ReaderStream() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderStream.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_stream_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use stream API to read entries for Task. + */ + ReaderStream.prototype.read = function (task) { + var _this = this; + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + var transform = new TransformStream(this); + var readable = this.api(root, task, options); + return readable + .on('error', function (err) { return _this.isEnoentCodeError(err) ? null : transform.emit('error', err); }) + .pipe(transform); + }; + /** + * Returns founded paths. + */ + ReaderStream.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderStream.prototype.dynamicApi = function (root, options) { + return readdir.readdirStreamStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderStream.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderStream; +}(reader_1.default)); +exports.default = ReaderStream; /***/ }), @@ -81500,80 +81501,80 @@ exports.default = ReaderStream; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var readdir = __webpack_require__(713); -var reader_1 = __webpack_require__(726); -var fs_sync_1 = __webpack_require__(738); -var ReaderSync = /** @class */ (function (_super) { - __extends(ReaderSync, _super); - function ReaderSync() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ReaderSync.prototype, "fsAdapter", { - /** - * Returns FileSystem adapter. - */ - get: function () { - return new fs_sync_1.default(this.options); - }, - enumerable: true, - configurable: true - }); - /** - * Use sync API to read entries for Task. - */ - ReaderSync.prototype.read = function (task) { - var root = this.getRootDirectory(task); - var options = this.getReaderOptions(task); - try { - var entries = this.api(root, task, options); - return entries.map(this.transform, this); - } - catch (err) { - if (this.isEnoentCodeError(err)) { - return []; - } - throw err; - } - }; - /** - * Returns founded paths. - */ - ReaderSync.prototype.api = function (root, task, options) { - if (task.dynamic) { - return this.dynamicApi(root, options); - } - return this.staticApi(task, options); - }; - /** - * Api for dynamic tasks. - */ - ReaderSync.prototype.dynamicApi = function (root, options) { - return readdir.readdirSyncStat(root, options); - }; - /** - * Api for static tasks. - */ - ReaderSync.prototype.staticApi = function (task, options) { - return this.fsAdapter.read(task.patterns, options.filter); - }; - return ReaderSync; -}(reader_1.default)); -exports.default = ReaderSync; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var readdir = __webpack_require__(713); +var reader_1 = __webpack_require__(726); +var fs_sync_1 = __webpack_require__(738); +var ReaderSync = /** @class */ (function (_super) { + __extends(ReaderSync, _super); + function ReaderSync() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderSync.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_sync_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use sync API to read entries for Task. + */ + ReaderSync.prototype.read = function (task) { + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + try { + var entries = this.api(root, task, options); + return entries.map(this.transform, this); + } + catch (err) { + if (this.isEnoentCodeError(err)) { + return []; + } + throw err; + } + }; + /** + * Returns founded paths. + */ + ReaderSync.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderSync.prototype.dynamicApi = function (root, options) { + return readdir.readdirSyncStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderSync.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderSync; +}(reader_1.default)); +exports.default = ReaderSync; /***/ }), @@ -81581,65 +81582,65 @@ exports.default = ReaderSync; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var fsStat = __webpack_require__(731); -var fs_1 = __webpack_require__(735); -var FileSystemSync = /** @class */ (function (_super) { - __extends(FileSystemSync, _super); - function FileSystemSync() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Use sync API to read entries for Task. - */ - FileSystemSync.prototype.read = function (patterns, filter) { - var _this = this; - var entries = []; - patterns.forEach(function (pattern) { - var filepath = _this.getFullEntryPath(pattern); - var entry = _this.getEntry(filepath, pattern); - if (entry === null || !filter(entry)) { - return; - } - entries.push(entry); - }); - return entries; - }; - /** - * Return entry for the provided path. - */ - FileSystemSync.prototype.getEntry = function (filepath, pattern) { - try { - var stat = this.getStat(filepath); - return this.makeEntry(stat, pattern); - } - catch (err) { - return null; - } - }; - /** - * Return fs.Stats for the provided path. - */ - FileSystemSync.prototype.getStat = function (filepath) { - return fsStat.statSync(filepath, { throwErrorOnBrokenSymlinks: false }); - }; - return FileSystemSync; -}(fs_1.default)); -exports.default = FileSystemSync; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var fsStat = __webpack_require__(731); +var fs_1 = __webpack_require__(735); +var FileSystemSync = /** @class */ (function (_super) { + __extends(FileSystemSync, _super); + function FileSystemSync() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Use sync API to read entries for Task. + */ + FileSystemSync.prototype.read = function (patterns, filter) { + var _this = this; + var entries = []; + patterns.forEach(function (pattern) { + var filepath = _this.getFullEntryPath(pattern); + var entry = _this.getEntry(filepath, pattern); + if (entry === null || !filter(entry)) { + return; + } + entries.push(entry); + }); + return entries; + }; + /** + * Return entry for the provided path. + */ + FileSystemSync.prototype.getEntry = function (filepath, pattern) { + try { + var stat = this.getStat(filepath); + return this.makeEntry(stat, pattern); + } + catch (err) { + return null; + } + }; + /** + * Return fs.Stats for the provided path. + */ + FileSystemSync.prototype.getStat = function (filepath) { + return fsStat.statSync(filepath, { throwErrorOnBrokenSymlinks: false }); + }; + return FileSystemSync; +}(fs_1.default)); +exports.default = FileSystemSync; /***/ }), @@ -81647,15 +81648,15 @@ exports.default = FileSystemSync; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Flatten nested arrays (max depth is 2) into a non-nested array of non-array items. - */ -function flatten(items) { - return items.reduce(function (collection, item) { return [].concat(collection, item); }, []); -} -exports.flatten = flatten; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Flatten nested arrays (max depth is 2) into a non-nested array of non-array items. + */ +function flatten(items) { + return items.reduce(function (collection, item) { return [].concat(collection, item); }, []); +} +exports.flatten = flatten; /***/ }), @@ -81663,20 +81664,20 @@ exports.flatten = flatten; /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var merge2 = __webpack_require__(349); -/** - * Merge multiple streams and propagate their errors into one stream in parallel. - */ -function merge(streams) { - var mergedStream = merge2(streams); - streams.forEach(function (stream) { - stream.on('error', function (err) { return mergedStream.emit('error', err); }); - }); - return mergedStream; -} -exports.merge = merge; + +Object.defineProperty(exports, "__esModule", { value: true }); +var merge2 = __webpack_require__(349); +/** + * Merge multiple streams and propagate their errors into one stream in parallel. + */ +function merge(streams) { + var mergedStream = merge2(streams); + streams.forEach(function (stream) { + stream.on('error', function (err) { return mergedStream.emit('error', err); }); + }); + return mergedStream; +} +exports.merge = merge; /***/ }), diff --git a/packages/osd-pm/src/config.ts b/packages/osd-pm/src/config.ts index 09645c6e851d..b7ceeefaea46 100644 --- a/packages/osd-pm/src/config.ts +++ b/packages/osd-pm/src/config.ts @@ -54,8 +54,8 @@ export function getProjectPaths({ rootPath, ossOnly, skipOpenSearchDashboardsPlu projectPaths.push(resolve(rootPath, 'test/plugin_functional/plugins/*')); projectPaths.push(resolve(rootPath, 'test/interpreter_functional/plugins/*')); projectPaths.push(resolve(rootPath, 'examples/*')); - if (!skipOpenSearchDashboardsPlugins) { + projectPaths.push(resolve(rootPath, 'plugins-extra/*')); projectPaths.push(resolve(rootPath, '../opensearch-dashboards-extra/*')); projectPaths.push(resolve(rootPath, '../opensearch-dashboards-extra/*/packages/*')); projectPaths.push(resolve(rootPath, '../opensearch-dashboards-extra/*/plugins/*')); diff --git a/plugins-extra/.gitignore b/plugins-extra/.gitignore new file mode 100644 index 000000000000..ab167be4ccab --- /dev/null +++ b/plugins-extra/.gitignore @@ -0,0 +1,2 @@ +target +/build \ No newline at end of file diff --git a/plugins-extra/query_enhancements/.eslintrc.js b/plugins-extra/query_enhancements/.eslintrc.js new file mode 100644 index 000000000000..b16a8b23a08e --- /dev/null +++ b/plugins-extra/query_enhancements/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + root: true, + extends: ['@elastic/eslint-config-kibana', 'plugin:@elastic/eui/recommended'], + rules: { + '@osd/eslint/require-license-header': 'off', + }, +}; diff --git a/plugins-extra/query_enhancements/.i18nrc.json b/plugins-extra/query_enhancements/.i18nrc.json new file mode 100644 index 000000000000..bb9a3ef5e506 --- /dev/null +++ b/plugins-extra/query_enhancements/.i18nrc.json @@ -0,0 +1,7 @@ +{ + "prefix": "queryEnhancements", + "paths": { + "queryEnhancements": "." + }, + "translations": ["translations/ja-JP.json"] +} diff --git a/plugins-extra/query_enhancements/README.md b/plugins-extra/query_enhancements/README.md new file mode 100755 index 000000000000..f7c6326fd095 --- /dev/null +++ b/plugins-extra/query_enhancements/README.md @@ -0,0 +1,9 @@ +# Query Enhancements Plugin + +Optional plugin, that registers query enhancing capabilities within +the application. + +## List of enhancements + +* PPL within Discover +* SQL within Discover diff --git a/plugins-extra/query_enhancements/common/config.ts b/plugins-extra/query_enhancements/common/config.ts new file mode 100644 index 000000000000..b6be3f718eea --- /dev/null +++ b/plugins-extra/query_enhancements/common/config.ts @@ -0,0 +1,12 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { schema, TypeOf } from '@osd/config-schema'; + +export const configSchema = schema.object({ + enabled: schema.boolean({ defaultValue: true }), +}); + +export type ConfigSchema = TypeOf; diff --git a/plugins-extra/query_enhancements/common/index.ts b/plugins-extra/query_enhancements/common/index.ts new file mode 100644 index 000000000000..1d434bcc74d8 --- /dev/null +++ b/plugins-extra/query_enhancements/common/index.ts @@ -0,0 +1,21 @@ +export const PLUGIN_ID = 'queryEnhancements'; +export const PLUGIN_NAME = 'queryEnhancements'; + +export const PPL_SEARCH_STRATEGY = 'ppl'; +export const SQL_SEARCH_STRATEGY = 'sql'; + +export const PPL_ENDPOINT = '/_plugins/_ppl'; +export const SQL_ENDPOINT = '/_plugins/_sql'; + +const BASE_OBSERVABILITY_URI = '/_plugins/_observability'; +const BASE_DATACONNECTIONS_URI = '/_plugins/_query/_datasources'; +export const OPENSEARCH_PANELS_API = { + OBJECT: `${BASE_OBSERVABILITY_URI}/object`, +}; +export const OPENSEARCH_DATACONNECTIONS_API = { + DATACONNECTION: `${BASE_DATACONNECTIONS_URI}`, +}; + +export const JOBS_ENDPOINT_BASE = '/_plugins/_async_query'; + +export * from './utils'; diff --git a/plugins-extra/query_enhancements/common/utils.ts b/plugins-extra/query_enhancements/common/utils.ts new file mode 100644 index 000000000000..89045c178918 --- /dev/null +++ b/plugins-extra/query_enhancements/common/utils.ts @@ -0,0 +1,27 @@ +export const formatDate = (dateString: string) => { + const date = new Date(dateString); + return ( + date.getFullYear() + + '-' + + ('0' + (date.getMonth() + 1)).slice(-2) + + '-' + + ('0' + date.getDate()).slice(-2) + + ' ' + + ('0' + date.getHours()).slice(-2) + + ':' + + ('0' + date.getMinutes()).slice(-2) + + ':' + + ('0' + date.getSeconds()).slice(-2) + ); +}; + +export const getFields = (rawResponse: any) => { + return rawResponse.data.schema?.map((field: any, index: any) => ({ + ...field, + values: rawResponse.data.datarows?.map((row: any) => row[index]), + })); +}; + +export const removeKeyword = (queryString: string | undefined) => { + return queryString?.replace(new RegExp('.keyword'), '') ?? ''; +}; diff --git a/plugins-extra/query_enhancements/opensearch_dashboards.json b/plugins-extra/query_enhancements/opensearch_dashboards.json new file mode 100644 index 000000000000..cdd81cde48c6 --- /dev/null +++ b/plugins-extra/query_enhancements/opensearch_dashboards.json @@ -0,0 +1,10 @@ +{ + "id": "queryEnhancements", + "version": "1.0.0", + "opensearchDashboardsVersion": "opensearchDashboards", + "server": true, + "ui": true, + "requiredPlugins": ["data"], + "optionalPlugins": ["home"], + "requiredBundles": [] +} diff --git a/plugins-extra/query_enhancements/package.json b/plugins-extra/query_enhancements/package.json new file mode 100644 index 000000000000..13954d97e836 --- /dev/null +++ b/plugins-extra/query_enhancements/package.json @@ -0,0 +1,10 @@ +{ + "name": "queryEnhancements", + "version": "0.0.0", + "private": true, + "scripts": { + "build": "yarn plugin-helpers build", + "plugin-helpers": "../../scripts/use_node ../../scripts/plugin_helpers", + "osd": "../../scripts/use_node ../../scripts/osd" + } +} diff --git a/plugins-extra/query_enhancements/public/index.scss b/plugins-extra/query_enhancements/public/index.scss new file mode 100644 index 000000000000..ff7112406eac --- /dev/null +++ b/plugins-extra/query_enhancements/public/index.scss @@ -0,0 +1 @@ +/* stylelint-disable no-empty-source */ diff --git a/plugins-extra/query_enhancements/public/index.ts b/plugins-extra/query_enhancements/public/index.ts new file mode 100644 index 000000000000..e02f44d758fe --- /dev/null +++ b/plugins-extra/query_enhancements/public/index.ts @@ -0,0 +1,10 @@ +import './index.scss'; + +import { QueryEnhancementsPlugin } from './plugin'; + +// This exports static code and TypeScript types, +// as well as, OpenSearch Dashboards Platform `plugin()` initializer. +export function plugin() { + return new QueryEnhancementsPlugin(); +} +export { QueryEnhancementsPluginSetup, QueryEnhancementsPluginStart } from './types'; diff --git a/plugins-extra/query_enhancements/public/plugin.ts b/plugins-extra/query_enhancements/public/plugin.ts new file mode 100644 index 000000000000..6f926e66fec2 --- /dev/null +++ b/plugins-extra/query_enhancements/public/plugin.ts @@ -0,0 +1,83 @@ +import moment from 'moment'; +import { CoreSetup, CoreStart, Plugin } from '../../../src/core/public'; +import { + QueryEnhancementsPluginSetup, + QueryEnhancementsPluginStart, + QueryEnhancementsPluginSetupDependencies, +} from './types'; +import { PPLQlSearchInterceptor } from './search/ppl_search_interceptor'; +import { SQLQlSearchInterceptor } from './search/sql_search_interceptor'; + +export class QueryEnhancementsPlugin + implements Plugin { + public setup( + core: CoreSetup, + { data }: QueryEnhancementsPluginSetupDependencies + ): QueryEnhancementsPluginSetup { + + const pplSearchInterceptor = new PPLQlSearchInterceptor({ + toasts: core.notifications.toasts, + http: core.http, + uiSettings: core.uiSettings, + startServices: core.getStartServices(), + usageCollector: data.search.usageCollector, + }); + + const sqlSearchInterceptor = new SQLQlSearchInterceptor({ + toasts: core.notifications.toasts, + http: core.http, + uiSettings: core.uiSettings, + startServices: core.getStartServices(), + usageCollector: data.search.usageCollector, + }); + + data.__enhance({ + ui: { + query: { + language: 'PPL', + search: pplSearchInterceptor, + searchBar: { + queryStringInput: { initialValue: 'source=' }, + dateRange: { + initialFrom: moment().subtract(2, 'days').toISOString(), + initialTo: moment().add(2, 'days').toISOString(), + }, + showFilterBar: false, + }, + fields: { + visualizable: false, + }, + supportedAppNames: ['discover'], + }, + }, + }); + + data.__enhance({ + ui: { + query: { + language: 'SQL', + search: sqlSearchInterceptor, + searchBar: { + showDatePicker: false, + showFilterBar: false, + queryStringInput: { initialValue: 'SELECT * FROM ' }, + }, + fields: { + filterable: false, + visualizable: false, + }, + showDocLinks: false, + supportedAppNames: ['discover'], + }, + }, + }); + + return {}; + } + + public start(core: CoreStart): QueryEnhancementsPluginStart { + return {}; + } + + public stop() {} +} diff --git a/plugins-extra/query_enhancements/public/search/ppl_search_interceptor.ts b/plugins-extra/query_enhancements/public/search/ppl_search_interceptor.ts new file mode 100644 index 000000000000..7eaf8cbd99fa --- /dev/null +++ b/plugins-extra/query_enhancements/public/search/ppl_search_interceptor.ts @@ -0,0 +1,181 @@ +import { trimEnd } from 'lodash'; +import { Observable, from } from 'rxjs'; +import { stringify } from '@osd/std'; +import { concatMap } from 'rxjs/operators'; +import { + DataFrameAggConfig, + getAggConfig, + getRawDataFrame, + getRawQueryString, + getTimeField, + formatTimePickerDate, + getUniqueValuesForRawAggs, + updateDataFrameMeta, +} from '../../../../src/plugins/data/common'; +import { + DataPublicPluginStart, + IOpenSearchDashboardsSearchRequest, + IOpenSearchDashboardsSearchResponse, + ISearchOptions, + SearchInterceptor, + SearchInterceptorDeps, +} from '../../../../src/plugins/data/public'; +import { formatDate, PPL_SEARCH_STRATEGY, removeKeyword } from '../../common'; +import { QueryEnhancementsPluginStartDependencies } from '../types'; + +export class PPLQlSearchInterceptor extends SearchInterceptor { + protected queryService!: DataPublicPluginStart['query']; + protected aggsService!: DataPublicPluginStart['search']['aggs']; + + constructor(deps: SearchInterceptorDeps) { + super(deps); + + deps.startServices.then(([coreStart, depsStart]) => { + this.queryService = (depsStart as QueryEnhancementsPluginStartDependencies).data.query; + this.aggsService = (depsStart as QueryEnhancementsPluginStartDependencies).data.search.aggs; + }); + } + + protected runSearch( + request: IOpenSearchDashboardsSearchRequest, + signal?: AbortSignal, + strategy?: string + ): Observable { + const { id, ...searchRequest } = request; + const path = trimEnd('/api/pplql/search'); + const { timefilter } = this.queryService; + const dateRange = timefilter.timefilter.getTime(); + const { fromDate, toDate } = formatTimePickerDate(dateRange, 'YYYY-MM-DD HH:mm:ss.SSS'); + + const fetchDataFrame = (queryString: string, df = null) => { + const body = stringify({ query: { qs: queryString, format: 'jdbc' }, df }); + return from( + this.deps.http.fetch({ + method: 'POST', + path, + body, + signal, + }) + ); + }; + + const getTimeFilter = (timeField: any) => { + return ` | where ${timeField?.name} >= '${formatDate(fromDate)}' and ${ + timeField?.name + } <= '${formatDate(toDate)}'`; + }; + + const getAggQsFn = ({ + qs, + aggConfig, + timeField, + timeFilter, + }: { + qs: string; + aggConfig: DataFrameAggConfig; + timeField: any; + timeFilter: string; + }) => { + return removeKeyword(`${qs} ${getAggString(timeField, aggConfig)} ${timeFilter}`); + }; + + const getAggString = (timeField: any, aggsConfig?: DataFrameAggConfig) => { + if (!aggsConfig) { + return ` | stats count() by span(${ + timeField?.name + }, ${this.aggsService.calculateAutoTimeExpression({ + from: fromDate, + to: toDate, + mode: 'absolute', + })})`; + } + if (aggsConfig.date_histogram) { + return ` | stats count() by span(${timeField?.name}, ${ + aggsConfig.date_histogram.fixed_interval ?? + aggsConfig.date_histogram.calendar_interval ?? + this.aggsService.calculateAutoTimeExpression({ + from: fromDate, + to: toDate, + mode: 'absolute', + }) + })`; + } + if (aggsConfig.avg) { + return ` | stats avg(${aggsConfig.avg.field})`; + } + if (aggsConfig.cardinality) { + return ` | dedup ${aggsConfig.cardinality.field} | stats count()`; + } + if (aggsConfig.terms) { + return ` | stats count() by ${aggsConfig.terms.field}`; + } + if (aggsConfig.id === 'other-filter') { + const uniqueConfig = getUniqueValuesForRawAggs(aggsConfig); + if ( + !uniqueConfig || + !uniqueConfig.field || + !uniqueConfig.values || + uniqueConfig.values.length === 0 + ) { + return ''; + } + + let otherQueryString = ` | stats count() by ${uniqueConfig.field}`; + uniqueConfig.values.forEach((value, index) => { + otherQueryString += ` ${index === 0 ? '| where' : 'and'} ${ + uniqueConfig.field + }<>'${value}'`; + }); + return otherQueryString; + } + }; + + let queryString = removeKeyword(getRawQueryString(searchRequest)) ?? ''; + const dataFrame = getRawDataFrame(searchRequest); + const aggConfig = getAggConfig( + searchRequest, + {}, + this.aggsService.types.get.bind(this) + ) as DataFrameAggConfig; + + if (!dataFrame) { + return fetchDataFrame(queryString).pipe( + concatMap((response) => { + const df = response.body; + const timeField = getTimeField(df, aggConfig); + const timeFilter = getTimeFilter(timeField); + updateDataFrameMeta({ + dataFrame: df, + qs: queryString, + aggConfig, + timeField, + timeFilter, + getAggQsFn: getAggQsFn.bind(this), + }); + + return fetchDataFrame(queryString, df); + }) + ); + } + + if (dataFrame) { + const timeField = getTimeField(dataFrame, aggConfig); + const timeFilter = getTimeFilter(timeField); + updateDataFrameMeta({ + dataFrame, + qs: queryString, + aggConfig, + timeField, + timeFilter, + getAggQsFn: getAggQsFn.bind(this), + }); + queryString += timeFilter; + } + + return fetchDataFrame(queryString, dataFrame); + } + + public search(request: IOpenSearchDashboardsSearchRequest, options: ISearchOptions) { + return this.runSearch(request, options.abortSignal, PPL_SEARCH_STRATEGY); + } +} diff --git a/plugins-extra/query_enhancements/public/search/sql_search_interceptor.ts b/plugins-extra/query_enhancements/public/search/sql_search_interceptor.ts new file mode 100644 index 000000000000..3ccea093fed8 --- /dev/null +++ b/plugins-extra/query_enhancements/public/search/sql_search_interceptor.ts @@ -0,0 +1,72 @@ +import { trimEnd } from 'lodash'; +import { Observable, from } from 'rxjs'; +import { stringify } from '@osd/std'; +import { + DataPublicPluginStart, + IOpenSearchDashboardsSearchRequest, + IOpenSearchDashboardsSearchResponse, + ISearchOptions, + SearchInterceptor, + SearchInterceptorDeps, +} from '../../../../src/plugins/data/public'; +import { SQL_SEARCH_STRATEGY } from '../../common'; +import { QueryEnhancementsPluginStartDependencies } from '../types'; +import { i18n } from '@osd/i18n'; + +export class SQLQlSearchInterceptor extends SearchInterceptor { + protected queryService!: DataPublicPluginStart['query']; + protected aggsService!: DataPublicPluginStart['search']['aggs']; + + constructor(deps: SearchInterceptorDeps) { + super(deps); + + deps.startServices.then(([coreStart, depsStart]) => { + this.queryService = (depsStart as QueryEnhancementsPluginStartDependencies).data.query; + this.aggsService = (depsStart as QueryEnhancementsPluginStartDependencies).data.search.aggs; + }); + } + + protected runSearch( + request: IOpenSearchDashboardsSearchRequest, + signal?: AbortSignal, + strategy?: string + ): Observable { + const { id, ...searchRequest } = request; + const path = trimEnd('/api/sqlql/search'); + + const fetchDataFrame = (queryString: string, df = null) => { + const body = stringify({ query: { qs: queryString, format: 'jdbc' }, df }); + return from( + this.deps.http.fetch({ + method: 'POST', + path, + body, + signal, + }) + ); + }; + + const dataFrame = fetchDataFrame( + searchRequest.params.body.query.queries[0].query, + searchRequest.params.body.df + ); + + // subscribe to dataFrame to see if an error is returned, display a toast message if so + dataFrame.subscribe((df) => { + if (!df.body.error) return; + const jsError = new Error(df.body.error.response); + this.deps.toasts.addError(jsError, { + title: i18n.translate('dqlPlugin.sqlQueryError', { + defaultMessage: 'Could not complete the SQL query', + }), + toastMessage: df.body.error.msg, + }); + }); + + return dataFrame; + } + + public search(request: IOpenSearchDashboardsSearchRequest, options: ISearchOptions) { + return this.runSearch(request, options.abortSignal, SQL_SEARCH_STRATEGY); + } +} diff --git a/plugins-extra/query_enhancements/public/types.ts b/plugins-extra/query_enhancements/public/types.ts new file mode 100644 index 000000000000..89ef8c02d2e0 --- /dev/null +++ b/plugins-extra/query_enhancements/public/types.ts @@ -0,0 +1,17 @@ +import { DataPublicPluginSetup, DataPublicPluginStart } from 'src/plugins/data/public'; +import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface QueryEnhancementsPluginSetup {} + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface QueryEnhancementsPluginStart {} + +export interface QueryEnhancementsPluginSetupDependencies { + data: DataPublicPluginSetup; +} + +export interface QueryEnhancementsPluginStartDependencies { + navigation: NavigationPublicPluginStart; + data: DataPublicPluginStart; +} diff --git a/plugins-extra/query_enhancements/server/index.ts b/plugins-extra/query_enhancements/server/index.ts new file mode 100644 index 000000000000..ccebeaff5fab --- /dev/null +++ b/plugins-extra/query_enhancements/server/index.ts @@ -0,0 +1,14 @@ +import { PluginConfigDescriptor, PluginInitializerContext } from '../../../src/core/server'; +import { QueryEnhancementsPlugin } from './plugin'; +import { configSchema, ConfigSchema } from '../common/config'; + +export const config: PluginConfigDescriptor = { + exposeToBrowser: {}, + schema: configSchema, +}; + +export function plugin(initializerContext: PluginInitializerContext) { + return new QueryEnhancementsPlugin(initializerContext); +} + +export { QueryEnhancementsPluginSetup, QueryEnhancementsPluginStart } from './types'; diff --git a/plugins-extra/query_enhancements/server/plugin.ts b/plugins-extra/query_enhancements/server/plugin.ts new file mode 100644 index 000000000000..8f50ab634fa2 --- /dev/null +++ b/plugins-extra/query_enhancements/server/plugin.ts @@ -0,0 +1,69 @@ +import { Observable } from 'rxjs'; +import { + PluginInitializerContext, + CoreSetup, + CoreStart, + Plugin, + Logger, + SharedGlobalConfig, +} from '../../../src/core/server'; + +import { + QueryEnhancementsPluginSetup, + QueryEnhancementsPluginSetupDependencies, + QueryEnhancementsPluginStart, +} from './types'; +import { defineRoutes } from './routes'; +import { PPLPlugin } from './search/ppl/ppl_plugin'; +import { EnginePlugin } from './search/engine_plugin'; +import { PPL_SEARCH_STRATEGY, SQL_SEARCH_STRATEGY } from '../common'; +import { pplSearchStrategyProvider } from './search/ppl/ppl_search_strategy'; +import { sqlSearchStrategyProvider } from './search/sql/sql_search_strategy'; +//import { logsPPLSpecProvider } from './sample_data/ppl'; + +//const pplSampleDateSet = logsPPLSpecProvider(); + +export class QueryEnhancementsPlugin + implements Plugin { + private readonly logger: Logger; + private readonly config$: Observable; + constructor(initializerContext: PluginInitializerContext) { + this.logger = initializerContext.logger.get(); + this.config$ = initializerContext.config.legacy.globalConfig$; + } + + public setup(core: CoreSetup, { data, home }: QueryEnhancementsPluginSetupDependencies) { + this.logger.debug('queryEnhancements: Setup'); + const router = core.http.createRouter(); + // Register server side APIs + const client = core.opensearch.legacy.createClient('opensearch_observability', { + plugins: [PPLPlugin, EnginePlugin], + }); + + const pplSearchStrategy = pplSearchStrategyProvider(this.config$, this.logger, client); + const sqlSearchStrategy = sqlSearchStrategyProvider(this.config$, this.logger, client); + + data.search.registerSearchStrategy(PPL_SEARCH_STRATEGY, pplSearchStrategy); + data.search.registerSearchStrategy(SQL_SEARCH_STRATEGY, sqlSearchStrategy); + + // if (home) { + // home.sampleData.registerSampleDataset(() => pplSampleDateSet); + // home.sampleData.addAppLinksToSampleDataset(pplSampleDateSet.id, pplSampleDateSet.appLinks); + // home.sampleData.addSavedObjectsToSampleDataset( + // pplSampleDateSet.id, + // pplSampleDateSet.savedObjects + // ); + // } + defineRoutes(this.logger, router, { ppl: pplSearchStrategy, sql: sqlSearchStrategy }); + + this.logger.info('queryEnhancements: Setup complete'); + return {}; + } + + public start(core: CoreStart) { + this.logger.debug('queryEnhancements: Started'); + return {}; + } + + public stop() {} +} diff --git a/plugins-extra/query_enhancements/server/routes/index.ts b/plugins-extra/query_enhancements/server/routes/index.ts new file mode 100644 index 000000000000..2183bf38d0a9 --- /dev/null +++ b/plugins-extra/query_enhancements/server/routes/index.ts @@ -0,0 +1,94 @@ +import { schema } from '@osd/config-schema'; +import { + IOpenSearchDashboardsResponse, + IRouter, + Logger, + ResponseError, +} from '../../../../src/core/server'; +import { ISearchStrategy } from '../../../../src/plugins/data/server'; +import { + IDataFrameResponse, + IOpenSearchDashboardsSearchRequest, +} from '../../../../src/plugins/data/common'; + +export function defineRoutes( + logger: Logger, + router: IRouter, + searchStrategies: Record< + string, + ISearchStrategy + > +) { + router.post( + { + path: `/api/pplql/search`, + validate: { + body: schema.object({ + query: schema.object({ + qs: schema.string(), + format: schema.string(), + }), + df: schema.nullable(schema.object({}, { unknowns: 'allow' })), + }), + }, + }, + async (context, req, res): Promise> => { + try { + const queryRes: IDataFrameResponse = await searchStrategies.ppl.search( + context, + req as any, + {} + ); + const result: any = { + body: { + ...queryRes, + }, + }; + return res.ok(result); + } catch (err) { + logger.error(err); + return res.custom({ + statusCode: 500, + body: err, + }); + } + } + ); + + // sql + router.post( + { + path: `/api/sqlql/search`, + validate: { + body: schema.object({ + query: schema.object({ + qs: schema.string(), + format: schema.string(), + }), + df: schema.nullable(schema.object({}, { unknowns: 'allow' })), + }), + }, + }, + async (context, req, res): Promise> => { + try { + const queryRes: IDataFrameResponse = await searchStrategies.sql.search( + context, + req as any, + {} + ); + const result: any = { + body: { + ...queryRes, + }, + }; + return res.ok(result); + } catch (err) { + logger.error(err); + return res.custom({ + statusCode: 500, + body: err, + }); + } + } + ); +} diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/field_mappings.ts b/plugins-extra/query_enhancements/server/sample_data/ppl/field_mappings.ts new file mode 100644 index 000000000000..8b9994f8615a --- /dev/null +++ b/plugins-extra/query_enhancements/server/sample_data/ppl/field_mappings.ts @@ -0,0 +1,143 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export const fieldMappings = { + request: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + geo: { + properties: { + srcdest: { + type: 'keyword', + }, + src: { + type: 'keyword', + }, + dest: { + type: 'keyword', + }, + coordinates: { + type: 'geo_point', + }, + }, + }, + url: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + message: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + host: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + clientip: { + type: 'ip', + }, + response: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + machine: { + properties: { + ram: { + type: 'long', + }, + os: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + }, + }, + agent: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + bytes: { + type: 'long', + }, + tags: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + referer: { + type: 'keyword', + }, + ip: { + type: 'ip', + }, + timestamp: { + type: 'date', + }, + '@timestamp': { + type: 'alias', + path: 'timestamp', + }, + phpmemory: { + type: 'long', + }, + memory: { + type: 'double', + }, + extension: { + type: 'text', + fields: { + keyword: { + type: 'keyword', + ignore_above: 256, + }, + }, + }, + event: { + properties: { + dataset: { + type: 'keyword', + }, + }, + }, +}; diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/index.ts b/plugins-extra/query_enhancements/server/sample_data/ppl/index.ts new file mode 100644 index 000000000000..b227eedd38f5 --- /dev/null +++ b/plugins-extra/query_enhancements/server/sample_data/ppl/index.ts @@ -0,0 +1,59 @@ +// /* +// * Copyright OpenSearch Contributors +// * SPDX-License-Identifier: Apache-2.0 +// */ + +// import path from 'path'; +// import { i18n } from '@osd/i18n'; +// import { getSavedObjects } from './saved_objects'; +// import { fieldMappings } from './field_mappings'; +// import { +// SampleDatasetSchema, +// AppLinkSchema, +// } from '../../../../../src/plugins/home/server/services/sample_data/lib/sample_dataset_registry_types'; +// // import { +// // appendDataSourceId, +// // getSavedObjectsWithDataSource, +// // } from '../../../../../src/plugins/home/server/services/sample_data/data_sets'; + +// const logsPPLName = i18n.translate('home.sampleData.logsPPLSpecTitle', { +// defaultMessage: '[PPL] Sample web logs', +// }); +// const logsPPLDescription = i18n.translate('home.sampleData.logsPPLSpecDescription', { +// defaultMessage: +// 'Sample data, visualizations, and dashboards for monitoring web logs but defaults to PPL for the query language.', +// }); +// const initialAppLinks = [] as AppLinkSchema[]; + +// const DEFAULT_INDEX = 'opensearch_dashboards_sample_data_ppl'; +// const DASHBOARD_ID = '9011e5eb-7018-463f-8541-14f98a938f16'; + +// export const logsPPLSpecProvider = function (): SampleDatasetSchema { +// return { +// id: 'ppl', +// name: logsPPLName, +// description: logsPPLDescription, +// previewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard.png', +// darkPreviewImagePath: '/plugins/home/assets/sample_data_resources/logs/dashboard_dark.png', +// hasNewThemeImages: true, +// overviewDashboard: DASHBOARD_ID, +// getDataSourceIntegratedDashboard: appendDataSourceId(DASHBOARD_ID), +// appLinks: initialAppLinks, +// defaultIndex: DEFAULT_INDEX, +// getDataSourceIntegratedDefaultIndex: appendDataSourceId(DEFAULT_INDEX), +// savedObjects: getSavedObjects(), +// getDataSourceIntegratedSavedObjects: (dataSourceId?: string, dataSourceTitle?: string) => +// getSavedObjectsWithDataSource(getSavedObjects(), dataSourceId, dataSourceTitle), +// dataIndices: [ +// { +// id: 'ppl', +// dataPath: path.join(__dirname, './logs.json.gz'), +// fields: fieldMappings, +// timeFields: ['timestamp'], +// currentTimeMarker: '2018-08-01T00:00:00', +// preserveDayOfWeekTimeOfDay: true, +// }, +// ], +// status: 'not_installed', +// }; +// }; diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/logs.json.gz b/plugins-extra/query_enhancements/server/sample_data/ppl/logs.json.gz new file mode 100644 index 000000000000..dd973bbdc815 Binary files /dev/null and b/plugins-extra/query_enhancements/server/sample_data/ppl/logs.json.gz differ diff --git a/plugins-extra/query_enhancements/server/sample_data/ppl/saved_objects.ts b/plugins-extra/query_enhancements/server/sample_data/ppl/saved_objects.ts new file mode 100644 index 000000000000..48d5bdbb124d --- /dev/null +++ b/plugins-extra/query_enhancements/server/sample_data/ppl/saved_objects.ts @@ -0,0 +1,242 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +/* eslint max-len: 0 */ +import { SavedObject } from 'opensearch-dashboards/server'; + +export const getSavedObjects = (): SavedObject[] => [ + { + id: 'opensearch_dashboards_sample_data_ppl', + type: 'index-pattern', + + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY1NSwxXQ==', + attributes: { + fieldFormatMap: '{"hour_of_day":{}}', + fields: + '[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"agent","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"agent.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"agent"}}},{"name":"bytes","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"clientip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"event.dataset","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"extension","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"extension.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"extension"}}},{"name":"geo.coordinates","type":"geo_point","esTypes":["geo_point"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.dest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.src","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"geo.srcdest","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"host","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"host.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"host"}}},{"name":"index","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"index.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"index"}}},{"name":"ip","type":"ip","esTypes":["ip"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"machine.os","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine.os.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"machine.os"}}},{"name":"machine.ram","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"memory","type":"number","esTypes":["double"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"message","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message"}}},{"name":"phpmemory","type":"number","esTypes":["long"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"referer","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"request","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"request.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"request"}}},{"name":"response","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"response.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"response"}}},{"name":"tags","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tags.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"tags"}}},{"name":"timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"url","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"url.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"url"}}},{"name":"utc_time","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"hour_of_day","type":"number","count":0,"scripted":true,"script":"doc[\'timestamp\'].value.getHour()","lang":"painless","searchable":true,"aggregatable":true,"readFromDocValues":false}]', + timeFieldName: 'timestamp', + title: 'opensearch_dashboards_sample_data_ppl', + }, + references: [], + migrationVersion: { 'index-pattern': '7.6.0' }, + }, + { + id: '9011e5eb-7018-463f-8541-14f98a938f16', + type: 'dashboard', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY2MiwxXQ==', + attributes: { + description: "Analyze mock web traffic log data for OpenSearch's website", + hits: 0, + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl | fields agent, timestamp","language":"PPL"},"highlightAll":true,"version":true,"filter":[]}', + }, + optionsJSON: '{"hidePanelTitles":false,"useMargins":true}', + panelsJSON: + '[{"embeddableConfig":{"vis":{"legendOpen":false}},"gridData":{"h":12,"i":"11","w":9,"x":30,"y":15},"panelIndex":"11","title":"","version":"3.0.0","panelRefName":"panel_0"},{"embeddableConfig":{"vis":{"legendOpen":false}},"gridData":{"h":12,"i":"17","w":11,"x":19,"y":15},"panelIndex":"17","version":"3.0.0","panelRefName":"panel_1"},{"embeddableConfig":{},"gridData":{"h":15,"i":"18","w":10,"x":0,"y":0},"panelIndex":"18","title":"","version":"3.0.0","panelRefName":"panel_2"},{"embeddableConfig":{},"gridData":{"h":15,"i":"61eb9da0-d482-434b-8be8-aef9ee62b1e3","w":38,"x":10,"y":0},"panelIndex":"61eb9da0-d482-434b-8be8-aef9ee62b1e3","version":"3.0.0","panelRefName":"panel_3"},{"embeddableConfig":{},"gridData":{"h":12,"i":"91225403-98a6-4780-baf7-99364291eba9","w":19,"x":0,"y":15},"panelIndex":"91225403-98a6-4780-baf7-99364291eba9","version":"3.0.0","panelRefName":"panel_4"},{"embeddableConfig":{"vis":null},"gridData":{"h":12,"i":"83075370-4d2c-4739-aaec-2f2b8cbf7809","w":9,"x":39,"y":15},"panelIndex":"83075370-4d2c-4739-aaec-2f2b8cbf7809","version":"3.0.0","panelRefName":"panel_5"}]', + refreshInterval: { pause: false, value: 900000 }, + timeFrom: '2024-04-01T15:55:56.275Z', + timeRestore: true, + timeTo: '2024-05-30T15:55:59.862Z', + title: '[PPL][Logs] Web Traffic', + version: 1, + }, + references: [ + { id: '02dba266-f5f3-4156-9bf7-70f105e93766', name: 'panel_0', type: 'visualization' }, + { id: '71053772-a267-4b13-be3b-38af62f2d4e1', name: 'panel_1', type: 'visualization' }, + { id: 'ec45f83a-6f93-4ad4-b73a-ffe495840966', name: 'panel_2', type: 'visualization' }, + { id: '21cfa169-0160-4da5-aec5-6d1fce61b1b9', name: 'panel_3', type: 'search' }, + { id: 'df3154e9-e31b-41a3-8b1e-90bf96aeace0', name: 'panel_4', type: 'visualization' }, + { id: 'b9a3e2b1-6a0d-490a-9d56-367aff04cef1', name: 'panel_5', type: 'visualization' }, + ], + migrationVersion: { dashboard: '7.9.3' }, + }, + { + id: 'c2684930-0641-11ef-bc97-5b4786ce056b', + type: 'visualization', + namespaces: ['default'], + updated_at: '2024-04-29T16:10:43.869Z', + version: 'WzIwNCwxXQ==', + attributes: { + title: '[PPL](Line) Traffic over time', + visState: + '{"title":"[PPL](Line) Traffic over time","type":"line","aggs":[{"id":"1","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"2024-04-01T15:55:56.275Z","to":"2024-05-30T15:55:59.862Z"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"}],"params":{"type":"line","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Count"}}],"seriesParams":[{"show":true,"type":"line","mode":"normal","data":{"label":"Count","id":"1"},"valueAxis":"ValueAxis-1","drawLinesBetweenPoints":true,"lineWidth":2,"interpolate":"linear","showCircles":true}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"labels":{},"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"}}}', + uiStateJSON: '{}', + description: '', + version: 1, + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + }, + references: [ + { + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + id: 'opensearch_dashboards_sample_data_ppl', + }, + ], + migrationVersion: { visualization: '7.10.0' }, + }, + { + id: '02dba266-f5f3-4156-9bf7-70f105e93766', + type: 'visualization', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY1NiwxXQ==', + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '[PPL][Logs] Goals', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"[PPL][Logs] Goals","type":"gauge","params":{"type":"gauge","addTooltip":true,"addLegend":false,"gauge":{"extendRange":true,"percentageMode":false,"gaugeType":"Arc","gaugeStyle":"Full","backStyle":"Full","orientation":"vertical","colorSchema":"Green to Red","gaugeColorMode":"Labels","colorsRange":[{"from":0,"to":500},{"from":500,"to":1000},{"from":1000,"to":1500}],"invertColors":true,"labels":{"show":false,"color":"black"},"scale":{"show":true,"labels":false,"color":"#333"},"type":"meter","style":{"bgWidth":0.9,"width":0.9,"mask":false,"bgMask":false,"maskBars":50,"bgFill":"#eee","bgColor":false,"subText":"visitors","fontSize":60,"labelColor":true},"alignment":"horizontal"},"isDisplayWarning":false},"aggs":[{"id":"1","enabled":true,"type":"cardinality","schema":"metric","params":{"field":"clientip","customLabel":"Unique Visitors"}}]}', + }, + references: [ + { + id: 'opensearch_dashboards_sample_data_ppl', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + migrationVersion: { visualization: '7.10.0' }, + }, + { + id: '71053772-a267-4b13-be3b-38af62f2d4e1', + type: 'visualization', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY1NywxXQ==', + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '[PPL][Logs] Visitors by OS', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"[PPL][Logs] Visitors by OS","type":"pie","params":{"type":"pie","addTooltip":true,"addLegend":true,"legendPosition":"right","isDonut":true,"labels":{"show":true,"values":true,"last_level":true,"truncate":100}},"aggs":[{"id":"1","enabled":true,"type":"count","schema":"metric","params":{}},{"id":"2","enabled":true,"type":"terms","schema":"segment","params":{"field":"machine.os.keyword","otherBucket":true,"otherBucketLabel":"Other","missingBucket":false,"missingBucketLabel":"Missing","size":10,"order":"desc","orderBy":"1"}}]}', + }, + references: [ + { + id: 'opensearch_dashboards_sample_data_ppl', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + migrationVersion: { visualization: '7.10.0' }, + }, + { + id: 'ec45f83a-6f93-4ad4-b73a-ffe495840966', + type: 'visualization', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY1OCwxXQ==', + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"filter":[]}', + }, + title: '[PPL][Logs] Markdown Instructions', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"[PPL][Logs] Markdown Instructions","type":"markdown","aggs":[],"params":{"fontSize":12,"openLinksInNewTab":true,"markdown":"### Sample Logs Data (PPL)\\nThis dashboard contains sample data for you to play with. You can view it, search it, and interact with the visualizations. For more information about OpenSearch Dashboards, check our [docs](https://opensearch.org/docs/latest/dashboards/index/).\\n\\nQueries were saved using the language PPL. \\n\\n#### Note\\nComposite aggregations currently do not work. "}}', + }, + references: [], + migrationVersion: { visualization: '7.10.0' }, + }, + { + id: 'df3154e9-e31b-41a3-8b1e-90bf96aeace0', + type: 'visualization', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY2MCwxXQ==', + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '[PPL](Line) Traffic over time', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"[PPL](Line) Traffic over time","type":"line","aggs":[{"id":"1","enabled":true,"type":"count","params":{},"schema":"metric"},{"id":"2","enabled":true,"type":"date_histogram","params":{"field":"timestamp","timeRange":{"from":"2024-04-01T15:55:56.275Z","to":"2024-05-30T15:55:59.862Z"},"useNormalizedOpenSearchInterval":true,"scaleMetricValues":false,"interval":"auto","drop_partials":false,"min_doc_count":1,"extended_bounds":{}},"schema":"segment"}],"params":{"type":"line","grid":{"categoryLines":false},"categoryAxes":[{"id":"CategoryAxis-1","type":"category","position":"bottom","show":true,"style":{},"scale":{"type":"linear"},"labels":{"show":true,"filter":true,"truncate":100},"title":{}}],"valueAxes":[{"id":"ValueAxis-1","name":"LeftAxis-1","type":"value","position":"left","show":true,"style":{},"scale":{"type":"linear","mode":"normal"},"labels":{"show":true,"rotate":0,"filter":false,"truncate":100},"title":{"text":"Count"}}],"seriesParams":[{"show":true,"type":"line","mode":"normal","data":{"label":"Count","id":"1"},"valueAxis":"ValueAxis-1","drawLinesBetweenPoints":true,"lineWidth":2,"interpolate":"linear","showCircles":true}],"addTooltip":true,"addLegend":true,"legendPosition":"right","times":[],"addTimeMarker":false,"labels":{},"thresholdLine":{"show":false,"value":10,"width":1,"style":"full","color":"#E7664C"}}}', + }, + references: [ + { + id: 'opensearch_dashboards_sample_data_ppl', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + migrationVersion: { visualization: '7.10.0' }, + }, + { + id: 'b9a3e2b1-6a0d-490a-9d56-367aff04cef1', + type: 'visualization', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY2MSwxXQ==', + attributes: { + description: '', + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + title: '[PPL](Goal) Average machine RAM', + uiStateJSON: '{}', + version: 1, + visState: + '{"title":"[PPL](Goal) Average machine RAM","type":"goal","aggs":[{"id":"1","enabled":true,"type":"avg","params":{"field":"machine.ram"},"schema":"metric"}],"params":{"addTooltip":true,"addLegend":false,"isDisplayWarning":false,"type":"gauge","gauge":{"verticalSplit":false,"autoExtend":false,"percentageMode":true,"gaugeType":"Arc","gaugeStyle":"Full","backStyle":"Full","orientation":"vertical","useRanges":false,"colorSchema":"Green to Red","gaugeColorMode":"None","colorsRange":[{"from":0,"to":10000000000},{"from":10000000000,"to":20000000000}],"invertColors":false,"labels":{"show":true,"color":"black"},"scale":{"show":false,"labels":false,"color":"rgba(105,112,125,0.2)","width":2},"type":"meter","style":{"bgFill":"rgba(105,112,125,0.2)","bgColor":false,"labelColor":false,"subText":"","fontSize":60}}}}', + }, + references: [ + { + id: 'opensearch_dashboards_sample_data_ppl', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + migrationVersion: { visualization: '7.10.0' }, + }, + { + id: '21cfa169-0160-4da5-aec5-6d1fce61b1b9', + type: 'search', + namespaces: ['default'], + updated_at: '2024-04-29T16:31:23.855Z', + version: 'WzY1OSwxXQ==', + attributes: { + columns: ['_source'], + description: '', + hits: 0, + kibanaSavedObjectMeta: { + searchSourceJSON: + '{"query":{"query":"source=opensearch_dashboards_sample_data_ppl","language":"PPL"},"highlightAll":true,"version":true,"aggs":{"2":{"date_histogram":{"field":"timestamp","calendar_interval":"1d","time_zone":"America/Los_Angeles","min_doc_count":1}}},"filter":[],"indexRefName":"kibanaSavedObjectMeta.searchSourceJSON.index"}', + }, + sort: [], + title: '[PPL] Saved Search', + version: 1, + }, + references: [ + { + id: 'opensearch_dashboards_sample_data_ppl', + name: 'kibanaSavedObjectMeta.searchSourceJSON.index', + type: 'index-pattern', + }, + ], + migrationVersion: { search: '7.9.3' }, + }, +]; diff --git a/plugins-extra/query_enhancements/server/sample_data/search/ppl_search.json.gz b/plugins-extra/query_enhancements/server/sample_data/search/ppl_search.json.gz new file mode 100644 index 000000000000..eca9107ce73b Binary files /dev/null and b/plugins-extra/query_enhancements/server/sample_data/search/ppl_search.json.gz differ diff --git a/plugins-extra/query_enhancements/server/sample_data/search/regular_search.json.gz b/plugins-extra/query_enhancements/server/sample_data/search/regular_search.json.gz new file mode 100644 index 000000000000..fb98ff927d8b Binary files /dev/null and b/plugins-extra/query_enhancements/server/sample_data/search/regular_search.json.gz differ diff --git a/plugins-extra/query_enhancements/server/search/engine_plugin.ts b/plugins-extra/query_enhancements/server/search/engine_plugin.ts new file mode 100644 index 000000000000..ec7188da423b --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/engine_plugin.ts @@ -0,0 +1,156 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { JOBS_ENDPOINT_BASE, OPENSEARCH_PANELS_API } from '../../common'; + +export const EnginePlugin = (client: any, config: any, components: any) => { + const clientAction = components.clientAction.factory; + + client.prototype.observability = components.clientAction.namespaceFactory(); + const observability = client.prototype.observability.prototype; + + // Get Object + observability.getObject = clientAction({ + url: { + fmt: OPENSEARCH_PANELS_API.OBJECT, + params: { + objectId: { + type: 'string', + }, + objectIdList: { + type: 'string', + }, + objectType: { + type: 'string', + }, + sortField: { + type: 'string', + }, + sortOrder: { + type: 'string', + }, + fromIndex: { + type: 'number', + }, + maxItems: { + type: 'number', + }, + name: { + type: 'string', + }, + lastUpdatedTimeMs: { + type: 'string', + }, + createdTimeMs: { + type: 'string', + }, + }, + }, + method: 'GET', + }); + + // Get Object by Id + observability.getObjectById = clientAction({ + url: { + fmt: `${OPENSEARCH_PANELS_API.OBJECT}/<%=objectId%>`, + req: { + objectId: { + type: 'string', + required: true, + }, + }, + }, + method: 'GET', + }); + + // Create new Object + observability.createObject = clientAction({ + url: { + fmt: OPENSEARCH_PANELS_API.OBJECT, + }, + method: 'POST', + needBody: true, + }); + + // Update Object by Id + observability.updateObjectById = clientAction({ + url: { + fmt: `${OPENSEARCH_PANELS_API.OBJECT}/<%=objectId%>`, + req: { + objectId: { + type: 'string', + required: true, + }, + }, + }, + method: 'PUT', + needBody: true, + }); + + // Delete Object by Id + observability.deleteObjectById = clientAction({ + url: { + fmt: `${OPENSEARCH_PANELS_API.OBJECT}/<%=objectId%>`, + req: { + objectId: { + type: 'string', + required: true, + }, + }, + }, + method: 'DELETE', + }); + + // Delete Object by Id List + observability.deleteObjectByIdList = clientAction({ + url: { + fmt: OPENSEARCH_PANELS_API.OBJECT, + params: { + objectIdList: { + type: 'string', + required: true, + }, + }, + }, + method: 'DELETE', + }); + + // Get async job status + observability.getJobStatus = clientAction({ + url: { + fmt: `${JOBS_ENDPOINT_BASE}/<%=queryId%>`, + req: { + queryId: { + type: 'string', + required: true, + }, + }, + }, + method: 'GET', + }); + + // Delete async job + observability.deleteJob = clientAction({ + url: { + fmt: `${JOBS_ENDPOINT_BASE}/<%=queryId%>`, + req: { + queryId: { + type: 'string', + required: true, + }, + }, + }, + method: 'DELETE', + }); + + // Run async job + observability.runDirectQuery = clientAction({ + url: { + fmt: `${JOBS_ENDPOINT_BASE}`, + }, + method: 'POST', + needBody: true, + }); +}; diff --git a/plugins-extra/query_enhancements/server/search/ppl/ppl_datasource.ts b/plugins-extra/query_enhancements/server/search/ppl/ppl_datasource.ts new file mode 100644 index 000000000000..c746749e26ec --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/ppl/ppl_datasource.ts @@ -0,0 +1,84 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import _ from 'lodash'; +import { IPPLEventsDataSource, IPPLVisualizationDataSource } from '../../types'; + +type PPLResponse = IPPLEventsDataSource & IPPLVisualizationDataSource; + +export class PPLDataSource { + constructor(private pplDataSource: PPLResponse, private dataType: string) { + if (this.dataType === 'jdbc') { + this.addSchemaRowMapping(); + } else if (this.dataType === 'viz') { + this.addStatsMapping(); + } + } + + private addStatsMapping = () => { + const visData = this.pplDataSource; + + /** + * Add vis mapping for runtime fields + * json data structure added to response will be + * [{ + * agent: "mozilla", + * avg(bytes): 5756 + * ... + * }, { + * agent: "MSIE", + * avg(bytes): 5605 + * ... + * }, { + * agent: "chrome", + * avg(bytes): 5648 + * ... + * }] + */ + const res = []; + if (visData?.metadata?.fields) { + const queriedFields = visData.metadata.fields; + for (let i = 0; i < visData.size; i++) { + const entry: any = {}; + queriedFields.map((field: any) => { + const statsDataSet = visData?.data; + entry[field.name] = statsDataSet[field.name][i]; + }); + res.push(entry); + } + visData.jsonData = res; + } + }; + + /** + * Add 'schemaName: data' entries for UI rendering + */ + private addSchemaRowMapping = () => { + const pplRes = this.pplDataSource; + + const data: any[] = []; + + _.forEach(pplRes.datarows, (row) => { + const record: any = {}; + + for (let i = 0; i < pplRes.schema.length; i++) { + const cur = pplRes.schema[i]; + + if (typeof row[i] === 'object') { + record[cur.name] = JSON.stringify(row[i]); + } else if (typeof row[i] === 'boolean') { + record[cur.name] = row[i].toString(); + } else { + record[cur.name] = row[i]; + } + } + + data.push(record); + }); + pplRes.jsonData = data; + }; + + public getDataSource = (): PPLResponse => this.pplDataSource; +} diff --git a/plugins-extra/query_enhancements/server/search/ppl/ppl_facet.ts b/plugins-extra/query_enhancements/server/search/ppl/ppl_facet.ts new file mode 100644 index 000000000000..5f64d4e625aa --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/ppl/ppl_facet.ts @@ -0,0 +1,42 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import _ from 'lodash'; +import { PPLDataSource } from './ppl_datasource'; + +export class PPLFacet { + constructor(private client: any) { + this.client = client; + } + + private fetch = async (request: any, format: string, responseFormat: string) => { + const res = { + success: false, + data: {}, + }; + try { + const params = { + body: { + query: request.body.query, + }, + }; + if (request.body.format !== 'jdbc') { + params.format = request.body.format; + } + const queryRes = await this.client.asScoped(request).callAsCurrentUser(format, params); + const pplDataSource = new PPLDataSource(queryRes, request.body.format); + res.success = true; + res.data = pplDataSource.getDataSource(); + } catch (err: any) { + console.error('PPL query fetch err: ', err); + res.data = err; + } + return res; + }; + + describeQuery = async (request: any) => { + return this.fetch(request, 'ppl.pplQuery', 'json'); + }; +} diff --git a/plugins-extra/query_enhancements/server/search/ppl/ppl_plugin.ts b/plugins-extra/query_enhancements/server/search/ppl/ppl_plugin.ts new file mode 100644 index 000000000000..85b1cd30a4e4 --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/ppl/ppl_plugin.ts @@ -0,0 +1,89 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { OPENSEARCH_DATACONNECTIONS_API, PPL_ENDPOINT, SQL_ENDPOINT } from '../../../common'; + +export const PPLPlugin = (client: any, config: any, components: any) => { + const ca = components.clientAction.factory; + client.prototype.ppl = components.clientAction.namespaceFactory(); + const ppl = client.prototype.ppl.prototype; + + ppl.pplQuery = ca({ + url: { + fmt: `${PPL_ENDPOINT}`, + params: { + format: { + type: 'string', + required: true, + }, + }, + }, + needBody: true, + method: 'POST', + }); + + ppl.sqlQuery = ca({ + url: { + fmt: `${SQL_ENDPOINT}`, + params: { + format: { + type: 'string', + required: true, + }, + }, + }, + needBody: true, + method: 'POST', + }); + + ppl.getDataConnectionById = ca({ + url: { + fmt: `${OPENSEARCH_DATACONNECTIONS_API.DATACONNECTION}/<%=dataconnection%>`, + req: { + dataconnection: { + type: 'string', + required: true, + }, + }, + }, + method: 'GET', + }); + + ppl.deleteDataConnection = ca({ + url: { + fmt: `${OPENSEARCH_DATACONNECTIONS_API.DATACONNECTION}/<%=dataconnection%>`, + req: { + dataconnection: { + type: 'string', + required: true, + }, + }, + }, + method: 'DELETE', + }); + + ppl.createDataSource = ca({ + url: { + fmt: `${OPENSEARCH_DATACONNECTIONS_API.DATACONNECTION}`, + }, + needBody: true, + method: 'POST', + }); + + ppl.modifyDataConnection = ca({ + url: { + fmt: `${OPENSEARCH_DATACONNECTIONS_API.DATACONNECTION}`, + }, + needBody: true, + method: 'PATCH', + }); + + ppl.getDataConnections = ca({ + url: { + fmt: `${OPENSEARCH_DATACONNECTIONS_API.DATACONNECTION}`, + }, + method: 'GET', + }); +}; diff --git a/plugins-extra/query_enhancements/server/search/ppl/ppl_search_strategy.ts b/plugins-extra/query_enhancements/server/search/ppl/ppl_search_strategy.ts new file mode 100644 index 000000000000..079fdaa55917 --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/ppl/ppl_search_strategy.ts @@ -0,0 +1,119 @@ +import { first } from 'rxjs/operators'; +import { SharedGlobalConfig, Logger, ILegacyClusterClient } from 'opensearch-dashboards/server'; +import { Observable } from 'rxjs'; +import { + ISearchStrategy, + getDefaultSearchParams, + SearchUsage, +} from '../../../../../src/plugins/data/server'; +import { + IDataFrameResponse, + IDataFrameWithAggs, + IOpenSearchDashboardsSearchRequest, + createDataFrame, +} from '../../../../../src/plugins/data/common'; +import { PPLFacet } from './ppl_facet'; +import { getFields } from '../../../common/utils'; + +export const pplSearchStrategyProvider = ( + config$: Observable, + logger: Logger, + client: ILegacyClusterClient, + usage?: SearchUsage +): ISearchStrategy => { + const pplFacet = new PPLFacet(client); + + const parseRequest = (query: string) => { + const pipeMap = new Map(); + const pipeArray = query.split('|'); + pipeArray.forEach((pipe, index) => { + const splitChar = index === 0 ? '=' : ' '; + const split = pipe.trim().split(splitChar); + const key = split[0]; + const value = pipe.replace(index === 0 ? `${key}=` : key, '').trim(); + pipeMap.set(key, value); + }); + + const source = pipeMap.get('source'); + + const describeQuery = `describe ${source}`; + + const searchQuery = `${Array.from(pipeMap.entries()) + .filter(([key]) => key !== 'stats' && key !== 'fields') + .map(([key, value]) => (key === 'source' ? `${key}=${value}` : `${key} ${value}`)) + .join(' | ')} ${pipeMap.has('fields') ? `| fields ${pipeMap.get('fields')}` : ''}`; + + const filters = pipeMap.get('where'); + + const stats = pipeMap.get('stats'); + const aggsQuery = stats + ? `source=${source} ${filters ? `| where ${filters}` : ''} | stats ${stats}` + : undefined; + + return { + map: pipeMap, + describe: describeQuery, + search: searchQuery, + aggs: aggsQuery, + }; + }; + + return { + search: async (context, request: any, options) => { + const config = await config$.pipe(first()).toPromise(); + const uiSettingsClient = await context.core.uiSettings.client; + + const { dataFrameHydrationStrategy, ...defaultParams } = await getDefaultSearchParams( + uiSettingsClient + ); + + try { + const requestParams = parseRequest(request.body.query.qs); + const source = requestParams?.map.get('source'); + const { schema, meta } = request.body.df ?? {}; + request.body.query = + !schema || dataFrameHydrationStrategy === 'perQuery' + ? `source=${source} | head` + : requestParams.search; + const rawResponse: any = await pplFacet.describeQuery(request); + + const dataFrame = createDataFrame({ + name: source, + schema: schema ?? rawResponse.data.schema, + meta, + fields: getFields(rawResponse), + }); + + dataFrame.size = rawResponse.data.datarows.length; + + if (usage) usage.trackSuccess(rawResponse.took); + + if (dataFrame.meta?.aggsQs) { + for (const [key, aggQueryString] of Object.entries(dataFrame.meta.aggsQs)) { + const aggRequest = parseRequest(aggQueryString as string); + const query = aggRequest.aggs; + request.body.query = query; + const rawAggs: any = await pplFacet.describeQuery(request); + (dataFrame as IDataFrameWithAggs).aggs = {}; + (dataFrame as IDataFrameWithAggs).aggs[key] = rawAggs.data.datarows?.map((hit: any) => { + return { + key: hit[1], + value: hit[0], + }; + }); + } + } + + return { + type: 'data_frame', + body: dataFrame, + took: rawResponse.took, + } as IDataFrameResponse; + } catch (e) { + logger.error(`pplSearchStrategy: ${e.message}`); + if (usage) usage.trackError(); + throw e; + } + }, + }; +}; diff --git a/plugins-extra/query_enhancements/server/search/sql/sql_facet.ts b/plugins-extra/query_enhancements/server/search/sql/sql_facet.ts new file mode 100644 index 000000000000..08724dee8ea6 --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/sql/sql_facet.ts @@ -0,0 +1,38 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export class SQLFacet { + constructor(private client: any) { + this.client = client; + } + + private fetch = async (request: any, format: string, responseFormat: string) => { + const res = { + success: false, + data: {}, + }; + try { + const params = { + body: { + query: request.body.query, + }, + }; + if (request.body.format !== 'jdbc') { + params.format = request.body.format; + } + const queryRes = await this.client.asScoped(request).callAsCurrentUser(format, params); + res.success = true; + res.data = queryRes; + } catch (err: any) { + console.error('SQL query fetch err: ', err); + res.data = err; + } + return res; + }; + + describeQuery = async (request: any) => { + return this.fetch(request, 'ppl.sqlQuery', 'json'); + }; +} diff --git a/plugins-extra/query_enhancements/server/search/sql/sql_search_strategy.ts b/plugins-extra/query_enhancements/server/search/sql/sql_search_strategy.ts new file mode 100644 index 000000000000..25fb0518c92e --- /dev/null +++ b/plugins-extra/query_enhancements/server/search/sql/sql_search_strategy.ts @@ -0,0 +1,59 @@ +import { SharedGlobalConfig, Logger, ILegacyClusterClient } from 'opensearch-dashboards/server'; +import { Observable } from 'rxjs'; +import { ISearchStrategy, SearchUsage } from '../../../../../src/plugins/data/server'; +import { + IDataFrameResponse, + IOpenSearchDashboardsSearchRequest, + PartialDataFrame, + createDataFrame, +} from '../../../../../src/plugins/data/common'; +import { SQLFacet } from './sql_facet'; + +export const sqlSearchStrategyProvider = ( + config$: Observable, + logger: Logger, + client: ILegacyClusterClient, + usage?: SearchUsage +): ISearchStrategy => { + const sqlFacet = new SQLFacet(client); + + return { + search: async (context, request: any, options) => { + try { + request.body.query = request.body.query.qs; + const rawResponse: any = await sqlFacet.describeQuery(request); + + if (!rawResponse.success) { + return { + type: 'data_frame', + body: { error: rawResponse.data }, + took: rawResponse.took, + }; + } + + const partial: PartialDataFrame = { + name: '', + fields: rawResponse.data?.schema || [], + }; + const dataFrame = createDataFrame(partial); + dataFrame.fields.forEach((field, index) => { + field.values = rawResponse.data.datarows.map((row: any) => row[index]); + }); + + dataFrame.size = rawResponse.data.datarows?.length || 0; + + if (usage) usage.trackSuccess(rawResponse.took); + + return { + type: 'data_frame', + body: dataFrame, + took: rawResponse.took, + } as IDataFrameResponse; + } catch (e) { + logger.error(`sqlSearchStrategy: ${e.message}`); + if (usage) usage.trackError(); + throw e; + } + }, + }; +}; diff --git a/plugins-extra/query_enhancements/server/types.ts b/plugins-extra/query_enhancements/server/types.ts new file mode 100644 index 000000000000..4279d2bd5f9e --- /dev/null +++ b/plugins-extra/query_enhancements/server/types.ts @@ -0,0 +1,35 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { DataPluginSetup } from 'src/plugins/data/server/plugin'; +import { HomeServerPluginSetup } from 'src/plugins/home/server/plugin'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface QueryEnhancementsPluginSetup {} +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface QueryEnhancementsPluginStart {} +export interface QueryEnhancementsPluginSetupDependencies { + data: DataPluginSetup; + home?: HomeServerPluginSetup; +} + +export interface ISchema { + name: string; + type: string; +} + +export interface IPPLVisualizationDataSource { + data: any; + metadata: any; + jsonData?: any[]; + size: number; + status: number; +} + +export interface IPPLEventsDataSource { + schema: ISchema[]; + datarows: any[]; + jsonData?: any[]; +} diff --git a/plugins-extra/query_enhancements/target/public/.osd-optimizer-cache b/plugins-extra/query_enhancements/target/public/.osd-optimizer-cache new file mode 100644 index 000000000000..f219c45e5133 --- /dev/null +++ b/plugins-extra/query_enhancements/target/public/.osd-optimizer-cache @@ -0,0 +1,283 @@ +{ + "bundleRefExportIds": [ + "plugin/data/common", + "plugin/data/public" + ], + "optimizerCacheKey": { + "lastCommit": "f822702cfc4466201f6c48d805513f5d8c82d52e", + "bootstrap": "# this is only human readable for debugging, please don't try to parse this\n@opensearch/datemath:e8a0aa4bfa58b7e1ce33199312a243fc842bd4b6\n@osd/babel-preset:b4767f884e88226a971256acad6fe0732c240fcb\n@osd/config-schema:adc4cd2effd704bffe0dc2123a5e4abd112b36e2\n@osd/cross-platform:b6f1f574ae78dc6e839db12b29f1f5c723d16b76\n@osd/dev-utils:ebb9202ee418c8f5af6502ed6a01e035502af5ac\n@osd/expect:6cba2164a2c06247ac6e0b642afd65a26e62f89a\n@osd/i18n:aa4b642b623de5d50a13f0accb3141675db49bed\n@osd/monaco:8bbebc99e7ec2eaefca49edd2178dd9b2be71307\n@osd/optimizer:e45d35ed6e37b7926689320d0f6d1cd8993a4bf4\n@osd/std:81ea91c582de89af9a0c59e30160b034d6214067\n@osd/ui-shared-deps:cd9efa0258ecaf1baae4c3db48602d077b355522\n@osd/utility-types:11576bba0579e232c7f810531f91340b28f1837b\n@osd/utils:4a161ff90a02d2e5f7a57a2092d11a0c82648090", + "deletedPaths": [], + "modifiedTimes": { + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/src/cli.ts": 1717101651177.3801, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/src/node/node_auto_tranpilation.ts": 1717101651177.3801, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/src/optimizer/optimizer_config.ts": 1717101651177.3801 + }, + "workerConfig": { + "dist": false, + "repoRoot": "/home/ubuntu/repos/OpenSearch-Dashboards-1", + "optimizerCacheKey": "♻", + "themeTags": [ + "v7dark", + "v7light", + "v8dark", + "v8light" + ], + "browserslistEnv": "dev" + } + }, + "cacheKey": { + "spec": { + "type": "plugin", + "id": "queryEnhancements", + "publicDirNames": [ + "public" + ], + "contextDir": "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements", + "sourceRoot": "/home/ubuntu/repos/OpenSearch-Dashboards-1", + "outputDir": "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/target/public", + "manifestPath": "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/opensearch_dashboards.json" + }, + "mtimes": { + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/functions/_colors.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/functions/_index.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/functions/_math.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_beta_badge.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_button.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_form.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_header.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_helpers.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_icons.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_index.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_loading.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_panel.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_popover.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_range.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_responsive.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_shadow.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_size.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_states.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_tool_tip.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_typography.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_animations.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_borders.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_buttons.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_collapsible_nav.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_colors.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_form.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_header.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_index.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_page.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_panel.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_responsive.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_shadows.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_size.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_states.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_tool_tip.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_typography.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_z_index.scss": 1707998946721.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/eui_next_colors_dark.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/eui_next_colors_light.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/eui_next_globals.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/functions/_colors.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/functions/_index.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/functions/_math.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_beta_badge.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_button.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_form.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_header.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_helpers.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_icons.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_index.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_loading.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_panel.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_popover.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_range.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_responsive.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_shadow.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_size.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_states.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_tool_tip.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_typography.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_animations.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_borders.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_buttons.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_collapsible_nav.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_colors.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_form.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_header.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_index.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_page.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_panel.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_responsive.scss": 1717100110477.2583, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_shadows.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_size.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_states.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_tool_tip.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_typography.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_z_index.scss": 1717100110481.2588, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui/eui_colors_dark.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui/eui_colors_light.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui/eui_globals.scss": 1717100110473.2576, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/package.json": 1684785209115, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/punycode/package.json": 1684785207269, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/url/package.json": 1684785207306.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/querystring-es3/package.json": 1684785207279, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/style-loader/package.json": 1684785209173, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/webpack/package.json": 1684970338332.999, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/postcss.config.js": 1705447209411.1094, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/target/worker/entry_point_creator.js": 1717101288189.5818, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/assert_never.js": 1717100131268.0115, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/clean.js": 1717100131280.013, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/deep_freeze.js": 1717100131288.0137, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/get_flattened_object.js": 1717100131312.0164, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/get.js": 1717100131304.0154, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/index.js": 1717100131320.017, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/json.js": 1717100131380.0237, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/map_to_object.js": 1717100131384.0242, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/merge.js": 1717100131404.0264, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/pick.js": 1717100131404.0264, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/promise.js": 1717100131412.027, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/rxjs_7.js": 1717100131416.0276, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/unset.js": 1717100131420.028, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/url.js": 1717100131428.0288, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/validate_object.js": 1717100131436.0298, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-ui-shared-deps/public_path_module_creator.js": 1701821573665.384, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/common/index.ts": 1717093988997.183, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/common/utils.ts": 1714417638893.4275, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/opensearch_dashboards.json": 1717100454166.247, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/index.scss": 1717100427733.2249, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/index.ts": 1717100974445.1145, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/plugin.ts": 1717101262073.6348, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/search/ppl_search_interceptor.ts": 1717101507043.1458, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/search/sql_search_interceptor.ts": 1717101514615.246, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/types.ts": 1717101148958.7913, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v7dark.scss": 1701821573693.384, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v7light.scss": 1701821573693.384, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v8dark.scss": 1705447209443.1094, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v8light.scss": 1705447209443.1094, + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_mixins.scss": 1708643812341.4402 + } + }, + "moduleCount": 44, + "workUnits": 1023, + "files": [ + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/functions/_colors.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/functions/_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/functions/_math.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_beta_badge.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_button.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_form.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_header.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_helpers.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_icons.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_loading.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_panel.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_popover.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_range.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_responsive.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_shadow.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_size.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_states.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_tool_tip.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/mixins/_typography.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_animations.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_borders.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_buttons.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_collapsible_nav.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_colors.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_form.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_header.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_page.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_panel.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_responsive.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_shadows.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_size.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_states.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_tool_tip.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_typography.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/global_styling/variables/_z_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/eui_next_colors_dark.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/eui_next_colors_light.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/eui_next_globals.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/functions/_colors.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/functions/_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/functions/_math.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_beta_badge.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_button.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_form.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_header.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_helpers.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_icons.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_loading.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_panel.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_popover.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_range.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_responsive.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_shadow.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_size.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_states.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_tool_tip.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/mixins/_typography.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_animations.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_borders.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_buttons.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_collapsible_nav.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_colors.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_form.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_header.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_page.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_panel.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_responsive.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_shadows.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_size.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_states.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_tool_tip.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_typography.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui-next/global_styling/variables/_z_index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui/eui_colors_dark.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui/eui_colors_light.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/@elastic/eui/src/themes/eui/eui_globals.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/package.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/punycode/package.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/url/package.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/querystring-es3/package.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/style-loader/package.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/webpack/package.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/postcss.config.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-optimizer/target/worker/entry_point_creator.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/assert_never.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/clean.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/deep_freeze.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/get_flattened_object.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/get.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/index.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/json.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/map_to_object.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/merge.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/pick.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/promise.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/rxjs_7.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/unset.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/url.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-std/target/web/validate_object.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/packages/osd-ui-shared-deps/public_path_module_creator.js", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/common/index.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/common/utils.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/opensearch_dashboards.json", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/index.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/index.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/plugin.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/search/ppl_search_interceptor.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/search/sql_search_interceptor.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/plugins-extra/query_enhancements/public/types.ts", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v7dark.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v7light.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v8dark.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_globals_v8light.scss", + "/home/ubuntu/repos/OpenSearch-Dashboards-1/src/core/public/core_app/styles/_mixins.scss" + ] +} \ No newline at end of file diff --git a/plugins-extra/query_enhancements/target/public/queryEnhancements.plugin.js b/plugins-extra/query_enhancements/target/public/queryEnhancements.plugin.js new file mode 100644 index 000000000000..81d34798161e --- /dev/null +++ b/plugins-extra/query_enhancements/target/public/queryEnhancements.plugin.js @@ -0,0 +1,4172 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "../../packages/osd-optimizer/target/worker/entry_point_creator.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!../../node_modules/comment-stripper/index.js?!../../node_modules/sass-loader/dist/cjs.js?!./public/index.scss?v7dark": +/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-0-1!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/postcss-loader/dist/cjs.js??ref--6-oneOf-0-2!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/comment-stripper??ref--6-oneOf-0-3!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-0-4!./public/index.scss?v7dark ***! + \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js */ "../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a); +// Module +___CSS_LOADER_EXPORT___.push([module.i, "/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n", "",{"version":3,"sources":["webpack://./public/index.scss"],"names":[],"mappings":"AAAA;;;;;;;;;EASE","sourcesContent":["/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!../../node_modules/comment-stripper/index.js?!../../node_modules/sass-loader/dist/cjs.js?!./public/index.scss?v7light": +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/postcss-loader/dist/cjs.js??ref--6-oneOf-1-2!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/comment-stripper??ref--6-oneOf-1-3!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-1-4!./public/index.scss?v7light ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js */ "../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a); +// Module +___CSS_LOADER_EXPORT___.push([module.i, "/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n", "",{"version":3,"sources":["webpack://./public/index.scss"],"names":[],"mappings":"AAAA;;;;;;;;;EASE","sourcesContent":["/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!../../node_modules/comment-stripper/index.js?!../../node_modules/sass-loader/dist/cjs.js?!./public/index.scss?v8dark": +/*!*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-2-1!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/postcss-loader/dist/cjs.js??ref--6-oneOf-2-2!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/comment-stripper??ref--6-oneOf-2-3!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-2-4!./public/index.scss?v8dark ***! + \*************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js */ "../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a); +// Module +___CSS_LOADER_EXPORT___.push([module.i, "/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n", "",{"version":3,"sources":["webpack://./public/index.scss"],"names":[],"mappings":"AAAA;;;;;;;;;EASE","sourcesContent":["/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "../../node_modules/css-loader/dist/cjs.js?!../../node_modules/postcss-loader/dist/cjs.js?!../../node_modules/comment-stripper/index.js?!../../node_modules/sass-loader/dist/cjs.js?!./public/index.scss?v8light": +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/postcss-loader/dist/cjs.js??ref--6-oneOf-3-2!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/comment-stripper??ref--6-oneOf-3-3!/home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/sass-loader/dist/cjs.js??ref--6-oneOf-3-4!./public/index.scss?v8light ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js */ "../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "../../node_modules/css-loader/dist/runtime/api.js"); +/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); +// Imports + + +var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_css_loader_dist_runtime_cssWithMappingToString_js__WEBPACK_IMPORTED_MODULE_0___default.a); +// Module +___CSS_LOADER_EXPORT___.push([module.i, "/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n", "",{"version":3,"sources":["webpack://./public/index.scss"],"names":[],"mappings":"AAAA;;;;;;;;;EASE","sourcesContent":["/*!\n * SPDX-License-Identifier: Apache-2.0\n *\n * The OpenSearch Contributors require contributions made to\n * this file be licensed under the Apache-2.0 license or a\n * compatible open source license.\n *\n * Modifications Copyright OpenSearch Contributors. See\n * GitHub history for details.\n */\n\n\n"],"sourceRoot":""}]); +// Exports +/* harmony default export */ __webpack_exports__["default"] = (___CSS_LOADER_EXPORT___); + + +/***/ }), + +/***/ "../../node_modules/css-loader/dist/runtime/api.js": +/*!**********************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/dist/runtime/api.js ***! + \**********************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +/* + MIT License http://www.opensource.org/licenses/mit-license.php + Author Tobias Koppers @sokra +*/ +// css base code, injected by the css-loader +// eslint-disable-next-line func-names +module.exports = function (cssWithMappingToString) { + var list = []; // return the list of modules as css string + + list.toString = function toString() { + return this.map(function (item) { + var content = cssWithMappingToString(item); + + if (item[2]) { + return "@media ".concat(item[2], " {").concat(content, "}"); + } + + return content; + }).join(""); + }; // import a list of modules into the list + // eslint-disable-next-line func-names + + + list.i = function (modules, mediaQuery, dedupe) { + if (typeof modules === "string") { + // eslint-disable-next-line no-param-reassign + modules = [[null, modules, ""]]; + } + + var alreadyImportedModules = {}; + + if (dedupe) { + for (var i = 0; i < this.length; i++) { + // eslint-disable-next-line prefer-destructuring + var id = this[i][0]; + + if (id != null) { + alreadyImportedModules[id] = true; + } + } + } + + for (var _i = 0; _i < modules.length; _i++) { + var item = [].concat(modules[_i]); + + if (dedupe && alreadyImportedModules[item[0]]) { + // eslint-disable-next-line no-continue + continue; + } + + if (mediaQuery) { + if (!item[2]) { + item[2] = mediaQuery; + } else { + item[2] = "".concat(mediaQuery, " and ").concat(item[2]); + } + } + + list.push(item); + } + }; + + return list; +}; + +/***/ }), + +/***/ "../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js": +/*!*****************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/css-loader/dist/runtime/cssWithMappingToString.js ***! + \*****************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +module.exports = function cssWithMappingToString(item) { + var _item = _slicedToArray(item, 4), + content = _item[1], + cssMapping = _item[3]; + + if (!cssMapping) { + return content; + } + + if (typeof btoa === "function") { + // eslint-disable-next-line no-undef + var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping)))); + var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64); + var sourceMapping = "/*# ".concat(data, " */"); + var sourceURLs = cssMapping.sources.map(function (source) { + return "/*# sourceURL=".concat(cssMapping.sourceRoot || "").concat(source, " */"); + }); + return [content].concat(sourceURLs).concat([sourceMapping]).join("\n"); + } + + return [content].join("\n"); +}; + +/***/ }), + +/***/ "../../node_modules/node-libs-browser/node_modules/punycode/punycode.js": +/*!*******************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/punycode/punycode.js ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module, global) {var __WEBPACK_AMD_DEFINE_RESULT__;/*! https://mths.be/punycode v1.4.1 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = true && exports && + !exports.nodeType && exports; + var freeModule = true && module && + !module.nodeType && module; + var freeGlobal = typeof global == 'object' && global; + if ( + freeGlobal.global === freeGlobal || + freeGlobal.window === freeGlobal || + freeGlobal.self === freeGlobal + ) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw new RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + var result = []; + while (length--) { + result[length] = fn(array[length]); + } + return result; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ + function toASCII(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.4.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + true + ) { + !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { + return punycode; + }).call(exports, __webpack_require__, exports, module), + __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); + } else {} + +}(this)); + +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/module.js */ "../../node_modules/webpack/buildin/module.js")(module), __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "../../node_modules/webpack/buildin/global.js"))) + +/***/ }), + +/***/ "../../node_modules/node-libs-browser/node_modules/url/url.js": +/*!*********************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/url/url.js ***! + \*********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +var punycode = __webpack_require__(/*! punycode */ "../../node_modules/node-libs-browser/node_modules/punycode/punycode.js"); +var util = __webpack_require__(/*! ./util */ "../../node_modules/node-libs-browser/node_modules/url/util.js"); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // Special case for a simple path URL + simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = __webpack_require__(/*! querystring */ "../../node_modules/querystring-es3/index.js"); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && util.isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!util.isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + // Copy chrome, IE, opera backslash-handling behavior. + // Back slashes before the query string get converted to forward slashes + // See: https://code.google.com/p/chromium/issues/detail?id=25916 + var queryIndex = url.indexOf('?'), + splitter = + (queryIndex !== -1 && queryIndex < url.indexOf('#')) ? '?' : '#', + uSplit = url.split(splitter), + slashRegex = /\\/g; + uSplit[0] = uSplit[0].replace(slashRegex, '/'); + url = uSplit.join(splitter); + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + if (!slashesDenoteHost && url.split('#').length === 1) { + // Try fast path regexp + var simplePath = simplePathPattern.exec(rest); + if (simplePath) { + this.path = rest; + this.href = rest; + this.pathname = simplePath[1]; + if (simplePath[2]) { + this.search = simplePath[2]; + if (parseQueryString) { + this.query = querystring.parse(this.search.substr(1)); + } else { + this.query = this.search.substr(1); + } + } else if (parseQueryString) { + this.search = ''; + this.query = {}; + } + return this; + } + } + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a punycoded representation of "domain". + // It only converts parts of the domain name that + // have non-ASCII characters, i.e. it doesn't matter if + // you call it with a domain that already is ASCII-only. + this.hostname = punycode.toASCII(this.hostname); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + if (rest.indexOf(ae) === -1) + continue; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (util.isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + util.isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (util.isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + var tkeys = Object.keys(this); + for (var tk = 0; tk < tkeys.length; tk++) { + var tkey = tkeys[tk]; + result[tkey] = this[tkey]; + } + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + var rkeys = Object.keys(relative); + for (var rk = 0; rk < rkeys.length; rk++) { + var rkey = rkeys[rk]; + if (rkey !== 'protocol') + result[rkey] = relative[rkey]; + } + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + var keys = Object.keys(relative); + for (var v = 0; v < keys.length; v++) { + var k = keys[v]; + result[k] = relative[k]; + } + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!util.isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host || srcPath.length > 1) && + (last === '.' || last === '..') || last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last === '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especially happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!util.isNull(result.pathname) || !util.isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; + + +/***/ }), + +/***/ "../../node_modules/node-libs-browser/node_modules/url/util.js": +/*!**********************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/node-libs-browser/node_modules/url/util.js ***! + \**********************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + isString: function(arg) { + return typeof(arg) === 'string'; + }, + isObject: function(arg) { + return typeof(arg) === 'object' && arg !== null; + }, + isNull: function(arg) { + return arg === null; + }, + isNullOrUndefined: function(arg) { + return arg == null; + } +}; + + +/***/ }), + +/***/ "../../node_modules/querystring-es3/decode.js": +/*!*****************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/querystring-es3/decode.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + + +/***/ }), + +/***/ "../../node_modules/querystring-es3/encode.js": +/*!*****************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/querystring-es3/encode.js ***! + \*****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + + +/***/ }), + +/***/ "../../node_modules/querystring-es3/index.js": +/*!****************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/querystring-es3/index.js ***! + \****************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.decode = exports.parse = __webpack_require__(/*! ./decode */ "../../node_modules/querystring-es3/decode.js"); +exports.encode = exports.stringify = __webpack_require__(/*! ./encode */ "../../node_modules/querystring-es3/encode.js"); + + +/***/ }), + +/***/ "../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": +/*!*********************************************************************************************************************!*\ + !*** /home/ubuntu/repos/OpenSearch-Dashboards-1/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! + \*********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var isOldIE = function isOldIE() { + var memo; + return function memorize() { + if (typeof memo === 'undefined') { + // Test for IE <= 9 as proposed by Browserhacks + // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 + // Tests for existence of standard globals is to allow style-loader + // to operate correctly into non-standard environments + // @see https://github.com/webpack-contrib/style-loader/issues/177 + memo = Boolean(window && document && document.all && !window.atob); + } + + return memo; + }; +}(); + +var getTarget = function getTarget() { + var memo = {}; + return function memorize(target) { + if (typeof memo[target] === 'undefined') { + var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself + + if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { + try { + // This will throw an exception if access to iframe is blocked + // due to cross-origin restrictions + styleTarget = styleTarget.contentDocument.head; + } catch (e) { + // istanbul ignore next + styleTarget = null; + } + } + + memo[target] = styleTarget; + } + + return memo[target]; + }; +}(); + +var stylesInDom = []; + +function getIndexByIdentifier(identifier) { + var result = -1; + + for (var i = 0; i < stylesInDom.length; i++) { + if (stylesInDom[i].identifier === identifier) { + result = i; + break; + } + } + + return result; +} + +function modulesToDom(list, options) { + var idCountMap = {}; + var identifiers = []; + + for (var i = 0; i < list.length; i++) { + var item = list[i]; + var id = options.base ? item[0] + options.base : item[0]; + var count = idCountMap[id] || 0; + var identifier = "".concat(id, " ").concat(count); + idCountMap[id] = count + 1; + var index = getIndexByIdentifier(identifier); + var obj = { + css: item[1], + media: item[2], + sourceMap: item[3] + }; + + if (index !== -1) { + stylesInDom[index].references++; + stylesInDom[index].updater(obj); + } else { + stylesInDom.push({ + identifier: identifier, + updater: addStyle(obj, options), + references: 1 + }); + } + + identifiers.push(identifier); + } + + return identifiers; +} + +function insertStyleElement(options) { + var style = document.createElement('style'); + var attributes = options.attributes || {}; + + if (typeof attributes.nonce === 'undefined') { + var nonce = true ? __webpack_require__.nc : undefined; + + if (nonce) { + attributes.nonce = nonce; + } + } + + Object.keys(attributes).forEach(function (key) { + style.setAttribute(key, attributes[key]); + }); + + if (typeof options.insert === 'function') { + options.insert(style); + } else { + var target = getTarget(options.insert || 'head'); + + if (!target) { + throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid."); + } + + target.appendChild(style); + } + + return style; +} + +function removeStyleElement(style) { + // istanbul ignore if + if (style.parentNode === null) { + return false; + } + + style.parentNode.removeChild(style); +} +/* istanbul ignore next */ + + +var replaceText = function replaceText() { + var textStore = []; + return function replace(index, replacement) { + textStore[index] = replacement; + return textStore.filter(Boolean).join('\n'); + }; +}(); + +function applyToSingletonTag(style, index, remove, obj) { + var css = remove ? '' : obj.media ? "@media ".concat(obj.media, " {").concat(obj.css, "}") : obj.css; // For old IE + + /* istanbul ignore if */ + + if (style.styleSheet) { + style.styleSheet.cssText = replaceText(index, css); + } else { + var cssNode = document.createTextNode(css); + var childNodes = style.childNodes; + + if (childNodes[index]) { + style.removeChild(childNodes[index]); + } + + if (childNodes.length) { + style.insertBefore(cssNode, childNodes[index]); + } else { + style.appendChild(cssNode); + } + } +} + +function applyToTag(style, options, obj) { + var css = obj.css; + var media = obj.media; + var sourceMap = obj.sourceMap; + + if (media) { + style.setAttribute('media', media); + } else { + style.removeAttribute('media'); + } + + if (sourceMap && typeof btoa !== 'undefined') { + css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */"); + } // For old IE + + /* istanbul ignore if */ + + + if (style.styleSheet) { + style.styleSheet.cssText = css; + } else { + while (style.firstChild) { + style.removeChild(style.firstChild); + } + + style.appendChild(document.createTextNode(css)); + } +} + +var singleton = null; +var singletonCounter = 0; + +function addStyle(obj, options) { + var style; + var update; + var remove; + + if (options.singleton) { + var styleIndex = singletonCounter++; + style = singleton || (singleton = insertStyleElement(options)); + update = applyToSingletonTag.bind(null, style, styleIndex, false); + remove = applyToSingletonTag.bind(null, style, styleIndex, true); + } else { + style = insertStyleElement(options); + update = applyToTag.bind(null, style, options); + + remove = function remove() { + removeStyleElement(style); + }; + } + + update(obj); + return function updateStyle(newObj) { + if (newObj) { + if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) { + return; + } + + update(obj = newObj); + } else { + remove(); + } + }; +} + +module.exports = function (list, options) { + options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of