From 622f56c564fec24bac54c546e722f0983ce9c816 Mon Sep 17 00:00:00 2001 From: Nick Harris Date: Thu, 28 Jul 2022 13:24:20 -0500 Subject: [PATCH 1/5] added snapshot test --- .github/workflows/build-main.yml | 1 - dist/index.js | 31957 +++++++--------- dist/index.js.map | 2 +- dist/licenses.txt | 412 +- package-lock.json | 3522 +- package.json | 10 +- src/__snapshots__/trace-provider.test.ts.snap | 19 + src/runner.ts | 5 +- src/trace-junit.test.ts | 56 +- src/trace-junit.ts | 8 +- src/trace-provider.test.ts | 194 +- src/trace-provider.ts | 4 + 12 files changed, 15082 insertions(+), 21108 deletions(-) create mode 100644 src/__snapshots__/trace-provider.test.ts.snap diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 45a5f76..c7c472b 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -62,4 +62,3 @@ jobs: with: token: "${{ secrets.BUILD_PAT }}" release-type: node - package-name: otel-upload-test-artifact-action diff --git a/dist/index.js b/dist/index.js index 082c112..5945725 100644 --- a/dist/index.js +++ b/dist/index.js @@ -102,6 +102,7 @@ exports.run = void 0; const github = __importStar(__nccwpck_require__(5438)); const artifact = __importStar(__nccwpck_require__(2605)); const core = __importStar(__nccwpck_require__(2186)); +const glob = __importStar(__nccwpck_require__(8090)); const api_1 = __nccwpck_require__(5163); const trace_provider_1 = __nccwpck_require__(1745); const trace_junit_1 = __nccwpck_require__(1737); @@ -147,12 +148,13 @@ async function run() { return; } const startTime = new Date(step.started_at); + const globber = await glob.create(path, { matchDirectories: false }); core.info("Trace Test file"); if (type === "junit") { await (0, trace_junit_1.traceJunitArtifact)({ trace: api_1.trace, tracer, - path, + filesGenerator: globber.globGenerator(), startTime, baseHtmlUrl: `${ghContext.serverUrl}/${ghContext.repo.owner}/${ghContext.repo.repo}`, }); @@ -223,10 +225,8 @@ exports.traceTestCase = exports.traceTestSuite = exports.traceTestSuites = expor const api_1 = __nccwpck_require__(5163); const junit2json_1 = __nccwpck_require__(8027); const fs = __importStar(__nccwpck_require__(5747)); -const glob = __importStar(__nccwpck_require__(8090)); const core = __importStar(__nccwpck_require__(2186)); -async function traceJunitArtifact({ trace, tracer, path, startTime, baseHtmlUrl, }) { - const globber = await glob.create(path, { matchDirectories: false }); +async function traceJunitArtifact({ trace, tracer, filesGenerator, startTime, baseHtmlUrl, }) { let endTimeSec = 0; let code = api_1.SpanStatusCode.OK; const ctx = api_1.ROOT_CONTEXT; @@ -240,7 +240,7 @@ async function traceJunitArtifact({ trace, tracer, path, startTime, baseHtmlUrl, }, ctx); let numFiles = 0; try { - for await (const file of globber.globGenerator()) { + for await (const file of filesGenerator) { core.debug(`Tracing file: ${file}`); numFiles++; const xmlString = fs.readFileSync(file, { encoding: "utf-8" }); @@ -480,9 +480,10 @@ const sdk_trace_base_1 = __nccwpck_require__(9253); const semantic_conventions_1 = __nccwpck_require__(7275); const opentelemetry_exporter_trace_otlp_file_1 = __nccwpck_require__(8595); const resources_1 = __nccwpck_require__(3871); -function createTracerProvider({ traceLogFilePath, serviceName, serviceInstanceId, serviceNamespace, serviceVersion, }) { +function createTracerProvider({ traceLogFilePath, serviceName, serviceInstanceId, serviceNamespace, serviceVersion, idGenerator, }) { const exporter = new opentelemetry_exporter_trace_otlp_file_1.FileTraceExporter({ filePath: traceLogFilePath }); const tracerProvider = new sdk_trace_base_1.BasicTracerProvider({ + idGenerator, resource: new resources_1.Resource({ [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: serviceName, [semantic_conventions_1.SemanticResourceAttributes.SERVICE_INSTANCE_ID]: serviceInstanceId, @@ -3540,7 +3541,7 @@ var MatchKind; /***/ }), -/***/ 1934: +/***/ 1849: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -3775,7 +3776,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Path = void 0; const path = __importStar(__nccwpck_require__(5622)); -const pathHelper = __importStar(__nccwpck_require__(1934)); +const pathHelper = __importStar(__nccwpck_require__(1849)); const assert_1 = __importDefault(__nccwpck_require__(2357)); const IS_WINDOWS = process.platform === 'win32'; /** @@ -3891,7 +3892,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.partialMatch = exports.match = exports.getSearchPaths = void 0; -const pathHelper = __importStar(__nccwpck_require__(1934)); +const pathHelper = __importStar(__nccwpck_require__(1849)); const internal_match_kind_1 = __nccwpck_require__(1063); const IS_WINDOWS = process.platform === 'win32'; /** @@ -3997,7 +3998,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Pattern = void 0; const os = __importStar(__nccwpck_require__(2087)); const path = __importStar(__nccwpck_require__(5622)); -const pathHelper = __importStar(__nccwpck_require__(1934)); +const pathHelper = __importStar(__nccwpck_require__(1849)); const assert_1 = __importDefault(__nccwpck_require__(2357)); const minimatch_1 = __nccwpck_require__(3973); const internal_match_kind_1 = __nccwpck_require__(1063); @@ -7216,6 +7217,533 @@ exports.request = request; //# sourceMappingURL=index.js.map +/***/ }), + +/***/ 9956: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0; +/** + * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses + * constant NoopMetrics for all of its methods. + */ +class NoopMeter { + constructor() { } + /** + * @see {@link Meter.createHistogram} + */ + createHistogram(_name, _options) { + return exports.NOOP_HISTOGRAM_METRIC; + } + /** + * @see {@link Meter.createCounter} + */ + createCounter(_name, _options) { + return exports.NOOP_COUNTER_METRIC; + } + /** + * @see {@link Meter.createUpDownCounter} + */ + createUpDownCounter(_name, _options) { + return exports.NOOP_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableGauge} + */ + createObservableGauge(_name, _options) { + return exports.NOOP_OBSERVABLE_GAUGE_METRIC; + } + /** + * @see {@link Meter.createObservableCounter} + */ + createObservableCounter(_name, _options) { + return exports.NOOP_OBSERVABLE_COUNTER_METRIC; + } + /** + * @see {@link Meter.createObservableUpDownCounter} + */ + createObservableUpDownCounter(_name, _options) { + return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC; + } + /** + * @see {@link Meter.addBatchObservableCallback} + */ + addBatchObservableCallback(_callback, _observables) { } + /** + * @see {@link Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(_callback) { } +} +exports.NoopMeter = NoopMeter; +class NoopMetric { +} +exports.NoopMetric = NoopMetric; +class NoopCounterMetric extends NoopMetric { + add(_value, _attributes) { } +} +exports.NoopCounterMetric = NoopCounterMetric; +class NoopUpDownCounterMetric extends NoopMetric { + add(_value, _attributes) { } +} +exports.NoopUpDownCounterMetric = NoopUpDownCounterMetric; +class NoopHistogramMetric extends NoopMetric { + record(_value, _attributes) { } +} +exports.NoopHistogramMetric = NoopHistogramMetric; +class NoopObservableMetric { + addCallback(_callback) { } + removeCallback(_callback) { } +} +exports.NoopObservableMetric = NoopObservableMetric; +class NoopObservableCounterMetric extends NoopObservableMetric { +} +exports.NoopObservableCounterMetric = NoopObservableCounterMetric; +class NoopObservableGaugeMetric extends NoopObservableMetric { +} +exports.NoopObservableGaugeMetric = NoopObservableGaugeMetric; +class NoopObservableUpDownCounterMetric extends NoopObservableMetric { +} +exports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric; +exports.NOOP_METER = new NoopMeter(); +// Synchronous instruments +exports.NOOP_COUNTER_METRIC = new NoopCounterMetric(); +exports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric(); +exports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric(); +// Asynchronous instruments +exports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric(); +exports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric(); +exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric(); +//# sourceMappingURL=NoopMeter.js.map + +/***/ }), + +/***/ 9485: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0; +const NoopMeter_1 = __nccwpck_require__(9956); +/** + * An implementation of the {@link MeterProvider} which returns an impotent Meter + * for all calls to `getMeter` + */ +class NoopMeterProvider { + getMeter(_name, _version, _options) { + return NoopMeter_1.NOOP_METER; + } +} +exports.NoopMeterProvider = NoopMeterProvider; +exports.NOOP_METER_PROVIDER = new NoopMeterProvider(); +//# sourceMappingURL=NoopMeterProvider.js.map + +/***/ }), + +/***/ 8297: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_METRICS_API_KEY = void 0; +const platform_1 = __nccwpck_require__(2890); +exports.GLOBAL_METRICS_API_KEY = Symbol.for('io.opentelemetry.js.api.metrics'); +exports._global = platform_1._globalThis; +/** + * Make a function which accepts a version integer and returns the instance of an API if the version + * is compatible, or a fallback version (usually NOOP) if it is not. + * + * @param requiredVersion Backwards compatibility version which is required to return the instance + * @param instance Instance which should be returned if the required version is compatible + * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible + */ +function makeGetter(requiredVersion, instance, fallback) { + return (version) => version === requiredVersion ? instance : fallback; +} +exports.makeGetter = makeGetter; +/** + * A number which should be incremented each time a backwards incompatible + * change is made to the API. This number is used when an API package + * attempts to access the global API to ensure it is getting a compatible + * version. If the global API is not compatible with the API package + * attempting to get it, a NOOP API implementation will be returned. + */ +exports.API_BACKWARDS_COMPATIBILITY_VERSION = 4; +//# sourceMappingURL=global-utils.js.map + +/***/ }), + +/***/ 3910: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MetricsAPI = void 0; +const NoopMeterProvider_1 = __nccwpck_require__(9485); +const global_utils_1 = __nccwpck_require__(8297); +/** + * Singleton object which represents the entry point to the OpenTelemetry Metrics API + */ +class MetricsAPI { + /** Empty private constructor prevents end users from constructing a new instance of the API */ + constructor() { } + /** Get the singleton instance of the Metrics API */ + static getInstance() { + if (!this._instance) { + this._instance = new MetricsAPI(); + } + return this._instance; + } + /** + * Set the current global meter. Returns the initialized global meter provider. + */ + setGlobalMeterProvider(provider) { + if (global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) { + // global meter provider has already been set + return this.getMeterProvider(); + } + global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopMeterProvider_1.NOOP_METER_PROVIDER); + return provider; + } + /** + * Returns the global meter provider. + */ + getMeterProvider() { + var _a, _b; + return ((_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]) === null || _a === void 0 ? void 0 : _a.call(global_utils_1._global, global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION)) !== null && _b !== void 0 ? _b : NoopMeterProvider_1.NOOP_METER_PROVIDER); + } + /** + * Returns a meter from the global meter provider. + */ + getMeter(name, version, options) { + return this.getMeterProvider().getMeter(name, version, options); + } + /** Remove the global meter provider */ + disable() { + delete global_utils_1._global[global_utils_1.GLOBAL_METRICS_API_KEY]; + } +} +exports.MetricsAPI = MetricsAPI; +//# sourceMappingURL=metrics.js.map + +/***/ }), + +/***/ 4582: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.metrics = void 0; +__exportStar(__nccwpck_require__(9956), exports); +__exportStar(__nccwpck_require__(9485), exports); +__exportStar(__nccwpck_require__(6412), exports); +__exportStar(__nccwpck_require__(3327), exports); +__exportStar(__nccwpck_require__(4941), exports); +__exportStar(__nccwpck_require__(7006), exports); +const metrics_1 = __nccwpck_require__(3910); +/** Entrypoint for metrics API */ +exports.metrics = metrics_1.MetricsAPI.getInstance(); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 2890: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(845), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 5111: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports._globalThis = void 0; +/** only globals that common to node and browsers are allowed */ +// eslint-disable-next-line node/no-unsupported-features/es-builtins +exports._globalThis = typeof globalThis === 'object' ? globalThis : global; +//# sourceMappingURL=globalThis.js.map + +/***/ }), + +/***/ 845: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(5111), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 6412: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=Meter.js.map + +/***/ }), + +/***/ 3327: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=MeterProvider.js.map + +/***/ }), + +/***/ 4941: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ValueType = void 0; +/** The Type of value. It describes how the data is reported. */ +var ValueType; +(function (ValueType) { + ValueType[ValueType["INT"] = 0] = "INT"; + ValueType[ValueType["DOUBLE"] = 1] = "DOUBLE"; +})(ValueType = exports.ValueType || (exports.ValueType = {})); +//# sourceMappingURL=Metric.js.map + +/***/ }), + +/***/ 7006: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=ObservableResult.js.map + /***/ }), /***/ 7171: @@ -12505,13 +13033,70 @@ exports.isWrapped = isWrapped; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.VERSION = void 0; // this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.4.0'; +exports.VERSION = '1.5.0'; //# sourceMappingURL=version.js.map /***/ }), -/***/ 4020: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 37: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.bufToHex = exports.hexToBuf = exports.toAnyValue = exports.toKeyValue = exports.toAttributes = void 0; +function toAttributes(attributes) { + return Object.keys(attributes).map(key => toKeyValue(key, attributes[key])); +} +exports.toAttributes = toAttributes; +function toKeyValue(key, value) { + return { + key: key, + value: toAnyValue(value), + }; +} +exports.toKeyValue = toKeyValue; +function toAnyValue(value) { + const t = typeof value; + if (t === 'string') + return { stringValue: value }; + if (t === 'number') { + if (!Number.isInteger(value)) + return { doubleValue: value }; + return { intValue: value }; + } + if (t === 'boolean') + return { boolValue: value }; + if (value instanceof Uint8Array) + return { bytesValue: value }; + if (Array.isArray(value)) + return { arrayValue: { values: value.map(toAnyValue) } }; + if (t === 'object' && value != null) + return { kvlistValue: { values: Object.entries(value).map(([k, v]) => toKeyValue(k, v)) } }; + return {}; +} +exports.toAnyValue = toAnyValue; +function hexToBuf(hex) { + var _a; + const ints = (_a = hex.match(/[\da-f]{2}/gi)) === null || _a === void 0 ? void 0 : _a.map(h => parseInt(h, 16)); + return ints && new Uint8Array(ints); +} +exports.hexToBuf = hexToBuf; +function i2hex(i) { + return ('0' + i.toString(16)).slice(-2); +} +function bufToHex(buf) { + if (buf == null || buf.length === 0) + return undefined; + return Array.from(buf).map(i2hex).join(''); +} +exports.bufToHex = bufToHex; +//# sourceMappingURL=internal.js.map + +/***/ }), + +/***/ 8972: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -12531,106 +13116,11 @@ exports.VERSION = '1.4.0'; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLPExporterBase = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(5797); -/** - * Collector Exporter abstract base class - */ -class OTLPExporterBase { - /** - * @param config - */ - constructor(config = {}) { - this._isShutdown = false; - this._shuttingDownPromise = Promise.resolve(); - this._sendingPromises = []; - this.url = this.getDefaultUrl(config); - if (typeof config.hostname === 'string') { - this.hostname = config.hostname; - } - this.attributes = config.attributes; - this.shutdown = this.shutdown.bind(this); - this._concurrencyLimit = - typeof config.concurrencyLimit === 'number' - ? config.concurrencyLimit - : Infinity; - // platform dependent - this.onInit(config); - } - /** - * Export items. - * @param items - * @param resultCallback - */ - export(items, resultCallback) { - if (this._isShutdown) { - resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: new Error('Exporter has been shutdown'), - }); - return; - } - if (this._sendingPromises.length >= this._concurrencyLimit) { - resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: new Error('Concurrent export limit reached'), - }); - return; - } - this._export(items) - .then(() => { - resultCallback({ code: core_1.ExportResultCode.SUCCESS }); - }) - .catch((error) => { - resultCallback({ code: core_1.ExportResultCode.FAILED, error }); - }); - } - _export(items) { - return new Promise((resolve, reject) => { - try { - api_1.diag.debug('items to be sent', items); - this.send(items, resolve, reject); - } - catch (e) { - reject(e); - } - }); - } - /** - * Shutdown the exporter. - */ - shutdown() { - if (this._isShutdown) { - api_1.diag.debug('shutdown already started'); - return this._shuttingDownPromise; - } - this._isShutdown = true; - api_1.diag.debug('shutdown started'); - this._shuttingDownPromise = new Promise((resolve, reject) => { - Promise.resolve() - .then(() => { - return this.onShutdown(); - }) - .then(() => { - return Promise.all(this._sendingPromises); - }) - .then(() => { - resolve(); - }) - .catch(e => { - reject(e); - }); - }); - return this._shuttingDownPromise; - } -} -exports.OTLPExporterBase = OTLPExporterBase; -//# sourceMappingURL=OTLPExporterBase.js.map +//# sourceMappingURL=types.js.map /***/ }), -/***/ 5401: +/***/ 4357: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -12661,24 +13151,44 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.appendResourcePathToUrlIfNotPresent = exports.toOTLPExportTraceServiceRequest = exports.toCollectorResource = exports.otlpTypes = void 0; -__exportStar(__nccwpck_require__(4020), exports); -__exportStar(__nccwpck_require__(6437), exports); -exports.otlpTypes = __nccwpck_require__(9981); -var transform_1 = __nccwpck_require__(3128); -Object.defineProperty(exports, "toCollectorResource", ({ enumerable: true, get: function () { return transform_1.toCollectorResource; } })); -Object.defineProperty(exports, "toOTLPExportTraceServiceRequest", ({ enumerable: true, get: function () { return transform_1.toOTLPExportTraceServiceRequest; } })); -var util_1 = __nccwpck_require__(6109); -Object.defineProperty(exports, "appendResourcePathToUrlIfNotPresent", ({ enumerable: true, get: function () { return util_1.appendResourcePathToUrlIfNotPresent; } })); +exports.createExportMetricsServiceRequest = exports.createExportTraceServiceRequest = void 0; +__exportStar(__nccwpck_require__(8972), exports); +__exportStar(__nccwpck_require__(7629), exports); +__exportStar(__nccwpck_require__(8531), exports); +__exportStar(__nccwpck_require__(1699), exports); +var trace_1 = __nccwpck_require__(9036); +Object.defineProperty(exports, "createExportTraceServiceRequest", ({ enumerable: true, get: function () { return trace_1.createExportTraceServiceRequest; } })); +var metrics_1 = __nccwpck_require__(7387); +Object.defineProperty(exports, "createExportMetricsServiceRequest", ({ enumerable: true, get: function () { return metrics_1.createExportMetricsServiceRequest; } })); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 7387: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createExportMetricsServiceRequest = void 0; +const internal_1 = __nccwpck_require__(2587); +function createExportMetricsServiceRequest(resourceMetrics) { + return { + resourceMetrics: resourceMetrics.map(metrics => (0, internal_1.toResourceMetrics)(metrics)) + }; +} +exports.createExportMetricsServiceRequest = createExportMetricsServiceRequest; //# sourceMappingURL=index.js.map /***/ }), -/***/ 4221: +/***/ 2587: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toMetric = exports.toScopeMetrics = exports.toResourceMetrics = void 0; /* * Copyright The OpenTelemetry Authors * @@ -12694,69 +13204,124 @@ Object.defineProperty(exports, "appendResourcePathToUrlIfNotPresent", ({ enumera * See the License for the specific language governing permissions and * limitations under the License. */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLPExporterBrowserBase = void 0; -const OTLPExporterBase_1 = __nccwpck_require__(4020); -const util_1 = __nccwpck_require__(6109); -const util_2 = __nccwpck_require__(8690); -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(5797); -/** - * Collector Metric Exporter abstract base class - */ -class OTLPExporterBrowserBase extends OTLPExporterBase_1.OTLPExporterBase { - /** - * @param config - */ - constructor(config = {}) { - super(config); - this._useXHR = false; - this._useXHR = - !!config.headers || typeof navigator.sendBeacon !== 'function'; - if (this._useXHR) { - this._headers = Object.assign({}, util_1.parseHeaders(config.headers), core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_HEADERS)); - } - else { - this._headers = {}; - } +const api_metrics_1 = __nccwpck_require__(4582); +const core_1 = __nccwpck_require__(9736); +const sdk_metrics_base_1 = __nccwpck_require__(8813); +const internal_1 = __nccwpck_require__(37); +function toResourceMetrics(resourceMetrics) { + return { + resource: { + attributes: (0, internal_1.toAttributes)(resourceMetrics.resource.attributes), + droppedAttributesCount: 0 + }, + schemaUrl: undefined, + scopeMetrics: toScopeMetrics(resourceMetrics.scopeMetrics) + }; +} +exports.toResourceMetrics = toResourceMetrics; +function toScopeMetrics(scopeMetrics) { + return Array.from(scopeMetrics.map(metrics => { + const scopeMetrics = { + scope: { + name: metrics.scope.name, + version: metrics.scope.version, + }, + metrics: metrics.metrics.map(metricData => toMetric(metricData)), + schemaUrl: metrics.scope.schemaUrl + }; + return scopeMetrics; + })); +} +exports.toScopeMetrics = toScopeMetrics; +function toMetric(metricData) { + const out = { + name: metricData.descriptor.name, + description: metricData.descriptor.description, + unit: metricData.descriptor.unit, + }; + const aggregationTemporality = toAggregationTemporality(metricData.aggregationTemporality); + if (metricData.dataPointType === sdk_metrics_base_1.DataPointType.SUM) { + out.sum = { + aggregationTemporality, + isMonotonic: metricData.isMonotonic, + dataPoints: toSingularDataPoints(metricData) + }; } - onInit() { - window.addEventListener('unload', this.shutdown); + else if (metricData.dataPointType === sdk_metrics_base_1.DataPointType.GAUGE) { + // Instrument is a gauge. + out.gauge = { + dataPoints: toSingularDataPoints(metricData) + }; } - onShutdown() { - window.removeEventListener('unload', this.shutdown); + else if (metricData.dataPointType === sdk_metrics_base_1.DataPointType.HISTOGRAM) { + out.histogram = { + aggregationTemporality, + dataPoints: toHistogramDataPoints(metricData) + }; } - send(items, onSuccess, onError) { - if (this._isShutdown) { - api_1.diag.debug('Shutdown already started. Cannot send objects'); - return; - } - const serviceRequest = this.convert(items); - const body = JSON.stringify(serviceRequest); - const promise = new Promise((resolve, reject) => { - if (this._useXHR) { - util_2.sendWithXhr(body, this.url, this._headers, resolve, reject); - } - else { - util_2.sendWithBeacon(body, this.url, { type: 'application/json' }, resolve, reject); - } - }) - .then(onSuccess, onError); - this._sendingPromises.push(promise); - const popPromise = () => { - const index = this._sendingPromises.indexOf(promise); - this._sendingPromises.splice(index, 1); + return out; +} +exports.toMetric = toMetric; +function toSingularDataPoint(dataPoint, valueType) { + const out = { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + startTimeUnixNano: (0, core_1.hrTimeToNanoseconds)(dataPoint.startTime), + timeUnixNano: (0, core_1.hrTimeToNanoseconds)(dataPoint.endTime), + }; + if (valueType === api_metrics_1.ValueType.INT) { + out.asInt = dataPoint.value; + } + else if (valueType === api_metrics_1.ValueType.DOUBLE) { + out.asDouble = dataPoint.value; + } + return out; +} +function toSingularDataPoints(metricData) { + return metricData.dataPoints.map(dataPoint => { + return toSingularDataPoint(dataPoint, metricData.descriptor.valueType); + }); +} +function toHistogramDataPoints(metricData) { + return metricData.dataPoints.map(dataPoint => { + const histogram = dataPoint.value; + return { + attributes: (0, internal_1.toAttributes)(dataPoint.attributes), + bucketCounts: histogram.buckets.counts, + explicitBounds: histogram.buckets.boundaries, + count: histogram.count, + sum: histogram.sum, + min: histogram.min, + max: histogram.max, + startTimeUnixNano: (0, core_1.hrTimeToNanoseconds)(dataPoint.startTime), + timeUnixNano: (0, core_1.hrTimeToNanoseconds)(dataPoint.endTime), }; - promise.then(popPromise, popPromise); + }); +} +function toAggregationTemporality(temporality) { + if (temporality === sdk_metrics_base_1.AggregationTemporality.DELTA) { + return 1 /* AGGREGATION_TEMPORALITY_DELTA */; } + if (temporality === sdk_metrics_base_1.AggregationTemporality.CUMULATIVE) { + return 2 /* AGGREGATION_TEMPORALITY_CUMULATIVE */; + } + return 0 /* AGGREGATION_TEMPORALITY_UNSPECIFIED */; } -exports.OTLPExporterBrowserBase = OTLPExporterBrowserBase; -//# sourceMappingURL=OTLPExporterBrowserBase.js.map +//# sourceMappingURL=internal.js.map /***/ }), -/***/ 1467: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 7629: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 8531: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -12776,41 +13341,146 @@ exports.OTLPExporterBrowserBase = OTLPExporterBrowserBase; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLPTraceExporter = void 0; -const OTLPExporterBrowserBase_1 = __nccwpck_require__(4221); -const transform_1 = __nccwpck_require__(3128); -const core_1 = __nccwpck_require__(5797); -const util_1 = __nccwpck_require__(6109); -const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces'; -const DEFAULT_COLLECTOR_URL = `http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`; -/** - * Collector Trace Exporter for Web - */ -class OTLPTraceExporter extends OTLPExporterBrowserBase_1.OTLPExporterBrowserBase { - constructor(config = {}) { - super(config); - this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS)); - } - convert(spans) { - return transform_1.toOTLPExportTraceServiceRequest(spans, this, true); - } - getDefaultUrl(config) { - return typeof config.url === 'string' - ? config.url - : core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0 - ? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - : core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0 - ? util_1.appendResourcePathToUrlIfNotPresent(core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH) - : DEFAULT_COLLECTOR_URL; +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 9036: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.createExportTraceServiceRequest = void 0; +const internal_1 = __nccwpck_require__(37); +const internal_2 = __nccwpck_require__(8106); +function createExportTraceServiceRequest(spans, useHex) { + return { + resourceSpans: spanRecordsToResourceSpans(spans, useHex) + }; +} +exports.createExportTraceServiceRequest = createExportTraceServiceRequest; +function createResourceMap(readableSpans) { + const resourceMap = new Map(); + for (const record of readableSpans) { + let ilmMap = resourceMap.get(record.resource); + if (!ilmMap) { + ilmMap = new Map(); + resourceMap.set(record.resource, ilmMap); + } + // TODO this is duplicated in basic tracer. Consolidate on a common helper in core + const instrumentationLibraryKey = `${record.instrumentationLibrary.name}@${record.instrumentationLibrary.version || ''}:${record.instrumentationLibrary.schemaUrl || ''}`; + let records = ilmMap.get(instrumentationLibraryKey); + if (!records) { + records = []; + ilmMap.set(instrumentationLibraryKey, records); + } + records.push(record); + } + return resourceMap; +} +function spanRecordsToResourceSpans(readableSpans, useHex) { + const resourceMap = createResourceMap(readableSpans); + const out = []; + const entryIterator = resourceMap.entries(); + let entry = entryIterator.next(); + while (!entry.done) { + const [resource, ilmMap] = entry.value; + const scopeResourceSpans = []; + const ilmIterator = ilmMap.values(); + let ilmEntry = ilmIterator.next(); + while (!ilmEntry.done) { + const scopeSpans = ilmEntry.value; + if (scopeSpans.length > 0) { + const { name, version, schemaUrl } = scopeSpans[0].instrumentationLibrary; + const spans = scopeSpans.map(readableSpan => (0, internal_2.sdkSpanToOtlpSpan)(readableSpan, useHex)); + scopeResourceSpans.push({ + scope: { name, version }, + spans: spans, + schemaUrl: schemaUrl + }); + } + ilmEntry = ilmIterator.next(); + } + // TODO SDK types don't provide resource schema URL at this time + const transformedSpans = { + resource: { + attributes: (0, internal_1.toAttributes)(resource.attributes), + droppedAttributesCount: 0, + }, + scopeSpans: scopeResourceSpans, + schemaUrl: undefined + }; + out.push(transformedSpans); + entry = entryIterator.next(); } + return out; } -exports.OTLPTraceExporter = OTLPTraceExporter; -//# sourceMappingURL=OTLPTraceExporter.js.map +//# sourceMappingURL=index.js.map /***/ }), -/***/ 6155: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 8106: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.toOtlpSpanEvent = exports.toOtlpLink = exports.sdkSpanToOtlpSpan = void 0; +const core_1 = __nccwpck_require__(9736); +const internal_1 = __nccwpck_require__(37); +const core = __nccwpck_require__(9736); +function sdkSpanToOtlpSpan(span, useHex) { + const ctx = span.spanContext(); + const status = span.status; + const parentSpanId = useHex ? span.parentSpanId : span.parentSpanId != null ? core.hexToBase64(span.parentSpanId) : undefined; + return { + traceId: useHex ? ctx.traceId : core.hexToBase64(ctx.traceId), + spanId: useHex ? ctx.spanId : core.hexToBase64(ctx.spanId), + parentSpanId: parentSpanId, + name: span.name, + // Span kind is offset by 1 because the API does not define a value for unset + kind: span.kind == null ? 0 : span.kind + 1, + startTimeUnixNano: (0, core_1.hrTimeToNanoseconds)(span.startTime), + endTimeUnixNano: (0, core_1.hrTimeToNanoseconds)(span.endTime), + attributes: (0, internal_1.toAttributes)(span.attributes), + droppedAttributesCount: 0, + events: span.events.map(toOtlpSpanEvent), + droppedEventsCount: 0, + status: { + // API and proto enums share the same values + code: status.code, + message: status.message, + }, + links: span.links.map(link => toOtlpLink(link, useHex)), + droppedLinksCount: 0, + }; +} +exports.sdkSpanToOtlpSpan = sdkSpanToOtlpSpan; +function toOtlpLink(link, useHex) { + return { + attributes: link.attributes ? (0, internal_1.toAttributes)(link.attributes) : [], + spanId: useHex ? link.context.spanId : core.hexToBase64(link.context.spanId), + traceId: useHex ? link.context.traceId : core.hexToBase64(link.context.traceId), + droppedAttributesCount: 0, + }; +} +exports.toOtlpLink = toOtlpLink; +function toOtlpSpanEvent(timedEvent) { + return { + attributes: timedEvent.attributes ? (0, internal_1.toAttributes)(timedEvent.attributes) : [], + name: timedEvent.name, + timeUnixNano: (0, core_1.hrTimeToNanoseconds)(timedEvent.time), + droppedAttributesCount: 0, + }; +} +exports.toOtlpSpanEvent = toOtlpSpanEvent; +//# sourceMappingURL=internal.js.map + +/***/ }), + +/***/ 1699: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -12829,30 +13499,48 @@ exports.OTLPTraceExporter = OTLPTraceExporter; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(1467), exports); -__exportStar(__nccwpck_require__(4221), exports); -//# sourceMappingURL=index.js.map +exports.ESpanKind = void 0; +/** + * SpanKind is the type of span. Can be used to specify additional relationships between spans + * in addition to a parent/child relationship. + */ +var ESpanKind; +(function (ESpanKind) { + /** Unspecified. Do NOT use as default. Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED. */ + ESpanKind[ESpanKind["SPAN_KIND_UNSPECIFIED"] = 0] = "SPAN_KIND_UNSPECIFIED"; + /** Indicates that the span represents an internal operation within an application, + * as opposed to an operation happening at the boundaries. Default value. + */ + ESpanKind[ESpanKind["SPAN_KIND_INTERNAL"] = 1] = "SPAN_KIND_INTERNAL"; + /** Indicates that the span covers server-side handling of an RPC or other + * remote network request. + */ + ESpanKind[ESpanKind["SPAN_KIND_SERVER"] = 2] = "SPAN_KIND_SERVER"; + /** Indicates that the span describes a request to some remote service. + */ + ESpanKind[ESpanKind["SPAN_KIND_CLIENT"] = 3] = "SPAN_KIND_CLIENT"; + /** Indicates that the span describes a producer sending a message to a broker. + * Unlike CLIENT and SERVER, there is often no direct critical path latency relationship + * between producer and consumer spans. A PRODUCER span ends when the message was accepted + * by the broker while the logical processing of the message might span a much longer time. + */ + ESpanKind[ESpanKind["SPAN_KIND_PRODUCER"] = 4] = "SPAN_KIND_PRODUCER"; + /** Indicates that the span describes consumer receiving a message from a broker. + * Like the PRODUCER kind, there is often no direct critical path latency relationship + * between producer and consumer spans. + */ + ESpanKind[ESpanKind["SPAN_KIND_CONSUMER"] = 5] = "SPAN_KIND_CONSUMER"; +})(ESpanKind = exports.ESpanKind || (exports.ESpanKind = {})); +//# sourceMappingURL=types.js.map /***/ }), -/***/ 8690: +/***/ 2723: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.sendWithXhr = exports.sendWithBeacon = void 0; /* * Copyright The OpenTelemetry Authors * @@ -12868,63 +13556,66 @@ exports.sendWithXhr = exports.sendWithBeacon = void 0; * See the License for the specific language governing permissions and * limitations under the License. */ -const api_1 = __nccwpck_require__(5163); -const otlpTypes = __nccwpck_require__(9981); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Resource = void 0; +const semantic_conventions_1 = __nccwpck_require__(7275); +const core_1 = __nccwpck_require__(9736); +const platform_1 = __nccwpck_require__(7784); /** - * Send metrics/spans using browser navigator.sendBeacon - * @param body - * @param onSuccess - * @param onError + * A Resource describes the entity for which a signals (metrics or trace) are + * collected. */ -function sendWithBeacon(body, url, blobPropertyBag, onSuccess, onError) { - if (navigator.sendBeacon(url, new Blob([body], blobPropertyBag))) { - api_1.diag.debug('sendBeacon - can send', body); - onSuccess(); +class Resource { + constructor( + /** + * A dictionary of attributes with string keys and values that provide + * information about the entity as numbers, strings or booleans + * TODO: Consider to add check/validation on attributes. + */ + attributes) { + this.attributes = attributes; } - else { - const error = new otlpTypes.OTLPExporterError(`sendBeacon - cannot send ${body}`); - onError(error); + /** + * Returns an empty Resource + */ + static empty() { + return Resource.EMPTY; + } + /** + * Returns a Resource that indentifies the SDK in use. + */ + static default() { + return new Resource({ + [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: (0, platform_1.defaultServiceName)(), + [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE], + [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME], + [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION], + }); + } + /** + * Returns a new, merged {@link Resource} by merging the current Resource + * with the other Resource. In case of a collision, other Resource takes + * precedence. + * + * @param other the Resource that will be merged with this. + * @returns the newly merged Resource. + */ + merge(other) { + if (!other || !Object.keys(other.attributes).length) + return this; + // SpanAttributes from resource overwrite attributes from other resource. + const mergedAttributes = Object.assign({}, this.attributes, other.attributes); + return new Resource(mergedAttributes); } } -exports.sendWithBeacon = sendWithBeacon; -/** - * function to send metrics/spans using browser XMLHttpRequest - * used when navigator.sendBeacon is not available - * @param body - * @param onSuccess - * @param onError - */ -function sendWithXhr(body, url, headers, onSuccess, onError) { - const xhr = new XMLHttpRequest(); - xhr.open('POST', url); - const defaultHeaders = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - }; - Object.entries(Object.assign(Object.assign({}, defaultHeaders), headers)).forEach(([k, v]) => { - xhr.setRequestHeader(k, v); - }); - xhr.send(body); - xhr.onreadystatechange = () => { - if (xhr.readyState === XMLHttpRequest.DONE) { - if (xhr.status >= 200 && xhr.status <= 299) { - api_1.diag.debug('xhr success', body); - onSuccess(); - } - else { - const error = new otlpTypes.OTLPExporterError(`Failed to export with XHR (status: ${xhr.status})`, xhr.status); - onError(error); - } - } - }; -} -exports.sendWithXhr = sendWithXhr; -//# sourceMappingURL=util.js.map +exports.Resource = Resource; +Resource.EMPTY = new Resource({}); +//# sourceMappingURL=Resource.js.map /***/ }), -/***/ 6437: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 1565: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -12943,26 +13634,12 @@ exports.sendWithXhr = sendWithXhr; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLPExporterBrowserBase = void 0; -__exportStar(__nccwpck_require__(81), exports); -var browser_1 = __nccwpck_require__(6155); -Object.defineProperty(exports, "OTLPExporterBrowserBase", ({ enumerable: true, get: function () { return browser_1.OTLPExporterBrowserBase; } })); -//# sourceMappingURL=index.js.map +//# sourceMappingURL=config.js.map /***/ }), -/***/ 4574: +/***/ 5969: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -12983,58 +13660,49 @@ Object.defineProperty(exports, "OTLPExporterBrowserBase", ({ enumerable: true, g * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLPExporterNodeBase = void 0; -const OTLPExporterBase_1 = __nccwpck_require__(4020); -const types_1 = __nccwpck_require__(5726); -const util_1 = __nccwpck_require__(6109); -const util_2 = __nccwpck_require__(2847); +exports.browserDetector = void 0; const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(5797); +const semantic_conventions_1 = __nccwpck_require__(7275); +const __1 = __nccwpck_require__(3871); /** - * Collector Metric Exporter abstract base class + * BrowserDetector will be used to detect the resources related to browser. */ -class OTLPExporterNodeBase extends OTLPExporterBase_1.OTLPExporterBase { - constructor(config = {}) { - super(config); - this.DEFAULT_HEADERS = {}; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - if (config.metadata) { - api_1.diag.warn('Metadata cannot be set when using http'); +class BrowserDetector { + async detect(config) { + const isBrowser = typeof navigator !== 'undefined'; + if (!isBrowser) { + return __1.Resource.empty(); } - this.headers = Object.assign(this.DEFAULT_HEADERS, util_1.parseHeaders(config.headers), core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_HEADERS)); - this.agent = util_2.createHttpAgent(config); - this.compression = config.compression || types_1.CompressionAlgorithm.NONE; - } - onInit(_config) { - this._isShutdown = false; + const browserResource = { + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'browser', + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: navigator.userAgent + }; + return this._getResourceAttributes(browserResource, config); } - send(objects, onSuccess, onError) { - if (this._isShutdown) { - api_1.diag.debug('Shutdown already started. Cannot send objects'); - return; + /** + * Validates process resource attribute map from process variables + * + * @param browserResource The un-sanitized resource attributes from process as key/value pairs. + * @param config: Config + * @returns The sanitized resource attributes. + */ + _getResourceAttributes(browserResource, _config) { + if (browserResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '') { + api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. '); + return __1.Resource.empty(); + } + else { + return new __1.Resource(Object.assign({}, browserResource)); } - const serviceRequest = this.convert(objects); - const promise = new Promise((resolve, reject) => { - util_2.sendWithHttp(this, JSON.stringify(serviceRequest), 'application/json', resolve, reject); - }) - .then(onSuccess, onError); - this._sendingPromises.push(promise); - const popPromise = () => { - const index = this._sendingPromises.indexOf(promise); - this._sendingPromises.splice(index, 1); - }; - promise.then(popPromise, popPromise); } - // TODO: end gzip stream from util.ts if not undefined - // It should perhaps be a class member here instead of a variable in util.ts - onShutdown() { } } -exports.OTLPExporterNodeBase = OTLPExporterNodeBase; -//# sourceMappingURL=OTLPExporterNodeBase.js.map +exports.browserDetector = new BrowserDetector(); +//# sourceMappingURL=BrowserDetector.js.map /***/ }), -/***/ 9377: +/***/ 2474: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13055,41 +13723,131 @@ exports.OTLPExporterNodeBase = OTLPExporterNodeBase; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLPTraceExporter = void 0; -const OTLPExporterNodeBase_1 = __nccwpck_require__(4574); -const transform_1 = __nccwpck_require__(3128); -const core_1 = __nccwpck_require__(5797); -const util_1 = __nccwpck_require__(6109); -const DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces'; -const DEFAULT_COLLECTOR_URL = `http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`; +exports.envDetector = void 0; +const api_1 = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +const semantic_conventions_1 = __nccwpck_require__(7275); +const Resource_1 = __nccwpck_require__(2723); /** - * Collector Trace Exporter for Node + * EnvDetector can be used to detect the presence of and create a Resource + * from the OTEL_RESOURCE_ATTRIBUTES environment variable. */ -class OTLPTraceExporter extends OTLPExporterNodeBase_1.OTLPExporterNodeBase { - constructor(config = {}) { - super(config); - this.headers = Object.assign(this.headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS)); +class EnvDetector { + constructor() { + // Type, attribute keys, and attribute values should not exceed 256 characters. + this._MAX_LENGTH = 255; + // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. + this._COMMA_SEPARATOR = ','; + // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. + this._LABEL_KEY_VALUE_SPLITTER = '='; + this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + + this._MAX_LENGTH + + ' characters.'; + this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + + this._MAX_LENGTH + + ' characters.'; } - convert(spans) { - return transform_1.toOTLPExportTraceServiceRequest(spans, this, true); + /** + * Returns a {@link Resource} populated with attributes from the + * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async + * function to conform to the Detector interface. + * + * @param config The resource detection config + */ + async detect(_config) { + const attributes = {}; + const env = (0, core_1.getEnv)(); + const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES; + const serviceName = env.OTEL_SERVICE_NAME; + if (rawAttributes) { + try { + const parsedAttributes = this._parseResourceAttributes(rawAttributes); + Object.assign(attributes, parsedAttributes); + } + catch (e) { + api_1.diag.debug(`EnvDetector failed: ${e.message}`); + } + } + if (serviceName) { + attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] = serviceName; + } + return new Resource_1.Resource(attributes); + } + /** + * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment + * variable. + * + * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing + * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and + * paths are accepted as attribute keys. Values may be quoted or unquoted in + * general. If a value contains whitespaces, =, or " characters, it must + * always be quoted. + * + * @param rawEnvAttributes The resource attributes as a comma-seperated list + * of key/value pairs. + * @returns The sanitized resource attributes. + */ + _parseResourceAttributes(rawEnvAttributes) { + if (!rawEnvAttributes) + return {}; + const attributes = {}; + const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); + for (const rawAttribute of rawAttributes) { + const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); + if (keyValuePair.length !== 2) { + continue; + } + let [key, value] = keyValuePair; + // Leading and trailing whitespaces are trimmed. + key = key.trim(); + value = value.trim().split('^"|"$').join(''); + if (!this._isValidAndNotEmpty(key)) { + throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); + } + if (!this._isValid(value)) { + throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); + } + attributes[key] = value; + } + return attributes; + } + /** + * Determines whether the given String is a valid printable ASCII string with + * a length not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid. + */ + _isValid(name) { + return name.length <= this._MAX_LENGTH && this._isPrintableString(name); + } + _isPrintableString(str) { + for (let i = 0; i < str.length; i++) { + const ch = str.charAt(i); + if (ch <= ' ' || ch >= '~') { + return false; + } + } + return true; } - getDefaultUrl(config) { - return typeof config.url === 'string' - ? config.url - : core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0 - ? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT - : core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0 - ? util_1.appendResourcePathToUrlIfNotPresent(core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH) - : DEFAULT_COLLECTOR_URL; + /** + * Determines whether the given String is a valid printable ASCII string with + * a length greater than 0 and not exceed _MAX_LENGTH characters. + * + * @param str The String to be validated. + * @returns Whether the String is valid and not empty. + */ + _isValidAndNotEmpty(str) { + return str.length > 0 && this._isValid(str); } } -exports.OTLPTraceExporter = OTLPTraceExporter; -//# sourceMappingURL=OTLPTraceExporter.js.map +exports.envDetector = new EnvDetector(); +//# sourceMappingURL=EnvDetector.js.map /***/ }), -/***/ 81: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 5267: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13108,157 +13866,62 @@ exports.OTLPTraceExporter = OTLPTraceExporter; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(9377), exports); -__exportStar(__nccwpck_require__(4574), exports); -__exportStar(__nccwpck_require__(2847), exports); -__exportStar(__nccwpck_require__(5726), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 5726: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompressionAlgorithm = void 0; -var CompressionAlgorithm; -(function (CompressionAlgorithm) { - CompressionAlgorithm["NONE"] = "none"; - CompressionAlgorithm["GZIP"] = "gzip"; -})(CompressionAlgorithm = exports.CompressionAlgorithm || (exports.CompressionAlgorithm = {})); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 2847: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.createHttpAgent = exports.sendWithHttp = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const url = __nccwpck_require__(8835); -const http = __nccwpck_require__(8605); -const https = __nccwpck_require__(7211); -const zlib = __nccwpck_require__(8761); -const stream_1 = __nccwpck_require__(2413); -const otlpTypes = __nccwpck_require__(9981); +exports.processDetector = void 0; const api_1 = __nccwpck_require__(5163); -const types_1 = __nccwpck_require__(5726); -let gzip; -/** - * Sends data using http - * @param collector - * @param data - * @param contentType - * @param onSuccess - * @param onError - */ -function sendWithHttp(collector, data, contentType, onSuccess, onError) { - const parsedUrl = new url.URL(collector.url); - const options = { - hostname: parsedUrl.hostname, - port: parsedUrl.port, - path: parsedUrl.pathname, - method: 'POST', - headers: Object.assign({ 'Content-Length': Buffer.byteLength(data), 'Content-Type': contentType }, collector.headers), - agent: collector.agent, - }; - const request = parsedUrl.protocol === 'http:' ? http.request : https.request; - const req = request(options, (res) => { - let responseData = ''; - res.on('data', chunk => (responseData += chunk)); - res.on('end', () => { - if (res.statusCode && res.statusCode < 299) { - api_1.diag.debug(`statusCode: ${res.statusCode}`, responseData); - onSuccess(); - } - else { - const error = new otlpTypes.OTLPExporterError(res.statusMessage, res.statusCode, responseData); - onError(error); - } - }); - }); - req.on('error', (error) => { - onError(error); - }); - switch (collector.compression) { - case types_1.CompressionAlgorithm.GZIP: { - if (!gzip) { - gzip = zlib.createGzip(); - } - req.setHeader('Content-Encoding', 'gzip'); - const dataStream = readableFromBuffer(data); - dataStream.on('error', onError) - .pipe(gzip).on('error', onError) - .pipe(req); - break; +const semantic_conventions_1 = __nccwpck_require__(7275); +const Resource_1 = __nccwpck_require__(2723); +/** + * ProcessDetector will be used to detect the resources related current process running + * and being instrumented from the NodeJS Process module. + */ +class ProcessDetector { + async detect(config) { + // Skip if not in Node.js environment. + if (typeof process !== 'object') { + return Resource_1.Resource.empty(); } - default: - req.write(data); - req.end(); - break; - } -} -exports.sendWithHttp = sendWithHttp; -function readableFromBuffer(buff) { - const readable = new stream_1.Readable(); - readable.push(buff); - readable.push(null); - return readable; -} -function createHttpAgent(config) { - if (config.httpAgentOptions && config.keepAlive === false) { - api_1.diag.warn('httpAgentOptions is used only when keepAlive is true'); - return undefined; - } - if (config.keepAlive === false || !config.url) - return undefined; - try { - const parsedUrl = new url.URL(config.url); - const Agent = parsedUrl.protocol === 'http:' ? http.Agent : https.Agent; - return new Agent(Object.assign({ keepAlive: true }, config.httpAgentOptions)); + const processResource = { + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_PID]: process.pid, + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]: process.title || '', + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND]: process.argv[1] || '', + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND_LINE]: process.argv.join(' ') || '', + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: process.versions.node, + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'nodejs', + [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', + }; + return this._getResourceAttributes(processResource, config); } - catch (err) { - api_1.diag.error(`collector exporter failed to create http agent. err: ${err.message}`); - return undefined; + /** + * Validates process resource attribute map from process varaibls + * + * @param processResource The unsantized resource attributes from process as key/value pairs. + * @param config: Config + * @returns The sanitized resource attributes. + */ + _getResourceAttributes(processResource, _config) { + if (processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME] === + '' || + processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH] === + '' || + processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND] === '' || + processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND_LINE] === '' || + processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '') { + api_1.diag.debug('ProcessDetector failed: Unable to find required process resources. '); + return Resource_1.Resource.empty(); + } + else { + return new Resource_1.Resource(Object.assign({}, processResource)); + } } } -exports.createHttpAgent = createHttpAgent; -//# sourceMappingURL=util.js.map +exports.processDetector = new ProcessDetector(); +//# sourceMappingURL=ProcessDetector.js.map /***/ }), -/***/ 3128: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4918: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -13277,277 +13940,214 @@ exports.createHttpAgent = createHttpAgent; * See the License for the specific language governing permissions and * limitations under the License. */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.groupSpansByResourceAndLibrary = exports.toOTLPExportTraceServiceRequest = exports.toCollectorTraceState = exports.toCollectorKind = exports.toCollectorResource = exports.toCollectorStatus = exports.toCollectorSpan = exports.toCollectorEvents = exports.toCollectorAnyValue = exports.toCollectorAttributeKeyValue = exports.toCollectorKeyValueList = exports.toCollectorArrayValue = exports.toCollectorAttributes = void 0; -const core = __nccwpck_require__(5797); -const types_1 = __nccwpck_require__(9981); -const MAX_INTEGER_VALUE = 2147483647; -const MIN_INTEGER_VALUE = -2147483648; -/** - * Converts attributes to KeyValue array - * @param attributes - */ -function toCollectorAttributes(attributes) { - return Object.keys(attributes).map(key => { - return toCollectorAttributeKeyValue(key, attributes[key]); - }); -} -exports.toCollectorAttributes = toCollectorAttributes; -/** - * Converts array of unknown value to ArrayValue - * @param values +__exportStar(__nccwpck_require__(5969), exports); +__exportStar(__nccwpck_require__(2474), exports); +__exportStar(__nccwpck_require__(5267), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 3871: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function toCollectorArrayValue(values) { - return { - values: values.map(value => toCollectorAnyValue(value)), - }; -} -exports.toCollectorArrayValue = toCollectorArrayValue; -/** - * Converts attributes to KeyValueList - * @param attributes +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(2723), exports); +__exportStar(__nccwpck_require__(7784), exports); +__exportStar(__nccwpck_require__(9566), exports); +__exportStar(__nccwpck_require__(1565), exports); +__exportStar(__nccwpck_require__(4918), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 7784: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function toCollectorKeyValueList(attributes) { - return { - values: toCollectorAttributes(attributes), - }; -} -exports.toCollectorKeyValueList = toCollectorKeyValueList; -/** - * Converts key and unknown value to KeyValue - * @param value event value +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(342), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9056: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function toCollectorAttributeKeyValue(key, value) { - const anyValue = toCollectorAnyValue(value); - return { - key, - value: anyValue, - }; -} -exports.toCollectorAttributeKeyValue = toCollectorAttributeKeyValue; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.hostDetector = void 0; +const semantic_conventions_1 = __nccwpck_require__(7275); +const Resource_1 = __nccwpck_require__(2723); +const os_1 = __nccwpck_require__(2087); /** - * Converts unknown value to AnyValue - * @param value + * HostDetector detects the resources related to the host current process is + * running on. Currently only non-cloud-based attributes are included. */ -function toCollectorAnyValue(value) { - const anyValue = {}; - if (typeof value === 'string') { - anyValue.stringValue = value; - } - else if (typeof value === 'boolean') { - anyValue.boolValue = value; - } - else if (typeof value === 'number' && - value <= MAX_INTEGER_VALUE && - value >= MIN_INTEGER_VALUE && - Number.isInteger(value)) { - anyValue.intValue = value; - } - else if (typeof value === 'number') { - anyValue.doubleValue = value; - } - else if (Array.isArray(value)) { - anyValue.arrayValue = toCollectorArrayValue(value); +class HostDetector { + async detect(_config) { + const attributes = { + [semantic_conventions_1.SemanticResourceAttributes.HOST_NAME]: (0, os_1.hostname)(), + [semantic_conventions_1.SemanticResourceAttributes.HOST_ARCH]: this._normalizeArch((0, os_1.arch)()), + }; + return new Resource_1.Resource(attributes); } - else if (value) { - anyValue.kvlistValue = toCollectorKeyValueList(value); + _normalizeArch(nodeArchString) { + // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md + switch (nodeArchString) { + case 'arm': + return 'arm32'; + case 'ppc': + return 'ppc32'; + case 'x64': + return 'amd64'; + default: + return nodeArchString; + } } - return anyValue; } -exports.toCollectorAnyValue = toCollectorAnyValue; -/** +exports.hostDetector = new HostDetector(); +//# sourceMappingURL=HostDetector.js.map + +/***/ }), + +/***/ 4618: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors * - * Converts events - * @param events array of events - */ -function toCollectorEvents(timedEvents) { - return timedEvents.map(timedEvent => { - const timeUnixNano = core.hrTimeToNanoseconds(timedEvent.time); - const name = timedEvent.name; - const attributes = toCollectorAttributes(timedEvent.attributes || {}); - const droppedAttributesCount = 0; - const protoEvent = { - timeUnixNano, - name, - attributes, - droppedAttributesCount, - }; - return protoEvent; - }); -} -exports.toCollectorEvents = toCollectorEvents; -/** - * Converts links - * @param span - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toCollectorLinks(span, useHex) { - return span.links.map((link) => { - const protoLink = { - traceId: useHex - ? link.context.traceId - : core.hexToBase64(link.context.traceId), - spanId: useHex - ? link.context.spanId - : core.hexToBase64(link.context.spanId), - attributes: toCollectorAttributes(link.attributes || {}), - droppedAttributesCount: 0, - }; - return protoLink; - }); -} -/** - * Converts span - * @param span - * @param useHex - if ids should be kept as hex without converting to base64 + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function toCollectorSpan(span, useHex) { - return { - traceId: useHex - ? span.spanContext().traceId - : core.hexToBase64(span.spanContext().traceId), - spanId: useHex - ? span.spanContext().spanId - : core.hexToBase64(span.spanContext().spanId), - parentSpanId: span.parentSpanId - ? useHex - ? span.parentSpanId - : core.hexToBase64(span.parentSpanId) - : undefined, - traceState: toCollectorTraceState(span.spanContext().traceState), - name: span.name, - kind: toCollectorKind(span.kind), - startTimeUnixNano: core.hrTimeToNanoseconds(span.startTime), - endTimeUnixNano: core.hrTimeToNanoseconds(span.endTime), - attributes: toCollectorAttributes(span.attributes), - droppedAttributesCount: 0, - events: toCollectorEvents(span.events), - droppedEventsCount: 0, - status: toCollectorStatus(span.status), - links: toCollectorLinks(span, useHex), - droppedLinksCount: 0, - }; -} -exports.toCollectorSpan = toCollectorSpan; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.osDetector = void 0; +const semantic_conventions_1 = __nccwpck_require__(7275); +const Resource_1 = __nccwpck_require__(2723); +const os_1 = __nccwpck_require__(2087); /** - * Converts status - * @param status + * OSDetector detects the resources related to the operating system (OS) on + * which the process represented by this resource is running. */ -function toCollectorStatus(status) { - const spanStatus = { - code: status.code, - }; - if (typeof status.message !== 'undefined') { - spanStatus.message = status.message; +class OSDetector { + async detect(_config) { + const attributes = { + [semantic_conventions_1.SemanticResourceAttributes.OS_TYPE]: this._normalizeType((0, os_1.platform)()), + [semantic_conventions_1.SemanticResourceAttributes.OS_VERSION]: (0, os_1.release)(), + }; + return new Resource_1.Resource(attributes); } - return spanStatus; -} -exports.toCollectorStatus = toCollectorStatus; -/** - * Converts resource - * @param resource - * @param additionalAttributes - */ -function toCollectorResource(resource, additionalAttributes = {}) { - const attr = Object.assign({}, additionalAttributes, resource ? resource.attributes : {}); - const resourceProto = { - attributes: toCollectorAttributes(attr), - droppedAttributesCount: 0, - }; - return resourceProto; -} -exports.toCollectorResource = toCollectorResource; -/** - * Converts span kind - * @param kind - */ -function toCollectorKind(kind) { - const collectorKind = types_1.OTLP_SPAN_KIND_MAPPING[kind]; - return typeof collectorKind === 'number' - ? collectorKind - : types_1.opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_UNSPECIFIED; -} -exports.toCollectorKind = toCollectorKind; -/** - * Converts traceState - * @param traceState - */ -function toCollectorTraceState(traceState) { - if (!traceState) - return undefined; - return traceState.serialize(); -} -exports.toCollectorTraceState = toCollectorTraceState; -/** - * Prepares trace service request to be sent to collector - * @param spans spans - * @param collectorExporterBase - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toOTLPExportTraceServiceRequest(spans, collectorTraceExporterBase, useHex) { - const groupedSpans = groupSpansByResourceAndLibrary(spans); - const additionalAttributes = Object.assign({}, collectorTraceExporterBase.attributes); - return { - resourceSpans: toCollectorResourceSpans(groupedSpans, additionalAttributes, useHex), - }; -} -exports.toOTLPExportTraceServiceRequest = toOTLPExportTraceServiceRequest; -/** - * Takes an array of spans and groups them by resource and instrumentation - * library - * @param spans spans - */ -function groupSpansByResourceAndLibrary(spans) { - return spans.reduce((spanMap, span) => { - //group by resource - let resourceSpans = spanMap.get(span.resource); - if (!resourceSpans) { - resourceSpans = new Map(); - spanMap.set(span.resource, resourceSpans); - } - //group by instrumentation library - let libSpans = resourceSpans.get(span.instrumentationLibrary); - if (!libSpans) { - libSpans = new Array(); - resourceSpans.set(span.instrumentationLibrary, libSpans); + _normalizeType(nodePlatform) { + // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec: + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md + switch (nodePlatform) { + case 'sunos': + return 'solaris'; + case 'win32': + return 'windows'; + default: + return nodePlatform; } - libSpans.push(span); - return spanMap; - }, new Map()); -} -exports.groupSpansByResourceAndLibrary = groupSpansByResourceAndLibrary; -/** - * Convert to InstrumentationLibrarySpans - * @param instrumentationLibrary - * @param spans - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex) { - return { - spans: spans.map(span => toCollectorSpan(span, useHex)), - instrumentationLibrary, - }; -} -/** - * Returns a list of resource spans which will be exported to the collector - * @param groupedSpans - * @param baseAttributes - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toCollectorResourceSpans(groupedSpans, baseAttributes, useHex) { - return Array.from(groupedSpans, ([resource, libSpans]) => { - return { - resource: toCollectorResource(resource, baseAttributes), - instrumentationLibrarySpans: Array.from(libSpans, ([instrumentationLibrary, spans]) => toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex)), - }; - }); + } } -//# sourceMappingURL=transform.js.map +exports.osDetector = new OSDetector(); +//# sourceMappingURL=OSDetector.js.map /***/ }), -/***/ 9981: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5671: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -13567,153 +14167,16 @@ function toCollectorResourceSpans(groupedSpans, baseAttributes, useHex) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.OTLP_SPAN_KIND_MAPPING = exports.OTLPExporterError = exports.opentelemetryProto = void 0; -const api_1 = __nccwpck_require__(5163); -/* eslint-disable @typescript-eslint/no-namespace */ -/* eslint-disable @typescript-eslint/no-unused-vars */ -var opentelemetryProto; -(function (opentelemetryProto) { - let metrics; - (function (metrics) { - let v1; - (function (v1) { - let AggregationTemporality; - (function (AggregationTemporality) { - // UNSPECIFIED is the default AggregationTemporality, it MUST not be used. - AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_UNSPECIFIED"] = 0] = "AGGREGATION_TEMPORALITY_UNSPECIFIED"; - // DELTA is an AggregationTemporality for a metric aggregator which reports - // changes since last report time. Successive metrics contain aggregation of - // values from continuous and non-overlapping intervals. - // - // The values for a DELTA metric are based only on the time interval - // associated with one measurement cycle. There is no dependency on - // previous measurements like is the case for CUMULATIVE metrics. - // - // For example, consider a system measuring the number of requests that - // it receives and reports the sum of these requests every second as a - // DELTA metric: - // - // 1. The system starts receiving at time=t_0. - // 2. A request is received, the system measures 1 request. - // 3. A request is received, the system measures 1 request. - // 4. A request is received, the system measures 1 request. - // 5. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0 to - // t_0+1 with a value of 3. - // 6. A request is received, the system measures 1 request. - // 7. A request is received, the system measures 1 request. - // 8. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0+1 to - // t_0+2 with a value of 2. - AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_DELTA"] = 1] = "AGGREGATION_TEMPORALITY_DELTA"; - // CUMULATIVE is an AggregationTemporality for a metric aggregator which - // reports changes since a fixed start time. This means that current values - // of a CUMULATIVE metric depend on all previous measurements since the - // start time. Because of this, the sender is required to retain this state - // in some form. If this state is lost or invalidated, the CUMULATIVE metric - // values MUST be reset and a new fixed start time following the last - // reported measurement time sent MUST be used. - // - // For example, consider a system measuring the number of requests that - // it receives and reports the sum of these requests every second as a - // CUMULATIVE metric: - // - // 1. The system starts receiving at time=t_0. - // 2. A request is received, the system measures 1 request. - // 3. A request is received, the system measures 1 request. - // 4. A request is received, the system measures 1 request. - // 5. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0 to - // t_0+1 with a value of 3. - // 6. A request is received, the system measures 1 request. - // 7. A request is received, the system measures 1 request. - // 8. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_0 to - // t_0+2 with a value of 5. - // 9. The system experiences a fault and loses state. - // 10. The system recovers and resumes receiving at time=t_1. - // 11. A request is received, the system measures 1 request. - // 12. The 1 second collection cycle ends. A metric is exported for the - // number of requests received over the interval of time t_1 to - // t_0+1 with a value of 1. - // - // Note: Even though, when reporting changes since last report time, using - // CUMULATIVE is valid, it is not recommended. This may cause problems for - // systems that do not use start_time to determine when the aggregation - // value was reset (e.g. Prometheus). - AggregationTemporality[AggregationTemporality["AGGREGATION_TEMPORALITY_CUMULATIVE"] = 2] = "AGGREGATION_TEMPORALITY_CUMULATIVE"; - })(AggregationTemporality = v1.AggregationTemporality || (v1.AggregationTemporality = {})); - })(v1 = metrics.v1 || (metrics.v1 = {})); - })(metrics = opentelemetryProto.metrics || (opentelemetryProto.metrics = {})); - let trace; - (function (trace) { - let v1; - (function (v1) { - let ConstantSampler; - (function (ConstantSampler) { - let ConstantDecision; - (function (ConstantDecision) { - ConstantDecision[ConstantDecision["ALWAYS_OFF"] = 0] = "ALWAYS_OFF"; - ConstantDecision[ConstantDecision["ALWAYS_ON"] = 1] = "ALWAYS_ON"; - ConstantDecision[ConstantDecision["ALWAYS_PARENT"] = 2] = "ALWAYS_PARENT"; - })(ConstantDecision = ConstantSampler.ConstantDecision || (ConstantSampler.ConstantDecision = {})); - })(ConstantSampler = v1.ConstantSampler || (v1.ConstantSampler = {})); - let Span; - (function (Span) { - // eslint-disable-next-line @typescript-eslint/no-shadow - let SpanKind; - (function (SpanKind) { - SpanKind[SpanKind["SPAN_KIND_UNSPECIFIED"] = 0] = "SPAN_KIND_UNSPECIFIED"; - SpanKind[SpanKind["SPAN_KIND_INTERNAL"] = 1] = "SPAN_KIND_INTERNAL"; - SpanKind[SpanKind["SPAN_KIND_SERVER"] = 2] = "SPAN_KIND_SERVER"; - SpanKind[SpanKind["SPAN_KIND_CLIENT"] = 3] = "SPAN_KIND_CLIENT"; - SpanKind[SpanKind["SPAN_KIND_PRODUCER"] = 4] = "SPAN_KIND_PRODUCER"; - SpanKind[SpanKind["SPAN_KIND_CONSUMER"] = 5] = "SPAN_KIND_CONSUMER"; - })(SpanKind = Span.SpanKind || (Span.SpanKind = {})); - })(Span = v1.Span || (v1.Span = {})); - })(v1 = trace.v1 || (trace.v1 = {})); - })(trace = opentelemetryProto.trace || (opentelemetryProto.trace = {})); - let common; - (function (common) { - let v1; - (function (v1) { - let ValueType; - (function (ValueType) { - ValueType[ValueType["STRING"] = 0] = "STRING"; - ValueType[ValueType["INT"] = 1] = "INT"; - ValueType[ValueType["DOUBLE"] = 2] = "DOUBLE"; - ValueType[ValueType["BOOL"] = 3] = "BOOL"; - })(ValueType = v1.ValueType || (v1.ValueType = {})); - })(v1 = common.v1 || (common.v1 = {})); - })(common = opentelemetryProto.common || (opentelemetryProto.common = {})); -})(opentelemetryProto = exports.opentelemetryProto || (exports.opentelemetryProto = {})); -/** - * Interface for handling error - */ -class OTLPExporterError extends Error { - constructor(message, code, data) { - super(message); - this.name = 'OTLPExporterError'; - this.data = data; - this.code = code; - } +exports.defaultServiceName = void 0; +function defaultServiceName() { + return `unknown_service:${process.argv0}`; } -exports.OTLPExporterError = OTLPExporterError; -/** - * Mapping between api SpanKind and proto SpanKind - */ -exports.OTLP_SPAN_KIND_MAPPING = { - [api_1.SpanKind.INTERNAL]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL, - [api_1.SpanKind.SERVER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_SERVER, - [api_1.SpanKind.CLIENT]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CLIENT, - [api_1.SpanKind.PRODUCER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_PRODUCER, - [api_1.SpanKind.CONSUMER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CONSUMER, -}; -//# sourceMappingURL=types.js.map +exports.defaultServiceName = defaultServiceName; +//# sourceMappingURL=default-service-name.js.map /***/ }), -/***/ 6109: +/***/ 6018: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13734,37 +14197,59 @@ exports.OTLP_SPAN_KIND_MAPPING = { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.appendResourcePathToUrlIfNotPresent = exports.parseHeaders = void 0; +exports.detectResources = void 0; +const Resource_1 = __nccwpck_require__(2723); const api_1 = __nccwpck_require__(5163); +const util = __nccwpck_require__(1669); /** - * Parses headers from config leaving only those that have defined values - * @param partialHeaders + * Runs all resource detectors and returns the results merged into a single + * Resource. + * + * @param config Configuration for resource detection */ -function parseHeaders(partialHeaders = {}) { - const headers = {}; - Object.entries(partialHeaders).forEach(([key, value]) => { - if (typeof value !== 'undefined') { - headers[key] = String(value); +const detectResources = async (config = {}) => { + const internalConfig = Object.assign(config); + const resources = await Promise.all((internalConfig.detectors || []).map(async (d) => { + try { + const resource = await d.detect(internalConfig); + api_1.diag.debug(`${d.constructor.name} found resource.`, resource); + return resource; } - else { - api_1.diag.warn(`Header "${key}" has wrong value and will be ignored`); + catch (e) { + api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); + return Resource_1.Resource.empty(); + } + })); + // Future check if verbose logging is enabled issue #1903 + logResources(resources); + return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); +}; +exports.detectResources = detectResources; +/** + * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. + * + * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. + */ +const logResources = (resources) => { + resources.forEach(resource => { + // Print only populated resources + if (Object.keys(resource.attributes).length > 0) { + const resourceDebugString = util.inspect(resource.attributes, { + depth: 2, + breakLength: Infinity, + sorted: true, + compact: false, + }); + api_1.diag.verbose(resourceDebugString); } }); - return headers; -} -exports.parseHeaders = parseHeaders; -function appendResourcePathToUrlIfNotPresent(url, path) { - if (url.match(/v\d\/(traces|metrics)$/)) - return url; - return url + path; -} -exports.appendResourcePathToUrlIfNotPresent = appendResourcePathToUrlIfNotPresent; -//# sourceMappingURL=util.js.map +}; +//# sourceMappingURL=detect-resources.js.map /***/ }), -/***/ 9249: -/***/ ((__unused_webpack_module, exports) => { +/***/ 342: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -13783,18 +14268,26 @@ exports.appendResourcePathToUrlIfNotPresent = appendResourcePathToUrlIfNotPresen * See the License for the specific language governing permissions and * limitations under the License. */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExportResultCode = void 0; -var ExportResultCode; -(function (ExportResultCode) { - ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); -//# sourceMappingURL=ExportResult.js.map +__exportStar(__nccwpck_require__(5671), exports); +__exportStar(__nccwpck_require__(6018), exports); +__exportStar(__nccwpck_require__(9056), exports); +__exportStar(__nccwpck_require__(4618), exports); +//# sourceMappingURL=index.js.map /***/ }), -/***/ 6831: +/***/ 9566: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -13815,23 +14308,11 @@ var ExportResultCode; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; -exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; -exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; -exports.BAGGAGE_ITEMS_SEPARATOR = ','; -// Name of the http header used to propagate the baggage -exports.BAGGAGE_HEADER = 'baggage'; -// Maximum number of name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; -// Maximum number of bytes per a single name-value pair allowed by w3c spec -exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; -// Maximum total length of all name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -//# sourceMappingURL=constants.js.map +//# sourceMappingURL=types.js.map /***/ }), -/***/ 6283: +/***/ 177: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -13852,72 +14333,58 @@ exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CBaggagePropagator = void 0; -const api_1 = __nccwpck_require__(5163); -const suppress_tracing_1 = __nccwpck_require__(1124); -const constants_1 = __nccwpck_require__(6831); -const utils_1 = __nccwpck_require__(889); +exports.isDescriptorCompatibleWith = exports.createInstrumentDescriptorWithView = exports.createInstrumentDescriptor = exports.InstrumentType = void 0; +const api_metrics_1 = __nccwpck_require__(4582); /** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ + * Supported types of metric instruments. */ -class W3CBaggagePropagator { - inject(context, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context); - if (!baggage || suppress_tracing_1.isTracingSuppressed(context)) - return; - const keyPairs = utils_1.getKeyPairs(baggage) - .filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }) - .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = utils_1.serializeKeyPairs(keyPairs); - if (headerValue.length > 0) { - setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - } - extract(context, carrier, getter) { - const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - if (!headerValue) - return context; - const baggage = {}; - if (headerValue.length === 0) { - return context; - } - const pairs = headerValue.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.forEach(entry => { - const keyPair = utils_1.parsePairKeyValue(entry); - if (keyPair) { - const baggageEntry = { value: keyPair.value }; - if (keyPair.metadata) { - baggageEntry.metadata = keyPair.metadata; - } - baggage[keyPair.key] = baggageEntry; - } - }); - if (Object.entries(baggage).length === 0) { - return context; - } - return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } +var InstrumentType; +(function (InstrumentType) { + InstrumentType["COUNTER"] = "COUNTER"; + InstrumentType["HISTOGRAM"] = "HISTOGRAM"; + InstrumentType["UP_DOWN_COUNTER"] = "UP_DOWN_COUNTER"; + InstrumentType["OBSERVABLE_COUNTER"] = "OBSERVABLE_COUNTER"; + InstrumentType["OBSERVABLE_GAUGE"] = "OBSERVABLE_GAUGE"; + InstrumentType["OBSERVABLE_UP_DOWN_COUNTER"] = "OBSERVABLE_UP_DOWN_COUNTER"; +})(InstrumentType = exports.InstrumentType || (exports.InstrumentType = {})); +function createInstrumentDescriptor(name, type, options) { + var _a, _b, _c; + return { + name, + type, + description: (_a = options === null || options === void 0 ? void 0 : options.description) !== null && _a !== void 0 ? _a : '', + unit: (_b = options === null || options === void 0 ? void 0 : options.unit) !== null && _b !== void 0 ? _b : '', + valueType: (_c = options === null || options === void 0 ? void 0 : options.valueType) !== null && _c !== void 0 ? _c : api_metrics_1.ValueType.DOUBLE, + }; } -exports.W3CBaggagePropagator = W3CBaggagePropagator; -//# sourceMappingURL=W3CBaggagePropagator.js.map +exports.createInstrumentDescriptor = createInstrumentDescriptor; +function createInstrumentDescriptorWithView(view, instrument) { + var _a, _b; + return { + name: (_a = view.name) !== null && _a !== void 0 ? _a : instrument.name, + description: (_b = view.description) !== null && _b !== void 0 ? _b : instrument.description, + type: instrument.type, + unit: instrument.unit, + valueType: instrument.valueType, + }; +} +exports.createInstrumentDescriptorWithView = createInstrumentDescriptorWithView; +function isDescriptorCompatibleWith(descriptor, otherDescriptor) { + return descriptor.name === otherDescriptor.name + && descriptor.unit === otherDescriptor.unit + && descriptor.type === otherDescriptor.type + && descriptor.valueType === otherDescriptor.valueType; +} +exports.isDescriptorCompatibleWith = isDescriptorCompatibleWith; +//# sourceMappingURL=InstrumentDescriptor.js.map /***/ }), -/***/ 889: +/***/ 5700: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; /* * Copyright The OpenTelemetry Authors * @@ -13933,137 +14400,306 @@ exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPair * See the License for the specific language governing permissions and * limitations under the License. */ -const api_1 = __nccwpck_require__(5163); -const constants_1 = __nccwpck_require__(6831); -function serializeKeyPairs(keyPairs) { - return keyPairs.reduce((hValue, current) => { - const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; - return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; - }, ''); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.isObservableInstrument = exports.ObservableUpDownCounterInstrument = exports.ObservableGaugeInstrument = exports.ObservableCounterInstrument = exports.ObservableInstrument = exports.HistogramInstrument = exports.CounterInstrument = exports.UpDownCounterInstrument = exports.SyncInstrument = void 0; +const api = __nccwpck_require__(5163); +const metrics = __nccwpck_require__(4582); +const core_1 = __nccwpck_require__(9736); +class SyncInstrument { + constructor(_writableMetricStorage, _descriptor) { + this._writableMetricStorage = _writableMetricStorage; + this._descriptor = _descriptor; + } + _record(value, attributes = {}, context = api.context.active()) { + if (this._descriptor.valueType === metrics.ValueType.INT && !Number.isInteger(value)) { + api.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + } + this._writableMetricStorage.record(value, attributes, context, (0, core_1.hrTime)()); + } } -exports.serializeKeyPairs = serializeKeyPairs; -function getKeyPairs(baggage) { - return baggage - .getAllEntries() - .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`); +exports.SyncInstrument = SyncInstrument; +/** + * The class implements {@link metrics.UpDownCounter} interface. + */ +class UpDownCounterInstrument extends SyncInstrument { + /** + * Increment value of counter by the input. Inputs may be negative. + */ + add(value, attributes, ctx) { + this._record(value, attributes, ctx); + } } -exports.getKeyPairs = getKeyPairs; -function parsePairKeyValue(entry) { - const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); - if (valueProps.length <= 0) - return; - const keyPairPart = valueProps.shift(); - if (!keyPairPart) - return; - const keyPair = keyPairPart.split(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); - if (keyPair.length !== 2) - return; - const key = decodeURIComponent(keyPair[0].trim()); - const value = decodeURIComponent(keyPair[1].trim()); - let metadata; - if (valueProps.length > 0) { - metadata = api_1.baggageEntryMetadataFromString(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); +exports.UpDownCounterInstrument = UpDownCounterInstrument; +/** + * The class implements {@link metrics.Counter} interface. + */ +class CounterInstrument extends SyncInstrument { + /** + * Increment value of counter by the input. Inputs may not be negative. + */ + add(value, attributes, ctx) { + if (value < 0) { + api.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); } - return { key, value, metadata }; } -exports.parsePairKeyValue = parsePairKeyValue; +exports.CounterInstrument = CounterInstrument; /** - * Parse a string serialized in the baggage HTTP Format (without metadata): - * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md + * The class implements {@link metrics.Histogram} interface. */ -function parseKeyPairsIntoRecord(value) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); +class HistogramInstrument extends SyncInstrument { + /** + * Records a measurement. Value of the measurement must not be negative. + */ + record(value, attributes, ctx) { + if (value < 0) { + api.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${value}`); + return; + } + this._record(value, attributes, ctx); + } } -exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -//# sourceMappingURL=utils.js.map +exports.HistogramInstrument = HistogramInstrument; +class ObservableInstrument { + constructor(descriptor, metricStorages, _observableRegistry) { + this._observableRegistry = _observableRegistry; + this._descriptor = descriptor; + this._metricStorages = metricStorages; + } + /** + * @see {metrics.Observable.addCallback} + */ + addCallback(callback) { + this._observableRegistry.addCallback(callback, this); + } + /** + * @see {metrics.Observable.removeCallback} + */ + removeCallback(callback) { + this._observableRegistry.removeCallback(callback, this); + } +} +exports.ObservableInstrument = ObservableInstrument; +class ObservableCounterInstrument extends ObservableInstrument { +} +exports.ObservableCounterInstrument = ObservableCounterInstrument; +class ObservableGaugeInstrument extends ObservableInstrument { +} +exports.ObservableGaugeInstrument = ObservableGaugeInstrument; +class ObservableUpDownCounterInstrument extends ObservableInstrument { +} +exports.ObservableUpDownCounterInstrument = ObservableUpDownCounterInstrument; +function isObservableInstrument(it) { + return it instanceof ObservableInstrument; +} +exports.isObservableInstrument = isObservableInstrument; +//# sourceMappingURL=Instruments.js.map /***/ }), -/***/ 9790: -/***/ ((__unused_webpack_module, exports) => { +/***/ 441: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAttributeValue = exports.sanitizeAttributes = void 0; -function sanitizeAttributes(attributes) { - const out = {}; - if (attributes == null || typeof attributes !== 'object') { - return out; +exports.Meter = void 0; +const InstrumentDescriptor_1 = __nccwpck_require__(177); +const Instruments_1 = __nccwpck_require__(5700); +/** + * This class implements the {@link metrics.Meter} interface. + */ +class Meter { + constructor(_meterSharedState) { + this._meterSharedState = _meterSharedState; } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - for (const [k, v] of Object.entries(attributes)) { - if (isAttributeValue(v)) { - if (Array.isArray(v)) { - out[k] = v.slice(); - } - else { - out[k] = v; - } - } + /** + * Create a {@link metrics.Histogram} instrument. + */ + createHistogram(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, InstrumentDescriptor_1.InstrumentType.HISTOGRAM, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.HistogramInstrument(storage, descriptor); } - return out; -} -exports.sanitizeAttributes = sanitizeAttributes; -function isAttributeValue(val) { - if (val == null) { - return true; + /** + * Create a {@link metrics.Counter} instrument. + */ + createCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, InstrumentDescriptor_1.InstrumentType.COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.CounterInstrument(storage, descriptor); } - if (Array.isArray(val)) { - return isHomogeneousAttributeValueArray(val); + /** + * Create a {@link metrics.UpDownCounter} instrument. + */ + createUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, InstrumentDescriptor_1.InstrumentType.UP_DOWN_COUNTER, options); + const storage = this._meterSharedState.registerMetricStorage(descriptor); + return new Instruments_1.UpDownCounterInstrument(storage, descriptor); + } + /** + * Create a {@link metrics.ObservableGauge} instrument. + */ + createObservableGauge(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, InstrumentDescriptor_1.InstrumentType.OBSERVABLE_GAUGE, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableGaugeInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + /** + * Create a {@link metrics.ObservableCounter} instrument. + */ + createObservableCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, InstrumentDescriptor_1.InstrumentType.OBSERVABLE_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + /** + * Create a {@link metrics.ObservableUpDownCounter} instrument. + */ + createObservableUpDownCounter(name, options) { + const descriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(name, InstrumentDescriptor_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER, options); + const storages = this._meterSharedState.registerAsyncMetricStorage(descriptor); + return new Instruments_1.ObservableUpDownCounterInstrument(descriptor, storages, this._meterSharedState.observableRegistry); + } + /** + * @see {@link metrics.Meter.addBatchObservableCallback} + */ + addBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.addBatchCallback(callback, observables); + } + /** + * @see {@link metrics.Meter.removeBatchObservableCallback} + */ + removeBatchObservableCallback(callback, observables) { + this._meterSharedState.observableRegistry.removeBatchCallback(callback, observables); } - return isValidPrimitiveAttributeValue(val); } -exports.isAttributeValue = isAttributeValue; -function isHomogeneousAttributeValueArray(arr) { - let type; - for (const element of arr) { - // null/undefined elements are allowed - if (element == null) - continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; +exports.Meter = Meter; +//# sourceMappingURL=Meter.js.map + +/***/ }), + +/***/ 858: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MeterProvider = void 0; +const api = __nccwpck_require__(5163); +const metrics = __nccwpck_require__(4582); +const resources_1 = __nccwpck_require__(3871); +const MeterProviderSharedState_1 = __nccwpck_require__(9817); +const MetricCollector_1 = __nccwpck_require__(840); +/** + * This class implements the {@link metrics.MeterProvider} interface. + */ +class MeterProvider { + constructor(options) { + var _a; + this._shutdown = false; + this._sharedState = new MeterProviderSharedState_1.MeterProviderSharedState((_a = options === null || options === void 0 ? void 0 : options.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty()); + if ((options === null || options === void 0 ? void 0 : options.views) != null && options.views.length > 0) { + for (const view of options.views) { + this._sharedState.viewRegistry.addView(view); } - // encountered an invalid primitive - return false; } - if (typeof element === type) { - continue; + } + /** + * Get a meter with the configuration of the MeterProvider. + */ + getMeter(name, version = '', options = {}) { + // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#meter-creation + if (this._shutdown) { + api.diag.warn('A shutdown MeterProvider cannot provide a Meter'); + return metrics.NOOP_METER; } - return false; + return this._sharedState + .getMeterSharedState({ name, version, schemaUrl: options.schemaUrl }) + .meter; } - return true; -} -function isValidPrimitiveAttributeValue(val) { - switch (typeof val) { - case 'number': - return true; - case 'boolean': - return true; - case 'string': - return true; + /** + * Register a {@link MetricReader} to the meter provider. After the + * registration, the MetricReader can start metrics collection. + * + * @param metricReader the metric reader to be registered. + */ + addMetricReader(metricReader) { + const collector = new MetricCollector_1.MetricCollector(this._sharedState, metricReader); + metricReader.setMetricProducer(collector); + this._sharedState.metricCollectors.push(collector); + } + /** + * Flush all buffered data and shut down the MeterProvider and all registered + * MetricReaders. + * + * Returns a promise which is resolved when all flushes are complete. + */ + async shutdown(options) { + if (this._shutdown) { + api.diag.warn('shutdown may only be called once per MeterProvider'); + return; + } + this._shutdown = true; + await Promise.all(this._sharedState.metricCollectors.map(collector => { + return collector.shutdown(options); + })); + } + /** + * Notifies all registered MetricReaders to flush any buffered data. + * + * Returns a promise which is resolved when all flushes are complete. + */ + async forceFlush(options) { + // do not flush after shutdown + if (this._shutdown) { + api.diag.warn('invalid attempt to force flush after MeterProvider shutdown'); + return; + } + await Promise.all(this._sharedState.metricCollectors.map(collector => { + return collector.forceFlush(options); + })); } - return false; } -//# sourceMappingURL=attributes.js.map +exports.MeterProvider = MeterProvider; +//# sourceMappingURL=MeterProvider.js.map /***/ }), -/***/ 7111: +/***/ 9958: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14084,34 +14720,69 @@ function isValidPrimitiveAttributeValue(val) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; -const logging_error_handler_1 = __nccwpck_require__(6792); -/** The global error handler delegate */ -let delegateHandler = logging_error_handler_1.loggingErrorHandler(); +exports.BatchObservableResultImpl = exports.ObservableResultImpl = void 0; +const api = __nccwpck_require__(5163); +const metrics = __nccwpck_require__(4582); +const HashMap_1 = __nccwpck_require__(6780); +const Instruments_1 = __nccwpck_require__(5700); /** - * Set the global error handler - * @param {ErrorHandler} handler + * The class implements {@link metrics.ObservableResult} interface. */ -function setGlobalErrorHandler(handler) { - delegateHandler = handler; +class ObservableResultImpl { + constructor(_descriptor) { + this._descriptor = _descriptor; + /** + * @internal + */ + this._buffer = new HashMap_1.AttributeHashMap(); + } + /** + * Observe a measurement of the value associated with the given attributes. + */ + observe(value, attributes = {}) { + if (this._descriptor.valueType === metrics.ValueType.INT && !Number.isInteger(value)) { + api.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + } + this._buffer.set(attributes, value); + } } -exports.setGlobalErrorHandler = setGlobalErrorHandler; +exports.ObservableResultImpl = ObservableResultImpl; /** - * Return the global error handler - * @param {Exception} ex + * The class implements {@link metrics.BatchObservableCallback} interface. */ -function globalErrorHandler(ex) { - try { - delegateHandler(ex); +class BatchObservableResultImpl { + constructor() { + /** + * @internal + */ + this._buffer = new Map(); + } + /** + * Observe a measurement of the value associated with the given attributes. + */ + observe(metric, value, attributes = {}) { + if (!(0, Instruments_1.isObservableInstrument)(metric)) { + return; + } + let map = this._buffer.get(metric); + if (map == null) { + map = new HashMap_1.AttributeHashMap(); + this._buffer.set(metric, map); + } + if (metric._descriptor.valueType === metrics.ValueType.INT && !Number.isInteger(value)) { + api.diag.warn(`INT value type cannot accept a floating-point value for ${metric._descriptor.name}, ignoring the fractional digits.`); + value = Math.trunc(value); + } + map.set(attributes, value); } - catch (_a) { } // eslint-disable-line no-empty } -exports.globalErrorHandler = globalErrorHandler; -//# sourceMappingURL=global-error-handler.js.map +exports.BatchObservableResultImpl = BatchObservableResultImpl; +//# sourceMappingURL=ObservableResult.js.map /***/ }), -/***/ 6792: +/***/ 3793: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14132,56 +14803,219 @@ exports.globalErrorHandler = globalErrorHandler; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loggingErrorHandler = void 0; -const api_1 = __nccwpck_require__(5163); -/** - * Returns a function that logs an error using the provided logger, or a - * console logger if one was not provided. - */ -function loggingErrorHandler() { - return (ex) => { - api_1.diag.error(stringifyException(ex)); - }; +exports.DropAggregator = void 0; +const types_1 = __nccwpck_require__(8825); +/** Basic aggregator for None which keeps no recorded value. */ +class DropAggregator { + constructor() { + this.kind = types_1.AggregatorKind.DROP; + } + createAccumulation() { + return undefined; + } + merge(_previous, _delta) { + return undefined; + } + diff(_previous, _current) { + return undefined; + } + toMetricData(_descriptor, _aggregationTemporality, _accumulationByAttributes, _endTime) { + return undefined; + } } -exports.loggingErrorHandler = loggingErrorHandler; -/** - * Converts an exception into a string representation - * @param {Exception} ex +exports.DropAggregator = DropAggregator; +//# sourceMappingURL=Drop.js.map + +/***/ }), + +/***/ 9534: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -function stringifyException(ex) { - if (typeof ex === 'string') { - return ex; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.HistogramAggregator = exports.HistogramAccumulation = void 0; +const types_1 = __nccwpck_require__(8825); +const MetricData_1 = __nccwpck_require__(5498); +const InstrumentDescriptor_1 = __nccwpck_require__(177); +function createNewEmptyCheckpoint(boundaries) { + const counts = boundaries.map(() => 0); + counts.push(0); + return { + buckets: { + boundaries, + counts, + }, + sum: 0, + count: 0, + hasMinMax: false, + min: Infinity, + max: -Infinity + }; +} +class HistogramAccumulation { + constructor(startTime, _boundaries, _recordMinMax = true, _current = createNewEmptyCheckpoint(_boundaries)) { + this.startTime = startTime; + this._boundaries = _boundaries; + this._recordMinMax = _recordMinMax; + this._current = _current; + } + record(value) { + this._current.count += 1; + this._current.sum += value; + if (this._recordMinMax) { + this._current.min = Math.min(value, this._current.min); + this._current.max = Math.max(value, this._current.max); + this._current.hasMinMax = true; + } + for (let i = 0; i < this._boundaries.length; i++) { + if (value < this._boundaries[i]) { + this._current.buckets.counts[i] += 1; + return; + } + } + // value is above all observed boundaries + this._current.buckets.counts[this._boundaries.length] += 1; } - else { - return JSON.stringify(flattenException(ex)); + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; } } +exports.HistogramAccumulation = HistogramAccumulation; /** - * Flattens an exception into key-value pairs by traversing the prototype chain - * and coercing values to strings. Duplicate properties will not be overwritten; - * the first insert wins. + * Basic aggregator which observes events and counts them in pre-defined buckets + * and provides the total sum and count of all observations. */ -function flattenException(ex) { - const result = {}; - let current = ex; - while (current !== null) { - Object.getOwnPropertyNames(current).forEach(propertyName => { - if (result[propertyName]) - return; - const value = current[propertyName]; - if (value) { - result[propertyName] = String(value); +class HistogramAggregator { + /** + * @param _boundaries upper bounds of recorded values. + * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. + */ + constructor(_boundaries, _recordMinMax) { + this._boundaries = _boundaries; + this._recordMinMax = _recordMinMax; + this.kind = types_1.AggregatorKind.HISTOGRAM; + } + createAccumulation(startTime) { + return new HistogramAccumulation(startTime, this._boundaries, this._recordMinMax); + } + /** + * Return the result of the merge of two histogram accumulations. As long as one Aggregator + * instance produces all Accumulations with constant boundaries we don't need to worry about + * merging accumulations with different boundaries. + */ + merge(previous, delta) { + const previousValue = previous.toPointValue(); + const deltaValue = delta.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const deltaCounts = deltaValue.buckets.counts; + const mergedCounts = new Array(previousCounts.length); + for (let idx = 0; idx < previousCounts.length; idx++) { + mergedCounts[idx] = previousCounts[idx] + deltaCounts[idx]; + } + let min = Infinity; + let max = -Infinity; + if (this._recordMinMax) { + if (previousValue.hasMinMax && deltaValue.hasMinMax) { + min = Math.min(previousValue.min, deltaValue.min); + max = Math.max(previousValue.max, deltaValue.max); + } + else if (previousValue.hasMinMax) { + min = previousValue.min; + max = previousValue.max; } + else if (deltaValue.hasMinMax) { + min = deltaValue.min; + max = deltaValue.max; + } + } + return new HistogramAccumulation(previous.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: mergedCounts, + }, + count: previousValue.count + deltaValue.count, + sum: previousValue.sum + deltaValue.sum, + hasMinMax: this._recordMinMax && (previousValue.hasMinMax || deltaValue.hasMinMax), + min: min, + max: max }); - current = Object.getPrototypeOf(current); } - return result; + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + */ + diff(previous, current) { + const previousValue = previous.toPointValue(); + const currentValue = current.toPointValue(); + const previousCounts = previousValue.buckets.counts; + const currentCounts = currentValue.buckets.counts; + const diffedCounts = new Array(previousCounts.length); + for (let idx = 0; idx < previousCounts.length; idx++) { + diffedCounts[idx] = currentCounts[idx] - previousCounts[idx]; + } + return new HistogramAccumulation(current.startTime, previousValue.buckets.boundaries, this._recordMinMax, { + buckets: { + boundaries: previousValue.buckets.boundaries, + counts: diffedCounts, + }, + count: currentValue.count - previousValue.count, + sum: currentValue.sum - previousValue.sum, + hasMinMax: false, + min: Infinity, + max: -Infinity + }); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.HISTOGRAM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + const pointValue = accumulation.toPointValue(); + // determine if instrument allows negative values. + const allowsNegativeValues = (descriptor.type === InstrumentDescriptor_1.InstrumentType.UP_DOWN_COUNTER) || + (descriptor.type === InstrumentDescriptor_1.InstrumentType.OBSERVABLE_GAUGE) || + (descriptor.type === InstrumentDescriptor_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER); + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: { + min: pointValue.hasMinMax ? pointValue.min : undefined, + max: pointValue.hasMinMax ? pointValue.max : undefined, + sum: !allowsNegativeValues ? pointValue.sum : undefined, + buckets: pointValue.buckets, + count: pointValue.count + }, + }; + }) + }; + } } -//# sourceMappingURL=logging-error-handler.js.map +exports.HistogramAggregator = HistogramAggregator; +//# sourceMappingURL=Histogram.js.map /***/ }), -/***/ 5202: +/***/ 4872: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14202,164 +15036,80 @@ function flattenException(ex) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = void 0; -const platform_1 = __nccwpck_require__(5054); -const NANOSECOND_DIGITS = 9; -const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); -/** - * Converts a number to HrTime, HrTime = [number, number]. - * The first number is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * numberToHrtime calculates the first number by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * numberToHrtime calculates the second number by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * SECOND_TO_NANOSECONDS = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - * @param epochMillis - */ -function numberToHrtime(epochMillis) { - const epochSeconds = epochMillis / 1000; - // Decimals only. - const seconds = Math.trunc(epochSeconds); - // Round sub-nanosecond accuracy to nanosecond. - const nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) * - SECOND_TO_NANOSECONDS; - return [seconds, nanos]; -} -function getTimeOrigin() { - let timeOrigin = platform_1.otperformance.timeOrigin; - if (typeof timeOrigin !== 'number') { - const perf = platform_1.otperformance; - timeOrigin = perf.timing && perf.timing.fetchStart; +exports.LastValueAggregator = exports.LastValueAccumulation = void 0; +const types_1 = __nccwpck_require__(8825); +const core_1 = __nccwpck_require__(9736); +const MetricData_1 = __nccwpck_require__(5498); +class LastValueAccumulation { + constructor(startTime, _current = 0, sampleTime = [0, 0]) { + this.startTime = startTime; + this._current = _current; + this.sampleTime = sampleTime; } - return timeOrigin; -} -/** - * Returns an hrtime calculated via performance component. - * @param performanceNow - */ -function hrTime(performanceNow) { - const timeOrigin = numberToHrtime(getTimeOrigin()); - const now = numberToHrtime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); - let seconds = timeOrigin[0] + now[0]; - let nanos = timeOrigin[1] + now[1]; - // Nanoseconds - if (nanos > SECOND_TO_NANOSECONDS) { - nanos -= SECOND_TO_NANOSECONDS; - seconds += 1; + record(value) { + this._current = value; + this.sampleTime = (0, core_1.hrTime)(); + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; } - return [seconds, nanos]; } -exports.hrTime = hrTime; -/** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ -function timeInputToHrTime(time) { - // process.hrtime - if (isTimeInputHrTime(time)) { - return time; +exports.LastValueAccumulation = LastValueAccumulation; +/** Basic aggregator which calculates a LastValue from individual measurements. */ +class LastValueAggregator { + constructor() { + this.kind = types_1.AggregatorKind.LAST_VALUE; } - else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { - return hrTime(time); - } - else { - // epoch milliseconds or performance.timeOrigin - return numberToHrtime(time); - } + createAccumulation(startTime) { + return new LastValueAccumulation(startTime); } - else if (time instanceof Date) { - return numberToHrtime(time.getTime()); + /** + * Returns the result of the merge of the given accumulations. + * + * Return the newly captured (delta) accumulation for LastValueAggregator. + */ + merge(previous, delta) { + // nanoseconds may lose precisions. + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(delta.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? delta : previous; + return new LastValueAccumulation(previous.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); } - else { - throw TypeError('Invalid input type'); + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + * + * A delta aggregation is not meaningful to LastValueAggregator, just return + * the newly captured (delta) accumulation for LastValueAggregator. + */ + diff(previous, current) { + // nanoseconds may lose precisions. + const latestAccumulation = (0, core_1.hrTimeToMicroseconds)(current.sampleTime) >= (0, core_1.hrTimeToMicroseconds)(previous.sampleTime) ? current : previous; + return new LastValueAccumulation(current.startTime, latestAccumulation.toPointValue(), latestAccumulation.sampleTime); } -} -exports.timeInputToHrTime = timeInputToHrTime; -/** - * Returns a duration of two hrTime. - * @param startTime - * @param endTime - */ -function hrTimeDuration(startTime, endTime) { - let seconds = endTime[0] - startTime[0]; - let nanos = endTime[1] - startTime[1]; - // overflow - if (nanos < 0) { - seconds -= 1; - // negate - nanos += SECOND_TO_NANOSECONDS; + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.GAUGE, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue(), + }; + }) + }; } - return [seconds, nanos]; -} -exports.hrTimeDuration = hrTimeDuration; -/** - * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" - * @param time - */ -function hrTimeToTimeStamp(time) { - const precision = NANOSECOND_DIGITS; - const tmp = `${'0'.repeat(precision)}${time[1]}Z`; - const nanoString = tmp.substr(tmp.length - precision - 1); - const date = new Date(time[0] * 1000).toISOString(); - return date.replace('000Z', nanoString); -} -exports.hrTimeToTimeStamp = hrTimeToTimeStamp; -/** - * Convert hrTime to nanoseconds. - * @param time - */ -function hrTimeToNanoseconds(time) { - return time[0] * SECOND_TO_NANOSECONDS + time[1]; -} -exports.hrTimeToNanoseconds = hrTimeToNanoseconds; -/** - * Convert hrTime to milliseconds. - * @param time - */ -function hrTimeToMilliseconds(time) { - return Math.round(time[0] * 1e3 + time[1] / 1e6); -} -exports.hrTimeToMilliseconds = hrTimeToMilliseconds; -/** - * Convert hrTime to microseconds. - * @param time - */ -function hrTimeToMicroseconds(time) { - return Math.round(time[0] * 1e6 + time[1] / 1e3); -} -exports.hrTimeToMicroseconds = hrTimeToMicroseconds; -/** - * check if time is HrTime - * @param value - */ -function isTimeInputHrTime(value) { - return (Array.isArray(value) && - value.length === 2 && - typeof value[0] === 'number' && - typeof value[1] === 'number'); -} -exports.isTimeInputHrTime = isTimeInputHrTime; -/** - * check if input value is a correct types.TimeInput - * @param value - */ -function isTimeInput(value) { - return (isTimeInputHrTime(value) || - typeof value === 'number' || - value instanceof Date); } -exports.isTimeInput = isTimeInput; -//# sourceMappingURL=time.js.map +exports.LastValueAggregator = LastValueAggregator; +//# sourceMappingURL=LastValue.js.map /***/ }), -/***/ 9180: -/***/ ((__unused_webpack_module, exports) => { +/***/ 7104: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14379,11 +15129,89 @@ exports.isTimeInput = isTimeInput; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map +exports.SumAggregator = exports.SumAccumulation = void 0; +const types_1 = __nccwpck_require__(8825); +const MetricData_1 = __nccwpck_require__(5498); +class SumAccumulation { + constructor(startTime, monotonic, _current = 0, reset = false) { + this.startTime = startTime; + this.monotonic = monotonic; + this._current = _current; + this.reset = reset; + } + record(value) { + if (this.monotonic && value < 0) { + return; + } + this._current += value; + } + setStartTime(startTime) { + this.startTime = startTime; + } + toPointValue() { + return this._current; + } +} +exports.SumAccumulation = SumAccumulation; +/** Basic aggregator which calculates a Sum from individual measurements. */ +class SumAggregator { + constructor(monotonic) { + this.monotonic = monotonic; + this.kind = types_1.AggregatorKind.SUM; + } + createAccumulation(startTime) { + return new SumAccumulation(startTime, this.monotonic); + } + /** + * Returns the result of the merge of the given accumulations. + */ + merge(previous, delta) { + const prevPv = previous.toPointValue(); + const deltaPv = delta.toPointValue(); + if (delta.reset) { + return new SumAccumulation(delta.startTime, this.monotonic, deltaPv, delta.reset); + } + return new SumAccumulation(previous.startTime, this.monotonic, prevPv + deltaPv); + } + /** + * Returns a new DELTA aggregation by comparing two cumulative measurements. + */ + diff(previous, current) { + const prevPv = previous.toPointValue(); + const currPv = current.toPointValue(); + /** + * If the SumAggregator is a monotonic one and the previous point value is + * greater than the current one, a reset is deemed to be happened. + * Return the current point value to prevent the value from been reset. + */ + if (this.monotonic && (prevPv > currPv)) { + return new SumAccumulation(current.startTime, this.monotonic, currPv, true); + } + return new SumAccumulation(current.startTime, this.monotonic, currPv - prevPv); + } + toMetricData(descriptor, aggregationTemporality, accumulationByAttributes, endTime) { + return { + descriptor, + aggregationTemporality, + dataPointType: MetricData_1.DataPointType.SUM, + dataPoints: accumulationByAttributes.map(([attributes, accumulation]) => { + return { + attributes, + startTime: accumulation.startTime, + endTime, + value: accumulation.toPointValue(), + }; + }), + isMonotonic: this.monotonic + }; + } +} +exports.SumAggregator = SumAggregator; +//# sourceMappingURL=Sum.js.map /***/ }), -/***/ 5797: +/***/ 1609: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -14414,38 +15242,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageUtils = void 0; -__exportStar(__nccwpck_require__(6283), exports); -__exportStar(__nccwpck_require__(9790), exports); -__exportStar(__nccwpck_require__(7111), exports); -__exportStar(__nccwpck_require__(6792), exports); -__exportStar(__nccwpck_require__(5202), exports); -__exportStar(__nccwpck_require__(9180), exports); -__exportStar(__nccwpck_require__(9249), exports); -__exportStar(__nccwpck_require__(7129), exports); -exports.baggageUtils = __nccwpck_require__(889); -__exportStar(__nccwpck_require__(5054), exports); -__exportStar(__nccwpck_require__(5382), exports); -__exportStar(__nccwpck_require__(9320), exports); -__exportStar(__nccwpck_require__(8882), exports); -__exportStar(__nccwpck_require__(2765), exports); -__exportStar(__nccwpck_require__(4218), exports); -__exportStar(__nccwpck_require__(2233), exports); -__exportStar(__nccwpck_require__(9054), exports); -__exportStar(__nccwpck_require__(6168), exports); -__exportStar(__nccwpck_require__(1124), exports); -__exportStar(__nccwpck_require__(7364), exports); -__exportStar(__nccwpck_require__(1331), exports); -__exportStar(__nccwpck_require__(1502), exports); -__exportStar(__nccwpck_require__(5803), exports); -__exportStar(__nccwpck_require__(9747), exports); -__exportStar(__nccwpck_require__(5071), exports); -__exportStar(__nccwpck_require__(7129), exports); +__exportStar(__nccwpck_require__(3793), exports); +__exportStar(__nccwpck_require__(9534), exports); +__exportStar(__nccwpck_require__(4872), exports); +__exportStar(__nccwpck_require__(7104), exports); //# sourceMappingURL=index.js.map /***/ }), -/***/ 4895: +/***/ 8825: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14466,54 +15271,24 @@ __exportStar(__nccwpck_require__(7129), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateValue = exports.validateKey = void 0; -const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; -const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; -const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; -const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); -const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; -const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; -/** - * Key is opaque string up to 256 characters printable. It MUST begin with a - * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, - * underscores _, dashes -, asterisks *, and forward slashes /. - * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the - * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. - * see https://www.w3.org/TR/trace-context/#key - */ -function validateKey(key) { - return VALID_KEY_REGEX.test(key); -} -exports.validateKey = validateKey; -/** - * Value is opaque string up to 256 characters printable ASCII RFC0020 - * characters (i.e., the range 0x20 to 0x7E) except comma , and =. - */ -function validateValue(value) { - return (VALID_VALUE_BASE_REGEX.test(value) && - !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); -} -exports.validateValue = validateValue; -//# sourceMappingURL=validators.js.map +exports.AggregatorKind = void 0; +/** The kind of aggregator. */ +var AggregatorKind; +(function (AggregatorKind) { + AggregatorKind[AggregatorKind["DROP"] = 0] = "DROP"; + AggregatorKind[AggregatorKind["SUM"] = 1] = "SUM"; + AggregatorKind[AggregatorKind["LAST_VALUE"] = 2] = "LAST_VALUE"; + AggregatorKind[AggregatorKind["HISTOGRAM"] = 3] = "HISTOGRAM"; +})(AggregatorKind = exports.AggregatorKind || (exports.AggregatorKind = {})); +//# sourceMappingURL=types.js.map /***/ }), -/***/ 5054: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 9116: +/***/ ((__unused_webpack_module, exports) => { "use strict"; -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); /* * Copyright The OpenTelemetry Authors * @@ -14529,13 +15304,22 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * See the License for the specific language governing permissions and * limitations under the License. */ -__exportStar(__nccwpck_require__(8331), exports); -//# sourceMappingURL=index.js.map +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AggregationTemporality = void 0; +/** + * AggregationTemporality indicates the way additive quantities are expressed. + */ +var AggregationTemporality; +(function (AggregationTemporality) { + AggregationTemporality[AggregationTemporality["DELTA"] = 0] = "DELTA"; + AggregationTemporality[AggregationTemporality["CUMULATIVE"] = 1] = "CUMULATIVE"; +})(AggregationTemporality = exports.AggregationTemporality || (exports.AggregationTemporality = {})); +//# sourceMappingURL=AggregationTemporality.js.map /***/ }), -/***/ 2295: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6848: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14555,50 +15339,59 @@ __exportStar(__nccwpck_require__(8331), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); +exports.InMemoryMetricExporter = void 0; +const core_1 = __nccwpck_require__(9736); +/** + * In-memory Metrics Exporter is a Push Metric Exporter + * which accumulates metrics data in the local memory and + * allows to inspect it (useful for e.g. unit tests). + */ +class InMemoryMetricExporter { + constructor(aggregationTemporality) { + this._shutdown = false; + this._metrics = []; + this._aggregationTemporality = aggregationTemporality; } -} -exports.RandomIdGenerator = RandomIdGenerator; -const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); -function getIdGenerator(bytes) { - return function generateId() { - for (let i = 0; i < bytes / 4; i++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - for (let i = 0; i < bytes; i++) { - if (SHARED_BUFFER[i] > 0) { - break; - } - else if (i === bytes - 1) { - SHARED_BUFFER[bytes - 1] = 1; - } + /** + * @inheritedDoc + */ + export(metrics, resultCallback) { + // Avoid storing metrics when exporter is shutdown + if (this._shutdown) { + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.FAILED }), 0); + return; } - return SHARED_BUFFER.toString('hex', 0, bytes); - }; + this._metrics.push(metrics); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + /** + * Returns all the collected resource metrics + * @returns ResourceMetrics[] + */ + getMetrics() { + return this._metrics; + } + forceFlush() { + return Promise.resolve(); + } + reset() { + this._metrics = []; + } + selectAggregationTemporality(_instrumentType) { + return this._aggregationTemporality; + } + shutdown() { + this._shutdown = true; + return Promise.resolve(); + } } -//# sourceMappingURL=RandomIdGenerator.js.map +exports.InMemoryMetricExporter = InMemoryMetricExporter; +//# sourceMappingURL=InMemoryMetricExporter.js.map /***/ }), -/***/ 3810: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 5498: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14618,24 +15411,89 @@ function getIdGenerator(bytes) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnv = void 0; -const os = __nccwpck_require__(2087); -const environment_1 = __nccwpck_require__(1331); +exports.DataPointType = void 0; /** - * Gets the environment variables + * The aggregated point data type. */ -function getEnv() { - const processEnv = environment_1.parseEnvironment(process.env); - return Object.assign({ - HOSTNAME: os.hostname(), - }, environment_1.DEFAULT_ENVIRONMENT, processEnv); +var DataPointType; +(function (DataPointType) { + /** + * A histogram data point contains a histogram statistics of collected + * values with a list of explicit bucket boundaries and statistics such + * as min, max, count, and sum of all collected values. + */ + DataPointType[DataPointType["HISTOGRAM"] = 0] = "HISTOGRAM"; + /** + * An exponential histogram data point contains a histogram statistics of + * collected values where bucket boundaries are automatically calculated + * using an exponential function, and statistics such as min, max, count, + * and sum of all collected values. + */ + DataPointType[DataPointType["EXPONENTIAL_HISTOGRAM"] = 1] = "EXPONENTIAL_HISTOGRAM"; + /** + * A gauge metric data point has only a single numeric value. + */ + DataPointType[DataPointType["GAUGE"] = 2] = "GAUGE"; + /** + * A sum metric data point has a single numeric value and a + * monotonicity-indicator. + */ + DataPointType[DataPointType["SUM"] = 3] = "SUM"; +})(DataPointType = exports.DataPointType || (exports.DataPointType = {})); +//# sourceMappingURL=MetricData.js.map + +/***/ }), + +/***/ 4780: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConsoleMetricExporter = void 0; +const AggregationTemporality_1 = __nccwpck_require__(9116); +const core_1 = __nccwpck_require__(9736); +class ConsoleMetricExporter { + constructor(aggregationTemporality) { + this._shutdown = true; + this._aggregationTemporality = aggregationTemporality !== null && aggregationTemporality !== void 0 ? aggregationTemporality : AggregationTemporality_1.AggregationTemporality.CUMULATIVE; + } + export(metrics, resultCallback) { + return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error('Method not implemented') + }); + } + selectAggregationTemporality(_instrumentType) { + return this._aggregationTemporality; + } + // nothing to do + async forceFlush() { } + async shutdown() { + this._shutdown = true; + } } -exports.getEnv = getEnv; -//# sourceMappingURL=environment.js.map +exports.ConsoleMetricExporter = ConsoleMetricExporter; +//# sourceMappingURL=MetricExporter.js.map /***/ }), -/***/ 9232: +/***/ 9688: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -14656,21 +15514,128 @@ exports.getEnv = getEnv; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map +//# sourceMappingURL=MetricProducer.js.map /***/ }), -/***/ 9788: -/***/ ((__unused_webpack_module, exports) => { +/***/ 4137: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; +exports.MetricReader = void 0; +const api = __nccwpck_require__(5163); +const utils_1 = __nccwpck_require__(9599); +/** + * A registered reader of metrics that, when linked to a {@link MetricProducer}, offers global + * control over metrics. + */ +class MetricReader { + constructor() { + // Tracks the shutdown state. + // TODO: use BindOncePromise here once a new version of @opentelemetry/core is available. + this._shutdown = false; + } + /** + * Set the {@link MetricProducer} used by this instance. + * + * @param metricProducer + */ + setMetricProducer(metricProducer) { + if (this._metricProducer) { + throw new Error('MetricReader can not be bound to a MeterProvider again.'); + } + this._metricProducer = metricProducer; + this.onInitialized(); + } + /** + * Handle once the SDK has initialized this {@link MetricReader} + * Overriding this method is optional. + */ + onInitialized() { + // Default implementation is empty. + } + /** + * Collect all metrics from the associated {@link MetricProducer} + */ + async collect(options) { + if (this._metricProducer === undefined) { + throw new Error('MetricReader is not bound to a MetricProducer'); + } + // Subsequent invocations to collect are not allowed. SDKs SHOULD return some failure for these calls. + if (this._shutdown) { + throw new Error('MetricReader is shutdown'); + } + return this._metricProducer.collect({ + timeoutMillis: options === null || options === void 0 ? void 0 : options.timeoutMillis, + }); + } + /** + * Shuts down the metric reader, the promise will reject after the optional timeout or resolve after completion. + * + *

NOTE: this operation will continue even after the promise rejects due to a timeout. + * @param options options with timeout. + */ + async shutdown(options) { + // Do not call shutdown again if it has already been called. + if (this._shutdown) { + api.diag.error('Cannot call shutdown twice.'); + return; + } + // No timeout if timeoutMillis is undefined or null. + if ((options === null || options === void 0 ? void 0 : options.timeoutMillis) == null) { + await this.onShutdown(); + } + else { + await (0, utils_1.callWithTimeout)(this.onShutdown(), options.timeoutMillis); + } + this._shutdown = true; + } + /** + * Flushes metrics read by this reader, the promise will reject after the optional timeout or resolve after completion. + * + *

NOTE: this operation will continue even after the promise rejects due to a timeout. + * @param options options with timeout. + */ + async forceFlush(options) { + if (this._shutdown) { + api.diag.warn('Cannot forceFlush on already shutdown MetricReader.'); + return; + } + // No timeout if timeoutMillis is undefined or null. + if ((options === null || options === void 0 ? void 0 : options.timeoutMillis) == null) { + await this.onForceFlush(); + return; + } + await (0, utils_1.callWithTimeout)(this.onForceFlush(), options.timeoutMillis); + } +} +exports.MetricReader = MetricReader; +//# sourceMappingURL=MetricReader.js.map + +/***/ }), + +/***/ 5863: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + /* * Copyright The OpenTelemetry Authors * @@ -14686,22 +15651,90 @@ exports.hexToBase64 = void 0; * See the License for the specific language governing permissions and * limitations under the License. */ -function hexToBase64(hexStr) { - const hexStrLen = hexStr.length; - let hexAsciiCharsStr = ''; - for (let i = 0; i < hexStrLen; i += 2) { - const hexPair = hexStr.substring(i, i + 2); - const hexVal = parseInt(hexPair, 16); - hexAsciiCharsStr += String.fromCharCode(hexVal); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.PeriodicExportingMetricReader = void 0; +const api = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +const MetricReader_1 = __nccwpck_require__(4137); +const utils_1 = __nccwpck_require__(9599); +/** + * {@link MetricReader} which collects metrics based on a user-configurable time interval, and passes the metrics to + * the configured {@link MetricExporter} + */ +class PeriodicExportingMetricReader extends MetricReader_1.MetricReader { + constructor(options) { + var _a, _b; + super(); + if (options.exportIntervalMillis !== undefined && options.exportIntervalMillis <= 0) { + throw Error('exportIntervalMillis must be greater than 0'); + } + if (options.exportTimeoutMillis !== undefined && options.exportTimeoutMillis <= 0) { + throw Error('exportTimeoutMillis must be greater than 0'); + } + if (options.exportTimeoutMillis !== undefined && + options.exportIntervalMillis !== undefined && + options.exportIntervalMillis < options.exportTimeoutMillis) { + throw Error('exportIntervalMillis must be greater than or equal to exportTimeoutMillis'); + } + this._exportInterval = (_a = options.exportIntervalMillis) !== null && _a !== void 0 ? _a : 60000; + this._exportTimeout = (_b = options.exportTimeoutMillis) !== null && _b !== void 0 ? _b : 30000; + this._exporter = options.exporter; + } + async _runOnce() { + const { resourceMetrics, errors } = await this.collect({}); + if (errors.length > 0) { + api.diag.error('PeriodicExportingMetricReader: metrics collection errors', ...errors); + } + return new Promise((resolve, reject) => { + this._exporter.export(resourceMetrics, result => { + var _a; + if (result.code !== core_1.ExportResultCode.SUCCESS) { + reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`PeriodicExportingMetricReader: metrics export failed (error ${result.error})`)); + } + else { + resolve(); + } + }); + }); + } + onInitialized() { + // start running the interval as soon as this reader is initialized and keep handle for shutdown. + this._interval = setInterval(async () => { + try { + await (0, utils_1.callWithTimeout)(this._runOnce(), this._exportTimeout); + } + catch (err) { + if (err instanceof utils_1.TimeoutError) { + api.diag.error('Export took longer than %s milliseconds and timed out.', this._exportTimeout); + return; + } + (0, core_1.globalErrorHandler)(err); + } + }, this._exportInterval); + (0, core_1.unrefTimer)(this._interval); + } + async onForceFlush() { + await this._exporter.forceFlush(); + } + async onShutdown() { + if (this._interval) { + clearInterval(this._interval); + } + await this._exporter.shutdown(); + } + /** + * @inheritdoc + */ + selectAggregationTemporality(instrumentType) { + return this._exporter.selectAggregationTemporality(instrumentType); } - return Buffer.from(hexAsciiCharsStr, 'ascii').toString('base64'); } -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map +exports.PeriodicExportingMetricReader = PeriodicExportingMetricReader; +//# sourceMappingURL=PeriodicExportingMetricReader.js.map /***/ }), -/***/ 8331: +/***/ 8813: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -14732,18 +15765,28 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(3810), exports); -__exportStar(__nccwpck_require__(9232), exports); -__exportStar(__nccwpck_require__(9788), exports); -__exportStar(__nccwpck_require__(2295), exports); -__exportStar(__nccwpck_require__(4393), exports); -__exportStar(__nccwpck_require__(9292), exports); -__exportStar(__nccwpck_require__(3450), exports); +exports.TimeoutError = exports.InstrumentType = void 0; +__exportStar(__nccwpck_require__(9116), exports); +__exportStar(__nccwpck_require__(5498), exports); +__exportStar(__nccwpck_require__(4780), exports); +__exportStar(__nccwpck_require__(9688), exports); +__exportStar(__nccwpck_require__(4137), exports); +__exportStar(__nccwpck_require__(5863), exports); +__exportStar(__nccwpck_require__(6848), exports); +var InstrumentDescriptor_1 = __nccwpck_require__(177); +Object.defineProperty(exports, "InstrumentType", ({ enumerable: true, get: function () { return InstrumentDescriptor_1.InstrumentType; } })); +__exportStar(__nccwpck_require__(441), exports); +__exportStar(__nccwpck_require__(858), exports); +__exportStar(__nccwpck_require__(9958), exports); +var utils_1 = __nccwpck_require__(9599); +Object.defineProperty(exports, "TimeoutError", ({ enumerable: true, get: function () { return utils_1.TimeoutError; } })); +__exportStar(__nccwpck_require__(4760), exports); +__exportStar(__nccwpck_require__(2804), exports); //# sourceMappingURL=index.js.map /***/ }), -/***/ 4393: +/***/ 1960: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14764,14 +15807,48 @@ __exportStar(__nccwpck_require__(3450), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(630); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map +exports.AsyncMetricStorage = void 0; +const MetricStorage_1 = __nccwpck_require__(3240); +const DeltaMetricProcessor_1 = __nccwpck_require__(4281); +const TemporalMetricProcessor_1 = __nccwpck_require__(1694); +const HashMap_1 = __nccwpck_require__(6780); +/** + * Internal interface. + * + * Stores and aggregates {@link MetricData} for asynchronous instruments. + */ +class AsyncMetricStorage extends MetricStorage_1.MetricStorage { + constructor(_instrumentDescriptor, aggregator, _attributesProcessor) { + super(_instrumentDescriptor); + this._attributesProcessor = _attributesProcessor; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator); + } + record(measurements, observationTime) { + const processed = new HashMap_1.AttributeHashMap(); + Array.from(measurements.entries()).forEach(([attributes, value]) => { + processed.set(this._attributesProcessor.process(attributes), value); + }); + this._deltaMetricStorage.batchCumulate(processed, observationTime); + } + /** + * Collects the metrics from this storage. The ObservableCallback is invoked + * during the collection. + * + * Note: This is a stateful operation and may reset any interval-related + * state for the MetricCollector. + */ + collect(collector, collectors, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, collectors, this._instrumentDescriptor, accumulations, collectionTime); + } +} +exports.AsyncMetricStorage = AsyncMetricStorage; +//# sourceMappingURL=AsyncMetricStorage.js.map /***/ }), -/***/ 9292: +/***/ 4281: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14792,27 +15869,63 @@ exports.otperformance = perf_hooks_1.performance; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SDK_INFO = void 0; -const version_1 = __nccwpck_require__(7129); -const semantic_conventions_1 = __nccwpck_require__(2039); -/** Constants describing the SDK in use */ -exports.SDK_INFO = { - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TelemetrySdkLanguageValues.NODEJS, - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: version_1.VERSION, -}; -//# sourceMappingURL=sdk-info.js.map +exports.DeltaMetricProcessor = void 0; +const HashMap_1 = __nccwpck_require__(6780); +/** + * Internal interface. + * + * Allows synchronous collection of metrics. This processor should allow + * allocation of new aggregation cells for metrics and convert cumulative + * recording to delta data points. + */ +class DeltaMetricProcessor { + constructor(_aggregator) { + this._aggregator = _aggregator; + this._activeCollectionStorage = new HashMap_1.AttributeHashMap(); + // TODO: find a reasonable mean to clean the memo; + // https://github.com/open-telemetry/opentelemetry-specification/pull/2208 + this._cumulativeMemoStorage = new HashMap_1.AttributeHashMap(); + } + record(value, attributes, _context, collectionTime) { + const accumulation = this._activeCollectionStorage.getOrDefault(attributes, () => this._aggregator.createAccumulation(collectionTime)); + accumulation === null || accumulation === void 0 ? void 0 : accumulation.record(value); + } + batchCumulate(measurements, collectionTime) { + Array.from(measurements.entries()).forEach(([attributes, value, hashCode]) => { + const accumulation = this._aggregator.createAccumulation(collectionTime); + accumulation === null || accumulation === void 0 ? void 0 : accumulation.record(value); + let delta = accumulation; + if (this._cumulativeMemoStorage.has(attributes, hashCode)) { + // has() returned true, previous is present. + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const previous = this._cumulativeMemoStorage.get(attributes, hashCode); + delta = this._aggregator.diff(previous, accumulation); + } + // Save the current record and the delta record. + this._cumulativeMemoStorage.set(attributes, accumulation, hashCode); + this._activeCollectionStorage.set(attributes, delta, hashCode); + }); + } + /** + * Returns a collection of delta metrics. Start time is the when first + * time event collected. + */ + collect() { + const unreportedDelta = this._activeCollectionStorage; + this._activeCollectionStorage = new HashMap_1.AttributeHashMap(); + return unreportedDelta; + } +} +exports.DeltaMetricProcessor = DeltaMetricProcessor; +//# sourceMappingURL=DeltaMetricProcessor.js.map /***/ }), -/***/ 3450: -/***/ ((__unused_webpack_module, exports) => { +/***/ 6780: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; /* * Copyright The OpenTelemetry Authors * @@ -14828,15 +15941,76 @@ exports.unrefTimer = void 0; * See the License for the specific language governing permissions and * limitations under the License. */ -function unrefTimer(timer) { - timer.unref(); +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.AttributeHashMap = exports.HashMap = void 0; +const utils_1 = __nccwpck_require__(9599); +class HashMap { + constructor(_hash) { + this._hash = _hash; + this._valueMap = new Map(); + this._keyMap = new Map(); + } + get(key, hashCode) { + hashCode !== null && hashCode !== void 0 ? hashCode : (hashCode = this._hash(key)); + return this._valueMap.get(hashCode); + } + getOrDefault(key, defaultFactory) { + const hash = this._hash(key); + if (this._valueMap.has(hash)) { + return this._valueMap.get(hash); + } + const val = defaultFactory(); + if (!this._keyMap.has(hash)) { + this._keyMap.set(hash, key); + } + this._valueMap.set(hash, val); + return val; + } + set(key, value, hashCode) { + hashCode !== null && hashCode !== void 0 ? hashCode : (hashCode = this._hash(key)); + if (!this._keyMap.has(hashCode)) { + this._keyMap.set(hashCode, key); + } + this._valueMap.set(hashCode, value); + } + has(key, hashCode) { + hashCode !== null && hashCode !== void 0 ? hashCode : (hashCode = this._hash(key)); + return this._valueMap.has(hashCode); + } + *keys() { + const keyIterator = this._keyMap.entries(); + let next = keyIterator.next(); + while (next.done !== true) { + yield [next.value[1], next.value[0]]; + next = keyIterator.next(); + } + } + *entries() { + const valueIterator = this._valueMap.entries(); + let next = valueIterator.next(); + while (next.done !== true) { + // next.value[0] here can not be undefined + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + yield [this._keyMap.get(next.value[0]), next.value[1], next.value[0]]; + next = valueIterator.next(); + } + } + get size() { + return this._valueMap.size; + } } -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map +exports.HashMap = HashMap; +class AttributeHashMap extends HashMap { + constructor() { + super(utils_1.hashAttributes); + } +} +exports.AttributeHashMap = AttributeHashMap; +//# sourceMappingURL=HashMap.js.map /***/ }), -/***/ 5382: +/***/ 9817: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14857,74 +16031,135 @@ exports.unrefTimer = unrefTimer; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompositePropagator = void 0; -const api_1 = __nccwpck_require__(5163); -/** Combines multiple propagators into a single propagator. */ -class CompositePropagator { - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators - // older propagators may not have fields function, null check to be sure - .map(p => (typeof p.fields === 'function' ? p.fields() : [])) - .reduce((x, y) => x.concat(y), []))); +exports.MeterProviderSharedState = void 0; +const utils_1 = __nccwpck_require__(9599); +const ViewRegistry_1 = __nccwpck_require__(685); +const MeterSharedState_1 = __nccwpck_require__(5737); +/** + * An internal record for shared meter provider states. + */ +class MeterProviderSharedState { + constructor(resource) { + this.resource = resource; + this.viewRegistry = new ViewRegistry_1.ViewRegistry(); + this.metricCollectors = []; + this.meterSharedStates = new Map(); } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same carrier key, the propagator later in the list - * will "win". - * - * @param context Context to inject - * @param carrier Carrier into which context will be injected - */ - inject(context, carrier, setter) { - for (const propagator of this._propagators) { - try { - propagator.inject(context, carrier, setter); - } - catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); - } + getMeterSharedState(instrumentationScope) { + const id = (0, utils_1.instrumentationScopeId)(instrumentationScope); + let meterSharedState = this.meterSharedStates.get(id); + if (meterSharedState == null) { + meterSharedState = new MeterSharedState_1.MeterSharedState(this, instrumentationScope); + this.meterSharedStates.set(id, meterSharedState); } + return meterSharedState; + } +} +exports.MeterProviderSharedState = MeterProviderSharedState; +//# sourceMappingURL=MeterProviderSharedState.js.map + +/***/ }), + +/***/ 5737: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MeterSharedState = void 0; +const InstrumentDescriptor_1 = __nccwpck_require__(177); +const Meter_1 = __nccwpck_require__(441); +const utils_1 = __nccwpck_require__(9599); +const AsyncMetricStorage_1 = __nccwpck_require__(1960); +const MetricStorageRegistry_1 = __nccwpck_require__(4146); +const MultiWritableMetricStorage_1 = __nccwpck_require__(6445); +const ObservableRegistry_1 = __nccwpck_require__(6747); +const SyncMetricStorage_1 = __nccwpck_require__(9633); +/** + * An internal record for shared meter provider states. + */ +class MeterSharedState { + constructor(_meterProviderSharedState, _instrumentationScope) { + this._meterProviderSharedState = _meterProviderSharedState; + this._instrumentationScope = _instrumentationScope; + this._metricStorageRegistry = new MetricStorageRegistry_1.MetricStorageRegistry(); + this.observableRegistry = new ObservableRegistry_1.ObservableRegistry(); + this.meter = new Meter_1.Meter(this); + } + registerMetricStorage(descriptor) { + const views = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope); + const storages = views + .map(view => { + const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); + const aggregator = view.aggregation.createAggregator(viewDescriptor); + const storage = new SyncMetricStorage_1.SyncMetricStorage(viewDescriptor, aggregator, view.attributesProcessor); + return this._metricStorageRegistry.register(storage); + }) + .filter(utils_1.isNotNullish); + if (storages.length === 1) { + return storages[0]; + } + return new MultiWritableMetricStorage_1.MultiMetricStorage(storages); + } + registerAsyncMetricStorage(descriptor) { + const views = this._meterProviderSharedState.viewRegistry.findViews(descriptor, this._instrumentationScope); + const storages = views + .map(view => { + const viewDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptorWithView)(view, descriptor); + const aggregator = view.aggregation.createAggregator(viewDescriptor); + const viewStorage = new AsyncMetricStorage_1.AsyncMetricStorage(viewDescriptor, aggregator, view.attributesProcessor); + return this._metricStorageRegistry.register(viewStorage); + }) + .filter(utils_1.isNotNullish); + return storages; } /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same context key, the propagator later in the list - * will "win". - * - * @param context Context to add values to - * @param carrier Carrier from which to extract context + * @param collector opaque handle of {@link MetricCollector} which initiated the collection. + * @param collectionTime the HrTime at which the collection was initiated. + * @returns the list of metric data collected. */ - extract(context, carrier, getter) { - return this._propagators.reduce((ctx, propagator) => { - try { - return propagator.extract(ctx, carrier, getter); - } - catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); - } - return ctx; - }, context); - } - fields() { - // return a new array so our fields cannot be modified - return this._fields.slice(); + async collect(collector, collectionTime, options) { + /** + * 1. Call all observable callbacks first. + * 2. Collect metric result for the collector. + */ + const errors = await this.observableRegistry.observe(collectionTime, options === null || options === void 0 ? void 0 : options.timeoutMillis); + const metricDataList = Array.from(this._metricStorageRegistry.getStorages()) + .map(metricStorage => { + return metricStorage.collect(collector, this._meterProviderSharedState.metricCollectors, collectionTime); + }) + .filter(utils_1.isNotNullish); + return { + scopeMetrics: { + scope: this._instrumentationScope, + metrics: metricDataList.filter(utils_1.isNotNullish), + }, + errors, + }; } } -exports.CompositePropagator = CompositePropagator; -//# sourceMappingURL=composite.js.map +exports.MeterSharedState = MeterSharedState; +//# sourceMappingURL=MeterSharedState.js.map /***/ }), -/***/ 8882: -/***/ ((__unused_webpack_module, exports) => { +/***/ 840: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14944,11 +16179,54 @@ exports.CompositePropagator = CompositePropagator; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=IdGenerator.js.map +exports.MetricCollector = void 0; +const core_1 = __nccwpck_require__(9736); +const utils_1 = __nccwpck_require__(9599); +/** + * An internal opaque interface that the MetricReader receives as + * MetricProducer. It acts as the storage key to the internal metric stream + * state for each MetricReader. + */ +class MetricCollector { + constructor(_sharedState, _metricReader) { + this._sharedState = _sharedState; + this._metricReader = _metricReader; + } + async collect(options) { + const collectionTime = (0, core_1.hrTime)(); + const meterCollectionPromises = Array.from(this._sharedState.meterSharedStates.values()) + .map(meterSharedState => meterSharedState.collect(this, collectionTime, options)); + const result = await Promise.all(meterCollectionPromises); + return { + resourceMetrics: { + resource: this._sharedState.resource, + scopeMetrics: result.map(it => it.scopeMetrics), + }, + errors: (0, utils_1.FlatMap)(result, it => it.errors), + }; + } + /** + * Delegates for MetricReader.forceFlush. + */ + async forceFlush(options) { + await this._metricReader.forceFlush(options); + } + /** + * Delegates for MetricReader.shutdown. + */ + async shutdown(options) { + await this._metricReader.shutdown(options); + } + selectAggregationTemporality(instrumentType) { + return this._metricReader.selectAggregationTemporality(instrumentType); + } +} +exports.MetricCollector = MetricCollector; +//# sourceMappingURL=MetricCollector.js.map /***/ }), -/***/ 7364: +/***/ 3240: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -14969,96 +16247,34 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceState = void 0; -const validators_1 = __nccwpck_require__(4895); -const MAX_TRACE_STATE_ITEMS = 32; -const MAX_TRACE_STATE_LEN = 512; -const LIST_MEMBERS_SEPARATOR = ','; -const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; +exports.MetricStorage = void 0; +const InstrumentDescriptor_1 = __nccwpck_require__(177); /** - * TraceState must be a class and not a simple object type because of the spec - * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). + * Internal interface. * - * Here is the list of allowed mutations: - * - New key-value pair should be added into the beginning of the list - * - The value of any key can be updated. Modified keys MUST be moved to the - * beginning of the list. + * Represents a storage from which we can collect metrics. */ -class TraceState { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - const traceState = this._clone(); - if (traceState._internalState.has(key)) { - traceState._internalState.delete(key); - } - traceState._internalState.set(key, value); - return traceState; - } - unset(key) { - const traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; - } - get(key) { - return this._internalState.get(key); +class MetricStorage { + constructor(_instrumentDescriptor) { + this._instrumentDescriptor = _instrumentDescriptor; } - serialize() { - return this._keys() - .reduce((agg, key) => { - agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); - return agg; - }, []) - .join(LIST_MEMBERS_SEPARATOR); - } - _parse(rawTraceState) { - if (rawTraceState.length > MAX_TRACE_STATE_LEN) - return; - this._internalState = rawTraceState - .split(LIST_MEMBERS_SEPARATOR) - .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (i !== -1) { - const key = listMember.slice(0, i); - const value = listMember.slice(i + 1, part.length); - if (validators_1.validateKey(key) && validators_1.validateValue(value)) { - agg.set(key, value); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .slice(0, MAX_TRACE_STATE_ITEMS)); - } - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); + getInstrumentDescriptor() { + return this._instrumentDescriptor; } - _clone() { - const traceState = new TraceState(); - traceState._internalState = new Map(this._internalState); - return traceState; + updateDescription(description) { + this._instrumentDescriptor = (0, InstrumentDescriptor_1.createInstrumentDescriptor)(this._instrumentDescriptor.name, this._instrumentDescriptor.type, { + description: description, + valueType: this._instrumentDescriptor.valueType, + unit: this._instrumentDescriptor.unit + }); } } -exports.TraceState = TraceState; -//# sourceMappingURL=TraceState.js.map +exports.MetricStorage = MetricStorage; +//# sourceMappingURL=MetricStorage.js.map /***/ }), -/***/ 9320: +/***/ 4146: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15079,98 +16295,70 @@ exports.TraceState = TraceState; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; -const api_1 = __nccwpck_require__(5163); -const suppress_tracing_1 = __nccwpck_require__(1124); -const TraceState_1 = __nccwpck_require__(7364); -exports.TRACE_PARENT_HEADER = 'traceparent'; -exports.TRACE_STATE_HEADER = 'tracestate'; -const VERSION = '00'; -const VERSION_PART = '(?!ff)[\\da-f]{2}'; -const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; -const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; -const FLAGS_PART = '[\\da-f]{2}'; -const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); +exports.MetricStorageRegistry = void 0; +const InstrumentDescriptor_1 = __nccwpck_require__(177); +const api = __nccwpck_require__(5163); +const RegistrationConflicts_1 = __nccwpck_require__(488); /** - * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} - * @param traceParent - A meta property that comes from server. - * It should be dynamically generated server side to have the server's request trace Id, - * a parent span Id that was set on the server's request span, - * and the trace flags to indicate the server's sampling decision - * (01 = sampled, 00 = not sampled). - * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' - * For more information see {@link https://www.w3.org/TR/trace-context/} + * Internal class for storing {@link MetricStorage} */ -function parseTraceParent(traceParent) { - const match = TRACE_PARENT_REGEX.exec(traceParent); - if (!match) - return null; - // According to the specification the implementation should be compatible - // with future versions. If there are more parts, we only reject it if it's using version 00 - // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent - if (match[1] === '00' && match[5]) - return null; - return { - traceId: match[2], - spanId: match[3], - traceFlags: parseInt(match[4], 16), - }; -} -exports.parseTraceParent = parseTraceParent; -/** - * Propagates {@link SpanContext} through Trace Context format propagation. - * - * Based on the Trace Context specification: - * https://www.w3.org/TR/trace-context/ - */ -class W3CTraceContextPropagator { - inject(context, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context); - if (!spanContext || - suppress_tracing_1.isTracingSuppressed(context) || - !api_1.isSpanContextValid(spanContext)) - return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) { - setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } +class MetricStorageRegistry { + constructor() { + this._metricStorageRegistry = new Map(); } - extract(context, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) - return context; - const traceParent = Array.isArray(traceParentHeader) - ? traceParentHeader[0] - : traceParentHeader; - if (typeof traceParent !== 'string') - return context; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) - return context; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - // If more than one `tracestate` header is found, we merge them into a - // single header. - const state = Array.isArray(traceStateHeader) - ? traceStateHeader.join(',') - : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); + static create() { + return new MetricStorageRegistry(); + } + getStorages() { + let storages = []; + for (const metricStorages of this._metricStorageRegistry.values()) { + storages = storages.concat(metricStorages); + } + return storages; + } + register(storage) { + const expectedDescriptor = storage.getInstrumentDescriptor(); + const existingStorages = this._metricStorageRegistry.get(expectedDescriptor.name); + // Add storage if it does not exist. + if (existingStorages === undefined) { + this._metricStorageRegistry.set(expectedDescriptor.name, [storage]); + return storage; + } + let compatibleStorage = null; + for (const existingStorage of existingStorages) { + const existingDescriptor = existingStorage.getInstrumentDescriptor(); + if ((0, InstrumentDescriptor_1.isDescriptorCompatibleWith)(existingDescriptor, expectedDescriptor)) { + // Use the longer description if it does not match. + if (existingDescriptor.description !== expectedDescriptor.description) { + if (expectedDescriptor.description.length > existingDescriptor.description.length) { + existingStorage.updateDescription(expectedDescriptor.description); + } + api.diag.warn('A view or instrument with the name ', expectedDescriptor.name, ' has already been registered, but has a different description and is incompatible with another registered view.\n', 'Details:\n', (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), 'The longer description will be used.\nTo resolve the conflict:', (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } + // Storage is fully compatible. There will never be more than one pre-existing fully compatible storage. + compatibleStorage = existingStorage; + } + else { + // The implementation SHOULD warn about duplicate instrument registration + // conflicts after applying View configuration. + api.diag.warn('A view or instrument with the name ', expectedDescriptor.name, ' has already been registered and is incompatible with another registered view.\n', 'Details:\n', (0, RegistrationConflicts_1.getIncompatibilityDetails)(existingDescriptor, expectedDescriptor), 'To resolve the conflict:\n', (0, RegistrationConflicts_1.getConflictResolutionRecipe)(existingDescriptor, expectedDescriptor)); + } } - return api_1.trace.setSpanContext(context, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; + if (compatibleStorage != null) { + return compatibleStorage; + } + // None of the storages were compatible, add the current one to the list. + existingStorages.push(storage); + return storage; } } -exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -//# sourceMappingURL=W3CTraceContextPropagator.js.map +exports.MetricStorageRegistry = MetricStorageRegistry; +//# sourceMappingURL=MetricStorageRegistry.js.map /***/ }), -/***/ 2765: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6445: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -15190,30 +16378,26 @@ exports.W3CTraceContextPropagator = W3CTraceContextPropagator; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; -const api_1 = __nccwpck_require__(5163); -const RPC_METADATA_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key RPC_METADATA'); -var RPCType; -(function (RPCType) { - RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); -function setRPCMetadata(context, meta) { - return context.setValue(RPC_METADATA_KEY, meta); -} -exports.setRPCMetadata = setRPCMetadata; -function deleteRPCMetadata(context) { - return context.deleteValue(RPC_METADATA_KEY); -} -exports.deleteRPCMetadata = deleteRPCMetadata; -function getRPCMetadata(context) { - return context.getValue(RPC_METADATA_KEY); +exports.MultiMetricStorage = void 0; +/** + * Internal interface. + */ +class MultiMetricStorage { + constructor(_backingStorages) { + this._backingStorages = _backingStorages; + } + record(value, attributes, context, recordTime) { + this._backingStorages.forEach(it => { + it.record(value, attributes, context, recordTime); + }); + } } -exports.getRPCMetadata = getRPCMetadata; -//# sourceMappingURL=rpc-metadata.js.map +exports.MultiMetricStorage = MultiMetricStorage; +//# sourceMappingURL=MultiWritableMetricStorage.js.map /***/ }), -/***/ 4218: +/***/ 6747: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15234,25 +16418,120 @@ exports.getRPCMetadata = getRPCMetadata; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(5163); -/** Sampler that samples no traces. */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; +exports.ObservableRegistry = void 0; +const api = __nccwpck_require__(5163); +const Instruments_1 = __nccwpck_require__(5700); +const ObservableResult_1 = __nccwpck_require__(9958); +const utils_1 = __nccwpck_require__(9599); +/** + * An internal interface for managing ObservableCallbacks. + * + * Every registered callback associated with a set of instruments are be evaluated + * exactly once during collection prior to reading data for that instrument. + */ +class ObservableRegistry { + constructor() { + this._callbacks = []; + this._batchCallbacks = []; } - toString() { - return 'AlwaysOffSampler'; + addCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx >= 0) { + return; + } + this._callbacks.push({ callback, instrument }); + } + removeCallback(callback, instrument) { + const idx = this._findCallback(callback, instrument); + if (idx < 0) { + return; + } + this._callbacks.splice(idx, 1); + } + addBatchCallback(callback, instruments) { + // Create a set of unique instruments. + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + if (observableInstruments.size === 0) { + api.diag.error('BatchObservableCallback is not associated with valid instruments', instruments); + return; + } + const idx = this._findBatchCallback(callback, observableInstruments); + if (idx >= 0) { + return; + } + this._batchCallbacks.push({ callback, instruments: observableInstruments }); + } + removeBatchCallback(callback, instruments) { + // Create a set of unique instruments. + const observableInstruments = new Set(instruments.filter(Instruments_1.isObservableInstrument)); + const idx = this._findBatchCallback(callback, observableInstruments); + if (idx < 0) { + return; + } + this._batchCallbacks.splice(idx, 1); + } + /** + * @returns a promise of rejected reasons for invoking callbacks. + */ + async observe(collectionTime, timeoutMillis) { + const callbackFutures = this._observeCallbacks(collectionTime, timeoutMillis); + const batchCallbackFutures = this._observeBatchCallbacks(collectionTime, timeoutMillis); + const results = await (0, utils_1.PromiseAllSettled)([...callbackFutures, ...batchCallbackFutures]); + const rejections = results.filter(utils_1.isPromiseAllSettledRejectionResult) + .map(it => it.reason); + return rejections; + } + _observeCallbacks(observationTime, timeoutMillis) { + return this._callbacks + .map(async ({ callback, instrument }) => { + const observableResult = new ObservableResult_1.ObservableResultImpl(instrument._descriptor); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) { + callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + } + await callPromise; + instrument._metricStorages.forEach(metricStorage => { + metricStorage.record(observableResult._buffer, observationTime); + }); + }); + } + _observeBatchCallbacks(observationTime, timeoutMillis) { + return this._batchCallbacks + .map(async ({ callback, instruments }) => { + const observableResult = new ObservableResult_1.BatchObservableResultImpl(); + let callPromise = Promise.resolve(callback(observableResult)); + if (timeoutMillis != null) { + callPromise = (0, utils_1.callWithTimeout)(callPromise, timeoutMillis); + } + await callPromise; + instruments.forEach(instrument => { + const buffer = observableResult._buffer.get(instrument); + if (buffer == null) { + return; + } + instrument._metricStorages.forEach(metricStorage => { + metricStorage.record(buffer, observationTime); + }); + }); + }); + } + _findCallback(callback, instrument) { + return this._callbacks.findIndex(record => { + return record.callback === callback && record.instrument === instrument; + }); + } + _findBatchCallback(callback, instruments) { + return this._batchCallbacks.findIndex(record => { + return record.callback === callback && (0, utils_1.setEquals)(record.instruments, instruments); + }); } } -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map +exports.ObservableRegistry = ObservableRegistry; +//# sourceMappingURL=ObservableRegistry.js.map /***/ }), -/***/ 2233: +/***/ 9633: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15273,25 +16552,43 @@ exports.AlwaysOffSampler = AlwaysOffSampler; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(5163); -/** Sampler that samples all traces. */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; +exports.SyncMetricStorage = void 0; +const MetricStorage_1 = __nccwpck_require__(3240); +const DeltaMetricProcessor_1 = __nccwpck_require__(4281); +const TemporalMetricProcessor_1 = __nccwpck_require__(1694); +/** + * Internal interface. + * + * Stores and aggregates {@link MetricData} for synchronous instruments. + */ +class SyncMetricStorage extends MetricStorage_1.MetricStorage { + constructor(instrumentDescriptor, aggregator, _attributesProcessor) { + super(instrumentDescriptor); + this._attributesProcessor = _attributesProcessor; + this._deltaMetricStorage = new DeltaMetricProcessor_1.DeltaMetricProcessor(aggregator); + this._temporalMetricStorage = new TemporalMetricProcessor_1.TemporalMetricProcessor(aggregator); } - toString() { - return 'AlwaysOnSampler'; + record(value, attributes, context, recordTime) { + attributes = this._attributesProcessor.process(attributes, context); + this._deltaMetricStorage.record(value, attributes, context, recordTime); + } + /** + * Collects the metrics from this storage. + * + * Note: This is a stateful operation and may reset any interval-related + * state for the MetricCollector. + */ + collect(collector, collectors, collectionTime) { + const accumulations = this._deltaMetricStorage.collect(); + return this._temporalMetricStorage.buildMetrics(collector, collectors, this._instrumentDescriptor, accumulations, collectionTime); } } -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map +exports.SyncMetricStorage = SyncMetricStorage; +//# sourceMappingURL=SyncMetricStorage.js.map /***/ }), -/***/ 9054: +/***/ 1694: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15312,59 +16609,142 @@ exports.AlwaysOnSampler = AlwaysOnSampler; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(5163); -const global_error_handler_1 = __nccwpck_require__(7111); -const AlwaysOffSampler_1 = __nccwpck_require__(4218); -const AlwaysOnSampler_1 = __nccwpck_require__(2233); +exports.TemporalMetricProcessor = void 0; +const AggregationTemporality_1 = __nccwpck_require__(9116); +const HashMap_1 = __nccwpck_require__(6780); /** - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. + * Internal interface. + * + * Provides unique reporting for each collectors. Allows synchronous collection + * of metrics and reports given temporality values. */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - global_error_handler_1.globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); +class TemporalMetricProcessor { + constructor(_aggregator) { + this._aggregator = _aggregator; + this._unreportedAccumulations = new Map(); + this._reportHistory = new Map(); } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !api_1.isSpanContextValid(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); + /** + * Builds the {@link MetricData} streams to report against a specific MetricCollector. + * @param collector The information of the MetricCollector. + * @param collectors The registered collectors. + * @param resource The resource to attach these metrics against. + * @param instrumentationScope The instrumentation scope that generated these metrics. + * @param instrumentDescriptor The instrumentation descriptor that these metrics generated with. + * @param currentAccumulations The current accumulation of metric data from instruments. + * @param collectionTime The current collection timestamp. + * @returns The {@link MetricData} points or `null`. + */ + buildMetrics(collector, collectors, instrumentDescriptor, currentAccumulations, collectionTime) { + this._stashAccumulations(collectors, currentAccumulations); + const unreportedAccumulations = this._getMergedUnreportedAccumulations(collector); + let result = unreportedAccumulations; + let aggregationTemporality; + // Check our last report time. + if (this._reportHistory.has(collector)) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const last = this._reportHistory.get(collector); + const lastCollectionTime = last.collectionTime; + aggregationTemporality = last.aggregationTemporality; + // Use aggregation temporality + instrument to determine if we do a merge or a diff of + // previous. We have the following four scenarios: + // 1. Cumulative Aggregation (temporality) + Delta recording (sync instrument). + // Here we merge with our last record to get a cumulative aggregation. + // 2. Cumulative Aggregation + Cumulative recording (async instrument). + // Cumulative records are converted to delta recording with DeltaMetricProcessor. + // Here we merge with our last record to get a cumulative aggregation. + // 3. Delta Aggregation + Delta recording + // Calibrate the startTime of metric streams to be the reader's lastCollectionTime. + // 4. Delta Aggregation + Cumulative recording. + // Cumulative records are converted to delta recording with DeltaMetricProcessor. + // Calibrate the startTime of metric streams to be the reader's lastCollectionTime. + if (aggregationTemporality === AggregationTemporality_1.AggregationTemporality.CUMULATIVE) { + // We need to make sure the current delta recording gets merged into the previous cumulative + // for the next cumulative recording. + result = TemporalMetricProcessor.merge(last.accumulations, unreportedAccumulations, this._aggregator); + } + else { + result = TemporalMetricProcessor.calibrateStartTime(last.accumulations, unreportedAccumulations, lastCollectionTime); + } } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + else { + // Call into user code to select aggregation temporality for the instrument. + aggregationTemporality = collector.selectAggregationTemporality(instrumentDescriptor.type); + } + // Update last reported (cumulative) accumulation. + this._reportHistory.set(collector, { + accumulations: result, + collectionTime, + aggregationTemporality, + }); + return this._aggregator.toMetricData(instrumentDescriptor, aggregationTemporality, AttributesMapToAccumulationRecords(result), + /* endTime */ collectionTime); + } + _stashAccumulations(collectors, currentAccumulation) { + collectors.forEach(it => { + let stash = this._unreportedAccumulations.get(it); + if (stash === undefined) { + stash = []; + this._unreportedAccumulations.set(it, stash); } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + stash.push(currentAccumulation); + }); + } + _getMergedUnreportedAccumulations(collector) { + let result = new HashMap_1.AttributeHashMap(); + const unreportedList = this._unreportedAccumulations.get(collector); + this._unreportedAccumulations.set(collector, []); + if (unreportedList === undefined) { + return result; } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + for (const it of unreportedList) { + result = TemporalMetricProcessor.merge(result, it, this._aggregator); } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); + return result; } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; + static merge(last, current, aggregator) { + const result = last; + const iterator = current.entries(); + let next = iterator.next(); + while (next.done !== true) { + const [key, record, hash] = next.value; + if (last.has(key, hash)) { + const lastAccumulation = last.get(key, hash); + // last.has() returned true, lastAccumulation is present. + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const accumulation = aggregator.merge(lastAccumulation, record); + result.set(key, accumulation, hash); + } + else { + result.set(key, record, hash); + } + next = iterator.next(); + } + return result; + } + /** + * Calibrate the reported metric streams' startTime to lastCollectionTime. Leaves + * the new stream to be the initial observation time unchanged. + */ + static calibrateStartTime(last, current, lastCollectionTime) { + for (const [key, hash] of last.keys()) { + const currentAccumulation = current.get(key, hash); + currentAccumulation === null || currentAccumulation === void 0 ? void 0 : currentAccumulation.setStartTime(lastCollectionTime); + } + return current; } } -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map +exports.TemporalMetricProcessor = TemporalMetricProcessor; +// TypeScript complains about converting 3 elements tuple to AccumulationRecord. +function AttributesMapToAccumulationRecords(map) { + return Array.from(map.entries()); +} +//# sourceMappingURL=TemporalMetricProcessor.js.map /***/ }), -/***/ 6168: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9599: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -15384,46 +16764,123 @@ exports.ParentBasedSampler = ParentBasedSampler; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(5163); -/** Sampler that samples a given fraction of traces based of trace id deterministically. */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: api_1.isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return `TraceIdRatioBased{${this._ratio}}`; +exports.setEquals = exports.FlatMap = exports.isPromiseAllSettledRejectionResult = exports.PromiseAllSettled = exports.callWithTimeout = exports.TimeoutError = exports.instrumentationScopeId = exports.hashAttributes = exports.isNotNullish = void 0; +function isNotNullish(item) { + return item !== undefined && item !== null; +} +exports.isNotNullish = isNotNullish; +/** + * Converting the unordered attributes into unique identifier string. + * @param attributes user provided unordered MetricAttributes. + */ +function hashAttributes(attributes) { + let keys = Object.keys(attributes); + if (keys.length === 0) + return ''; + // Return a string that is stable on key orders. + keys = keys.sort(); + return JSON.stringify(keys.map(key => [key, attributes[key]])); +} +exports.hashAttributes = hashAttributes; +/** + * Converting the instrumentation scope object to a unique identifier string. + * @param instrumentationScope + */ +function instrumentationScopeId(instrumentationScope) { + var _a, _b; + return `${instrumentationScope.name}:${(_a = instrumentationScope.version) !== null && _a !== void 0 ? _a : ''}:${(_b = instrumentationScope.schemaUrl) !== null && _b !== void 0 ? _b : ''}`; +} +exports.instrumentationScopeId = instrumentationScopeId; +/** + * Error that is thrown on timeouts. + */ +class TimeoutError extends Error { + constructor(message) { + super(message); + // manually adjust prototype to retain `instanceof` functionality when targeting ES5, see: + // https://github.com/Microsoft/TypeScript-wiki/blob/main/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + Object.setPrototypeOf(this, TimeoutError.prototype); } - _normalize(ratio) { - if (typeof ratio !== 'number' || isNaN(ratio)) - return 0; - return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; +} +exports.TimeoutError = TimeoutError; +/** + * Adds a timeout to a promise and rejects if the specified timeout has elapsed. Also rejects if the specified promise + * rejects, and resolves if the specified promise resolves. + * + *

NOTE: this operation will continue even after it throws a {@link TimeoutError}. + * + * @param promise promise to use with timeout. + * @param timeout the timeout in milliseconds until the returned promise is rejected. + */ +function callWithTimeout(promise, timeout) { + let timeoutHandle; + const timeoutPromise = new Promise(function timeoutFunction(_resolve, reject) { + timeoutHandle = setTimeout(function timeoutHandler() { + reject(new TimeoutError('Operation timed out.')); + }, timeout); + }); + return Promise.race([promise, timeoutPromise]).then(result => { + clearTimeout(timeoutHandle); + return result; + }, reason => { + clearTimeout(timeoutHandle); + throw reason; + }); +} +exports.callWithTimeout = callWithTimeout; +/** + * Node.js v12.9 lower and browser compatible `Promise.allSettled`. + */ +async function PromiseAllSettled(promises) { + return Promise.all(promises.map(async (p) => { + try { + const ret = await p; + return { + status: 'fulfilled', + value: ret, + }; + } + catch (e) { + return { + status: 'rejected', + reason: e, + }; + } + })); +} +exports.PromiseAllSettled = PromiseAllSettled; +function isPromiseAllSettledRejectionResult(it) { + return it.status === 'rejected'; +} +exports.isPromiseAllSettledRejectionResult = isPromiseAllSettledRejectionResult; +/** + * Node.js v11.0 lower and browser compatible `Array.prototype.flatMap`. + */ +function FlatMap(arr, fn) { + const result = []; + arr.forEach(it => { + result.push(...fn(it)); + }); + return result; +} +exports.FlatMap = FlatMap; +function setEquals(lhs, rhs) { + if (lhs.size !== rhs.size) { + return false; } - _accumulate(traceId) { - let accumulation = 0; - for (let i = 0; i < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; + for (const item of lhs) { + if (!rhs.has(item)) { + return false; } - return accumulation; } + return true; } -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map +exports.setEquals = setEquals; +//# sourceMappingURL=utils.js.map /***/ }), -/***/ 1124: +/***/ 4760: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15444,27 +16901,154 @@ exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; -const api_1 = __nccwpck_require__(5163); -const SUPPRESS_TRACING_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); -function suppressTracing(context) { - return context.setValue(SUPPRESS_TRACING_KEY, true); +exports.DefaultAggregation = exports.ExplicitBucketHistogramAggregation = exports.HistogramAggregation = exports.LastValueAggregation = exports.SumAggregation = exports.DropAggregation = exports.Aggregation = void 0; +const api = __nccwpck_require__(5163); +const aggregator_1 = __nccwpck_require__(1609); +const InstrumentDescriptor_1 = __nccwpck_require__(177); +/** + * Configures how measurements are combined into metrics for views. + * + * Aggregation provides a set of built-in aggregations via static methods. + */ +class Aggregation { + static Drop() { + return DROP_AGGREGATION; + } + static Sum() { + return SUM_AGGREGATION; + } + static LastValue() { + return LAST_VALUE_AGGREGATION; + } + static Histogram() { + return HISTOGRAM_AGGREGATION; + } + static Default() { + return DEFAULT_AGGREGATION; + } } -exports.suppressTracing = suppressTracing; -function unsuppressTracing(context) { - return context.deleteValue(SUPPRESS_TRACING_KEY); +exports.Aggregation = Aggregation; +/** + * The default drop aggregation. + */ +class DropAggregation extends Aggregation { + createAggregator(_instrument) { + return DropAggregation.DEFAULT_INSTANCE; + } } -exports.unsuppressTracing = unsuppressTracing; -function isTracingSuppressed(context) { - return context.getValue(SUPPRESS_TRACING_KEY) === true; +exports.DropAggregation = DropAggregation; +DropAggregation.DEFAULT_INSTANCE = new aggregator_1.DropAggregator(); +/** + * The default sum aggregation. + */ +class SumAggregation extends Aggregation { + createAggregator(instrument) { + switch (instrument.type) { + case InstrumentDescriptor_1.InstrumentType.COUNTER: + case InstrumentDescriptor_1.InstrumentType.OBSERVABLE_COUNTER: + case InstrumentDescriptor_1.InstrumentType.HISTOGRAM: { + return SumAggregation.MONOTONIC_INSTANCE; + } + default: { + return SumAggregation.NON_MONOTONIC_INSTANCE; + } + } + } } -exports.isTracingSuppressed = isTracingSuppressed; -//# sourceMappingURL=suppress-tracing.js.map +exports.SumAggregation = SumAggregation; +SumAggregation.MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(true); +SumAggregation.NON_MONOTONIC_INSTANCE = new aggregator_1.SumAggregator(false); +/** + * The default last value aggregation. + */ +class LastValueAggregation extends Aggregation { + createAggregator(_instrument) { + return LastValueAggregation.DEFAULT_INSTANCE; + } +} +exports.LastValueAggregation = LastValueAggregation; +LastValueAggregation.DEFAULT_INSTANCE = new aggregator_1.LastValueAggregator(); +/** + * The default histogram aggregation. + */ +class HistogramAggregation extends Aggregation { + createAggregator(_instrument) { + return HistogramAggregation.DEFAULT_INSTANCE; + } +} +exports.HistogramAggregation = HistogramAggregation; +HistogramAggregation.DEFAULT_INSTANCE = new aggregator_1.HistogramAggregator([0, 5, 10, 25, 50, 75, 100, 250, 500, 1000], true); +/** + * The explicit bucket histogram aggregation. + */ +class ExplicitBucketHistogramAggregation extends Aggregation { + /** + * @param boundaries the bucket boundaries of the histogram aggregation + * @param _recordMinMax If set to true, min and max will be recorded. Otherwise, min and max will not be recorded. + */ + constructor(boundaries, _recordMinMax = true) { + super(); + this._recordMinMax = _recordMinMax; + if (boundaries === undefined || boundaries.length === 0) { + throw new Error('HistogramAggregator should be created with boundaries.'); + } + // Copy the boundaries array for modification. + boundaries = boundaries.concat(); + // We need to an ordered set to be able to correctly compute count for each + // boundary since we'll iterate on each in order. + boundaries = boundaries.sort((a, b) => a - b); + // Remove all Infinity from the boundaries. + const minusInfinityIndex = boundaries.lastIndexOf(-Infinity); + let infinityIndex = boundaries.indexOf(Infinity); + if (infinityIndex === -1) { + infinityIndex = undefined; + } + this._boundaries = boundaries.slice(minusInfinityIndex + 1, infinityIndex); + } + createAggregator(_instrument) { + return new aggregator_1.HistogramAggregator(this._boundaries, this._recordMinMax); + } +} +exports.ExplicitBucketHistogramAggregation = ExplicitBucketHistogramAggregation; +/** + * The default aggregation. + */ +class DefaultAggregation extends Aggregation { + _resolve(instrument) { + // cast to unknown to disable complaints on the (unreachable) fallback. + switch (instrument.type) { + case InstrumentDescriptor_1.InstrumentType.COUNTER: + case InstrumentDescriptor_1.InstrumentType.UP_DOWN_COUNTER: + case InstrumentDescriptor_1.InstrumentType.OBSERVABLE_COUNTER: + case InstrumentDescriptor_1.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER: { + return SUM_AGGREGATION; + } + case InstrumentDescriptor_1.InstrumentType.OBSERVABLE_GAUGE: { + return LAST_VALUE_AGGREGATION; + } + case InstrumentDescriptor_1.InstrumentType.HISTOGRAM: { + return HISTOGRAM_AGGREGATION; + } + } + api.diag.warn(`Unable to recognize instrument type: ${instrument.type}`); + return DROP_AGGREGATION; + } + createAggregator(instrument) { + return this._resolve(instrument).createAggregator(instrument); + } +} +exports.DefaultAggregation = DefaultAggregation; +const DROP_AGGREGATION = new DropAggregation(); +const SUM_AGGREGATION = new SumAggregation(); +const LAST_VALUE_AGGREGATION = new LastValueAggregation(); +const HISTOGRAM_AGGREGATION = new HistogramAggregation(); +const DEFAULT_AGGREGATION = new DefaultAggregation(); +//# sourceMappingURL=Aggregation.js.map /***/ }), -/***/ 1331: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4477: +/***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -15484,175 +17068,49 @@ exports.isTracingSuppressed = isTracingSuppressed; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; -const api_1 = __nccwpck_require__(5163); -const sampling_1 = __nccwpck_require__(5803); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_TRACES_EXPORTER: 'none', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', -}; +exports.FilteringAttributesProcessor = exports.NoopAttributesProcessor = exports.AttributesProcessor = void 0; /** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max + * The {@link AttributesProcessor} is responsible for customizing which + * attribute(s) are to be reported as metrics dimension(s) and adding + * additional dimension(s) from the {@link Context}. */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } +class AttributesProcessor { + static Noop() { + return NOOP; } } -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); +exports.AttributesProcessor = AttributesProcessor; +class NoopAttributesProcessor extends AttributesProcessor { + process(incoming, _context) { + return incoming; } } -// The support string -> DiagLogLevel mappings -const logLevelMap = { - ALL: api_1.DiagLogLevel.ALL, - VERBOSE: api_1.DiagLogLevel.VERBOSE, - DEBUG: api_1.DiagLogLevel.DEBUG, - INFO: api_1.DiagLogLevel.INFO, - WARN: api_1.DiagLogLevel.WARN, - ERROR: api_1.DiagLogLevel.ERROR, - NONE: api_1.DiagLogLevel.NONE, -}; +exports.NoopAttributesProcessor = NoopAttributesProcessor; /** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values + * {@link AttributesProcessor} that filters by allowed attribute names and drops any names that are not in the + * allow list. */ -function setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } +class FilteringAttributesProcessor extends AttributesProcessor { + constructor(_allowedAttributeNames) { + super(); + this._allowedAttributeNames = _allowedAttributeNames; } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } + process(incoming, _context) { + const filteredAttributes = {}; + Object.keys(incoming) + .filter(attributeName => this._allowedAttributeNames.includes(attributeName)) + .forEach(attributeName => filteredAttributes[attributeName] = incoming[attributeName]); + return filteredAttributes; } - return environment; } -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map +exports.FilteringAttributesProcessor = FilteringAttributesProcessor; +const NOOP = new NoopAttributesProcessor; +//# sourceMappingURL=AttributesProcessor.js.map /***/ }), -/***/ 3839: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2020: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15672,162 +17130,27 @@ exports.parseEnvironment = parseEnvironment; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPlainObject = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * based on lodash in order to support esm builds without esModuleInterop. - * lodash is using MIT License. - **/ -const objectTag = '[object Object]'; -const nullTag = '[object Null]'; -const undefinedTag = '[object Undefined]'; -const funcProto = Function.prototype; -const funcToString = funcProto.toString; -const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); -const objectProto = Object.prototype; -const hasOwnProperty = objectProto.hasOwnProperty; -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; -const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { - return false; - } - const proto = getPrototype(value); - if (proto === null) { - return true; - } - const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) === objectCtorString; -} -exports.isPlainObject = isPlainObject; -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; - let unmasked = false; - try { - value[symToStringTag] = undefined; - unmasked = true; +exports.InstrumentSelector = void 0; +const Predicate_1 = __nccwpck_require__(2871); +class InstrumentSelector { + constructor(criteria) { + var _a; + this._nameFilter = new Predicate_1.PatternPredicate((_a = criteria === null || criteria === void 0 ? void 0 : criteria.name) !== null && _a !== void 0 ? _a : '*'); + this._type = criteria === null || criteria === void 0 ? void 0 : criteria.type; } - catch (e) { - // silence + getType() { + return this._type; } - const result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } - else { - delete value[symToStringTag]; - } + getNameFilter() { + return this._nameFilter; } - return result; -} -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); } -//# sourceMappingURL=lodash.merge.js.map +exports.InstrumentSelector = InstrumentSelector; +//# sourceMappingURL=InstrumentSelector.js.map /***/ }), -/***/ 1502: +/***/ 5323: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -15848,152 +17171,33 @@ function objectToString(value) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -const lodash_merge_1 = __nccwpck_require__(3839); -const MAX_LEVEL = 20; -/** - * Merges objects together - * @param args - objects / values to be merged - */ -function merge(...args) { - let result = args.shift(); - const objects = new WeakMap(); - while (args.length > 0) { - result = mergeTwoObjects(result, args.shift(), 0, objects); - } - return result; -} -exports.merge = merge; -function takeValue(value) { - if (isArray(value)) { - return value.slice(); - } - return value; -} -/** - * Merges two objects - * @param one - first object - * @param two - second object - * @param level - current deep level - * @param objects - objects holder that has been already referenced - to prevent - * cyclic dependency - */ -function mergeTwoObjects(one, two, level = 0, objects) { - let result; - if (level > MAX_LEVEL) { - return undefined; - } - level++; - if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { - result = takeValue(two); - } - else if (isArray(one)) { - result = one.slice(); - if (isArray(two)) { - for (let i = 0, j = two.length; i < j; i++) { - result.push(takeValue(two[i])); - } - } - else if (isObject(two)) { - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - result[key] = takeValue(two[key]); - } - } +exports.MeterSelector = void 0; +const Predicate_1 = __nccwpck_require__(2871); +class MeterSelector { + constructor(criteria) { + this._nameFilter = new Predicate_1.ExactPredicate(criteria === null || criteria === void 0 ? void 0 : criteria.name); + this._versionFilter = new Predicate_1.ExactPredicate(criteria === null || criteria === void 0 ? void 0 : criteria.version); + this._schemaUrlFilter = new Predicate_1.ExactPredicate(criteria === null || criteria === void 0 ? void 0 : criteria.schemaUrl); } - else if (isObject(one)) { - if (isObject(two)) { - if (!shouldMerge(one, two)) { - return two; - } - result = Object.assign({}, one); - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - const twoValue = two[key]; - if (isPrimitive(twoValue)) { - if (typeof twoValue === 'undefined') { - delete result[key]; - } - else { - // result[key] = takeValue(twoValue); - result[key] = twoValue; - } - } - else { - const obj1 = result[key]; - const obj2 = twoValue; - if (wasObjectReferenced(one, key, objects) || - wasObjectReferenced(two, key, objects)) { - delete result[key]; - } - else { - if (isObject(obj1) && isObject(obj2)) { - const arr1 = objects.get(obj1) || []; - const arr2 = objects.get(obj2) || []; - arr1.push({ obj: one, key }); - arr2.push({ obj: two, key }); - objects.set(obj1, arr1); - objects.set(obj2, arr2); - } - result[key] = mergeTwoObjects(result[key], twoValue, level, objects); - } - } - } - } - else { - result = two; - } + getNameFilter() { + return this._nameFilter; } - return result; -} -/** - * Function to check if object has been already reference - * @param obj - * @param key - * @param objects - */ -function wasObjectReferenced(obj, key, objects) { - const arr = objects.get(obj[key]) || []; - for (let i = 0, j = arr.length; i < j; i++) { - const info = arr[i]; - if (info.key === key && info.obj === obj) { - return true; - } + /** + * TODO: semver filter? no spec yet. + */ + getVersionFilter() { + return this._versionFilter; } - return false; -} -function isArray(value) { - return Array.isArray(value); -} -function isFunction(value) { - return typeof value === 'function'; -} -function isObject(value) { - return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === 'object'; -} -function isPrimitive(value) { - return typeof value === 'string' || - typeof value === 'number' || - typeof value === 'boolean' || - typeof value === 'undefined' || - value instanceof Date || - value instanceof RegExp || - value === null; -} -function shouldMerge(one, two) { - if (!lodash_merge_1.isPlainObject(one) || !lodash_merge_1.isPlainObject(two)) { - return false; + getSchemaUrlFilter() { + return this._schemaUrlFilter; } - return true; } -//# sourceMappingURL=merge.js.map +exports.MeterSelector = MeterSelector; +//# sourceMappingURL=MeterSelector.js.map /***/ }), -/***/ 5803: +/***/ 2871: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -16014,73 +17218,60 @@ function shouldMerge(one, two) { * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; -var TracesSamplerValues; -(function (TracesSamplerValues) { - TracesSamplerValues["AlwaysOff"] = "always_off"; - TracesSamplerValues["AlwaysOn"] = "always_on"; - TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; - TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; - TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; - TracesSamplerValues["TraceIdRatio"] = "traceidratio"; -})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - -/***/ 9747: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isUrlIgnored = exports.urlMatches = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. +exports.ExactPredicate = exports.PatternPredicate = void 0; +// https://tc39.es/proposal-regex-escaping +// escape ^ $ \ . + ? ( ) [ ] { } | +// do not need to escape * as we are interpret it as wildcard +const ESCAPE = /[\^$\\.+?()[\]{}|]/g; +/** + * Wildcard pattern predicate, support patterns like `*`, `foo*`, `*bar`. */ -function urlMatches(url, urlToMatch) { - if (typeof urlToMatch === 'string') { - return url === urlToMatch; +class PatternPredicate { + constructor(pattern) { + if (pattern === '*') { + this._matchAll = true; + this._regexp = /.*/; + } + else { + this._matchAll = false; + this._regexp = new RegExp(PatternPredicate.escapePattern(pattern)); + } } - else { - return !!url.match(urlToMatch); + match(str) { + if (this._matchAll) { + return true; + } + return this._regexp.test(str); + } + static escapePattern(pattern) { + return `^${pattern.replace(ESCAPE, '\\$&').replace('*', '.*')}$`; + } + static hasWildcard(pattern) { + return pattern.includes('*'); } } -exports.urlMatches = urlMatches; -/** - * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} - * @param url - * @param ignoredUrls - */ -function isUrlIgnored(url, ignoredUrls) { - if (!ignoredUrls) { - return false; +exports.PatternPredicate = PatternPredicate; +class ExactPredicate { + constructor(pattern) { + this._matchAll = pattern === undefined; + this._pattern = pattern; } - for (const ignoreUrl of ignoredUrls) { - if (urlMatches(url, ignoreUrl)) { + match(str) { + if (this._matchAll) { + return true; + } + if (str === this._pattern) { return true; } + return false; } - return false; } -exports.isUrlIgnored = isUrlIgnored; -//# sourceMappingURL=url.js.map +exports.ExactPredicate = ExactPredicate; +//# sourceMappingURL=Predicate.js.map /***/ }), -/***/ 5071: +/***/ 488: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -16101,24 +17292,77 @@ exports.isUrlIgnored = isUrlIgnored; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); +exports.getConflictResolutionRecipe = exports.getDescriptionResolutionRecipe = exports.getTypeConflictResolutionRecipe = exports.getUnitConflictResolutionRecipe = exports.getValueTypeConflictResolutionRecipe = exports.getIncompatibilityDetails = void 0; +function getIncompatibilityDetails(existing, otherDescriptor) { + let incompatibility = ''; + if (existing.unit !== otherDescriptor.unit) { + incompatibility += `\t- Unit '${existing.unit}' does not match '${otherDescriptor.unit}'\n`; + } + if (existing.type !== otherDescriptor.type) { + incompatibility += `\t- Type '${existing.type}' does not match '${otherDescriptor.type}'\n`; + } + if (existing.valueType !== otherDescriptor.valueType) { + incompatibility += `\t- Value Type '${existing.valueType}' does not match '${otherDescriptor.valueType}'\n`; + } + if (existing.description !== otherDescriptor.description) { + incompatibility += `\t- Description '${existing.description}' does not match '${otherDescriptor.description}'\n`; + } + return incompatibility; } -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map +exports.getIncompatibilityDetails = getIncompatibilityDetails; +function getValueTypeConflictResolutionRecipe(existing, otherDescriptor) { + return `\t- use valueType '${existing.valueType}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; +} +exports.getValueTypeConflictResolutionRecipe = getValueTypeConflictResolutionRecipe; +function getUnitConflictResolutionRecipe(existing, otherDescriptor) { + return `\t- use unit '${existing.unit}' on instrument creation or use an instrument name other than '${otherDescriptor.name}'`; +} +exports.getUnitConflictResolutionRecipe = getUnitConflictResolutionRecipe; +function getTypeConflictResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type + }; + const selectorString = JSON.stringify(selector); + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}'`; +} +exports.getTypeConflictResolutionRecipe = getTypeConflictResolutionRecipe; +function getDescriptionResolutionRecipe(existing, otherDescriptor) { + const selector = { + name: otherDescriptor.name, + type: otherDescriptor.type + }; + const selectorString = JSON.stringify(selector); + return `\t- create a new view with a name other than '${existing.name}' and InstrumentSelector '${selectorString}' + \t- OR - create a new view with the name ${existing.name} and description '${existing.description}' and InstrumentSelector ${selectorString} + \t- OR - create a new view with the name ${otherDescriptor.name} and description '${existing.description}' and InstrumentSelector ${selectorString}`; +} +exports.getDescriptionResolutionRecipe = getDescriptionResolutionRecipe; +function getConflictResolutionRecipe(existing, otherDescriptor) { + // Conflicts that cannot be solved via views. + if (existing.valueType !== otherDescriptor.valueType) { + return getValueTypeConflictResolutionRecipe(existing, otherDescriptor); + } + if (existing.unit !== otherDescriptor.unit) { + return getUnitConflictResolutionRecipe(existing, otherDescriptor); + } + // Conflicts that can be solved via views. + if (existing.type !== otherDescriptor.type) { + // this will automatically solve possible description conflicts. + return getTypeConflictResolutionRecipe(existing, otherDescriptor); + } + if (existing.description !== otherDescriptor.description) { + return getDescriptionResolutionRecipe(existing, otherDescriptor); + } + return ''; +} +exports.getConflictResolutionRecipe = getConflictResolutionRecipe; +//# sourceMappingURL=RegistrationConflicts.js.map /***/ }), -/***/ 7129: -/***/ ((__unused_webpack_module, exports) => { +/***/ 2804: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16138,15 +17382,114 @@ exports.isWrapped = isWrapped; * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.0.1'; -//# sourceMappingURL=version.js.map +exports.View = void 0; +const Predicate_1 = __nccwpck_require__(2871); +const AttributesProcessor_1 = __nccwpck_require__(4477); +const InstrumentSelector_1 = __nccwpck_require__(2020); +const MeterSelector_1 = __nccwpck_require__(5323); +const Aggregation_1 = __nccwpck_require__(4760); +function isSelectorNotProvided(options) { + return (options.instrumentName == null && + options.instrumentType == null && + options.meterName == null && + options.meterVersion == null && + options.meterSchemaUrl == null); +} +/** + * Can be passed to a {@link MeterProvider} to select instruments and alter their metric stream. + */ +class View { + /** + * Create a new {@link View} instance. + * + * Parameters can be categorized as two types: + * Instrument selection criteria: Used to describe the instrument(s) this view will be applied to. + * Will be treated as additive (the Instrument has to meet all the provided criteria to be selected). + * + * Metric stream altering: Alter the metric stream of instruments selected by instrument selection criteria. + * + * @param viewOptions {@link ViewOptions} for altering the metric stream and instrument selection. + * @param viewOptions.name + * Alters the metric stream: + * This will be used as the name of the metrics stream. + * If not provided, the original Instrument name will be used. + * @param viewOptions.description + * Alters the metric stream: + * This will be used as the description of the metrics stream. + * If not provided, the original Instrument description will be used by default. + * @param viewOptions.attributeKeys + * Alters the metric stream: + * If provided, the attributes that are not in the list will be ignored. + * If not provided, all attribute keys will be used by default. + * @param viewOptions.aggregation + * Alters the metric stream: + * Alters the {@link Aggregation} of the metric stream. + * @param viewOptions.instrumentName + * Instrument selection criteria: + * Original name of the Instrument(s) with wildcard support. + * @param viewOptions.instrumentType + * Instrument selection criteria: + * The original type of the Instrument(s). + * @param viewOptions.meterName + * Instrument selection criteria: + * The name of the Meter. No wildcard support, name must match the meter exactly. + * @param viewOptions.meterVersion + * Instrument selection criteria: + * The version of the Meter. No wildcard support, version must match exactly. + * @param viewOptions.meterSchemaUrl + * Instrument selection criteria: + * The schema URL of the Meter. No wildcard support, schema URL must match exactly. + * + * @example + * // Create a view that changes the Instrument 'my.instrument' to use to an + * // ExplicitBucketHistogramAggregation with the boundaries [20, 30, 40] + * new View({ + * aggregation: new ExplicitBucketHistogramAggregation([20, 30, 40]), + * instrumentName: 'my.instrument' + * }) + */ + constructor(viewOptions) { + var _a; + // If no criteria is provided, the SDK SHOULD treat it as an error. + // It is recommended that the SDK implementations fail fast. + if (isSelectorNotProvided(viewOptions)) { + throw new Error('Cannot create view with no selector arguments supplied'); + } + // the SDK SHOULD NOT allow Views with a specified name to be declared with instrument selectors that + // may select more than one instrument (e.g. wild card instrument name) in the same Meter. + if (viewOptions.name != null && + ((viewOptions === null || viewOptions === void 0 ? void 0 : viewOptions.instrumentName) == null || + Predicate_1.PatternPredicate.hasWildcard(viewOptions.instrumentName))) { + throw new Error('Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.'); + } + // Create AttributesProcessor if attributeKeys are defined set. + if (viewOptions.attributeKeys != null) { + this.attributesProcessor = new AttributesProcessor_1.FilteringAttributesProcessor(viewOptions.attributeKeys); + } + else { + this.attributesProcessor = AttributesProcessor_1.AttributesProcessor.Noop(); + } + this.name = viewOptions.name; + this.description = viewOptions.description; + this.aggregation = (_a = viewOptions.aggregation) !== null && _a !== void 0 ? _a : Aggregation_1.Aggregation.Default(); + this.instrumentSelector = new InstrumentSelector_1.InstrumentSelector({ + name: viewOptions.instrumentName, + type: viewOptions.instrumentType, + }); + this.meterSelector = new MeterSelector_1.MeterSelector({ + name: viewOptions.meterName, + version: viewOptions.meterVersion, + schemaUrl: viewOptions.meterSchemaUrl + }); + } +} +exports.View = View; +//# sourceMappingURL=View.js.map /***/ }), -/***/ 2039: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 685: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16165,25 +17508,47 @@ exports.VERSION = '1.0.1'; * See the License for the specific language governing permissions and * limitations under the License. */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(2787), exports); -__exportStar(__nccwpck_require__(3896), exports); -//# sourceMappingURL=index.js.map +exports.ViewRegistry = void 0; +const View_1 = __nccwpck_require__(2804); +class ViewRegistry { + constructor() { + this._registeredViews = []; + } + addView(view) { + this._registeredViews.push(view); + } + findViews(instrument, meter) { + const views = this._registeredViews + .filter(registeredView => { + return this._matchInstrument(registeredView.instrumentSelector, instrument) && + this._matchMeter(registeredView.meterSelector, meter); + }); + if (views.length === 0) { + return [ViewRegistry.DEFAULT_VIEW]; + } + return views; + } + _matchInstrument(selector, instrument) { + return (selector.getType() === undefined || instrument.type === selector.getType()) && + selector.getNameFilter().match(instrument.name); + } + _matchMeter(selector, meter) { + return selector.getNameFilter().match(meter.name) && + (meter.version === undefined || selector.getVersionFilter().match(meter.version)) && + (meter.schemaUrl === undefined || selector.getSchemaUrlFilter().match(meter.schemaUrl)); + } +} +exports.ViewRegistry = ViewRegistry; +ViewRegistry.DEFAULT_VIEW = new View_1.View({ + instrumentName: '*' +}); +//# sourceMappingURL=ViewRegistry.js.map /***/ }), -/***/ 5601: -/***/ ((__unused_webpack_module, exports) => { +/***/ 8920: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; @@ -16203,521 +17568,1135 @@ __exportStar(__nccwpck_require__(3896), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticResourceAttributes = { - /** - * Name of the cloud provider. - */ - CLOUD_PROVIDER: 'cloud.provider', - /** - * The cloud account ID the resource is assigned to. - */ - CLOUD_ACCOUNT_ID: 'cloud.account.id', - /** - * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). - */ - CLOUD_REGION: 'cloud.region', - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - */ - CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone', - /** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - */ - CLOUD_PLATFORM: 'cloud.platform', - /** - * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - */ - AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn', - /** - * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - */ - AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn', +exports.BasicTracerProvider = exports.ForceFlushState = void 0; +const api_1 = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +const resources_1 = __nccwpck_require__(3871); +const _1 = __nccwpck_require__(9253); +const config_1 = __nccwpck_require__(91); +const MultiSpanProcessor_1 = __nccwpck_require__(2352); +const NoopSpanProcessor_1 = __nccwpck_require__(9252); +const platform_1 = __nccwpck_require__(262); +const utility_1 = __nccwpck_require__(4324); +var ForceFlushState; +(function (ForceFlushState) { + ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; + ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; + ForceFlushState[ForceFlushState["error"] = 2] = "error"; + ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; +})(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); +/** + * This class represents a basic tracer provider which platform libraries can extend + */ +class BasicTracerProvider { + constructor(config = {}) { + var _a; + this._registeredSpanProcessors = []; + this._tracers = new Map(); + const mergedConfig = (0, core_1.merge)({}, config_1.DEFAULT_CONFIG, (0, utility_1.reconfigureLimits)(config)); + this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty(); + this.resource = resources_1.Resource.default().merge(this.resource); + this._config = Object.assign({}, mergedConfig, { + resource: this.resource, + }); + const defaultExporter = this._buildExporterFromEnv(); + if (defaultExporter !== undefined) { + const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter); + this.activeSpanProcessor = batchProcessor; + } + else { + this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor(); + } + } + getTracer(name, version, options) { + const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`; + if (!this._tracers.has(key)) { + this._tracers.set(key, new _1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); + } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return this._tracers.get(key); + } /** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - */ - AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype', + * Adds a new {@link SpanProcessor} to this tracer. + * @param spanProcessor the new SpanProcessor to be added. + */ + addSpanProcessor(spanProcessor) { + if (this._registeredSpanProcessors.length === 0) { + // since we might have enabled by default a batchProcessor, we disable it + // before adding the new one + this.activeSpanProcessor + .shutdown() + .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err)); + } + this._registeredSpanProcessors.push(spanProcessor); + this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); + } + getActiveSpanProcessor() { + return this.activeSpanProcessor; + } /** - * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - */ - AWS_ECS_TASK_ARN: 'aws.ecs.task.arn', + * Register this TracerProvider for use with the OpenTelemetry API. + * Undefined values may be replaced with defaults, and + * null values will be skipped. + * + * @param config Configuration object for SDK registration + */ + register(config = {}) { + api_1.trace.setGlobalTracerProvider(this); + if (config.propagator === undefined) { + config.propagator = this._buildPropagatorFromEnv(); + } + if (config.contextManager) { + api_1.context.setGlobalContextManager(config.contextManager); + } + if (config.propagator) { + api_1.propagation.setGlobalPropagator(config.propagator); + } + } + forceFlush() { + const timeout = this._config.forceFlushTimeoutMillis; + const promises = this._registeredSpanProcessors.map((spanProcessor) => { + return new Promise(resolve => { + let state; + const timeoutInterval = setTimeout(() => { + resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); + state = ForceFlushState.timeout; + }, timeout); + spanProcessor + .forceFlush() + .then(() => { + clearTimeout(timeoutInterval); + if (state !== ForceFlushState.timeout) { + state = ForceFlushState.resolved; + resolve(state); + } + }) + .catch(error => { + clearTimeout(timeoutInterval); + state = ForceFlushState.error; + resolve(error); + }); + }); + }); + return new Promise((resolve, reject) => { + Promise.all(promises) + .then(results => { + const errors = results.filter(result => result !== ForceFlushState.resolved); + if (errors.length > 0) { + reject(errors); + } + else { + resolve(); + } + }) + .catch(error => reject([error])); + }); + } + shutdown() { + return this.activeSpanProcessor.shutdown(); + } /** - * The task definition family this task definition is a member of. - */ - AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family', + * TS cannot yet infer the type of this.constructor: + * https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146 + * There is no need to override either of the getters in your child class. + * The type of the registered component maps should be the same across all + * classes in the inheritance tree. + */ + _getPropagator(name) { + var _a; + return (_a = (this.constructor._registeredPropagators).get(name)) === null || _a === void 0 ? void 0 : _a(); + } + _getSpanExporter(name) { + var _a; + return (_a = (this.constructor._registeredExporters).get(name)) === null || _a === void 0 ? void 0 : _a(); + } + _buildPropagatorFromEnv() { + // per spec, propagators from env must be deduplicated + const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); + const propagators = uniquePropagatorNames.map(name => { + const propagator = this._getPropagator(name); + if (!propagator) { + api_1.diag.warn(`Propagator "${name}" requested through environment variable is unavailable.`); + } + return propagator; + }); + const validPropagators = propagators.reduce((list, item) => { + if (item) { + list.push(item); + } + return list; + }, []); + if (validPropagators.length === 0) { + return; + } + else if (uniquePropagatorNames.length === 1) { + return validPropagators[0]; + } + else { + return new core_1.CompositePropagator({ + propagators: validPropagators, + }); + } + } + _buildExporterFromEnv() { + const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER; + if (exporterName === 'none') + return; + const exporter = this._getSpanExporter(exporterName); + if (!exporter) { + api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`); + } + return exporter; + } +} +exports.BasicTracerProvider = BasicTracerProvider; +BasicTracerProvider._registeredPropagators = new Map([ + ['tracecontext', () => new core_1.W3CTraceContextPropagator()], + ['baggage', () => new core_1.W3CBaggagePropagator()], +]); +BasicTracerProvider._registeredExporters = new Map(); +//# sourceMappingURL=BasicTracerProvider.js.map + +/***/ }), + +/***/ 2352: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MultiSpanProcessor = void 0; +const core_1 = __nccwpck_require__(9736); +/** + * Implementation of the {@link SpanProcessor} that simply forwards all + * received events to a list of {@link SpanProcessor}s. + */ +class MultiSpanProcessor { + constructor(_spanProcessors) { + this._spanProcessors = _spanProcessors; + } + forceFlush() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.forceFlush()); + } + return new Promise(resolve => { + Promise.all(promises) + .then(() => { + resolve(); + }) + .catch(error => { + (0, core_1.globalErrorHandler)(error || new Error('MultiSpanProcessor: forceFlush failed')); + resolve(); + }); + }); + } + onStart(span, context) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onStart(span, context); + } + } + onEnd(span) { + for (const spanProcessor of this._spanProcessors) { + spanProcessor.onEnd(span); + } + } + shutdown() { + const promises = []; + for (const spanProcessor of this._spanProcessors) { + promises.push(spanProcessor.shutdown()); + } + return new Promise((resolve, reject) => { + Promise.all(promises).then(() => { + resolve(); + }, reject); + }); + } +} +exports.MultiSpanProcessor = MultiSpanProcessor; +//# sourceMappingURL=MultiSpanProcessor.js.map + +/***/ }), + +/***/ 1301: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Span = void 0; +const api = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +const semantic_conventions_1 = __nccwpck_require__(7275); +const enums_1 = __nccwpck_require__(5092); +/** + * This class represents a span. + */ +class Span { + /** Constructs a new Span instance. */ + constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime = (0, core_1.hrTime)()) { + this.attributes = {}; + this.links = []; + this.events = []; + this.status = { + code: api.SpanStatusCode.UNSET, + }; + this.endTime = [0, 0]; + this._ended = false; + this._duration = [-1, -1]; + this.name = spanName; + this._spanContext = spanContext; + this.parentSpanId = parentSpanId; + this.kind = kind; + this.links = links; + this.startTime = (0, core_1.timeInputToHrTime)(startTime); + this.resource = parentTracer.resource; + this.instrumentationLibrary = parentTracer.instrumentationLibrary; + this._spanLimits = parentTracer.getSpanLimits(); + this._spanProcessor = parentTracer.getActiveSpanProcessor(); + this._spanProcessor.onStart(this, context); + this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0; + } + spanContext() { + return this._spanContext; + } + setAttribute(key, value) { + if (value == null || this._isSpanEnded()) + return this; + if (key.length === 0) { + api.diag.warn(`Invalid attribute key: ${key}`); + return this; + } + if (!(0, core_1.isAttributeValue)(value)) { + api.diag.warn(`Invalid attribute value set for key: ${key}`); + return this; + } + if (Object.keys(this.attributes).length >= + this._spanLimits.attributeCountLimit && + !Object.prototype.hasOwnProperty.call(this.attributes, key)) { + return this; + } + this.attributes[key] = this._truncateToSize(value); + return this; + } + setAttributes(attributes) { + for (const [k, v] of Object.entries(attributes)) { + this.setAttribute(k, v); + } + return this; + } /** - * The revision for this task definition. - */ - AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision', + * + * @param name Span Name + * @param [attributesOrStartTime] Span attributes or start time + * if type is {@type TimeInput} and 3rd param is undefined + * @param [startTime] Specified start time for the event + */ + addEvent(name, attributesOrStartTime, startTime) { + if (this._isSpanEnded()) + return this; + if (this._spanLimits.eventCountLimit === 0) { + api.diag.warn('No events allowed.'); + return this; + } + if (this.events.length >= this._spanLimits.eventCountLimit) { + api.diag.warn('Dropping extra events.'); + this.events.shift(); + } + if ((0, core_1.isTimeInput)(attributesOrStartTime)) { + if (typeof startTime === 'undefined') { + startTime = attributesOrStartTime; + } + attributesOrStartTime = undefined; + } + if (typeof startTime === 'undefined') { + startTime = (0, core_1.hrTime)(); + } + const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime); + this.events.push({ + name, + attributes, + time: (0, core_1.timeInputToHrTime)(startTime), + }); + return this; + } + setStatus(status) { + if (this._isSpanEnded()) + return this; + this.status = status; + return this; + } + updateName(name) { + if (this._isSpanEnded()) + return this; + this.name = name; + return this; + } + end(endTime = (0, core_1.hrTime)()) { + if (this._isSpanEnded()) { + api.diag.error('You can only call end() on a span once.'); + return; + } + this._ended = true; + this.endTime = (0, core_1.timeInputToHrTime)(endTime); + this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); + if (this._duration[0] < 0) { + api.diag.warn('Inconsistent start and end time, startTime > endTime', this.startTime, this.endTime); + } + this._spanProcessor.onEnd(this); + } + isRecording() { + return this._ended === false; + } + recordException(exception, time = (0, core_1.hrTime)()) { + const attributes = {}; + if (typeof exception === 'string') { + attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE] = exception; + } + else if (exception) { + if (exception.code) { + attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] = exception.code.toString(); + } + else if (exception.name) { + attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] = exception.name; + } + if (exception.message) { + attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE] = exception.message; + } + if (exception.stack) { + attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_STACKTRACE] = exception.stack; + } + } + // these are minimum requirements from spec + if (attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] || + attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE]) { + this.addEvent(enums_1.ExceptionEventName, attributes, time); + } + else { + api.diag.warn(`Failed to record an exception ${exception}`); + } + } + get duration() { + return this._duration; + } + get ended() { + return this._ended; + } + _isSpanEnded() { + if (this._ended) { + api.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); + } + return this._ended; + } + // Utility function to truncate given value within size + // for value type of string, will truncate to given limit + // for type of non-string, will return same value + _truncateToLimitUtil(value, limit) { + if (value.length <= limit) { + return value; + } + return value.substr(0, limit); + } /** - * The ARN of an EKS cluster. - */ - AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn', + * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then + * return string with trucated to {@code attributeValueLengthLimit} characters + * + * If the given attribute value is array of strings then + * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters + * + * Otherwise return same Attribute {@code value} + * + * @param value Attribute value + * @returns truncated attribute value if required, otherwise same value + */ + _truncateToSize(value) { + const limit = this._attributeValueLengthLimit; + // Check limit + if (limit <= 0) { + // Negative values are invalid, so do not truncate + api.diag.warn(`Attribute value limit must be positive, got ${limit}`); + return value; + } + // String + if (typeof value === 'string') { + return this._truncateToLimitUtil(value, limit); + } + // Array of strings + if (Array.isArray(value)) { + return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val); + } + // Other types, no need to apply value length limit + return value; + } +} +exports.Span = Span; +//# sourceMappingURL=Span.js.map + +/***/ }), + +/***/ 3502: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=SpanProcessor.js.map + +/***/ }), + +/***/ 6598: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=TimedEvent.js.map + +/***/ }), + +/***/ 3806: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.Tracer = void 0; +const api = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +const Span_1 = __nccwpck_require__(1301); +const utility_1 = __nccwpck_require__(4324); +/** + * This class represents a basic tracer. + */ +class Tracer { /** - * The name(s) of the AWS log group(s) an application is writing to. - * - * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - */ - AWS_LOG_GROUP_NAMES: 'aws.log.group.names', - /** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - */ - AWS_LOG_GROUP_ARNS: 'aws.log.group.arns', - /** - * The name(s) of the AWS log stream(s) an application is writing to. - */ - AWS_LOG_STREAM_NAMES: 'aws.log.stream.names', - /** - * The ARN(s) of the AWS log stream(s). - * - * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - */ - AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns', - /** - * Container name. - */ - CONTAINER_NAME: 'container.name', - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. - */ - CONTAINER_ID: 'container.id', - /** - * The container runtime managing this container. - */ - CONTAINER_RUNTIME: 'container.runtime', + * Constructs a new Tracer instance. + */ + constructor(instrumentationLibrary, config, _tracerProvider) { + this._tracerProvider = _tracerProvider; + const localConfig = (0, utility_1.mergeConfig)(config); + this._sampler = localConfig.sampler; + this._generalLimits = localConfig.generalLimits; + this._spanLimits = localConfig.spanLimits; + this._idGenerator = config.idGenerator || new core_1.RandomIdGenerator(); + this.resource = _tracerProvider.resource; + this.instrumentationLibrary = instrumentationLibrary; + } /** - * Name of the image the container was built on. - */ - CONTAINER_IMAGE_NAME: 'container.image.name', + * Starts a new Span or returns the default NoopSpan based on the sampling + * decision. + */ + startSpan(name, options = {}, context = api.context.active()) { + var _a, _b; + if ((0, core_1.isTracingSuppressed)(context)) { + api.diag.debug('Instrumentation suppressed, returning Noop Span'); + return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); + } + // remove span from context in case a root span is requested via options + if (options.root) { + context = api.trace.deleteSpan(context); + } + const parentSpanContext = api.trace.getSpanContext(context); + const spanId = this._idGenerator.generateSpanId(); + let traceId; + let traceState; + let parentSpanId; + if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) { + // New root span. + traceId = this._idGenerator.generateTraceId(); + } + else { + // New child span. + traceId = parentSpanContext.traceId; + traceState = parentSpanContext.traceState; + parentSpanId = parentSpanContext.spanId; + } + const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL; + const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => { + return { + context: link.context, + attributes: (0, core_1.sanitizeAttributes)(link.attributes), + }; + }); + const attributes = (0, core_1.sanitizeAttributes)(options.attributes); + // make sampling decision + const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); + const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED + ? api.TraceFlags.SAMPLED + : api.TraceFlags.NONE; + const spanContext = { traceId, spanId, traceFlags, traceState }; + if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { + api.diag.debug('Recording is off, propagating context in a non-recording span'); + return api.trace.wrapSpanContext(spanContext); + } + const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime); + // Set initial span attributes. The attributes object may have been mutated + // by the sampler, so we sanitize the merged attributes before setting them. + const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); + span.setAttributes(initAttributes); + return span; + } + startActiveSpan(name, arg2, arg3, arg4) { + let opts; + let ctx; + let fn; + if (arguments.length < 2) { + return; + } + else if (arguments.length === 2) { + fn = arg2; + } + else if (arguments.length === 3) { + opts = arg2; + fn = arg3; + } + else { + opts = arg2; + ctx = arg3; + fn = arg4; + } + const parentContext = ctx !== null && ctx !== void 0 ? ctx : api.context.active(); + const span = this.startSpan(name, opts, parentContext); + const contextWithSpanSet = api.trace.setSpan(parentContext, span); + return api.context.with(contextWithSpanSet, fn, undefined, span); + } + /** Returns the active {@link GeneralLimits}. */ + getGeneralLimits() { + return this._generalLimits; + } + /** Returns the active {@link SpanLimits}. */ + getSpanLimits() { + return this._spanLimits; + } + getActiveSpanProcessor() { + return this._tracerProvider.getActiveSpanProcessor(); + } +} +exports.Tracer = Tracer; +//# sourceMappingURL=Tracer.js.map + +/***/ }), + +/***/ 91: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.buildSamplerFromEnv = exports.DEFAULT_CONFIG = void 0; +const api_1 = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +const env = (0, core_1.getEnv)(); +const FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; +const DEFAULT_RATIO = 1; +/** + * Default configuration. For fields with primitive values, any user-provided + * value will override the corresponding default value. For fields with + * non-primitive values (like `spanLimits`), the user-provided value will be + * used to extend the default value. + */ +exports.DEFAULT_CONFIG = { + sampler: buildSamplerFromEnv(env), + forceFlushTimeoutMillis: 30000, + generalLimits: { + attributeValueLengthLimit: (0, core_1.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: (0, core_1.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT, + }, + spanLimits: { + attributeValueLengthLimit: (0, core_1.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, + attributeCountLimit: (0, core_1.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, + linkCountLimit: (0, core_1.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT, + eventCountLimit: (0, core_1.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT, + }, +}; +/** + * Based on environment, builds a sampler, complies with specification. + * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment + */ +function buildSamplerFromEnv(environment = (0, core_1.getEnv)()) { + switch (environment.OTEL_TRACES_SAMPLER) { + case core_1.TracesSamplerValues.AlwaysOn: + return new core_1.AlwaysOnSampler(); + case core_1.TracesSamplerValues.AlwaysOff: + return new core_1.AlwaysOffSampler(); + case core_1.TracesSamplerValues.ParentBasedAlwaysOn: + return new core_1.ParentBasedSampler({ + root: new core_1.AlwaysOnSampler(), + }); + case core_1.TracesSamplerValues.ParentBasedAlwaysOff: + return new core_1.ParentBasedSampler({ + root: new core_1.AlwaysOffSampler(), + }); + case core_1.TracesSamplerValues.TraceIdRatio: + return new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); + case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: + return new core_1.ParentBasedSampler({ + root: new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), + }); + default: + api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); + return new core_1.AlwaysOnSampler(); + } +} +exports.buildSamplerFromEnv = buildSamplerFromEnv; +function getSamplerProbabilityFromEnv(environment) { + if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || + environment.OTEL_TRACES_SAMPLER_ARG === '') { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); + if (isNaN(probability)) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + if (probability < 0 || probability > 1) { + api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); + return DEFAULT_RATIO; + } + return probability; +} +//# sourceMappingURL=config.js.map + +/***/ }), + +/***/ 5092: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ExceptionEventName = void 0; +// Event name definitions +exports.ExceptionEventName = 'exception'; +//# sourceMappingURL=enums.js.map + +/***/ }), + +/***/ 9727: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BatchSpanProcessorBase = void 0; +const api_1 = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +/** + * Implementation of the {@link SpanProcessor} that batches spans exported by + * the SDK then pushes them to the exporter pipeline. + */ +class BatchSpanProcessorBase { + constructor(_exporter, config) { + this._exporter = _exporter; + this._finishedSpans = []; + const env = (0, core_1.getEnv)(); + this._maxExportBatchSize = + typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number' + ? config.maxExportBatchSize + : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; + this._maxQueueSize = + typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number' + ? config.maxQueueSize + : env.OTEL_BSP_MAX_QUEUE_SIZE; + this._scheduledDelayMillis = + typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number' + ? config.scheduledDelayMillis + : env.OTEL_BSP_SCHEDULE_DELAY; + this._exportTimeoutMillis = + typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number' + ? config.exportTimeoutMillis + : env.OTEL_BSP_EXPORT_TIMEOUT; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + } + forceFlush() { + if (this._shutdownOnce.isCalled) { + return this._shutdownOnce.promise; + } + return this._flushAll(); + } + // does nothing. + onStart(_span, _parentContext) { } + onEnd(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + this._addToBuffer(span); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return Promise.resolve() + .then(() => { + return this.onShutdown(); + }) + .then(() => { + return this._flushAll(); + }) + .then(() => { + return this._exporter.shutdown(); + }); + } + /** Add a span in the buffer. */ + _addToBuffer(span) { + if (this._finishedSpans.length >= this._maxQueueSize) { + // limit reached, drop span + return; + } + this._finishedSpans.push(span); + this._maybeStartTimer(); + } /** - * Container image tag. - */ - CONTAINER_IMAGE_TAG: 'container.image.tag', + * Send all spans to the exporter respecting the batch size limit + * This function is used only on forceFlush or shutdown, + * for all other cases _flush should be used + * */ + _flushAll() { + return new Promise((resolve, reject) => { + const promises = []; + // calculate number of batches + const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); + for (let i = 0, j = count; i < j; i++) { + promises.push(this._flushOneBatch()); + } + Promise.all(promises) + .then(() => { + resolve(); + }) + .catch(reject); + }); + } + _flushOneBatch() { + this._clearTimer(); + if (this._finishedSpans.length === 0) { + return Promise.resolve(); + } + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + // don't wait anymore for export, this way the next batch can start + reject(new Error('Timeout')); + }, this._exportTimeoutMillis); + // prevent downstream exporter calls from generating spans + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + // Reset the finished spans buffer here because the next invocations of the _flush method + // could pass the same finished spans to the exporter if the buffer is cleared + // outside of the execution of this callback. + this._exporter.export(this._finishedSpans.splice(0, this._maxExportBatchSize), result => { + var _a; + clearTimeout(timer); + if (result.code === core_1.ExportResultCode.SUCCESS) { + resolve(); + } + else { + reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error('BatchSpanProcessor: span export failed')); + } + }); + }); + }); + } + _maybeStartTimer() { + if (this._timer !== undefined) + return; + this._timer = setTimeout(() => { + this._flushOneBatch() + .then(() => { + if (this._finishedSpans.length > 0) { + this._clearTimer(); + this._maybeStartTimer(); + } + }) + .catch(e => { + (0, core_1.globalErrorHandler)(e); + }); + }, this._scheduledDelayMillis); + (0, core_1.unrefTimer)(this._timer); + } + _clearTimer() { + if (this._timer !== undefined) { + clearTimeout(this._timer); + this._timer = undefined; + } + } +} +exports.BatchSpanProcessorBase = BatchSpanProcessorBase; +//# sourceMappingURL=BatchSpanProcessorBase.js.map + +/***/ }), + +/***/ 6784: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.ConsoleSpanExporter = void 0; +const core_1 = __nccwpck_require__(9736); +/** + * This is implementation of {@link SpanExporter} that prints spans to the + * console. This class can be used for diagnostic purposes. + */ +/* eslint-disable no-console */ +class ConsoleSpanExporter { /** - * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - */ - DEPLOYMENT_ENVIRONMENT: 'deployment.environment', + * Export spans. + * @param spans + * @param resultCallback + */ + export(spans, resultCallback) { + return this._sendSpans(spans, resultCallback); + } /** - * A unique identifier representing the device. - * - * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. - */ - DEVICE_ID: 'device.id', + * Shutdown the exporter. + */ + shutdown() { + this._sendSpans([]); + return Promise.resolve(); + } /** - * The model identifier for the device. - * - * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. - */ - DEVICE_MODEL_IDENTIFIER: 'device.model.identifier', + * converts span info into more readable format + * @param span + */ + _exportInfo(span) { + return { + traceId: span.spanContext().traceId, + parentId: span.parentSpanId, + name: span.name, + id: span.spanContext().spanId, + kind: span.kind, + timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), + duration: (0, core_1.hrTimeToMicroseconds)(span.duration), + attributes: span.attributes, + status: span.status, + events: span.events, + links: span.links + }; + } /** - * The marketing name for the device model. - * - * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. - */ - DEVICE_MODEL_NAME: 'device.model.name', - /** - * The name of the single function that this runtime instance executes. - * - * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). - */ - FAAS_NAME: 'faas.name', - /** - * The unique ID of the single function that this runtime instance executes. - * - * Note: Depending on the cloud provider, use: - - * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - Take care not to use the "invoked ARN" directly but replace any - [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple - different aliases. - * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) - * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). - - On some providers, it may not be possible to determine the full ID at startup, - which is why this field cannot be made required. For example, on AWS the account ID - part of the ARN is not available without calling another AWS API - which may be deemed too slow for a short-running lambda function. - As an alternative, consider setting `faas.id` as a span attribute instead. - */ - FAAS_ID: 'faas.id', - /** - * The immutable version of the function being executed. - * - * Note: Depending on the cloud provider and platform, use: - - * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - (an integer represented as a decimal string). - * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) - (i.e., the function name plus the revision suffix). - * **Google Cloud Functions:** The value of the - [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - * **Azure Functions:** Not applicable. Do not set this attribute. - */ - FAAS_VERSION: 'faas.version', - /** - * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. - * - * Note: * **AWS Lambda:** Use the (full) log stream name. - */ - FAAS_INSTANCE: 'faas.instance', - /** - * The amount of memory available to the serverless function in MiB. - * - * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. - */ - FAAS_MAX_MEMORY: 'faas.max_memory', - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. - */ - HOST_ID: 'host.id', - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - */ - HOST_NAME: 'host.name', - /** - * Type of host. For Cloud, this must be the machine type. - */ - HOST_TYPE: 'host.type', - /** - * The CPU architecture the host system is running on. - */ - HOST_ARCH: 'host.arch', - /** - * Name of the VM image or OS install the host was instantiated from. - */ - HOST_IMAGE_NAME: 'host.image.name', - /** - * VM image ID. For Cloud, this value is from the provider. - */ - HOST_IMAGE_ID: 'host.image.id', - /** - * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). - */ - HOST_IMAGE_VERSION: 'host.image.version', - /** - * The name of the cluster. - */ - K8S_CLUSTER_NAME: 'k8s.cluster.name', - /** - * The name of the Node. - */ - K8S_NODE_NAME: 'k8s.node.name', - /** - * The UID of the Node. - */ - K8S_NODE_UID: 'k8s.node.uid', - /** - * The name of the namespace that the pod is running in. - */ - K8S_NAMESPACE_NAME: 'k8s.namespace.name', - /** - * The UID of the Pod. - */ - K8S_POD_UID: 'k8s.pod.uid', - /** - * The name of the Pod. - */ - K8S_POD_NAME: 'k8s.pod.name', - /** - * The name of the Container in a Pod template. - */ - K8S_CONTAINER_NAME: 'k8s.container.name', - /** - * The UID of the ReplicaSet. - */ - K8S_REPLICASET_UID: 'k8s.replicaset.uid', - /** - * The name of the ReplicaSet. - */ - K8S_REPLICASET_NAME: 'k8s.replicaset.name', - /** - * The UID of the Deployment. - */ - K8S_DEPLOYMENT_UID: 'k8s.deployment.uid', - /** - * The name of the Deployment. - */ - K8S_DEPLOYMENT_NAME: 'k8s.deployment.name', - /** - * The UID of the StatefulSet. - */ - K8S_STATEFULSET_UID: 'k8s.statefulset.uid', - /** - * The name of the StatefulSet. - */ - K8S_STATEFULSET_NAME: 'k8s.statefulset.name', - /** - * The UID of the DaemonSet. - */ - K8S_DAEMONSET_UID: 'k8s.daemonset.uid', - /** - * The name of the DaemonSet. - */ - K8S_DAEMONSET_NAME: 'k8s.daemonset.name', - /** - * The UID of the Job. - */ - K8S_JOB_UID: 'k8s.job.uid', - /** - * The name of the Job. - */ - K8S_JOB_NAME: 'k8s.job.name', - /** - * The UID of the CronJob. - */ - K8S_CRONJOB_UID: 'k8s.cronjob.uid', - /** - * The name of the CronJob. - */ - K8S_CRONJOB_NAME: 'k8s.cronjob.name', - /** - * The operating system type. - */ - OS_TYPE: 'os.type', - /** - * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - */ - OS_DESCRIPTION: 'os.description', - /** - * Human readable operating system name. - */ - OS_NAME: 'os.name', - /** - * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). - */ - OS_VERSION: 'os.version', - /** - * Process identifier (PID). - */ - PROCESS_PID: 'process.pid', - /** - * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. - */ - PROCESS_EXECUTABLE_NAME: 'process.executable.name', - /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - */ - PROCESS_EXECUTABLE_PATH: 'process.executable.path', - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - */ - PROCESS_COMMAND: 'process.command', - /** - * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. - */ - PROCESS_COMMAND_LINE: 'process.command_line', - /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - */ - PROCESS_COMMAND_ARGS: 'process.command_args', - /** - * The username of the user that owns the process. - */ - PROCESS_OWNER: 'process.owner', - /** - * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. - */ - PROCESS_RUNTIME_NAME: 'process.runtime.name', - /** - * The version of the runtime of this process, as returned by the runtime without modification. - */ - PROCESS_RUNTIME_VERSION: 'process.runtime.version', - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - */ - PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description', - /** - * Logical name of the service. - * - * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - */ - SERVICE_NAME: 'service.name', - /** - * A namespace for `service.name`. - * - * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - */ - SERVICE_NAMESPACE: 'service.namespace', - /** - * The string ID of the service instance. - * - * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). - */ - SERVICE_INSTANCE_ID: 'service.instance.id', - /** - * The version string of the service API or implementation. - */ - SERVICE_VERSION: 'service.version', - /** - * The name of the telemetry SDK as defined above. - */ - TELEMETRY_SDK_NAME: 'telemetry.sdk.name', - /** - * The language of the telemetry SDK. - */ - TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language', - /** - * The version string of the telemetry SDK. - */ - TELEMETRY_SDK_VERSION: 'telemetry.sdk.version', - /** - * The version string of the auto instrumentation agent, if used. - */ - TELEMETRY_AUTO_VERSION: 'telemetry.auto.version', - /** - * The name of the web engine. - */ - WEBENGINE_NAME: 'webengine.name', - /** - * The version of the web engine. - */ - WEBENGINE_VERSION: 'webengine.version', - /** - * Additional description of the web engine (e.g. detailed version and edition information). - */ - WEBENGINE_DESCRIPTION: 'webengine.description', -}; -exports.CloudProviderValues = { - /** Alibaba Cloud. */ - ALIBABA_CLOUD: 'alibaba_cloud', - /** Amazon Web Services. */ - AWS: 'aws', - /** Microsoft Azure. */ - AZURE: 'azure', - /** Google Cloud Platform. */ - GCP: 'gcp', -}; -exports.CloudPlatformValues = { - /** Alibaba Cloud Elastic Compute Service. */ - ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs', - /** Alibaba Cloud Function Compute. */ - ALIBABA_CLOUD_FC: 'alibaba_cloud_fc', - /** AWS Elastic Compute Cloud. */ - AWS_EC2: 'aws_ec2', - /** AWS Elastic Container Service. */ - AWS_ECS: 'aws_ecs', - /** AWS Elastic Kubernetes Service. */ - AWS_EKS: 'aws_eks', - /** AWS Lambda. */ - AWS_LAMBDA: 'aws_lambda', - /** AWS Elastic Beanstalk. */ - AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk', - /** Azure Virtual Machines. */ - AZURE_VM: 'azure_vm', - /** Azure Container Instances. */ - AZURE_CONTAINER_INSTANCES: 'azure_container_instances', - /** Azure Kubernetes Service. */ - AZURE_AKS: 'azure_aks', - /** Azure Functions. */ - AZURE_FUNCTIONS: 'azure_functions', - /** Azure App Service. */ - AZURE_APP_SERVICE: 'azure_app_service', - /** Google Cloud Compute Engine (GCE). */ - GCP_COMPUTE_ENGINE: 'gcp_compute_engine', - /** Google Cloud Run. */ - GCP_CLOUD_RUN: 'gcp_cloud_run', - /** Google Cloud Kubernetes Engine (GKE). */ - GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine', - /** Google Cloud Functions (GCF). */ - GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions', - /** Google Cloud App Engine (GAE). */ - GCP_APP_ENGINE: 'gcp_app_engine', -}; -exports.AwsEcsLaunchtypeValues = { - /** ec2. */ - EC2: 'ec2', - /** fargate. */ - FARGATE: 'fargate', -}; -exports.HostArchValues = { - /** AMD64. */ - AMD64: 'amd64', - /** ARM32. */ - ARM32: 'arm32', - /** ARM64. */ - ARM64: 'arm64', - /** Itanium. */ - IA64: 'ia64', - /** 32-bit PowerPC. */ - PPC32: 'ppc32', - /** 64-bit PowerPC. */ - PPC64: 'ppc64', - /** 32-bit x86. */ - X86: 'x86', -}; -exports.OsTypeValues = { - /** Microsoft Windows. */ - WINDOWS: 'windows', - /** Linux. */ - LINUX: 'linux', - /** Apple Darwin. */ - DARWIN: 'darwin', - /** FreeBSD. */ - FREEBSD: 'freebsd', - /** NetBSD. */ - NETBSD: 'netbsd', - /** OpenBSD. */ - OPENBSD: 'openbsd', - /** DragonFly BSD. */ - DRAGONFLYBSD: 'dragonflybsd', - /** HP-UX (Hewlett Packard Unix). */ - HPUX: 'hpux', - /** AIX (Advanced Interactive eXecutive). */ - AIX: 'aix', - /** Oracle Solaris. */ - SOLARIS: 'solaris', - /** IBM z/OS. */ - Z_OS: 'z_os', -}; -exports.TelemetrySdkLanguageValues = { - /** cpp. */ - CPP: 'cpp', - /** dotnet. */ - DOTNET: 'dotnet', - /** erlang. */ - ERLANG: 'erlang', - /** go. */ - GO: 'go', - /** java. */ - JAVA: 'java', - /** nodejs. */ - NODEJS: 'nodejs', - /** php. */ - PHP: 'php', - /** python. */ - PYTHON: 'python', - /** ruby. */ - RUBY: 'ruby', - /** webjs. */ - WEBJS: 'webjs', -}; -//# sourceMappingURL=SemanticResourceAttributes.js.map + * Showing spans in console + * @param spans + * @param done + */ + _sendSpans(spans, done) { + for (const span of spans) { + console.dir(this._exportInfo(span), { depth: 3 }); + } + if (done) { + return done({ code: core_1.ExportResultCode.SUCCESS }); + } + } +} +exports.ConsoleSpanExporter = ConsoleSpanExporter; +//# sourceMappingURL=ConsoleSpanExporter.js.map /***/ }), -/***/ 3896: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 4093: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { "use strict"; -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.InMemorySpanExporter = void 0; +const core_1 = __nccwpck_require__(9736); +/** + * This class can be used for testing purposes. It stores the exported spans + * in a list in memory that can be retrieved using the `getFinishedSpans()` + * method. + */ +class InMemorySpanExporter { + constructor() { + this._finishedSpans = []; + /** + * Indicates if the exporter has been "shutdown." + * When false, exported spans will not be stored in-memory. + */ + this._stopped = false; + } + export(spans, resultCallback) { + if (this._stopped) + return resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error('Exporter has been stopped'), + }); + this._finishedSpans.push(...spans); + setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); + } + shutdown() { + this._stopped = true; + this._finishedSpans = []; + return Promise.resolve(); + } + reset() { + this._finishedSpans = []; + } + getFinishedSpans() { + return this._finishedSpans; + } +} +exports.InMemorySpanExporter = InMemorySpanExporter; +//# sourceMappingURL=InMemorySpanExporter.js.map + +/***/ }), + +/***/ 9252: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + /* * Copyright The OpenTelemetry Authors * @@ -16733,12 +18712,25 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * See the License for the specific language governing permissions and * limitations under the License. */ -__exportStar(__nccwpck_require__(5601), exports); -//# sourceMappingURL=index.js.map +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.NoopSpanProcessor = void 0; +/** No-op implementation of SpanProcessor */ +class NoopSpanProcessor { + onStart(_span, _context) { } + onEnd(_span) { } + shutdown() { + return Promise.resolve(); + } + forceFlush() { + return Promise.resolve(); + } +} +exports.NoopSpanProcessor = NoopSpanProcessor; +//# sourceMappingURL=NoopSpanProcessor.js.map /***/ }), -/***/ 2572: +/***/ 5561: /***/ ((__unused_webpack_module, exports) => { "use strict"; @@ -16759,420 +18751,1375 @@ __exportStar(__nccwpck_require__(5601), exports); * limitations under the License. */ Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticAttributes = { - /** - * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - * - * Note: This may be different from `faas.id` if an alias is involved. - */ - AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn', - /** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - */ - DB_SYSTEM: 'db.system', - /** - * The connection string used to connect to the database. It is recommended to remove embedded credentials. - */ - DB_CONNECTION_STRING: 'db.connection_string', - /** - * Username for accessing the database. - */ - DB_USER: 'db.user', - /** - * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - */ - DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname', - /** - * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - * - * Note: In some SQL databases, the database name to be used is called "schema name". +//# sourceMappingURL=ReadableSpan.js.map + +/***/ }), + +/***/ 9802: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.SimpleSpanProcessor = void 0; +const api_1 = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +/** + * An implementation of the {@link SpanProcessor} that converts the {@link Span} + * to {@link ReadableSpan} and passes it to the configured exporter. + * + * Only spans that are sampled are converted. + */ +class SimpleSpanProcessor { + constructor(_exporter) { + this._exporter = _exporter; + this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); + } + forceFlush() { + // do nothing as all spans are being exported without waiting + return Promise.resolve(); + } + // does nothing. + onStart(_span, _parentContext) { } + onEnd(span) { + if (this._shutdownOnce.isCalled) { + return; + } + if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { + return; + } + // prevent downstream exporter calls from generating spans + api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { + this._exporter.export([span], result => { + var _a; + if (result.code !== core_1.ExportResultCode.SUCCESS) { + (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); + } + }); + }); + } + shutdown() { + return this._shutdownOnce.call(); + } + _shutdown() { + return this._exporter.shutdown(); + } +} +exports.SimpleSpanProcessor = SimpleSpanProcessor; +//# sourceMappingURL=SimpleSpanProcessor.js.map + +/***/ }), + +/***/ 4570: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=SpanExporter.js.map + +/***/ }), + +/***/ 9253: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(3806), exports); +__exportStar(__nccwpck_require__(8920), exports); +__exportStar(__nccwpck_require__(262), exports); +__exportStar(__nccwpck_require__(6784), exports); +__exportStar(__nccwpck_require__(4093), exports); +__exportStar(__nccwpck_require__(5561), exports); +__exportStar(__nccwpck_require__(9802), exports); +__exportStar(__nccwpck_require__(4570), exports); +__exportStar(__nccwpck_require__(9252), exports); +__exportStar(__nccwpck_require__(1301), exports); +__exportStar(__nccwpck_require__(3502), exports); +__exportStar(__nccwpck_require__(6598), exports); +__exportStar(__nccwpck_require__(9068), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 262: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(6573), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 7913: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BatchSpanProcessor = void 0; +const BatchSpanProcessorBase_1 = __nccwpck_require__(9727); +class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { + onShutdown() { } +} +exports.BatchSpanProcessor = BatchSpanProcessor; +//# sourceMappingURL=BatchSpanProcessor.js.map + +/***/ }), + +/***/ 6573: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(7913), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9068: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +//# sourceMappingURL=types.js.map + +/***/ }), + +/***/ 4324: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.reconfigureLimits = exports.mergeConfig = void 0; +const config_1 = __nccwpck_require__(91); +/** + * Function to merge Default configuration (as specified in './config') with + * user provided configurations. + */ +function mergeConfig(userConfig) { + const perInstanceDefaults = { + sampler: (0, config_1.buildSamplerFromEnv)(), + }; + const target = Object.assign({}, config_1.DEFAULT_CONFIG, perInstanceDefaults, userConfig); + target.generalLimits = Object.assign({}, config_1.DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); + target.spanLimits = Object.assign({}, config_1.DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); + return target; +} +exports.mergeConfig = mergeConfig; +/** + * When general limits are provided and model specific limits are not, + * configures the model specific limits by using the values from the general ones. + * @param userConfig User provided tracer configuration + */ +function reconfigureLimits(userConfig) { + var _a, _b; + const spanLimits = Object.assign({}, userConfig.spanLimits); + /** + * When span attribute count limit is not defined, but general attribute count limit is defined + * Then, span attribute count limit will be same as general one + */ + if (spanLimits.attributeCountLimit == null && ((_a = userConfig.generalLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) != null) { + spanLimits.attributeCountLimit = userConfig.generalLimits.attributeCountLimit; + } + /** + * When span attribute value length limit is not defined, but general attribute value length limit is defined + * Then, span attribute value length limit will be same as general one + */ + if (spanLimits.attributeValueLengthLimit == null && ((_b = userConfig.generalLimits) === null || _b === void 0 ? void 0 : _b.attributeValueLengthLimit) != null) { + spanLimits.attributeValueLengthLimit = userConfig.generalLimits.attributeValueLengthLimit; + } + return Object.assign({}, userConfig, { spanLimits }); +} +exports.reconfigureLimits = reconfigureLimits; +//# sourceMappingURL=utility.js.map + +/***/ }), + +/***/ 7275: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(5836), exports); +__exportStar(__nccwpck_require__(2834), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 5003: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0; +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +exports.SemanticResourceAttributes = { + /** + * Name of the cloud provider. */ - DB_NAME: 'db.name', + CLOUD_PROVIDER: 'cloud.provider', /** - * The database statement being executed. - * - * Note: The value may be sanitized to exclude sensitive information. + * The cloud account ID the resource is assigned to. */ - DB_STATEMENT: 'db.statement', + CLOUD_ACCOUNT_ID: 'cloud.account.id', /** - * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - * - * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). */ - DB_OPERATION: 'db.operation', + CLOUD_REGION: 'cloud.region', /** - * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. * - * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). + * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. */ - DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name', + CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone', /** - * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. + * The cloud platform in use. + * + * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. */ - DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace', + CLOUD_PLATFORM: 'cloud.platform', /** - * The fetch size used for paging, i.e. how many rows will be returned at once. + * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). */ - DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size', + AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn', /** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). */ - DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level', + AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn', /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. */ - DB_CASSANDRA_TABLE: 'db.cassandra.table', + AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype', /** - * Whether or not the query is idempotent. + * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). */ - DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence', + AWS_ECS_TASK_ARN: 'aws.ecs.task.arn', /** - * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + * The task definition family this task definition is a member of. */ - DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count', + AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family', /** - * The ID of the coordinating node for a query. + * The revision for this task definition. */ - DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id', + AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision', /** - * The data center of the coordinating node for a query. + * The ARN of an EKS cluster. */ - DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc', + AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn', /** - * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. + * The name(s) of the AWS log group(s) an application is writing to. + * + * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. */ - DB_HBASE_NAMESPACE: 'db.hbase.namespace', + AWS_LOG_GROUP_NAMES: 'aws.log.group.names', /** - * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + * The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). */ - DB_REDIS_DATABASE_INDEX: 'db.redis.database_index', + AWS_LOG_GROUP_ARNS: 'aws.log.group.arns', /** - * The collection being accessed within the database stated in `db.name`. + * The name(s) of the AWS log stream(s) an application is writing to. */ - DB_MONGODB_COLLECTION: 'db.mongodb.collection', + AWS_LOG_STREAM_NAMES: 'aws.log.stream.names', /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * The ARN(s) of the AWS log stream(s). * - * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. */ - DB_SQL_TABLE: 'db.sql.table', + AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns', /** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. + * Container name. */ - EXCEPTION_TYPE: 'exception.type', + CONTAINER_NAME: 'container.name', /** - * The exception message. + * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. */ - EXCEPTION_MESSAGE: 'exception.message', + CONTAINER_ID: 'container.id', /** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. + * The container runtime managing this container. */ - EXCEPTION_STACKTRACE: 'exception.stacktrace', + CONTAINER_RUNTIME: 'container.runtime', /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + * Name of the image the container was built on. + */ + CONTAINER_IMAGE_NAME: 'container.image.name', + /** + * Container image tag. + */ + CONTAINER_IMAGE_TAG: 'container.image.tag', + /** + * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). + */ + DEPLOYMENT_ENVIRONMENT: 'deployment.environment', + /** + * A unique identifier representing the device. * - * Note: An exception is considered to have escaped (or left) the scope of a span, - if that span is ended while the exception is still logically "in flight". - This may be actually "in flight" in some languages (e.g. if the exception - is passed to a Context manager's `__exit__` method in Python) but will - usually be caught at the point of recording the exception in most languages. - - It is usually not possible to determine at the point where an exception is thrown - whether it will escape the scope of a span. - However, it is trivial to know that an exception - will escape, if one checks for an active exception just before ending the span, - as done in the [example above](#exception-end-example). - - It follows that an exception may still escape the scope of the span - even if the `exception.escaped` attribute was not set or set to false, - since the event might have been recorded at a time where it was not - clear whether the exception will escape. + * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. */ - EXCEPTION_ESCAPED: 'exception.escaped', + DEVICE_ID: 'device.id', /** - * Type of the trigger on which the function is executed. + * The model identifier for the device. + * + * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. */ - FAAS_TRIGGER: 'faas.trigger', + DEVICE_MODEL_IDENTIFIER: 'device.model.identifier', /** - * The execution ID of the current function execution. + * The marketing name for the device model. + * + * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. */ - FAAS_EXECUTION: 'faas.execution', + DEVICE_MODEL_NAME: 'device.model.name', /** - * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + * The name of the single function that this runtime instance executes. + * + * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). */ - FAAS_DOCUMENT_COLLECTION: 'faas.document.collection', + FAAS_NAME: 'faas.name', /** - * Describes the type of the operation that was performed on the data. + * The unique ID of the single function that this runtime instance executes. + * + * Note: Depending on the cloud provider, use: + + * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + Take care not to use the "invoked ARN" directly but replace any + [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple + different aliases. + * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) + * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). + + On some providers, it may not be possible to determine the full ID at startup, + which is why this field cannot be made required. For example, on AWS the account ID + part of the ARN is not available without calling another AWS API + which may be deemed too slow for a short-running lambda function. + As an alternative, consider setting `faas.id` as a span attribute instead. */ - FAAS_DOCUMENT_OPERATION: 'faas.document.operation', + FAAS_ID: 'faas.id', /** - * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * The immutable version of the function being executed. + * + * Note: Depending on the cloud provider and platform, use: + + * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) + (an integer represented as a decimal string). + * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) + (i.e., the function name plus the revision suffix). + * **Google Cloud Functions:** The value of the + [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). + * **Azure Functions:** Not applicable. Do not set this attribute. */ - FAAS_DOCUMENT_TIME: 'faas.document.time', + FAAS_VERSION: 'faas.version', /** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. + * + * Note: * **AWS Lambda:** Use the (full) log stream name. */ - FAAS_DOCUMENT_NAME: 'faas.document.name', + FAAS_INSTANCE: 'faas.instance', /** - * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + * The amount of memory available to the serverless function in MiB. + * + * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. */ - FAAS_TIME: 'faas.time', + FAAS_MAX_MEMORY: 'faas.max_memory', /** - * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. */ - FAAS_CRON: 'faas.cron', + HOST_ID: 'host.id', /** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. */ - FAAS_COLDSTART: 'faas.coldstart', + HOST_NAME: 'host.name', /** - * The name of the invoked function. - * - * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. + * Type of host. For Cloud, this must be the machine type. */ - FAAS_INVOKED_NAME: 'faas.invoked_name', + HOST_TYPE: 'host.type', /** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + * The CPU architecture the host system is running on. */ - FAAS_INVOKED_PROVIDER: 'faas.invoked_provider', + HOST_ARCH: 'host.arch', /** - * The cloud region of the invoked function. - * - * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + * Name of the VM image or OS install the host was instantiated from. */ - FAAS_INVOKED_REGION: 'faas.invoked_region', + HOST_IMAGE_NAME: 'host.image.name', /** - * Transport protocol used. See note below. + * VM image ID. For Cloud, this value is from the provider. */ - NET_TRANSPORT: 'net.transport', + HOST_IMAGE_ID: 'host.image.id', /** - * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). + * The version string of the VM image as defined in [Version SpanAttributes](README.md#version-attributes). */ - NET_PEER_IP: 'net.peer.ip', + HOST_IMAGE_VERSION: 'host.image.version', /** - * Remote port number. + * The name of the cluster. */ - NET_PEER_PORT: 'net.peer.port', + K8S_CLUSTER_NAME: 'k8s.cluster.name', /** - * Remote hostname or similar, see note below. + * The name of the Node. */ - NET_PEER_NAME: 'net.peer.name', + K8S_NODE_NAME: 'k8s.node.name', /** - * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. + * The UID of the Node. */ - NET_HOST_IP: 'net.host.ip', + K8S_NODE_UID: 'k8s.node.uid', /** - * Like `net.peer.port` but for the host port. + * The name of the namespace that the pod is running in. */ - NET_HOST_PORT: 'net.host.port', + K8S_NAMESPACE_NAME: 'k8s.namespace.name', /** - * Local hostname or similar, see note below. + * The UID of the Pod. */ - NET_HOST_NAME: 'net.host.name', + K8S_POD_UID: 'k8s.pod.uid', /** - * The internet connection type currently being used by the host. + * The name of the Pod. */ - NET_HOST_CONNECTION_TYPE: 'net.host.connection.type', + K8S_POD_NAME: 'k8s.pod.name', /** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + * The name of the Container in a Pod template. */ - NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype', + K8S_CONTAINER_NAME: 'k8s.container.name', /** - * The name of the mobile carrier. + * The UID of the ReplicaSet. */ - NET_HOST_CARRIER_NAME: 'net.host.carrier.name', + K8S_REPLICASET_UID: 'k8s.replicaset.uid', /** - * The mobile carrier country code. + * The name of the ReplicaSet. */ - NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc', + K8S_REPLICASET_NAME: 'k8s.replicaset.name', /** - * The mobile carrier network code. + * The UID of the Deployment. */ - NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc', + K8S_DEPLOYMENT_UID: 'k8s.deployment.uid', /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + * The name of the Deployment. */ - NET_HOST_CARRIER_ICC: 'net.host.carrier.icc', + K8S_DEPLOYMENT_NAME: 'k8s.deployment.name', /** - * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + * The UID of the StatefulSet. */ - PEER_SERVICE: 'peer.service', + K8S_STATEFULSET_UID: 'k8s.statefulset.uid', /** - * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. + * The name of the StatefulSet. */ - ENDUSER_ID: 'enduser.id', + K8S_STATEFULSET_NAME: 'k8s.statefulset.name', /** - * Actual/assumed role the client is making the request under extracted from token or application security context. + * The UID of the DaemonSet. */ - ENDUSER_ROLE: 'enduser.role', + K8S_DAEMONSET_UID: 'k8s.daemonset.uid', /** - * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + * The name of the DaemonSet. */ - ENDUSER_SCOPE: 'enduser.scope', + K8S_DAEMONSET_NAME: 'k8s.daemonset.name', /** - * Current "managed" thread ID (as opposed to OS thread ID). + * The UID of the Job. */ - THREAD_ID: 'thread.id', + K8S_JOB_UID: 'k8s.job.uid', /** - * Current thread name. + * The name of the Job. */ - THREAD_NAME: 'thread.name', + K8S_JOB_NAME: 'k8s.job.name', /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). + * The UID of the CronJob. */ - CODE_FUNCTION: 'code.function', + K8S_CRONJOB_UID: 'k8s.cronjob.uid', /** - * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + * The name of the CronJob. */ - CODE_NAMESPACE: 'code.namespace', + K8S_CRONJOB_NAME: 'k8s.cronjob.name', /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + * The operating system type. */ - CODE_FILEPATH: 'code.filepath', + OS_TYPE: 'os.type', /** - * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. */ - CODE_LINENO: 'code.lineno', + OS_DESCRIPTION: 'os.description', /** - * HTTP request method. + * Human readable operating system name. */ - HTTP_METHOD: 'http.method', + OS_NAME: 'os.name', /** - * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. - * - * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. + * The version string of the operating system as defined in [Version SpanAttributes](../../resource/semantic_conventions/README.md#version-attributes). */ - HTTP_URL: 'http.url', + OS_VERSION: 'os.version', /** - * The full request target as passed in a HTTP request line or equivalent. + * Process identifier (PID). */ - HTTP_TARGET: 'http.target', + PROCESS_PID: 'process.pid', /** - * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. - * - * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. + * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. */ - HTTP_HOST: 'http.host', + PROCESS_EXECUTABLE_NAME: 'process.executable.name', /** - * The URI scheme identifying the used protocol. + * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. */ - HTTP_SCHEME: 'http.scheme', + PROCESS_EXECUTABLE_PATH: 'process.executable.path', /** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. */ - HTTP_STATUS_CODE: 'http.status_code', + PROCESS_COMMAND: 'process.command', /** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. */ - HTTP_FLAVOR: 'http.flavor', + PROCESS_COMMAND_LINE: 'process.command_line', /** - * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. + * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. */ - HTTP_USER_AGENT: 'http.user_agent', + PROCESS_COMMAND_ARGS: 'process.command_args', /** - * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + * The username of the user that owns the process. */ - HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length', + PROCESS_OWNER: 'process.owner', /** - * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. + * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. */ - HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed', + PROCESS_RUNTIME_NAME: 'process.runtime.name', /** - * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + * The version of the runtime of this process, as returned by the runtime without modification. */ - HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length', + PROCESS_RUNTIME_VERSION: 'process.runtime.version', /** - * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. + * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. */ - HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed', + PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description', /** - * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). + * Logical name of the service. * - * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. + * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. */ - HTTP_SERVER_NAME: 'http.server_name', + SERVICE_NAME: 'service.name', /** - * The matched route (path template). + * A namespace for `service.name`. + * + * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. */ - HTTP_ROUTE: 'http.route', + SERVICE_NAMESPACE: 'service.namespace', /** - * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). + * The string ID of the service instance. * - * Note: This is not necessarily the same as `net.peer.ip`, which would - identify the network-level peer, which may be a proxy. - - This attribute should be set when a source of information different - from the one used for `net.peer.ip`, is available even if that other - source just confirms the same value as `net.peer.ip`. - Rationale: For `net.peer.ip`, one typically does not know if it - comes from a proxy, reverse proxy, or the actual client. Setting - `http.client_ip` when it's the same as `net.peer.ip` means that - one is at least somewhat confident that the address is not that of - the closest proxy. + * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). */ - HTTP_CLIENT_IP: 'http.client_ip', + SERVICE_INSTANCE_ID: 'service.instance.id', /** - * The keys in the `RequestItems` object field. + * The version string of the service API or implementation. */ - AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names', + SERVICE_VERSION: 'service.version', /** - * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + * The name of the telemetry SDK as defined above. */ - AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity', + TELEMETRY_SDK_NAME: 'telemetry.sdk.name', /** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. + * The language of the telemetry SDK. */ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics', + TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language', /** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + * The version string of the telemetry SDK. */ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity', + TELEMETRY_SDK_VERSION: 'telemetry.sdk.version', /** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + * The version string of the auto instrumentation agent, if used. */ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity', + TELEMETRY_AUTO_VERSION: 'telemetry.auto.version', /** - * The value of the `ConsistentRead` request parameter. + * The name of the web engine. */ - AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read', + WEBENGINE_NAME: 'webengine.name', /** - * The value of the `ProjectionExpression` request parameter. + * The version of the web engine. */ - AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection', + WEBENGINE_VERSION: 'webengine.version', /** - * The value of the `Limit` request parameter. + * Additional description of the web engine (e.g. detailed version and edition information). */ - AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit', + WEBENGINE_DESCRIPTION: 'webengine.description', +}; +exports.CloudProviderValues = { + /** Alibaba Cloud. */ + ALIBABA_CLOUD: 'alibaba_cloud', + /** Amazon Web Services. */ + AWS: 'aws', + /** Microsoft Azure. */ + AZURE: 'azure', + /** Google Cloud Platform. */ + GCP: 'gcp', +}; +exports.CloudPlatformValues = { + /** Alibaba Cloud Elastic Compute Service. */ + ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs', + /** Alibaba Cloud Function Compute. */ + ALIBABA_CLOUD_FC: 'alibaba_cloud_fc', + /** AWS Elastic Compute Cloud. */ + AWS_EC2: 'aws_ec2', + /** AWS Elastic Container Service. */ + AWS_ECS: 'aws_ecs', + /** AWS Elastic Kubernetes Service. */ + AWS_EKS: 'aws_eks', + /** AWS Lambda. */ + AWS_LAMBDA: 'aws_lambda', + /** AWS Elastic Beanstalk. */ + AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk', + /** Azure Virtual Machines. */ + AZURE_VM: 'azure_vm', + /** Azure Container Instances. */ + AZURE_CONTAINER_INSTANCES: 'azure_container_instances', + /** Azure Kubernetes Service. */ + AZURE_AKS: 'azure_aks', + /** Azure Functions. */ + AZURE_FUNCTIONS: 'azure_functions', + /** Azure App Service. */ + AZURE_APP_SERVICE: 'azure_app_service', + /** Google Cloud Compute Engine (GCE). */ + GCP_COMPUTE_ENGINE: 'gcp_compute_engine', + /** Google Cloud Run. */ + GCP_CLOUD_RUN: 'gcp_cloud_run', + /** Google Cloud Kubernetes Engine (GKE). */ + GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine', + /** Google Cloud Functions (GCF). */ + GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions', + /** Google Cloud App Engine (GAE). */ + GCP_APP_ENGINE: 'gcp_app_engine', +}; +exports.AwsEcsLaunchtypeValues = { + /** ec2. */ + EC2: 'ec2', + /** fargate. */ + FARGATE: 'fargate', +}; +exports.HostArchValues = { + /** AMD64. */ + AMD64: 'amd64', + /** ARM32. */ + ARM32: 'arm32', + /** ARM64. */ + ARM64: 'arm64', + /** Itanium. */ + IA64: 'ia64', + /** 32-bit PowerPC. */ + PPC32: 'ppc32', + /** 64-bit PowerPC. */ + PPC64: 'ppc64', + /** 32-bit x86. */ + X86: 'x86', +}; +exports.OsTypeValues = { + /** Microsoft Windows. */ + WINDOWS: 'windows', + /** Linux. */ + LINUX: 'linux', + /** Apple Darwin. */ + DARWIN: 'darwin', + /** FreeBSD. */ + FREEBSD: 'freebsd', + /** NetBSD. */ + NETBSD: 'netbsd', + /** OpenBSD. */ + OPENBSD: 'openbsd', + /** DragonFly BSD. */ + DRAGONFLYBSD: 'dragonflybsd', + /** HP-UX (Hewlett Packard Unix). */ + HPUX: 'hpux', + /** AIX (Advanced Interactive eXecutive). */ + AIX: 'aix', + /** Oracle Solaris. */ + SOLARIS: 'solaris', + /** IBM z/OS. */ + Z_OS: 'z_os', +}; +exports.TelemetrySdkLanguageValues = { + /** cpp. */ + CPP: 'cpp', + /** dotnet. */ + DOTNET: 'dotnet', + /** erlang. */ + ERLANG: 'erlang', + /** go. */ + GO: 'go', + /** java. */ + JAVA: 'java', + /** nodejs. */ + NODEJS: 'nodejs', + /** php. */ + PHP: 'php', + /** python. */ + PYTHON: 'python', + /** ruby. */ + RUBY: 'ruby', + /** webjs. */ + WEBJS: 'webjs', +}; +//# sourceMappingURL=SemanticResourceAttributes.js.map + +/***/ }), + +/***/ 2834: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__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]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +__exportStar(__nccwpck_require__(5003), exports); +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 9943: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +/* + * Copyright The OpenTelemetry Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0; +// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 +exports.SemanticAttributes = { /** - * The value of the `AttributesToGet` request parameter. + * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). + * + * Note: This may be different from `faas.id` if an alias is involved. */ - AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get', + AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn', /** - * The value of the `IndexName` request parameter. + * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. */ - AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name', + DB_SYSTEM: 'db.system', /** - * The value of the `Select` request parameter. + * The connection string used to connect to the database. It is recommended to remove embedded credentials. */ - AWS_DYNAMODB_SELECT: 'aws.dynamodb.select', + DB_CONNECTION_STRING: 'db.connection_string', /** - * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + * Username for accessing the database. */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes', + DB_USER: 'db.user', /** - * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. */ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes', + DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname', /** - * The value of the `ExclusiveStartTableName` request parameter. + * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). + * + * Note: In some SQL databases, the database name to be used is called "schema name". + */ + DB_NAME: 'db.name', + /** + * The database statement being executed. + * + * Note: The value may be sanitized to exclude sensitive information. + */ + DB_STATEMENT: 'db.statement', + /** + * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. + * + * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. + */ + DB_OPERATION: 'db.operation', + /** + * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. + * + * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). + */ + DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name', + /** + * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. + */ + DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace', + /** + * The fetch size used for paging, i.e. how many rows will be returned at once. + */ + DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size', + /** + * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). + */ + DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level', + /** + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + */ + DB_CASSANDRA_TABLE: 'db.cassandra.table', + /** + * Whether or not the query is idempotent. + */ + DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence', + /** + * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. + */ + DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count', + /** + * The ID of the coordinating node for a query. + */ + DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id', + /** + * The data center of the coordinating node for a query. + */ + DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc', + /** + * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. + */ + DB_HBASE_NAMESPACE: 'db.hbase.namespace', + /** + * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. + */ + DB_REDIS_DATABASE_INDEX: 'db.redis.database_index', + /** + * The collection being accessed within the database stated in `db.name`. + */ + DB_MONGODB_COLLECTION: 'db.mongodb.collection', + /** + * The name of the primary table that the operation is acting upon, including the schema name (if applicable). + * + * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. + */ + DB_SQL_TABLE: 'db.sql.table', + /** + * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. + */ + EXCEPTION_TYPE: 'exception.type', + /** + * The exception message. + */ + EXCEPTION_MESSAGE: 'exception.message', + /** + * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. + */ + EXCEPTION_STACKTRACE: 'exception.stacktrace', + /** + * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. + * + * Note: An exception is considered to have escaped (or left) the scope of a span, + if that span is ended while the exception is still logically "in flight". + This may be actually "in flight" in some languages (e.g. if the exception + is passed to a Context manager's `__exit__` method in Python) but will + usually be caught at the point of recording the exception in most languages. + + It is usually not possible to determine at the point where an exception is thrown + whether it will escape the scope of a span. + However, it is trivial to know that an exception + will escape, if one checks for an active exception just before ending the span, + as done in the [example above](#exception-end-example). + + It follows that an exception may still escape the scope of the span + even if the `exception.escaped` attribute was not set or set to false, + since the event might have been recorded at a time where it was not + clear whether the exception will escape. + */ + EXCEPTION_ESCAPED: 'exception.escaped', + /** + * Type of the trigger on which the function is executed. + */ + FAAS_TRIGGER: 'faas.trigger', + /** + * The execution ID of the current function execution. + */ + FAAS_EXECUTION: 'faas.execution', + /** + * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. + */ + FAAS_DOCUMENT_COLLECTION: 'faas.document.collection', + /** + * Describes the type of the operation that was performed on the data. + */ + FAAS_DOCUMENT_OPERATION: 'faas.document.operation', + /** + * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + */ + FAAS_DOCUMENT_TIME: 'faas.document.time', + /** + * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. + */ + FAAS_DOCUMENT_NAME: 'faas.document.name', + /** + * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). + */ + FAAS_TIME: 'faas.time', + /** + * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). + */ + FAAS_CRON: 'faas.cron', + /** + * A boolean that is true if the serverless function is executed for the first time (aka cold-start). + */ + FAAS_COLDSTART: 'faas.coldstart', + /** + * The name of the invoked function. + * + * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. + */ + FAAS_INVOKED_NAME: 'faas.invoked_name', + /** + * The cloud provider of the invoked function. + * + * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. + */ + FAAS_INVOKED_PROVIDER: 'faas.invoked_provider', + /** + * The cloud region of the invoked function. + * + * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. + */ + FAAS_INVOKED_REGION: 'faas.invoked_region', + /** + * Transport protocol used. See note below. + */ + NET_TRANSPORT: 'net.transport', + /** + * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). + */ + NET_PEER_IP: 'net.peer.ip', + /** + * Remote port number. + */ + NET_PEER_PORT: 'net.peer.port', + /** + * Remote hostname or similar, see note below. + */ + NET_PEER_NAME: 'net.peer.name', + /** + * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. + */ + NET_HOST_IP: 'net.host.ip', + /** + * Like `net.peer.port` but for the host port. + */ + NET_HOST_PORT: 'net.host.port', + /** + * Local hostname or similar, see note below. + */ + NET_HOST_NAME: 'net.host.name', + /** + * The internet connection type currently being used by the host. + */ + NET_HOST_CONNECTION_TYPE: 'net.host.connection.type', + /** + * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. + */ + NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype', + /** + * The name of the mobile carrier. + */ + NET_HOST_CARRIER_NAME: 'net.host.carrier.name', + /** + * The mobile carrier country code. + */ + NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc', + /** + * The mobile carrier network code. + */ + NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc', + /** + * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. + */ + NET_HOST_CARRIER_ICC: 'net.host.carrier.icc', + /** + * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. + */ + PEER_SERVICE: 'peer.service', + /** + * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. + */ + ENDUSER_ID: 'enduser.id', + /** + * Actual/assumed role the client is making the request under extracted from token or application security context. + */ + ENDUSER_ROLE: 'enduser.role', + /** + * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). + */ + ENDUSER_SCOPE: 'enduser.scope', + /** + * Current "managed" thread ID (as opposed to OS thread ID). + */ + THREAD_ID: 'thread.id', + /** + * Current thread name. + */ + THREAD_NAME: 'thread.name', + /** + * The method or function name, or equivalent (usually rightmost part of the code unit's name). + */ + CODE_FUNCTION: 'code.function', + /** + * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. + */ + CODE_NAMESPACE: 'code.namespace', + /** + * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). + */ + CODE_FILEPATH: 'code.filepath', + /** + * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. + */ + CODE_LINENO: 'code.lineno', + /** + * HTTP request method. + */ + HTTP_METHOD: 'http.method', + /** + * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. + * + * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. + */ + HTTP_URL: 'http.url', + /** + * The full request target as passed in a HTTP request line or equivalent. + */ + HTTP_TARGET: 'http.target', + /** + * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. + * + * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. + */ + HTTP_HOST: 'http.host', + /** + * The URI scheme identifying the used protocol. + */ + HTTP_SCHEME: 'http.scheme', + /** + * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). + */ + HTTP_STATUS_CODE: 'http.status_code', + /** + * Kind of HTTP protocol used. + * + * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. + */ + HTTP_FLAVOR: 'http.flavor', + /** + * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. + */ + HTTP_USER_AGENT: 'http.user_agent', + /** + * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + */ + HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length', + /** + * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. + */ + HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed', + /** + * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. + */ + HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length', + /** + * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. + */ + HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed', + /** + * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). + * + * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. + */ + HTTP_SERVER_NAME: 'http.server_name', + /** + * The matched route (path template). + */ + HTTP_ROUTE: 'http.route', + /** + * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). + * + * Note: This is not necessarily the same as `net.peer.ip`, which would + identify the network-level peer, which may be a proxy. + + This attribute should be set when a source of information different + from the one used for `net.peer.ip`, is available even if that other + source just confirms the same value as `net.peer.ip`. + Rationale: For `net.peer.ip`, one typically does not know if it + comes from a proxy, reverse proxy, or the actual client. Setting + `http.client_ip` when it's the same as `net.peer.ip` means that + one is at least somewhat confident that the address is not that of + the closest proxy. + */ + HTTP_CLIENT_IP: 'http.client_ip', + /** + * The keys in the `RequestItems` object field. + */ + AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names', + /** + * The JSON-serialized value of each item in the `ConsumedCapacity` response field. + */ + AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity', + /** + * The JSON-serialized value of the `ItemCollectionMetrics` response field. + */ + AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics', + /** + * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. + */ + AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity', + /** + * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. + */ + AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity', + /** + * The value of the `ConsistentRead` request parameter. + */ + AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read', + /** + * The value of the `ProjectionExpression` request parameter. + */ + AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection', + /** + * The value of the `Limit` request parameter. + */ + AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit', + /** + * The value of the `AttributesToGet` request parameter. + */ + AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get', + /** + * The value of the `IndexName` request parameter. + */ + AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name', + /** + * The value of the `Select` request parameter. + */ + AWS_DYNAMODB_SELECT: 'aws.dynamodb.select', + /** + * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. + */ + AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes', + /** + * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. + */ + AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes', + /** + * The value of the `ExclusiveStartTableName` request parameter. */ AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table', /** @@ -17632,7 +20579,7 @@ exports.MessageTypeValues = { /***/ }), -/***/ 2787: +/***/ 5836: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; @@ -17663,15516 +20610,7730 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); * See the License for the specific language governing permissions and * limitations under the License. */ -__exportStar(__nccwpck_require__(2572), exports); +__exportStar(__nccwpck_require__(9943), exports); //# sourceMappingURL=index.js.map /***/ }), -/***/ 2723: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 9417: +/***/ ((module) => { "use strict"; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Resource = void 0; -const semantic_conventions_1 = __nccwpck_require__(7275); -const core_1 = __nccwpck_require__(9736); -const platform_1 = __nccwpck_require__(7784); -/** - * A Resource describes the entity for which a signals (metrics or trace) are - * collected. - */ -class Resource { - constructor( - /** - * A dictionary of attributes with string keys and values that provide - * information about the entity as numbers, strings or booleans - * TODO: Consider to add check/validation on attributes. - */ - attributes) { - this.attributes = attributes; - } - /** - * Returns an empty Resource - */ - static empty() { - return Resource.EMPTY; - } - /** - * Returns a Resource that indentifies the SDK in use. - */ - static default() { - return new Resource({ - [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: (0, platform_1.defaultServiceName)(), - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE], - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME], - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION], - }); - } - /** - * Returns a new, merged {@link Resource} by merging the current Resource - * with the other Resource. In case of a collision, other Resource takes - * precedence. - * - * @param other the Resource that will be merged with this. - * @returns the newly merged Resource. - */ - merge(other) { - if (!other || !Object.keys(other.attributes).length) - return this; - // SpanAttributes from resource overwrite attributes from other resource. - const mergedAttributes = Object.assign({}, this.attributes, other.attributes); - return new Resource(mergedAttributes); - } -} -exports.Resource = Resource; -Resource.EMPTY = new Resource({}); -//# sourceMappingURL=Resource.js.map - -/***/ }), +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); -/***/ 1565: -/***/ ((__unused_webpack_module, exports) => { + var r = range(a, b, str); -"use strict"; + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=config.js.map +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} -/***/ }), +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; -/***/ 5969: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.browserDetector = void 0; -const api_1 = __nccwpck_require__(5163); -const semantic_conventions_1 = __nccwpck_require__(7275); -const __1 = __nccwpck_require__(3871); -/** - * BrowserDetector will be used to detect the resources related to browser. - */ -class BrowserDetector { - async detect(config) { - const isBrowser = typeof navigator !== 'undefined'; - if (!isBrowser) { - return __1.Resource.empty(); + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - const browserResource = { - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'browser', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: navigator.userAgent - }; - return this._getResourceAttributes(browserResource, config); + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; } - /** - * Validates process resource attribute map from process variables - * - * @param browserResource The un-sanitized resource attributes from process as key/value pairs. - * @param config: Config - * @returns The sanitized resource attributes. - */ - _getResourceAttributes(browserResource, _config) { - if (browserResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '') { - api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. '); - return __1.Resource.empty(); - } - else { - return new __1.Resource(Object.assign({}, browserResource)); - } + + if (begs.length) { + result = [ left, right ]; } + } + + return result; } -exports.browserDetector = new BrowserDetector(); -//# sourceMappingURL=BrowserDetector.js.map + /***/ }), -/***/ 2474: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 3682: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var register = __nccwpck_require__(4670) +var addHook = __nccwpck_require__(5549) +var removeHook = __nccwpck_require__(6819) -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.envDetector = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -const semantic_conventions_1 = __nccwpck_require__(7275); -const Resource_1 = __nccwpck_require__(2723); -/** - * EnvDetector can be used to detect the presence of and create a Resource - * from the OTEL_RESOURCE_ATTRIBUTES environment variable. - */ -class EnvDetector { - constructor() { - // Type, attribute keys, and attribute values should not exceed 256 characters. - this._MAX_LENGTH = 255; - // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes. - this._COMMA_SEPARATOR = ','; - // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='. - this._LABEL_KEY_VALUE_SPLITTER = '='; - this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' + - this._MAX_LENGTH + - ' characters.'; - this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' + - this._MAX_LENGTH + - ' characters.'; - } - /** - * Returns a {@link Resource} populated with attributes from the - * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async - * function to conform to the Detector interface. - * - * @param config The resource detection config - */ - async detect(_config) { - const attributes = {}; - const env = (0, core_1.getEnv)(); - const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES; - const serviceName = env.OTEL_SERVICE_NAME; - if (rawAttributes) { - try { - const parsedAttributes = this._parseResourceAttributes(rawAttributes); - Object.assign(attributes, parsedAttributes); - } - catch (e) { - api_1.diag.debug(`EnvDetector failed: ${e.message}`); - } - } - if (serviceName) { - attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] = serviceName; - } - return new Resource_1.Resource(attributes); - } - /** - * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment - * variable. - * - * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing - * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and - * paths are accepted as attribute keys. Values may be quoted or unquoted in - * general. If a value contains whitespaces, =, or " characters, it must - * always be quoted. - * - * @param rawEnvAttributes The resource attributes as a comma-seperated list - * of key/value pairs. - * @returns The sanitized resource attributes. - */ - _parseResourceAttributes(rawEnvAttributes) { - if (!rawEnvAttributes) - return {}; - const attributes = {}; - const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1); - for (const rawAttribute of rawAttributes) { - const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1); - if (keyValuePair.length !== 2) { - continue; - } - let [key, value] = keyValuePair; - // Leading and trailing whitespaces are trimmed. - key = key.trim(); - value = value.trim().split('^"|"$').join(''); - if (!this._isValidAndNotEmpty(key)) { - throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); - } - if (!this._isValid(value)) { - throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`); - } - attributes[key] = value; - } - return attributes; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid. - */ - _isValid(name) { - return name.length <= this._MAX_LENGTH && this._isPrintableString(name); - } - _isPrintableString(str) { - for (let i = 0; i < str.length; i++) { - const ch = str.charAt(i); - if (ch <= ' ' || ch >= '~') { - return false; - } - } - return true; - } - /** - * Determines whether the given String is a valid printable ASCII string with - * a length greater than 0 and not exceed _MAX_LENGTH characters. - * - * @param str The String to be validated. - * @returns Whether the String is valid and not empty. - */ - _isValidAndNotEmpty(str) { - return str.length > 0 && this._isValid(str); - } +// bind with array of arguments: https://stackoverflow.com/a/21792913 +var bind = Function.bind +var bindable = bind.bind(bind) + +function bindApi (hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) + hook.api = { remove: removeHookRef } + hook.remove = removeHookRef + + ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { + var args = name ? [state, kind, name] : [state, kind] + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) + }) } -exports.envDetector = new EnvDetector(); -//# sourceMappingURL=EnvDetector.js.map -/***/ }), +function HookSingular () { + var singularHookName = 'h' + var singularHookState = { + registry: {} + } + var singularHook = register.bind(null, singularHookState, singularHookName) + bindApi(singularHook, singularHookState, singularHookName) + return singularHook +} -/***/ 5267: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function HookCollection () { + var state = { + registry: {} + } -"use strict"; + var hook = register.bind(null, state) + bindApi(hook, state) -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.processDetector = void 0; -const api_1 = __nccwpck_require__(5163); -const semantic_conventions_1 = __nccwpck_require__(7275); -const Resource_1 = __nccwpck_require__(2723); -/** - * ProcessDetector will be used to detect the resources related current process running - * and being instrumented from the NodeJS Process module. - */ -class ProcessDetector { - async detect(config) { - // Skip if not in Node.js environment. - if (typeof process !== 'object') { - return Resource_1.Resource.empty(); - } - const processResource = { - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_PID]: process.pid, - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]: process.title || '', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND]: process.argv[1] || '', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND_LINE]: process.argv.join(' ') || '', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: process.versions.node, - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'nodejs', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Node.js', - }; - return this._getResourceAttributes(processResource, config); - } - /** - * Validates process resource attribute map from process varaibls - * - * @param processResource The unsantized resource attributes from process as key/value pairs. - * @param config: Config - * @returns The sanitized resource attributes. - */ - _getResourceAttributes(processResource, _config) { - if (processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME] === - '' || - processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH] === - '' || - processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND] === '' || - processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND_LINE] === '' || - processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '') { - api_1.diag.debug('ProcessDetector failed: Unable to find required process resources. '); - return Resource_1.Resource.empty(); - } - else { - return new Resource_1.Resource(Object.assign({}, processResource)); - } - } + return hook } -exports.processDetector = new ProcessDetector(); -//# sourceMappingURL=ProcessDetector.js.map -/***/ }), +var collectionHookDeprecationMessageDisplayed = false +function Hook () { + if (!collectionHookDeprecationMessageDisplayed) { + console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') + collectionHookDeprecationMessageDisplayed = true + } + return HookCollection() +} -/***/ 4918: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +Hook.Singular = HookSingular.bind() +Hook.Collection = HookCollection.bind() -"use strict"; +module.exports = Hook +// expose constructors as a named property for TypeScript +module.exports.Hook = Hook +module.exports.Singular = Hook.Singular +module.exports.Collection = Hook.Collection -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(5969), exports); -__exportStar(__nccwpck_require__(2474), exports); -__exportStar(__nccwpck_require__(5267), exports); -//# sourceMappingURL=index.js.map /***/ }), -/***/ 3871: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 5549: +/***/ ((module) => { -"use strict"; +module.exports = addHook; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(2723), exports); -__exportStar(__nccwpck_require__(7784), exports); -__exportStar(__nccwpck_require__(9566), exports); -__exportStar(__nccwpck_require__(1565), exports); -__exportStar(__nccwpck_require__(4918), exports); -//# sourceMappingURL=index.js.map +function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } -/***/ }), + if (kind === "before") { + hook = function (method, options) { + return Promise.resolve() + .then(orig.bind(null, options)) + .then(method.bind(null, options)); + }; + } -/***/ 7784: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + if (kind === "after") { + hook = function (method, options) { + var result; + return Promise.resolve() + .then(method.bind(null, options)) + .then(function (result_) { + result = result_; + return orig(result, options); + }) + .then(function () { + return result; + }); + }; + } -"use strict"; + if (kind === "error") { + hook = function (method, options) { + return Promise.resolve() + .then(method.bind(null, options)) + .catch(function (error) { + return orig(error, options); + }); + }; + } + + state.registry[name].push({ + hook: hook, + orig: orig, + }); +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(342), exports); -//# sourceMappingURL=index.js.map /***/ }), -/***/ 9056: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 4670: +/***/ ((module) => { -"use strict"; +module.exports = register; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hostDetector = void 0; -const semantic_conventions_1 = __nccwpck_require__(7275); -const Resource_1 = __nccwpck_require__(2723); -const os_1 = __nccwpck_require__(2087); -/** - * HostDetector detects the resources related to the host current process is - * running on. Currently only non-cloud-based attributes are included. - */ -class HostDetector { - async detect(_config) { - const attributes = { - [semantic_conventions_1.SemanticResourceAttributes.HOST_NAME]: (0, os_1.hostname)(), - [semantic_conventions_1.SemanticResourceAttributes.HOST_ARCH]: this._normalizeArch((0, os_1.arch)()), - }; - return new Resource_1.Resource(attributes); - } - _normalizeArch(nodeArchString) { - // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec: - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md - switch (nodeArchString) { - case 'arm': - return 'arm32'; - case 'ppc': - return 'ppc32'; - case 'x64': - return 'amd64'; - default: - return nodeArchString; - } +function register(state, name, method, options) { + if (typeof method !== "function") { + throw new Error("method for before hook must be a function"); + } + + if (!options) { + options = {}; + } + + if (Array.isArray(name)) { + return name.reverse().reduce(function (callback, name) { + return register.bind(null, state, name, callback, options); + }, method)(); + } + + return Promise.resolve().then(function () { + if (!state.registry[name]) { + return method(options); } + + return state.registry[name].reduce(function (method, registered) { + return registered.hook.bind(null, method, options); + }, method)(); + }); } -exports.hostDetector = new HostDetector(); -//# sourceMappingURL=HostDetector.js.map + /***/ }), -/***/ 4618: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6819: +/***/ ((module) => { -"use strict"; +module.exports = removeHook; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.osDetector = void 0; -const semantic_conventions_1 = __nccwpck_require__(7275); -const Resource_1 = __nccwpck_require__(2723); -const os_1 = __nccwpck_require__(2087); -/** - * OSDetector detects the resources related to the operating system (OS) on - * which the process represented by this resource is running. - */ -class OSDetector { - async detect(_config) { - const attributes = { - [semantic_conventions_1.SemanticResourceAttributes.OS_TYPE]: this._normalizeType((0, os_1.platform)()), - [semantic_conventions_1.SemanticResourceAttributes.OS_VERSION]: (0, os_1.release)(), - }; - return new Resource_1.Resource(attributes); - } - _normalizeType(nodePlatform) { - // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec: - // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md - switch (nodePlatform) { - case 'sunos': - return 'solaris'; - case 'win32': - return 'windows'; - default: - return nodePlatform; - } - } +function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } + + var index = state.registry[name] + .map(function (registered) { + return registered.orig; + }) + .indexOf(method); + + if (index === -1) { + return; + } + + state.registry[name].splice(index, 1); } -exports.osDetector = new OSDetector(); -//# sourceMappingURL=OSDetector.js.map + /***/ }), -/***/ 5671: -/***/ ((__unused_webpack_module, exports) => { +/***/ 3717: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +var concatMap = __nccwpck_require__(6891); +var balanced = __nccwpck_require__(9417); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.defaultServiceName = void 0; -function defaultServiceName() { - return `unknown_service:${process.argv0}`; +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); } -exports.defaultServiceName = defaultServiceName; -//# sourceMappingURL=default-service-name.js.map -/***/ }), +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} -/***/ 6018: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} -"use strict"; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.detectResources = void 0; -const Resource_1 = __nccwpck_require__(2723); -const api_1 = __nccwpck_require__(5163); -const util = __nccwpck_require__(1669); -/** - * Runs all resource detectors and returns the results merged into a single - * Resource. - * - * @param config Configuration for resource detection - */ -const detectResources = async (config = {}) => { - const internalConfig = Object.assign(config); - const resources = await Promise.all((internalConfig.detectors || []).map(async (d) => { - try { - const resource = await d.detect(internalConfig); - api_1.diag.debug(`${d.constructor.name} found resource.`, resource); - return resource; - } - catch (e) { - api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`); - return Resource_1.Resource.empty(); - } - })); - // Future check if verbose logging is enabled issue #1903 - logResources(resources); - return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty()); -}; -exports.detectResources = detectResources; -/** - * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided. - * - * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored. - */ -const logResources = (resources) => { - resources.forEach(resource => { - // Print only populated resources - if (Object.keys(resource.attributes).length > 0) { - const resourceDebugString = util.inspect(resource.attributes, { - depth: 2, - breakLength: Infinity, - sorted: true, - compact: false, - }); - api_1.diag.verbose(resourceDebugString); +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } } - }); -}; -//# sourceMappingURL=detect-resources.js.map + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + + /***/ }), -/***/ 342: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +/***/ 6891: +/***/ ((module) => { -"use strict"; +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; }; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(5671), exports); -__exportStar(__nccwpck_require__(6018), exports); -__exportStar(__nccwpck_require__(9056), exports); -__exportStar(__nccwpck_require__(4618), exports); -//# sourceMappingURL=index.js.map + /***/ }), -/***/ 9566: +/***/ 8932: /***/ ((__unused_webpack_module, exports) => { "use strict"; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ + Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map + +class Deprecation extends Error { + constructor(message) { + super(message); // Maintains proper stack trace (only available on V8) + + /* istanbul ignore next */ + + if (Error.captureStackTrace) { + Error.captureStackTrace(this, this.constructor); + } + + this.name = 'Deprecation'; + } + +} + +exports.Deprecation = Deprecation; + /***/ }), -/***/ 8920: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +/***/ 6863: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +module.exports = realpath +realpath.realpath = realpath +realpath.sync = realpathSync +realpath.realpathSync = realpathSync +realpath.monkeypatch = monkeypatch +realpath.unmonkeypatch = unmonkeypatch -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BasicTracerProvider = exports.ForceFlushState = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -const resources_1 = __nccwpck_require__(3871); -const _1 = __nccwpck_require__(9253); -const config_1 = __nccwpck_require__(91); -const MultiSpanProcessor_1 = __nccwpck_require__(2352); -const NoopSpanProcessor_1 = __nccwpck_require__(9252); -const platform_1 = __nccwpck_require__(262); -const utility_1 = __nccwpck_require__(4324); -var ForceFlushState; -(function (ForceFlushState) { - ForceFlushState[ForceFlushState["resolved"] = 0] = "resolved"; - ForceFlushState[ForceFlushState["timeout"] = 1] = "timeout"; - ForceFlushState[ForceFlushState["error"] = 2] = "error"; - ForceFlushState[ForceFlushState["unresolved"] = 3] = "unresolved"; -})(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {})); -/** - * This class represents a basic tracer provider which platform libraries can extend - */ -class BasicTracerProvider { - constructor(config = {}) { - var _a; - this._registeredSpanProcessors = []; - this._tracers = new Map(); - const mergedConfig = (0, core_1.merge)({}, config_1.DEFAULT_CONFIG, (0, utility_1.reconfigureLimits)(config)); - this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty(); - this.resource = resources_1.Resource.default().merge(this.resource); - this._config = Object.assign({}, mergedConfig, { - resource: this.resource, - }); - const defaultExporter = this._buildExporterFromEnv(); - if (defaultExporter !== undefined) { - const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter); - this.activeSpanProcessor = batchProcessor; - } - else { - this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor(); - } - } - getTracer(name, version, options) { - const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`; - if (!this._tracers.has(key)) { - this._tracers.set(key, new _1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this)); - } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - return this._tracers.get(key); - } - /** - * Adds a new {@link SpanProcessor} to this tracer. - * @param spanProcessor the new SpanProcessor to be added. - */ - addSpanProcessor(spanProcessor) { - if (this._registeredSpanProcessors.length === 0) { - // since we might have enabled by default a batchProcessor, we disable it - // before adding the new one - this.activeSpanProcessor - .shutdown() - .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err)); - } - this._registeredSpanProcessors.push(spanProcessor); - this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors); - } - getActiveSpanProcessor() { - return this.activeSpanProcessor; - } - /** - * Register this TracerProvider for use with the OpenTelemetry API. - * Undefined values may be replaced with defaults, and - * null values will be skipped. - * - * @param config Configuration object for SDK registration - */ - register(config = {}) { - api_1.trace.setGlobalTracerProvider(this); - if (config.propagator === undefined) { - config.propagator = this._buildPropagatorFromEnv(); - } - if (config.contextManager) { - api_1.context.setGlobalContextManager(config.contextManager); - } - if (config.propagator) { - api_1.propagation.setGlobalPropagator(config.propagator); - } - } - forceFlush() { - const timeout = this._config.forceFlushTimeoutMillis; - const promises = this._registeredSpanProcessors.map((spanProcessor) => { - return new Promise(resolve => { - let state; - const timeoutInterval = setTimeout(() => { - resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`)); - state = ForceFlushState.timeout; - }, timeout); - spanProcessor - .forceFlush() - .then(() => { - clearTimeout(timeoutInterval); - if (state !== ForceFlushState.timeout) { - state = ForceFlushState.resolved; - resolve(state); - } - }) - .catch(error => { - clearTimeout(timeoutInterval); - state = ForceFlushState.error; - resolve(error); - }); - }); - }); - return new Promise((resolve, reject) => { - Promise.all(promises) - .then(results => { - const errors = results.filter(result => result !== ForceFlushState.resolved); - if (errors.length > 0) { - reject(errors); - } - else { - resolve(); - } - }) - .catch(error => reject([error])); - }); - } - shutdown() { - return this.activeSpanProcessor.shutdown(); - } - _getPropagator(name) { - var _a; - return (_a = BasicTracerProvider._registeredPropagators.get(name)) === null || _a === void 0 ? void 0 : _a(); - } - _getSpanExporter(name) { - var _a; - return (_a = BasicTracerProvider._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a(); - } - _buildPropagatorFromEnv() { - // per spec, propagators from env must be deduplicated - const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS)); - const propagators = uniquePropagatorNames.map(name => { - const propagator = this._getPropagator(name); - if (!propagator) { - api_1.diag.warn(`Propagator "${name}" requested through environment variable is unavailable.`); - } - return propagator; - }); - const validPropagators = propagators.reduce((list, item) => { - if (item) { - list.push(item); - } - return list; - }, []); - if (validPropagators.length === 0) { - return; - } - else if (uniquePropagatorNames.length === 1) { - return validPropagators[0]; - } - else { - return new core_1.CompositePropagator({ - propagators: validPropagators, - }); - } +var fs = __nccwpck_require__(5747) +var origRealpath = fs.realpath +var origRealpathSync = fs.realpathSync + +var version = process.version +var ok = /^v[0-5]\./.test(version) +var old = __nccwpck_require__(1734) + +function newError (er) { + return er && er.syscall === 'realpath' && ( + er.code === 'ELOOP' || + er.code === 'ENOMEM' || + er.code === 'ENAMETOOLONG' + ) +} + +function realpath (p, cache, cb) { + if (ok) { + return origRealpath(p, cache, cb) + } + + if (typeof cache === 'function') { + cb = cache + cache = null + } + origRealpath(p, cache, function (er, result) { + if (newError(er)) { + old.realpath(p, cache, cb) + } else { + cb(er, result) } - _buildExporterFromEnv() { - const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER; - if (exporterName === 'none') - return; - const exporter = this._getSpanExporter(exporterName); - if (!exporter) { - api_1.diag.error(`Exporter "${exporterName}" requested through environment variable is unavailable.`); - } - return exporter; + }) +} + +function realpathSync (p, cache) { + if (ok) { + return origRealpathSync(p, cache) + } + + try { + return origRealpathSync(p, cache) + } catch (er) { + if (newError(er)) { + return old.realpathSync(p, cache) + } else { + throw er } + } +} + +function monkeypatch () { + fs.realpath = realpath + fs.realpathSync = realpathSync +} + +function unmonkeypatch () { + fs.realpath = origRealpath + fs.realpathSync = origRealpathSync } -exports.BasicTracerProvider = BasicTracerProvider; -BasicTracerProvider._registeredPropagators = new Map([ - ['tracecontext', () => new core_1.W3CTraceContextPropagator()], - ['baggage', () => new core_1.W3CBaggagePropagator()], -]); -BasicTracerProvider._registeredExporters = new Map(); -//# sourceMappingURL=BasicTracerProvider.js.map + /***/ }), -/***/ 2352: +/***/ 1734: /***/ ((__unused_webpack_module, exports, __nccwpck_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. -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MultiSpanProcessor = void 0; -const core_1 = __nccwpck_require__(9736); -/** - * Implementation of the {@link SpanProcessor} that simply forwards all - * received events to a list of {@link SpanProcessor}s. - */ -class MultiSpanProcessor { - constructor(_spanProcessors) { - this._spanProcessors = _spanProcessors; - } - forceFlush() { - const promises = []; - for (const spanProcessor of this._spanProcessors) { - promises.push(spanProcessor.forceFlush()); - } - return new Promise(resolve => { - Promise.all(promises) - .then(() => { - resolve(); - }) - .catch(error => { - (0, core_1.globalErrorHandler)(error || new Error('MultiSpanProcessor: forceFlush failed')); - resolve(); - }); - }); - } - onStart(span, context) { - for (const spanProcessor of this._spanProcessors) { - spanProcessor.onStart(span, context); - } - } - onEnd(span) { - for (const spanProcessor of this._spanProcessors) { - spanProcessor.onEnd(span); - } +var pathModule = __nccwpck_require__(5622); +var isWindows = process.platform === 'win32'; +var fs = __nccwpck_require__(5747); + +// JavaScript implementation of realpath, ported from node pre-v6 + +var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); + +function rethrow() { + // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and + // is fairly slow to generate. + var callback; + if (DEBUG) { + var backtrace = new Error; + callback = debugCallback; + } else + callback = missingCallback; + + return callback; + + function debugCallback(err) { + if (err) { + backtrace.message = err.message; + err = backtrace; + missingCallback(err); } - shutdown() { - const promises = []; - for (const spanProcessor of this._spanProcessors) { - promises.push(spanProcessor.shutdown()); - } - return new Promise((resolve, reject) => { - Promise.all(promises).then(() => { - resolve(); - }, reject); - }); + } + + function missingCallback(err) { + if (err) { + if (process.throwDeprecation) + throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs + else if (!process.noDeprecation) { + var msg = 'fs: missing callback ' + (err.stack || err.message); + if (process.traceDeprecation) + console.trace(msg); + else + console.error(msg); + } } + } } -exports.MultiSpanProcessor = MultiSpanProcessor; -//# sourceMappingURL=MultiSpanProcessor.js.map -/***/ }), +function maybeCallback(cb) { + return typeof cb === 'function' ? cb : rethrow(); +} -/***/ 1301: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +var normalize = pathModule.normalize; -"use strict"; +// Regexp that finds the next partion of a (partial) path +// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] +if (isWindows) { + var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; +} else { + var nextPartRe = /(.*?)(?:[\/]+|$)/g; +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Span = void 0; -const api = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -const semantic_conventions_1 = __nccwpck_require__(7275); -const enums_1 = __nccwpck_require__(5092); -/** - * This class represents a span. - */ -class Span { - /** Constructs a new Span instance. */ - constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime = (0, core_1.hrTime)()) { - this.attributes = {}; - this.links = []; - this.events = []; - this.status = { - code: api.SpanStatusCode.UNSET, - }; - this.endTime = [0, 0]; - this._ended = false; - this._duration = [-1, -1]; - this.name = spanName; - this._spanContext = spanContext; - this.parentSpanId = parentSpanId; - this.kind = kind; - this.links = links; - this.startTime = (0, core_1.timeInputToHrTime)(startTime); - this.resource = parentTracer.resource; - this.instrumentationLibrary = parentTracer.instrumentationLibrary; - this._spanLimits = parentTracer.getSpanLimits(); - this._spanProcessor = parentTracer.getActiveSpanProcessor(); - this._spanProcessor.onStart(this, context); - this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0; +// Regex to find the device root, including trailing slash. E.g. 'c:\\'. +if (isWindows) { + var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; +} else { + var splitRootRe = /^[\/]*/; +} + +exports.realpathSync = function realpathSync(p, cache) { + // make p is absolute + p = pathModule.resolve(p); + + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return cache[p]; + } + + var original = p, + seenLinks = {}, + knownHard = {}; + + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; + + start(); + + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; + + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstatSync(base); + knownHard[base] = true; } - spanContext() { - return this._spanContext; + } + + // walk down the path, swapping out linked pathparts for their real + // values + // NB: p.length changes. + while (pos < p.length) { + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + continue; } - setAttribute(key, value) { - if (value == null || this._isSpanEnded()) - return this; - if (key.length === 0) { - api.diag.warn(`Invalid attribute key: ${key}`); - return this; + + var resolvedLink; + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // some known symbolic link. no need to stat again. + resolvedLink = cache[base]; + } else { + var stat = fs.lstatSync(base); + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + continue; + } + + // read the link if it wasn't read before + // dev/ino always return 0 on windows, so skip the check. + var linkTarget = null; + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + linkTarget = seenLinks[id]; } - if (!(0, core_1.isAttributeValue)(value)) { - api.diag.warn(`Invalid attribute value set for key: ${key}`); - return this; - } - if (Object.keys(this.attributes).length >= - this._spanLimits.attributeCountLimit && - !Object.prototype.hasOwnProperty.call(this.attributes, key)) { - return this; - } - this.attributes[key] = this._truncateToSize(value); - return this; - } - setAttributes(attributes) { - for (const [k, v] of Object.entries(attributes)) { - this.setAttribute(k, v); - } - return this; - } - /** - * - * @param name Span Name - * @param [attributesOrStartTime] Span attributes or start time - * if type is {@type TimeInput} and 3rd param is undefined - * @param [startTime] Specified start time for the event - */ - addEvent(name, attributesOrStartTime, startTime) { - if (this._isSpanEnded()) - return this; - if (this._spanLimits.eventCountLimit === 0) { - api.diag.warn('No events allowed.'); - return this; - } - if (this.events.length >= this._spanLimits.eventCountLimit) { - api.diag.warn('Dropping extra events.'); - this.events.shift(); - } - if ((0, core_1.isTimeInput)(attributesOrStartTime)) { - if (typeof startTime === 'undefined') { - startTime = attributesOrStartTime; - } - attributesOrStartTime = undefined; - } - if (typeof startTime === 'undefined') { - startTime = (0, core_1.hrTime)(); - } - const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime); - this.events.push({ - name, - attributes, - time: (0, core_1.timeInputToHrTime)(startTime), - }); - return this; - } - setStatus(status) { - if (this._isSpanEnded()) - return this; - this.status = status; - return this; - } - updateName(name) { - if (this._isSpanEnded()) - return this; - this.name = name; - return this; - } - end(endTime = (0, core_1.hrTime)()) { - if (this._isSpanEnded()) { - api.diag.error('You can only call end() on a span once.'); - return; - } - this._ended = true; - this.endTime = (0, core_1.timeInputToHrTime)(endTime); - this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime); - if (this._duration[0] < 0) { - api.diag.warn('Inconsistent start and end time, startTime > endTime', this.startTime, this.endTime); - } - this._spanProcessor.onEnd(this); - } - isRecording() { - return this._ended === false; - } - recordException(exception, time = (0, core_1.hrTime)()) { - const attributes = {}; - if (typeof exception === 'string') { - attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE] = exception; - } - else if (exception) { - if (exception.code) { - attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] = exception.code.toString(); - } - else if (exception.name) { - attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] = exception.name; - } - if (exception.message) { - attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE] = exception.message; - } - if (exception.stack) { - attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_STACKTRACE] = exception.stack; - } - } - // these are minimum requirements from spec - if (attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] || - attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE]) { - this.addEvent(enums_1.ExceptionEventName, attributes, time); - } - else { - api.diag.warn(`Failed to record an exception ${exception}`); - } - } - get duration() { - return this._duration; - } - get ended() { - return this._ended; - } - _isSpanEnded() { - if (this._ended) { - api.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`); - } - return this._ended; - } - // Utility function to truncate given value within size - // for value type of string, will truncate to given limit - // for type of non-string, will return same value - _truncateToLimitUtil(value, limit) { - if (value.length <= limit) { - return value; - } - return value.substr(0, limit); - } - /** - * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then - * return string with trucated to {@code attributeValueLengthLimit} characters - * - * If the given attribute value is array of strings then - * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters - * - * Otherwise return same Attribute {@code value} - * - * @param value Attribute value - * @returns truncated attribute value if required, otherwise same value - */ - _truncateToSize(value) { - const limit = this._attributeValueLengthLimit; - // Check limit - if (limit <= 0) { - // Negative values are invalid, so do not truncate - api.diag.warn(`Attribute value limit must be positive, got ${limit}`); - return value; - } - // String - if (typeof value === 'string') { - return this._truncateToLimitUtil(value, limit); - } - // Array of strings - if (Array.isArray(value)) { - return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val); - } - // Other types, no need to apply value length limit - return value; + } + if (linkTarget === null) { + fs.statSync(base); + linkTarget = fs.readlinkSync(base); + } + resolvedLink = pathModule.resolve(previous, linkTarget); + // track this, if given a cache. + if (cache) cache[base] = resolvedLink; + if (!isWindows) seenLinks[id] = linkTarget; } -} -exports.Span = Span; -//# sourceMappingURL=Span.js.map -/***/ }), + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } -/***/ 3502: -/***/ ((__unused_webpack_module, exports) => { + if (cache) cache[original] = p; -"use strict"; + return p; +}; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=SpanProcessor.js.map -/***/ }), +exports.realpath = function realpath(p, cache, cb) { + if (typeof cb !== 'function') { + cb = maybeCallback(cache); + cache = null; + } -/***/ 6598: -/***/ ((__unused_webpack_module, exports) => { + // make p is absolute + p = pathModule.resolve(p); -"use strict"; + if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { + return process.nextTick(cb.bind(null, null, cache[p])); + } -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=TimedEvent.js.map + var original = p, + seenLinks = {}, + knownHard = {}; -/***/ }), + // current character position in p + var pos; + // the partial path so far, including a trailing slash if any + var current; + // the partial path without a trailing slash (except when pointing at a root) + var base; + // the partial path scanned in the previous round, with slash + var previous; -/***/ 3806: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + start(); -"use strict"; + function start() { + // Skip over roots + var m = splitRootRe.exec(p); + pos = m[0].length; + current = m[0]; + base = m[0]; + previous = ''; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.Tracer = void 0; -const api = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -const Span_1 = __nccwpck_require__(1301); -const utility_1 = __nccwpck_require__(4324); -/** - * This class represents a basic tracer. - */ -class Tracer { - /** - * Constructs a new Tracer instance. - */ - constructor(instrumentationLibrary, config, _tracerProvider) { - this._tracerProvider = _tracerProvider; - const localConfig = (0, utility_1.mergeConfig)(config); - this._sampler = localConfig.sampler; - this._generalLimits = localConfig.generalLimits; - this._spanLimits = localConfig.spanLimits; - this._idGenerator = config.idGenerator || new core_1.RandomIdGenerator(); - this.resource = _tracerProvider.resource; - this.instrumentationLibrary = instrumentationLibrary; + // On windows, check that the root exists. On unix there is no need. + if (isWindows && !knownHard[base]) { + fs.lstat(base, function(err) { + if (err) return cb(err); + knownHard[base] = true; + LOOP(); + }); + } else { + process.nextTick(LOOP); } - /** - * Starts a new Span or returns the default NoopSpan based on the sampling - * decision. - */ - startSpan(name, options = {}, context = api.context.active()) { - var _a, _b; - if ((0, core_1.isTracingSuppressed)(context)) { - api.diag.debug('Instrumentation suppressed, returning Noop Span'); - return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT); - } - // remove span from context in case a root span is requested via options - if (options.root) { - context = api.trace.deleteSpan(context); - } - const parentSpanContext = api.trace.getSpanContext(context); - const spanId = this._idGenerator.generateSpanId(); - let traceId; - let traceState; - let parentSpanId; - if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) { - // New root span. - traceId = this._idGenerator.generateTraceId(); - } - else { - // New child span. - traceId = parentSpanContext.traceId; - traceState = parentSpanContext.traceState; - parentSpanId = parentSpanContext.spanId; - } - const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL; - const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => { - return { - context: link.context, - attributes: (0, core_1.sanitizeAttributes)(link.attributes), - }; - }); - const attributes = (0, core_1.sanitizeAttributes)(options.attributes); - // make sampling decision - const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links); - const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED - ? api.TraceFlags.SAMPLED - : api.TraceFlags.NONE; - const spanContext = { traceId, spanId, traceFlags, traceState }; - if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) { - api.diag.debug('Recording is off, propagating context in a non-recording span'); - return api.trace.wrapSpanContext(spanContext); - } - const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime); - // Set initial span attributes. The attributes object may have been mutated - // by the sampler, so we sanitize the merged attributes before setting them. - const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes)); - span.setAttributes(initAttributes); - return span; + } + + // walk down the path, swapping out linked pathparts for their real + // values + function LOOP() { + // stop if scanned past end of path + if (pos >= p.length) { + if (cache) cache[original] = p; + return cb(null, p); } - startActiveSpan(name, arg2, arg3, arg4) { - let opts; - let ctx; - let fn; - if (arguments.length < 2) { - return; - } - else if (arguments.length === 2) { - fn = arg2; - } - else if (arguments.length === 3) { - opts = arg2; - fn = arg3; - } - else { - opts = arg2; - ctx = arg3; - fn = arg4; - } - const parentContext = ctx !== null && ctx !== void 0 ? ctx : api.context.active(); - const span = this.startSpan(name, opts, parentContext); - const contextWithSpanSet = api.trace.setSpan(parentContext, span); - return api.context.with(contextWithSpanSet, fn, undefined, span); + + // find the next part + nextPartRe.lastIndex = pos; + var result = nextPartRe.exec(p); + previous = current; + current += result[0]; + base = previous + result[1]; + pos = nextPartRe.lastIndex; + + // continue if not a symlink + if (knownHard[base] || (cache && cache[base] === base)) { + return process.nextTick(LOOP); } - /** Returns the active {@link GeneralLimits}. */ - getGeneralLimits() { - return this._generalLimits; + + if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { + // known symbolic link. no need to stat again. + return gotResolvedLink(cache[base]); } - /** Returns the active {@link SpanLimits}. */ - getSpanLimits() { - return this._spanLimits; + + return fs.lstat(base, gotStat); + } + + function gotStat(err, stat) { + if (err) return cb(err); + + // if not a symlink, skip to the next path part + if (!stat.isSymbolicLink()) { + knownHard[base] = true; + if (cache) cache[base] = base; + return process.nextTick(LOOP); } - getActiveSpanProcessor() { - return this._tracerProvider.getActiveSpanProcessor(); + + // stat & read the link if not read before + // call gotTarget as soon as the link target is known + // dev/ino always return 0 on windows, so skip the check. + if (!isWindows) { + var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); + if (seenLinks.hasOwnProperty(id)) { + return gotTarget(null, seenLinks[id], base); + } } -} -exports.Tracer = Tracer; -//# sourceMappingURL=Tracer.js.map + fs.stat(base, function(err) { + if (err) return cb(err); + + fs.readlink(base, function(err, target) { + if (!isWindows) seenLinks[id] = target; + gotTarget(err, target); + }); + }); + } + + function gotTarget(err, target, base) { + if (err) return cb(err); + + var resolvedLink = pathModule.resolve(previous, target); + if (cache) cache[base] = resolvedLink; + gotResolvedLink(resolvedLink); + } + + function gotResolvedLink(resolvedLink) { + // resolve the link, then start over + p = pathModule.resolve(resolvedLink, p.slice(pos)); + start(); + } +}; + /***/ }), -/***/ 91: +/***/ 7625: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { -"use strict"; +exports.setopts = setopts +exports.ownProp = ownProp +exports.makeAbs = makeAbs +exports.finish = finish +exports.mark = mark +exports.isIgnored = isIgnored +exports.childrenIgnored = childrenIgnored -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.buildSamplerFromEnv = exports.DEFAULT_CONFIG = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -const env = (0, core_1.getEnv)(); -const FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn; -const DEFAULT_RATIO = 1; -/** - * Default configuration. For fields with primitive values, any user-provided - * value will override the corresponding default value. For fields with - * non-primitive values (like `spanLimits`), the user-provided value will be - * used to extend the default value. - */ -exports.DEFAULT_CONFIG = { - sampler: buildSamplerFromEnv(env), - forceFlushTimeoutMillis: 30000, - generalLimits: { - attributeValueLengthLimit: (0, core_1.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: (0, core_1.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT, - }, - spanLimits: { - attributeValueLengthLimit: (0, core_1.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, - attributeCountLimit: (0, core_1.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, - linkCountLimit: (0, core_1.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT, - eventCountLimit: (0, core_1.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT, - }, -}; -/** - * Based on environment, builds a sampler, complies with specification. - * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment - */ -function buildSamplerFromEnv(environment = (0, core_1.getEnv)()) { - switch (environment.OTEL_TRACES_SAMPLER) { - case core_1.TracesSamplerValues.AlwaysOn: - return new core_1.AlwaysOnSampler(); - case core_1.TracesSamplerValues.AlwaysOff: - return new core_1.AlwaysOffSampler(); - case core_1.TracesSamplerValues.ParentBasedAlwaysOn: - return new core_1.ParentBasedSampler({ - root: new core_1.AlwaysOnSampler(), - }); - case core_1.TracesSamplerValues.ParentBasedAlwaysOff: - return new core_1.ParentBasedSampler({ - root: new core_1.AlwaysOffSampler(), - }); - case core_1.TracesSamplerValues.TraceIdRatio: - return new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)); - case core_1.TracesSamplerValues.ParentBasedTraceIdRatio: - return new core_1.ParentBasedSampler({ - root: new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)), - }); - default: - api_1.diag.error(`OTEL_TRACES_SAMPLER value "${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}".`); - return new core_1.AlwaysOnSampler(); - } -} -exports.buildSamplerFromEnv = buildSamplerFromEnv; -function getSamplerProbabilityFromEnv(environment) { - if (environment.OTEL_TRACES_SAMPLER_ARG === undefined || - environment.OTEL_TRACES_SAMPLER_ARG === '') { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG); - if (isNaN(probability)) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - if (probability < 0 || probability > 1) { - api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`); - return DEFAULT_RATIO; - } - return probability; +function ownProp (obj, field) { + return Object.prototype.hasOwnProperty.call(obj, field) } -//# sourceMappingURL=config.js.map -/***/ }), +var fs = __nccwpck_require__(5747) +var path = __nccwpck_require__(5622) +var minimatch = __nccwpck_require__(3973) +var isAbsolute = __nccwpck_require__(8714) +var Minimatch = minimatch.Minimatch -/***/ 5092: -/***/ ((__unused_webpack_module, exports) => { +function alphasort (a, b) { + return a.localeCompare(b, 'en') +} -"use strict"; +function setupIgnores (self, options) { + self.ignore = options.ignore || [] -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExceptionEventName = void 0; -// Event name definitions -exports.ExceptionEventName = 'exception'; -//# sourceMappingURL=enums.js.map + if (!Array.isArray(self.ignore)) + self.ignore = [self.ignore] -/***/ }), + if (self.ignore.length) { + self.ignore = self.ignore.map(ignoreMap) + } +} -/***/ 9727: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +// ignore patterns are always in dot:true mode. +function ignoreMap (pattern) { + var gmatcher = null + if (pattern.slice(-3) === '/**') { + var gpattern = pattern.replace(/(\/\*\*)+$/, '') + gmatcher = new Minimatch(gpattern, { dot: true }) + } -"use strict"; + return { + matcher: new Minimatch(pattern, { dot: true }), + gmatcher: gmatcher + } +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchSpanProcessorBase = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -/** - * Implementation of the {@link SpanProcessor} that batches spans exported by - * the SDK then pushes them to the exporter pipeline. - */ -class BatchSpanProcessorBase { - constructor(_exporter, config) { - this._exporter = _exporter; - this._finishedSpans = []; - const env = (0, core_1.getEnv)(); - this._maxExportBatchSize = - typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number' - ? config.maxExportBatchSize - : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE; - this._maxQueueSize = - typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number' - ? config.maxQueueSize - : env.OTEL_BSP_MAX_QUEUE_SIZE; - this._scheduledDelayMillis = - typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number' - ? config.scheduledDelayMillis - : env.OTEL_BSP_SCHEDULE_DELAY; - this._exportTimeoutMillis = - typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number' - ? config.exportTimeoutMillis - : env.OTEL_BSP_EXPORT_TIMEOUT; - this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); - } - forceFlush() { - if (this._shutdownOnce.isCalled) { - return this._shutdownOnce.promise; - } - return this._flushAll(); - } - // does nothing. - onStart(_span, _parentContext) { } - onEnd(span) { - if (this._shutdownOnce.isCalled) { - return; - } - if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { - return; - } - this._addToBuffer(span); - } - shutdown() { - return this._shutdownOnce.call(); - } - _shutdown() { - return Promise.resolve() - .then(() => { - return this.onShutdown(); - }) - .then(() => { - return this._flushAll(); - }) - .then(() => { - return this._exporter.shutdown(); - }); - } - /** Add a span in the buffer. */ - _addToBuffer(span) { - if (this._finishedSpans.length >= this._maxQueueSize) { - // limit reached, drop span - return; - } - this._finishedSpans.push(span); - this._maybeStartTimer(); - } - /** - * Send all spans to the exporter respecting the batch size limit - * This function is used only on forceFlush or shutdown, - * for all other cases _flush should be used - * */ - _flushAll() { - return new Promise((resolve, reject) => { - const promises = []; - // calculate number of batches - const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize); - for (let i = 0, j = count; i < j; i++) { - promises.push(this._flushOneBatch()); - } - Promise.all(promises) - .then(() => { - resolve(); - }) - .catch(reject); - }); - } - _flushOneBatch() { - this._clearTimer(); - if (this._finishedSpans.length === 0) { - return Promise.resolve(); - } - return new Promise((resolve, reject) => { - const timer = setTimeout(() => { - // don't wait anymore for export, this way the next batch can start - reject(new Error('Timeout')); - }, this._exportTimeoutMillis); - // prevent downstream exporter calls from generating spans - api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { - // Reset the finished spans buffer here because the next invocations of the _flush method - // could pass the same finished spans to the exporter if the buffer is cleared - // outside of the execution of this callback. - this._exporter.export(this._finishedSpans.splice(0, this._maxExportBatchSize), result => { - var _a; - clearTimeout(timer); - if (result.code === core_1.ExportResultCode.SUCCESS) { - resolve(); - } - else { - reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error('BatchSpanProcessor: span export failed')); - } - }); - }); - }); - } - _maybeStartTimer() { - if (this._timer !== undefined) - return; - this._timer = setTimeout(() => { - this._flushOneBatch() - .then(() => { - if (this._finishedSpans.length > 0) { - this._clearTimer(); - this._maybeStartTimer(); - } - }) - .catch(e => { - (0, core_1.globalErrorHandler)(e); - }); - }, this._scheduledDelayMillis); - (0, core_1.unrefTimer)(this._timer); - } - _clearTimer() { - if (this._timer !== undefined) { - clearTimeout(this._timer); - this._timer = undefined; - } +function setopts (self, pattern, options) { + if (!options) + options = {} + + // base-matching: just use globstar for that. + if (options.matchBase && -1 === pattern.indexOf("/")) { + if (options.noglobstar) { + throw new Error("base matching requires globstar") } -} -exports.BatchSpanProcessorBase = BatchSpanProcessorBase; -//# sourceMappingURL=BatchSpanProcessorBase.js.map + pattern = "**/" + pattern + } -/***/ }), + self.silent = !!options.silent + self.pattern = pattern + self.strict = options.strict !== false + self.realpath = !!options.realpath + self.realpathCache = options.realpathCache || Object.create(null) + self.follow = !!options.follow + self.dot = !!options.dot + self.mark = !!options.mark + self.nodir = !!options.nodir + if (self.nodir) + self.mark = true + self.sync = !!options.sync + self.nounique = !!options.nounique + self.nonull = !!options.nonull + self.nosort = !!options.nosort + self.nocase = !!options.nocase + self.stat = !!options.stat + self.noprocess = !!options.noprocess + self.absolute = !!options.absolute + self.fs = options.fs || fs -/***/ 6784: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + self.maxLength = options.maxLength || Infinity + self.cache = options.cache || Object.create(null) + self.statCache = options.statCache || Object.create(null) + self.symlinks = options.symlinks || Object.create(null) -"use strict"; + setupIgnores(self, options) -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ConsoleSpanExporter = void 0; -const core_1 = __nccwpck_require__(9736); -/** - * This is implementation of {@link SpanExporter} that prints spans to the - * console. This class can be used for diagnostic purposes. - */ -/* eslint-disable no-console */ -class ConsoleSpanExporter { - /** - * Export spans. - * @param spans - * @param resultCallback - */ - export(spans, resultCallback) { - return this._sendSpans(spans, resultCallback); - } - /** - * Shutdown the exporter. - */ - shutdown() { - this._sendSpans([]); - return Promise.resolve(); - } - /** - * converts span info into more readable format - * @param span - */ - _exportInfo(span) { - return { - traceId: span.spanContext().traceId, - parentId: span.parentSpanId, - name: span.name, - id: span.spanContext().spanId, - kind: span.kind, - timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime), - duration: (0, core_1.hrTimeToMicroseconds)(span.duration), - attributes: span.attributes, - status: span.status, - events: span.events, - links: span.links - }; - } - /** - * Showing spans in console - * @param spans - * @param done - */ - _sendSpans(spans, done) { - for (const span of spans) { - console.dir(this._exportInfo(span), { depth: 3 }); - } - if (done) { - return done({ code: core_1.ExportResultCode.SUCCESS }); - } - } -} -exports.ConsoleSpanExporter = ConsoleSpanExporter; -//# sourceMappingURL=ConsoleSpanExporter.js.map + self.changedCwd = false + var cwd = process.cwd() + if (!ownProp(options, "cwd")) + self.cwd = cwd + else { + self.cwd = path.resolve(options.cwd) + self.changedCwd = self.cwd !== cwd + } -/***/ }), + self.root = options.root || path.resolve(self.cwd, "/") + self.root = path.resolve(self.root) + if (process.platform === "win32") + self.root = self.root.replace(/\\/g, "/") -/***/ 4093: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + // TODO: is an absolute `cwd` supposed to be resolved against `root`? + // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') + self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) + if (process.platform === "win32") + self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") + self.nomount = !!options.nomount -"use strict"; + // disable comments and negation in Minimatch. + // Note that they are not supported in Glob itself anyway. + options.nonegate = true + options.nocomment = true -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.InMemorySpanExporter = void 0; -const core_1 = __nccwpck_require__(9736); -/** - * This class can be used for testing purposes. It stores the exported spans - * in a list in memory that can be retrieved using the `getFinishedSpans()` - * method. - */ -class InMemorySpanExporter { - constructor() { - this._finishedSpans = []; - /** - * Indicates if the exporter has been "shutdown." - * When false, exported spans will not be stored in-memory. - */ - this._stopped = false; - } - export(spans, resultCallback) { - if (this._stopped) - return resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: new Error('Exporter has been stopped'), - }); - this._finishedSpans.push(...spans); - setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0); - } - shutdown() { - this._stopped = true; - this._finishedSpans = []; - return Promise.resolve(); + self.minimatch = new Minimatch(pattern, options) + self.options = self.minimatch.options +} + +function finish (self) { + var nou = self.nounique + var all = nou ? [] : Object.create(null) + + for (var i = 0, l = self.matches.length; i < l; i ++) { + var matches = self.matches[i] + if (!matches || Object.keys(matches).length === 0) { + if (self.nonull) { + // do like the shell, and spit out the literal glob + var literal = self.minimatch.globSet[i] + if (nou) + all.push(literal) + else + all[literal] = true + } + } else { + // had matches + var m = Object.keys(matches) + if (nou) + all.push.apply(all, m) + else + m.forEach(function (m) { + all[m] = true + }) } - reset() { - this._finishedSpans = []; + } + + if (!nou) + all = Object.keys(all) + + if (!self.nosort) + all = all.sort(alphasort) + + // at *some* point we statted all of these + if (self.mark) { + for (var i = 0; i < all.length; i++) { + all[i] = self._mark(all[i]) } - getFinishedSpans() { - return this._finishedSpans; + if (self.nodir) { + all = all.filter(function (e) { + var notDir = !(/\/$/.test(e)) + var c = self.cache[e] || self.cache[makeAbs(self, e)] + if (notDir && c) + notDir = c !== 'DIR' && !Array.isArray(c) + return notDir + }) } -} -exports.InMemorySpanExporter = InMemorySpanExporter; -//# sourceMappingURL=InMemorySpanExporter.js.map + } -/***/ }), + if (self.ignore.length) + all = all.filter(function(m) { + return !isIgnored(self, m) + }) -/***/ 9252: -/***/ ((__unused_webpack_module, exports) => { + self.found = all +} -"use strict"; +function mark (self, p) { + var abs = makeAbs(self, p) + var c = self.cache[abs] + var m = p + if (c) { + var isDir = c === 'DIR' || Array.isArray(c) + var slash = p.slice(-1) === '/' -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.NoopSpanProcessor = void 0; -/** No-op implementation of SpanProcessor */ -class NoopSpanProcessor { - onStart(_span, _context) { } - onEnd(_span) { } - shutdown() { - return Promise.resolve(); - } - forceFlush() { - return Promise.resolve(); + if (isDir && !slash) + m += '/' + else if (!isDir && slash) + m = m.slice(0, -1) + + if (m !== p) { + var mabs = makeAbs(self, m) + self.statCache[mabs] = self.statCache[abs] + self.cache[mabs] = self.cache[abs] } + } + + return m } -exports.NoopSpanProcessor = NoopSpanProcessor; -//# sourceMappingURL=NoopSpanProcessor.js.map -/***/ }), +// lotta situps... +function makeAbs (self, f) { + var abs = f + if (f.charAt(0) === '/') { + abs = path.join(self.root, f) + } else if (isAbsolute(f) || f === '') { + abs = f + } else if (self.changedCwd) { + abs = path.resolve(self.cwd, f) + } else { + abs = path.resolve(f) + } -/***/ 5561: -/***/ ((__unused_webpack_module, exports) => { + if (process.platform === 'win32') + abs = abs.replace(/\\/g, '/') -"use strict"; + return abs +} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=ReadableSpan.js.map -/***/ }), +// Return true, if pattern ends with globstar '**', for the accompanying parent directory. +// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents +function isIgnored (self, path) { + if (!self.ignore.length) + return false -/***/ 9802: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + return self.ignore.some(function(item) { + return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) + }) +} -"use strict"; +function childrenIgnored (self, path) { + if (!self.ignore.length) + return false -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SimpleSpanProcessor = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(9736); -/** - * An implementation of the {@link SpanProcessor} that converts the {@link Span} - * to {@link ReadableSpan} and passes it to the configured exporter. - * - * Only spans that are sampled are converted. - */ -class SimpleSpanProcessor { - constructor(_exporter) { - this._exporter = _exporter; - this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this); - } - forceFlush() { - // do nothing as all spans are being exported without waiting - return Promise.resolve(); - } - // does nothing. - onStart(_span, _parentContext) { } - onEnd(span) { - if (this._shutdownOnce.isCalled) { - return; - } - if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) { - return; - } - // prevent downstream exporter calls from generating spans - api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => { - this._exporter.export([span], result => { - var _a; - if (result.code !== core_1.ExportResultCode.SUCCESS) { - (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`)); - } - }); - }); - } - shutdown() { - return this._shutdownOnce.call(); - } - _shutdown() { - return this._exporter.shutdown(); - } + return self.ignore.some(function(item) { + return !!(item.gmatcher && item.gmatcher.match(path)) + }) } -exports.SimpleSpanProcessor = SimpleSpanProcessor; -//# sourceMappingURL=SimpleSpanProcessor.js.map + /***/ }), -/***/ 4570: -/***/ ((__unused_webpack_module, exports) => { +/***/ 1957: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -"use strict"; +// Approach: +// +// 1. Get the minimatch set +// 2. For each pattern in the set, PROCESS(pattern, false) +// 3. Store matches per-set, then uniq them +// +// PROCESS(pattern, inGlobStar) +// Get the first [n] items from pattern that are all strings +// Join these together. This is PREFIX. +// If there is no more remaining, then stat(PREFIX) and +// add to matches if it succeeds. END. +// +// If inGlobStar and PREFIX is symlink and points to dir +// set ENTRIES = [] +// else readdir(PREFIX) as ENTRIES +// If fail, END +// +// with ENTRIES +// If pattern[n] is GLOBSTAR +// // handle the case where the globstar match is empty +// // by pruning it out, and testing the resulting pattern +// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) +// // handle other cases. +// for ENTRY in ENTRIES (not dotfiles) +// // attach globstar + tail onto the entry +// // Mark that this entry is a globstar match +// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) +// +// else // not globstar +// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) +// Test ENTRY against pattern[n] +// If fails, continue +// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) +// +// Caveat: +// Cache all stats and readdirs results to minimize syscall. Since all +// we ever care about is existence and directory-ness, we can just keep +// `true` for files, and [children,...] for directories, or `false` for +// things that don't exist. -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=SpanExporter.js.map +module.exports = glob -/***/ }), +var rp = __nccwpck_require__(6863) +var minimatch = __nccwpck_require__(3973) +var Minimatch = minimatch.Minimatch +var inherits = __nccwpck_require__(4124) +var EE = __nccwpck_require__(8614).EventEmitter +var path = __nccwpck_require__(5622) +var assert = __nccwpck_require__(2357) +var isAbsolute = __nccwpck_require__(8714) +var globSync = __nccwpck_require__(9010) +var common = __nccwpck_require__(7625) +var setopts = common.setopts +var ownProp = common.ownProp +var inflight = __nccwpck_require__(2492) +var util = __nccwpck_require__(1669) +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored -/***/ 9253: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +var once = __nccwpck_require__(1223) -"use strict"; +function glob (pattern, options, cb) { + if (typeof options === 'function') cb = options, options = {} + if (!options) options = {} -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(3806), exports); -__exportStar(__nccwpck_require__(8920), exports); -__exportStar(__nccwpck_require__(262), exports); -__exportStar(__nccwpck_require__(6784), exports); -__exportStar(__nccwpck_require__(4093), exports); -__exportStar(__nccwpck_require__(5561), exports); -__exportStar(__nccwpck_require__(9802), exports); -__exportStar(__nccwpck_require__(4570), exports); -__exportStar(__nccwpck_require__(9252), exports); -__exportStar(__nccwpck_require__(1301), exports); -__exportStar(__nccwpck_require__(3502), exports); -__exportStar(__nccwpck_require__(6598), exports); -__exportStar(__nccwpck_require__(9068), exports); -//# sourceMappingURL=index.js.map + if (options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return globSync(pattern, options) + } -/***/ }), + return new Glob(pattern, options, cb) +} -/***/ 262: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { +glob.sync = globSync +var GlobSync = glob.GlobSync = globSync.GlobSync -"use strict"; +// old api surface +glob.glob = glob -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(6573), exports); -//# sourceMappingURL=index.js.map +function extend (origin, add) { + if (add === null || typeof add !== 'object') { + return origin + } -/***/ }), + var keys = Object.keys(add) + var i = keys.length + while (i--) { + origin[keys[i]] = add[keys[i]] + } + return origin +} -/***/ 7913: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { +glob.hasMagic = function (pattern, options_) { + var options = extend({}, options_) + options.noprocess = true -"use strict"; + var g = new Glob(pattern, options) + var set = g.minimatch.set -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BatchSpanProcessor = void 0; -const BatchSpanProcessorBase_1 = __nccwpck_require__(9727); -class BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase { - onShutdown() { } + if (!pattern) + return false + + if (set.length > 1) + return true + + for (var j = 0; j < set[0].length; j++) { + if (typeof set[0][j] !== 'string') + return true + } + + return false } -exports.BatchSpanProcessor = BatchSpanProcessor; -//# sourceMappingURL=BatchSpanProcessor.js.map -/***/ }), +glob.Glob = Glob +inherits(Glob, EE) +function Glob (pattern, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } -/***/ 6573: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + if (options && options.sync) { + if (cb) + throw new TypeError('callback provided to sync glob') + return new GlobSync(pattern, options) + } -"use strict"; + if (!(this instanceof Glob)) + return new Glob(pattern, options, cb) -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(7913), exports); -//# sourceMappingURL=index.js.map + setopts(this, pattern, options) + this._didRealPath = false -/***/ }), + // process each pattern in the minimatch set + var n = this.minimatch.set.length -/***/ 9068: -/***/ ((__unused_webpack_module, exports) => { + // The matches are stored as {: true,...} so that + // duplicates are automagically pruned. + // Later, we do an Object.keys() on these. + // Keep them as a list so we can fill in when nonull is set. + this.matches = new Array(n) -"use strict"; + if (typeof cb === 'function') { + cb = once(cb) + this.on('error', cb) + this.on('end', function (matches) { + cb(null, matches) + }) + } -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map + var self = this + this._processing = 0 -/***/ }), + this._emitQueue = [] + this._processQueue = [] + this.paused = false -/***/ 4324: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + if (this.noprocess) + return this -"use strict"; + if (n === 0) + return done() -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.reconfigureLimits = exports.mergeConfig = void 0; -const config_1 = __nccwpck_require__(91); -/** - * Function to merge Default configuration (as specified in './config') with - * user provided configurations. - */ -function mergeConfig(userConfig) { - const perInstanceDefaults = { - sampler: (0, config_1.buildSamplerFromEnv)(), - }; - const target = Object.assign({}, config_1.DEFAULT_CONFIG, perInstanceDefaults, userConfig); - target.generalLimits = Object.assign({}, config_1.DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {}); - target.spanLimits = Object.assign({}, config_1.DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {}); - return target; + var sync = true + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false, done) + } + sync = false + + function done () { + --self._processing + if (self._processing <= 0) { + if (sync) { + process.nextTick(function () { + self._finish() + }) + } else { + self._finish() + } + } + } } -exports.mergeConfig = mergeConfig; -/** - * When general limits are provided and model specific limits are not, - * configures the model specific limits by using the values from the general ones. - * @param userConfig User provided tracer configuration - */ -function reconfigureLimits(userConfig) { - var _a, _b; - const spanLimits = Object.assign({}, userConfig.spanLimits); - /** - * When span attribute count limit is not defined, but general attribute count limit is defined - * Then, span attribute count limit will be same as general one - */ - if (spanLimits.attributeCountLimit == null && ((_a = userConfig.generalLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) != null) { - spanLimits.attributeCountLimit = userConfig.generalLimits.attributeCountLimit; + +Glob.prototype._finish = function () { + assert(this instanceof Glob) + if (this.aborted) + return + + if (this.realpath && !this._didRealpath) + return this._realpath() + + common.finish(this) + this.emit('end', this.found) +} + +Glob.prototype._realpath = function () { + if (this._didRealpath) + return + + this._didRealpath = true + + var n = this.matches.length + if (n === 0) + return this._finish() + + var self = this + for (var i = 0; i < this.matches.length; i++) + this._realpathSet(i, next) + + function next () { + if (--n === 0) + self._finish() + } +} + +Glob.prototype._realpathSet = function (index, cb) { + var matchset = this.matches[index] + if (!matchset) + return cb() + + var found = Object.keys(matchset) + var self = this + var n = found.length + + if (n === 0) + return cb() + + var set = this.matches[index] = Object.create(null) + found.forEach(function (p, i) { + // If there's a problem with the stat, then it means that + // one or more of the links in the realpath couldn't be + // resolved. just return the abs value in that case. + p = self._makeAbs(p) + rp.realpath(p, self.realpathCache, function (er, real) { + if (!er) + set[real] = true + else if (er.syscall === 'stat') + set[p] = true + else + self.emit('error', er) // srsly wtf right here + + if (--n === 0) { + self.matches[index] = set + cb() + } + }) + }) +} + +Glob.prototype._mark = function (p) { + return common.mark(this, p) +} + +Glob.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + +Glob.prototype.abort = function () { + this.aborted = true + this.emit('abort') +} + +Glob.prototype.pause = function () { + if (!this.paused) { + this.paused = true + this.emit('pause') + } +} + +Glob.prototype.resume = function () { + if (this.paused) { + this.emit('resume') + this.paused = false + if (this._emitQueue.length) { + var eq = this._emitQueue.slice(0) + this._emitQueue.length = 0 + for (var i = 0; i < eq.length; i ++) { + var e = eq[i] + this._emitMatch(e[0], e[1]) + } } - /** - * When span attribute value length limit is not defined, but general attribute value length limit is defined - * Then, span attribute value length limit will be same as general one - */ - if (spanLimits.attributeValueLengthLimit == null && ((_b = userConfig.generalLimits) === null || _b === void 0 ? void 0 : _b.attributeValueLengthLimit) != null) { - spanLimits.attributeValueLengthLimit = userConfig.generalLimits.attributeValueLengthLimit; + if (this._processQueue.length) { + var pq = this._processQueue.slice(0) + this._processQueue.length = 0 + for (var i = 0; i < pq.length; i ++) { + var p = pq[i] + this._processing-- + this._process(p[0], p[1], p[2], p[3]) + } } - return Object.assign({}, userConfig, { spanLimits }); + } } -exports.reconfigureLimits = reconfigureLimits; -//# sourceMappingURL=utility.js.map -/***/ }), +Glob.prototype._process = function (pattern, index, inGlobStar, cb) { + assert(this instanceof Glob) + assert(typeof cb === 'function') -/***/ 7275: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + if (this.aborted) + return -"use strict"; + this._processing++ + if (this.paused) { + this._processQueue.push([pattern, index, inGlobStar, cb]) + return + } -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(5836), exports); -__exportStar(__nccwpck_require__(2834), exports); -//# sourceMappingURL=index.js.map + //console.error('PROCESS %d', this._processing, pattern) -/***/ }), + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. -/***/ 5003: -/***/ ((__unused_webpack_module, exports) => { + // see if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index, cb) + return -"use strict"; + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticResourceAttributes = { - /** - * Name of the cloud provider. - */ - CLOUD_PROVIDER: 'cloud.provider', - /** - * The cloud account ID the resource is assigned to. - */ - CLOUD_ACCOUNT_ID: 'cloud.account.id', - /** - * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). - */ - CLOUD_REGION: 'cloud.region', - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - */ - CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone', - /** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - */ - CLOUD_PLATFORM: 'cloud.platform', - /** - * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - */ - AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn', - /** - * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - */ - AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn', - /** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - */ - AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype', - /** - * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - */ - AWS_ECS_TASK_ARN: 'aws.ecs.task.arn', - /** - * The task definition family this task definition is a member of. - */ - AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family', - /** - * The revision for this task definition. - */ - AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision', - /** - * The ARN of an EKS cluster. - */ - AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn', - /** - * The name(s) of the AWS log group(s) an application is writing to. - * - * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - */ - AWS_LOG_GROUP_NAMES: 'aws.log.group.names', - /** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - */ - AWS_LOG_GROUP_ARNS: 'aws.log.group.arns', - /** - * The name(s) of the AWS log stream(s) an application is writing to. - */ - AWS_LOG_STREAM_NAMES: 'aws.log.stream.names', - /** - * The ARN(s) of the AWS log stream(s). - * - * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - */ - AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns', - /** - * Container name. - */ - CONTAINER_NAME: 'container.name', - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. - */ - CONTAINER_ID: 'container.id', - /** - * The container runtime managing this container. - */ - CONTAINER_RUNTIME: 'container.runtime', - /** - * Name of the image the container was built on. - */ - CONTAINER_IMAGE_NAME: 'container.image.name', - /** - * Container image tag. - */ - CONTAINER_IMAGE_TAG: 'container.image.tag', - /** - * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - */ - DEPLOYMENT_ENVIRONMENT: 'deployment.environment', - /** - * A unique identifier representing the device. - * - * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. - */ - DEVICE_ID: 'device.id', - /** - * The model identifier for the device. - * - * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. - */ - DEVICE_MODEL_IDENTIFIER: 'device.model.identifier', - /** - * The marketing name for the device model. - * - * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. - */ - DEVICE_MODEL_NAME: 'device.model.name', - /** - * The name of the single function that this runtime instance executes. - * - * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). - */ - FAAS_NAME: 'faas.name', - /** - * The unique ID of the single function that this runtime instance executes. - * - * Note: Depending on the cloud provider, use: - - * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - Take care not to use the "invoked ARN" directly but replace any - [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple - different aliases. - * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) - * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). - - On some providers, it may not be possible to determine the full ID at startup, - which is why this field cannot be made required. For example, on AWS the account ID - part of the ARN is not available without calling another AWS API - which may be deemed too slow for a short-running lambda function. - As an alternative, consider setting `faas.id` as a span attribute instead. - */ - FAAS_ID: 'faas.id', - /** - * The immutable version of the function being executed. - * - * Note: Depending on the cloud provider and platform, use: - - * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - (an integer represented as a decimal string). - * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) - (i.e., the function name plus the revision suffix). - * **Google Cloud Functions:** The value of the - [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - * **Azure Functions:** Not applicable. Do not set this attribute. - */ - FAAS_VERSION: 'faas.version', - /** - * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. - * - * Note: * **AWS Lambda:** Use the (full) log stream name. - */ - FAAS_INSTANCE: 'faas.instance', - /** - * The amount of memory available to the serverless function in MiB. - * - * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. - */ - FAAS_MAX_MEMORY: 'faas.max_memory', - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. - */ - HOST_ID: 'host.id', - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - */ - HOST_NAME: 'host.name', - /** - * Type of host. For Cloud, this must be the machine type. - */ - HOST_TYPE: 'host.type', - /** - * The CPU architecture the host system is running on. - */ - HOST_ARCH: 'host.arch', - /** - * Name of the VM image or OS install the host was instantiated from. - */ - HOST_IMAGE_NAME: 'host.image.name', - /** - * VM image ID. For Cloud, this value is from the provider. - */ - HOST_IMAGE_ID: 'host.image.id', - /** - * The version string of the VM image as defined in [Version SpanAttributes](README.md#version-attributes). - */ - HOST_IMAGE_VERSION: 'host.image.version', - /** - * The name of the cluster. - */ - K8S_CLUSTER_NAME: 'k8s.cluster.name', - /** - * The name of the Node. - */ - K8S_NODE_NAME: 'k8s.node.name', - /** - * The UID of the Node. - */ - K8S_NODE_UID: 'k8s.node.uid', - /** - * The name of the namespace that the pod is running in. - */ - K8S_NAMESPACE_NAME: 'k8s.namespace.name', - /** - * The UID of the Pod. - */ - K8S_POD_UID: 'k8s.pod.uid', - /** - * The name of the Pod. - */ - K8S_POD_NAME: 'k8s.pod.name', - /** - * The name of the Container in a Pod template. - */ - K8S_CONTAINER_NAME: 'k8s.container.name', - /** - * The UID of the ReplicaSet. - */ - K8S_REPLICASET_UID: 'k8s.replicaset.uid', - /** - * The name of the ReplicaSet. - */ - K8S_REPLICASET_NAME: 'k8s.replicaset.name', - /** - * The UID of the Deployment. - */ - K8S_DEPLOYMENT_UID: 'k8s.deployment.uid', - /** - * The name of the Deployment. - */ - K8S_DEPLOYMENT_NAME: 'k8s.deployment.name', - /** - * The UID of the StatefulSet. - */ - K8S_STATEFULSET_UID: 'k8s.statefulset.uid', - /** - * The name of the StatefulSet. - */ - K8S_STATEFULSET_NAME: 'k8s.statefulset.name', - /** - * The UID of the DaemonSet. - */ - K8S_DAEMONSET_UID: 'k8s.daemonset.uid', - /** - * The name of the DaemonSet. - */ - K8S_DAEMONSET_NAME: 'k8s.daemonset.name', - /** - * The UID of the Job. - */ - K8S_JOB_UID: 'k8s.job.uid', - /** - * The name of the Job. - */ - K8S_JOB_NAME: 'k8s.job.name', - /** - * The UID of the CronJob. - */ - K8S_CRONJOB_UID: 'k8s.cronjob.uid', - /** - * The name of the CronJob. - */ - K8S_CRONJOB_NAME: 'k8s.cronjob.name', - /** - * The operating system type. - */ - OS_TYPE: 'os.type', - /** - * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - */ - OS_DESCRIPTION: 'os.description', - /** - * Human readable operating system name. - */ - OS_NAME: 'os.name', - /** - * The version string of the operating system as defined in [Version SpanAttributes](../../resource/semantic_conventions/README.md#version-attributes). - */ - OS_VERSION: 'os.version', - /** - * Process identifier (PID). - */ - PROCESS_PID: 'process.pid', - /** - * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. - */ - PROCESS_EXECUTABLE_NAME: 'process.executable.name', - /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - */ - PROCESS_EXECUTABLE_PATH: 'process.executable.path', - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - */ - PROCESS_COMMAND: 'process.command', - /** - * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. - */ - PROCESS_COMMAND_LINE: 'process.command_line', - /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - */ - PROCESS_COMMAND_ARGS: 'process.command_args', - /** - * The username of the user that owns the process. - */ - PROCESS_OWNER: 'process.owner', - /** - * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. - */ - PROCESS_RUNTIME_NAME: 'process.runtime.name', - /** - * The version of the runtime of this process, as returned by the runtime without modification. - */ - PROCESS_RUNTIME_VERSION: 'process.runtime.version', - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - */ - PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description', - /** - * Logical name of the service. - * - * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - */ - SERVICE_NAME: 'service.name', - /** - * A namespace for `service.name`. - * - * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - */ - SERVICE_NAMESPACE: 'service.namespace', - /** - * The string ID of the service instance. - * - * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). - */ - SERVICE_INSTANCE_ID: 'service.instance.id', - /** - * The version string of the service API or implementation. - */ - SERVICE_VERSION: 'service.version', - /** - * The name of the telemetry SDK as defined above. - */ - TELEMETRY_SDK_NAME: 'telemetry.sdk.name', - /** - * The language of the telemetry SDK. - */ - TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language', - /** - * The version string of the telemetry SDK. - */ - TELEMETRY_SDK_VERSION: 'telemetry.sdk.version', - /** - * The version string of the auto instrumentation agent, if used. - */ - TELEMETRY_AUTO_VERSION: 'telemetry.auto.version', - /** - * The name of the web engine. - */ - WEBENGINE_NAME: 'webengine.name', - /** - * The version of the web engine. - */ - WEBENGINE_VERSION: 'webengine.version', - /** - * Additional description of the web engine (e.g. detailed version and edition information). - */ - WEBENGINE_DESCRIPTION: 'webengine.description', -}; -exports.CloudProviderValues = { - /** Alibaba Cloud. */ - ALIBABA_CLOUD: 'alibaba_cloud', - /** Amazon Web Services. */ - AWS: 'aws', - /** Microsoft Azure. */ - AZURE: 'azure', - /** Google Cloud Platform. */ - GCP: 'gcp', -}; -exports.CloudPlatformValues = { - /** Alibaba Cloud Elastic Compute Service. */ - ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs', - /** Alibaba Cloud Function Compute. */ - ALIBABA_CLOUD_FC: 'alibaba_cloud_fc', - /** AWS Elastic Compute Cloud. */ - AWS_EC2: 'aws_ec2', - /** AWS Elastic Container Service. */ - AWS_ECS: 'aws_ecs', - /** AWS Elastic Kubernetes Service. */ - AWS_EKS: 'aws_eks', - /** AWS Lambda. */ - AWS_LAMBDA: 'aws_lambda', - /** AWS Elastic Beanstalk. */ - AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk', - /** Azure Virtual Machines. */ - AZURE_VM: 'azure_vm', - /** Azure Container Instances. */ - AZURE_CONTAINER_INSTANCES: 'azure_container_instances', - /** Azure Kubernetes Service. */ - AZURE_AKS: 'azure_aks', - /** Azure Functions. */ - AZURE_FUNCTIONS: 'azure_functions', - /** Azure App Service. */ - AZURE_APP_SERVICE: 'azure_app_service', - /** Google Cloud Compute Engine (GCE). */ - GCP_COMPUTE_ENGINE: 'gcp_compute_engine', - /** Google Cloud Run. */ - GCP_CLOUD_RUN: 'gcp_cloud_run', - /** Google Cloud Kubernetes Engine (GKE). */ - GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine', - /** Google Cloud Functions (GCF). */ - GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions', - /** Google Cloud App Engine (GAE). */ - GCP_APP_ENGINE: 'gcp_app_engine', -}; -exports.AwsEcsLaunchtypeValues = { - /** ec2. */ - EC2: 'ec2', - /** fargate. */ - FARGATE: 'fargate', -}; -exports.HostArchValues = { - /** AMD64. */ - AMD64: 'amd64', - /** ARM32. */ - ARM32: 'arm32', - /** ARM64. */ - ARM64: 'arm64', - /** Itanium. */ - IA64: 'ia64', - /** 32-bit PowerPC. */ - PPC32: 'ppc32', - /** 64-bit PowerPC. */ - PPC64: 'ppc64', - /** 32-bit x86. */ - X86: 'x86', -}; -exports.OsTypeValues = { - /** Microsoft Windows. */ - WINDOWS: 'windows', - /** Linux. */ - LINUX: 'linux', - /** Apple Darwin. */ - DARWIN: 'darwin', - /** FreeBSD. */ - FREEBSD: 'freebsd', - /** NetBSD. */ - NETBSD: 'netbsd', - /** OpenBSD. */ - OPENBSD: 'openbsd', - /** DragonFly BSD. */ - DRAGONFLYBSD: 'dragonflybsd', - /** HP-UX (Hewlett Packard Unix). */ - HPUX: 'hpux', - /** AIX (Advanced Interactive eXecutive). */ - AIX: 'aix', - /** Oracle Solaris. */ - SOLARIS: 'solaris', - /** IBM z/OS. */ - Z_OS: 'z_os', -}; -exports.TelemetrySdkLanguageValues = { - /** cpp. */ - CPP: 'cpp', - /** dotnet. */ - DOTNET: 'dotnet', - /** erlang. */ - ERLANG: 'erlang', - /** go. */ - GO: 'go', - /** java. */ - JAVA: 'java', - /** nodejs. */ - NODEJS: 'nodejs', - /** php. */ - PHP: 'php', - /** python. */ - PYTHON: 'python', - /** ruby. */ - RUBY: 'ruby', - /** webjs. */ - WEBJS: 'webjs', -}; -//# sourceMappingURL=SemanticResourceAttributes.js.map + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } -/***/ }), + var remain = pattern.slice(n) -/***/ 2834: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix -"use strict"; + var abs = this._makeAbs(read) -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -__exportStar(__nccwpck_require__(5003), exports); -//# sourceMappingURL=index.js.map + //if ignored, skip _processing + if (childrenIgnored(this, read)) + return cb() -/***/ }), + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) +} -/***/ 9943: -/***/ ((__unused_webpack_module, exports) => { +Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} -"use strict"; +Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticAttributes = { - /** - * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - * - * Note: This may be different from `faas.id` if an alias is involved. - */ - AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn', - /** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - */ - DB_SYSTEM: 'db.system', - /** - * The connection string used to connect to the database. It is recommended to remove embedded credentials. - */ - DB_CONNECTION_STRING: 'db.connection_string', - /** - * Username for accessing the database. - */ - DB_USER: 'db.user', - /** - * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - */ - DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname', - /** - * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - * - * Note: In some SQL databases, the database name to be used is called "schema name". - */ - DB_NAME: 'db.name', - /** - * The database statement being executed. - * - * Note: The value may be sanitized to exclude sensitive information. - */ - DB_STATEMENT: 'db.statement', - /** - * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - * - * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - */ - DB_OPERATION: 'db.operation', - /** - * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - * - * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). - */ - DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name', - /** - * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. - */ - DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace', - /** - * The fetch size used for paging, i.e. how many rows will be returned at once. - */ - DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size', - /** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - */ - DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level', - /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - */ - DB_CASSANDRA_TABLE: 'db.cassandra.table', - /** - * Whether or not the query is idempotent. - */ - DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence', - /** - * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - */ - DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count', - /** - * The ID of the coordinating node for a query. - */ - DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id', - /** - * The data center of the coordinating node for a query. - */ - DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc', - /** - * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. - */ - DB_HBASE_NAMESPACE: 'db.hbase.namespace', - /** - * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - */ - DB_REDIS_DATABASE_INDEX: 'db.redis.database_index', - /** - * The collection being accessed within the database stated in `db.name`. - */ - DB_MONGODB_COLLECTION: 'db.mongodb.collection', - /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - */ - DB_SQL_TABLE: 'db.sql.table', - /** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. - */ - EXCEPTION_TYPE: 'exception.type', - /** - * The exception message. - */ - EXCEPTION_MESSAGE: 'exception.message', - /** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - */ - EXCEPTION_STACKTRACE: 'exception.stacktrace', - /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. - * - * Note: An exception is considered to have escaped (or left) the scope of a span, - if that span is ended while the exception is still logically "in flight". - This may be actually "in flight" in some languages (e.g. if the exception - is passed to a Context manager's `__exit__` method in Python) but will - usually be caught at the point of recording the exception in most languages. - - It is usually not possible to determine at the point where an exception is thrown - whether it will escape the scope of a span. - However, it is trivial to know that an exception - will escape, if one checks for an active exception just before ending the span, - as done in the [example above](#exception-end-example). - - It follows that an exception may still escape the scope of the span - even if the `exception.escaped` attribute was not set or set to false, - since the event might have been recorded at a time where it was not - clear whether the exception will escape. - */ - EXCEPTION_ESCAPED: 'exception.escaped', - /** - * Type of the trigger on which the function is executed. - */ - FAAS_TRIGGER: 'faas.trigger', - /** - * The execution ID of the current function execution. - */ - FAAS_EXECUTION: 'faas.execution', - /** - * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. - */ - FAAS_DOCUMENT_COLLECTION: 'faas.document.collection', - /** - * Describes the type of the operation that was performed on the data. - */ - FAAS_DOCUMENT_OPERATION: 'faas.document.operation', - /** - * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - */ - FAAS_DOCUMENT_TIME: 'faas.document.time', - /** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. - */ - FAAS_DOCUMENT_NAME: 'faas.document.name', - /** - * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - */ - FAAS_TIME: 'faas.time', - /** - * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - */ - FAAS_CRON: 'faas.cron', - /** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). - */ - FAAS_COLDSTART: 'faas.coldstart', - /** - * The name of the invoked function. - * - * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. - */ - FAAS_INVOKED_NAME: 'faas.invoked_name', - /** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - */ - FAAS_INVOKED_PROVIDER: 'faas.invoked_provider', - /** - * The cloud region of the invoked function. - * - * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. - */ - FAAS_INVOKED_REGION: 'faas.invoked_region', - /** - * Transport protocol used. See note below. - */ - NET_TRANSPORT: 'net.transport', - /** - * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). - */ - NET_PEER_IP: 'net.peer.ip', - /** - * Remote port number. - */ - NET_PEER_PORT: 'net.peer.port', - /** - * Remote hostname or similar, see note below. - */ - NET_PEER_NAME: 'net.peer.name', - /** - * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. - */ - NET_HOST_IP: 'net.host.ip', - /** - * Like `net.peer.port` but for the host port. - */ - NET_HOST_PORT: 'net.host.port', - /** - * Local hostname or similar, see note below. - */ - NET_HOST_NAME: 'net.host.name', - /** - * The internet connection type currently being used by the host. - */ - NET_HOST_CONNECTION_TYPE: 'net.host.connection.type', - /** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - */ - NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype', - /** - * The name of the mobile carrier. - */ - NET_HOST_CARRIER_NAME: 'net.host.carrier.name', - /** - * The mobile carrier country code. - */ - NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc', - /** - * The mobile carrier network code. - */ - NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc', - /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - */ - NET_HOST_CARRIER_ICC: 'net.host.carrier.icc', - /** - * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. - */ - PEER_SERVICE: 'peer.service', - /** - * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. - */ - ENDUSER_ID: 'enduser.id', - /** - * Actual/assumed role the client is making the request under extracted from token or application security context. - */ - ENDUSER_ROLE: 'enduser.role', - /** - * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - */ - ENDUSER_SCOPE: 'enduser.scope', - /** - * Current "managed" thread ID (as opposed to OS thread ID). - */ - THREAD_ID: 'thread.id', - /** - * Current thread name. - */ - THREAD_NAME: 'thread.name', - /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - */ - CODE_FUNCTION: 'code.function', - /** - * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. - */ - CODE_NAMESPACE: 'code.namespace', - /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). - */ - CODE_FILEPATH: 'code.filepath', - /** - * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. - */ - CODE_LINENO: 'code.lineno', - /** - * HTTP request method. - */ - HTTP_METHOD: 'http.method', - /** - * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. - * - * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. - */ - HTTP_URL: 'http.url', - /** - * The full request target as passed in a HTTP request line or equivalent. - */ - HTTP_TARGET: 'http.target', - /** - * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. - * - * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. - */ - HTTP_HOST: 'http.host', - /** - * The URI scheme identifying the used protocol. - */ - HTTP_SCHEME: 'http.scheme', - /** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - */ - HTTP_STATUS_CODE: 'http.status_code', - /** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - */ - HTTP_FLAVOR: 'http.flavor', - /** - * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. - */ - HTTP_USER_AGENT: 'http.user_agent', - /** - * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - */ - HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length', - /** - * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. - */ - HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed', - /** - * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - */ - HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length', - /** - * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. - */ - HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed', - /** - * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). - * - * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. - */ - HTTP_SERVER_NAME: 'http.server_name', - /** - * The matched route (path template). - */ - HTTP_ROUTE: 'http.route', - /** - * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). - * - * Note: This is not necessarily the same as `net.peer.ip`, which would - identify the network-level peer, which may be a proxy. - - This attribute should be set when a source of information different - from the one used for `net.peer.ip`, is available even if that other - source just confirms the same value as `net.peer.ip`. - Rationale: For `net.peer.ip`, one typically does not know if it - comes from a proxy, reverse proxy, or the actual client. Setting - `http.client_ip` when it's the same as `net.peer.ip` means that - one is at least somewhat confident that the address is not that of - the closest proxy. - */ - HTTP_CLIENT_IP: 'http.client_ip', - /** - * The keys in the `RequestItems` object field. - */ - AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names', - /** - * The JSON-serialized value of each item in the `ConsumedCapacity` response field. - */ - AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity', - /** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. - */ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics', - /** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - */ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity', - /** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - */ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity', - /** - * The value of the `ConsistentRead` request parameter. - */ - AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read', - /** - * The value of the `ProjectionExpression` request parameter. - */ - AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection', - /** - * The value of the `Limit` request parameter. - */ - AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit', - /** - * The value of the `AttributesToGet` request parameter. - */ - AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get', - /** - * The value of the `IndexName` request parameter. - */ - AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name', - /** - * The value of the `Select` request parameter. - */ - AWS_DYNAMODB_SELECT: 'aws.dynamodb.select', - /** - * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. - */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes', - /** - * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. - */ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes', - /** - * The value of the `ExclusiveStartTableName` request parameter. - */ - AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table', - /** - * The the number of items in the `TableNames` response parameter. - */ - AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count', - /** - * The value of the `ScanIndexForward` request parameter. - */ - AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward', - /** - * The value of the `Segment` request parameter. - */ - AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment', - /** - * The value of the `TotalSegments` request parameter. - */ - AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments', - /** - * The value of the `Count` response parameter. - */ - AWS_DYNAMODB_COUNT: 'aws.dynamodb.count', - /** - * The value of the `ScannedCount` response parameter. - */ - AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count', - /** - * The JSON-serialized value of each item in the `AttributeDefinitions` request field. - */ - AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions', - /** - * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. - */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates', - /** - * A string identifying the messaging system. - */ - MESSAGING_SYSTEM: 'messaging.system', - /** - * The message destination name. This might be equal to the span name but is required nevertheless. - */ - MESSAGING_DESTINATION: 'messaging.destination', - /** - * The kind of message destination. - */ - MESSAGING_DESTINATION_KIND: 'messaging.destination_kind', - /** - * A boolean that is true if the message destination is temporary. - */ - MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination', - /** - * The name of the transport protocol. - */ - MESSAGING_PROTOCOL: 'messaging.protocol', - /** - * The version of the transport protocol. - */ - MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version', - /** - * Connection string. - */ - MESSAGING_URL: 'messaging.url', - /** - * A value used by the messaging system as an identifier for the message, represented as a string. - */ - MESSAGING_MESSAGE_ID: 'messaging.message_id', - /** - * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - */ - MESSAGING_CONVERSATION_ID: 'messaging.conversation_id', - /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. - */ - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes', - /** - * The compressed size of the message payload in bytes. - */ - MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes', - /** - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - */ - MESSAGING_OPERATION: 'messaging.operation', - /** - * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. - */ - MESSAGING_CONSUMER_ID: 'messaging.consumer_id', - /** - * RabbitMQ message routing key. - */ - MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.routing_key', - /** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. - * - * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. - */ - MESSAGING_KAFKA_MESSAGE_KEY: 'messaging.kafka.message_key', - /** - * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. - */ - MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group', - /** - * Client Id for the Consumer or Producer that is handling the message. - */ - MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id', - /** - * Partition the message is sent to. - */ - MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition', - /** - * A boolean that is true if the message is a tombstone. - */ - MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone', - /** - * A string identifying the remoting system. - */ - RPC_SYSTEM: 'rpc.system', - /** - * The full (logical) name of the service being called, including its package name, if applicable. - * - * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - */ - RPC_SERVICE: 'rpc.service', - /** - * The name of the (logical) method being called, must be equal to the $method part in the span name. - * - * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). - */ - RPC_METHOD: 'rpc.method', - /** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - */ - RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code', - /** - * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. - */ - RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version', - /** - * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. - */ - RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id', - /** - * `error.code` property of response if it is an error response. - */ - RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code', - /** - * `error.message` property of response if it is an error response. - */ - RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message', - /** - * Whether this is a received or sent message. - */ - MESSAGE_TYPE: 'message.type', - /** - * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. - * - * Note: This way we guarantee that the values will be consistent between different implementations. - */ - MESSAGE_ID: 'message.id', - /** - * Compressed size of the message in bytes. - */ - MESSAGE_COMPRESSED_SIZE: 'message.compressed_size', - /** - * Uncompressed size of the message in bytes. - */ - MESSAGE_UNCOMPRESSED_SIZE: 'message.uncompressed_size', -}; -exports.DbSystemValues = { - /** Some other SQL database. Fallback only. See notes. */ - OTHER_SQL: 'other_sql', - /** Microsoft SQL Server. */ - MSSQL: 'mssql', - /** MySQL. */ - MYSQL: 'mysql', - /** Oracle Database. */ - ORACLE: 'oracle', - /** IBM Db2. */ - DB2: 'db2', - /** PostgreSQL. */ - POSTGRESQL: 'postgresql', - /** Amazon Redshift. */ - REDSHIFT: 'redshift', - /** Apache Hive. */ - HIVE: 'hive', - /** Cloudscape. */ - CLOUDSCAPE: 'cloudscape', - /** HyperSQL DataBase. */ - HSQLDB: 'hsqldb', - /** Progress Database. */ - PROGRESS: 'progress', - /** SAP MaxDB. */ - MAXDB: 'maxdb', - /** SAP HANA. */ - HANADB: 'hanadb', - /** Ingres. */ - INGRES: 'ingres', - /** FirstSQL. */ - FIRSTSQL: 'firstsql', - /** EnterpriseDB. */ - EDB: 'edb', - /** InterSystems Caché. */ - CACHE: 'cache', - /** Adabas (Adaptable Database System). */ - ADABAS: 'adabas', - /** Firebird. */ - FIREBIRD: 'firebird', - /** Apache Derby. */ - DERBY: 'derby', - /** FileMaker. */ - FILEMAKER: 'filemaker', - /** Informix. */ - INFORMIX: 'informix', - /** InstantDB. */ - INSTANTDB: 'instantdb', - /** InterBase. */ - INTERBASE: 'interbase', - /** MariaDB. */ - MARIADB: 'mariadb', - /** Netezza. */ - NETEZZA: 'netezza', - /** Pervasive PSQL. */ - PERVASIVE: 'pervasive', - /** PointBase. */ - POINTBASE: 'pointbase', - /** SQLite. */ - SQLITE: 'sqlite', - /** Sybase. */ - SYBASE: 'sybase', - /** Teradata. */ - TERADATA: 'teradata', - /** Vertica. */ - VERTICA: 'vertica', - /** H2. */ - H2: 'h2', - /** ColdFusion IMQ. */ - COLDFUSION: 'coldfusion', - /** Apache Cassandra. */ - CASSANDRA: 'cassandra', - /** Apache HBase. */ - HBASE: 'hbase', - /** MongoDB. */ - MONGODB: 'mongodb', - /** Redis. */ - REDIS: 'redis', - /** Couchbase. */ - COUCHBASE: 'couchbase', - /** CouchDB. */ - COUCHDB: 'couchdb', - /** Microsoft Azure Cosmos DB. */ - COSMOSDB: 'cosmosdb', - /** Amazon DynamoDB. */ - DYNAMODB: 'dynamodb', - /** Neo4j. */ - NEO4J: 'neo4j', - /** Apache Geode. */ - GEODE: 'geode', - /** Elasticsearch. */ - ELASTICSEARCH: 'elasticsearch', - /** Memcached. */ - MEMCACHED: 'memcached', - /** CockroachDB. */ - COCKROACHDB: 'cockroachdb', -}; -exports.DbCassandraConsistencyLevelValues = { - /** all. */ - ALL: 'all', - /** each_quorum. */ - EACH_QUORUM: 'each_quorum', - /** quorum. */ - QUORUM: 'quorum', - /** local_quorum. */ - LOCAL_QUORUM: 'local_quorum', - /** one. */ - ONE: 'one', - /** two. */ - TWO: 'two', - /** three. */ - THREE: 'three', - /** local_one. */ - LOCAL_ONE: 'local_one', - /** any. */ - ANY: 'any', - /** serial. */ - SERIAL: 'serial', - /** local_serial. */ - LOCAL_SERIAL: 'local_serial', -}; -exports.FaasTriggerValues = { - /** A response to some data source operation such as a database or filesystem read/write. */ - DATASOURCE: 'datasource', - /** To provide an answer to an inbound HTTP request. */ - HTTP: 'http', - /** A function is set to be executed when messages are sent to a messaging system. */ - PUBSUB: 'pubsub', - /** A function is scheduled to be executed regularly. */ - TIMER: 'timer', - /** If none of the others apply. */ - OTHER: 'other', -}; -exports.FaasDocumentOperationValues = { - /** When a new object is created. */ - INSERT: 'insert', - /** When an object is modified. */ - EDIT: 'edit', - /** When an object is deleted. */ - DELETE: 'delete', -}; -exports.FaasInvokedProviderValues = { - /** Alibaba Cloud. */ - ALIBABA_CLOUD: 'alibaba_cloud', - /** Amazon Web Services. */ - AWS: 'aws', - /** Microsoft Azure. */ - AZURE: 'azure', - /** Google Cloud Platform. */ - GCP: 'gcp', -}; -exports.NetTransportValues = { - /** ip_tcp. */ - IP_TCP: 'ip_tcp', - /** ip_udp. */ - IP_UDP: 'ip_udp', - /** Another IP-based protocol. */ - IP: 'ip', - /** Unix Domain socket. See below. */ - UNIX: 'unix', - /** Named or anonymous pipe. See note below. */ - PIPE: 'pipe', - /** In-process communication. */ - INPROC: 'inproc', - /** Something else (non IP-based). */ - OTHER: 'other', -}; -exports.NetHostConnectionTypeValues = { - /** wifi. */ - WIFI: 'wifi', - /** wired. */ - WIRED: 'wired', - /** cell. */ - CELL: 'cell', - /** unavailable. */ - UNAVAILABLE: 'unavailable', - /** unknown. */ - UNKNOWN: 'unknown', -}; -exports.NetHostConnectionSubtypeValues = { - /** GPRS. */ - GPRS: 'gprs', - /** EDGE. */ - EDGE: 'edge', - /** UMTS. */ - UMTS: 'umts', - /** CDMA. */ - CDMA: 'cdma', - /** EVDO Rel. 0. */ - EVDO_0: 'evdo_0', - /** EVDO Rev. A. */ - EVDO_A: 'evdo_a', - /** CDMA2000 1XRTT. */ - CDMA2000_1XRTT: 'cdma2000_1xrtt', - /** HSDPA. */ - HSDPA: 'hsdpa', - /** HSUPA. */ - HSUPA: 'hsupa', - /** HSPA. */ - HSPA: 'hspa', - /** IDEN. */ - IDEN: 'iden', - /** EVDO Rev. B. */ - EVDO_B: 'evdo_b', - /** LTE. */ - LTE: 'lte', - /** EHRPD. */ - EHRPD: 'ehrpd', - /** HSPAP. */ - HSPAP: 'hspap', - /** GSM. */ - GSM: 'gsm', - /** TD-SCDMA. */ - TD_SCDMA: 'td_scdma', - /** IWLAN. */ - IWLAN: 'iwlan', - /** 5G NR (New Radio). */ - NR: 'nr', - /** 5G NRNSA (New Radio Non-Standalone). */ - NRNSA: 'nrnsa', - /** LTE CA. */ - LTE_CA: 'lte_ca', -}; -exports.HttpFlavorValues = { - /** HTTP 1.0. */ - HTTP_1_0: '1.0', - /** HTTP 1.1. */ - HTTP_1_1: '1.1', - /** HTTP 2. */ - HTTP_2_0: '2.0', - /** SPDY protocol. */ - SPDY: 'SPDY', - /** QUIC protocol. */ - QUIC: 'QUIC', -}; -exports.MessagingDestinationKindValues = { - /** A message sent to a queue. */ - QUEUE: 'queue', - /** A message sent to a topic. */ - TOPIC: 'topic', -}; -exports.MessagingOperationValues = { - /** receive. */ - RECEIVE: 'receive', - /** process. */ - PROCESS: 'process', -}; -exports.RpcGrpcStatusCodeValues = { - /** OK. */ - OK: 0, - /** CANCELLED. */ - CANCELLED: 1, - /** UNKNOWN. */ - UNKNOWN: 2, - /** INVALID_ARGUMENT. */ - INVALID_ARGUMENT: 3, - /** DEADLINE_EXCEEDED. */ - DEADLINE_EXCEEDED: 4, - /** NOT_FOUND. */ - NOT_FOUND: 5, - /** ALREADY_EXISTS. */ - ALREADY_EXISTS: 6, - /** PERMISSION_DENIED. */ - PERMISSION_DENIED: 7, - /** RESOURCE_EXHAUSTED. */ - RESOURCE_EXHAUSTED: 8, - /** FAILED_PRECONDITION. */ - FAILED_PRECONDITION: 9, - /** ABORTED. */ - ABORTED: 10, - /** OUT_OF_RANGE. */ - OUT_OF_RANGE: 11, - /** UNIMPLEMENTED. */ - UNIMPLEMENTED: 12, - /** INTERNAL. */ - INTERNAL: 13, - /** UNAVAILABLE. */ - UNAVAILABLE: 14, - /** DATA_LOSS. */ - DATA_LOSS: 15, - /** UNAUTHENTICATED. */ - UNAUTHENTICATED: 16, -}; -exports.MessageTypeValues = { - /** sent. */ - SENT: 'SENT', - /** received. */ - RECEIVED: 'RECEIVED', -}; -//# sourceMappingURL=SemanticAttributes.js.map - -/***/ }), - -/***/ 5836: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -__exportStar(__nccwpck_require__(9943), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 9417: -/***/ ((module) => { - -"use strict"; - -module.exports = balanced; -function balanced(a, b, str) { - if (a instanceof RegExp) a = maybeMatch(a, str); - if (b instanceof RegExp) b = maybeMatch(b, str); - - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -function maybeMatch(reg, str) { - var m = str.match(reg); - return m ? m[0] : null; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - if(a===b) { - return [ai, bi]; - } - begs = []; - left = str.length; - - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} - - -/***/ }), - -/***/ 3682: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var register = __nccwpck_require__(4670) -var addHook = __nccwpck_require__(5549) -var removeHook = __nccwpck_require__(6819) - -// bind with array of arguments: https://stackoverflow.com/a/21792913 -var bind = Function.bind -var bindable = bind.bind(bind) - -function bindApi (hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state]) - hook.api = { remove: removeHookRef } - hook.remove = removeHookRef - - ;['before', 'error', 'after', 'wrap'].forEach(function (kind) { - var args = name ? [state, kind, name] : [state, kind] - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args) - }) -} - -function HookSingular () { - var singularHookName = 'h' - var singularHookState = { - registry: {} - } - var singularHook = register.bind(null, singularHookState, singularHookName) - bindApi(singularHook, singularHookState, singularHookName) - return singularHook -} - -function HookCollection () { - var state = { - registry: {} - } - - var hook = register.bind(null, state) - bindApi(hook, state) - - return hook -} - -var collectionHookDeprecationMessageDisplayed = false -function Hook () { - if (!collectionHookDeprecationMessageDisplayed) { - console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4') - collectionHookDeprecationMessageDisplayed = true - } - return HookCollection() -} - -Hook.Singular = HookSingular.bind() -Hook.Collection = HookCollection.bind() - -module.exports = Hook -// expose constructors as a named property for TypeScript -module.exports.Hook = Hook -module.exports.Singular = Hook.Singular -module.exports.Collection = Hook.Collection - - -/***/ }), - -/***/ 5549: -/***/ ((module) => { - -module.exports = addHook; - -function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } - - if (kind === "before") { - hook = function (method, options) { - return Promise.resolve() - .then(orig.bind(null, options)) - .then(method.bind(null, options)); - }; - } - - if (kind === "after") { - hook = function (method, options) { - var result; - return Promise.resolve() - .then(method.bind(null, options)) - .then(function (result_) { - result = result_; - return orig(result, options); - }) - .then(function () { - return result; - }); - }; - } - - if (kind === "error") { - hook = function (method, options) { - return Promise.resolve() - .then(method.bind(null, options)) - .catch(function (error) { - return orig(error, options); - }); - }; - } - - state.registry[name].push({ - hook: hook, - orig: orig, - }); -} - - -/***/ }), - -/***/ 4670: -/***/ ((module) => { - -module.exports = register; - -function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); - } - - if (!options) { - options = {}; - } - - if (Array.isArray(name)) { - return name.reverse().reduce(function (callback, name) { - return register.bind(null, state, name, callback, options); - }, method)(); - } - - return Promise.resolve().then(function () { - if (!state.registry[name]) { - return method(options); - } - - return state.registry[name].reduce(function (method, registered) { - return registered.hook.bind(null, method, options); - }, method)(); - }); -} - - -/***/ }), - -/***/ 6819: -/***/ ((module) => { - -module.exports = removeHook; - -function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - - var index = state.registry[name] - .map(function (registered) { - return registered.orig; - }) - .indexOf(method); - - if (index === -1) { - return; - } - - state.registry[name].splice(index, 1); -} - - -/***/ }), - -/***/ 3717: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var concatMap = __nccwpck_require__(6891); -var balanced = __nccwpck_require__(9417); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - // I don't know why Bash 4.3 does this, but it does. - // Anything starting with {} will have the first two bytes preserved - // but *only* at the top level, so {},a}b will not expand to anything, - // but a{},b}c will be expanded to [a}c,abc]. - // One could argue that this is a bug in Bash, but since the goal of - // this module is to match Bash's rules, we escape a leading {} - if (str.substr(0, 2) === '{}') { - str = '\\{\\}' + str.substr(2); - } - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = m.body.indexOf(',') >= 0; - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - - - -/***/ }), - -/***/ 6891: -/***/ ((module) => { - -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - - -/***/ }), - -/***/ 8932: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -class Deprecation extends Error { - constructor(message) { - super(message); // Maintains proper stack trace (only available on V8) - - /* istanbul ignore next */ - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - - this.name = 'Deprecation'; - } - -} - -exports.Deprecation = Deprecation; - - -/***/ }), - -/***/ 6863: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = realpath -realpath.realpath = realpath -realpath.sync = realpathSync -realpath.realpathSync = realpathSync -realpath.monkeypatch = monkeypatch -realpath.unmonkeypatch = unmonkeypatch - -var fs = __nccwpck_require__(5747) -var origRealpath = fs.realpath -var origRealpathSync = fs.realpathSync - -var version = process.version -var ok = /^v[0-5]\./.test(version) -var old = __nccwpck_require__(1734) - -function newError (er) { - return er && er.syscall === 'realpath' && ( - er.code === 'ELOOP' || - er.code === 'ENOMEM' || - er.code === 'ENAMETOOLONG' - ) -} - -function realpath (p, cache, cb) { - if (ok) { - return origRealpath(p, cache, cb) - } - - if (typeof cache === 'function') { - cb = cache - cache = null - } - origRealpath(p, cache, function (er, result) { - if (newError(er)) { - old.realpath(p, cache, cb) - } else { - cb(er, result) - } - }) -} - -function realpathSync (p, cache) { - if (ok) { - return origRealpathSync(p, cache) - } - - try { - return origRealpathSync(p, cache) - } catch (er) { - if (newError(er)) { - return old.realpathSync(p, cache) - } else { - throw er - } - } -} - -function monkeypatch () { - fs.realpath = realpath - fs.realpathSync = realpathSync -} - -function unmonkeypatch () { - fs.realpath = origRealpath - fs.realpathSync = origRealpathSync -} - - -/***/ }), - -/***/ 1734: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -// 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 pathModule = __nccwpck_require__(5622); -var isWindows = process.platform === 'win32'; -var fs = __nccwpck_require__(5747); - -// JavaScript implementation of realpath, ported from node pre-v6 - -var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG); - -function rethrow() { - // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and - // is fairly slow to generate. - var callback; - if (DEBUG) { - var backtrace = new Error; - callback = debugCallback; - } else - callback = missingCallback; - - return callback; - - function debugCallback(err) { - if (err) { - backtrace.message = err.message; - err = backtrace; - missingCallback(err); - } - } - - function missingCallback(err) { - if (err) { - if (process.throwDeprecation) - throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs - else if (!process.noDeprecation) { - var msg = 'fs: missing callback ' + (err.stack || err.message); - if (process.traceDeprecation) - console.trace(msg); - else - console.error(msg); - } - } - } -} - -function maybeCallback(cb) { - return typeof cb === 'function' ? cb : rethrow(); -} - -var normalize = pathModule.normalize; - -// Regexp that finds the next partion of a (partial) path -// result is [base_with_slash, base], e.g. ['somedir/', 'somedir'] -if (isWindows) { - var nextPartRe = /(.*?)(?:[\/\\]+|$)/g; -} else { - var nextPartRe = /(.*?)(?:[\/]+|$)/g; -} - -// Regex to find the device root, including trailing slash. E.g. 'c:\\'. -if (isWindows) { - var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/; -} else { - var splitRootRe = /^[\/]*/; -} - -exports.realpathSync = function realpathSync(p, cache) { - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return cache[p]; - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstatSync(base); - knownHard[base] = true; - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - // NB: p.length changes. - while (pos < p.length) { - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - continue; - } - - var resolvedLink; - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // some known symbolic link. no need to stat again. - resolvedLink = cache[base]; - } else { - var stat = fs.lstatSync(base); - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - continue; - } - - // read the link if it wasn't read before - // dev/ino always return 0 on windows, so skip the check. - var linkTarget = null; - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - linkTarget = seenLinks[id]; - } - } - if (linkTarget === null) { - fs.statSync(base); - linkTarget = fs.readlinkSync(base); - } - resolvedLink = pathModule.resolve(previous, linkTarget); - // track this, if given a cache. - if (cache) cache[base] = resolvedLink; - if (!isWindows) seenLinks[id] = linkTarget; - } - - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } - - if (cache) cache[original] = p; - - return p; -}; - - -exports.realpath = function realpath(p, cache, cb) { - if (typeof cb !== 'function') { - cb = maybeCallback(cache); - cache = null; - } - - // make p is absolute - p = pathModule.resolve(p); - - if (cache && Object.prototype.hasOwnProperty.call(cache, p)) { - return process.nextTick(cb.bind(null, null, cache[p])); - } - - var original = p, - seenLinks = {}, - knownHard = {}; - - // current character position in p - var pos; - // the partial path so far, including a trailing slash if any - var current; - // the partial path without a trailing slash (except when pointing at a root) - var base; - // the partial path scanned in the previous round, with slash - var previous; - - start(); - - function start() { - // Skip over roots - var m = splitRootRe.exec(p); - pos = m[0].length; - current = m[0]; - base = m[0]; - previous = ''; - - // On windows, check that the root exists. On unix there is no need. - if (isWindows && !knownHard[base]) { - fs.lstat(base, function(err) { - if (err) return cb(err); - knownHard[base] = true; - LOOP(); - }); - } else { - process.nextTick(LOOP); - } - } - - // walk down the path, swapping out linked pathparts for their real - // values - function LOOP() { - // stop if scanned past end of path - if (pos >= p.length) { - if (cache) cache[original] = p; - return cb(null, p); - } - - // find the next part - nextPartRe.lastIndex = pos; - var result = nextPartRe.exec(p); - previous = current; - current += result[0]; - base = previous + result[1]; - pos = nextPartRe.lastIndex; - - // continue if not a symlink - if (knownHard[base] || (cache && cache[base] === base)) { - return process.nextTick(LOOP); - } - - if (cache && Object.prototype.hasOwnProperty.call(cache, base)) { - // known symbolic link. no need to stat again. - return gotResolvedLink(cache[base]); - } - - return fs.lstat(base, gotStat); - } - - function gotStat(err, stat) { - if (err) return cb(err); - - // if not a symlink, skip to the next path part - if (!stat.isSymbolicLink()) { - knownHard[base] = true; - if (cache) cache[base] = base; - return process.nextTick(LOOP); - } - - // stat & read the link if not read before - // call gotTarget as soon as the link target is known - // dev/ino always return 0 on windows, so skip the check. - if (!isWindows) { - var id = stat.dev.toString(32) + ':' + stat.ino.toString(32); - if (seenLinks.hasOwnProperty(id)) { - return gotTarget(null, seenLinks[id], base); - } - } - fs.stat(base, function(err) { - if (err) return cb(err); - - fs.readlink(base, function(err, target) { - if (!isWindows) seenLinks[id] = target; - gotTarget(err, target); - }); - }); - } - - function gotTarget(err, target, base) { - if (err) return cb(err); - - var resolvedLink = pathModule.resolve(previous, target); - if (cache) cache[base] = resolvedLink; - gotResolvedLink(resolvedLink); - } - - function gotResolvedLink(resolvedLink) { - // resolve the link, then start over - p = pathModule.resolve(resolvedLink, p.slice(pos)); - start(); - } -}; - - -/***/ }), - -/***/ 7625: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var fs = __nccwpck_require__(5747) -var path = __nccwpck_require__(5622) -var minimatch = __nccwpck_require__(3973) -var isAbsolute = __nccwpck_require__(8714) -var Minimatch = minimatch.Minimatch - -function alphasort (a, b) { - return a.localeCompare(b, 'en') -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -// ignore patterns are always in dot:true mode. -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { dot: true }) - } - - return { - matcher: new Minimatch(pattern, { dot: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.silent = !!options.silent - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - self.absolute = !!options.absolute - self.fs = options.fs || fs - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = path.resolve(options.cwd) - self.changedCwd = self.cwd !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - // TODO: is an absolute `cwd` supposed to be resolved against `root`? - // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test') - self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd) - if (process.platform === "win32") - self.cwdAbs = self.cwdAbs.replace(/\\/g, "/") - self.nomount = !!options.nomount - - // disable comments and negation in Minimatch. - // Note that they are not supported in Glob itself anyway. - options.nonegate = true - options.nocomment = true - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - var notDir = !(/\/$/.test(e)) - var c = self.cache[e] || self.cache[makeAbs(self, e)] - if (notDir && c) - notDir = c !== 'DIR' && !Array.isArray(c) - return notDir - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (isAbsolute(f) || f === '') { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else { - abs = path.resolve(f) - } - - if (process.platform === 'win32') - abs = abs.replace(/\\/g, '/') - - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - - -/***/ }), - -/***/ 1957: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var rp = __nccwpck_require__(6863) -var minimatch = __nccwpck_require__(3973) -var Minimatch = minimatch.Minimatch -var inherits = __nccwpck_require__(4124) -var EE = __nccwpck_require__(8614).EventEmitter -var path = __nccwpck_require__(5622) -var assert = __nccwpck_require__(2357) -var isAbsolute = __nccwpck_require__(8714) -var globSync = __nccwpck_require__(9010) -var common = __nccwpck_require__(7625) -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = __nccwpck_require__(2492) -var util = __nccwpck_require__(1669) -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -var once = __nccwpck_require__(1223) - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -function extend (origin, add) { - if (add === null || typeof add !== 'object') { - return origin - } - - var keys = Object.keys(add) - var i = keys.length - while (i--) { - origin[keys[i]] = add[keys[i]] - } - return origin -} - -glob.hasMagic = function (pattern, options_) { - var options = extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - - if (!pattern) - return false - - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - this._processing = 0 - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - var sync = true - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - sync = false - - function done () { - --self._processing - if (self._processing <= 0) { - if (sync) { - process.nextTick(function () { - self._finish() - }) - } else { - self._finish() - } - } - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - rp.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (isIgnored(this, e)) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = isAbsolute(e) ? e : this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) - e = abs - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - self.fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er && er.code === 'ENOENT') - return cb() - - var isSym = lstat && lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - self.fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - this.emit('error', error) - this.abort() - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) { - this.emit('error', er) - // If the error is handled, then we abort - // if not, we threw out of here - this.abort() - } - if (!this.silent) - console.error('glob error', er) - break - } - - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - self.fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return self.fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) - return cb(null, false, stat) - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return cb() - - return cb(null, c, stat) -} - - -/***/ }), - -/***/ 9010: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = globSync -globSync.GlobSync = GlobSync - -var rp = __nccwpck_require__(6863) -var minimatch = __nccwpck_require__(3973) -var Minimatch = minimatch.Minimatch -var Glob = __nccwpck_require__(1957).Glob -var util = __nccwpck_require__(1669) -var path = __nccwpck_require__(5622) -var assert = __nccwpck_require__(2357) -var isAbsolute = __nccwpck_require__(8714) -var common = __nccwpck_require__(7625) -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored -var isIgnored = common.isIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = rp.realpathSync(p, self.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - if (isIgnored(this, e)) - return - - var abs = this._makeAbs(e) - - if (this.mark) - e = this._mark(e) - - if (this.absolute) { - e = abs - } - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er.code === 'ENOENT') { - // lstat failed, doesn't exist - return null - } - } - - var isSym = lstat && lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && lstat && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, this.fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 - case 'ENOTDIR': // totally normal. means it *does* exist. - var abs = this._makeAbs(f) - this.cache[abs] = 'FILE' - if (abs === this.cwdAbs) { - var error = new Error(er.code + ' invalid cwd ' + this.cwd) - error.path = this.cwd - error.code = er.code - throw error - } - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) - throw er - if (!this.silent) - console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = this.fs.lstatSync(abs) - } catch (er) { - if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { - this.statCache[abs] = false - return false - } - } - - if (lstat && lstat.isSymbolicLink()) { - try { - stat = this.fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = true - if (stat) - c = stat.isDirectory() ? 'DIR' : 'FILE' - - this.cache[abs] = this.cache[abs] || c - - if (needDir && c === 'FILE') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - - -/***/ }), - -/***/ 2492: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var wrappy = __nccwpck_require__(2940) -var reqs = Object.create(null) -var once = __nccwpck_require__(1223) - -module.exports = wrappy(inflight) - -function inflight (key, cb) { - if (reqs[key]) { - reqs[key].push(cb) - return null - } else { - reqs[key] = [cb] - return makeres(key) - } -} - -function makeres (key) { - return once(function RES () { - var cbs = reqs[key] - var len = cbs.length - var args = slice(arguments) - - // XXX It's somewhat ambiguous whether a new callback added in this - // pass should be queued for later execution if something in the - // list of callbacks throws, or if it should just be discarded. - // However, it's such an edge case that it hardly matters, and either - // choice is likely as surprising as the other. - // As it happens, we do go ahead and schedule it for later execution. - try { - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - } finally { - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] - } - } - }) -} - -function slice (args) { - var length = args.length - var array = [] - - for (var i = 0; i < length; i++) array[i] = args[i] - return array -} - - -/***/ }), - -/***/ 4124: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -try { - var util = __nccwpck_require__(1669); - /* istanbul ignore next */ - if (typeof util.inherits !== 'function') throw ''; - module.exports = util.inherits; -} catch (e) { - /* istanbul ignore next */ - module.exports = __nccwpck_require__(8544); -} - - -/***/ }), - -/***/ 8544: -/***/ ((module) => { - -if (typeof Object.create === 'function') { - // implementation from standard node.js 'util' module - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - ctor.prototype = Object.create(superCtor.prototype, { - constructor: { - value: ctor, - enumerable: false, - writable: true, - configurable: true - } - }) - } - }; -} else { - // old school shim for old browsers - module.exports = function inherits(ctor, superCtor) { - if (superCtor) { - ctor.super_ = superCtor - var TempCtor = function () {} - TempCtor.prototype = superCtor.prototype - ctor.prototype = new TempCtor() - ctor.prototype.constructor = ctor - } - } -} - - -/***/ }), - -/***/ 3287: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -/*! - * is-plain-object - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -function isObject(o) { - return Object.prototype.toString.call(o) === '[object Object]'; -} - -function isPlainObject(o) { - var ctor,prot; - - if (isObject(o) === false) return false; - - // If has modified constructor - ctor = o.constructor; - if (ctor === undefined) return true; - - // If has modified prototype - prot = ctor.prototype; - if (isObject(prot) === false) return false; - - // If constructor does not have an Object-specific method - if (prot.hasOwnProperty('isPrototypeOf') === false) { - return false; - } - - // Most likely a plain Object - return true; -} - -exports.isPlainObject = isPlainObject; - - -/***/ }), - -/***/ 8027: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parse = void 0; -const xml2js_1 = __importDefault(__nccwpck_require__(6189)); -const parse = async (xmlString, xml2jsOptions) => { - const options = xml2jsOptions !== null && xml2jsOptions !== void 0 ? xml2jsOptions : { - attrValueProcessors: [xml2js_1.default.processors.parseNumbers] - }; - const result = await xml2js_1.default.parseStringPromise(xmlString, options); - if (result['testsuites']) { - return _parse(result['testsuites']); - } - else { - return _parse(result['testsuite']); - } -}; -exports.parse = parse; -const _parse = (objOrArray) => { - if (Array.isArray(objOrArray)) { - return objOrArray.map((_obj) => { - // 中身がさらにネストされた配列 or $キーのobjectなら再起 - if (Array.isArray(_obj) || typeof (_obj) === 'object') { - return _parse(_obj); - } - // 配列の中身が単なる文字列ならinnerキーを自分で付けてobjectで返す - return { inner: _obj }; - }); - } - let output = {}; - Object.keys(objOrArray).forEach((key) => { - const nested = objOrArray[key]; - if (key === '$') { - output = { ...output, ..._parse(nested) }; - } - else if (key === 'system-out' || key === 'system-err') { - output[key] = nested.map((inner) => inner); - } - else if (typeof (nested) === 'object') { - output[key] = _parse(nested); - } - else if (key === '_') { - output['inner'] = nested; - } - else { - output[key] = nested; - } - }); - return output; -}; -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 3973: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = __nccwpck_require__(5622) -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __nccwpck_require__(3717) - -var plTypes = { - '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, - '?': { open: '(?:', close: ')?' }, - '+': { open: '(?:', close: ')+' }, - '*': { open: '(?:', close: ')*' }, - '@': { open: '(?:', close: ')' } -} - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new TypeError('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - if (pattern.length > 1024 * 64) { - throw new TypeError('pattern is too long') - } - - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - patternListStack.push({ - type: stateChar, - start: i - 1, - reStart: re.length, - open: plTypes[stateChar].open, - close: plTypes[stateChar].close - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - var pl = patternListStack.pop() - // negation is (?:(?!js)[^/]*) - // The others are (?:) - re += pl.close - if (pl.type === '!') { - negativeLists.push(pl) - } - pl.reEnd = re.length - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + pl.open.length) - this.debug('setting tail', re, pl) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail, pl, re) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - try { - var regExp = new RegExp('^' + re + '$', flags) - } catch (er) { - // If it was an invalid regular expression, then it can't match - // anything. This trick looks for a character after the end of - // the string, which is of course impossible, except in multi-line - // mode, but it's not a /m regex. - return new RegExp('$.') - } - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - - -/***/ }), - -/***/ 467: -/***/ ((module, exports, __nccwpck_require__) => { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", ({ value: true })); - -function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } - -var Stream = _interopDefault(__nccwpck_require__(2413)); -var http = _interopDefault(__nccwpck_require__(8605)); -var Url = _interopDefault(__nccwpck_require__(8835)); -var whatwgUrl = _interopDefault(__nccwpck_require__(3323)); -var https = _interopDefault(__nccwpck_require__(7211)); -var zlib = _interopDefault(__nccwpck_require__(8761)); - -// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js - -// fix for "Readable" isn't a named export issue -const Readable = Stream.Readable; - -const BUFFER = Symbol('buffer'); -const TYPE = Symbol('type'); - -class Blob { - constructor() { - this[TYPE] = ''; - - const blobParts = arguments[0]; - const options = arguments[1]; - - const buffers = []; - let size = 0; - - if (blobParts) { - const a = blobParts; - const length = Number(a.length); - for (let i = 0; i < length; i++) { - const element = a[i]; - let buffer; - if (element instanceof Buffer) { - buffer = element; - } else if (ArrayBuffer.isView(element)) { - buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); - } else if (element instanceof ArrayBuffer) { - buffer = Buffer.from(element); - } else if (element instanceof Blob) { - buffer = element[BUFFER]; - } else { - buffer = Buffer.from(typeof element === 'string' ? element : String(element)); - } - size += buffer.length; - buffers.push(buffer); - } - } - - this[BUFFER] = Buffer.concat(buffers); - - let type = options && options.type !== undefined && String(options.type).toLowerCase(); - if (type && !/[^\u0020-\u007E]/.test(type)) { - this[TYPE] = type; - } - } - get size() { - return this[BUFFER].length; - } - get type() { - return this[TYPE]; - } - text() { - return Promise.resolve(this[BUFFER].toString()); - } - arrayBuffer() { - const buf = this[BUFFER]; - const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - return Promise.resolve(ab); - } - stream() { - const readable = new Readable(); - readable._read = function () {}; - readable.push(this[BUFFER]); - readable.push(null); - return readable; - } - toString() { - return '[object Blob]'; - } - slice() { - const size = this.size; - - const start = arguments[0]; - const end = arguments[1]; - let relativeStart, relativeEnd; - if (start === undefined) { - relativeStart = 0; - } else if (start < 0) { - relativeStart = Math.max(size + start, 0); - } else { - relativeStart = Math.min(start, size); - } - if (end === undefined) { - relativeEnd = size; - } else if (end < 0) { - relativeEnd = Math.max(size + end, 0); - } else { - relativeEnd = Math.min(end, size); - } - const span = Math.max(relativeEnd - relativeStart, 0); - - const buffer = this[BUFFER]; - const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); - const blob = new Blob([], { type: arguments[2] }); - blob[BUFFER] = slicedBuffer; - return blob; - } -} - -Object.defineProperties(Blob.prototype, { - size: { enumerable: true }, - type: { enumerable: true }, - slice: { enumerable: true } -}); - -Object.defineProperty(Blob.prototype, Symbol.toStringTag, { - value: 'Blob', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * fetch-error.js - * - * FetchError interface for operational errors - */ - -/** - * Create FetchError instance - * - * @param String message Error message for human - * @param String type Error type for machine - * @param String systemError For Node.js system error - * @return FetchError - */ -function FetchError(message, type, systemError) { - Error.call(this, message); - - this.message = message; - this.type = type; - - // when err.type is `system`, err.code contains system error code - if (systemError) { - this.code = this.errno = systemError.code; - } - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -FetchError.prototype = Object.create(Error.prototype); -FetchError.prototype.constructor = FetchError; -FetchError.prototype.name = 'FetchError'; - -let convert; -try { - convert = __nccwpck_require__(2877).convert; -} catch (e) {} - -const INTERNALS = Symbol('Body internals'); - -// fix an issue where "PassThrough" isn't a named export for node <10 -const PassThrough = Stream.PassThrough; - -/** - * Body mixin - * - * Ref: https://fetch.spec.whatwg.org/#body - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -function Body(body) { - var _this = this; - - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - _ref$size = _ref.size; - - let size = _ref$size === undefined ? 0 : _ref$size; - var _ref$timeout = _ref.timeout; - let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; - - if (body == null) { - // body is undefined or null - body = null; - } else if (isURLSearchParams(body)) { - // body is a URLSearchParams - body = Buffer.from(body.toString()); - } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { - // body is ArrayBuffer - body = Buffer.from(body); - } else if (ArrayBuffer.isView(body)) { - // body is ArrayBufferView - body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); - } else if (body instanceof Stream) ; else { - // none of the above - // coerce to string then buffer - body = Buffer.from(String(body)); - } - this[INTERNALS] = { - body, - disturbed: false, - error: null - }; - this.size = size; - this.timeout = timeout; - - if (body instanceof Stream) { - body.on('error', function (err) { - const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); - _this[INTERNALS].error = error; - }); - } -} - -Body.prototype = { - get body() { - return this[INTERNALS].body; - }, - - get bodyUsed() { - return this[INTERNALS].disturbed; - }, - - /** - * Decode response as ArrayBuffer - * - * @return Promise - */ - arrayBuffer() { - return consumeBody.call(this).then(function (buf) { - return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); - }); - }, - - /** - * Return raw response as Blob - * - * @return Promise - */ - blob() { - let ct = this.headers && this.headers.get('content-type') || ''; - return consumeBody.call(this).then(function (buf) { - return Object.assign( - // Prevent copying - new Blob([], { - type: ct.toLowerCase() - }), { - [BUFFER]: buf - }); - }); - }, - - /** - * Decode response as json - * - * @return Promise - */ - json() { - var _this2 = this; - - return consumeBody.call(this).then(function (buffer) { - try { - return JSON.parse(buffer.toString()); - } catch (err) { - return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); - } - }); - }, - - /** - * Decode response as text - * - * @return Promise - */ - text() { - return consumeBody.call(this).then(function (buffer) { - return buffer.toString(); - }); - }, - - /** - * Decode response as buffer (non-spec api) - * - * @return Promise - */ - buffer() { - return consumeBody.call(this); - }, - - /** - * Decode response as text, while automatically detecting the encoding and - * trying to decode to UTF-8 (non-spec api) - * - * @return Promise - */ - textConverted() { - var _this3 = this; - - return consumeBody.call(this).then(function (buffer) { - return convertBody(buffer, _this3.headers); - }); - } -}; - -// In browsers, all properties are enumerable. -Object.defineProperties(Body.prototype, { - body: { enumerable: true }, - bodyUsed: { enumerable: true }, - arrayBuffer: { enumerable: true }, - blob: { enumerable: true }, - json: { enumerable: true }, - text: { enumerable: true } -}); - -Body.mixIn = function (proto) { - for (const name of Object.getOwnPropertyNames(Body.prototype)) { - // istanbul ignore else: future proof - if (!(name in proto)) { - const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); - Object.defineProperty(proto, name, desc); - } - } -}; - -/** - * Consume and convert an entire Body to a Buffer. - * - * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body - * - * @return Promise - */ -function consumeBody() { - var _this4 = this; - - if (this[INTERNALS].disturbed) { - return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); - } - - this[INTERNALS].disturbed = true; - - if (this[INTERNALS].error) { - return Body.Promise.reject(this[INTERNALS].error); - } - - let body = this.body; - - // body is null - if (body === null) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is blob - if (isBlob(body)) { - body = body.stream(); - } - - // body is buffer - if (Buffer.isBuffer(body)) { - return Body.Promise.resolve(body); - } - - // istanbul ignore if: should never happen - if (!(body instanceof Stream)) { - return Body.Promise.resolve(Buffer.alloc(0)); - } - - // body is stream - // get ready to actually consume the body - let accum = []; - let accumBytes = 0; - let abort = false; - - return new Body.Promise(function (resolve, reject) { - let resTimeout; - - // allow timeout on slow response body - if (_this4.timeout) { - resTimeout = setTimeout(function () { - abort = true; - reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); - }, _this4.timeout); - } - - // handle stream errors - body.on('error', function (err) { - if (err.name === 'AbortError') { - // if the request was aborted, reject with this Error - abort = true; - reject(err); - } else { - // other errors, such as incorrect content-encoding - reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - - body.on('data', function (chunk) { - if (abort || chunk === null) { - return; - } - - if (_this4.size && accumBytes + chunk.length > _this4.size) { - abort = true; - reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); - return; - } - - accumBytes += chunk.length; - accum.push(chunk); - }); - - body.on('end', function () { - if (abort) { - return; - } - - clearTimeout(resTimeout); - - try { - resolve(Buffer.concat(accum, accumBytes)); - } catch (err) { - // handle streams that have accumulated too much data (issue #414) - reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); - } - }); - }); -} - -/** - * Detect buffer encoding and convert to target encoding - * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding - * - * @param Buffer buffer Incoming buffer - * @param String encoding Target encoding - * @return String - */ -function convertBody(buffer, headers) { - if (typeof convert !== 'function') { - throw new Error('The package `encoding` must be installed to use the textConverted() function'); - } - - const ct = headers.get('content-type'); - let charset = 'utf-8'; - let res, str; - - // header - if (ct) { - res = /charset=([^;]*)/i.exec(ct); - } - - // no charset in content type, peek at response body for at most 1024 bytes - str = buffer.slice(0, 1024).toString(); - - // html5 - if (!res && str) { - res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; - - this[MAP] = Object.create(null); - - if (init instanceof Headers) { - const rawHeaders = init.raw(); - const headerNames = Object.keys(rawHeaders); - - for (const headerName of headerNames) { - for (const value of rawHeaders[headerName]) { - this.append(headerName, value); - } - } - - return; - } - - // We don't worry about converting prop to ByteString here as append() - // will handle it. - if (init == null) ; else if (typeof init === 'object') { - const method = init[Symbol.iterator]; - if (method != null) { - if (typeof method !== 'function') { - throw new TypeError('Header pairs must be iterable'); - } - - // sequence> - // Note: per spec we have to first exhaust the lists then process them - const pairs = []; - for (const pair of init) { - if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { - throw new TypeError('Each header pair must be iterable'); - } - pairs.push(Array.from(pair)); - } - - for (const pair of pairs) { - if (pair.length !== 2) { - throw new TypeError('Each header pair must be a name/value tuple'); - } - this.append(pair[0], pair[1]); - } - } else { - // record - for (const key of Object.keys(init)) { - const value = init[key]; - this.append(key, value); - } - } - } else { - throw new TypeError('Provided initializer must be an object'); - } - } - - /** - * Return combined header value given name - * - * @param String name Header name - * @return Mixed - */ - get(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key === undefined) { - return null; - } - - return this[MAP][key].join(', '); - } - - /** - * Iterate over all headers - * - * @param Function callback Executed for each item with parameters (value, name, thisArg) - * @param Boolean thisArg `this` context for callback function - * @return Void - */ - forEach(callback) { - let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - - let pairs = getHeaders(this); - let i = 0; - while (i < pairs.length) { - var _pairs$i = pairs[i]; - const name = _pairs$i[0], - value = _pairs$i[1]; - - callback.call(thisArg, value, name, this); - pairs = getHeaders(this); - i++; - } - } - - /** - * Overwrite header values given name - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - set(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - this[MAP][key !== undefined ? key : name] = [value]; - } - - /** - * Append a value onto existing header - * - * @param String name Header name - * @param String value Header value - * @return Void - */ - append(name, value) { - name = `${name}`; - value = `${value}`; - validateName(name); - validateValue(value); - const key = find(this[MAP], name); - if (key !== undefined) { - this[MAP][key].push(value); - } else { - this[MAP][name] = [value]; - } - } - - /** - * Check for header name existence - * - * @param String name Header name - * @return Boolean - */ - has(name) { - name = `${name}`; - validateName(name); - return find(this[MAP], name) !== undefined; - } - - /** - * Delete all header values given name - * - * @param String name Header name - * @return Void - */ - delete(name) { - name = `${name}`; - validateName(name); - const key = find(this[MAP], name); - if (key !== undefined) { - delete this[MAP][key]; - } - } - - /** - * Return raw headers (non-spec api) - * - * @return Object - */ - raw() { - return this[MAP]; - } - - /** - * Get an iterator on keys. - * - * @return Iterator - */ - keys() { - return createHeadersIterator(this, 'key'); - } - - /** - * Get an iterator on values. - * - * @return Iterator - */ - values() { - return createHeadersIterator(this, 'value'); - } - - /** - * Get an iterator on entries. - * - * This is the default iterator of the Headers object. - * - * @return Iterator - */ - [Symbol.iterator]() { - return createHeadersIterator(this, 'key+value'); - } -} -Headers.prototype.entries = Headers.prototype[Symbol.iterator]; - -Object.defineProperty(Headers.prototype, Symbol.toStringTag, { - value: 'Headers', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Headers.prototype, { - get: { enumerable: true }, - forEach: { enumerable: true }, - set: { enumerable: true }, - append: { enumerable: true }, - has: { enumerable: true }, - delete: { enumerable: true }, - keys: { enumerable: true }, - values: { enumerable: true }, - entries: { enumerable: true } -}); - -function getHeaders(headers) { - let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; - - const keys = Object.keys(headers[MAP]).sort(); - return keys.map(kind === 'key' ? function (k) { - return k.toLowerCase(); - } : kind === 'value' ? function (k) { - return headers[MAP][k].join(', '); - } : function (k) { - return [k.toLowerCase(), headers[MAP][k].join(', ')]; - }); -} - -const INTERNAL = Symbol('internal'); - -function createHeadersIterator(target, kind) { - const iterator = Object.create(HeadersIteratorPrototype); - iterator[INTERNAL] = { - target, - kind, - index: 0 - }; - return iterator; -} - -const HeadersIteratorPrototype = Object.setPrototypeOf({ - next() { - // istanbul ignore if - if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { - throw new TypeError('Value of `this` is not a HeadersIterator'); - } - - var _INTERNAL = this[INTERNAL]; - const target = _INTERNAL.target, - kind = _INTERNAL.kind, - index = _INTERNAL.index; - - const values = getHeaders(target, kind); - const len = values.length; - if (index >= len) { - return { - value: undefined, - done: true - }; - } - - this[INTERNAL].index = index + 1; - - return { - value: values[index], - done: false - }; - } -}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); - -Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { - value: 'HeadersIterator', - writable: false, - enumerable: false, - configurable: true -}); - -/** - * Export the Headers object in a form that Node.js can consume. - * - * @param Headers headers - * @return Object - */ -function exportNodeCompatibleHeaders(headers) { - const obj = Object.assign({ __proto__: null }, headers[MAP]); - - // http.request() only supports string as Host header. This hack makes - // specifying custom Host header possible. - const hostHeaderKey = find(headers[MAP], 'Host'); - if (hostHeaderKey !== undefined) { - obj[hostHeaderKey] = obj[hostHeaderKey][0]; - } - - return obj; -} - -/** - * Create a Headers object from an object of headers, ignoring those that do - * not conform to HTTP grammar productions. - * - * @param Object obj Object of headers - * @return Headers - */ -function createHeadersLenient(obj) { - const headers = new Headers(); - for (const name of Object.keys(obj)) { - if (invalidTokenRegex.test(name)) { - continue; - } - if (Array.isArray(obj[name])) { - for (const val of obj[name]) { - if (invalidHeaderCharRegex.test(val)) { - continue; - } - if (headers[MAP][name] === undefined) { - headers[MAP][name] = [val]; - } else { - headers[MAP][name].push(val); - } - } - } else if (!invalidHeaderCharRegex.test(obj[name])) { - headers[MAP][name] = [obj[name]]; - } - } - return headers; -} - -const INTERNALS$1 = Symbol('Response internals'); - -// fix an issue where "STATUS_CODES" aren't a named export for node <10 -const STATUS_CODES = http.STATUS_CODES; - -/** - * Response class - * - * @param Stream body Readable stream - * @param Object opts Response options - * @return Void - */ -class Response { - constructor() { - let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; - let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - Body.call(this, body, opts); - - const status = opts.status || 200; - const headers = new Headers(opts.headers); - - if (body != null && !headers.has('Content-Type')) { - const contentType = extractContentType(body); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - this[INTERNALS$1] = { - url: opts.url, - status, - statusText: opts.statusText || STATUS_CODES[status], - headers, - counter: opts.counter - }; - } - - get url() { - return this[INTERNALS$1].url || ''; - } - - get status() { - return this[INTERNALS$1].status; - } - - /** - * Convenience property representing if the request ended normally - */ - get ok() { - return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; - } - - get redirected() { - return this[INTERNALS$1].counter > 0; - } - - get statusText() { - return this[INTERNALS$1].statusText; - } - - get headers() { - return this[INTERNALS$1].headers; - } - - /** - * Clone this response - * - * @return Response - */ - clone() { - return new Response(clone(this), { - url: this.url, - status: this.status, - statusText: this.statusText, - headers: this.headers, - ok: this.ok, - redirected: this.redirected - }); - } -} - -Body.mixIn(Response.prototype); - -Object.defineProperties(Response.prototype, { - url: { enumerable: true }, - status: { enumerable: true }, - ok: { enumerable: true }, - redirected: { enumerable: true }, - statusText: { enumerable: true }, - headers: { enumerable: true }, - clone: { enumerable: true } -}); - -Object.defineProperty(Response.prototype, Symbol.toStringTag, { - value: 'Response', - writable: false, - enumerable: false, - configurable: true -}); - -const INTERNALS$2 = Symbol('Request internals'); -const URL = Url.URL || whatwgUrl.URL; - -// fix an issue where "format", "parse" aren't a named export for node <10 -const parse_url = Url.parse; -const format_url = Url.format; - -/** - * Wrapper around `new URL` to handle arbitrary URLs - * - * @param {string} urlStr - * @return {void} - */ -function parseURL(urlStr) { - /* - Check whether the URL is absolute or not - Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 - Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 - */ - if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { - urlStr = new URL(urlStr).toString(); - } - - // Fallback to old implementation for arbitrary URLs - return parse_url(urlStr); -} - -const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; - -/** - * Check if a value is an instance of Request. - * - * @param Mixed input - * @return Boolean - */ -function isRequest(input) { - return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; -} - -function isAbortSignal(signal) { - const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); - return !!(proto && proto.constructor.name === 'AbortSignal'); -} - -/** - * Request class - * - * @param Mixed input Url or Request instance - * @param Object init Custom options - * @return Void - */ -class Request { - constructor(input) { - let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - - let parsedURL; - - // normalize input - if (!isRequest(input)) { - if (input && input.href) { - // in order to support Node.js' Url objects; though WHATWG's URL objects - // will fall into this branch also (since their `toString()` will return - // `href` property anyway) - parsedURL = parseURL(input.href); - } else { - // coerce input to a string before attempting to parse - parsedURL = parseURL(`${input}`); - } - input = {}; - } else { - parsedURL = parseURL(input.url); - } - - let method = init.method || input.method || 'GET'; - method = method.toUpperCase(); - - if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { - throw new TypeError('Request with GET/HEAD method cannot have body'); - } - - let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; - - Body.call(this, inputBody, { - timeout: init.timeout || input.timeout || 0, - size: init.size || input.size || 0 - }); - - const headers = new Headers(init.headers || input.headers || {}); - - if (inputBody != null && !headers.has('Content-Type')) { - const contentType = extractContentType(inputBody); - if (contentType) { - headers.append('Content-Type', contentType); - } - } - - let signal = isRequest(input) ? input.signal : null; - if ('signal' in init) signal = init.signal; - - if (signal != null && !isAbortSignal(signal)) { - throw new TypeError('Expected signal to be an instanceof AbortSignal'); - } - - this[INTERNALS$2] = { - method, - redirect: init.redirect || input.redirect || 'follow', - headers, - parsedURL, - signal - }; - - // node-fetch-only options - this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; - this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; - this.counter = init.counter || input.counter || 0; - this.agent = init.agent || input.agent; - } - - get method() { - return this[INTERNALS$2].method; - } - - get url() { - return format_url(this[INTERNALS$2].parsedURL); - } - - get headers() { - return this[INTERNALS$2].headers; - } - - get redirect() { - return this[INTERNALS$2].redirect; - } - - get signal() { - return this[INTERNALS$2].signal; - } - - /** - * Clone this request - * - * @return Request - */ - clone() { - return new Request(this); - } -} - -Body.mixIn(Request.prototype); - -Object.defineProperty(Request.prototype, Symbol.toStringTag, { - value: 'Request', - writable: false, - enumerable: false, - configurable: true -}); - -Object.defineProperties(Request.prototype, { - method: { enumerable: true }, - url: { enumerable: true }, - headers: { enumerable: true }, - redirect: { enumerable: true }, - clone: { enumerable: true }, - signal: { enumerable: true } -}); - -/** - * Convert a Request to Node.js http request options. - * - * @param Request A Request instance - * @return Object The options object to be passed to http.request - */ -function getNodeRequestOptions(request) { - const parsedURL = request[INTERNALS$2].parsedURL; - const headers = new Headers(request[INTERNALS$2].headers); - - // fetch step 1.3 - if (!headers.has('Accept')) { - headers.set('Accept', '*/*'); - } - - // Basic fetch - if (!parsedURL.protocol || !parsedURL.hostname) { - throw new TypeError('Only absolute URLs are supported'); - } - - if (!/^https?:$/.test(parsedURL.protocol)) { - throw new TypeError('Only HTTP(S) protocols are supported'); - } - - if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { - throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); - } - - // HTTP-network-or-cache fetch steps 2.4-2.7 - let contentLengthValue = null; - if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { - contentLengthValue = '0'; - } - if (request.body != null) { - const totalBytes = getTotalBytes(request); - if (typeof totalBytes === 'number') { - contentLengthValue = String(totalBytes); - } - } - if (contentLengthValue) { - headers.set('Content-Length', contentLengthValue); - } - - // HTTP-network-or-cache fetch step 2.11 - if (!headers.has('User-Agent')) { - headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); - } - - // HTTP-network-or-cache fetch step 2.15 - if (request.compress && !headers.has('Accept-Encoding')) { - headers.set('Accept-Encoding', 'gzip,deflate'); - } - - let agent = request.agent; - if (typeof agent === 'function') { - agent = agent(parsedURL); - } - - if (!headers.has('Connection') && !agent) { - headers.set('Connection', 'close'); - } - - // HTTP-network fetch step 4.2 - // chunked encoding is handled by Node.js - - return Object.assign({}, parsedURL, { - method: request.method, - headers: exportNodeCompatibleHeaders(headers), - agent - }); -} - -/** - * abort-error.js - * - * AbortError interface for cancelled requests - */ - -/** - * Create AbortError instance - * - * @param String message Error message for human - * @return AbortError - */ -function AbortError(message) { - Error.call(this, message); - - this.type = 'aborted'; - this.message = message; - - // hide custom error implementation details from end-users - Error.captureStackTrace(this, this.constructor); -} - -AbortError.prototype = Object.create(Error.prototype); -AbortError.prototype.constructor = AbortError; -AbortError.prototype.name = 'AbortError'; - -const URL$1 = Url.URL || whatwgUrl.URL; - -// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 -const PassThrough$1 = Stream.PassThrough; - -const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { - const orig = new URL$1(original).hostname; - const dest = new URL$1(destination).hostname; - - return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); -}; - -/** - * Fetch function - * - * @param Mixed url Absolute url or Request instance - * @param Object opts Fetch options - * @return Promise - */ -function fetch(url, opts) { - - // allow custom promise - if (!fetch.Promise) { - throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); - } - - Body.Promise = fetch.Promise; - - // wrap http.request into fetch - return new fetch.Promise(function (resolve, reject) { - // build request object - const request = new Request(url, opts); - const options = getNodeRequestOptions(request); - - const send = (options.protocol === 'https:' ? https : http).request; - const signal = request.signal; - - let response = null; - - const abort = function abort() { - let error = new AbortError('The user aborted a request.'); - reject(error); - if (request.body && request.body instanceof Stream.Readable) { - request.body.destroy(error); - } - if (!response || !response.body) return; - response.body.emit('error', error); - }; - - if (signal && signal.aborted) { - abort(); - return; - } - - const abortAndFinalize = function abortAndFinalize() { - abort(); - finalize(); - }; - - // send request - const req = send(options); - let reqTimeout; - - if (signal) { - signal.addEventListener('abort', abortAndFinalize); - } - - function finalize() { - req.abort(); - if (signal) signal.removeEventListener('abort', abortAndFinalize); - clearTimeout(reqTimeout); - } - - if (request.timeout) { - req.once('socket', function (socket) { - reqTimeout = setTimeout(function () { - reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); - finalize(); - }, request.timeout); - }); - } - - req.on('error', function (err) { - reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); - finalize(); - }); - - req.on('response', function (res) { - clearTimeout(reqTimeout); - - const headers = createHeadersLenient(res.headers); - - // HTTP fetch step 5 - if (fetch.isRedirect(res.statusCode)) { - // HTTP fetch step 5.2 - const location = headers.get('Location'); - - // HTTP fetch step 5.3 - let locationURL = null; - try { - locationURL = location === null ? null : new URL$1(location, request.url).toString(); - } catch (err) { - // error here can only be invalid URL in Location: header - // do not throw when options.redirect == manual - // let the user extract the errorneous redirect URL - if (request.redirect !== 'manual') { - reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); - finalize(); - return; - } - } - - // HTTP fetch step 5.5 - switch (request.redirect) { - case 'error': - reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); - finalize(); - return; - case 'manual': - // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. - if (locationURL !== null) { - // handle corrupted header - try { - headers.set('Location', locationURL); - } catch (err) { - // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request - reject(err); - } - } - break; - case 'follow': - // HTTP-redirect fetch step 2 - if (locationURL === null) { - break; - } - - // HTTP-redirect fetch step 5 - if (request.counter >= request.follow) { - reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 6 (counter increment) - // Create a new Request object. - const requestOpts = { - headers: new Headers(request.headers), - follow: request.follow, - counter: request.counter + 1, - agent: request.agent, - compress: request.compress, - method: request.method, - body: request.body, - signal: request.signal, - timeout: request.timeout, - size: request.size - }; - - if (!isDomainOrSubdomain(request.url, locationURL)) { - for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { - requestOpts.headers.delete(name); - } - } - - // HTTP-redirect fetch step 9 - if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { - reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); - finalize(); - return; - } - - // HTTP-redirect fetch step 11 - if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { - requestOpts.method = 'GET'; - requestOpts.body = undefined; - requestOpts.headers.delete('content-length'); - } - - // HTTP-redirect fetch step 15 - resolve(fetch(new Request(locationURL, requestOpts))); - finalize(); - return; - } - } - - // prepare response - res.once('end', function () { - if (signal) signal.removeEventListener('abort', abortAndFinalize); - }); - let body = res.pipe(new PassThrough$1()); - - const response_options = { - url: request.url, - status: res.statusCode, - statusText: res.statusMessage, - headers: headers, - size: request.size, - timeout: request.timeout, - counter: request.counter - }; - - // HTTP-network fetch step 12.1.1.3 - const codings = headers.get('Content-Encoding'); - - // HTTP-network fetch step 12.1.1.4: handle content codings - - // in following scenarios we ignore compression support - // 1. compression support is disabled - // 2. HEAD request - // 3. no Content-Encoding header - // 4. no content response (204) - // 5. content not modified response (304) - if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { - response = new Response(body, response_options); - resolve(response); - return; - } - - // For Node v6+ - // Be less strict when decoding compressed responses, since sometimes - // servers send slightly invalid responses that are still accepted - // by common browsers. - // Always using Z_SYNC_FLUSH is what cURL does. - const zlibOptions = { - flush: zlib.Z_SYNC_FLUSH, - finishFlush: zlib.Z_SYNC_FLUSH - }; - - // for gzip - if (codings == 'gzip' || codings == 'x-gzip') { - body = body.pipe(zlib.createGunzip(zlibOptions)); - response = new Response(body, response_options); - resolve(response); - return; - } - - // for deflate - if (codings == 'deflate' || codings == 'x-deflate') { - // handle the infamous raw deflate response from old servers - // a hack for old IIS and Apache servers - const raw = res.pipe(new PassThrough$1()); - raw.once('data', function (chunk) { - // see http://stackoverflow.com/questions/37519828 - if ((chunk[0] & 0x0F) === 0x08) { - body = body.pipe(zlib.createInflate()); - } else { - body = body.pipe(zlib.createInflateRaw()); - } - response = new Response(body, response_options); - resolve(response); - }); - return; - } - - // for br - if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { - body = body.pipe(zlib.createBrotliDecompress()); - response = new Response(body, response_options); - resolve(response); - return; - } - - // otherwise, use response as-is - response = new Response(body, response_options); - resolve(response); - }); - - writeToStream(req, request); - }); -} -/** - * Redirect code matching - * - * @param Number code Status code - * @return Boolean - */ -fetch.isRedirect = function (code) { - return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; -}; - -// expose Promise -fetch.Promise = global.Promise; - -module.exports = exports = fetch; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.default = exports; -exports.Headers = Headers; -exports.Request = Request; -exports.Response = Response; -exports.FetchError = FetchError; - - -/***/ }), - -/***/ 2299: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -var punycode = __nccwpck_require__(4213); -var mappingTable = __nccwpck_require__(8661); - -var PROCESSING_OPTIONS = { - TRANSITIONAL: 0, - NONTRANSITIONAL: 1 -}; - -function normalize(str) { // fix bug in v8 - return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000'); -} - -function findStatus(val) { - var start = 0; - var end = mappingTable.length - 1; - - while (start <= end) { - var mid = Math.floor((start + end) / 2); - - var target = mappingTable[mid]; - if (target[0][0] <= val && target[0][1] >= val) { - return target; - } else if (target[0][0] > val) { - end = mid - 1; - } else { - start = mid + 1; - } - } - - return null; -} - -var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; - -function countSymbols(string) { - return string - // replace every surrogate pair with a BMP symbol - .replace(regexAstralSymbols, '_') - // then get the length - .length; -} - -function mapChars(domain_name, useSTD3, processing_option) { - var hasError = false; - var processed = ""; - - var len = countSymbols(domain_name); - for (var i = 0; i < len; ++i) { - var codePoint = domain_name.codePointAt(i); - var status = findStatus(codePoint); - - switch (status[1]) { - case "disallowed": - hasError = true; - processed += String.fromCodePoint(codePoint); - break; - case "ignored": - break; - case "mapped": - processed += String.fromCodePoint.apply(String, status[2]); - break; - case "deviation": - if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { - processed += String.fromCodePoint.apply(String, status[2]); - } else { - processed += String.fromCodePoint(codePoint); - } - break; - case "valid": - processed += String.fromCodePoint(codePoint); - break; - case "disallowed_STD3_mapped": - if (useSTD3) { - hasError = true; - processed += String.fromCodePoint(codePoint); - } else { - processed += String.fromCodePoint.apply(String, status[2]); - } - break; - case "disallowed_STD3_valid": - if (useSTD3) { - hasError = true; - } - - processed += String.fromCodePoint(codePoint); - break; - } - } - - return { - string: processed, - error: hasError - }; -} - -var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; - -function validateLabel(label, processing_option) { - if (label.substr(0, 4) === "xn--") { - label = punycode.toUnicode(label); - processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; - } - - var error = false; - - if (normalize(label) !== label || - (label[3] === "-" && label[4] === "-") || - label[0] === "-" || label[label.length - 1] === "-" || - label.indexOf(".") !== -1 || - label.search(combiningMarksRegex) === 0) { - error = true; - } - - var len = countSymbols(label); - for (var i = 0; i < len; ++i) { - var status = findStatus(label.codePointAt(i)); - if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") || - (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && - status[1] !== "valid" && status[1] !== "deviation")) { - error = true; - break; - } - } - - return { - label: label, - error: error - }; -} - -function processing(domain_name, useSTD3, processing_option) { - var result = mapChars(domain_name, useSTD3, processing_option); - result.string = normalize(result.string); - - var labels = result.string.split("."); - for (var i = 0; i < labels.length; ++i) { - try { - var validation = validateLabel(labels[i]); - labels[i] = validation.label; - result.error = result.error || validation.error; - } catch(e) { - result.error = true; - } - } - - return { - string: labels.join("."), - error: result.error - }; -} - -module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { - var result = processing(domain_name, useSTD3, processing_option); - var labels = result.string.split("."); - labels = labels.map(function(l) { - try { - return punycode.toASCII(l); - } catch(e) { - result.error = true; - return l; - } - }); - - if (verifyDnsLength) { - var total = labels.slice(0, labels.length - 1).join(".").length; - if (total.length > 253 || total.length === 0) { - result.error = true; - } - - for (var i=0; i < labels.length; ++i) { - if (labels.length > 63 || labels.length === 0) { - result.error = true; - break; - } - } - } - - if (result.error) return null; - return labels.join("."); -}; - -module.exports.toUnicode = function(domain_name, useSTD3) { - var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); - - return { - domain: result.string, - error: result.error - }; -}; - -module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; - - -/***/ }), - -/***/ 5871: -/***/ ((module) => { - -"use strict"; - - -var conversions = {}; -module.exports = conversions; - -function sign(x) { - return x < 0 ? -1 : 1; -} - -function evenRound(x) { - // Round x to the nearest integer, choosing the even integer if it lies halfway between two. - if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor) - return Math.floor(x); - } else { - return Math.round(x); - } -} - -function createNumberConversion(bitLength, typeOpts) { - if (!typeOpts.unsigned) { - --bitLength; - } - const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); - const upperBound = Math.pow(2, bitLength) - 1; - - const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); - const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); - - return function(V, opts) { - if (!opts) opts = {}; - - let x = +V; - - if (opts.enforceRange) { - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite number"); - } - - x = sign(x) * Math.floor(Math.abs(x)); - if (x < lowerBound || x > upperBound) { - throw new TypeError("Argument is not in byte range"); - } - - return x; - } - - if (!isNaN(x) && opts.clamp) { - x = evenRound(x); - - if (x < lowerBound) x = lowerBound; - if (x > upperBound) x = upperBound; - return x; - } - - if (!Number.isFinite(x) || x === 0) { - return 0; - } - - x = sign(x) * Math.floor(Math.abs(x)); - x = x % moduloVal; - - if (!typeOpts.unsigned && x >= moduloBound) { - return x - moduloVal; - } else if (typeOpts.unsigned) { - if (x < 0) { - x += moduloVal; - } else if (x === -0) { // don't return negative zero - return 0; - } - } - - return x; - } -} - -conversions["void"] = function () { - return undefined; -}; - -conversions["boolean"] = function (val) { - return !!val; -}; - -conversions["byte"] = createNumberConversion(8, { unsigned: false }); -conversions["octet"] = createNumberConversion(8, { unsigned: true }); - -conversions["short"] = createNumberConversion(16, { unsigned: false }); -conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); - -conversions["long"] = createNumberConversion(32, { unsigned: false }); -conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); - -conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); -conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); - -conversions["double"] = function (V) { - const x = +V; - - if (!Number.isFinite(x)) { - throw new TypeError("Argument is not a finite floating-point value"); - } - - return x; -}; - -conversions["unrestricted double"] = function (V) { - const x = +V; - - if (isNaN(x)) { - throw new TypeError("Argument is NaN"); - } - - return x; -}; - -// not quite valid, but good enough for JS -conversions["float"] = conversions["double"]; -conversions["unrestricted float"] = conversions["unrestricted double"]; - -conversions["DOMString"] = function (V, opts) { - if (!opts) opts = {}; - - if (opts.treatNullAsEmptyString && V === null) { - return ""; - } - - return String(V); -}; - -conversions["ByteString"] = function (V, opts) { - const x = String(V); - let c = undefined; - for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { - if (c > 255) { - throw new TypeError("Argument is not a valid bytestring"); - } - } - - return x; -}; - -conversions["USVString"] = function (V) { - const S = String(V); - const n = S.length; - const U = []; - for (let i = 0; i < n; ++i) { - const c = S.charCodeAt(i); - if (c < 0xD800 || c > 0xDFFF) { - U.push(String.fromCodePoint(c)); - } else if (0xDC00 <= c && c <= 0xDFFF) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - if (i === n - 1) { - U.push(String.fromCodePoint(0xFFFD)); - } else { - const d = S.charCodeAt(i + 1); - if (0xDC00 <= d && d <= 0xDFFF) { - const a = c & 0x3FF; - const b = d & 0x3FF; - U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); - ++i; - } else { - U.push(String.fromCodePoint(0xFFFD)); - } - } - } - } - - return U.join(''); -}; - -conversions["Date"] = function (V, opts) { - if (!(V instanceof Date)) { - throw new TypeError("Argument is not a Date object"); - } - if (isNaN(V)) { - return undefined; - } - - return V; -}; - -conversions["RegExp"] = function (V, opts) { - if (!(V instanceof RegExp)) { - V = new RegExp(V); - } - - return V; -}; - - -/***/ }), - -/***/ 8262: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -const usm = __nccwpck_require__(33); - -exports.implementation = class URLImpl { - constructor(constructorArgs) { - const url = constructorArgs[0]; - const base = constructorArgs[1]; - - let parsedBase = null; - if (base !== undefined) { - parsedBase = usm.basicURLParse(base); - if (parsedBase === "failure") { - throw new TypeError("Invalid base URL"); - } - } - - const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - - this._url = parsedURL; - - // TODO: query stuff - } - - get href() { - return usm.serializeURL(this._url); - } - - set href(v) { - const parsedURL = usm.basicURLParse(v); - if (parsedURL === "failure") { - throw new TypeError("Invalid URL"); - } - - this._url = parsedURL; - } - - get origin() { - return usm.serializeURLOrigin(this._url); - } - - get protocol() { - return this._url.scheme + ":"; - } - - set protocol(v) { - usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); - } - - get username() { - return this._url.username; - } - - set username(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setTheUsername(this._url, v); - } - - get password() { - return this._url.password; - } - - set password(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - usm.setThePassword(this._url, v); - } - - get host() { - const url = this._url; - - if (url.host === null) { - return ""; - } - - if (url.port === null) { - return usm.serializeHost(url.host); - } - - return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); - } - - set host(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); - } - - get hostname() { - if (this._url.host === null) { - return ""; - } - - return usm.serializeHost(this._url.host); - } - - set hostname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); - } - - get port() { - if (this._url.port === null) { - return ""; - } - - return usm.serializeInteger(this._url.port); - } - - set port(v) { - if (usm.cannotHaveAUsernamePasswordPort(this._url)) { - return; - } - - if (v === "") { - this._url.port = null; - } else { - usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); - } - } - - get pathname() { - if (this._url.cannotBeABaseURL) { - return this._url.path[0]; - } - - if (this._url.path.length === 0) { - return ""; - } - - return "/" + this._url.path.join("/"); - } - - set pathname(v) { - if (this._url.cannotBeABaseURL) { - return; - } - - this._url.path = []; - usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); - } - - get search() { - if (this._url.query === null || this._url.query === "") { - return ""; - } - - return "?" + this._url.query; - } - - set search(v) { - // TODO: query stuff - - const url = this._url; - - if (v === "") { - url.query = null; - return; - } - - const input = v[0] === "?" ? v.substring(1) : v; - url.query = ""; - usm.basicURLParse(input, { url, stateOverride: "query" }); - } - - get hash() { - if (this._url.fragment === null || this._url.fragment === "") { - return ""; - } - - return "#" + this._url.fragment; - } - - set hash(v) { - if (v === "") { - this._url.fragment = null; - return; - } - - const input = v[0] === "#" ? v.substring(1) : v; - this._url.fragment = ""; - usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); - } - - toJSON() { - return this.href; - } -}; - - -/***/ }), - -/***/ 653: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - - -const conversions = __nccwpck_require__(5871); -const utils = __nccwpck_require__(276); -const Impl = __nccwpck_require__(8262); - -const impl = utils.implSymbol; - -function URL(url) { - if (!this || this[impl] || !(this instanceof URL)) { - throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); - } - if (arguments.length < 1) { - throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); - } - const args = []; - for (let i = 0; i < arguments.length && i < 2; ++i) { - args[i] = arguments[i]; - } - args[0] = conversions["USVString"](args[0]); - if (args[1] !== undefined) { - args[1] = conversions["USVString"](args[1]); - } - - module.exports.setup(this, args); -} - -URL.prototype.toJSON = function toJSON() { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - const args = []; - for (let i = 0; i < arguments.length && i < 0; ++i) { - args[i] = arguments[i]; - } - return this[impl].toJSON.apply(this[impl], args); -}; -Object.defineProperty(URL.prototype, "href", { - get() { - return this[impl].href; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].href = V; - }, - enumerable: true, - configurable: true -}); - -URL.prototype.toString = function () { - if (!this || !module.exports.is(this)) { - throw new TypeError("Illegal invocation"); - } - return this.href; -}; - -Object.defineProperty(URL.prototype, "origin", { - get() { - return this[impl].origin; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "protocol", { - get() { - return this[impl].protocol; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].protocol = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "username", { - get() { - return this[impl].username; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].username = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "password", { - get() { - return this[impl].password; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].password = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "host", { - get() { - return this[impl].host; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].host = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "hostname", { - get() { - return this[impl].hostname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hostname = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "port", { - get() { - return this[impl].port; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].port = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "pathname", { - get() { - return this[impl].pathname; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].pathname = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "search", { - get() { - return this[impl].search; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].search = V; - }, - enumerable: true, - configurable: true -}); - -Object.defineProperty(URL.prototype, "hash", { - get() { - return this[impl].hash; - }, - set(V) { - V = conversions["USVString"](V); - this[impl].hash = V; - }, - enumerable: true, - configurable: true -}); - - -module.exports = { - is(obj) { - return !!obj && obj[impl] instanceof Impl.implementation; - }, - create(constructorArgs, privateData) { - let obj = Object.create(URL.prototype); - this.setup(obj, constructorArgs, privateData); - return obj; - }, - setup(obj, constructorArgs, privateData) { - if (!privateData) privateData = {}; - privateData.wrapper = obj; - - obj[impl] = new Impl.implementation(constructorArgs, privateData); - obj[impl][utils.wrapperSymbol] = obj; - }, - interface: URL, - expose: { - Window: { URL: URL }, - Worker: { URL: URL } - } -}; - - - -/***/ }), - -/***/ 3323: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - - -exports.URL = __nccwpck_require__(653).interface; -exports.serializeURL = __nccwpck_require__(33).serializeURL; -exports.serializeURLOrigin = __nccwpck_require__(33).serializeURLOrigin; -exports.basicURLParse = __nccwpck_require__(33).basicURLParse; -exports.setTheUsername = __nccwpck_require__(33).setTheUsername; -exports.setThePassword = __nccwpck_require__(33).setThePassword; -exports.serializeHost = __nccwpck_require__(33).serializeHost; -exports.serializeInteger = __nccwpck_require__(33).serializeInteger; -exports.parseURL = __nccwpck_require__(33).parseURL; - - -/***/ }), - -/***/ 33: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -"use strict"; - -const punycode = __nccwpck_require__(4213); -const tr46 = __nccwpck_require__(2299); - -const specialSchemes = { - ftp: 21, - file: null, - gopher: 70, - http: 80, - https: 443, - ws: 80, - wss: 443 -}; - -const failure = Symbol("failure"); - -function countSymbols(str) { - return punycode.ucs2.decode(str).length; -} - -function at(input, idx) { - const c = input[idx]; - return isNaN(c) ? undefined : String.fromCodePoint(c); -} - -function isASCIIDigit(c) { - return c >= 0x30 && c <= 0x39; -} - -function isASCIIAlpha(c) { - return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); -} - -function isASCIIAlphanumeric(c) { - return isASCIIAlpha(c) || isASCIIDigit(c); -} - -function isASCIIHex(c) { - return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); -} - -function isSingleDot(buffer) { - return buffer === "." || buffer.toLowerCase() === "%2e"; -} - -function isDoubleDot(buffer) { - buffer = buffer.toLowerCase(); - return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; -} - -function isWindowsDriveLetterCodePoints(cp1, cp2) { - return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); -} - -function isWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); -} - -function isNormalizedWindowsDriveLetterString(string) { - return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; -} - -function containsForbiddenHostCodePoint(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; -} - -function containsForbiddenHostCodePointExcludingPercent(string) { - return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; -} - -function isSpecialScheme(scheme) { - return specialSchemes[scheme] !== undefined; -} - -function isSpecial(url) { - return isSpecialScheme(url.scheme); -} - -function defaultPort(scheme) { - return specialSchemes[scheme]; -} - -function percentEncode(c) { - let hex = c.toString(16).toUpperCase(); - if (hex.length === 1) { - hex = "0" + hex; - } - - return "%" + hex; -} - -function utf8PercentEncode(c) { - const buf = new Buffer(c); - - let str = ""; - - for (let i = 0; i < buf.length; ++i) { - str += percentEncode(buf[i]); - } - - return str; -} - -function utf8PercentDecode(str) { - const input = new Buffer(str); - const output = []; - for (let i = 0; i < input.length; ++i) { - if (input[i] !== 37) { - output.push(input[i]); - } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { - output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); - i += 2; - } else { - output.push(input[i]); - } - } - return new Buffer(output).toString(); -} - -function isC0ControlPercentEncode(c) { - return c <= 0x1F || c > 0x7E; -} - -const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); -function isPathPercentEncode(c) { - return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); -} - -const extraUserinfoPercentEncodeSet = - new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); -function isUserinfoPercentEncode(c) { - return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); -} - -function percentEncodeChar(c, encodeSetPredicate) { - const cStr = String.fromCodePoint(c); - - if (encodeSetPredicate(c)) { - return utf8PercentEncode(cStr); - } - - return cStr; -} - -function parseIPv4Number(input) { - let R = 10; - - if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { - input = input.substring(2); - R = 16; - } else if (input.length >= 2 && input.charAt(0) === "0") { - input = input.substring(1); - R = 8; - } - - if (input === "") { - return 0; - } - - const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); - if (regex.test(input)) { - return failure; - } - - return parseInt(input, R); -} - -function parseIPv4(input) { - const parts = input.split("."); - if (parts[parts.length - 1] === "") { - if (parts.length > 1) { - parts.pop(); - } - } - - if (parts.length > 4) { - return input; - } - - const numbers = []; - for (const part of parts) { - if (part === "") { - return input; - } - const n = parseIPv4Number(part); - if (n === failure) { - return input; - } - - numbers.push(n); - } - - for (let i = 0; i < numbers.length - 1; ++i) { - if (numbers[i] > 255) { - return failure; - } - } - if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { - return failure; - } - - let ipv4 = numbers.pop(); - let counter = 0; - - for (const n of numbers) { - ipv4 += n * Math.pow(256, 3 - counter); - ++counter; - } - - return ipv4; -} - -function serializeIPv4(address) { - let output = ""; - let n = address; - - for (let i = 1; i <= 4; ++i) { - output = String(n % 256) + output; - if (i !== 4) { - output = "." + output; - } - n = Math.floor(n / 256); - } - - return output; -} - -function parseIPv6(input) { - const address = [0, 0, 0, 0, 0, 0, 0, 0]; - let pieceIndex = 0; - let compress = null; - let pointer = 0; - - input = punycode.ucs2.decode(input); - - if (input[pointer] === 58) { - if (input[pointer + 1] !== 58) { - return failure; - } - - pointer += 2; - ++pieceIndex; - compress = pieceIndex; - } - - while (pointer < input.length) { - if (pieceIndex === 8) { - return failure; - } - - if (input[pointer] === 58) { - if (compress !== null) { - return failure; - } - ++pointer; - ++pieceIndex; - compress = pieceIndex; - continue; - } - - let value = 0; - let length = 0; - - while (length < 4 && isASCIIHex(input[pointer])) { - value = value * 0x10 + parseInt(at(input, pointer), 16); - ++pointer; - ++length; - } - - if (input[pointer] === 46) { - if (length === 0) { - return failure; - } - - pointer -= length; - - if (pieceIndex > 6) { - return failure; - } - - let numbersSeen = 0; - - while (input[pointer] !== undefined) { - let ipv4Piece = null; - - if (numbersSeen > 0) { - if (input[pointer] === 46 && numbersSeen < 4) { - ++pointer; - } else { - return failure; - } - } - - if (!isASCIIDigit(input[pointer])) { - return failure; - } - - while (isASCIIDigit(input[pointer])) { - const number = parseInt(at(input, pointer)); - if (ipv4Piece === null) { - ipv4Piece = number; - } else if (ipv4Piece === 0) { - return failure; - } else { - ipv4Piece = ipv4Piece * 10 + number; - } - if (ipv4Piece > 255) { - return failure; - } - ++pointer; - } - - address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; - - ++numbersSeen; - - if (numbersSeen === 2 || numbersSeen === 4) { - ++pieceIndex; - } - } - - if (numbersSeen !== 4) { - return failure; - } - - break; - } else if (input[pointer] === 58) { - ++pointer; - if (input[pointer] === undefined) { - return failure; - } - } else if (input[pointer] !== undefined) { - return failure; - } - - address[pieceIndex] = value; - ++pieceIndex; - } - - if (compress !== null) { - let swaps = pieceIndex - compress; - pieceIndex = 7; - while (pieceIndex !== 0 && swaps > 0) { - const temp = address[compress + swaps - 1]; - address[compress + swaps - 1] = address[pieceIndex]; - address[pieceIndex] = temp; - --pieceIndex; - --swaps; - } - } else if (compress === null && pieceIndex !== 8) { - return failure; - } - - return address; -} - -function serializeIPv6(address) { - let output = ""; - const seqResult = findLongestZeroSequence(address); - const compress = seqResult.idx; - let ignore0 = false; - - for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { - if (ignore0 && address[pieceIndex] === 0) { - continue; - } else if (ignore0) { - ignore0 = false; - } - - if (compress === pieceIndex) { - const separator = pieceIndex === 0 ? "::" : ":"; - output += separator; - ignore0 = true; - continue; - } - - output += address[pieceIndex].toString(16); - - if (pieceIndex !== 7) { - output += ":"; - } - } - - return output; -} - -function parseHost(input, isSpecialArg) { - if (input[0] === "[") { - if (input[input.length - 1] !== "]") { - return failure; - } - - return parseIPv6(input.substring(1, input.length - 1)); - } - - if (!isSpecialArg) { - return parseOpaqueHost(input); - } - - const domain = utf8PercentDecode(input); - const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); - if (asciiDomain === null) { - return failure; - } - - if (containsForbiddenHostCodePoint(asciiDomain)) { - return failure; - } - - const ipv4Host = parseIPv4(asciiDomain); - if (typeof ipv4Host === "number" || ipv4Host === failure) { - return ipv4Host; - } - - return asciiDomain; -} - -function parseOpaqueHost(input) { - if (containsForbiddenHostCodePointExcludingPercent(input)) { - return failure; - } - - let output = ""; - const decoded = punycode.ucs2.decode(input); - for (let i = 0; i < decoded.length; ++i) { - output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); - } - return output; -} - -function findLongestZeroSequence(arr) { - let maxIdx = null; - let maxLen = 1; // only find elements > 1 - let currStart = null; - let currLen = 0; - - for (let i = 0; i < arr.length; ++i) { - if (arr[i] !== 0) { - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - - currStart = null; - currLen = 0; - } else { - if (currStart === null) { - currStart = i; - } - ++currLen; - } - } - - // if trailing zeros - if (currLen > maxLen) { - maxIdx = currStart; - maxLen = currLen; - } - - return { - idx: maxIdx, - len: maxLen - }; -} - -function serializeHost(host) { - if (typeof host === "number") { - return serializeIPv4(host); - } - - // IPv6 serializer - if (host instanceof Array) { - return "[" + serializeIPv6(host) + "]"; - } - - return host; -} - -function trimControlChars(url) { - return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); -} - -function trimTabAndNewline(url) { - return url.replace(/\u0009|\u000A|\u000D/g, ""); -} - -function shortenPath(url) { - const path = url.path; - if (path.length === 0) { - return; - } - if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { - return; - } - - path.pop(); -} - -function includesCredentials(url) { - return url.username !== "" || url.password !== ""; -} - -function cannotHaveAUsernamePasswordPort(url) { - return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; -} - -function isNormalizedWindowsDriveLetter(string) { - return /^[A-Za-z]:$/.test(string); -} - -function URLStateMachine(input, base, encodingOverride, url, stateOverride) { - this.pointer = 0; - this.input = input; - this.base = base || null; - this.encodingOverride = encodingOverride || "utf-8"; - this.stateOverride = stateOverride; - this.url = url; - this.failure = false; - this.parseError = false; - - if (!this.url) { - this.url = { - scheme: "", - username: "", - password: "", - host: null, - port: null, - path: [], - query: null, - fragment: null, - - cannotBeABaseURL: false - }; - - const res = trimControlChars(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - } - - const res = trimTabAndNewline(this.input); - if (res !== this.input) { - this.parseError = true; - } - this.input = res; - - this.state = stateOverride || "scheme start"; - - this.buffer = ""; - this.atFlag = false; - this.arrFlag = false; - this.passwordTokenSeenFlag = false; - - this.input = punycode.ucs2.decode(this.input); - - for (; this.pointer <= this.input.length; ++this.pointer) { - const c = this.input[this.pointer]; - const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); - - // exec state machine - const ret = this["parse " + this.state](c, cStr); - if (!ret) { - break; // terminate algorithm - } else if (ret === failure) { - this.failure = true; - break; - } - } -} - -URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { - if (isASCIIAlpha(c)) { - this.buffer += cStr.toLowerCase(); - this.state = "scheme"; - } else if (!this.stateOverride) { - this.state = "no scheme"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { - if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { - this.buffer += cStr.toLowerCase(); - } else if (c === 58) { - if (this.stateOverride) { - if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { - return false; - } - - if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { - return false; - } - - if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { - return false; - } - - if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { - return false; - } - } - this.url.scheme = this.buffer; - this.buffer = ""; - if (this.stateOverride) { - return false; - } - if (this.url.scheme === "file") { - if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { - this.parseError = true; - } - this.state = "file"; - } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { - this.state = "special relative or authority"; - } else if (isSpecial(this.url)) { - this.state = "special authority slashes"; - } else if (this.input[this.pointer + 1] === 47) { - this.state = "path or authority"; - ++this.pointer; - } else { - this.url.cannotBeABaseURL = true; - this.url.path.push(""); - this.state = "cannot-be-a-base-URL path"; - } - } else if (!this.stateOverride) { - this.buffer = ""; - this.state = "no scheme"; - this.pointer = -1; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { - if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { - return failure; - } else if (this.base.cannotBeABaseURL && c === 35) { - this.url.scheme = this.base.scheme; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.url.cannotBeABaseURL = true; - this.state = "fragment"; - } else if (this.base.scheme === "file") { - this.state = "file"; - --this.pointer; - } else { - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "relative"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { - if (c === 47) { - this.state = "authority"; - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative"] = function parseRelative(c) { - this.url.scheme = this.base.scheme; - if (isNaN(c)) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 47) { - this.state = "relative slash"; - } else if (c === 63) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else if (isSpecial(this.url) && c === 92) { - this.parseError = true; - this.state = "relative slash"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.url.path = this.base.path.slice(0, this.base.path.length - 1); - - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { - if (isSpecial(this.url) && (c === 47 || c === 92)) { - if (c === 92) { - this.parseError = true; - } - this.state = "special authority ignore slashes"; - } else if (c === 47) { - this.state = "authority"; - } else { - this.url.username = this.base.username; - this.url.password = this.base.password; - this.url.host = this.base.host; - this.url.port = this.base.port; - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { - if (c === 47 && this.input[this.pointer + 1] === 47) { - this.state = "special authority ignore slashes"; - ++this.pointer; - } else { - this.parseError = true; - this.state = "special authority ignore slashes"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { - if (c !== 47 && c !== 92) { - this.state = "authority"; - --this.pointer; - } else { - this.parseError = true; - } - - return true; -}; - -URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { - if (c === 64) { - this.parseError = true; - if (this.atFlag) { - this.buffer = "%40" + this.buffer; - } - this.atFlag = true; - - // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars - const len = countSymbols(this.buffer); - for (let pointer = 0; pointer < len; ++pointer) { - const codePoint = this.buffer.codePointAt(pointer); - - if (codePoint === 58 && !this.passwordTokenSeenFlag) { - this.passwordTokenSeenFlag = true; - continue; - } - const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); - if (this.passwordTokenSeenFlag) { - this.url.password += encodedCodePoints; - } else { - this.url.username += encodedCodePoints; - } - } - this.buffer = ""; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - if (this.atFlag && this.buffer === "") { - this.parseError = true; - return failure; - } - this.pointer -= countSymbols(this.buffer) + 1; - this.buffer = ""; - this.state = "host"; - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse hostname"] = -URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { - if (this.stateOverride && this.url.scheme === "file") { - --this.pointer; - this.state = "file host"; - } else if (c === 58 && !this.arrFlag) { - if (this.buffer === "") { - this.parseError = true; - return failure; - } - - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "port"; - if (this.stateOverride === "hostname") { - return false; - } - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92)) { - --this.pointer; - if (isSpecial(this.url) && this.buffer === "") { - this.parseError = true; - return failure; - } else if (this.stateOverride && this.buffer === "" && - (includesCredentials(this.url) || this.url.port !== null)) { - this.parseError = true; - return false; - } - - const host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - - this.url.host = host; - this.buffer = ""; - this.state = "path start"; - if (this.stateOverride) { - return false; - } - } else { - if (c === 91) { - this.arrFlag = true; - } else if (c === 93) { - this.arrFlag = false; - } - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { - if (isASCIIDigit(c)) { - this.buffer += cStr; - } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || - (isSpecial(this.url) && c === 92) || - this.stateOverride) { - if (this.buffer !== "") { - const port = parseInt(this.buffer); - if (port > Math.pow(2, 16) - 1) { - this.parseError = true; - return failure; - } - this.url.port = port === defaultPort(this.url.scheme) ? null : port; - this.buffer = ""; - } - if (this.stateOverride) { - return false; - } - this.state = "path start"; - --this.pointer; - } else { - this.parseError = true; - return failure; - } - - return true; -}; - -const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); - -URLStateMachine.prototype["parse file"] = function parseFile(c) { - this.url.scheme = "file"; - - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file slash"; - } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c)) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - } else if (c === 63) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - this.url.query = this.base.query; - this.url.fragment = ""; - this.state = "fragment"; - } else { - if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points - !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || - (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points - !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { - this.url.host = this.base.host; - this.url.path = this.base.path.slice(); - shortenPath(this.url); - } else { - this.parseError = true; - } - - this.state = "path"; - --this.pointer; - } - } else { - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { - if (c === 47 || c === 92) { - if (c === 92) { - this.parseError = true; - } - this.state = "file host"; - } else { - if (this.base !== null && this.base.scheme === "file") { - if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { - this.url.path.push(this.base.path[0]); - } else { - this.url.host = this.base.host; - } - } - this.state = "path"; - --this.pointer; - } - - return true; -}; - -URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { - if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { - --this.pointer; - if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { - this.parseError = true; - this.state = "path"; - } else if (this.buffer === "") { - this.url.host = ""; - if (this.stateOverride) { - return false; - } - this.state = "path start"; - } else { - let host = parseHost(this.buffer, isSpecial(this.url)); - if (host === failure) { - return failure; - } - if (host === "localhost") { - host = ""; - } - this.url.host = host; - - if (this.stateOverride) { - return false; - } - - this.buffer = ""; - this.state = "path start"; - } - } else { - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { - if (isSpecial(this.url)) { - if (c === 92) { - this.parseError = true; - } - this.state = "path"; - - if (c !== 47 && c !== 92) { - --this.pointer; - } - } else if (!this.stateOverride && c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (!this.stateOverride && c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else if (c !== undefined) { - this.state = "path"; - if (c !== 47) { - --this.pointer; - } - } - - return true; -}; - -URLStateMachine.prototype["parse path"] = function parsePath(c) { - if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || - (!this.stateOverride && (c === 63 || c === 35))) { - if (isSpecial(this.url) && c === 92) { - this.parseError = true; - } - - if (isDoubleDot(this.buffer)) { - shortenPath(this.url); - if (c !== 47 && !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } - } else if (isSingleDot(this.buffer) && c !== 47 && - !(isSpecial(this.url) && c === 92)) { - this.url.path.push(""); - } else if (!isSingleDot(this.buffer)) { - if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { - if (this.url.host !== "" && this.url.host !== null) { - this.parseError = true; - this.url.host = ""; - } - this.buffer = this.buffer[0] + ":"; - } - this.url.path.push(this.buffer); - } - this.buffer = ""; - if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { - while (this.url.path.length > 1 && this.url.path[0] === "") { - this.parseError = true; - this.url.path.shift(); - } - } - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += percentEncodeChar(c, isPathPercentEncode); - } - - return true; -}; - -URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { - if (c === 63) { - this.url.query = ""; - this.state = "query"; - } else if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } else { - // TODO: Add: not a URL code point - if (!isNaN(c) && c !== 37) { - this.parseError = true; - } - - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - if (!isNaN(c)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); - } - } - - return true; -}; - -URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { - if (isNaN(c) || (!this.stateOverride && c === 35)) { - if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { - this.encodingOverride = "utf-8"; - } - - const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead - for (let i = 0; i < buffer.length; ++i) { - if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || - buffer[i] === 0x3C || buffer[i] === 0x3E) { - this.url.query += percentEncode(buffer[i]); - } else { - this.url.query += String.fromCodePoint(buffer[i]); - } - } - - this.buffer = ""; - if (c === 35) { - this.url.fragment = ""; - this.state = "fragment"; - } - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.buffer += cStr; - } - - return true; -}; - -URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { - if (isNaN(c)) { // do nothing - } else if (c === 0x0) { - this.parseError = true; - } else { - // TODO: If c is not a URL code point and not "%", parse error. - if (c === 37 && - (!isASCIIHex(this.input[this.pointer + 1]) || - !isASCIIHex(this.input[this.pointer + 2]))) { - this.parseError = true; - } - - this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); - } - - return true; -}; - -function serializeURL(url, excludeFragment) { - let output = url.scheme + ":"; - if (url.host !== null) { - output += "//"; - - if (url.username !== "" || url.password !== "") { - output += url.username; - if (url.password !== "") { - output += ":" + url.password; - } - output += "@"; - } - - output += serializeHost(url.host); - - if (url.port !== null) { - output += ":" + url.port; - } - } else if (url.host === null && url.scheme === "file") { - output += "//"; - } - - if (url.cannotBeABaseURL) { - output += url.path[0]; - } else { - for (const string of url.path) { - output += "/" + string; - } - } - - if (url.query !== null) { - output += "?" + url.query; - } - - if (!excludeFragment && url.fragment !== null) { - output += "#" + url.fragment; - } - - return output; -} - -function serializeOrigin(tuple) { - let result = tuple.scheme + "://"; - result += serializeHost(tuple.host); - - if (tuple.port !== null) { - result += ":" + tuple.port; - } - - return result; -} - -module.exports.serializeURL = serializeURL; - -module.exports.serializeURLOrigin = function (url) { - // https://url.spec.whatwg.org/#concept-url-origin - switch (url.scheme) { - case "blob": - try { - return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); - } catch (e) { - // serializing an opaque origin returns "null" - return "null"; - } - case "ftp": - case "gopher": - case "http": - case "https": - case "ws": - case "wss": - return serializeOrigin({ - scheme: url.scheme, - host: url.host, - port: url.port - }); - case "file": - // spec says "exercise to the reader", chrome says "file://" - return "file://"; - default: - // serializing an opaque origin returns "null" - return "null"; - } -}; - -module.exports.basicURLParse = function (input, options) { - if (options === undefined) { - options = {}; - } - - const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); - if (usm.failure) { - return "failure"; - } - - return usm.url; -}; - -module.exports.setTheUsername = function (url, username) { - url.username = ""; - const decoded = punycode.ucs2.decode(username); - for (let i = 0; i < decoded.length; ++i) { - url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; - -module.exports.setThePassword = function (url, password) { - url.password = ""; - const decoded = punycode.ucs2.decode(password); - for (let i = 0; i < decoded.length; ++i) { - url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); - } -}; - -module.exports.serializeHost = serializeHost; - -module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; - -module.exports.serializeInteger = function (integer) { - return String(integer); -}; - -module.exports.parseURL = function (input, options) { - if (options === undefined) { - options = {}; - } - - // We don't handle blobs, so this just delegates: - return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); -}; - - -/***/ }), - -/***/ 276: -/***/ ((module) => { - -"use strict"; - - -module.exports.mixin = function mixin(target, source) { - const keys = Object.getOwnPropertyNames(source); - for (let i = 0; i < keys.length; ++i) { - Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); - } -}; - -module.exports.wrapperSymbol = Symbol("wrapper"); -module.exports.implSymbol = Symbol("impl"); - -module.exports.wrapperForImpl = function (impl) { - return impl[module.exports.wrapperSymbol]; -}; - -module.exports.implForWrapper = function (wrapper) { - return wrapper[module.exports.implSymbol]; -}; - - - -/***/ }), - -/***/ 1223: -/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { - -var wrappy = __nccwpck_require__(2940) -module.exports = wrappy(once) -module.exports.strict = wrappy(onceStrict) - -once.proto = once(function () { - Object.defineProperty(Function.prototype, 'once', { - value: function () { - return once(this) - }, - configurable: true - }) - - Object.defineProperty(Function.prototype, 'onceStrict', { - value: function () { - return onceStrict(this) - }, - configurable: true - }) -}) - -function once (fn) { - var f = function () { - if (f.called) return f.value - f.called = true - return f.value = fn.apply(this, arguments) - } - f.called = false - return f -} - -function onceStrict (fn) { - var f = function () { - if (f.called) - throw new Error(f.onceError) - f.called = true - return f.value = fn.apply(this, arguments) - } - var name = fn.name || 'Function wrapped with `once`' - f.onceError = name + " shouldn't be called more than once" - f.called = false - return f -} - - -/***/ }), - -/***/ 2437: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FileExporterBase = void 0; -const api_1 = __nccwpck_require__(5163); -const core_1 = __nccwpck_require__(3946); -class FileExporterBase { - /* istanbul ignore next */ - constructor(config = {}) { - this._isShutdown = false; - this._shuttingDownPromise = Promise.resolve(); - this._sendingPromises = []; - this.filePath = config.filePath; - this.attributes = config.attributes; - this.shutdown = this.shutdown.bind(this); - this._concurrencyLimit = - typeof config.concurrencyLimit === "number" - ? config.concurrencyLimit - : Infinity; - // platform dependent - this.onInit(config); - } - export(items, resultCallback) { - if (this._isShutdown) { - resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: new Error("Exporter has been shutdown"), - }); - return; - } - if (this._sendingPromises.length >= this._concurrencyLimit) { - resultCallback({ - code: core_1.ExportResultCode.FAILED, - error: new Error("Concurrent export limit reached"), - }); - return; - } - this._export(items) - .then(() => { - resultCallback({ code: core_1.ExportResultCode.SUCCESS }); - }) - .catch((error) => { - resultCallback({ code: core_1.ExportResultCode.FAILED, error }); - }); - } - _export(items) { - return new Promise((resolve, reject) => { - try { - api_1.diag.debug("items to be sent", items); - this.send(items, resolve, reject); - } - catch (e) { - reject(e); - } - }); - } - /** - * Shutdown the exporter. - */ - async shutdown() { - if (this._isShutdown) { - api_1.diag.debug("shutdown already started"); - return this._shuttingDownPromise; - } - this._isShutdown = true; - api_1.diag.debug("shutdown started"); - this._shuttingDownPromise = this._shutdown(); - return await this._shuttingDownPromise; - } - async _shutdown() { - await this.onShutdown(); - await Promise.all(this._sendingPromises); - } -} -exports.FileExporterBase = FileExporterBase; - - -/***/ }), - -/***/ 8595: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(2437), exports); -__exportStar(__nccwpck_require__(1157), exports); -__exportStar(__nccwpck_require__(4214), exports); -__exportStar(__nccwpck_require__(2280), exports); - - -/***/ }), - -/***/ 1157: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(9425), exports); - - -/***/ }), - -/***/ 3125: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (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; -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.FileTraceExporter = void 0; -const api_1 = __nccwpck_require__(5163); -const FileExporterBase_1 = __nccwpck_require__(2437); -const transform_1 = __nccwpck_require__(4214); -const fs = __importStar(__nccwpck_require__(5747)); -class FileTraceExporter extends FileExporterBase_1.FileExporterBase { - constructor(config) { - super(config); - this._stream = this._createWriteStream(); - } - _createWriteStream() { - if (this._stream && !this.isShutdown()) { - return this._stream; - } - return fs.createWriteStream(this.filePath, { flags: "a" }); - } - async onShutdown() { - return new Promise((resolve, reject) => { - try { - this._stream.end(resolve); - } - catch (error) { - /* istanbul ignore next */ - reject(error); - } - }); - } - isShutdown() { - return this._isShutdown && !this._stream.writable; - } - onInit() { - this._isShutdown = false; - this._stream = this._createWriteStream(); - } - send(objects, onSuccess, onError) { - /* istanbul ignore if */ - if (this._isShutdown) { - api_1.diag.debug("Shutdown already started. Cannot send objects"); - return; - } - const serviceRequest = this.convert(objects); - const promise = new Promise((resolve, reject) => { - this._stream.write(JSON.stringify(serviceRequest) + "\n", (err) => { - /* istanbul ignore if */ - if (err) { - reject(err); - } - else { - resolve(); - } - }); - }).then(onSuccess, onError); - this._sendingPromises.push(promise); - const popPromise = () => { - const index = this._sendingPromises.indexOf(promise); - this._sendingPromises.splice(index, 1); - }; - promise.then(popPromise, popPromise); - } - convert(spans) { - return (0, transform_1.toFileExportTraceServiceRequest)(spans, this, true); - } -} -exports.FileTraceExporter = FileTraceExporter; - - -/***/ }), - -/***/ 9425: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(3125), exports); -__exportStar(__nccwpck_require__(6306), exports); - - -/***/ }), - -/***/ 6306: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 4214: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.toFileExportTraceServiceRequest = void 0; -const exporter_trace_otlp_http_1 = __nccwpck_require__(5401); -const transform_1 = __nccwpck_require__(3128); -/** - * Prepares trace service request to be sent to collector - * @param spans spans - * @param collectorExporterBase - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toFileExportTraceServiceRequest(spans, collectorTraceExporterBase, useHex) { - const groupedSpans = (0, transform_1.groupSpansByResourceAndLibrary)(spans); - const additionalAttributes = Object.assign({}, collectorTraceExporterBase.attributes); - return { - resourceSpans: toCollectorResourceSpans(groupedSpans, additionalAttributes, useHex), - }; -} -exports.toFileExportTraceServiceRequest = toFileExportTraceServiceRequest; -/** - * Convert to InstrumentationLibrarySpans - * @param instrumentationLibrary - * @param spans - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex) { - return { - spans: spans.map((span) => (0, transform_1.toCollectorSpan)(span, useHex)), - instrumentationLibrary, - }; -} -/** - * Returns a list of resource spans which will be exported to the collector - * @param groupedSpans - * @param baseAttributes - * @param useHex - if ids should be kept as hex without converting to base64 - */ -function toCollectorResourceSpans(groupedSpans, baseAttributes, useHex) { - return Array.from(groupedSpans, ([resource, libSpans]) => { - return { - resource: (0, exporter_trace_otlp_http_1.toCollectorResource)(resource, baseAttributes), - instrumentationLibrarySpans: Array.from(libSpans, ([instrumentationLibrary, spans]) => toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex)), - }; - }); -} - - -/***/ }), - -/***/ 2280: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); - - -/***/ }), - -/***/ 2883: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ExportResultCode = void 0; -var ExportResultCode; -(function (ExportResultCode) { - ExportResultCode[ExportResultCode["SUCCESS"] = 0] = "SUCCESS"; - ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED"; -})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {})); -//# sourceMappingURL=ExportResult.js.map - -/***/ }), - -/***/ 881: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0; -exports.BAGGAGE_KEY_PAIR_SEPARATOR = '='; -exports.BAGGAGE_PROPERTIES_SEPARATOR = ';'; -exports.BAGGAGE_ITEMS_SEPARATOR = ','; -// Name of the http header used to propagate the baggage -exports.BAGGAGE_HEADER = 'baggage'; -// Maximum number of name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180; -// Maximum number of bytes per a single name-value pair allowed by w3c spec -exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096; -// Maximum total length of all name-value pairs allowed by w3c spec -exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192; -//# sourceMappingURL=constants.js.map - -/***/ }), - -/***/ 1822: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CBaggagePropagator = void 0; -const api_1 = __nccwpck_require__(5163); -const suppress_tracing_1 = __nccwpck_require__(7888); -const constants_1 = __nccwpck_require__(881); -const utils_1 = __nccwpck_require__(5689); -/** - * Propagates {@link Baggage} through Context format propagation. - * - * Based on the Baggage specification: - * https://w3c.github.io/baggage/ - */ -class W3CBaggagePropagator { - inject(context, carrier, setter) { - const baggage = api_1.propagation.getBaggage(context); - if (!baggage || suppress_tracing_1.isTracingSuppressed(context)) - return; - const keyPairs = utils_1.getKeyPairs(baggage) - .filter((pair) => { - return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS; - }) - .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS); - const headerValue = utils_1.serializeKeyPairs(keyPairs); - if (headerValue.length > 0) { - setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue); - } - } - extract(context, carrier, getter) { - const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER); - if (!headerValue) - return context; - const baggage = {}; - if (headerValue.length === 0) { - return context; - } - const pairs = headerValue.split(constants_1.BAGGAGE_ITEMS_SEPARATOR); - pairs.forEach(entry => { - const keyPair = utils_1.parsePairKeyValue(entry); - if (keyPair) { - const baggageEntry = { value: keyPair.value }; - if (keyPair.metadata) { - baggageEntry.metadata = keyPair.metadata; - } - baggage[keyPair.key] = baggageEntry; - } - }); - if (Object.entries(baggage).length === 0) { - return context; - } - return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage)); - } - fields() { - return [constants_1.BAGGAGE_HEADER]; - } -} -exports.W3CBaggagePropagator = W3CBaggagePropagator; -//# sourceMappingURL=W3CBaggagePropagator.js.map - -/***/ }), - -/***/ 5689: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -const api_1 = __nccwpck_require__(5163); -const constants_1 = __nccwpck_require__(881); -function serializeKeyPairs(keyPairs) { - return keyPairs.reduce((hValue, current) => { - const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`; - return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value; - }, ''); -} -exports.serializeKeyPairs = serializeKeyPairs; -function getKeyPairs(baggage) { - return baggage - .getAllEntries() - .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`); -} -exports.getKeyPairs = getKeyPairs; -function parsePairKeyValue(entry) { - const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR); - if (valueProps.length <= 0) - return; - const keyPairPart = valueProps.shift(); - if (!keyPairPart) - return; - const keyPair = keyPairPart.split(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR); - if (keyPair.length !== 2) - return; - const key = decodeURIComponent(keyPair[0].trim()); - const value = decodeURIComponent(keyPair[1].trim()); - let metadata; - if (valueProps.length > 0) { - metadata = api_1.baggageEntryMetadataFromString(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR)); - } - return { key, value, metadata }; -} -exports.parsePairKeyValue = parsePairKeyValue; -/** - * Parse a string serialized in the baggage HTTP Format (without metadata): - * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md - */ -function parseKeyPairsIntoRecord(value) { - if (typeof value !== 'string' || value.length === 0) - return {}; - return value - .split(constants_1.BAGGAGE_ITEMS_SEPARATOR) - .map(entry => { - return parsePairKeyValue(entry); - }) - .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0) - .reduce((headers, keyPair) => { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - headers[keyPair.key] = keyPair.value; - return headers; - }, {}); -} -exports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord; -//# sourceMappingURL=utils.js.map - -/***/ }), - -/***/ 4099: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isAttributeValue = exports.sanitizeAttributes = void 0; -function sanitizeAttributes(attributes) { - const out = {}; - if (attributes == null || typeof attributes !== 'object') { - return out; - } - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - for (const [k, v] of Object.entries(attributes)) { - if (isAttributeValue(v)) { - if (Array.isArray(v)) { - out[k] = v.slice(); - } - else { - out[k] = v; - } - } - } - return out; -} -exports.sanitizeAttributes = sanitizeAttributes; -function isAttributeValue(val) { - if (val == null) { - return true; - } - if (Array.isArray(val)) { - return isHomogeneousAttributeValueArray(val); - } - return isValidPrimitiveAttributeValue(val); -} -exports.isAttributeValue = isAttributeValue; -function isHomogeneousAttributeValueArray(arr) { - let type; - for (const element of arr) { - // null/undefined elements are allowed - if (element == null) - continue; - if (!type) { - if (isValidPrimitiveAttributeValue(element)) { - type = typeof element; - continue; - } - // encountered an invalid primitive - return false; - } - if (typeof element === type) { - continue; - } - return false; - } - return true; -} -function isValidPrimitiveAttributeValue(val) { - switch (typeof val) { - case 'number': - return true; - case 'boolean': - return true; - case 'string': - return true; - } - return false; -} -//# sourceMappingURL=attributes.js.map - -/***/ }), - -/***/ 2442: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.globalErrorHandler = exports.setGlobalErrorHandler = void 0; -const logging_error_handler_1 = __nccwpck_require__(6286); -/** The global error handler delegate */ -let delegateHandler = logging_error_handler_1.loggingErrorHandler(); -/** - * Set the global error handler - * @param {ErrorHandler} handler - */ -function setGlobalErrorHandler(handler) { - delegateHandler = handler; -} -exports.setGlobalErrorHandler = setGlobalErrorHandler; -/** - * Return the global error handler - * @param {Exception} ex - */ -function globalErrorHandler(ex) { - try { - delegateHandler(ex); - } - catch (_a) { } // eslint-disable-line no-empty -} -exports.globalErrorHandler = globalErrorHandler; -//# sourceMappingURL=global-error-handler.js.map - -/***/ }), - -/***/ 6286: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.loggingErrorHandler = void 0; -const api_1 = __nccwpck_require__(5163); -/** - * Returns a function that logs an error using the provided logger, or a - * console logger if one was not provided. - */ -function loggingErrorHandler() { - return (ex) => { - api_1.diag.error(stringifyException(ex)); - }; -} -exports.loggingErrorHandler = loggingErrorHandler; -/** - * Converts an exception into a string representation - * @param {Exception} ex - */ -function stringifyException(ex) { - if (typeof ex === 'string') { - return ex; - } - else { - return JSON.stringify(flattenException(ex)); - } -} -/** - * Flattens an exception into key-value pairs by traversing the prototype chain - * and coercing values to strings. Duplicate properties will not be overwritten; - * the first insert wins. - */ -function flattenException(ex) { - const result = {}; - let current = ex; - while (current !== null) { - Object.getOwnPropertyNames(current).forEach(propertyName => { - if (result[propertyName]) - return; - const value = current[propertyName]; - if (value) { - result[propertyName] = String(value); - } - }); - current = Object.getPrototypeOf(current); - } - return result; -} -//# sourceMappingURL=logging-error-handler.js.map - -/***/ }), - -/***/ 6843: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = void 0; -const platform_1 = __nccwpck_require__(4228); -const NANOSECOND_DIGITS = 9; -const SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS); -/** - * Converts a number to HrTime, HrTime = [number, number]. - * The first number is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. - * The second number represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. - * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. - * numberToHrtime calculates the first number by converting and truncating the Epoch time in milliseconds to seconds: - * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. - * numberToHrtime calculates the second number by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: - * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * SECOND_TO_NANOSECONDS = 150000000. - * This is represented in HrTime format as [1609504210, 150000000]. - * @param epochMillis - */ -function numberToHrtime(epochMillis) { - const epochSeconds = epochMillis / 1000; - // Decimals only. - const seconds = Math.trunc(epochSeconds); - // Round sub-nanosecond accuracy to nanosecond. - const nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) * - SECOND_TO_NANOSECONDS; - return [seconds, nanos]; -} -function getTimeOrigin() { - let timeOrigin = platform_1.otperformance.timeOrigin; - if (typeof timeOrigin !== 'number') { - const perf = platform_1.otperformance; - timeOrigin = perf.timing && perf.timing.fetchStart; - } - return timeOrigin; -} -/** - * Returns an hrtime calculated via performance component. - * @param performanceNow - */ -function hrTime(performanceNow) { - const timeOrigin = numberToHrtime(getTimeOrigin()); - const now = numberToHrtime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now()); - let seconds = timeOrigin[0] + now[0]; - let nanos = timeOrigin[1] + now[1]; - // Nanoseconds - if (nanos > SECOND_TO_NANOSECONDS) { - nanos -= SECOND_TO_NANOSECONDS; - seconds += 1; - } - return [seconds, nanos]; -} -exports.hrTime = hrTime; -/** - * - * Converts a TimeInput to an HrTime, defaults to _hrtime(). - * @param time - */ -function timeInputToHrTime(time) { - // process.hrtime - if (isTimeInputHrTime(time)) { - return time; - } - else if (typeof time === 'number') { - // Must be a performance.now() if it's smaller than process start time. - if (time < getTimeOrigin()) { - return hrTime(time); - } - else { - // epoch milliseconds or performance.timeOrigin - return numberToHrtime(time); - } - } - else if (time instanceof Date) { - return numberToHrtime(time.getTime()); - } - else { - throw TypeError('Invalid input type'); - } -} -exports.timeInputToHrTime = timeInputToHrTime; -/** - * Returns a duration of two hrTime. - * @param startTime - * @param endTime - */ -function hrTimeDuration(startTime, endTime) { - let seconds = endTime[0] - startTime[0]; - let nanos = endTime[1] - startTime[1]; - // overflow - if (nanos < 0) { - seconds -= 1; - // negate - nanos += SECOND_TO_NANOSECONDS; - } - return [seconds, nanos]; -} -exports.hrTimeDuration = hrTimeDuration; -/** - * Convert hrTime to timestamp, for example "2019-05-14T17:00:00.000123456Z" - * @param time - */ -function hrTimeToTimeStamp(time) { - const precision = NANOSECOND_DIGITS; - const tmp = `${'0'.repeat(precision)}${time[1]}Z`; - const nanoString = tmp.substr(tmp.length - precision - 1); - const date = new Date(time[0] * 1000).toISOString(); - return date.replace('000Z', nanoString); -} -exports.hrTimeToTimeStamp = hrTimeToTimeStamp; -/** - * Convert hrTime to nanoseconds. - * @param time - */ -function hrTimeToNanoseconds(time) { - return time[0] * SECOND_TO_NANOSECONDS + time[1]; -} -exports.hrTimeToNanoseconds = hrTimeToNanoseconds; -/** - * Convert hrTime to milliseconds. - * @param time - */ -function hrTimeToMilliseconds(time) { - return Math.round(time[0] * 1e3 + time[1] / 1e6); -} -exports.hrTimeToMilliseconds = hrTimeToMilliseconds; -/** - * Convert hrTime to microseconds. - * @param time - */ -function hrTimeToMicroseconds(time) { - return Math.round(time[0] * 1e6 + time[1] / 1e3); -} -exports.hrTimeToMicroseconds = hrTimeToMicroseconds; -/** - * check if time is HrTime - * @param value - */ -function isTimeInputHrTime(value) { - return (Array.isArray(value) && - value.length === 2 && - typeof value[0] === 'number' && - typeof value[1] === 'number'); -} -exports.isTimeInputHrTime = isTimeInputHrTime; -/** - * check if input value is a correct types.TimeInput - * @param value - */ -function isTimeInput(value) { - return (isTimeInputHrTime(value) || - typeof value === 'number' || - value instanceof Date); -} -exports.isTimeInput = isTimeInput; -//# sourceMappingURL=time.js.map - -/***/ }), - -/***/ 4472: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=types.js.map - -/***/ }), - -/***/ 3946: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.baggageUtils = void 0; -__exportStar(__nccwpck_require__(1822), exports); -__exportStar(__nccwpck_require__(4099), exports); -__exportStar(__nccwpck_require__(2442), exports); -__exportStar(__nccwpck_require__(6286), exports); -__exportStar(__nccwpck_require__(6843), exports); -__exportStar(__nccwpck_require__(4472), exports); -__exportStar(__nccwpck_require__(2883), exports); -__exportStar(__nccwpck_require__(4047), exports); -exports.baggageUtils = __nccwpck_require__(5689); -__exportStar(__nccwpck_require__(4228), exports); -__exportStar(__nccwpck_require__(9484), exports); -__exportStar(__nccwpck_require__(6962), exports); -__exportStar(__nccwpck_require__(1849), exports); -__exportStar(__nccwpck_require__(6453), exports); -__exportStar(__nccwpck_require__(8440), exports); -__exportStar(__nccwpck_require__(4061), exports); -__exportStar(__nccwpck_require__(3322), exports); -__exportStar(__nccwpck_require__(9123), exports); -__exportStar(__nccwpck_require__(7888), exports); -__exportStar(__nccwpck_require__(1959), exports); -__exportStar(__nccwpck_require__(2421), exports); -__exportStar(__nccwpck_require__(7336), exports); -__exportStar(__nccwpck_require__(6369), exports); -__exportStar(__nccwpck_require__(8100), exports); -__exportStar(__nccwpck_require__(3369), exports); -__exportStar(__nccwpck_require__(4047), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 8285: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.validateValue = exports.validateKey = void 0; -const VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]'; -const VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`; -const VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`; -const VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`); -const VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/; -const INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/; -/** - * Key is opaque string up to 256 characters printable. It MUST begin with a - * lowercase letter, and can only contain lowercase letters a-z, digits 0-9, - * underscores _, dashes -, asterisks *, and forward slashes /. - * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the - * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key. - * see https://www.w3.org/TR/trace-context/#key - */ -function validateKey(key) { - return VALID_KEY_REGEX.test(key); -} -exports.validateKey = validateKey; -/** - * Value is opaque string up to 256 characters printable ASCII RFC0020 - * characters (i.e., the range 0x20 to 0x7E) except comma , and =. - */ -function validateValue(value) { - return (VALID_VALUE_BASE_REGEX.test(value) && - !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value)); -} -exports.validateValue = validateValue; -//# sourceMappingURL=validators.js.map - -/***/ }), - -/***/ 4228: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -__exportStar(__nccwpck_require__(840), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 1620: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.RandomIdGenerator = void 0; -const SPAN_ID_BYTES = 8; -const TRACE_ID_BYTES = 16; -class RandomIdGenerator { - constructor() { - /** - * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex - * characters corresponding to 128 bits. - */ - this.generateTraceId = getIdGenerator(TRACE_ID_BYTES); - /** - * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex - * characters corresponding to 64 bits. - */ - this.generateSpanId = getIdGenerator(SPAN_ID_BYTES); - } -} -exports.RandomIdGenerator = RandomIdGenerator; -const SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES); -function getIdGenerator(bytes) { - return function generateId() { - for (let i = 0; i < bytes / 4; i++) { - // unsigned right shift drops decimal part of the number - // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE - SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4); - } - // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated - for (let i = 0; i < bytes; i++) { - if (SHARED_BUFFER[i] > 0) { - break; - } - else if (i === bytes - 1) { - SHARED_BUFFER[bytes - 1] = 1; - } - } - return SHARED_BUFFER.toString('hex', 0, bytes); - }; -} -//# sourceMappingURL=RandomIdGenerator.js.map - -/***/ }), - -/***/ 3790: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getEnv = void 0; -const os = __nccwpck_require__(2087); -const environment_1 = __nccwpck_require__(2421); -/** - * Gets the environment variables - */ -function getEnv() { - const processEnv = environment_1.parseEnvironment(process.env); - return Object.assign({ - HOSTNAME: os.hostname(), - }, environment_1.DEFAULT_ENVIRONMENT, processEnv); -} -exports.getEnv = getEnv; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 7327: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports._globalThis = void 0; -/** only globals that common to node and browsers are allowed */ -// eslint-disable-next-line node/no-unsupported-features/es-builtins -exports._globalThis = typeof globalThis === 'object' ? globalThis : global; -//# sourceMappingURL=globalThis.js.map - -/***/ }), - -/***/ 4044: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.hexToBase64 = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function hexToBase64(hexStr) { - const hexStrLen = hexStr.length; - let hexAsciiCharsStr = ''; - for (let i = 0; i < hexStrLen; i += 2) { - const hexPair = hexStr.substring(i, i + 2); - const hexVal = parseInt(hexPair, 16); - hexAsciiCharsStr += String.fromCharCode(hexVal); - } - return Buffer.from(hexAsciiCharsStr, 'ascii').toString('base64'); -} -exports.hexToBase64 = hexToBase64; -//# sourceMappingURL=hex-to-base64.js.map - -/***/ }), - -/***/ 840: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(3790), exports); -__exportStar(__nccwpck_require__(7327), exports); -__exportStar(__nccwpck_require__(4044), exports); -__exportStar(__nccwpck_require__(1620), exports); -__exportStar(__nccwpck_require__(3661), exports); -__exportStar(__nccwpck_require__(2752), exports); -__exportStar(__nccwpck_require__(9199), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 3661: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.otperformance = void 0; -const perf_hooks_1 = __nccwpck_require__(630); -exports.otperformance = perf_hooks_1.performance; -//# sourceMappingURL=performance.js.map - -/***/ }), - -/***/ 2752: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.SDK_INFO = void 0; -const version_1 = __nccwpck_require__(4047); -const semantic_conventions_1 = __nccwpck_require__(820); -/** Constants describing the SDK in use */ -exports.SDK_INFO = { - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry', - [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'node', - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TelemetrySdkLanguageValues.NODEJS, - [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: version_1.VERSION, -}; -//# sourceMappingURL=sdk-info.js.map - -/***/ }), - -/***/ 9199: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.unrefTimer = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function unrefTimer(timer) { - timer.unref(); -} -exports.unrefTimer = unrefTimer; -//# sourceMappingURL=timer-util.js.map - -/***/ }), - -/***/ 9484: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.CompositePropagator = void 0; -const api_1 = __nccwpck_require__(5163); -/** Combines multiple propagators into a single propagator. */ -class CompositePropagator { - /** - * Construct a composite propagator from a list of propagators. - * - * @param [config] Configuration object for composite propagator - */ - constructor(config = {}) { - var _a; - this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : []; - this._fields = Array.from(new Set(this._propagators - // older propagators may not have fields function, null check to be sure - .map(p => (typeof p.fields === 'function' ? p.fields() : [])) - .reduce((x, y) => x.concat(y), []))); - } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same carrier key, the propagator later in the list - * will "win". - * - * @param context Context to inject - * @param carrier Carrier into which context will be injected - */ - inject(context, carrier, setter) { - for (const propagator of this._propagators) { - try { - propagator.inject(context, carrier, setter); - } - catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); - } - } - } - /** - * Run each of the configured propagators with the given context and carrier. - * Propagators are run in the order they are configured, so if multiple - * propagators write the same context key, the propagator later in the list - * will "win". - * - * @param context Context to add values to - * @param carrier Carrier from which to extract context - */ - extract(context, carrier, getter) { - return this._propagators.reduce((ctx, propagator) => { - try { - return propagator.extract(ctx, carrier, getter); - } - catch (err) { - api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`); - } - return ctx; - }, context); - } - fields() { - // return a new array so our fields cannot be modified - return this._fields.slice(); - } -} -exports.CompositePropagator = CompositePropagator; -//# sourceMappingURL=composite.js.map - -/***/ }), - -/***/ 1849: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -//# sourceMappingURL=IdGenerator.js.map - -/***/ }), - -/***/ 1959: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceState = void 0; -const validators_1 = __nccwpck_require__(8285); -const MAX_TRACE_STATE_ITEMS = 32; -const MAX_TRACE_STATE_LEN = 512; -const LIST_MEMBERS_SEPARATOR = ','; -const LIST_MEMBER_KEY_VALUE_SPLITTER = '='; -/** - * TraceState must be a class and not a simple object type because of the spec - * requirement (https://www.w3.org/TR/trace-context/#tracestate-field). - * - * Here is the list of allowed mutations: - * - New key-value pair should be added into the beginning of the list - * - The value of any key can be updated. Modified keys MUST be moved to the - * beginning of the list. - */ -class TraceState { - constructor(rawTraceState) { - this._internalState = new Map(); - if (rawTraceState) - this._parse(rawTraceState); - } - set(key, value) { - // TODO: Benchmark the different approaches(map vs list) and - // use the faster one. - const traceState = this._clone(); - if (traceState._internalState.has(key)) { - traceState._internalState.delete(key); - } - traceState._internalState.set(key, value); - return traceState; - } - unset(key) { - const traceState = this._clone(); - traceState._internalState.delete(key); - return traceState; - } - get(key) { - return this._internalState.get(key); - } - serialize() { - return this._keys() - .reduce((agg, key) => { - agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key)); - return agg; - }, []) - .join(LIST_MEMBERS_SEPARATOR); - } - _parse(rawTraceState) { - if (rawTraceState.length > MAX_TRACE_STATE_LEN) - return; - this._internalState = rawTraceState - .split(LIST_MEMBERS_SEPARATOR) - .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning - .reduce((agg, part) => { - const listMember = part.trim(); // Optional Whitespace (OWS) handling - const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER); - if (i !== -1) { - const key = listMember.slice(0, i); - const value = listMember.slice(i + 1, part.length); - if (validators_1.validateKey(key) && validators_1.validateValue(value)) { - agg.set(key, value); - } - else { - // TODO: Consider to add warning log - } - } - return agg; - }, new Map()); - // Because of the reverse() requirement, trunc must be done after map is created - if (this._internalState.size > MAX_TRACE_STATE_ITEMS) { - this._internalState = new Map(Array.from(this._internalState.entries()) - .reverse() // Use reverse same as original tracestate parse chain - .slice(0, MAX_TRACE_STATE_ITEMS)); - } - } - _keys() { - return Array.from(this._internalState.keys()).reverse(); - } - _clone() { - const traceState = new TraceState(); - traceState._internalState = new Map(this._internalState); - return traceState; - } -} -exports.TraceState = TraceState; -//# sourceMappingURL=TraceState.js.map - -/***/ }), - -/***/ 6962: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0; -const api_1 = __nccwpck_require__(5163); -const suppress_tracing_1 = __nccwpck_require__(7888); -const TraceState_1 = __nccwpck_require__(1959); -exports.TRACE_PARENT_HEADER = 'traceparent'; -exports.TRACE_STATE_HEADER = 'tracestate'; -const VERSION = '00'; -const VERSION_PART = '(?!ff)[\\da-f]{2}'; -const TRACE_ID_PART = '(?![0]{32})[\\da-f]{32}'; -const PARENT_ID_PART = '(?![0]{16})[\\da-f]{16}'; -const FLAGS_PART = '[\\da-f]{2}'; -const TRACE_PARENT_REGEX = new RegExp(`^\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\s?$`); -/** - * Parses information from the [traceparent] span tag and converts it into {@link SpanContext} - * @param traceParent - A meta property that comes from server. - * It should be dynamically generated server side to have the server's request trace Id, - * a parent span Id that was set on the server's request span, - * and the trace flags to indicate the server's sampling decision - * (01 = sampled, 00 = not sampled). - * for example: '{version}-{traceId}-{spanId}-{sampleDecision}' - * For more information see {@link https://www.w3.org/TR/trace-context/} - */ -function parseTraceParent(traceParent) { - const match = TRACE_PARENT_REGEX.exec(traceParent); - if (!match) - return null; - // According to the specification the implementation should be compatible - // with future versions. If there are more parts, we only reject it if it's using version 00 - // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent - if (match[1] === '00' && match[5]) - return null; - return { - traceId: match[2], - spanId: match[3], - traceFlags: parseInt(match[4], 16), - }; -} -exports.parseTraceParent = parseTraceParent; -/** - * Propagates {@link SpanContext} through Trace Context format propagation. - * - * Based on the Trace Context specification: - * https://www.w3.org/TR/trace-context/ - */ -class W3CTraceContextPropagator { - inject(context, carrier, setter) { - const spanContext = api_1.trace.getSpanContext(context); - if (!spanContext || - suppress_tracing_1.isTracingSuppressed(context) || - !api_1.isSpanContextValid(spanContext)) - return; - const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`; - setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent); - if (spanContext.traceState) { - setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize()); - } - } - extract(context, carrier, getter) { - const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER); - if (!traceParentHeader) - return context; - const traceParent = Array.isArray(traceParentHeader) - ? traceParentHeader[0] - : traceParentHeader; - if (typeof traceParent !== 'string') - return context; - const spanContext = parseTraceParent(traceParent); - if (!spanContext) - return context; - spanContext.isRemote = true; - const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER); - if (traceStateHeader) { - // If more than one `tracestate` header is found, we merge them into a - // single header. - const state = Array.isArray(traceStateHeader) - ? traceStateHeader.join(',') - : traceStateHeader; - spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined); - } - return api_1.trace.setSpanContext(context, spanContext); - } - fields() { - return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER]; - } -} -exports.W3CTraceContextPropagator = W3CTraceContextPropagator; -//# sourceMappingURL=W3CTraceContextPropagator.js.map - -/***/ }), - -/***/ 6453: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0; -const api_1 = __nccwpck_require__(5163); -const RPC_METADATA_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key RPC_METADATA'); -var RPCType; -(function (RPCType) { - RPCType["HTTP"] = "http"; -})(RPCType = exports.RPCType || (exports.RPCType = {})); -function setRPCMetadata(context, meta) { - return context.setValue(RPC_METADATA_KEY, meta); -} -exports.setRPCMetadata = setRPCMetadata; -function deleteRPCMetadata(context) { - return context.deleteValue(RPC_METADATA_KEY); -} -exports.deleteRPCMetadata = deleteRPCMetadata; -function getRPCMetadata(context) { - return context.getValue(RPC_METADATA_KEY); -} -exports.getRPCMetadata = getRPCMetadata; -//# sourceMappingURL=rpc-metadata.js.map - -/***/ }), - -/***/ 8440: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOffSampler = void 0; -const api_1 = __nccwpck_require__(5163); -/** Sampler that samples no traces. */ -class AlwaysOffSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return 'AlwaysOffSampler'; - } -} -exports.AlwaysOffSampler = AlwaysOffSampler; -//# sourceMappingURL=AlwaysOffSampler.js.map - -/***/ }), - -/***/ 4061: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.AlwaysOnSampler = void 0; -const api_1 = __nccwpck_require__(5163); -/** Sampler that samples all traces. */ -class AlwaysOnSampler { - shouldSample() { - return { - decision: api_1.SamplingDecision.RECORD_AND_SAMPLED, - }; - } - toString() { - return 'AlwaysOnSampler'; - } -} -exports.AlwaysOnSampler = AlwaysOnSampler; -//# sourceMappingURL=AlwaysOnSampler.js.map - -/***/ }), - -/***/ 3322: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.ParentBasedSampler = void 0; -const api_1 = __nccwpck_require__(5163); -const global_error_handler_1 = __nccwpck_require__(2442); -const AlwaysOffSampler_1 = __nccwpck_require__(8440); -const AlwaysOnSampler_1 = __nccwpck_require__(4061); -/** - * A composite sampler that either respects the parent span's sampling decision - * or delegates to `delegateSampler` for root spans. - */ -class ParentBasedSampler { - constructor(config) { - var _a, _b, _c, _d; - this._root = config.root; - if (!this._root) { - global_error_handler_1.globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured')); - this._root = new AlwaysOnSampler_1.AlwaysOnSampler(); - } - this._remoteParentSampled = - (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._remoteParentNotSampled = - (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler(); - this._localParentSampled = - (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler(); - this._localParentNotSampled = - (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler(); - } - shouldSample(context, traceId, spanName, spanKind, attributes, links) { - const parentContext = api_1.trace.getSpanContext(context); - if (!parentContext || !api_1.isSpanContextValid(parentContext)) { - return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.isRemote) { - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) { - return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links); - } - toString() { - return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`; - } -} -exports.ParentBasedSampler = ParentBasedSampler; -//# sourceMappingURL=ParentBasedSampler.js.map - -/***/ }), - -/***/ 9123: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TraceIdRatioBasedSampler = void 0; -const api_1 = __nccwpck_require__(5163); -/** Sampler that samples a given fraction of traces based of trace id deterministically. */ -class TraceIdRatioBasedSampler { - constructor(_ratio = 0) { - this._ratio = _ratio; - this._ratio = this._normalize(_ratio); - this._upperBound = Math.floor(this._ratio * 0xffffffff); - } - shouldSample(context, traceId) { - return { - decision: api_1.isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound - ? api_1.SamplingDecision.RECORD_AND_SAMPLED - : api_1.SamplingDecision.NOT_RECORD, - }; - } - toString() { - return `TraceIdRatioBased{${this._ratio}}`; - } - _normalize(ratio) { - if (typeof ratio !== 'number' || isNaN(ratio)) - return 0; - return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio; - } - _accumulate(traceId) { - let accumulation = 0; - for (let i = 0; i < traceId.length / 8; i++) { - const pos = i * 8; - const part = parseInt(traceId.slice(pos, pos + 8), 16); - accumulation = (accumulation ^ part) >>> 0; - } - return accumulation; - } -} -exports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler; -//# sourceMappingURL=TraceIdRatioBasedSampler.js.map - -/***/ }), - -/***/ 7888: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0; -const api_1 = __nccwpck_require__(5163); -const SUPPRESS_TRACING_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING'); -function suppressTracing(context) { - return context.setValue(SUPPRESS_TRACING_KEY, true); -} -exports.suppressTracing = suppressTracing; -function unsuppressTracing(context) { - return context.deleteValue(SUPPRESS_TRACING_KEY); -} -exports.unsuppressTracing = unsuppressTracing; -function isTracingSuppressed(context) { - return context.getValue(SUPPRESS_TRACING_KEY) === true; -} -exports.isTracingSuppressed = isTracingSuppressed; -//# sourceMappingURL=suppress-tracing.js.map - -/***/ }), - -/***/ 2421: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0; -const api_1 = __nccwpck_require__(5163); -const sampling_1 = __nccwpck_require__(6369); -const DEFAULT_LIST_SEPARATOR = ','; -/** - * Environment interface to define all names - */ -const ENVIRONMENT_NUMBERS_KEYS = [ - 'OTEL_BSP_EXPORT_TIMEOUT', - 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE', - 'OTEL_BSP_MAX_QUEUE_SIZE', - 'OTEL_BSP_SCHEDULE_DELAY', - 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT', - 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT', - 'OTEL_SPAN_EVENT_COUNT_LIMIT', - 'OTEL_SPAN_LINK_COUNT_LIMIT', -]; -function isEnvVarANumber(key) { - return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1); -} -const ENVIRONMENT_LISTS_KEYS = [ - 'OTEL_NO_PATCH_MODULES', - 'OTEL_PROPAGATORS', -]; -function isEnvVarAList(key) { - return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1; -} -exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity; -exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128; -/** - * Default environment variables - */ -exports.DEFAULT_ENVIRONMENT = { - CONTAINER_NAME: '', - ECS_CONTAINER_METADATA_URI_V4: '', - ECS_CONTAINER_METADATA_URI: '', - HOSTNAME: '', - KUBERNETES_SERVICE_HOST: '', - NAMESPACE: '', - OTEL_BSP_EXPORT_TIMEOUT: 30000, - OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512, - OTEL_BSP_MAX_QUEUE_SIZE: 2048, - OTEL_BSP_SCHEDULE_DELAY: 5000, - OTEL_EXPORTER_JAEGER_AGENT_HOST: '', - OTEL_EXPORTER_JAEGER_ENDPOINT: '', - OTEL_EXPORTER_JAEGER_PASSWORD: '', - OTEL_EXPORTER_JAEGER_USER: '', - OTEL_EXPORTER_OTLP_ENDPOINT: '', - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '', - OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '', - OTEL_EXPORTER_OTLP_HEADERS: '', - OTEL_EXPORTER_OTLP_TRACES_HEADERS: '', - OTEL_EXPORTER_OTLP_METRICS_HEADERS: '', - OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans', - OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO, - OTEL_NO_PATCH_MODULES: [], - OTEL_PROPAGATORS: ['tracecontext', 'baggage'], - OTEL_RESOURCE_ATTRIBUTES: '', - OTEL_SERVICE_NAME: '', - OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT, - OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT, - OTEL_SPAN_EVENT_COUNT_LIMIT: 128, - OTEL_SPAN_LINK_COUNT_LIMIT: 128, - OTEL_TRACES_EXPORTER: 'none', - OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn, - OTEL_TRACES_SAMPLER_ARG: '', -}; -/** - * Parses a variable as number with number validation - * @param name - * @param environment - * @param values - * @param min - * @param max - */ -function parseNumber(name, environment, values, min = -Infinity, max = Infinity) { - if (typeof values[name] !== 'undefined') { - const value = Number(values[name]); - if (!isNaN(value)) { - if (value < min) { - environment[name] = min; - } - else if (value > max) { - environment[name] = max; - } - else { - environment[name] = value; - } - } - } -} -/** - * Parses list-like strings from input into output. - * @param name - * @param environment - * @param values - * @param separator - */ -function parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) { - const givenValue = input[name]; - if (typeof givenValue === 'string') { - output[name] = givenValue.split(separator).map(v => v.trim()); - } -} -// The support string -> DiagLogLevel mappings -const logLevelMap = { - ALL: api_1.DiagLogLevel.ALL, - VERBOSE: api_1.DiagLogLevel.VERBOSE, - DEBUG: api_1.DiagLogLevel.DEBUG, - INFO: api_1.DiagLogLevel.INFO, - WARN: api_1.DiagLogLevel.WARN, - ERROR: api_1.DiagLogLevel.ERROR, - NONE: api_1.DiagLogLevel.NONE, -}; -/** - * Environmentally sets log level if valid log level string is provided - * @param key - * @param environment - * @param values - */ -function setLogLevelFromEnv(key, environment, values) { - const value = values[key]; - if (typeof value === 'string') { - const theLevel = logLevelMap[value.toUpperCase()]; - if (theLevel != null) { - environment[key] = theLevel; - } - } -} -/** - * Parses environment values - * @param values - */ -function parseEnvironment(values) { - const environment = {}; - for (const env in exports.DEFAULT_ENVIRONMENT) { - const key = env; - switch (key) { - case 'OTEL_LOG_LEVEL': - setLogLevelFromEnv(key, environment, values); - break; - default: - if (isEnvVarANumber(key)) { - parseNumber(key, environment, values); - } - else if (isEnvVarAList(key)) { - parseStringList(key, environment, values); - } - else { - const value = values[key]; - if (typeof value !== 'undefined' && value !== null) { - environment[key] = String(value); - } - } - } - } - return environment; -} -exports.parseEnvironment = parseEnvironment; -//# sourceMappingURL=environment.js.map - -/***/ }), - -/***/ 329: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isPlainObject = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -/** - * based on lodash in order to support esm builds without esModuleInterop. - * lodash is using MIT License. - **/ -const objectTag = '[object Object]'; -const nullTag = '[object Null]'; -const undefinedTag = '[object Undefined]'; -const funcProto = Function.prototype; -const funcToString = funcProto.toString; -const objectCtorString = funcToString.call(Object); -const getPrototype = overArg(Object.getPrototypeOf, Object); -const objectProto = Object.prototype; -const hasOwnProperty = objectProto.hasOwnProperty; -const symToStringTag = Symbol ? Symbol.toStringTag : undefined; -const nativeObjectToString = objectProto.toString; -/** - * Creates a unary function that invokes `func` with its argument transformed. - * - * @private - * @param {Function} func The function to wrap. - * @param {Function} transform The argument transform. - * @returns {Function} Returns the new function. - */ -function overArg(func, transform) { - return function (arg) { - return func(transform(arg)); - }; -} -/** - * Checks if `value` is a plain object, that is, an object created by the - * `Object` constructor or one with a `[[Prototype]]` of `null`. - * - * @static - * @memberOf _ - * @since 0.8.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. - * @example - * - * function Foo() { - * this.a = 1; - * } - * - * _.isPlainObject(new Foo); - * // => false - * - * _.isPlainObject([1, 2, 3]); - * // => false - * - * _.isPlainObject({ 'x': 0, 'y': 0 }); - * // => true - * - * _.isPlainObject(Object.create(null)); - * // => true - */ -function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) !== objectTag) { - return false; - } - const proto = getPrototype(value); - if (proto === null) { - return true; - } - const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) === objectCtorString; -} -exports.isPlainObject = isPlainObject; -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; -} -/** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); -} -/** - * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the raw `toStringTag`. - */ -function getRawTag(value) { - const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; - let unmasked = false; - try { - value[symToStringTag] = undefined; - unmasked = true; - } - catch (e) { - // silence - } - const result = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } - else { - delete value[symToStringTag]; - } - } - return result; -} -/** - * Converts `value` to a string using `Object.prototype.toString`. - * - * @private - * @param {*} value The value to convert. - * @returns {string} Returns the converted string. - */ -function objectToString(value) { - return nativeObjectToString.call(value); -} -//# sourceMappingURL=lodash.merge.js.map - -/***/ }), - -/***/ 7336: -/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.merge = void 0; -/* eslint-disable @typescript-eslint/no-explicit-any */ -const lodash_merge_1 = __nccwpck_require__(329); -const MAX_LEVEL = 20; -/** - * Merges objects together - * @param args - objects / values to be merged - */ -function merge(...args) { - let result = args.shift(); - const objects = new WeakMap(); - while (args.length > 0) { - result = mergeTwoObjects(result, args.shift(), 0, objects); - } - return result; -} -exports.merge = merge; -function takeValue(value) { - if (isArray(value)) { - return value.slice(); - } - return value; -} -/** - * Merges two objects - * @param one - first object - * @param two - second object - * @param level - current deep level - * @param objects - objects holder that has been already referenced - to prevent - * cyclic dependency - */ -function mergeTwoObjects(one, two, level = 0, objects) { - let result; - if (level > MAX_LEVEL) { - return undefined; - } - level++; - if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) { - result = takeValue(two); - } - else if (isArray(one)) { - result = one.slice(); - if (isArray(two)) { - for (let i = 0, j = two.length; i < j; i++) { - result.push(takeValue(two[i])); - } - } - else if (isObject(two)) { - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - result[key] = takeValue(two[key]); - } - } - } - else if (isObject(one)) { - if (isObject(two)) { - if (!shouldMerge(one, two)) { - return two; - } - result = Object.assign({}, one); - const keys = Object.keys(two); - for (let i = 0, j = keys.length; i < j; i++) { - const key = keys[i]; - const twoValue = two[key]; - if (isPrimitive(twoValue)) { - if (typeof twoValue === 'undefined') { - delete result[key]; - } - else { - // result[key] = takeValue(twoValue); - result[key] = twoValue; - } - } - else { - const obj1 = result[key]; - const obj2 = twoValue; - if (wasObjectReferenced(one, key, objects) || - wasObjectReferenced(two, key, objects)) { - delete result[key]; - } - else { - if (isObject(obj1) && isObject(obj2)) { - const arr1 = objects.get(obj1) || []; - const arr2 = objects.get(obj2) || []; - arr1.push({ obj: one, key }); - arr2.push({ obj: two, key }); - objects.set(obj1, arr1); - objects.set(obj2, arr2); - } - result[key] = mergeTwoObjects(result[key], twoValue, level, objects); - } - } - } - } - else { - result = two; - } - } - return result; -} -/** - * Function to check if object has been already reference - * @param obj - * @param key - * @param objects - */ -function wasObjectReferenced(obj, key, objects) { - const arr = objects.get(obj[key]) || []; - for (let i = 0, j = arr.length; i < j; i++) { - const info = arr[i]; - if (info.key === key && info.obj === obj) { - return true; - } - } - return false; -} -function isArray(value) { - return Array.isArray(value); -} -function isFunction(value) { - return typeof value === 'function'; -} -function isObject(value) { - return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === 'object'; -} -function isPrimitive(value) { - return typeof value === 'string' || - typeof value === 'number' || - typeof value === 'boolean' || - typeof value === 'undefined' || - value instanceof Date || - value instanceof RegExp || - value === null; -} -function shouldMerge(one, two) { - if (!lodash_merge_1.isPlainObject(one) || !lodash_merge_1.isPlainObject(two)) { - return false; - } - return true; -} -//# sourceMappingURL=merge.js.map - -/***/ }), - -/***/ 6369: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TracesSamplerValues = void 0; -var TracesSamplerValues; -(function (TracesSamplerValues) { - TracesSamplerValues["AlwaysOff"] = "always_off"; - TracesSamplerValues["AlwaysOn"] = "always_on"; - TracesSamplerValues["ParentBasedAlwaysOff"] = "parentbased_always_off"; - TracesSamplerValues["ParentBasedAlwaysOn"] = "parentbased_always_on"; - TracesSamplerValues["ParentBasedTraceIdRatio"] = "parentbased_traceidratio"; - TracesSamplerValues["TraceIdRatio"] = "traceidratio"; -})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {})); -//# sourceMappingURL=sampling.js.map - -/***/ }), - -/***/ 8100: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isUrlIgnored = exports.urlMatches = void 0; -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -function urlMatches(url, urlToMatch) { - if (typeof urlToMatch === 'string') { - return url === urlToMatch; - } - else { - return !!url.match(urlToMatch); - } -} -exports.urlMatches = urlMatches; -/** - * Check if {@param url} should be ignored when comparing against {@param ignoredUrls} - * @param url - * @param ignoredUrls - */ -function isUrlIgnored(url, ignoredUrls) { - if (!ignoredUrls) { - return false; - } - for (const ignoreUrl of ignoredUrls) { - if (urlMatches(url, ignoreUrl)) { - return true; - } - } - return false; -} -exports.isUrlIgnored = isUrlIgnored; -//# sourceMappingURL=url.js.map - -/***/ }), - -/***/ 3369: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.isWrapped = void 0; -/** - * Checks if certain function has been already wrapped - * @param func - */ -function isWrapped(func) { - return (typeof func === 'function' && - typeof func.__original === 'function' && - typeof func.__unwrap === 'function' && - func.__wrapped === true); -} -exports.isWrapped = isWrapped; -//# sourceMappingURL=wrap.js.map - -/***/ }), - -/***/ 4047: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.VERSION = void 0; -// this is autogenerated file, see scripts/version-update.js -exports.VERSION = '1.0.1'; -//# sourceMappingURL=version.js.map - -/***/ }), - -/***/ 820: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -__exportStar(__nccwpck_require__(2341), exports); -__exportStar(__nccwpck_require__(9565), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 2576: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticResourceAttributes = { - /** - * Name of the cloud provider. - */ - CLOUD_PROVIDER: 'cloud.provider', - /** - * The cloud account ID the resource is assigned to. - */ - CLOUD_ACCOUNT_ID: 'cloud.account.id', - /** - * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations). - */ - CLOUD_REGION: 'cloud.region', - /** - * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running. - * - * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud. - */ - CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone', - /** - * The cloud platform in use. - * - * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`. - */ - CLOUD_PLATFORM: 'cloud.platform', - /** - * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html). - */ - AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn', - /** - * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html). - */ - AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn', - /** - * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task. - */ - AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype', - /** - * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html). - */ - AWS_ECS_TASK_ARN: 'aws.ecs.task.arn', - /** - * The task definition family this task definition is a member of. - */ - AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family', - /** - * The revision for this task definition. - */ - AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision', - /** - * The ARN of an EKS cluster. - */ - AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn', - /** - * The name(s) of the AWS log group(s) an application is writing to. - * - * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group. - */ - AWS_LOG_GROUP_NAMES: 'aws.log.group.names', - /** - * The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). - */ - AWS_LOG_GROUP_ARNS: 'aws.log.group.arns', - /** - * The name(s) of the AWS log stream(s) an application is writing to. - */ - AWS_LOG_STREAM_NAMES: 'aws.log.stream.names', - /** - * The ARN(s) of the AWS log stream(s). - * - * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream. - */ - AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns', - /** - * Container name. - */ - CONTAINER_NAME: 'container.name', - /** - * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated. - */ - CONTAINER_ID: 'container.id', - /** - * The container runtime managing this container. - */ - CONTAINER_RUNTIME: 'container.runtime', - /** - * Name of the image the container was built on. - */ - CONTAINER_IMAGE_NAME: 'container.image.name', - /** - * Container image tag. - */ - CONTAINER_IMAGE_TAG: 'container.image.tag', - /** - * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier). - */ - DEPLOYMENT_ENVIRONMENT: 'deployment.environment', - /** - * A unique identifier representing the device. - * - * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence. - */ - DEVICE_ID: 'device.id', - /** - * The model identifier for the device. - * - * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device. - */ - DEVICE_MODEL_IDENTIFIER: 'device.model.identifier', - /** - * The marketing name for the device model. - * - * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative. - */ - DEVICE_MODEL_NAME: 'device.model.name', - /** - * The name of the single function that this runtime instance executes. - * - * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes). - */ - FAAS_NAME: 'faas.name', - /** - * The unique ID of the single function that this runtime instance executes. - * - * Note: Depending on the cloud provider, use: - - * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - Take care not to use the "invoked ARN" directly but replace any - [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple - different aliases. - * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names) - * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id). - - On some providers, it may not be possible to determine the full ID at startup, - which is why this field cannot be made required. For example, on AWS the account ID - part of the ARN is not available without calling another AWS API - which may be deemed too slow for a short-running lambda function. - As an alternative, consider setting `faas.id` as a span attribute instead. - */ - FAAS_ID: 'faas.id', - /** - * The immutable version of the function being executed. - * - * Note: Depending on the cloud provider and platform, use: - - * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html) - (an integer represented as a decimal string). - * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions) - (i.e., the function name plus the revision suffix). - * **Google Cloud Functions:** The value of the - [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically). - * **Azure Functions:** Not applicable. Do not set this attribute. - */ - FAAS_VERSION: 'faas.version', - /** - * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version. - * - * Note: * **AWS Lambda:** Use the (full) log stream name. - */ - FAAS_INSTANCE: 'faas.instance', - /** - * The amount of memory available to the serverless function in MiB. - * - * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information. - */ - FAAS_MAX_MEMORY: 'faas.max_memory', - /** - * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. - */ - HOST_ID: 'host.id', - /** - * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. - */ - HOST_NAME: 'host.name', - /** - * Type of host. For Cloud, this must be the machine type. - */ - HOST_TYPE: 'host.type', - /** - * The CPU architecture the host system is running on. - */ - HOST_ARCH: 'host.arch', - /** - * Name of the VM image or OS install the host was instantiated from. - */ - HOST_IMAGE_NAME: 'host.image.name', - /** - * VM image ID. For Cloud, this value is from the provider. - */ - HOST_IMAGE_ID: 'host.image.id', - /** - * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). - */ - HOST_IMAGE_VERSION: 'host.image.version', - /** - * The name of the cluster. - */ - K8S_CLUSTER_NAME: 'k8s.cluster.name', - /** - * The name of the Node. - */ - K8S_NODE_NAME: 'k8s.node.name', - /** - * The UID of the Node. - */ - K8S_NODE_UID: 'k8s.node.uid', - /** - * The name of the namespace that the pod is running in. - */ - K8S_NAMESPACE_NAME: 'k8s.namespace.name', - /** - * The UID of the Pod. - */ - K8S_POD_UID: 'k8s.pod.uid', - /** - * The name of the Pod. - */ - K8S_POD_NAME: 'k8s.pod.name', - /** - * The name of the Container in a Pod template. - */ - K8S_CONTAINER_NAME: 'k8s.container.name', - /** - * The UID of the ReplicaSet. - */ - K8S_REPLICASET_UID: 'k8s.replicaset.uid', - /** - * The name of the ReplicaSet. - */ - K8S_REPLICASET_NAME: 'k8s.replicaset.name', - /** - * The UID of the Deployment. - */ - K8S_DEPLOYMENT_UID: 'k8s.deployment.uid', - /** - * The name of the Deployment. - */ - K8S_DEPLOYMENT_NAME: 'k8s.deployment.name', - /** - * The UID of the StatefulSet. - */ - K8S_STATEFULSET_UID: 'k8s.statefulset.uid', - /** - * The name of the StatefulSet. - */ - K8S_STATEFULSET_NAME: 'k8s.statefulset.name', - /** - * The UID of the DaemonSet. - */ - K8S_DAEMONSET_UID: 'k8s.daemonset.uid', - /** - * The name of the DaemonSet. - */ - K8S_DAEMONSET_NAME: 'k8s.daemonset.name', - /** - * The UID of the Job. - */ - K8S_JOB_UID: 'k8s.job.uid', - /** - * The name of the Job. - */ - K8S_JOB_NAME: 'k8s.job.name', - /** - * The UID of the CronJob. - */ - K8S_CRONJOB_UID: 'k8s.cronjob.uid', - /** - * The name of the CronJob. - */ - K8S_CRONJOB_NAME: 'k8s.cronjob.name', - /** - * The operating system type. - */ - OS_TYPE: 'os.type', - /** - * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands. - */ - OS_DESCRIPTION: 'os.description', - /** - * Human readable operating system name. - */ - OS_NAME: 'os.name', - /** - * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes). - */ - OS_VERSION: 'os.version', - /** - * Process identifier (PID). - */ - PROCESS_PID: 'process.pid', - /** - * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`. - */ - PROCESS_EXECUTABLE_NAME: 'process.executable.name', - /** - * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`. - */ - PROCESS_EXECUTABLE_PATH: 'process.executable.path', - /** - * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`. - */ - PROCESS_COMMAND: 'process.command', - /** - * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead. - */ - PROCESS_COMMAND_LINE: 'process.command_line', - /** - * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`. - */ - PROCESS_COMMAND_ARGS: 'process.command_args', - /** - * The username of the user that owns the process. - */ - PROCESS_OWNER: 'process.owner', - /** - * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler. - */ - PROCESS_RUNTIME_NAME: 'process.runtime.name', - /** - * The version of the runtime of this process, as returned by the runtime without modification. - */ - PROCESS_RUNTIME_VERSION: 'process.runtime.version', - /** - * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment. - */ - PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description', - /** - * Logical name of the service. - * - * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`. - */ - SERVICE_NAME: 'service.name', - /** - * A namespace for `service.name`. - * - * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace. - */ - SERVICE_NAMESPACE: 'service.namespace', - /** - * The string ID of the service instance. - * - * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations). - */ - SERVICE_INSTANCE_ID: 'service.instance.id', - /** - * The version string of the service API or implementation. - */ - SERVICE_VERSION: 'service.version', - /** - * The name of the telemetry SDK as defined above. - */ - TELEMETRY_SDK_NAME: 'telemetry.sdk.name', - /** - * The language of the telemetry SDK. - */ - TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language', - /** - * The version string of the telemetry SDK. - */ - TELEMETRY_SDK_VERSION: 'telemetry.sdk.version', - /** - * The version string of the auto instrumentation agent, if used. - */ - TELEMETRY_AUTO_VERSION: 'telemetry.auto.version', - /** - * The name of the web engine. - */ - WEBENGINE_NAME: 'webengine.name', - /** - * The version of the web engine. - */ - WEBENGINE_VERSION: 'webengine.version', - /** - * Additional description of the web engine (e.g. detailed version and edition information). - */ - WEBENGINE_DESCRIPTION: 'webengine.description', -}; -exports.CloudProviderValues = { - /** Alibaba Cloud. */ - ALIBABA_CLOUD: 'alibaba_cloud', - /** Amazon Web Services. */ - AWS: 'aws', - /** Microsoft Azure. */ - AZURE: 'azure', - /** Google Cloud Platform. */ - GCP: 'gcp', -}; -exports.CloudPlatformValues = { - /** Alibaba Cloud Elastic Compute Service. */ - ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs', - /** Alibaba Cloud Function Compute. */ - ALIBABA_CLOUD_FC: 'alibaba_cloud_fc', - /** AWS Elastic Compute Cloud. */ - AWS_EC2: 'aws_ec2', - /** AWS Elastic Container Service. */ - AWS_ECS: 'aws_ecs', - /** AWS Elastic Kubernetes Service. */ - AWS_EKS: 'aws_eks', - /** AWS Lambda. */ - AWS_LAMBDA: 'aws_lambda', - /** AWS Elastic Beanstalk. */ - AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk', - /** Azure Virtual Machines. */ - AZURE_VM: 'azure_vm', - /** Azure Container Instances. */ - AZURE_CONTAINER_INSTANCES: 'azure_container_instances', - /** Azure Kubernetes Service. */ - AZURE_AKS: 'azure_aks', - /** Azure Functions. */ - AZURE_FUNCTIONS: 'azure_functions', - /** Azure App Service. */ - AZURE_APP_SERVICE: 'azure_app_service', - /** Google Cloud Compute Engine (GCE). */ - GCP_COMPUTE_ENGINE: 'gcp_compute_engine', - /** Google Cloud Run. */ - GCP_CLOUD_RUN: 'gcp_cloud_run', - /** Google Cloud Kubernetes Engine (GKE). */ - GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine', - /** Google Cloud Functions (GCF). */ - GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions', - /** Google Cloud App Engine (GAE). */ - GCP_APP_ENGINE: 'gcp_app_engine', -}; -exports.AwsEcsLaunchtypeValues = { - /** ec2. */ - EC2: 'ec2', - /** fargate. */ - FARGATE: 'fargate', -}; -exports.HostArchValues = { - /** AMD64. */ - AMD64: 'amd64', - /** ARM32. */ - ARM32: 'arm32', - /** ARM64. */ - ARM64: 'arm64', - /** Itanium. */ - IA64: 'ia64', - /** 32-bit PowerPC. */ - PPC32: 'ppc32', - /** 64-bit PowerPC. */ - PPC64: 'ppc64', - /** 32-bit x86. */ - X86: 'x86', -}; -exports.OsTypeValues = { - /** Microsoft Windows. */ - WINDOWS: 'windows', - /** Linux. */ - LINUX: 'linux', - /** Apple Darwin. */ - DARWIN: 'darwin', - /** FreeBSD. */ - FREEBSD: 'freebsd', - /** NetBSD. */ - NETBSD: 'netbsd', - /** OpenBSD. */ - OPENBSD: 'openbsd', - /** DragonFly BSD. */ - DRAGONFLYBSD: 'dragonflybsd', - /** HP-UX (Hewlett Packard Unix). */ - HPUX: 'hpux', - /** AIX (Advanced Interactive eXecutive). */ - AIX: 'aix', - /** Oracle Solaris. */ - SOLARIS: 'solaris', - /** IBM z/OS. */ - Z_OS: 'z_os', -}; -exports.TelemetrySdkLanguageValues = { - /** cpp. */ - CPP: 'cpp', - /** dotnet. */ - DOTNET: 'dotnet', - /** erlang. */ - ERLANG: 'erlang', - /** go. */ - GO: 'go', - /** java. */ - JAVA: 'java', - /** nodejs. */ - NODEJS: 'nodejs', - /** php. */ - PHP: 'php', - /** python. */ - PYTHON: 'python', - /** ruby. */ - RUBY: 'ruby', - /** webjs. */ - WEBJS: 'webjs', -}; -//# sourceMappingURL=SemanticResourceAttributes.js.map - -/***/ }), - -/***/ 9565: -/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { - -"use strict"; - -var __createBinding = (this && this.__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]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -__exportStar(__nccwpck_require__(2576), exports); -//# sourceMappingURL=index.js.map - -/***/ }), - -/***/ 8942: -/***/ ((__unused_webpack_module, exports) => { - -"use strict"; - -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -Object.defineProperty(exports, "__esModule", ({ value: true })); -exports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0; -// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2 -exports.SemanticAttributes = { - /** - * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable). - * - * Note: This may be different from `faas.id` if an alias is involved. - */ - AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn', - /** - * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers. - */ - DB_SYSTEM: 'db.system', - /** - * The connection string used to connect to the database. It is recommended to remove embedded credentials. - */ - DB_CONNECTION_STRING: 'db.connection_string', - /** - * Username for accessing the database. - */ - DB_USER: 'db.user', - /** - * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect. - */ - DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname', - /** - * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails). - * - * Note: In some SQL databases, the database name to be used is called "schema name". - */ - DB_NAME: 'db.name', - /** - * The database statement being executed. - * - * Note: The value may be sanitized to exclude sensitive information. - */ - DB_STATEMENT: 'db.statement', - /** - * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword. - * - * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted. - */ - DB_OPERATION: 'db.operation', - /** - * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance. - * - * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard). - */ - DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name', - /** - * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute. - */ - DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace', - /** - * The fetch size used for paging, i.e. how many rows will be returned at once. - */ - DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size', - /** - * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html). - */ - DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level', - /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - */ - DB_CASSANDRA_TABLE: 'db.cassandra.table', - /** - * Whether or not the query is idempotent. - */ - DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence', - /** - * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively. - */ - DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count', - /** - * The ID of the coordinating node for a query. - */ - DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id', - /** - * The data center of the coordinating node for a query. - */ - DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc', - /** - * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute. - */ - DB_HBASE_NAMESPACE: 'db.hbase.namespace', - /** - * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute. - */ - DB_REDIS_DATABASE_INDEX: 'db.redis.database_index', - /** - * The collection being accessed within the database stated in `db.name`. - */ - DB_MONGODB_COLLECTION: 'db.mongodb.collection', - /** - * The name of the primary table that the operation is acting upon, including the schema name (if applicable). - * - * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set. - */ - DB_SQL_TABLE: 'db.sql.table', - /** - * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it. - */ - EXCEPTION_TYPE: 'exception.type', - /** - * The exception message. - */ - EXCEPTION_MESSAGE: 'exception.message', - /** - * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG. - */ - EXCEPTION_STACKTRACE: 'exception.stacktrace', - /** - * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span. - * - * Note: An exception is considered to have escaped (or left) the scope of a span, - if that span is ended while the exception is still logically "in flight". - This may be actually "in flight" in some languages (e.g. if the exception - is passed to a Context manager's `__exit__` method in Python) but will - usually be caught at the point of recording the exception in most languages. - - It is usually not possible to determine at the point where an exception is thrown - whether it will escape the scope of a span. - However, it is trivial to know that an exception - will escape, if one checks for an active exception just before ending the span, - as done in the [example above](#exception-end-example). - - It follows that an exception may still escape the scope of the span - even if the `exception.escaped` attribute was not set or set to false, - since the event might have been recorded at a time where it was not - clear whether the exception will escape. - */ - EXCEPTION_ESCAPED: 'exception.escaped', - /** - * Type of the trigger on which the function is executed. - */ - FAAS_TRIGGER: 'faas.trigger', - /** - * The execution ID of the current function execution. - */ - FAAS_EXECUTION: 'faas.execution', - /** - * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name. - */ - FAAS_DOCUMENT_COLLECTION: 'faas.document.collection', - /** - * Describes the type of the operation that was performed on the data. - */ - FAAS_DOCUMENT_OPERATION: 'faas.document.operation', - /** - * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - */ - FAAS_DOCUMENT_TIME: 'faas.document.time', - /** - * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name. - */ - FAAS_DOCUMENT_NAME: 'faas.document.name', - /** - * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime). - */ - FAAS_TIME: 'faas.time', - /** - * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm). - */ - FAAS_CRON: 'faas.cron', - /** - * A boolean that is true if the serverless function is executed for the first time (aka cold-start). - */ - FAAS_COLDSTART: 'faas.coldstart', - /** - * The name of the invoked function. - * - * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function. - */ - FAAS_INVOKED_NAME: 'faas.invoked_name', - /** - * The cloud provider of the invoked function. - * - * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function. - */ - FAAS_INVOKED_PROVIDER: 'faas.invoked_provider', - /** - * The cloud region of the invoked function. - * - * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function. - */ - FAAS_INVOKED_REGION: 'faas.invoked_region', - /** - * Transport protocol used. See note below. - */ - NET_TRANSPORT: 'net.transport', - /** - * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6). - */ - NET_PEER_IP: 'net.peer.ip', - /** - * Remote port number. - */ - NET_PEER_PORT: 'net.peer.port', - /** - * Remote hostname or similar, see note below. - */ - NET_PEER_NAME: 'net.peer.name', - /** - * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host. - */ - NET_HOST_IP: 'net.host.ip', - /** - * Like `net.peer.port` but for the host port. - */ - NET_HOST_PORT: 'net.host.port', - /** - * Local hostname or similar, see note below. - */ - NET_HOST_NAME: 'net.host.name', - /** - * The internet connection type currently being used by the host. - */ - NET_HOST_CONNECTION_TYPE: 'net.host.connection.type', - /** - * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection. - */ - NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype', - /** - * The name of the mobile carrier. - */ - NET_HOST_CARRIER_NAME: 'net.host.carrier.name', - /** - * The mobile carrier country code. - */ - NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc', - /** - * The mobile carrier network code. - */ - NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc', - /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - */ - NET_HOST_CARRIER_ICC: 'net.host.carrier.icc', - /** - * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any. - */ - PEER_SERVICE: 'peer.service', - /** - * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system. - */ - ENDUSER_ID: 'enduser.id', - /** - * Actual/assumed role the client is making the request under extracted from token or application security context. - */ - ENDUSER_ROLE: 'enduser.role', - /** - * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html). - */ - ENDUSER_SCOPE: 'enduser.scope', - /** - * Current "managed" thread ID (as opposed to OS thread ID). - */ - THREAD_ID: 'thread.id', - /** - * Current thread name. - */ - THREAD_NAME: 'thread.name', - /** - * The method or function name, or equivalent (usually rightmost part of the code unit's name). - */ - CODE_FUNCTION: 'code.function', - /** - * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit. - */ - CODE_NAMESPACE: 'code.namespace', - /** - * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). - */ - CODE_FILEPATH: 'code.filepath', - /** - * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`. - */ - CODE_LINENO: 'code.lineno', - /** - * HTTP request method. - */ - HTTP_METHOD: 'http.method', - /** - * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless. - * - * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`. - */ - HTTP_URL: 'http.url', - /** - * The full request target as passed in a HTTP request line or equivalent. - */ - HTTP_TARGET: 'http.target', - /** - * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note. - * - * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set. - */ - HTTP_HOST: 'http.host', - /** - * The URI scheme identifying the used protocol. - */ - HTTP_SCHEME: 'http.scheme', - /** - * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6). - */ - HTTP_STATUS_CODE: 'http.status_code', - /** - * Kind of HTTP protocol used. - * - * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed. - */ - HTTP_FLAVOR: 'http.flavor', - /** - * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client. - */ - HTTP_USER_AGENT: 'http.user_agent', - /** - * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - */ - HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length', - /** - * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used. - */ - HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed', - /** - * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size. - */ - HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length', - /** - * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used. - */ - HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed', - /** - * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). - * - * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available. - */ - HTTP_SERVER_NAME: 'http.server_name', - /** - * The matched route (path template). - */ - HTTP_ROUTE: 'http.route', - /** - * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)). - * - * Note: This is not necessarily the same as `net.peer.ip`, which would - identify the network-level peer, which may be a proxy. - - This attribute should be set when a source of information different - from the one used for `net.peer.ip`, is available even if that other - source just confirms the same value as `net.peer.ip`. - Rationale: For `net.peer.ip`, one typically does not know if it - comes from a proxy, reverse proxy, or the actual client. Setting - `http.client_ip` when it's the same as `net.peer.ip` means that - one is at least somewhat confident that the address is not that of - the closest proxy. - */ - HTTP_CLIENT_IP: 'http.client_ip', - /** - * The keys in the `RequestItems` object field. - */ - AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names', - /** - * The JSON-serialized value of each item in the `ConsumedCapacity` response field. - */ - AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity', - /** - * The JSON-serialized value of the `ItemCollectionMetrics` response field. - */ - AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics', - /** - * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter. - */ - AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity', - /** - * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter. - */ - AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity', - /** - * The value of the `ConsistentRead` request parameter. - */ - AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read', - /** - * The value of the `ProjectionExpression` request parameter. - */ - AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection', - /** - * The value of the `Limit` request parameter. - */ - AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit', - /** - * The value of the `AttributesToGet` request parameter. - */ - AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get', - /** - * The value of the `IndexName` request parameter. - */ - AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name', - /** - * The value of the `Select` request parameter. - */ - AWS_DYNAMODB_SELECT: 'aws.dynamodb.select', - /** - * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field. - */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes', - /** - * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field. - */ - AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes', - /** - * The value of the `ExclusiveStartTableName` request parameter. - */ - AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table', - /** - * The the number of items in the `TableNames` response parameter. - */ - AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count', - /** - * The value of the `ScanIndexForward` request parameter. - */ - AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward', - /** - * The value of the `Segment` request parameter. - */ - AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment', - /** - * The value of the `TotalSegments` request parameter. - */ - AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments', - /** - * The value of the `Count` response parameter. - */ - AWS_DYNAMODB_COUNT: 'aws.dynamodb.count', - /** - * The value of the `ScannedCount` response parameter. - */ - AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count', - /** - * The JSON-serialized value of each item in the `AttributeDefinitions` request field. - */ - AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions', - /** - * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field. - */ - AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates', - /** - * A string identifying the messaging system. - */ - MESSAGING_SYSTEM: 'messaging.system', - /** - * The message destination name. This might be equal to the span name but is required nevertheless. - */ - MESSAGING_DESTINATION: 'messaging.destination', - /** - * The kind of message destination. - */ - MESSAGING_DESTINATION_KIND: 'messaging.destination_kind', - /** - * A boolean that is true if the message destination is temporary. - */ - MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination', - /** - * The name of the transport protocol. - */ - MESSAGING_PROTOCOL: 'messaging.protocol', - /** - * The version of the transport protocol. - */ - MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version', - /** - * Connection string. - */ - MESSAGING_URL: 'messaging.url', - /** - * A value used by the messaging system as an identifier for the message, represented as a string. - */ - MESSAGING_MESSAGE_ID: 'messaging.message_id', - /** - * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID". - */ - MESSAGING_CONVERSATION_ID: 'messaging.conversation_id', - /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported. - */ - MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes', - /** - * The compressed size of the message payload in bytes. - */ - MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes', - /** - * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case. - */ - MESSAGING_OPERATION: 'messaging.operation', - /** - * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message. - */ - MESSAGING_CONSUMER_ID: 'messaging.consumer_id', - /** - * RabbitMQ message routing key. - */ - MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.routing_key', - /** - * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set. - * - * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value. - */ - MESSAGING_KAFKA_MESSAGE_KEY: 'messaging.kafka.message_key', - /** - * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers. - */ - MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group', - /** - * Client Id for the Consumer or Producer that is handling the message. - */ - MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id', - /** - * Partition the message is sent to. - */ - MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition', - /** - * A boolean that is true if the message is a tombstone. - */ - MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone', - /** - * A string identifying the remoting system. - */ - RPC_SYSTEM: 'rpc.system', - /** - * The full (logical) name of the service being called, including its package name, if applicable. - * - * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side). - */ - RPC_SERVICE: 'rpc.service', - /** - * The name of the (logical) method being called, must be equal to the $method part in the span name. - * - * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side). - */ - RPC_METHOD: 'rpc.method', - /** - * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request. - */ - RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code', - /** - * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted. - */ - RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version', - /** - * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification. - */ - RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id', - /** - * `error.code` property of response if it is an error response. - */ - RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code', - /** - * `error.message` property of response if it is an error response. - */ - RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message', - /** - * Whether this is a received or sent message. - */ - MESSAGE_TYPE: 'message.type', - /** - * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message. - * - * Note: This way we guarantee that the values will be consistent between different implementations. - */ - MESSAGE_ID: 'message.id', - /** - * Compressed size of the message in bytes. - */ - MESSAGE_COMPRESSED_SIZE: 'message.compressed_size', - /** - * Uncompressed size of the message in bytes. - */ - MESSAGE_UNCOMPRESSED_SIZE: 'message.uncompressed_size', + // if the abs isn't a dir, then nothing can match! + if (!entries) + return cb() + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return cb() + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return cb() + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) { + if (prefix !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + this._process([e].concat(remain), index, inGlobStar, cb) + } + cb() +} + +Glob.prototype._emitMatch = function (index, e) { + if (this.aborted) + return + + if (isIgnored(this, e)) + return + + if (this.paused) { + this._emitQueue.push([index, e]) + return + } + + var abs = isAbsolute(e) ? e : this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) + e = abs + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + var st = this.statCache[abs] + if (st) + this.emit('stat', e, st) + + this.emit('match', e) +} + +Glob.prototype._readdirInGlobStar = function (abs, cb) { + if (this.aborted) + return + + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false, cb) + + var lstatkey = 'lstat\0' + abs + var self = this + var lstatcb = inflight(lstatkey, lstatcb_) + + if (lstatcb) + self.fs.lstat(abs, lstatcb) + + function lstatcb_ (er, lstat) { + if (er && er.code === 'ENOENT') + return cb() + + var isSym = lstat && lstat.isSymbolicLink() + self.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) { + self.cache[abs] = 'FILE' + cb() + } else + self._readdir(abs, false, cb) + } +} + +Glob.prototype._readdir = function (abs, inGlobStar, cb) { + if (this.aborted) + return + + cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) + if (!cb) + return + + //console.error('RD %j %j', +inGlobStar, abs) + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs, cb) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return cb() + + if (Array.isArray(c)) + return cb(null, c) + } + + var self = this + self.fs.readdir(abs, readdirCb(this, abs, cb)) +} + +function readdirCb (self, abs, cb) { + return function (er, entries) { + if (er) + self._readdirError(abs, er, cb) + else + self._readdirEntries(abs, entries, cb) + } +} + +Glob.prototype._readdirEntries = function (abs, entries, cb) { + if (this.aborted) + return + + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + return cb(null, entries) +} + +Glob.prototype._readdirError = function (f, er, cb) { + if (this.aborted) + return + + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + this.emit('error', error) + this.abort() + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) { + this.emit('error', er) + // If the error is handled, then we abort + // if not, we threw out of here + this.abort() + } + if (!this.silent) + console.error('glob error', er) + break + } + + return cb() +} + +Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { + var self = this + this._readdir(abs, inGlobStar, function (er, entries) { + self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) + }) +} + + +Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { + //console.error('pgs2', prefix, remain[0], entries) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return cb() + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false, cb) + + var isSym = this.symlinks[abs] + var len = entries.length + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return cb() + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true, cb) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true, cb) + } + + cb() +} + +Glob.prototype._processSimple = function (prefix, index, cb) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var self = this + this._stat(prefix, function (er, exists) { + self._processSimple2(prefix, index, er, exists, cb) + }) +} +Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { + + //console.error('ps2', prefix, exists) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return cb() + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) + cb() +} + +// Returns either 'DIR', 'FILE', or false +Glob.prototype._stat = function (f, cb) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return cb() + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return cb(null, c) + + if (needDir && c === 'FILE') + return cb() + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (stat !== undefined) { + if (stat === false) + return cb(null, stat) + else { + var type = stat.isDirectory() ? 'DIR' : 'FILE' + if (needDir && type === 'FILE') + return cb() + else + return cb(null, type, stat) + } + } + + var self = this + var statcb = inflight('stat\0' + abs, lstatcb_) + if (statcb) + self.fs.lstat(abs, statcb) + + function lstatcb_ (er, lstat) { + if (lstat && lstat.isSymbolicLink()) { + // If it's a symlink, then treat it as the target, unless + // the target does not exist, then treat it as a file. + return self.fs.stat(abs, function (er, stat) { + if (er) + self._stat2(f, abs, null, lstat, cb) + else + self._stat2(f, abs, er, stat, cb) + }) + } else { + self._stat2(f, abs, er, lstat, cb) + } + } +} + +Glob.prototype._stat2 = function (f, abs, er, stat, cb) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return cb() + } + + var needDir = f.slice(-1) === '/' + this.statCache[abs] = stat + + if (abs.slice(-1) === '/' && stat && !stat.isDirectory()) + return cb(null, false, stat) + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return cb() + + return cb(null, c, stat) +} + + +/***/ }), + +/***/ 9010: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = globSync +globSync.GlobSync = GlobSync + +var rp = __nccwpck_require__(6863) +var minimatch = __nccwpck_require__(3973) +var Minimatch = minimatch.Minimatch +var Glob = __nccwpck_require__(1957).Glob +var util = __nccwpck_require__(1669) +var path = __nccwpck_require__(5622) +var assert = __nccwpck_require__(2357) +var isAbsolute = __nccwpck_require__(8714) +var common = __nccwpck_require__(7625) +var setopts = common.setopts +var ownProp = common.ownProp +var childrenIgnored = common.childrenIgnored +var isIgnored = common.isIgnored + +function globSync (pattern, options) { + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + return new GlobSync(pattern, options).found +} + +function GlobSync (pattern, options) { + if (!pattern) + throw new Error('must provide pattern') + + if (typeof options === 'function' || arguments.length === 3) + throw new TypeError('callback provided to sync glob\n'+ + 'See: https://github.com/isaacs/node-glob/issues/167') + + if (!(this instanceof GlobSync)) + return new GlobSync(pattern, options) + + setopts(this, pattern, options) + + if (this.noprocess) + return this + + var n = this.minimatch.set.length + this.matches = new Array(n) + for (var i = 0; i < n; i ++) { + this._process(this.minimatch.set[i], i, false) + } + this._finish() +} + +GlobSync.prototype._finish = function () { + assert(this instanceof GlobSync) + if (this.realpath) { + var self = this + this.matches.forEach(function (matchset, index) { + var set = self.matches[index] = Object.create(null) + for (var p in matchset) { + try { + p = self._makeAbs(p) + var real = rp.realpathSync(p, self.realpathCache) + set[real] = true + } catch (er) { + if (er.syscall === 'stat') + set[self._makeAbs(p)] = true + else + throw er + } + } + }) + } + common.finish(this) +} + + +GlobSync.prototype._process = function (pattern, index, inGlobStar) { + assert(this instanceof GlobSync) + + // Get the first [n] parts of pattern that are all strings. + var n = 0 + while (typeof pattern[n] === 'string') { + n ++ + } + // now n is the index of the first one that is *not* a string. + + // See if there's anything else + var prefix + switch (n) { + // if not, then this is rather simple + case pattern.length: + this._processSimple(pattern.join('/'), index) + return + + case 0: + // pattern *starts* with some non-trivial item. + // going to readdir(cwd), but not include the prefix in matches. + prefix = null + break + + default: + // pattern has some string bits in the front. + // whatever it starts with, whether that's 'absolute' like /foo/bar, + // or 'relative' like '../baz' + prefix = pattern.slice(0, n).join('/') + break + } + + var remain = pattern.slice(n) + + // get the list of entries. + var read + if (prefix === null) + read = '.' + else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { + if (!prefix || !isAbsolute(prefix)) + prefix = '/' + prefix + read = prefix + } else + read = prefix + + var abs = this._makeAbs(read) + + //if ignored, skip processing + if (childrenIgnored(this, read)) + return + + var isGlobStar = remain[0] === minimatch.GLOBSTAR + if (isGlobStar) + this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) + else + this._processReaddir(prefix, read, abs, remain, index, inGlobStar) +} + + +GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { + var entries = this._readdir(abs, inGlobStar) + + // if the abs isn't a dir, then nothing can match! + if (!entries) + return + + // It will only match dot entries if it starts with a dot, or if + // dot is set. Stuff like @(.foo|.bar) isn't allowed. + var pn = remain[0] + var negate = !!this.minimatch.negate + var rawGlob = pn._glob + var dotOk = this.dot || rawGlob.charAt(0) === '.' + + var matchedEntries = [] + for (var i = 0; i < entries.length; i++) { + var e = entries[i] + if (e.charAt(0) !== '.' || dotOk) { + var m + if (negate && !prefix) { + m = !e.match(pn) + } else { + m = e.match(pn) + } + if (m) + matchedEntries.push(e) + } + } + + var len = matchedEntries.length + // If there are no matched entries, then nothing matches. + if (len === 0) + return + + // if this is the last remaining pattern bit, then no need for + // an additional stat *unless* the user has specified mark or + // stat explicitly. We know they exist, since readdir returned + // them. + + if (remain.length === 1 && !this.mark && !this.stat) { + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + if (prefix) { + if (prefix.slice(-1) !== '/') + e = prefix + '/' + e + else + e = prefix + e + } + + if (e.charAt(0) === '/' && !this.nomount) { + e = path.join(this.root, e) + } + this._emitMatch(index, e) + } + // This was the last one, and no stats were needed + return + } + + // now test all matched entries as stand-ins for that part + // of the pattern. + remain.shift() + for (var i = 0; i < len; i ++) { + var e = matchedEntries[i] + var newPattern + if (prefix) + newPattern = [prefix, e] + else + newPattern = [e] + this._process(newPattern.concat(remain), index, inGlobStar) + } +} + + +GlobSync.prototype._emitMatch = function (index, e) { + if (isIgnored(this, e)) + return + + var abs = this._makeAbs(e) + + if (this.mark) + e = this._mark(e) + + if (this.absolute) { + e = abs + } + + if (this.matches[index][e]) + return + + if (this.nodir) { + var c = this.cache[abs] + if (c === 'DIR' || Array.isArray(c)) + return + } + + this.matches[index][e] = true + + if (this.stat) + this._stat(e) +} + + +GlobSync.prototype._readdirInGlobStar = function (abs) { + // follow all symlinked directories forever + // just proceed as if this is a non-globstar situation + if (this.follow) + return this._readdir(abs, false) + + var entries + var lstat + var stat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er.code === 'ENOENT') { + // lstat failed, doesn't exist + return null + } + } + + var isSym = lstat && lstat.isSymbolicLink() + this.symlinks[abs] = isSym + + // If it's not a symlink or a dir, then it's definitely a regular file. + // don't bother doing a readdir in that case. + if (!isSym && lstat && !lstat.isDirectory()) + this.cache[abs] = 'FILE' + else + entries = this._readdir(abs, false) + + return entries +} + +GlobSync.prototype._readdir = function (abs, inGlobStar) { + var entries + + if (inGlobStar && !ownProp(this.symlinks, abs)) + return this._readdirInGlobStar(abs) + + if (ownProp(this.cache, abs)) { + var c = this.cache[abs] + if (!c || c === 'FILE') + return null + + if (Array.isArray(c)) + return c + } + + try { + return this._readdirEntries(abs, this.fs.readdirSync(abs)) + } catch (er) { + this._readdirError(abs, er) + return null + } +} + +GlobSync.prototype._readdirEntries = function (abs, entries) { + // if we haven't asked to stat everything, then just + // assume that everything in there exists, so we can avoid + // having to stat it a second time. + if (!this.mark && !this.stat) { + for (var i = 0; i < entries.length; i ++) { + var e = entries[i] + if (abs === '/') + e = abs + e + else + e = abs + '/' + e + this.cache[e] = true + } + } + + this.cache[abs] = entries + + // mark and cache dir-ness + return entries +} + +GlobSync.prototype._readdirError = function (f, er) { + // handle errors, and cache the information + switch (er.code) { + case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205 + case 'ENOTDIR': // totally normal. means it *does* exist. + var abs = this._makeAbs(f) + this.cache[abs] = 'FILE' + if (abs === this.cwdAbs) { + var error = new Error(er.code + ' invalid cwd ' + this.cwd) + error.path = this.cwd + error.code = er.code + throw error + } + break + + case 'ENOENT': // not terribly unusual + case 'ELOOP': + case 'ENAMETOOLONG': + case 'UNKNOWN': + this.cache[this._makeAbs(f)] = false + break + + default: // some unusual error. Treat as failure. + this.cache[this._makeAbs(f)] = false + if (this.strict) + throw er + if (!this.silent) + console.error('glob error', er) + break + } +} + +GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { + + var entries = this._readdir(abs, inGlobStar) + + // no entries means not a dir, so it can never have matches + // foo.txt/** doesn't match foo.txt + if (!entries) + return + + // test without the globstar, and with every child both below + // and replacing the globstar. + var remainWithoutGlobStar = remain.slice(1) + var gspref = prefix ? [ prefix ] : [] + var noGlobStar = gspref.concat(remainWithoutGlobStar) + + // the noGlobStar pattern exits the inGlobStar state + this._process(noGlobStar, index, false) + + var len = entries.length + var isSym = this.symlinks[abs] + + // If it's a symlink, and we're in a globstar, then stop + if (isSym && inGlobStar) + return + + for (var i = 0; i < len; i++) { + var e = entries[i] + if (e.charAt(0) === '.' && !this.dot) + continue + + // these two cases enter the inGlobStar state + var instead = gspref.concat(entries[i], remainWithoutGlobStar) + this._process(instead, index, true) + + var below = gspref.concat(entries[i], remain) + this._process(below, index, true) + } +} + +GlobSync.prototype._processSimple = function (prefix, index) { + // XXX review this. Shouldn't it be doing the mounting etc + // before doing stat? kinda weird? + var exists = this._stat(prefix) + + if (!this.matches[index]) + this.matches[index] = Object.create(null) + + // If it doesn't exist, then just mark the lack of results + if (!exists) + return + + if (prefix && isAbsolute(prefix) && !this.nomount) { + var trail = /[\/\\]$/.test(prefix) + if (prefix.charAt(0) === '/') { + prefix = path.join(this.root, prefix) + } else { + prefix = path.resolve(this.root, prefix) + if (trail) + prefix += '/' + } + } + + if (process.platform === 'win32') + prefix = prefix.replace(/\\/g, '/') + + // Mark this as a match + this._emitMatch(index, prefix) +} + +// Returns either 'DIR', 'FILE', or false +GlobSync.prototype._stat = function (f) { + var abs = this._makeAbs(f) + var needDir = f.slice(-1) === '/' + + if (f.length > this.maxLength) + return false + + if (!this.stat && ownProp(this.cache, abs)) { + var c = this.cache[abs] + + if (Array.isArray(c)) + c = 'DIR' + + // It exists, but maybe not how we need it + if (!needDir || c === 'DIR') + return c + + if (needDir && c === 'FILE') + return false + + // otherwise we have to stat, because maybe c=true + // if we know it exists, but not what it is. + } + + var exists + var stat = this.statCache[abs] + if (!stat) { + var lstat + try { + lstat = this.fs.lstatSync(abs) + } catch (er) { + if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { + this.statCache[abs] = false + return false + } + } + + if (lstat && lstat.isSymbolicLink()) { + try { + stat = this.fs.statSync(abs) + } catch (er) { + stat = lstat + } + } else { + stat = lstat + } + } + + this.statCache[abs] = stat + + var c = true + if (stat) + c = stat.isDirectory() ? 'DIR' : 'FILE' + + this.cache[abs] = this.cache[abs] || c + + if (needDir && c === 'FILE') + return false + + return c +} + +GlobSync.prototype._mark = function (p) { + return common.mark(this, p) +} + +GlobSync.prototype._makeAbs = function (f) { + return common.makeAbs(this, f) +} + + +/***/ }), + +/***/ 2492: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var wrappy = __nccwpck_require__(2940) +var reqs = Object.create(null) +var once = __nccwpck_require__(1223) + +module.exports = wrappy(inflight) + +function inflight (key, cb) { + if (reqs[key]) { + reqs[key].push(cb) + return null + } else { + reqs[key] = [cb] + return makeres(key) + } +} + +function makeres (key) { + return once(function RES () { + var cbs = reqs[key] + var len = cbs.length + var args = slice(arguments) + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } + } + }) +} + +function slice (args) { + var length = args.length + var array = [] + + for (var i = 0; i < length; i++) array[i] = args[i] + return array +} + + +/***/ }), + +/***/ 4124: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +try { + var util = __nccwpck_require__(1669); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(8544); +} + + +/***/ }), + +/***/ 8544: +/***/ ((module) => { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + + +/***/ }), + +/***/ 3287: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +/*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +function isObject(o) { + return Object.prototype.toString.call(o) === '[object Object]'; +} + +function isPlainObject(o) { + var ctor,prot; + + if (isObject(o) === false) return false; + + // If has modified constructor + ctor = o.constructor; + if (ctor === undefined) return true; + + // If has modified prototype + prot = ctor.prototype; + if (isObject(prot) === false) return false; + + // If constructor does not have an Object-specific method + if (prot.hasOwnProperty('isPrototypeOf') === false) { + return false; + } + + // Most likely a plain Object + return true; +} + +exports.isPlainObject = isPlainObject; + + +/***/ }), + +/***/ 8027: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.parse = void 0; +const xml2js_1 = __importDefault(__nccwpck_require__(6189)); +const parse = async (xmlString, xml2jsOptions) => { + const options = xml2jsOptions !== null && xml2jsOptions !== void 0 ? xml2jsOptions : { + attrValueProcessors: [xml2js_1.default.processors.parseNumbers] + }; + const result = await xml2js_1.default.parseStringPromise(xmlString, options); + if (result['testsuites']) { + return _parse(result['testsuites']); + } + else { + return _parse(result['testsuite']); + } +}; +exports.parse = parse; +const _parse = (objOrArray) => { + if (Array.isArray(objOrArray)) { + return objOrArray.map((_obj) => { + // 中身がさらにネストされた配列 or $キーのobjectなら再起 + if (Array.isArray(_obj) || typeof (_obj) === 'object') { + return _parse(_obj); + } + // 配列の中身が単なる文字列ならinnerキーを自分で付けてobjectで返す + return { inner: _obj }; + }); + } + let output = {}; + Object.keys(objOrArray).forEach((key) => { + const nested = objOrArray[key]; + if (key === '$') { + output = { ...output, ..._parse(nested) }; + } + else if (key === 'system-out' || key === 'system-err') { + output[key] = nested.map((inner) => inner); + } + else if (typeof (nested) === 'object') { + output[key] = _parse(nested); + } + else if (key === '_') { + output['inner'] = nested; + } + else { + output[key] = nested; + } + }); + return output; +}; +//# sourceMappingURL=index.js.map + +/***/ }), + +/***/ 3973: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = __nccwpck_require__(5622) +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = __nccwpck_require__(3717) + +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + var pl = patternListStack.pop() + // negation is (?:(?!js)[^/]*) + // The others are (?:) + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) + } + pl.reEnd = re.length + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} + + +/***/ }), + +/***/ 467: +/***/ ((module, exports, __nccwpck_require__) => { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var Stream = _interopDefault(__nccwpck_require__(2413)); +var http = _interopDefault(__nccwpck_require__(8605)); +var Url = _interopDefault(__nccwpck_require__(8835)); +var whatwgUrl = _interopDefault(__nccwpck_require__(3323)); +var https = _interopDefault(__nccwpck_require__(7211)); +var zlib = _interopDefault(__nccwpck_require__(8761)); + +// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js + +// fix for "Readable" isn't a named export issue +const Readable = Stream.Readable; + +const BUFFER = Symbol('buffer'); +const TYPE = Symbol('type'); + +class Blob { + constructor() { + this[TYPE] = ''; + + const blobParts = arguments[0]; + const options = arguments[1]; + + const buffers = []; + let size = 0; + + if (blobParts) { + const a = blobParts; + const length = Number(a.length); + for (let i = 0; i < length; i++) { + const element = a[i]; + let buffer; + if (element instanceof Buffer) { + buffer = element; + } else if (ArrayBuffer.isView(element)) { + buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength); + } else if (element instanceof ArrayBuffer) { + buffer = Buffer.from(element); + } else if (element instanceof Blob) { + buffer = element[BUFFER]; + } else { + buffer = Buffer.from(typeof element === 'string' ? element : String(element)); + } + size += buffer.length; + buffers.push(buffer); + } + } + + this[BUFFER] = Buffer.concat(buffers); + + let type = options && options.type !== undefined && String(options.type).toLowerCase(); + if (type && !/[^\u0020-\u007E]/.test(type)) { + this[TYPE] = type; + } + } + get size() { + return this[BUFFER].length; + } + get type() { + return this[TYPE]; + } + text() { + return Promise.resolve(this[BUFFER].toString()); + } + arrayBuffer() { + const buf = this[BUFFER]; + const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + return Promise.resolve(ab); + } + stream() { + const readable = new Readable(); + readable._read = function () {}; + readable.push(this[BUFFER]); + readable.push(null); + return readable; + } + toString() { + return '[object Blob]'; + } + slice() { + const size = this.size; + + const start = arguments[0]; + const end = arguments[1]; + let relativeStart, relativeEnd; + if (start === undefined) { + relativeStart = 0; + } else if (start < 0) { + relativeStart = Math.max(size + start, 0); + } else { + relativeStart = Math.min(start, size); + } + if (end === undefined) { + relativeEnd = size; + } else if (end < 0) { + relativeEnd = Math.max(size + end, 0); + } else { + relativeEnd = Math.min(end, size); + } + const span = Math.max(relativeEnd - relativeStart, 0); + + const buffer = this[BUFFER]; + const slicedBuffer = buffer.slice(relativeStart, relativeStart + span); + const blob = new Blob([], { type: arguments[2] }); + blob[BUFFER] = slicedBuffer; + return blob; + } +} + +Object.defineProperties(Blob.prototype, { + size: { enumerable: true }, + type: { enumerable: true }, + slice: { enumerable: true } +}); + +Object.defineProperty(Blob.prototype, Symbol.toStringTag, { + value: 'Blob', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * fetch-error.js + * + * FetchError interface for operational errors + */ + +/** + * Create FetchError instance + * + * @param String message Error message for human + * @param String type Error type for machine + * @param String systemError For Node.js system error + * @return FetchError + */ +function FetchError(message, type, systemError) { + Error.call(this, message); + + this.message = message; + this.type = type; + + // when err.type is `system`, err.code contains system error code + if (systemError) { + this.code = this.errno = systemError.code; + } + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +FetchError.prototype = Object.create(Error.prototype); +FetchError.prototype.constructor = FetchError; +FetchError.prototype.name = 'FetchError'; + +let convert; +try { + convert = __nccwpck_require__(2877).convert; +} catch (e) {} + +const INTERNALS = Symbol('Body internals'); + +// fix an issue where "PassThrough" isn't a named export for node <10 +const PassThrough = Stream.PassThrough; + +/** + * Body mixin + * + * Ref: https://fetch.spec.whatwg.org/#body + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +function Body(body) { + var _this = this; + + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$size = _ref.size; + + let size = _ref$size === undefined ? 0 : _ref$size; + var _ref$timeout = _ref.timeout; + let timeout = _ref$timeout === undefined ? 0 : _ref$timeout; + + if (body == null) { + // body is undefined or null + body = null; + } else if (isURLSearchParams(body)) { + // body is a URLSearchParams + body = Buffer.from(body.toString()); + } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') { + // body is ArrayBuffer + body = Buffer.from(body); + } else if (ArrayBuffer.isView(body)) { + // body is ArrayBufferView + body = Buffer.from(body.buffer, body.byteOffset, body.byteLength); + } else if (body instanceof Stream) ; else { + // none of the above + // coerce to string then buffer + body = Buffer.from(String(body)); + } + this[INTERNALS] = { + body, + disturbed: false, + error: null + }; + this.size = size; + this.timeout = timeout; + + if (body instanceof Stream) { + body.on('error', function (err) { + const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err); + _this[INTERNALS].error = error; + }); + } +} + +Body.prototype = { + get body() { + return this[INTERNALS].body; + }, + + get bodyUsed() { + return this[INTERNALS].disturbed; + }, + + /** + * Decode response as ArrayBuffer + * + * @return Promise + */ + arrayBuffer() { + return consumeBody.call(this).then(function (buf) { + return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); + }); + }, + + /** + * Return raw response as Blob + * + * @return Promise + */ + blob() { + let ct = this.headers && this.headers.get('content-type') || ''; + return consumeBody.call(this).then(function (buf) { + return Object.assign( + // Prevent copying + new Blob([], { + type: ct.toLowerCase() + }), { + [BUFFER]: buf + }); + }); + }, + + /** + * Decode response as json + * + * @return Promise + */ + json() { + var _this2 = this; + + return consumeBody.call(this).then(function (buffer) { + try { + return JSON.parse(buffer.toString()); + } catch (err) { + return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json')); + } + }); + }, + + /** + * Decode response as text + * + * @return Promise + */ + text() { + return consumeBody.call(this).then(function (buffer) { + return buffer.toString(); + }); + }, + + /** + * Decode response as buffer (non-spec api) + * + * @return Promise + */ + buffer() { + return consumeBody.call(this); + }, + + /** + * Decode response as text, while automatically detecting the encoding and + * trying to decode to UTF-8 (non-spec api) + * + * @return Promise + */ + textConverted() { + var _this3 = this; + + return consumeBody.call(this).then(function (buffer) { + return convertBody(buffer, _this3.headers); + }); + } +}; + +// In browsers, all properties are enumerable. +Object.defineProperties(Body.prototype, { + body: { enumerable: true }, + bodyUsed: { enumerable: true }, + arrayBuffer: { enumerable: true }, + blob: { enumerable: true }, + json: { enumerable: true }, + text: { enumerable: true } +}); + +Body.mixIn = function (proto) { + for (const name of Object.getOwnPropertyNames(Body.prototype)) { + // istanbul ignore else: future proof + if (!(name in proto)) { + const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); + Object.defineProperty(proto, name, desc); + } + } +}; + +/** + * Consume and convert an entire Body to a Buffer. + * + * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body + * + * @return Promise + */ +function consumeBody() { + var _this4 = this; + + if (this[INTERNALS].disturbed) { + return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); + } + + this[INTERNALS].disturbed = true; + + if (this[INTERNALS].error) { + return Body.Promise.reject(this[INTERNALS].error); + } + + let body = this.body; + + // body is null + if (body === null) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is blob + if (isBlob(body)) { + body = body.stream(); + } + + // body is buffer + if (Buffer.isBuffer(body)) { + return Body.Promise.resolve(body); + } + + // istanbul ignore if: should never happen + if (!(body instanceof Stream)) { + return Body.Promise.resolve(Buffer.alloc(0)); + } + + // body is stream + // get ready to actually consume the body + let accum = []; + let accumBytes = 0; + let abort = false; + + return new Body.Promise(function (resolve, reject) { + let resTimeout; + + // allow timeout on slow response body + if (_this4.timeout) { + resTimeout = setTimeout(function () { + abort = true; + reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout')); + }, _this4.timeout); + } + + // handle stream errors + body.on('error', function (err) { + if (err.name === 'AbortError') { + // if the request was aborted, reject with this Error + abort = true; + reject(err); + } else { + // other errors, such as incorrect content-encoding + reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + + body.on('data', function (chunk) { + if (abort || chunk === null) { + return; + } + + if (_this4.size && accumBytes + chunk.length > _this4.size) { + abort = true; + reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size')); + return; + } + + accumBytes += chunk.length; + accum.push(chunk); + }); + + body.on('end', function () { + if (abort) { + return; + } + + clearTimeout(resTimeout); + + try { + resolve(Buffer.concat(accum, accumBytes)); + } catch (err) { + // handle streams that have accumulated too much data (issue #414) + reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err)); + } + }); + }); +} + +/** + * Detect buffer encoding and convert to target encoding + * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding + * + * @param Buffer buffer Incoming buffer + * @param String encoding Target encoding + * @return String + */ +function convertBody(buffer, headers) { + if (typeof convert !== 'function') { + throw new Error('The package `encoding` must be installed to use the textConverted() function'); + } + + const ct = headers.get('content-type'); + let charset = 'utf-8'; + let res, str; + + // header + if (ct) { + res = /charset=([^;]*)/i.exec(ct); + } + + // no charset in content type, peek at response body for at most 1024 bytes + str = buffer.slice(0, 1024).toString(); + + // html5 + if (!res && str) { + res = / 0 && arguments[0] !== undefined ? arguments[0] : undefined; + + this[MAP] = Object.create(null); + + if (init instanceof Headers) { + const rawHeaders = init.raw(); + const headerNames = Object.keys(rawHeaders); + + for (const headerName of headerNames) { + for (const value of rawHeaders[headerName]) { + this.append(headerName, value); + } + } + + return; + } + + // We don't worry about converting prop to ByteString here as append() + // will handle it. + if (init == null) ; else if (typeof init === 'object') { + const method = init[Symbol.iterator]; + if (method != null) { + if (typeof method !== 'function') { + throw new TypeError('Header pairs must be iterable'); + } + + // sequence> + // Note: per spec we have to first exhaust the lists then process them + const pairs = []; + for (const pair of init) { + if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') { + throw new TypeError('Each header pair must be iterable'); + } + pairs.push(Array.from(pair)); + } + + for (const pair of pairs) { + if (pair.length !== 2) { + throw new TypeError('Each header pair must be a name/value tuple'); + } + this.append(pair[0], pair[1]); + } + } else { + // record + for (const key of Object.keys(init)) { + const value = init[key]; + this.append(key, value); + } + } + } else { + throw new TypeError('Provided initializer must be an object'); + } + } + + /** + * Return combined header value given name + * + * @param String name Header name + * @return Mixed + */ + get(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key === undefined) { + return null; + } + + return this[MAP][key].join(', '); + } + + /** + * Iterate over all headers + * + * @param Function callback Executed for each item with parameters (value, name, thisArg) + * @param Boolean thisArg `this` context for callback function + * @return Void + */ + forEach(callback) { + let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + + let pairs = getHeaders(this); + let i = 0; + while (i < pairs.length) { + var _pairs$i = pairs[i]; + const name = _pairs$i[0], + value = _pairs$i[1]; + + callback.call(thisArg, value, name, this); + pairs = getHeaders(this); + i++; + } + } + + /** + * Overwrite header values given name + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + set(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + this[MAP][key !== undefined ? key : name] = [value]; + } + + /** + * Append a value onto existing header + * + * @param String name Header name + * @param String value Header value + * @return Void + */ + append(name, value) { + name = `${name}`; + value = `${value}`; + validateName(name); + validateValue(value); + const key = find(this[MAP], name); + if (key !== undefined) { + this[MAP][key].push(value); + } else { + this[MAP][name] = [value]; + } + } + + /** + * Check for header name existence + * + * @param String name Header name + * @return Boolean + */ + has(name) { + name = `${name}`; + validateName(name); + return find(this[MAP], name) !== undefined; + } + + /** + * Delete all header values given name + * + * @param String name Header name + * @return Void + */ + delete(name) { + name = `${name}`; + validateName(name); + const key = find(this[MAP], name); + if (key !== undefined) { + delete this[MAP][key]; + } + } + + /** + * Return raw headers (non-spec api) + * + * @return Object + */ + raw() { + return this[MAP]; + } + + /** + * Get an iterator on keys. + * + * @return Iterator + */ + keys() { + return createHeadersIterator(this, 'key'); + } + + /** + * Get an iterator on values. + * + * @return Iterator + */ + values() { + return createHeadersIterator(this, 'value'); + } + + /** + * Get an iterator on entries. + * + * This is the default iterator of the Headers object. + * + * @return Iterator + */ + [Symbol.iterator]() { + return createHeadersIterator(this, 'key+value'); + } +} +Headers.prototype.entries = Headers.prototype[Symbol.iterator]; + +Object.defineProperty(Headers.prototype, Symbol.toStringTag, { + value: 'Headers', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Headers.prototype, { + get: { enumerable: true }, + forEach: { enumerable: true }, + set: { enumerable: true }, + append: { enumerable: true }, + has: { enumerable: true }, + delete: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true } +}); + +function getHeaders(headers) { + let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value'; + + const keys = Object.keys(headers[MAP]).sort(); + return keys.map(kind === 'key' ? function (k) { + return k.toLowerCase(); + } : kind === 'value' ? function (k) { + return headers[MAP][k].join(', '); + } : function (k) { + return [k.toLowerCase(), headers[MAP][k].join(', ')]; + }); +} + +const INTERNAL = Symbol('internal'); + +function createHeadersIterator(target, kind) { + const iterator = Object.create(HeadersIteratorPrototype); + iterator[INTERNAL] = { + target, + kind, + index: 0 + }; + return iterator; +} + +const HeadersIteratorPrototype = Object.setPrototypeOf({ + next() { + // istanbul ignore if + if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) { + throw new TypeError('Value of `this` is not a HeadersIterator'); + } + + var _INTERNAL = this[INTERNAL]; + const target = _INTERNAL.target, + kind = _INTERNAL.kind, + index = _INTERNAL.index; + + const values = getHeaders(target, kind); + const len = values.length; + if (index >= len) { + return { + value: undefined, + done: true + }; + } + + this[INTERNAL].index = index + 1; + + return { + value: values[index], + done: false + }; + } +}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); + +Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { + value: 'HeadersIterator', + writable: false, + enumerable: false, + configurable: true +}); + +/** + * Export the Headers object in a form that Node.js can consume. + * + * @param Headers headers + * @return Object + */ +function exportNodeCompatibleHeaders(headers) { + const obj = Object.assign({ __proto__: null }, headers[MAP]); + + // http.request() only supports string as Host header. This hack makes + // specifying custom Host header possible. + const hostHeaderKey = find(headers[MAP], 'Host'); + if (hostHeaderKey !== undefined) { + obj[hostHeaderKey] = obj[hostHeaderKey][0]; + } + + return obj; +} + +/** + * Create a Headers object from an object of headers, ignoring those that do + * not conform to HTTP grammar productions. + * + * @param Object obj Object of headers + * @return Headers + */ +function createHeadersLenient(obj) { + const headers = new Headers(); + for (const name of Object.keys(obj)) { + if (invalidTokenRegex.test(name)) { + continue; + } + if (Array.isArray(obj[name])) { + for (const val of obj[name]) { + if (invalidHeaderCharRegex.test(val)) { + continue; + } + if (headers[MAP][name] === undefined) { + headers[MAP][name] = [val]; + } else { + headers[MAP][name].push(val); + } + } + } else if (!invalidHeaderCharRegex.test(obj[name])) { + headers[MAP][name] = [obj[name]]; + } + } + return headers; +} + +const INTERNALS$1 = Symbol('Response internals'); + +// fix an issue where "STATUS_CODES" aren't a named export for node <10 +const STATUS_CODES = http.STATUS_CODES; + +/** + * Response class + * + * @param Stream body Readable stream + * @param Object opts Response options + * @return Void + */ +class Response { + constructor() { + let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + Body.call(this, body, opts); + + const status = opts.status || 200; + const headers = new Headers(opts.headers); + + if (body != null && !headers.has('Content-Type')) { + const contentType = extractContentType(body); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + this[INTERNALS$1] = { + url: opts.url, + status, + statusText: opts.statusText || STATUS_CODES[status], + headers, + counter: opts.counter + }; + } + + get url() { + return this[INTERNALS$1].url || ''; + } + + get status() { + return this[INTERNALS$1].status; + } + + /** + * Convenience property representing if the request ended normally + */ + get ok() { + return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; + } + + get redirected() { + return this[INTERNALS$1].counter > 0; + } + + get statusText() { + return this[INTERNALS$1].statusText; + } + + get headers() { + return this[INTERNALS$1].headers; + } + + /** + * Clone this response + * + * @return Response + */ + clone() { + return new Response(clone(this), { + url: this.url, + status: this.status, + statusText: this.statusText, + headers: this.headers, + ok: this.ok, + redirected: this.redirected + }); + } +} + +Body.mixIn(Response.prototype); + +Object.defineProperties(Response.prototype, { + url: { enumerable: true }, + status: { enumerable: true }, + ok: { enumerable: true }, + redirected: { enumerable: true }, + statusText: { enumerable: true }, + headers: { enumerable: true }, + clone: { enumerable: true } +}); + +Object.defineProperty(Response.prototype, Symbol.toStringTag, { + value: 'Response', + writable: false, + enumerable: false, + configurable: true +}); + +const INTERNALS$2 = Symbol('Request internals'); +const URL = Url.URL || whatwgUrl.URL; + +// fix an issue where "format", "parse" aren't a named export for node <10 +const parse_url = Url.parse; +const format_url = Url.format; + +/** + * Wrapper around `new URL` to handle arbitrary URLs + * + * @param {string} urlStr + * @return {void} + */ +function parseURL(urlStr) { + /* + Check whether the URL is absolute or not + Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 + Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 + */ + if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) { + urlStr = new URL(urlStr).toString(); + } + + // Fallback to old implementation for arbitrary URLs + return parse_url(urlStr); +} + +const streamDestructionSupported = 'destroy' in Stream.Readable.prototype; + +/** + * Check if a value is an instance of Request. + * + * @param Mixed input + * @return Boolean + */ +function isRequest(input) { + return typeof input === 'object' && typeof input[INTERNALS$2] === 'object'; +} + +function isAbortSignal(signal) { + const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal); + return !!(proto && proto.constructor.name === 'AbortSignal'); +} + +/** + * Request class + * + * @param Mixed input Url or Request instance + * @param Object init Custom options + * @return Void + */ +class Request { + constructor(input) { + let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + let parsedURL; + + // normalize input + if (!isRequest(input)) { + if (input && input.href) { + // in order to support Node.js' Url objects; though WHATWG's URL objects + // will fall into this branch also (since their `toString()` will return + // `href` property anyway) + parsedURL = parseURL(input.href); + } else { + // coerce input to a string before attempting to parse + parsedURL = parseURL(`${input}`); + } + input = {}; + } else { + parsedURL = parseURL(input.url); + } + + let method = init.method || input.method || 'GET'; + method = method.toUpperCase(); + + if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) { + throw new TypeError('Request with GET/HEAD method cannot have body'); + } + + let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null; + + Body.call(this, inputBody, { + timeout: init.timeout || input.timeout || 0, + size: init.size || input.size || 0 + }); + + const headers = new Headers(init.headers || input.headers || {}); + + if (inputBody != null && !headers.has('Content-Type')) { + const contentType = extractContentType(inputBody); + if (contentType) { + headers.append('Content-Type', contentType); + } + } + + let signal = isRequest(input) ? input.signal : null; + if ('signal' in init) signal = init.signal; + + if (signal != null && !isAbortSignal(signal)) { + throw new TypeError('Expected signal to be an instanceof AbortSignal'); + } + + this[INTERNALS$2] = { + method, + redirect: init.redirect || input.redirect || 'follow', + headers, + parsedURL, + signal + }; + + // node-fetch-only options + this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20; + this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true; + this.counter = init.counter || input.counter || 0; + this.agent = init.agent || input.agent; + } + + get method() { + return this[INTERNALS$2].method; + } + + get url() { + return format_url(this[INTERNALS$2].parsedURL); + } + + get headers() { + return this[INTERNALS$2].headers; + } + + get redirect() { + return this[INTERNALS$2].redirect; + } + + get signal() { + return this[INTERNALS$2].signal; + } + + /** + * Clone this request + * + * @return Request + */ + clone() { + return new Request(this); + } +} + +Body.mixIn(Request.prototype); + +Object.defineProperty(Request.prototype, Symbol.toStringTag, { + value: 'Request', + writable: false, + enumerable: false, + configurable: true +}); + +Object.defineProperties(Request.prototype, { + method: { enumerable: true }, + url: { enumerable: true }, + headers: { enumerable: true }, + redirect: { enumerable: true }, + clone: { enumerable: true }, + signal: { enumerable: true } +}); + +/** + * Convert a Request to Node.js http request options. + * + * @param Request A Request instance + * @return Object The options object to be passed to http.request + */ +function getNodeRequestOptions(request) { + const parsedURL = request[INTERNALS$2].parsedURL; + const headers = new Headers(request[INTERNALS$2].headers); + + // fetch step 1.3 + if (!headers.has('Accept')) { + headers.set('Accept', '*/*'); + } + + // Basic fetch + if (!parsedURL.protocol || !parsedURL.hostname) { + throw new TypeError('Only absolute URLs are supported'); + } + + if (!/^https?:$/.test(parsedURL.protocol)) { + throw new TypeError('Only HTTP(S) protocols are supported'); + } + + if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) { + throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8'); + } + + // HTTP-network-or-cache fetch steps 2.4-2.7 + let contentLengthValue = null; + if (request.body == null && /^(POST|PUT)$/i.test(request.method)) { + contentLengthValue = '0'; + } + if (request.body != null) { + const totalBytes = getTotalBytes(request); + if (typeof totalBytes === 'number') { + contentLengthValue = String(totalBytes); + } + } + if (contentLengthValue) { + headers.set('Content-Length', contentLengthValue); + } + + // HTTP-network-or-cache fetch step 2.11 + if (!headers.has('User-Agent')) { + headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)'); + } + + // HTTP-network-or-cache fetch step 2.15 + if (request.compress && !headers.has('Accept-Encoding')) { + headers.set('Accept-Encoding', 'gzip,deflate'); + } + + let agent = request.agent; + if (typeof agent === 'function') { + agent = agent(parsedURL); + } + + if (!headers.has('Connection') && !agent) { + headers.set('Connection', 'close'); + } + + // HTTP-network fetch step 4.2 + // chunked encoding is handled by Node.js + + return Object.assign({}, parsedURL, { + method: request.method, + headers: exportNodeCompatibleHeaders(headers), + agent + }); +} + +/** + * abort-error.js + * + * AbortError interface for cancelled requests + */ + +/** + * Create AbortError instance + * + * @param String message Error message for human + * @return AbortError + */ +function AbortError(message) { + Error.call(this, message); + + this.type = 'aborted'; + this.message = message; + + // hide custom error implementation details from end-users + Error.captureStackTrace(this, this.constructor); +} + +AbortError.prototype = Object.create(Error.prototype); +AbortError.prototype.constructor = AbortError; +AbortError.prototype.name = 'AbortError'; + +const URL$1 = Url.URL || whatwgUrl.URL; + +// fix an issue where "PassThrough", "resolve" aren't a named export for node <10 +const PassThrough$1 = Stream.PassThrough; + +const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) { + const orig = new URL$1(original).hostname; + const dest = new URL$1(destination).hostname; + + return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest); +}; + +/** + * Fetch function + * + * @param Mixed url Absolute url or Request instance + * @param Object opts Fetch options + * @return Promise + */ +function fetch(url, opts) { + + // allow custom promise + if (!fetch.Promise) { + throw new Error('native promise missing, set fetch.Promise to your favorite alternative'); + } + + Body.Promise = fetch.Promise; + + // wrap http.request into fetch + return new fetch.Promise(function (resolve, reject) { + // build request object + const request = new Request(url, opts); + const options = getNodeRequestOptions(request); + + const send = (options.protocol === 'https:' ? https : http).request; + const signal = request.signal; + + let response = null; + + const abort = function abort() { + let error = new AbortError('The user aborted a request.'); + reject(error); + if (request.body && request.body instanceof Stream.Readable) { + request.body.destroy(error); + } + if (!response || !response.body) return; + response.body.emit('error', error); + }; + + if (signal && signal.aborted) { + abort(); + return; + } + + const abortAndFinalize = function abortAndFinalize() { + abort(); + finalize(); + }; + + // send request + const req = send(options); + let reqTimeout; + + if (signal) { + signal.addEventListener('abort', abortAndFinalize); + } + + function finalize() { + req.abort(); + if (signal) signal.removeEventListener('abort', abortAndFinalize); + clearTimeout(reqTimeout); + } + + if (request.timeout) { + req.once('socket', function (socket) { + reqTimeout = setTimeout(function () { + reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout')); + finalize(); + }, request.timeout); + }); + } + + req.on('error', function (err) { + reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err)); + finalize(); + }); + + req.on('response', function (res) { + clearTimeout(reqTimeout); + + const headers = createHeadersLenient(res.headers); + + // HTTP fetch step 5 + if (fetch.isRedirect(res.statusCode)) { + // HTTP fetch step 5.2 + const location = headers.get('Location'); + + // HTTP fetch step 5.3 + let locationURL = null; + try { + locationURL = location === null ? null : new URL$1(location, request.url).toString(); + } catch (err) { + // error here can only be invalid URL in Location: header + // do not throw when options.redirect == manual + // let the user extract the errorneous redirect URL + if (request.redirect !== 'manual') { + reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect')); + finalize(); + return; + } + } + + // HTTP fetch step 5.5 + switch (request.redirect) { + case 'error': + reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect')); + finalize(); + return; + case 'manual': + // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL. + if (locationURL !== null) { + // handle corrupted header + try { + headers.set('Location', locationURL); + } catch (err) { + // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request + reject(err); + } + } + break; + case 'follow': + // HTTP-redirect fetch step 2 + if (locationURL === null) { + break; + } + + // HTTP-redirect fetch step 5 + if (request.counter >= request.follow) { + reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 6 (counter increment) + // Create a new Request object. + const requestOpts = { + headers: new Headers(request.headers), + follow: request.follow, + counter: request.counter + 1, + agent: request.agent, + compress: request.compress, + method: request.method, + body: request.body, + signal: request.signal, + timeout: request.timeout, + size: request.size + }; + + if (!isDomainOrSubdomain(request.url, locationURL)) { + for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) { + requestOpts.headers.delete(name); + } + } + + // HTTP-redirect fetch step 9 + if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) { + reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect')); + finalize(); + return; + } + + // HTTP-redirect fetch step 11 + if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') { + requestOpts.method = 'GET'; + requestOpts.body = undefined; + requestOpts.headers.delete('content-length'); + } + + // HTTP-redirect fetch step 15 + resolve(fetch(new Request(locationURL, requestOpts))); + finalize(); + return; + } + } + + // prepare response + res.once('end', function () { + if (signal) signal.removeEventListener('abort', abortAndFinalize); + }); + let body = res.pipe(new PassThrough$1()); + + const response_options = { + url: request.url, + status: res.statusCode, + statusText: res.statusMessage, + headers: headers, + size: request.size, + timeout: request.timeout, + counter: request.counter + }; + + // HTTP-network fetch step 12.1.1.3 + const codings = headers.get('Content-Encoding'); + + // HTTP-network fetch step 12.1.1.4: handle content codings + + // in following scenarios we ignore compression support + // 1. compression support is disabled + // 2. HEAD request + // 3. no Content-Encoding header + // 4. no content response (204) + // 5. content not modified response (304) + if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) { + response = new Response(body, response_options); + resolve(response); + return; + } + + // For Node v6+ + // Be less strict when decoding compressed responses, since sometimes + // servers send slightly invalid responses that are still accepted + // by common browsers. + // Always using Z_SYNC_FLUSH is what cURL does. + const zlibOptions = { + flush: zlib.Z_SYNC_FLUSH, + finishFlush: zlib.Z_SYNC_FLUSH + }; + + // for gzip + if (codings == 'gzip' || codings == 'x-gzip') { + body = body.pipe(zlib.createGunzip(zlibOptions)); + response = new Response(body, response_options); + resolve(response); + return; + } + + // for deflate + if (codings == 'deflate' || codings == 'x-deflate') { + // handle the infamous raw deflate response from old servers + // a hack for old IIS and Apache servers + const raw = res.pipe(new PassThrough$1()); + raw.once('data', function (chunk) { + // see http://stackoverflow.com/questions/37519828 + if ((chunk[0] & 0x0F) === 0x08) { + body = body.pipe(zlib.createInflate()); + } else { + body = body.pipe(zlib.createInflateRaw()); + } + response = new Response(body, response_options); + resolve(response); + }); + return; + } + + // for br + if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') { + body = body.pipe(zlib.createBrotliDecompress()); + response = new Response(body, response_options); + resolve(response); + return; + } + + // otherwise, use response as-is + response = new Response(body, response_options); + resolve(response); + }); + + writeToStream(req, request); + }); +} +/** + * Redirect code matching + * + * @param Number code Status code + * @return Boolean + */ +fetch.isRedirect = function (code) { + return code === 301 || code === 302 || code === 303 || code === 307 || code === 308; +}; + +// expose Promise +fetch.Promise = global.Promise; + +module.exports = exports = fetch; +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.default = exports; +exports.Headers = Headers; +exports.Request = Request; +exports.Response = Response; +exports.FetchError = FetchError; + + +/***/ }), + +/***/ 2299: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +var punycode = __nccwpck_require__(4213); +var mappingTable = __nccwpck_require__(8661); + +var PROCESSING_OPTIONS = { + TRANSITIONAL: 0, + NONTRANSITIONAL: 1 +}; + +function normalize(str) { // fix bug in v8 + return str.split('\u0000').map(function (s) { return s.normalize('NFC'); }).join('\u0000'); +} + +function findStatus(val) { + var start = 0; + var end = mappingTable.length - 1; + + while (start <= end) { + var mid = Math.floor((start + end) / 2); + + var target = mappingTable[mid]; + if (target[0][0] <= val && target[0][1] >= val) { + return target; + } else if (target[0][0] > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + + return null; +} + +var regexAstralSymbols = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + +function countSymbols(string) { + return string + // replace every surrogate pair with a BMP symbol + .replace(regexAstralSymbols, '_') + // then get the length + .length; +} + +function mapChars(domain_name, useSTD3, processing_option) { + var hasError = false; + var processed = ""; + + var len = countSymbols(domain_name); + for (var i = 0; i < len; ++i) { + var codePoint = domain_name.codePointAt(i); + var status = findStatus(codePoint); + + switch (status[1]) { + case "disallowed": + hasError = true; + processed += String.fromCodePoint(codePoint); + break; + case "ignored": + break; + case "mapped": + processed += String.fromCodePoint.apply(String, status[2]); + break; + case "deviation": + if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) { + processed += String.fromCodePoint.apply(String, status[2]); + } else { + processed += String.fromCodePoint(codePoint); + } + break; + case "valid": + processed += String.fromCodePoint(codePoint); + break; + case "disallowed_STD3_mapped": + if (useSTD3) { + hasError = true; + processed += String.fromCodePoint(codePoint); + } else { + processed += String.fromCodePoint.apply(String, status[2]); + } + break; + case "disallowed_STD3_valid": + if (useSTD3) { + hasError = true; + } + + processed += String.fromCodePoint(codePoint); + break; + } + } + + return { + string: processed, + error: hasError + }; +} + +var combiningMarksRegex = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2D]|\uD800[\uDDFD\uDEE0\uDF76-\uDF7A]|\uD802[\uDE01-\uDE03\uDE05\uDE06\uDE0C-\uDE0F\uDE38-\uDE3A\uDE3F\uDEE5\uDEE6]|\uD804[\uDC00-\uDC02\uDC38-\uDC46\uDC7F-\uDC82\uDCB0-\uDCBA\uDD00-\uDD02\uDD27-\uDD34\uDD73\uDD80-\uDD82\uDDB3-\uDDC0\uDE2C-\uDE37\uDEDF-\uDEEA\uDF01-\uDF03\uDF3C\uDF3E-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF62\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDCB0-\uDCC3\uDDAF-\uDDB5\uDDB8-\uDDC0\uDE30-\uDE40\uDEAB-\uDEB7]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF51-\uDF7E\uDF8F-\uDF92]|\uD82F[\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD83A[\uDCD0-\uDCD6]|\uDB40[\uDD00-\uDDEF]/; + +function validateLabel(label, processing_option) { + if (label.substr(0, 4) === "xn--") { + label = punycode.toUnicode(label); + processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL; + } + + var error = false; + + if (normalize(label) !== label || + (label[3] === "-" && label[4] === "-") || + label[0] === "-" || label[label.length - 1] === "-" || + label.indexOf(".") !== -1 || + label.search(combiningMarksRegex) === 0) { + error = true; + } + + var len = countSymbols(label); + for (var i = 0; i < len; ++i) { + var status = findStatus(label.codePointAt(i)); + if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid") || + (processing === PROCESSING_OPTIONS.NONTRANSITIONAL && + status[1] !== "valid" && status[1] !== "deviation")) { + error = true; + break; + } + } + + return { + label: label, + error: error + }; +} + +function processing(domain_name, useSTD3, processing_option) { + var result = mapChars(domain_name, useSTD3, processing_option); + result.string = normalize(result.string); + + var labels = result.string.split("."); + for (var i = 0; i < labels.length; ++i) { + try { + var validation = validateLabel(labels[i]); + labels[i] = validation.label; + result.error = result.error || validation.error; + } catch(e) { + result.error = true; + } + } + + return { + string: labels.join("."), + error: result.error + }; +} + +module.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) { + var result = processing(domain_name, useSTD3, processing_option); + var labels = result.string.split("."); + labels = labels.map(function(l) { + try { + return punycode.toASCII(l); + } catch(e) { + result.error = true; + return l; + } + }); + + if (verifyDnsLength) { + var total = labels.slice(0, labels.length - 1).join(".").length; + if (total.length > 253 || total.length === 0) { + result.error = true; + } + + for (var i=0; i < labels.length; ++i) { + if (labels.length > 63 || labels.length === 0) { + result.error = true; + break; + } + } + } + + if (result.error) return null; + return labels.join("."); }; -exports.DbSystemValues = { - /** Some other SQL database. Fallback only. See notes. */ - OTHER_SQL: 'other_sql', - /** Microsoft SQL Server. */ - MSSQL: 'mssql', - /** MySQL. */ - MYSQL: 'mysql', - /** Oracle Database. */ - ORACLE: 'oracle', - /** IBM Db2. */ - DB2: 'db2', - /** PostgreSQL. */ - POSTGRESQL: 'postgresql', - /** Amazon Redshift. */ - REDSHIFT: 'redshift', - /** Apache Hive. */ - HIVE: 'hive', - /** Cloudscape. */ - CLOUDSCAPE: 'cloudscape', - /** HyperSQL DataBase. */ - HSQLDB: 'hsqldb', - /** Progress Database. */ - PROGRESS: 'progress', - /** SAP MaxDB. */ - MAXDB: 'maxdb', - /** SAP HANA. */ - HANADB: 'hanadb', - /** Ingres. */ - INGRES: 'ingres', - /** FirstSQL. */ - FIRSTSQL: 'firstsql', - /** EnterpriseDB. */ - EDB: 'edb', - /** InterSystems Caché. */ - CACHE: 'cache', - /** Adabas (Adaptable Database System). */ - ADABAS: 'adabas', - /** Firebird. */ - FIREBIRD: 'firebird', - /** Apache Derby. */ - DERBY: 'derby', - /** FileMaker. */ - FILEMAKER: 'filemaker', - /** Informix. */ - INFORMIX: 'informix', - /** InstantDB. */ - INSTANTDB: 'instantdb', - /** InterBase. */ - INTERBASE: 'interbase', - /** MariaDB. */ - MARIADB: 'mariadb', - /** Netezza. */ - NETEZZA: 'netezza', - /** Pervasive PSQL. */ - PERVASIVE: 'pervasive', - /** PointBase. */ - POINTBASE: 'pointbase', - /** SQLite. */ - SQLITE: 'sqlite', - /** Sybase. */ - SYBASE: 'sybase', - /** Teradata. */ - TERADATA: 'teradata', - /** Vertica. */ - VERTICA: 'vertica', - /** H2. */ - H2: 'h2', - /** ColdFusion IMQ. */ - COLDFUSION: 'coldfusion', - /** Apache Cassandra. */ - CASSANDRA: 'cassandra', - /** Apache HBase. */ - HBASE: 'hbase', - /** MongoDB. */ - MONGODB: 'mongodb', - /** Redis. */ - REDIS: 'redis', - /** Couchbase. */ - COUCHBASE: 'couchbase', - /** CouchDB. */ - COUCHDB: 'couchdb', - /** Microsoft Azure Cosmos DB. */ - COSMOSDB: 'cosmosdb', - /** Amazon DynamoDB. */ - DYNAMODB: 'dynamodb', - /** Neo4j. */ - NEO4J: 'neo4j', - /** Apache Geode. */ - GEODE: 'geode', - /** Elasticsearch. */ - ELASTICSEARCH: 'elasticsearch', - /** Memcached. */ - MEMCACHED: 'memcached', - /** CockroachDB. */ - COCKROACHDB: 'cockroachdb', + +module.exports.toUnicode = function(domain_name, useSTD3) { + var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL); + + return { + domain: result.string, + error: result.error + }; }; -exports.DbCassandraConsistencyLevelValues = { - /** all. */ - ALL: 'all', - /** each_quorum. */ - EACH_QUORUM: 'each_quorum', - /** quorum. */ - QUORUM: 'quorum', - /** local_quorum. */ - LOCAL_QUORUM: 'local_quorum', - /** one. */ - ONE: 'one', - /** two. */ - TWO: 'two', - /** three. */ - THREE: 'three', - /** local_one. */ - LOCAL_ONE: 'local_one', - /** any. */ - ANY: 'any', - /** serial. */ - SERIAL: 'serial', - /** local_serial. */ - LOCAL_SERIAL: 'local_serial', + +module.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS; + + +/***/ }), + +/***/ 5871: +/***/ ((module) => { + +"use strict"; + + +var conversions = {}; +module.exports = conversions; + +function sign(x) { + return x < 0 ? -1 : 1; +} + +function evenRound(x) { + // Round x to the nearest integer, choosing the even integer if it lies halfway between two. + if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor) + return Math.floor(x); + } else { + return Math.round(x); + } +} + +function createNumberConversion(bitLength, typeOpts) { + if (!typeOpts.unsigned) { + --bitLength; + } + const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength); + const upperBound = Math.pow(2, bitLength) - 1; + + const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength); + const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1); + + return function(V, opts) { + if (!opts) opts = {}; + + let x = +V; + + if (opts.enforceRange) { + if (!Number.isFinite(x)) { + throw new TypeError("Argument is not a finite number"); + } + + x = sign(x) * Math.floor(Math.abs(x)); + if (x < lowerBound || x > upperBound) { + throw new TypeError("Argument is not in byte range"); + } + + return x; + } + + if (!isNaN(x) && opts.clamp) { + x = evenRound(x); + + if (x < lowerBound) x = lowerBound; + if (x > upperBound) x = upperBound; + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + x = sign(x) * Math.floor(Math.abs(x)); + x = x % moduloVal; + + if (!typeOpts.unsigned && x >= moduloBound) { + return x - moduloVal; + } else if (typeOpts.unsigned) { + if (x < 0) { + x += moduloVal; + } else if (x === -0) { // don't return negative zero + return 0; + } + } + + return x; + } +} + +conversions["void"] = function () { + return undefined; }; -exports.FaasTriggerValues = { - /** A response to some data source operation such as a database or filesystem read/write. */ - DATASOURCE: 'datasource', - /** To provide an answer to an inbound HTTP request. */ - HTTP: 'http', - /** A function is set to be executed when messages are sent to a messaging system. */ - PUBSUB: 'pubsub', - /** A function is scheduled to be executed regularly. */ - TIMER: 'timer', - /** If none of the others apply. */ - OTHER: 'other', + +conversions["boolean"] = function (val) { + return !!val; }; -exports.FaasDocumentOperationValues = { - /** When a new object is created. */ - INSERT: 'insert', - /** When an object is modified. */ - EDIT: 'edit', - /** When an object is deleted. */ - DELETE: 'delete', + +conversions["byte"] = createNumberConversion(8, { unsigned: false }); +conversions["octet"] = createNumberConversion(8, { unsigned: true }); + +conversions["short"] = createNumberConversion(16, { unsigned: false }); +conversions["unsigned short"] = createNumberConversion(16, { unsigned: true }); + +conversions["long"] = createNumberConversion(32, { unsigned: false }); +conversions["unsigned long"] = createNumberConversion(32, { unsigned: true }); + +conversions["long long"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 }); +conversions["unsigned long long"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 }); + +conversions["double"] = function (V) { + const x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError("Argument is not a finite floating-point value"); + } + + return x; +}; + +conversions["unrestricted double"] = function (V) { + const x = +V; + + if (isNaN(x)) { + throw new TypeError("Argument is NaN"); + } + + return x; +}; + +// not quite valid, but good enough for JS +conversions["float"] = conversions["double"]; +conversions["unrestricted float"] = conversions["unrestricted double"]; + +conversions["DOMString"] = function (V, opts) { + if (!opts) opts = {}; + + if (opts.treatNullAsEmptyString && V === null) { + return ""; + } + + return String(V); +}; + +conversions["ByteString"] = function (V, opts) { + const x = String(V); + let c = undefined; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw new TypeError("Argument is not a valid bytestring"); + } + } + + return x; +}; + +conversions["USVString"] = function (V) { + const S = String(V); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + const d = S.charCodeAt(i + 1); + if (0xDC00 <= d && d <= 0xDFFF) { + const a = c & 0x3FF; + const b = d & 0x3FF; + U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + } + + return U.join(''); +}; + +conversions["Date"] = function (V, opts) { + if (!(V instanceof Date)) { + throw new TypeError("Argument is not a Date object"); + } + if (isNaN(V)) { + return undefined; + } + + return V; +}; + +conversions["RegExp"] = function (V, opts) { + if (!(V instanceof RegExp)) { + V = new RegExp(V); + } + + return V; +}; + + +/***/ }), + +/***/ 8262: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +const usm = __nccwpck_require__(33); + +exports.implementation = class URLImpl { + constructor(constructorArgs) { + const url = constructorArgs[0]; + const base = constructorArgs[1]; + + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === "failure") { + throw new TypeError("Invalid base URL"); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); + } + + this._url = parsedURL; + + // TODO: query stuff + } + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === "failure") { + throw new TypeError("Invalid URL"); + } + + this._url = parsedURL; + } + + get origin() { + return usm.serializeURLOrigin(this._url); + } + + get protocol() { + return this._url.scheme + ":"; + } + + set protocol(v) { + usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setTheUsername(this._url, v); + } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); + } + + set host(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + if (this._url.cannotBeABaseURL) { + return this._url.path[0]; + } + + if (this._url.path.length === 0) { + return ""; + } + + return "/" + this._url.path.join("/"); + } + + set pathname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return "?" + this._url.query; + } + + set search(v) { + // TODO: query stuff + + const url = this._url; + + if (v === "") { + url.query = null; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return "#" + this._url.fragment; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } }; -exports.FaasInvokedProviderValues = { - /** Alibaba Cloud. */ - ALIBABA_CLOUD: 'alibaba_cloud', - /** Amazon Web Services. */ - AWS: 'aws', - /** Microsoft Azure. */ - AZURE: 'azure', - /** Google Cloud Platform. */ - GCP: 'gcp', + + +/***/ }), + +/***/ 653: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + + +const conversions = __nccwpck_require__(5871); +const utils = __nccwpck_require__(276); +const Impl = __nccwpck_require__(8262); + +const impl = utils.implSymbol; + +function URL(url) { + if (!this || this[impl] || !(this instanceof URL)) { + throw new TypeError("Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function."); + } + if (arguments.length < 1) { + throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); + } + const args = []; + for (let i = 0; i < arguments.length && i < 2; ++i) { + args[i] = arguments[i]; + } + args[0] = conversions["USVString"](args[0]); + if (args[1] !== undefined) { + args[1] = conversions["USVString"](args[1]); + } + + module.exports.setup(this, args); +} + +URL.prototype.toJSON = function toJSON() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + const args = []; + for (let i = 0; i < arguments.length && i < 0; ++i) { + args[i] = arguments[i]; + } + return this[impl].toJSON.apply(this[impl], args); }; -exports.NetTransportValues = { - /** ip_tcp. */ - IP_TCP: 'ip_tcp', - /** ip_udp. */ - IP_UDP: 'ip_udp', - /** Another IP-based protocol. */ - IP: 'ip', - /** Unix Domain socket. See below. */ - UNIX: 'unix', - /** Named or anonymous pipe. See note below. */ - PIPE: 'pipe', - /** In-process communication. */ - INPROC: 'inproc', - /** Something else (non IP-based). */ - OTHER: 'other', +Object.defineProperty(URL.prototype, "href", { + get() { + return this[impl].href; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].href = V; + }, + enumerable: true, + configurable: true +}); + +URL.prototype.toString = function () { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return this.href; }; -exports.NetHostConnectionTypeValues = { - /** wifi. */ - WIFI: 'wifi', - /** wired. */ - WIRED: 'wired', - /** cell. */ - CELL: 'cell', - /** unavailable. */ - UNAVAILABLE: 'unavailable', - /** unknown. */ - UNKNOWN: 'unknown', + +Object.defineProperty(URL.prototype, "origin", { + get() { + return this[impl].origin; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "protocol", { + get() { + return this[impl].protocol; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].protocol = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "username", { + get() { + return this[impl].username; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].username = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "password", { + get() { + return this[impl].password; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].password = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "host", { + get() { + return this[impl].host; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].host = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "hostname", { + get() { + return this[impl].hostname; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].hostname = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "port", { + get() { + return this[impl].port; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].port = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "pathname", { + get() { + return this[impl].pathname; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].pathname = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "search", { + get() { + return this[impl].search; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].search = V; + }, + enumerable: true, + configurable: true +}); + +Object.defineProperty(URL.prototype, "hash", { + get() { + return this[impl].hash; + }, + set(V) { + V = conversions["USVString"](V); + this[impl].hash = V; + }, + enumerable: true, + configurable: true +}); + + +module.exports = { + is(obj) { + return !!obj && obj[impl] instanceof Impl.implementation; + }, + create(constructorArgs, privateData) { + let obj = Object.create(URL.prototype); + this.setup(obj, constructorArgs, privateData); + return obj; + }, + setup(obj, constructorArgs, privateData) { + if (!privateData) privateData = {}; + privateData.wrapper = obj; + + obj[impl] = new Impl.implementation(constructorArgs, privateData); + obj[impl][utils.wrapperSymbol] = obj; + }, + interface: URL, + expose: { + Window: { URL: URL }, + Worker: { URL: URL } + } }; -exports.NetHostConnectionSubtypeValues = { - /** GPRS. */ - GPRS: 'gprs', - /** EDGE. */ - EDGE: 'edge', - /** UMTS. */ - UMTS: 'umts', - /** CDMA. */ - CDMA: 'cdma', - /** EVDO Rel. 0. */ - EVDO_0: 'evdo_0', - /** EVDO Rev. A. */ - EVDO_A: 'evdo_a', - /** CDMA2000 1XRTT. */ - CDMA2000_1XRTT: 'cdma2000_1xrtt', - /** HSDPA. */ - HSDPA: 'hsdpa', - /** HSUPA. */ - HSUPA: 'hsupa', - /** HSPA. */ - HSPA: 'hspa', - /** IDEN. */ - IDEN: 'iden', - /** EVDO Rev. B. */ - EVDO_B: 'evdo_b', - /** LTE. */ - LTE: 'lte', - /** EHRPD. */ - EHRPD: 'ehrpd', - /** HSPAP. */ - HSPAP: 'hspap', - /** GSM. */ - GSM: 'gsm', - /** TD-SCDMA. */ - TD_SCDMA: 'td_scdma', - /** IWLAN. */ - IWLAN: 'iwlan', - /** 5G NR (New Radio). */ - NR: 'nr', - /** 5G NRNSA (New Radio Non-Standalone). */ - NRNSA: 'nrnsa', - /** LTE CA. */ - LTE_CA: 'lte_ca', + + + +/***/ }), + +/***/ 3323: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + + +exports.URL = __nccwpck_require__(653).interface; +exports.serializeURL = __nccwpck_require__(33).serializeURL; +exports.serializeURLOrigin = __nccwpck_require__(33).serializeURLOrigin; +exports.basicURLParse = __nccwpck_require__(33).basicURLParse; +exports.setTheUsername = __nccwpck_require__(33).setTheUsername; +exports.setThePassword = __nccwpck_require__(33).setThePassword; +exports.serializeHost = __nccwpck_require__(33).serializeHost; +exports.serializeInteger = __nccwpck_require__(33).serializeInteger; +exports.parseURL = __nccwpck_require__(33).parseURL; + + +/***/ }), + +/***/ 33: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +"use strict"; + +const punycode = __nccwpck_require__(4213); +const tr46 = __nccwpck_require__(2299); + +const specialSchemes = { + ftp: 21, + file: null, + gopher: 70, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return punycode.ucs2.decode(str).length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = "0" + hex; + } + + return "%" + hex; +} + +function utf8PercentEncode(c) { + const buf = new Buffer(c); + + let str = ""; + + for (let i = 0; i < buf.length; ++i) { + str += percentEncode(buf[i]); + } + + return str; +} + +function utf8PercentDecode(str) { + const input = new Buffer(str); + const output = []; + for (let i = 0; i < input.length; ++i) { + if (input[i] !== 37) { + output.push(input[i]); + } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) { + output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16)); + i += 2; + } else { + output.push(input[i]); + } + } + return new Buffer(output).toString(); +} + +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +const extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); +function isPathPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +const extraUserinfoPercentEncodeSet = + new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +function percentEncodeChar(c, encodeSetPredicate) { + const cStr = String.fromCodePoint(c); + + if (encodeSetPredicate(c)) { + return utf8PercentEncode(cStr); + } + + return cStr; +} + +function parseIPv4Number(input) { + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/); + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return input; + } + + const numbers = []; + for (const part of parts) { + if (part === "") { + return input; + } + const n = parseIPv4Number(part); + if (n === failure) { + return input; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * Math.pow(256, 3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = "." + output; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = punycode.ucs2.decode(input); + + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === 58) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === 46) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!isASCIIDigit(input[pointer])) { + return failure; + } + + while (isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === 58) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const seqResult = findLongestZeroSequence(address); + const compress = seqResult.idx; + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isSpecialArg) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (!isSpecialArg) { + return parseOpaqueHost(input); + } + + const domain = utf8PercentDecode(input); + const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false); + if (asciiDomain === null) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + const ipv4Host = parseIPv4(asciiDomain); + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; + } + + return asciiDomain; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + let output = ""; + const decoded = punycode.ucs2.decode(input); + for (let i = 0; i < decoded.length; ++i) { + output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); + } + return output; +} + +function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; // only find elements > 1 + let currStart = null; + let currLen = 0; + + for (let i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + ++currLen; + } + } + + // if trailing zeros + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + return { + idx: maxIdx, + len: maxLen + }; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; + } + + return host; +} + +function trimControlChars(url) { + return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/g, ""); +} + +function shortenPath(url) { + const path = url.path; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + + cannotBeABaseURL: false + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = punycode.ucs2.decode(this.input); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this["parse " + this.state](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { + return false; + } + } + this.url.scheme = this.buffer; + this.buffer = ""; + if (this.stateOverride) { + return false; + } + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { + return failure; + } else if (this.base.cannotBeABaseURL && c === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (isNaN(c)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 47) { + this.state = "relative slash"; + } else if (c === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === 47 || c === 92)) { + if (c === 92) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== 47 && c !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === 64) { + this.parseError = true; + if (this.atFlag) { + this.buffer = "%40" + this.buffer; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + if (this.stateOverride === "hostname") { + return false; + } + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === 91) { + this.arrFlag = true; + } else if (c === 93) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points + !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) || + (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points + !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === 92) { + this.parseError = true; + } + this.state = "path"; + + if (c !== 47 && c !== 92) { + --this.pointer; + } + } else if (!this.stateOverride && c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== 47) { + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || + (!this.stateOverride && (c === 63 || c === 35))) { + if (isSpecial(this.url) && c === 92) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== 47 && + !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; + } + this.buffer = this.buffer[0] + ":"; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += percentEncodeChar(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== 37) { + this.parseError = true; + } + + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (isNaN(c) || (!this.stateOverride && c === 35)) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || + buffer[i] === 0x3C || buffer[i] === 0x3E) { + this.url.query += percentEncode(buffer[i]); + } else { + this.url.query += String.fromCodePoint(buffer[i]); + } + } + + this.buffer = ""; + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (isNaN(c)) { // do nothing + } else if (c === 0x0) { + this.parseError = true; + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!isASCIIHex(this.input[this.pointer + 1]) || + !isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = url.scheme + ":"; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += ":" + url.password; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += ":" + url.port; + } + } else if (url.host === null && url.scheme === "file") { + output += "//"; + } + + if (url.cannotBeABaseURL) { + output += url.path[0]; + } else { + for (const string of url.path) { + output += "/" + string; + } + } + + if (url.query !== null) { + output += "?" + url.query; + } + + if (!excludeFragment && url.fragment !== null) { + output += "#" + url.fragment; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = tuple.scheme + "://"; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += ":" + tuple.port; + } + + return result; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); + } catch (e) { + // serializing an opaque origin returns "null" + return "null"; + } + case "ftp": + case "gopher": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // spec says "exercise to the reader", chrome says "file://" + return "file://"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return "failure"; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = ""; + const decoded = punycode.ucs2.decode(username); + for (let i = 0; i < decoded.length; ++i) { + url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.setThePassword = function (url, password) { + url.password = ""; + const decoded = punycode.ucs2.decode(password); + for (let i = 0; i < decoded.length; ++i) { + url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; + + +/***/ }), + +/***/ 276: +/***/ ((module) => { + +"use strict"; + + +module.exports.mixin = function mixin(target, source) { + const keys = Object.getOwnPropertyNames(source); + for (let i = 0; i < keys.length; ++i) { + Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i])); + } }; -exports.HttpFlavorValues = { - /** HTTP 1.0. */ - HTTP_1_0: '1.0', - /** HTTP 1.1. */ - HTTP_1_1: '1.1', - /** HTTP 2. */ - HTTP_2_0: '2.0', - /** SPDY protocol. */ - SPDY: 'SPDY', - /** QUIC protocol. */ - QUIC: 'QUIC', + +module.exports.wrapperSymbol = Symbol("wrapper"); +module.exports.implSymbol = Symbol("impl"); + +module.exports.wrapperForImpl = function (impl) { + return impl[module.exports.wrapperSymbol]; }; -exports.MessagingDestinationKindValues = { - /** A message sent to a queue. */ - QUEUE: 'queue', - /** A message sent to a topic. */ - TOPIC: 'topic', + +module.exports.implForWrapper = function (wrapper) { + return wrapper[module.exports.implSymbol]; }; -exports.MessagingOperationValues = { - /** receive. */ - RECEIVE: 'receive', - /** process. */ - PROCESS: 'process', + + + +/***/ }), + +/***/ 1223: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var wrappy = __nccwpck_require__(2940) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} + + +/***/ }), + +/***/ 2437: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FileExporterBase = void 0; +const api_1 = __nccwpck_require__(5163); +const core_1 = __nccwpck_require__(9736); +class FileExporterBase { + /* istanbul ignore next */ + constructor(config = {}) { + this._isShutdown = false; + this._shuttingDownPromise = Promise.resolve(); + this._sendingPromises = []; + this.filePath = config.filePath; + this.attributes = config.attributes; + this.shutdown = this.shutdown.bind(this); + this._concurrencyLimit = + typeof config.concurrencyLimit === "number" + ? config.concurrencyLimit + : Infinity; + // platform dependent + this.onInit(config); + } + export(items, resultCallback) { + if (this._isShutdown) { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error("Exporter has been shutdown"), + }); + return; + } + if (this._sendingPromises.length >= this._concurrencyLimit) { + resultCallback({ + code: core_1.ExportResultCode.FAILED, + error: new Error("Concurrent export limit reached"), + }); + return; + } + this._export(items) + .then(() => { + resultCallback({ code: core_1.ExportResultCode.SUCCESS }); + }) + .catch((error) => { + resultCallback({ code: core_1.ExportResultCode.FAILED, error }); + }); + } + _export(items) { + return new Promise((resolve, reject) => { + try { + api_1.diag.debug("items to be sent", items); + this.send(items, resolve, reject); + } + catch (e) { + reject(e); + } + }); + } + /** + * Shutdown the exporter. + */ + async shutdown() { + if (this._isShutdown) { + api_1.diag.debug("shutdown already started"); + return this._shuttingDownPromise; + } + this._isShutdown = true; + api_1.diag.debug("shutdown started"); + this._shuttingDownPromise = this._shutdown(); + return await this._shuttingDownPromise; + } + async _shutdown() { + await this.onShutdown(); + await Promise.all(this._sendingPromises); + } +} +exports.FileExporterBase = FileExporterBase; + + +/***/ }), + +/***/ 8595: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; -exports.RpcGrpcStatusCodeValues = { - /** OK. */ - OK: 0, - /** CANCELLED. */ - CANCELLED: 1, - /** UNKNOWN. */ - UNKNOWN: 2, - /** INVALID_ARGUMENT. */ - INVALID_ARGUMENT: 3, - /** DEADLINE_EXCEEDED. */ - DEADLINE_EXCEEDED: 4, - /** NOT_FOUND. */ - NOT_FOUND: 5, - /** ALREADY_EXISTS. */ - ALREADY_EXISTS: 6, - /** PERMISSION_DENIED. */ - PERMISSION_DENIED: 7, - /** RESOURCE_EXHAUSTED. */ - RESOURCE_EXHAUSTED: 8, - /** FAILED_PRECONDITION. */ - FAILED_PRECONDITION: 9, - /** ABORTED. */ - ABORTED: 10, - /** OUT_OF_RANGE. */ - OUT_OF_RANGE: 11, - /** UNIMPLEMENTED. */ - UNIMPLEMENTED: 12, - /** INTERNAL. */ - INTERNAL: 13, - /** UNAVAILABLE. */ - UNAVAILABLE: 14, - /** DATA_LOSS. */ - DATA_LOSS: 15, - /** UNAUTHENTICATED. */ - UNAUTHENTICATED: 16, +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(2437), exports); +__exportStar(__nccwpck_require__(1157), exports); +__exportStar(__nccwpck_require__(2280), exports); + + +/***/ }), + +/***/ 1157: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; -exports.MessageTypeValues = { - /** sent. */ - SENT: 'SENT', - /** received. */ - RECEIVED: 'RECEIVED', +Object.defineProperty(exports, "__esModule", ({ value: true })); +__exportStar(__nccwpck_require__(9425), exports); + + +/***/ }), + +/***/ 3125: +/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { + +"use strict"; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (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; }; -//# sourceMappingURL=SemanticAttributes.js.map +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.FileTraceExporter = void 0; +const otlp_transformer_1 = __nccwpck_require__(4357); +const api_1 = __nccwpck_require__(5163); +const FileExporterBase_1 = __nccwpck_require__(2437); +const fs = __importStar(__nccwpck_require__(5747)); +class FileTraceExporter extends FileExporterBase_1.FileExporterBase { + constructor(config) { + super(config); + this._stream = this._createWriteStream(); + } + _createWriteStream() { + if (this._stream && !this.isShutdown()) { + return this._stream; + } + return fs.createWriteStream(this.filePath, { flags: "a" }); + } + async onShutdown() { + return new Promise((resolve, reject) => { + try { + this._stream.end(resolve); + } + catch (error) { + /* istanbul ignore next */ + reject(error); + } + }); + } + isShutdown() { + return this._isShutdown && !this._stream.writable; + } + onInit() { + this._isShutdown = false; + this._stream = this._createWriteStream(); + } + send(objects, onSuccess, onError) { + /* istanbul ignore if */ + if (this._isShutdown) { + api_1.diag.debug("Shutdown already started. Cannot send objects"); + return; + } + const serviceRequest = this.convert(objects); + const promise = new Promise((resolve, reject) => { + this._stream.write(JSON.stringify(serviceRequest) + "\n", (err) => { + /* istanbul ignore if */ + if (err) { + reject(err); + } + else { + resolve(); + } + }); + }).then(onSuccess, onError); + this._sendingPromises.push(promise); + const popPromise = () => { + const index = this._sendingPromises.indexOf(promise); + this._sendingPromises.splice(index, 1); + }; + promise.then(popPromise, popPromise); + } + convert(spans) { + return (0, otlp_transformer_1.createExportTraceServiceRequest)(spans, true); + } +} +exports.FileTraceExporter = FileTraceExporter; + /***/ }), -/***/ 2341: +/***/ 9425: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { "use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; @@ -33181,23 +28342,29 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; Object.defineProperty(exports, "__esModule", ({ value: true })); -/* - * Copyright The OpenTelemetry Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -__exportStar(__nccwpck_require__(8942), exports); -//# sourceMappingURL=index.js.map +__exportStar(__nccwpck_require__(3125), exports); +__exportStar(__nccwpck_require__(6306), exports); + + +/***/ }), + +/***/ 6306: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + + +/***/ }), + +/***/ 2280: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); + /***/ }), @@ -37739,7 +32906,7 @@ function wrappy (fn, cb) { /***/ }), -/***/ 3754: +/***/ 2421: /***/ (function(module, __unused_webpack_exports, __nccwpck_require__) { // Generated by CoffeeScript 1.12.7 @@ -38016,7 +33183,7 @@ function wrappy (fn, cb) { XMLDTDEntity = __nccwpck_require__(53); - XMLDTDElement = __nccwpck_require__(3754); + XMLDTDElement = __nccwpck_require__(2421); XMLDTDNotation = __nccwpck_require__(2837); @@ -38473,7 +33640,7 @@ function wrappy (fn, cb) { XMLDTDEntity = __nccwpck_require__(53); - XMLDTDElement = __nccwpck_require__(3754); + XMLDTDElement = __nccwpck_require__(2421); XMLDTDNotation = __nccwpck_require__(2837); @@ -40887,7 +36054,7 @@ function wrappy (fn, cb) { XMLDTDAttList = __nccwpck_require__(1015); - XMLDTDElement = __nccwpck_require__(3754); + XMLDTDElement = __nccwpck_require__(2421); XMLDTDEntity = __nccwpck_require__(53); diff --git a/dist/index.js.map b/dist/index.js.map index 90555a6..64c7a7e 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../webpack://otel-upload-test-artifact-action/./lib/github.js","../webpack://otel-upload-test-artifact-action/./lib/index.js","../webpack://otel-upload-test-artifact-action/./lib/runner.js","../webpack://otel-upload-test-artifact-action/./lib/trace-junit.js","../webpack://otel-upload-test-artifact-action/./lib/trace-provider.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/artifact-client.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/artifact-client.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/config-variables.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/download-http-client.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/download-specification.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/http-manager.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/path-and-artifact-name-validation.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/requestUtils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/status-reporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/upload-gzip.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/upload-http-client.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/upload-specification.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/artifact/lib/internal/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/core/lib/command.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/core/lib/core.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/core/lib/file-command.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/core/lib/oidc-utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/core/lib/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/github/lib/context.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/github/lib/github.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/github/lib/internal/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/github/lib/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/glob.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-glob-options-helper.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-globber.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-hash-files.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-match-kind.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-path-helper.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-path.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-pattern-helper.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-pattern.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/glob/lib/internal-search-state.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/http-client/auth.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/http-client/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@actions/http-client/proxy.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/auth-token/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/core/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/endpoint/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/graphql/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/plugin-paginate-rest/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/request-error/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@octokit/request/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/api/context.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/api/diag.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/api/propagation.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/api/trace.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/baggage/context-helpers.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/baggage/internal/baggage-impl.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/baggage/internal/symbol.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/baggage/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/baggage/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/common/Attributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/common/Exception.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/common/Time.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/context/NoopContextManager.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/context/context.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/context/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/diag/ComponentLogger.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/diag/consoleLogger.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/diag/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/diag/internal/logLevelLogger.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/diag/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/internal/global-utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/internal/semver.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/platform/node/globalThis.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/propagation/NoopTextMapPropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/propagation/TextMapPropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/NonRecordingSpan.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/NoopTracerProvider.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/ProxyTracerProvider.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/Sampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/SamplingResult.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/SpanOptions.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/attributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/context-utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-impl.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/internal/tracestate-validators.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/internal/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/invalid-span-constants.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/link.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/span.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/span_context.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/span_kind.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/spancontext-utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/status.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/trace_flags.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/trace_state.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/tracer.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/tracer_options.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/trace/tracer_provider.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/api/build/src/version.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/ExportResult.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/baggage/constants.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/baggage/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/common/attributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/common/global-error-handler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/common/time.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/common/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/internal/validators.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/RandomIdGenerator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/environment.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/hex-to-base64.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/performance.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/propagation/composite.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/IdGenerator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/TraceState.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOffSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOnSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/sampler/ParentBasedSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/sampler/TraceIdRatioBasedSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/callback.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/environment.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/merge.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/promise.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/sampling.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/url.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/utils/wrap.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/core/build/src/version.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/OTLPExporterBase.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/browser/OTLPExporterBrowserBase.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/browser/OTLPTraceExporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/browser/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/browser/util.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPExporterNodeBase.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/OTLPTraceExporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/platform/node/util.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/transform.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/build/src/util.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/ExportResult.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/baggage/constants.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/baggage/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/common/attributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/common/time.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/common/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/internal/validators.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/RandomIdGenerator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/environment.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/hex-to-base64.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/performance.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/propagation/composite.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/IdGenerator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/TraceState.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOffSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOnSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/sampler/ParentBasedSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/sampler/TraceIdRatioBasedSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/utils/environment.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/utils/merge.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/utils/sampling.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/utils/url.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/utils/wrap.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/core/build/src/version.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/exporter-trace-otlp-http/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/Resource.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/config.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/detectors/BrowserDetector.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/detectors/EnvDetector.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/detectors/ProcessDetector.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/detectors/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/platform/node/HostDetector.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/platform/node/OSDetector.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/platform/node/default-service-name.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/platform/node/detect-resources.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/resources/build/src/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/BasicTracerProvider.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/MultiSpanProcessor.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/Span.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/SpanProcessor.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/TimedEvent.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/Tracer.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/config.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/enums.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/BatchSpanProcessorBase.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/ConsoleSpanExporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/InMemorySpanExporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/NoopSpanProcessor.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/ReadableSpan.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/SimpleSpanProcessor.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/export/SpanExporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/export/BatchSpanProcessor.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/sdk-trace-base/build/src/utility.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/semantic-conventions/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/balanced-match/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/before-after-hook/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/before-after-hook/lib/add.js","../webpack://otel-upload-test-artifact-action/./node_modules/before-after-hook/lib/register.js","../webpack://otel-upload-test-artifact-action/./node_modules/before-after-hook/lib/remove.js","../webpack://otel-upload-test-artifact-action/./node_modules/brace-expansion/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/concat-map/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/deprecation/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/fs.realpath/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/fs.realpath/old.js","../webpack://otel-upload-test-artifact-action/./node_modules/glob/common.js","../webpack://otel-upload-test-artifact-action/./node_modules/glob/glob.js","../webpack://otel-upload-test-artifact-action/./node_modules/glob/sync.js","../webpack://otel-upload-test-artifact-action/./node_modules/inflight/inflight.js","../webpack://otel-upload-test-artifact-action/./node_modules/inherits/inherits.js","../webpack://otel-upload-test-artifact-action/./node_modules/inherits/inherits_browser.js","../webpack://otel-upload-test-artifact-action/./node_modules/is-plain-object/dist/is-plain-object.js","../webpack://otel-upload-test-artifact-action/./node_modules/junit2json/dist/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/minimatch/minimatch.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/lib/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/tr46/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/webidl-conversions/lib/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/whatwg-url/lib/URL-impl.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/whatwg-url/lib/URL.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/whatwg-url/lib/public-api.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/whatwg-url/lib/url-state-machine.js","../webpack://otel-upload-test-artifact-action/./node_modules/node-fetch/node_modules/whatwg-url/lib/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/once/once.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/FileExporterBase.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/platform/node/FileTraceExporter.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/platform/node/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/transform.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/dist/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/ExportResult.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/baggage/constants.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/baggage/propagation/W3CBaggagePropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/baggage/utils.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/common/attributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/common/global-error-handler.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/common/logging-error-handler.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/common/time.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/common/types.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/internal/validators.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/RandomIdGenerator.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/environment.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/globalThis.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/hex-to-base64.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/performance.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/sdk-info.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/platform/node/timer-util.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/propagation/composite.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/IdGenerator.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/TraceState.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/W3CTraceContextPropagator.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/rpc-metadata.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOffSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/sampler/AlwaysOnSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/sampler/ParentBasedSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/sampler/TraceIdRatioBasedSampler.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/trace/suppress-tracing.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/utils/environment.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/utils/lodash.merge.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/utils/merge.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/utils/sampling.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/utils/url.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/utils/wrap.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/core/build/src/version.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/semantic-conventions/build/src/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/semantic-conventions/build/src/resource/SemanticResourceAttributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/semantic-conventions/build/src/resource/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/semantic-conventions/build/src/trace/SemanticAttributes.js","../webpack://otel-upload-test-artifact-action/./node_modules/opentelemetry-exporter-trace-otlp-file/node_modules/@opentelemetry/semantic-conventions/build/src/trace/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/path-is-absolute/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/rimraf/rimraf.js","../webpack://otel-upload-test-artifact-action/./node_modules/sax/lib/sax.js","../webpack://otel-upload-test-artifact-action/./node_modules/tmp-promise/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/tmp/lib/tmp.js","../webpack://otel-upload-test-artifact-action/./node_modules/tunnel/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/tunnel/lib/tunnel.js","../webpack://otel-upload-test-artifact-action/./node_modules/universal-user-agent/dist-node/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/wrappy/wrappy.js","../webpack://otel-upload-test-artifact-action/./node_modules/xml2js/lib/bom.js","../webpack://otel-upload-test-artifact-action/./node_modules/xml2js/lib/builder.js","../webpack://otel-upload-test-artifact-action/./node_modules/xml2js/lib/defaults.js","../webpack://otel-upload-test-artifact-action/./node_modules/xml2js/lib/parser.js","../webpack://otel-upload-test-artifact-action/./node_modules/xml2js/lib/processors.js","../webpack://otel-upload-test-artifact-action/./node_modules/xml2js/lib/xml2js.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/DocumentPosition.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/NodeType.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/Utility.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/WriterState.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLAttribute.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLCData.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLCharacterData.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLComment.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDOMConfiguration.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDOMErrorHandler.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDOMImplementation.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDOMStringList.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDTDAttList.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDTDElement.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDTDEntity.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDTDNotation.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDeclaration.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDocType.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDocument.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDocumentCB.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLDummy.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLElement.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLNamedNodeMap.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLNode.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLNodeList.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLProcessingInstruction.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLRaw.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLStreamWriter.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLStringWriter.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLStringifier.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLText.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/XMLWriterBase.js","../webpack://otel-upload-test-artifact-action/./node_modules/xmlbuilder/lib/index.js","../webpack://otel-upload-test-artifact-action/./node_modules/@vercel/ncc/dist/ncc/@@notfound.js","../webpack://otel-upload-test-artifact-action/external \"assert\"","../webpack://otel-upload-test-artifact-action/external \"crypto\"","../webpack://otel-upload-test-artifact-action/external \"events\"","../webpack://otel-upload-test-artifact-action/external \"fs\"","../webpack://otel-upload-test-artifact-action/external \"http\"","../webpack://otel-upload-test-artifact-action/external \"https\"","../webpack://otel-upload-test-artifact-action/external \"net\"","../webpack://otel-upload-test-artifact-action/external \"os\"","../webpack://otel-upload-test-artifact-action/external \"path\"","../webpack://otel-upload-test-artifact-action/external \"perf_hooks\"","../webpack://otel-upload-test-artifact-action/external \"punycode\"","../webpack://otel-upload-test-artifact-action/external \"stream\"","../webpack://otel-upload-test-artifact-action/external \"string_decoder\"","../webpack://otel-upload-test-artifact-action/external \"timers\"","../webpack://otel-upload-test-artifact-action/external \"tls\"","../webpack://otel-upload-test-artifact-action/external \"url\"","../webpack://otel-upload-test-artifact-action/external \"util\"","../webpack://otel-upload-test-artifact-action/external \"zlib\"","../webpack://otel-upload-test-artifact-action/webpack/bootstrap","../webpack://otel-upload-test-artifact-action/webpack/runtime/compat","../webpack://otel-upload-test-artifact-action/webpack/startup"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uploadTraceLogArtifact = exports.getWorkflowRunStep = void 0;\nasync function getWorkflowRunStep({ context, octokit, runId, jobName, stepName, }) {\n const jobs = [];\n const pageSize = 100;\n for (let page = 1, hasNext = true; hasNext; page++) {\n const listJobsForWorkflowRunResponse = await octokit.rest.actions.listJobsForWorkflowRun({\n ...context.repo,\n run_id: runId,\n filter: \"latest\",\n page,\n per_page: pageSize,\n });\n jobs.push(...listJobsForWorkflowRunResponse.data.jobs);\n hasNext = jobs.length < listJobsForWorkflowRunResponse.data.total_count;\n }\n const job = jobs.find(({ name }) => name === jobName);\n const step = job?.steps?.find(({ name }) => name === stepName);\n return step;\n}\nexports.getWorkflowRunStep = getWorkflowRunStep;\nasync function uploadTraceLogArtifact({ jobName, stepName, path, artifactClient, }) {\n const artifactKey = `{${jobName}}{${stepName}}`;\n const uploadResponse = await artifactClient.uploadArtifact(artifactKey, [path], \".\");\n if (uploadResponse.failedItems.length > 0) {\n throw new Error(`Failed to upload ${path} to Artifact<${artifactKey}>`);\n }\n}\nexports.uploadTraceLogArtifact = uploadTraceLogArtifact;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst runner_1 = require(\"./runner\");\nconst core = __importStar(require(\"@actions/core\"));\n(0, runner_1.run)().catch((error) => {\n core.setFailed(error.message);\n});\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.run = void 0;\nconst github = __importStar(require(\"@actions/github\"));\nconst artifact = __importStar(require(\"@actions/artifact\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst api_1 = require(\"@opentelemetry/api\");\nconst trace_provider_1 = require(\"./trace-provider\");\nconst trace_junit_1 = require(\"./trace-junit\");\nconst github_1 = require(\"./github\");\nasync function run() {\n const ghContext = github.context;\n const jobName = core.getInput(\"jobName\");\n const stepName = core.getInput(\"stepName\");\n const path = core.getInput(\"path\");\n const type = core.getInput(\"type\");\n const runId = ghContext.runId;\n const ghToken = core.getInput(\"githubToken\") || process.env.GITHUB_TOKEN;\n if (!ghToken) {\n core.setFailed(\"Missing GITHUB_TOKEN secret\");\n return;\n }\n if (![\"junit\"].includes(type)) {\n core.setFailed(`Test file Type<${type}> is not supported`);\n return;\n }\n const traceLogFilePath = \"trace.log\";\n const provider = (0, trace_provider_1.createTracerProvider)({\n traceLogFilePath,\n serviceName: ghContext.workflow,\n serviceNamespace: `${ghContext.repo.owner}/${ghContext.repo.repo}`,\n serviceInstanceId: ghContext.sha,\n serviceVersion: \"1.0.0\",\n });\n try {\n const tracer = provider.getTracer(\"Trace Test Artifact\");\n const octokit = github.getOctokit(ghToken);\n const artifactClient = artifact.create();\n core.info(`Verify Job<${jobName}> and Step<${stepName}>`);\n const step = await (0, github_1.getWorkflowRunStep)({\n context: ghContext,\n octokit,\n runId,\n jobName,\n stepName,\n });\n if (!step || !step.started_at) {\n core.setFailed(`Job<${jobName}> and Step<${stepName}> does not exist`);\n return;\n }\n const startTime = new Date(step.started_at);\n core.info(\"Trace Test file\");\n if (type === \"junit\") {\n await (0, trace_junit_1.traceJunitArtifact)({\n trace: api_1.trace,\n tracer,\n path,\n startTime,\n baseHtmlUrl: `${ghContext.serverUrl}/${ghContext.repo.owner}/${ghContext.repo.repo}`,\n });\n }\n core.info(\"Flush Otel Provider to WriteStream\");\n await provider.forceFlush();\n core.info(\"Upload OTLP Trace Log\");\n await (0, github_1.uploadTraceLogArtifact)({\n jobName,\n stepName,\n path: traceLogFilePath,\n artifactClient,\n });\n }\n catch (e) {\n if (e instanceof Error) {\n core.setFailed(e);\n }\n else {\n core.setFailed(JSON.stringify(e));\n }\n }\n finally {\n core.info(\"Shutdown Trace Provider\");\n setTimeout(() => {\n provider\n .shutdown()\n .then(() => {\n core.info(\"Provider shutdown\");\n })\n .catch((error) => {\n core.warning(error);\n });\n }, 2000);\n }\n}\nexports.run = run;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.traceTestCase = exports.traceTestSuite = exports.traceTestSuites = exports.traceJunitArtifact = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst junit2json_1 = require(\"junit2json\");\nconst fs = __importStar(require(\"fs\"));\nconst glob = __importStar(require(\"@actions/glob\"));\nconst core = __importStar(require(\"@actions/core\"));\nasync function traceJunitArtifact({ trace, tracer, path, startTime, baseHtmlUrl, }) {\n const globber = await glob.create(path, { matchDirectories: false });\n let endTimeSec = 0;\n let code = api_1.SpanStatusCode.OK;\n const ctx = api_1.ROOT_CONTEXT;\n const span = tracer.startSpan(\"Junit Test Runs\", {\n startTime,\n attributes: {\n \"test.source\": \"junit\",\n \"test.scope\": \"Run\",\n },\n root: true,\n }, ctx);\n let numFiles = 0;\n try {\n for await (const file of globber.globGenerator()) {\n core.debug(`Tracing file: ${file}`);\n numFiles++;\n const xmlString = fs.readFileSync(file, { encoding: \"utf-8\" });\n const document = await (0, junit2json_1.parse)(xmlString);\n if (\"testcase\" in document) {\n const testSuite = document;\n const testSuiteResponse = traceTestSuite({\n testSuite,\n parentContext: ctx,\n parentSpan: span,\n trace,\n tracer,\n baseHtmlUrl,\n startTime: new Date(testSuite.timestamp || startTime),\n });\n endTimeSec = Math.max(endTimeSec, testSuiteResponse.durationSec);\n code =\n testSuiteResponse.code === api_1.SpanStatusCode.ERROR\n ? testSuiteResponse.code\n : code;\n }\n else if (\"testsuite\" in document) {\n const testSuites = document;\n const testSuitesResponse = traceTestSuites({\n testSuites,\n parentContext: ctx,\n parentSpan: span,\n trace,\n tracer,\n baseHtmlUrl,\n startTime: new Date(startTime),\n });\n endTimeSec = Math.max(endTimeSec, testSuitesResponse.durationSec);\n code =\n testSuitesResponse.code === api_1.SpanStatusCode.ERROR\n ? testSuitesResponse.code\n : code;\n }\n }\n }\n finally {\n core.debug(`Traced ${numFiles} Files`);\n span.setStatus({ code });\n span.setAttribute(\"error\", code === api_1.SpanStatusCode.ERROR);\n const endTime = new Date(startTime);\n endTime.setMilliseconds(startTime.getMilliseconds() + endTimeSec * 1000);\n span.end(endTime);\n }\n}\nexports.traceJunitArtifact = traceJunitArtifact;\nfunction traceTestSuites({ trace, tracer, parentContext, parentSpan, testSuites, startTime, baseHtmlUrl, }) {\n /* istanbul ignore next */\n core.debug(`Tracing TestSuites<${testSuites.name || \"Undefined\"}>`);\n const ctx = trace.setSpan(parentContext, parentSpan);\n const span = tracer.startSpan(\n /* istanbul ignore next */\n testSuites.name || \"Junit Test Suites\", {\n startTime,\n attributes: {\n \"test.tests\": testSuites.tests,\n \"test.failures\": testSuites.failures,\n \"test.errors\": testSuites.errors,\n \"test.disabled\": testSuites.disabled,\n \"tests.time\": testSuites.time,\n },\n }, ctx);\n let code = api_1.SpanStatusCode.OK;\n /* istanbul ignore next */\n if ((testSuites.errors && testSuites.errors > 0) ||\n (testSuites.failures && testSuites.failures > 0)) {\n code = api_1.SpanStatusCode.ERROR;\n }\n span.setStatus({ code });\n span.setAttribute(\"error\", code === api_1.SpanStatusCode.ERROR);\n let endTimeSec = 0;\n try {\n const testSuiteTimes = testSuites.testsuite.map((testSuite) => traceTestSuite({\n testSuite,\n parentContext: ctx,\n parentSpan: span,\n startTime: new Date(testSuite.timestamp || startTime),\n tracer,\n trace,\n baseHtmlUrl,\n }).durationSec);\n endTimeSec = testSuiteTimes.reduce((r, i) => r + i, 0);\n return { durationSec: endTimeSec, code };\n }\n finally {\n const endTime = new Date(startTime);\n endTime.setMilliseconds(startTime.getMilliseconds() + endTimeSec * 1000);\n span.end(endTime);\n }\n}\nexports.traceTestSuites = traceTestSuites;\nfunction traceTestSuite({ testSuite, trace, tracer, startTime, parentSpan, parentContext, baseHtmlUrl, }) {\n core.debug(`Tracing TestSuite<${testSuite.name}>`);\n const ctx = trace.setSpan(parentContext, parentSpan);\n const span = tracer.startSpan(testSuite.name, {\n startTime,\n attributes: {\n \"test.name\": testSuite.name,\n \"test.scope\": \"Suite\",\n \"test.tests\": testSuite.tests,\n \"test.failures\": testSuite.failures,\n \"test.errors\": testSuite.errors,\n \"test.time\": testSuite.time,\n \"test.disables\": testSuite.disabled,\n \"test.skips\": testSuite.skipped,\n \"test.timestamp\": testSuite.timestamp,\n \"test.hostname\": testSuite.hostname,\n \"test.id\": testSuite.id,\n \"test.package\": testSuite.package,\n \"test.system.out\": testSuite[\"system-out\"],\n \"test.system.err\": testSuite[\"system-err\"],\n \"test.html_url\": `${baseHtmlUrl}/${testSuite.name}`,\n },\n }, ctx);\n let code = api_1.SpanStatusCode.OK;\n /* istanbul ignore next */\n if ((testSuite.errors && testSuite.errors > 0) ||\n (testSuite.failures && testSuite.failures > 0)) {\n code = api_1.SpanStatusCode.ERROR;\n }\n span.setStatus({ code });\n span.setAttribute(\"error\", code === api_1.SpanStatusCode.ERROR);\n let testCaseTime = new Date(startTime);\n let testCasesTimeSec = testSuite.time || 0;\n try {\n // there are cases when a testSuite exists without any testCases\n // see https://github.com/windyroad/JUnit-Schema/blob/cfa434d4b8e102a8f55b8727b552a0063ee9044e/JUnit.xsd#L18-L24\n const testCasesTimes = testSuite.testcase?.map((testCase) => {\n const testCaseTimeSec = traceTestCase({\n testCase,\n tracer,\n trace,\n parentSpan: span,\n parentContext: ctx,\n startTime: testCaseTime,\n });\n testCaseTime = new Date(testCaseTime);\n testCaseTime.setMilliseconds(testCaseTime.getMilliseconds() + (testCase.time || testCaseTimeSec));\n return testCaseTimeSec;\n });\n // If testSuite exists with testCases\n if (testCasesTimes) {\n testCasesTimeSec =\n testCasesTimeSec || testCasesTimes.reduce((r, i) => r + i, 0);\n }\n return { durationSec: testCasesTimeSec, code };\n }\n finally {\n const endTime = new Date(startTime);\n endTime.setMilliseconds(startTime.getMilliseconds() + testCasesTimeSec * 1000);\n span.end(endTime);\n }\n}\nexports.traceTestSuite = traceTestSuite;\nfunction traceTestCase({ testCase, parentContext, parentSpan, startTime, tracer, trace, }) {\n core.debug(`Tracing TestCase<${testCase.name}>`);\n const ctx = trace.setSpan(parentContext, parentSpan);\n const span = tracer.startSpan(testCase.name, {\n startTime,\n attributes: {\n \"test.name\": testCase.name,\n \"test.scope\": \"Case\",\n \"test.classname\": testCase.classname,\n \"test.time\": testCase.time,\n \"test.status\": testCase.status,\n \"test.assertions\": testCase.assertions,\n \"test.system.out\": testCase[\"system-out\"],\n \"test.system.err\": testCase[\"system-err\"],\n },\n }, ctx);\n try {\n let code = api_1.SpanStatusCode.OK;\n if (\n /* istanbul ignore next */ (testCase.status &&\n testCase.status !== \"PASS\") ||\n (testCase.error && testCase.error.length > 0) ||\n (testCase.failure && testCase.failure.length > 0)) {\n code = api_1.SpanStatusCode.ERROR;\n }\n span.setStatus({ code });\n span.setAttribute(\"error\", code === api_1.SpanStatusCode.ERROR);\n /* istanbul ignore next */\n testCase.skipped?.forEach(({ message }, index) => {\n if (message) {\n span.setAttribute(`test.skipped.${index}.message`, message);\n }\n });\n /* istanbul ignore next */\n testCase.error?.forEach(({ message, type, inner }, index) => {\n if (message) {\n span.setAttribute(`test.error.${index}.message`, message);\n }\n if (type) {\n span.setAttribute(`test.error.${index}.type`, type);\n }\n if (inner) {\n span.setAttribute(`test.error.${index}.inner`, inner);\n }\n });\n /* istanbul ignore next */\n testCase.failure?.forEach(({ message, type, inner }, index) => {\n if (message) {\n span.setAttribute(`test.failure.${index}.message`, message);\n }\n if (type) {\n span.setAttribute(`test.failure.${index}.type`, type);\n }\n if (inner) {\n span.setAttribute(`test.failure.${index}.inner`, inner);\n }\n });\n }\n finally {\n const endTime = new Date(startTime);\n endTime.setMilliseconds(startTime.getMilliseconds() + (testCase.time || 0) * 1000);\n span.end(endTime);\n }\n return testCase.time || 0;\n}\nexports.traceTestCase = traceTestCase;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTracerProvider = void 0;\nconst sdk_trace_base_1 = require(\"@opentelemetry/sdk-trace-base\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst opentelemetry_exporter_trace_otlp_file_1 = require(\"opentelemetry-exporter-trace-otlp-file\");\nconst resources_1 = require(\"@opentelemetry/resources\");\nfunction createTracerProvider({ traceLogFilePath, serviceName, serviceInstanceId, serviceNamespace, serviceVersion, }) {\n const exporter = new opentelemetry_exporter_trace_otlp_file_1.FileTraceExporter({ filePath: traceLogFilePath });\n const tracerProvider = new sdk_trace_base_1.BasicTracerProvider({\n resource: new resources_1.Resource({\n [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: serviceName,\n [semantic_conventions_1.SemanticResourceAttributes.SERVICE_INSTANCE_ID]: serviceInstanceId,\n [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAMESPACE]: serviceNamespace,\n [semantic_conventions_1.SemanticResourceAttributes.SERVICE_VERSION]: serviceVersion,\n }),\n });\n tracerProvider.addSpanProcessor(new sdk_trace_base_1.SimpleSpanProcessor(exporter));\n tracerProvider.register();\n return tracerProvider;\n}\nexports.createTracerProvider = createTracerProvider;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst artifact_client_1 = require(\"./internal/artifact-client\");\n/**\n * Constructs an ArtifactClient\n */\nfunction create() {\n return artifact_client_1.DefaultArtifactClient.create();\n}\nexports.create = create;\n//# sourceMappingURL=artifact-client.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst upload_specification_1 = require(\"./upload-specification\");\nconst upload_http_client_1 = require(\"./upload-http-client\");\nconst utils_1 = require(\"./utils\");\nconst path_and_artifact_name_validation_1 = require(\"./path-and-artifact-name-validation\");\nconst download_http_client_1 = require(\"./download-http-client\");\nconst download_specification_1 = require(\"./download-specification\");\nconst config_variables_1 = require(\"./config-variables\");\nconst path_1 = require(\"path\");\nclass DefaultArtifactClient {\n /**\n * Constructs a DefaultArtifactClient\n */\n static create() {\n return new DefaultArtifactClient();\n }\n /**\n * Uploads an artifact\n */\n uploadArtifact(name, files, rootDirectory, options) {\n return __awaiter(this, void 0, void 0, function* () {\n core.info(`Starting artifact upload\nFor more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging`);\n path_and_artifact_name_validation_1.checkArtifactName(name);\n // Get specification for the files being uploaded\n const uploadSpecification = upload_specification_1.getUploadSpecification(name, rootDirectory, files);\n const uploadResponse = {\n artifactName: name,\n artifactItems: [],\n size: 0,\n failedItems: []\n };\n const uploadHttpClient = new upload_http_client_1.UploadHttpClient();\n if (uploadSpecification.length === 0) {\n core.warning(`No files found that can be uploaded`);\n }\n else {\n // Create an entry for the artifact in the file container\n const response = yield uploadHttpClient.createArtifactInFileContainer(name, options);\n if (!response.fileContainerResourceUrl) {\n core.debug(response.toString());\n throw new Error('No URL provided by the Artifact Service to upload an artifact to');\n }\n core.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`);\n core.info(`Container for artifact \"${name}\" successfully created. Starting upload of file(s)`);\n // Upload each of the files that were found concurrently\n const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options);\n // Update the size of the artifact to indicate we are done uploading\n // The uncompressed size is used for display when downloading a zip of the artifact from the UI\n core.info(`File upload process has finished. Finalizing the artifact upload`);\n yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name);\n if (uploadResult.failedItems.length > 0) {\n core.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`);\n }\n else {\n core.info(`Artifact has been finalized. All files have been successfully uploaded!`);\n }\n core.info(`\nThe raw size of all the files that were specified for upload is ${uploadResult.totalSize} bytes\nThe size of all the files that were uploaded is ${uploadResult.uploadSize} bytes. This takes into account any gzip compression used to reduce the upload size, time and storage\n\nNote: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads \\r\\n`);\n uploadResponse.artifactItems = uploadSpecification.map(item => item.absoluteFilePath);\n uploadResponse.size = uploadResult.uploadSize;\n uploadResponse.failedItems = uploadResult.failedItems;\n }\n return uploadResponse;\n });\n }\n downloadArtifact(name, path, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const downloadHttpClient = new download_http_client_1.DownloadHttpClient();\n const artifacts = yield downloadHttpClient.listArtifacts();\n if (artifacts.count === 0) {\n throw new Error(`Unable to find any artifacts for the associated workflow`);\n }\n const artifactToDownload = artifacts.value.find(artifact => {\n return artifact.name === name;\n });\n if (!artifactToDownload) {\n throw new Error(`Unable to find an artifact with the name: ${name}`);\n }\n const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl);\n if (!path) {\n path = config_variables_1.getWorkSpaceDirectory();\n }\n path = path_1.normalize(path);\n path = path_1.resolve(path);\n // During upload, empty directories are rejected by the remote server so there should be no artifacts that consist of only empty directories\n const downloadSpecification = download_specification_1.getDownloadSpecification(name, items.value, path, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false);\n if (downloadSpecification.filesToDownload.length === 0) {\n core.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`);\n }\n else {\n // Create all necessary directories recursively before starting any download\n yield utils_1.createDirectoriesForArtifact(downloadSpecification.directoryStructure);\n core.info('Directory structure has been setup for the artifact');\n yield utils_1.createEmptyFilesForArtifact(downloadSpecification.emptyFilesToCreate);\n yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload);\n }\n return {\n artifactName: name,\n downloadPath: downloadSpecification.rootDownloadLocation\n };\n });\n }\n downloadAllArtifacts(path) {\n return __awaiter(this, void 0, void 0, function* () {\n const downloadHttpClient = new download_http_client_1.DownloadHttpClient();\n const response = [];\n const artifacts = yield downloadHttpClient.listArtifacts();\n if (artifacts.count === 0) {\n core.info('Unable to find any artifacts for the associated workflow');\n return response;\n }\n if (!path) {\n path = config_variables_1.getWorkSpaceDirectory();\n }\n path = path_1.normalize(path);\n path = path_1.resolve(path);\n let downloadedArtifacts = 0;\n while (downloadedArtifacts < artifacts.count) {\n const currentArtifactToDownload = artifacts.value[downloadedArtifacts];\n downloadedArtifacts += 1;\n core.info(`starting download of artifact ${currentArtifactToDownload.name} : ${downloadedArtifacts}/${artifacts.count}`);\n // Get container entries for the specific artifact\n const items = yield downloadHttpClient.getContainerItems(currentArtifactToDownload.name, currentArtifactToDownload.fileContainerResourceUrl);\n const downloadSpecification = download_specification_1.getDownloadSpecification(currentArtifactToDownload.name, items.value, path, true);\n if (downloadSpecification.filesToDownload.length === 0) {\n core.info(`No downloadable files were found for any artifact ${currentArtifactToDownload.name}`);\n }\n else {\n yield utils_1.createDirectoriesForArtifact(downloadSpecification.directoryStructure);\n yield utils_1.createEmptyFilesForArtifact(downloadSpecification.emptyFilesToCreate);\n yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload);\n }\n response.push({\n artifactName: currentArtifactToDownload.name,\n downloadPath: downloadSpecification.rootDownloadLocation\n });\n }\n return response;\n });\n }\n}\nexports.DefaultArtifactClient = DefaultArtifactClient;\n//# sourceMappingURL=artifact-client.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// The number of concurrent uploads that happens at the same time\nfunction getUploadFileConcurrency() {\n return 2;\n}\nexports.getUploadFileConcurrency = getUploadFileConcurrency;\n// When uploading large files that can't be uploaded with a single http call, this controls\n// the chunk size that is used during upload\nfunction getUploadChunkSize() {\n return 8 * 1024 * 1024; // 8 MB Chunks\n}\nexports.getUploadChunkSize = getUploadChunkSize;\n// The maximum number of retries that can be attempted before an upload or download fails\nfunction getRetryLimit() {\n return 5;\n}\nexports.getRetryLimit = getRetryLimit;\n// With exponential backoff, the larger the retry count, the larger the wait time before another attempt\n// The retry multiplier controls by how much the backOff time increases depending on the number of retries\nfunction getRetryMultiplier() {\n return 1.5;\n}\nexports.getRetryMultiplier = getRetryMultiplier;\n// The initial wait time if an upload or download fails and a retry is being attempted for the first time\nfunction getInitialRetryIntervalInMilliseconds() {\n return 3000;\n}\nexports.getInitialRetryIntervalInMilliseconds = getInitialRetryIntervalInMilliseconds;\n// The number of concurrent downloads that happens at the same time\nfunction getDownloadFileConcurrency() {\n return 2;\n}\nexports.getDownloadFileConcurrency = getDownloadFileConcurrency;\nfunction getRuntimeToken() {\n const token = process.env['ACTIONS_RUNTIME_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_RUNTIME_TOKEN env variable');\n }\n return token;\n}\nexports.getRuntimeToken = getRuntimeToken;\nfunction getRuntimeUrl() {\n const runtimeUrl = process.env['ACTIONS_RUNTIME_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_RUNTIME_URL env variable');\n }\n return runtimeUrl;\n}\nexports.getRuntimeUrl = getRuntimeUrl;\nfunction getWorkFlowRunId() {\n const workFlowRunId = process.env['GITHUB_RUN_ID'];\n if (!workFlowRunId) {\n throw new Error('Unable to get GITHUB_RUN_ID env variable');\n }\n return workFlowRunId;\n}\nexports.getWorkFlowRunId = getWorkFlowRunId;\nfunction getWorkSpaceDirectory() {\n const workspaceDirectory = process.env['GITHUB_WORKSPACE'];\n if (!workspaceDirectory) {\n throw new Error('Unable to get GITHUB_WORKSPACE env variable');\n }\n return workspaceDirectory;\n}\nexports.getWorkSpaceDirectory = getWorkSpaceDirectory;\nfunction getRetentionDays() {\n return process.env['GITHUB_RETENTION_DAYS'];\n}\nexports.getRetentionDays = getRetentionDays;\n//# sourceMappingURL=config-variables.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs = __importStar(require(\"fs\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst zlib = __importStar(require(\"zlib\"));\nconst utils_1 = require(\"./utils\");\nconst url_1 = require(\"url\");\nconst status_reporter_1 = require(\"./status-reporter\");\nconst perf_hooks_1 = require(\"perf_hooks\");\nconst http_manager_1 = require(\"./http-manager\");\nconst config_variables_1 = require(\"./config-variables\");\nconst requestUtils_1 = require(\"./requestUtils\");\nclass DownloadHttpClient {\n constructor() {\n this.downloadHttpManager = new http_manager_1.HttpManager(config_variables_1.getDownloadFileConcurrency(), '@actions/artifact-download');\n // downloads are usually significantly faster than uploads so display status information every second\n this.statusReporter = new status_reporter_1.StatusReporter(1000);\n }\n /**\n * Gets a list of all artifacts that are in a specific container\n */\n listArtifacts() {\n return __awaiter(this, void 0, void 0, function* () {\n const artifactUrl = utils_1.getArtifactUrl();\n // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately\n const client = this.downloadHttpManager.getClient(0);\n const headers = utils_1.getDownloadHeaders('application/json');\n const response = yield requestUtils_1.retryHttpClientRequest('List Artifacts', () => __awaiter(this, void 0, void 0, function* () { return client.get(artifactUrl, headers); }));\n const body = yield response.readBody();\n return JSON.parse(body);\n });\n }\n /**\n * Fetches a set of container items that describe the contents of an artifact\n * @param artifactName the name of the artifact\n * @param containerUrl the artifact container URL for the run\n */\n getContainerItems(artifactName, containerUrl) {\n return __awaiter(this, void 0, void 0, function* () {\n // the itemPath search parameter controls which containers will be returned\n const resourceUrl = new url_1.URL(containerUrl);\n resourceUrl.searchParams.append('itemPath', artifactName);\n // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately\n const client = this.downloadHttpManager.getClient(0);\n const headers = utils_1.getDownloadHeaders('application/json');\n const response = yield requestUtils_1.retryHttpClientRequest('Get Container Items', () => __awaiter(this, void 0, void 0, function* () { return client.get(resourceUrl.toString(), headers); }));\n const body = yield response.readBody();\n return JSON.parse(body);\n });\n }\n /**\n * Concurrently downloads all the files that are part of an artifact\n * @param downloadItems information about what items to download and where to save them\n */\n downloadSingleArtifact(downloadItems) {\n return __awaiter(this, void 0, void 0, function* () {\n const DOWNLOAD_CONCURRENCY = config_variables_1.getDownloadFileConcurrency();\n // limit the number of files downloaded at a single time\n core.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`);\n const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()];\n let currentFile = 0;\n let downloadedFiles = 0;\n core.info(`Total number of files that will be downloaded: ${downloadItems.length}`);\n this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length);\n this.statusReporter.start();\n yield Promise.all(parallelDownloads.map((index) => __awaiter(this, void 0, void 0, function* () {\n while (currentFile < downloadItems.length) {\n const currentFileToDownload = downloadItems[currentFile];\n currentFile += 1;\n const startTime = perf_hooks_1.performance.now();\n yield this.downloadIndividualFile(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath);\n if (core.isDebug()) {\n core.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`);\n }\n this.statusReporter.incrementProcessedCount();\n }\n })))\n .catch(error => {\n throw new Error(`Unable to download the artifact: ${error}`);\n })\n .finally(() => {\n this.statusReporter.stop();\n // safety dispose all connections\n this.downloadHttpManager.disposeAndReplaceAllClients();\n });\n });\n }\n /**\n * Downloads an individual file\n * @param httpClientIndex the index of the http client that is used to make all of the calls\n * @param artifactLocation origin location where a file will be downloaded from\n * @param downloadPath destination location for the file being downloaded\n */\n downloadIndividualFile(httpClientIndex, artifactLocation, downloadPath) {\n return __awaiter(this, void 0, void 0, function* () {\n let retryCount = 0;\n const retryLimit = config_variables_1.getRetryLimit();\n let destinationStream = fs.createWriteStream(downloadPath);\n const headers = utils_1.getDownloadHeaders('application/json', true, true);\n // a single GET request is used to download a file\n const makeDownloadRequest = () => __awaiter(this, void 0, void 0, function* () {\n const client = this.downloadHttpManager.getClient(httpClientIndex);\n return yield client.get(artifactLocation, headers);\n });\n // check the response headers to determine if the file was compressed using gzip\n const isGzip = (incomingHeaders) => {\n return ('content-encoding' in incomingHeaders &&\n incomingHeaders['content-encoding'] === 'gzip');\n };\n // Increments the current retry count and then checks if the retry limit has been reached\n // If there have been too many retries, fail so the download stops. If there is a retryAfterValue value provided,\n // it will be used\n const backOff = (retryAfterValue) => __awaiter(this, void 0, void 0, function* () {\n retryCount++;\n if (retryCount > retryLimit) {\n return Promise.reject(new Error(`Retry limit has been reached. Unable to download ${artifactLocation}`));\n }\n else {\n this.downloadHttpManager.disposeAndReplaceClient(httpClientIndex);\n if (retryAfterValue) {\n // Back off by waiting the specified time denoted by the retry-after header\n core.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the download`);\n yield utils_1.sleep(retryAfterValue);\n }\n else {\n // Back off using an exponential value that depends on the retry count\n const backoffTime = utils_1.getExponentialRetryTimeInMilliseconds(retryCount);\n core.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`);\n yield utils_1.sleep(backoffTime);\n }\n core.info(`Finished backoff for retry #${retryCount}, continuing with download`);\n }\n });\n const isAllBytesReceived = (expected, received) => {\n // be lenient, if any input is missing, assume success, i.e. not truncated\n if (!expected ||\n !received ||\n process.env['ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION']) {\n core.info('Skipping download validation.');\n return true;\n }\n return parseInt(expected) === received;\n };\n const resetDestinationStream = (fileDownloadPath) => __awaiter(this, void 0, void 0, function* () {\n destinationStream.close();\n yield utils_1.rmFile(fileDownloadPath);\n destinationStream = fs.createWriteStream(fileDownloadPath);\n });\n // keep trying to download a file until a retry limit has been reached\n while (retryCount <= retryLimit) {\n let response;\n try {\n response = yield makeDownloadRequest();\n }\n catch (error) {\n // if an error is caught, it is usually indicative of a timeout so retry the download\n core.info('An error occurred while attempting to download a file');\n // eslint-disable-next-line no-console\n console.log(error);\n // increment the retryCount and use exponential backoff to wait before making the next request\n yield backOff();\n continue;\n }\n let forceRetry = false;\n if (utils_1.isSuccessStatusCode(response.message.statusCode)) {\n // The body contains the contents of the file however calling response.readBody() causes all the content to be converted to a string\n // which can cause some gzip encoded data to be lost\n // Instead of using response.readBody(), response.message is a readableStream that can be directly used to get the raw body contents\n try {\n const isGzipped = isGzip(response.message.headers);\n yield this.pipeResponseToFile(response, destinationStream, isGzipped);\n if (isGzipped ||\n isAllBytesReceived(response.message.headers['content-length'], yield utils_1.getFileSize(downloadPath))) {\n return;\n }\n else {\n forceRetry = true;\n }\n }\n catch (error) {\n // retry on error, most likely streams were corrupted\n forceRetry = true;\n }\n }\n if (forceRetry || utils_1.isRetryableStatusCode(response.message.statusCode)) {\n core.info(`A ${response.message.statusCode} response code has been received while attempting to download an artifact`);\n resetDestinationStream(downloadPath);\n // if a throttled status code is received, try to get the retryAfter header value, else differ to standard exponential backoff\n utils_1.isThrottledStatusCode(response.message.statusCode)\n ? yield backOff(utils_1.tryGetRetryAfterValueTimeInMilliseconds(response.message.headers))\n : yield backOff();\n }\n else {\n // Some unexpected response code, fail immediately and stop the download\n utils_1.displayHttpDiagnostics(response);\n return Promise.reject(new Error(`Unexpected http ${response.message.statusCode} during download for ${artifactLocation}`));\n }\n }\n });\n }\n /**\n * Pipes the response from downloading an individual file to the appropriate destination stream while decoding gzip content if necessary\n * @param response the http response received when downloading a file\n * @param destinationStream the stream where the file should be written to\n * @param isGzip a boolean denoting if the content is compressed using gzip and if we need to decode it\n */\n pipeResponseToFile(response, destinationStream, isGzip) {\n return __awaiter(this, void 0, void 0, function* () {\n yield new Promise((resolve, reject) => {\n if (isGzip) {\n const gunzip = zlib.createGunzip();\n response.message\n .on('error', error => {\n core.error(`An error occurred while attempting to read the response stream`);\n gunzip.close();\n destinationStream.close();\n reject(error);\n })\n .pipe(gunzip)\n .on('error', error => {\n core.error(`An error occurred while attempting to decompress the response stream`);\n destinationStream.close();\n reject(error);\n })\n .pipe(destinationStream)\n .on('close', () => {\n resolve();\n })\n .on('error', error => {\n core.error(`An error occurred while writing a downloaded file to ${destinationStream.path}`);\n reject(error);\n });\n }\n else {\n response.message\n .on('error', error => {\n core.error(`An error occurred while attempting to read the response stream`);\n destinationStream.close();\n reject(error);\n })\n .pipe(destinationStream)\n .on('close', () => {\n resolve();\n })\n .on('error', error => {\n core.error(`An error occurred while writing a downloaded file to ${destinationStream.path}`);\n reject(error);\n });\n }\n });\n return;\n });\n }\n}\nexports.DownloadHttpClient = DownloadHttpClient;\n//# sourceMappingURL=download-http-client.js.map","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst path = __importStar(require(\"path\"));\n/**\n * Creates a specification for a set of files that will be downloaded\n * @param artifactName the name of the artifact\n * @param artifactEntries a set of container entries that describe that files that make up an artifact\n * @param downloadPath the path where the artifact will be downloaded to\n * @param includeRootDirectory specifies if there should be an extra directory (denoted by the artifact name) where the artifact files should be downloaded to\n */\nfunction getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) {\n // use a set for the directory paths so that there are no duplicates\n const directories = new Set();\n const specifications = {\n rootDownloadLocation: includeRootDirectory\n ? path.join(downloadPath, artifactName)\n : downloadPath,\n directoryStructure: [],\n emptyFilesToCreate: [],\n filesToDownload: []\n };\n for (const entry of artifactEntries) {\n // Ignore artifacts in the container that don't begin with the same name\n if (entry.path.startsWith(`${artifactName}/`) ||\n entry.path.startsWith(`${artifactName}\\\\`)) {\n // normalize all separators to the local OS\n const normalizedPathEntry = path.normalize(entry.path);\n // entry.path always starts with the artifact name, if includeRootDirectory is false, remove the name from the beginning of the path\n const filePath = path.join(downloadPath, includeRootDirectory\n ? normalizedPathEntry\n : normalizedPathEntry.replace(artifactName, ''));\n // Case insensitive folder structure maintained in the backend, not every folder is created so the 'folder'\n // itemType cannot be relied upon. The file must be used to determine the directory structure\n if (entry.itemType === 'file') {\n // Get the directories that we need to create from the filePath for each individual file\n directories.add(path.dirname(filePath));\n if (entry.fileLength === 0) {\n // An empty file was uploaded, create the empty files locally so that no extra http calls are made\n specifications.emptyFilesToCreate.push(filePath);\n }\n else {\n specifications.filesToDownload.push({\n sourceLocation: entry.contentLocation,\n targetPath: filePath\n });\n }\n }\n }\n }\n specifications.directoryStructure = Array.from(directories);\n return specifications;\n}\nexports.getDownloadSpecification = getDownloadSpecification;\n//# sourceMappingURL=download-specification.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"./utils\");\n/**\n * Used for managing http clients during either upload or download\n */\nclass HttpManager {\n constructor(clientCount, userAgent) {\n if (clientCount < 1) {\n throw new Error('There must be at least one client');\n }\n this.userAgent = userAgent;\n this.clients = new Array(clientCount).fill(utils_1.createHttpClient(userAgent));\n }\n getClient(index) {\n return this.clients[index];\n }\n // client disposal is necessary if a keep-alive connection is used to properly close the connection\n // for more information see: https://github.com/actions/http-client/blob/04e5ad73cd3fd1f5610a32116b0759eddf6570d2/index.ts#L292\n disposeAndReplaceClient(index) {\n this.clients[index].dispose();\n this.clients[index] = utils_1.createHttpClient(this.userAgent);\n }\n disposeAndReplaceAllClients() {\n for (const [index] of this.clients.entries()) {\n this.disposeAndReplaceClient(index);\n }\n }\n}\nexports.HttpManager = HttpManager;\n//# sourceMappingURL=http-manager.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"@actions/core\");\n/**\n * Invalid characters that cannot be in the artifact name or an uploaded file. Will be rejected\n * from the server if attempted to be sent over. These characters are not allowed due to limitations with certain\n * file systems such as NTFS. To maintain platform-agnostic behavior, all characters that are not supported by an\n * individual filesystem/platform will not be supported on all fileSystems/platforms\n *\n * FilePaths can include characters such as \\ and / which are not permitted in the artifact name alone\n */\nconst invalidArtifactFilePathCharacters = new Map([\n ['\"', ' Double quote \"'],\n [':', ' Colon :'],\n ['<', ' Less than <'],\n ['>', ' Greater than >'],\n ['|', ' Vertical bar |'],\n ['*', ' Asterisk *'],\n ['?', ' Question mark ?'],\n ['\\r', ' Carriage return \\\\r'],\n ['\\n', ' Line feed \\\\n']\n]);\nconst invalidArtifactNameCharacters = new Map([\n ...invalidArtifactFilePathCharacters,\n ['\\\\', ' Backslash \\\\'],\n ['/', ' Forward slash /']\n]);\n/**\n * Scans the name of the artifact to make sure there are no illegal characters\n */\nfunction checkArtifactName(name) {\n if (!name) {\n throw new Error(`Artifact name: ${name}, is incorrectly provided`);\n }\n for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactNameCharacters) {\n if (name.includes(invalidCharacterKey)) {\n throw new Error(`Artifact name is not valid: ${name}. Contains the following character: ${errorMessageForCharacter}\n \nInvalid characters include: ${Array.from(invalidArtifactNameCharacters.values()).toString()}\n \nThese characters are not allowed in the artifact name due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.`);\n }\n }\n core_1.info(`Artifact name is valid!`);\n}\nexports.checkArtifactName = checkArtifactName;\n/**\n * Scans the name of the filePath used to make sure there are no illegal characters\n */\nfunction checkArtifactFilePath(path) {\n if (!path) {\n throw new Error(`Artifact path: ${path}, is incorrectly provided`);\n }\n for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) {\n if (path.includes(invalidCharacterKey)) {\n throw new Error(`Artifact path is not valid: ${path}. Contains the following character: ${errorMessageForCharacter}\n \nInvalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()}\n \nThe following characters are not allowed in files that are uploaded due to limitations with certain file systems such as NTFS. To maintain file system agnostic behavior, these characters are intentionally not allowed to prevent potential problems with downloads on different file systems.\n `);\n }\n }\n}\nexports.checkArtifactFilePath = checkArtifactFilePath;\n//# sourceMappingURL=path-and-artifact-name-validation.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"./utils\");\nconst core = __importStar(require(\"@actions/core\"));\nconst config_variables_1 = require(\"./config-variables\");\nfunction retry(name, operation, customErrorMessages, maxAttempts) {\n return __awaiter(this, void 0, void 0, function* () {\n let response = undefined;\n let statusCode = undefined;\n let isRetryable = false;\n let errorMessage = '';\n let customErrorInformation = undefined;\n let attempt = 1;\n while (attempt <= maxAttempts) {\n try {\n response = yield operation();\n statusCode = response.message.statusCode;\n if (utils_1.isSuccessStatusCode(statusCode)) {\n return response;\n }\n // Extra error information that we want to display if a particular response code is hit\n if (statusCode) {\n customErrorInformation = customErrorMessages.get(statusCode);\n }\n isRetryable = utils_1.isRetryableStatusCode(statusCode);\n errorMessage = `Artifact service responded with ${statusCode}`;\n }\n catch (error) {\n isRetryable = true;\n errorMessage = error.message;\n }\n if (!isRetryable) {\n core.info(`${name} - Error is not retryable`);\n if (response) {\n utils_1.displayHttpDiagnostics(response);\n }\n break;\n }\n core.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`);\n yield utils_1.sleep(utils_1.getExponentialRetryTimeInMilliseconds(attempt));\n attempt++;\n }\n if (response) {\n utils_1.displayHttpDiagnostics(response);\n }\n if (customErrorInformation) {\n throw Error(`${name} failed: ${customErrorInformation}`);\n }\n throw Error(`${name} failed: ${errorMessage}`);\n });\n}\nexports.retry = retry;\nfunction retryHttpClientRequest(name, method, customErrorMessages = new Map(), maxAttempts = config_variables_1.getRetryLimit()) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield retry(name, method, customErrorMessages, maxAttempts);\n });\n}\nexports.retryHttpClientRequest = retryHttpClientRequest;\n//# sourceMappingURL=requestUtils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"@actions/core\");\n/**\n * Status Reporter that displays information about the progress/status of an artifact that is being uploaded or downloaded\n *\n * Variable display time that can be adjusted using the displayFrequencyInMilliseconds variable\n * The total status of the upload/download gets displayed according to this value\n * If there is a large file that is being uploaded, extra information about the individual status can also be displayed using the updateLargeFileStatus function\n */\nclass StatusReporter {\n constructor(displayFrequencyInMilliseconds) {\n this.totalNumberOfFilesToProcess = 0;\n this.processedCount = 0;\n this.largeFiles = new Map();\n this.totalFileStatus = undefined;\n this.displayFrequencyInMilliseconds = displayFrequencyInMilliseconds;\n }\n setTotalNumberOfFilesToProcess(fileTotal) {\n this.totalNumberOfFilesToProcess = fileTotal;\n this.processedCount = 0;\n }\n start() {\n // displays information about the total upload/download status\n this.totalFileStatus = setInterval(() => {\n // display 1 decimal place without any rounding\n const percentage = this.formatPercentage(this.processedCount, this.totalNumberOfFilesToProcess);\n core_1.info(`Total file count: ${this.totalNumberOfFilesToProcess} ---- Processed file #${this.processedCount} (${percentage.slice(0, percentage.indexOf('.') + 2)}%)`);\n }, this.displayFrequencyInMilliseconds);\n }\n // if there is a large file that is being uploaded in chunks, this is used to display extra information about the status of the upload\n updateLargeFileStatus(fileName, chunkStartIndex, chunkEndIndex, totalUploadFileSize) {\n // display 1 decimal place without any rounding\n const percentage = this.formatPercentage(chunkEndIndex, totalUploadFileSize);\n core_1.info(`Uploaded ${fileName} (${percentage.slice(0, percentage.indexOf('.') + 2)}%) bytes ${chunkStartIndex}:${chunkEndIndex}`);\n }\n stop() {\n if (this.totalFileStatus) {\n clearInterval(this.totalFileStatus);\n }\n }\n incrementProcessedCount() {\n this.processedCount++;\n }\n formatPercentage(numerator, denominator) {\n // toFixed() rounds, so use extra precision to display accurate information even though 4 decimal places are not displayed\n return ((numerator / denominator) * 100).toFixed(4).toString();\n }\n}\nexports.StatusReporter = StatusReporter;\n//# sourceMappingURL=status-reporter.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n 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);\n 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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs = __importStar(require(\"fs\"));\nconst zlib = __importStar(require(\"zlib\"));\nconst util_1 = require(\"util\");\nconst stat = util_1.promisify(fs.stat);\n/**\n * GZipping certain files that are already compressed will likely not yield further size reductions. Creating large temporary gzip\n * files then will just waste a lot of time before ultimately being discarded (especially for very large files).\n * If any of these types of files are encountered then on-disk gzip creation will be skipped and the original file will be uploaded as-is\n */\nconst gzipExemptFileExtensions = [\n '.gzip',\n '.zip',\n '.tar.lz',\n '.tar.gz',\n '.tar.bz2',\n '.7z'\n];\n/**\n * Creates a Gzip compressed file of an original file at the provided temporary filepath location\n * @param {string} originalFilePath filepath of whatever will be compressed. The original file will be unmodified\n * @param {string} tempFilePath the location of where the Gzip file will be created\n * @returns the size of gzip file that gets created\n */\nfunction createGZipFileOnDisk(originalFilePath, tempFilePath) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const gzipExemptExtension of gzipExemptFileExtensions) {\n if (originalFilePath.endsWith(gzipExemptExtension)) {\n // return a really large number so that the original file gets uploaded\n return Number.MAX_SAFE_INTEGER;\n }\n }\n return new Promise((resolve, reject) => {\n const inputStream = fs.createReadStream(originalFilePath);\n const gzip = zlib.createGzip();\n const outputStream = fs.createWriteStream(tempFilePath);\n inputStream.pipe(gzip).pipe(outputStream);\n outputStream.on('finish', () => __awaiter(this, void 0, void 0, function* () {\n // wait for stream to finish before calculating the size which is needed as part of the Content-Length header when starting an upload\n const size = (yield stat(tempFilePath)).size;\n resolve(size);\n }));\n outputStream.on('error', error => {\n // eslint-disable-next-line no-console\n console.log(error);\n reject;\n });\n });\n });\n}\nexports.createGZipFileOnDisk = createGZipFileOnDisk;\n/**\n * Creates a GZip file in memory using a buffer. Should be used for smaller files to reduce disk I/O\n * @param originalFilePath the path to the original file that is being GZipped\n * @returns a buffer with the GZip file\n */\nfunction createGZipFileInBuffer(originalFilePath) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n var e_1, _a;\n const inputStream = fs.createReadStream(originalFilePath);\n const gzip = zlib.createGzip();\n inputStream.pipe(gzip);\n // read stream into buffer, using experimental async iterators see https://github.com/nodejs/readable-stream/issues/403#issuecomment-479069043\n const chunks = [];\n try {\n for (var gzip_1 = __asyncValues(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), !gzip_1_1.done;) {\n const chunk = gzip_1_1.value;\n chunks.push(chunk);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (gzip_1_1 && !gzip_1_1.done && (_a = gzip_1.return)) yield _a.call(gzip_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n resolve(Buffer.concat(chunks));\n }));\n });\n}\nexports.createGZipFileInBuffer = createGZipFileInBuffer;\n//# sourceMappingURL=upload-gzip.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs = __importStar(require(\"fs\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst tmp = __importStar(require(\"tmp-promise\"));\nconst stream = __importStar(require(\"stream\"));\nconst utils_1 = require(\"./utils\");\nconst config_variables_1 = require(\"./config-variables\");\nconst util_1 = require(\"util\");\nconst url_1 = require(\"url\");\nconst perf_hooks_1 = require(\"perf_hooks\");\nconst status_reporter_1 = require(\"./status-reporter\");\nconst http_client_1 = require(\"@actions/http-client\");\nconst http_manager_1 = require(\"./http-manager\");\nconst upload_gzip_1 = require(\"./upload-gzip\");\nconst requestUtils_1 = require(\"./requestUtils\");\nconst stat = util_1.promisify(fs.stat);\nclass UploadHttpClient {\n constructor() {\n this.uploadHttpManager = new http_manager_1.HttpManager(config_variables_1.getUploadFileConcurrency(), '@actions/artifact-upload');\n this.statusReporter = new status_reporter_1.StatusReporter(10000);\n }\n /**\n * Creates a file container for the new artifact in the remote blob storage/file service\n * @param {string} artifactName Name of the artifact being created\n * @returns The response from the Artifact Service if the file container was successfully created\n */\n createArtifactInFileContainer(artifactName, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const parameters = {\n Type: 'actions_storage',\n Name: artifactName\n };\n // calculate retention period\n if (options && options.retentionDays) {\n const maxRetentionStr = config_variables_1.getRetentionDays();\n parameters.RetentionDays = utils_1.getProperRetention(options.retentionDays, maxRetentionStr);\n }\n const data = JSON.stringify(parameters, null, 2);\n const artifactUrl = utils_1.getArtifactUrl();\n // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately\n const client = this.uploadHttpManager.getClient(0);\n const headers = utils_1.getUploadHeaders('application/json', false);\n // Extra information to display when a particular HTTP code is returned\n // If a 403 is returned when trying to create a file container, the customer has exceeded\n // their storage quota so no new artifact containers can be created\n const customErrorMessages = new Map([\n [\n http_client_1.HttpCodes.Forbidden,\n 'Artifact storage quota has been hit. Unable to upload any new artifacts'\n ],\n [\n http_client_1.HttpCodes.BadRequest,\n `The artifact name ${artifactName} is not valid. Request URL ${artifactUrl}`\n ]\n ]);\n const response = yield requestUtils_1.retryHttpClientRequest('Create Artifact Container', () => __awaiter(this, void 0, void 0, function* () { return client.post(artifactUrl, data, headers); }), customErrorMessages);\n const body = yield response.readBody();\n return JSON.parse(body);\n });\n }\n /**\n * Concurrently upload all of the files in chunks\n * @param {string} uploadUrl Base Url for the artifact that was created\n * @param {SearchResult[]} filesToUpload A list of information about the files being uploaded\n * @returns The size of all the files uploaded in bytes\n */\n uploadArtifactToFileContainer(uploadUrl, filesToUpload, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const FILE_CONCURRENCY = config_variables_1.getUploadFileConcurrency();\n const MAX_CHUNK_SIZE = config_variables_1.getUploadChunkSize();\n core.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`);\n const parameters = [];\n // by default, file uploads will continue if there is an error unless specified differently in the options\n let continueOnError = true;\n if (options) {\n if (options.continueOnError === false) {\n continueOnError = false;\n }\n }\n // prepare the necessary parameters to upload all the files\n for (const file of filesToUpload) {\n const resourceUrl = new url_1.URL(uploadUrl);\n resourceUrl.searchParams.append('itemPath', file.uploadFilePath);\n parameters.push({\n file: file.absoluteFilePath,\n resourceUrl: resourceUrl.toString(),\n maxChunkSize: MAX_CHUNK_SIZE,\n continueOnError\n });\n }\n const parallelUploads = [...new Array(FILE_CONCURRENCY).keys()];\n const failedItemsToReport = [];\n let currentFile = 0;\n let completedFiles = 0;\n let uploadFileSize = 0;\n let totalFileSize = 0;\n let abortPendingFileUploads = false;\n this.statusReporter.setTotalNumberOfFilesToProcess(filesToUpload.length);\n this.statusReporter.start();\n // only allow a certain amount of files to be uploaded at once, this is done to reduce potential errors\n yield Promise.all(parallelUploads.map((index) => __awaiter(this, void 0, void 0, function* () {\n while (currentFile < filesToUpload.length) {\n const currentFileParameters = parameters[currentFile];\n currentFile += 1;\n if (abortPendingFileUploads) {\n failedItemsToReport.push(currentFileParameters.file);\n continue;\n }\n const startTime = perf_hooks_1.performance.now();\n const uploadFileResult = yield this.uploadFileAsync(index, currentFileParameters);\n if (core.isDebug()) {\n core.debug(`File: ${++completedFiles}/${filesToUpload.length}. ${currentFileParameters.file} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish upload`);\n }\n uploadFileSize += uploadFileResult.successfulUploadSize;\n totalFileSize += uploadFileResult.totalSize;\n if (uploadFileResult.isSuccess === false) {\n failedItemsToReport.push(currentFileParameters.file);\n if (!continueOnError) {\n // fail fast\n core.error(`aborting artifact upload`);\n abortPendingFileUploads = true;\n }\n }\n this.statusReporter.incrementProcessedCount();\n }\n })));\n this.statusReporter.stop();\n // done uploading, safety dispose all connections\n this.uploadHttpManager.disposeAndReplaceAllClients();\n core.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`);\n return {\n uploadSize: uploadFileSize,\n totalSize: totalFileSize,\n failedItems: failedItemsToReport\n };\n });\n }\n /**\n * Asynchronously uploads a file. The file is compressed and uploaded using GZip if it is determined to save space.\n * If the upload file is bigger than the max chunk size it will be uploaded via multiple calls\n * @param {number} httpClientIndex The index of the httpClient that is being used to make all of the calls\n * @param {UploadFileParameters} parameters Information about the file that needs to be uploaded\n * @returns The size of the file that was uploaded in bytes along with any failed uploads\n */\n uploadFileAsync(httpClientIndex, parameters) {\n return __awaiter(this, void 0, void 0, function* () {\n const fileStat = yield stat(parameters.file);\n const totalFileSize = fileStat.size;\n const isFIFO = fileStat.isFIFO();\n let offset = 0;\n let isUploadSuccessful = true;\n let failedChunkSizes = 0;\n let uploadFileSize = 0;\n let isGzip = true;\n // the file that is being uploaded is less than 64k in size to increase throughput and to minimize disk I/O\n // for creating a new GZip file, an in-memory buffer is used for compression\n // with named pipes the file size is reported as zero in that case don't read the file in memory\n if (!isFIFO && totalFileSize < 65536) {\n core.debug(`${parameters.file} is less than 64k in size. Creating a gzip file in-memory to potentially reduce the upload size`);\n const buffer = yield upload_gzip_1.createGZipFileInBuffer(parameters.file);\n // An open stream is needed in the event of a failure and we need to retry. If a NodeJS.ReadableStream is directly passed in,\n // it will not properly get reset to the start of the stream if a chunk upload needs to be retried\n let openUploadStream;\n if (totalFileSize < buffer.byteLength) {\n // compression did not help with reducing the size, use a readable stream from the original file for upload\n core.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`);\n openUploadStream = () => fs.createReadStream(parameters.file);\n isGzip = false;\n uploadFileSize = totalFileSize;\n }\n else {\n // create a readable stream using a PassThrough stream that is both readable and writable\n core.debug(`A gzip file created for ${parameters.file} helped with reducing the size of the original file. The file will be uploaded using gzip.`);\n openUploadStream = () => {\n const passThrough = new stream.PassThrough();\n passThrough.end(buffer);\n return passThrough;\n };\n uploadFileSize = buffer.byteLength;\n }\n const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, openUploadStream, 0, uploadFileSize - 1, uploadFileSize, isGzip, totalFileSize);\n if (!result) {\n // chunk failed to upload\n isUploadSuccessful = false;\n failedChunkSizes += uploadFileSize;\n core.warning(`Aborting upload for ${parameters.file} due to failure`);\n }\n return {\n isSuccess: isUploadSuccessful,\n successfulUploadSize: uploadFileSize - failedChunkSizes,\n totalSize: totalFileSize\n };\n }\n else {\n // the file that is being uploaded is greater than 64k in size, a temporary file gets created on disk using the\n // npm tmp-promise package and this file gets used to create a GZipped file\n const tempFile = yield tmp.file();\n core.debug(`${parameters.file} is greater than 64k in size. Creating a gzip file on-disk ${tempFile.path} to potentially reduce the upload size`);\n // create a GZip file of the original file being uploaded, the original file should not be modified in any way\n uploadFileSize = yield upload_gzip_1.createGZipFileOnDisk(parameters.file, tempFile.path);\n let uploadFilePath = tempFile.path;\n // compression did not help with size reduction, use the original file for upload and delete the temp GZip file\n // for named pipes totalFileSize is zero, this assumes compression did help\n if (!isFIFO && totalFileSize < uploadFileSize) {\n core.debug(`The gzip file created for ${parameters.file} did not help with reducing the size of the file. The original file will be uploaded as-is`);\n uploadFileSize = totalFileSize;\n uploadFilePath = parameters.file;\n isGzip = false;\n }\n else {\n core.debug(`The gzip file created for ${parameters.file} is smaller than the original file. The file will be uploaded using gzip.`);\n }\n let abortFileUpload = false;\n // upload only a single chunk at a time\n while (offset < uploadFileSize) {\n const chunkSize = Math.min(uploadFileSize - offset, parameters.maxChunkSize);\n const startChunkIndex = offset;\n const endChunkIndex = offset + chunkSize - 1;\n offset += parameters.maxChunkSize;\n if (abortFileUpload) {\n // if we don't want to continue in the event of an error, any pending upload chunks will be marked as failed\n failedChunkSizes += chunkSize;\n continue;\n }\n const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs.createReadStream(uploadFilePath, {\n start: startChunkIndex,\n end: endChunkIndex,\n autoClose: false\n }), startChunkIndex, endChunkIndex, uploadFileSize, isGzip, totalFileSize);\n if (!result) {\n // Chunk failed to upload, report as failed and do not continue uploading any more chunks for the file. It is possible that part of a chunk was\n // successfully uploaded so the server may report a different size for what was uploaded\n isUploadSuccessful = false;\n failedChunkSizes += chunkSize;\n core.warning(`Aborting upload for ${parameters.file} due to failure`);\n abortFileUpload = true;\n }\n else {\n // if an individual file is greater than 8MB (1024*1024*8) in size, display extra information about the upload status\n if (uploadFileSize > 8388608) {\n this.statusReporter.updateLargeFileStatus(parameters.file, startChunkIndex, endChunkIndex, uploadFileSize);\n }\n }\n }\n // Delete the temporary file that was created as part of the upload. If the temp file does not get manually deleted by\n // calling cleanup, it gets removed when the node process exits. For more info see: https://www.npmjs.com/package/tmp-promise#about\n core.debug(`deleting temporary gzip file ${tempFile.path}`);\n yield tempFile.cleanup();\n return {\n isSuccess: isUploadSuccessful,\n successfulUploadSize: uploadFileSize - failedChunkSizes,\n totalSize: totalFileSize\n };\n }\n });\n }\n /**\n * Uploads a chunk of an individual file to the specified resourceUrl. If the upload fails and the status code\n * indicates a retryable status, we try to upload the chunk as well\n * @param {number} httpClientIndex The index of the httpClient being used to make all the necessary calls\n * @param {string} resourceUrl Url of the resource that the chunk will be uploaded to\n * @param {NodeJS.ReadableStream} openStream Stream of the file that will be uploaded\n * @param {number} start Starting byte index of file that the chunk belongs to\n * @param {number} end Ending byte index of file that the chunk belongs to\n * @param {number} uploadFileSize Total size of the file in bytes that is being uploaded\n * @param {boolean} isGzip Denotes if we are uploading a Gzip compressed stream\n * @param {number} totalFileSize Original total size of the file that is being uploaded\n * @returns if the chunk was successfully uploaded\n */\n uploadChunk(httpClientIndex, resourceUrl, openStream, start, end, uploadFileSize, isGzip, totalFileSize) {\n return __awaiter(this, void 0, void 0, function* () {\n // prepare all the necessary headers before making any http call\n const headers = utils_1.getUploadHeaders('application/octet-stream', true, isGzip, totalFileSize, end - start + 1, utils_1.getContentRange(start, end, uploadFileSize));\n const uploadChunkRequest = () => __awaiter(this, void 0, void 0, function* () {\n const client = this.uploadHttpManager.getClient(httpClientIndex);\n return yield client.sendStream('PUT', resourceUrl, openStream(), headers);\n });\n let retryCount = 0;\n const retryLimit = config_variables_1.getRetryLimit();\n // Increments the current retry count and then checks if the retry limit has been reached\n // If there have been too many retries, fail so the download stops\n const incrementAndCheckRetryLimit = (response) => {\n retryCount++;\n if (retryCount > retryLimit) {\n if (response) {\n utils_1.displayHttpDiagnostics(response);\n }\n core.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`);\n return true;\n }\n return false;\n };\n const backOff = (retryAfterValue) => __awaiter(this, void 0, void 0, function* () {\n this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex);\n if (retryAfterValue) {\n core.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`);\n yield utils_1.sleep(retryAfterValue);\n }\n else {\n const backoffTime = utils_1.getExponentialRetryTimeInMilliseconds(retryCount);\n core.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`);\n yield utils_1.sleep(backoffTime);\n }\n core.info(`Finished backoff for retry #${retryCount}, continuing with upload`);\n return;\n });\n // allow for failed chunks to be retried multiple times\n while (retryCount <= retryLimit) {\n let response;\n try {\n response = yield uploadChunkRequest();\n }\n catch (error) {\n // if an error is caught, it is usually indicative of a timeout so retry the upload\n core.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`);\n // eslint-disable-next-line no-console\n console.log(error);\n if (incrementAndCheckRetryLimit()) {\n return false;\n }\n yield backOff();\n continue;\n }\n // Always read the body of the response. There is potential for a resource leak if the body is not read which will\n // result in the connection remaining open along with unintended consequences when trying to dispose of the client\n yield response.readBody();\n if (utils_1.isSuccessStatusCode(response.message.statusCode)) {\n return true;\n }\n else if (utils_1.isRetryableStatusCode(response.message.statusCode)) {\n core.info(`A ${response.message.statusCode} status code has been received, will attempt to retry the upload`);\n if (incrementAndCheckRetryLimit(response)) {\n return false;\n }\n utils_1.isThrottledStatusCode(response.message.statusCode)\n ? yield backOff(utils_1.tryGetRetryAfterValueTimeInMilliseconds(response.message.headers))\n : yield backOff();\n }\n else {\n core.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`);\n utils_1.displayHttpDiagnostics(response);\n return false;\n }\n }\n return false;\n });\n }\n /**\n * Updates the size of the artifact from -1 which was initially set when the container was first created for the artifact.\n * Updating the size indicates that we are done uploading all the contents of the artifact\n */\n patchArtifactSize(size, artifactName) {\n return __awaiter(this, void 0, void 0, function* () {\n const resourceUrl = new url_1.URL(utils_1.getArtifactUrl());\n resourceUrl.searchParams.append('artifactName', artifactName);\n const parameters = { Size: size };\n const data = JSON.stringify(parameters, null, 2);\n core.debug(`URL is ${resourceUrl.toString()}`);\n // use the first client from the httpManager, `keep-alive` is not used so the connection will close immediately\n const client = this.uploadHttpManager.getClient(0);\n const headers = utils_1.getUploadHeaders('application/json', false);\n // Extra information to display when a particular HTTP code is returned\n const customErrorMessages = new Map([\n [\n http_client_1.HttpCodes.NotFound,\n `An Artifact with the name ${artifactName} was not found`\n ]\n ]);\n // TODO retry for all possible response codes, the artifact upload is pretty much complete so it at all costs we should try to finish this\n const response = yield requestUtils_1.retryHttpClientRequest('Finalize artifact upload', () => __awaiter(this, void 0, void 0, function* () { return client.patch(resourceUrl.toString(), data, headers); }), customErrorMessages);\n yield response.readBody();\n core.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`);\n });\n }\n}\nexports.UploadHttpClient = UploadHttpClient;\n//# sourceMappingURL=upload-http-client.js.map","\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs = __importStar(require(\"fs\"));\nconst core_1 = require(\"@actions/core\");\nconst path_1 = require(\"path\");\nconst path_and_artifact_name_validation_1 = require(\"./path-and-artifact-name-validation\");\n/**\n * Creates a specification that describes how each file that is part of the artifact will be uploaded\n * @param artifactName the name of the artifact being uploaded. Used during upload to denote where the artifact is stored on the server\n * @param rootDirectory an absolute file path that denotes the path that should be removed from the beginning of each artifact file\n * @param artifactFiles a list of absolute file paths that denote what should be uploaded as part of the artifact\n */\nfunction getUploadSpecification(artifactName, rootDirectory, artifactFiles) {\n // artifact name was checked earlier on, no need to check again\n const specifications = [];\n if (!fs.existsSync(rootDirectory)) {\n throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`);\n }\n if (!fs.lstatSync(rootDirectory).isDirectory()) {\n throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`);\n }\n // Normalize and resolve, this allows for either absolute or relative paths to be used\n rootDirectory = path_1.normalize(rootDirectory);\n rootDirectory = path_1.resolve(rootDirectory);\n /*\n Example to demonstrate behavior\n \n Input:\n artifactName: my-artifact\n rootDirectory: '/home/user/files/plz-upload'\n artifactFiles: [\n '/home/user/files/plz-upload/file1.txt',\n '/home/user/files/plz-upload/file2.txt',\n '/home/user/files/plz-upload/dir/file3.txt'\n ]\n \n Output:\n specifications: [\n ['/home/user/files/plz-upload/file1.txt', 'my-artifact/file1.txt'],\n ['/home/user/files/plz-upload/file1.txt', 'my-artifact/file2.txt'],\n ['/home/user/files/plz-upload/file1.txt', 'my-artifact/dir/file3.txt']\n ]\n */\n for (let file of artifactFiles) {\n if (!fs.existsSync(file)) {\n throw new Error(`File ${file} does not exist`);\n }\n if (!fs.lstatSync(file).isDirectory()) {\n // Normalize and resolve, this allows for either absolute or relative paths to be used\n file = path_1.normalize(file);\n file = path_1.resolve(file);\n if (!file.startsWith(rootDirectory)) {\n throw new Error(`The rootDirectory: ${rootDirectory} is not a parent directory of the file: ${file}`);\n }\n // Check for forbidden characters in file paths that will be rejected during upload\n const uploadPath = file.replace(rootDirectory, '');\n path_and_artifact_name_validation_1.checkArtifactFilePath(uploadPath);\n /*\n uploadFilePath denotes where the file will be uploaded in the file container on the server. During a run, if multiple artifacts are uploaded, they will all\n be saved in the same container. The artifact name is used as the root directory in the container to separate and distinguish uploaded artifacts\n \n path.join handles all the following cases and would return 'artifact-name/file-to-upload.txt\n join('artifact-name/', 'file-to-upload.txt')\n join('artifact-name/', '/file-to-upload.txt')\n join('artifact-name', 'file-to-upload.txt')\n join('artifact-name', '/file-to-upload.txt')\n */\n specifications.push({\n absoluteFilePath: file,\n uploadFilePath: path_1.join(artifactName, uploadPath)\n });\n }\n else {\n // Directories are rejected by the server during upload\n core_1.debug(`Removing ${file} from rawSearchResults because it is a directory`);\n }\n }\n return specifications;\n}\nexports.getUploadSpecification = getUploadSpecification;\n//# sourceMappingURL=upload-specification.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core_1 = require(\"@actions/core\");\nconst fs_1 = require(\"fs\");\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/auth\");\nconst config_variables_1 = require(\"./config-variables\");\n/**\n * Returns a retry time in milliseconds that exponentially gets larger\n * depending on the amount of retries that have been attempted\n */\nfunction getExponentialRetryTimeInMilliseconds(retryCount) {\n if (retryCount < 0) {\n throw new Error('RetryCount should not be negative');\n }\n else if (retryCount === 0) {\n return config_variables_1.getInitialRetryIntervalInMilliseconds();\n }\n const minTime = config_variables_1.getInitialRetryIntervalInMilliseconds() * config_variables_1.getRetryMultiplier() * retryCount;\n const maxTime = minTime * config_variables_1.getRetryMultiplier();\n // returns a random number between the minTime (inclusive) and the maxTime (exclusive)\n return Math.trunc(Math.random() * (maxTime - minTime) + minTime);\n}\nexports.getExponentialRetryTimeInMilliseconds = getExponentialRetryTimeInMilliseconds;\n/**\n * Parses a env variable that is a number\n */\nfunction parseEnvNumber(key) {\n const value = Number(process.env[key]);\n if (Number.isNaN(value) || value < 0) {\n return undefined;\n }\n return value;\n}\nexports.parseEnvNumber = parseEnvNumber;\n/**\n * Various utility functions to help with the necessary API calls\n */\nfunction getApiVersion() {\n return '6.0-preview';\n}\nexports.getApiVersion = getApiVersion;\nfunction isSuccessStatusCode(statusCode) {\n if (!statusCode) {\n return false;\n }\n return statusCode >= 200 && statusCode < 300;\n}\nexports.isSuccessStatusCode = isSuccessStatusCode;\nfunction isForbiddenStatusCode(statusCode) {\n if (!statusCode) {\n return false;\n }\n return statusCode === http_client_1.HttpCodes.Forbidden;\n}\nexports.isForbiddenStatusCode = isForbiddenStatusCode;\nfunction isRetryableStatusCode(statusCode) {\n if (!statusCode) {\n return false;\n }\n const retryableStatusCodes = [\n http_client_1.HttpCodes.BadGateway,\n http_client_1.HttpCodes.GatewayTimeout,\n http_client_1.HttpCodes.InternalServerError,\n http_client_1.HttpCodes.ServiceUnavailable,\n http_client_1.HttpCodes.TooManyRequests,\n 413 // Payload Too Large\n ];\n return retryableStatusCodes.includes(statusCode);\n}\nexports.isRetryableStatusCode = isRetryableStatusCode;\nfunction isThrottledStatusCode(statusCode) {\n if (!statusCode) {\n return false;\n }\n return statusCode === http_client_1.HttpCodes.TooManyRequests;\n}\nexports.isThrottledStatusCode = isThrottledStatusCode;\n/**\n * Attempts to get the retry-after value from a set of http headers. The retry time\n * is originally denoted in seconds, so if present, it is converted to milliseconds\n * @param headers all the headers received when making an http call\n */\nfunction tryGetRetryAfterValueTimeInMilliseconds(headers) {\n if (headers['retry-after']) {\n const retryTime = Number(headers['retry-after']);\n if (!isNaN(retryTime)) {\n core_1.info(`Retry-After header is present with a value of ${retryTime}`);\n return retryTime * 1000;\n }\n core_1.info(`Returned retry-after header value: ${retryTime} is non-numeric and cannot be used`);\n return undefined;\n }\n core_1.info(`No retry-after header was found. Dumping all headers for diagnostic purposes`);\n // eslint-disable-next-line no-console\n console.log(headers);\n return undefined;\n}\nexports.tryGetRetryAfterValueTimeInMilliseconds = tryGetRetryAfterValueTimeInMilliseconds;\nfunction getContentRange(start, end, total) {\n // Format: `bytes start-end/fileSize\n // start and end are inclusive\n // For a 200 byte chunk starting at byte 0:\n // Content-Range: bytes 0-199/200\n return `bytes ${start}-${end}/${total}`;\n}\nexports.getContentRange = getContentRange;\n/**\n * Sets all the necessary headers when downloading an artifact\n * @param {string} contentType the type of content being uploaded\n * @param {boolean} isKeepAlive is the same connection being used to make multiple calls\n * @param {boolean} acceptGzip can we accept a gzip encoded response\n * @param {string} acceptType the type of content that we can accept\n * @returns appropriate headers to make a specific http call during artifact download\n */\nfunction getDownloadHeaders(contentType, isKeepAlive, acceptGzip) {\n const requestOptions = {};\n if (contentType) {\n requestOptions['Content-Type'] = contentType;\n }\n if (isKeepAlive) {\n requestOptions['Connection'] = 'Keep-Alive';\n // keep alive for at least 10 seconds before closing the connection\n requestOptions['Keep-Alive'] = '10';\n }\n if (acceptGzip) {\n // if we are expecting a response with gzip encoding, it should be using an octet-stream in the accept header\n requestOptions['Accept-Encoding'] = 'gzip';\n requestOptions['Accept'] = `application/octet-stream;api-version=${getApiVersion()}`;\n }\n else {\n // default to application/json if we are not working with gzip content\n requestOptions['Accept'] = `application/json;api-version=${getApiVersion()}`;\n }\n return requestOptions;\n}\nexports.getDownloadHeaders = getDownloadHeaders;\n/**\n * Sets all the necessary headers when uploading an artifact\n * @param {string} contentType the type of content being uploaded\n * @param {boolean} isKeepAlive is the same connection being used to make multiple calls\n * @param {boolean} isGzip is the connection being used to upload GZip compressed content\n * @param {number} uncompressedLength the original size of the content if something is being uploaded that has been compressed\n * @param {number} contentLength the length of the content that is being uploaded\n * @param {string} contentRange the range of the content that is being uploaded\n * @returns appropriate headers to make a specific http call during artifact upload\n */\nfunction getUploadHeaders(contentType, isKeepAlive, isGzip, uncompressedLength, contentLength, contentRange) {\n const requestOptions = {};\n requestOptions['Accept'] = `application/json;api-version=${getApiVersion()}`;\n if (contentType) {\n requestOptions['Content-Type'] = contentType;\n }\n if (isKeepAlive) {\n requestOptions['Connection'] = 'Keep-Alive';\n // keep alive for at least 10 seconds before closing the connection\n requestOptions['Keep-Alive'] = '10';\n }\n if (isGzip) {\n requestOptions['Content-Encoding'] = 'gzip';\n requestOptions['x-tfs-filelength'] = uncompressedLength;\n }\n if (contentLength) {\n requestOptions['Content-Length'] = contentLength;\n }\n if (contentRange) {\n requestOptions['Content-Range'] = contentRange;\n }\n return requestOptions;\n}\nexports.getUploadHeaders = getUploadHeaders;\nfunction createHttpClient(userAgent) {\n return new http_client_1.HttpClient(userAgent, [\n new auth_1.BearerCredentialHandler(config_variables_1.getRuntimeToken())\n ]);\n}\nexports.createHttpClient = createHttpClient;\nfunction getArtifactUrl() {\n const artifactUrl = `${config_variables_1.getRuntimeUrl()}_apis/pipelines/workflows/${config_variables_1.getWorkFlowRunId()}/artifacts?api-version=${getApiVersion()}`;\n core_1.debug(`Artifact Url: ${artifactUrl}`);\n return artifactUrl;\n}\nexports.getArtifactUrl = getArtifactUrl;\n/**\n * Uh oh! Something might have gone wrong during either upload or download. The IHtttpClientResponse object contains information\n * about the http call that was made by the actions http client. This information might be useful to display for diagnostic purposes, but\n * this entire object is really big and most of the information is not really useful. This function takes the response object and displays only\n * the information that we want.\n *\n * Certain information such as the TLSSocket and the Readable state are not really useful for diagnostic purposes so they can be avoided.\n * Other information such as the headers, the response code and message might be useful, so this is displayed.\n */\nfunction displayHttpDiagnostics(response) {\n core_1.info(`##### Begin Diagnostic HTTP information #####\nStatus Code: ${response.message.statusCode}\nStatus Message: ${response.message.statusMessage}\nHeader Information: ${JSON.stringify(response.message.headers, undefined, 2)}\n###### End Diagnostic HTTP information ######`);\n}\nexports.displayHttpDiagnostics = displayHttpDiagnostics;\nfunction createDirectoriesForArtifact(directories) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const directory of directories) {\n yield fs_1.promises.mkdir(directory, {\n recursive: true\n });\n }\n });\n}\nexports.createDirectoriesForArtifact = createDirectoriesForArtifact;\nfunction createEmptyFilesForArtifact(emptyFilesToCreate) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const filePath of emptyFilesToCreate) {\n yield (yield fs_1.promises.open(filePath, 'w')).close();\n }\n });\n}\nexports.createEmptyFilesForArtifact = createEmptyFilesForArtifact;\nfunction getFileSize(filePath) {\n return __awaiter(this, void 0, void 0, function* () {\n const stats = yield fs_1.promises.stat(filePath);\n core_1.debug(`${filePath} size:(${stats.size}) blksize:(${stats.blksize}) blocks:(${stats.blocks})`);\n return stats.size;\n });\n}\nexports.getFileSize = getFileSize;\nfunction rmFile(filePath) {\n return __awaiter(this, void 0, void 0, function* () {\n yield fs_1.promises.unlink(filePath);\n });\n}\nexports.rmFile = rmFile;\nfunction getProperRetention(retentionInput, retentionSetting) {\n if (retentionInput < 0) {\n throw new Error('Invalid retention, minimum value is 1.');\n }\n let retention = retentionInput;\n if (retentionSetting) {\n const maxRetention = parseInt(retentionSetting);\n if (!isNaN(maxRetention) && maxRetention < retention) {\n core_1.warning(`Retention days is greater than the max value allowed by the repository setting, reduce retention to ${maxRetention} days`);\n retention = maxRetention;\n }\n }\n return retention;\n}\nexports.getProperRetention = getProperRetention;\nfunction sleep(milliseconds) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n });\n}\nexports.sleep = sleep;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n const delimiter = '_GitHubActionsFileCommandDelimeter_';\n const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;\n file_command_1.issueCommand('ENV', commandValue);\n }\n else {\n command_1.issueCommand('set-env', { name }, convertedVal);\n }\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n return inputs;\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, value);\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n command_1.issueCommand('save-state', { name }, value);\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issueCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\nfunction issueCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueCommand = issueCommand;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nconst fs_1 = require(\"fs\");\nconst os_1 = require(\"os\");\nclass Context {\n /**\n * Hydrate the context from the environment\n */\n constructor() {\n var _a, _b, _c;\n this.payload = {};\n if (process.env.GITHUB_EVENT_PATH) {\n if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {\n this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));\n }\n else {\n const path = process.env.GITHUB_EVENT_PATH;\n process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);\n }\n }\n this.eventName = process.env.GITHUB_EVENT_NAME;\n this.sha = process.env.GITHUB_SHA;\n this.ref = process.env.GITHUB_REF;\n this.workflow = process.env.GITHUB_WORKFLOW;\n this.action = process.env.GITHUB_ACTION;\n this.actor = process.env.GITHUB_ACTOR;\n this.job = process.env.GITHUB_JOB;\n this.runNumber = parseInt(process.env.GITHUB_RUN_NUMBER, 10);\n this.runId = parseInt(process.env.GITHUB_RUN_ID, 10);\n this.apiUrl = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `https://api.github.com`;\n this.serverUrl = (_b = process.env.GITHUB_SERVER_URL) !== null && _b !== void 0 ? _b : `https://github.com`;\n this.graphqlUrl = (_c = process.env.GITHUB_GRAPHQL_URL) !== null && _c !== void 0 ? _c : `https://api.github.com/graphql`;\n }\n get issue() {\n const payload = this.payload;\n return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });\n }\n get repo() {\n if (process.env.GITHUB_REPOSITORY) {\n const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');\n return { owner, repo };\n }\n if (this.payload.repository) {\n return {\n owner: this.payload.repository.owner.login,\n repo: this.payload.repository.name\n };\n }\n throw new Error(\"context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'\");\n }\n}\nexports.Context = Context;\n//# sourceMappingURL=context.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokit = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst utils_1 = require(\"./utils\");\nexports.context = new Context.Context();\n/**\n * Returns a hydrated octokit ready to use for GitHub Actions\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokit(token, options) {\n return new utils_1.GitHub(utils_1.getOctokitOptions(token, options));\n}\nexports.getOctokit = getOctokit;\n//# sourceMappingURL=github.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getApiBaseUrl = exports.getProxyAgent = exports.getAuthString = void 0;\nconst httpClient = __importStar(require(\"@actions/http-client\"));\nfunction getAuthString(token, options) {\n if (!token && !options.auth) {\n throw new Error('Parameter token or opts.auth is required');\n }\n else if (token && options.auth) {\n throw new Error('Parameters token and opts.auth may not both be specified');\n }\n return typeof options.auth === 'string' ? options.auth : `token ${token}`;\n}\nexports.getAuthString = getAuthString;\nfunction getProxyAgent(destinationUrl) {\n const hc = new httpClient.HttpClient();\n return hc.getAgent(destinationUrl);\n}\nexports.getProxyAgent = getProxyAgent;\nfunction getApiBaseUrl() {\n return process.env['GITHUB_API_URL'] || 'https://api.github.com';\n}\nexports.getApiBaseUrl = getApiBaseUrl;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOctokitOptions = exports.GitHub = exports.context = void 0;\nconst Context = __importStar(require(\"./context\"));\nconst Utils = __importStar(require(\"./internal/utils\"));\n// octokit + plugins\nconst core_1 = require(\"@octokit/core\");\nconst plugin_rest_endpoint_methods_1 = require(\"@octokit/plugin-rest-endpoint-methods\");\nconst plugin_paginate_rest_1 = require(\"@octokit/plugin-paginate-rest\");\nexports.context = new Context.Context();\nconst baseUrl = Utils.getApiBaseUrl();\nconst defaults = {\n baseUrl,\n request: {\n agent: Utils.getProxyAgent(baseUrl)\n }\n};\nexports.GitHub = core_1.Octokit.plugin(plugin_rest_endpoint_methods_1.restEndpointMethods, plugin_paginate_rest_1.paginateRest).defaults(defaults);\n/**\n * Convience function to correctly format Octokit Options to pass into the constructor.\n *\n * @param token the repo PAT or GITHUB_TOKEN\n * @param options other options to set\n */\nfunction getOctokitOptions(token, options) {\n const opts = Object.assign({}, options || {}); // Shallow clone - don't mutate the object provided by the caller\n // Auth\n const auth = Utils.getAuthString(token, opts);\n if (auth) {\n opts.auth = auth;\n }\n return opts;\n}\nexports.getOctokitOptions = getOctokitOptions;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hashFiles = exports.create = void 0;\nconst internal_globber_1 = require(\"./internal-globber\");\nconst internal_hash_files_1 = require(\"./internal-hash-files\");\n/**\n * Constructs a globber\n *\n * @param patterns Patterns separated by newlines\n * @param options Glob options\n */\nfunction create(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield internal_globber_1.DefaultGlobber.create(patterns, options);\n });\n}\nexports.create = create;\n/**\n * Computes the sha256 hash of a glob\n *\n * @param patterns Patterns separated by newlines\n * @param options Glob options\n */\nfunction hashFiles(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n let followSymbolicLinks = true;\n if (options && typeof options.followSymbolicLinks === 'boolean') {\n followSymbolicLinks = options.followSymbolicLinks;\n }\n const globber = yield create(patterns, { followSymbolicLinks });\n return internal_hash_files_1.hashFiles(globber);\n });\n}\nexports.hashFiles = hashFiles;\n//# sourceMappingURL=glob.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOptions = void 0;\nconst core = __importStar(require(\"@actions/core\"));\n/**\n * Returns a copy with defaults filled in.\n */\nfunction getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n matchDirectories: true,\n omitBrokenSymbolicLinks: true\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.matchDirectories === 'boolean') {\n result.matchDirectories = copy.matchDirectories;\n core.debug(`matchDirectories '${result.matchDirectories}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n }\n return result;\n}\nexports.getOptions = getOptions;\n//# sourceMappingURL=internal-glob-options-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n 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);\n 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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n 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); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultGlobber = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst fs = __importStar(require(\"fs\"));\nconst globOptionsHelper = __importStar(require(\"./internal-glob-options-helper\"));\nconst path = __importStar(require(\"path\"));\nconst patternHelper = __importStar(require(\"./internal-pattern-helper\"));\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst internal_pattern_1 = require(\"./internal-pattern\");\nconst internal_search_state_1 = require(\"./internal-search-state\");\nconst IS_WINDOWS = process.platform === 'win32';\nclass DefaultGlobber {\n constructor(options) {\n this.patterns = [];\n this.searchPaths = [];\n this.options = globOptionsHelper.getOptions(options);\n }\n getSearchPaths() {\n // Return a copy\n return this.searchPaths.slice();\n }\n glob() {\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function* () {\n const result = [];\n try {\n for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) {\n const itemPath = _c.value;\n result.push(itemPath);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return result;\n });\n }\n globGenerator() {\n return __asyncGenerator(this, arguments, function* globGenerator_1() {\n // Fill in defaults options\n const options = globOptionsHelper.getOptions(this.options);\n // Implicit descendants?\n const patterns = [];\n for (const pattern of this.patterns) {\n patterns.push(pattern);\n if (options.implicitDescendants &&\n (pattern.trailingSeparator ||\n pattern.segments[pattern.segments.length - 1] !== '**')) {\n patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**')));\n }\n }\n // Push the search paths\n const stack = [];\n for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n core.debug(`Search path '${searchPath}'`);\n // Exists?\n try {\n // Intentionally using lstat. Detection for broken symlink\n // will be performed later (if following symlinks).\n yield __await(fs.promises.lstat(searchPath));\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n continue;\n }\n throw err;\n }\n stack.unshift(new internal_search_state_1.SearchState(searchPath, 1));\n }\n // Search\n const traversalChain = []; // used to detect cycles\n while (stack.length) {\n // Pop\n const item = stack.pop();\n // Match?\n const match = patternHelper.match(patterns, item.path);\n const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n if (!match && !partialMatch) {\n continue;\n }\n // Stat\n const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n // Broken symlink, or symlink cycle detected, or no longer exists\n );\n // Broken symlink, or symlink cycle detected, or no longer exists\n if (!stats) {\n continue;\n }\n // Directory\n if (stats.isDirectory()) {\n // Matched\n if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) {\n yield yield __await(item.path);\n }\n // Descend?\n else if (!partialMatch) {\n continue;\n }\n // Push the child items in reverse\n const childLevel = item.level + 1;\n const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel));\n stack.push(...childItems.reverse());\n }\n // File\n else if (match & internal_match_kind_1.MatchKind.File) {\n yield yield __await(item.path);\n }\n }\n });\n }\n /**\n * Constructs a DefaultGlobber\n */\n static create(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = new DefaultGlobber(options);\n if (IS_WINDOWS) {\n patterns = patterns.replace(/\\r\\n/g, '\\n');\n patterns = patterns.replace(/\\r/g, '\\n');\n }\n const lines = patterns.split('\\n').map(x => x.trim());\n for (const line of lines) {\n // Empty or comment\n if (!line || line.startsWith('#')) {\n continue;\n }\n // Pattern\n else {\n result.patterns.push(new internal_pattern_1.Pattern(line));\n }\n }\n result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n return result;\n });\n }\n static stat(item, options, traversalChain) {\n return __awaiter(this, void 0, void 0, function* () {\n // Note:\n // `stat` returns info about the target of a symlink (or symlink chain)\n // `lstat` returns info about a symlink itself\n let stats;\n if (options.followSymbolicLinks) {\n try {\n // Use `stat` (following symlinks)\n stats = yield fs.promises.stat(item.path);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n if (options.omitBrokenSymbolicLinks) {\n core.debug(`Broken symlink '${item.path}'`);\n return undefined;\n }\n throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n }\n throw err;\n }\n }\n else {\n // Use `lstat` (not following symlinks)\n stats = yield fs.promises.lstat(item.path);\n }\n // Note, isDirectory() returns false for the lstat of a symlink\n if (stats.isDirectory() && options.followSymbolicLinks) {\n // Get the realpath\n const realPath = yield fs.promises.realpath(item.path);\n // Fixup the traversal chain to match the item level\n while (traversalChain.length >= item.level) {\n traversalChain.pop();\n }\n // Test for a cycle\n if (traversalChain.some((x) => x === realPath)) {\n core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n return undefined;\n }\n // Update the traversal chain\n traversalChain.push(realPath);\n }\n return stats;\n });\n }\n}\nexports.DefaultGlobber = DefaultGlobber;\n//# sourceMappingURL=internal-globber.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n 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);\n 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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hashFiles = void 0;\nconst crypto = __importStar(require(\"crypto\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst fs = __importStar(require(\"fs\"));\nconst stream = __importStar(require(\"stream\"));\nconst util = __importStar(require(\"util\"));\nconst path = __importStar(require(\"path\"));\nfunction hashFiles(globber) {\n var e_1, _a;\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n let hasMatch = false;\n const githubWorkspace = (_b = process.env['GITHUB_WORKSPACE']) !== null && _b !== void 0 ? _b : process.cwd();\n const result = crypto.createHash('sha256');\n let count = 0;\n try {\n for (var _c = __asyncValues(globber.globGenerator()), _d; _d = yield _c.next(), !_d.done;) {\n const file = _d.value;\n core.debug(file);\n if (!file.startsWith(`${githubWorkspace}${path.sep}`)) {\n core.debug(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`);\n continue;\n }\n if (fs.statSync(file).isDirectory()) {\n core.debug(`Skip directory '${file}'.`);\n continue;\n }\n const hash = crypto.createHash('sha256');\n const pipeline = util.promisify(stream.pipeline);\n yield pipeline(fs.createReadStream(file), hash);\n result.write(hash.digest());\n count++;\n if (!hasMatch) {\n hasMatch = true;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) yield _a.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n result.end();\n if (hasMatch) {\n core.debug(`Found ${count} files to hash.`);\n return result.digest('hex');\n }\n else {\n core.debug(`No matches found for glob`);\n return '';\n }\n });\n}\nexports.hashFiles = hashFiles;\n//# sourceMappingURL=internal-hash-files.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MatchKind = void 0;\n/**\n * Indicates whether a pattern matches a path\n */\nvar MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind = exports.MatchKind || (exports.MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0;\nconst path = __importStar(require(\"path\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nfunction dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\nexports.dirname = dirname;\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nfunction ensureAbsoluteRoot(root, itemPath) {\n assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert_1.default(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert_1.default(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\nexports.ensureAbsoluteRoot = ensureAbsoluteRoot;\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nfunction hasAbsoluteRoot(itemPath) {\n assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\nexports.hasAbsoluteRoot = hasAbsoluteRoot;\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nfunction hasRoot(itemPath) {\n assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\nexports.hasRoot = hasRoot;\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nfunction normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\nexports.normalizeSeparators = normalizeSeparators;\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nfunction safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\nexports.safeTrimTrailingSeparator = safeTrimTrailingSeparator;\n//# sourceMappingURL=internal-path-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst path = __importStar(require(\"path\"));\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nclass Path {\n /**\n * Constructs a Path\n * @param itemPath Path or array of segments\n */\n constructor(itemPath) {\n this.segments = [];\n // String\n if (typeof itemPath === 'string') {\n assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`);\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n // Not rooted\n if (!pathHelper.hasRoot(itemPath)) {\n this.segments = itemPath.split(path.sep);\n }\n // Rooted\n else {\n // Add all segments, while not at the root\n let remaining = itemPath;\n let dir = pathHelper.dirname(remaining);\n while (dir !== remaining) {\n // Add the segment\n const basename = path.basename(remaining);\n this.segments.unshift(basename);\n // Truncate the last segment\n remaining = dir;\n dir = pathHelper.dirname(remaining);\n }\n // Remainder is the root\n this.segments.unshift(remaining);\n }\n }\n // Array\n else {\n // Must not be empty\n assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n // Each segment\n for (let i = 0; i < itemPath.length; i++) {\n let segment = itemPath[i];\n // Must not be empty\n assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`);\n // Normalize slashes\n segment = pathHelper.normalizeSeparators(itemPath[i]);\n // Root segment\n if (i === 0 && pathHelper.hasRoot(segment)) {\n segment = pathHelper.safeTrimTrailingSeparator(segment);\n assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n this.segments.push(segment);\n }\n // All other segments\n else {\n // Must not contain slash\n assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n this.segments.push(segment);\n }\n }\n }\n }\n /**\n * Converts the path to it's string representation\n */\n toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }\n}\nexports.Path = Path;\n//# sourceMappingURL=internal-path.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partialMatch = exports.match = exports.getSearchPaths = void 0;\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nfunction getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\nexports.getSearchPaths = getSearchPaths;\n/**\n * Matches the patterns against the path\n */\nfunction match(patterns, itemPath) {\n let result = internal_match_kind_1.MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\nexports.match = match;\n/**\n * Checks whether to descend further into the directory\n */\nfunction partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\nexports.partialMatch = partialMatch;\n//# sourceMappingURL=internal-pattern-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pattern = void 0;\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst minimatch_1 = require(\"minimatch\");\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst internal_path_1 = require(\"./internal-path\");\nconst IS_WINDOWS = process.platform === 'win32';\nclass Pattern {\n constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n /**\n * Indicates whether matches should be excluded from the result set\n */\n this.negate = false;\n // Pattern overload\n let pattern;\n if (typeof patternOrNegate === 'string') {\n pattern = patternOrNegate.trim();\n }\n // Segments overload\n else {\n // Convert to pattern\n segments = segments || [];\n assert_1.default(segments.length, `Parameter 'segments' must not empty`);\n const root = Pattern.getLiteral(segments[0]);\n assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n pattern = new internal_path_1.Path(segments).toString().trim();\n if (patternOrNegate) {\n pattern = `!${pattern}`;\n }\n }\n // Negate\n while (pattern.startsWith('!')) {\n this.negate = !this.negate;\n pattern = pattern.substr(1).trim();\n }\n // Normalize slashes and ensures absolute root\n pattern = Pattern.fixupPattern(pattern, homedir);\n // Segments\n this.segments = new internal_path_1.Path(pattern).segments;\n // Trailing slash indicates the pattern should only match directories, not regular files\n this.trailingSeparator = pathHelper\n .normalizeSeparators(pattern)\n .endsWith(path.sep);\n pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n // Search path (literal path prior to the first glob segment)\n let foundGlob = false;\n const searchSegments = this.segments\n .map(x => Pattern.getLiteral(x))\n .filter(x => !foundGlob && !(foundGlob = x === ''));\n this.searchPath = new internal_path_1.Path(searchSegments).toString();\n // Root RegExp (required when determining partial match)\n this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n this.isImplicitPattern = isImplicitPattern;\n // Create minimatch\n const minimatchOptions = {\n dot: true,\n nobrace: true,\n nocase: IS_WINDOWS,\n nocomment: true,\n noext: true,\n nonegate: true\n };\n pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions);\n }\n /**\n * Matches the pattern against the specified path\n */\n match(itemPath) {\n // Last segment is globstar?\n if (this.segments[this.segments.length - 1] === '**') {\n // Normalize slashes\n itemPath = pathHelper.normalizeSeparators(itemPath);\n // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n // Note, this is safe because the constructor ensures the pattern has an absolute root.\n // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n itemPath = `${itemPath}${path.sep}`;\n }\n }\n else {\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n }\n // Match\n if (this.minimatch.match(itemPath)) {\n return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All;\n }\n return internal_match_kind_1.MatchKind.None;\n }\n /**\n * Indicates whether the pattern may match descendants of the specified path\n */\n partialMatch(itemPath) {\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n // matchOne does not handle root path correctly\n if (pathHelper.dirname(itemPath) === itemPath) {\n return this.rootRegExp.test(itemPath);\n }\n return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n }\n /**\n * Escapes glob patterns within a path\n */\n static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }\n /**\n * Normalizes slashes and ensures absolute root\n */\n static fixupPattern(pattern, homedir) {\n // Empty\n assert_1.default(pattern, 'pattern cannot be empty');\n // Must not contain `.` segment, unless first segment\n // Must not contain `..` segment\n const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x));\n assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n // Normalize slashes\n pattern = pathHelper.normalizeSeparators(pattern);\n // Replace leading `.` segment\n if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n }\n // Replace leading `~` segment\n else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n homedir = homedir || os.homedir();\n assert_1.default(homedir, 'Unable to determine HOME directory');\n assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n }\n // Replace relative drive root, e.g. pattern is C: or C:foo\n else if (IS_WINDOWS &&\n (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n if (pattern.length > 2 && !root.endsWith('\\\\')) {\n root += '\\\\';\n }\n pattern = Pattern.globEscape(root) + pattern.substr(2);\n }\n // Replace relative root, e.g. pattern is \\ or \\foo\n else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n if (!root.endsWith('\\\\')) {\n root += '\\\\';\n }\n pattern = Pattern.globEscape(root) + pattern.substr(1);\n }\n // Otherwise ensure absolute root\n else {\n pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n }\n return pathHelper.normalizeSeparators(pattern);\n }\n /**\n * Attempts to unescape a pattern segment to create a literal path segment.\n * Otherwise returns empty string.\n */\n static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }\n /**\n * Escapes regexp special characters\n * https://javascript.info/regexp-escaping\n */\n static regExpEscape(s) {\n return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n }\n}\nexports.Pattern = Pattern;\n//# sourceMappingURL=internal-pattern.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SearchState = void 0;\nclass SearchState {\n constructor(path, level) {\n this.path = path;\n this.level = level;\n }\n}\nexports.SearchState = SearchState;\n//# sourceMappingURL=internal-search-state.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' +\n Buffer.from(this.username + ':' + this.password).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] = 'Bearer ' + this.token;\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n options.headers['Authorization'] =\n 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');\n }\n // This handler cannot handle 401\n canHandleAuthentication(response) {\n return false;\n }\n handleAuthentication(httpClient, requestInfo, objs) {\n return null;\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst pm = require(\"./proxy\");\nlet tunnel;\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n let proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return new Promise(async (resolve, reject) => {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n let parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n }\n get(requestUrl, additionalHeaders) {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n }\n del(requestUrl, additionalHeaders) {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n }\n post(requestUrl, data, additionalHeaders) {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n }\n patch(requestUrl, data, additionalHeaders) {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n }\n put(requestUrl, data, additionalHeaders) {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n }\n head(requestUrl, additionalHeaders) {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n async getJson(requestUrl, additionalHeaders = {}) {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n let res = await this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async postJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async putJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n async patchJson(requestUrl, obj, additionalHeaders = {}) {\n let data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n let res = await this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n async request(verb, requestUrl, data, headers) {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n let parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n let maxTries = this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n while (numTries < maxTries) {\n response = await this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (let i = 0; i < this.handlers.length; i++) {\n if (this.handlers[i].canHandleAuthentication(response)) {\n authenticationHandler = this.handlers[i];\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1 &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n let parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol == 'https:' &&\n parsedUrl.protocol != parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n await response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (let header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = await this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n await response.readBody();\n await this._performExponentialBackoff(numTries);\n }\n }\n return response;\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return new Promise((resolve, reject) => {\n let callbackForResult = function (err, res) {\n if (err) {\n reject(err);\n }\n resolve(res);\n };\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n let socket;\n if (typeof data === 'string') {\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n let handleResult = (err, res) => {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n };\n let req = info.httpModule.request(info.options, (msg) => {\n let res = new HttpClientResponse(msg);\n handleResult(null, res);\n });\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error('Request timeout: ' + info.options.path), null);\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err, null);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n let parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n this.handlers.forEach(handler => {\n handler.prepareRequest(info.options);\n });\n }\n return info;\n }\n _mergeHeaders(headers) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n let proxyUrl = pm.getProxyUrl(parsedUrl);\n let useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (!!agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (!!this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n if (useProxy) {\n // If using proxy, need tunnel\n if (!tunnel) {\n tunnel = require('tunnel');\n }\n const agentOptions = {\n maxSockets: maxSockets,\n keepAlive: this._keepAlive,\n proxy: {\n ...((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n }),\n host: proxyUrl.hostname,\n port: proxyUrl.port\n }\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n }\n static dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n let a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n async _processResponse(res, options) {\n return new Promise(async (resolve, reject) => {\n const statusCode = res.message.statusCode;\n const response = {\n statusCode: statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode == HttpCodes.NotFound) {\n resolve(response);\n }\n let obj;\n let contents;\n // get the result from the body\n try {\n contents = await res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = 'Failed request: (' + statusCode + ')';\n }\n let err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n });\n }\n}\nexports.HttpClient = HttpClient;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction getProxyUrl(reqUrl) {\n let usingSsl = reqUrl.protocol === 'https:';\n let proxyUrl;\n if (checkBypass(reqUrl)) {\n return proxyUrl;\n }\n let proxyVar;\n if (usingSsl) {\n proxyVar = process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n proxyVar = process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n if (proxyVar) {\n proxyUrl = new URL(proxyVar);\n }\n return proxyUrl;\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n let noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n let upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (let upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperReqHosts.some(x => x === upperNoProxyItem)) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.5.1\";\n\nconst _excluded = [\"authStrategy\"];\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, _excluded);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.12\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.8.0\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst VERSION = \"2.17.0\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\n/**\n * Some “list” response that can be paginated have a different response structure\n *\n * They have a `total_count` key in the response (search also has `incomplete_results`,\n * /installation/repositories also has `repository_selection`), as well as a key with\n * the list of the items which name varies from endpoint to endpoint.\n *\n * Octokit normalizes these responses so that paginated results are always returned following\n * the same structure. One challenge is that if the list response has only one page, no Link\n * header is provided, so this header alone is not sufficient to check wether a response is\n * paginated or not.\n *\n * We check if a \"total_count\" key is present in the response data, but also make sure that\n * a \"url\" property is not, as the \"Get the combined status for a specific ref\" endpoint would\n * otherwise match: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref\n */\nfunction normalizePaginatedListResponse(response) {\n // endpoints can respond with 204 if repository is empty\n if (!response.data) {\n return _objectSpread2(_objectSpread2({}, response), {}, {\n data: []\n });\n }\n\n const responseNeedsNormalization = \"total_count\" in response.data && !(\"url\" in response.data);\n if (!responseNeedsNormalization) return response; // keep the additional properties intact as there is currently no other way\n // to retrieve the same information.\n\n const incompleteResults = response.data.incomplete_results;\n const repositorySelection = response.data.repository_selection;\n const totalCount = response.data.total_count;\n delete response.data.incomplete_results;\n delete response.data.repository_selection;\n delete response.data.total_count;\n const namespaceKey = Object.keys(response.data)[0];\n const data = response.data[namespaceKey];\n response.data = data;\n\n if (typeof incompleteResults !== \"undefined\") {\n response.data.incomplete_results = incompleteResults;\n }\n\n if (typeof repositorySelection !== \"undefined\") {\n response.data.repository_selection = repositorySelection;\n }\n\n response.data.total_count = totalCount;\n return response;\n}\n\nfunction iterator(octokit, route, parameters) {\n const options = typeof route === \"function\" ? route.endpoint(parameters) : octokit.request.endpoint(route, parameters);\n const requestMethod = typeof route === \"function\" ? route : octokit.request;\n const method = options.method;\n const headers = options.headers;\n let url = options.url;\n return {\n [Symbol.asyncIterator]: () => ({\n async next() {\n if (!url) return {\n done: true\n };\n\n try {\n const response = await requestMethod({\n method,\n url,\n headers\n });\n const normalizedResponse = normalizePaginatedListResponse(response); // `response.headers.link` format:\n // '; rel=\"next\", ; rel=\"last\"'\n // sets `url` to undefined if \"next\" URL is not present or `link` header is not set\n\n url = ((normalizedResponse.headers.link || \"\").match(/<([^>]+)>;\\s*rel=\"next\"/) || [])[1];\n return {\n value: normalizedResponse\n };\n } catch (error) {\n if (error.status !== 409) throw error;\n url = \"\";\n return {\n value: {\n status: 200,\n headers: {},\n data: []\n }\n };\n }\n }\n\n })\n };\n}\n\nfunction paginate(octokit, route, parameters, mapFn) {\n if (typeof parameters === \"function\") {\n mapFn = parameters;\n parameters = undefined;\n }\n\n return gather(octokit, [], iterator(octokit, route, parameters)[Symbol.asyncIterator](), mapFn);\n}\n\nfunction gather(octokit, results, iterator, mapFn) {\n return iterator.next().then(result => {\n if (result.done) {\n return results;\n }\n\n let earlyExit = false;\n\n function done() {\n earlyExit = true;\n }\n\n results = results.concat(mapFn ? mapFn(result.value, done) : result.value.data);\n\n if (earlyExit) {\n return results;\n }\n\n return gather(octokit, results, iterator, mapFn);\n });\n}\n\nconst composePaginateRest = Object.assign(paginate, {\n iterator\n});\n\nconst paginatingEndpoints = [\"GET /app/hook/deliveries\", \"GET /app/installations\", \"GET /applications/grants\", \"GET /authorizations\", \"GET /enterprises/{enterprise}/actions/permissions/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations\", \"GET /enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners\", \"GET /enterprises/{enterprise}/actions/runners\", \"GET /enterprises/{enterprise}/actions/runners/downloads\", \"GET /events\", \"GET /gists\", \"GET /gists/public\", \"GET /gists/starred\", \"GET /gists/{gist_id}/comments\", \"GET /gists/{gist_id}/commits\", \"GET /gists/{gist_id}/forks\", \"GET /installation/repositories\", \"GET /issues\", \"GET /marketplace_listing/plans\", \"GET /marketplace_listing/plans/{plan_id}/accounts\", \"GET /marketplace_listing/stubbed/plans\", \"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\", \"GET /networks/{owner}/{repo}/events\", \"GET /notifications\", \"GET /organizations\", \"GET /orgs/{org}/actions/permissions/repositories\", \"GET /orgs/{org}/actions/runner-groups\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/repositories\", \"GET /orgs/{org}/actions/runner-groups/{runner_group_id}/runners\", \"GET /orgs/{org}/actions/runners\", \"GET /orgs/{org}/actions/runners/downloads\", \"GET /orgs/{org}/actions/secrets\", \"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\", \"GET /orgs/{org}/blocks\", \"GET /orgs/{org}/credential-authorizations\", \"GET /orgs/{org}/events\", \"GET /orgs/{org}/failed_invitations\", \"GET /orgs/{org}/hooks\", \"GET /orgs/{org}/hooks/{hook_id}/deliveries\", \"GET /orgs/{org}/installations\", \"GET /orgs/{org}/invitations\", \"GET /orgs/{org}/invitations/{invitation_id}/teams\", \"GET /orgs/{org}/issues\", \"GET /orgs/{org}/members\", \"GET /orgs/{org}/migrations\", \"GET /orgs/{org}/migrations/{migration_id}/repositories\", \"GET /orgs/{org}/outside_collaborators\", \"GET /orgs/{org}/packages\", \"GET /orgs/{org}/projects\", \"GET /orgs/{org}/public_members\", \"GET /orgs/{org}/repos\", \"GET /orgs/{org}/secret-scanning/alerts\", \"GET /orgs/{org}/team-sync/groups\", \"GET /orgs/{org}/teams\", \"GET /orgs/{org}/teams/{team_slug}/discussions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\", \"GET /orgs/{org}/teams/{team_slug}/invitations\", \"GET /orgs/{org}/teams/{team_slug}/members\", \"GET /orgs/{org}/teams/{team_slug}/projects\", \"GET /orgs/{org}/teams/{team_slug}/repos\", \"GET /orgs/{org}/teams/{team_slug}/team-sync/group-mappings\", \"GET /orgs/{org}/teams/{team_slug}/teams\", \"GET /projects/columns/{column_id}/cards\", \"GET /projects/{project_id}/collaborators\", \"GET /projects/{project_id}/columns\", \"GET /repos/{owner}/{repo}/actions/artifacts\", \"GET /repos/{owner}/{repo}/actions/runners\", \"GET /repos/{owner}/{repo}/actions/runners/downloads\", \"GET /repos/{owner}/{repo}/actions/runs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\", \"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\", \"GET /repos/{owner}/{repo}/actions/secrets\", \"GET /repos/{owner}/{repo}/actions/workflows\", \"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\", \"GET /repos/{owner}/{repo}/assignees\", \"GET /repos/{owner}/{repo}/autolinks\", \"GET /repos/{owner}/{repo}/branches\", \"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\", \"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\", \"GET /repos/{owner}/{repo}/code-scanning/alerts\", \"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", \"GET /repos/{owner}/{repo}/code-scanning/analyses\", \"GET /repos/{owner}/{repo}/collaborators\", \"GET /repos/{owner}/{repo}/comments\", \"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/commits\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\", \"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\", \"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\", \"GET /repos/{owner}/{repo}/commits/{ref}/statuses\", \"GET /repos/{owner}/{repo}/contributors\", \"GET /repos/{owner}/{repo}/deployments\", \"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\", \"GET /repos/{owner}/{repo}/events\", \"GET /repos/{owner}/{repo}/forks\", \"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\", \"GET /repos/{owner}/{repo}/hooks\", \"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\", \"GET /repos/{owner}/{repo}/invitations\", \"GET /repos/{owner}/{repo}/issues\", \"GET /repos/{owner}/{repo}/issues/comments\", \"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/issues/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/events\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\", \"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\", \"GET /repos/{owner}/{repo}/keys\", \"GET /repos/{owner}/{repo}/labels\", \"GET /repos/{owner}/{repo}/milestones\", \"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\", \"GET /repos/{owner}/{repo}/notifications\", \"GET /repos/{owner}/{repo}/pages/builds\", \"GET /repos/{owner}/{repo}/projects\", \"GET /repos/{owner}/{repo}/pulls\", \"GET /repos/{owner}/{repo}/pulls/comments\", \"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\", \"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\", \"GET /repos/{owner}/{repo}/releases\", \"GET /repos/{owner}/{repo}/releases/{release_id}/assets\", \"GET /repos/{owner}/{repo}/secret-scanning/alerts\", \"GET /repos/{owner}/{repo}/stargazers\", \"GET /repos/{owner}/{repo}/subscribers\", \"GET /repos/{owner}/{repo}/tags\", \"GET /repos/{owner}/{repo}/teams\", \"GET /repositories\", \"GET /repositories/{repository_id}/environments/{environment_name}/secrets\", \"GET /scim/v2/enterprises/{enterprise}/Groups\", \"GET /scim/v2/enterprises/{enterprise}/Users\", \"GET /scim/v2/organizations/{org}/Users\", \"GET /search/code\", \"GET /search/commits\", \"GET /search/issues\", \"GET /search/labels\", \"GET /search/repositories\", \"GET /search/topics\", \"GET /search/users\", \"GET /teams/{team_id}/discussions\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments\", \"GET /teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions\", \"GET /teams/{team_id}/discussions/{discussion_number}/reactions\", \"GET /teams/{team_id}/invitations\", \"GET /teams/{team_id}/members\", \"GET /teams/{team_id}/projects\", \"GET /teams/{team_id}/repos\", \"GET /teams/{team_id}/team-sync/group-mappings\", \"GET /teams/{team_id}/teams\", \"GET /user/blocks\", \"GET /user/emails\", \"GET /user/followers\", \"GET /user/following\", \"GET /user/gpg_keys\", \"GET /user/installations\", \"GET /user/installations/{installation_id}/repositories\", \"GET /user/issues\", \"GET /user/keys\", \"GET /user/marketplace_purchases\", \"GET /user/marketplace_purchases/stubbed\", \"GET /user/memberships/orgs\", \"GET /user/migrations\", \"GET /user/migrations/{migration_id}/repositories\", \"GET /user/orgs\", \"GET /user/packages\", \"GET /user/public_emails\", \"GET /user/repos\", \"GET /user/repository_invitations\", \"GET /user/starred\", \"GET /user/subscriptions\", \"GET /user/teams\", \"GET /users\", \"GET /users/{username}/events\", \"GET /users/{username}/events/orgs/{org}\", \"GET /users/{username}/events/public\", \"GET /users/{username}/followers\", \"GET /users/{username}/following\", \"GET /users/{username}/gists\", \"GET /users/{username}/gpg_keys\", \"GET /users/{username}/keys\", \"GET /users/{username}/orgs\", \"GET /users/{username}/packages\", \"GET /users/{username}/projects\", \"GET /users/{username}/received_events\", \"GET /users/{username}/received_events/public\", \"GET /users/{username}/repos\", \"GET /users/{username}/starred\", \"GET /users/{username}/subscriptions\"];\n\nfunction isPaginatingEndpoint(arg) {\n if (typeof arg === \"string\") {\n return paginatingEndpoints.includes(arg);\n } else {\n return false;\n }\n}\n\n/**\n * @param octokit Octokit instance\n * @param options Options passed to Octokit constructor\n */\n\nfunction paginateRest(octokit) {\n return {\n paginate: Object.assign(paginate.bind(null, octokit), {\n iterator: iterator.bind(null, octokit)\n })\n };\n}\npaginateRest.VERSION = VERSION;\n\nexports.composePaginateRest = composePaginateRest;\nexports.isPaginatingEndpoint = isPaginatingEndpoint;\nexports.paginateRest = paginateRest;\nexports.paginatingEndpoints = paginatingEndpoints;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (enumerableOnly) {\n symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n }\n\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nconst Endpoints = {\n actions: {\n addSelectedRepoToOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n approveWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/approve\"],\n cancelWorkflowRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel\"],\n createOrUpdateEnvironmentSecret: [\"PUT /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n createOrUpdateOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}\"],\n createOrUpdateRepoSecret: [\"PUT /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n createRegistrationTokenForOrg: [\"POST /orgs/{org}/actions/runners/registration-token\"],\n createRegistrationTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/registration-token\"],\n createRemoveTokenForOrg: [\"POST /orgs/{org}/actions/runners/remove-token\"],\n createRemoveTokenForRepo: [\"POST /repos/{owner}/{repo}/actions/runners/remove-token\"],\n createWorkflowDispatch: [\"POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches\"],\n deleteArtifact: [\"DELETE /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n deleteEnvironmentSecret: [\"DELETE /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n deleteOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}\"],\n deleteRepoSecret: [\"DELETE /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n deleteSelfHostedRunnerFromOrg: [\"DELETE /orgs/{org}/actions/runners/{runner_id}\"],\n deleteSelfHostedRunnerFromRepo: [\"DELETE /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n deleteWorkflowRun: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n deleteWorkflowRunLogs: [\"DELETE /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n disableSelectedRepositoryGithubActionsOrganization: [\"DELETE /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n disableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable\"],\n downloadArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}\"],\n downloadJobLogsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}/logs\"],\n downloadWorkflowRunAttemptLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs\"],\n downloadWorkflowRunLogs: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/logs\"],\n enableSelectedRepositoryGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories/{repository_id}\"],\n enableWorkflow: [\"PUT /repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable\"],\n getAllowedActionsOrganization: [\"GET /orgs/{org}/actions/permissions/selected-actions\"],\n getAllowedActionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n getArtifact: [\"GET /repos/{owner}/{repo}/actions/artifacts/{artifact_id}\"],\n getEnvironmentPublicKey: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/public-key\"],\n getEnvironmentSecret: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets/{secret_name}\"],\n getGithubActionsPermissionsOrganization: [\"GET /orgs/{org}/actions/permissions\"],\n getGithubActionsPermissionsRepository: [\"GET /repos/{owner}/{repo}/actions/permissions\"],\n getJobForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/jobs/{job_id}\"],\n getOrgPublicKey: [\"GET /orgs/{org}/actions/secrets/public-key\"],\n getOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}\"],\n getPendingDeploymentsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n getRepoPermissions: [\"GET /repos/{owner}/{repo}/actions/permissions\", {}, {\n renamed: [\"actions\", \"getGithubActionsPermissionsRepository\"]\n }],\n getRepoPublicKey: [\"GET /repos/{owner}/{repo}/actions/secrets/public-key\"],\n getRepoSecret: [\"GET /repos/{owner}/{repo}/actions/secrets/{secret_name}\"],\n getReviewsForRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/approvals\"],\n getSelfHostedRunnerForOrg: [\"GET /orgs/{org}/actions/runners/{runner_id}\"],\n getSelfHostedRunnerForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/{runner_id}\"],\n getWorkflow: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}\"],\n getWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}\"],\n getWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}\"],\n getWorkflowRunUsage: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/timing\"],\n getWorkflowUsage: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing\"],\n listArtifactsForRepo: [\"GET /repos/{owner}/{repo}/actions/artifacts\"],\n listEnvironmentSecrets: [\"GET /repositories/{repository_id}/environments/{environment_name}/secrets\"],\n listJobsForWorkflowRun: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/jobs\"],\n listJobsForWorkflowRunAttempt: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs\"],\n listOrgSecrets: [\"GET /orgs/{org}/actions/secrets\"],\n listRepoSecrets: [\"GET /repos/{owner}/{repo}/actions/secrets\"],\n listRepoWorkflows: [\"GET /repos/{owner}/{repo}/actions/workflows\"],\n listRunnerApplicationsForOrg: [\"GET /orgs/{org}/actions/runners/downloads\"],\n listRunnerApplicationsForRepo: [\"GET /repos/{owner}/{repo}/actions/runners/downloads\"],\n listSelectedReposForOrgSecret: [\"GET /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n listSelectedRepositoriesEnabledGithubActionsOrganization: [\"GET /orgs/{org}/actions/permissions/repositories\"],\n listSelfHostedRunnersForOrg: [\"GET /orgs/{org}/actions/runners\"],\n listSelfHostedRunnersForRepo: [\"GET /repos/{owner}/{repo}/actions/runners\"],\n listWorkflowRunArtifacts: [\"GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts\"],\n listWorkflowRuns: [\"GET /repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs\"],\n listWorkflowRunsForRepo: [\"GET /repos/{owner}/{repo}/actions/runs\"],\n removeSelectedRepoFromOrgSecret: [\"DELETE /orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}\"],\n reviewPendingDeploymentsForRun: [\"POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments\"],\n setAllowedActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/selected-actions\"],\n setAllowedActionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsOrganization: [\"PUT /orgs/{org}/actions/permissions\"],\n setGithubActionsPermissionsRepository: [\"PUT /repos/{owner}/{repo}/actions/permissions\"],\n setSelectedReposForOrgSecret: [\"PUT /orgs/{org}/actions/secrets/{secret_name}/repositories\"],\n setSelectedRepositoriesEnabledGithubActionsOrganization: [\"PUT /orgs/{org}/actions/permissions/repositories\"]\n },\n activity: {\n checkRepoIsStarredByAuthenticatedUser: [\"GET /user/starred/{owner}/{repo}\"],\n deleteRepoSubscription: [\"DELETE /repos/{owner}/{repo}/subscription\"],\n deleteThreadSubscription: [\"DELETE /notifications/threads/{thread_id}/subscription\"],\n getFeeds: [\"GET /feeds\"],\n getRepoSubscription: [\"GET /repos/{owner}/{repo}/subscription\"],\n getThread: [\"GET /notifications/threads/{thread_id}\"],\n getThreadSubscriptionForAuthenticatedUser: [\"GET /notifications/threads/{thread_id}/subscription\"],\n listEventsForAuthenticatedUser: [\"GET /users/{username}/events\"],\n listNotificationsForAuthenticatedUser: [\"GET /notifications\"],\n listOrgEventsForAuthenticatedUser: [\"GET /users/{username}/events/orgs/{org}\"],\n listPublicEvents: [\"GET /events\"],\n listPublicEventsForRepoNetwork: [\"GET /networks/{owner}/{repo}/events\"],\n listPublicEventsForUser: [\"GET /users/{username}/events/public\"],\n listPublicOrgEvents: [\"GET /orgs/{org}/events\"],\n listReceivedEventsForUser: [\"GET /users/{username}/received_events\"],\n listReceivedPublicEventsForUser: [\"GET /users/{username}/received_events/public\"],\n listRepoEvents: [\"GET /repos/{owner}/{repo}/events\"],\n listRepoNotificationsForAuthenticatedUser: [\"GET /repos/{owner}/{repo}/notifications\"],\n listReposStarredByAuthenticatedUser: [\"GET /user/starred\"],\n listReposStarredByUser: [\"GET /users/{username}/starred\"],\n listReposWatchedByUser: [\"GET /users/{username}/subscriptions\"],\n listStargazersForRepo: [\"GET /repos/{owner}/{repo}/stargazers\"],\n listWatchedReposForAuthenticatedUser: [\"GET /user/subscriptions\"],\n listWatchersForRepo: [\"GET /repos/{owner}/{repo}/subscribers\"],\n markNotificationsAsRead: [\"PUT /notifications\"],\n markRepoNotificationsAsRead: [\"PUT /repos/{owner}/{repo}/notifications\"],\n markThreadAsRead: [\"PATCH /notifications/threads/{thread_id}\"],\n setRepoSubscription: [\"PUT /repos/{owner}/{repo}/subscription\"],\n setThreadSubscription: [\"PUT /notifications/threads/{thread_id}/subscription\"],\n starRepoForAuthenticatedUser: [\"PUT /user/starred/{owner}/{repo}\"],\n unstarRepoForAuthenticatedUser: [\"DELETE /user/starred/{owner}/{repo}\"]\n },\n apps: {\n addRepoToInstallation: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"addRepoToInstallationForAuthenticatedUser\"]\n }],\n addRepoToInstallationForAuthenticatedUser: [\"PUT /user/installations/{installation_id}/repositories/{repository_id}\"],\n checkToken: [\"POST /applications/{client_id}/token\"],\n createContentAttachment: [\"POST /content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createContentAttachmentForRepo: [\"POST /repos/{owner}/{repo}/content_references/{content_reference_id}/attachments\", {\n mediaType: {\n previews: [\"corsair\"]\n }\n }],\n createFromManifest: [\"POST /app-manifests/{code}/conversions\"],\n createInstallationAccessToken: [\"POST /app/installations/{installation_id}/access_tokens\"],\n deleteAuthorization: [\"DELETE /applications/{client_id}/grant\"],\n deleteInstallation: [\"DELETE /app/installations/{installation_id}\"],\n deleteToken: [\"DELETE /applications/{client_id}/token\"],\n getAuthenticated: [\"GET /app\"],\n getBySlug: [\"GET /apps/{app_slug}\"],\n getInstallation: [\"GET /app/installations/{installation_id}\"],\n getOrgInstallation: [\"GET /orgs/{org}/installation\"],\n getRepoInstallation: [\"GET /repos/{owner}/{repo}/installation\"],\n getSubscriptionPlanForAccount: [\"GET /marketplace_listing/accounts/{account_id}\"],\n getSubscriptionPlanForAccountStubbed: [\"GET /marketplace_listing/stubbed/accounts/{account_id}\"],\n getUserInstallation: [\"GET /users/{username}/installation\"],\n getWebhookConfigForApp: [\"GET /app/hook/config\"],\n getWebhookDelivery: [\"GET /app/hook/deliveries/{delivery_id}\"],\n listAccountsForPlan: [\"GET /marketplace_listing/plans/{plan_id}/accounts\"],\n listAccountsForPlanStubbed: [\"GET /marketplace_listing/stubbed/plans/{plan_id}/accounts\"],\n listInstallationReposForAuthenticatedUser: [\"GET /user/installations/{installation_id}/repositories\"],\n listInstallations: [\"GET /app/installations\"],\n listInstallationsForAuthenticatedUser: [\"GET /user/installations\"],\n listPlans: [\"GET /marketplace_listing/plans\"],\n listPlansStubbed: [\"GET /marketplace_listing/stubbed/plans\"],\n listReposAccessibleToInstallation: [\"GET /installation/repositories\"],\n listSubscriptionsForAuthenticatedUser: [\"GET /user/marketplace_purchases\"],\n listSubscriptionsForAuthenticatedUserStubbed: [\"GET /user/marketplace_purchases/stubbed\"],\n listWebhookDeliveries: [\"GET /app/hook/deliveries\"],\n redeliverWebhookDelivery: [\"POST /app/hook/deliveries/{delivery_id}/attempts\"],\n removeRepoFromInstallation: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\", {}, {\n renamed: [\"apps\", \"removeRepoFromInstallationForAuthenticatedUser\"]\n }],\n removeRepoFromInstallationForAuthenticatedUser: [\"DELETE /user/installations/{installation_id}/repositories/{repository_id}\"],\n resetToken: [\"PATCH /applications/{client_id}/token\"],\n revokeInstallationAccessToken: [\"DELETE /installation/token\"],\n scopeToken: [\"POST /applications/{client_id}/token/scoped\"],\n suspendInstallation: [\"PUT /app/installations/{installation_id}/suspended\"],\n unsuspendInstallation: [\"DELETE /app/installations/{installation_id}/suspended\"],\n updateWebhookConfigForApp: [\"PATCH /app/hook/config\"]\n },\n billing: {\n getGithubActionsBillingOrg: [\"GET /orgs/{org}/settings/billing/actions\"],\n getGithubActionsBillingUser: [\"GET /users/{username}/settings/billing/actions\"],\n getGithubPackagesBillingOrg: [\"GET /orgs/{org}/settings/billing/packages\"],\n getGithubPackagesBillingUser: [\"GET /users/{username}/settings/billing/packages\"],\n getSharedStorageBillingOrg: [\"GET /orgs/{org}/settings/billing/shared-storage\"],\n getSharedStorageBillingUser: [\"GET /users/{username}/settings/billing/shared-storage\"]\n },\n checks: {\n create: [\"POST /repos/{owner}/{repo}/check-runs\"],\n createSuite: [\"POST /repos/{owner}/{repo}/check-suites\"],\n get: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}\"],\n getSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}\"],\n listAnnotations: [\"GET /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations\"],\n listForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-runs\"],\n listForSuite: [\"GET /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs\"],\n listSuitesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/check-suites\"],\n rerequestRun: [\"POST /repos/{owner}/{repo}/check-runs/{check_run_id}/rerequest\"],\n rerequestSuite: [\"POST /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest\"],\n setSuitesPreferences: [\"PATCH /repos/{owner}/{repo}/check-suites/preferences\"],\n update: [\"PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}\"]\n },\n codeScanning: {\n deleteAnalysis: [\"DELETE /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}{?confirm_delete}\"],\n getAlert: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\", {}, {\n renamedParameters: {\n alert_id: \"alert_number\"\n }\n }],\n getAnalysis: [\"GET /repos/{owner}/{repo}/code-scanning/analyses/{analysis_id}\"],\n getSarif: [\"GET /repos/{owner}/{repo}/code-scanning/sarifs/{sarif_id}\"],\n listAlertInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/code-scanning/alerts\"],\n listAlertsInstances: [\"GET /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/instances\", {}, {\n renamed: [\"codeScanning\", \"listAlertInstances\"]\n }],\n listRecentAnalyses: [\"GET /repos/{owner}/{repo}/code-scanning/analyses\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}\"],\n uploadSarif: [\"POST /repos/{owner}/{repo}/code-scanning/sarifs\"]\n },\n codesOfConduct: {\n getAllCodesOfConduct: [\"GET /codes_of_conduct\"],\n getConductCode: [\"GET /codes_of_conduct/{key}\"]\n },\n emojis: {\n get: [\"GET /emojis\"]\n },\n enterpriseAdmin: {\n disableSelectedOrganizationGithubActionsEnterprise: [\"DELETE /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n enableSelectedOrganizationGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations/{org_id}\"],\n getAllowedActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n getGithubActionsPermissionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions\"],\n listSelectedOrganizationsEnabledGithubActionsEnterprise: [\"GET /enterprises/{enterprise}/actions/permissions/organizations\"],\n setAllowedActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/selected-actions\"],\n setGithubActionsPermissionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions\"],\n setSelectedOrganizationsEnabledGithubActionsEnterprise: [\"PUT /enterprises/{enterprise}/actions/permissions/organizations\"]\n },\n gists: {\n checkIsStarred: [\"GET /gists/{gist_id}/star\"],\n create: [\"POST /gists\"],\n createComment: [\"POST /gists/{gist_id}/comments\"],\n delete: [\"DELETE /gists/{gist_id}\"],\n deleteComment: [\"DELETE /gists/{gist_id}/comments/{comment_id}\"],\n fork: [\"POST /gists/{gist_id}/forks\"],\n get: [\"GET /gists/{gist_id}\"],\n getComment: [\"GET /gists/{gist_id}/comments/{comment_id}\"],\n getRevision: [\"GET /gists/{gist_id}/{sha}\"],\n list: [\"GET /gists\"],\n listComments: [\"GET /gists/{gist_id}/comments\"],\n listCommits: [\"GET /gists/{gist_id}/commits\"],\n listForUser: [\"GET /users/{username}/gists\"],\n listForks: [\"GET /gists/{gist_id}/forks\"],\n listPublic: [\"GET /gists/public\"],\n listStarred: [\"GET /gists/starred\"],\n star: [\"PUT /gists/{gist_id}/star\"],\n unstar: [\"DELETE /gists/{gist_id}/star\"],\n update: [\"PATCH /gists/{gist_id}\"],\n updateComment: [\"PATCH /gists/{gist_id}/comments/{comment_id}\"]\n },\n git: {\n createBlob: [\"POST /repos/{owner}/{repo}/git/blobs\"],\n createCommit: [\"POST /repos/{owner}/{repo}/git/commits\"],\n createRef: [\"POST /repos/{owner}/{repo}/git/refs\"],\n createTag: [\"POST /repos/{owner}/{repo}/git/tags\"],\n createTree: [\"POST /repos/{owner}/{repo}/git/trees\"],\n deleteRef: [\"DELETE /repos/{owner}/{repo}/git/refs/{ref}\"],\n getBlob: [\"GET /repos/{owner}/{repo}/git/blobs/{file_sha}\"],\n getCommit: [\"GET /repos/{owner}/{repo}/git/commits/{commit_sha}\"],\n getRef: [\"GET /repos/{owner}/{repo}/git/ref/{ref}\"],\n getTag: [\"GET /repos/{owner}/{repo}/git/tags/{tag_sha}\"],\n getTree: [\"GET /repos/{owner}/{repo}/git/trees/{tree_sha}\"],\n listMatchingRefs: [\"GET /repos/{owner}/{repo}/git/matching-refs/{ref}\"],\n updateRef: [\"PATCH /repos/{owner}/{repo}/git/refs/{ref}\"]\n },\n gitignore: {\n getAllTemplates: [\"GET /gitignore/templates\"],\n getTemplate: [\"GET /gitignore/templates/{name}\"]\n },\n interactions: {\n getRestrictionsForAuthenticatedUser: [\"GET /user/interaction-limits\"],\n getRestrictionsForOrg: [\"GET /orgs/{org}/interaction-limits\"],\n getRestrictionsForRepo: [\"GET /repos/{owner}/{repo}/interaction-limits\"],\n getRestrictionsForYourPublicRepos: [\"GET /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"getRestrictionsForAuthenticatedUser\"]\n }],\n removeRestrictionsForAuthenticatedUser: [\"DELETE /user/interaction-limits\"],\n removeRestrictionsForOrg: [\"DELETE /orgs/{org}/interaction-limits\"],\n removeRestrictionsForRepo: [\"DELETE /repos/{owner}/{repo}/interaction-limits\"],\n removeRestrictionsForYourPublicRepos: [\"DELETE /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"removeRestrictionsForAuthenticatedUser\"]\n }],\n setRestrictionsForAuthenticatedUser: [\"PUT /user/interaction-limits\"],\n setRestrictionsForOrg: [\"PUT /orgs/{org}/interaction-limits\"],\n setRestrictionsForRepo: [\"PUT /repos/{owner}/{repo}/interaction-limits\"],\n setRestrictionsForYourPublicRepos: [\"PUT /user/interaction-limits\", {}, {\n renamed: [\"interactions\", \"setRestrictionsForAuthenticatedUser\"]\n }]\n },\n issues: {\n addAssignees: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n addLabels: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n checkUserCanBeAssigned: [\"GET /repos/{owner}/{repo}/assignees/{assignee}\"],\n create: [\"POST /repos/{owner}/{repo}/issues\"],\n createComment: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n createLabel: [\"POST /repos/{owner}/{repo}/labels\"],\n createMilestone: [\"POST /repos/{owner}/{repo}/milestones\"],\n deleteComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n deleteLabel: [\"DELETE /repos/{owner}/{repo}/labels/{name}\"],\n deleteMilestone: [\"DELETE /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n get: [\"GET /repos/{owner}/{repo}/issues/{issue_number}\"],\n getComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n getEvent: [\"GET /repos/{owner}/{repo}/issues/events/{event_id}\"],\n getLabel: [\"GET /repos/{owner}/{repo}/labels/{name}\"],\n getMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}\"],\n list: [\"GET /issues\"],\n listAssignees: [\"GET /repos/{owner}/{repo}/assignees\"],\n listComments: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/comments\"],\n listCommentsForRepo: [\"GET /repos/{owner}/{repo}/issues/comments\"],\n listEvents: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/events\"],\n listEventsForRepo: [\"GET /repos/{owner}/{repo}/issues/events\"],\n listEventsForTimeline: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/timeline\"],\n listForAuthenticatedUser: [\"GET /user/issues\"],\n listForOrg: [\"GET /orgs/{org}/issues\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/issues\"],\n listLabelsForMilestone: [\"GET /repos/{owner}/{repo}/milestones/{milestone_number}/labels\"],\n listLabelsForRepo: [\"GET /repos/{owner}/{repo}/labels\"],\n listLabelsOnIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n listMilestones: [\"GET /repos/{owner}/{repo}/milestones\"],\n lock: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n removeAllLabels: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n removeAssignees: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/assignees\"],\n removeLabel: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/labels/{name}\"],\n setLabels: [\"PUT /repos/{owner}/{repo}/issues/{issue_number}/labels\"],\n unlock: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/lock\"],\n update: [\"PATCH /repos/{owner}/{repo}/issues/{issue_number}\"],\n updateComment: [\"PATCH /repos/{owner}/{repo}/issues/comments/{comment_id}\"],\n updateLabel: [\"PATCH /repos/{owner}/{repo}/labels/{name}\"],\n updateMilestone: [\"PATCH /repos/{owner}/{repo}/milestones/{milestone_number}\"]\n },\n licenses: {\n get: [\"GET /licenses/{license}\"],\n getAllCommonlyUsed: [\"GET /licenses\"],\n getForRepo: [\"GET /repos/{owner}/{repo}/license\"]\n },\n markdown: {\n render: [\"POST /markdown\"],\n renderRaw: [\"POST /markdown/raw\", {\n headers: {\n \"content-type\": \"text/plain; charset=utf-8\"\n }\n }]\n },\n meta: {\n get: [\"GET /meta\"],\n getOctocat: [\"GET /octocat\"],\n getZen: [\"GET /zen\"],\n root: [\"GET /\"]\n },\n migrations: {\n cancelImport: [\"DELETE /repos/{owner}/{repo}/import\"],\n deleteArchiveForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/archive\"],\n deleteArchiveForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/archive\"],\n downloadArchiveForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/archive\"],\n getArchiveForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/archive\"],\n getCommitAuthors: [\"GET /repos/{owner}/{repo}/import/authors\"],\n getImportStatus: [\"GET /repos/{owner}/{repo}/import\"],\n getLargeFiles: [\"GET /repos/{owner}/{repo}/import/large_files\"],\n getStatusForAuthenticatedUser: [\"GET /user/migrations/{migration_id}\"],\n getStatusForOrg: [\"GET /orgs/{org}/migrations/{migration_id}\"],\n listForAuthenticatedUser: [\"GET /user/migrations\"],\n listForOrg: [\"GET /orgs/{org}/migrations\"],\n listReposForAuthenticatedUser: [\"GET /user/migrations/{migration_id}/repositories\"],\n listReposForOrg: [\"GET /orgs/{org}/migrations/{migration_id}/repositories\"],\n listReposForUser: [\"GET /user/migrations/{migration_id}/repositories\", {}, {\n renamed: [\"migrations\", \"listReposForAuthenticatedUser\"]\n }],\n mapCommitAuthor: [\"PATCH /repos/{owner}/{repo}/import/authors/{author_id}\"],\n setLfsPreference: [\"PATCH /repos/{owner}/{repo}/import/lfs\"],\n startForAuthenticatedUser: [\"POST /user/migrations\"],\n startForOrg: [\"POST /orgs/{org}/migrations\"],\n startImport: [\"PUT /repos/{owner}/{repo}/import\"],\n unlockRepoForAuthenticatedUser: [\"DELETE /user/migrations/{migration_id}/repos/{repo_name}/lock\"],\n unlockRepoForOrg: [\"DELETE /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock\"],\n updateImport: [\"PATCH /repos/{owner}/{repo}/import\"]\n },\n orgs: {\n blockUser: [\"PUT /orgs/{org}/blocks/{username}\"],\n cancelInvitation: [\"DELETE /orgs/{org}/invitations/{invitation_id}\"],\n checkBlockedUser: [\"GET /orgs/{org}/blocks/{username}\"],\n checkMembershipForUser: [\"GET /orgs/{org}/members/{username}\"],\n checkPublicMembershipForUser: [\"GET /orgs/{org}/public_members/{username}\"],\n convertMemberToOutsideCollaborator: [\"PUT /orgs/{org}/outside_collaborators/{username}\"],\n createInvitation: [\"POST /orgs/{org}/invitations\"],\n createWebhook: [\"POST /orgs/{org}/hooks\"],\n deleteWebhook: [\"DELETE /orgs/{org}/hooks/{hook_id}\"],\n get: [\"GET /orgs/{org}\"],\n getMembershipForAuthenticatedUser: [\"GET /user/memberships/orgs/{org}\"],\n getMembershipForUser: [\"GET /orgs/{org}/memberships/{username}\"],\n getWebhook: [\"GET /orgs/{org}/hooks/{hook_id}\"],\n getWebhookConfigForOrg: [\"GET /orgs/{org}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n list: [\"GET /organizations\"],\n listAppInstallations: [\"GET /orgs/{org}/installations\"],\n listBlockedUsers: [\"GET /orgs/{org}/blocks\"],\n listFailedInvitations: [\"GET /orgs/{org}/failed_invitations\"],\n listForAuthenticatedUser: [\"GET /user/orgs\"],\n listForUser: [\"GET /users/{username}/orgs\"],\n listInvitationTeams: [\"GET /orgs/{org}/invitations/{invitation_id}/teams\"],\n listMembers: [\"GET /orgs/{org}/members\"],\n listMembershipsForAuthenticatedUser: [\"GET /user/memberships/orgs\"],\n listOutsideCollaborators: [\"GET /orgs/{org}/outside_collaborators\"],\n listPendingInvitations: [\"GET /orgs/{org}/invitations\"],\n listPublicMembers: [\"GET /orgs/{org}/public_members\"],\n listWebhookDeliveries: [\"GET /orgs/{org}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /orgs/{org}/hooks\"],\n pingWebhook: [\"POST /orgs/{org}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeMember: [\"DELETE /orgs/{org}/members/{username}\"],\n removeMembershipForUser: [\"DELETE /orgs/{org}/memberships/{username}\"],\n removeOutsideCollaborator: [\"DELETE /orgs/{org}/outside_collaborators/{username}\"],\n removePublicMembershipForAuthenticatedUser: [\"DELETE /orgs/{org}/public_members/{username}\"],\n setMembershipForUser: [\"PUT /orgs/{org}/memberships/{username}\"],\n setPublicMembershipForAuthenticatedUser: [\"PUT /orgs/{org}/public_members/{username}\"],\n unblockUser: [\"DELETE /orgs/{org}/blocks/{username}\"],\n update: [\"PATCH /orgs/{org}\"],\n updateMembershipForAuthenticatedUser: [\"PATCH /user/memberships/orgs/{org}\"],\n updateWebhook: [\"PATCH /orgs/{org}/hooks/{hook_id}\"],\n updateWebhookConfigForOrg: [\"PATCH /orgs/{org}/hooks/{hook_id}/config\"]\n },\n packages: {\n deletePackageForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}\"],\n deletePackageForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}\"],\n deletePackageForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}\"],\n deletePackageVersionForAuthenticatedUser: [\"DELETE /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForOrg: [\"DELETE /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n deletePackageVersionForUser: [\"DELETE /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getAllPackageVersionsForAPackageOwnedByAnOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByOrg\"]\n }],\n getAllPackageVersionsForAPackageOwnedByTheAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\", {}, {\n renamed: [\"packages\", \"getAllPackageVersionsForPackageOwnedByAuthenticatedUser\"]\n }],\n getAllPackageVersionsForPackageOwnedByAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByOrg: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions\"],\n getAllPackageVersionsForPackageOwnedByUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions\"],\n getPackageForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}\"],\n getPackageForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}\"],\n getPackageForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}\"],\n getPackageVersionForAuthenticatedUser: [\"GET /user/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForOrganization: [\"GET /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n getPackageVersionForUser: [\"GET /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}\"],\n listPackagesForAuthenticatedUser: [\"GET /user/packages\"],\n listPackagesForOrganization: [\"GET /orgs/{org}/packages\"],\n listPackagesForUser: [\"GET /users/{username}/packages\"],\n restorePackageForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/restore{?token}\"],\n restorePackageVersionForAuthenticatedUser: [\"POST /user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForOrg: [\"POST /orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"],\n restorePackageVersionForUser: [\"POST /users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore\"]\n },\n projects: {\n addCollaborator: [\"PUT /projects/{project_id}/collaborators/{username}\"],\n createCard: [\"POST /projects/columns/{column_id}/cards\"],\n createColumn: [\"POST /projects/{project_id}/columns\"],\n createForAuthenticatedUser: [\"POST /user/projects\"],\n createForOrg: [\"POST /orgs/{org}/projects\"],\n createForRepo: [\"POST /repos/{owner}/{repo}/projects\"],\n delete: [\"DELETE /projects/{project_id}\"],\n deleteCard: [\"DELETE /projects/columns/cards/{card_id}\"],\n deleteColumn: [\"DELETE /projects/columns/{column_id}\"],\n get: [\"GET /projects/{project_id}\"],\n getCard: [\"GET /projects/columns/cards/{card_id}\"],\n getColumn: [\"GET /projects/columns/{column_id}\"],\n getPermissionForUser: [\"GET /projects/{project_id}/collaborators/{username}/permission\"],\n listCards: [\"GET /projects/columns/{column_id}/cards\"],\n listCollaborators: [\"GET /projects/{project_id}/collaborators\"],\n listColumns: [\"GET /projects/{project_id}/columns\"],\n listForOrg: [\"GET /orgs/{org}/projects\"],\n listForRepo: [\"GET /repos/{owner}/{repo}/projects\"],\n listForUser: [\"GET /users/{username}/projects\"],\n moveCard: [\"POST /projects/columns/cards/{card_id}/moves\"],\n moveColumn: [\"POST /projects/columns/{column_id}/moves\"],\n removeCollaborator: [\"DELETE /projects/{project_id}/collaborators/{username}\"],\n update: [\"PATCH /projects/{project_id}\"],\n updateCard: [\"PATCH /projects/columns/cards/{card_id}\"],\n updateColumn: [\"PATCH /projects/columns/{column_id}\"]\n },\n pulls: {\n checkIfMerged: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n create: [\"POST /repos/{owner}/{repo}/pulls\"],\n createReplyForReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments/{comment_id}/replies\"],\n createReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n createReviewComment: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n deletePendingReview: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n deleteReviewComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n dismissReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/dismissals\"],\n get: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}\"],\n getReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n getReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}\"],\n list: [\"GET /repos/{owner}/{repo}/pulls\"],\n listCommentsForReview: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/comments\"],\n listCommits: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/commits\"],\n listFiles: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/files\"],\n listRequestedReviewers: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n listReviewComments: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/comments\"],\n listReviewCommentsForRepo: [\"GET /repos/{owner}/{repo}/pulls/comments\"],\n listReviews: [\"GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews\"],\n merge: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/merge\"],\n removeRequestedReviewers: [\"DELETE /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n requestReviewers: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers\"],\n submitReview: [\"POST /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}/events\"],\n update: [\"PATCH /repos/{owner}/{repo}/pulls/{pull_number}\"],\n updateBranch: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/update-branch\"],\n updateReview: [\"PUT /repos/{owner}/{repo}/pulls/{pull_number}/reviews/{review_id}\"],\n updateReviewComment: [\"PATCH /repos/{owner}/{repo}/pulls/comments/{comment_id}\"]\n },\n rateLimit: {\n get: [\"GET /rate_limit\"]\n },\n reactions: {\n createForCommitComment: [\"POST /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n createForIssue: [\"POST /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n createForIssueComment: [\"POST /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n createForPullRequestReviewComment: [\"POST /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n createForRelease: [\"POST /repos/{owner}/{repo}/releases/{release_id}/reactions\"],\n createForTeamDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n createForTeamDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"],\n deleteForCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForIssue: [\"DELETE /repos/{owner}/{repo}/issues/{issue_number}/reactions/{reaction_id}\"],\n deleteForIssueComment: [\"DELETE /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForPullRequestComment: [\"DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions/{reaction_id}\"],\n deleteForTeamDiscussion: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}\"],\n deleteForTeamDiscussionComment: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}\"],\n listForCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}/reactions\"],\n listForIssue: [\"GET /repos/{owner}/{repo}/issues/{issue_number}/reactions\"],\n listForIssueComment: [\"GET /repos/{owner}/{repo}/issues/comments/{comment_id}/reactions\"],\n listForPullRequestReviewComment: [\"GET /repos/{owner}/{repo}/pulls/comments/{comment_id}/reactions\"],\n listForTeamDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions\"],\n listForTeamDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions\"]\n },\n repos: {\n acceptInvitation: [\"PATCH /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"acceptInvitationForAuthenticatedUser\"]\n }],\n acceptInvitationForAuthenticatedUser: [\"PATCH /user/repository_invitations/{invitation_id}\"],\n addAppAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n addCollaborator: [\"PUT /repos/{owner}/{repo}/collaborators/{username}\"],\n addStatusCheckContexts: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n addTeamAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n addUserAccessRestrictions: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n checkCollaborator: [\"GET /repos/{owner}/{repo}/collaborators/{username}\"],\n checkVulnerabilityAlerts: [\"GET /repos/{owner}/{repo}/vulnerability-alerts\"],\n compareCommits: [\"GET /repos/{owner}/{repo}/compare/{base}...{head}\"],\n compareCommitsWithBasehead: [\"GET /repos/{owner}/{repo}/compare/{basehead}\"],\n createAutolink: [\"POST /repos/{owner}/{repo}/autolinks\"],\n createCommitComment: [\"POST /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n createCommitSignatureProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n createCommitStatus: [\"POST /repos/{owner}/{repo}/statuses/{sha}\"],\n createDeployKey: [\"POST /repos/{owner}/{repo}/keys\"],\n createDeployment: [\"POST /repos/{owner}/{repo}/deployments\"],\n createDeploymentStatus: [\"POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n createDispatchEvent: [\"POST /repos/{owner}/{repo}/dispatches\"],\n createForAuthenticatedUser: [\"POST /user/repos\"],\n createFork: [\"POST /repos/{owner}/{repo}/forks\"],\n createInOrg: [\"POST /orgs/{org}/repos\"],\n createOrUpdateEnvironment: [\"PUT /repos/{owner}/{repo}/environments/{environment_name}\"],\n createOrUpdateFileContents: [\"PUT /repos/{owner}/{repo}/contents/{path}\"],\n createPagesSite: [\"POST /repos/{owner}/{repo}/pages\"],\n createRelease: [\"POST /repos/{owner}/{repo}/releases\"],\n createUsingTemplate: [\"POST /repos/{template_owner}/{template_repo}/generate\"],\n createWebhook: [\"POST /repos/{owner}/{repo}/hooks\"],\n declineInvitation: [\"DELETE /user/repository_invitations/{invitation_id}\", {}, {\n renamed: [\"repos\", \"declineInvitationForAuthenticatedUser\"]\n }],\n declineInvitationForAuthenticatedUser: [\"DELETE /user/repository_invitations/{invitation_id}\"],\n delete: [\"DELETE /repos/{owner}/{repo}\"],\n deleteAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n deleteAdminBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n deleteAnEnvironment: [\"DELETE /repos/{owner}/{repo}/environments/{environment_name}\"],\n deleteAutolink: [\"DELETE /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n deleteBranchProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection\"],\n deleteCommitComment: [\"DELETE /repos/{owner}/{repo}/comments/{comment_id}\"],\n deleteCommitSignatureProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n deleteDeployKey: [\"DELETE /repos/{owner}/{repo}/keys/{key_id}\"],\n deleteDeployment: [\"DELETE /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n deleteFile: [\"DELETE /repos/{owner}/{repo}/contents/{path}\"],\n deleteInvitation: [\"DELETE /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n deletePagesSite: [\"DELETE /repos/{owner}/{repo}/pages\"],\n deletePullRequestReviewProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n deleteRelease: [\"DELETE /repos/{owner}/{repo}/releases/{release_id}\"],\n deleteReleaseAsset: [\"DELETE /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n deleteWebhook: [\"DELETE /repos/{owner}/{repo}/hooks/{hook_id}\"],\n disableAutomatedSecurityFixes: [\"DELETE /repos/{owner}/{repo}/automated-security-fixes\"],\n disableLfsForRepo: [\"DELETE /repos/{owner}/{repo}/lfs\"],\n disableVulnerabilityAlerts: [\"DELETE /repos/{owner}/{repo}/vulnerability-alerts\"],\n downloadArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\", {}, {\n renamed: [\"repos\", \"downloadZipballArchive\"]\n }],\n downloadTarballArchive: [\"GET /repos/{owner}/{repo}/tarball/{ref}\"],\n downloadZipballArchive: [\"GET /repos/{owner}/{repo}/zipball/{ref}\"],\n enableAutomatedSecurityFixes: [\"PUT /repos/{owner}/{repo}/automated-security-fixes\"],\n enableLfsForRepo: [\"PUT /repos/{owner}/{repo}/lfs\"],\n enableVulnerabilityAlerts: [\"PUT /repos/{owner}/{repo}/vulnerability-alerts\"],\n generateReleaseNotes: [\"POST /repos/{owner}/{repo}/releases/generate-notes\"],\n get: [\"GET /repos/{owner}/{repo}\"],\n getAccessRestrictions: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions\"],\n getAdminBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n getAllEnvironments: [\"GET /repos/{owner}/{repo}/environments\"],\n getAllStatusCheckContexts: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\"],\n getAllTopics: [\"GET /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n getAppsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\"],\n getAutolink: [\"GET /repos/{owner}/{repo}/autolinks/{autolink_id}\"],\n getBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}\"],\n getBranchProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection\"],\n getClones: [\"GET /repos/{owner}/{repo}/traffic/clones\"],\n getCodeFrequencyStats: [\"GET /repos/{owner}/{repo}/stats/code_frequency\"],\n getCollaboratorPermissionLevel: [\"GET /repos/{owner}/{repo}/collaborators/{username}/permission\"],\n getCombinedStatusForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/status\"],\n getCommit: [\"GET /repos/{owner}/{repo}/commits/{ref}\"],\n getCommitActivityStats: [\"GET /repos/{owner}/{repo}/stats/commit_activity\"],\n getCommitComment: [\"GET /repos/{owner}/{repo}/comments/{comment_id}\"],\n getCommitSignatureProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures\"],\n getCommunityProfileMetrics: [\"GET /repos/{owner}/{repo}/community/profile\"],\n getContent: [\"GET /repos/{owner}/{repo}/contents/{path}\"],\n getContributorsStats: [\"GET /repos/{owner}/{repo}/stats/contributors\"],\n getDeployKey: [\"GET /repos/{owner}/{repo}/keys/{key_id}\"],\n getDeployment: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}\"],\n getDeploymentStatus: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses/{status_id}\"],\n getEnvironment: [\"GET /repos/{owner}/{repo}/environments/{environment_name}\"],\n getLatestPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/latest\"],\n getLatestRelease: [\"GET /repos/{owner}/{repo}/releases/latest\"],\n getPages: [\"GET /repos/{owner}/{repo}/pages\"],\n getPagesBuild: [\"GET /repos/{owner}/{repo}/pages/builds/{build_id}\"],\n getPagesHealthCheck: [\"GET /repos/{owner}/{repo}/pages/health\"],\n getParticipationStats: [\"GET /repos/{owner}/{repo}/stats/participation\"],\n getPullRequestReviewProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n getPunchCardStats: [\"GET /repos/{owner}/{repo}/stats/punch_card\"],\n getReadme: [\"GET /repos/{owner}/{repo}/readme\"],\n getReadmeInDirectory: [\"GET /repos/{owner}/{repo}/readme/{dir}\"],\n getRelease: [\"GET /repos/{owner}/{repo}/releases/{release_id}\"],\n getReleaseAsset: [\"GET /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n getReleaseByTag: [\"GET /repos/{owner}/{repo}/releases/tags/{tag}\"],\n getStatusChecksProtection: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n getTeamsWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\"],\n getTopPaths: [\"GET /repos/{owner}/{repo}/traffic/popular/paths\"],\n getTopReferrers: [\"GET /repos/{owner}/{repo}/traffic/popular/referrers\"],\n getUsersWithAccessToProtectedBranch: [\"GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\"],\n getViews: [\"GET /repos/{owner}/{repo}/traffic/views\"],\n getWebhook: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}\"],\n getWebhookConfigForRepo: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n getWebhookDelivery: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}\"],\n listAutolinks: [\"GET /repos/{owner}/{repo}/autolinks\"],\n listBranches: [\"GET /repos/{owner}/{repo}/branches\"],\n listBranchesForHeadCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/branches-where-head\"],\n listCollaborators: [\"GET /repos/{owner}/{repo}/collaborators\"],\n listCommentsForCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/comments\"],\n listCommitCommentsForRepo: [\"GET /repos/{owner}/{repo}/comments\"],\n listCommitStatusesForRef: [\"GET /repos/{owner}/{repo}/commits/{ref}/statuses\"],\n listCommits: [\"GET /repos/{owner}/{repo}/commits\"],\n listContributors: [\"GET /repos/{owner}/{repo}/contributors\"],\n listDeployKeys: [\"GET /repos/{owner}/{repo}/keys\"],\n listDeploymentStatuses: [\"GET /repos/{owner}/{repo}/deployments/{deployment_id}/statuses\"],\n listDeployments: [\"GET /repos/{owner}/{repo}/deployments\"],\n listForAuthenticatedUser: [\"GET /user/repos\"],\n listForOrg: [\"GET /orgs/{org}/repos\"],\n listForUser: [\"GET /users/{username}/repos\"],\n listForks: [\"GET /repos/{owner}/{repo}/forks\"],\n listInvitations: [\"GET /repos/{owner}/{repo}/invitations\"],\n listInvitationsForAuthenticatedUser: [\"GET /user/repository_invitations\"],\n listLanguages: [\"GET /repos/{owner}/{repo}/languages\"],\n listPagesBuilds: [\"GET /repos/{owner}/{repo}/pages/builds\"],\n listPublic: [\"GET /repositories\"],\n listPullRequestsAssociatedWithCommit: [\"GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls\"],\n listReleaseAssets: [\"GET /repos/{owner}/{repo}/releases/{release_id}/assets\"],\n listReleases: [\"GET /repos/{owner}/{repo}/releases\"],\n listTags: [\"GET /repos/{owner}/{repo}/tags\"],\n listTeams: [\"GET /repos/{owner}/{repo}/teams\"],\n listWebhookDeliveries: [\"GET /repos/{owner}/{repo}/hooks/{hook_id}/deliveries\"],\n listWebhooks: [\"GET /repos/{owner}/{repo}/hooks\"],\n merge: [\"POST /repos/{owner}/{repo}/merges\"],\n mergeUpstream: [\"POST /repos/{owner}/{repo}/merge-upstream\"],\n pingWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/pings\"],\n redeliverWebhookDelivery: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/deliveries/{delivery_id}/attempts\"],\n removeAppAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n removeCollaborator: [\"DELETE /repos/{owner}/{repo}/collaborators/{username}\"],\n removeStatusCheckContexts: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n removeStatusCheckProtection: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n removeTeamAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n removeUserAccessRestrictions: [\"DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n renameBranch: [\"POST /repos/{owner}/{repo}/branches/{branch}/rename\"],\n replaceAllTopics: [\"PUT /repos/{owner}/{repo}/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n requestPagesBuild: [\"POST /repos/{owner}/{repo}/pages/builds\"],\n setAdminBranchProtection: [\"POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins\"],\n setAppAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps\", {}, {\n mapToData: \"apps\"\n }],\n setStatusCheckContexts: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts\", {}, {\n mapToData: \"contexts\"\n }],\n setTeamAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams\", {}, {\n mapToData: \"teams\"\n }],\n setUserAccessRestrictions: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users\", {}, {\n mapToData: \"users\"\n }],\n testPushWebhook: [\"POST /repos/{owner}/{repo}/hooks/{hook_id}/tests\"],\n transfer: [\"POST /repos/{owner}/{repo}/transfer\"],\n update: [\"PATCH /repos/{owner}/{repo}\"],\n updateBranchProtection: [\"PUT /repos/{owner}/{repo}/branches/{branch}/protection\"],\n updateCommitComment: [\"PATCH /repos/{owner}/{repo}/comments/{comment_id}\"],\n updateInformationAboutPagesSite: [\"PUT /repos/{owner}/{repo}/pages\"],\n updateInvitation: [\"PATCH /repos/{owner}/{repo}/invitations/{invitation_id}\"],\n updatePullRequestReviewProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews\"],\n updateRelease: [\"PATCH /repos/{owner}/{repo}/releases/{release_id}\"],\n updateReleaseAsset: [\"PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}\"],\n updateStatusCheckPotection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\", {}, {\n renamed: [\"repos\", \"updateStatusCheckProtection\"]\n }],\n updateStatusCheckProtection: [\"PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks\"],\n updateWebhook: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}\"],\n updateWebhookConfigForRepo: [\"PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config\"],\n uploadReleaseAsset: [\"POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}\", {\n baseUrl: \"https://uploads.github.com\"\n }]\n },\n search: {\n code: [\"GET /search/code\"],\n commits: [\"GET /search/commits\"],\n issuesAndPullRequests: [\"GET /search/issues\"],\n labels: [\"GET /search/labels\"],\n repos: [\"GET /search/repositories\"],\n topics: [\"GET /search/topics\", {\n mediaType: {\n previews: [\"mercy\"]\n }\n }],\n users: [\"GET /search/users\"]\n },\n secretScanning: {\n getAlert: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"],\n listAlertsForOrg: [\"GET /orgs/{org}/secret-scanning/alerts\"],\n listAlertsForRepo: [\"GET /repos/{owner}/{repo}/secret-scanning/alerts\"],\n updateAlert: [\"PATCH /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}\"]\n },\n teams: {\n addOrUpdateMembershipForUserInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n addOrUpdateProjectPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n addOrUpdateRepoPermissionsInOrg: [\"PUT /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n checkPermissionsForProjectInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n checkPermissionsForRepoInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n create: [\"POST /orgs/{org}/teams\"],\n createDiscussionCommentInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n createDiscussionInOrg: [\"POST /orgs/{org}/teams/{team_slug}/discussions\"],\n deleteDiscussionCommentInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n deleteDiscussionInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n deleteInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}\"],\n getByName: [\"GET /orgs/{org}/teams/{team_slug}\"],\n getDiscussionCommentInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n getDiscussionInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n getMembershipForUserInOrg: [\"GET /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n list: [\"GET /orgs/{org}/teams\"],\n listChildInOrg: [\"GET /orgs/{org}/teams/{team_slug}/teams\"],\n listDiscussionCommentsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments\"],\n listDiscussionsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/discussions\"],\n listForAuthenticatedUser: [\"GET /user/teams\"],\n listMembersInOrg: [\"GET /orgs/{org}/teams/{team_slug}/members\"],\n listPendingInvitationsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/invitations\"],\n listProjectsInOrg: [\"GET /orgs/{org}/teams/{team_slug}/projects\"],\n listReposInOrg: [\"GET /orgs/{org}/teams/{team_slug}/repos\"],\n removeMembershipForUserInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/memberships/{username}\"],\n removeProjectInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/projects/{project_id}\"],\n removeRepoInOrg: [\"DELETE /orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}\"],\n updateDiscussionCommentInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}\"],\n updateDiscussionInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}\"],\n updateInOrg: [\"PATCH /orgs/{org}/teams/{team_slug}\"]\n },\n users: {\n addEmailForAuthenticated: [\"POST /user/emails\", {}, {\n renamed: [\"users\", \"addEmailForAuthenticatedUser\"]\n }],\n addEmailForAuthenticatedUser: [\"POST /user/emails\"],\n block: [\"PUT /user/blocks/{username}\"],\n checkBlocked: [\"GET /user/blocks/{username}\"],\n checkFollowingForUser: [\"GET /users/{username}/following/{target_user}\"],\n checkPersonIsFollowedByAuthenticated: [\"GET /user/following/{username}\"],\n createGpgKeyForAuthenticated: [\"POST /user/gpg_keys\", {}, {\n renamed: [\"users\", \"createGpgKeyForAuthenticatedUser\"]\n }],\n createGpgKeyForAuthenticatedUser: [\"POST /user/gpg_keys\"],\n createPublicSshKeyForAuthenticated: [\"POST /user/keys\", {}, {\n renamed: [\"users\", \"createPublicSshKeyForAuthenticatedUser\"]\n }],\n createPublicSshKeyForAuthenticatedUser: [\"POST /user/keys\"],\n deleteEmailForAuthenticated: [\"DELETE /user/emails\", {}, {\n renamed: [\"users\", \"deleteEmailForAuthenticatedUser\"]\n }],\n deleteEmailForAuthenticatedUser: [\"DELETE /user/emails\"],\n deleteGpgKeyForAuthenticated: [\"DELETE /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"deleteGpgKeyForAuthenticatedUser\"]\n }],\n deleteGpgKeyForAuthenticatedUser: [\"DELETE /user/gpg_keys/{gpg_key_id}\"],\n deletePublicSshKeyForAuthenticated: [\"DELETE /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"deletePublicSshKeyForAuthenticatedUser\"]\n }],\n deletePublicSshKeyForAuthenticatedUser: [\"DELETE /user/keys/{key_id}\"],\n follow: [\"PUT /user/following/{username}\"],\n getAuthenticated: [\"GET /user\"],\n getByUsername: [\"GET /users/{username}\"],\n getContextForUser: [\"GET /users/{username}/hovercard\"],\n getGpgKeyForAuthenticated: [\"GET /user/gpg_keys/{gpg_key_id}\", {}, {\n renamed: [\"users\", \"getGpgKeyForAuthenticatedUser\"]\n }],\n getGpgKeyForAuthenticatedUser: [\"GET /user/gpg_keys/{gpg_key_id}\"],\n getPublicSshKeyForAuthenticated: [\"GET /user/keys/{key_id}\", {}, {\n renamed: [\"users\", \"getPublicSshKeyForAuthenticatedUser\"]\n }],\n getPublicSshKeyForAuthenticatedUser: [\"GET /user/keys/{key_id}\"],\n list: [\"GET /users\"],\n listBlockedByAuthenticated: [\"GET /user/blocks\", {}, {\n renamed: [\"users\", \"listBlockedByAuthenticatedUser\"]\n }],\n listBlockedByAuthenticatedUser: [\"GET /user/blocks\"],\n listEmailsForAuthenticated: [\"GET /user/emails\", {}, {\n renamed: [\"users\", \"listEmailsForAuthenticatedUser\"]\n }],\n listEmailsForAuthenticatedUser: [\"GET /user/emails\"],\n listFollowedByAuthenticated: [\"GET /user/following\", {}, {\n renamed: [\"users\", \"listFollowedByAuthenticatedUser\"]\n }],\n listFollowedByAuthenticatedUser: [\"GET /user/following\"],\n listFollowersForAuthenticatedUser: [\"GET /user/followers\"],\n listFollowersForUser: [\"GET /users/{username}/followers\"],\n listFollowingForUser: [\"GET /users/{username}/following\"],\n listGpgKeysForAuthenticated: [\"GET /user/gpg_keys\", {}, {\n renamed: [\"users\", \"listGpgKeysForAuthenticatedUser\"]\n }],\n listGpgKeysForAuthenticatedUser: [\"GET /user/gpg_keys\"],\n listGpgKeysForUser: [\"GET /users/{username}/gpg_keys\"],\n listPublicEmailsForAuthenticated: [\"GET /user/public_emails\", {}, {\n renamed: [\"users\", \"listPublicEmailsForAuthenticatedUser\"]\n }],\n listPublicEmailsForAuthenticatedUser: [\"GET /user/public_emails\"],\n listPublicKeysForUser: [\"GET /users/{username}/keys\"],\n listPublicSshKeysForAuthenticated: [\"GET /user/keys\", {}, {\n renamed: [\"users\", \"listPublicSshKeysForAuthenticatedUser\"]\n }],\n listPublicSshKeysForAuthenticatedUser: [\"GET /user/keys\"],\n setPrimaryEmailVisibilityForAuthenticated: [\"PATCH /user/email/visibility\", {}, {\n renamed: [\"users\", \"setPrimaryEmailVisibilityForAuthenticatedUser\"]\n }],\n setPrimaryEmailVisibilityForAuthenticatedUser: [\"PATCH /user/email/visibility\"],\n unblock: [\"DELETE /user/blocks/{username}\"],\n unfollow: [\"DELETE /user/following/{username}\"],\n updateAuthenticated: [\"PATCH /user\"]\n }\n};\n\nconst VERSION = \"5.13.0\";\n\nfunction endpointsToMethods(octokit, endpointsMap) {\n const newMethods = {};\n\n for (const [scope, endpoints] of Object.entries(endpointsMap)) {\n for (const [methodName, endpoint] of Object.entries(endpoints)) {\n const [route, defaults, decorations] = endpoint;\n const [method, url] = route.split(/ /);\n const endpointDefaults = Object.assign({\n method,\n url\n }, defaults);\n\n if (!newMethods[scope]) {\n newMethods[scope] = {};\n }\n\n const scopeMethods = newMethods[scope];\n\n if (decorations) {\n scopeMethods[methodName] = decorate(octokit, scope, methodName, endpointDefaults, decorations);\n continue;\n }\n\n scopeMethods[methodName] = octokit.request.defaults(endpointDefaults);\n }\n }\n\n return newMethods;\n}\n\nfunction decorate(octokit, scope, methodName, defaults, decorations) {\n const requestWithDefaults = octokit.request.defaults(defaults);\n /* istanbul ignore next */\n\n function withDecorations(...args) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n let options = requestWithDefaults.endpoint.merge(...args); // There are currently no other decorations than `.mapToData`\n\n if (decorations.mapToData) {\n options = Object.assign({}, options, {\n data: options[decorations.mapToData],\n [decorations.mapToData]: undefined\n });\n return requestWithDefaults(options);\n }\n\n if (decorations.renamed) {\n const [newScope, newMethodName] = decorations.renamed;\n octokit.log.warn(`octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()`);\n }\n\n if (decorations.deprecated) {\n octokit.log.warn(decorations.deprecated);\n }\n\n if (decorations.renamedParameters) {\n // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n const options = requestWithDefaults.endpoint.merge(...args);\n\n for (const [name, alias] of Object.entries(decorations.renamedParameters)) {\n if (name in options) {\n octokit.log.warn(`\"${name}\" parameter is deprecated for \"octokit.${scope}.${methodName}()\". Use \"${alias}\" instead`);\n\n if (!(alias in options)) {\n options[alias] = options[name];\n }\n\n delete options[name];\n }\n }\n\n return requestWithDefaults(options);\n } // @ts-ignore https://github.com/microsoft/TypeScript/issues/25488\n\n\n return requestWithDefaults(...args);\n }\n\n return Object.assign(withDecorations, requestWithDefaults);\n}\n\nfunction restEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return {\n rest: api\n };\n}\nrestEndpointMethods.VERSION = VERSION;\nfunction legacyRestEndpointMethods(octokit) {\n const api = endpointsToMethods(octokit, Endpoints);\n return _objectSpread2(_objectSpread2({}, api), {}, {\n rest: api\n });\n}\nlegacyRestEndpointMethods.VERSION = VERSION;\n\nexports.legacyRestEndpointMethods = legacyRestEndpointMethods;\nexports.restEndpointMethods = restEndpointMethods;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.6.3\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextAPI = void 0;\nvar NoopContextManager_1 = require(\"../context/NoopContextManager\");\nvar global_utils_1 = require(\"../internal/global-utils\");\nvar diag_1 = require(\"./diag\");\nvar API_NAME = 'context';\nvar NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nvar ContextAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function ContextAPI() {\n }\n /** Get the singleton instance of the Context API */\n ContextAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n };\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n ContextAPI.prototype.setGlobalContextManager = function (contextManager) {\n return global_utils_1.registerGlobal(API_NAME, contextManager, diag_1.DiagAPI.instance());\n };\n /**\n * Get the currently active context\n */\n ContextAPI.prototype.active = function () {\n return this._getContextManager().active();\n };\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n ContextAPI.prototype.with = function (context, fn, thisArg) {\n var _a;\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return (_a = this._getContextManager()).with.apply(_a, __spreadArray([context, fn, thisArg], args));\n };\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n ContextAPI.prototype.bind = function (context, target) {\n return this._getContextManager().bind(context, target);\n };\n ContextAPI.prototype._getContextManager = function () {\n return global_utils_1.getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n };\n /** Disable and remove the global context manager */\n ContextAPI.prototype.disable = function () {\n this._getContextManager().disable();\n global_utils_1.unregisterGlobal(API_NAME, diag_1.DiagAPI.instance());\n };\n return ContextAPI;\n}());\nexports.ContextAPI = ContextAPI;\n//# sourceMappingURL=context.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagAPI = void 0;\nvar ComponentLogger_1 = require(\"../diag/ComponentLogger\");\nvar logLevelLogger_1 = require(\"../diag/internal/logLevelLogger\");\nvar types_1 = require(\"../diag/types\");\nvar global_utils_1 = require(\"../internal/global-utils\");\nvar API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nvar DiagAPI = /** @class */ (function () {\n /**\n * Private internal constructor\n * @private\n */\n function DiagAPI() {\n function _logProxy(funcName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var logger = global_utils_1.getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName].apply(logger, args);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n var self = this;\n // DiagAPI specific functions\n self.setLogger = function (logger, logLevel) {\n var _a, _b;\n if (logLevel === void 0) { logLevel = types_1.DiagLogLevel.INFO; }\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n var err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n var oldLogger = global_utils_1.getGlobal('diag');\n var newLogger = logLevelLogger_1.createLogLevelDiagLogger(logLevel, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger) {\n var stack = (_b = new Error().stack) !== null && _b !== void 0 ? _b : '';\n oldLogger.warn(\"Current logger will be overwritten from \" + stack);\n newLogger.warn(\"Current logger will overwrite one already registered from \" + stack);\n }\n return global_utils_1.registerGlobal('diag', newLogger, self, true);\n };\n self.disable = function () {\n global_utils_1.unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = function (options) {\n return new ComponentLogger_1.DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n DiagAPI.instance = function () {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n };\n return DiagAPI;\n}());\nexports.DiagAPI = DiagAPI;\n//# sourceMappingURL=diag.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PropagationAPI = void 0;\nvar global_utils_1 = require(\"../internal/global-utils\");\nvar NoopTextMapPropagator_1 = require(\"../propagation/NoopTextMapPropagator\");\nvar TextMapPropagator_1 = require(\"../propagation/TextMapPropagator\");\nvar context_helpers_1 = require(\"../baggage/context-helpers\");\nvar utils_1 = require(\"../baggage/utils\");\nvar diag_1 = require(\"./diag\");\nvar API_NAME = 'propagation';\nvar NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nvar PropagationAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function PropagationAPI() {\n this.createBaggage = utils_1.createBaggage;\n this.getBaggage = context_helpers_1.getBaggage;\n this.setBaggage = context_helpers_1.setBaggage;\n this.deleteBaggage = context_helpers_1.deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n PropagationAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n };\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n PropagationAPI.prototype.setGlobalPropagator = function (propagator) {\n return global_utils_1.registerGlobal(API_NAME, propagator, diag_1.DiagAPI.instance());\n };\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n PropagationAPI.prototype.inject = function (context, carrier, setter) {\n if (setter === void 0) { setter = TextMapPropagator_1.defaultTextMapSetter; }\n return this._getGlobalPropagator().inject(context, carrier, setter);\n };\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n PropagationAPI.prototype.extract = function (context, carrier, getter) {\n if (getter === void 0) { getter = TextMapPropagator_1.defaultTextMapGetter; }\n return this._getGlobalPropagator().extract(context, carrier, getter);\n };\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n PropagationAPI.prototype.fields = function () {\n return this._getGlobalPropagator().fields();\n };\n /** Remove the global propagator */\n PropagationAPI.prototype.disable = function () {\n global_utils_1.unregisterGlobal(API_NAME, diag_1.DiagAPI.instance());\n };\n PropagationAPI.prototype._getGlobalPropagator = function () {\n return global_utils_1.getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n };\n return PropagationAPI;\n}());\nexports.PropagationAPI = PropagationAPI;\n//# sourceMappingURL=propagation.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceAPI = void 0;\nvar global_utils_1 = require(\"../internal/global-utils\");\nvar ProxyTracerProvider_1 = require(\"../trace/ProxyTracerProvider\");\nvar spancontext_utils_1 = require(\"../trace/spancontext-utils\");\nvar context_utils_1 = require(\"../trace/context-utils\");\nvar diag_1 = require(\"./diag\");\nvar API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nvar TraceAPI = /** @class */ (function () {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n function TraceAPI() {\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n this.wrapSpanContext = spancontext_utils_1.wrapSpanContext;\n this.isSpanContextValid = spancontext_utils_1.isSpanContextValid;\n this.deleteSpan = context_utils_1.deleteSpan;\n this.getSpan = context_utils_1.getSpan;\n this.getSpanContext = context_utils_1.getSpanContext;\n this.setSpan = context_utils_1.setSpan;\n this.setSpanContext = context_utils_1.setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n TraceAPI.getInstance = function () {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n };\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n TraceAPI.prototype.setGlobalTracerProvider = function (provider) {\n var success = global_utils_1.registerGlobal(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n };\n /**\n * Returns the global tracer provider.\n */\n TraceAPI.prototype.getTracerProvider = function () {\n return global_utils_1.getGlobal(API_NAME) || this._proxyTracerProvider;\n };\n /**\n * Returns a tracer from the global tracer provider.\n */\n TraceAPI.prototype.getTracer = function (name, version) {\n return this.getTracerProvider().getTracer(name, version);\n };\n /** Remove the global tracer provider */\n TraceAPI.prototype.disable = function () {\n global_utils_1.unregisterGlobal(API_NAME, diag_1.DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n };\n return TraceAPI;\n}());\nexports.TraceAPI = TraceAPI;\n//# sourceMappingURL=trace.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteBaggage = exports.setBaggage = exports.getBaggage = void 0;\nvar context_1 = require(\"../context/context\");\n/**\n * Baggage key\n */\nvar BAGGAGE_KEY = context_1.createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nfunction getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\nexports.getBaggage = getBaggage;\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nfunction setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\nexports.setBaggage = setBaggage;\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nfunction deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\nexports.deleteBaggage = deleteBaggage;\n//# sourceMappingURL=context-helpers.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaggageImpl = void 0;\nvar BaggageImpl = /** @class */ (function () {\n function BaggageImpl(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n BaggageImpl.prototype.getEntry = function (key) {\n var entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n };\n BaggageImpl.prototype.getAllEntries = function () {\n return Array.from(this._entries.entries()).map(function (_a) {\n var k = _a[0], v = _a[1];\n return [k, v];\n });\n };\n BaggageImpl.prototype.setEntry = function (key, entry) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntry = function (key) {\n var newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n };\n BaggageImpl.prototype.removeEntries = function () {\n var keys = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n keys[_i] = arguments[_i];\n }\n var newBaggage = new BaggageImpl(this._entries);\n for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) {\n var key = keys_1[_a];\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n };\n BaggageImpl.prototype.clear = function () {\n return new BaggageImpl();\n };\n return BaggageImpl;\n}());\nexports.BaggageImpl = BaggageImpl;\n//# sourceMappingURL=baggage-impl.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageEntryMetadataSymbol = void 0;\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageEntryMetadataFromString = exports.createBaggage = void 0;\nvar diag_1 = require(\"../api/diag\");\nvar baggage_impl_1 = require(\"./internal/baggage-impl\");\nvar symbol_1 = require(\"./internal/symbol\");\nvar diag = diag_1.DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nfunction createBaggage(entries) {\n if (entries === void 0) { entries = {}; }\n return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries)));\n}\nexports.createBaggage = createBaggage;\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nfunction baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(\"Cannot create baggage metadata from unknown type: \" + typeof str);\n str = '';\n }\n return {\n __TYPE__: symbol_1.baggageEntryMetadataSymbol,\n toString: function () {\n return str;\n },\n };\n}\nexports.baggageEntryMetadataFromString = baggageEntryMetadataFromString;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Attributes.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Exception.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Time.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopContextManager = void 0;\nvar context_1 = require(\"./context\");\nvar NoopContextManager = /** @class */ (function () {\n function NoopContextManager() {\n }\n NoopContextManager.prototype.active = function () {\n return context_1.ROOT_CONTEXT;\n };\n NoopContextManager.prototype.with = function (_context, fn, thisArg) {\n var args = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n args[_i - 3] = arguments[_i];\n }\n return fn.call.apply(fn, __spreadArray([thisArg], args));\n };\n NoopContextManager.prototype.bind = function (_context, target) {\n return target;\n };\n NoopContextManager.prototype.enable = function () {\n return this;\n };\n NoopContextManager.prototype.disable = function () {\n return this;\n };\n return NoopContextManager;\n}());\nexports.NoopContextManager = NoopContextManager;\n//# sourceMappingURL=NoopContextManager.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ROOT_CONTEXT = exports.createContextKey = void 0;\n/** Get a key to uniquely identify a context value */\nfunction createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nexports.createContextKey = createContextKey;\nvar BaseContext = /** @class */ (function () {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n function BaseContext(parentContext) {\n // for minification\n var self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = function (key) { return self._currentContext.get(key); };\n self.setValue = function (key, value) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = function (key) {\n var context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n return BaseContext;\n}());\n/** The root context is used as the default parent context when there is no active context */\nexports.ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagComponentLogger = void 0;\nvar global_utils_1 = require(\"../internal/global-utils\");\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nvar DiagComponentLogger = /** @class */ (function () {\n function DiagComponentLogger(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n DiagComponentLogger.prototype.debug = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('debug', this._namespace, args);\n };\n DiagComponentLogger.prototype.error = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('error', this._namespace, args);\n };\n DiagComponentLogger.prototype.info = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('info', this._namespace, args);\n };\n DiagComponentLogger.prototype.warn = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('warn', this._namespace, args);\n };\n DiagComponentLogger.prototype.verbose = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return logProxy('verbose', this._namespace, args);\n };\n return DiagComponentLogger;\n}());\nexports.DiagComponentLogger = DiagComponentLogger;\nfunction logProxy(funcName, namespace, args) {\n var logger = global_utils_1.getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n args.unshift(namespace);\n return logger[funcName].apply(logger, args);\n}\n//# sourceMappingURL=ComponentLogger.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagConsoleLogger = void 0;\nvar consoleMap = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n */\nvar DiagConsoleLogger = /** @class */ (function () {\n function DiagConsoleLogger() {\n function _consoleFunc(funcName) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n // eslint-disable-next-line no-console\n var theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n }\n };\n }\n for (var i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n return DiagConsoleLogger;\n}());\nexports.DiagConsoleLogger = DiagConsoleLogger;\n//# sourceMappingURL=consoleLogger.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./consoleLogger\"), exports);\n__exportStar(require(\"./types\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createLogLevelDiagLogger = void 0;\nvar types_1 = require(\"../types\");\nfunction createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < types_1.DiagLogLevel.NONE) {\n maxLevel = types_1.DiagLogLevel.NONE;\n }\n else if (maxLevel > types_1.DiagLogLevel.ALL) {\n maxLevel = types_1.DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n var theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', types_1.DiagLogLevel.ERROR),\n warn: _filterFunc('warn', types_1.DiagLogLevel.WARN),\n info: _filterFunc('info', types_1.DiagLogLevel.INFO),\n debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE),\n };\n}\nexports.createLogLevelDiagLogger = createLogLevelDiagLogger;\n//# sourceMappingURL=logLevelLogger.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagLogLevel = void 0;\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nvar DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.diag = exports.propagation = exports.trace = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.baggageEntryMetadataFromString = void 0;\n__exportStar(require(\"./baggage/types\"), exports);\nvar utils_1 = require(\"./baggage/utils\");\nObject.defineProperty(exports, \"baggageEntryMetadataFromString\", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });\n__exportStar(require(\"./common/Exception\"), exports);\n__exportStar(require(\"./common/Time\"), exports);\n__exportStar(require(\"./common/Attributes\"), exports);\n__exportStar(require(\"./diag\"), exports);\n__exportStar(require(\"./propagation/TextMapPropagator\"), exports);\n__exportStar(require(\"./trace/attributes\"), exports);\n__exportStar(require(\"./trace/link\"), exports);\n__exportStar(require(\"./trace/ProxyTracer\"), exports);\n__exportStar(require(\"./trace/ProxyTracerProvider\"), exports);\n__exportStar(require(\"./trace/Sampler\"), exports);\n__exportStar(require(\"./trace/SamplingResult\"), exports);\n__exportStar(require(\"./trace/span_context\"), exports);\n__exportStar(require(\"./trace/span_kind\"), exports);\n__exportStar(require(\"./trace/span\"), exports);\n__exportStar(require(\"./trace/SpanOptions\"), exports);\n__exportStar(require(\"./trace/status\"), exports);\n__exportStar(require(\"./trace/trace_flags\"), exports);\n__exportStar(require(\"./trace/trace_state\"), exports);\nvar utils_2 = require(\"./trace/internal/utils\");\nObject.defineProperty(exports, \"createTraceState\", { enumerable: true, get: function () { return utils_2.createTraceState; } });\n__exportStar(require(\"./trace/tracer_provider\"), exports);\n__exportStar(require(\"./trace/tracer\"), exports);\n__exportStar(require(\"./trace/tracer_options\"), exports);\nvar spancontext_utils_1 = require(\"./trace/spancontext-utils\");\nObject.defineProperty(exports, \"isSpanContextValid\", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });\nObject.defineProperty(exports, \"isValidTraceId\", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });\nObject.defineProperty(exports, \"isValidSpanId\", { enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } });\nvar invalid_span_constants_1 = require(\"./trace/invalid-span-constants\");\nObject.defineProperty(exports, \"INVALID_SPANID\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } });\nObject.defineProperty(exports, \"INVALID_TRACEID\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } });\nObject.defineProperty(exports, \"INVALID_SPAN_CONTEXT\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } });\n__exportStar(require(\"./context/context\"), exports);\n__exportStar(require(\"./context/types\"), exports);\nvar context_1 = require(\"./api/context\");\n/** Entrypoint for context API */\nexports.context = context_1.ContextAPI.getInstance();\nvar trace_1 = require(\"./api/trace\");\n/** Entrypoint for trace API */\nexports.trace = trace_1.TraceAPI.getInstance();\nvar propagation_1 = require(\"./api/propagation\");\n/** Entrypoint for propagation API */\nexports.propagation = propagation_1.PropagationAPI.getInstance();\nvar diag_1 = require(\"./api/diag\");\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexports.diag = diag_1.DiagAPI.instance();\nexports.default = {\n trace: exports.trace,\n context: exports.context,\n propagation: exports.propagation,\n diag: exports.diag,\n};\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0;\nvar platform_1 = require(\"../platform\");\nvar version_1 = require(\"../version\");\nvar semver_1 = require(\"./semver\");\nvar major = version_1.VERSION.split('.')[0];\nvar GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(\"opentelemetry.js.api.\" + major);\nvar _global = platform_1._globalThis;\nfunction registerGlobal(type, instance, diag, allowOverride) {\n var _a;\n if (allowOverride === void 0) { allowOverride = false; }\n var api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: version_1.VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n var err = new Error(\"@opentelemetry/api: Attempted duplicate registration of API: \" + type);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== version_1.VERSION) {\n // All registered APIs must be of the same version exactly\n var err = new Error('@opentelemetry/api: All API registration versions must match');\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(\"@opentelemetry/api: Registered a global for \" + type + \" v\" + version_1.VERSION + \".\");\n return true;\n}\nexports.registerGlobal = registerGlobal;\nfunction getGlobal(type) {\n var _a, _b;\n var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !semver_1.isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexports.getGlobal = getGlobal;\nfunction unregisterGlobal(type, diag) {\n diag.debug(\"@opentelemetry/api: Unregistering a global for \" + type + \" v\" + version_1.VERSION + \".\");\n var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\nexports.unregisterGlobal = unregisterGlobal;\n//# sourceMappingURL=global-utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCompatible = exports._makeCompatibilityCheck = void 0;\nvar version_1 = require(\"../version\");\nvar re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nfunction _makeCompatibilityCheck(ownVersion) {\n var acceptedVersions = new Set([ownVersion]);\n var rejectedVersions = new Set();\n var myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return function () { return false; };\n }\n var ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n var globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n var globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\nexports._makeCompatibilityCheck = _makeCompatibilityCheck;\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexports.isCompatible = _makeCompatibilityCheck(version_1.VERSION);\n//# sourceMappingURL=semver.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._globalThis = void 0;\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexports._globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./globalThis\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTextMapPropagator = void 0;\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nvar NoopTextMapPropagator = /** @class */ (function () {\n function NoopTextMapPropagator() {\n }\n /** Noop inject function does nothing */\n NoopTextMapPropagator.prototype.inject = function (_context, _carrier) { };\n /** Noop extract function does nothing and returns the input context */\n NoopTextMapPropagator.prototype.extract = function (context, _carrier) {\n return context;\n };\n NoopTextMapPropagator.prototype.fields = function () {\n return [];\n };\n return NoopTextMapPropagator;\n}());\nexports.NoopTextMapPropagator = NoopTextMapPropagator;\n//# sourceMappingURL=NoopTextMapPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0;\nexports.defaultTextMapGetter = {\n get: function (carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys: function (carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexports.defaultTextMapSetter = {\n set: function (carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NonRecordingSpan = void 0;\nvar invalid_span_constants_1 = require(\"./invalid-span-constants\");\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nvar NonRecordingSpan = /** @class */ (function () {\n function NonRecordingSpan(_spanContext) {\n if (_spanContext === void 0) { _spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT; }\n this._spanContext = _spanContext;\n }\n // Returns a SpanContext.\n NonRecordingSpan.prototype.spanContext = function () {\n return this._spanContext;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttribute = function (_key, _value) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setAttributes = function (_attributes) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.addEvent = function (_name, _attributes) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.setStatus = function (_status) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.updateName = function (_name) {\n return this;\n };\n // By default does nothing\n NonRecordingSpan.prototype.end = function (_endTime) { };\n // isRecording always returns false for NonRecordingSpan.\n NonRecordingSpan.prototype.isRecording = function () {\n return false;\n };\n // By default does nothing\n NonRecordingSpan.prototype.recordException = function (_exception, _time) { };\n return NonRecordingSpan;\n}());\nexports.NonRecordingSpan = NonRecordingSpan;\n//# sourceMappingURL=NonRecordingSpan.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTracer = void 0;\nvar context_1 = require(\"../api/context\");\nvar context_utils_1 = require(\"../trace/context-utils\");\nvar NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nvar spancontext_utils_1 = require(\"./spancontext-utils\");\nvar context = context_1.ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nvar NoopTracer = /** @class */ (function () {\n function NoopTracer() {\n }\n // startSpan starts a noop span.\n NoopTracer.prototype.startSpan = function (name, options, context) {\n var root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan_1.NonRecordingSpan();\n }\n var parentFromContext = context && context_utils_1.getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n spancontext_utils_1.isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan_1.NonRecordingSpan();\n }\n };\n NoopTracer.prototype.startActiveSpan = function (name, arg2, arg3, arg4) {\n var opts;\n var ctx;\n var fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n var parentContext = ctx !== null && ctx !== void 0 ? ctx : context.active();\n var span = this.startSpan(name, opts, parentContext);\n var contextWithSpanSet = context_utils_1.setSpan(parentContext, span);\n return context.with(contextWithSpanSet, fn, undefined, span);\n };\n return NoopTracer;\n}());\nexports.NoopTracer = NoopTracer;\nfunction isSpanContext(spanContext) {\n return (typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTracerProvider = void 0;\nvar NoopTracer_1 = require(\"./NoopTracer\");\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nvar NoopTracerProvider = /** @class */ (function () {\n function NoopTracerProvider() {\n }\n NoopTracerProvider.prototype.getTracer = function (_name, _version, _options) {\n return new NoopTracer_1.NoopTracer();\n };\n return NoopTracerProvider;\n}());\nexports.NoopTracerProvider = NoopTracerProvider;\n//# sourceMappingURL=NoopTracerProvider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProxyTracer = void 0;\nvar NoopTracer_1 = require(\"./NoopTracer\");\nvar NOOP_TRACER = new NoopTracer_1.NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n */\nvar ProxyTracer = /** @class */ (function () {\n function ProxyTracer(_provider, name, version, options) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n ProxyTracer.prototype.startSpan = function (name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n };\n ProxyTracer.prototype.startActiveSpan = function (_name, _options, _context, _fn) {\n var tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n };\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n ProxyTracer.prototype._getTracer = function () {\n if (this._delegate) {\n return this._delegate;\n }\n var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n };\n return ProxyTracer;\n}());\nexports.ProxyTracer = ProxyTracer;\n//# sourceMappingURL=ProxyTracer.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProxyTracerProvider = void 0;\nvar ProxyTracer_1 = require(\"./ProxyTracer\");\nvar NoopTracerProvider_1 = require(\"./NoopTracerProvider\");\nvar NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nvar ProxyTracerProvider = /** @class */ (function () {\n function ProxyTracerProvider() {\n }\n /**\n * Get a {@link ProxyTracer}\n */\n ProxyTracerProvider.prototype.getTracer = function (name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options));\n };\n ProxyTracerProvider.prototype.getDelegate = function () {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n };\n /**\n * Set the delegate tracer provider\n */\n ProxyTracerProvider.prototype.setDelegate = function (delegate) {\n this._delegate = delegate;\n };\n ProxyTracerProvider.prototype.getDelegateTracer = function (name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n };\n return ProxyTracerProvider;\n}());\nexports.ProxyTracerProvider = ProxyTracerProvider;\n//# sourceMappingURL=ProxyTracerProvider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Sampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SamplingDecision = void 0;\n/**\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nvar SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=SpanOptions.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=attributes.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getSpan = void 0;\nvar context_1 = require(\"../context/context\");\nvar NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\n/**\n * span key\n */\nvar SPAN_KEY = context_1.createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nfunction getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\nexports.getSpan = getSpan;\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nfunction setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\nexports.setSpan = setSpan;\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nfunction deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\nexports.deleteSpan = deleteSpan;\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nfunction setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext));\n}\nexports.setSpanContext = setSpanContext;\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nfunction getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\nexports.getSpanContext = getSpanContext;\n//# sourceMappingURL=context-utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceStateImpl = void 0;\nvar tracestate_validators_1 = require(\"./tracestate-validators\");\nvar MAX_TRACE_STATE_ITEMS = 32;\nvar MAX_TRACE_STATE_LEN = 512;\nvar LIST_MEMBERS_SEPARATOR = ',';\nvar LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nvar TraceStateImpl = /** @class */ (function () {\n function TraceStateImpl(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n TraceStateImpl.prototype.set = function (key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n var traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n };\n TraceStateImpl.prototype.unset = function (key) {\n var traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n };\n TraceStateImpl.prototype.get = function (key) {\n return this._internalState.get(key);\n };\n TraceStateImpl.prototype.serialize = function () {\n var _this = this;\n return this._keys()\n .reduce(function (agg, key) {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + _this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n };\n TraceStateImpl.prototype._parse = function (rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce(function (agg, part) {\n var listMember = part.trim(); // Optional Whitespace (OWS) handling\n var i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n var key = listMember.slice(0, i);\n var value = listMember.slice(i + 1, part.length);\n if (tracestate_validators_1.validateKey(key) && tracestate_validators_1.validateValue(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n };\n TraceStateImpl.prototype._keys = function () {\n return Array.from(this._internalState.keys()).reverse();\n };\n TraceStateImpl.prototype._clone = function () {\n var traceState = new TraceStateImpl();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n };\n return TraceStateImpl;\n}());\nexports.TraceStateImpl = TraceStateImpl;\n//# sourceMappingURL=tracestate-impl.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateValue = exports.validateKey = void 0;\nvar VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nvar VALID_KEY = \"[a-z]\" + VALID_KEY_CHAR_RANGE + \"{0,255}\";\nvar VALID_VENDOR_KEY = \"[a-z0-9]\" + VALID_KEY_CHAR_RANGE + \"{0,240}@[a-z]\" + VALID_KEY_CHAR_RANGE + \"{0,13}\";\nvar VALID_KEY_REGEX = new RegExp(\"^(?:\" + VALID_KEY + \"|\" + VALID_VENDOR_KEY + \")$\");\nvar VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nvar INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nfunction validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\nexports.validateKey = validateKey;\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nfunction validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\nexports.validateValue = validateValue;\n//# sourceMappingURL=tracestate-validators.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTraceState = void 0;\nvar tracestate_impl_1 = require(\"./tracestate-impl\");\nfunction createTraceState(rawTraceState) {\n return new tracestate_impl_1.TraceStateImpl(rawTraceState);\n}\nexports.createTraceState = createTraceState;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0;\nvar trace_flags_1 = require(\"./trace_flags\");\nexports.INVALID_SPANID = '0000000000000000';\nexports.INVALID_TRACEID = '00000000000000000000000000000000';\nexports.INVALID_SPAN_CONTEXT = {\n traceId: exports.INVALID_TRACEID,\n spanId: exports.INVALID_SPANID,\n traceFlags: trace_flags_1.TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=link.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=span.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=span_context.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SpanKind = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind = exports.SpanKind || (exports.SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar invalid_span_constants_1 = require(\"./invalid-span-constants\");\nvar NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nvar VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nvar VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\nfunction isValidTraceId(traceId) {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID;\n}\nexports.isValidTraceId = isValidTraceId;\nfunction isValidSpanId(spanId) {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID;\n}\nexports.isValidSpanId = isValidSpanId;\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n */\nfunction isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\nexports.isSpanContextValid = isSpanContextValid;\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nfunction wrapSpanContext(spanContext) {\n return new NonRecordingSpan_1.NonRecordingSpan(spanContext);\n}\nexports.wrapSpanContext = wrapSpanContext;\n//# sourceMappingURL=spancontext-utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SpanStatusCode = void 0;\n/**\n * An enumeration of status codes.\n */\nvar SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceFlags = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=trace_state.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=tracer.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=tracer_options.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=tracer_provider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VERSION = void 0;\n// this is autogenerated file, see scripts/version-update.js\nexports.VERSION = '1.1.0';\n//# sourceMappingURL=version.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExportResultCode = void 0;\nvar ExportResultCode;\n(function (ExportResultCode) {\n ExportResultCode[ExportResultCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExportResultCode[ExportResultCode[\"FAILED\"] = 1] = \"FAILED\";\n})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {}));\n//# sourceMappingURL=ExportResult.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0;\nexports.BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexports.BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexports.BAGGAGE_ITEMS_SEPARATOR = ',';\n// Name of the http header used to propagate the baggage\nexports.BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexports.BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n//# sourceMappingURL=constants.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.W3CBaggagePropagator = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst suppress_tracing_1 = require(\"../../trace/suppress-tracing\");\nconst constants_1 = require(\"../constants\");\nconst utils_1 = require(\"../utils\");\n/**\n * Propagates {@link Baggage} through Context format propagation.\n *\n * Based on the Baggage specification:\n * https://w3c.github.io/baggage/\n */\nclass W3CBaggagePropagator {\n inject(context, carrier, setter) {\n const baggage = api_1.propagation.getBaggage(context);\n if (!baggage || (0, suppress_tracing_1.isTracingSuppressed)(context))\n return;\n const keyPairs = (0, utils_1.getKeyPairs)(baggage)\n .filter((pair) => {\n return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;\n })\n .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS);\n const headerValue = (0, utils_1.serializeKeyPairs)(keyPairs);\n if (headerValue.length > 0) {\n setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue);\n }\n }\n extract(context, carrier, getter) {\n const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER);\n const baggageString = Array.isArray(headerValue) ? headerValue.join(constants_1.BAGGAGE_ITEMS_SEPARATOR) : headerValue;\n if (!baggageString)\n return context;\n const baggage = {};\n if (baggageString.length === 0) {\n return context;\n }\n const pairs = baggageString.split(constants_1.BAGGAGE_ITEMS_SEPARATOR);\n pairs.forEach(entry => {\n const keyPair = (0, utils_1.parsePairKeyValue)(entry);\n if (keyPair) {\n const baggageEntry = { value: keyPair.value };\n if (keyPair.metadata) {\n baggageEntry.metadata = keyPair.metadata;\n }\n baggage[keyPair.key] = baggageEntry;\n }\n });\n if (Object.entries(baggage).length === 0) {\n return context;\n }\n return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage));\n }\n fields() {\n return [constants_1.BAGGAGE_HEADER];\n }\n}\nexports.W3CBaggagePropagator = W3CBaggagePropagator;\n//# sourceMappingURL=W3CBaggagePropagator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst api_1 = require(\"@opentelemetry/api\");\nconst constants_1 = require(\"./constants\");\nfunction serializeKeyPairs(keyPairs) {\n return keyPairs.reduce((hValue, current) => {\n const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`;\n return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;\n }, '');\n}\nexports.serializeKeyPairs = serializeKeyPairs;\nfunction getKeyPairs(baggage) {\n return baggage.getAllEntries().map(([key, value]) => {\n let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`;\n // include opaque metadata if provided\n // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation\n if (value.metadata !== undefined) {\n entry += constants_1.BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString();\n }\n return entry;\n });\n}\nexports.getKeyPairs = getKeyPairs;\nfunction parsePairKeyValue(entry) {\n const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR);\n if (valueProps.length <= 0)\n return;\n const keyPairPart = valueProps.shift();\n if (!keyPairPart)\n return;\n const keyPair = keyPairPart.split(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR);\n if (keyPair.length !== 2)\n return;\n const key = decodeURIComponent(keyPair[0].trim());\n const value = decodeURIComponent(keyPair[1].trim());\n let metadata;\n if (valueProps.length > 0) {\n metadata = (0, api_1.baggageEntryMetadataFromString)(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR));\n }\n return { key, value, metadata };\n}\nexports.parsePairKeyValue = parsePairKeyValue;\n/**\n * Parse a string serialized in the baggage HTTP Format (without metadata):\n * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md\n */\nfunction parseKeyPairsIntoRecord(value) {\n if (typeof value !== 'string' || value.length === 0)\n return {};\n return value\n .split(constants_1.BAGGAGE_ITEMS_SEPARATOR)\n .map(entry => {\n return parsePairKeyValue(entry);\n })\n .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0)\n .reduce((headers, keyPair) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n headers[keyPair.key] = keyPair.value;\n return headers;\n }, {});\n}\nexports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAttributeValue = exports.isAttributeKey = exports.sanitizeAttributes = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nfunction sanitizeAttributes(attributes) {\n const out = {};\n if (typeof attributes !== 'object' || attributes == null) {\n return out;\n }\n for (const [key, val] of Object.entries(attributes)) {\n if (!isAttributeKey(key)) {\n api_1.diag.warn(`Invalid attribute key: ${key}`);\n continue;\n }\n if (!isAttributeValue(val)) {\n api_1.diag.warn(`Invalid attribute value set for key: ${key}`);\n continue;\n }\n if (Array.isArray(val)) {\n out[key] = val.slice();\n }\n else {\n out[key] = val;\n }\n }\n return out;\n}\nexports.sanitizeAttributes = sanitizeAttributes;\nfunction isAttributeKey(key) {\n return typeof key === 'string' && key.length > 0;\n}\nexports.isAttributeKey = isAttributeKey;\nfunction isAttributeValue(val) {\n if (val == null) {\n return true;\n }\n if (Array.isArray(val)) {\n return isHomogeneousAttributeValueArray(val);\n }\n return isValidPrimitiveAttributeValue(val);\n}\nexports.isAttributeValue = isAttributeValue;\nfunction isHomogeneousAttributeValueArray(arr) {\n let type;\n for (const element of arr) {\n // null/undefined elements are allowed\n if (element == null)\n continue;\n if (!type) {\n if (isValidPrimitiveAttributeValue(element)) {\n type = typeof element;\n continue;\n }\n // encountered an invalid primitive\n return false;\n }\n if (typeof element === type) {\n continue;\n }\n return false;\n }\n return true;\n}\nfunction isValidPrimitiveAttributeValue(val) {\n switch (typeof val) {\n case 'number':\n case 'boolean':\n case 'string':\n return true;\n }\n return false;\n}\n//# sourceMappingURL=attributes.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.globalErrorHandler = exports.setGlobalErrorHandler = void 0;\nconst logging_error_handler_1 = require(\"./logging-error-handler\");\n/** The global error handler delegate */\nlet delegateHandler = (0, logging_error_handler_1.loggingErrorHandler)();\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nfunction setGlobalErrorHandler(handler) {\n delegateHandler = handler;\n}\nexports.setGlobalErrorHandler = setGlobalErrorHandler;\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nfunction globalErrorHandler(ex) {\n try {\n delegateHandler(ex);\n }\n catch (_a) { } // eslint-disable-line no-empty\n}\nexports.globalErrorHandler = globalErrorHandler;\n//# sourceMappingURL=global-error-handler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loggingErrorHandler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nfunction loggingErrorHandler() {\n return (ex) => {\n api_1.diag.error(stringifyException(ex));\n };\n}\nexports.loggingErrorHandler = loggingErrorHandler;\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex) {\n if (typeof ex === 'string') {\n return ex;\n }\n else {\n return JSON.stringify(flattenException(ex));\n }\n}\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex) {\n const result = {};\n let current = ex;\n while (current !== null) {\n Object.getOwnPropertyNames(current).forEach(propertyName => {\n if (result[propertyName])\n return;\n const value = current[propertyName];\n if (value) {\n result[propertyName] = String(value);\n }\n });\n current = Object.getPrototypeOf(current);\n }\n return result;\n}\n//# sourceMappingURL=logging-error-handler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = void 0;\nconst platform_1 = require(\"../platform\");\nconst NANOSECOND_DIGITS = 9;\nconst SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n/**\n * Converts a number to HrTime, HrTime = [number, number].\n * The first number is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * numberToHrtime calculates the first number by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * numberToHrtime calculates the second number by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * SECOND_TO_NANOSECONDS = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n * @param epochMillis\n */\nfunction numberToHrtime(epochMillis) {\n const epochSeconds = epochMillis / 1000;\n // Decimals only.\n const seconds = Math.trunc(epochSeconds);\n // Round sub-nanosecond accuracy to nanosecond.\n const nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) *\n SECOND_TO_NANOSECONDS;\n return [seconds, nanos];\n}\nfunction getTimeOrigin() {\n let timeOrigin = platform_1.otperformance.timeOrigin;\n if (typeof timeOrigin !== 'number') {\n const perf = platform_1.otperformance;\n timeOrigin = perf.timing && perf.timing.fetchStart;\n }\n return timeOrigin;\n}\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nfunction hrTime(performanceNow) {\n const timeOrigin = numberToHrtime(getTimeOrigin());\n const now = numberToHrtime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now());\n let seconds = timeOrigin[0] + now[0];\n let nanos = timeOrigin[1] + now[1];\n // Nanoseconds\n if (nanos > SECOND_TO_NANOSECONDS) {\n nanos -= SECOND_TO_NANOSECONDS;\n seconds += 1;\n }\n return [seconds, nanos];\n}\nexports.hrTime = hrTime;\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nfunction timeInputToHrTime(time) {\n // process.hrtime\n if (isTimeInputHrTime(time)) {\n return time;\n }\n else if (typeof time === 'number') {\n // Must be a performance.now() if it's smaller than process start time.\n if (time < getTimeOrigin()) {\n return hrTime(time);\n }\n else {\n // epoch milliseconds or performance.timeOrigin\n return numberToHrtime(time);\n }\n }\n else if (time instanceof Date) {\n return numberToHrtime(time.getTime());\n }\n else {\n throw TypeError('Invalid input type');\n }\n}\nexports.timeInputToHrTime = timeInputToHrTime;\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nfunction hrTimeDuration(startTime, endTime) {\n let seconds = endTime[0] - startTime[0];\n let nanos = endTime[1] - startTime[1];\n // overflow\n if (nanos < 0) {\n seconds -= 1;\n // negate\n nanos += SECOND_TO_NANOSECONDS;\n }\n return [seconds, nanos];\n}\nexports.hrTimeDuration = hrTimeDuration;\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param time\n */\nfunction hrTimeToTimeStamp(time) {\n const precision = NANOSECOND_DIGITS;\n const tmp = `${'0'.repeat(precision)}${time[1]}Z`;\n const nanoString = tmp.substr(tmp.length - precision - 1);\n const date = new Date(time[0] * 1000).toISOString();\n return date.replace('000Z', nanoString);\n}\nexports.hrTimeToTimeStamp = hrTimeToTimeStamp;\n/**\n * Convert hrTime to nanoseconds.\n * @param time\n */\nfunction hrTimeToNanoseconds(time) {\n return time[0] * SECOND_TO_NANOSECONDS + time[1];\n}\nexports.hrTimeToNanoseconds = hrTimeToNanoseconds;\n/**\n * Convert hrTime to milliseconds.\n * @param time\n */\nfunction hrTimeToMilliseconds(time) {\n return Math.round(time[0] * 1e3 + time[1] / 1e6);\n}\nexports.hrTimeToMilliseconds = hrTimeToMilliseconds;\n/**\n * Convert hrTime to microseconds.\n * @param time\n */\nfunction hrTimeToMicroseconds(time) {\n return Math.round(time[0] * 1e6 + time[1] / 1e3);\n}\nexports.hrTimeToMicroseconds = hrTimeToMicroseconds;\n/**\n * check if time is HrTime\n * @param value\n */\nfunction isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}\nexports.isTimeInputHrTime = isTimeInputHrTime;\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nfunction isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}\nexports.isTimeInput = isTimeInput;\n//# sourceMappingURL=time.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageUtils = void 0;\n__exportStar(require(\"./baggage/propagation/W3CBaggagePropagator\"), exports);\n__exportStar(require(\"./common/attributes\"), exports);\n__exportStar(require(\"./common/global-error-handler\"), exports);\n__exportStar(require(\"./common/logging-error-handler\"), exports);\n__exportStar(require(\"./common/time\"), exports);\n__exportStar(require(\"./common/types\"), exports);\n__exportStar(require(\"./ExportResult\"), exports);\n__exportStar(require(\"./version\"), exports);\nexports.baggageUtils = require(\"./baggage/utils\");\n__exportStar(require(\"./platform\"), exports);\n__exportStar(require(\"./propagation/composite\"), exports);\n__exportStar(require(\"./trace/W3CTraceContextPropagator\"), exports);\n__exportStar(require(\"./trace/IdGenerator\"), exports);\n__exportStar(require(\"./trace/rpc-metadata\"), exports);\n__exportStar(require(\"./trace/sampler/AlwaysOffSampler\"), exports);\n__exportStar(require(\"./trace/sampler/AlwaysOnSampler\"), exports);\n__exportStar(require(\"./trace/sampler/ParentBasedSampler\"), exports);\n__exportStar(require(\"./trace/sampler/TraceIdRatioBasedSampler\"), exports);\n__exportStar(require(\"./trace/suppress-tracing\"), exports);\n__exportStar(require(\"./trace/TraceState\"), exports);\n__exportStar(require(\"./utils/environment\"), exports);\n__exportStar(require(\"./utils/merge\"), exports);\n__exportStar(require(\"./utils/sampling\"), exports);\n__exportStar(require(\"./utils/url\"), exports);\n__exportStar(require(\"./utils/wrap\"), exports);\n__exportStar(require(\"./utils/callback\"), exports);\n__exportStar(require(\"./version\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateValue = exports.validateKey = void 0;\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nfunction validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\nexports.validateKey = validateKey;\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nfunction validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\nexports.validateValue = validateValue;\n//# sourceMappingURL=validators.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RandomIdGenerator = void 0;\nconst SPAN_ID_BYTES = 8;\nconst TRACE_ID_BYTES = 16;\nclass RandomIdGenerator {\n constructor() {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n this.generateTraceId = getIdGenerator(TRACE_ID_BYTES);\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n this.generateSpanId = getIdGenerator(SPAN_ID_BYTES);\n }\n}\nexports.RandomIdGenerator = RandomIdGenerator;\nconst SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES);\nfunction getIdGenerator(bytes) {\n return function generateId() {\n for (let i = 0; i < bytes / 4; i++) {\n // unsigned right shift drops decimal part of the number\n // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE\n SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4);\n }\n // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated\n for (let i = 0; i < bytes; i++) {\n if (SHARED_BUFFER[i] > 0) {\n break;\n }\n else if (i === bytes - 1) {\n SHARED_BUFFER[bytes - 1] = 1;\n }\n }\n return SHARED_BUFFER.toString('hex', 0, bytes);\n };\n}\n//# sourceMappingURL=RandomIdGenerator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEnv = void 0;\nconst os = require(\"os\");\nconst environment_1 = require(\"../../utils/environment\");\n/**\n * Gets the environment variables\n */\nfunction getEnv() {\n const processEnv = (0, environment_1.parseEnvironment)(process.env);\n return Object.assign({\n HOSTNAME: os.hostname(),\n }, environment_1.DEFAULT_ENVIRONMENT, processEnv);\n}\nexports.getEnv = getEnv;\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._globalThis = void 0;\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexports._globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hexToBase64 = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction hexToBase64(hexStr) {\n const hexStrLen = hexStr.length;\n let hexAsciiCharsStr = '';\n for (let i = 0; i < hexStrLen; i += 2) {\n const hexPair = hexStr.substring(i, i + 2);\n const hexVal = parseInt(hexPair, 16);\n hexAsciiCharsStr += String.fromCharCode(hexVal);\n }\n return Buffer.from(hexAsciiCharsStr, 'ascii').toString('base64');\n}\nexports.hexToBase64 = hexToBase64;\n//# sourceMappingURL=hex-to-base64.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./environment\"), exports);\n__exportStar(require(\"./globalThis\"), exports);\n__exportStar(require(\"./hex-to-base64\"), exports);\n__exportStar(require(\"./RandomIdGenerator\"), exports);\n__exportStar(require(\"./performance\"), exports);\n__exportStar(require(\"./sdk-info\"), exports);\n__exportStar(require(\"./timer-util\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.otperformance = void 0;\nconst perf_hooks_1 = require(\"perf_hooks\");\nexports.otperformance = perf_hooks_1.performance;\n//# sourceMappingURL=performance.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SDK_INFO = void 0;\nconst version_1 = require(\"../../version\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\n/** Constants describing the SDK in use */\nexports.SDK_INFO = {\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'node',\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TelemetrySdkLanguageValues.NODEJS,\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: version_1.VERSION,\n};\n//# sourceMappingURL=sdk-info.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unrefTimer = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction unrefTimer(timer) {\n timer.unref();\n}\nexports.unrefTimer = unrefTimer;\n//# sourceMappingURL=timer-util.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompositePropagator = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Combines multiple propagators into a single propagator. */\nclass CompositePropagator {\n /**\n * Construct a composite propagator from a list of propagators.\n *\n * @param [config] Configuration object for composite propagator\n */\n constructor(config = {}) {\n var _a;\n this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : [];\n this._fields = Array.from(new Set(this._propagators\n // older propagators may not have fields function, null check to be sure\n .map(p => (typeof p.fields === 'function' ? p.fields() : []))\n .reduce((x, y) => x.concat(y), [])));\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same carrier key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to inject\n * @param carrier Carrier into which context will be injected\n */\n inject(context, carrier, setter) {\n for (const propagator of this._propagators) {\n try {\n propagator.inject(context, carrier, setter);\n }\n catch (err) {\n api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n }\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same context key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to add values to\n * @param carrier Carrier from which to extract context\n */\n extract(context, carrier, getter) {\n return this._propagators.reduce((ctx, propagator) => {\n try {\n return propagator.extract(ctx, carrier, getter);\n }\n catch (err) {\n api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n return ctx;\n }, context);\n }\n fields() {\n // return a new array so our fields cannot be modified\n return this._fields.slice();\n }\n}\nexports.CompositePropagator = CompositePropagator;\n//# sourceMappingURL=composite.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IdGenerator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceState = void 0;\nconst validators_1 = require(\"../internal/validators\");\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nclass TraceState {\n constructor(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n set(key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n const traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n }\n unset(key) {\n const traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n }\n get(key) {\n return this._internalState.get(key);\n }\n serialize() {\n return this._keys()\n .reduce((agg, key) => {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n }\n _parse(rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce((agg, part) => {\n const listMember = part.trim(); // Optional Whitespace (OWS) handling\n const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n const key = listMember.slice(0, i);\n const value = listMember.slice(i + 1, part.length);\n if ((0, validators_1.validateKey)(key) && (0, validators_1.validateValue)(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n }\n _keys() {\n return Array.from(this._internalState.keys()).reverse();\n }\n _clone() {\n const traceState = new TraceState();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n }\n}\nexports.TraceState = TraceState;\n//# sourceMappingURL=TraceState.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst suppress_tracing_1 = require(\"./suppress-tracing\");\nconst TraceState_1 = require(\"./TraceState\");\nexports.TRACE_PARENT_HEADER = 'traceparent';\nexports.TRACE_STATE_HEADER = 'tracestate';\nconst VERSION = '00';\nconst VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nconst TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nconst PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nconst FLAGS_PART = '[\\\\da-f]{2}';\nconst TRACE_PARENT_REGEX = new RegExp(`^\\\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\\\s?$`);\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n * It should be dynamically generated server side to have the server's request trace Id,\n * a parent span Id that was set on the server's request span,\n * and the trace flags to indicate the server's sampling decision\n * (01 = sampled, 00 = not sampled).\n * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n * For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nfunction parseTraceParent(traceParent) {\n const match = TRACE_PARENT_REGEX.exec(traceParent);\n if (!match)\n return null;\n // According to the specification the implementation should be compatible\n // with future versions. If there are more parts, we only reject it if it's using version 00\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n if (match[1] === '00' && match[5])\n return null;\n return {\n traceId: match[2],\n spanId: match[3],\n traceFlags: parseInt(match[4], 16),\n };\n}\nexports.parseTraceParent = parseTraceParent;\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nclass W3CTraceContextPropagator {\n inject(context, carrier, setter) {\n const spanContext = api_1.trace.getSpanContext(context);\n if (!spanContext ||\n (0, suppress_tracing_1.isTracingSuppressed)(context) ||\n !(0, api_1.isSpanContextValid)(spanContext))\n return;\n const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`;\n setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent);\n if (spanContext.traceState) {\n setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize());\n }\n }\n extract(context, carrier, getter) {\n const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER);\n if (!traceParentHeader)\n return context;\n const traceParent = Array.isArray(traceParentHeader)\n ? traceParentHeader[0]\n : traceParentHeader;\n if (typeof traceParent !== 'string')\n return context;\n const spanContext = parseTraceParent(traceParent);\n if (!spanContext)\n return context;\n spanContext.isRemote = true;\n const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER);\n if (traceStateHeader) {\n // If more than one `tracestate` header is found, we merge them into a\n // single header.\n const state = Array.isArray(traceStateHeader)\n ? traceStateHeader.join(',')\n : traceStateHeader;\n spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined);\n }\n return api_1.trace.setSpanContext(context, spanContext);\n }\n fields() {\n return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER];\n }\n}\nexports.W3CTraceContextPropagator = W3CTraceContextPropagator;\n//# sourceMappingURL=W3CTraceContextPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst RPC_METADATA_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key RPC_METADATA');\nvar RPCType;\n(function (RPCType) {\n RPCType[\"HTTP\"] = \"http\";\n})(RPCType = exports.RPCType || (exports.RPCType = {}));\nfunction setRPCMetadata(context, meta) {\n return context.setValue(RPC_METADATA_KEY, meta);\n}\nexports.setRPCMetadata = setRPCMetadata;\nfunction deleteRPCMetadata(context) {\n return context.deleteValue(RPC_METADATA_KEY);\n}\nexports.deleteRPCMetadata = deleteRPCMetadata;\nfunction getRPCMetadata(context) {\n return context.getValue(RPC_METADATA_KEY);\n}\nexports.getRPCMetadata = getRPCMetadata;\n//# sourceMappingURL=rpc-metadata.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AlwaysOffSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples no traces. */\nclass AlwaysOffSampler {\n shouldSample() {\n return {\n decision: api_1.SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return 'AlwaysOffSampler';\n }\n}\nexports.AlwaysOffSampler = AlwaysOffSampler;\n//# sourceMappingURL=AlwaysOffSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AlwaysOnSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples all traces. */\nclass AlwaysOnSampler {\n shouldSample() {\n return {\n decision: api_1.SamplingDecision.RECORD_AND_SAMPLED,\n };\n }\n toString() {\n return 'AlwaysOnSampler';\n }\n}\nexports.AlwaysOnSampler = AlwaysOnSampler;\n//# sourceMappingURL=AlwaysOnSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParentBasedSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst global_error_handler_1 = require(\"../../common/global-error-handler\");\nconst AlwaysOffSampler_1 = require(\"./AlwaysOffSampler\");\nconst AlwaysOnSampler_1 = require(\"./AlwaysOnSampler\");\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nclass ParentBasedSampler {\n constructor(config) {\n var _a, _b, _c, _d;\n this._root = config.root;\n if (!this._root) {\n (0, global_error_handler_1.globalErrorHandler)(new Error('ParentBasedSampler must have a root sampler configured'));\n this._root = new AlwaysOnSampler_1.AlwaysOnSampler();\n }\n this._remoteParentSampled =\n (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler();\n this._remoteParentNotSampled =\n (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler();\n this._localParentSampled =\n (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler();\n this._localParentNotSampled =\n (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler();\n }\n shouldSample(context, traceId, spanName, spanKind, attributes, links) {\n const parentContext = api_1.trace.getSpanContext(context);\n if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) {\n return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.isRemote) {\n if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {\n return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {\n return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n toString() {\n return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;\n }\n}\nexports.ParentBasedSampler = ParentBasedSampler;\n//# sourceMappingURL=ParentBasedSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceIdRatioBasedSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nclass TraceIdRatioBasedSampler {\n constructor(_ratio = 0) {\n this._ratio = _ratio;\n this._ratio = this._normalize(_ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n shouldSample(context, traceId) {\n return {\n decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound\n ? api_1.SamplingDecision.RECORD_AND_SAMPLED\n : api_1.SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n _normalize(ratio) {\n if (typeof ratio !== 'number' || isNaN(ratio))\n return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n _accumulate(traceId) {\n let accumulation = 0;\n for (let i = 0; i < traceId.length / 8; i++) {\n const pos = i * 8;\n const part = parseInt(traceId.slice(pos, pos + 8), 16);\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\nexports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler;\n//# sourceMappingURL=TraceIdRatioBasedSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst SUPPRESS_TRACING_KEY = (0, api_1.createContextKey)('OpenTelemetry SDK Context Key SUPPRESS_TRACING');\nfunction suppressTracing(context) {\n return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\nexports.suppressTracing = suppressTracing;\nfunction unsuppressTracing(context) {\n return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\nexports.unsuppressTracing = unsuppressTracing;\nfunction isTracingSuppressed(context) {\n return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\nexports.isTracingSuppressed = isTracingSuppressed;\n//# sourceMappingURL=suppress-tracing.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindOnceFuture = void 0;\nconst promise_1 = require(\"./promise\");\n/**\n * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked.\n */\nclass BindOnceFuture {\n constructor(_callback, _that) {\n this._callback = _callback;\n this._that = _that;\n this._isCalled = false;\n this._deferred = new promise_1.Deferred();\n }\n get isCalled() {\n return this._isCalled;\n }\n get promise() {\n return this._deferred.promise;\n }\n call(...args) {\n if (!this._isCalled) {\n this._isCalled = true;\n try {\n Promise.resolve(this._callback.call(this._that, ...args))\n .then(val => this._deferred.resolve(val), err => this._deferred.reject(err));\n }\n catch (err) {\n this._deferred.reject(err);\n }\n }\n return this._deferred.promise;\n }\n}\nexports.BindOnceFuture = BindOnceFuture;\n//# sourceMappingURL=callback.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst sampling_1 = require(\"./sampling\");\nconst DEFAULT_LIST_SEPARATOR = ',';\n/**\n * Environment interface to define all names\n */\nconst ENVIRONMENT_NUMBERS_KEYS = [\n 'OTEL_BSP_EXPORT_TIMEOUT',\n 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE',\n 'OTEL_BSP_MAX_QUEUE_SIZE',\n 'OTEL_BSP_SCHEDULE_DELAY',\n 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT',\n 'OTEL_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT',\n 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_EVENT_COUNT_LIMIT',\n 'OTEL_SPAN_LINK_COUNT_LIMIT',\n 'OTEL_EXPORTER_OTLP_TIMEOUT',\n 'OTEL_EXPORTER_OTLP_TRACES_TIMEOUT',\n 'OTEL_EXPORTER_OTLP_METRICS_TIMEOUT',\n 'OTEL_EXPORTER_JAEGER_AGENT_PORT',\n];\nfunction isEnvVarANumber(key) {\n return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1);\n}\nconst ENVIRONMENT_LISTS_KEYS = [\n 'OTEL_NO_PATCH_MODULES',\n 'OTEL_PROPAGATORS',\n];\nfunction isEnvVarAList(key) {\n return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1;\n}\nexports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;\nexports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;\n/**\n * Default environment variables\n */\nexports.DEFAULT_ENVIRONMENT = {\n CONTAINER_NAME: '',\n ECS_CONTAINER_METADATA_URI_V4: '',\n ECS_CONTAINER_METADATA_URI: '',\n HOSTNAME: '',\n KUBERNETES_SERVICE_HOST: '',\n NAMESPACE: '',\n OTEL_BSP_EXPORT_TIMEOUT: 30000,\n OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512,\n OTEL_BSP_MAX_QUEUE_SIZE: 2048,\n OTEL_BSP_SCHEDULE_DELAY: 5000,\n OTEL_EXPORTER_JAEGER_AGENT_HOST: '',\n OTEL_EXPORTER_JAEGER_AGENT_PORT: 6832,\n OTEL_EXPORTER_JAEGER_ENDPOINT: '',\n OTEL_EXPORTER_JAEGER_PASSWORD: '',\n OTEL_EXPORTER_JAEGER_USER: '',\n OTEL_EXPORTER_OTLP_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_HEADERS: '',\n OTEL_EXPORTER_OTLP_TRACES_HEADERS: '',\n OTEL_EXPORTER_OTLP_METRICS_HEADERS: '',\n OTEL_EXPORTER_OTLP_TIMEOUT: 10000,\n OTEL_EXPORTER_OTLP_TRACES_TIMEOUT: 10000,\n OTEL_EXPORTER_OTLP_METRICS_TIMEOUT: 10000,\n OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans',\n OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO,\n OTEL_NO_PATCH_MODULES: [],\n OTEL_PROPAGATORS: ['tracecontext', 'baggage'],\n OTEL_RESOURCE_ATTRIBUTES: '',\n OTEL_SERVICE_NAME: '',\n OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT,\n OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT,\n OTEL_SPAN_EVENT_COUNT_LIMIT: 128,\n OTEL_SPAN_LINK_COUNT_LIMIT: 128,\n OTEL_TRACES_EXPORTER: 'none',\n OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn,\n OTEL_TRACES_SAMPLER_ARG: '',\n OTEL_EXPORTER_OTLP_INSECURE: '',\n OTEL_EXPORTER_OTLP_TRACES_INSECURE: '',\n OTEL_EXPORTER_OTLP_METRICS_INSECURE: '',\n OTEL_EXPORTER_OTLP_CERTIFICATE: '',\n OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE: '',\n OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE: '',\n OTEL_EXPORTER_OTLP_COMPRESSION: '',\n OTEL_EXPORTER_OTLP_TRACES_COMPRESSION: '',\n OTEL_EXPORTER_OTLP_METRICS_COMPRESSION: '',\n OTEL_EXPORTER_OTLP_CLIENT_KEY: '',\n OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY: '',\n OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY: '',\n OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE: '',\n OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE: '',\n OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE: ''\n};\n/**\n * Parses a variable as number with number validation\n * @param name\n * @param environment\n * @param values\n * @param min\n * @param max\n */\nfunction parseNumber(name, environment, values, min = -Infinity, max = Infinity) {\n if (typeof values[name] !== 'undefined') {\n const value = Number(values[name]);\n if (!isNaN(value)) {\n if (value < min) {\n environment[name] = min;\n }\n else if (value > max) {\n environment[name] = max;\n }\n else {\n environment[name] = value;\n }\n }\n }\n}\n/**\n * Parses list-like strings from input into output.\n * @param name\n * @param environment\n * @param values\n * @param separator\n */\nfunction parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) {\n const givenValue = input[name];\n if (typeof givenValue === 'string') {\n output[name] = givenValue.split(separator).map(v => v.trim());\n }\n}\n// The support string -> DiagLogLevel mappings\nconst logLevelMap = {\n ALL: api_1.DiagLogLevel.ALL,\n VERBOSE: api_1.DiagLogLevel.VERBOSE,\n DEBUG: api_1.DiagLogLevel.DEBUG,\n INFO: api_1.DiagLogLevel.INFO,\n WARN: api_1.DiagLogLevel.WARN,\n ERROR: api_1.DiagLogLevel.ERROR,\n NONE: api_1.DiagLogLevel.NONE,\n};\n/**\n * Environmentally sets log level if valid log level string is provided\n * @param key\n * @param environment\n * @param values\n */\nfunction setLogLevelFromEnv(key, environment, values) {\n const value = values[key];\n if (typeof value === 'string') {\n const theLevel = logLevelMap[value.toUpperCase()];\n if (theLevel != null) {\n environment[key] = theLevel;\n }\n }\n}\n/**\n * Parses environment values\n * @param values\n */\nfunction parseEnvironment(values) {\n const environment = {};\n for (const env in exports.DEFAULT_ENVIRONMENT) {\n const key = env;\n switch (key) {\n case 'OTEL_LOG_LEVEL':\n setLogLevelFromEnv(key, environment, values);\n break;\n default:\n if (isEnvVarANumber(key)) {\n parseNumber(key, environment, values);\n }\n else if (isEnvVarAList(key)) {\n parseStringList(key, environment, values);\n }\n else {\n const value = values[key];\n if (typeof value !== 'undefined' && value !== null) {\n environment[key] = String(value);\n }\n }\n }\n }\n return environment;\n}\nexports.parseEnvironment = parseEnvironment;\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isPlainObject = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * based on lodash in order to support esm builds without esModuleInterop.\n * lodash is using MIT License.\n **/\nconst objectTag = '[object Object]';\nconst nullTag = '[object Null]';\nconst undefinedTag = '[object Undefined]';\nconst funcProto = Function.prototype;\nconst funcToString = funcProto.toString;\nconst objectCtorString = funcToString.call(Object);\nconst getPrototype = overArg(Object.getPrototypeOf, Object);\nconst objectProto = Object.prototype;\nconst hasOwnProperty = objectProto.hasOwnProperty;\nconst symToStringTag = Symbol ? Symbol.toStringTag : undefined;\nconst nativeObjectToString = objectProto.toString;\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function (arg) {\n return func(transform(arg));\n };\n}\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {\n return false;\n }\n const proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) === objectCtorString;\n}\nexports.isPlainObject = isPlainObject;\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];\n let unmasked = false;\n try {\n value[symToStringTag] = undefined;\n unmasked = true;\n }\n catch (e) {\n // silence\n }\n const result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n }\n else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n//# sourceMappingURL=lodash.merge.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.merge = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst lodash_merge_1 = require(\"./lodash.merge\");\nconst MAX_LEVEL = 20;\n/**\n * Merges objects together\n * @param args - objects / values to be merged\n */\nfunction merge(...args) {\n let result = args.shift();\n const objects = new WeakMap();\n while (args.length > 0) {\n result = mergeTwoObjects(result, args.shift(), 0, objects);\n }\n return result;\n}\nexports.merge = merge;\nfunction takeValue(value) {\n if (isArray(value)) {\n return value.slice();\n }\n return value;\n}\n/**\n * Merges two objects\n * @param one - first object\n * @param two - second object\n * @param level - current deep level\n * @param objects - objects holder that has been already referenced - to prevent\n * cyclic dependency\n */\nfunction mergeTwoObjects(one, two, level = 0, objects) {\n let result;\n if (level > MAX_LEVEL) {\n return undefined;\n }\n level++;\n if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) {\n result = takeValue(two);\n }\n else if (isArray(one)) {\n result = one.slice();\n if (isArray(two)) {\n for (let i = 0, j = two.length; i < j; i++) {\n result.push(takeValue(two[i]));\n }\n }\n else if (isObject(two)) {\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n result[key] = takeValue(two[key]);\n }\n }\n }\n else if (isObject(one)) {\n if (isObject(two)) {\n if (!shouldMerge(one, two)) {\n return two;\n }\n result = Object.assign({}, one);\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n const twoValue = two[key];\n if (isPrimitive(twoValue)) {\n if (typeof twoValue === 'undefined') {\n delete result[key];\n }\n else {\n // result[key] = takeValue(twoValue);\n result[key] = twoValue;\n }\n }\n else {\n const obj1 = result[key];\n const obj2 = twoValue;\n if (wasObjectReferenced(one, key, objects) ||\n wasObjectReferenced(two, key, objects)) {\n delete result[key];\n }\n else {\n if (isObject(obj1) && isObject(obj2)) {\n const arr1 = objects.get(obj1) || [];\n const arr2 = objects.get(obj2) || [];\n arr1.push({ obj: one, key });\n arr2.push({ obj: two, key });\n objects.set(obj1, arr1);\n objects.set(obj2, arr2);\n }\n result[key] = mergeTwoObjects(result[key], twoValue, level, objects);\n }\n }\n }\n }\n else {\n result = two;\n }\n }\n return result;\n}\n/**\n * Function to check if object has been already reference\n * @param obj\n * @param key\n * @param objects\n */\nfunction wasObjectReferenced(obj, key, objects) {\n const arr = objects.get(obj[key]) || [];\n for (let i = 0, j = arr.length; i < j; i++) {\n const info = arr[i];\n if (info.key === key && info.obj === obj) {\n return true;\n }\n }\n return false;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isObject(value) {\n return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === 'object';\n}\nfunction isPrimitive(value) {\n return typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'undefined' ||\n value instanceof Date ||\n value instanceof RegExp ||\n value === null;\n}\nfunction shouldMerge(one, two) {\n if (!(0, lodash_merge_1.isPlainObject)(one) || !(0, lodash_merge_1.isPlainObject)(two)) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=merge.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Deferred = void 0;\nclass Deferred {\n constructor() {\n this._promise = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n get promise() {\n return this._promise;\n }\n resolve(val) {\n this._resolve(val);\n }\n reject(err) {\n this._reject(err);\n }\n}\nexports.Deferred = Deferred;\n//# sourceMappingURL=promise.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TracesSamplerValues = void 0;\nvar TracesSamplerValues;\n(function (TracesSamplerValues) {\n TracesSamplerValues[\"AlwaysOff\"] = \"always_off\";\n TracesSamplerValues[\"AlwaysOn\"] = \"always_on\";\n TracesSamplerValues[\"ParentBasedAlwaysOff\"] = \"parentbased_always_off\";\n TracesSamplerValues[\"ParentBasedAlwaysOn\"] = \"parentbased_always_on\";\n TracesSamplerValues[\"ParentBasedTraceIdRatio\"] = \"parentbased_traceidratio\";\n TracesSamplerValues[\"TraceIdRatio\"] = \"traceidratio\";\n})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {}));\n//# sourceMappingURL=sampling.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isUrlIgnored = exports.urlMatches = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction urlMatches(url, urlToMatch) {\n if (typeof urlToMatch === 'string') {\n return url === urlToMatch;\n }\n else {\n return !!url.match(urlToMatch);\n }\n}\nexports.urlMatches = urlMatches;\n/**\n * Check if {@param url} should be ignored when comparing against {@param ignoredUrls}\n * @param url\n * @param ignoredUrls\n */\nfunction isUrlIgnored(url, ignoredUrls) {\n if (!ignoredUrls) {\n return false;\n }\n for (const ignoreUrl of ignoredUrls) {\n if (urlMatches(url, ignoreUrl)) {\n return true;\n }\n }\n return false;\n}\nexports.isUrlIgnored = isUrlIgnored;\n//# sourceMappingURL=url.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isWrapped = void 0;\n/**\n * Checks if certain function has been already wrapped\n * @param func\n */\nfunction isWrapped(func) {\n return (typeof func === 'function' &&\n typeof func.__original === 'function' &&\n typeof func.__unwrap === 'function' &&\n func.__wrapped === true);\n}\nexports.isWrapped = isWrapped;\n//# sourceMappingURL=wrap.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VERSION = void 0;\n// this is autogenerated file, see scripts/version-update.js\nexports.VERSION = '1.4.0';\n//# sourceMappingURL=version.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLPExporterBase = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * Collector Exporter abstract base class\n */\nclass OTLPExporterBase {\n /**\n * @param config\n */\n constructor(config = {}) {\n this._isShutdown = false;\n this._shuttingDownPromise = Promise.resolve();\n this._sendingPromises = [];\n this.url = this.getDefaultUrl(config);\n if (typeof config.hostname === 'string') {\n this.hostname = config.hostname;\n }\n this.attributes = config.attributes;\n this.shutdown = this.shutdown.bind(this);\n this._concurrencyLimit =\n typeof config.concurrencyLimit === 'number'\n ? config.concurrencyLimit\n : Infinity;\n // platform dependent\n this.onInit(config);\n }\n /**\n * Export items.\n * @param items\n * @param resultCallback\n */\n export(items, resultCallback) {\n if (this._isShutdown) {\n resultCallback({\n code: core_1.ExportResultCode.FAILED,\n error: new Error('Exporter has been shutdown'),\n });\n return;\n }\n if (this._sendingPromises.length >= this._concurrencyLimit) {\n resultCallback({\n code: core_1.ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n this._export(items)\n .then(() => {\n resultCallback({ code: core_1.ExportResultCode.SUCCESS });\n })\n .catch((error) => {\n resultCallback({ code: core_1.ExportResultCode.FAILED, error });\n });\n }\n _export(items) {\n return new Promise((resolve, reject) => {\n try {\n api_1.diag.debug('items to be sent', items);\n this.send(items, resolve, reject);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n /**\n * Shutdown the exporter.\n */\n shutdown() {\n if (this._isShutdown) {\n api_1.diag.debug('shutdown already started');\n return this._shuttingDownPromise;\n }\n this._isShutdown = true;\n api_1.diag.debug('shutdown started');\n this._shuttingDownPromise = new Promise((resolve, reject) => {\n Promise.resolve()\n .then(() => {\n return this.onShutdown();\n })\n .then(() => {\n return Promise.all(this._sendingPromises);\n })\n .then(() => {\n resolve();\n })\n .catch(e => {\n reject(e);\n });\n });\n return this._shuttingDownPromise;\n }\n}\nexports.OTLPExporterBase = OTLPExporterBase;\n//# sourceMappingURL=OTLPExporterBase.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.appendResourcePathToUrlIfNotPresent = exports.toOTLPExportTraceServiceRequest = exports.toCollectorResource = exports.otlpTypes = void 0;\n__exportStar(require(\"./OTLPExporterBase\"), exports);\n__exportStar(require(\"./platform\"), exports);\nexports.otlpTypes = require(\"./types\");\nvar transform_1 = require(\"./transform\");\nObject.defineProperty(exports, \"toCollectorResource\", { enumerable: true, get: function () { return transform_1.toCollectorResource; } });\nObject.defineProperty(exports, \"toOTLPExportTraceServiceRequest\", { enumerable: true, get: function () { return transform_1.toOTLPExportTraceServiceRequest; } });\nvar util_1 = require(\"./util\");\nObject.defineProperty(exports, \"appendResourcePathToUrlIfNotPresent\", { enumerable: true, get: function () { return util_1.appendResourcePathToUrlIfNotPresent; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLPExporterBrowserBase = void 0;\nconst OTLPExporterBase_1 = require(\"../../OTLPExporterBase\");\nconst util_1 = require(\"../../util\");\nconst util_2 = require(\"./util\");\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * Collector Metric Exporter abstract base class\n */\nclass OTLPExporterBrowserBase extends OTLPExporterBase_1.OTLPExporterBase {\n /**\n * @param config\n */\n constructor(config = {}) {\n super(config);\n this._useXHR = false;\n this._useXHR =\n !!config.headers || typeof navigator.sendBeacon !== 'function';\n if (this._useXHR) {\n this._headers = Object.assign({}, util_1.parseHeaders(config.headers), core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_HEADERS));\n }\n else {\n this._headers = {};\n }\n }\n onInit() {\n window.addEventListener('unload', this.shutdown);\n }\n onShutdown() {\n window.removeEventListener('unload', this.shutdown);\n }\n send(items, onSuccess, onError) {\n if (this._isShutdown) {\n api_1.diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n const serviceRequest = this.convert(items);\n const body = JSON.stringify(serviceRequest);\n const promise = new Promise((resolve, reject) => {\n if (this._useXHR) {\n util_2.sendWithXhr(body, this.url, this._headers, resolve, reject);\n }\n else {\n util_2.sendWithBeacon(body, this.url, { type: 'application/json' }, resolve, reject);\n }\n })\n .then(onSuccess, onError);\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n}\nexports.OTLPExporterBrowserBase = OTLPExporterBrowserBase;\n//# sourceMappingURL=OTLPExporterBrowserBase.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLPTraceExporter = void 0;\nconst OTLPExporterBrowserBase_1 = require(\"./OTLPExporterBrowserBase\");\nconst transform_1 = require(\"../../transform\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst util_1 = require(\"../../util\");\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n/**\n * Collector Trace Exporter for Web\n */\nclass OTLPTraceExporter extends OTLPExporterBrowserBase_1.OTLPExporterBrowserBase {\n constructor(config = {}) {\n super(config);\n this._headers = Object.assign(this._headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));\n }\n convert(spans) {\n return transform_1.toOTLPExportTraceServiceRequest(spans, this, true);\n }\n getDefaultUrl(config) {\n return typeof config.url === 'string'\n ? config.url\n : core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\n : core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? util_1.appendResourcePathToUrlIfNotPresent(core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\nexports.OTLPTraceExporter = OTLPTraceExporter;\n//# sourceMappingURL=OTLPTraceExporter.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./OTLPTraceExporter\"), exports);\n__exportStar(require(\"./OTLPExporterBrowserBase\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendWithXhr = exports.sendWithBeacon = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst api_1 = require(\"@opentelemetry/api\");\nconst otlpTypes = require(\"../../types\");\n/**\n * Send metrics/spans using browser navigator.sendBeacon\n * @param body\n * @param onSuccess\n * @param onError\n */\nfunction sendWithBeacon(body, url, blobPropertyBag, onSuccess, onError) {\n if (navigator.sendBeacon(url, new Blob([body], blobPropertyBag))) {\n api_1.diag.debug('sendBeacon - can send', body);\n onSuccess();\n }\n else {\n const error = new otlpTypes.OTLPExporterError(`sendBeacon - cannot send ${body}`);\n onError(error);\n }\n}\nexports.sendWithBeacon = sendWithBeacon;\n/**\n * function to send metrics/spans using browser XMLHttpRequest\n * used when navigator.sendBeacon is not available\n * @param body\n * @param onSuccess\n * @param onError\n */\nfunction sendWithXhr(body, url, headers, onSuccess, onError) {\n const xhr = new XMLHttpRequest();\n xhr.open('POST', url);\n const defaultHeaders = {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n };\n Object.entries(Object.assign(Object.assign({}, defaultHeaders), headers)).forEach(([k, v]) => {\n xhr.setRequestHeader(k, v);\n });\n xhr.send(body);\n xhr.onreadystatechange = () => {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status >= 200 && xhr.status <= 299) {\n api_1.diag.debug('xhr success', body);\n onSuccess();\n }\n else {\n const error = new otlpTypes.OTLPExporterError(`Failed to export with XHR (status: ${xhr.status})`, xhr.status);\n onError(error);\n }\n }\n };\n}\nexports.sendWithXhr = sendWithXhr;\n//# sourceMappingURL=util.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLPExporterBrowserBase = void 0;\n__exportStar(require(\"./node\"), exports);\nvar browser_1 = require(\"./browser\");\nObject.defineProperty(exports, \"OTLPExporterBrowserBase\", { enumerable: true, get: function () { return browser_1.OTLPExporterBrowserBase; } });\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLPExporterNodeBase = void 0;\nconst OTLPExporterBase_1 = require(\"../../OTLPExporterBase\");\nconst types_1 = require(\"./types\");\nconst util_1 = require(\"../../util\");\nconst util_2 = require(\"./util\");\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * Collector Metric Exporter abstract base class\n */\nclass OTLPExporterNodeBase extends OTLPExporterBase_1.OTLPExporterBase {\n constructor(config = {}) {\n super(config);\n this.DEFAULT_HEADERS = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n if (config.metadata) {\n api_1.diag.warn('Metadata cannot be set when using http');\n }\n this.headers = Object.assign(this.DEFAULT_HEADERS, util_1.parseHeaders(config.headers), core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_HEADERS));\n this.agent = util_2.createHttpAgent(config);\n this.compression = config.compression || types_1.CompressionAlgorithm.NONE;\n }\n onInit(_config) {\n this._isShutdown = false;\n }\n send(objects, onSuccess, onError) {\n if (this._isShutdown) {\n api_1.diag.debug('Shutdown already started. Cannot send objects');\n return;\n }\n const serviceRequest = this.convert(objects);\n const promise = new Promise((resolve, reject) => {\n util_2.sendWithHttp(this, JSON.stringify(serviceRequest), 'application/json', resolve, reject);\n })\n .then(onSuccess, onError);\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n // TODO: end gzip stream from util.ts if not undefined\n // It should perhaps be a class member here instead of a variable in util.ts\n onShutdown() { }\n}\nexports.OTLPExporterNodeBase = OTLPExporterNodeBase;\n//# sourceMappingURL=OTLPExporterNodeBase.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLPTraceExporter = void 0;\nconst OTLPExporterNodeBase_1 = require(\"./OTLPExporterNodeBase\");\nconst transform_1 = require(\"../../transform\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst util_1 = require(\"../../util\");\nconst DEFAULT_COLLECTOR_RESOURCE_PATH = '/v1/traces';\nconst DEFAULT_COLLECTOR_URL = `http://localhost:55681${DEFAULT_COLLECTOR_RESOURCE_PATH}`;\n/**\n * Collector Trace Exporter for Node\n */\nclass OTLPTraceExporter extends OTLPExporterNodeBase_1.OTLPExporterNodeBase {\n constructor(config = {}) {\n super(config);\n this.headers = Object.assign(this.headers, core_1.baggageUtils.parseKeyPairsIntoRecord(core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_HEADERS));\n }\n convert(spans) {\n return transform_1.toOTLPExportTraceServiceRequest(spans, this, true);\n }\n getDefaultUrl(config) {\n return typeof config.url === 'string'\n ? config.url\n : core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length > 0\n ? core_1.getEnv().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT\n : core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT.length > 0\n ? util_1.appendResourcePathToUrlIfNotPresent(core_1.getEnv().OTEL_EXPORTER_OTLP_ENDPOINT, DEFAULT_COLLECTOR_RESOURCE_PATH)\n : DEFAULT_COLLECTOR_URL;\n }\n}\nexports.OTLPTraceExporter = OTLPTraceExporter;\n//# sourceMappingURL=OTLPTraceExporter.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./OTLPTraceExporter\"), exports);\n__exportStar(require(\"./OTLPExporterNodeBase\"), exports);\n__exportStar(require(\"./util\"), exports);\n__exportStar(require(\"./types\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompressionAlgorithm = void 0;\nvar CompressionAlgorithm;\n(function (CompressionAlgorithm) {\n CompressionAlgorithm[\"NONE\"] = \"none\";\n CompressionAlgorithm[\"GZIP\"] = \"gzip\";\n})(CompressionAlgorithm = exports.CompressionAlgorithm || (exports.CompressionAlgorithm = {}));\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createHttpAgent = exports.sendWithHttp = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst url = require(\"url\");\nconst http = require(\"http\");\nconst https = require(\"https\");\nconst zlib = require(\"zlib\");\nconst stream_1 = require(\"stream\");\nconst otlpTypes = require(\"../../types\");\nconst api_1 = require(\"@opentelemetry/api\");\nconst types_1 = require(\"./types\");\nlet gzip;\n/**\n * Sends data using http\n * @param collector\n * @param data\n * @param contentType\n * @param onSuccess\n * @param onError\n */\nfunction sendWithHttp(collector, data, contentType, onSuccess, onError) {\n const parsedUrl = new url.URL(collector.url);\n const options = {\n hostname: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.pathname,\n method: 'POST',\n headers: Object.assign({ 'Content-Length': Buffer.byteLength(data), 'Content-Type': contentType }, collector.headers),\n agent: collector.agent,\n };\n const request = parsedUrl.protocol === 'http:' ? http.request : https.request;\n const req = request(options, (res) => {\n let responseData = '';\n res.on('data', chunk => (responseData += chunk));\n res.on('end', () => {\n if (res.statusCode && res.statusCode < 299) {\n api_1.diag.debug(`statusCode: ${res.statusCode}`, responseData);\n onSuccess();\n }\n else {\n const error = new otlpTypes.OTLPExporterError(res.statusMessage, res.statusCode, responseData);\n onError(error);\n }\n });\n });\n req.on('error', (error) => {\n onError(error);\n });\n switch (collector.compression) {\n case types_1.CompressionAlgorithm.GZIP: {\n if (!gzip) {\n gzip = zlib.createGzip();\n }\n req.setHeader('Content-Encoding', 'gzip');\n const dataStream = readableFromBuffer(data);\n dataStream.on('error', onError)\n .pipe(gzip).on('error', onError)\n .pipe(req);\n break;\n }\n default:\n req.write(data);\n req.end();\n break;\n }\n}\nexports.sendWithHttp = sendWithHttp;\nfunction readableFromBuffer(buff) {\n const readable = new stream_1.Readable();\n readable.push(buff);\n readable.push(null);\n return readable;\n}\nfunction createHttpAgent(config) {\n if (config.httpAgentOptions && config.keepAlive === false) {\n api_1.diag.warn('httpAgentOptions is used only when keepAlive is true');\n return undefined;\n }\n if (config.keepAlive === false || !config.url)\n return undefined;\n try {\n const parsedUrl = new url.URL(config.url);\n const Agent = parsedUrl.protocol === 'http:' ? http.Agent : https.Agent;\n return new Agent(Object.assign({ keepAlive: true }, config.httpAgentOptions));\n }\n catch (err) {\n api_1.diag.error(`collector exporter failed to create http agent. err: ${err.message}`);\n return undefined;\n }\n}\nexports.createHttpAgent = createHttpAgent;\n//# sourceMappingURL=util.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.groupSpansByResourceAndLibrary = exports.toOTLPExportTraceServiceRequest = exports.toCollectorTraceState = exports.toCollectorKind = exports.toCollectorResource = exports.toCollectorStatus = exports.toCollectorSpan = exports.toCollectorEvents = exports.toCollectorAnyValue = exports.toCollectorAttributeKeyValue = exports.toCollectorKeyValueList = exports.toCollectorArrayValue = exports.toCollectorAttributes = void 0;\nconst core = require(\"@opentelemetry/core\");\nconst types_1 = require(\"./types\");\nconst MAX_INTEGER_VALUE = 2147483647;\nconst MIN_INTEGER_VALUE = -2147483648;\n/**\n * Converts attributes to KeyValue array\n * @param attributes\n */\nfunction toCollectorAttributes(attributes) {\n return Object.keys(attributes).map(key => {\n return toCollectorAttributeKeyValue(key, attributes[key]);\n });\n}\nexports.toCollectorAttributes = toCollectorAttributes;\n/**\n * Converts array of unknown value to ArrayValue\n * @param values\n */\nfunction toCollectorArrayValue(values) {\n return {\n values: values.map(value => toCollectorAnyValue(value)),\n };\n}\nexports.toCollectorArrayValue = toCollectorArrayValue;\n/**\n * Converts attributes to KeyValueList\n * @param attributes\n */\nfunction toCollectorKeyValueList(attributes) {\n return {\n values: toCollectorAttributes(attributes),\n };\n}\nexports.toCollectorKeyValueList = toCollectorKeyValueList;\n/**\n * Converts key and unknown value to KeyValue\n * @param value event value\n */\nfunction toCollectorAttributeKeyValue(key, value) {\n const anyValue = toCollectorAnyValue(value);\n return {\n key,\n value: anyValue,\n };\n}\nexports.toCollectorAttributeKeyValue = toCollectorAttributeKeyValue;\n/**\n * Converts unknown value to AnyValue\n * @param value\n */\nfunction toCollectorAnyValue(value) {\n const anyValue = {};\n if (typeof value === 'string') {\n anyValue.stringValue = value;\n }\n else if (typeof value === 'boolean') {\n anyValue.boolValue = value;\n }\n else if (typeof value === 'number' &&\n value <= MAX_INTEGER_VALUE &&\n value >= MIN_INTEGER_VALUE &&\n Number.isInteger(value)) {\n anyValue.intValue = value;\n }\n else if (typeof value === 'number') {\n anyValue.doubleValue = value;\n }\n else if (Array.isArray(value)) {\n anyValue.arrayValue = toCollectorArrayValue(value);\n }\n else if (value) {\n anyValue.kvlistValue = toCollectorKeyValueList(value);\n }\n return anyValue;\n}\nexports.toCollectorAnyValue = toCollectorAnyValue;\n/**\n *\n * Converts events\n * @param events array of events\n */\nfunction toCollectorEvents(timedEvents) {\n return timedEvents.map(timedEvent => {\n const timeUnixNano = core.hrTimeToNanoseconds(timedEvent.time);\n const name = timedEvent.name;\n const attributes = toCollectorAttributes(timedEvent.attributes || {});\n const droppedAttributesCount = 0;\n const protoEvent = {\n timeUnixNano,\n name,\n attributes,\n droppedAttributesCount,\n };\n return protoEvent;\n });\n}\nexports.toCollectorEvents = toCollectorEvents;\n/**\n * Converts links\n * @param span\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorLinks(span, useHex) {\n return span.links.map((link) => {\n const protoLink = {\n traceId: useHex\n ? link.context.traceId\n : core.hexToBase64(link.context.traceId),\n spanId: useHex\n ? link.context.spanId\n : core.hexToBase64(link.context.spanId),\n attributes: toCollectorAttributes(link.attributes || {}),\n droppedAttributesCount: 0,\n };\n return protoLink;\n });\n}\n/**\n * Converts span\n * @param span\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorSpan(span, useHex) {\n return {\n traceId: useHex\n ? span.spanContext().traceId\n : core.hexToBase64(span.spanContext().traceId),\n spanId: useHex\n ? span.spanContext().spanId\n : core.hexToBase64(span.spanContext().spanId),\n parentSpanId: span.parentSpanId\n ? useHex\n ? span.parentSpanId\n : core.hexToBase64(span.parentSpanId)\n : undefined,\n traceState: toCollectorTraceState(span.spanContext().traceState),\n name: span.name,\n kind: toCollectorKind(span.kind),\n startTimeUnixNano: core.hrTimeToNanoseconds(span.startTime),\n endTimeUnixNano: core.hrTimeToNanoseconds(span.endTime),\n attributes: toCollectorAttributes(span.attributes),\n droppedAttributesCount: 0,\n events: toCollectorEvents(span.events),\n droppedEventsCount: 0,\n status: toCollectorStatus(span.status),\n links: toCollectorLinks(span, useHex),\n droppedLinksCount: 0,\n };\n}\nexports.toCollectorSpan = toCollectorSpan;\n/**\n * Converts status\n * @param status\n */\nfunction toCollectorStatus(status) {\n const spanStatus = {\n code: status.code,\n };\n if (typeof status.message !== 'undefined') {\n spanStatus.message = status.message;\n }\n return spanStatus;\n}\nexports.toCollectorStatus = toCollectorStatus;\n/**\n * Converts resource\n * @param resource\n * @param additionalAttributes\n */\nfunction toCollectorResource(resource, additionalAttributes = {}) {\n const attr = Object.assign({}, additionalAttributes, resource ? resource.attributes : {});\n const resourceProto = {\n attributes: toCollectorAttributes(attr),\n droppedAttributesCount: 0,\n };\n return resourceProto;\n}\nexports.toCollectorResource = toCollectorResource;\n/**\n * Converts span kind\n * @param kind\n */\nfunction toCollectorKind(kind) {\n const collectorKind = types_1.OTLP_SPAN_KIND_MAPPING[kind];\n return typeof collectorKind === 'number'\n ? collectorKind\n : types_1.opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_UNSPECIFIED;\n}\nexports.toCollectorKind = toCollectorKind;\n/**\n * Converts traceState\n * @param traceState\n */\nfunction toCollectorTraceState(traceState) {\n if (!traceState)\n return undefined;\n return traceState.serialize();\n}\nexports.toCollectorTraceState = toCollectorTraceState;\n/**\n * Prepares trace service request to be sent to collector\n * @param spans spans\n * @param collectorExporterBase\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toOTLPExportTraceServiceRequest(spans, collectorTraceExporterBase, useHex) {\n const groupedSpans = groupSpansByResourceAndLibrary(spans);\n const additionalAttributes = Object.assign({}, collectorTraceExporterBase.attributes);\n return {\n resourceSpans: toCollectorResourceSpans(groupedSpans, additionalAttributes, useHex),\n };\n}\nexports.toOTLPExportTraceServiceRequest = toOTLPExportTraceServiceRequest;\n/**\n * Takes an array of spans and groups them by resource and instrumentation\n * library\n * @param spans spans\n */\nfunction groupSpansByResourceAndLibrary(spans) {\n return spans.reduce((spanMap, span) => {\n //group by resource\n let resourceSpans = spanMap.get(span.resource);\n if (!resourceSpans) {\n resourceSpans = new Map();\n spanMap.set(span.resource, resourceSpans);\n }\n //group by instrumentation library\n let libSpans = resourceSpans.get(span.instrumentationLibrary);\n if (!libSpans) {\n libSpans = new Array();\n resourceSpans.set(span.instrumentationLibrary, libSpans);\n }\n libSpans.push(span);\n return spanMap;\n }, new Map());\n}\nexports.groupSpansByResourceAndLibrary = groupSpansByResourceAndLibrary;\n/**\n * Convert to InstrumentationLibrarySpans\n * @param instrumentationLibrary\n * @param spans\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex) {\n return {\n spans: spans.map(span => toCollectorSpan(span, useHex)),\n instrumentationLibrary,\n };\n}\n/**\n * Returns a list of resource spans which will be exported to the collector\n * @param groupedSpans\n * @param baseAttributes\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorResourceSpans(groupedSpans, baseAttributes, useHex) {\n return Array.from(groupedSpans, ([resource, libSpans]) => {\n return {\n resource: toCollectorResource(resource, baseAttributes),\n instrumentationLibrarySpans: Array.from(libSpans, ([instrumentationLibrary, spans]) => toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex)),\n };\n });\n}\n//# sourceMappingURL=transform.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OTLP_SPAN_KIND_MAPPING = exports.OTLPExporterError = exports.opentelemetryProto = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/* eslint-disable @typescript-eslint/no-namespace */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nvar opentelemetryProto;\n(function (opentelemetryProto) {\n let metrics;\n (function (metrics) {\n let v1;\n (function (v1) {\n let AggregationTemporality;\n (function (AggregationTemporality) {\n // UNSPECIFIED is the default AggregationTemporality, it MUST not be used.\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_UNSPECIFIED\"] = 0] = \"AGGREGATION_TEMPORALITY_UNSPECIFIED\";\n // DELTA is an AggregationTemporality for a metric aggregator which reports\n // changes since last report time. Successive metrics contain aggregation of\n // values from continuous and non-overlapping intervals.\n //\n // The values for a DELTA metric are based only on the time interval\n // associated with one measurement cycle. There is no dependency on\n // previous measurements like is the case for CUMULATIVE metrics.\n //\n // For example, consider a system measuring the number of requests that\n // it receives and reports the sum of these requests every second as a\n // DELTA metric:\n //\n // 1. The system starts receiving at time=t_0.\n // 2. A request is received, the system measures 1 request.\n // 3. A request is received, the system measures 1 request.\n // 4. A request is received, the system measures 1 request.\n // 5. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+1 with a value of 3.\n // 6. A request is received, the system measures 1 request.\n // 7. A request is received, the system measures 1 request.\n // 8. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0+1 to\n // t_0+2 with a value of 2.\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_DELTA\"] = 1] = \"AGGREGATION_TEMPORALITY_DELTA\";\n // CUMULATIVE is an AggregationTemporality for a metric aggregator which\n // reports changes since a fixed start time. This means that current values\n // of a CUMULATIVE metric depend on all previous measurements since the\n // start time. Because of this, the sender is required to retain this state\n // in some form. If this state is lost or invalidated, the CUMULATIVE metric\n // values MUST be reset and a new fixed start time following the last\n // reported measurement time sent MUST be used.\n //\n // For example, consider a system measuring the number of requests that\n // it receives and reports the sum of these requests every second as a\n // CUMULATIVE metric:\n //\n // 1. The system starts receiving at time=t_0.\n // 2. A request is received, the system measures 1 request.\n // 3. A request is received, the system measures 1 request.\n // 4. A request is received, the system measures 1 request.\n // 5. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+1 with a value of 3.\n // 6. A request is received, the system measures 1 request.\n // 7. A request is received, the system measures 1 request.\n // 8. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_0 to\n // t_0+2 with a value of 5.\n // 9. The system experiences a fault and loses state.\n // 10. The system recovers and resumes receiving at time=t_1.\n // 11. A request is received, the system measures 1 request.\n // 12. The 1 second collection cycle ends. A metric is exported for the\n // number of requests received over the interval of time t_1 to\n // t_0+1 with a value of 1.\n //\n // Note: Even though, when reporting changes since last report time, using\n // CUMULATIVE is valid, it is not recommended. This may cause problems for\n // systems that do not use start_time to determine when the aggregation\n // value was reset (e.g. Prometheus).\n AggregationTemporality[AggregationTemporality[\"AGGREGATION_TEMPORALITY_CUMULATIVE\"] = 2] = \"AGGREGATION_TEMPORALITY_CUMULATIVE\";\n })(AggregationTemporality = v1.AggregationTemporality || (v1.AggregationTemporality = {}));\n })(v1 = metrics.v1 || (metrics.v1 = {}));\n })(metrics = opentelemetryProto.metrics || (opentelemetryProto.metrics = {}));\n let trace;\n (function (trace) {\n let v1;\n (function (v1) {\n let ConstantSampler;\n (function (ConstantSampler) {\n let ConstantDecision;\n (function (ConstantDecision) {\n ConstantDecision[ConstantDecision[\"ALWAYS_OFF\"] = 0] = \"ALWAYS_OFF\";\n ConstantDecision[ConstantDecision[\"ALWAYS_ON\"] = 1] = \"ALWAYS_ON\";\n ConstantDecision[ConstantDecision[\"ALWAYS_PARENT\"] = 2] = \"ALWAYS_PARENT\";\n })(ConstantDecision = ConstantSampler.ConstantDecision || (ConstantSampler.ConstantDecision = {}));\n })(ConstantSampler = v1.ConstantSampler || (v1.ConstantSampler = {}));\n let Span;\n (function (Span) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n let SpanKind;\n (function (SpanKind) {\n SpanKind[SpanKind[\"SPAN_KIND_UNSPECIFIED\"] = 0] = \"SPAN_KIND_UNSPECIFIED\";\n SpanKind[SpanKind[\"SPAN_KIND_INTERNAL\"] = 1] = \"SPAN_KIND_INTERNAL\";\n SpanKind[SpanKind[\"SPAN_KIND_SERVER\"] = 2] = \"SPAN_KIND_SERVER\";\n SpanKind[SpanKind[\"SPAN_KIND_CLIENT\"] = 3] = \"SPAN_KIND_CLIENT\";\n SpanKind[SpanKind[\"SPAN_KIND_PRODUCER\"] = 4] = \"SPAN_KIND_PRODUCER\";\n SpanKind[SpanKind[\"SPAN_KIND_CONSUMER\"] = 5] = \"SPAN_KIND_CONSUMER\";\n })(SpanKind = Span.SpanKind || (Span.SpanKind = {}));\n })(Span = v1.Span || (v1.Span = {}));\n })(v1 = trace.v1 || (trace.v1 = {}));\n })(trace = opentelemetryProto.trace || (opentelemetryProto.trace = {}));\n let common;\n (function (common) {\n let v1;\n (function (v1) {\n let ValueType;\n (function (ValueType) {\n ValueType[ValueType[\"STRING\"] = 0] = \"STRING\";\n ValueType[ValueType[\"INT\"] = 1] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 2] = \"DOUBLE\";\n ValueType[ValueType[\"BOOL\"] = 3] = \"BOOL\";\n })(ValueType = v1.ValueType || (v1.ValueType = {}));\n })(v1 = common.v1 || (common.v1 = {}));\n })(common = opentelemetryProto.common || (opentelemetryProto.common = {}));\n})(opentelemetryProto = exports.opentelemetryProto || (exports.opentelemetryProto = {}));\n/**\n * Interface for handling error\n */\nclass OTLPExporterError extends Error {\n constructor(message, code, data) {\n super(message);\n this.name = 'OTLPExporterError';\n this.data = data;\n this.code = code;\n }\n}\nexports.OTLPExporterError = OTLPExporterError;\n/**\n * Mapping between api SpanKind and proto SpanKind\n */\nexports.OTLP_SPAN_KIND_MAPPING = {\n [api_1.SpanKind.INTERNAL]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_INTERNAL,\n [api_1.SpanKind.SERVER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_SERVER,\n [api_1.SpanKind.CLIENT]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CLIENT,\n [api_1.SpanKind.PRODUCER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_PRODUCER,\n [api_1.SpanKind.CONSUMER]: opentelemetryProto.trace.v1.Span.SpanKind.SPAN_KIND_CONSUMER,\n};\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.appendResourcePathToUrlIfNotPresent = exports.parseHeaders = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nfunction parseHeaders(partialHeaders = {}) {\n const headers = {};\n Object.entries(partialHeaders).forEach(([key, value]) => {\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n }\n else {\n api_1.diag.warn(`Header \"${key}\" has wrong value and will be ignored`);\n }\n });\n return headers;\n}\nexports.parseHeaders = parseHeaders;\nfunction appendResourcePathToUrlIfNotPresent(url, path) {\n if (url.match(/v\\d\\/(traces|metrics)$/))\n return url;\n return url + path;\n}\nexports.appendResourcePathToUrlIfNotPresent = appendResourcePathToUrlIfNotPresent;\n//# sourceMappingURL=util.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExportResultCode = void 0;\nvar ExportResultCode;\n(function (ExportResultCode) {\n ExportResultCode[ExportResultCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExportResultCode[ExportResultCode[\"FAILED\"] = 1] = \"FAILED\";\n})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {}));\n//# sourceMappingURL=ExportResult.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0;\nexports.BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexports.BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexports.BAGGAGE_ITEMS_SEPARATOR = ',';\n// Name of the http header used to propagate the baggage\nexports.BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexports.BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n//# sourceMappingURL=constants.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.W3CBaggagePropagator = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst suppress_tracing_1 = require(\"../../trace/suppress-tracing\");\nconst constants_1 = require(\"../constants\");\nconst utils_1 = require(\"../utils\");\n/**\n * Propagates {@link Baggage} through Context format propagation.\n *\n * Based on the Baggage specification:\n * https://w3c.github.io/baggage/\n */\nclass W3CBaggagePropagator {\n inject(context, carrier, setter) {\n const baggage = api_1.propagation.getBaggage(context);\n if (!baggage || suppress_tracing_1.isTracingSuppressed(context))\n return;\n const keyPairs = utils_1.getKeyPairs(baggage)\n .filter((pair) => {\n return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;\n })\n .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS);\n const headerValue = utils_1.serializeKeyPairs(keyPairs);\n if (headerValue.length > 0) {\n setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue);\n }\n }\n extract(context, carrier, getter) {\n const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER);\n if (!headerValue)\n return context;\n const baggage = {};\n if (headerValue.length === 0) {\n return context;\n }\n const pairs = headerValue.split(constants_1.BAGGAGE_ITEMS_SEPARATOR);\n pairs.forEach(entry => {\n const keyPair = utils_1.parsePairKeyValue(entry);\n if (keyPair) {\n const baggageEntry = { value: keyPair.value };\n if (keyPair.metadata) {\n baggageEntry.metadata = keyPair.metadata;\n }\n baggage[keyPair.key] = baggageEntry;\n }\n });\n if (Object.entries(baggage).length === 0) {\n return context;\n }\n return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage));\n }\n fields() {\n return [constants_1.BAGGAGE_HEADER];\n }\n}\nexports.W3CBaggagePropagator = W3CBaggagePropagator;\n//# sourceMappingURL=W3CBaggagePropagator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst api_1 = require(\"@opentelemetry/api\");\nconst constants_1 = require(\"./constants\");\nfunction serializeKeyPairs(keyPairs) {\n return keyPairs.reduce((hValue, current) => {\n const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`;\n return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;\n }, '');\n}\nexports.serializeKeyPairs = serializeKeyPairs;\nfunction getKeyPairs(baggage) {\n return baggage\n .getAllEntries()\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`);\n}\nexports.getKeyPairs = getKeyPairs;\nfunction parsePairKeyValue(entry) {\n const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR);\n if (valueProps.length <= 0)\n return;\n const keyPairPart = valueProps.shift();\n if (!keyPairPart)\n return;\n const keyPair = keyPairPart.split(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR);\n if (keyPair.length !== 2)\n return;\n const key = decodeURIComponent(keyPair[0].trim());\n const value = decodeURIComponent(keyPair[1].trim());\n let metadata;\n if (valueProps.length > 0) {\n metadata = api_1.baggageEntryMetadataFromString(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR));\n }\n return { key, value, metadata };\n}\nexports.parsePairKeyValue = parsePairKeyValue;\n/**\n * Parse a string serialized in the baggage HTTP Format (without metadata):\n * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md\n */\nfunction parseKeyPairsIntoRecord(value) {\n if (typeof value !== 'string' || value.length === 0)\n return {};\n return value\n .split(constants_1.BAGGAGE_ITEMS_SEPARATOR)\n .map(entry => {\n return parsePairKeyValue(entry);\n })\n .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0)\n .reduce((headers, keyPair) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n headers[keyPair.key] = keyPair.value;\n return headers;\n }, {});\n}\nexports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAttributeValue = exports.sanitizeAttributes = void 0;\nfunction sanitizeAttributes(attributes) {\n const out = {};\n if (attributes == null || typeof attributes !== 'object') {\n return out;\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n for (const [k, v] of Object.entries(attributes)) {\n if (isAttributeValue(v)) {\n if (Array.isArray(v)) {\n out[k] = v.slice();\n }\n else {\n out[k] = v;\n }\n }\n }\n return out;\n}\nexports.sanitizeAttributes = sanitizeAttributes;\nfunction isAttributeValue(val) {\n if (val == null) {\n return true;\n }\n if (Array.isArray(val)) {\n return isHomogeneousAttributeValueArray(val);\n }\n return isValidPrimitiveAttributeValue(val);\n}\nexports.isAttributeValue = isAttributeValue;\nfunction isHomogeneousAttributeValueArray(arr) {\n let type;\n for (const element of arr) {\n // null/undefined elements are allowed\n if (element == null)\n continue;\n if (!type) {\n if (isValidPrimitiveAttributeValue(element)) {\n type = typeof element;\n continue;\n }\n // encountered an invalid primitive\n return false;\n }\n if (typeof element === type) {\n continue;\n }\n return false;\n }\n return true;\n}\nfunction isValidPrimitiveAttributeValue(val) {\n switch (typeof val) {\n case 'number':\n return true;\n case 'boolean':\n return true;\n case 'string':\n return true;\n }\n return false;\n}\n//# sourceMappingURL=attributes.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.globalErrorHandler = exports.setGlobalErrorHandler = void 0;\nconst logging_error_handler_1 = require(\"./logging-error-handler\");\n/** The global error handler delegate */\nlet delegateHandler = logging_error_handler_1.loggingErrorHandler();\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nfunction setGlobalErrorHandler(handler) {\n delegateHandler = handler;\n}\nexports.setGlobalErrorHandler = setGlobalErrorHandler;\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nfunction globalErrorHandler(ex) {\n try {\n delegateHandler(ex);\n }\n catch (_a) { } // eslint-disable-line no-empty\n}\nexports.globalErrorHandler = globalErrorHandler;\n//# sourceMappingURL=global-error-handler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loggingErrorHandler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nfunction loggingErrorHandler() {\n return (ex) => {\n api_1.diag.error(stringifyException(ex));\n };\n}\nexports.loggingErrorHandler = loggingErrorHandler;\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex) {\n if (typeof ex === 'string') {\n return ex;\n }\n else {\n return JSON.stringify(flattenException(ex));\n }\n}\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex) {\n const result = {};\n let current = ex;\n while (current !== null) {\n Object.getOwnPropertyNames(current).forEach(propertyName => {\n if (result[propertyName])\n return;\n const value = current[propertyName];\n if (value) {\n result[propertyName] = String(value);\n }\n });\n current = Object.getPrototypeOf(current);\n }\n return result;\n}\n//# sourceMappingURL=logging-error-handler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = void 0;\nconst platform_1 = require(\"../platform\");\nconst NANOSECOND_DIGITS = 9;\nconst SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n/**\n * Converts a number to HrTime, HrTime = [number, number].\n * The first number is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * numberToHrtime calculates the first number by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * numberToHrtime calculates the second number by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * SECOND_TO_NANOSECONDS = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n * @param epochMillis\n */\nfunction numberToHrtime(epochMillis) {\n const epochSeconds = epochMillis / 1000;\n // Decimals only.\n const seconds = Math.trunc(epochSeconds);\n // Round sub-nanosecond accuracy to nanosecond.\n const nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) *\n SECOND_TO_NANOSECONDS;\n return [seconds, nanos];\n}\nfunction getTimeOrigin() {\n let timeOrigin = platform_1.otperformance.timeOrigin;\n if (typeof timeOrigin !== 'number') {\n const perf = platform_1.otperformance;\n timeOrigin = perf.timing && perf.timing.fetchStart;\n }\n return timeOrigin;\n}\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nfunction hrTime(performanceNow) {\n const timeOrigin = numberToHrtime(getTimeOrigin());\n const now = numberToHrtime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now());\n let seconds = timeOrigin[0] + now[0];\n let nanos = timeOrigin[1] + now[1];\n // Nanoseconds\n if (nanos > SECOND_TO_NANOSECONDS) {\n nanos -= SECOND_TO_NANOSECONDS;\n seconds += 1;\n }\n return [seconds, nanos];\n}\nexports.hrTime = hrTime;\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nfunction timeInputToHrTime(time) {\n // process.hrtime\n if (isTimeInputHrTime(time)) {\n return time;\n }\n else if (typeof time === 'number') {\n // Must be a performance.now() if it's smaller than process start time.\n if (time < getTimeOrigin()) {\n return hrTime(time);\n }\n else {\n // epoch milliseconds or performance.timeOrigin\n return numberToHrtime(time);\n }\n }\n else if (time instanceof Date) {\n return numberToHrtime(time.getTime());\n }\n else {\n throw TypeError('Invalid input type');\n }\n}\nexports.timeInputToHrTime = timeInputToHrTime;\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nfunction hrTimeDuration(startTime, endTime) {\n let seconds = endTime[0] - startTime[0];\n let nanos = endTime[1] - startTime[1];\n // overflow\n if (nanos < 0) {\n seconds -= 1;\n // negate\n nanos += SECOND_TO_NANOSECONDS;\n }\n return [seconds, nanos];\n}\nexports.hrTimeDuration = hrTimeDuration;\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param time\n */\nfunction hrTimeToTimeStamp(time) {\n const precision = NANOSECOND_DIGITS;\n const tmp = `${'0'.repeat(precision)}${time[1]}Z`;\n const nanoString = tmp.substr(tmp.length - precision - 1);\n const date = new Date(time[0] * 1000).toISOString();\n return date.replace('000Z', nanoString);\n}\nexports.hrTimeToTimeStamp = hrTimeToTimeStamp;\n/**\n * Convert hrTime to nanoseconds.\n * @param time\n */\nfunction hrTimeToNanoseconds(time) {\n return time[0] * SECOND_TO_NANOSECONDS + time[1];\n}\nexports.hrTimeToNanoseconds = hrTimeToNanoseconds;\n/**\n * Convert hrTime to milliseconds.\n * @param time\n */\nfunction hrTimeToMilliseconds(time) {\n return Math.round(time[0] * 1e3 + time[1] / 1e6);\n}\nexports.hrTimeToMilliseconds = hrTimeToMilliseconds;\n/**\n * Convert hrTime to microseconds.\n * @param time\n */\nfunction hrTimeToMicroseconds(time) {\n return Math.round(time[0] * 1e6 + time[1] / 1e3);\n}\nexports.hrTimeToMicroseconds = hrTimeToMicroseconds;\n/**\n * check if time is HrTime\n * @param value\n */\nfunction isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}\nexports.isTimeInputHrTime = isTimeInputHrTime;\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nfunction isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}\nexports.isTimeInput = isTimeInput;\n//# sourceMappingURL=time.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageUtils = void 0;\n__exportStar(require(\"./baggage/propagation/W3CBaggagePropagator\"), exports);\n__exportStar(require(\"./common/attributes\"), exports);\n__exportStar(require(\"./common/global-error-handler\"), exports);\n__exportStar(require(\"./common/logging-error-handler\"), exports);\n__exportStar(require(\"./common/time\"), exports);\n__exportStar(require(\"./common/types\"), exports);\n__exportStar(require(\"./ExportResult\"), exports);\n__exportStar(require(\"./version\"), exports);\nexports.baggageUtils = require(\"./baggage/utils\");\n__exportStar(require(\"./platform\"), exports);\n__exportStar(require(\"./propagation/composite\"), exports);\n__exportStar(require(\"./trace/W3CTraceContextPropagator\"), exports);\n__exportStar(require(\"./trace/IdGenerator\"), exports);\n__exportStar(require(\"./trace/rpc-metadata\"), exports);\n__exportStar(require(\"./trace/sampler/AlwaysOffSampler\"), exports);\n__exportStar(require(\"./trace/sampler/AlwaysOnSampler\"), exports);\n__exportStar(require(\"./trace/sampler/ParentBasedSampler\"), exports);\n__exportStar(require(\"./trace/sampler/TraceIdRatioBasedSampler\"), exports);\n__exportStar(require(\"./trace/suppress-tracing\"), exports);\n__exportStar(require(\"./trace/TraceState\"), exports);\n__exportStar(require(\"./utils/environment\"), exports);\n__exportStar(require(\"./utils/merge\"), exports);\n__exportStar(require(\"./utils/sampling\"), exports);\n__exportStar(require(\"./utils/url\"), exports);\n__exportStar(require(\"./utils/wrap\"), exports);\n__exportStar(require(\"./version\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateValue = exports.validateKey = void 0;\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nfunction validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\nexports.validateKey = validateKey;\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nfunction validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\nexports.validateValue = validateValue;\n//# sourceMappingURL=validators.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RandomIdGenerator = void 0;\nconst SPAN_ID_BYTES = 8;\nconst TRACE_ID_BYTES = 16;\nclass RandomIdGenerator {\n constructor() {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n this.generateTraceId = getIdGenerator(TRACE_ID_BYTES);\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n this.generateSpanId = getIdGenerator(SPAN_ID_BYTES);\n }\n}\nexports.RandomIdGenerator = RandomIdGenerator;\nconst SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES);\nfunction getIdGenerator(bytes) {\n return function generateId() {\n for (let i = 0; i < bytes / 4; i++) {\n // unsigned right shift drops decimal part of the number\n // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE\n SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4);\n }\n // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated\n for (let i = 0; i < bytes; i++) {\n if (SHARED_BUFFER[i] > 0) {\n break;\n }\n else if (i === bytes - 1) {\n SHARED_BUFFER[bytes - 1] = 1;\n }\n }\n return SHARED_BUFFER.toString('hex', 0, bytes);\n };\n}\n//# sourceMappingURL=RandomIdGenerator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEnv = void 0;\nconst os = require(\"os\");\nconst environment_1 = require(\"../../utils/environment\");\n/**\n * Gets the environment variables\n */\nfunction getEnv() {\n const processEnv = environment_1.parseEnvironment(process.env);\n return Object.assign({\n HOSTNAME: os.hostname(),\n }, environment_1.DEFAULT_ENVIRONMENT, processEnv);\n}\nexports.getEnv = getEnv;\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._globalThis = void 0;\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexports._globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hexToBase64 = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction hexToBase64(hexStr) {\n const hexStrLen = hexStr.length;\n let hexAsciiCharsStr = '';\n for (let i = 0; i < hexStrLen; i += 2) {\n const hexPair = hexStr.substring(i, i + 2);\n const hexVal = parseInt(hexPair, 16);\n hexAsciiCharsStr += String.fromCharCode(hexVal);\n }\n return Buffer.from(hexAsciiCharsStr, 'ascii').toString('base64');\n}\nexports.hexToBase64 = hexToBase64;\n//# sourceMappingURL=hex-to-base64.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./environment\"), exports);\n__exportStar(require(\"./globalThis\"), exports);\n__exportStar(require(\"./hex-to-base64\"), exports);\n__exportStar(require(\"./RandomIdGenerator\"), exports);\n__exportStar(require(\"./performance\"), exports);\n__exportStar(require(\"./sdk-info\"), exports);\n__exportStar(require(\"./timer-util\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.otperformance = void 0;\nconst perf_hooks_1 = require(\"perf_hooks\");\nexports.otperformance = perf_hooks_1.performance;\n//# sourceMappingURL=performance.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SDK_INFO = void 0;\nconst version_1 = require(\"../../version\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\n/** Constants describing the SDK in use */\nexports.SDK_INFO = {\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'node',\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TelemetrySdkLanguageValues.NODEJS,\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: version_1.VERSION,\n};\n//# sourceMappingURL=sdk-info.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unrefTimer = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction unrefTimer(timer) {\n timer.unref();\n}\nexports.unrefTimer = unrefTimer;\n//# sourceMappingURL=timer-util.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompositePropagator = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Combines multiple propagators into a single propagator. */\nclass CompositePropagator {\n /**\n * Construct a composite propagator from a list of propagators.\n *\n * @param [config] Configuration object for composite propagator\n */\n constructor(config = {}) {\n var _a;\n this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : [];\n this._fields = Array.from(new Set(this._propagators\n // older propagators may not have fields function, null check to be sure\n .map(p => (typeof p.fields === 'function' ? p.fields() : []))\n .reduce((x, y) => x.concat(y), [])));\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same carrier key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to inject\n * @param carrier Carrier into which context will be injected\n */\n inject(context, carrier, setter) {\n for (const propagator of this._propagators) {\n try {\n propagator.inject(context, carrier, setter);\n }\n catch (err) {\n api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n }\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same context key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to add values to\n * @param carrier Carrier from which to extract context\n */\n extract(context, carrier, getter) {\n return this._propagators.reduce((ctx, propagator) => {\n try {\n return propagator.extract(ctx, carrier, getter);\n }\n catch (err) {\n api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n return ctx;\n }, context);\n }\n fields() {\n // return a new array so our fields cannot be modified\n return this._fields.slice();\n }\n}\nexports.CompositePropagator = CompositePropagator;\n//# sourceMappingURL=composite.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IdGenerator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceState = void 0;\nconst validators_1 = require(\"../internal/validators\");\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nclass TraceState {\n constructor(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n set(key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n const traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n }\n unset(key) {\n const traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n }\n get(key) {\n return this._internalState.get(key);\n }\n serialize() {\n return this._keys()\n .reduce((agg, key) => {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n }\n _parse(rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce((agg, part) => {\n const listMember = part.trim(); // Optional Whitespace (OWS) handling\n const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n const key = listMember.slice(0, i);\n const value = listMember.slice(i + 1, part.length);\n if (validators_1.validateKey(key) && validators_1.validateValue(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n }\n _keys() {\n return Array.from(this._internalState.keys()).reverse();\n }\n _clone() {\n const traceState = new TraceState();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n }\n}\nexports.TraceState = TraceState;\n//# sourceMappingURL=TraceState.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst suppress_tracing_1 = require(\"./suppress-tracing\");\nconst TraceState_1 = require(\"./TraceState\");\nexports.TRACE_PARENT_HEADER = 'traceparent';\nexports.TRACE_STATE_HEADER = 'tracestate';\nconst VERSION = '00';\nconst VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nconst TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nconst PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nconst FLAGS_PART = '[\\\\da-f]{2}';\nconst TRACE_PARENT_REGEX = new RegExp(`^\\\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\\\s?$`);\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n * It should be dynamically generated server side to have the server's request trace Id,\n * a parent span Id that was set on the server's request span,\n * and the trace flags to indicate the server's sampling decision\n * (01 = sampled, 00 = not sampled).\n * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n * For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nfunction parseTraceParent(traceParent) {\n const match = TRACE_PARENT_REGEX.exec(traceParent);\n if (!match)\n return null;\n // According to the specification the implementation should be compatible\n // with future versions. If there are more parts, we only reject it if it's using version 00\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n if (match[1] === '00' && match[5])\n return null;\n return {\n traceId: match[2],\n spanId: match[3],\n traceFlags: parseInt(match[4], 16),\n };\n}\nexports.parseTraceParent = parseTraceParent;\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nclass W3CTraceContextPropagator {\n inject(context, carrier, setter) {\n const spanContext = api_1.trace.getSpanContext(context);\n if (!spanContext ||\n suppress_tracing_1.isTracingSuppressed(context) ||\n !api_1.isSpanContextValid(spanContext))\n return;\n const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`;\n setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent);\n if (spanContext.traceState) {\n setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize());\n }\n }\n extract(context, carrier, getter) {\n const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER);\n if (!traceParentHeader)\n return context;\n const traceParent = Array.isArray(traceParentHeader)\n ? traceParentHeader[0]\n : traceParentHeader;\n if (typeof traceParent !== 'string')\n return context;\n const spanContext = parseTraceParent(traceParent);\n if (!spanContext)\n return context;\n spanContext.isRemote = true;\n const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER);\n if (traceStateHeader) {\n // If more than one `tracestate` header is found, we merge them into a\n // single header.\n const state = Array.isArray(traceStateHeader)\n ? traceStateHeader.join(',')\n : traceStateHeader;\n spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined);\n }\n return api_1.trace.setSpanContext(context, spanContext);\n }\n fields() {\n return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER];\n }\n}\nexports.W3CTraceContextPropagator = W3CTraceContextPropagator;\n//# sourceMappingURL=W3CTraceContextPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst RPC_METADATA_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key RPC_METADATA');\nvar RPCType;\n(function (RPCType) {\n RPCType[\"HTTP\"] = \"http\";\n})(RPCType = exports.RPCType || (exports.RPCType = {}));\nfunction setRPCMetadata(context, meta) {\n return context.setValue(RPC_METADATA_KEY, meta);\n}\nexports.setRPCMetadata = setRPCMetadata;\nfunction deleteRPCMetadata(context) {\n return context.deleteValue(RPC_METADATA_KEY);\n}\nexports.deleteRPCMetadata = deleteRPCMetadata;\nfunction getRPCMetadata(context) {\n return context.getValue(RPC_METADATA_KEY);\n}\nexports.getRPCMetadata = getRPCMetadata;\n//# sourceMappingURL=rpc-metadata.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AlwaysOffSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples no traces. */\nclass AlwaysOffSampler {\n shouldSample() {\n return {\n decision: api_1.SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return 'AlwaysOffSampler';\n }\n}\nexports.AlwaysOffSampler = AlwaysOffSampler;\n//# sourceMappingURL=AlwaysOffSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AlwaysOnSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples all traces. */\nclass AlwaysOnSampler {\n shouldSample() {\n return {\n decision: api_1.SamplingDecision.RECORD_AND_SAMPLED,\n };\n }\n toString() {\n return 'AlwaysOnSampler';\n }\n}\nexports.AlwaysOnSampler = AlwaysOnSampler;\n//# sourceMappingURL=AlwaysOnSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParentBasedSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst global_error_handler_1 = require(\"../../common/global-error-handler\");\nconst AlwaysOffSampler_1 = require(\"./AlwaysOffSampler\");\nconst AlwaysOnSampler_1 = require(\"./AlwaysOnSampler\");\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nclass ParentBasedSampler {\n constructor(config) {\n var _a, _b, _c, _d;\n this._root = config.root;\n if (!this._root) {\n global_error_handler_1.globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured'));\n this._root = new AlwaysOnSampler_1.AlwaysOnSampler();\n }\n this._remoteParentSampled =\n (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler();\n this._remoteParentNotSampled =\n (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler();\n this._localParentSampled =\n (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler();\n this._localParentNotSampled =\n (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler();\n }\n shouldSample(context, traceId, spanName, spanKind, attributes, links) {\n const parentContext = api_1.trace.getSpanContext(context);\n if (!parentContext || !api_1.isSpanContextValid(parentContext)) {\n return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.isRemote) {\n if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {\n return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {\n return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n toString() {\n return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;\n }\n}\nexports.ParentBasedSampler = ParentBasedSampler;\n//# sourceMappingURL=ParentBasedSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceIdRatioBasedSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nclass TraceIdRatioBasedSampler {\n constructor(_ratio = 0) {\n this._ratio = _ratio;\n this._ratio = this._normalize(_ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n shouldSample(context, traceId) {\n return {\n decision: api_1.isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? api_1.SamplingDecision.RECORD_AND_SAMPLED\n : api_1.SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n _normalize(ratio) {\n if (typeof ratio !== 'number' || isNaN(ratio))\n return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n _accumulate(traceId) {\n let accumulation = 0;\n for (let i = 0; i < traceId.length / 8; i++) {\n const pos = i * 8;\n const part = parseInt(traceId.slice(pos, pos + 8), 16);\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\nexports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler;\n//# sourceMappingURL=TraceIdRatioBasedSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst SUPPRESS_TRACING_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING');\nfunction suppressTracing(context) {\n return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\nexports.suppressTracing = suppressTracing;\nfunction unsuppressTracing(context) {\n return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\nexports.unsuppressTracing = unsuppressTracing;\nfunction isTracingSuppressed(context) {\n return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\nexports.isTracingSuppressed = isTracingSuppressed;\n//# sourceMappingURL=suppress-tracing.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst sampling_1 = require(\"./sampling\");\nconst DEFAULT_LIST_SEPARATOR = ',';\n/**\n * Environment interface to define all names\n */\nconst ENVIRONMENT_NUMBERS_KEYS = [\n 'OTEL_BSP_EXPORT_TIMEOUT',\n 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE',\n 'OTEL_BSP_MAX_QUEUE_SIZE',\n 'OTEL_BSP_SCHEDULE_DELAY',\n 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT',\n 'OTEL_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT',\n 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_EVENT_COUNT_LIMIT',\n 'OTEL_SPAN_LINK_COUNT_LIMIT',\n];\nfunction isEnvVarANumber(key) {\n return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1);\n}\nconst ENVIRONMENT_LISTS_KEYS = [\n 'OTEL_NO_PATCH_MODULES',\n 'OTEL_PROPAGATORS',\n];\nfunction isEnvVarAList(key) {\n return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1;\n}\nexports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;\nexports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;\n/**\n * Default environment variables\n */\nexports.DEFAULT_ENVIRONMENT = {\n CONTAINER_NAME: '',\n ECS_CONTAINER_METADATA_URI_V4: '',\n ECS_CONTAINER_METADATA_URI: '',\n HOSTNAME: '',\n KUBERNETES_SERVICE_HOST: '',\n NAMESPACE: '',\n OTEL_BSP_EXPORT_TIMEOUT: 30000,\n OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512,\n OTEL_BSP_MAX_QUEUE_SIZE: 2048,\n OTEL_BSP_SCHEDULE_DELAY: 5000,\n OTEL_EXPORTER_JAEGER_AGENT_HOST: '',\n OTEL_EXPORTER_JAEGER_ENDPOINT: '',\n OTEL_EXPORTER_JAEGER_PASSWORD: '',\n OTEL_EXPORTER_JAEGER_USER: '',\n OTEL_EXPORTER_OTLP_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_HEADERS: '',\n OTEL_EXPORTER_OTLP_TRACES_HEADERS: '',\n OTEL_EXPORTER_OTLP_METRICS_HEADERS: '',\n OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans',\n OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO,\n OTEL_NO_PATCH_MODULES: [],\n OTEL_PROPAGATORS: ['tracecontext', 'baggage'],\n OTEL_RESOURCE_ATTRIBUTES: '',\n OTEL_SERVICE_NAME: '',\n OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT,\n OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT,\n OTEL_SPAN_EVENT_COUNT_LIMIT: 128,\n OTEL_SPAN_LINK_COUNT_LIMIT: 128,\n OTEL_TRACES_EXPORTER: 'none',\n OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn,\n OTEL_TRACES_SAMPLER_ARG: '',\n};\n/**\n * Parses a variable as number with number validation\n * @param name\n * @param environment\n * @param values\n * @param min\n * @param max\n */\nfunction parseNumber(name, environment, values, min = -Infinity, max = Infinity) {\n if (typeof values[name] !== 'undefined') {\n const value = Number(values[name]);\n if (!isNaN(value)) {\n if (value < min) {\n environment[name] = min;\n }\n else if (value > max) {\n environment[name] = max;\n }\n else {\n environment[name] = value;\n }\n }\n }\n}\n/**\n * Parses list-like strings from input into output.\n * @param name\n * @param environment\n * @param values\n * @param separator\n */\nfunction parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) {\n const givenValue = input[name];\n if (typeof givenValue === 'string') {\n output[name] = givenValue.split(separator).map(v => v.trim());\n }\n}\n// The support string -> DiagLogLevel mappings\nconst logLevelMap = {\n ALL: api_1.DiagLogLevel.ALL,\n VERBOSE: api_1.DiagLogLevel.VERBOSE,\n DEBUG: api_1.DiagLogLevel.DEBUG,\n INFO: api_1.DiagLogLevel.INFO,\n WARN: api_1.DiagLogLevel.WARN,\n ERROR: api_1.DiagLogLevel.ERROR,\n NONE: api_1.DiagLogLevel.NONE,\n};\n/**\n * Environmentally sets log level if valid log level string is provided\n * @param key\n * @param environment\n * @param values\n */\nfunction setLogLevelFromEnv(key, environment, values) {\n const value = values[key];\n if (typeof value === 'string') {\n const theLevel = logLevelMap[value.toUpperCase()];\n if (theLevel != null) {\n environment[key] = theLevel;\n }\n }\n}\n/**\n * Parses environment values\n * @param values\n */\nfunction parseEnvironment(values) {\n const environment = {};\n for (const env in exports.DEFAULT_ENVIRONMENT) {\n const key = env;\n switch (key) {\n case 'OTEL_LOG_LEVEL':\n setLogLevelFromEnv(key, environment, values);\n break;\n default:\n if (isEnvVarANumber(key)) {\n parseNumber(key, environment, values);\n }\n else if (isEnvVarAList(key)) {\n parseStringList(key, environment, values);\n }\n else {\n const value = values[key];\n if (typeof value !== 'undefined' && value !== null) {\n environment[key] = String(value);\n }\n }\n }\n }\n return environment;\n}\nexports.parseEnvironment = parseEnvironment;\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isPlainObject = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * based on lodash in order to support esm builds without esModuleInterop.\n * lodash is using MIT License.\n **/\nconst objectTag = '[object Object]';\nconst nullTag = '[object Null]';\nconst undefinedTag = '[object Undefined]';\nconst funcProto = Function.prototype;\nconst funcToString = funcProto.toString;\nconst objectCtorString = funcToString.call(Object);\nconst getPrototype = overArg(Object.getPrototypeOf, Object);\nconst objectProto = Object.prototype;\nconst hasOwnProperty = objectProto.hasOwnProperty;\nconst symToStringTag = Symbol ? Symbol.toStringTag : undefined;\nconst nativeObjectToString = objectProto.toString;\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function (arg) {\n return func(transform(arg));\n };\n}\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {\n return false;\n }\n const proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) === objectCtorString;\n}\nexports.isPlainObject = isPlainObject;\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];\n let unmasked = false;\n try {\n value[symToStringTag] = undefined;\n unmasked = true;\n }\n catch (e) {\n // silence\n }\n const result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n }\n else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n//# sourceMappingURL=lodash.merge.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.merge = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst lodash_merge_1 = require(\"./lodash.merge\");\nconst MAX_LEVEL = 20;\n/**\n * Merges objects together\n * @param args - objects / values to be merged\n */\nfunction merge(...args) {\n let result = args.shift();\n const objects = new WeakMap();\n while (args.length > 0) {\n result = mergeTwoObjects(result, args.shift(), 0, objects);\n }\n return result;\n}\nexports.merge = merge;\nfunction takeValue(value) {\n if (isArray(value)) {\n return value.slice();\n }\n return value;\n}\n/**\n * Merges two objects\n * @param one - first object\n * @param two - second object\n * @param level - current deep level\n * @param objects - objects holder that has been already referenced - to prevent\n * cyclic dependency\n */\nfunction mergeTwoObjects(one, two, level = 0, objects) {\n let result;\n if (level > MAX_LEVEL) {\n return undefined;\n }\n level++;\n if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) {\n result = takeValue(two);\n }\n else if (isArray(one)) {\n result = one.slice();\n if (isArray(two)) {\n for (let i = 0, j = two.length; i < j; i++) {\n result.push(takeValue(two[i]));\n }\n }\n else if (isObject(two)) {\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n result[key] = takeValue(two[key]);\n }\n }\n }\n else if (isObject(one)) {\n if (isObject(two)) {\n if (!shouldMerge(one, two)) {\n return two;\n }\n result = Object.assign({}, one);\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n const twoValue = two[key];\n if (isPrimitive(twoValue)) {\n if (typeof twoValue === 'undefined') {\n delete result[key];\n }\n else {\n // result[key] = takeValue(twoValue);\n result[key] = twoValue;\n }\n }\n else {\n const obj1 = result[key];\n const obj2 = twoValue;\n if (wasObjectReferenced(one, key, objects) ||\n wasObjectReferenced(two, key, objects)) {\n delete result[key];\n }\n else {\n if (isObject(obj1) && isObject(obj2)) {\n const arr1 = objects.get(obj1) || [];\n const arr2 = objects.get(obj2) || [];\n arr1.push({ obj: one, key });\n arr2.push({ obj: two, key });\n objects.set(obj1, arr1);\n objects.set(obj2, arr2);\n }\n result[key] = mergeTwoObjects(result[key], twoValue, level, objects);\n }\n }\n }\n }\n else {\n result = two;\n }\n }\n return result;\n}\n/**\n * Function to check if object has been already reference\n * @param obj\n * @param key\n * @param objects\n */\nfunction wasObjectReferenced(obj, key, objects) {\n const arr = objects.get(obj[key]) || [];\n for (let i = 0, j = arr.length; i < j; i++) {\n const info = arr[i];\n if (info.key === key && info.obj === obj) {\n return true;\n }\n }\n return false;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isObject(value) {\n return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === 'object';\n}\nfunction isPrimitive(value) {\n return typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'undefined' ||\n value instanceof Date ||\n value instanceof RegExp ||\n value === null;\n}\nfunction shouldMerge(one, two) {\n if (!lodash_merge_1.isPlainObject(one) || !lodash_merge_1.isPlainObject(two)) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=merge.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TracesSamplerValues = void 0;\nvar TracesSamplerValues;\n(function (TracesSamplerValues) {\n TracesSamplerValues[\"AlwaysOff\"] = \"always_off\";\n TracesSamplerValues[\"AlwaysOn\"] = \"always_on\";\n TracesSamplerValues[\"ParentBasedAlwaysOff\"] = \"parentbased_always_off\";\n TracesSamplerValues[\"ParentBasedAlwaysOn\"] = \"parentbased_always_on\";\n TracesSamplerValues[\"ParentBasedTraceIdRatio\"] = \"parentbased_traceidratio\";\n TracesSamplerValues[\"TraceIdRatio\"] = \"traceidratio\";\n})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {}));\n//# sourceMappingURL=sampling.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isUrlIgnored = exports.urlMatches = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction urlMatches(url, urlToMatch) {\n if (typeof urlToMatch === 'string') {\n return url === urlToMatch;\n }\n else {\n return !!url.match(urlToMatch);\n }\n}\nexports.urlMatches = urlMatches;\n/**\n * Check if {@param url} should be ignored when comparing against {@param ignoredUrls}\n * @param url\n * @param ignoredUrls\n */\nfunction isUrlIgnored(url, ignoredUrls) {\n if (!ignoredUrls) {\n return false;\n }\n for (const ignoreUrl of ignoredUrls) {\n if (urlMatches(url, ignoreUrl)) {\n return true;\n }\n }\n return false;\n}\nexports.isUrlIgnored = isUrlIgnored;\n//# sourceMappingURL=url.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isWrapped = void 0;\n/**\n * Checks if certain function has been already wrapped\n * @param func\n */\nfunction isWrapped(func) {\n return (typeof func === 'function' &&\n typeof func.__original === 'function' &&\n typeof func.__unwrap === 'function' &&\n func.__wrapped === true);\n}\nexports.isWrapped = isWrapped;\n//# sourceMappingURL=wrap.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VERSION = void 0;\n// this is autogenerated file, see scripts/version-update.js\nexports.VERSION = '1.0.1';\n//# sourceMappingURL=version.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./trace\"), exports);\n__exportStar(require(\"./resource\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0;\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexports.SemanticResourceAttributes = {\n /**\n * Name of the cloud provider.\n */\n CLOUD_PROVIDER: 'cloud.provider',\n /**\n * The cloud account ID the resource is assigned to.\n */\n CLOUD_ACCOUNT_ID: 'cloud.account.id',\n /**\n * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations).\n */\n CLOUD_REGION: 'cloud.region',\n /**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud.\n */\n CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone',\n /**\n * The cloud platform in use.\n *\n * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`.\n */\n CLOUD_PLATFORM: 'cloud.platform',\n /**\n * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).\n */\n AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn',\n /**\n * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).\n */\n AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn',\n /**\n * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.\n */\n AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype',\n /**\n * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).\n */\n AWS_ECS_TASK_ARN: 'aws.ecs.task.arn',\n /**\n * The task definition family this task definition is a member of.\n */\n AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family',\n /**\n * The revision for this task definition.\n */\n AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision',\n /**\n * The ARN of an EKS cluster.\n */\n AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn',\n /**\n * The name(s) of the AWS log group(s) an application is writing to.\n *\n * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.\n */\n AWS_LOG_GROUP_NAMES: 'aws.log.group.names',\n /**\n * The Amazon Resource Name(s) (ARN) of the AWS log group(s).\n *\n * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).\n */\n AWS_LOG_GROUP_ARNS: 'aws.log.group.arns',\n /**\n * The name(s) of the AWS log stream(s) an application is writing to.\n */\n AWS_LOG_STREAM_NAMES: 'aws.log.stream.names',\n /**\n * The ARN(s) of the AWS log stream(s).\n *\n * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream.\n */\n AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns',\n /**\n * Container name.\n */\n CONTAINER_NAME: 'container.name',\n /**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated.\n */\n CONTAINER_ID: 'container.id',\n /**\n * The container runtime managing this container.\n */\n CONTAINER_RUNTIME: 'container.runtime',\n /**\n * Name of the image the container was built on.\n */\n CONTAINER_IMAGE_NAME: 'container.image.name',\n /**\n * Container image tag.\n */\n CONTAINER_IMAGE_TAG: 'container.image.tag',\n /**\n * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier).\n */\n DEPLOYMENT_ENVIRONMENT: 'deployment.environment',\n /**\n * A unique identifier representing the device.\n *\n * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.\n */\n DEVICE_ID: 'device.id',\n /**\n * The model identifier for the device.\n *\n * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device.\n */\n DEVICE_MODEL_IDENTIFIER: 'device.model.identifier',\n /**\n * The marketing name for the device model.\n *\n * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.\n */\n DEVICE_MODEL_NAME: 'device.model.name',\n /**\n * The name of the single function that this runtime instance executes.\n *\n * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes).\n */\n FAAS_NAME: 'faas.name',\n /**\n * The unique ID of the single function that this runtime instance executes.\n *\n * Note: Depending on the cloud provider, use:\n \n * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).\n Take care not to use the "invoked ARN" directly but replace any\n [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple\n different aliases.\n * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)\n * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).\n \n On some providers, it may not be possible to determine the full ID at startup,\n which is why this field cannot be made required. For example, on AWS the account ID\n part of the ARN is not available without calling another AWS API\n which may be deemed too slow for a short-running lambda function.\n As an alternative, consider setting `faas.id` as a span attribute instead.\n */\n FAAS_ID: 'faas.id',\n /**\n * The immutable version of the function being executed.\n *\n * Note: Depending on the cloud provider and platform, use:\n \n * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)\n (an integer represented as a decimal string).\n * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)\n (i.e., the function name plus the revision suffix).\n * **Google Cloud Functions:** The value of the\n [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).\n * **Azure Functions:** Not applicable. Do not set this attribute.\n */\n FAAS_VERSION: 'faas.version',\n /**\n * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.\n *\n * Note: * **AWS Lambda:** Use the (full) log stream name.\n */\n FAAS_INSTANCE: 'faas.instance',\n /**\n * The amount of memory available to the serverless function in MiB.\n *\n * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information.\n */\n FAAS_MAX_MEMORY: 'faas.max_memory',\n /**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider.\n */\n HOST_ID: 'host.id',\n /**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n */\n HOST_NAME: 'host.name',\n /**\n * Type of host. For Cloud, this must be the machine type.\n */\n HOST_TYPE: 'host.type',\n /**\n * The CPU architecture the host system is running on.\n */\n HOST_ARCH: 'host.arch',\n /**\n * Name of the VM image or OS install the host was instantiated from.\n */\n HOST_IMAGE_NAME: 'host.image.name',\n /**\n * VM image ID. For Cloud, this value is from the provider.\n */\n HOST_IMAGE_ID: 'host.image.id',\n /**\n * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes).\n */\n HOST_IMAGE_VERSION: 'host.image.version',\n /**\n * The name of the cluster.\n */\n K8S_CLUSTER_NAME: 'k8s.cluster.name',\n /**\n * The name of the Node.\n */\n K8S_NODE_NAME: 'k8s.node.name',\n /**\n * The UID of the Node.\n */\n K8S_NODE_UID: 'k8s.node.uid',\n /**\n * The name of the namespace that the pod is running in.\n */\n K8S_NAMESPACE_NAME: 'k8s.namespace.name',\n /**\n * The UID of the Pod.\n */\n K8S_POD_UID: 'k8s.pod.uid',\n /**\n * The name of the Pod.\n */\n K8S_POD_NAME: 'k8s.pod.name',\n /**\n * The name of the Container in a Pod template.\n */\n K8S_CONTAINER_NAME: 'k8s.container.name',\n /**\n * The UID of the ReplicaSet.\n */\n K8S_REPLICASET_UID: 'k8s.replicaset.uid',\n /**\n * The name of the ReplicaSet.\n */\n K8S_REPLICASET_NAME: 'k8s.replicaset.name',\n /**\n * The UID of the Deployment.\n */\n K8S_DEPLOYMENT_UID: 'k8s.deployment.uid',\n /**\n * The name of the Deployment.\n */\n K8S_DEPLOYMENT_NAME: 'k8s.deployment.name',\n /**\n * The UID of the StatefulSet.\n */\n K8S_STATEFULSET_UID: 'k8s.statefulset.uid',\n /**\n * The name of the StatefulSet.\n */\n K8S_STATEFULSET_NAME: 'k8s.statefulset.name',\n /**\n * The UID of the DaemonSet.\n */\n K8S_DAEMONSET_UID: 'k8s.daemonset.uid',\n /**\n * The name of the DaemonSet.\n */\n K8S_DAEMONSET_NAME: 'k8s.daemonset.name',\n /**\n * The UID of the Job.\n */\n K8S_JOB_UID: 'k8s.job.uid',\n /**\n * The name of the Job.\n */\n K8S_JOB_NAME: 'k8s.job.name',\n /**\n * The UID of the CronJob.\n */\n K8S_CRONJOB_UID: 'k8s.cronjob.uid',\n /**\n * The name of the CronJob.\n */\n K8S_CRONJOB_NAME: 'k8s.cronjob.name',\n /**\n * The operating system type.\n */\n OS_TYPE: 'os.type',\n /**\n * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands.\n */\n OS_DESCRIPTION: 'os.description',\n /**\n * Human readable operating system name.\n */\n OS_NAME: 'os.name',\n /**\n * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).\n */\n OS_VERSION: 'os.version',\n /**\n * Process identifier (PID).\n */\n PROCESS_PID: 'process.pid',\n /**\n * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_NAME: 'process.executable.name',\n /**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_PATH: 'process.executable.path',\n /**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n */\n PROCESS_COMMAND: 'process.command',\n /**\n * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead.\n */\n PROCESS_COMMAND_LINE: 'process.command_line',\n /**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n */\n PROCESS_COMMAND_ARGS: 'process.command_args',\n /**\n * The username of the user that owns the process.\n */\n PROCESS_OWNER: 'process.owner',\n /**\n * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler.\n */\n PROCESS_RUNTIME_NAME: 'process.runtime.name',\n /**\n * The version of the runtime of this process, as returned by the runtime without modification.\n */\n PROCESS_RUNTIME_VERSION: 'process.runtime.version',\n /**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n */\n PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description',\n /**\n * Logical name of the service.\n *\n * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.\n */\n SERVICE_NAME: 'service.name',\n /**\n * A namespace for `service.name`.\n *\n * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\n SERVICE_NAMESPACE: 'service.namespace',\n /**\n * The string ID of the service instance.\n *\n * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations).\n */\n SERVICE_INSTANCE_ID: 'service.instance.id',\n /**\n * The version string of the service API or implementation.\n */\n SERVICE_VERSION: 'service.version',\n /**\n * The name of the telemetry SDK as defined above.\n */\n TELEMETRY_SDK_NAME: 'telemetry.sdk.name',\n /**\n * The language of the telemetry SDK.\n */\n TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language',\n /**\n * The version string of the telemetry SDK.\n */\n TELEMETRY_SDK_VERSION: 'telemetry.sdk.version',\n /**\n * The version string of the auto instrumentation agent, if used.\n */\n TELEMETRY_AUTO_VERSION: 'telemetry.auto.version',\n /**\n * The name of the web engine.\n */\n WEBENGINE_NAME: 'webengine.name',\n /**\n * The version of the web engine.\n */\n WEBENGINE_VERSION: 'webengine.version',\n /**\n * Additional description of the web engine (e.g. detailed version and edition information).\n */\n WEBENGINE_DESCRIPTION: 'webengine.description',\n};\nexports.CloudProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexports.CloudPlatformValues = {\n /** Alibaba Cloud Elastic Compute Service. */\n ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs',\n /** Alibaba Cloud Function Compute. */\n ALIBABA_CLOUD_FC: 'alibaba_cloud_fc',\n /** AWS Elastic Compute Cloud. */\n AWS_EC2: 'aws_ec2',\n /** AWS Elastic Container Service. */\n AWS_ECS: 'aws_ecs',\n /** AWS Elastic Kubernetes Service. */\n AWS_EKS: 'aws_eks',\n /** AWS Lambda. */\n AWS_LAMBDA: 'aws_lambda',\n /** AWS Elastic Beanstalk. */\n AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk',\n /** Azure Virtual Machines. */\n AZURE_VM: 'azure_vm',\n /** Azure Container Instances. */\n AZURE_CONTAINER_INSTANCES: 'azure_container_instances',\n /** Azure Kubernetes Service. */\n AZURE_AKS: 'azure_aks',\n /** Azure Functions. */\n AZURE_FUNCTIONS: 'azure_functions',\n /** Azure App Service. */\n AZURE_APP_SERVICE: 'azure_app_service',\n /** Google Cloud Compute Engine (GCE). */\n GCP_COMPUTE_ENGINE: 'gcp_compute_engine',\n /** Google Cloud Run. */\n GCP_CLOUD_RUN: 'gcp_cloud_run',\n /** Google Cloud Kubernetes Engine (GKE). */\n GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine',\n /** Google Cloud Functions (GCF). */\n GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions',\n /** Google Cloud App Engine (GAE). */\n GCP_APP_ENGINE: 'gcp_app_engine',\n};\nexports.AwsEcsLaunchtypeValues = {\n /** ec2. */\n EC2: 'ec2',\n /** fargate. */\n FARGATE: 'fargate',\n};\nexports.HostArchValues = {\n /** AMD64. */\n AMD64: 'amd64',\n /** ARM32. */\n ARM32: 'arm32',\n /** ARM64. */\n ARM64: 'arm64',\n /** Itanium. */\n IA64: 'ia64',\n /** 32-bit PowerPC. */\n PPC32: 'ppc32',\n /** 64-bit PowerPC. */\n PPC64: 'ppc64',\n /** 32-bit x86. */\n X86: 'x86',\n};\nexports.OsTypeValues = {\n /** Microsoft Windows. */\n WINDOWS: 'windows',\n /** Linux. */\n LINUX: 'linux',\n /** Apple Darwin. */\n DARWIN: 'darwin',\n /** FreeBSD. */\n FREEBSD: 'freebsd',\n /** NetBSD. */\n NETBSD: 'netbsd',\n /** OpenBSD. */\n OPENBSD: 'openbsd',\n /** DragonFly BSD. */\n DRAGONFLYBSD: 'dragonflybsd',\n /** HP-UX (Hewlett Packard Unix). */\n HPUX: 'hpux',\n /** AIX (Advanced Interactive eXecutive). */\n AIX: 'aix',\n /** Oracle Solaris. */\n SOLARIS: 'solaris',\n /** IBM z/OS. */\n Z_OS: 'z_os',\n};\nexports.TelemetrySdkLanguageValues = {\n /** cpp. */\n CPP: 'cpp',\n /** dotnet. */\n DOTNET: 'dotnet',\n /** erlang. */\n ERLANG: 'erlang',\n /** go. */\n GO: 'go',\n /** java. */\n JAVA: 'java',\n /** nodejs. */\n NODEJS: 'nodejs',\n /** php. */\n PHP: 'php',\n /** python. */\n PYTHON: 'python',\n /** ruby. */\n RUBY: 'ruby',\n /** webjs. */\n WEBJS: 'webjs',\n};\n//# sourceMappingURL=SemanticResourceAttributes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./SemanticResourceAttributes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0;\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexports.SemanticAttributes = {\n /**\n * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).\n *\n * Note: This may be different from `faas.id` if an alias is involved.\n */\n AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn',\n /**\n * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.\n */\n DB_SYSTEM: 'db.system',\n /**\n * The connection string used to connect to the database. It is recommended to remove embedded credentials.\n */\n DB_CONNECTION_STRING: 'db.connection_string',\n /**\n * Username for accessing the database.\n */\n DB_USER: 'db.user',\n /**\n * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n */\n DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname',\n /**\n * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n *\n * Note: In some SQL databases, the database name to be used is called "schema name".\n */\n DB_NAME: 'db.name',\n /**\n * The database statement being executed.\n *\n * Note: The value may be sanitized to exclude sensitive information.\n */\n DB_STATEMENT: 'db.statement',\n /**\n * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n *\n * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n */\n DB_OPERATION: 'db.operation',\n /**\n * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n *\n * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard).\n */\n DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name',\n /**\n * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace',\n /**\n * The fetch size used for paging, i.e. how many rows will be returned at once.\n */\n DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size',\n /**\n * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n */\n DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_CASSANDRA_TABLE: 'db.cassandra.table',\n /**\n * Whether or not the query is idempotent.\n */\n DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence',\n /**\n * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n */\n DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count',\n /**\n * The ID of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id',\n /**\n * The data center of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc',\n /**\n * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_HBASE_NAMESPACE: 'db.hbase.namespace',\n /**\n * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n */\n DB_REDIS_DATABASE_INDEX: 'db.redis.database_index',\n /**\n * The collection being accessed within the database stated in `db.name`.\n */\n DB_MONGODB_COLLECTION: 'db.mongodb.collection',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_SQL_TABLE: 'db.sql.table',\n /**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n */\n EXCEPTION_TYPE: 'exception.type',\n /**\n * The exception message.\n */\n EXCEPTION_MESSAGE: 'exception.message',\n /**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n */\n EXCEPTION_STACKTRACE: 'exception.stacktrace',\n /**\n * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.\n *\n * Note: An exception is considered to have escaped (or left) the scope of a span,\n if that span is ended while the exception is still logically "in flight".\n This may be actually "in flight" in some languages (e.g. if the exception\n is passed to a Context manager's `__exit__` method in Python) but will\n usually be caught at the point of recording the exception in most languages.\n \n It is usually not possible to determine at the point where an exception is thrown\n whether it will escape the scope of a span.\n However, it is trivial to know that an exception\n will escape, if one checks for an active exception just before ending the span,\n as done in the [example above](#exception-end-example).\n \n It follows that an exception may still escape the scope of the span\n even if the `exception.escaped` attribute was not set or set to false,\n since the event might have been recorded at a time where it was not\n clear whether the exception will escape.\n */\n EXCEPTION_ESCAPED: 'exception.escaped',\n /**\n * Type of the trigger on which the function is executed.\n */\n FAAS_TRIGGER: 'faas.trigger',\n /**\n * The execution ID of the current function execution.\n */\n FAAS_EXECUTION: 'faas.execution',\n /**\n * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.\n */\n FAAS_DOCUMENT_COLLECTION: 'faas.document.collection',\n /**\n * Describes the type of the operation that was performed on the data.\n */\n FAAS_DOCUMENT_OPERATION: 'faas.document.operation',\n /**\n * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_DOCUMENT_TIME: 'faas.document.time',\n /**\n * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.\n */\n FAAS_DOCUMENT_NAME: 'faas.document.name',\n /**\n * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_TIME: 'faas.time',\n /**\n * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).\n */\n FAAS_CRON: 'faas.cron',\n /**\n * A boolean that is true if the serverless function is executed for the first time (aka cold-start).\n */\n FAAS_COLDSTART: 'faas.coldstart',\n /**\n * The name of the invoked function.\n *\n * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function.\n */\n FAAS_INVOKED_NAME: 'faas.invoked_name',\n /**\n * The cloud provider of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.\n */\n FAAS_INVOKED_PROVIDER: 'faas.invoked_provider',\n /**\n * The cloud region of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function.\n */\n FAAS_INVOKED_REGION: 'faas.invoked_region',\n /**\n * Transport protocol used. See note below.\n */\n NET_TRANSPORT: 'net.transport',\n /**\n * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6).\n */\n NET_PEER_IP: 'net.peer.ip',\n /**\n * Remote port number.\n */\n NET_PEER_PORT: 'net.peer.port',\n /**\n * Remote hostname or similar, see note below.\n */\n NET_PEER_NAME: 'net.peer.name',\n /**\n * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.\n */\n NET_HOST_IP: 'net.host.ip',\n /**\n * Like `net.peer.port` but for the host port.\n */\n NET_HOST_PORT: 'net.host.port',\n /**\n * Local hostname or similar, see note below.\n */\n NET_HOST_NAME: 'net.host.name',\n /**\n * The internet connection type currently being used by the host.\n */\n NET_HOST_CONNECTION_TYPE: 'net.host.connection.type',\n /**\n * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.\n */\n NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype',\n /**\n * The name of the mobile carrier.\n */\n NET_HOST_CARRIER_NAME: 'net.host.carrier.name',\n /**\n * The mobile carrier country code.\n */\n NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc',\n /**\n * The mobile carrier network code.\n */\n NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc',\n /**\n * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.\n */\n NET_HOST_CARRIER_ICC: 'net.host.carrier.icc',\n /**\n * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any.\n */\n PEER_SERVICE: 'peer.service',\n /**\n * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system.\n */\n ENDUSER_ID: 'enduser.id',\n /**\n * Actual/assumed role the client is making the request under extracted from token or application security context.\n */\n ENDUSER_ROLE: 'enduser.role',\n /**\n * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).\n */\n ENDUSER_SCOPE: 'enduser.scope',\n /**\n * Current "managed" thread ID (as opposed to OS thread ID).\n */\n THREAD_ID: 'thread.id',\n /**\n * Current thread name.\n */\n THREAD_NAME: 'thread.name',\n /**\n * The method or function name, or equivalent (usually rightmost part of the code unit's name).\n */\n CODE_FUNCTION: 'code.function',\n /**\n * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.\n */\n CODE_NAMESPACE: 'code.namespace',\n /**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).\n */\n CODE_FILEPATH: 'code.filepath',\n /**\n * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.\n */\n CODE_LINENO: 'code.lineno',\n /**\n * HTTP request method.\n */\n HTTP_METHOD: 'http.method',\n /**\n * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.\n *\n * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`.\n */\n HTTP_URL: 'http.url',\n /**\n * The full request target as passed in a HTTP request line or equivalent.\n */\n HTTP_TARGET: 'http.target',\n /**\n * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.\n *\n * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.\n */\n HTTP_HOST: 'http.host',\n /**\n * The URI scheme identifying the used protocol.\n */\n HTTP_SCHEME: 'http.scheme',\n /**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n */\n HTTP_STATUS_CODE: 'http.status_code',\n /**\n * Kind of HTTP protocol used.\n *\n * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.\n */\n HTTP_FLAVOR: 'http.flavor',\n /**\n * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.\n */\n HTTP_USER_AGENT: 'http.user_agent',\n /**\n * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length',\n /**\n * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed',\n /**\n * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length',\n /**\n * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed',\n /**\n * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead).\n *\n * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available.\n */\n HTTP_SERVER_NAME: 'http.server_name',\n /**\n * The matched route (path template).\n */\n HTTP_ROUTE: 'http.route',\n /**\n * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).\n *\n * Note: This is not necessarily the same as `net.peer.ip`, which would\n identify the network-level peer, which may be a proxy.\n \n This attribute should be set when a source of information different\n from the one used for `net.peer.ip`, is available even if that other\n source just confirms the same value as `net.peer.ip`.\n Rationale: For `net.peer.ip`, one typically does not know if it\n comes from a proxy, reverse proxy, or the actual client. Setting\n `http.client_ip` when it's the same as `net.peer.ip` means that\n one is at least somewhat confident that the address is not that of\n the closest proxy.\n */\n HTTP_CLIENT_IP: 'http.client_ip',\n /**\n * The keys in the `RequestItems` object field.\n */\n AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names',\n /**\n * The JSON-serialized value of each item in the `ConsumedCapacity` response field.\n */\n AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity',\n /**\n * The JSON-serialized value of the `ItemCollectionMetrics` response field.\n */\n AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics',\n /**\n * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity',\n /**\n * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity',\n /**\n * The value of the `ConsistentRead` request parameter.\n */\n AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read',\n /**\n * The value of the `ProjectionExpression` request parameter.\n */\n AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection',\n /**\n * The value of the `Limit` request parameter.\n */\n AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit',\n /**\n * The value of the `AttributesToGet` request parameter.\n */\n AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get',\n /**\n * The value of the `IndexName` request parameter.\n */\n AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name',\n /**\n * The value of the `Select` request parameter.\n */\n AWS_DYNAMODB_SELECT: 'aws.dynamodb.select',\n /**\n * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes',\n /**\n * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes',\n /**\n * The value of the `ExclusiveStartTableName` request parameter.\n */\n AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table',\n /**\n * The the number of items in the `TableNames` response parameter.\n */\n AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count',\n /**\n * The value of the `ScanIndexForward` request parameter.\n */\n AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward',\n /**\n * The value of the `Segment` request parameter.\n */\n AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment',\n /**\n * The value of the `TotalSegments` request parameter.\n */\n AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments',\n /**\n * The value of the `Count` response parameter.\n */\n AWS_DYNAMODB_COUNT: 'aws.dynamodb.count',\n /**\n * The value of the `ScannedCount` response parameter.\n */\n AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count',\n /**\n * The JSON-serialized value of each item in the `AttributeDefinitions` request field.\n */\n AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions',\n /**\n * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates',\n /**\n * A string identifying the messaging system.\n */\n MESSAGING_SYSTEM: 'messaging.system',\n /**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n */\n MESSAGING_DESTINATION: 'messaging.destination',\n /**\n * The kind of message destination.\n */\n MESSAGING_DESTINATION_KIND: 'messaging.destination_kind',\n /**\n * A boolean that is true if the message destination is temporary.\n */\n MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination',\n /**\n * The name of the transport protocol.\n */\n MESSAGING_PROTOCOL: 'messaging.protocol',\n /**\n * The version of the transport protocol.\n */\n MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version',\n /**\n * Connection string.\n */\n MESSAGING_URL: 'messaging.url',\n /**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n */\n MESSAGING_MESSAGE_ID: 'messaging.message_id',\n /**\n * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".\n */\n MESSAGING_CONVERSATION_ID: 'messaging.conversation_id',\n /**\n * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported.\n */\n MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes',\n /**\n * The compressed size of the message payload in bytes.\n */\n MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes',\n /**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n */\n MESSAGING_OPERATION: 'messaging.operation',\n /**\n * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message.\n */\n MESSAGING_CONSUMER_ID: 'messaging.consumer_id',\n /**\n * RabbitMQ message routing key.\n */\n MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.routing_key',\n /**\n * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.\n *\n * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.\n */\n MESSAGING_KAFKA_MESSAGE_KEY: 'messaging.kafka.message_key',\n /**\n * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers.\n */\n MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group',\n /**\n * Client Id for the Consumer or Producer that is handling the message.\n */\n MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id',\n /**\n * Partition the message is sent to.\n */\n MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition',\n /**\n * A boolean that is true if the message is a tombstone.\n */\n MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone',\n /**\n * A string identifying the remoting system.\n */\n RPC_SYSTEM: 'rpc.system',\n /**\n * The full (logical) name of the service being called, including its package name, if applicable.\n *\n * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).\n */\n RPC_SERVICE: 'rpc.service',\n /**\n * The name of the (logical) method being called, must be equal to the $method part in the span name.\n *\n * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).\n */\n RPC_METHOD: 'rpc.method',\n /**\n * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.\n */\n RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code',\n /**\n * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted.\n */\n RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version',\n /**\n * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification.\n */\n RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id',\n /**\n * `error.code` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code',\n /**\n * `error.message` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message',\n /**\n * Whether this is a received or sent message.\n */\n MESSAGE_TYPE: 'message.type',\n /**\n * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.\n *\n * Note: This way we guarantee that the values will be consistent between different implementations.\n */\n MESSAGE_ID: 'message.id',\n /**\n * Compressed size of the message in bytes.\n */\n MESSAGE_COMPRESSED_SIZE: 'message.compressed_size',\n /**\n * Uncompressed size of the message in bytes.\n */\n MESSAGE_UNCOMPRESSED_SIZE: 'message.uncompressed_size',\n};\nexports.DbSystemValues = {\n /** Some other SQL database. Fallback only. See notes. */\n OTHER_SQL: 'other_sql',\n /** Microsoft SQL Server. */\n MSSQL: 'mssql',\n /** MySQL. */\n MYSQL: 'mysql',\n /** Oracle Database. */\n ORACLE: 'oracle',\n /** IBM Db2. */\n DB2: 'db2',\n /** PostgreSQL. */\n POSTGRESQL: 'postgresql',\n /** Amazon Redshift. */\n REDSHIFT: 'redshift',\n /** Apache Hive. */\n HIVE: 'hive',\n /** Cloudscape. */\n CLOUDSCAPE: 'cloudscape',\n /** HyperSQL DataBase. */\n HSQLDB: 'hsqldb',\n /** Progress Database. */\n PROGRESS: 'progress',\n /** SAP MaxDB. */\n MAXDB: 'maxdb',\n /** SAP HANA. */\n HANADB: 'hanadb',\n /** Ingres. */\n INGRES: 'ingres',\n /** FirstSQL. */\n FIRSTSQL: 'firstsql',\n /** EnterpriseDB. */\n EDB: 'edb',\n /** InterSystems Caché. */\n CACHE: 'cache',\n /** Adabas (Adaptable Database System). */\n ADABAS: 'adabas',\n /** Firebird. */\n FIREBIRD: 'firebird',\n /** Apache Derby. */\n DERBY: 'derby',\n /** FileMaker. */\n FILEMAKER: 'filemaker',\n /** Informix. */\n INFORMIX: 'informix',\n /** InstantDB. */\n INSTANTDB: 'instantdb',\n /** InterBase. */\n INTERBASE: 'interbase',\n /** MariaDB. */\n MARIADB: 'mariadb',\n /** Netezza. */\n NETEZZA: 'netezza',\n /** Pervasive PSQL. */\n PERVASIVE: 'pervasive',\n /** PointBase. */\n POINTBASE: 'pointbase',\n /** SQLite. */\n SQLITE: 'sqlite',\n /** Sybase. */\n SYBASE: 'sybase',\n /** Teradata. */\n TERADATA: 'teradata',\n /** Vertica. */\n VERTICA: 'vertica',\n /** H2. */\n H2: 'h2',\n /** ColdFusion IMQ. */\n COLDFUSION: 'coldfusion',\n /** Apache Cassandra. */\n CASSANDRA: 'cassandra',\n /** Apache HBase. */\n HBASE: 'hbase',\n /** MongoDB. */\n MONGODB: 'mongodb',\n /** Redis. */\n REDIS: 'redis',\n /** Couchbase. */\n COUCHBASE: 'couchbase',\n /** CouchDB. */\n COUCHDB: 'couchdb',\n /** Microsoft Azure Cosmos DB. */\n COSMOSDB: 'cosmosdb',\n /** Amazon DynamoDB. */\n DYNAMODB: 'dynamodb',\n /** Neo4j. */\n NEO4J: 'neo4j',\n /** Apache Geode. */\n GEODE: 'geode',\n /** Elasticsearch. */\n ELASTICSEARCH: 'elasticsearch',\n /** Memcached. */\n MEMCACHED: 'memcached',\n /** CockroachDB. */\n COCKROACHDB: 'cockroachdb',\n};\nexports.DbCassandraConsistencyLevelValues = {\n /** all. */\n ALL: 'all',\n /** each_quorum. */\n EACH_QUORUM: 'each_quorum',\n /** quorum. */\n QUORUM: 'quorum',\n /** local_quorum. */\n LOCAL_QUORUM: 'local_quorum',\n /** one. */\n ONE: 'one',\n /** two. */\n TWO: 'two',\n /** three. */\n THREE: 'three',\n /** local_one. */\n LOCAL_ONE: 'local_one',\n /** any. */\n ANY: 'any',\n /** serial. */\n SERIAL: 'serial',\n /** local_serial. */\n LOCAL_SERIAL: 'local_serial',\n};\nexports.FaasTriggerValues = {\n /** A response to some data source operation such as a database or filesystem read/write. */\n DATASOURCE: 'datasource',\n /** To provide an answer to an inbound HTTP request. */\n HTTP: 'http',\n /** A function is set to be executed when messages are sent to a messaging system. */\n PUBSUB: 'pubsub',\n /** A function is scheduled to be executed regularly. */\n TIMER: 'timer',\n /** If none of the others apply. */\n OTHER: 'other',\n};\nexports.FaasDocumentOperationValues = {\n /** When a new object is created. */\n INSERT: 'insert',\n /** When an object is modified. */\n EDIT: 'edit',\n /** When an object is deleted. */\n DELETE: 'delete',\n};\nexports.FaasInvokedProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexports.NetTransportValues = {\n /** ip_tcp. */\n IP_TCP: 'ip_tcp',\n /** ip_udp. */\n IP_UDP: 'ip_udp',\n /** Another IP-based protocol. */\n IP: 'ip',\n /** Unix Domain socket. See below. */\n UNIX: 'unix',\n /** Named or anonymous pipe. See note below. */\n PIPE: 'pipe',\n /** In-process communication. */\n INPROC: 'inproc',\n /** Something else (non IP-based). */\n OTHER: 'other',\n};\nexports.NetHostConnectionTypeValues = {\n /** wifi. */\n WIFI: 'wifi',\n /** wired. */\n WIRED: 'wired',\n /** cell. */\n CELL: 'cell',\n /** unavailable. */\n UNAVAILABLE: 'unavailable',\n /** unknown. */\n UNKNOWN: 'unknown',\n};\nexports.NetHostConnectionSubtypeValues = {\n /** GPRS. */\n GPRS: 'gprs',\n /** EDGE. */\n EDGE: 'edge',\n /** UMTS. */\n UMTS: 'umts',\n /** CDMA. */\n CDMA: 'cdma',\n /** EVDO Rel. 0. */\n EVDO_0: 'evdo_0',\n /** EVDO Rev. A. */\n EVDO_A: 'evdo_a',\n /** CDMA2000 1XRTT. */\n CDMA2000_1XRTT: 'cdma2000_1xrtt',\n /** HSDPA. */\n HSDPA: 'hsdpa',\n /** HSUPA. */\n HSUPA: 'hsupa',\n /** HSPA. */\n HSPA: 'hspa',\n /** IDEN. */\n IDEN: 'iden',\n /** EVDO Rev. B. */\n EVDO_B: 'evdo_b',\n /** LTE. */\n LTE: 'lte',\n /** EHRPD. */\n EHRPD: 'ehrpd',\n /** HSPAP. */\n HSPAP: 'hspap',\n /** GSM. */\n GSM: 'gsm',\n /** TD-SCDMA. */\n TD_SCDMA: 'td_scdma',\n /** IWLAN. */\n IWLAN: 'iwlan',\n /** 5G NR (New Radio). */\n NR: 'nr',\n /** 5G NRNSA (New Radio Non-Standalone). */\n NRNSA: 'nrnsa',\n /** LTE CA. */\n LTE_CA: 'lte_ca',\n};\nexports.HttpFlavorValues = {\n /** HTTP 1.0. */\n HTTP_1_0: '1.0',\n /** HTTP 1.1. */\n HTTP_1_1: '1.1',\n /** HTTP 2. */\n HTTP_2_0: '2.0',\n /** SPDY protocol. */\n SPDY: 'SPDY',\n /** QUIC protocol. */\n QUIC: 'QUIC',\n};\nexports.MessagingDestinationKindValues = {\n /** A message sent to a queue. */\n QUEUE: 'queue',\n /** A message sent to a topic. */\n TOPIC: 'topic',\n};\nexports.MessagingOperationValues = {\n /** receive. */\n RECEIVE: 'receive',\n /** process. */\n PROCESS: 'process',\n};\nexports.RpcGrpcStatusCodeValues = {\n /** OK. */\n OK: 0,\n /** CANCELLED. */\n CANCELLED: 1,\n /** UNKNOWN. */\n UNKNOWN: 2,\n /** INVALID_ARGUMENT. */\n INVALID_ARGUMENT: 3,\n /** DEADLINE_EXCEEDED. */\n DEADLINE_EXCEEDED: 4,\n /** NOT_FOUND. */\n NOT_FOUND: 5,\n /** ALREADY_EXISTS. */\n ALREADY_EXISTS: 6,\n /** PERMISSION_DENIED. */\n PERMISSION_DENIED: 7,\n /** RESOURCE_EXHAUSTED. */\n RESOURCE_EXHAUSTED: 8,\n /** FAILED_PRECONDITION. */\n FAILED_PRECONDITION: 9,\n /** ABORTED. */\n ABORTED: 10,\n /** OUT_OF_RANGE. */\n OUT_OF_RANGE: 11,\n /** UNIMPLEMENTED. */\n UNIMPLEMENTED: 12,\n /** INTERNAL. */\n INTERNAL: 13,\n /** UNAVAILABLE. */\n UNAVAILABLE: 14,\n /** DATA_LOSS. */\n DATA_LOSS: 15,\n /** UNAUTHENTICATED. */\n UNAUTHENTICATED: 16,\n};\nexports.MessageTypeValues = {\n /** sent. */\n SENT: 'SENT',\n /** received. */\n RECEIVED: 'RECEIVED',\n};\n//# sourceMappingURL=SemanticAttributes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./SemanticAttributes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Resource = void 0;\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst platform_1 = require(\"./platform\");\n/**\n * A Resource describes the entity for which a signals (metrics or trace) are\n * collected.\n */\nclass Resource {\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n attributes) {\n this.attributes = attributes;\n }\n /**\n * Returns an empty Resource\n */\n static empty() {\n return Resource.EMPTY;\n }\n /**\n * Returns a Resource that indentifies the SDK in use.\n */\n static default() {\n return new Resource({\n [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: (0, platform_1.defaultServiceName)(),\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME],\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: core_1.SDK_INFO[semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION],\n });\n }\n /**\n * Returns a new, merged {@link Resource} by merging the current Resource\n * with the other Resource. In case of a collision, other Resource takes\n * precedence.\n *\n * @param other the Resource that will be merged with this.\n * @returns the newly merged Resource.\n */\n merge(other) {\n if (!other || !Object.keys(other.attributes).length)\n return this;\n // SpanAttributes from resource overwrite attributes from other resource.\n const mergedAttributes = Object.assign({}, this.attributes, other.attributes);\n return new Resource(mergedAttributes);\n }\n}\nexports.Resource = Resource;\nResource.EMPTY = new Resource({});\n//# sourceMappingURL=Resource.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=config.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.browserDetector = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst __1 = require(\"..\");\n/**\n * BrowserDetector will be used to detect the resources related to browser.\n */\nclass BrowserDetector {\n async detect(config) {\n const isBrowser = typeof navigator !== 'undefined';\n if (!isBrowser) {\n return __1.Resource.empty();\n }\n const browserResource = {\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'browser',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Web Browser',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: navigator.userAgent\n };\n return this._getResourceAttributes(browserResource, config);\n }\n /**\n * Validates process resource attribute map from process variables\n *\n * @param browserResource The un-sanitized resource attributes from process as key/value pairs.\n * @param config: Config\n * @returns The sanitized resource attributes.\n */\n _getResourceAttributes(browserResource, _config) {\n if (browserResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '') {\n api_1.diag.debug('BrowserDetector failed: Unable to find required browser resources. ');\n return __1.Resource.empty();\n }\n else {\n return new __1.Resource(Object.assign({}, browserResource));\n }\n }\n}\nexports.browserDetector = new BrowserDetector();\n//# sourceMappingURL=BrowserDetector.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.envDetector = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst Resource_1 = require(\"../Resource\");\n/**\n * EnvDetector can be used to detect the presence of and create a Resource\n * from the OTEL_RESOURCE_ATTRIBUTES environment variable.\n */\nclass EnvDetector {\n constructor() {\n // Type, attribute keys, and attribute values should not exceed 256 characters.\n this._MAX_LENGTH = 255;\n // OTEL_RESOURCE_ATTRIBUTES is a comma-separated list of attributes.\n this._COMMA_SEPARATOR = ',';\n // OTEL_RESOURCE_ATTRIBUTES contains key value pair separated by '='.\n this._LABEL_KEY_VALUE_SPLITTER = '=';\n this._ERROR_MESSAGE_INVALID_CHARS = 'should be a ASCII string with a length greater than 0 and not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n this._ERROR_MESSAGE_INVALID_VALUE = 'should be a ASCII string with a length not exceed ' +\n this._MAX_LENGTH +\n ' characters.';\n }\n /**\n * Returns a {@link Resource} populated with attributes from the\n * OTEL_RESOURCE_ATTRIBUTES environment variable. Note this is an async\n * function to conform to the Detector interface.\n *\n * @param config The resource detection config\n */\n async detect(_config) {\n const attributes = {};\n const env = (0, core_1.getEnv)();\n const rawAttributes = env.OTEL_RESOURCE_ATTRIBUTES;\n const serviceName = env.OTEL_SERVICE_NAME;\n if (rawAttributes) {\n try {\n const parsedAttributes = this._parseResourceAttributes(rawAttributes);\n Object.assign(attributes, parsedAttributes);\n }\n catch (e) {\n api_1.diag.debug(`EnvDetector failed: ${e.message}`);\n }\n }\n if (serviceName) {\n attributes[semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME] = serviceName;\n }\n return new Resource_1.Resource(attributes);\n }\n /**\n * Creates an attribute map from the OTEL_RESOURCE_ATTRIBUTES environment\n * variable.\n *\n * OTEL_RESOURCE_ATTRIBUTES: A comma-separated list of attributes describing\n * the source in more detail, e.g. “key1=val1,key2=val2”. Domain names and\n * paths are accepted as attribute keys. Values may be quoted or unquoted in\n * general. If a value contains whitespaces, =, or \" characters, it must\n * always be quoted.\n *\n * @param rawEnvAttributes The resource attributes as a comma-seperated list\n * of key/value pairs.\n * @returns The sanitized resource attributes.\n */\n _parseResourceAttributes(rawEnvAttributes) {\n if (!rawEnvAttributes)\n return {};\n const attributes = {};\n const rawAttributes = rawEnvAttributes.split(this._COMMA_SEPARATOR, -1);\n for (const rawAttribute of rawAttributes) {\n const keyValuePair = rawAttribute.split(this._LABEL_KEY_VALUE_SPLITTER, -1);\n if (keyValuePair.length !== 2) {\n continue;\n }\n let [key, value] = keyValuePair;\n // Leading and trailing whitespaces are trimmed.\n key = key.trim();\n value = value.trim().split('^\"|\"$').join('');\n if (!this._isValidAndNotEmpty(key)) {\n throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);\n }\n if (!this._isValid(value)) {\n throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);\n }\n attributes[key] = value;\n }\n return attributes;\n }\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid.\n */\n _isValid(name) {\n return name.length <= this._MAX_LENGTH && this._isPrintableString(name);\n }\n _isPrintableString(str) {\n for (let i = 0; i < str.length; i++) {\n const ch = str.charAt(i);\n if (ch <= ' ' || ch >= '~') {\n return false;\n }\n }\n return true;\n }\n /**\n * Determines whether the given String is a valid printable ASCII string with\n * a length greater than 0 and not exceed _MAX_LENGTH characters.\n *\n * @param str The String to be validated.\n * @returns Whether the String is valid and not empty.\n */\n _isValidAndNotEmpty(str) {\n return str.length > 0 && this._isValid(str);\n }\n}\nexports.envDetector = new EnvDetector();\n//# sourceMappingURL=EnvDetector.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.processDetector = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst Resource_1 = require(\"../Resource\");\n/**\n * ProcessDetector will be used to detect the resources related current process running\n * and being instrumented from the NodeJS Process module.\n */\nclass ProcessDetector {\n async detect(config) {\n // Skip if not in Node.js environment.\n if (typeof process !== 'object') {\n return Resource_1.Resource.empty();\n }\n const processResource = {\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_PID]: process.pid,\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]: process.title || '',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND]: process.argv[1] || '',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND_LINE]: process.argv.join(' ') || '',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]: process.versions.node,\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'nodejs',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]: 'Node.js',\n };\n return this._getResourceAttributes(processResource, config);\n }\n /**\n * Validates process resource attribute map from process varaibls\n *\n * @param processResource The unsantized resource attributes from process as key/value pairs.\n * @param config: Config\n * @returns The sanitized resource attributes.\n */\n _getResourceAttributes(processResource, _config) {\n if (processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME] ===\n '' ||\n processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH] ===\n '' ||\n processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND] === '' ||\n processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_COMMAND_LINE] === '' ||\n processResource[semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION] === '') {\n api_1.diag.debug('ProcessDetector failed: Unable to find required process resources. ');\n return Resource_1.Resource.empty();\n }\n else {\n return new Resource_1.Resource(Object.assign({}, processResource));\n }\n }\n}\nexports.processDetector = new ProcessDetector();\n//# sourceMappingURL=ProcessDetector.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./BrowserDetector\"), exports);\n__exportStar(require(\"./EnvDetector\"), exports);\n__exportStar(require(\"./ProcessDetector\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Resource\"), exports);\n__exportStar(require(\"./platform\"), exports);\n__exportStar(require(\"./types\"), exports);\n__exportStar(require(\"./config\"), exports);\n__exportStar(require(\"./detectors\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hostDetector = void 0;\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst Resource_1 = require(\"../../Resource\");\nconst os_1 = require(\"os\");\n/**\n * HostDetector detects the resources related to the host current process is\n * running on. Currently only non-cloud-based attributes are included.\n */\nclass HostDetector {\n async detect(_config) {\n const attributes = {\n [semantic_conventions_1.SemanticResourceAttributes.HOST_NAME]: (0, os_1.hostname)(),\n [semantic_conventions_1.SemanticResourceAttributes.HOST_ARCH]: this._normalizeArch((0, os_1.arch)()),\n };\n return new Resource_1.Resource(attributes);\n }\n _normalizeArch(nodeArchString) {\n // Maps from https://nodejs.org/api/os.html#osarch to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/host.md\n switch (nodeArchString) {\n case 'arm':\n return 'arm32';\n case 'ppc':\n return 'ppc32';\n case 'x64':\n return 'amd64';\n default:\n return nodeArchString;\n }\n }\n}\nexports.hostDetector = new HostDetector();\n//# sourceMappingURL=HostDetector.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.osDetector = void 0;\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst Resource_1 = require(\"../../Resource\");\nconst os_1 = require(\"os\");\n/**\n * OSDetector detects the resources related to the operating system (OS) on\n * which the process represented by this resource is running.\n */\nclass OSDetector {\n async detect(_config) {\n const attributes = {\n [semantic_conventions_1.SemanticResourceAttributes.OS_TYPE]: this._normalizeType((0, os_1.platform)()),\n [semantic_conventions_1.SemanticResourceAttributes.OS_VERSION]: (0, os_1.release)(),\n };\n return new Resource_1.Resource(attributes);\n }\n _normalizeType(nodePlatform) {\n // Maps from https://nodejs.org/api/os.html#osplatform to arch values in spec:\n // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/os.md\n switch (nodePlatform) {\n case 'sunos':\n return 'solaris';\n case 'win32':\n return 'windows';\n default:\n return nodePlatform;\n }\n }\n}\nexports.osDetector = new OSDetector();\n//# sourceMappingURL=OSDetector.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultServiceName = void 0;\nfunction defaultServiceName() {\n return `unknown_service:${process.argv0}`;\n}\nexports.defaultServiceName = defaultServiceName;\n//# sourceMappingURL=default-service-name.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.detectResources = void 0;\nconst Resource_1 = require(\"../../Resource\");\nconst api_1 = require(\"@opentelemetry/api\");\nconst util = require(\"util\");\n/**\n * Runs all resource detectors and returns the results merged into a single\n * Resource.\n *\n * @param config Configuration for resource detection\n */\nconst detectResources = async (config = {}) => {\n const internalConfig = Object.assign(config);\n const resources = await Promise.all((internalConfig.detectors || []).map(async (d) => {\n try {\n const resource = await d.detect(internalConfig);\n api_1.diag.debug(`${d.constructor.name} found resource.`, resource);\n return resource;\n }\n catch (e) {\n api_1.diag.debug(`${d.constructor.name} failed: ${e.message}`);\n return Resource_1.Resource.empty();\n }\n }));\n // Future check if verbose logging is enabled issue #1903\n logResources(resources);\n return resources.reduce((acc, resource) => acc.merge(resource), Resource_1.Resource.empty());\n};\nexports.detectResources = detectResources;\n/**\n * Writes debug information about the detected resources to the logger defined in the resource detection config, if one is provided.\n *\n * @param resources The array of {@link Resource} that should be logged. Empty entries will be ignored.\n */\nconst logResources = (resources) => {\n resources.forEach(resource => {\n // Print only populated resources\n if (Object.keys(resource.attributes).length > 0) {\n const resourceDebugString = util.inspect(resource.attributes, {\n depth: 2,\n breakLength: Infinity,\n sorted: true,\n compact: false,\n });\n api_1.diag.verbose(resourceDebugString);\n }\n });\n};\n//# sourceMappingURL=detect-resources.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./default-service-name\"), exports);\n__exportStar(require(\"./detect-resources\"), exports);\n__exportStar(require(\"./HostDetector\"), exports);\n__exportStar(require(\"./OSDetector\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BasicTracerProvider = exports.ForceFlushState = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst resources_1 = require(\"@opentelemetry/resources\");\nconst _1 = require(\".\");\nconst config_1 = require(\"./config\");\nconst MultiSpanProcessor_1 = require(\"./MultiSpanProcessor\");\nconst NoopSpanProcessor_1 = require(\"./export/NoopSpanProcessor\");\nconst platform_1 = require(\"./platform\");\nconst utility_1 = require(\"./utility\");\nvar ForceFlushState;\n(function (ForceFlushState) {\n ForceFlushState[ForceFlushState[\"resolved\"] = 0] = \"resolved\";\n ForceFlushState[ForceFlushState[\"timeout\"] = 1] = \"timeout\";\n ForceFlushState[ForceFlushState[\"error\"] = 2] = \"error\";\n ForceFlushState[ForceFlushState[\"unresolved\"] = 3] = \"unresolved\";\n})(ForceFlushState = exports.ForceFlushState || (exports.ForceFlushState = {}));\n/**\n * This class represents a basic tracer provider which platform libraries can extend\n */\nclass BasicTracerProvider {\n constructor(config = {}) {\n var _a;\n this._registeredSpanProcessors = [];\n this._tracers = new Map();\n const mergedConfig = (0, core_1.merge)({}, config_1.DEFAULT_CONFIG, (0, utility_1.reconfigureLimits)(config));\n this.resource = (_a = mergedConfig.resource) !== null && _a !== void 0 ? _a : resources_1.Resource.empty();\n this.resource = resources_1.Resource.default().merge(this.resource);\n this._config = Object.assign({}, mergedConfig, {\n resource: this.resource,\n });\n const defaultExporter = this._buildExporterFromEnv();\n if (defaultExporter !== undefined) {\n const batchProcessor = new platform_1.BatchSpanProcessor(defaultExporter);\n this.activeSpanProcessor = batchProcessor;\n }\n else {\n this.activeSpanProcessor = new NoopSpanProcessor_1.NoopSpanProcessor();\n }\n }\n getTracer(name, version, options) {\n const key = `${name}@${version || ''}:${(options === null || options === void 0 ? void 0 : options.schemaUrl) || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new _1.Tracer({ name, version, schemaUrl: options === null || options === void 0 ? void 0 : options.schemaUrl }, this._config, this));\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key);\n }\n /**\n * Adds a new {@link SpanProcessor} to this tracer.\n * @param spanProcessor the new SpanProcessor to be added.\n */\n addSpanProcessor(spanProcessor) {\n if (this._registeredSpanProcessors.length === 0) {\n // since we might have enabled by default a batchProcessor, we disable it\n // before adding the new one\n this.activeSpanProcessor\n .shutdown()\n .catch(err => api_1.diag.error('Error while trying to shutdown current span processor', err));\n }\n this._registeredSpanProcessors.push(spanProcessor);\n this.activeSpanProcessor = new MultiSpanProcessor_1.MultiSpanProcessor(this._registeredSpanProcessors);\n }\n getActiveSpanProcessor() {\n return this.activeSpanProcessor;\n }\n /**\n * Register this TracerProvider for use with the OpenTelemetry API.\n * Undefined values may be replaced with defaults, and\n * null values will be skipped.\n *\n * @param config Configuration object for SDK registration\n */\n register(config = {}) {\n api_1.trace.setGlobalTracerProvider(this);\n if (config.propagator === undefined) {\n config.propagator = this._buildPropagatorFromEnv();\n }\n if (config.contextManager) {\n api_1.context.setGlobalContextManager(config.contextManager);\n }\n if (config.propagator) {\n api_1.propagation.setGlobalPropagator(config.propagator);\n }\n }\n forceFlush() {\n const timeout = this._config.forceFlushTimeoutMillis;\n const promises = this._registeredSpanProcessors.map((spanProcessor) => {\n return new Promise(resolve => {\n let state;\n const timeoutInterval = setTimeout(() => {\n resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));\n state = ForceFlushState.timeout;\n }, timeout);\n spanProcessor\n .forceFlush()\n .then(() => {\n clearTimeout(timeoutInterval);\n if (state !== ForceFlushState.timeout) {\n state = ForceFlushState.resolved;\n resolve(state);\n }\n })\n .catch(error => {\n clearTimeout(timeoutInterval);\n state = ForceFlushState.error;\n resolve(error);\n });\n });\n });\n return new Promise((resolve, reject) => {\n Promise.all(promises)\n .then(results => {\n const errors = results.filter(result => result !== ForceFlushState.resolved);\n if (errors.length > 0) {\n reject(errors);\n }\n else {\n resolve();\n }\n })\n .catch(error => reject([error]));\n });\n }\n shutdown() {\n return this.activeSpanProcessor.shutdown();\n }\n _getPropagator(name) {\n var _a;\n return (_a = BasicTracerProvider._registeredPropagators.get(name)) === null || _a === void 0 ? void 0 : _a();\n }\n _getSpanExporter(name) {\n var _a;\n return (_a = BasicTracerProvider._registeredExporters.get(name)) === null || _a === void 0 ? void 0 : _a();\n }\n _buildPropagatorFromEnv() {\n // per spec, propagators from env must be deduplicated\n const uniquePropagatorNames = Array.from(new Set((0, core_1.getEnv)().OTEL_PROPAGATORS));\n const propagators = uniquePropagatorNames.map(name => {\n const propagator = this._getPropagator(name);\n if (!propagator) {\n api_1.diag.warn(`Propagator \"${name}\" requested through environment variable is unavailable.`);\n }\n return propagator;\n });\n const validPropagators = propagators.reduce((list, item) => {\n if (item) {\n list.push(item);\n }\n return list;\n }, []);\n if (validPropagators.length === 0) {\n return;\n }\n else if (uniquePropagatorNames.length === 1) {\n return validPropagators[0];\n }\n else {\n return new core_1.CompositePropagator({\n propagators: validPropagators,\n });\n }\n }\n _buildExporterFromEnv() {\n const exporterName = (0, core_1.getEnv)().OTEL_TRACES_EXPORTER;\n if (exporterName === 'none')\n return;\n const exporter = this._getSpanExporter(exporterName);\n if (!exporter) {\n api_1.diag.error(`Exporter \"${exporterName}\" requested through environment variable is unavailable.`);\n }\n return exporter;\n }\n}\nexports.BasicTracerProvider = BasicTracerProvider;\nBasicTracerProvider._registeredPropagators = new Map([\n ['tracecontext', () => new core_1.W3CTraceContextPropagator()],\n ['baggage', () => new core_1.W3CBaggagePropagator()],\n]);\nBasicTracerProvider._registeredExporters = new Map();\n//# sourceMappingURL=BasicTracerProvider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MultiSpanProcessor = void 0;\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * Implementation of the {@link SpanProcessor} that simply forwards all\n * received events to a list of {@link SpanProcessor}s.\n */\nclass MultiSpanProcessor {\n constructor(_spanProcessors) {\n this._spanProcessors = _spanProcessors;\n }\n forceFlush() {\n const promises = [];\n for (const spanProcessor of this._spanProcessors) {\n promises.push(spanProcessor.forceFlush());\n }\n return new Promise(resolve => {\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(error => {\n (0, core_1.globalErrorHandler)(error || new Error('MultiSpanProcessor: forceFlush failed'));\n resolve();\n });\n });\n }\n onStart(span, context) {\n for (const spanProcessor of this._spanProcessors) {\n spanProcessor.onStart(span, context);\n }\n }\n onEnd(span) {\n for (const spanProcessor of this._spanProcessors) {\n spanProcessor.onEnd(span);\n }\n }\n shutdown() {\n const promises = [];\n for (const spanProcessor of this._spanProcessors) {\n promises.push(spanProcessor.shutdown());\n }\n return new Promise((resolve, reject) => {\n Promise.all(promises).then(() => {\n resolve();\n }, reject);\n });\n }\n}\nexports.MultiSpanProcessor = MultiSpanProcessor;\n//# sourceMappingURL=MultiSpanProcessor.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Span = void 0;\nconst api = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\nconst enums_1 = require(\"./enums\");\n/**\n * This class represents a span.\n */\nclass Span {\n /** Constructs a new Span instance. */\n constructor(parentTracer, context, spanName, spanContext, kind, parentSpanId, links = [], startTime = (0, core_1.hrTime)()) {\n this.attributes = {};\n this.links = [];\n this.events = [];\n this.status = {\n code: api.SpanStatusCode.UNSET,\n };\n this.endTime = [0, 0];\n this._ended = false;\n this._duration = [-1, -1];\n this.name = spanName;\n this._spanContext = spanContext;\n this.parentSpanId = parentSpanId;\n this.kind = kind;\n this.links = links;\n this.startTime = (0, core_1.timeInputToHrTime)(startTime);\n this.resource = parentTracer.resource;\n this.instrumentationLibrary = parentTracer.instrumentationLibrary;\n this._spanLimits = parentTracer.getSpanLimits();\n this._spanProcessor = parentTracer.getActiveSpanProcessor();\n this._spanProcessor.onStart(this, context);\n this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit || 0;\n }\n spanContext() {\n return this._spanContext;\n }\n setAttribute(key, value) {\n if (value == null || this._isSpanEnded())\n return this;\n if (key.length === 0) {\n api.diag.warn(`Invalid attribute key: ${key}`);\n return this;\n }\n if (!(0, core_1.isAttributeValue)(value)) {\n api.diag.warn(`Invalid attribute value set for key: ${key}`);\n return this;\n }\n if (Object.keys(this.attributes).length >=\n this._spanLimits.attributeCountLimit &&\n !Object.prototype.hasOwnProperty.call(this.attributes, key)) {\n return this;\n }\n this.attributes[key] = this._truncateToSize(value);\n return this;\n }\n setAttributes(attributes) {\n for (const [k, v] of Object.entries(attributes)) {\n this.setAttribute(k, v);\n }\n return this;\n }\n /**\n *\n * @param name Span Name\n * @param [attributesOrStartTime] Span attributes or start time\n * if type is {@type TimeInput} and 3rd param is undefined\n * @param [startTime] Specified start time for the event\n */\n addEvent(name, attributesOrStartTime, startTime) {\n if (this._isSpanEnded())\n return this;\n if (this._spanLimits.eventCountLimit === 0) {\n api.diag.warn('No events allowed.');\n return this;\n }\n if (this.events.length >= this._spanLimits.eventCountLimit) {\n api.diag.warn('Dropping extra events.');\n this.events.shift();\n }\n if ((0, core_1.isTimeInput)(attributesOrStartTime)) {\n if (typeof startTime === 'undefined') {\n startTime = attributesOrStartTime;\n }\n attributesOrStartTime = undefined;\n }\n if (typeof startTime === 'undefined') {\n startTime = (0, core_1.hrTime)();\n }\n const attributes = (0, core_1.sanitizeAttributes)(attributesOrStartTime);\n this.events.push({\n name,\n attributes,\n time: (0, core_1.timeInputToHrTime)(startTime),\n });\n return this;\n }\n setStatus(status) {\n if (this._isSpanEnded())\n return this;\n this.status = status;\n return this;\n }\n updateName(name) {\n if (this._isSpanEnded())\n return this;\n this.name = name;\n return this;\n }\n end(endTime = (0, core_1.hrTime)()) {\n if (this._isSpanEnded()) {\n api.diag.error('You can only call end() on a span once.');\n return;\n }\n this._ended = true;\n this.endTime = (0, core_1.timeInputToHrTime)(endTime);\n this._duration = (0, core_1.hrTimeDuration)(this.startTime, this.endTime);\n if (this._duration[0] < 0) {\n api.diag.warn('Inconsistent start and end time, startTime > endTime', this.startTime, this.endTime);\n }\n this._spanProcessor.onEnd(this);\n }\n isRecording() {\n return this._ended === false;\n }\n recordException(exception, time = (0, core_1.hrTime)()) {\n const attributes = {};\n if (typeof exception === 'string') {\n attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE] = exception;\n }\n else if (exception) {\n if (exception.code) {\n attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] = exception.code.toString();\n }\n else if (exception.name) {\n attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] = exception.name;\n }\n if (exception.message) {\n attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE] = exception.message;\n }\n if (exception.stack) {\n attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_STACKTRACE] = exception.stack;\n }\n }\n // these are minimum requirements from spec\n if (attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_TYPE] ||\n attributes[semantic_conventions_1.SemanticAttributes.EXCEPTION_MESSAGE]) {\n this.addEvent(enums_1.ExceptionEventName, attributes, time);\n }\n else {\n api.diag.warn(`Failed to record an exception ${exception}`);\n }\n }\n get duration() {\n return this._duration;\n }\n get ended() {\n return this._ended;\n }\n _isSpanEnded() {\n if (this._ended) {\n api.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);\n }\n return this._ended;\n }\n // Utility function to truncate given value within size\n // for value type of string, will truncate to given limit\n // for type of non-string, will return same value\n _truncateToLimitUtil(value, limit) {\n if (value.length <= limit) {\n return value;\n }\n return value.substr(0, limit);\n }\n /**\n * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then\n * return string with trucated to {@code attributeValueLengthLimit} characters\n *\n * If the given attribute value is array of strings then\n * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters\n *\n * Otherwise return same Attribute {@code value}\n *\n * @param value Attribute value\n * @returns truncated attribute value if required, otherwise same value\n */\n _truncateToSize(value) {\n const limit = this._attributeValueLengthLimit;\n // Check limit\n if (limit <= 0) {\n // Negative values are invalid, so do not truncate\n api.diag.warn(`Attribute value limit must be positive, got ${limit}`);\n return value;\n }\n // String\n if (typeof value === 'string') {\n return this._truncateToLimitUtil(value, limit);\n }\n // Array of strings\n if (Array.isArray(value)) {\n return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val);\n }\n // Other types, no need to apply value length limit\n return value;\n }\n}\nexports.Span = Span;\n//# sourceMappingURL=Span.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=SpanProcessor.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=TimedEvent.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Tracer = void 0;\nconst api = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst Span_1 = require(\"./Span\");\nconst utility_1 = require(\"./utility\");\n/**\n * This class represents a basic tracer.\n */\nclass Tracer {\n /**\n * Constructs a new Tracer instance.\n */\n constructor(instrumentationLibrary, config, _tracerProvider) {\n this._tracerProvider = _tracerProvider;\n const localConfig = (0, utility_1.mergeConfig)(config);\n this._sampler = localConfig.sampler;\n this._generalLimits = localConfig.generalLimits;\n this._spanLimits = localConfig.spanLimits;\n this._idGenerator = config.idGenerator || new core_1.RandomIdGenerator();\n this.resource = _tracerProvider.resource;\n this.instrumentationLibrary = instrumentationLibrary;\n }\n /**\n * Starts a new Span or returns the default NoopSpan based on the sampling\n * decision.\n */\n startSpan(name, options = {}, context = api.context.active()) {\n var _a, _b;\n if ((0, core_1.isTracingSuppressed)(context)) {\n api.diag.debug('Instrumentation suppressed, returning Noop Span');\n return api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);\n }\n // remove span from context in case a root span is requested via options\n if (options.root) {\n context = api.trace.deleteSpan(context);\n }\n const parentSpanContext = api.trace.getSpanContext(context);\n const spanId = this._idGenerator.generateSpanId();\n let traceId;\n let traceState;\n let parentSpanId;\n if (!parentSpanContext || !api.trace.isSpanContextValid(parentSpanContext)) {\n // New root span.\n traceId = this._idGenerator.generateTraceId();\n }\n else {\n // New child span.\n traceId = parentSpanContext.traceId;\n traceState = parentSpanContext.traceState;\n parentSpanId = parentSpanContext.spanId;\n }\n const spanKind = (_a = options.kind) !== null && _a !== void 0 ? _a : api.SpanKind.INTERNAL;\n const links = ((_b = options.links) !== null && _b !== void 0 ? _b : []).map(link => {\n return {\n context: link.context,\n attributes: (0, core_1.sanitizeAttributes)(link.attributes),\n };\n });\n const attributes = (0, core_1.sanitizeAttributes)(options.attributes);\n // make sampling decision\n const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links);\n const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED\n ? api.TraceFlags.SAMPLED\n : api.TraceFlags.NONE;\n const spanContext = { traceId, spanId, traceFlags, traceState };\n if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) {\n api.diag.debug('Recording is off, propagating context in a non-recording span');\n return api.trace.wrapSpanContext(spanContext);\n }\n const span = new Span_1.Span(this, context, name, spanContext, spanKind, parentSpanId, links, options.startTime);\n // Set initial span attributes. The attributes object may have been mutated\n // by the sampler, so we sanitize the merged attributes before setting them.\n const initAttributes = (0, core_1.sanitizeAttributes)(Object.assign(attributes, samplingResult.attributes));\n span.setAttributes(initAttributes);\n return span;\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx !== null && ctx !== void 0 ? ctx : api.context.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = api.trace.setSpan(parentContext, span);\n return api.context.with(contextWithSpanSet, fn, undefined, span);\n }\n /** Returns the active {@link GeneralLimits}. */\n getGeneralLimits() {\n return this._generalLimits;\n }\n /** Returns the active {@link SpanLimits}. */\n getSpanLimits() {\n return this._spanLimits;\n }\n getActiveSpanProcessor() {\n return this._tracerProvider.getActiveSpanProcessor();\n }\n}\nexports.Tracer = Tracer;\n//# sourceMappingURL=Tracer.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.buildSamplerFromEnv = exports.DEFAULT_CONFIG = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\nconst env = (0, core_1.getEnv)();\nconst FALLBACK_OTEL_TRACES_SAMPLER = core_1.TracesSamplerValues.AlwaysOn;\nconst DEFAULT_RATIO = 1;\n/**\n * Default configuration. For fields with primitive values, any user-provided\n * value will override the corresponding default value. For fields with\n * non-primitive values (like `spanLimits`), the user-provided value will be\n * used to extend the default value.\n */\nexports.DEFAULT_CONFIG = {\n sampler: buildSamplerFromEnv(env),\n forceFlushTimeoutMillis: 30000,\n generalLimits: {\n attributeValueLengthLimit: (0, core_1.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n attributeCountLimit: (0, core_1.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT,\n },\n spanLimits: {\n attributeValueLengthLimit: (0, core_1.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n attributeCountLimit: (0, core_1.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,\n linkCountLimit: (0, core_1.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,\n eventCountLimit: (0, core_1.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,\n },\n};\n/**\n * Based on environment, builds a sampler, complies with specification.\n * @param environment optional, by default uses getEnv(), but allows passing a value to reuse parsed environment\n */\nfunction buildSamplerFromEnv(environment = (0, core_1.getEnv)()) {\n switch (environment.OTEL_TRACES_SAMPLER) {\n case core_1.TracesSamplerValues.AlwaysOn:\n return new core_1.AlwaysOnSampler();\n case core_1.TracesSamplerValues.AlwaysOff:\n return new core_1.AlwaysOffSampler();\n case core_1.TracesSamplerValues.ParentBasedAlwaysOn:\n return new core_1.ParentBasedSampler({\n root: new core_1.AlwaysOnSampler(),\n });\n case core_1.TracesSamplerValues.ParentBasedAlwaysOff:\n return new core_1.ParentBasedSampler({\n root: new core_1.AlwaysOffSampler(),\n });\n case core_1.TracesSamplerValues.TraceIdRatio:\n return new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment));\n case core_1.TracesSamplerValues.ParentBasedTraceIdRatio:\n return new core_1.ParentBasedSampler({\n root: new core_1.TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv(environment)),\n });\n default:\n api_1.diag.error(`OTEL_TRACES_SAMPLER value \"${environment.OTEL_TRACES_SAMPLER} invalid, defaulting to ${FALLBACK_OTEL_TRACES_SAMPLER}\".`);\n return new core_1.AlwaysOnSampler();\n }\n}\nexports.buildSamplerFromEnv = buildSamplerFromEnv;\nfunction getSamplerProbabilityFromEnv(environment) {\n if (environment.OTEL_TRACES_SAMPLER_ARG === undefined ||\n environment.OTEL_TRACES_SAMPLER_ARG === '') {\n api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n const probability = Number(environment.OTEL_TRACES_SAMPLER_ARG);\n if (isNaN(probability)) {\n api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n if (probability < 0 || probability > 1) {\n api_1.diag.error(`OTEL_TRACES_SAMPLER_ARG=${environment.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n return probability;\n}\n//# sourceMappingURL=config.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExceptionEventName = void 0;\n// Event name definitions\nexports.ExceptionEventName = 'exception';\n//# sourceMappingURL=enums.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BatchSpanProcessorBase = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * Implementation of the {@link SpanProcessor} that batches spans exported by\n * the SDK then pushes them to the exporter pipeline.\n */\nclass BatchSpanProcessorBase {\n constructor(_exporter, config) {\n this._exporter = _exporter;\n this._finishedSpans = [];\n const env = (0, core_1.getEnv)();\n this._maxExportBatchSize =\n typeof (config === null || config === void 0 ? void 0 : config.maxExportBatchSize) === 'number'\n ? config.maxExportBatchSize\n : env.OTEL_BSP_MAX_EXPORT_BATCH_SIZE;\n this._maxQueueSize =\n typeof (config === null || config === void 0 ? void 0 : config.maxQueueSize) === 'number'\n ? config.maxQueueSize\n : env.OTEL_BSP_MAX_QUEUE_SIZE;\n this._scheduledDelayMillis =\n typeof (config === null || config === void 0 ? void 0 : config.scheduledDelayMillis) === 'number'\n ? config.scheduledDelayMillis\n : env.OTEL_BSP_SCHEDULE_DELAY;\n this._exportTimeoutMillis =\n typeof (config === null || config === void 0 ? void 0 : config.exportTimeoutMillis) === 'number'\n ? config.exportTimeoutMillis\n : env.OTEL_BSP_EXPORT_TIMEOUT;\n this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this);\n }\n forceFlush() {\n if (this._shutdownOnce.isCalled) {\n return this._shutdownOnce.promise;\n }\n return this._flushAll();\n }\n // does nothing.\n onStart(_span, _parentContext) { }\n onEnd(span) {\n if (this._shutdownOnce.isCalled) {\n return;\n }\n if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) {\n return;\n }\n this._addToBuffer(span);\n }\n shutdown() {\n return this._shutdownOnce.call();\n }\n _shutdown() {\n return Promise.resolve()\n .then(() => {\n return this.onShutdown();\n })\n .then(() => {\n return this._flushAll();\n })\n .then(() => {\n return this._exporter.shutdown();\n });\n }\n /** Add a span in the buffer. */\n _addToBuffer(span) {\n if (this._finishedSpans.length >= this._maxQueueSize) {\n // limit reached, drop span\n return;\n }\n this._finishedSpans.push(span);\n this._maybeStartTimer();\n }\n /**\n * Send all spans to the exporter respecting the batch size limit\n * This function is used only on forceFlush or shutdown,\n * for all other cases _flush should be used\n * */\n _flushAll() {\n return new Promise((resolve, reject) => {\n const promises = [];\n // calculate number of batches\n const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);\n for (let i = 0, j = count; i < j; i++) {\n promises.push(this._flushOneBatch());\n }\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(reject);\n });\n }\n _flushOneBatch() {\n this._clearTimer();\n if (this._finishedSpans.length === 0) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n // don't wait anymore for export, this way the next batch can start\n reject(new Error('Timeout'));\n }, this._exportTimeoutMillis);\n // prevent downstream exporter calls from generating spans\n api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => {\n // Reset the finished spans buffer here because the next invocations of the _flush method\n // could pass the same finished spans to the exporter if the buffer is cleared\n // outside of the execution of this callback.\n this._exporter.export(this._finishedSpans.splice(0, this._maxExportBatchSize), result => {\n var _a;\n clearTimeout(timer);\n if (result.code === core_1.ExportResultCode.SUCCESS) {\n resolve();\n }\n else {\n reject((_a = result.error) !== null && _a !== void 0 ? _a : new Error('BatchSpanProcessor: span export failed'));\n }\n });\n });\n });\n }\n _maybeStartTimer() {\n if (this._timer !== undefined)\n return;\n this._timer = setTimeout(() => {\n this._flushOneBatch()\n .then(() => {\n if (this._finishedSpans.length > 0) {\n this._clearTimer();\n this._maybeStartTimer();\n }\n })\n .catch(e => {\n (0, core_1.globalErrorHandler)(e);\n });\n }, this._scheduledDelayMillis);\n (0, core_1.unrefTimer)(this._timer);\n }\n _clearTimer() {\n if (this._timer !== undefined) {\n clearTimeout(this._timer);\n this._timer = undefined;\n }\n }\n}\nexports.BatchSpanProcessorBase = BatchSpanProcessorBase;\n//# sourceMappingURL=BatchSpanProcessorBase.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConsoleSpanExporter = void 0;\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * This is implementation of {@link SpanExporter} that prints spans to the\n * console. This class can be used for diagnostic purposes.\n */\n/* eslint-disable no-console */\nclass ConsoleSpanExporter {\n /**\n * Export spans.\n * @param spans\n * @param resultCallback\n */\n export(spans, resultCallback) {\n return this._sendSpans(spans, resultCallback);\n }\n /**\n * Shutdown the exporter.\n */\n shutdown() {\n this._sendSpans([]);\n return Promise.resolve();\n }\n /**\n * converts span info into more readable format\n * @param span\n */\n _exportInfo(span) {\n return {\n traceId: span.spanContext().traceId,\n parentId: span.parentSpanId,\n name: span.name,\n id: span.spanContext().spanId,\n kind: span.kind,\n timestamp: (0, core_1.hrTimeToMicroseconds)(span.startTime),\n duration: (0, core_1.hrTimeToMicroseconds)(span.duration),\n attributes: span.attributes,\n status: span.status,\n events: span.events,\n links: span.links\n };\n }\n /**\n * Showing spans in console\n * @param spans\n * @param done\n */\n _sendSpans(spans, done) {\n for (const span of spans) {\n console.dir(this._exportInfo(span), { depth: 3 });\n }\n if (done) {\n return done({ code: core_1.ExportResultCode.SUCCESS });\n }\n }\n}\nexports.ConsoleSpanExporter = ConsoleSpanExporter;\n//# sourceMappingURL=ConsoleSpanExporter.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InMemorySpanExporter = void 0;\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * This class can be used for testing purposes. It stores the exported spans\n * in a list in memory that can be retrieved using the `getFinishedSpans()`\n * method.\n */\nclass InMemorySpanExporter {\n constructor() {\n this._finishedSpans = [];\n /**\n * Indicates if the exporter has been \"shutdown.\"\n * When false, exported spans will not be stored in-memory.\n */\n this._stopped = false;\n }\n export(spans, resultCallback) {\n if (this._stopped)\n return resultCallback({\n code: core_1.ExportResultCode.FAILED,\n error: new Error('Exporter has been stopped'),\n });\n this._finishedSpans.push(...spans);\n setTimeout(() => resultCallback({ code: core_1.ExportResultCode.SUCCESS }), 0);\n }\n shutdown() {\n this._stopped = true;\n this._finishedSpans = [];\n return Promise.resolve();\n }\n reset() {\n this._finishedSpans = [];\n }\n getFinishedSpans() {\n return this._finishedSpans;\n }\n}\nexports.InMemorySpanExporter = InMemorySpanExporter;\n//# sourceMappingURL=InMemorySpanExporter.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopSpanProcessor = void 0;\n/** No-op implementation of SpanProcessor */\nclass NoopSpanProcessor {\n onStart(_span, _context) { }\n onEnd(_span) { }\n shutdown() {\n return Promise.resolve();\n }\n forceFlush() {\n return Promise.resolve();\n }\n}\nexports.NoopSpanProcessor = NoopSpanProcessor;\n//# sourceMappingURL=NoopSpanProcessor.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=ReadableSpan.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SimpleSpanProcessor = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\n/**\n * An implementation of the {@link SpanProcessor} that converts the {@link Span}\n * to {@link ReadableSpan} and passes it to the configured exporter.\n *\n * Only spans that are sampled are converted.\n */\nclass SimpleSpanProcessor {\n constructor(_exporter) {\n this._exporter = _exporter;\n this._shutdownOnce = new core_1.BindOnceFuture(this._shutdown, this);\n }\n forceFlush() {\n // do nothing as all spans are being exported without waiting\n return Promise.resolve();\n }\n // does nothing.\n onStart(_span, _parentContext) { }\n onEnd(span) {\n if (this._shutdownOnce.isCalled) {\n return;\n }\n if ((span.spanContext().traceFlags & api_1.TraceFlags.SAMPLED) === 0) {\n return;\n }\n // prevent downstream exporter calls from generating spans\n api_1.context.with((0, core_1.suppressTracing)(api_1.context.active()), () => {\n this._exporter.export([span], result => {\n var _a;\n if (result.code !== core_1.ExportResultCode.SUCCESS) {\n (0, core_1.globalErrorHandler)((_a = result.error) !== null && _a !== void 0 ? _a : new Error(`SimpleSpanProcessor: span export failed (status ${result})`));\n }\n });\n });\n }\n shutdown() {\n return this._shutdownOnce.call();\n }\n _shutdown() {\n return this._exporter.shutdown();\n }\n}\nexports.SimpleSpanProcessor = SimpleSpanProcessor;\n//# sourceMappingURL=SimpleSpanProcessor.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=SpanExporter.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./Tracer\"), exports);\n__exportStar(require(\"./BasicTracerProvider\"), exports);\n__exportStar(require(\"./platform\"), exports);\n__exportStar(require(\"./export/ConsoleSpanExporter\"), exports);\n__exportStar(require(\"./export/InMemorySpanExporter\"), exports);\n__exportStar(require(\"./export/ReadableSpan\"), exports);\n__exportStar(require(\"./export/SimpleSpanProcessor\"), exports);\n__exportStar(require(\"./export/SpanExporter\"), exports);\n__exportStar(require(\"./export/NoopSpanProcessor\"), exports);\n__exportStar(require(\"./Span\"), exports);\n__exportStar(require(\"./SpanProcessor\"), exports);\n__exportStar(require(\"./TimedEvent\"), exports);\n__exportStar(require(\"./types\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BatchSpanProcessor = void 0;\nconst BatchSpanProcessorBase_1 = require(\"../../../export/BatchSpanProcessorBase\");\nclass BatchSpanProcessor extends BatchSpanProcessorBase_1.BatchSpanProcessorBase {\n onShutdown() { }\n}\nexports.BatchSpanProcessor = BatchSpanProcessor;\n//# sourceMappingURL=BatchSpanProcessor.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./export/BatchSpanProcessor\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.reconfigureLimits = exports.mergeConfig = void 0;\nconst config_1 = require(\"./config\");\n/**\n * Function to merge Default configuration (as specified in './config') with\n * user provided configurations.\n */\nfunction mergeConfig(userConfig) {\n const perInstanceDefaults = {\n sampler: (0, config_1.buildSamplerFromEnv)(),\n };\n const target = Object.assign({}, config_1.DEFAULT_CONFIG, perInstanceDefaults, userConfig);\n target.generalLimits = Object.assign({}, config_1.DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {});\n target.spanLimits = Object.assign({}, config_1.DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});\n return target;\n}\nexports.mergeConfig = mergeConfig;\n/**\n * When general limits are provided and model specific limits are not,\n * configures the model specific limits by using the values from the general ones.\n * @param userConfig User provided tracer configuration\n */\nfunction reconfigureLimits(userConfig) {\n var _a, _b;\n const spanLimits = Object.assign({}, userConfig.spanLimits);\n /**\n * When span attribute count limit is not defined, but general attribute count limit is defined\n * Then, span attribute count limit will be same as general one\n */\n if (spanLimits.attributeCountLimit == null && ((_a = userConfig.generalLimits) === null || _a === void 0 ? void 0 : _a.attributeCountLimit) != null) {\n spanLimits.attributeCountLimit = userConfig.generalLimits.attributeCountLimit;\n }\n /**\n * When span attribute value length limit is not defined, but general attribute value length limit is defined\n * Then, span attribute value length limit will be same as general one\n */\n if (spanLimits.attributeValueLengthLimit == null && ((_b = userConfig.generalLimits) === null || _b === void 0 ? void 0 : _b.attributeValueLengthLimit) != null) {\n spanLimits.attributeValueLengthLimit = userConfig.generalLimits.attributeValueLengthLimit;\n }\n return Object.assign({}, userConfig, { spanLimits });\n}\nexports.reconfigureLimits = reconfigureLimits;\n//# sourceMappingURL=utility.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./trace\"), exports);\n__exportStar(require(\"./resource\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0;\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexports.SemanticResourceAttributes = {\n /**\n * Name of the cloud provider.\n */\n CLOUD_PROVIDER: 'cloud.provider',\n /**\n * The cloud account ID the resource is assigned to.\n */\n CLOUD_ACCOUNT_ID: 'cloud.account.id',\n /**\n * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations).\n */\n CLOUD_REGION: 'cloud.region',\n /**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud.\n */\n CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone',\n /**\n * The cloud platform in use.\n *\n * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`.\n */\n CLOUD_PLATFORM: 'cloud.platform',\n /**\n * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).\n */\n AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn',\n /**\n * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).\n */\n AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn',\n /**\n * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.\n */\n AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype',\n /**\n * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).\n */\n AWS_ECS_TASK_ARN: 'aws.ecs.task.arn',\n /**\n * The task definition family this task definition is a member of.\n */\n AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family',\n /**\n * The revision for this task definition.\n */\n AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision',\n /**\n * The ARN of an EKS cluster.\n */\n AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn',\n /**\n * The name(s) of the AWS log group(s) an application is writing to.\n *\n * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.\n */\n AWS_LOG_GROUP_NAMES: 'aws.log.group.names',\n /**\n * The Amazon Resource Name(s) (ARN) of the AWS log group(s).\n *\n * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).\n */\n AWS_LOG_GROUP_ARNS: 'aws.log.group.arns',\n /**\n * The name(s) of the AWS log stream(s) an application is writing to.\n */\n AWS_LOG_STREAM_NAMES: 'aws.log.stream.names',\n /**\n * The ARN(s) of the AWS log stream(s).\n *\n * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream.\n */\n AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns',\n /**\n * Container name.\n */\n CONTAINER_NAME: 'container.name',\n /**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated.\n */\n CONTAINER_ID: 'container.id',\n /**\n * The container runtime managing this container.\n */\n CONTAINER_RUNTIME: 'container.runtime',\n /**\n * Name of the image the container was built on.\n */\n CONTAINER_IMAGE_NAME: 'container.image.name',\n /**\n * Container image tag.\n */\n CONTAINER_IMAGE_TAG: 'container.image.tag',\n /**\n * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier).\n */\n DEPLOYMENT_ENVIRONMENT: 'deployment.environment',\n /**\n * A unique identifier representing the device.\n *\n * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.\n */\n DEVICE_ID: 'device.id',\n /**\n * The model identifier for the device.\n *\n * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device.\n */\n DEVICE_MODEL_IDENTIFIER: 'device.model.identifier',\n /**\n * The marketing name for the device model.\n *\n * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.\n */\n DEVICE_MODEL_NAME: 'device.model.name',\n /**\n * The name of the single function that this runtime instance executes.\n *\n * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes).\n */\n FAAS_NAME: 'faas.name',\n /**\n * The unique ID of the single function that this runtime instance executes.\n *\n * Note: Depending on the cloud provider, use:\n \n * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).\n Take care not to use the "invoked ARN" directly but replace any\n [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple\n different aliases.\n * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)\n * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).\n \n On some providers, it may not be possible to determine the full ID at startup,\n which is why this field cannot be made required. For example, on AWS the account ID\n part of the ARN is not available without calling another AWS API\n which may be deemed too slow for a short-running lambda function.\n As an alternative, consider setting `faas.id` as a span attribute instead.\n */\n FAAS_ID: 'faas.id',\n /**\n * The immutable version of the function being executed.\n *\n * Note: Depending on the cloud provider and platform, use:\n \n * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)\n (an integer represented as a decimal string).\n * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)\n (i.e., the function name plus the revision suffix).\n * **Google Cloud Functions:** The value of the\n [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).\n * **Azure Functions:** Not applicable. Do not set this attribute.\n */\n FAAS_VERSION: 'faas.version',\n /**\n * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.\n *\n * Note: * **AWS Lambda:** Use the (full) log stream name.\n */\n FAAS_INSTANCE: 'faas.instance',\n /**\n * The amount of memory available to the serverless function in MiB.\n *\n * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information.\n */\n FAAS_MAX_MEMORY: 'faas.max_memory',\n /**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider.\n */\n HOST_ID: 'host.id',\n /**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n */\n HOST_NAME: 'host.name',\n /**\n * Type of host. For Cloud, this must be the machine type.\n */\n HOST_TYPE: 'host.type',\n /**\n * The CPU architecture the host system is running on.\n */\n HOST_ARCH: 'host.arch',\n /**\n * Name of the VM image or OS install the host was instantiated from.\n */\n HOST_IMAGE_NAME: 'host.image.name',\n /**\n * VM image ID. For Cloud, this value is from the provider.\n */\n HOST_IMAGE_ID: 'host.image.id',\n /**\n * The version string of the VM image as defined in [Version SpanAttributes](README.md#version-attributes).\n */\n HOST_IMAGE_VERSION: 'host.image.version',\n /**\n * The name of the cluster.\n */\n K8S_CLUSTER_NAME: 'k8s.cluster.name',\n /**\n * The name of the Node.\n */\n K8S_NODE_NAME: 'k8s.node.name',\n /**\n * The UID of the Node.\n */\n K8S_NODE_UID: 'k8s.node.uid',\n /**\n * The name of the namespace that the pod is running in.\n */\n K8S_NAMESPACE_NAME: 'k8s.namespace.name',\n /**\n * The UID of the Pod.\n */\n K8S_POD_UID: 'k8s.pod.uid',\n /**\n * The name of the Pod.\n */\n K8S_POD_NAME: 'k8s.pod.name',\n /**\n * The name of the Container in a Pod template.\n */\n K8S_CONTAINER_NAME: 'k8s.container.name',\n /**\n * The UID of the ReplicaSet.\n */\n K8S_REPLICASET_UID: 'k8s.replicaset.uid',\n /**\n * The name of the ReplicaSet.\n */\n K8S_REPLICASET_NAME: 'k8s.replicaset.name',\n /**\n * The UID of the Deployment.\n */\n K8S_DEPLOYMENT_UID: 'k8s.deployment.uid',\n /**\n * The name of the Deployment.\n */\n K8S_DEPLOYMENT_NAME: 'k8s.deployment.name',\n /**\n * The UID of the StatefulSet.\n */\n K8S_STATEFULSET_UID: 'k8s.statefulset.uid',\n /**\n * The name of the StatefulSet.\n */\n K8S_STATEFULSET_NAME: 'k8s.statefulset.name',\n /**\n * The UID of the DaemonSet.\n */\n K8S_DAEMONSET_UID: 'k8s.daemonset.uid',\n /**\n * The name of the DaemonSet.\n */\n K8S_DAEMONSET_NAME: 'k8s.daemonset.name',\n /**\n * The UID of the Job.\n */\n K8S_JOB_UID: 'k8s.job.uid',\n /**\n * The name of the Job.\n */\n K8S_JOB_NAME: 'k8s.job.name',\n /**\n * The UID of the CronJob.\n */\n K8S_CRONJOB_UID: 'k8s.cronjob.uid',\n /**\n * The name of the CronJob.\n */\n K8S_CRONJOB_NAME: 'k8s.cronjob.name',\n /**\n * The operating system type.\n */\n OS_TYPE: 'os.type',\n /**\n * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands.\n */\n OS_DESCRIPTION: 'os.description',\n /**\n * Human readable operating system name.\n */\n OS_NAME: 'os.name',\n /**\n * The version string of the operating system as defined in [Version SpanAttributes](../../resource/semantic_conventions/README.md#version-attributes).\n */\n OS_VERSION: 'os.version',\n /**\n * Process identifier (PID).\n */\n PROCESS_PID: 'process.pid',\n /**\n * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_NAME: 'process.executable.name',\n /**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_PATH: 'process.executable.path',\n /**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n */\n PROCESS_COMMAND: 'process.command',\n /**\n * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead.\n */\n PROCESS_COMMAND_LINE: 'process.command_line',\n /**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n */\n PROCESS_COMMAND_ARGS: 'process.command_args',\n /**\n * The username of the user that owns the process.\n */\n PROCESS_OWNER: 'process.owner',\n /**\n * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler.\n */\n PROCESS_RUNTIME_NAME: 'process.runtime.name',\n /**\n * The version of the runtime of this process, as returned by the runtime without modification.\n */\n PROCESS_RUNTIME_VERSION: 'process.runtime.version',\n /**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n */\n PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description',\n /**\n * Logical name of the service.\n *\n * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.\n */\n SERVICE_NAME: 'service.name',\n /**\n * A namespace for `service.name`.\n *\n * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\n SERVICE_NAMESPACE: 'service.namespace',\n /**\n * The string ID of the service instance.\n *\n * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations).\n */\n SERVICE_INSTANCE_ID: 'service.instance.id',\n /**\n * The version string of the service API or implementation.\n */\n SERVICE_VERSION: 'service.version',\n /**\n * The name of the telemetry SDK as defined above.\n */\n TELEMETRY_SDK_NAME: 'telemetry.sdk.name',\n /**\n * The language of the telemetry SDK.\n */\n TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language',\n /**\n * The version string of the telemetry SDK.\n */\n TELEMETRY_SDK_VERSION: 'telemetry.sdk.version',\n /**\n * The version string of the auto instrumentation agent, if used.\n */\n TELEMETRY_AUTO_VERSION: 'telemetry.auto.version',\n /**\n * The name of the web engine.\n */\n WEBENGINE_NAME: 'webengine.name',\n /**\n * The version of the web engine.\n */\n WEBENGINE_VERSION: 'webengine.version',\n /**\n * Additional description of the web engine (e.g. detailed version and edition information).\n */\n WEBENGINE_DESCRIPTION: 'webengine.description',\n};\nexports.CloudProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexports.CloudPlatformValues = {\n /** Alibaba Cloud Elastic Compute Service. */\n ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs',\n /** Alibaba Cloud Function Compute. */\n ALIBABA_CLOUD_FC: 'alibaba_cloud_fc',\n /** AWS Elastic Compute Cloud. */\n AWS_EC2: 'aws_ec2',\n /** AWS Elastic Container Service. */\n AWS_ECS: 'aws_ecs',\n /** AWS Elastic Kubernetes Service. */\n AWS_EKS: 'aws_eks',\n /** AWS Lambda. */\n AWS_LAMBDA: 'aws_lambda',\n /** AWS Elastic Beanstalk. */\n AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk',\n /** Azure Virtual Machines. */\n AZURE_VM: 'azure_vm',\n /** Azure Container Instances. */\n AZURE_CONTAINER_INSTANCES: 'azure_container_instances',\n /** Azure Kubernetes Service. */\n AZURE_AKS: 'azure_aks',\n /** Azure Functions. */\n AZURE_FUNCTIONS: 'azure_functions',\n /** Azure App Service. */\n AZURE_APP_SERVICE: 'azure_app_service',\n /** Google Cloud Compute Engine (GCE). */\n GCP_COMPUTE_ENGINE: 'gcp_compute_engine',\n /** Google Cloud Run. */\n GCP_CLOUD_RUN: 'gcp_cloud_run',\n /** Google Cloud Kubernetes Engine (GKE). */\n GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine',\n /** Google Cloud Functions (GCF). */\n GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions',\n /** Google Cloud App Engine (GAE). */\n GCP_APP_ENGINE: 'gcp_app_engine',\n};\nexports.AwsEcsLaunchtypeValues = {\n /** ec2. */\n EC2: 'ec2',\n /** fargate. */\n FARGATE: 'fargate',\n};\nexports.HostArchValues = {\n /** AMD64. */\n AMD64: 'amd64',\n /** ARM32. */\n ARM32: 'arm32',\n /** ARM64. */\n ARM64: 'arm64',\n /** Itanium. */\n IA64: 'ia64',\n /** 32-bit PowerPC. */\n PPC32: 'ppc32',\n /** 64-bit PowerPC. */\n PPC64: 'ppc64',\n /** 32-bit x86. */\n X86: 'x86',\n};\nexports.OsTypeValues = {\n /** Microsoft Windows. */\n WINDOWS: 'windows',\n /** Linux. */\n LINUX: 'linux',\n /** Apple Darwin. */\n DARWIN: 'darwin',\n /** FreeBSD. */\n FREEBSD: 'freebsd',\n /** NetBSD. */\n NETBSD: 'netbsd',\n /** OpenBSD. */\n OPENBSD: 'openbsd',\n /** DragonFly BSD. */\n DRAGONFLYBSD: 'dragonflybsd',\n /** HP-UX (Hewlett Packard Unix). */\n HPUX: 'hpux',\n /** AIX (Advanced Interactive eXecutive). */\n AIX: 'aix',\n /** Oracle Solaris. */\n SOLARIS: 'solaris',\n /** IBM z/OS. */\n Z_OS: 'z_os',\n};\nexports.TelemetrySdkLanguageValues = {\n /** cpp. */\n CPP: 'cpp',\n /** dotnet. */\n DOTNET: 'dotnet',\n /** erlang. */\n ERLANG: 'erlang',\n /** go. */\n GO: 'go',\n /** java. */\n JAVA: 'java',\n /** nodejs. */\n NODEJS: 'nodejs',\n /** php. */\n PHP: 'php',\n /** python. */\n PYTHON: 'python',\n /** ruby. */\n RUBY: 'ruby',\n /** webjs. */\n WEBJS: 'webjs',\n};\n//# sourceMappingURL=SemanticResourceAttributes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./SemanticResourceAttributes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0;\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexports.SemanticAttributes = {\n /**\n * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).\n *\n * Note: This may be different from `faas.id` if an alias is involved.\n */\n AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn',\n /**\n * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.\n */\n DB_SYSTEM: 'db.system',\n /**\n * The connection string used to connect to the database. It is recommended to remove embedded credentials.\n */\n DB_CONNECTION_STRING: 'db.connection_string',\n /**\n * Username for accessing the database.\n */\n DB_USER: 'db.user',\n /**\n * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n */\n DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname',\n /**\n * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n *\n * Note: In some SQL databases, the database name to be used is called "schema name".\n */\n DB_NAME: 'db.name',\n /**\n * The database statement being executed.\n *\n * Note: The value may be sanitized to exclude sensitive information.\n */\n DB_STATEMENT: 'db.statement',\n /**\n * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n *\n * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n */\n DB_OPERATION: 'db.operation',\n /**\n * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n *\n * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard).\n */\n DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name',\n /**\n * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace',\n /**\n * The fetch size used for paging, i.e. how many rows will be returned at once.\n */\n DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size',\n /**\n * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n */\n DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_CASSANDRA_TABLE: 'db.cassandra.table',\n /**\n * Whether or not the query is idempotent.\n */\n DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence',\n /**\n * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n */\n DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count',\n /**\n * The ID of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id',\n /**\n * The data center of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc',\n /**\n * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_HBASE_NAMESPACE: 'db.hbase.namespace',\n /**\n * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n */\n DB_REDIS_DATABASE_INDEX: 'db.redis.database_index',\n /**\n * The collection being accessed within the database stated in `db.name`.\n */\n DB_MONGODB_COLLECTION: 'db.mongodb.collection',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_SQL_TABLE: 'db.sql.table',\n /**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n */\n EXCEPTION_TYPE: 'exception.type',\n /**\n * The exception message.\n */\n EXCEPTION_MESSAGE: 'exception.message',\n /**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n */\n EXCEPTION_STACKTRACE: 'exception.stacktrace',\n /**\n * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.\n *\n * Note: An exception is considered to have escaped (or left) the scope of a span,\n if that span is ended while the exception is still logically "in flight".\n This may be actually "in flight" in some languages (e.g. if the exception\n is passed to a Context manager's `__exit__` method in Python) but will\n usually be caught at the point of recording the exception in most languages.\n \n It is usually not possible to determine at the point where an exception is thrown\n whether it will escape the scope of a span.\n However, it is trivial to know that an exception\n will escape, if one checks for an active exception just before ending the span,\n as done in the [example above](#exception-end-example).\n \n It follows that an exception may still escape the scope of the span\n even if the `exception.escaped` attribute was not set or set to false,\n since the event might have been recorded at a time where it was not\n clear whether the exception will escape.\n */\n EXCEPTION_ESCAPED: 'exception.escaped',\n /**\n * Type of the trigger on which the function is executed.\n */\n FAAS_TRIGGER: 'faas.trigger',\n /**\n * The execution ID of the current function execution.\n */\n FAAS_EXECUTION: 'faas.execution',\n /**\n * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.\n */\n FAAS_DOCUMENT_COLLECTION: 'faas.document.collection',\n /**\n * Describes the type of the operation that was performed on the data.\n */\n FAAS_DOCUMENT_OPERATION: 'faas.document.operation',\n /**\n * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_DOCUMENT_TIME: 'faas.document.time',\n /**\n * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.\n */\n FAAS_DOCUMENT_NAME: 'faas.document.name',\n /**\n * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_TIME: 'faas.time',\n /**\n * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).\n */\n FAAS_CRON: 'faas.cron',\n /**\n * A boolean that is true if the serverless function is executed for the first time (aka cold-start).\n */\n FAAS_COLDSTART: 'faas.coldstart',\n /**\n * The name of the invoked function.\n *\n * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function.\n */\n FAAS_INVOKED_NAME: 'faas.invoked_name',\n /**\n * The cloud provider of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.\n */\n FAAS_INVOKED_PROVIDER: 'faas.invoked_provider',\n /**\n * The cloud region of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function.\n */\n FAAS_INVOKED_REGION: 'faas.invoked_region',\n /**\n * Transport protocol used. See note below.\n */\n NET_TRANSPORT: 'net.transport',\n /**\n * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6).\n */\n NET_PEER_IP: 'net.peer.ip',\n /**\n * Remote port number.\n */\n NET_PEER_PORT: 'net.peer.port',\n /**\n * Remote hostname or similar, see note below.\n */\n NET_PEER_NAME: 'net.peer.name',\n /**\n * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.\n */\n NET_HOST_IP: 'net.host.ip',\n /**\n * Like `net.peer.port` but for the host port.\n */\n NET_HOST_PORT: 'net.host.port',\n /**\n * Local hostname or similar, see note below.\n */\n NET_HOST_NAME: 'net.host.name',\n /**\n * The internet connection type currently being used by the host.\n */\n NET_HOST_CONNECTION_TYPE: 'net.host.connection.type',\n /**\n * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.\n */\n NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype',\n /**\n * The name of the mobile carrier.\n */\n NET_HOST_CARRIER_NAME: 'net.host.carrier.name',\n /**\n * The mobile carrier country code.\n */\n NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc',\n /**\n * The mobile carrier network code.\n */\n NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc',\n /**\n * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.\n */\n NET_HOST_CARRIER_ICC: 'net.host.carrier.icc',\n /**\n * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any.\n */\n PEER_SERVICE: 'peer.service',\n /**\n * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system.\n */\n ENDUSER_ID: 'enduser.id',\n /**\n * Actual/assumed role the client is making the request under extracted from token or application security context.\n */\n ENDUSER_ROLE: 'enduser.role',\n /**\n * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).\n */\n ENDUSER_SCOPE: 'enduser.scope',\n /**\n * Current "managed" thread ID (as opposed to OS thread ID).\n */\n THREAD_ID: 'thread.id',\n /**\n * Current thread name.\n */\n THREAD_NAME: 'thread.name',\n /**\n * The method or function name, or equivalent (usually rightmost part of the code unit's name).\n */\n CODE_FUNCTION: 'code.function',\n /**\n * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.\n */\n CODE_NAMESPACE: 'code.namespace',\n /**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).\n */\n CODE_FILEPATH: 'code.filepath',\n /**\n * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.\n */\n CODE_LINENO: 'code.lineno',\n /**\n * HTTP request method.\n */\n HTTP_METHOD: 'http.method',\n /**\n * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.\n *\n * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`.\n */\n HTTP_URL: 'http.url',\n /**\n * The full request target as passed in a HTTP request line or equivalent.\n */\n HTTP_TARGET: 'http.target',\n /**\n * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.\n *\n * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.\n */\n HTTP_HOST: 'http.host',\n /**\n * The URI scheme identifying the used protocol.\n */\n HTTP_SCHEME: 'http.scheme',\n /**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n */\n HTTP_STATUS_CODE: 'http.status_code',\n /**\n * Kind of HTTP protocol used.\n *\n * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.\n */\n HTTP_FLAVOR: 'http.flavor',\n /**\n * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.\n */\n HTTP_USER_AGENT: 'http.user_agent',\n /**\n * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length',\n /**\n * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed',\n /**\n * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length',\n /**\n * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed',\n /**\n * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead).\n *\n * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available.\n */\n HTTP_SERVER_NAME: 'http.server_name',\n /**\n * The matched route (path template).\n */\n HTTP_ROUTE: 'http.route',\n /**\n * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).\n *\n * Note: This is not necessarily the same as `net.peer.ip`, which would\n identify the network-level peer, which may be a proxy.\n \n This attribute should be set when a source of information different\n from the one used for `net.peer.ip`, is available even if that other\n source just confirms the same value as `net.peer.ip`.\n Rationale: For `net.peer.ip`, one typically does not know if it\n comes from a proxy, reverse proxy, or the actual client. Setting\n `http.client_ip` when it's the same as `net.peer.ip` means that\n one is at least somewhat confident that the address is not that of\n the closest proxy.\n */\n HTTP_CLIENT_IP: 'http.client_ip',\n /**\n * The keys in the `RequestItems` object field.\n */\n AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names',\n /**\n * The JSON-serialized value of each item in the `ConsumedCapacity` response field.\n */\n AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity',\n /**\n * The JSON-serialized value of the `ItemCollectionMetrics` response field.\n */\n AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics',\n /**\n * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity',\n /**\n * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity',\n /**\n * The value of the `ConsistentRead` request parameter.\n */\n AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read',\n /**\n * The value of the `ProjectionExpression` request parameter.\n */\n AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection',\n /**\n * The value of the `Limit` request parameter.\n */\n AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit',\n /**\n * The value of the `AttributesToGet` request parameter.\n */\n AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get',\n /**\n * The value of the `IndexName` request parameter.\n */\n AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name',\n /**\n * The value of the `Select` request parameter.\n */\n AWS_DYNAMODB_SELECT: 'aws.dynamodb.select',\n /**\n * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes',\n /**\n * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes',\n /**\n * The value of the `ExclusiveStartTableName` request parameter.\n */\n AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table',\n /**\n * The the number of items in the `TableNames` response parameter.\n */\n AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count',\n /**\n * The value of the `ScanIndexForward` request parameter.\n */\n AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward',\n /**\n * The value of the `Segment` request parameter.\n */\n AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment',\n /**\n * The value of the `TotalSegments` request parameter.\n */\n AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments',\n /**\n * The value of the `Count` response parameter.\n */\n AWS_DYNAMODB_COUNT: 'aws.dynamodb.count',\n /**\n * The value of the `ScannedCount` response parameter.\n */\n AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count',\n /**\n * The JSON-serialized value of each item in the `AttributeDefinitions` request field.\n */\n AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions',\n /**\n * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates',\n /**\n * A string identifying the messaging system.\n */\n MESSAGING_SYSTEM: 'messaging.system',\n /**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n */\n MESSAGING_DESTINATION: 'messaging.destination',\n /**\n * The kind of message destination.\n */\n MESSAGING_DESTINATION_KIND: 'messaging.destination_kind',\n /**\n * A boolean that is true if the message destination is temporary.\n */\n MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination',\n /**\n * The name of the transport protocol.\n */\n MESSAGING_PROTOCOL: 'messaging.protocol',\n /**\n * The version of the transport protocol.\n */\n MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version',\n /**\n * Connection string.\n */\n MESSAGING_URL: 'messaging.url',\n /**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n */\n MESSAGING_MESSAGE_ID: 'messaging.message_id',\n /**\n * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".\n */\n MESSAGING_CONVERSATION_ID: 'messaging.conversation_id',\n /**\n * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported.\n */\n MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes',\n /**\n * The compressed size of the message payload in bytes.\n */\n MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes',\n /**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n */\n MESSAGING_OPERATION: 'messaging.operation',\n /**\n * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message.\n */\n MESSAGING_CONSUMER_ID: 'messaging.consumer_id',\n /**\n * RabbitMQ message routing key.\n */\n MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.routing_key',\n /**\n * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.\n *\n * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.\n */\n MESSAGING_KAFKA_MESSAGE_KEY: 'messaging.kafka.message_key',\n /**\n * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers.\n */\n MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group',\n /**\n * Client Id for the Consumer or Producer that is handling the message.\n */\n MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id',\n /**\n * Partition the message is sent to.\n */\n MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition',\n /**\n * A boolean that is true if the message is a tombstone.\n */\n MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone',\n /**\n * A string identifying the remoting system.\n */\n RPC_SYSTEM: 'rpc.system',\n /**\n * The full (logical) name of the service being called, including its package name, if applicable.\n *\n * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).\n */\n RPC_SERVICE: 'rpc.service',\n /**\n * The name of the (logical) method being called, must be equal to the $method part in the span name.\n *\n * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).\n */\n RPC_METHOD: 'rpc.method',\n /**\n * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.\n */\n RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code',\n /**\n * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted.\n */\n RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version',\n /**\n * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification.\n */\n RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id',\n /**\n * `error.code` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code',\n /**\n * `error.message` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message',\n /**\n * Whether this is a received or sent message.\n */\n MESSAGE_TYPE: 'message.type',\n /**\n * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.\n *\n * Note: This way we guarantee that the values will be consistent between different implementations.\n */\n MESSAGE_ID: 'message.id',\n /**\n * Compressed size of the message in bytes.\n */\n MESSAGE_COMPRESSED_SIZE: 'message.compressed_size',\n /**\n * Uncompressed size of the message in bytes.\n */\n MESSAGE_UNCOMPRESSED_SIZE: 'message.uncompressed_size',\n};\nexports.DbSystemValues = {\n /** Some other SQL database. Fallback only. See notes. */\n OTHER_SQL: 'other_sql',\n /** Microsoft SQL Server. */\n MSSQL: 'mssql',\n /** MySQL. */\n MYSQL: 'mysql',\n /** Oracle Database. */\n ORACLE: 'oracle',\n /** IBM Db2. */\n DB2: 'db2',\n /** PostgreSQL. */\n POSTGRESQL: 'postgresql',\n /** Amazon Redshift. */\n REDSHIFT: 'redshift',\n /** Apache Hive. */\n HIVE: 'hive',\n /** Cloudscape. */\n CLOUDSCAPE: 'cloudscape',\n /** HyperSQL DataBase. */\n HSQLDB: 'hsqldb',\n /** Progress Database. */\n PROGRESS: 'progress',\n /** SAP MaxDB. */\n MAXDB: 'maxdb',\n /** SAP HANA. */\n HANADB: 'hanadb',\n /** Ingres. */\n INGRES: 'ingres',\n /** FirstSQL. */\n FIRSTSQL: 'firstsql',\n /** EnterpriseDB. */\n EDB: 'edb',\n /** InterSystems Caché. */\n CACHE: 'cache',\n /** Adabas (Adaptable Database System). */\n ADABAS: 'adabas',\n /** Firebird. */\n FIREBIRD: 'firebird',\n /** Apache Derby. */\n DERBY: 'derby',\n /** FileMaker. */\n FILEMAKER: 'filemaker',\n /** Informix. */\n INFORMIX: 'informix',\n /** InstantDB. */\n INSTANTDB: 'instantdb',\n /** InterBase. */\n INTERBASE: 'interbase',\n /** MariaDB. */\n MARIADB: 'mariadb',\n /** Netezza. */\n NETEZZA: 'netezza',\n /** Pervasive PSQL. */\n PERVASIVE: 'pervasive',\n /** PointBase. */\n POINTBASE: 'pointbase',\n /** SQLite. */\n SQLITE: 'sqlite',\n /** Sybase. */\n SYBASE: 'sybase',\n /** Teradata. */\n TERADATA: 'teradata',\n /** Vertica. */\n VERTICA: 'vertica',\n /** H2. */\n H2: 'h2',\n /** ColdFusion IMQ. */\n COLDFUSION: 'coldfusion',\n /** Apache Cassandra. */\n CASSANDRA: 'cassandra',\n /** Apache HBase. */\n HBASE: 'hbase',\n /** MongoDB. */\n MONGODB: 'mongodb',\n /** Redis. */\n REDIS: 'redis',\n /** Couchbase. */\n COUCHBASE: 'couchbase',\n /** CouchDB. */\n COUCHDB: 'couchdb',\n /** Microsoft Azure Cosmos DB. */\n COSMOSDB: 'cosmosdb',\n /** Amazon DynamoDB. */\n DYNAMODB: 'dynamodb',\n /** Neo4j. */\n NEO4J: 'neo4j',\n /** Apache Geode. */\n GEODE: 'geode',\n /** Elasticsearch. */\n ELASTICSEARCH: 'elasticsearch',\n /** Memcached. */\n MEMCACHED: 'memcached',\n /** CockroachDB. */\n COCKROACHDB: 'cockroachdb',\n};\nexports.DbCassandraConsistencyLevelValues = {\n /** all. */\n ALL: 'all',\n /** each_quorum. */\n EACH_QUORUM: 'each_quorum',\n /** quorum. */\n QUORUM: 'quorum',\n /** local_quorum. */\n LOCAL_QUORUM: 'local_quorum',\n /** one. */\n ONE: 'one',\n /** two. */\n TWO: 'two',\n /** three. */\n THREE: 'three',\n /** local_one. */\n LOCAL_ONE: 'local_one',\n /** any. */\n ANY: 'any',\n /** serial. */\n SERIAL: 'serial',\n /** local_serial. */\n LOCAL_SERIAL: 'local_serial',\n};\nexports.FaasTriggerValues = {\n /** A response to some data source operation such as a database or filesystem read/write. */\n DATASOURCE: 'datasource',\n /** To provide an answer to an inbound HTTP request. */\n HTTP: 'http',\n /** A function is set to be executed when messages are sent to a messaging system. */\n PUBSUB: 'pubsub',\n /** A function is scheduled to be executed regularly. */\n TIMER: 'timer',\n /** If none of the others apply. */\n OTHER: 'other',\n};\nexports.FaasDocumentOperationValues = {\n /** When a new object is created. */\n INSERT: 'insert',\n /** When an object is modified. */\n EDIT: 'edit',\n /** When an object is deleted. */\n DELETE: 'delete',\n};\nexports.FaasInvokedProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexports.NetTransportValues = {\n /** ip_tcp. */\n IP_TCP: 'ip_tcp',\n /** ip_udp. */\n IP_UDP: 'ip_udp',\n /** Another IP-based protocol. */\n IP: 'ip',\n /** Unix Domain socket. See below. */\n UNIX: 'unix',\n /** Named or anonymous pipe. See note below. */\n PIPE: 'pipe',\n /** In-process communication. */\n INPROC: 'inproc',\n /** Something else (non IP-based). */\n OTHER: 'other',\n};\nexports.NetHostConnectionTypeValues = {\n /** wifi. */\n WIFI: 'wifi',\n /** wired. */\n WIRED: 'wired',\n /** cell. */\n CELL: 'cell',\n /** unavailable. */\n UNAVAILABLE: 'unavailable',\n /** unknown. */\n UNKNOWN: 'unknown',\n};\nexports.NetHostConnectionSubtypeValues = {\n /** GPRS. */\n GPRS: 'gprs',\n /** EDGE. */\n EDGE: 'edge',\n /** UMTS. */\n UMTS: 'umts',\n /** CDMA. */\n CDMA: 'cdma',\n /** EVDO Rel. 0. */\n EVDO_0: 'evdo_0',\n /** EVDO Rev. A. */\n EVDO_A: 'evdo_a',\n /** CDMA2000 1XRTT. */\n CDMA2000_1XRTT: 'cdma2000_1xrtt',\n /** HSDPA. */\n HSDPA: 'hsdpa',\n /** HSUPA. */\n HSUPA: 'hsupa',\n /** HSPA. */\n HSPA: 'hspa',\n /** IDEN. */\n IDEN: 'iden',\n /** EVDO Rev. B. */\n EVDO_B: 'evdo_b',\n /** LTE. */\n LTE: 'lte',\n /** EHRPD. */\n EHRPD: 'ehrpd',\n /** HSPAP. */\n HSPAP: 'hspap',\n /** GSM. */\n GSM: 'gsm',\n /** TD-SCDMA. */\n TD_SCDMA: 'td_scdma',\n /** IWLAN. */\n IWLAN: 'iwlan',\n /** 5G NR (New Radio). */\n NR: 'nr',\n /** 5G NRNSA (New Radio Non-Standalone). */\n NRNSA: 'nrnsa',\n /** LTE CA. */\n LTE_CA: 'lte_ca',\n};\nexports.HttpFlavorValues = {\n /** HTTP 1.0. */\n HTTP_1_0: '1.0',\n /** HTTP 1.1. */\n HTTP_1_1: '1.1',\n /** HTTP 2. */\n HTTP_2_0: '2.0',\n /** SPDY protocol. */\n SPDY: 'SPDY',\n /** QUIC protocol. */\n QUIC: 'QUIC',\n};\nexports.MessagingDestinationKindValues = {\n /** A message sent to a queue. */\n QUEUE: 'queue',\n /** A message sent to a topic. */\n TOPIC: 'topic',\n};\nexports.MessagingOperationValues = {\n /** receive. */\n RECEIVE: 'receive',\n /** process. */\n PROCESS: 'process',\n};\nexports.RpcGrpcStatusCodeValues = {\n /** OK. */\n OK: 0,\n /** CANCELLED. */\n CANCELLED: 1,\n /** UNKNOWN. */\n UNKNOWN: 2,\n /** INVALID_ARGUMENT. */\n INVALID_ARGUMENT: 3,\n /** DEADLINE_EXCEEDED. */\n DEADLINE_EXCEEDED: 4,\n /** NOT_FOUND. */\n NOT_FOUND: 5,\n /** ALREADY_EXISTS. */\n ALREADY_EXISTS: 6,\n /** PERMISSION_DENIED. */\n PERMISSION_DENIED: 7,\n /** RESOURCE_EXHAUSTED. */\n RESOURCE_EXHAUSTED: 8,\n /** FAILED_PRECONDITION. */\n FAILED_PRECONDITION: 9,\n /** ABORTED. */\n ABORTED: 10,\n /** OUT_OF_RANGE. */\n OUT_OF_RANGE: 11,\n /** UNIMPLEMENTED. */\n UNIMPLEMENTED: 12,\n /** INTERNAL. */\n INTERNAL: 13,\n /** UNAVAILABLE. */\n UNAVAILABLE: 14,\n /** DATA_LOSS. */\n DATA_LOSS: 15,\n /** UNAUTHENTICATED. */\n UNAUTHENTICATED: 16,\n};\nexports.MessageTypeValues = {\n /** sent. */\n SENT: 'SENT',\n /** received. */\n RECEIVED: 'RECEIVED',\n};\n//# sourceMappingURL=SemanticAttributes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./SemanticAttributes\"), exports);\n//# sourceMappingURL=index.js.map","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","var register = require('./lib/register')\nvar addHook = require('./lib/add')\nvar removeHook = require('./lib/remove')\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind\nvar bindable = bind.bind(bind)\n\nfunction bindApi (hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])\n hook.api = { remove: removeHookRef }\n hook.remove = removeHookRef\n\n ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind]\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)\n })\n}\n\nfunction HookSingular () {\n var singularHookName = 'h'\n var singularHookState = {\n registry: {}\n }\n var singularHook = register.bind(null, singularHookState, singularHookName)\n bindApi(singularHook, singularHookState, singularHookName)\n return singularHook\n}\n\nfunction HookCollection () {\n var state = {\n registry: {}\n }\n\n var hook = register.bind(null, state)\n bindApi(hook, state)\n\n return hook\n}\n\nvar collectionHookDeprecationMessageDisplayed = false\nfunction Hook () {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn('[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4')\n collectionHookDeprecationMessageDisplayed = true\n }\n return HookCollection()\n}\n\nHook.Singular = HookSingular.bind()\nHook.Collection = HookCollection.bind()\n\nmodule.exports = Hook\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook\nmodule.exports.Singular = Hook.Singular\nmodule.exports.Collection = Hook.Collection\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\n","module.exports = realpath\nrealpath.realpath = realpath\nrealpath.sync = realpathSync\nrealpath.realpathSync = realpathSync\nrealpath.monkeypatch = monkeypatch\nrealpath.unmonkeypatch = unmonkeypatch\n\nvar fs = require('fs')\nvar origRealpath = fs.realpath\nvar origRealpathSync = fs.realpathSync\n\nvar version = process.version\nvar ok = /^v[0-5]\\./.test(version)\nvar old = require('./old.js')\n\nfunction newError (er) {\n return er && er.syscall === 'realpath' && (\n er.code === 'ELOOP' ||\n er.code === 'ENOMEM' ||\n er.code === 'ENAMETOOLONG'\n )\n}\n\nfunction realpath (p, cache, cb) {\n if (ok) {\n return origRealpath(p, cache, cb)\n }\n\n if (typeof cache === 'function') {\n cb = cache\n cache = null\n }\n origRealpath(p, cache, function (er, result) {\n if (newError(er)) {\n old.realpath(p, cache, cb)\n } else {\n cb(er, result)\n }\n })\n}\n\nfunction realpathSync (p, cache) {\n if (ok) {\n return origRealpathSync(p, cache)\n }\n\n try {\n return origRealpathSync(p, cache)\n } catch (er) {\n if (newError(er)) {\n return old.realpathSync(p, cache)\n } else {\n throw er\n }\n }\n}\n\nfunction monkeypatch () {\n fs.realpath = realpath\n fs.realpathSync = realpathSync\n}\n\nfunction unmonkeypatch () {\n fs.realpath = origRealpath\n fs.realpathSync = origRealpathSync\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar pathModule = require('path');\nvar isWindows = process.platform === 'win32';\nvar fs = require('fs');\n\n// JavaScript implementation of realpath, ported from node pre-v6\n\nvar DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);\n\nfunction rethrow() {\n // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and\n // is fairly slow to generate.\n var callback;\n if (DEBUG) {\n var backtrace = new Error;\n callback = debugCallback;\n } else\n callback = missingCallback;\n\n return callback;\n\n function debugCallback(err) {\n if (err) {\n backtrace.message = err.message;\n err = backtrace;\n missingCallback(err);\n }\n }\n\n function missingCallback(err) {\n if (err) {\n if (process.throwDeprecation)\n throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs\n else if (!process.noDeprecation) {\n var msg = 'fs: missing callback ' + (err.stack || err.message);\n if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n }\n }\n }\n}\n\nfunction maybeCallback(cb) {\n return typeof cb === 'function' ? cb : rethrow();\n}\n\nvar normalize = pathModule.normalize;\n\n// Regexp that finds the next partion of a (partial) path\n// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']\nif (isWindows) {\n var nextPartRe = /(.*?)(?:[\\/\\\\]+|$)/g;\n} else {\n var nextPartRe = /(.*?)(?:[\\/]+|$)/g;\n}\n\n// Regex to find the device root, including trailing slash. E.g. 'c:\\\\'.\nif (isWindows) {\n var splitRootRe = /^(?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/][^\\\\\\/]+)?[\\\\\\/]*/;\n} else {\n var splitRootRe = /^[\\/]*/;\n}\n\nexports.realpathSync = function realpathSync(p, cache) {\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return cache[p];\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstatSync(base);\n knownHard[base] = true;\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n // NB: p.length changes.\n while (pos < p.length) {\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n continue;\n }\n\n var resolvedLink;\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // some known symbolic link. no need to stat again.\n resolvedLink = cache[base];\n } else {\n var stat = fs.lstatSync(base);\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n continue;\n }\n\n // read the link if it wasn't read before\n // dev/ino always return 0 on windows, so skip the check.\n var linkTarget = null;\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n linkTarget = seenLinks[id];\n }\n }\n if (linkTarget === null) {\n fs.statSync(base);\n linkTarget = fs.readlinkSync(base);\n }\n resolvedLink = pathModule.resolve(previous, linkTarget);\n // track this, if given a cache.\n if (cache) cache[base] = resolvedLink;\n if (!isWindows) seenLinks[id] = linkTarget;\n }\n\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n\n if (cache) cache[original] = p;\n\n return p;\n};\n\n\nexports.realpath = function realpath(p, cache, cb) {\n if (typeof cb !== 'function') {\n cb = maybeCallback(cache);\n cache = null;\n }\n\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return process.nextTick(cb.bind(null, null, cache[p]));\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstat(base, function(err) {\n if (err) return cb(err);\n knownHard[base] = true;\n LOOP();\n });\n } else {\n process.nextTick(LOOP);\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs.lstat(base, gotStat);\n }\n\n function gotStat(err, stat) {\n if (err) return cb(err);\n\n // if not a symlink, skip to the next path part\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n return process.nextTick(LOOP);\n }\n\n // stat & read the link if not read before\n // call gotTarget as soon as the link target is known\n // dev/ino always return 0 on windows, so skip the check.\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n return gotTarget(null, seenLinks[id], base);\n }\n }\n fs.stat(base, function(err) {\n if (err) return cb(err);\n\n fs.readlink(base, function(err, target) {\n if (!isWindows) seenLinks[id] = target;\n gotTarget(err, target);\n });\n });\n }\n\n function gotTarget(err, target, base) {\n if (err) return cb(err);\n\n var resolvedLink = pathModule.resolve(previous, target);\n if (cache) cache[base] = resolvedLink;\n gotResolvedLink(resolvedLink);\n }\n\n function gotResolvedLink(resolvedLink) {\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n};\n","exports.setopts = setopts\nexports.ownProp = ownProp\nexports.makeAbs = makeAbs\nexports.finish = finish\nexports.mark = mark\nexports.isIgnored = isIgnored\nexports.childrenIgnored = childrenIgnored\n\nfunction ownProp (obj, field) {\n return Object.prototype.hasOwnProperty.call(obj, field)\n}\n\nvar fs = require(\"fs\")\nvar path = require(\"path\")\nvar minimatch = require(\"minimatch\")\nvar isAbsolute = require(\"path-is-absolute\")\nvar Minimatch = minimatch.Minimatch\n\nfunction alphasort (a, b) {\n return a.localeCompare(b, 'en')\n}\n\nfunction setupIgnores (self, options) {\n self.ignore = options.ignore || []\n\n if (!Array.isArray(self.ignore))\n self.ignore = [self.ignore]\n\n if (self.ignore.length) {\n self.ignore = self.ignore.map(ignoreMap)\n }\n}\n\n// ignore patterns are always in dot:true mode.\nfunction ignoreMap (pattern) {\n var gmatcher = null\n if (pattern.slice(-3) === '/**') {\n var gpattern = pattern.replace(/(\\/\\*\\*)+$/, '')\n gmatcher = new Minimatch(gpattern, { dot: true })\n }\n\n return {\n matcher: new Minimatch(pattern, { dot: true }),\n gmatcher: gmatcher\n }\n}\n\nfunction setopts (self, pattern, options) {\n if (!options)\n options = {}\n\n // base-matching: just use globstar for that.\n if (options.matchBase && -1 === pattern.indexOf(\"/\")) {\n if (options.noglobstar) {\n throw new Error(\"base matching requires globstar\")\n }\n pattern = \"**/\" + pattern\n }\n\n self.silent = !!options.silent\n self.pattern = pattern\n self.strict = options.strict !== false\n self.realpath = !!options.realpath\n self.realpathCache = options.realpathCache || Object.create(null)\n self.follow = !!options.follow\n self.dot = !!options.dot\n self.mark = !!options.mark\n self.nodir = !!options.nodir\n if (self.nodir)\n self.mark = true\n self.sync = !!options.sync\n self.nounique = !!options.nounique\n self.nonull = !!options.nonull\n self.nosort = !!options.nosort\n self.nocase = !!options.nocase\n self.stat = !!options.stat\n self.noprocess = !!options.noprocess\n self.absolute = !!options.absolute\n self.fs = options.fs || fs\n\n self.maxLength = options.maxLength || Infinity\n self.cache = options.cache || Object.create(null)\n self.statCache = options.statCache || Object.create(null)\n self.symlinks = options.symlinks || Object.create(null)\n\n setupIgnores(self, options)\n\n self.changedCwd = false\n var cwd = process.cwd()\n if (!ownProp(options, \"cwd\"))\n self.cwd = cwd\n else {\n self.cwd = path.resolve(options.cwd)\n self.changedCwd = self.cwd !== cwd\n }\n\n self.root = options.root || path.resolve(self.cwd, \"/\")\n self.root = path.resolve(self.root)\n if (process.platform === \"win32\")\n self.root = self.root.replace(/\\\\/g, \"/\")\n\n // TODO: is an absolute `cwd` supposed to be resolved against `root`?\n // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')\n self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)\n if (process.platform === \"win32\")\n self.cwdAbs = self.cwdAbs.replace(/\\\\/g, \"/\")\n self.nomount = !!options.nomount\n\n // disable comments and negation in Minimatch.\n // Note that they are not supported in Glob itself anyway.\n options.nonegate = true\n options.nocomment = true\n\n self.minimatch = new Minimatch(pattern, options)\n self.options = self.minimatch.options\n}\n\nfunction finish (self) {\n var nou = self.nounique\n var all = nou ? [] : Object.create(null)\n\n for (var i = 0, l = self.matches.length; i < l; i ++) {\n var matches = self.matches[i]\n if (!matches || Object.keys(matches).length === 0) {\n if (self.nonull) {\n // do like the shell, and spit out the literal glob\n var literal = self.minimatch.globSet[i]\n if (nou)\n all.push(literal)\n else\n all[literal] = true\n }\n } else {\n // had matches\n var m = Object.keys(matches)\n if (nou)\n all.push.apply(all, m)\n else\n m.forEach(function (m) {\n all[m] = true\n })\n }\n }\n\n if (!nou)\n all = Object.keys(all)\n\n if (!self.nosort)\n all = all.sort(alphasort)\n\n // at *some* point we statted all of these\n if (self.mark) {\n for (var i = 0; i < all.length; i++) {\n all[i] = self._mark(all[i])\n }\n if (self.nodir) {\n all = all.filter(function (e) {\n var notDir = !(/\\/$/.test(e))\n var c = self.cache[e] || self.cache[makeAbs(self, e)]\n if (notDir && c)\n notDir = c !== 'DIR' && !Array.isArray(c)\n return notDir\n })\n }\n }\n\n if (self.ignore.length)\n all = all.filter(function(m) {\n return !isIgnored(self, m)\n })\n\n self.found = all\n}\n\nfunction mark (self, p) {\n var abs = makeAbs(self, p)\n var c = self.cache[abs]\n var m = p\n if (c) {\n var isDir = c === 'DIR' || Array.isArray(c)\n var slash = p.slice(-1) === '/'\n\n if (isDir && !slash)\n m += '/'\n else if (!isDir && slash)\n m = m.slice(0, -1)\n\n if (m !== p) {\n var mabs = makeAbs(self, m)\n self.statCache[mabs] = self.statCache[abs]\n self.cache[mabs] = self.cache[abs]\n }\n }\n\n return m\n}\n\n// lotta situps...\nfunction makeAbs (self, f) {\n var abs = f\n if (f.charAt(0) === '/') {\n abs = path.join(self.root, f)\n } else if (isAbsolute(f) || f === '') {\n abs = f\n } else if (self.changedCwd) {\n abs = path.resolve(self.cwd, f)\n } else {\n abs = path.resolve(f)\n }\n\n if (process.platform === 'win32')\n abs = abs.replace(/\\\\/g, '/')\n\n return abs\n}\n\n\n// Return true, if pattern ends with globstar '**', for the accompanying parent directory.\n// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents\nfunction isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n\nfunction childrenIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n","// Approach:\n//\n// 1. Get the minimatch set\n// 2. For each pattern in the set, PROCESS(pattern, false)\n// 3. Store matches per-set, then uniq them\n//\n// PROCESS(pattern, inGlobStar)\n// Get the first [n] items from pattern that are all strings\n// Join these together. This is PREFIX.\n// If there is no more remaining, then stat(PREFIX) and\n// add to matches if it succeeds. END.\n//\n// If inGlobStar and PREFIX is symlink and points to dir\n// set ENTRIES = []\n// else readdir(PREFIX) as ENTRIES\n// If fail, END\n//\n// with ENTRIES\n// If pattern[n] is GLOBSTAR\n// // handle the case where the globstar match is empty\n// // by pruning it out, and testing the resulting pattern\n// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)\n// // handle other cases.\n// for ENTRY in ENTRIES (not dotfiles)\n// // attach globstar + tail onto the entry\n// // Mark that this entry is a globstar match\n// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)\n//\n// else // not globstar\n// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)\n// Test ENTRY against pattern[n]\n// If fails, continue\n// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])\n//\n// Caveat:\n// Cache all stats and readdirs results to minimize syscall. Since all\n// we ever care about is existence and directory-ness, we can just keep\n// `true` for files, and [children,...] for directories, or `false` for\n// things that don't exist.\n\nmodule.exports = glob\n\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar inherits = require('inherits')\nvar EE = require('events').EventEmitter\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar globSync = require('./sync.js')\nvar common = require('./common.js')\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar inflight = require('inflight')\nvar util = require('util')\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nvar once = require('once')\n\nfunction glob (pattern, options, cb) {\n if (typeof options === 'function') cb = options, options = {}\n if (!options) options = {}\n\n if (options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return globSync(pattern, options)\n }\n\n return new Glob(pattern, options, cb)\n}\n\nglob.sync = globSync\nvar GlobSync = glob.GlobSync = globSync.GlobSync\n\n// old api surface\nglob.glob = glob\n\nfunction extend (origin, add) {\n if (add === null || typeof add !== 'object') {\n return origin\n }\n\n var keys = Object.keys(add)\n var i = keys.length\n while (i--) {\n origin[keys[i]] = add[keys[i]]\n }\n return origin\n}\n\nglob.hasMagic = function (pattern, options_) {\n var options = extend({}, options_)\n options.noprocess = true\n\n var g = new Glob(pattern, options)\n var set = g.minimatch.set\n\n if (!pattern)\n return false\n\n if (set.length > 1)\n return true\n\n for (var j = 0; j < set[0].length; j++) {\n if (typeof set[0][j] !== 'string')\n return true\n }\n\n return false\n}\n\nglob.Glob = Glob\ninherits(Glob, EE)\nfunction Glob (pattern, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n\n if (options && options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return new GlobSync(pattern, options)\n }\n\n if (!(this instanceof Glob))\n return new Glob(pattern, options, cb)\n\n setopts(this, pattern, options)\n this._didRealPath = false\n\n // process each pattern in the minimatch set\n var n = this.minimatch.set.length\n\n // The matches are stored as {: true,...} so that\n // duplicates are automagically pruned.\n // Later, we do an Object.keys() on these.\n // Keep them as a list so we can fill in when nonull is set.\n this.matches = new Array(n)\n\n if (typeof cb === 'function') {\n cb = once(cb)\n this.on('error', cb)\n this.on('end', function (matches) {\n cb(null, matches)\n })\n }\n\n var self = this\n this._processing = 0\n\n this._emitQueue = []\n this._processQueue = []\n this.paused = false\n\n if (this.noprocess)\n return this\n\n if (n === 0)\n return done()\n\n var sync = true\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false, done)\n }\n sync = false\n\n function done () {\n --self._processing\n if (self._processing <= 0) {\n if (sync) {\n process.nextTick(function () {\n self._finish()\n })\n } else {\n self._finish()\n }\n }\n }\n}\n\nGlob.prototype._finish = function () {\n assert(this instanceof Glob)\n if (this.aborted)\n return\n\n if (this.realpath && !this._didRealpath)\n return this._realpath()\n\n common.finish(this)\n this.emit('end', this.found)\n}\n\nGlob.prototype._realpath = function () {\n if (this._didRealpath)\n return\n\n this._didRealpath = true\n\n var n = this.matches.length\n if (n === 0)\n return this._finish()\n\n var self = this\n for (var i = 0; i < this.matches.length; i++)\n this._realpathSet(i, next)\n\n function next () {\n if (--n === 0)\n self._finish()\n }\n}\n\nGlob.prototype._realpathSet = function (index, cb) {\n var matchset = this.matches[index]\n if (!matchset)\n return cb()\n\n var found = Object.keys(matchset)\n var self = this\n var n = found.length\n\n if (n === 0)\n return cb()\n\n var set = this.matches[index] = Object.create(null)\n found.forEach(function (p, i) {\n // If there's a problem with the stat, then it means that\n // one or more of the links in the realpath couldn't be\n // resolved. just return the abs value in that case.\n p = self._makeAbs(p)\n rp.realpath(p, self.realpathCache, function (er, real) {\n if (!er)\n set[real] = true\n else if (er.syscall === 'stat')\n set[p] = true\n else\n self.emit('error', er) // srsly wtf right here\n\n if (--n === 0) {\n self.matches[index] = set\n cb()\n }\n })\n })\n}\n\nGlob.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlob.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n\nGlob.prototype.abort = function () {\n this.aborted = true\n this.emit('abort')\n}\n\nGlob.prototype.pause = function () {\n if (!this.paused) {\n this.paused = true\n this.emit('pause')\n }\n}\n\nGlob.prototype.resume = function () {\n if (this.paused) {\n this.emit('resume')\n this.paused = false\n if (this._emitQueue.length) {\n var eq = this._emitQueue.slice(0)\n this._emitQueue.length = 0\n for (var i = 0; i < eq.length; i ++) {\n var e = eq[i]\n this._emitMatch(e[0], e[1])\n }\n }\n if (this._processQueue.length) {\n var pq = this._processQueue.slice(0)\n this._processQueue.length = 0\n for (var i = 0; i < pq.length; i ++) {\n var p = pq[i]\n this._processing--\n this._process(p[0], p[1], p[2], p[3])\n }\n }\n }\n}\n\nGlob.prototype._process = function (pattern, index, inGlobStar, cb) {\n assert(this instanceof Glob)\n assert(typeof cb === 'function')\n\n if (this.aborted)\n return\n\n this._processing++\n if (this.paused) {\n this._processQueue.push([pattern, index, inGlobStar, cb])\n return\n }\n\n //console.error('PROCESS %d', this._processing, pattern)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // see if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index, cb)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip _processing\n if (childrenIgnored(this, read))\n return cb()\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)\n}\n\nGlob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\nGlob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return cb()\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return cb()\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return cb()\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n this._process([e].concat(remain), index, inGlobStar, cb)\n }\n cb()\n}\n\nGlob.prototype._emitMatch = function (index, e) {\n if (this.aborted)\n return\n\n if (isIgnored(this, e))\n return\n\n if (this.paused) {\n this._emitQueue.push([index, e])\n return\n }\n\n var abs = isAbsolute(e) ? e : this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute)\n e = abs\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n var st = this.statCache[abs]\n if (st)\n this.emit('stat', e, st)\n\n this.emit('match', e)\n}\n\nGlob.prototype._readdirInGlobStar = function (abs, cb) {\n if (this.aborted)\n return\n\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false, cb)\n\n var lstatkey = 'lstat\\0' + abs\n var self = this\n var lstatcb = inflight(lstatkey, lstatcb_)\n\n if (lstatcb)\n self.fs.lstat(abs, lstatcb)\n\n function lstatcb_ (er, lstat) {\n if (er && er.code === 'ENOENT')\n return cb()\n\n var isSym = lstat && lstat.isSymbolicLink()\n self.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory()) {\n self.cache[abs] = 'FILE'\n cb()\n } else\n self._readdir(abs, false, cb)\n }\n}\n\nGlob.prototype._readdir = function (abs, inGlobStar, cb) {\n if (this.aborted)\n return\n\n cb = inflight('readdir\\0'+abs+'\\0'+inGlobStar, cb)\n if (!cb)\n return\n\n //console.error('RD %j %j', +inGlobStar, abs)\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs, cb)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return cb()\n\n if (Array.isArray(c))\n return cb(null, c)\n }\n\n var self = this\n self.fs.readdir(abs, readdirCb(this, abs, cb))\n}\n\nfunction readdirCb (self, abs, cb) {\n return function (er, entries) {\n if (er)\n self._readdirError(abs, er, cb)\n else\n self._readdirEntries(abs, entries, cb)\n }\n}\n\nGlob.prototype._readdirEntries = function (abs, entries, cb) {\n if (this.aborted)\n return\n\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n return cb(null, entries)\n}\n\nGlob.prototype._readdirError = function (f, er, cb) {\n if (this.aborted)\n return\n\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n this.emit('error', error)\n this.abort()\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict) {\n this.emit('error', er)\n // If the error is handled, then we abort\n // if not, we threw out of here\n this.abort()\n }\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n\n return cb()\n}\n\nGlob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\n\nGlob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n //console.error('pgs2', prefix, remain[0], entries)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return cb()\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false, cb)\n\n var isSym = this.symlinks[abs]\n var len = entries.length\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return cb()\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true, cb)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true, cb)\n }\n\n cb()\n}\n\nGlob.prototype._processSimple = function (prefix, index, cb) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var self = this\n this._stat(prefix, function (er, exists) {\n self._processSimple2(prefix, index, er, exists, cb)\n })\n}\nGlob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {\n\n //console.error('ps2', prefix, exists)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return cb()\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n cb()\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlob.prototype._stat = function (f, cb) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return cb()\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return cb(null, c)\n\n if (needDir && c === 'FILE')\n return cb()\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (stat !== undefined) {\n if (stat === false)\n return cb(null, stat)\n else {\n var type = stat.isDirectory() ? 'DIR' : 'FILE'\n if (needDir && type === 'FILE')\n return cb()\n else\n return cb(null, type, stat)\n }\n }\n\n var self = this\n var statcb = inflight('stat\\0' + abs, lstatcb_)\n if (statcb)\n self.fs.lstat(abs, statcb)\n\n function lstatcb_ (er, lstat) {\n if (lstat && lstat.isSymbolicLink()) {\n // If it's a symlink, then treat it as the target, unless\n // the target does not exist, then treat it as a file.\n return self.fs.stat(abs, function (er, stat) {\n if (er)\n self._stat2(f, abs, null, lstat, cb)\n else\n self._stat2(f, abs, er, stat, cb)\n })\n } else {\n self._stat2(f, abs, er, lstat, cb)\n }\n }\n}\n\nGlob.prototype._stat2 = function (f, abs, er, stat, cb) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return cb()\n }\n\n var needDir = f.slice(-1) === '/'\n this.statCache[abs] = stat\n\n if (abs.slice(-1) === '/' && stat && !stat.isDirectory())\n return cb(null, false, stat)\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return cb()\n\n return cb(null, c, stat)\n}\n","module.exports = globSync\nglobSync.GlobSync = GlobSync\n\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar Glob = require('./glob.js').Glob\nvar util = require('util')\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar common = require('./common.js')\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nfunction globSync (pattern, options) {\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n return new GlobSync(pattern, options).found\n}\n\nfunction GlobSync (pattern, options) {\n if (!pattern)\n throw new Error('must provide pattern')\n\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n if (!(this instanceof GlobSync))\n return new GlobSync(pattern, options)\n\n setopts(this, pattern, options)\n\n if (this.noprocess)\n return this\n\n var n = this.minimatch.set.length\n this.matches = new Array(n)\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false)\n }\n this._finish()\n}\n\nGlobSync.prototype._finish = function () {\n assert(this instanceof GlobSync)\n if (this.realpath) {\n var self = this\n this.matches.forEach(function (matchset, index) {\n var set = self.matches[index] = Object.create(null)\n for (var p in matchset) {\n try {\n p = self._makeAbs(p)\n var real = rp.realpathSync(p, self.realpathCache)\n set[real] = true\n } catch (er) {\n if (er.syscall === 'stat')\n set[self._makeAbs(p)] = true\n else\n throw er\n }\n }\n })\n }\n common.finish(this)\n}\n\n\nGlobSync.prototype._process = function (pattern, index, inGlobStar) {\n assert(this instanceof GlobSync)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // See if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip processing\n if (childrenIgnored(this, read))\n return\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar)\n}\n\n\nGlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {\n var entries = this._readdir(abs, inGlobStar)\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix.slice(-1) !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix)\n newPattern = [prefix, e]\n else\n newPattern = [e]\n this._process(newPattern.concat(remain), index, inGlobStar)\n }\n}\n\n\nGlobSync.prototype._emitMatch = function (index, e) {\n if (isIgnored(this, e))\n return\n\n var abs = this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute) {\n e = abs\n }\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n if (this.stat)\n this._stat(e)\n}\n\n\nGlobSync.prototype._readdirInGlobStar = function (abs) {\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false)\n\n var entries\n var lstat\n var stat\n try {\n lstat = this.fs.lstatSync(abs)\n } catch (er) {\n if (er.code === 'ENOENT') {\n // lstat failed, doesn't exist\n return null\n }\n }\n\n var isSym = lstat && lstat.isSymbolicLink()\n this.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory())\n this.cache[abs] = 'FILE'\n else\n entries = this._readdir(abs, false)\n\n return entries\n}\n\nGlobSync.prototype._readdir = function (abs, inGlobStar) {\n var entries\n\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return null\n\n if (Array.isArray(c))\n return c\n }\n\n try {\n return this._readdirEntries(abs, this.fs.readdirSync(abs))\n } catch (er) {\n this._readdirError(abs, er)\n return null\n }\n}\n\nGlobSync.prototype._readdirEntries = function (abs, entries) {\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n\n // mark and cache dir-ness\n return entries\n}\n\nGlobSync.prototype._readdirError = function (f, er) {\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n throw error\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict)\n throw er\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n}\n\nGlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {\n\n var entries = this._readdir(abs, inGlobStar)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false)\n\n var len = entries.length\n var isSym = this.symlinks[abs]\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true)\n }\n}\n\nGlobSync.prototype._processSimple = function (prefix, index) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var exists = this._stat(prefix)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlobSync.prototype._stat = function (f) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return false\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return c\n\n if (needDir && c === 'FILE')\n return false\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (!stat) {\n var lstat\n try {\n lstat = this.fs.lstatSync(abs)\n } catch (er) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return false\n }\n }\n\n if (lstat && lstat.isSymbolicLink()) {\n try {\n stat = this.fs.statSync(abs)\n } catch (er) {\n stat = lstat\n }\n } else {\n stat = lstat\n }\n }\n\n this.statCache[abs] = stat\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return false\n\n return c\n}\n\nGlobSync.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlobSync.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n","var wrappy = require('wrappy')\nvar reqs = Object.create(null)\nvar once = require('once')\n\nmodule.exports = wrappy(inflight)\n\nfunction inflight (key, cb) {\n if (reqs[key]) {\n reqs[key].push(cb)\n return null\n } else {\n reqs[key] = [cb]\n return makeres(key)\n }\n}\n\nfunction makeres (key) {\n return once(function RES () {\n var cbs = reqs[key]\n var len = cbs.length\n var args = slice(arguments)\n\n // XXX It's somewhat ambiguous whether a new callback added in this\n // pass should be queued for later execution if something in the\n // list of callbacks throws, or if it should just be discarded.\n // However, it's such an edge case that it hardly matters, and either\n // choice is likely as surprising as the other.\n // As it happens, we do go ahead and schedule it for later execution.\n try {\n for (var i = 0; i < len; i++) {\n cbs[i].apply(null, args)\n }\n } finally {\n if (cbs.length > len) {\n // added more in the interim.\n // de-zalgo, just in case, but don't call again.\n cbs.splice(0, len)\n process.nextTick(function () {\n RES.apply(null, args)\n })\n } else {\n delete reqs[key]\n }\n }\n })\n}\n\nfunction slice (args) {\n var length = args.length\n var array = []\n\n for (var i = 0; i < length; i++) array[i] = args[i]\n return array\n}\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parse = void 0;\nconst xml2js_1 = __importDefault(require(\"xml2js\"));\nconst parse = async (xmlString, xml2jsOptions) => {\n const options = xml2jsOptions !== null && xml2jsOptions !== void 0 ? xml2jsOptions : {\n attrValueProcessors: [xml2js_1.default.processors.parseNumbers]\n };\n const result = await xml2js_1.default.parseStringPromise(xmlString, options);\n if (result['testsuites']) {\n return _parse(result['testsuites']);\n }\n else {\n return _parse(result['testsuite']);\n }\n};\nexports.parse = parse;\nconst _parse = (objOrArray) => {\n if (Array.isArray(objOrArray)) {\n return objOrArray.map((_obj) => {\n // 中身がさらにネストされた配列 or $キーのobjectなら再起\n if (Array.isArray(_obj) || typeof (_obj) === 'object') {\n return _parse(_obj);\n }\n // 配列の中身が単なる文字列ならinnerキーを自分で付けてobjectで返す\n return { inner: _obj };\n });\n }\n let output = {};\n Object.keys(objOrArray).forEach((key) => {\n const nested = objOrArray[key];\n if (key === '$') {\n output = { ...output, ..._parse(nested) };\n }\n else if (key === 'system-out' || key === 'system-err') {\n output[key] = nested.map((inner) => inner);\n }\n else if (typeof (nested) === 'object') {\n output[key] = _parse(nested);\n }\n else if (key === '_') {\n output['inner'] = nested;\n }\n else {\n output[key] = nested;\n }\n });\n return output;\n};\n//# sourceMappingURL=index.js.map","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = { sep: '/' }\ntry {\n path = require('path')\n} catch (er) {}\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n a = a || {}\n b = b || {}\n var t = {}\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return minimatch\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig.minimatch(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n if (!def || !Object.keys(def).length) return Minimatch\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n // \"\" only matches \"\"\n if (pattern.trim() === '') return p === ''\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n if (typeof pattern !== 'string') {\n throw new TypeError('glob pattern string required')\n }\n\n if (!options) options = {}\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n // don't do it more than once.\n if (this._made) return\n\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = console.error\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n if (typeof pattern === 'undefined') {\n throw new TypeError('undefined pattern')\n }\n\n if (options.nobrace ||\n !pattern.match(/\\{.*\\}/)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n if (pattern.length > 1024 * 64) {\n throw new TypeError('pattern is too long')\n }\n\n var options = this.options\n\n // shortcuts\n if (!options.noglobstar && pattern === '**') return GLOBSTAR\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n case '/':\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n if (inClass) {\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '.':\n case '[':\n case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = match\nfunction match (f, partial) {\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n if (options.nocase) {\n hit = f.toLowerCase() === p.toLowerCase()\n } else {\n hit = f === p\n }\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')\n return emptyFileEnd\n }\n\n // should be unreachable.\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\trequest.body.destroy(error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\t\t\tfinalize();\n\t\t});\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileExporterBase = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst core_1 = require(\"@opentelemetry/core\");\nclass FileExporterBase {\n /* istanbul ignore next */\n constructor(config = {}) {\n this._isShutdown = false;\n this._shuttingDownPromise = Promise.resolve();\n this._sendingPromises = [];\n this.filePath = config.filePath;\n this.attributes = config.attributes;\n this.shutdown = this.shutdown.bind(this);\n this._concurrencyLimit =\n typeof config.concurrencyLimit === \"number\"\n ? config.concurrencyLimit\n : Infinity;\n // platform dependent\n this.onInit(config);\n }\n export(items, resultCallback) {\n if (this._isShutdown) {\n resultCallback({\n code: core_1.ExportResultCode.FAILED,\n error: new Error(\"Exporter has been shutdown\"),\n });\n return;\n }\n if (this._sendingPromises.length >= this._concurrencyLimit) {\n resultCallback({\n code: core_1.ExportResultCode.FAILED,\n error: new Error(\"Concurrent export limit reached\"),\n });\n return;\n }\n this._export(items)\n .then(() => {\n resultCallback({ code: core_1.ExportResultCode.SUCCESS });\n })\n .catch((error) => {\n resultCallback({ code: core_1.ExportResultCode.FAILED, error });\n });\n }\n _export(items) {\n return new Promise((resolve, reject) => {\n try {\n api_1.diag.debug(\"items to be sent\", items);\n this.send(items, resolve, reject);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n /**\n * Shutdown the exporter.\n */\n async shutdown() {\n if (this._isShutdown) {\n api_1.diag.debug(\"shutdown already started\");\n return this._shuttingDownPromise;\n }\n this._isShutdown = true;\n api_1.diag.debug(\"shutdown started\");\n this._shuttingDownPromise = this._shutdown();\n return await this._shuttingDownPromise;\n }\n async _shutdown() {\n await this.onShutdown();\n await Promise.all(this._sendingPromises);\n }\n}\nexports.FileExporterBase = FileExporterBase;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./FileExporterBase\"), exports);\n__exportStar(require(\"./platform\"), exports);\n__exportStar(require(\"./transform\"), exports);\n__exportStar(require(\"./types\"), exports);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./node\"), exports);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileTraceExporter = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst FileExporterBase_1 = require(\"../../FileExporterBase\");\nconst transform_1 = require(\"../../transform\");\nconst fs = __importStar(require(\"fs\"));\nclass FileTraceExporter extends FileExporterBase_1.FileExporterBase {\n constructor(config) {\n super(config);\n this._stream = this._createWriteStream();\n }\n _createWriteStream() {\n if (this._stream && !this.isShutdown()) {\n return this._stream;\n }\n return fs.createWriteStream(this.filePath, { flags: \"a\" });\n }\n async onShutdown() {\n return new Promise((resolve, reject) => {\n try {\n this._stream.end(resolve);\n }\n catch (error) {\n /* istanbul ignore next */\n reject(error);\n }\n });\n }\n isShutdown() {\n return this._isShutdown && !this._stream.writable;\n }\n onInit() {\n this._isShutdown = false;\n this._stream = this._createWriteStream();\n }\n send(objects, onSuccess, onError) {\n /* istanbul ignore if */\n if (this._isShutdown) {\n api_1.diag.debug(\"Shutdown already started. Cannot send objects\");\n return;\n }\n const serviceRequest = this.convert(objects);\n const promise = new Promise((resolve, reject) => {\n this._stream.write(JSON.stringify(serviceRequest) + \"\\n\", (err) => {\n /* istanbul ignore if */\n if (err) {\n reject(err);\n }\n else {\n resolve();\n }\n });\n }).then(onSuccess, onError);\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n convert(spans) {\n return (0, transform_1.toFileExportTraceServiceRequest)(spans, this, true);\n }\n}\nexports.FileTraceExporter = FileTraceExporter;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./FileTraceExporter\"), exports);\n__exportStar(require(\"./types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toFileExportTraceServiceRequest = void 0;\nconst exporter_trace_otlp_http_1 = require(\"@opentelemetry/exporter-trace-otlp-http\");\nconst transform_1 = require(\"@opentelemetry/exporter-trace-otlp-http/build/src/transform\");\n/**\n * Prepares trace service request to be sent to collector\n * @param spans spans\n * @param collectorExporterBase\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toFileExportTraceServiceRequest(spans, collectorTraceExporterBase, useHex) {\n const groupedSpans = (0, transform_1.groupSpansByResourceAndLibrary)(spans);\n const additionalAttributes = Object.assign({}, collectorTraceExporterBase.attributes);\n return {\n resourceSpans: toCollectorResourceSpans(groupedSpans, additionalAttributes, useHex),\n };\n}\nexports.toFileExportTraceServiceRequest = toFileExportTraceServiceRequest;\n/**\n * Convert to InstrumentationLibrarySpans\n * @param instrumentationLibrary\n * @param spans\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex) {\n return {\n spans: spans.map((span) => (0, transform_1.toCollectorSpan)(span, useHex)),\n instrumentationLibrary,\n };\n}\n/**\n * Returns a list of resource spans which will be exported to the collector\n * @param groupedSpans\n * @param baseAttributes\n * @param useHex - if ids should be kept as hex without converting to base64\n */\nfunction toCollectorResourceSpans(groupedSpans, baseAttributes, useHex) {\n return Array.from(groupedSpans, ([resource, libSpans]) => {\n return {\n resource: (0, exporter_trace_otlp_http_1.toCollectorResource)(resource, baseAttributes),\n instrumentationLibrarySpans: Array.from(libSpans, ([instrumentationLibrary, spans]) => toCollectorInstrumentationLibrarySpans(instrumentationLibrary, spans, useHex)),\n };\n });\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExportResultCode = void 0;\nvar ExportResultCode;\n(function (ExportResultCode) {\n ExportResultCode[ExportResultCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExportResultCode[ExportResultCode[\"FAILED\"] = 1] = \"FAILED\";\n})(ExportResultCode = exports.ExportResultCode || (exports.ExportResultCode = {}));\n//# sourceMappingURL=ExportResult.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0;\nexports.BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexports.BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexports.BAGGAGE_ITEMS_SEPARATOR = ',';\n// Name of the http header used to propagate the baggage\nexports.BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexports.BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n//# sourceMappingURL=constants.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.W3CBaggagePropagator = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst suppress_tracing_1 = require(\"../../trace/suppress-tracing\");\nconst constants_1 = require(\"../constants\");\nconst utils_1 = require(\"../utils\");\n/**\n * Propagates {@link Baggage} through Context format propagation.\n *\n * Based on the Baggage specification:\n * https://w3c.github.io/baggage/\n */\nclass W3CBaggagePropagator {\n inject(context, carrier, setter) {\n const baggage = api_1.propagation.getBaggage(context);\n if (!baggage || suppress_tracing_1.isTracingSuppressed(context))\n return;\n const keyPairs = utils_1.getKeyPairs(baggage)\n .filter((pair) => {\n return pair.length <= constants_1.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;\n })\n .slice(0, constants_1.BAGGAGE_MAX_NAME_VALUE_PAIRS);\n const headerValue = utils_1.serializeKeyPairs(keyPairs);\n if (headerValue.length > 0) {\n setter.set(carrier, constants_1.BAGGAGE_HEADER, headerValue);\n }\n }\n extract(context, carrier, getter) {\n const headerValue = getter.get(carrier, constants_1.BAGGAGE_HEADER);\n if (!headerValue)\n return context;\n const baggage = {};\n if (headerValue.length === 0) {\n return context;\n }\n const pairs = headerValue.split(constants_1.BAGGAGE_ITEMS_SEPARATOR);\n pairs.forEach(entry => {\n const keyPair = utils_1.parsePairKeyValue(entry);\n if (keyPair) {\n const baggageEntry = { value: keyPair.value };\n if (keyPair.metadata) {\n baggageEntry.metadata = keyPair.metadata;\n }\n baggage[keyPair.key] = baggageEntry;\n }\n });\n if (Object.entries(baggage).length === 0) {\n return context;\n }\n return api_1.propagation.setBaggage(context, api_1.propagation.createBaggage(baggage));\n }\n fields() {\n return [constants_1.BAGGAGE_HEADER];\n }\n}\nexports.W3CBaggagePropagator = W3CBaggagePropagator;\n//# sourceMappingURL=W3CBaggagePropagator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseKeyPairsIntoRecord = exports.parsePairKeyValue = exports.getKeyPairs = exports.serializeKeyPairs = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst api_1 = require(\"@opentelemetry/api\");\nconst constants_1 = require(\"./constants\");\nfunction serializeKeyPairs(keyPairs) {\n return keyPairs.reduce((hValue, current) => {\n const value = `${hValue}${hValue !== '' ? constants_1.BAGGAGE_ITEMS_SEPARATOR : ''}${current}`;\n return value.length > constants_1.BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;\n }, '');\n}\nexports.serializeKeyPairs = serializeKeyPairs;\nfunction getKeyPairs(baggage) {\n return baggage\n .getAllEntries()\n .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`);\n}\nexports.getKeyPairs = getKeyPairs;\nfunction parsePairKeyValue(entry) {\n const valueProps = entry.split(constants_1.BAGGAGE_PROPERTIES_SEPARATOR);\n if (valueProps.length <= 0)\n return;\n const keyPairPart = valueProps.shift();\n if (!keyPairPart)\n return;\n const keyPair = keyPairPart.split(constants_1.BAGGAGE_KEY_PAIR_SEPARATOR);\n if (keyPair.length !== 2)\n return;\n const key = decodeURIComponent(keyPair[0].trim());\n const value = decodeURIComponent(keyPair[1].trim());\n let metadata;\n if (valueProps.length > 0) {\n metadata = api_1.baggageEntryMetadataFromString(valueProps.join(constants_1.BAGGAGE_PROPERTIES_SEPARATOR));\n }\n return { key, value, metadata };\n}\nexports.parsePairKeyValue = parsePairKeyValue;\n/**\n * Parse a string serialized in the baggage HTTP Format (without metadata):\n * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md\n */\nfunction parseKeyPairsIntoRecord(value) {\n if (typeof value !== 'string' || value.length === 0)\n return {};\n return value\n .split(constants_1.BAGGAGE_ITEMS_SEPARATOR)\n .map(entry => {\n return parsePairKeyValue(entry);\n })\n .filter(keyPair => keyPair !== undefined && keyPair.value.length > 0)\n .reduce((headers, keyPair) => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n headers[keyPair.key] = keyPair.value;\n return headers;\n }, {});\n}\nexports.parseKeyPairsIntoRecord = parseKeyPairsIntoRecord;\n//# sourceMappingURL=utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isAttributeValue = exports.sanitizeAttributes = void 0;\nfunction sanitizeAttributes(attributes) {\n const out = {};\n if (attributes == null || typeof attributes !== 'object') {\n return out;\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n for (const [k, v] of Object.entries(attributes)) {\n if (isAttributeValue(v)) {\n if (Array.isArray(v)) {\n out[k] = v.slice();\n }\n else {\n out[k] = v;\n }\n }\n }\n return out;\n}\nexports.sanitizeAttributes = sanitizeAttributes;\nfunction isAttributeValue(val) {\n if (val == null) {\n return true;\n }\n if (Array.isArray(val)) {\n return isHomogeneousAttributeValueArray(val);\n }\n return isValidPrimitiveAttributeValue(val);\n}\nexports.isAttributeValue = isAttributeValue;\nfunction isHomogeneousAttributeValueArray(arr) {\n let type;\n for (const element of arr) {\n // null/undefined elements are allowed\n if (element == null)\n continue;\n if (!type) {\n if (isValidPrimitiveAttributeValue(element)) {\n type = typeof element;\n continue;\n }\n // encountered an invalid primitive\n return false;\n }\n if (typeof element === type) {\n continue;\n }\n return false;\n }\n return true;\n}\nfunction isValidPrimitiveAttributeValue(val) {\n switch (typeof val) {\n case 'number':\n return true;\n case 'boolean':\n return true;\n case 'string':\n return true;\n }\n return false;\n}\n//# sourceMappingURL=attributes.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.globalErrorHandler = exports.setGlobalErrorHandler = void 0;\nconst logging_error_handler_1 = require(\"./logging-error-handler\");\n/** The global error handler delegate */\nlet delegateHandler = logging_error_handler_1.loggingErrorHandler();\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nfunction setGlobalErrorHandler(handler) {\n delegateHandler = handler;\n}\nexports.setGlobalErrorHandler = setGlobalErrorHandler;\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nfunction globalErrorHandler(ex) {\n try {\n delegateHandler(ex);\n }\n catch (_a) { } // eslint-disable-line no-empty\n}\nexports.globalErrorHandler = globalErrorHandler;\n//# sourceMappingURL=global-error-handler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.loggingErrorHandler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nfunction loggingErrorHandler() {\n return (ex) => {\n api_1.diag.error(stringifyException(ex));\n };\n}\nexports.loggingErrorHandler = loggingErrorHandler;\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex) {\n if (typeof ex === 'string') {\n return ex;\n }\n else {\n return JSON.stringify(flattenException(ex));\n }\n}\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex) {\n const result = {};\n let current = ex;\n while (current !== null) {\n Object.getOwnPropertyNames(current).forEach(propertyName => {\n if (result[propertyName])\n return;\n const value = current[propertyName];\n if (value) {\n result[propertyName] = String(value);\n }\n });\n current = Object.getPrototypeOf(current);\n }\n return result;\n}\n//# sourceMappingURL=logging-error-handler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTimeInput = exports.isTimeInputHrTime = exports.hrTimeToMicroseconds = exports.hrTimeToMilliseconds = exports.hrTimeToNanoseconds = exports.hrTimeToTimeStamp = exports.hrTimeDuration = exports.timeInputToHrTime = exports.hrTime = void 0;\nconst platform_1 = require(\"../platform\");\nconst NANOSECOND_DIGITS = 9;\nconst SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n/**\n * Converts a number to HrTime, HrTime = [number, number].\n * The first number is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970.\n * The second number represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds.\n * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150.\n * numberToHrtime calculates the first number by converting and truncating the Epoch time in milliseconds to seconds:\n * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210.\n * numberToHrtime calculates the second number by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds:\n * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * SECOND_TO_NANOSECONDS = 150000000.\n * This is represented in HrTime format as [1609504210, 150000000].\n * @param epochMillis\n */\nfunction numberToHrtime(epochMillis) {\n const epochSeconds = epochMillis / 1000;\n // Decimals only.\n const seconds = Math.trunc(epochSeconds);\n // Round sub-nanosecond accuracy to nanosecond.\n const nanos = Number((epochSeconds - seconds).toFixed(NANOSECOND_DIGITS)) *\n SECOND_TO_NANOSECONDS;\n return [seconds, nanos];\n}\nfunction getTimeOrigin() {\n let timeOrigin = platform_1.otperformance.timeOrigin;\n if (typeof timeOrigin !== 'number') {\n const perf = platform_1.otperformance;\n timeOrigin = perf.timing && perf.timing.fetchStart;\n }\n return timeOrigin;\n}\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nfunction hrTime(performanceNow) {\n const timeOrigin = numberToHrtime(getTimeOrigin());\n const now = numberToHrtime(typeof performanceNow === 'number' ? performanceNow : platform_1.otperformance.now());\n let seconds = timeOrigin[0] + now[0];\n let nanos = timeOrigin[1] + now[1];\n // Nanoseconds\n if (nanos > SECOND_TO_NANOSECONDS) {\n nanos -= SECOND_TO_NANOSECONDS;\n seconds += 1;\n }\n return [seconds, nanos];\n}\nexports.hrTime = hrTime;\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nfunction timeInputToHrTime(time) {\n // process.hrtime\n if (isTimeInputHrTime(time)) {\n return time;\n }\n else if (typeof time === 'number') {\n // Must be a performance.now() if it's smaller than process start time.\n if (time < getTimeOrigin()) {\n return hrTime(time);\n }\n else {\n // epoch milliseconds or performance.timeOrigin\n return numberToHrtime(time);\n }\n }\n else if (time instanceof Date) {\n return numberToHrtime(time.getTime());\n }\n else {\n throw TypeError('Invalid input type');\n }\n}\nexports.timeInputToHrTime = timeInputToHrTime;\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nfunction hrTimeDuration(startTime, endTime) {\n let seconds = endTime[0] - startTime[0];\n let nanos = endTime[1] - startTime[1];\n // overflow\n if (nanos < 0) {\n seconds -= 1;\n // negate\n nanos += SECOND_TO_NANOSECONDS;\n }\n return [seconds, nanos];\n}\nexports.hrTimeDuration = hrTimeDuration;\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param time\n */\nfunction hrTimeToTimeStamp(time) {\n const precision = NANOSECOND_DIGITS;\n const tmp = `${'0'.repeat(precision)}${time[1]}Z`;\n const nanoString = tmp.substr(tmp.length - precision - 1);\n const date = new Date(time[0] * 1000).toISOString();\n return date.replace('000Z', nanoString);\n}\nexports.hrTimeToTimeStamp = hrTimeToTimeStamp;\n/**\n * Convert hrTime to nanoseconds.\n * @param time\n */\nfunction hrTimeToNanoseconds(time) {\n return time[0] * SECOND_TO_NANOSECONDS + time[1];\n}\nexports.hrTimeToNanoseconds = hrTimeToNanoseconds;\n/**\n * Convert hrTime to milliseconds.\n * @param time\n */\nfunction hrTimeToMilliseconds(time) {\n return Math.round(time[0] * 1e3 + time[1] / 1e6);\n}\nexports.hrTimeToMilliseconds = hrTimeToMilliseconds;\n/**\n * Convert hrTime to microseconds.\n * @param time\n */\nfunction hrTimeToMicroseconds(time) {\n return Math.round(time[0] * 1e6 + time[1] / 1e3);\n}\nexports.hrTimeToMicroseconds = hrTimeToMicroseconds;\n/**\n * check if time is HrTime\n * @param value\n */\nfunction isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}\nexports.isTimeInputHrTime = isTimeInputHrTime;\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nfunction isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}\nexports.isTimeInput = isTimeInput;\n//# sourceMappingURL=time.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageUtils = void 0;\n__exportStar(require(\"./baggage/propagation/W3CBaggagePropagator\"), exports);\n__exportStar(require(\"./common/attributes\"), exports);\n__exportStar(require(\"./common/global-error-handler\"), exports);\n__exportStar(require(\"./common/logging-error-handler\"), exports);\n__exportStar(require(\"./common/time\"), exports);\n__exportStar(require(\"./common/types\"), exports);\n__exportStar(require(\"./ExportResult\"), exports);\n__exportStar(require(\"./version\"), exports);\nexports.baggageUtils = require(\"./baggage/utils\");\n__exportStar(require(\"./platform\"), exports);\n__exportStar(require(\"./propagation/composite\"), exports);\n__exportStar(require(\"./trace/W3CTraceContextPropagator\"), exports);\n__exportStar(require(\"./trace/IdGenerator\"), exports);\n__exportStar(require(\"./trace/rpc-metadata\"), exports);\n__exportStar(require(\"./trace/sampler/AlwaysOffSampler\"), exports);\n__exportStar(require(\"./trace/sampler/AlwaysOnSampler\"), exports);\n__exportStar(require(\"./trace/sampler/ParentBasedSampler\"), exports);\n__exportStar(require(\"./trace/sampler/TraceIdRatioBasedSampler\"), exports);\n__exportStar(require(\"./trace/suppress-tracing\"), exports);\n__exportStar(require(\"./trace/TraceState\"), exports);\n__exportStar(require(\"./utils/environment\"), exports);\n__exportStar(require(\"./utils/merge\"), exports);\n__exportStar(require(\"./utils/sampling\"), exports);\n__exportStar(require(\"./utils/url\"), exports);\n__exportStar(require(\"./utils/wrap\"), exports);\n__exportStar(require(\"./version\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateValue = exports.validateKey = void 0;\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nfunction validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\nexports.validateKey = validateKey;\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nfunction validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\nexports.validateValue = validateValue;\n//# sourceMappingURL=validators.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RandomIdGenerator = void 0;\nconst SPAN_ID_BYTES = 8;\nconst TRACE_ID_BYTES = 16;\nclass RandomIdGenerator {\n constructor() {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n this.generateTraceId = getIdGenerator(TRACE_ID_BYTES);\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n this.generateSpanId = getIdGenerator(SPAN_ID_BYTES);\n }\n}\nexports.RandomIdGenerator = RandomIdGenerator;\nconst SHARED_BUFFER = Buffer.allocUnsafe(TRACE_ID_BYTES);\nfunction getIdGenerator(bytes) {\n return function generateId() {\n for (let i = 0; i < bytes / 4; i++) {\n // unsigned right shift drops decimal part of the number\n // it is required because if a number between 2**32 and 2**32 - 1 is generated, an out of range error is thrown by writeUInt32BE\n SHARED_BUFFER.writeUInt32BE((Math.random() * 2 ** 32) >>> 0, i * 4);\n }\n // If buffer is all 0, set the last byte to 1 to guarantee a valid w3c id is generated\n for (let i = 0; i < bytes; i++) {\n if (SHARED_BUFFER[i] > 0) {\n break;\n }\n else if (i === bytes - 1) {\n SHARED_BUFFER[bytes - 1] = 1;\n }\n }\n return SHARED_BUFFER.toString('hex', 0, bytes);\n };\n}\n//# sourceMappingURL=RandomIdGenerator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getEnv = void 0;\nconst os = require(\"os\");\nconst environment_1 = require(\"../../utils/environment\");\n/**\n * Gets the environment variables\n */\nfunction getEnv() {\n const processEnv = environment_1.parseEnvironment(process.env);\n return Object.assign({\n HOSTNAME: os.hostname(),\n }, environment_1.DEFAULT_ENVIRONMENT, processEnv);\n}\nexports.getEnv = getEnv;\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._globalThis = void 0;\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexports._globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hexToBase64 = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction hexToBase64(hexStr) {\n const hexStrLen = hexStr.length;\n let hexAsciiCharsStr = '';\n for (let i = 0; i < hexStrLen; i += 2) {\n const hexPair = hexStr.substring(i, i + 2);\n const hexVal = parseInt(hexPair, 16);\n hexAsciiCharsStr += String.fromCharCode(hexVal);\n }\n return Buffer.from(hexAsciiCharsStr, 'ascii').toString('base64');\n}\nexports.hexToBase64 = hexToBase64;\n//# sourceMappingURL=hex-to-base64.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./environment\"), exports);\n__exportStar(require(\"./globalThis\"), exports);\n__exportStar(require(\"./hex-to-base64\"), exports);\n__exportStar(require(\"./RandomIdGenerator\"), exports);\n__exportStar(require(\"./performance\"), exports);\n__exportStar(require(\"./sdk-info\"), exports);\n__exportStar(require(\"./timer-util\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.otperformance = void 0;\nconst perf_hooks_1 = require(\"perf_hooks\");\nexports.otperformance = perf_hooks_1.performance;\n//# sourceMappingURL=performance.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SDK_INFO = void 0;\nconst version_1 = require(\"../../version\");\nconst semantic_conventions_1 = require(\"@opentelemetry/semantic-conventions\");\n/** Constants describing the SDK in use */\nexports.SDK_INFO = {\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_NAME]: 'opentelemetry',\n [semantic_conventions_1.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]: 'node',\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]: semantic_conventions_1.TelemetrySdkLanguageValues.NODEJS,\n [semantic_conventions_1.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]: version_1.VERSION,\n};\n//# sourceMappingURL=sdk-info.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unrefTimer = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction unrefTimer(timer) {\n timer.unref();\n}\nexports.unrefTimer = unrefTimer;\n//# sourceMappingURL=timer-util.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CompositePropagator = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Combines multiple propagators into a single propagator. */\nclass CompositePropagator {\n /**\n * Construct a composite propagator from a list of propagators.\n *\n * @param [config] Configuration object for composite propagator\n */\n constructor(config = {}) {\n var _a;\n this._propagators = (_a = config.propagators) !== null && _a !== void 0 ? _a : [];\n this._fields = Array.from(new Set(this._propagators\n // older propagators may not have fields function, null check to be sure\n .map(p => (typeof p.fields === 'function' ? p.fields() : []))\n .reduce((x, y) => x.concat(y), [])));\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same carrier key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to inject\n * @param carrier Carrier into which context will be injected\n */\n inject(context, carrier, setter) {\n for (const propagator of this._propagators) {\n try {\n propagator.inject(context, carrier, setter);\n }\n catch (err) {\n api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n }\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same context key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to add values to\n * @param carrier Carrier from which to extract context\n */\n extract(context, carrier, getter) {\n return this._propagators.reduce((ctx, propagator) => {\n try {\n return propagator.extract(ctx, carrier, getter);\n }\n catch (err) {\n api_1.diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n return ctx;\n }, context);\n }\n fields() {\n // return a new array so our fields cannot be modified\n return this._fields.slice();\n }\n}\nexports.CompositePropagator = CompositePropagator;\n//# sourceMappingURL=composite.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=IdGenerator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceState = void 0;\nconst validators_1 = require(\"../internal/validators\");\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nclass TraceState {\n constructor(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n set(key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n const traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n }\n unset(key) {\n const traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n }\n get(key) {\n return this._internalState.get(key);\n }\n serialize() {\n return this._keys()\n .reduce((agg, key) => {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n }\n _parse(rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce((agg, part) => {\n const listMember = part.trim(); // Optional Whitespace (OWS) handling\n const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n const key = listMember.slice(0, i);\n const value = listMember.slice(i + 1, part.length);\n if (validators_1.validateKey(key) && validators_1.validateValue(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n }\n _keys() {\n return Array.from(this._internalState.keys()).reverse();\n }\n _clone() {\n const traceState = new TraceState();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n }\n}\nexports.TraceState = TraceState;\n//# sourceMappingURL=TraceState.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.W3CTraceContextPropagator = exports.parseTraceParent = exports.TRACE_STATE_HEADER = exports.TRACE_PARENT_HEADER = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst suppress_tracing_1 = require(\"./suppress-tracing\");\nconst TraceState_1 = require(\"./TraceState\");\nexports.TRACE_PARENT_HEADER = 'traceparent';\nexports.TRACE_STATE_HEADER = 'tracestate';\nconst VERSION = '00';\nconst VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nconst TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nconst PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nconst FLAGS_PART = '[\\\\da-f]{2}';\nconst TRACE_PARENT_REGEX = new RegExp(`^\\\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\\\s?$`);\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n * It should be dynamically generated server side to have the server's request trace Id,\n * a parent span Id that was set on the server's request span,\n * and the trace flags to indicate the server's sampling decision\n * (01 = sampled, 00 = not sampled).\n * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n * For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nfunction parseTraceParent(traceParent) {\n const match = TRACE_PARENT_REGEX.exec(traceParent);\n if (!match)\n return null;\n // According to the specification the implementation should be compatible\n // with future versions. If there are more parts, we only reject it if it's using version 00\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n if (match[1] === '00' && match[5])\n return null;\n return {\n traceId: match[2],\n spanId: match[3],\n traceFlags: parseInt(match[4], 16),\n };\n}\nexports.parseTraceParent = parseTraceParent;\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nclass W3CTraceContextPropagator {\n inject(context, carrier, setter) {\n const spanContext = api_1.trace.getSpanContext(context);\n if (!spanContext ||\n suppress_tracing_1.isTracingSuppressed(context) ||\n !api_1.isSpanContextValid(spanContext))\n return;\n const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || api_1.TraceFlags.NONE).toString(16)}`;\n setter.set(carrier, exports.TRACE_PARENT_HEADER, traceParent);\n if (spanContext.traceState) {\n setter.set(carrier, exports.TRACE_STATE_HEADER, spanContext.traceState.serialize());\n }\n }\n extract(context, carrier, getter) {\n const traceParentHeader = getter.get(carrier, exports.TRACE_PARENT_HEADER);\n if (!traceParentHeader)\n return context;\n const traceParent = Array.isArray(traceParentHeader)\n ? traceParentHeader[0]\n : traceParentHeader;\n if (typeof traceParent !== 'string')\n return context;\n const spanContext = parseTraceParent(traceParent);\n if (!spanContext)\n return context;\n spanContext.isRemote = true;\n const traceStateHeader = getter.get(carrier, exports.TRACE_STATE_HEADER);\n if (traceStateHeader) {\n // If more than one `tracestate` header is found, we merge them into a\n // single header.\n const state = Array.isArray(traceStateHeader)\n ? traceStateHeader.join(',')\n : traceStateHeader;\n spanContext.traceState = new TraceState_1.TraceState(typeof state === 'string' ? state : undefined);\n }\n return api_1.trace.setSpanContext(context, spanContext);\n }\n fields() {\n return [exports.TRACE_PARENT_HEADER, exports.TRACE_STATE_HEADER];\n }\n}\nexports.W3CTraceContextPropagator = W3CTraceContextPropagator;\n//# sourceMappingURL=W3CTraceContextPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRPCMetadata = exports.deleteRPCMetadata = exports.setRPCMetadata = exports.RPCType = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst RPC_METADATA_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key RPC_METADATA');\nvar RPCType;\n(function (RPCType) {\n RPCType[\"HTTP\"] = \"http\";\n})(RPCType = exports.RPCType || (exports.RPCType = {}));\nfunction setRPCMetadata(context, meta) {\n return context.setValue(RPC_METADATA_KEY, meta);\n}\nexports.setRPCMetadata = setRPCMetadata;\nfunction deleteRPCMetadata(context) {\n return context.deleteValue(RPC_METADATA_KEY);\n}\nexports.deleteRPCMetadata = deleteRPCMetadata;\nfunction getRPCMetadata(context) {\n return context.getValue(RPC_METADATA_KEY);\n}\nexports.getRPCMetadata = getRPCMetadata;\n//# sourceMappingURL=rpc-metadata.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AlwaysOffSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples no traces. */\nclass AlwaysOffSampler {\n shouldSample() {\n return {\n decision: api_1.SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return 'AlwaysOffSampler';\n }\n}\nexports.AlwaysOffSampler = AlwaysOffSampler;\n//# sourceMappingURL=AlwaysOffSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AlwaysOnSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples all traces. */\nclass AlwaysOnSampler {\n shouldSample() {\n return {\n decision: api_1.SamplingDecision.RECORD_AND_SAMPLED,\n };\n }\n toString() {\n return 'AlwaysOnSampler';\n }\n}\nexports.AlwaysOnSampler = AlwaysOnSampler;\n//# sourceMappingURL=AlwaysOnSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ParentBasedSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst global_error_handler_1 = require(\"../../common/global-error-handler\");\nconst AlwaysOffSampler_1 = require(\"./AlwaysOffSampler\");\nconst AlwaysOnSampler_1 = require(\"./AlwaysOnSampler\");\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nclass ParentBasedSampler {\n constructor(config) {\n var _a, _b, _c, _d;\n this._root = config.root;\n if (!this._root) {\n global_error_handler_1.globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured'));\n this._root = new AlwaysOnSampler_1.AlwaysOnSampler();\n }\n this._remoteParentSampled =\n (_a = config.remoteParentSampled) !== null && _a !== void 0 ? _a : new AlwaysOnSampler_1.AlwaysOnSampler();\n this._remoteParentNotSampled =\n (_b = config.remoteParentNotSampled) !== null && _b !== void 0 ? _b : new AlwaysOffSampler_1.AlwaysOffSampler();\n this._localParentSampled =\n (_c = config.localParentSampled) !== null && _c !== void 0 ? _c : new AlwaysOnSampler_1.AlwaysOnSampler();\n this._localParentNotSampled =\n (_d = config.localParentNotSampled) !== null && _d !== void 0 ? _d : new AlwaysOffSampler_1.AlwaysOffSampler();\n }\n shouldSample(context, traceId, spanName, spanKind, attributes, links) {\n const parentContext = api_1.trace.getSpanContext(context);\n if (!parentContext || !api_1.isSpanContextValid(parentContext)) {\n return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.isRemote) {\n if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {\n return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {\n return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n toString() {\n return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;\n }\n}\nexports.ParentBasedSampler = ParentBasedSampler;\n//# sourceMappingURL=ParentBasedSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceIdRatioBasedSampler = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nclass TraceIdRatioBasedSampler {\n constructor(_ratio = 0) {\n this._ratio = _ratio;\n this._ratio = this._normalize(_ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n shouldSample(context, traceId) {\n return {\n decision: api_1.isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? api_1.SamplingDecision.RECORD_AND_SAMPLED\n : api_1.SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n _normalize(ratio) {\n if (typeof ratio !== 'number' || isNaN(ratio))\n return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n _accumulate(traceId) {\n let accumulation = 0;\n for (let i = 0; i < traceId.length / 8; i++) {\n const pos = i * 8;\n const part = parseInt(traceId.slice(pos, pos + 8), 16);\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\nexports.TraceIdRatioBasedSampler = TraceIdRatioBasedSampler;\n//# sourceMappingURL=TraceIdRatioBasedSampler.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isTracingSuppressed = exports.unsuppressTracing = exports.suppressTracing = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst SUPPRESS_TRACING_KEY = api_1.createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING');\nfunction suppressTracing(context) {\n return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\nexports.suppressTracing = suppressTracing;\nfunction unsuppressTracing(context) {\n return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\nexports.unsuppressTracing = unsuppressTracing;\nfunction isTracingSuppressed(context) {\n return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\nexports.isTracingSuppressed = isTracingSuppressed;\n//# sourceMappingURL=suppress-tracing.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.parseEnvironment = exports.DEFAULT_ENVIRONMENT = exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = void 0;\nconst api_1 = require(\"@opentelemetry/api\");\nconst sampling_1 = require(\"./sampling\");\nconst DEFAULT_LIST_SEPARATOR = ',';\n/**\n * Environment interface to define all names\n */\nconst ENVIRONMENT_NUMBERS_KEYS = [\n 'OTEL_BSP_EXPORT_TIMEOUT',\n 'OTEL_BSP_MAX_EXPORT_BATCH_SIZE',\n 'OTEL_BSP_MAX_QUEUE_SIZE',\n 'OTEL_BSP_SCHEDULE_DELAY',\n 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT',\n 'OTEL_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT',\n 'OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT',\n 'OTEL_SPAN_EVENT_COUNT_LIMIT',\n 'OTEL_SPAN_LINK_COUNT_LIMIT',\n];\nfunction isEnvVarANumber(key) {\n return (ENVIRONMENT_NUMBERS_KEYS.indexOf(key) > -1);\n}\nconst ENVIRONMENT_LISTS_KEYS = [\n 'OTEL_NO_PATCH_MODULES',\n 'OTEL_PROPAGATORS',\n];\nfunction isEnvVarAList(key) {\n return ENVIRONMENT_LISTS_KEYS.indexOf(key) > -1;\n}\nexports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;\nexports.DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;\n/**\n * Default environment variables\n */\nexports.DEFAULT_ENVIRONMENT = {\n CONTAINER_NAME: '',\n ECS_CONTAINER_METADATA_URI_V4: '',\n ECS_CONTAINER_METADATA_URI: '',\n HOSTNAME: '',\n KUBERNETES_SERVICE_HOST: '',\n NAMESPACE: '',\n OTEL_BSP_EXPORT_TIMEOUT: 30000,\n OTEL_BSP_MAX_EXPORT_BATCH_SIZE: 512,\n OTEL_BSP_MAX_QUEUE_SIZE: 2048,\n OTEL_BSP_SCHEDULE_DELAY: 5000,\n OTEL_EXPORTER_JAEGER_AGENT_HOST: '',\n OTEL_EXPORTER_JAEGER_ENDPOINT: '',\n OTEL_EXPORTER_JAEGER_PASSWORD: '',\n OTEL_EXPORTER_JAEGER_USER: '',\n OTEL_EXPORTER_OTLP_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: '',\n OTEL_EXPORTER_OTLP_HEADERS: '',\n OTEL_EXPORTER_OTLP_TRACES_HEADERS: '',\n OTEL_EXPORTER_OTLP_METRICS_HEADERS: '',\n OTEL_EXPORTER_ZIPKIN_ENDPOINT: 'http://localhost:9411/api/v2/spans',\n OTEL_LOG_LEVEL: api_1.DiagLogLevel.INFO,\n OTEL_NO_PATCH_MODULES: [],\n OTEL_PROPAGATORS: ['tracecontext', 'baggage'],\n OTEL_RESOURCE_ATTRIBUTES: '',\n OTEL_SERVICE_NAME: '',\n OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n OTEL_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT,\n OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT: exports.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,\n OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT: exports.DEFAULT_ATTRIBUTE_COUNT_LIMIT,\n OTEL_SPAN_EVENT_COUNT_LIMIT: 128,\n OTEL_SPAN_LINK_COUNT_LIMIT: 128,\n OTEL_TRACES_EXPORTER: 'none',\n OTEL_TRACES_SAMPLER: sampling_1.TracesSamplerValues.ParentBasedAlwaysOn,\n OTEL_TRACES_SAMPLER_ARG: '',\n};\n/**\n * Parses a variable as number with number validation\n * @param name\n * @param environment\n * @param values\n * @param min\n * @param max\n */\nfunction parseNumber(name, environment, values, min = -Infinity, max = Infinity) {\n if (typeof values[name] !== 'undefined') {\n const value = Number(values[name]);\n if (!isNaN(value)) {\n if (value < min) {\n environment[name] = min;\n }\n else if (value > max) {\n environment[name] = max;\n }\n else {\n environment[name] = value;\n }\n }\n }\n}\n/**\n * Parses list-like strings from input into output.\n * @param name\n * @param environment\n * @param values\n * @param separator\n */\nfunction parseStringList(name, output, input, separator = DEFAULT_LIST_SEPARATOR) {\n const givenValue = input[name];\n if (typeof givenValue === 'string') {\n output[name] = givenValue.split(separator).map(v => v.trim());\n }\n}\n// The support string -> DiagLogLevel mappings\nconst logLevelMap = {\n ALL: api_1.DiagLogLevel.ALL,\n VERBOSE: api_1.DiagLogLevel.VERBOSE,\n DEBUG: api_1.DiagLogLevel.DEBUG,\n INFO: api_1.DiagLogLevel.INFO,\n WARN: api_1.DiagLogLevel.WARN,\n ERROR: api_1.DiagLogLevel.ERROR,\n NONE: api_1.DiagLogLevel.NONE,\n};\n/**\n * Environmentally sets log level if valid log level string is provided\n * @param key\n * @param environment\n * @param values\n */\nfunction setLogLevelFromEnv(key, environment, values) {\n const value = values[key];\n if (typeof value === 'string') {\n const theLevel = logLevelMap[value.toUpperCase()];\n if (theLevel != null) {\n environment[key] = theLevel;\n }\n }\n}\n/**\n * Parses environment values\n * @param values\n */\nfunction parseEnvironment(values) {\n const environment = {};\n for (const env in exports.DEFAULT_ENVIRONMENT) {\n const key = env;\n switch (key) {\n case 'OTEL_LOG_LEVEL':\n setLogLevelFromEnv(key, environment, values);\n break;\n default:\n if (isEnvVarANumber(key)) {\n parseNumber(key, environment, values);\n }\n else if (isEnvVarAList(key)) {\n parseStringList(key, environment, values);\n }\n else {\n const value = values[key];\n if (typeof value !== 'undefined' && value !== null) {\n environment[key] = String(value);\n }\n }\n }\n }\n return environment;\n}\nexports.parseEnvironment = parseEnvironment;\n//# sourceMappingURL=environment.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isPlainObject = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * based on lodash in order to support esm builds without esModuleInterop.\n * lodash is using MIT License.\n **/\nconst objectTag = '[object Object]';\nconst nullTag = '[object Null]';\nconst undefinedTag = '[object Undefined]';\nconst funcProto = Function.prototype;\nconst funcToString = funcProto.toString;\nconst objectCtorString = funcToString.call(Object);\nconst getPrototype = overArg(Object.getPrototypeOf, Object);\nconst objectProto = Object.prototype;\nconst hasOwnProperty = objectProto.hasOwnProperty;\nconst symToStringTag = Symbol ? Symbol.toStringTag : undefined;\nconst nativeObjectToString = objectProto.toString;\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function (arg) {\n return func(transform(arg));\n };\n}\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {\n return false;\n }\n const proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) === objectCtorString;\n}\nexports.isPlainObject = isPlainObject;\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];\n let unmasked = false;\n try {\n value[symToStringTag] = undefined;\n unmasked = true;\n }\n catch (e) {\n // silence\n }\n const result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n }\n else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n//# sourceMappingURL=lodash.merge.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.merge = void 0;\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst lodash_merge_1 = require(\"./lodash.merge\");\nconst MAX_LEVEL = 20;\n/**\n * Merges objects together\n * @param args - objects / values to be merged\n */\nfunction merge(...args) {\n let result = args.shift();\n const objects = new WeakMap();\n while (args.length > 0) {\n result = mergeTwoObjects(result, args.shift(), 0, objects);\n }\n return result;\n}\nexports.merge = merge;\nfunction takeValue(value) {\n if (isArray(value)) {\n return value.slice();\n }\n return value;\n}\n/**\n * Merges two objects\n * @param one - first object\n * @param two - second object\n * @param level - current deep level\n * @param objects - objects holder that has been already referenced - to prevent\n * cyclic dependency\n */\nfunction mergeTwoObjects(one, two, level = 0, objects) {\n let result;\n if (level > MAX_LEVEL) {\n return undefined;\n }\n level++;\n if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) {\n result = takeValue(two);\n }\n else if (isArray(one)) {\n result = one.slice();\n if (isArray(two)) {\n for (let i = 0, j = two.length; i < j; i++) {\n result.push(takeValue(two[i]));\n }\n }\n else if (isObject(two)) {\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n result[key] = takeValue(two[key]);\n }\n }\n }\n else if (isObject(one)) {\n if (isObject(two)) {\n if (!shouldMerge(one, two)) {\n return two;\n }\n result = Object.assign({}, one);\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n const twoValue = two[key];\n if (isPrimitive(twoValue)) {\n if (typeof twoValue === 'undefined') {\n delete result[key];\n }\n else {\n // result[key] = takeValue(twoValue);\n result[key] = twoValue;\n }\n }\n else {\n const obj1 = result[key];\n const obj2 = twoValue;\n if (wasObjectReferenced(one, key, objects) ||\n wasObjectReferenced(two, key, objects)) {\n delete result[key];\n }\n else {\n if (isObject(obj1) && isObject(obj2)) {\n const arr1 = objects.get(obj1) || [];\n const arr2 = objects.get(obj2) || [];\n arr1.push({ obj: one, key });\n arr2.push({ obj: two, key });\n objects.set(obj1, arr1);\n objects.set(obj2, arr2);\n }\n result[key] = mergeTwoObjects(result[key], twoValue, level, objects);\n }\n }\n }\n }\n else {\n result = two;\n }\n }\n return result;\n}\n/**\n * Function to check if object has been already reference\n * @param obj\n * @param key\n * @param objects\n */\nfunction wasObjectReferenced(obj, key, objects) {\n const arr = objects.get(obj[key]) || [];\n for (let i = 0, j = arr.length; i < j; i++) {\n const info = arr[i];\n if (info.key === key && info.obj === obj) {\n return true;\n }\n }\n return false;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isObject(value) {\n return !isPrimitive(value) && !isArray(value) && !isFunction(value) && typeof value === 'object';\n}\nfunction isPrimitive(value) {\n return typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'undefined' ||\n value instanceof Date ||\n value instanceof RegExp ||\n value === null;\n}\nfunction shouldMerge(one, two) {\n if (!lodash_merge_1.isPlainObject(one) || !lodash_merge_1.isPlainObject(two)) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=merge.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TracesSamplerValues = void 0;\nvar TracesSamplerValues;\n(function (TracesSamplerValues) {\n TracesSamplerValues[\"AlwaysOff\"] = \"always_off\";\n TracesSamplerValues[\"AlwaysOn\"] = \"always_on\";\n TracesSamplerValues[\"ParentBasedAlwaysOff\"] = \"parentbased_always_off\";\n TracesSamplerValues[\"ParentBasedAlwaysOn\"] = \"parentbased_always_on\";\n TracesSamplerValues[\"ParentBasedTraceIdRatio\"] = \"parentbased_traceidratio\";\n TracesSamplerValues[\"TraceIdRatio\"] = \"traceidratio\";\n})(TracesSamplerValues = exports.TracesSamplerValues || (exports.TracesSamplerValues = {}));\n//# sourceMappingURL=sampling.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isUrlIgnored = exports.urlMatches = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nfunction urlMatches(url, urlToMatch) {\n if (typeof urlToMatch === 'string') {\n return url === urlToMatch;\n }\n else {\n return !!url.match(urlToMatch);\n }\n}\nexports.urlMatches = urlMatches;\n/**\n * Check if {@param url} should be ignored when comparing against {@param ignoredUrls}\n * @param url\n * @param ignoredUrls\n */\nfunction isUrlIgnored(url, ignoredUrls) {\n if (!ignoredUrls) {\n return false;\n }\n for (const ignoreUrl of ignoredUrls) {\n if (urlMatches(url, ignoreUrl)) {\n return true;\n }\n }\n return false;\n}\nexports.isUrlIgnored = isUrlIgnored;\n//# sourceMappingURL=url.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isWrapped = void 0;\n/**\n * Checks if certain function has been already wrapped\n * @param func\n */\nfunction isWrapped(func) {\n return (typeof func === 'function' &&\n typeof func.__original === 'function' &&\n typeof func.__unwrap === 'function' &&\n func.__wrapped === true);\n}\nexports.isWrapped = isWrapped;\n//# sourceMappingURL=wrap.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VERSION = void 0;\n// this is autogenerated file, see scripts/version-update.js\nexports.VERSION = '1.0.1';\n//# sourceMappingURL=version.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./trace\"), exports);\n__exportStar(require(\"./resource\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TelemetrySdkLanguageValues = exports.OsTypeValues = exports.HostArchValues = exports.AwsEcsLaunchtypeValues = exports.CloudPlatformValues = exports.CloudProviderValues = exports.SemanticResourceAttributes = void 0;\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexports.SemanticResourceAttributes = {\n /**\n * Name of the cloud provider.\n */\n CLOUD_PROVIDER: 'cloud.provider',\n /**\n * The cloud account ID the resource is assigned to.\n */\n CLOUD_ACCOUNT_ID: 'cloud.account.id',\n /**\n * The geographical region the resource is running. Refer to your provider's docs to see the available regions, for example [Alibaba Cloud regions](https://www.alibabacloud.com/help/doc-detail/40654.htm), [AWS regions](https://aws.amazon.com/about-aws/global-infrastructure/regions_az/), [Azure regions](https://azure.microsoft.com/en-us/global-infrastructure/geographies/), or [Google Cloud regions](https://cloud.google.com/about/locations).\n */\n CLOUD_REGION: 'cloud.region',\n /**\n * Cloud regions often have multiple, isolated locations known as zones to increase availability. Availability zone represents the zone where the resource is running.\n *\n * Note: Availability zones are called "zones" on Alibaba Cloud and Google Cloud.\n */\n CLOUD_AVAILABILITY_ZONE: 'cloud.availability_zone',\n /**\n * The cloud platform in use.\n *\n * Note: The prefix of the service SHOULD match the one specified in `cloud.provider`.\n */\n CLOUD_PLATFORM: 'cloud.platform',\n /**\n * The Amazon Resource Name (ARN) of an [ECS container instance](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_instances.html).\n */\n AWS_ECS_CONTAINER_ARN: 'aws.ecs.container.arn',\n /**\n * The ARN of an [ECS cluster](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/clusters.html).\n */\n AWS_ECS_CLUSTER_ARN: 'aws.ecs.cluster.arn',\n /**\n * The [launch type](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) for an ECS task.\n */\n AWS_ECS_LAUNCHTYPE: 'aws.ecs.launchtype',\n /**\n * The ARN of an [ECS task definition](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definitions.html).\n */\n AWS_ECS_TASK_ARN: 'aws.ecs.task.arn',\n /**\n * The task definition family this task definition is a member of.\n */\n AWS_ECS_TASK_FAMILY: 'aws.ecs.task.family',\n /**\n * The revision for this task definition.\n */\n AWS_ECS_TASK_REVISION: 'aws.ecs.task.revision',\n /**\n * The ARN of an EKS cluster.\n */\n AWS_EKS_CLUSTER_ARN: 'aws.eks.cluster.arn',\n /**\n * The name(s) of the AWS log group(s) an application is writing to.\n *\n * Note: Multiple log groups must be supported for cases like multi-container applications, where a single application has sidecar containers, and each write to their own log group.\n */\n AWS_LOG_GROUP_NAMES: 'aws.log.group.names',\n /**\n * The Amazon Resource Name(s) (ARN) of the AWS log group(s).\n *\n * Note: See the [log group ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format).\n */\n AWS_LOG_GROUP_ARNS: 'aws.log.group.arns',\n /**\n * The name(s) of the AWS log stream(s) an application is writing to.\n */\n AWS_LOG_STREAM_NAMES: 'aws.log.stream.names',\n /**\n * The ARN(s) of the AWS log stream(s).\n *\n * Note: See the [log stream ARN format documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-access-control-overview-cwl.html#CWL_ARN_Format). One log group can contain several log streams, so these ARNs necessarily identify both a log group and a log stream.\n */\n AWS_LOG_STREAM_ARNS: 'aws.log.stream.arns',\n /**\n * Container name.\n */\n CONTAINER_NAME: 'container.name',\n /**\n * Container ID. Usually a UUID, as for example used to [identify Docker containers](https://docs.docker.com/engine/reference/run/#container-identification). The UUID might be abbreviated.\n */\n CONTAINER_ID: 'container.id',\n /**\n * The container runtime managing this container.\n */\n CONTAINER_RUNTIME: 'container.runtime',\n /**\n * Name of the image the container was built on.\n */\n CONTAINER_IMAGE_NAME: 'container.image.name',\n /**\n * Container image tag.\n */\n CONTAINER_IMAGE_TAG: 'container.image.tag',\n /**\n * Name of the [deployment environment](https://en.wikipedia.org/wiki/Deployment_environment) (aka deployment tier).\n */\n DEPLOYMENT_ENVIRONMENT: 'deployment.environment',\n /**\n * A unique identifier representing the device.\n *\n * Note: The device identifier MUST only be defined using the values outlined below. This value is not an advertising identifier and MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST be equal to the [vendor identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor). On Android (Java or Kotlin), this value MUST be equal to the Firebase Installation ID or a globally unique UUID which is persisted across sessions in your application. More information can be found [here](https://developer.android.com/training/articles/user-data-ids) on best practices and exact implementation details. Caution should be taken when storing personal data or anything which can identify a user. GDPR and data protection laws may apply, ensure you do your own due diligence.\n */\n DEVICE_ID: 'device.id',\n /**\n * The model identifier for the device.\n *\n * Note: It's recommended this value represents a machine readable version of the model identifier rather than the market or consumer-friendly name of the device.\n */\n DEVICE_MODEL_IDENTIFIER: 'device.model.identifier',\n /**\n * The marketing name for the device model.\n *\n * Note: It's recommended this value represents a human readable version of the device model rather than a machine readable alternative.\n */\n DEVICE_MODEL_NAME: 'device.model.name',\n /**\n * The name of the single function that this runtime instance executes.\n *\n * Note: This is the name of the function as configured/deployed on the FaaS platform and is usually different from the name of the callback function (which may be stored in the [`code.namespace`/`code.function`](../../trace/semantic_conventions/span-general.md#source-code-attributes) span attributes).\n */\n FAAS_NAME: 'faas.name',\n /**\n * The unique ID of the single function that this runtime instance executes.\n *\n * Note: Depending on the cloud provider, use:\n \n * **AWS Lambda:** The function [ARN](https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html).\n Take care not to use the "invoked ARN" directly but replace any\n [alias suffix](https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html) with the resolved function version, as the same runtime instance may be invokable with multiple\n different aliases.\n * **GCP:** The [URI of the resource](https://cloud.google.com/iam/docs/full-resource-names)\n * **Azure:** The [Fully Qualified Resource ID](https://docs.microsoft.com/en-us/rest/api/resources/resources/get-by-id).\n \n On some providers, it may not be possible to determine the full ID at startup,\n which is why this field cannot be made required. For example, on AWS the account ID\n part of the ARN is not available without calling another AWS API\n which may be deemed too slow for a short-running lambda function.\n As an alternative, consider setting `faas.id` as a span attribute instead.\n */\n FAAS_ID: 'faas.id',\n /**\n * The immutable version of the function being executed.\n *\n * Note: Depending on the cloud provider and platform, use:\n \n * **AWS Lambda:** The [function version](https://docs.aws.amazon.com/lambda/latest/dg/configuration-versions.html)\n (an integer represented as a decimal string).\n * **Google Cloud Run:** The [revision](https://cloud.google.com/run/docs/managing/revisions)\n (i.e., the function name plus the revision suffix).\n * **Google Cloud Functions:** The value of the\n [`K_REVISION` environment variable](https://cloud.google.com/functions/docs/env-var#runtime_environment_variables_set_automatically).\n * **Azure Functions:** Not applicable. Do not set this attribute.\n */\n FAAS_VERSION: 'faas.version',\n /**\n * The execution environment ID as a string, that will be potentially reused for other invocations to the same function/function version.\n *\n * Note: * **AWS Lambda:** Use the (full) log stream name.\n */\n FAAS_INSTANCE: 'faas.instance',\n /**\n * The amount of memory available to the serverless function in MiB.\n *\n * Note: It's recommended to set this attribute since e.g. too little memory can easily stop a Java AWS Lambda function from working correctly. On AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information.\n */\n FAAS_MAX_MEMORY: 'faas.max_memory',\n /**\n * Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider.\n */\n HOST_ID: 'host.id',\n /**\n * Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.\n */\n HOST_NAME: 'host.name',\n /**\n * Type of host. For Cloud, this must be the machine type.\n */\n HOST_TYPE: 'host.type',\n /**\n * The CPU architecture the host system is running on.\n */\n HOST_ARCH: 'host.arch',\n /**\n * Name of the VM image or OS install the host was instantiated from.\n */\n HOST_IMAGE_NAME: 'host.image.name',\n /**\n * VM image ID. For Cloud, this value is from the provider.\n */\n HOST_IMAGE_ID: 'host.image.id',\n /**\n * The version string of the VM image as defined in [Version Attributes](README.md#version-attributes).\n */\n HOST_IMAGE_VERSION: 'host.image.version',\n /**\n * The name of the cluster.\n */\n K8S_CLUSTER_NAME: 'k8s.cluster.name',\n /**\n * The name of the Node.\n */\n K8S_NODE_NAME: 'k8s.node.name',\n /**\n * The UID of the Node.\n */\n K8S_NODE_UID: 'k8s.node.uid',\n /**\n * The name of the namespace that the pod is running in.\n */\n K8S_NAMESPACE_NAME: 'k8s.namespace.name',\n /**\n * The UID of the Pod.\n */\n K8S_POD_UID: 'k8s.pod.uid',\n /**\n * The name of the Pod.\n */\n K8S_POD_NAME: 'k8s.pod.name',\n /**\n * The name of the Container in a Pod template.\n */\n K8S_CONTAINER_NAME: 'k8s.container.name',\n /**\n * The UID of the ReplicaSet.\n */\n K8S_REPLICASET_UID: 'k8s.replicaset.uid',\n /**\n * The name of the ReplicaSet.\n */\n K8S_REPLICASET_NAME: 'k8s.replicaset.name',\n /**\n * The UID of the Deployment.\n */\n K8S_DEPLOYMENT_UID: 'k8s.deployment.uid',\n /**\n * The name of the Deployment.\n */\n K8S_DEPLOYMENT_NAME: 'k8s.deployment.name',\n /**\n * The UID of the StatefulSet.\n */\n K8S_STATEFULSET_UID: 'k8s.statefulset.uid',\n /**\n * The name of the StatefulSet.\n */\n K8S_STATEFULSET_NAME: 'k8s.statefulset.name',\n /**\n * The UID of the DaemonSet.\n */\n K8S_DAEMONSET_UID: 'k8s.daemonset.uid',\n /**\n * The name of the DaemonSet.\n */\n K8S_DAEMONSET_NAME: 'k8s.daemonset.name',\n /**\n * The UID of the Job.\n */\n K8S_JOB_UID: 'k8s.job.uid',\n /**\n * The name of the Job.\n */\n K8S_JOB_NAME: 'k8s.job.name',\n /**\n * The UID of the CronJob.\n */\n K8S_CRONJOB_UID: 'k8s.cronjob.uid',\n /**\n * The name of the CronJob.\n */\n K8S_CRONJOB_NAME: 'k8s.cronjob.name',\n /**\n * The operating system type.\n */\n OS_TYPE: 'os.type',\n /**\n * Human readable (not intended to be parsed) OS version information, like e.g. reported by `ver` or `lsb_release -a` commands.\n */\n OS_DESCRIPTION: 'os.description',\n /**\n * Human readable operating system name.\n */\n OS_NAME: 'os.name',\n /**\n * The version string of the operating system as defined in [Version Attributes](../../resource/semantic_conventions/README.md#version-attributes).\n */\n OS_VERSION: 'os.version',\n /**\n * Process identifier (PID).\n */\n PROCESS_PID: 'process.pid',\n /**\n * The name of the process executable. On Linux based systems, can be set to the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_NAME: 'process.executable.name',\n /**\n * The full path to the process executable. On Linux based systems, can be set to the target of `proc/[pid]/exe`. On Windows, can be set to the result of `GetProcessImageFileNameW`.\n */\n PROCESS_EXECUTABLE_PATH: 'process.executable.path',\n /**\n * The command used to launch the process (i.e. the command name). On Linux based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On Windows, can be set to the first parameter extracted from `GetCommandLineW`.\n */\n PROCESS_COMMAND: 'process.command',\n /**\n * The full command used to launch the process as a single string representing the full command. On Windows, can be set to the result of `GetCommandLineW`. Do not set this if you have to assemble it just for monitoring; use `process.command_args` instead.\n */\n PROCESS_COMMAND_LINE: 'process.command_line',\n /**\n * All the command arguments (including the command/executable itself) as received by the process. On Linux-based systems (and some other Unixoid systems supporting procfs), can be set according to the list of null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based executables, this would be the full argv vector passed to `main`.\n */\n PROCESS_COMMAND_ARGS: 'process.command_args',\n /**\n * The username of the user that owns the process.\n */\n PROCESS_OWNER: 'process.owner',\n /**\n * The name of the runtime of this process. For compiled native binaries, this SHOULD be the name of the compiler.\n */\n PROCESS_RUNTIME_NAME: 'process.runtime.name',\n /**\n * The version of the runtime of this process, as returned by the runtime without modification.\n */\n PROCESS_RUNTIME_VERSION: 'process.runtime.version',\n /**\n * An additional description about the runtime of the process, for example a specific vendor customization of the runtime environment.\n */\n PROCESS_RUNTIME_DESCRIPTION: 'process.runtime.description',\n /**\n * Logical name of the service.\n *\n * Note: MUST be the same for all instances of horizontally scaled services. If the value was not specified, SDKs MUST fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md#process), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value MUST be set to `unknown_service`.\n */\n SERVICE_NAME: 'service.name',\n /**\n * A namespace for `service.name`.\n *\n * Note: A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\n SERVICE_NAMESPACE: 'service.namespace',\n /**\n * The string ID of the service instance.\n *\n * Note: MUST be unique for each instance of the same `service.namespace,service.name` pair (in other words `service.namespace,service.name,service.instance.id` triplet MUST be globally unique). The ID helps to distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled service). It is preferable for the ID to be persistent and stay the same for the lifetime of the service instance, however it is acceptable that the ID is ephemeral and changes during important lifetime events for the service (e.g. service restarts). If the service has no inherent unique ID that can be used as the value of this attribute it is recommended to generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may also use Version 5, see RFC 4122 for more recommendations).\n */\n SERVICE_INSTANCE_ID: 'service.instance.id',\n /**\n * The version string of the service API or implementation.\n */\n SERVICE_VERSION: 'service.version',\n /**\n * The name of the telemetry SDK as defined above.\n */\n TELEMETRY_SDK_NAME: 'telemetry.sdk.name',\n /**\n * The language of the telemetry SDK.\n */\n TELEMETRY_SDK_LANGUAGE: 'telemetry.sdk.language',\n /**\n * The version string of the telemetry SDK.\n */\n TELEMETRY_SDK_VERSION: 'telemetry.sdk.version',\n /**\n * The version string of the auto instrumentation agent, if used.\n */\n TELEMETRY_AUTO_VERSION: 'telemetry.auto.version',\n /**\n * The name of the web engine.\n */\n WEBENGINE_NAME: 'webengine.name',\n /**\n * The version of the web engine.\n */\n WEBENGINE_VERSION: 'webengine.version',\n /**\n * Additional description of the web engine (e.g. detailed version and edition information).\n */\n WEBENGINE_DESCRIPTION: 'webengine.description',\n};\nexports.CloudProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexports.CloudPlatformValues = {\n /** Alibaba Cloud Elastic Compute Service. */\n ALIBABA_CLOUD_ECS: 'alibaba_cloud_ecs',\n /** Alibaba Cloud Function Compute. */\n ALIBABA_CLOUD_FC: 'alibaba_cloud_fc',\n /** AWS Elastic Compute Cloud. */\n AWS_EC2: 'aws_ec2',\n /** AWS Elastic Container Service. */\n AWS_ECS: 'aws_ecs',\n /** AWS Elastic Kubernetes Service. */\n AWS_EKS: 'aws_eks',\n /** AWS Lambda. */\n AWS_LAMBDA: 'aws_lambda',\n /** AWS Elastic Beanstalk. */\n AWS_ELASTIC_BEANSTALK: 'aws_elastic_beanstalk',\n /** Azure Virtual Machines. */\n AZURE_VM: 'azure_vm',\n /** Azure Container Instances. */\n AZURE_CONTAINER_INSTANCES: 'azure_container_instances',\n /** Azure Kubernetes Service. */\n AZURE_AKS: 'azure_aks',\n /** Azure Functions. */\n AZURE_FUNCTIONS: 'azure_functions',\n /** Azure App Service. */\n AZURE_APP_SERVICE: 'azure_app_service',\n /** Google Cloud Compute Engine (GCE). */\n GCP_COMPUTE_ENGINE: 'gcp_compute_engine',\n /** Google Cloud Run. */\n GCP_CLOUD_RUN: 'gcp_cloud_run',\n /** Google Cloud Kubernetes Engine (GKE). */\n GCP_KUBERNETES_ENGINE: 'gcp_kubernetes_engine',\n /** Google Cloud Functions (GCF). */\n GCP_CLOUD_FUNCTIONS: 'gcp_cloud_functions',\n /** Google Cloud App Engine (GAE). */\n GCP_APP_ENGINE: 'gcp_app_engine',\n};\nexports.AwsEcsLaunchtypeValues = {\n /** ec2. */\n EC2: 'ec2',\n /** fargate. */\n FARGATE: 'fargate',\n};\nexports.HostArchValues = {\n /** AMD64. */\n AMD64: 'amd64',\n /** ARM32. */\n ARM32: 'arm32',\n /** ARM64. */\n ARM64: 'arm64',\n /** Itanium. */\n IA64: 'ia64',\n /** 32-bit PowerPC. */\n PPC32: 'ppc32',\n /** 64-bit PowerPC. */\n PPC64: 'ppc64',\n /** 32-bit x86. */\n X86: 'x86',\n};\nexports.OsTypeValues = {\n /** Microsoft Windows. */\n WINDOWS: 'windows',\n /** Linux. */\n LINUX: 'linux',\n /** Apple Darwin. */\n DARWIN: 'darwin',\n /** FreeBSD. */\n FREEBSD: 'freebsd',\n /** NetBSD. */\n NETBSD: 'netbsd',\n /** OpenBSD. */\n OPENBSD: 'openbsd',\n /** DragonFly BSD. */\n DRAGONFLYBSD: 'dragonflybsd',\n /** HP-UX (Hewlett Packard Unix). */\n HPUX: 'hpux',\n /** AIX (Advanced Interactive eXecutive). */\n AIX: 'aix',\n /** Oracle Solaris. */\n SOLARIS: 'solaris',\n /** IBM z/OS. */\n Z_OS: 'z_os',\n};\nexports.TelemetrySdkLanguageValues = {\n /** cpp. */\n CPP: 'cpp',\n /** dotnet. */\n DOTNET: 'dotnet',\n /** erlang. */\n ERLANG: 'erlang',\n /** go. */\n GO: 'go',\n /** java. */\n JAVA: 'java',\n /** nodejs. */\n NODEJS: 'nodejs',\n /** php. */\n PHP: 'php',\n /** python. */\n PYTHON: 'python',\n /** ruby. */\n RUBY: 'ruby',\n /** webjs. */\n WEBJS: 'webjs',\n};\n//# sourceMappingURL=SemanticResourceAttributes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./SemanticResourceAttributes\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MessageTypeValues = exports.RpcGrpcStatusCodeValues = exports.MessagingOperationValues = exports.MessagingDestinationKindValues = exports.HttpFlavorValues = exports.NetHostConnectionSubtypeValues = exports.NetHostConnectionTypeValues = exports.NetTransportValues = exports.FaasInvokedProviderValues = exports.FaasDocumentOperationValues = exports.FaasTriggerValues = exports.DbCassandraConsistencyLevelValues = exports.DbSystemValues = exports.SemanticAttributes = void 0;\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates//templates/SemanticAttributes.ts.j2\nexports.SemanticAttributes = {\n /**\n * The full invoked ARN as provided on the `Context` passed to the function (`Lambda-Runtime-Invoked-Function-Arn` header on the `/runtime/invocation/next` applicable).\n *\n * Note: This may be different from `faas.id` if an alias is involved.\n */\n AWS_LAMBDA_INVOKED_ARN: 'aws.lambda.invoked_arn',\n /**\n * An identifier for the database management system (DBMS) product being used. See below for a list of well-known identifiers.\n */\n DB_SYSTEM: 'db.system',\n /**\n * The connection string used to connect to the database. It is recommended to remove embedded credentials.\n */\n DB_CONNECTION_STRING: 'db.connection_string',\n /**\n * Username for accessing the database.\n */\n DB_USER: 'db.user',\n /**\n * The fully-qualified class name of the [Java Database Connectivity (JDBC)](https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/) driver used to connect.\n */\n DB_JDBC_DRIVER_CLASSNAME: 'db.jdbc.driver_classname',\n /**\n * If no [tech-specific attribute](#call-level-attributes-for-specific-technologies) is defined, this attribute is used to report the name of the database being accessed. For commands that switch the database, this should be set to the target database (even if the command fails).\n *\n * Note: In some SQL databases, the database name to be used is called "schema name".\n */\n DB_NAME: 'db.name',\n /**\n * The database statement being executed.\n *\n * Note: The value may be sanitized to exclude sensitive information.\n */\n DB_STATEMENT: 'db.statement',\n /**\n * The name of the operation being executed, e.g. the [MongoDB command name](https://docs.mongodb.com/manual/reference/command/#database-operations) such as `findAndModify`, or the SQL keyword.\n *\n * Note: When setting this to an SQL keyword, it is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if the operation name is provided by the library being instrumented. If the SQL statement has an ambiguous operation, or performs more than one operation, this value may be omitted.\n */\n DB_OPERATION: 'db.operation',\n /**\n * The Microsoft SQL Server [instance name](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver15) connecting to. This name is used to determine the port of a named instance.\n *\n * Note: If setting a `db.mssql.instance_name`, `net.peer.port` is no longer required (but still recommended if non-standard).\n */\n DB_MSSQL_INSTANCE_NAME: 'db.mssql.instance_name',\n /**\n * The name of the keyspace being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_CASSANDRA_KEYSPACE: 'db.cassandra.keyspace',\n /**\n * The fetch size used for paging, i.e. how many rows will be returned at once.\n */\n DB_CASSANDRA_PAGE_SIZE: 'db.cassandra.page_size',\n /**\n * The consistency level of the query. Based on consistency values from [CQL](https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/dml/dmlConfigConsistency.html).\n */\n DB_CASSANDRA_CONSISTENCY_LEVEL: 'db.cassandra.consistency_level',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: This mirrors the db.sql.table attribute but references cassandra rather than sql. It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_CASSANDRA_TABLE: 'db.cassandra.table',\n /**\n * Whether or not the query is idempotent.\n */\n DB_CASSANDRA_IDEMPOTENCE: 'db.cassandra.idempotence',\n /**\n * The number of times a query was speculatively executed. Not set or `0` if the query was not executed speculatively.\n */\n DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT: 'db.cassandra.speculative_execution_count',\n /**\n * The ID of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_ID: 'db.cassandra.coordinator.id',\n /**\n * The data center of the coordinating node for a query.\n */\n DB_CASSANDRA_COORDINATOR_DC: 'db.cassandra.coordinator.dc',\n /**\n * The [HBase namespace](https://hbase.apache.org/book.html#_namespace) being accessed. To be used instead of the generic `db.name` attribute.\n */\n DB_HBASE_NAMESPACE: 'db.hbase.namespace',\n /**\n * The index of the database being accessed as used in the [`SELECT` command](https://redis.io/commands/select), provided as an integer. To be used instead of the generic `db.name` attribute.\n */\n DB_REDIS_DATABASE_INDEX: 'db.redis.database_index',\n /**\n * The collection being accessed within the database stated in `db.name`.\n */\n DB_MONGODB_COLLECTION: 'db.mongodb.collection',\n /**\n * The name of the primary table that the operation is acting upon, including the schema name (if applicable).\n *\n * Note: It is not recommended to attempt any client-side parsing of `db.statement` just to get this property, but it should be set if it is provided by the library being instrumented. If the operation is acting upon an anonymous table, or more than one table, this value MUST NOT be set.\n */\n DB_SQL_TABLE: 'db.sql.table',\n /**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n */\n EXCEPTION_TYPE: 'exception.type',\n /**\n * The exception message.\n */\n EXCEPTION_MESSAGE: 'exception.message',\n /**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n */\n EXCEPTION_STACKTRACE: 'exception.stacktrace',\n /**\n * SHOULD be set to true if the exception event is recorded at a point where it is known that the exception is escaping the scope of the span.\n *\n * Note: An exception is considered to have escaped (or left) the scope of a span,\n if that span is ended while the exception is still logically "in flight".\n This may be actually "in flight" in some languages (e.g. if the exception\n is passed to a Context manager's `__exit__` method in Python) but will\n usually be caught at the point of recording the exception in most languages.\n \n It is usually not possible to determine at the point where an exception is thrown\n whether it will escape the scope of a span.\n However, it is trivial to know that an exception\n will escape, if one checks for an active exception just before ending the span,\n as done in the [example above](#exception-end-example).\n \n It follows that an exception may still escape the scope of the span\n even if the `exception.escaped` attribute was not set or set to false,\n since the event might have been recorded at a time where it was not\n clear whether the exception will escape.\n */\n EXCEPTION_ESCAPED: 'exception.escaped',\n /**\n * Type of the trigger on which the function is executed.\n */\n FAAS_TRIGGER: 'faas.trigger',\n /**\n * The execution ID of the current function execution.\n */\n FAAS_EXECUTION: 'faas.execution',\n /**\n * The name of the source on which the triggering operation was performed. For example, in Cloud Storage or S3 corresponds to the bucket name, and in Cosmos DB to the database name.\n */\n FAAS_DOCUMENT_COLLECTION: 'faas.document.collection',\n /**\n * Describes the type of the operation that was performed on the data.\n */\n FAAS_DOCUMENT_OPERATION: 'faas.document.operation',\n /**\n * A string containing the time when the data was accessed in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_DOCUMENT_TIME: 'faas.document.time',\n /**\n * The document name/table subjected to the operation. For example, in Cloud Storage or S3 is the name of the file, and in Cosmos DB the table name.\n */\n FAAS_DOCUMENT_NAME: 'faas.document.name',\n /**\n * A string containing the function invocation time in the [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format expressed in [UTC](https://www.w3.org/TR/NOTE-datetime).\n */\n FAAS_TIME: 'faas.time',\n /**\n * A string containing the schedule period as [Cron Expression](https://docs.oracle.com/cd/E12058_01/doc/doc.1014/e12030/cron_expressions.htm).\n */\n FAAS_CRON: 'faas.cron',\n /**\n * A boolean that is true if the serverless function is executed for the first time (aka cold-start).\n */\n FAAS_COLDSTART: 'faas.coldstart',\n /**\n * The name of the invoked function.\n *\n * Note: SHOULD be equal to the `faas.name` resource attribute of the invoked function.\n */\n FAAS_INVOKED_NAME: 'faas.invoked_name',\n /**\n * The cloud provider of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.provider` resource attribute of the invoked function.\n */\n FAAS_INVOKED_PROVIDER: 'faas.invoked_provider',\n /**\n * The cloud region of the invoked function.\n *\n * Note: SHOULD be equal to the `cloud.region` resource attribute of the invoked function.\n */\n FAAS_INVOKED_REGION: 'faas.invoked_region',\n /**\n * Transport protocol used. See note below.\n */\n NET_TRANSPORT: 'net.transport',\n /**\n * Remote address of the peer (dotted decimal for IPv4 or [RFC5952](https://tools.ietf.org/html/rfc5952) for IPv6).\n */\n NET_PEER_IP: 'net.peer.ip',\n /**\n * Remote port number.\n */\n NET_PEER_PORT: 'net.peer.port',\n /**\n * Remote hostname or similar, see note below.\n */\n NET_PEER_NAME: 'net.peer.name',\n /**\n * Like `net.peer.ip` but for the host IP. Useful in case of a multi-IP host.\n */\n NET_HOST_IP: 'net.host.ip',\n /**\n * Like `net.peer.port` but for the host port.\n */\n NET_HOST_PORT: 'net.host.port',\n /**\n * Local hostname or similar, see note below.\n */\n NET_HOST_NAME: 'net.host.name',\n /**\n * The internet connection type currently being used by the host.\n */\n NET_HOST_CONNECTION_TYPE: 'net.host.connection.type',\n /**\n * This describes more details regarding the connection.type. It may be the type of cell technology connection, but it could be used for describing details about a wifi connection.\n */\n NET_HOST_CONNECTION_SUBTYPE: 'net.host.connection.subtype',\n /**\n * The name of the mobile carrier.\n */\n NET_HOST_CARRIER_NAME: 'net.host.carrier.name',\n /**\n * The mobile carrier country code.\n */\n NET_HOST_CARRIER_MCC: 'net.host.carrier.mcc',\n /**\n * The mobile carrier network code.\n */\n NET_HOST_CARRIER_MNC: 'net.host.carrier.mnc',\n /**\n * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network.\n */\n NET_HOST_CARRIER_ICC: 'net.host.carrier.icc',\n /**\n * The [`service.name`](../../resource/semantic_conventions/README.md#service) of the remote service. SHOULD be equal to the actual `service.name` resource attribute of the remote service if any.\n */\n PEER_SERVICE: 'peer.service',\n /**\n * Username or client_id extracted from the access token or [Authorization](https://tools.ietf.org/html/rfc7235#section-4.2) header in the inbound request from outside the system.\n */\n ENDUSER_ID: 'enduser.id',\n /**\n * Actual/assumed role the client is making the request under extracted from token or application security context.\n */\n ENDUSER_ROLE: 'enduser.role',\n /**\n * Scopes or granted authorities the client currently possesses extracted from token or application security context. The value would come from the scope associated with an [OAuth 2.0 Access Token](https://tools.ietf.org/html/rfc6749#section-3.3) or an attribute value in a [SAML 2.0 Assertion](http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-tech-overview-2.0.html).\n */\n ENDUSER_SCOPE: 'enduser.scope',\n /**\n * Current "managed" thread ID (as opposed to OS thread ID).\n */\n THREAD_ID: 'thread.id',\n /**\n * Current thread name.\n */\n THREAD_NAME: 'thread.name',\n /**\n * The method or function name, or equivalent (usually rightmost part of the code unit's name).\n */\n CODE_FUNCTION: 'code.function',\n /**\n * The "namespace" within which `code.function` is defined. Usually the qualified class or module name, such that `code.namespace` + some separator + `code.function` form a unique identifier for the code unit.\n */\n CODE_NAMESPACE: 'code.namespace',\n /**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path).\n */\n CODE_FILEPATH: 'code.filepath',\n /**\n * The line number in `code.filepath` best representing the operation. It SHOULD point within the code unit named in `code.function`.\n */\n CODE_LINENO: 'code.lineno',\n /**\n * HTTP request method.\n */\n HTTP_METHOD: 'http.method',\n /**\n * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.\n *\n * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute's value should be `https://www.example.com/`.\n */\n HTTP_URL: 'http.url',\n /**\n * The full request target as passed in a HTTP request line or equivalent.\n */\n HTTP_TARGET: 'http.target',\n /**\n * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.\n *\n * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.\n */\n HTTP_HOST: 'http.host',\n /**\n * The URI scheme identifying the used protocol.\n */\n HTTP_SCHEME: 'http.scheme',\n /**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n */\n HTTP_STATUS_CODE: 'http.status_code',\n /**\n * Kind of HTTP protocol used.\n *\n * Note: If `net.transport` is not specified, it can be assumed to be `IP.TCP` except if `http.flavor` is `QUIC`, in which case `IP.UDP` is assumed.\n */\n HTTP_FLAVOR: 'http.flavor',\n /**\n * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.\n */\n HTTP_USER_AGENT: 'http.user_agent',\n /**\n * The size of the request payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_REQUEST_CONTENT_LENGTH: 'http.request_content_length',\n /**\n * The size of the uncompressed request payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED: 'http.request_content_length_uncompressed',\n /**\n * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.\n */\n HTTP_RESPONSE_CONTENT_LENGTH: 'http.response_content_length',\n /**\n * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.\n */\n HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED: 'http.response_content_length_uncompressed',\n /**\n * The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead).\n *\n * Note: `http.url` is usually not readily available on the server side but would have to be assembled in a cumbersome and sometimes lossy process from other information (see e.g. open-telemetry/opentelemetry-python/pull/148). It is thus preferred to supply the raw data that is available.\n */\n HTTP_SERVER_NAME: 'http.server_name',\n /**\n * The matched route (path template).\n */\n HTTP_ROUTE: 'http.route',\n /**\n * The IP address of the original client behind all proxies, if known (e.g. from [X-Forwarded-For](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For)).\n *\n * Note: This is not necessarily the same as `net.peer.ip`, which would\n identify the network-level peer, which may be a proxy.\n \n This attribute should be set when a source of information different\n from the one used for `net.peer.ip`, is available even if that other\n source just confirms the same value as `net.peer.ip`.\n Rationale: For `net.peer.ip`, one typically does not know if it\n comes from a proxy, reverse proxy, or the actual client. Setting\n `http.client_ip` when it's the same as `net.peer.ip` means that\n one is at least somewhat confident that the address is not that of\n the closest proxy.\n */\n HTTP_CLIENT_IP: 'http.client_ip',\n /**\n * The keys in the `RequestItems` object field.\n */\n AWS_DYNAMODB_TABLE_NAMES: 'aws.dynamodb.table_names',\n /**\n * The JSON-serialized value of each item in the `ConsumedCapacity` response field.\n */\n AWS_DYNAMODB_CONSUMED_CAPACITY: 'aws.dynamodb.consumed_capacity',\n /**\n * The JSON-serialized value of the `ItemCollectionMetrics` response field.\n */\n AWS_DYNAMODB_ITEM_COLLECTION_METRICS: 'aws.dynamodb.item_collection_metrics',\n /**\n * The value of the `ProvisionedThroughput.ReadCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_READ_CAPACITY: 'aws.dynamodb.provisioned_read_capacity',\n /**\n * The value of the `ProvisionedThroughput.WriteCapacityUnits` request parameter.\n */\n AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY: 'aws.dynamodb.provisioned_write_capacity',\n /**\n * The value of the `ConsistentRead` request parameter.\n */\n AWS_DYNAMODB_CONSISTENT_READ: 'aws.dynamodb.consistent_read',\n /**\n * The value of the `ProjectionExpression` request parameter.\n */\n AWS_DYNAMODB_PROJECTION: 'aws.dynamodb.projection',\n /**\n * The value of the `Limit` request parameter.\n */\n AWS_DYNAMODB_LIMIT: 'aws.dynamodb.limit',\n /**\n * The value of the `AttributesToGet` request parameter.\n */\n AWS_DYNAMODB_ATTRIBUTES_TO_GET: 'aws.dynamodb.attributes_to_get',\n /**\n * The value of the `IndexName` request parameter.\n */\n AWS_DYNAMODB_INDEX_NAME: 'aws.dynamodb.index_name',\n /**\n * The value of the `Select` request parameter.\n */\n AWS_DYNAMODB_SELECT: 'aws.dynamodb.select',\n /**\n * The JSON-serialized value of each item of the `GlobalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES: 'aws.dynamodb.global_secondary_indexes',\n /**\n * The JSON-serialized value of each item of the `LocalSecondaryIndexes` request field.\n */\n AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES: 'aws.dynamodb.local_secondary_indexes',\n /**\n * The value of the `ExclusiveStartTableName` request parameter.\n */\n AWS_DYNAMODB_EXCLUSIVE_START_TABLE: 'aws.dynamodb.exclusive_start_table',\n /**\n * The the number of items in the `TableNames` response parameter.\n */\n AWS_DYNAMODB_TABLE_COUNT: 'aws.dynamodb.table_count',\n /**\n * The value of the `ScanIndexForward` request parameter.\n */\n AWS_DYNAMODB_SCAN_FORWARD: 'aws.dynamodb.scan_forward',\n /**\n * The value of the `Segment` request parameter.\n */\n AWS_DYNAMODB_SEGMENT: 'aws.dynamodb.segment',\n /**\n * The value of the `TotalSegments` request parameter.\n */\n AWS_DYNAMODB_TOTAL_SEGMENTS: 'aws.dynamodb.total_segments',\n /**\n * The value of the `Count` response parameter.\n */\n AWS_DYNAMODB_COUNT: 'aws.dynamodb.count',\n /**\n * The value of the `ScannedCount` response parameter.\n */\n AWS_DYNAMODB_SCANNED_COUNT: 'aws.dynamodb.scanned_count',\n /**\n * The JSON-serialized value of each item in the `AttributeDefinitions` request field.\n */\n AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS: 'aws.dynamodb.attribute_definitions',\n /**\n * The JSON-serialized value of each item in the the `GlobalSecondaryIndexUpdates` request field.\n */\n AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES: 'aws.dynamodb.global_secondary_index_updates',\n /**\n * A string identifying the messaging system.\n */\n MESSAGING_SYSTEM: 'messaging.system',\n /**\n * The message destination name. This might be equal to the span name but is required nevertheless.\n */\n MESSAGING_DESTINATION: 'messaging.destination',\n /**\n * The kind of message destination.\n */\n MESSAGING_DESTINATION_KIND: 'messaging.destination_kind',\n /**\n * A boolean that is true if the message destination is temporary.\n */\n MESSAGING_TEMP_DESTINATION: 'messaging.temp_destination',\n /**\n * The name of the transport protocol.\n */\n MESSAGING_PROTOCOL: 'messaging.protocol',\n /**\n * The version of the transport protocol.\n */\n MESSAGING_PROTOCOL_VERSION: 'messaging.protocol_version',\n /**\n * Connection string.\n */\n MESSAGING_URL: 'messaging.url',\n /**\n * A value used by the messaging system as an identifier for the message, represented as a string.\n */\n MESSAGING_MESSAGE_ID: 'messaging.message_id',\n /**\n * The [conversation ID](#conversations) identifying the conversation to which the message belongs, represented as a string. Sometimes called "Correlation ID".\n */\n MESSAGING_CONVERSATION_ID: 'messaging.conversation_id',\n /**\n * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is unknown whether the compressed or uncompressed payload size is reported.\n */\n MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES: 'messaging.message_payload_size_bytes',\n /**\n * The compressed size of the message payload in bytes.\n */\n MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES: 'messaging.message_payload_compressed_size_bytes',\n /**\n * A string identifying the kind of message consumption as defined in the [Operation names](#operation-names) section above. If the operation is "send", this attribute MUST NOT be set, since the operation can be inferred from the span kind in that case.\n */\n MESSAGING_OPERATION: 'messaging.operation',\n /**\n * The identifier for the consumer receiving a message. For Kafka, set it to `{messaging.kafka.consumer_group} - {messaging.kafka.client_id}`, if both are present, or only `messaging.kafka.consumer_group`. For brokers, such as RabbitMQ and Artemis, set it to the `client_id` of the client consuming the message.\n */\n MESSAGING_CONSUMER_ID: 'messaging.consumer_id',\n /**\n * RabbitMQ message routing key.\n */\n MESSAGING_RABBITMQ_ROUTING_KEY: 'messaging.rabbitmq.routing_key',\n /**\n * Message keys in Kafka are used for grouping alike messages to ensure they're processed on the same partition. They differ from `messaging.message_id` in that they're not unique. If the key is `null`, the attribute MUST NOT be set.\n *\n * Note: If the key type is not string, it's string representation has to be supplied for the attribute. If the key has no unambiguous, canonical string form, don't include its value.\n */\n MESSAGING_KAFKA_MESSAGE_KEY: 'messaging.kafka.message_key',\n /**\n * Name of the Kafka Consumer Group that is handling the message. Only applies to consumers, not producers.\n */\n MESSAGING_KAFKA_CONSUMER_GROUP: 'messaging.kafka.consumer_group',\n /**\n * Client Id for the Consumer or Producer that is handling the message.\n */\n MESSAGING_KAFKA_CLIENT_ID: 'messaging.kafka.client_id',\n /**\n * Partition the message is sent to.\n */\n MESSAGING_KAFKA_PARTITION: 'messaging.kafka.partition',\n /**\n * A boolean that is true if the message is a tombstone.\n */\n MESSAGING_KAFKA_TOMBSTONE: 'messaging.kafka.tombstone',\n /**\n * A string identifying the remoting system.\n */\n RPC_SYSTEM: 'rpc.system',\n /**\n * The full (logical) name of the service being called, including its package name, if applicable.\n *\n * Note: This is the logical name of the service from the RPC interface perspective, which can be different from the name of any implementing class. The `code.namespace` attribute may be used to store the latter (despite the attribute name, it may include a class name; e.g., class with method actually executing the call on the server side, RPC client stub class on the client side).\n */\n RPC_SERVICE: 'rpc.service',\n /**\n * The name of the (logical) method being called, must be equal to the $method part in the span name.\n *\n * Note: This is the logical name of the method from the RPC interface perspective, which can be different from the name of any implementing method/function. The `code.function` attribute may be used to store the latter (e.g., method actually executing the call on the server side, RPC client stub method on the client side).\n */\n RPC_METHOD: 'rpc.method',\n /**\n * The [numeric status code](https://github.com/grpc/grpc/blob/v1.33.2/doc/statuscodes.md) of the gRPC request.\n */\n RPC_GRPC_STATUS_CODE: 'rpc.grpc.status_code',\n /**\n * Protocol version as in `jsonrpc` property of request/response. Since JSON-RPC 1.0 does not specify this, the value can be omitted.\n */\n RPC_JSONRPC_VERSION: 'rpc.jsonrpc.version',\n /**\n * `id` property of request or response. Since protocol allows id to be int, string, `null` or missing (for notifications), value is expected to be cast to string for simplicity. Use empty string in case of `null` value. Omit entirely if this is a notification.\n */\n RPC_JSONRPC_REQUEST_ID: 'rpc.jsonrpc.request_id',\n /**\n * `error.code` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_CODE: 'rpc.jsonrpc.error_code',\n /**\n * `error.message` property of response if it is an error response.\n */\n RPC_JSONRPC_ERROR_MESSAGE: 'rpc.jsonrpc.error_message',\n /**\n * Whether this is a received or sent message.\n */\n MESSAGE_TYPE: 'message.type',\n /**\n * MUST be calculated as two different counters starting from `1` one for sent messages and one for received message.\n *\n * Note: This way we guarantee that the values will be consistent between different implementations.\n */\n MESSAGE_ID: 'message.id',\n /**\n * Compressed size of the message in bytes.\n */\n MESSAGE_COMPRESSED_SIZE: 'message.compressed_size',\n /**\n * Uncompressed size of the message in bytes.\n */\n MESSAGE_UNCOMPRESSED_SIZE: 'message.uncompressed_size',\n};\nexports.DbSystemValues = {\n /** Some other SQL database. Fallback only. See notes. */\n OTHER_SQL: 'other_sql',\n /** Microsoft SQL Server. */\n MSSQL: 'mssql',\n /** MySQL. */\n MYSQL: 'mysql',\n /** Oracle Database. */\n ORACLE: 'oracle',\n /** IBM Db2. */\n DB2: 'db2',\n /** PostgreSQL. */\n POSTGRESQL: 'postgresql',\n /** Amazon Redshift. */\n REDSHIFT: 'redshift',\n /** Apache Hive. */\n HIVE: 'hive',\n /** Cloudscape. */\n CLOUDSCAPE: 'cloudscape',\n /** HyperSQL DataBase. */\n HSQLDB: 'hsqldb',\n /** Progress Database. */\n PROGRESS: 'progress',\n /** SAP MaxDB. */\n MAXDB: 'maxdb',\n /** SAP HANA. */\n HANADB: 'hanadb',\n /** Ingres. */\n INGRES: 'ingres',\n /** FirstSQL. */\n FIRSTSQL: 'firstsql',\n /** EnterpriseDB. */\n EDB: 'edb',\n /** InterSystems Caché. */\n CACHE: 'cache',\n /** Adabas (Adaptable Database System). */\n ADABAS: 'adabas',\n /** Firebird. */\n FIREBIRD: 'firebird',\n /** Apache Derby. */\n DERBY: 'derby',\n /** FileMaker. */\n FILEMAKER: 'filemaker',\n /** Informix. */\n INFORMIX: 'informix',\n /** InstantDB. */\n INSTANTDB: 'instantdb',\n /** InterBase. */\n INTERBASE: 'interbase',\n /** MariaDB. */\n MARIADB: 'mariadb',\n /** Netezza. */\n NETEZZA: 'netezza',\n /** Pervasive PSQL. */\n PERVASIVE: 'pervasive',\n /** PointBase. */\n POINTBASE: 'pointbase',\n /** SQLite. */\n SQLITE: 'sqlite',\n /** Sybase. */\n SYBASE: 'sybase',\n /** Teradata. */\n TERADATA: 'teradata',\n /** Vertica. */\n VERTICA: 'vertica',\n /** H2. */\n H2: 'h2',\n /** ColdFusion IMQ. */\n COLDFUSION: 'coldfusion',\n /** Apache Cassandra. */\n CASSANDRA: 'cassandra',\n /** Apache HBase. */\n HBASE: 'hbase',\n /** MongoDB. */\n MONGODB: 'mongodb',\n /** Redis. */\n REDIS: 'redis',\n /** Couchbase. */\n COUCHBASE: 'couchbase',\n /** CouchDB. */\n COUCHDB: 'couchdb',\n /** Microsoft Azure Cosmos DB. */\n COSMOSDB: 'cosmosdb',\n /** Amazon DynamoDB. */\n DYNAMODB: 'dynamodb',\n /** Neo4j. */\n NEO4J: 'neo4j',\n /** Apache Geode. */\n GEODE: 'geode',\n /** Elasticsearch. */\n ELASTICSEARCH: 'elasticsearch',\n /** Memcached. */\n MEMCACHED: 'memcached',\n /** CockroachDB. */\n COCKROACHDB: 'cockroachdb',\n};\nexports.DbCassandraConsistencyLevelValues = {\n /** all. */\n ALL: 'all',\n /** each_quorum. */\n EACH_QUORUM: 'each_quorum',\n /** quorum. */\n QUORUM: 'quorum',\n /** local_quorum. */\n LOCAL_QUORUM: 'local_quorum',\n /** one. */\n ONE: 'one',\n /** two. */\n TWO: 'two',\n /** three. */\n THREE: 'three',\n /** local_one. */\n LOCAL_ONE: 'local_one',\n /** any. */\n ANY: 'any',\n /** serial. */\n SERIAL: 'serial',\n /** local_serial. */\n LOCAL_SERIAL: 'local_serial',\n};\nexports.FaasTriggerValues = {\n /** A response to some data source operation such as a database or filesystem read/write. */\n DATASOURCE: 'datasource',\n /** To provide an answer to an inbound HTTP request. */\n HTTP: 'http',\n /** A function is set to be executed when messages are sent to a messaging system. */\n PUBSUB: 'pubsub',\n /** A function is scheduled to be executed regularly. */\n TIMER: 'timer',\n /** If none of the others apply. */\n OTHER: 'other',\n};\nexports.FaasDocumentOperationValues = {\n /** When a new object is created. */\n INSERT: 'insert',\n /** When an object is modified. */\n EDIT: 'edit',\n /** When an object is deleted. */\n DELETE: 'delete',\n};\nexports.FaasInvokedProviderValues = {\n /** Alibaba Cloud. */\n ALIBABA_CLOUD: 'alibaba_cloud',\n /** Amazon Web Services. */\n AWS: 'aws',\n /** Microsoft Azure. */\n AZURE: 'azure',\n /** Google Cloud Platform. */\n GCP: 'gcp',\n};\nexports.NetTransportValues = {\n /** ip_tcp. */\n IP_TCP: 'ip_tcp',\n /** ip_udp. */\n IP_UDP: 'ip_udp',\n /** Another IP-based protocol. */\n IP: 'ip',\n /** Unix Domain socket. See below. */\n UNIX: 'unix',\n /** Named or anonymous pipe. See note below. */\n PIPE: 'pipe',\n /** In-process communication. */\n INPROC: 'inproc',\n /** Something else (non IP-based). */\n OTHER: 'other',\n};\nexports.NetHostConnectionTypeValues = {\n /** wifi. */\n WIFI: 'wifi',\n /** wired. */\n WIRED: 'wired',\n /** cell. */\n CELL: 'cell',\n /** unavailable. */\n UNAVAILABLE: 'unavailable',\n /** unknown. */\n UNKNOWN: 'unknown',\n};\nexports.NetHostConnectionSubtypeValues = {\n /** GPRS. */\n GPRS: 'gprs',\n /** EDGE. */\n EDGE: 'edge',\n /** UMTS. */\n UMTS: 'umts',\n /** CDMA. */\n CDMA: 'cdma',\n /** EVDO Rel. 0. */\n EVDO_0: 'evdo_0',\n /** EVDO Rev. A. */\n EVDO_A: 'evdo_a',\n /** CDMA2000 1XRTT. */\n CDMA2000_1XRTT: 'cdma2000_1xrtt',\n /** HSDPA. */\n HSDPA: 'hsdpa',\n /** HSUPA. */\n HSUPA: 'hsupa',\n /** HSPA. */\n HSPA: 'hspa',\n /** IDEN. */\n IDEN: 'iden',\n /** EVDO Rev. B. */\n EVDO_B: 'evdo_b',\n /** LTE. */\n LTE: 'lte',\n /** EHRPD. */\n EHRPD: 'ehrpd',\n /** HSPAP. */\n HSPAP: 'hspap',\n /** GSM. */\n GSM: 'gsm',\n /** TD-SCDMA. */\n TD_SCDMA: 'td_scdma',\n /** IWLAN. */\n IWLAN: 'iwlan',\n /** 5G NR (New Radio). */\n NR: 'nr',\n /** 5G NRNSA (New Radio Non-Standalone). */\n NRNSA: 'nrnsa',\n /** LTE CA. */\n LTE_CA: 'lte_ca',\n};\nexports.HttpFlavorValues = {\n /** HTTP 1.0. */\n HTTP_1_0: '1.0',\n /** HTTP 1.1. */\n HTTP_1_1: '1.1',\n /** HTTP 2. */\n HTTP_2_0: '2.0',\n /** SPDY protocol. */\n SPDY: 'SPDY',\n /** QUIC protocol. */\n QUIC: 'QUIC',\n};\nexports.MessagingDestinationKindValues = {\n /** A message sent to a queue. */\n QUEUE: 'queue',\n /** A message sent to a topic. */\n TOPIC: 'topic',\n};\nexports.MessagingOperationValues = {\n /** receive. */\n RECEIVE: 'receive',\n /** process. */\n PROCESS: 'process',\n};\nexports.RpcGrpcStatusCodeValues = {\n /** OK. */\n OK: 0,\n /** CANCELLED. */\n CANCELLED: 1,\n /** UNKNOWN. */\n UNKNOWN: 2,\n /** INVALID_ARGUMENT. */\n INVALID_ARGUMENT: 3,\n /** DEADLINE_EXCEEDED. */\n DEADLINE_EXCEEDED: 4,\n /** NOT_FOUND. */\n NOT_FOUND: 5,\n /** ALREADY_EXISTS. */\n ALREADY_EXISTS: 6,\n /** PERMISSION_DENIED. */\n PERMISSION_DENIED: 7,\n /** RESOURCE_EXHAUSTED. */\n RESOURCE_EXHAUSTED: 8,\n /** FAILED_PRECONDITION. */\n FAILED_PRECONDITION: 9,\n /** ABORTED. */\n ABORTED: 10,\n /** OUT_OF_RANGE. */\n OUT_OF_RANGE: 11,\n /** UNIMPLEMENTED. */\n UNIMPLEMENTED: 12,\n /** INTERNAL. */\n INTERNAL: 13,\n /** UNAVAILABLE. */\n UNAVAILABLE: 14,\n /** DATA_LOSS. */\n DATA_LOSS: 15,\n /** UNAUTHENTICATED. */\n UNAUTHENTICATED: 16,\n};\nexports.MessageTypeValues = {\n /** sent. */\n SENT: 'SENT',\n /** received. */\n RECEIVED: 'RECEIVED',\n};\n//# sourceMappingURL=SemanticAttributes.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n__exportStar(require(\"./SemanticAttributes\"), exports);\n//# sourceMappingURL=index.js.map","'use strict';\n\nfunction posix(path) {\n\treturn path.charAt(0) === '/';\n}\n\nfunction win32(path) {\n\t// https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56\n\tvar splitDeviceRe = /^([a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?([\\\\\\/])?([\\s\\S]*?)$/;\n\tvar result = splitDeviceRe.exec(path);\n\tvar device = result[1] || '';\n\tvar isUnc = Boolean(device && device.charAt(1) !== ':');\n\n\t// UNC paths are always absolute\n\treturn Boolean(result[2] || isUnc);\n}\n\nmodule.exports = process.platform === 'win32' ? win32 : posix;\nmodule.exports.posix = posix;\nmodule.exports.win32 = win32;\n","const assert = require(\"assert\")\nconst path = require(\"path\")\nconst fs = require(\"fs\")\nlet glob = undefined\ntry {\n glob = require(\"glob\")\n} catch (_err) {\n // treat glob as optional.\n}\n\nconst defaultGlobOpts = {\n nosort: true,\n silent: true\n}\n\n// for EMFILE handling\nlet timeout = 0\n\nconst isWindows = (process.platform === \"win32\")\n\nconst defaults = options => {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n options.emfileWait = options.emfileWait || 1000\n if (options.glob === false) {\n options.disableGlob = true\n }\n if (options.disableGlob !== true && glob === undefined) {\n throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')\n }\n options.disableGlob = options.disableGlob || false\n options.glob = options.glob || defaultGlobOpts\n}\n\nconst rimraf = (p, options, cb) => {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.equal(typeof p, 'string', 'rimraf: path should be a string')\n assert.equal(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.equal(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n let busyTries = 0\n let errState = null\n let n = 0\n\n const next = (er) => {\n errState = errState || er\n if (--n === 0)\n cb(errState)\n }\n\n const afterGlob = (er, results) => {\n if (er)\n return cb(er)\n\n n = results.length\n if (n === 0)\n return cb()\n\n results.forEach(p => {\n const CB = (er) => {\n if (er) {\n if ((er.code === \"EBUSY\" || er.code === \"ENOTEMPTY\" || er.code === \"EPERM\") &&\n busyTries < options.maxBusyTries) {\n busyTries ++\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), busyTries * 100)\n }\n\n // this one won't happen if graceful-fs is used.\n if (er.code === \"EMFILE\" && timeout < options.emfileWait) {\n return setTimeout(() => rimraf_(p, options, CB), timeout ++)\n }\n\n // already gone\n if (er.code === \"ENOENT\") er = null\n }\n\n timeout = 0\n next(er)\n }\n rimraf_(p, options, CB)\n })\n }\n\n if (options.disableGlob || !glob.hasMagic(p))\n return afterGlob(null, [p])\n\n options.lstat(p, (er, stat) => {\n if (!er)\n return afterGlob(null, [p])\n\n glob(p, options.glob, afterGlob)\n })\n\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nconst rimraf_ = (p, options, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === \"ENOENT\")\n return cb(null)\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === \"EPERM\" && isWindows)\n fixWinEPERM(p, options, er, cb)\n\n if (st && st.isDirectory())\n return rmdir(p, options, er, cb)\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === \"ENOENT\")\n return cb(null)\n if (er.code === \"EPERM\")\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n if (er.code === \"EISDIR\")\n return rmdir(p, options, er, cb)\n }\n return cb(er)\n })\n })\n}\n\nconst fixWinEPERM = (p, options, er, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2)\n cb(er2.code === \"ENOENT\" ? null : er)\n else\n options.stat(p, (er3, stats) => {\n if (er3)\n cb(er3.code === \"ENOENT\" ? null : er)\n else if (stats.isDirectory())\n rmdir(p, options, er, cb)\n else\n options.unlink(p, cb)\n })\n })\n}\n\nconst fixWinEPERMSync = (p, options, er) => {\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === \"ENOENT\")\n return\n else\n throw er\n }\n\n let stats\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === \"ENOENT\")\n return\n else\n throw er\n }\n\n if (stats.isDirectory())\n rmdirSync(p, options, er)\n else\n options.unlinkSync(p)\n}\n\nconst rmdir = (p, options, originalEr, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === \"ENOTEMPTY\" || er.code === \"EEXIST\" || er.code === \"EPERM\"))\n rmkids(p, options, cb)\n else if (er && er.code === \"ENOTDIR\")\n cb(originalEr)\n else\n cb(er)\n })\n}\n\nconst rmkids = (p, options, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er)\n return cb(er)\n let n = files.length\n if (n === 0)\n return options.rmdir(p, cb)\n let errState\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState)\n return\n if (er)\n return cb(errState = er)\n if (--n === 0)\n options.rmdir(p, cb)\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nconst rimrafSync = (p, options) => {\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.equal(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.equal(typeof options, 'object', 'rimraf: options should be object')\n\n let results\n\n if (options.disableGlob || !glob.hasMagic(p)) {\n results = [p]\n } else {\n try {\n options.lstatSync(p)\n results = [p]\n } catch (er) {\n results = glob.sync(p, options.glob)\n }\n }\n\n if (!results.length)\n return\n\n for (let i = 0; i < results.length; i++) {\n const p = results[i]\n\n let st\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === \"EPERM\" && isWindows)\n fixWinEPERMSync(p, options, er)\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory())\n rmdirSync(p, options, null)\n else\n options.unlinkSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n if (er.code === \"EPERM\")\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n if (er.code !== \"EISDIR\")\n throw er\n\n rmdirSync(p, options, er)\n }\n }\n}\n\nconst rmdirSync = (p, options, originalEr) => {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n if (er.code === \"ENOTDIR\")\n throw originalEr\n if (er.code === \"ENOTEMPTY\" || er.code === \"EEXIST\" || er.code === \"EPERM\")\n rmkidsSync(p, options)\n }\n}\n\nconst rmkidsSync = (p, options) => {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const retries = isWindows ? 100 : 1\n let i = 0\n do {\n let threw = true\n try {\n const ret = options.rmdirSync(p, options)\n threw = false\n return ret\n } finally {\n if (++i < retries && threw)\n continue\n }\n } while (true)\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n",";(function (sax) { // wrapper for non-node envs\n sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\n sax.SAXParser = SAXParser\n sax.SAXStream = SAXStream\n sax.createStream = createStream\n\n // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n // since that's the earliest that a buffer overrun could occur. This way, checks are\n // as rare as required, but as often as necessary to ensure never crossing this bound.\n // Furthermore, buffers are only tested at most once per write(), so passing a very\n // large string into write() might have undesirable effects, but this is manageable by\n // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n // edge case, result in creating at most one complete copy of the string passed in.\n // Set to Infinity to have unlimited buffers.\n sax.MAX_BUFFER_LENGTH = 64 * 1024\n\n var buffers = [\n 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',\n 'procInstName', 'procInstBody', 'entity', 'attribName',\n 'attribValue', 'cdata', 'script'\n ]\n\n sax.EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n ]\n\n function SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt)\n }\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = ''\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.strictEntities = parser.opt.strictEntities\n parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS)\n }\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, 'onready')\n }\n\n if (!Object.create) {\n Object.create = function (o) {\n function F () {}\n F.prototype = o\n var newf = new F()\n return newf\n }\n }\n\n if (!Object.keys) {\n Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n }\n }\n\n function checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n var maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case 'textNode':\n closeText(parser)\n break\n\n case 'cdata':\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n break\n\n case 'script':\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n break\n\n default:\n error(parser, 'Max buffer length exceeded: ' + buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n var m = sax.MAX_BUFFER_LENGTH - maxActual\n parser.bufferCheckPosition = m + parser.position\n }\n\n function clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i++) {\n parser[buffers[i]] = ''\n }\n }\n\n function flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== '') {\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n }\n if (parser.script !== '') {\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n }\n }\n\n SAXParser.prototype = {\n end: function () { end(this) },\n write: write,\n resume: function () { this.error = null; return this },\n close: function () { return this.write(null) },\n flush: function () { flushBuffers(this) }\n }\n\n var Stream\n try {\n Stream = require('stream').Stream\n } catch (ex) {\n Stream = function () {}\n }\n\n var streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== 'error' && ev !== 'end'\n })\n\n function createStream (strict, opt) {\n return new SAXStream(strict, opt)\n }\n\n function SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt)\n }\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n var me = this\n\n this._parser.onend = function () {\n me.emit('end')\n }\n\n this._parser.onerror = function (er) {\n me.emit('error', er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, 'on' + ev, {\n get: function () {\n return me._parser['on' + ev]\n },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n me._parser['on' + ev] = h\n return h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n }\n\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n })\n\n SAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data)\n }\n\n this._parser.write(data.toString())\n this.emit('data', data)\n return true\n }\n\n SAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) {\n this.write(chunk)\n }\n this._parser.end()\n return true\n }\n\n SAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser['on' + ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n }\n\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n var CDATA = '[CDATA['\n var DOCTYPE = 'DOCTYPE'\n var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'\n var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n // http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n // This implementation works on strings, a single character at a time\n // as such, it cannot ever support astral-plane characters (10000-EFFFF)\n // without a significant breaking change to either this parser, or the\n // JavaScript language. Implementation of an emoji-capable xml parser\n // is left as an exercise for the reader.\n var nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/\n\n var nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n var entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/\n var entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/\n\n function isWhitespace (c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t'\n }\n\n function isQuote (c) {\n return c === '\"' || c === '\\''\n }\n\n function isAttribEnd (c) {\n return c === '>' || isWhitespace(c)\n }\n\n function isMatch (regex, c) {\n return regex.test(c)\n }\n\n function notMatch (regex, c) {\n return !isMatch(regex, c)\n }\n\n var S = 0\n sax.STATE = {\n BEGIN: S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++, // leading whitespace\n TEXT: S++, // general stuff\n TEXT_ENTITY: S++, // & and such.\n OPEN_WAKA: S++, // <\n SGML_DECL: S++, // \n SCRIPT: S++, //