@sebspark/openapi-client 4.1.2 → 4.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,1690 +1,11 @@
1
1
  import { retry } from "@sebspark/retry";
2
2
  import { fromAxiosError } from "@sebspark/openapi-core";
3
+ import { getLogger } from "@sebspark/otel";
3
4
  import axios from "axios";
4
5
  import createAuthRefreshInterceptor from "axios-auth-refresh";
5
6
 
6
7
  export * from "@sebspark/retry"
7
8
 
8
- //#region rolldown:runtime
9
- var __create = Object.create;
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __getProtoOf = Object.getPrototypeOf;
14
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
16
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
17
- var __copyProps = (to, from, except, desc) => {
18
- if (from && typeof from === "object" || typeof from === "function") {
19
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
- key = keys[i];
21
- if (!__hasOwnProp.call(to, key) && key !== except) {
22
- __defProp(to, key, {
23
- get: ((k) => from[k]).bind(null, key),
24
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
25
- });
26
- }
27
- }
28
- }
29
- return to;
30
- };
31
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
32
- value: mod,
33
- enumerable: true
34
- }) : target, mod));
35
-
36
- //#endregion
37
- //#region ../../node_modules/@opentelemetry/api/build/esm/platform/node/globalThis.js
38
- var _globalThis;
39
- var init_globalThis = __esmMin((() => {
40
- _globalThis = typeof globalThis === "object" ? globalThis : global;
41
- }));
42
-
43
- //#endregion
44
- //#region ../../node_modules/@opentelemetry/api/build/esm/platform/node/index.js
45
- var init_node = __esmMin((() => {
46
- init_globalThis();
47
- }));
48
-
49
- //#endregion
50
- //#region ../../node_modules/@opentelemetry/api/build/esm/platform/index.js
51
- var init_platform = __esmMin((() => {
52
- init_node();
53
- }));
54
-
55
- //#endregion
56
- //#region ../../node_modules/@opentelemetry/api/build/esm/version.js
57
- var VERSION;
58
- var init_version = __esmMin((() => {
59
- VERSION = "1.9.0";
60
- }));
61
-
62
- //#endregion
63
- //#region ../../node_modules/@opentelemetry/api/build/esm/internal/semver.js
64
- /**
65
- * Create a function to test an API version to see if it is compatible with the provided ownVersion.
66
- *
67
- * The returned function has the following semantics:
68
- * - Exact match is always compatible
69
- * - Major versions must match exactly
70
- * - 1.x package cannot use global 2.x package
71
- * - 2.x package cannot use global 1.x package
72
- * - 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
73
- * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects
74
- * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3
75
- * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor
76
- * - Patch and build tag differences are not considered at this time
77
- *
78
- * @param ownVersion version which should be checked against
79
- */
80
- function _makeCompatibilityCheck(ownVersion) {
81
- var acceptedVersions = new Set([ownVersion]);
82
- var rejectedVersions = /* @__PURE__ */ new Set();
83
- var myVersionMatch = ownVersion.match(re);
84
- if (!myVersionMatch) return function() {
85
- return false;
86
- };
87
- var ownVersionParsed = {
88
- major: +myVersionMatch[1],
89
- minor: +myVersionMatch[2],
90
- patch: +myVersionMatch[3],
91
- prerelease: myVersionMatch[4]
92
- };
93
- if (ownVersionParsed.prerelease != null) return function isExactmatch(globalVersion) {
94
- return globalVersion === ownVersion;
95
- };
96
- function _reject(v) {
97
- rejectedVersions.add(v);
98
- return false;
99
- }
100
- function _accept(v) {
101
- acceptedVersions.add(v);
102
- return true;
103
- }
104
- return function isCompatible$1(globalVersion) {
105
- if (acceptedVersions.has(globalVersion)) return true;
106
- if (rejectedVersions.has(globalVersion)) return false;
107
- var globalVersionMatch = globalVersion.match(re);
108
- if (!globalVersionMatch) return _reject(globalVersion);
109
- var globalVersionParsed = {
110
- major: +globalVersionMatch[1],
111
- minor: +globalVersionMatch[2],
112
- patch: +globalVersionMatch[3],
113
- prerelease: globalVersionMatch[4]
114
- };
115
- if (globalVersionParsed.prerelease != null) return _reject(globalVersion);
116
- if (ownVersionParsed.major !== globalVersionParsed.major) return _reject(globalVersion);
117
- if (ownVersionParsed.major === 0) {
118
- if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) return _accept(globalVersion);
119
- return _reject(globalVersion);
120
- }
121
- if (ownVersionParsed.minor <= globalVersionParsed.minor) return _accept(globalVersion);
122
- return _reject(globalVersion);
123
- };
124
- }
125
- var re, isCompatible;
126
- var init_semver = __esmMin((() => {
127
- init_version();
128
- re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
129
- isCompatible = _makeCompatibilityCheck(VERSION);
130
- }));
131
-
132
- //#endregion
133
- //#region ../../node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
134
- function registerGlobal(type, instance, diag$1, allowOverride) {
135
- var _a;
136
- if (allowOverride === void 0) allowOverride = false;
137
- var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : { version: VERSION };
138
- if (!allowOverride && api[type]) {
139
- var err = /* @__PURE__ */ new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
140
- diag$1.error(err.stack || err.message);
141
- return false;
142
- }
143
- if (api.version !== VERSION) {
144
- var err = /* @__PURE__ */ new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION);
145
- diag$1.error(err.stack || err.message);
146
- return false;
147
- }
148
- api[type] = instance;
149
- diag$1.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + ".");
150
- return true;
151
- }
152
- function getGlobal(type) {
153
- var _a, _b;
154
- var globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
155
- if (!globalVersion || !isCompatible(globalVersion)) return;
156
- return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
157
- }
158
- function unregisterGlobal(type, diag$1) {
159
- diag$1.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
160
- var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
161
- if (api) delete api[type];
162
- }
163
- var major, GLOBAL_OPENTELEMETRY_API_KEY, _global;
164
- var init_global_utils = __esmMin((() => {
165
- init_platform();
166
- init_version();
167
- init_semver();
168
- major = VERSION.split(".")[0];
169
- GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major);
170
- _global = _globalThis;
171
- }));
172
-
173
- //#endregion
174
- //#region ../../node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
175
- function logProxy(funcName, namespace, args) {
176
- var logger = getGlobal("diag");
177
- if (!logger) return;
178
- args.unshift(namespace);
179
- return logger[funcName].apply(logger, __spreadArray$3([], __read$3(args), false));
180
- }
181
- var __read$3, __spreadArray$3, DiagComponentLogger;
182
- var init_ComponentLogger = __esmMin((() => {
183
- init_global_utils();
184
- __read$3 = void 0 && (void 0).__read || function(o, n) {
185
- var m = typeof Symbol === "function" && o[Symbol.iterator];
186
- if (!m) return o;
187
- var i = m.call(o), r, ar = [], e;
188
- try {
189
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
190
- } catch (error) {
191
- e = { error };
192
- } finally {
193
- try {
194
- if (r && !r.done && (m = i["return"])) m.call(i);
195
- } finally {
196
- if (e) throw e.error;
197
- }
198
- }
199
- return ar;
200
- };
201
- __spreadArray$3 = void 0 && (void 0).__spreadArray || function(to, from, pack) {
202
- if (pack || arguments.length === 2) {
203
- for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
204
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
205
- ar[i] = from[i];
206
- }
207
- }
208
- return to.concat(ar || Array.prototype.slice.call(from));
209
- };
210
- DiagComponentLogger = function() {
211
- function DiagComponentLogger$1(props) {
212
- this._namespace = props.namespace || "DiagComponentLogger";
213
- }
214
- DiagComponentLogger$1.prototype.debug = function() {
215
- var args = [];
216
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
217
- return logProxy("debug", this._namespace, args);
218
- };
219
- DiagComponentLogger$1.prototype.error = function() {
220
- var args = [];
221
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
222
- return logProxy("error", this._namespace, args);
223
- };
224
- DiagComponentLogger$1.prototype.info = function() {
225
- var args = [];
226
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
227
- return logProxy("info", this._namespace, args);
228
- };
229
- DiagComponentLogger$1.prototype.warn = function() {
230
- var args = [];
231
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
232
- return logProxy("warn", this._namespace, args);
233
- };
234
- DiagComponentLogger$1.prototype.verbose = function() {
235
- var args = [];
236
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
237
- return logProxy("verbose", this._namespace, args);
238
- };
239
- return DiagComponentLogger$1;
240
- }();
241
- }));
242
-
243
- //#endregion
244
- //#region ../../node_modules/@opentelemetry/api/build/esm/diag/types.js
245
- var DiagLogLevel;
246
- var init_types = __esmMin((() => {
247
- ;
248
- (function(DiagLogLevel$1) {
249
- /** Diagnostic Logging level setting to disable all logging (except and forced logs) */
250
- DiagLogLevel$1[DiagLogLevel$1["NONE"] = 0] = "NONE";
251
- /** Identifies an error scenario */
252
- DiagLogLevel$1[DiagLogLevel$1["ERROR"] = 30] = "ERROR";
253
- /** Identifies a warning scenario */
254
- DiagLogLevel$1[DiagLogLevel$1["WARN"] = 50] = "WARN";
255
- /** General informational log message */
256
- DiagLogLevel$1[DiagLogLevel$1["INFO"] = 60] = "INFO";
257
- /** General debug log message */
258
- DiagLogLevel$1[DiagLogLevel$1["DEBUG"] = 70] = "DEBUG";
259
- /**
260
- * Detailed trace level logging should only be used for development, should only be set
261
- * in a development environment.
262
- */
263
- DiagLogLevel$1[DiagLogLevel$1["VERBOSE"] = 80] = "VERBOSE";
264
- /** Used to set the logging level to include all logging */
265
- DiagLogLevel$1[DiagLogLevel$1["ALL"] = 9999] = "ALL";
266
- })(DiagLogLevel || (DiagLogLevel = {}));
267
- }));
268
-
269
- //#endregion
270
- //#region ../../node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
271
- function createLogLevelDiagLogger(maxLevel, logger) {
272
- if (maxLevel < DiagLogLevel.NONE) maxLevel = DiagLogLevel.NONE;
273
- else if (maxLevel > DiagLogLevel.ALL) maxLevel = DiagLogLevel.ALL;
274
- logger = logger || {};
275
- function _filterFunc(funcName, theLevel) {
276
- var theFunc = logger[funcName];
277
- if (typeof theFunc === "function" && maxLevel >= theLevel) return theFunc.bind(logger);
278
- return function() {};
279
- }
280
- return {
281
- error: _filterFunc("error", DiagLogLevel.ERROR),
282
- warn: _filterFunc("warn", DiagLogLevel.WARN),
283
- info: _filterFunc("info", DiagLogLevel.INFO),
284
- debug: _filterFunc("debug", DiagLogLevel.DEBUG),
285
- verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
286
- };
287
- }
288
- var init_logLevelLogger = __esmMin((() => {
289
- init_types();
290
- }));
291
-
292
- //#endregion
293
- //#region ../../node_modules/@opentelemetry/api/build/esm/api/diag.js
294
- var __read$2, __spreadArray$2, API_NAME$2, DiagAPI;
295
- var init_diag = __esmMin((() => {
296
- init_ComponentLogger();
297
- init_logLevelLogger();
298
- init_types();
299
- init_global_utils();
300
- __read$2 = void 0 && (void 0).__read || function(o, n) {
301
- var m = typeof Symbol === "function" && o[Symbol.iterator];
302
- if (!m) return o;
303
- var i = m.call(o), r, ar = [], e;
304
- try {
305
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
306
- } catch (error) {
307
- e = { error };
308
- } finally {
309
- try {
310
- if (r && !r.done && (m = i["return"])) m.call(i);
311
- } finally {
312
- if (e) throw e.error;
313
- }
314
- }
315
- return ar;
316
- };
317
- __spreadArray$2 = void 0 && (void 0).__spreadArray || function(to, from, pack) {
318
- if (pack || arguments.length === 2) {
319
- for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
320
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
321
- ar[i] = from[i];
322
- }
323
- }
324
- return to.concat(ar || Array.prototype.slice.call(from));
325
- };
326
- API_NAME$2 = "diag";
327
- DiagAPI = function() {
328
- /**
329
- * Private internal constructor
330
- * @private
331
- */
332
- function DiagAPI$1() {
333
- function _logProxy(funcName) {
334
- return function() {
335
- var args = [];
336
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
337
- var logger = getGlobal("diag");
338
- if (!logger) return;
339
- return logger[funcName].apply(logger, __spreadArray$2([], __read$2(args), false));
340
- };
341
- }
342
- var self = this;
343
- var setLogger = function(logger, optionsOrLogLevel) {
344
- var _a, _b, _c;
345
- if (optionsOrLogLevel === void 0) optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
346
- if (logger === self) {
347
- var err = /* @__PURE__ */ new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
348
- self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
349
- return false;
350
- }
351
- if (typeof optionsOrLogLevel === "number") optionsOrLogLevel = { logLevel: optionsOrLogLevel };
352
- var oldLogger = getGlobal("diag");
353
- var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
354
- if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
355
- var stack = (_c = (/* @__PURE__ */ new Error()).stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
356
- oldLogger.warn("Current logger will be overwritten from " + stack);
357
- newLogger.warn("Current logger will overwrite one already registered from " + stack);
358
- }
359
- return registerGlobal("diag", newLogger, self, true);
360
- };
361
- self.setLogger = setLogger;
362
- self.disable = function() {
363
- unregisterGlobal(API_NAME$2, self);
364
- };
365
- self.createComponentLogger = function(options) {
366
- return new DiagComponentLogger(options);
367
- };
368
- self.verbose = _logProxy("verbose");
369
- self.debug = _logProxy("debug");
370
- self.info = _logProxy("info");
371
- self.warn = _logProxy("warn");
372
- self.error = _logProxy("error");
373
- }
374
- /** Get the singleton instance of the DiagAPI API */
375
- DiagAPI$1.instance = function() {
376
- if (!this._instance) this._instance = new DiagAPI$1();
377
- return this._instance;
378
- };
379
- return DiagAPI$1;
380
- }();
381
- }));
382
-
383
- //#endregion
384
- //#region ../../node_modules/@opentelemetry/api/build/esm/context/context.js
385
- /** Get a key to uniquely identify a context value */
386
- function createContextKey(description) {
387
- return Symbol.for(description);
388
- }
389
- var BaseContext, ROOT_CONTEXT;
390
- var init_context$1 = __esmMin((() => {
391
- BaseContext = function() {
392
- /**
393
- * Construct a new context which inherits values from an optional parent context.
394
- *
395
- * @param parentContext a context from which to inherit values
396
- */
397
- function BaseContext$1(parentContext) {
398
- var self = this;
399
- self._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
400
- self.getValue = function(key) {
401
- return self._currentContext.get(key);
402
- };
403
- self.setValue = function(key, value) {
404
- var context$1 = new BaseContext$1(self._currentContext);
405
- context$1._currentContext.set(key, value);
406
- return context$1;
407
- };
408
- self.deleteValue = function(key) {
409
- var context$1 = new BaseContext$1(self._currentContext);
410
- context$1._currentContext.delete(key);
411
- return context$1;
412
- };
413
- }
414
- return BaseContext$1;
415
- }();
416
- ROOT_CONTEXT = new BaseContext();
417
- }));
418
-
419
- //#endregion
420
- //#region ../../node_modules/@opentelemetry/api/build/esm/diag/consoleLogger.js
421
- var consoleMap, DiagConsoleLogger;
422
- var init_consoleLogger = __esmMin((() => {
423
- consoleMap = [
424
- {
425
- n: "error",
426
- c: "error"
427
- },
428
- {
429
- n: "warn",
430
- c: "warn"
431
- },
432
- {
433
- n: "info",
434
- c: "info"
435
- },
436
- {
437
- n: "debug",
438
- c: "debug"
439
- },
440
- {
441
- n: "verbose",
442
- c: "trace"
443
- }
444
- ];
445
- DiagConsoleLogger = function() {
446
- function DiagConsoleLogger$1() {
447
- function _consoleFunc(funcName) {
448
- return function() {
449
- var args = [];
450
- for (var _i = 0; _i < arguments.length; _i++) args[_i] = arguments[_i];
451
- if (console) {
452
- var theFunc = console[funcName];
453
- if (typeof theFunc !== "function") theFunc = console.log;
454
- if (typeof theFunc === "function") return theFunc.apply(console, args);
455
- }
456
- };
457
- }
458
- for (var i = 0; i < consoleMap.length; i++) this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);
459
- }
460
- return DiagConsoleLogger$1;
461
- }();
462
- }));
463
-
464
- //#endregion
465
- //#region ../../node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
466
- var __read$1, __spreadArray$1, NoopContextManager;
467
- var init_NoopContextManager = __esmMin((() => {
468
- init_context$1();
469
- __read$1 = void 0 && (void 0).__read || function(o, n) {
470
- var m = typeof Symbol === "function" && o[Symbol.iterator];
471
- if (!m) return o;
472
- var i = m.call(o), r, ar = [], e;
473
- try {
474
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
475
- } catch (error) {
476
- e = { error };
477
- } finally {
478
- try {
479
- if (r && !r.done && (m = i["return"])) m.call(i);
480
- } finally {
481
- if (e) throw e.error;
482
- }
483
- }
484
- return ar;
485
- };
486
- __spreadArray$1 = void 0 && (void 0).__spreadArray || function(to, from, pack) {
487
- if (pack || arguments.length === 2) {
488
- for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
489
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
490
- ar[i] = from[i];
491
- }
492
- }
493
- return to.concat(ar || Array.prototype.slice.call(from));
494
- };
495
- NoopContextManager = function() {
496
- function NoopContextManager$1() {}
497
- NoopContextManager$1.prototype.active = function() {
498
- return ROOT_CONTEXT;
499
- };
500
- NoopContextManager$1.prototype.with = function(_context, fn, thisArg) {
501
- var args = [];
502
- for (var _i = 3; _i < arguments.length; _i++) args[_i - 3] = arguments[_i];
503
- return fn.call.apply(fn, __spreadArray$1([thisArg], __read$1(args), false));
504
- };
505
- NoopContextManager$1.prototype.bind = function(_context, target) {
506
- return target;
507
- };
508
- NoopContextManager$1.prototype.enable = function() {
509
- return this;
510
- };
511
- NoopContextManager$1.prototype.disable = function() {
512
- return this;
513
- };
514
- return NoopContextManager$1;
515
- }();
516
- }));
517
-
518
- //#endregion
519
- //#region ../../node_modules/@opentelemetry/api/build/esm/api/context.js
520
- var __read, __spreadArray, API_NAME$1, NOOP_CONTEXT_MANAGER, ContextAPI;
521
- var init_context = __esmMin((() => {
522
- init_NoopContextManager();
523
- init_global_utils();
524
- init_diag();
525
- __read = void 0 && (void 0).__read || function(o, n) {
526
- var m = typeof Symbol === "function" && o[Symbol.iterator];
527
- if (!m) return o;
528
- var i = m.call(o), r, ar = [], e;
529
- try {
530
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
531
- } catch (error) {
532
- e = { error };
533
- } finally {
534
- try {
535
- if (r && !r.done && (m = i["return"])) m.call(i);
536
- } finally {
537
- if (e) throw e.error;
538
- }
539
- }
540
- return ar;
541
- };
542
- __spreadArray = void 0 && (void 0).__spreadArray || function(to, from, pack) {
543
- if (pack || arguments.length === 2) {
544
- for (var i = 0, l = from.length, ar; i < l; i++) if (ar || !(i in from)) {
545
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
546
- ar[i] = from[i];
547
- }
548
- }
549
- return to.concat(ar || Array.prototype.slice.call(from));
550
- };
551
- API_NAME$1 = "context";
552
- NOOP_CONTEXT_MANAGER = new NoopContextManager();
553
- ContextAPI = function() {
554
- /** Empty private constructor prevents end users from constructing a new instance of the API */
555
- function ContextAPI$1() {}
556
- /** Get the singleton instance of the Context API */
557
- ContextAPI$1.getInstance = function() {
558
- if (!this._instance) this._instance = new ContextAPI$1();
559
- return this._instance;
560
- };
561
- /**
562
- * Set the current context manager.
563
- *
564
- * @returns true if the context manager was successfully registered, else false
565
- */
566
- ContextAPI$1.prototype.setGlobalContextManager = function(contextManager) {
567
- return registerGlobal(API_NAME$1, contextManager, DiagAPI.instance());
568
- };
569
- /**
570
- * Get the currently active context
571
- */
572
- ContextAPI$1.prototype.active = function() {
573
- return this._getContextManager().active();
574
- };
575
- /**
576
- * Execute a function with an active context
577
- *
578
- * @param context context to be active during function execution
579
- * @param fn function to execute in a context
580
- * @param thisArg optional receiver to be used for calling fn
581
- * @param args optional arguments forwarded to fn
582
- */
583
- ContextAPI$1.prototype.with = function(context$1, fn, thisArg) {
584
- var _a;
585
- var args = [];
586
- for (var _i = 3; _i < arguments.length; _i++) args[_i - 3] = arguments[_i];
587
- return (_a = this._getContextManager()).with.apply(_a, __spreadArray([
588
- context$1,
589
- fn,
590
- thisArg
591
- ], __read(args), false));
592
- };
593
- /**
594
- * Bind a context to a target function or event emitter
595
- *
596
- * @param context context to bind to the event emitter or function. Defaults to the currently active context
597
- * @param target function or event emitter to bind
598
- */
599
- ContextAPI$1.prototype.bind = function(context$1, target) {
600
- return this._getContextManager().bind(context$1, target);
601
- };
602
- ContextAPI$1.prototype._getContextManager = function() {
603
- return getGlobal(API_NAME$1) || NOOP_CONTEXT_MANAGER;
604
- };
605
- /** Disable and remove the global context manager */
606
- ContextAPI$1.prototype.disable = function() {
607
- this._getContextManager().disable();
608
- unregisterGlobal(API_NAME$1, DiagAPI.instance());
609
- };
610
- return ContextAPI$1;
611
- }();
612
- }));
613
-
614
- //#endregion
615
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
616
- var TraceFlags;
617
- var init_trace_flags = __esmMin((() => {
618
- ;
619
- (function(TraceFlags$1) {
620
- /** Represents no flag set. */
621
- TraceFlags$1[TraceFlags$1["NONE"] = 0] = "NONE";
622
- /** Bit to represent whether trace is sampled in trace flags. */
623
- TraceFlags$1[TraceFlags$1["SAMPLED"] = 1] = "SAMPLED";
624
- })(TraceFlags || (TraceFlags = {}));
625
- }));
626
-
627
- //#endregion
628
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
629
- var INVALID_SPANID, INVALID_TRACEID, INVALID_SPAN_CONTEXT;
630
- var init_invalid_span_constants = __esmMin((() => {
631
- init_trace_flags();
632
- INVALID_SPANID = "0000000000000000";
633
- INVALID_TRACEID = "00000000000000000000000000000000";
634
- INVALID_SPAN_CONTEXT = {
635
- traceId: INVALID_TRACEID,
636
- spanId: INVALID_SPANID,
637
- traceFlags: TraceFlags.NONE
638
- };
639
- }));
640
-
641
- //#endregion
642
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
643
- var NonRecordingSpan;
644
- var init_NonRecordingSpan = __esmMin((() => {
645
- init_invalid_span_constants();
646
- NonRecordingSpan = function() {
647
- function NonRecordingSpan$1(_spanContext) {
648
- if (_spanContext === void 0) _spanContext = INVALID_SPAN_CONTEXT;
649
- this._spanContext = _spanContext;
650
- }
651
- NonRecordingSpan$1.prototype.spanContext = function() {
652
- return this._spanContext;
653
- };
654
- NonRecordingSpan$1.prototype.setAttribute = function(_key, _value) {
655
- return this;
656
- };
657
- NonRecordingSpan$1.prototype.setAttributes = function(_attributes) {
658
- return this;
659
- };
660
- NonRecordingSpan$1.prototype.addEvent = function(_name, _attributes) {
661
- return this;
662
- };
663
- NonRecordingSpan$1.prototype.addLink = function(_link) {
664
- return this;
665
- };
666
- NonRecordingSpan$1.prototype.addLinks = function(_links) {
667
- return this;
668
- };
669
- NonRecordingSpan$1.prototype.setStatus = function(_status) {
670
- return this;
671
- };
672
- NonRecordingSpan$1.prototype.updateName = function(_name) {
673
- return this;
674
- };
675
- NonRecordingSpan$1.prototype.end = function(_endTime) {};
676
- NonRecordingSpan$1.prototype.isRecording = function() {
677
- return false;
678
- };
679
- NonRecordingSpan$1.prototype.recordException = function(_exception, _time) {};
680
- return NonRecordingSpan$1;
681
- }();
682
- }));
683
-
684
- //#endregion
685
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
686
- /**
687
- * Return the span if one exists
688
- *
689
- * @param context context to get span from
690
- */
691
- function getSpan(context$1) {
692
- return context$1.getValue(SPAN_KEY) || void 0;
693
- }
694
- /**
695
- * Gets the span from the current context, if one exists.
696
- */
697
- function getActiveSpan() {
698
- return getSpan(ContextAPI.getInstance().active());
699
- }
700
- /**
701
- * Set the span on a context
702
- *
703
- * @param context context to use as parent
704
- * @param span span to set active
705
- */
706
- function setSpan(context$1, span) {
707
- return context$1.setValue(SPAN_KEY, span);
708
- }
709
- /**
710
- * Remove current span stored in the context
711
- *
712
- * @param context context to delete span from
713
- */
714
- function deleteSpan(context$1) {
715
- return context$1.deleteValue(SPAN_KEY);
716
- }
717
- /**
718
- * Wrap span context in a NoopSpan and set as span in a new
719
- * context
720
- *
721
- * @param context context to set active span on
722
- * @param spanContext span context to be wrapped
723
- */
724
- function setSpanContext(context$1, spanContext) {
725
- return setSpan(context$1, new NonRecordingSpan(spanContext));
726
- }
727
- /**
728
- * Get the span context of the span if it exists.
729
- *
730
- * @param context context to get values from
731
- */
732
- function getSpanContext(context$1) {
733
- var _a;
734
- return (_a = getSpan(context$1)) === null || _a === void 0 ? void 0 : _a.spanContext();
735
- }
736
- var SPAN_KEY;
737
- var init_context_utils = __esmMin((() => {
738
- init_context$1();
739
- init_NonRecordingSpan();
740
- init_context();
741
- SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
742
- }));
743
-
744
- //#endregion
745
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
746
- function isValidTraceId(traceId) {
747
- return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
748
- }
749
- function isValidSpanId(spanId) {
750
- return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
751
- }
752
- /**
753
- * Returns true if this {@link SpanContext} is valid.
754
- * @return true if this {@link SpanContext} is valid.
755
- */
756
- function isSpanContextValid(spanContext) {
757
- return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
758
- }
759
- /**
760
- * Wrap the given {@link SpanContext} in a new non-recording {@link Span}
761
- *
762
- * @param spanContext span context to be wrapped
763
- * @returns a new non-recording {@link Span} with the provided context
764
- */
765
- function wrapSpanContext(spanContext) {
766
- return new NonRecordingSpan(spanContext);
767
- }
768
- var VALID_TRACEID_REGEX, VALID_SPANID_REGEX;
769
- var init_spancontext_utils = __esmMin((() => {
770
- init_invalid_span_constants();
771
- init_NonRecordingSpan();
772
- VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
773
- VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
774
- }));
775
-
776
- //#endregion
777
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
778
- function isSpanContext(spanContext) {
779
- return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
780
- }
781
- var contextApi, NoopTracer;
782
- var init_NoopTracer = __esmMin((() => {
783
- init_context();
784
- init_context_utils();
785
- init_NonRecordingSpan();
786
- init_spancontext_utils();
787
- contextApi = ContextAPI.getInstance();
788
- NoopTracer = function() {
789
- function NoopTracer$1() {}
790
- NoopTracer$1.prototype.startSpan = function(name, options, context$1) {
791
- if (context$1 === void 0) context$1 = contextApi.active();
792
- if (Boolean(options === null || options === void 0 ? void 0 : options.root)) return new NonRecordingSpan();
793
- var parentFromContext = context$1 && getSpanContext(context$1);
794
- if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) return new NonRecordingSpan(parentFromContext);
795
- else return new NonRecordingSpan();
796
- };
797
- NoopTracer$1.prototype.startActiveSpan = function(name, arg2, arg3, arg4) {
798
- var opts;
799
- var ctx;
800
- var fn;
801
- if (arguments.length < 2) return;
802
- else if (arguments.length === 2) fn = arg2;
803
- else if (arguments.length === 3) {
804
- opts = arg2;
805
- fn = arg3;
806
- } else {
807
- opts = arg2;
808
- ctx = arg3;
809
- fn = arg4;
810
- }
811
- var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
812
- var span = this.startSpan(name, opts, parentContext);
813
- var contextWithSpanSet = setSpan(parentContext, span);
814
- return contextApi.with(contextWithSpanSet, fn, void 0, span);
815
- };
816
- return NoopTracer$1;
817
- }();
818
- }));
819
-
820
- //#endregion
821
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
822
- var NOOP_TRACER, ProxyTracer;
823
- var init_ProxyTracer = __esmMin((() => {
824
- init_NoopTracer();
825
- NOOP_TRACER = new NoopTracer();
826
- ProxyTracer = function() {
827
- function ProxyTracer$1(_provider, name, version, options) {
828
- this._provider = _provider;
829
- this.name = name;
830
- this.version = version;
831
- this.options = options;
832
- }
833
- ProxyTracer$1.prototype.startSpan = function(name, options, context$1) {
834
- return this._getTracer().startSpan(name, options, context$1);
835
- };
836
- ProxyTracer$1.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
837
- var tracer = this._getTracer();
838
- return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
839
- };
840
- /**
841
- * Try to get a tracer from the proxy tracer provider.
842
- * If the proxy tracer provider has no delegate, return a noop tracer.
843
- */
844
- ProxyTracer$1.prototype._getTracer = function() {
845
- if (this._delegate) return this._delegate;
846
- var tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
847
- if (!tracer) return NOOP_TRACER;
848
- this._delegate = tracer;
849
- return this._delegate;
850
- };
851
- return ProxyTracer$1;
852
- }();
853
- }));
854
-
855
- //#endregion
856
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
857
- var NoopTracerProvider;
858
- var init_NoopTracerProvider = __esmMin((() => {
859
- init_NoopTracer();
860
- NoopTracerProvider = function() {
861
- function NoopTracerProvider$1() {}
862
- NoopTracerProvider$1.prototype.getTracer = function(_name, _version, _options) {
863
- return new NoopTracer();
864
- };
865
- return NoopTracerProvider$1;
866
- }();
867
- }));
868
-
869
- //#endregion
870
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
871
- var NOOP_TRACER_PROVIDER, ProxyTracerProvider;
872
- var init_ProxyTracerProvider = __esmMin((() => {
873
- init_ProxyTracer();
874
- init_NoopTracerProvider();
875
- NOOP_TRACER_PROVIDER = new NoopTracerProvider();
876
- ProxyTracerProvider = function() {
877
- function ProxyTracerProvider$1() {}
878
- /**
879
- * Get a {@link ProxyTracer}
880
- */
881
- ProxyTracerProvider$1.prototype.getTracer = function(name, version, options) {
882
- var _a;
883
- return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options);
884
- };
885
- ProxyTracerProvider$1.prototype.getDelegate = function() {
886
- var _a;
887
- return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
888
- };
889
- /**
890
- * Set the delegate tracer provider
891
- */
892
- ProxyTracerProvider$1.prototype.setDelegate = function(delegate) {
893
- this._delegate = delegate;
894
- };
895
- ProxyTracerProvider$1.prototype.getDelegateTracer = function(name, version, options) {
896
- var _a;
897
- return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
898
- };
899
- return ProxyTracerProvider$1;
900
- }();
901
- }));
902
-
903
- //#endregion
904
- //#region ../../node_modules/@opentelemetry/api/build/esm/context-api.js
905
- var context;
906
- var init_context_api = __esmMin((() => {
907
- init_context();
908
- context = ContextAPI.getInstance();
909
- }));
910
-
911
- //#endregion
912
- //#region ../../node_modules/@opentelemetry/api/build/esm/diag-api.js
913
- var diag;
914
- var init_diag_api = __esmMin((() => {
915
- init_diag();
916
- diag = DiagAPI.instance();
917
- }));
918
-
919
- //#endregion
920
- //#region ../../node_modules/@opentelemetry/api/build/esm/api/trace.js
921
- var API_NAME, TraceAPI;
922
- var init_trace$1 = __esmMin((() => {
923
- init_global_utils();
924
- init_ProxyTracerProvider();
925
- init_spancontext_utils();
926
- init_context_utils();
927
- init_diag();
928
- API_NAME = "trace";
929
- TraceAPI = function() {
930
- /** Empty private constructor prevents end users from constructing a new instance of the API */
931
- function TraceAPI$1() {
932
- this._proxyTracerProvider = new ProxyTracerProvider();
933
- this.wrapSpanContext = wrapSpanContext;
934
- this.isSpanContextValid = isSpanContextValid;
935
- this.deleteSpan = deleteSpan;
936
- this.getSpan = getSpan;
937
- this.getActiveSpan = getActiveSpan;
938
- this.getSpanContext = getSpanContext;
939
- this.setSpan = setSpan;
940
- this.setSpanContext = setSpanContext;
941
- }
942
- /** Get the singleton instance of the Trace API */
943
- TraceAPI$1.getInstance = function() {
944
- if (!this._instance) this._instance = new TraceAPI$1();
945
- return this._instance;
946
- };
947
- /**
948
- * Set the current global tracer.
949
- *
950
- * @returns true if the tracer provider was successfully registered, else false
951
- */
952
- TraceAPI$1.prototype.setGlobalTracerProvider = function(provider) {
953
- var success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());
954
- if (success) this._proxyTracerProvider.setDelegate(provider);
955
- return success;
956
- };
957
- /**
958
- * Returns the global tracer provider.
959
- */
960
- TraceAPI$1.prototype.getTracerProvider = function() {
961
- return getGlobal(API_NAME) || this._proxyTracerProvider;
962
- };
963
- /**
964
- * Returns a tracer from the global tracer provider.
965
- */
966
- TraceAPI$1.prototype.getTracer = function(name, version) {
967
- return this.getTracerProvider().getTracer(name, version);
968
- };
969
- /** Remove the global tracer provider */
970
- TraceAPI$1.prototype.disable = function() {
971
- unregisterGlobal(API_NAME, DiagAPI.instance());
972
- this._proxyTracerProvider = new ProxyTracerProvider();
973
- };
974
- return TraceAPI$1;
975
- }();
976
- }));
977
-
978
- //#endregion
979
- //#region ../../node_modules/@opentelemetry/api/build/esm/trace-api.js
980
- var trace;
981
- var init_trace_api = __esmMin((() => {
982
- init_trace$1();
983
- trace = TraceAPI.getInstance();
984
- }));
985
-
986
- //#endregion
987
- //#region ../../node_modules/@opentelemetry/api/build/esm/index.js
988
- var init_esm$1 = __esmMin((() => {
989
- init_consoleLogger();
990
- init_types();
991
- init_context_api();
992
- init_diag_api();
993
- init_trace_api();
994
- }));
995
-
996
- //#endregion
997
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/types/LogRecord.js
998
- var require_LogRecord = /* @__PURE__ */ __commonJSMin(((exports) => {
999
- Object.defineProperty(exports, "__esModule", { value: true });
1000
- exports.SeverityNumber = void 0;
1001
- (function(SeverityNumber$1) {
1002
- SeverityNumber$1[SeverityNumber$1["UNSPECIFIED"] = 0] = "UNSPECIFIED";
1003
- SeverityNumber$1[SeverityNumber$1["TRACE"] = 1] = "TRACE";
1004
- SeverityNumber$1[SeverityNumber$1["TRACE2"] = 2] = "TRACE2";
1005
- SeverityNumber$1[SeverityNumber$1["TRACE3"] = 3] = "TRACE3";
1006
- SeverityNumber$1[SeverityNumber$1["TRACE4"] = 4] = "TRACE4";
1007
- SeverityNumber$1[SeverityNumber$1["DEBUG"] = 5] = "DEBUG";
1008
- SeverityNumber$1[SeverityNumber$1["DEBUG2"] = 6] = "DEBUG2";
1009
- SeverityNumber$1[SeverityNumber$1["DEBUG3"] = 7] = "DEBUG3";
1010
- SeverityNumber$1[SeverityNumber$1["DEBUG4"] = 8] = "DEBUG4";
1011
- SeverityNumber$1[SeverityNumber$1["INFO"] = 9] = "INFO";
1012
- SeverityNumber$1[SeverityNumber$1["INFO2"] = 10] = "INFO2";
1013
- SeverityNumber$1[SeverityNumber$1["INFO3"] = 11] = "INFO3";
1014
- SeverityNumber$1[SeverityNumber$1["INFO4"] = 12] = "INFO4";
1015
- SeverityNumber$1[SeverityNumber$1["WARN"] = 13] = "WARN";
1016
- SeverityNumber$1[SeverityNumber$1["WARN2"] = 14] = "WARN2";
1017
- SeverityNumber$1[SeverityNumber$1["WARN3"] = 15] = "WARN3";
1018
- SeverityNumber$1[SeverityNumber$1["WARN4"] = 16] = "WARN4";
1019
- SeverityNumber$1[SeverityNumber$1["ERROR"] = 17] = "ERROR";
1020
- SeverityNumber$1[SeverityNumber$1["ERROR2"] = 18] = "ERROR2";
1021
- SeverityNumber$1[SeverityNumber$1["ERROR3"] = 19] = "ERROR3";
1022
- SeverityNumber$1[SeverityNumber$1["ERROR4"] = 20] = "ERROR4";
1023
- SeverityNumber$1[SeverityNumber$1["FATAL"] = 21] = "FATAL";
1024
- SeverityNumber$1[SeverityNumber$1["FATAL2"] = 22] = "FATAL2";
1025
- SeverityNumber$1[SeverityNumber$1["FATAL3"] = 23] = "FATAL3";
1026
- SeverityNumber$1[SeverityNumber$1["FATAL4"] = 24] = "FATAL4";
1027
- })(exports.SeverityNumber || (exports.SeverityNumber = {}));
1028
- }));
1029
-
1030
- //#endregion
1031
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/NoopLogger.js
1032
- var require_NoopLogger = /* @__PURE__ */ __commonJSMin(((exports) => {
1033
- Object.defineProperty(exports, "__esModule", { value: true });
1034
- exports.NOOP_LOGGER = exports.NoopLogger = void 0;
1035
- var NoopLogger = class {
1036
- emit(_logRecord) {}
1037
- };
1038
- exports.NoopLogger = NoopLogger;
1039
- exports.NOOP_LOGGER = new NoopLogger();
1040
- }));
1041
-
1042
- //#endregion
1043
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/NoopLoggerProvider.js
1044
- var require_NoopLoggerProvider = /* @__PURE__ */ __commonJSMin(((exports) => {
1045
- Object.defineProperty(exports, "__esModule", { value: true });
1046
- exports.NOOP_LOGGER_PROVIDER = exports.NoopLoggerProvider = void 0;
1047
- const NoopLogger_1 = require_NoopLogger();
1048
- var NoopLoggerProvider = class {
1049
- getLogger(_name, _version, _options) {
1050
- return new NoopLogger_1.NoopLogger();
1051
- }
1052
- };
1053
- exports.NoopLoggerProvider = NoopLoggerProvider;
1054
- exports.NOOP_LOGGER_PROVIDER = new NoopLoggerProvider();
1055
- }));
1056
-
1057
- //#endregion
1058
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/ProxyLogger.js
1059
- var require_ProxyLogger = /* @__PURE__ */ __commonJSMin(((exports) => {
1060
- Object.defineProperty(exports, "__esModule", { value: true });
1061
- exports.ProxyLogger = void 0;
1062
- const NoopLogger_1 = require_NoopLogger();
1063
- var ProxyLogger = class {
1064
- constructor(provider, name, version, options) {
1065
- this._provider = provider;
1066
- this.name = name;
1067
- this.version = version;
1068
- this.options = options;
1069
- }
1070
- /**
1071
- * Emit a log record. This method should only be used by log appenders.
1072
- *
1073
- * @param logRecord
1074
- */
1075
- emit(logRecord) {
1076
- this._getLogger().emit(logRecord);
1077
- }
1078
- /**
1079
- * Try to get a logger from the proxy logger provider.
1080
- * If the proxy logger provider has no delegate, return a noop logger.
1081
- */
1082
- _getLogger() {
1083
- if (this._delegate) return this._delegate;
1084
- const logger = this._provider._getDelegateLogger(this.name, this.version, this.options);
1085
- if (!logger) return NoopLogger_1.NOOP_LOGGER;
1086
- this._delegate = logger;
1087
- return this._delegate;
1088
- }
1089
- };
1090
- exports.ProxyLogger = ProxyLogger;
1091
- }));
1092
-
1093
- //#endregion
1094
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/ProxyLoggerProvider.js
1095
- var require_ProxyLoggerProvider = /* @__PURE__ */ __commonJSMin(((exports) => {
1096
- Object.defineProperty(exports, "__esModule", { value: true });
1097
- exports.ProxyLoggerProvider = void 0;
1098
- const NoopLoggerProvider_1 = require_NoopLoggerProvider();
1099
- const ProxyLogger_1 = require_ProxyLogger();
1100
- var ProxyLoggerProvider = class {
1101
- getLogger(name, version, options) {
1102
- var _a;
1103
- return (_a = this._getDelegateLogger(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyLogger_1.ProxyLogger(this, name, version, options);
1104
- }
1105
- /**
1106
- * Get the delegate logger provider.
1107
- * Used by tests only.
1108
- * @internal
1109
- */
1110
- _getDelegate() {
1111
- var _a;
1112
- return (_a = this._delegate) !== null && _a !== void 0 ? _a : NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER;
1113
- }
1114
- /**
1115
- * Set the delegate logger provider
1116
- * @internal
1117
- */
1118
- _setDelegate(delegate) {
1119
- this._delegate = delegate;
1120
- }
1121
- /**
1122
- * @internal
1123
- */
1124
- _getDelegateLogger(name, version, options) {
1125
- var _a;
1126
- return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getLogger(name, version, options);
1127
- }
1128
- };
1129
- exports.ProxyLoggerProvider = ProxyLoggerProvider;
1130
- }));
1131
-
1132
- //#endregion
1133
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/internal/global-utils.js
1134
- var require_global_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
1135
- Object.defineProperty(exports, "__esModule", { value: true });
1136
- exports.API_BACKWARDS_COMPATIBILITY_VERSION = exports.makeGetter = exports._global = exports.GLOBAL_LOGS_API_KEY = void 0;
1137
- exports.GLOBAL_LOGS_API_KEY = Symbol.for("io.opentelemetry.js.api.logs");
1138
- exports._global = globalThis;
1139
- /**
1140
- * Make a function which accepts a version integer and returns the instance of an API if the version
1141
- * is compatible, or a fallback version (usually NOOP) if it is not.
1142
- *
1143
- * @param requiredVersion Backwards compatibility version which is required to return the instance
1144
- * @param instance Instance which should be returned if the required version is compatible
1145
- * @param fallback Fallback instance, usually NOOP, which will be returned if the required version is not compatible
1146
- */
1147
- function makeGetter(requiredVersion, instance, fallback) {
1148
- return (version) => version === requiredVersion ? instance : fallback;
1149
- }
1150
- exports.makeGetter = makeGetter;
1151
- /**
1152
- * A number which should be incremented each time a backwards incompatible
1153
- * change is made to the API. This number is used when an API package
1154
- * attempts to access the global API to ensure it is getting a compatible
1155
- * version. If the global API is not compatible with the API package
1156
- * attempting to get it, a NOOP API implementation will be returned.
1157
- */
1158
- exports.API_BACKWARDS_COMPATIBILITY_VERSION = 1;
1159
- }));
1160
-
1161
- //#endregion
1162
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/api/logs.js
1163
- var require_logs = /* @__PURE__ */ __commonJSMin(((exports) => {
1164
- Object.defineProperty(exports, "__esModule", { value: true });
1165
- exports.LogsAPI = void 0;
1166
- const global_utils_1 = require_global_utils();
1167
- const NoopLoggerProvider_1 = require_NoopLoggerProvider();
1168
- const ProxyLoggerProvider_1 = require_ProxyLoggerProvider();
1169
- var LogsAPI = class LogsAPI {
1170
- constructor() {
1171
- this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider();
1172
- }
1173
- static getInstance() {
1174
- if (!this._instance) this._instance = new LogsAPI();
1175
- return this._instance;
1176
- }
1177
- setGlobalLoggerProvider(provider) {
1178
- if (global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY]) return this.getLoggerProvider();
1179
- global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY] = (0, global_utils_1.makeGetter)(global_utils_1.API_BACKWARDS_COMPATIBILITY_VERSION, provider, NoopLoggerProvider_1.NOOP_LOGGER_PROVIDER);
1180
- this._proxyLoggerProvider._setDelegate(provider);
1181
- return provider;
1182
- }
1183
- /**
1184
- * Returns the global logger provider.
1185
- *
1186
- * @returns LoggerProvider
1187
- */
1188
- getLoggerProvider() {
1189
- var _a, _b;
1190
- return (_b = (_a = global_utils_1._global[global_utils_1.GLOBAL_LOGS_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 : this._proxyLoggerProvider;
1191
- }
1192
- /**
1193
- * Returns a logger from the global logger provider.
1194
- *
1195
- * @returns Logger
1196
- */
1197
- getLogger(name, version, options) {
1198
- return this.getLoggerProvider().getLogger(name, version, options);
1199
- }
1200
- /** Remove the global logger provider */
1201
- disable() {
1202
- delete global_utils_1._global[global_utils_1.GLOBAL_LOGS_API_KEY];
1203
- this._proxyLoggerProvider = new ProxyLoggerProvider_1.ProxyLoggerProvider();
1204
- }
1205
- };
1206
- exports.LogsAPI = LogsAPI;
1207
- }));
1208
-
1209
- //#endregion
1210
- //#region ../../node_modules/@opentelemetry/api-logs/build/src/index.js
1211
- var require_src = /* @__PURE__ */ __commonJSMin(((exports) => {
1212
- Object.defineProperty(exports, "__esModule", { value: true });
1213
- exports.logs = exports.ProxyLoggerProvider = exports.NoopLogger = exports.NOOP_LOGGER = exports.SeverityNumber = void 0;
1214
- var LogRecord_1 = require_LogRecord();
1215
- Object.defineProperty(exports, "SeverityNumber", {
1216
- enumerable: true,
1217
- get: function() {
1218
- return LogRecord_1.SeverityNumber;
1219
- }
1220
- });
1221
- var NoopLogger_1 = require_NoopLogger();
1222
- Object.defineProperty(exports, "NOOP_LOGGER", {
1223
- enumerable: true,
1224
- get: function() {
1225
- return NoopLogger_1.NOOP_LOGGER;
1226
- }
1227
- });
1228
- Object.defineProperty(exports, "NoopLogger", {
1229
- enumerable: true,
1230
- get: function() {
1231
- return NoopLogger_1.NoopLogger;
1232
- }
1233
- });
1234
- var ProxyLoggerProvider_1 = require_ProxyLoggerProvider();
1235
- Object.defineProperty(exports, "ProxyLoggerProvider", {
1236
- enumerable: true,
1237
- get: function() {
1238
- return ProxyLoggerProvider_1.ProxyLoggerProvider;
1239
- }
1240
- });
1241
- const logs_1 = require_logs();
1242
- exports.logs = logs_1.LogsAPI.getInstance();
1243
- }));
1244
-
1245
- //#endregion
1246
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/trace/SemanticAttributes.js
1247
- var init_SemanticAttributes = __esmMin((() => {}));
1248
-
1249
- //#endregion
1250
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/trace/index.js
1251
- var init_trace = __esmMin((() => {
1252
- init_SemanticAttributes();
1253
- }));
1254
-
1255
- //#endregion
1256
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/resource/SemanticResourceAttributes.js
1257
- var init_SemanticResourceAttributes = __esmMin((() => {}));
1258
-
1259
- //#endregion
1260
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/resource/index.js
1261
- var init_resource = __esmMin((() => {
1262
- init_SemanticResourceAttributes();
1263
- }));
1264
-
1265
- //#endregion
1266
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
1267
- var ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION;
1268
- var init_stable_attributes = __esmMin((() => {
1269
- ATTR_SERVICE_NAME = "service.name";
1270
- ATTR_SERVICE_VERSION = "service.version";
1271
- }));
1272
-
1273
- //#endregion
1274
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_metrics.js
1275
- var init_stable_metrics = __esmMin((() => {}));
1276
-
1277
- //#endregion
1278
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/stable_events.js
1279
- var init_stable_events = __esmMin((() => {}));
1280
-
1281
- //#endregion
1282
- //#region ../../node_modules/@opentelemetry/semantic-conventions/build/esm/index.js
1283
- var init_esm = __esmMin((() => {
1284
- init_trace();
1285
- init_resource();
1286
- init_stable_attributes();
1287
- init_stable_metrics();
1288
- init_stable_events();
1289
- }));
1290
-
1291
- //#endregion
1292
- //#region ../../node_modules/fast-safe-stringify/index.js
1293
- var require_fast_safe_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1294
- module.exports = stringify;
1295
- stringify.default = stringify;
1296
- stringify.stable = deterministicStringify;
1297
- stringify.stableStringify = deterministicStringify;
1298
- var LIMIT_REPLACE_NODE = "[...]";
1299
- var CIRCULAR_REPLACE_NODE = "[Circular]";
1300
- var arr = [];
1301
- var replacerStack = [];
1302
- function defaultOptions() {
1303
- return {
1304
- depthLimit: Number.MAX_SAFE_INTEGER,
1305
- edgesLimit: Number.MAX_SAFE_INTEGER
1306
- };
1307
- }
1308
- function stringify(obj, replacer, spacer, options) {
1309
- if (typeof options === "undefined") options = defaultOptions();
1310
- decirc(obj, "", 0, [], void 0, 0, options);
1311
- var res;
1312
- try {
1313
- if (replacerStack.length === 0) res = JSON.stringify(obj, replacer, spacer);
1314
- else res = JSON.stringify(obj, replaceGetterValues(replacer), spacer);
1315
- } catch (_) {
1316
- return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
1317
- } finally {
1318
- while (arr.length !== 0) {
1319
- var part = arr.pop();
1320
- if (part.length === 4) Object.defineProperty(part[0], part[1], part[3]);
1321
- else part[0][part[1]] = part[2];
1322
- }
1323
- }
1324
- return res;
1325
- }
1326
- function setReplace(replace, val, k, parent) {
1327
- var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k);
1328
- if (propertyDescriptor.get !== void 0) if (propertyDescriptor.configurable) {
1329
- Object.defineProperty(parent, k, { value: replace });
1330
- arr.push([
1331
- parent,
1332
- k,
1333
- val,
1334
- propertyDescriptor
1335
- ]);
1336
- } else replacerStack.push([
1337
- val,
1338
- k,
1339
- replace
1340
- ]);
1341
- else {
1342
- parent[k] = replace;
1343
- arr.push([
1344
- parent,
1345
- k,
1346
- val
1347
- ]);
1348
- }
1349
- }
1350
- function decirc(val, k, edgeIndex, stack, parent, depth, options) {
1351
- depth += 1;
1352
- var i;
1353
- if (typeof val === "object" && val !== null) {
1354
- for (i = 0; i < stack.length; i++) if (stack[i] === val) {
1355
- setReplace(CIRCULAR_REPLACE_NODE, val, k, parent);
1356
- return;
1357
- }
1358
- if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) {
1359
- setReplace(LIMIT_REPLACE_NODE, val, k, parent);
1360
- return;
1361
- }
1362
- if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) {
1363
- setReplace(LIMIT_REPLACE_NODE, val, k, parent);
1364
- return;
1365
- }
1366
- stack.push(val);
1367
- if (Array.isArray(val)) for (i = 0; i < val.length; i++) decirc(val[i], i, i, stack, val, depth, options);
1368
- else {
1369
- var keys = Object.keys(val);
1370
- for (i = 0; i < keys.length; i++) {
1371
- var key = keys[i];
1372
- decirc(val[key], key, i, stack, val, depth, options);
1373
- }
1374
- }
1375
- stack.pop();
1376
- }
1377
- }
1378
- function compareFunction(a, b) {
1379
- if (a < b) return -1;
1380
- if (a > b) return 1;
1381
- return 0;
1382
- }
1383
- function deterministicStringify(obj, replacer, spacer, options) {
1384
- if (typeof options === "undefined") options = defaultOptions();
1385
- var tmp = deterministicDecirc(obj, "", 0, [], void 0, 0, options) || obj;
1386
- var res;
1387
- try {
1388
- if (replacerStack.length === 0) res = JSON.stringify(tmp, replacer, spacer);
1389
- else res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer);
1390
- } catch (_) {
1391
- return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]");
1392
- } finally {
1393
- while (arr.length !== 0) {
1394
- var part = arr.pop();
1395
- if (part.length === 4) Object.defineProperty(part[0], part[1], part[3]);
1396
- else part[0][part[1]] = part[2];
1397
- }
1398
- }
1399
- return res;
1400
- }
1401
- function deterministicDecirc(val, k, edgeIndex, stack, parent, depth, options) {
1402
- depth += 1;
1403
- var i;
1404
- if (typeof val === "object" && val !== null) {
1405
- for (i = 0; i < stack.length; i++) if (stack[i] === val) {
1406
- setReplace(CIRCULAR_REPLACE_NODE, val, k, parent);
1407
- return;
1408
- }
1409
- try {
1410
- if (typeof val.toJSON === "function") return;
1411
- } catch (_) {
1412
- return;
1413
- }
1414
- if (typeof options.depthLimit !== "undefined" && depth > options.depthLimit) {
1415
- setReplace(LIMIT_REPLACE_NODE, val, k, parent);
1416
- return;
1417
- }
1418
- if (typeof options.edgesLimit !== "undefined" && edgeIndex + 1 > options.edgesLimit) {
1419
- setReplace(LIMIT_REPLACE_NODE, val, k, parent);
1420
- return;
1421
- }
1422
- stack.push(val);
1423
- if (Array.isArray(val)) for (i = 0; i < val.length; i++) deterministicDecirc(val[i], i, i, stack, val, depth, options);
1424
- else {
1425
- var tmp = {};
1426
- var keys = Object.keys(val).sort(compareFunction);
1427
- for (i = 0; i < keys.length; i++) {
1428
- var key = keys[i];
1429
- deterministicDecirc(val[key], key, i, stack, val, depth, options);
1430
- tmp[key] = val[key];
1431
- }
1432
- if (typeof parent !== "undefined") {
1433
- arr.push([
1434
- parent,
1435
- k,
1436
- val
1437
- ]);
1438
- parent[k] = tmp;
1439
- } else return tmp;
1440
- }
1441
- stack.pop();
1442
- }
1443
- }
1444
- function replaceGetterValues(replacer) {
1445
- replacer = typeof replacer !== "undefined" ? replacer : function(k, v) {
1446
- return v;
1447
- };
1448
- return function(key, val) {
1449
- if (replacerStack.length > 0) for (var i = 0; i < replacerStack.length; i++) {
1450
- var part = replacerStack[i];
1451
- if (part[1] === key && part[0] === val) {
1452
- val = part[2];
1453
- replacerStack.splice(i, 1);
1454
- break;
1455
- }
1456
- }
1457
- return replacer.call(this, key, val);
1458
- };
1459
- }
1460
- }));
1461
-
1462
- //#endregion
1463
- //#region ../../node_modules/kleur/index.mjs
1464
- var import_fast_safe_stringify = /* @__PURE__ */ __toESM(require_fast_safe_stringify(), 1);
1465
- init_esm();
1466
- var import_src = require_src();
1467
- init_esm$1();
1468
- let FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, isTTY = true;
1469
- if (typeof process !== "undefined") {
1470
- ({FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM} = process.env || {});
1471
- isTTY = process.stdout && process.stdout.isTTY;
1472
- }
1473
- const $ = {
1474
- enabled: !NODE_DISABLE_COLORS && NO_COLOR == null && TERM !== "dumb" && (FORCE_COLOR != null && FORCE_COLOR !== "0" || isTTY),
1475
- reset: init(0, 0),
1476
- bold: init(1, 22),
1477
- dim: init(2, 22),
1478
- italic: init(3, 23),
1479
- underline: init(4, 24),
1480
- inverse: init(7, 27),
1481
- hidden: init(8, 28),
1482
- strikethrough: init(9, 29),
1483
- black: init(30, 39),
1484
- red: init(31, 39),
1485
- green: init(32, 39),
1486
- yellow: init(33, 39),
1487
- blue: init(34, 39),
1488
- magenta: init(35, 39),
1489
- cyan: init(36, 39),
1490
- white: init(37, 39),
1491
- gray: init(90, 39),
1492
- grey: init(90, 39),
1493
- bgBlack: init(40, 49),
1494
- bgRed: init(41, 49),
1495
- bgGreen: init(42, 49),
1496
- bgYellow: init(43, 49),
1497
- bgBlue: init(44, 49),
1498
- bgMagenta: init(45, 49),
1499
- bgCyan: init(46, 49),
1500
- bgWhite: init(47, 49)
1501
- };
1502
- function run(arr, str) {
1503
- let i = 0, tmp, beg = "", end = "";
1504
- for (; i < arr.length; i++) {
1505
- tmp = arr[i];
1506
- beg += tmp.open;
1507
- end += tmp.close;
1508
- if (!!~str.indexOf(tmp.close)) str = str.replace(tmp.rgx, tmp.close + tmp.open);
1509
- }
1510
- return beg + str + end;
1511
- }
1512
- function chain(has, keys) {
1513
- let ctx = {
1514
- has,
1515
- keys
1516
- };
1517
- ctx.reset = $.reset.bind(ctx);
1518
- ctx.bold = $.bold.bind(ctx);
1519
- ctx.dim = $.dim.bind(ctx);
1520
- ctx.italic = $.italic.bind(ctx);
1521
- ctx.underline = $.underline.bind(ctx);
1522
- ctx.inverse = $.inverse.bind(ctx);
1523
- ctx.hidden = $.hidden.bind(ctx);
1524
- ctx.strikethrough = $.strikethrough.bind(ctx);
1525
- ctx.black = $.black.bind(ctx);
1526
- ctx.red = $.red.bind(ctx);
1527
- ctx.green = $.green.bind(ctx);
1528
- ctx.yellow = $.yellow.bind(ctx);
1529
- ctx.blue = $.blue.bind(ctx);
1530
- ctx.magenta = $.magenta.bind(ctx);
1531
- ctx.cyan = $.cyan.bind(ctx);
1532
- ctx.white = $.white.bind(ctx);
1533
- ctx.gray = $.gray.bind(ctx);
1534
- ctx.grey = $.grey.bind(ctx);
1535
- ctx.bgBlack = $.bgBlack.bind(ctx);
1536
- ctx.bgRed = $.bgRed.bind(ctx);
1537
- ctx.bgGreen = $.bgGreen.bind(ctx);
1538
- ctx.bgYellow = $.bgYellow.bind(ctx);
1539
- ctx.bgBlue = $.bgBlue.bind(ctx);
1540
- ctx.bgMagenta = $.bgMagenta.bind(ctx);
1541
- ctx.bgCyan = $.bgCyan.bind(ctx);
1542
- ctx.bgWhite = $.bgWhite.bind(ctx);
1543
- return ctx;
1544
- }
1545
- function init(open, close) {
1546
- let blk = {
1547
- open: `\x1b[${open}m`,
1548
- close: `\x1b[${close}m`,
1549
- rgx: new RegExp(`\\x1b\\[${close}m`, "g")
1550
- };
1551
- return function(txt) {
1552
- if (this !== void 0 && this.has !== void 0) {
1553
- ~this.has.indexOf(open) || (this.has.push(open), this.keys.push(blk));
1554
- return txt === void 0 ? this : $.enabled ? run(this.keys, txt + "") : txt + "";
1555
- }
1556
- return txt === void 0 ? chain([open], [blk]) : $.enabled ? run([blk], txt + "") : txt + "";
1557
- };
1558
- }
1559
- var kleur_default = $;
1560
-
1561
- //#endregion
1562
- //#region ../otel/dist/index.mjs
1563
- const LOG_SEVERITY_MAP = {
1564
- TRACE: 1,
1565
- DEBUG: 5,
1566
- INFO: 9,
1567
- NOTICE: 10,
1568
- WARNING: 13,
1569
- WARN: 13,
1570
- ERROR: 17,
1571
- FATAL: 21,
1572
- CRITICAL: 21,
1573
- ALERT: 22,
1574
- EMERGENCY: 23
1575
- };
1576
- const colors = {
1577
- gray: kleur_default.gray,
1578
- dim: kleur_default.dim,
1579
- cyan: kleur_default.cyan,
1580
- white: kleur_default.white,
1581
- green: kleur_default.green,
1582
- yellow: kleur_default.yellow,
1583
- red: kleur_default.red,
1584
- magenta: kleur_default.magenta
1585
- };
1586
- const levelColorMap = {
1587
- DEBUG: kleur_default.magenta,
1588
- INFO: kleur_default.green,
1589
- WARN: kleur_default.yellow,
1590
- ERROR: kleur_default.red,
1591
- FATAL: kleur_default.red
1592
- };
1593
- const statusColorMap = {
1594
- 0: colors.gray,
1595
- 1: colors.green,
1596
- 2: colors.red
1597
- };
1598
- colors.white, colors.cyan, colors.yellow, colors.magenta, colors.green;
1599
- const stringify = import_fast_safe_stringify.default.default.stableStringify;
1600
- /**
1601
- * Extracts telemetry context from environment (cloud/k8s aware),
1602
- * with support for subservice/component override.
1603
- */
1604
- function detectTelemetryContext(componentNameOverride) {
1605
- const { OTEL_SERVICE_NAME, OTEL_SERVICE_VERSION, K_SERVICE, K_REVISION, K_CONFIGURATION, KUBERNETES_SERVICE_HOST, POD_NAME, POD_NAMESPACE, GCP_PROJECT, CLOUD_PROVIDER } = process.env;
1606
- const systemName = OTEL_SERVICE_NAME || "unknown-service";
1607
- const systemVersion = OTEL_SERVICE_VERSION || "1.0.0";
1608
- const componentName = componentNameOverride || void 0;
1609
- return {
1610
- systemName,
1611
- systemVersion,
1612
- componentName,
1613
- resourceAttributes: {
1614
- [ATTR_SERVICE_NAME]: systemName,
1615
- [ATTR_SERVICE_VERSION]: systemVersion,
1616
- "serviceContext.service": systemName,
1617
- "serviceContext.version": systemVersion,
1618
- ...K_SERVICE && { "cloud.run.service": K_SERVICE },
1619
- ...K_REVISION && { "cloud.run.revision": K_REVISION },
1620
- ...K_CONFIGURATION && { "cloud.run.configuration": K_CONFIGURATION },
1621
- ...POD_NAME && { "k8s.pod_name": POD_NAME },
1622
- ...POD_NAMESPACE && { "k8s.namespace_name": POD_NAMESPACE },
1623
- ...KUBERNETES_SERVICE_HOST && { "cloud.orchestrator": "kubernetes" },
1624
- ...GCP_PROJECT && { "cloud.account.id": GCP_PROJECT },
1625
- ...CLOUD_PROVIDER && { "cloud.provider": CLOUD_PROVIDER },
1626
- ...componentName && { "component.name": componentName }
1627
- }
1628
- };
1629
- }
1630
- diag.disable();
1631
- diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.ERROR);
1632
- let _isInitialized = false;
1633
- function isInitialized() {
1634
- return _isInitialized;
1635
- }
1636
- function getLogger(serviceOverride, extraAttrs = {}) {
1637
- const { systemName, systemVersion, resourceAttributes } = detectTelemetryContext(serviceOverride);
1638
- const defaultAttrs = {
1639
- ...resourceAttributes,
1640
- ...extraAttrs
1641
- };
1642
- function emit(severityText, body, attrs = {}) {
1643
- if (!isInitialized() && process.env.NODE_ENV !== "test") {
1644
- console.warn("OTEL must be initialized before using logger");
1645
- console.log(`[${severityText}] ${body}`);
1646
- return;
1647
- }
1648
- const logger = import_src.logs.getLogger(systemName, systemVersion);
1649
- const spanContext = trace.getSpan(context.active())?.spanContext();
1650
- logger.emit({
1651
- severityText,
1652
- severityNumber: LOG_SEVERITY_MAP[severityText],
1653
- body,
1654
- attributes: {
1655
- ...defaultAttrs,
1656
- ...spanContext && {
1657
- trace_id: spanContext.traceId,
1658
- span_id: spanContext.spanId
1659
- },
1660
- ...attrs
1661
- }
1662
- });
1663
- }
1664
- return {
1665
- debug: (msg, attrs) => emit("DEBUG", msg, attrs),
1666
- info: (msg, attrs) => emit("INFO", msg, attrs),
1667
- notice: (msg, attrs) => emit("NOTICE", msg, attrs),
1668
- warn: (msg, attrs) => emit("WARNING", msg, attrs),
1669
- error: (msg, errOrAttrs, maybeAttrs = {}) => {
1670
- let body;
1671
- let attrs;
1672
- if (errOrAttrs instanceof Error) {
1673
- body = `${msg}: ${errOrAttrs.stack || errOrAttrs.message}`;
1674
- attrs = maybeAttrs;
1675
- } else {
1676
- body = msg instanceof Error ? msg.stack || msg.message : msg;
1677
- attrs = errOrAttrs || {};
1678
- }
1679
- emit("ERROR", body, attrs);
1680
- },
1681
- critical: (msg, attrs) => emit("CRITICAL", msg, attrs),
1682
- alert: (msg, attrs) => emit("ALERT", msg, attrs),
1683
- emergency: (msg, attrs) => emit("EMERGENCY", msg, attrs)
1684
- };
1685
- }
1686
-
1687
- //#endregion
1688
9
  //#region src/paramsSerializer.ts
1689
10
  const encodeParam = (param) => encodeURIComponent(param);
1690
11
  const encodeValue = (param, encodeCommas = false) => {
@@ -1707,16 +28,16 @@ const paramsSerializer = (format) => (params) => {
1707
28
  continue;
1708
29
  }
1709
30
  value.forEach((v, ix) => {
1710
- const value$1 = encodeValue(v);
31
+ const value = encodeValue(v);
1711
32
  switch (format) {
1712
33
  case "indices":
1713
- s.push(`${title}[${ix}]=${value$1}`);
34
+ s.push(`${title}[${ix}]=${value}`);
1714
35
  break;
1715
36
  case "repeat":
1716
- s.push(`${title}=${value$1}`);
37
+ s.push(`${title}=${value}`);
1717
38
  break;
1718
39
  default:
1719
- s.push(`${title}[]=${value$1}`);
40
+ s.push(`${title}[]=${value}`);
1720
41
  break;
1721
42
  }
1722
43
  });
@@ -1825,12 +146,12 @@ const callServer = async (axiosInstance, args, logger) => {
1825
146
  throw fromAxiosError(error);
1826
147
  }
1827
148
  };
1828
- const mergeArgs = (baseUrl, url, method, requestArgs, extras, global$1) => {
1829
- const params = merge("params", global$1, requestArgs, extras);
1830
- const query = merge("query", global$1, requestArgs, extras);
1831
- const headers = merge("headers", global$1, requestArgs, extras);
1832
- const body = merge("body", global$1, requestArgs, extras);
1833
- const retry$1 = merge("retry", global$1, requestArgs, extras);
149
+ const mergeArgs = (baseUrl, url, method, requestArgs, extras, global) => {
150
+ const params = merge("params", global, requestArgs, extras);
151
+ const query = merge("query", global, requestArgs, extras);
152
+ const headers = merge("headers", global, requestArgs, extras);
153
+ const body = merge("body", global, requestArgs, extras);
154
+ const retry = merge("retry", global, requestArgs, extras);
1834
155
  return {
1835
156
  url: setParams(url, params),
1836
157
  baseUrl,
@@ -1838,14 +159,14 @@ const mergeArgs = (baseUrl, url, method, requestArgs, extras, global$1) => {
1838
159
  params: query,
1839
160
  headers,
1840
161
  body,
1841
- retry: retry$1,
1842
- arrayFormat: global$1?.arrayFormat,
162
+ retry,
163
+ arrayFormat: global?.arrayFormat,
1843
164
  httpsAgent: extras?.httpsAgent,
1844
165
  httpAgent: extras?.httpAgent
1845
166
  };
1846
167
  };
1847
168
  const merge = (prop, ...args) => Object.assign({}, ...args.map((a) => a?.[prop] || {}));
1848
- const setParams = (url, params = {}) => Object.entries(params).reduce((url$1, [key, val]) => url$1.replace(new RegExp(`/:${key}(?!\\w|\\d)`, "g"), `/${val}`), url);
169
+ const setParams = (url, params = {}) => Object.entries(params).reduce((url, [key, val]) => url.replace(new RegExp(`/:${key}(?!\\w|\\d)`, "g"), `/${val}`), url);
1849
170
 
1850
171
  //#endregion
1851
172
  //#region src/graphql/client.ts