@hexclave/dashboard-ui-components 1.0.28 → 1.0.29
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.
|
@@ -4461,1326 +4461,448 @@ This is likely an error in Hexclave. Please make sure you are running the newest
|
|
|
4461
4461
|
return Object.assign(Result.error(new RetryError(errors)), { attempts: totalAttempts });
|
|
4462
4462
|
}
|
|
4463
4463
|
|
|
4464
|
-
// ../shared/dist/esm/utils/
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
var IterableWeakMap = (_a2 = class {
|
|
4479
|
-
constructor(entries) {
|
|
4480
|
-
this[_Symbol$toStringTag] = "IterableWeakMap";
|
|
4481
|
-
const mappedEntries = entries?.map((e40) => [e40[0], {
|
|
4482
|
-
value: e40[1],
|
|
4483
|
-
keyRef: new WeakRefIfAvailable(e40[0])
|
|
4484
|
-
}]);
|
|
4485
|
-
this._weakMap = new WeakMap(mappedEntries ?? []);
|
|
4486
|
-
this._keyRefs = new Set(mappedEntries?.map((e40) => e40[1].keyRef) ?? []);
|
|
4487
|
-
}
|
|
4488
|
-
get(key) {
|
|
4489
|
-
return this._weakMap.get(key)?.value;
|
|
4490
|
-
}
|
|
4491
|
-
set(key, value) {
|
|
4492
|
-
const updated = {
|
|
4493
|
-
value,
|
|
4494
|
-
keyRef: this._weakMap.get(key)?.keyRef ?? new WeakRefIfAvailable(key)
|
|
4495
|
-
};
|
|
4496
|
-
this._weakMap.set(key, updated);
|
|
4497
|
-
this._keyRefs.add(updated.keyRef);
|
|
4498
|
-
return this;
|
|
4499
|
-
}
|
|
4500
|
-
delete(key) {
|
|
4501
|
-
const res = this._weakMap.get(key);
|
|
4502
|
-
if (res) {
|
|
4503
|
-
this._weakMap.delete(key);
|
|
4504
|
-
this._keyRefs.delete(res.keyRef);
|
|
4505
|
-
return true;
|
|
4506
|
-
}
|
|
4507
|
-
return false;
|
|
4508
|
-
}
|
|
4509
|
-
has(key) {
|
|
4510
|
-
return this._weakMap.has(key) && this._keyRefs.has(this._weakMap.get(key).keyRef);
|
|
4511
|
-
}
|
|
4512
|
-
*[Symbol.iterator]() {
|
|
4513
|
-
for (const keyRef of this._keyRefs) {
|
|
4514
|
-
const key = keyRef.deref();
|
|
4515
|
-
const existing = key ? this._weakMap.get(key) : void 0;
|
|
4516
|
-
if (!key) this._keyRefs.delete(keyRef);
|
|
4517
|
-
else if (existing) yield [key, existing.value];
|
|
4518
|
-
}
|
|
4464
|
+
// ../shared/dist/esm/utils/bytes.js
|
|
4465
|
+
function decodeBase64(input) {
|
|
4466
|
+
return new Uint8Array(atob(input).split("").map((char) => char.charCodeAt(0)));
|
|
4467
|
+
}
|
|
4468
|
+
function isBase64(input) {
|
|
4469
|
+
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(input);
|
|
4470
|
+
}
|
|
4471
|
+
|
|
4472
|
+
// ../shared/dist/esm/utils/urls.js
|
|
4473
|
+
function createUrlIfValid(...args) {
|
|
4474
|
+
try {
|
|
4475
|
+
return new URL(...args);
|
|
4476
|
+
} catch (e40) {
|
|
4477
|
+
return null;
|
|
4519
4478
|
}
|
|
4520
|
-
}
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4479
|
+
}
|
|
4480
|
+
function isValidUrl(url) {
|
|
4481
|
+
return !!createUrlIfValid(url);
|
|
4482
|
+
}
|
|
4483
|
+
function isValidHostname(hostname) {
|
|
4484
|
+
if (!hostname || hostname.startsWith(".") || hostname.endsWith(".") || hostname.includes("..")) return false;
|
|
4485
|
+
const url = createUrlIfValid(`https://${hostname}`);
|
|
4486
|
+
if (!url) return false;
|
|
4487
|
+
return url.hostname === hostname;
|
|
4488
|
+
}
|
|
4489
|
+
function isValidHostnameWithWildcards(hostname) {
|
|
4490
|
+
if (!hostname) return false;
|
|
4491
|
+
if (!hostname.includes("*")) return isValidHostname(hostname);
|
|
4492
|
+
if (hostname.startsWith(".") || hostname.endsWith(".")) return false;
|
|
4493
|
+
if (hostname.includes("..")) return false;
|
|
4494
|
+
const testHostname = hostname.replace(/\*+/g, "wildcard");
|
|
4495
|
+
if (!/^[a-zA-Z0-9.-]+$/.test(testHostname)) return false;
|
|
4496
|
+
const segments = hostname.split(/\*+/);
|
|
4497
|
+
for (let i = 0; i < segments.length; i++) {
|
|
4498
|
+
const segment = segments[i];
|
|
4499
|
+
if (segment === "") continue;
|
|
4500
|
+
if (i === 0 && segment.startsWith(".")) return false;
|
|
4501
|
+
if (i === segments.length - 1 && segment.endsWith(".")) return false;
|
|
4502
|
+
if (segment.includes("..")) return false;
|
|
4528
4503
|
}
|
|
4529
|
-
|
|
4530
|
-
|
|
4504
|
+
return true;
|
|
4505
|
+
}
|
|
4506
|
+
|
|
4507
|
+
// ../shared/dist/esm/known-errors.js
|
|
4508
|
+
var KnownError = class extends StatusError {
|
|
4509
|
+
constructor(statusCode, humanReadableMessage, details) {
|
|
4510
|
+
super(statusCode, humanReadableMessage);
|
|
4511
|
+
this.statusCode = statusCode;
|
|
4512
|
+
this.humanReadableMessage = humanReadableMessage;
|
|
4513
|
+
this.details = details;
|
|
4514
|
+
this.__stackKnownErrorBrand = "stack-known-error-brand-sentinel";
|
|
4515
|
+
this.name = "KnownError";
|
|
4531
4516
|
}
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
else return this._primitiveMap.get(key);
|
|
4517
|
+
static isKnownError(error) {
|
|
4518
|
+
return typeof error === "object" && error !== null && "__stackKnownErrorBrand" in error && error.__stackKnownErrorBrand === "stack-known-error-brand-sentinel";
|
|
4535
4519
|
}
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
else this._primitiveMap.set(key, value);
|
|
4539
|
-
return this;
|
|
4520
|
+
getBody() {
|
|
4521
|
+
return new TextEncoder().encode(JSON.stringify(this.toDescriptiveJson(), void 0, 2));
|
|
4540
4522
|
}
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4523
|
+
getHeaders() {
|
|
4524
|
+
return {
|
|
4525
|
+
"Content-Type": ["application/json; charset=utf-8"],
|
|
4526
|
+
"X-Stack-Known-Error": [this.errorCode],
|
|
4527
|
+
"X-Hexclave-Known-Error": [this.errorCode]
|
|
4528
|
+
};
|
|
4544
4529
|
}
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4530
|
+
toDescriptiveJson() {
|
|
4531
|
+
return {
|
|
4532
|
+
code: this.errorCode,
|
|
4533
|
+
...this.details ? { details: this.details } : {},
|
|
4534
|
+
error: this.humanReadableMessage
|
|
4535
|
+
};
|
|
4548
4536
|
}
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
yield* this._weakMap;
|
|
4537
|
+
get errorCode() {
|
|
4538
|
+
return this.constructor.errorCode ?? throwErr(`Can't find error code for this KnownError. Is its constructor a KnownErrorConstructor? ${this}`);
|
|
4552
4539
|
}
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
hasValue: false,
|
|
4560
|
-
value: void 0
|
|
4561
|
-
};
|
|
4562
|
-
this[_Symbol$toStringTag3] = "DependenciesMap";
|
|
4540
|
+
static constructorArgsFromJson(json) {
|
|
4541
|
+
return [
|
|
4542
|
+
400,
|
|
4543
|
+
json.message,
|
|
4544
|
+
json
|
|
4545
|
+
];
|
|
4563
4546
|
}
|
|
4564
|
-
|
|
4565
|
-
if (
|
|
4566
|
-
|
|
4547
|
+
static fromJson(json) {
|
|
4548
|
+
for (const [_, KnownErrorType] of Object.entries(KnownErrors)) if (json.code === KnownErrorType.prototype.errorCode) return new KnownErrorType(...KnownErrorType.constructorArgsFromJson(json));
|
|
4549
|
+
throw new Error(`An error occurred. Please update your version of the Hexclave SDK. ${json.code}: ${json.message}`);
|
|
4567
4550
|
}
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4551
|
+
};
|
|
4552
|
+
function createKnownErrorConstructor(SuperClass, errorCode, create, constructorArgsFromJson) {
|
|
4553
|
+
const createFn = create === "inherit" ? identityArgs : create;
|
|
4554
|
+
const constructorArgsFromJsonFn = constructorArgsFromJson === "inherit" ? SuperClass.constructorArgsFromJson : constructorArgsFromJson;
|
|
4555
|
+
const _KnownErrorImpl = class _KnownErrorImpl extends SuperClass {
|
|
4556
|
+
constructor(...args) {
|
|
4557
|
+
super(...createFn(...args));
|
|
4558
|
+
this.name = `KnownError<${errorCode}>`;
|
|
4559
|
+
this.constructorArgs = args;
|
|
4575
4560
|
}
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
if (dependencies.length === 0) {
|
|
4579
|
-
const res = this._valueToResult(inner);
|
|
4580
|
-
if (value.status === "ok") {
|
|
4581
|
-
inner.hasValue = true;
|
|
4582
|
-
inner.value = value.data;
|
|
4583
|
-
} else {
|
|
4584
|
-
inner.hasValue = false;
|
|
4585
|
-
inner.value = void 0;
|
|
4586
|
-
}
|
|
4587
|
-
return res;
|
|
4588
|
-
} else {
|
|
4589
|
-
const [key, ...rest] = dependencies;
|
|
4590
|
-
let newInner = inner.map.get(key);
|
|
4591
|
-
if (!newInner) inner.map.set(key, newInner = {
|
|
4592
|
-
map: new MaybeWeakMap(),
|
|
4593
|
-
hasValue: false,
|
|
4594
|
-
value: void 0
|
|
4595
|
-
});
|
|
4596
|
-
return this._setInInner(rest, value, newInner);
|
|
4561
|
+
static constructorArgsFromJson(json) {
|
|
4562
|
+
return constructorArgsFromJsonFn(json.details);
|
|
4597
4563
|
}
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
set(dependencies, value) {
|
|
4607
|
-
this._setInInner(dependencies, Result.ok(value), this._inner);
|
|
4608
|
-
return this;
|
|
4609
|
-
}
|
|
4610
|
-
delete(dependencies) {
|
|
4611
|
-
return this._setInInner(dependencies, Result.error(void 0), this._inner).status === "ok";
|
|
4612
|
-
}
|
|
4613
|
-
has(dependencies) {
|
|
4614
|
-
return this._unwrapFromInner(dependencies, this._inner).status === "ok";
|
|
4615
|
-
}
|
|
4616
|
-
clear() {
|
|
4617
|
-
this._inner = {
|
|
4618
|
-
map: new MaybeWeakMap(),
|
|
4619
|
-
hasValue: false,
|
|
4620
|
-
value: void 0
|
|
4621
|
-
};
|
|
4622
|
-
}
|
|
4623
|
-
*[Symbol.iterator]() {
|
|
4624
|
-
yield* this._iterateInner([], this._inner);
|
|
4625
|
-
}
|
|
4626
|
-
}, _Symbol$toStringTag3 = Symbol.toStringTag, _a4);
|
|
4627
|
-
|
|
4628
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js
|
|
4629
|
-
var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
4630
|
-
|
|
4631
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/version.js
|
|
4632
|
-
var VERSION = "1.9.0";
|
|
4633
|
-
|
|
4634
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
4635
|
-
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
4636
|
-
function _makeCompatibilityCheck(ownVersion) {
|
|
4637
|
-
var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
4638
|
-
var rejectedVersions = /* @__PURE__ */ new Set();
|
|
4639
|
-
var myVersionMatch = ownVersion.match(re);
|
|
4640
|
-
if (!myVersionMatch) {
|
|
4641
|
-
return function() {
|
|
4564
|
+
static isInstance(error) {
|
|
4565
|
+
if (!KnownError.isKnownError(error)) return false;
|
|
4566
|
+
let current = error;
|
|
4567
|
+
while (true) {
|
|
4568
|
+
current = Object.getPrototypeOf(current);
|
|
4569
|
+
if (!current) break;
|
|
4570
|
+
if ("errorCode" in current.constructor && current.constructor.errorCode === errorCode) return true;
|
|
4571
|
+
}
|
|
4642
4572
|
return false;
|
|
4643
|
-
};
|
|
4644
|
-
}
|
|
4645
|
-
var ownVersionParsed = {
|
|
4646
|
-
major: +myVersionMatch[1],
|
|
4647
|
-
minor: +myVersionMatch[2],
|
|
4648
|
-
patch: +myVersionMatch[3],
|
|
4649
|
-
prerelease: myVersionMatch[4]
|
|
4650
|
-
};
|
|
4651
|
-
if (ownVersionParsed.prerelease != null) {
|
|
4652
|
-
return function isExactmatch(globalVersion) {
|
|
4653
|
-
return globalVersion === ownVersion;
|
|
4654
|
-
};
|
|
4655
|
-
}
|
|
4656
|
-
function _reject(v) {
|
|
4657
|
-
rejectedVersions.add(v);
|
|
4658
|
-
return false;
|
|
4659
|
-
}
|
|
4660
|
-
function _accept(v) {
|
|
4661
|
-
acceptedVersions.add(v);
|
|
4662
|
-
return true;
|
|
4663
|
-
}
|
|
4664
|
-
return function isCompatible2(globalVersion) {
|
|
4665
|
-
if (acceptedVersions.has(globalVersion)) {
|
|
4666
|
-
return true;
|
|
4667
|
-
}
|
|
4668
|
-
if (rejectedVersions.has(globalVersion)) {
|
|
4669
|
-
return false;
|
|
4670
|
-
}
|
|
4671
|
-
var globalVersionMatch = globalVersion.match(re);
|
|
4672
|
-
if (!globalVersionMatch) {
|
|
4673
|
-
return _reject(globalVersion);
|
|
4674
|
-
}
|
|
4675
|
-
var globalVersionParsed = {
|
|
4676
|
-
major: +globalVersionMatch[1],
|
|
4677
|
-
minor: +globalVersionMatch[2],
|
|
4678
|
-
patch: +globalVersionMatch[3],
|
|
4679
|
-
prerelease: globalVersionMatch[4]
|
|
4680
|
-
};
|
|
4681
|
-
if (globalVersionParsed.prerelease != null) {
|
|
4682
|
-
return _reject(globalVersion);
|
|
4683
|
-
}
|
|
4684
|
-
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
4685
|
-
return _reject(globalVersion);
|
|
4686
|
-
}
|
|
4687
|
-
if (ownVersionParsed.major === 0) {
|
|
4688
|
-
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) {
|
|
4689
|
-
return _accept(globalVersion);
|
|
4690
|
-
}
|
|
4691
|
-
return _reject(globalVersion);
|
|
4692
|
-
}
|
|
4693
|
-
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
|
4694
|
-
return _accept(globalVersion);
|
|
4695
4573
|
}
|
|
4696
|
-
return _reject(globalVersion);
|
|
4697
4574
|
};
|
|
4575
|
+
_KnownErrorImpl.errorCode = errorCode;
|
|
4576
|
+
let KnownErrorImpl = _KnownErrorImpl;
|
|
4577
|
+
return KnownErrorImpl;
|
|
4698
4578
|
}
|
|
4699
|
-
var
|
|
4579
|
+
var UnsupportedError = createKnownErrorConstructor(KnownError, "UNSUPPORTED_ERROR", (originalErrorCode) => [
|
|
4580
|
+
500,
|
|
4581
|
+
`An error occurred that is not currently supported (possibly because it was added in a version of Stack that is newer than this client). The original unsupported error code was: ${originalErrorCode}`,
|
|
4582
|
+
{ originalErrorCode }
|
|
4583
|
+
], (json) => [json?.originalErrorCode ?? throwErr("originalErrorCode not found in UnsupportedError details")]);
|
|
4584
|
+
var BodyParsingError = createKnownErrorConstructor(KnownError, "BODY_PARSING_ERROR", (message) => [400, message], (json) => [json.message]);
|
|
4585
|
+
var SchemaError = createKnownErrorConstructor(KnownError, "SCHEMA_ERROR", (message) => [
|
|
4586
|
+
400,
|
|
4587
|
+
message || throwErr("SchemaError requires a message"),
|
|
4588
|
+
{ message }
|
|
4589
|
+
], (json) => [json.message]);
|
|
4590
|
+
var AllOverloadsFailed = createKnownErrorConstructor(KnownError, "ALL_OVERLOADS_FAILED", (overloadErrors) => [
|
|
4591
|
+
400,
|
|
4592
|
+
deindent`
|
|
4593
|
+
This endpoint has multiple overloads, but they all failed to process the request.
|
|
4700
4594
|
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
return;
|
|
4732
|
-
}
|
|
4733
|
-
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
4734
|
-
}
|
|
4735
|
-
function unregisterGlobal(type, diag) {
|
|
4736
|
-
diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
|
|
4737
|
-
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
4738
|
-
if (api) {
|
|
4739
|
-
delete api[type];
|
|
4595
|
+
${overloadErrors.map((e40, i) => deindent`
|
|
4596
|
+
Overload ${i + 1}: ${JSON.stringify(e40, void 0, 2)}
|
|
4597
|
+
`).join("\n\n")}
|
|
4598
|
+
`,
|
|
4599
|
+
{ overload_errors: overloadErrors }
|
|
4600
|
+
], (json) => [json?.overload_errors ?? throwErr("overload_errors not found in AllOverloadsFailed details")]);
|
|
4601
|
+
var ProjectAuthenticationError = createKnownErrorConstructor(KnownError, "PROJECT_AUTHENTICATION_ERROR", "inherit", "inherit");
|
|
4602
|
+
var InvalidProjectAuthentication = createKnownErrorConstructor(ProjectAuthenticationError, "INVALID_PROJECT_AUTHENTICATION", "inherit", "inherit");
|
|
4603
|
+
var ProjectKeyWithoutAccessType = createKnownErrorConstructor(InvalidProjectAuthentication, "PROJECT_KEY_WITHOUT_ACCESS_TYPE", () => [400, "Either an API key or an admin access token was provided, but the x-hexclave-access-type header is missing. Set it to 'client', 'server', or 'admin' as appropriate. (The legacy x-stack-access-type header is also accepted.)"], () => []);
|
|
4604
|
+
var InvalidAccessType = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_ACCESS_TYPE", (accessType) => [400, `The x-hexclave-access-type header must be 'client', 'server', or 'admin', but was '${accessType}'. (The legacy x-stack-access-type header is also accepted.)`], (json) => [json?.accessType ?? throwErr("accessType not found in InvalidAccessType details")]);
|
|
4605
|
+
var AccessTypeWithoutProjectId = createKnownErrorConstructor(InvalidProjectAuthentication, "ACCESS_TYPE_WITHOUT_PROJECT_ID", (accessType) => [
|
|
4606
|
+
400,
|
|
4607
|
+
deindent`
|
|
4608
|
+
The x-hexclave-access-type header was '${accessType}', but the x-hexclave-project-id header was not provided. (The legacy x-stack-access-type and x-stack-project-id headers are also accepted.)
|
|
4609
|
+
|
|
4610
|
+
For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication
|
|
4611
|
+
`,
|
|
4612
|
+
{ request_type: accessType }
|
|
4613
|
+
], (json) => [json.request_type]);
|
|
4614
|
+
var AccessTypeRequired = createKnownErrorConstructor(InvalidProjectAuthentication, "ACCESS_TYPE_REQUIRED", () => [400, deindent`
|
|
4615
|
+
You must specify an access level for this Hexclave project. Make sure project API keys are provided (eg. x-hexclave-publishable-client-key) and you set the x-hexclave-access-type header to 'client', 'server', or 'admin'. (The legacy x-stack-* equivalents are also accepted.)
|
|
4616
|
+
|
|
4617
|
+
For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication
|
|
4618
|
+
`], () => []);
|
|
4619
|
+
var InsufficientAccessType = createKnownErrorConstructor(InvalidProjectAuthentication, "INSUFFICIENT_ACCESS_TYPE", (actualAccessType, allowedAccessTypes) => [
|
|
4620
|
+
401,
|
|
4621
|
+
`The x-hexclave-access-type header must be ${allowedAccessTypes.map((s8) => `'${s8}'`).join(" or ")}, but was '${actualAccessType}'. (The legacy x-stack-access-type header is also accepted.)`,
|
|
4622
|
+
{
|
|
4623
|
+
actual_access_type: actualAccessType,
|
|
4624
|
+
allowed_access_types: allowedAccessTypes
|
|
4740
4625
|
}
|
|
4741
|
-
|
|
4626
|
+
], (json) => [json.actual_access_type, json.allowed_access_types]);
|
|
4627
|
+
var InvalidPublishableClientKey = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_PUBLISHABLE_CLIENT_KEY", (projectId) => [
|
|
4628
|
+
401,
|
|
4629
|
+
`The publishable key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,
|
|
4630
|
+
{ project_id: projectId }
|
|
4631
|
+
], (json) => [json.project_id]);
|
|
4632
|
+
var InvalidSecretServerKey = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_SECRET_SERVER_KEY", (projectId) => [
|
|
4633
|
+
401,
|
|
4634
|
+
`The secret server key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,
|
|
4635
|
+
{ project_id: projectId }
|
|
4636
|
+
], (json) => [json.project_id]);
|
|
4637
|
+
var InvalidSuperSecretAdminKey = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_SUPER_SECRET_ADMIN_KEY", (projectId) => [
|
|
4638
|
+
401,
|
|
4639
|
+
`The super secret admin key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,
|
|
4640
|
+
{ project_id: projectId }
|
|
4641
|
+
], (json) => [json.project_id]);
|
|
4642
|
+
var InvalidAdminAccessToken = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_ADMIN_ACCESS_TOKEN", "inherit", "inherit");
|
|
4643
|
+
var UnparsableAdminAccessToken = createKnownErrorConstructor(InvalidAdminAccessToken, "UNPARSABLE_ADMIN_ACCESS_TOKEN", () => [401, "Admin access token is not parsable."], () => []);
|
|
4644
|
+
var AdminAccessTokenExpired = createKnownErrorConstructor(InvalidAdminAccessToken, "ADMIN_ACCESS_TOKEN_EXPIRED", (expiredAt) => [
|
|
4645
|
+
401,
|
|
4646
|
+
`Admin access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : ""}`,
|
|
4647
|
+
{ expired_at_millis: expiredAt?.getTime() ?? null }
|
|
4648
|
+
], (json) => [json.expired_at_millis ? new Date(json.expired_at_millis) : void 0]);
|
|
4649
|
+
var InvalidProjectForAdminAccessToken = createKnownErrorConstructor(InvalidAdminAccessToken, "INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN", () => [401, "Admin access tokens must be created on the internal project."], () => []);
|
|
4650
|
+
var AdminAccessTokenIsNotAdmin = createKnownErrorConstructor(InvalidAdminAccessToken, "ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN", () => [401, "Admin access token does not have the required permissions to access this project."], () => []);
|
|
4651
|
+
var ProjectAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationError, "PROJECT_AUTHENTICATION_REQUIRED", "inherit", "inherit");
|
|
4652
|
+
var ClientAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_AUTHENTICATION_REQUIRED", () => [401, "The publishable client key must be provided."], () => []);
|
|
4653
|
+
var PublishableClientKeyRequiredForProject = createKnownErrorConstructor(ProjectAuthenticationRequired, "PUBLISHABLE_CLIENT_KEY_REQUIRED_FOR_PROJECT", (projectId) => [
|
|
4654
|
+
401,
|
|
4655
|
+
"Publishable client keys are required for this project. Create one in Project Keys, or disable this requirement there to allow keyless client access.",
|
|
4656
|
+
{ project_id: projectId ?? null }
|
|
4657
|
+
], (json) => [json.project_id ?? void 0]);
|
|
4658
|
+
var ServerAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "SERVER_AUTHENTICATION_REQUIRED", () => [401, "The secret server key must be provided."], () => []);
|
|
4659
|
+
var ClientOrServerAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED", () => [401, "Either the publishable client key or the secret server key must be provided."], () => []);
|
|
4660
|
+
var ClientOrAdminAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED", () => [401, "Either the publishable client key or the super secret admin key must be provided."], () => []);
|
|
4661
|
+
var ClientOrServerOrAdminAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED", () => [401, "Either the publishable client key, the secret server key, or the super secret admin key must be provided."], () => []);
|
|
4662
|
+
var AdminAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "ADMIN_AUTHENTICATION_REQUIRED", () => [401, "The super secret admin key must be provided."], () => []);
|
|
4663
|
+
var ExpectedInternalProject = createKnownErrorConstructor(ProjectAuthenticationError, "EXPECTED_INTERNAL_PROJECT", () => [401, "The project ID is expected to be internal."], () => []);
|
|
4664
|
+
var SessionAuthenticationError = createKnownErrorConstructor(KnownError, "SESSION_AUTHENTICATION_ERROR", "inherit", "inherit");
|
|
4665
|
+
var InvalidSessionAuthentication = createKnownErrorConstructor(SessionAuthenticationError, "INVALID_SESSION_AUTHENTICATION", "inherit", "inherit");
|
|
4666
|
+
var InvalidAccessToken = createKnownErrorConstructor(InvalidSessionAuthentication, "INVALID_ACCESS_TOKEN", "inherit", "inherit");
|
|
4667
|
+
var UnparsableAccessToken = createKnownErrorConstructor(InvalidAccessToken, "UNPARSABLE_ACCESS_TOKEN", () => [401, "Access token is not parsable."], () => []);
|
|
4668
|
+
var AccessTokenExpired = createKnownErrorConstructor(InvalidAccessToken, "ACCESS_TOKEN_EXPIRED", (expiredAt, projectId, userId, refreshTokenId) => [
|
|
4669
|
+
401,
|
|
4670
|
+
deindent`
|
|
4671
|
+
Access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : ""}${projectId ? ` Project ID: ${projectId}.` : ""}${userId ? ` User ID: ${userId}.` : ""}${refreshTokenId ? ` Refresh token ID: ${refreshTokenId}.` : ""}
|
|
4742
4672
|
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
} catch (error) {
|
|
4751
|
-
e40 = { error };
|
|
4752
|
-
} finally {
|
|
4753
|
-
try {
|
|
4754
|
-
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
4755
|
-
} finally {
|
|
4756
|
-
if (e40) throw e40.error;
|
|
4757
|
-
}
|
|
4673
|
+
Debug info: Most likely, you fetched the access token before it expired (for example, in a server component, pre-rendered page, or on page load), but then didn't refresh it before it expired. If this is the case, and you're using the SDK, make sure you call getAccessToken() every time you need to use the access token. If you're not using the SDK, make sure you refresh the access token with the refresh endpoint.
|
|
4674
|
+
`,
|
|
4675
|
+
{
|
|
4676
|
+
expired_at_millis: expiredAt?.getTime() ?? null,
|
|
4677
|
+
project_id: projectId ?? null,
|
|
4678
|
+
user_id: userId ?? null,
|
|
4679
|
+
refresh_token_id: refreshTokenId ?? null
|
|
4758
4680
|
}
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4681
|
+
], (json) => [
|
|
4682
|
+
json.expired_at_millis ? new Date(json.expired_at_millis) : void 0,
|
|
4683
|
+
json.project_id ?? void 0,
|
|
4684
|
+
json.user_id ?? void 0,
|
|
4685
|
+
json.refresh_token_id ?? void 0
|
|
4686
|
+
]);
|
|
4687
|
+
var InvalidProjectForAccessToken = createKnownErrorConstructor(InvalidAccessToken, "INVALID_PROJECT_FOR_ACCESS_TOKEN", (expectedProjectId, actualProjectId) => [
|
|
4688
|
+
401,
|
|
4689
|
+
`Access token not valid for this project. Expected project ID ${JSON.stringify(expectedProjectId)}, but the token is for project ID ${JSON.stringify(actualProjectId)}.`,
|
|
4690
|
+
{
|
|
4691
|
+
expected_project_id: expectedProjectId,
|
|
4692
|
+
actual_project_id: actualProjectId
|
|
4767
4693
|
}
|
|
4768
|
-
|
|
4769
|
-
|
|
4770
|
-
var
|
|
4771
|
-
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
args[_i] = arguments[_i];
|
|
4780
|
-
}
|
|
4781
|
-
return logProxy("debug", this._namespace, args);
|
|
4782
|
-
};
|
|
4783
|
-
DiagComponentLogger2.prototype.error = function() {
|
|
4784
|
-
var args = [];
|
|
4785
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4786
|
-
args[_i] = arguments[_i];
|
|
4787
|
-
}
|
|
4788
|
-
return logProxy("error", this._namespace, args);
|
|
4789
|
-
};
|
|
4790
|
-
DiagComponentLogger2.prototype.info = function() {
|
|
4791
|
-
var args = [];
|
|
4792
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4793
|
-
args[_i] = arguments[_i];
|
|
4794
|
-
}
|
|
4795
|
-
return logProxy("info", this._namespace, args);
|
|
4796
|
-
};
|
|
4797
|
-
DiagComponentLogger2.prototype.warn = function() {
|
|
4798
|
-
var args = [];
|
|
4799
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4800
|
-
args[_i] = arguments[_i];
|
|
4801
|
-
}
|
|
4802
|
-
return logProxy("warn", this._namespace, args);
|
|
4803
|
-
};
|
|
4804
|
-
DiagComponentLogger2.prototype.verbose = function() {
|
|
4805
|
-
var args = [];
|
|
4806
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
4807
|
-
args[_i] = arguments[_i];
|
|
4808
|
-
}
|
|
4809
|
-
return logProxy("verbose", this._namespace, args);
|
|
4810
|
-
};
|
|
4811
|
-
return DiagComponentLogger2;
|
|
4812
|
-
}()
|
|
4813
|
-
);
|
|
4814
|
-
function logProxy(funcName, namespace, args) {
|
|
4815
|
-
var logger = getGlobal("diag");
|
|
4816
|
-
if (!logger) {
|
|
4817
|
-
return;
|
|
4694
|
+
], (json) => [json.expected_project_id, json.actual_project_id]);
|
|
4695
|
+
var RefreshTokenError = createKnownErrorConstructor(KnownError, "REFRESH_TOKEN_ERROR", "inherit", "inherit");
|
|
4696
|
+
var RefreshTokenNotFoundOrExpired = createKnownErrorConstructor(RefreshTokenError, "REFRESH_TOKEN_NOT_FOUND_OR_EXPIRED", () => [401, "Refresh token not found for this project, or the session has expired/been revoked."], () => []);
|
|
4697
|
+
var CannotDeleteCurrentSession = createKnownErrorConstructor(RefreshTokenError, "CANNOT_DELETE_CURRENT_SESSION", () => [400, "Cannot delete the current session."], () => []);
|
|
4698
|
+
var ProviderRejected = createKnownErrorConstructor(RefreshTokenError, "PROVIDER_REJECTED", () => [401, "The provider refused to refresh their token. This usually means that the provider used to authenticate the user no longer regards this session as valid, and the user must re-authenticate."], () => []);
|
|
4699
|
+
var UserWithEmailAlreadyExists = createKnownErrorConstructor(KnownError, "USER_EMAIL_ALREADY_EXISTS", (email, wouldWorkIfEmailWasVerified = false) => [
|
|
4700
|
+
409,
|
|
4701
|
+
`A user with email ${JSON.stringify(email)} already exists${wouldWorkIfEmailWasVerified ? " but the email is not verified. Please login to your existing account with the method you used to sign up, and then verify your email to sign in with this login method." : "."}`,
|
|
4702
|
+
{
|
|
4703
|
+
email,
|
|
4704
|
+
would_work_if_email_was_verified: wouldWorkIfEmailWasVerified
|
|
4818
4705
|
}
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4827
|
-
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4706
|
+
], (json) => [json.email, json.would_work_if_email_was_verified ?? false]);
|
|
4707
|
+
var EmailNotVerified = createKnownErrorConstructor(KnownError, "EMAIL_NOT_VERIFIED", () => [400, "The email is not verified."], () => []);
|
|
4708
|
+
var CannotGetOwnUserWithoutUser = createKnownErrorConstructor(KnownError, "CANNOT_GET_OWN_USER_WITHOUT_USER", () => [400, "You have specified 'me' as a userId, but did not provide authentication for a user."], () => []);
|
|
4709
|
+
var UserIdDoesNotExist = createKnownErrorConstructor(KnownError, "USER_ID_DOES_NOT_EXIST", (userId) => [
|
|
4710
|
+
400,
|
|
4711
|
+
`The given user with the ID ${userId} does not exist.`,
|
|
4712
|
+
{ user_id: userId }
|
|
4713
|
+
], (json) => [json.user_id]);
|
|
4714
|
+
var UserNotFound = createKnownErrorConstructor(KnownError, "USER_NOT_FOUND", () => [404, "User not found."], () => []);
|
|
4715
|
+
var RestrictedUserNotAllowed = createKnownErrorConstructor(KnownError, "RESTRICTED_USER_NOT_ALLOWED", (restrictedReason) => [
|
|
4716
|
+
403,
|
|
4717
|
+
`The user in the access token is in restricted state. Reason: ${restrictedReason.type}. Please pass the X-Stack-Allow-Restricted-User header if this is intended.`,
|
|
4718
|
+
{ restricted_reason: restrictedReason }
|
|
4719
|
+
], (json) => [json.restricted_reason ?? { type: "anonymous" }]);
|
|
4720
|
+
var ProjectNotFound = createKnownErrorConstructor(KnownError, "PROJECT_NOT_FOUND", (projectId) => {
|
|
4721
|
+
if (typeof projectId !== "string") throw new HexclaveAssertionError("projectId of KnownErrors.ProjectNotFound must be a string");
|
|
4722
|
+
return [
|
|
4723
|
+
404,
|
|
4724
|
+
`Project ${projectId} not found or is not accessible with the current user.`,
|
|
4725
|
+
{ project_id: projectId }
|
|
4726
|
+
];
|
|
4727
|
+
}, (json) => [json.project_id]);
|
|
4728
|
+
var CurrentProjectNotFound = createKnownErrorConstructor(KnownError, "CURRENT_PROJECT_NOT_FOUND", (projectId) => [
|
|
4729
|
+
400,
|
|
4730
|
+
`The current project with ID ${projectId} was not found. Please check the value of the x-hexclave-project-id header. (The legacy x-stack-project-id header is also accepted.)`,
|
|
4731
|
+
{ project_id: projectId }
|
|
4732
|
+
], (json) => [json.project_id]);
|
|
4733
|
+
var BranchDoesNotExist = createKnownErrorConstructor(KnownError, "BRANCH_DOES_NOT_EXIST", (branchId) => [
|
|
4734
|
+
400,
|
|
4735
|
+
`The branch with ID ${branchId} does not exist.`,
|
|
4736
|
+
{ branch_id: branchId }
|
|
4737
|
+
], (json) => [json.branch_id]);
|
|
4738
|
+
var SignUpNotEnabled = createKnownErrorConstructor(KnownError, "SIGN_UP_NOT_ENABLED", () => [400, "Creation of new accounts is not enabled for this project. Please ask the project owner to enable it."], () => []);
|
|
4739
|
+
var SignUpRejected = createKnownErrorConstructor(KnownError, "SIGN_UP_REJECTED", (message) => [
|
|
4740
|
+
403,
|
|
4741
|
+
message ?? "Your sign up was rejected by an administrator's sign-up rule.",
|
|
4742
|
+
{ message: message ?? "Your sign up was rejected by an administrator's sign-up rule." }
|
|
4743
|
+
], (json) => [json.message]);
|
|
4744
|
+
var BotChallengeRequired = createKnownErrorConstructor(KnownError, "BOT_CHALLENGE_REQUIRED", () => [409, "An additional bot challenge is required before sign-up can continue."], () => []);
|
|
4745
|
+
var BotChallengeFailed = createKnownErrorConstructor(KnownError, "BOT_CHALLENGE_FAILED", (message) => [
|
|
4746
|
+
400,
|
|
4747
|
+
message,
|
|
4748
|
+
{ message }
|
|
4749
|
+
], (json) => [json.message]);
|
|
4750
|
+
var PasswordAuthenticationNotEnabled = createKnownErrorConstructor(KnownError, "PASSWORD_AUTHENTICATION_NOT_ENABLED", () => [400, "Password authentication is not enabled for this project."], () => []);
|
|
4751
|
+
var DataVaultStoreDoesNotExist = createKnownErrorConstructor(KnownError, "DATA_VAULT_STORE_DOES_NOT_EXIST", (storeId) => [
|
|
4752
|
+
400,
|
|
4753
|
+
`Data vault store with ID ${storeId} does not exist.`,
|
|
4754
|
+
{ store_id: storeId }
|
|
4755
|
+
], (json) => [json.store_id]);
|
|
4756
|
+
var DataVaultStoreHashedKeyDoesNotExist = createKnownErrorConstructor(KnownError, "DATA_VAULT_STORE_HASHED_KEY_DOES_NOT_EXIST", (storeId, hashedKey) => [
|
|
4757
|
+
400,
|
|
4758
|
+
`Data vault store with ID ${storeId} does not contain a key with hash ${hashedKey}.`,
|
|
4759
|
+
{
|
|
4760
|
+
store_id: storeId,
|
|
4761
|
+
hashed_key: hashedKey
|
|
4841
4762
|
}
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4763
|
+
], (json) => [json.store_id, json.hashed_key]);
|
|
4764
|
+
var PasskeyAuthenticationNotEnabled = createKnownErrorConstructor(KnownError, "PASSKEY_AUTHENTICATION_NOT_ENABLED", () => [400, "Passkey authentication is not enabled for this project."], () => []);
|
|
4765
|
+
var AnonymousAccountsNotEnabled = createKnownErrorConstructor(KnownError, "ANONYMOUS_ACCOUNTS_NOT_ENABLED", () => [400, "Anonymous accounts are not enabled for this project."], () => []);
|
|
4766
|
+
var AnonymousAuthenticationNotAllowed = createKnownErrorConstructor(KnownError, "ANONYMOUS_AUTHENTICATION_NOT_ALLOWED", () => [401, "X-Stack-Access-Token is for an anonymous user, but anonymous users are not enabled. Set the X-Stack-Allow-Anonymous-User header of this request to 'true' to allow anonymous users."], () => []);
|
|
4767
|
+
var EmailPasswordMismatch = createKnownErrorConstructor(KnownError, "EMAIL_PASSWORD_MISMATCH", () => [400, "Wrong e-mail or password."], () => []);
|
|
4768
|
+
var RedirectUrlNotWhitelisted = createKnownErrorConstructor(KnownError, "REDIRECT_URL_NOT_WHITELISTED", (redirectUrl) => [
|
|
4769
|
+
400,
|
|
4770
|
+
"Redirect URL not whitelisted. Did you forget to add this domain to the trusted domains list on the Hexclave dashboard?",
|
|
4771
|
+
redirectUrl === void 0 ? void 0 : { redirect_url: redirectUrl }
|
|
4772
|
+
], (json) => [json?.redirect_url]);
|
|
4773
|
+
var PasswordRequirementsNotMet = createKnownErrorConstructor(KnownError, "PASSWORD_REQUIREMENTS_NOT_MET", "inherit", "inherit");
|
|
4774
|
+
var PasswordTooShort = createKnownErrorConstructor(PasswordRequirementsNotMet, "PASSWORD_TOO_SHORT", (minLength) => [
|
|
4775
|
+
400,
|
|
4776
|
+
`Password too short. Minimum length is ${minLength}.`,
|
|
4777
|
+
{ min_length: minLength }
|
|
4778
|
+
], (json) => [json?.min_length ?? throwErr("min_length not found in PasswordTooShort details")]);
|
|
4779
|
+
var PasswordTooLong = createKnownErrorConstructor(PasswordRequirementsNotMet, "PASSWORD_TOO_LONG", (maxLength) => [
|
|
4780
|
+
400,
|
|
4781
|
+
`Password too long. Maximum length is ${maxLength}.`,
|
|
4782
|
+
{ maxLength }
|
|
4783
|
+
], (json) => [json?.maxLength ?? throwErr("maxLength not found in PasswordTooLong details")]);
|
|
4784
|
+
var UserDoesNotHavePassword = createKnownErrorConstructor(KnownError, "USER_DOES_NOT_HAVE_PASSWORD", () => [400, "This user does not have password authentication enabled."], () => []);
|
|
4785
|
+
var VerificationCodeError = createKnownErrorConstructor(KnownError, "VERIFICATION_ERROR", "inherit", "inherit");
|
|
4786
|
+
var VerificationCodeNotFound = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_NOT_FOUND", () => [404, "The verification code does not exist for this project."], () => []);
|
|
4787
|
+
var VerificationCodeExpired = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_EXPIRED", () => [400, "The verification code has expired."], () => []);
|
|
4788
|
+
var VerificationCodeAlreadyUsed = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_ALREADY_USED", () => [409, "The verification link has already been used."], () => []);
|
|
4789
|
+
var VerificationCodeMaxAttemptsReached = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_MAX_ATTEMPTS_REACHED", () => [400, "The verification code nonce has reached the maximum number of attempts. This code is not valid anymore."], () => []);
|
|
4790
|
+
var PasswordConfirmationMismatch = createKnownErrorConstructor(KnownError, "PASSWORD_CONFIRMATION_MISMATCH", () => [400, "Passwords do not match."], () => []);
|
|
4791
|
+
var EmailAlreadyVerified = createKnownErrorConstructor(KnownError, "EMAIL_ALREADY_VERIFIED", () => [409, "The e-mail is already verified."], () => []);
|
|
4792
|
+
var EmailNotAssociatedWithUser = createKnownErrorConstructor(KnownError, "EMAIL_NOT_ASSOCIATED_WITH_USER", () => [400, "The e-mail is not associated with a user that could log in with that e-mail."], () => []);
|
|
4793
|
+
var EmailIsNotPrimaryEmail = createKnownErrorConstructor(KnownError, "EMAIL_IS_NOT_PRIMARY_EMAIL", (email, primaryEmail) => [
|
|
4794
|
+
400,
|
|
4795
|
+
`The given e-mail (${email}) must equal the user's primary e-mail (${primaryEmail}).`,
|
|
4796
|
+
{
|
|
4797
|
+
email,
|
|
4798
|
+
primary_email: primaryEmail
|
|
4850
4799
|
}
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
4861
|
-
var __read2 = function(o21, n9) {
|
|
4862
|
-
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
4863
|
-
if (!m5) return o21;
|
|
4864
|
-
var i = m5.call(o21), r7, ar = [], e40;
|
|
4865
|
-
try {
|
|
4866
|
-
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
4867
|
-
} catch (error) {
|
|
4868
|
-
e40 = { error };
|
|
4869
|
-
} finally {
|
|
4870
|
-
try {
|
|
4871
|
-
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
4872
|
-
} finally {
|
|
4873
|
-
if (e40) throw e40.error;
|
|
4874
|
-
}
|
|
4800
|
+
], (json) => [json.email, json.primary_email]);
|
|
4801
|
+
var PasskeyRegistrationFailed = createKnownErrorConstructor(KnownError, "PASSKEY_REGISTRATION_FAILED", (message) => [400, message], (json) => [json.message]);
|
|
4802
|
+
var PasskeyWebAuthnError = createKnownErrorConstructor(KnownError, "PASSKEY_WEBAUTHN_ERROR", (message, code) => [
|
|
4803
|
+
400,
|
|
4804
|
+
message,
|
|
4805
|
+
{
|
|
4806
|
+
message,
|
|
4807
|
+
code
|
|
4875
4808
|
}
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
var
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4809
|
+
], (json) => [json.message, json.code]);
|
|
4810
|
+
var PasskeyAuthenticationFailed = createKnownErrorConstructor(KnownError, "PASSKEY_AUTHENTICATION_FAILED", (message) => [400, message], (json) => [json.message]);
|
|
4811
|
+
var PermissionNotFound = createKnownErrorConstructor(KnownError, "PERMISSION_NOT_FOUND", (permissionId) => [
|
|
4812
|
+
404,
|
|
4813
|
+
`Permission "${permissionId}" not found. Make sure you created it on the dashboard.`,
|
|
4814
|
+
{ permission_id: permissionId }
|
|
4815
|
+
], (json) => [json.permission_id]);
|
|
4816
|
+
var PermissionScopeMismatch = createKnownErrorConstructor(KnownError, "WRONG_PERMISSION_SCOPE", (permissionId, expectedScope, actualScope) => [
|
|
4817
|
+
404,
|
|
4818
|
+
`Permission ${JSON.stringify(permissionId)} not found. (It was found for a different scope ${JSON.stringify(actualScope)}, but scope ${JSON.stringify(expectedScope)} was expected.)`,
|
|
4819
|
+
{
|
|
4820
|
+
permission_id: permissionId,
|
|
4821
|
+
expected_scope: expectedScope,
|
|
4822
|
+
actual_scope: actualScope
|
|
4884
4823
|
}
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
|
|
4888
|
-
|
|
4889
|
-
|
|
4890
|
-
|
|
4891
|
-
|
|
4892
|
-
|
|
4893
|
-
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
4912
|
-
self2.error((_a5 = err.stack) !== null && _a5 !== void 0 ? _a5 : err.message);
|
|
4913
|
-
return false;
|
|
4914
|
-
}
|
|
4915
|
-
if (typeof optionsOrLogLevel === "number") {
|
|
4916
|
-
optionsOrLogLevel = {
|
|
4917
|
-
logLevel: optionsOrLogLevel
|
|
4918
|
-
};
|
|
4919
|
-
}
|
|
4920
|
-
var oldLogger = getGlobal("diag");
|
|
4921
|
-
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
4922
|
-
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
4923
|
-
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
4924
|
-
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
4925
|
-
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
4926
|
-
}
|
|
4927
|
-
return registerGlobal("diag", newLogger, self2, true);
|
|
4928
|
-
};
|
|
4929
|
-
self2.setLogger = setLogger;
|
|
4930
|
-
self2.disable = function() {
|
|
4931
|
-
unregisterGlobal(API_NAME, self2);
|
|
4932
|
-
};
|
|
4933
|
-
self2.createComponentLogger = function(options) {
|
|
4934
|
-
return new DiagComponentLogger(options);
|
|
4935
|
-
};
|
|
4936
|
-
self2.verbose = _logProxy("verbose");
|
|
4937
|
-
self2.debug = _logProxy("debug");
|
|
4938
|
-
self2.info = _logProxy("info");
|
|
4939
|
-
self2.warn = _logProxy("warn");
|
|
4940
|
-
self2.error = _logProxy("error");
|
|
4941
|
-
}
|
|
4942
|
-
DiagAPI2.instance = function() {
|
|
4943
|
-
if (!this._instance) {
|
|
4944
|
-
this._instance = new DiagAPI2();
|
|
4945
|
-
}
|
|
4946
|
-
return this._instance;
|
|
4947
|
-
};
|
|
4948
|
-
return DiagAPI2;
|
|
4949
|
-
}()
|
|
4950
|
-
);
|
|
4951
|
-
|
|
4952
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/context/context.js
|
|
4953
|
-
function createContextKey(description) {
|
|
4954
|
-
return Symbol.for(description);
|
|
4955
|
-
}
|
|
4956
|
-
var BaseContext = (
|
|
4957
|
-
/** @class */
|
|
4958
|
-
/* @__PURE__ */ function() {
|
|
4959
|
-
function BaseContext2(parentContext) {
|
|
4960
|
-
var self2 = this;
|
|
4961
|
-
self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
4962
|
-
self2.getValue = function(key) {
|
|
4963
|
-
return self2._currentContext.get(key);
|
|
4964
|
-
};
|
|
4965
|
-
self2.setValue = function(key, value) {
|
|
4966
|
-
var context = new BaseContext2(self2._currentContext);
|
|
4967
|
-
context._currentContext.set(key, value);
|
|
4968
|
-
return context;
|
|
4969
|
-
};
|
|
4970
|
-
self2.deleteValue = function(key) {
|
|
4971
|
-
var context = new BaseContext2(self2._currentContext);
|
|
4972
|
-
context._currentContext.delete(key);
|
|
4973
|
-
return context;
|
|
4974
|
-
};
|
|
4975
|
-
}
|
|
4976
|
-
return BaseContext2;
|
|
4977
|
-
}()
|
|
4978
|
-
);
|
|
4979
|
-
var ROOT_CONTEXT = new BaseContext();
|
|
4980
|
-
|
|
4981
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
|
|
4982
|
-
var __read3 = function(o21, n9) {
|
|
4983
|
-
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
4984
|
-
if (!m5) return o21;
|
|
4985
|
-
var i = m5.call(o21), r7, ar = [], e40;
|
|
4986
|
-
try {
|
|
4987
|
-
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
4988
|
-
} catch (error) {
|
|
4989
|
-
e40 = { error };
|
|
4990
|
-
} finally {
|
|
4991
|
-
try {
|
|
4992
|
-
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
4993
|
-
} finally {
|
|
4994
|
-
if (e40) throw e40.error;
|
|
4995
|
-
}
|
|
4824
|
+
], (json) => [
|
|
4825
|
+
json.permission_id,
|
|
4826
|
+
json.expected_scope,
|
|
4827
|
+
json.actual_scope
|
|
4828
|
+
]);
|
|
4829
|
+
var ContainedPermissionNotFound = createKnownErrorConstructor(KnownError, "CONTAINED_PERMISSION_NOT_FOUND", (permissionId) => [
|
|
4830
|
+
400,
|
|
4831
|
+
`Contained permission with ID "${permissionId}" not found. Make sure you created it on the dashboard.`,
|
|
4832
|
+
{ permission_id: permissionId }
|
|
4833
|
+
], (json) => [json.permission_id]);
|
|
4834
|
+
var TeamNotFound = createKnownErrorConstructor(KnownError, "TEAM_NOT_FOUND", (teamId) => [
|
|
4835
|
+
404,
|
|
4836
|
+
`Team ${teamId} not found.`,
|
|
4837
|
+
{ team_id: teamId }
|
|
4838
|
+
], (json) => [json.team_id]);
|
|
4839
|
+
createKnownErrorConstructor(KnownError, "TEAM_ALREADY_EXISTS", (teamId) => [
|
|
4840
|
+
409,
|
|
4841
|
+
`Team ${teamId} already exists.`,
|
|
4842
|
+
{ team_id: teamId }
|
|
4843
|
+
], (json) => [json.team_id]);
|
|
4844
|
+
var TeamMembershipNotFound = createKnownErrorConstructor(KnownError, "TEAM_MEMBERSHIP_NOT_FOUND", (teamId, userId) => [
|
|
4845
|
+
404,
|
|
4846
|
+
`User ${userId} is not found in team ${teamId}.`,
|
|
4847
|
+
{
|
|
4848
|
+
team_id: teamId,
|
|
4849
|
+
user_id: userId
|
|
4996
4850
|
}
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
4851
|
+
], (json) => [json.team_id, json.user_id]);
|
|
4852
|
+
var TeamInvitationRestrictedUserNotAllowed = createKnownErrorConstructor(KnownError, "TEAM_INVITATION_RESTRICTED_USER_NOT_ALLOWED", (restrictedReason) => [
|
|
4853
|
+
403,
|
|
4854
|
+
`Restricted users cannot accept team invitations. Reason: ${restrictedReason.type}. Please complete the onboarding process before accepting team invitations.`,
|
|
4855
|
+
{ restricted_reason: restrictedReason }
|
|
4856
|
+
], (json) => [json.restricted_reason ?? { type: "anonymous" }]);
|
|
4857
|
+
var TeamInvitationEmailMismatch = createKnownErrorConstructor(KnownError, "TEAM_INVITATION_EMAIL_MISMATCH", () => [403, "This team invitation was sent to a different email address. Sign in with the invited email, or add and verify that email on your account, then try again."], () => []);
|
|
4858
|
+
var EmailTemplateAlreadyExists = createKnownErrorConstructor(KnownError, "EMAIL_TEMPLATE_ALREADY_EXISTS", () => [409, "Email template already exists."], () => []);
|
|
4859
|
+
var OAuthConnectionNotConnectedToUser = createKnownErrorConstructor(KnownError, "OAUTH_CONNECTION_NOT_CONNECTED_TO_USER", () => [400, "The OAuth connection is not connected to any user."], () => []);
|
|
4860
|
+
var OAuthConnectionAlreadyConnectedToAnotherUser = createKnownErrorConstructor(KnownError, "OAUTH_CONNECTION_ALREADY_CONNECTED_TO_ANOTHER_USER", () => [409, "The OAuth connection is already connected to another user."], () => []);
|
|
4861
|
+
var OAuthConnectionDoesNotHaveRequiredScope = createKnownErrorConstructor(KnownError, "OAUTH_CONNECTION_DOES_NOT_HAVE_REQUIRED_SCOPE", () => [400, "The OAuth connection does not have the required scope."], () => []);
|
|
4862
|
+
var OAuthAccessTokenNotAvailable = createKnownErrorConstructor(KnownError, "OAUTH_ACCESS_TOKEN_NOT_AVAILABLE", (provider, details) => [
|
|
4863
|
+
400,
|
|
4864
|
+
`Failed to retrieve an OAuth access token for the connected account (provider: ${provider}). ${details}`,
|
|
4865
|
+
{
|
|
4866
|
+
provider,
|
|
4867
|
+
details
|
|
5005
4868
|
}
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
var
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
);
|
|
5035
|
-
|
|
5036
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/context.js
|
|
5037
|
-
var __read4 = function(o21, n9) {
|
|
5038
|
-
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
5039
|
-
if (!m5) return o21;
|
|
5040
|
-
var i = m5.call(o21), r7, ar = [], e40;
|
|
5041
|
-
try {
|
|
5042
|
-
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
5043
|
-
} catch (error) {
|
|
5044
|
-
e40 = { error };
|
|
5045
|
-
} finally {
|
|
5046
|
-
try {
|
|
5047
|
-
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
5048
|
-
} finally {
|
|
5049
|
-
if (e40) throw e40.error;
|
|
5050
|
-
}
|
|
4869
|
+
], (json) => [json.provider, json.details]);
|
|
4870
|
+
var OAuthExtraScopeNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(KnownError, "OAUTH_EXTRA_SCOPE_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS", () => [400, "Extra scopes are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use extra scopes."], () => []);
|
|
4871
|
+
var OAuthAccessTokenNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(KnownError, "OAUTH_ACCESS_TOKEN_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS", () => [400, "Access tokens are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use access tokens."], () => []);
|
|
4872
|
+
var InvalidOAuthClientIdOrSecret = createKnownErrorConstructor(KnownError, "INVALID_OAUTH_CLIENT_ID_OR_SECRET", (clientId) => [
|
|
4873
|
+
400,
|
|
4874
|
+
"The OAuth client ID or secret is invalid. The client ID must be equal to the project ID (potentially with a hash and a branch ID), and the client secret must be a publishable client key.",
|
|
4875
|
+
{ client_id: clientId ?? null }
|
|
4876
|
+
], (json) => [json.client_id ?? void 0]);
|
|
4877
|
+
var InvalidScope = createKnownErrorConstructor(KnownError, "INVALID_SCOPE", (scope) => [400, `The scope "${scope}" is not a valid OAuth scope for Stack.`], (json) => [json.scope]);
|
|
4878
|
+
var UserAlreadyConnectedToAnotherOAuthConnection = createKnownErrorConstructor(KnownError, "USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION", () => [409, "The user is already connected to another OAuth account. Did you maybe selected the wrong account?"], () => []);
|
|
4879
|
+
var OuterOAuthTimeout = createKnownErrorConstructor(KnownError, "OUTER_OAUTH_TIMEOUT", () => [408, "The OAuth flow has timed out. Please sign in again."], () => []);
|
|
4880
|
+
var OAuthProviderNotFoundOrNotEnabled = createKnownErrorConstructor(KnownError, "OAUTH_PROVIDER_NOT_FOUND_OR_NOT_ENABLED", () => [400, "The OAuth provider is not found or not enabled."], () => []);
|
|
4881
|
+
var AppleBundleIdNotConfigured = createKnownErrorConstructor(KnownError, "APPLE_BUNDLE_ID_NOT_CONFIGURED", () => [400, "Apple Sign In is enabled, but no Bundle IDs are configured. Please add your app's Bundle ID in the Hexclave dashboard under OAuth Providers > Apple > Apple Bundle IDs."], () => []);
|
|
4882
|
+
var OAuthProviderAccountIdAlreadyUsedForSignIn = createKnownErrorConstructor(KnownError, "OAUTH_PROVIDER_ACCOUNT_ID_ALREADY_USED_FOR_SIGN_IN", () => [400, `A provider with the same account ID is already used for signing in.`], () => []);
|
|
4883
|
+
var MultiFactorAuthenticationRequired = createKnownErrorConstructor(KnownError, "MULTI_FACTOR_AUTHENTICATION_REQUIRED", (attemptCode) => [
|
|
4884
|
+
400,
|
|
4885
|
+
`Multi-factor authentication is required for this user.`,
|
|
4886
|
+
{ attempt_code: attemptCode }
|
|
4887
|
+
], (json) => [json.attempt_code]);
|
|
4888
|
+
var InvalidTotpCode = createKnownErrorConstructor(KnownError, "INVALID_TOTP_CODE", () => [400, "The TOTP code is invalid. Please try again."], () => []);
|
|
4889
|
+
var UserAuthenticationRequired = createKnownErrorConstructor(KnownError, "USER_AUTHENTICATION_REQUIRED", () => [401, "User authentication required for this endpoint."], () => []);
|
|
4890
|
+
var TeamMembershipAlreadyExists = createKnownErrorConstructor(KnownError, "TEAM_MEMBERSHIP_ALREADY_EXISTS", () => [409, "Team membership already exists."], () => []);
|
|
4891
|
+
var ProjectPermissionRequired = createKnownErrorConstructor(KnownError, "PROJECT_PERMISSION_REQUIRED", (userId, permissionId) => [
|
|
4892
|
+
401,
|
|
4893
|
+
`User ${userId} does not have permission ${permissionId}.`,
|
|
4894
|
+
{
|
|
4895
|
+
user_id: userId,
|
|
4896
|
+
permission_id: permissionId
|
|
5051
4897
|
}
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5058
|
-
|
|
5059
|
-
|
|
5060
|
-
}
|
|
5061
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
5062
|
-
};
|
|
5063
|
-
var API_NAME2 = "context";
|
|
5064
|
-
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
5065
|
-
var ContextAPI = (
|
|
5066
|
-
/** @class */
|
|
5067
|
-
function() {
|
|
5068
|
-
function ContextAPI2() {
|
|
5069
|
-
}
|
|
5070
|
-
ContextAPI2.getInstance = function() {
|
|
5071
|
-
if (!this._instance) {
|
|
5072
|
-
this._instance = new ContextAPI2();
|
|
5073
|
-
}
|
|
5074
|
-
return this._instance;
|
|
5075
|
-
};
|
|
5076
|
-
ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
|
|
5077
|
-
return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
|
|
5078
|
-
};
|
|
5079
|
-
ContextAPI2.prototype.active = function() {
|
|
5080
|
-
return this._getContextManager().active();
|
|
5081
|
-
};
|
|
5082
|
-
ContextAPI2.prototype.with = function(context, fn, thisArg) {
|
|
5083
|
-
var _a5;
|
|
5084
|
-
var args = [];
|
|
5085
|
-
for (var _i = 3; _i < arguments.length; _i++) {
|
|
5086
|
-
args[_i - 3] = arguments[_i];
|
|
5087
|
-
}
|
|
5088
|
-
return (_a5 = this._getContextManager()).with.apply(_a5, __spreadArray4([context, fn, thisArg], __read4(args), false));
|
|
5089
|
-
};
|
|
5090
|
-
ContextAPI2.prototype.bind = function(context, target) {
|
|
5091
|
-
return this._getContextManager().bind(context, target);
|
|
5092
|
-
};
|
|
5093
|
-
ContextAPI2.prototype._getContextManager = function() {
|
|
5094
|
-
return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
|
|
5095
|
-
};
|
|
5096
|
-
ContextAPI2.prototype.disable = function() {
|
|
5097
|
-
this._getContextManager().disable();
|
|
5098
|
-
unregisterGlobal(API_NAME2, DiagAPI.instance());
|
|
5099
|
-
};
|
|
5100
|
-
return ContextAPI2;
|
|
5101
|
-
}()
|
|
5102
|
-
);
|
|
5103
|
-
|
|
5104
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
|
|
5105
|
-
var TraceFlags;
|
|
5106
|
-
(function(TraceFlags2) {
|
|
5107
|
-
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
5108
|
-
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
5109
|
-
})(TraceFlags || (TraceFlags = {}));
|
|
5110
|
-
|
|
5111
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
|
|
5112
|
-
var INVALID_SPANID = "0000000000000000";
|
|
5113
|
-
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
5114
|
-
var INVALID_SPAN_CONTEXT = {
|
|
5115
|
-
traceId: INVALID_TRACEID,
|
|
5116
|
-
spanId: INVALID_SPANID,
|
|
5117
|
-
traceFlags: TraceFlags.NONE
|
|
5118
|
-
};
|
|
5119
|
-
|
|
5120
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
|
|
5121
|
-
var NonRecordingSpan = (
|
|
5122
|
-
/** @class */
|
|
5123
|
-
function() {
|
|
5124
|
-
function NonRecordingSpan2(_spanContext) {
|
|
5125
|
-
if (_spanContext === void 0) {
|
|
5126
|
-
_spanContext = INVALID_SPAN_CONTEXT;
|
|
5127
|
-
}
|
|
5128
|
-
this._spanContext = _spanContext;
|
|
5129
|
-
}
|
|
5130
|
-
NonRecordingSpan2.prototype.spanContext = function() {
|
|
5131
|
-
return this._spanContext;
|
|
5132
|
-
};
|
|
5133
|
-
NonRecordingSpan2.prototype.setAttribute = function(_key, _value) {
|
|
5134
|
-
return this;
|
|
5135
|
-
};
|
|
5136
|
-
NonRecordingSpan2.prototype.setAttributes = function(_attributes) {
|
|
5137
|
-
return this;
|
|
5138
|
-
};
|
|
5139
|
-
NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) {
|
|
5140
|
-
return this;
|
|
5141
|
-
};
|
|
5142
|
-
NonRecordingSpan2.prototype.addLink = function(_link) {
|
|
5143
|
-
return this;
|
|
5144
|
-
};
|
|
5145
|
-
NonRecordingSpan2.prototype.addLinks = function(_links) {
|
|
5146
|
-
return this;
|
|
5147
|
-
};
|
|
5148
|
-
NonRecordingSpan2.prototype.setStatus = function(_status) {
|
|
5149
|
-
return this;
|
|
5150
|
-
};
|
|
5151
|
-
NonRecordingSpan2.prototype.updateName = function(_name) {
|
|
5152
|
-
return this;
|
|
5153
|
-
};
|
|
5154
|
-
NonRecordingSpan2.prototype.end = function(_endTime) {
|
|
5155
|
-
};
|
|
5156
|
-
NonRecordingSpan2.prototype.isRecording = function() {
|
|
5157
|
-
return false;
|
|
5158
|
-
};
|
|
5159
|
-
NonRecordingSpan2.prototype.recordException = function(_exception, _time) {
|
|
5160
|
-
};
|
|
5161
|
-
return NonRecordingSpan2;
|
|
5162
|
-
}()
|
|
5163
|
-
);
|
|
5164
|
-
|
|
5165
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
|
|
5166
|
-
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
5167
|
-
function getSpan(context) {
|
|
5168
|
-
return context.getValue(SPAN_KEY) || void 0;
|
|
5169
|
-
}
|
|
5170
|
-
function getActiveSpan() {
|
|
5171
|
-
return getSpan(ContextAPI.getInstance().active());
|
|
5172
|
-
}
|
|
5173
|
-
function setSpan(context, span) {
|
|
5174
|
-
return context.setValue(SPAN_KEY, span);
|
|
5175
|
-
}
|
|
5176
|
-
function deleteSpan(context) {
|
|
5177
|
-
return context.deleteValue(SPAN_KEY);
|
|
5178
|
-
}
|
|
5179
|
-
function setSpanContext(context, spanContext) {
|
|
5180
|
-
return setSpan(context, new NonRecordingSpan(spanContext));
|
|
5181
|
-
}
|
|
5182
|
-
function getSpanContext(context) {
|
|
5183
|
-
var _a5;
|
|
5184
|
-
return (_a5 = getSpan(context)) === null || _a5 === void 0 ? void 0 : _a5.spanContext();
|
|
5185
|
-
}
|
|
5186
|
-
|
|
5187
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
|
|
5188
|
-
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
|
|
5189
|
-
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
|
|
5190
|
-
function isValidTraceId(traceId) {
|
|
5191
|
-
return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
|
|
5192
|
-
}
|
|
5193
|
-
function isValidSpanId(spanId) {
|
|
5194
|
-
return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
|
|
5195
|
-
}
|
|
5196
|
-
function isSpanContextValid(spanContext) {
|
|
5197
|
-
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
5198
|
-
}
|
|
5199
|
-
function wrapSpanContext(spanContext) {
|
|
5200
|
-
return new NonRecordingSpan(spanContext);
|
|
5201
|
-
}
|
|
5202
|
-
|
|
5203
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
|
|
5204
|
-
var contextApi = ContextAPI.getInstance();
|
|
5205
|
-
var NoopTracer = (
|
|
5206
|
-
/** @class */
|
|
5207
|
-
function() {
|
|
5208
|
-
function NoopTracer2() {
|
|
5209
|
-
}
|
|
5210
|
-
NoopTracer2.prototype.startSpan = function(name, options, context) {
|
|
5211
|
-
if (context === void 0) {
|
|
5212
|
-
context = contextApi.active();
|
|
5213
|
-
}
|
|
5214
|
-
var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
5215
|
-
if (root) {
|
|
5216
|
-
return new NonRecordingSpan();
|
|
5217
|
-
}
|
|
5218
|
-
var parentFromContext = context && getSpanContext(context);
|
|
5219
|
-
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
|
|
5220
|
-
return new NonRecordingSpan(parentFromContext);
|
|
5221
|
-
} else {
|
|
5222
|
-
return new NonRecordingSpan();
|
|
5223
|
-
}
|
|
5224
|
-
};
|
|
5225
|
-
NoopTracer2.prototype.startActiveSpan = function(name, arg2, arg3, arg4) {
|
|
5226
|
-
var opts;
|
|
5227
|
-
var ctx;
|
|
5228
|
-
var fn;
|
|
5229
|
-
if (arguments.length < 2) {
|
|
5230
|
-
return;
|
|
5231
|
-
} else if (arguments.length === 2) {
|
|
5232
|
-
fn = arg2;
|
|
5233
|
-
} else if (arguments.length === 3) {
|
|
5234
|
-
opts = arg2;
|
|
5235
|
-
fn = arg3;
|
|
5236
|
-
} else {
|
|
5237
|
-
opts = arg2;
|
|
5238
|
-
ctx = arg3;
|
|
5239
|
-
fn = arg4;
|
|
5240
|
-
}
|
|
5241
|
-
var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
5242
|
-
var span = this.startSpan(name, opts, parentContext);
|
|
5243
|
-
var contextWithSpanSet = setSpan(parentContext, span);
|
|
5244
|
-
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
5245
|
-
};
|
|
5246
|
-
return NoopTracer2;
|
|
5247
|
-
}()
|
|
5248
|
-
);
|
|
5249
|
-
function isSpanContext(spanContext) {
|
|
5250
|
-
return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
|
|
5251
|
-
}
|
|
5252
|
-
|
|
5253
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
|
|
5254
|
-
var NOOP_TRACER = new NoopTracer();
|
|
5255
|
-
var ProxyTracer = (
|
|
5256
|
-
/** @class */
|
|
5257
|
-
function() {
|
|
5258
|
-
function ProxyTracer2(_provider, name, version, options) {
|
|
5259
|
-
this._provider = _provider;
|
|
5260
|
-
this.name = name;
|
|
5261
|
-
this.version = version;
|
|
5262
|
-
this.options = options;
|
|
5263
|
-
}
|
|
5264
|
-
ProxyTracer2.prototype.startSpan = function(name, options, context) {
|
|
5265
|
-
return this._getTracer().startSpan(name, options, context);
|
|
5266
|
-
};
|
|
5267
|
-
ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
|
5268
|
-
var tracer2 = this._getTracer();
|
|
5269
|
-
return Reflect.apply(tracer2.startActiveSpan, tracer2, arguments);
|
|
5270
|
-
};
|
|
5271
|
-
ProxyTracer2.prototype._getTracer = function() {
|
|
5272
|
-
if (this._delegate) {
|
|
5273
|
-
return this._delegate;
|
|
5274
|
-
}
|
|
5275
|
-
var tracer2 = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
5276
|
-
if (!tracer2) {
|
|
5277
|
-
return NOOP_TRACER;
|
|
5278
|
-
}
|
|
5279
|
-
this._delegate = tracer2;
|
|
5280
|
-
return this._delegate;
|
|
5281
|
-
};
|
|
5282
|
-
return ProxyTracer2;
|
|
5283
|
-
}()
|
|
5284
|
-
);
|
|
5285
|
-
|
|
5286
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
|
|
5287
|
-
var NoopTracerProvider = (
|
|
5288
|
-
/** @class */
|
|
5289
|
-
function() {
|
|
5290
|
-
function NoopTracerProvider2() {
|
|
5291
|
-
}
|
|
5292
|
-
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
|
|
5293
|
-
return new NoopTracer();
|
|
5294
|
-
};
|
|
5295
|
-
return NoopTracerProvider2;
|
|
5296
|
-
}()
|
|
5297
|
-
);
|
|
5298
|
-
|
|
5299
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
|
|
5300
|
-
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
5301
|
-
var ProxyTracerProvider = (
|
|
5302
|
-
/** @class */
|
|
5303
|
-
function() {
|
|
5304
|
-
function ProxyTracerProvider2() {
|
|
5305
|
-
}
|
|
5306
|
-
ProxyTracerProvider2.prototype.getTracer = function(name, version, options) {
|
|
5307
|
-
var _a5;
|
|
5308
|
-
return (_a5 = this.getDelegateTracer(name, version, options)) !== null && _a5 !== void 0 ? _a5 : new ProxyTracer(this, name, version, options);
|
|
5309
|
-
};
|
|
5310
|
-
ProxyTracerProvider2.prototype.getDelegate = function() {
|
|
5311
|
-
var _a5;
|
|
5312
|
-
return (_a5 = this._delegate) !== null && _a5 !== void 0 ? _a5 : NOOP_TRACER_PROVIDER;
|
|
5313
|
-
};
|
|
5314
|
-
ProxyTracerProvider2.prototype.setDelegate = function(delegate) {
|
|
5315
|
-
this._delegate = delegate;
|
|
5316
|
-
};
|
|
5317
|
-
ProxyTracerProvider2.prototype.getDelegateTracer = function(name, version, options) {
|
|
5318
|
-
var _a5;
|
|
5319
|
-
return (_a5 = this._delegate) === null || _a5 === void 0 ? void 0 : _a5.getTracer(name, version, options);
|
|
5320
|
-
};
|
|
5321
|
-
return ProxyTracerProvider2;
|
|
5322
|
-
}()
|
|
5323
|
-
);
|
|
5324
|
-
|
|
5325
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
5326
|
-
var API_NAME3 = "trace";
|
|
5327
|
-
var TraceAPI = (
|
|
5328
|
-
/** @class */
|
|
5329
|
-
function() {
|
|
5330
|
-
function TraceAPI2() {
|
|
5331
|
-
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
5332
|
-
this.wrapSpanContext = wrapSpanContext;
|
|
5333
|
-
this.isSpanContextValid = isSpanContextValid;
|
|
5334
|
-
this.deleteSpan = deleteSpan;
|
|
5335
|
-
this.getSpan = getSpan;
|
|
5336
|
-
this.getActiveSpan = getActiveSpan;
|
|
5337
|
-
this.getSpanContext = getSpanContext;
|
|
5338
|
-
this.setSpan = setSpan;
|
|
5339
|
-
this.setSpanContext = setSpanContext;
|
|
5340
|
-
}
|
|
5341
|
-
TraceAPI2.getInstance = function() {
|
|
5342
|
-
if (!this._instance) {
|
|
5343
|
-
this._instance = new TraceAPI2();
|
|
5344
|
-
}
|
|
5345
|
-
return this._instance;
|
|
5346
|
-
};
|
|
5347
|
-
TraceAPI2.prototype.setGlobalTracerProvider = function(provider) {
|
|
5348
|
-
var success = registerGlobal(API_NAME3, this._proxyTracerProvider, DiagAPI.instance());
|
|
5349
|
-
if (success) {
|
|
5350
|
-
this._proxyTracerProvider.setDelegate(provider);
|
|
5351
|
-
}
|
|
5352
|
-
return success;
|
|
5353
|
-
};
|
|
5354
|
-
TraceAPI2.prototype.getTracerProvider = function() {
|
|
5355
|
-
return getGlobal(API_NAME3) || this._proxyTracerProvider;
|
|
5356
|
-
};
|
|
5357
|
-
TraceAPI2.prototype.getTracer = function(name, version) {
|
|
5358
|
-
return this.getTracerProvider().getTracer(name, version);
|
|
5359
|
-
};
|
|
5360
|
-
TraceAPI2.prototype.disable = function() {
|
|
5361
|
-
unregisterGlobal(API_NAME3, DiagAPI.instance());
|
|
5362
|
-
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
5363
|
-
};
|
|
5364
|
-
return TraceAPI2;
|
|
5365
|
-
}()
|
|
5366
|
-
);
|
|
5367
|
-
|
|
5368
|
-
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
5369
|
-
var trace = TraceAPI.getInstance();
|
|
5370
|
-
|
|
5371
|
-
// ../shared/dist/esm/utils/telemetry.js
|
|
5372
|
-
var tracer = trace.getTracer("stack-tracer");
|
|
5373
|
-
async function traceSpan(optionsOrDescription, fn) {
|
|
5374
|
-
let options = typeof optionsOrDescription === "string" ? { description: optionsOrDescription } : optionsOrDescription;
|
|
5375
|
-
return await tracer.startActiveSpan(`STACK: ${options.description}`, async (span) => {
|
|
5376
|
-
if (options.attributes) for (const [key, value] of Object.entries(options.attributes)) span.setAttribute(key, value);
|
|
5377
|
-
try {
|
|
5378
|
-
return await fn(span);
|
|
5379
|
-
} finally {
|
|
5380
|
-
span.end();
|
|
5381
|
-
}
|
|
5382
|
-
});
|
|
5383
|
-
}
|
|
5384
|
-
|
|
5385
|
-
// ../shared/dist/esm/known-errors.js
|
|
5386
|
-
var KnownError = class extends StatusError {
|
|
5387
|
-
constructor(statusCode, humanReadableMessage, details) {
|
|
5388
|
-
super(statusCode, humanReadableMessage);
|
|
5389
|
-
this.statusCode = statusCode;
|
|
5390
|
-
this.humanReadableMessage = humanReadableMessage;
|
|
5391
|
-
this.details = details;
|
|
5392
|
-
this.__stackKnownErrorBrand = "stack-known-error-brand-sentinel";
|
|
5393
|
-
this.name = "KnownError";
|
|
5394
|
-
}
|
|
5395
|
-
static isKnownError(error) {
|
|
5396
|
-
return typeof error === "object" && error !== null && "__stackKnownErrorBrand" in error && error.__stackKnownErrorBrand === "stack-known-error-brand-sentinel";
|
|
5397
|
-
}
|
|
5398
|
-
getBody() {
|
|
5399
|
-
return new TextEncoder().encode(JSON.stringify(this.toDescriptiveJson(), void 0, 2));
|
|
5400
|
-
}
|
|
5401
|
-
getHeaders() {
|
|
5402
|
-
return {
|
|
5403
|
-
"Content-Type": ["application/json; charset=utf-8"],
|
|
5404
|
-
"X-Stack-Known-Error": [this.errorCode],
|
|
5405
|
-
"X-Hexclave-Known-Error": [this.errorCode]
|
|
5406
|
-
};
|
|
5407
|
-
}
|
|
5408
|
-
toDescriptiveJson() {
|
|
5409
|
-
return {
|
|
5410
|
-
code: this.errorCode,
|
|
5411
|
-
...this.details ? { details: this.details } : {},
|
|
5412
|
-
error: this.humanReadableMessage
|
|
5413
|
-
};
|
|
5414
|
-
}
|
|
5415
|
-
get errorCode() {
|
|
5416
|
-
return this.constructor.errorCode ?? throwErr(`Can't find error code for this KnownError. Is its constructor a KnownErrorConstructor? ${this}`);
|
|
5417
|
-
}
|
|
5418
|
-
static constructorArgsFromJson(json) {
|
|
5419
|
-
return [
|
|
5420
|
-
400,
|
|
5421
|
-
json.message,
|
|
5422
|
-
json
|
|
5423
|
-
];
|
|
5424
|
-
}
|
|
5425
|
-
static fromJson(json) {
|
|
5426
|
-
for (const [_, KnownErrorType] of Object.entries(KnownErrors)) if (json.code === KnownErrorType.prototype.errorCode) return new KnownErrorType(...KnownErrorType.constructorArgsFromJson(json));
|
|
5427
|
-
throw new Error(`An error occurred. Please update your version of the Hexclave SDK. ${json.code}: ${json.message}`);
|
|
5428
|
-
}
|
|
5429
|
-
};
|
|
5430
|
-
function createKnownErrorConstructor(SuperClass, errorCode, create, constructorArgsFromJson) {
|
|
5431
|
-
const createFn = create === "inherit" ? identityArgs : create;
|
|
5432
|
-
const constructorArgsFromJsonFn = constructorArgsFromJson === "inherit" ? SuperClass.constructorArgsFromJson : constructorArgsFromJson;
|
|
5433
|
-
const _KnownErrorImpl = class _KnownErrorImpl extends SuperClass {
|
|
5434
|
-
constructor(...args) {
|
|
5435
|
-
super(...createFn(...args));
|
|
5436
|
-
this.name = `KnownError<${errorCode}>`;
|
|
5437
|
-
this.constructorArgs = args;
|
|
5438
|
-
}
|
|
5439
|
-
static constructorArgsFromJson(json) {
|
|
5440
|
-
return constructorArgsFromJsonFn(json.details);
|
|
5441
|
-
}
|
|
5442
|
-
static isInstance(error) {
|
|
5443
|
-
if (!KnownError.isKnownError(error)) return false;
|
|
5444
|
-
let current = error;
|
|
5445
|
-
while (true) {
|
|
5446
|
-
current = Object.getPrototypeOf(current);
|
|
5447
|
-
if (!current) break;
|
|
5448
|
-
if ("errorCode" in current.constructor && current.constructor.errorCode === errorCode) return true;
|
|
5449
|
-
}
|
|
5450
|
-
return false;
|
|
5451
|
-
}
|
|
5452
|
-
};
|
|
5453
|
-
_KnownErrorImpl.errorCode = errorCode;
|
|
5454
|
-
let KnownErrorImpl = _KnownErrorImpl;
|
|
5455
|
-
return KnownErrorImpl;
|
|
5456
|
-
}
|
|
5457
|
-
var UnsupportedError = createKnownErrorConstructor(KnownError, "UNSUPPORTED_ERROR", (originalErrorCode) => [
|
|
5458
|
-
500,
|
|
5459
|
-
`An error occurred that is not currently supported (possibly because it was added in a version of Stack that is newer than this client). The original unsupported error code was: ${originalErrorCode}`,
|
|
5460
|
-
{ originalErrorCode }
|
|
5461
|
-
], (json) => [json?.originalErrorCode ?? throwErr("originalErrorCode not found in UnsupportedError details")]);
|
|
5462
|
-
var BodyParsingError = createKnownErrorConstructor(KnownError, "BODY_PARSING_ERROR", (message) => [400, message], (json) => [json.message]);
|
|
5463
|
-
var SchemaError = createKnownErrorConstructor(KnownError, "SCHEMA_ERROR", (message) => [
|
|
5464
|
-
400,
|
|
5465
|
-
message || throwErr("SchemaError requires a message"),
|
|
5466
|
-
{ message }
|
|
5467
|
-
], (json) => [json.message]);
|
|
5468
|
-
var AllOverloadsFailed = createKnownErrorConstructor(KnownError, "ALL_OVERLOADS_FAILED", (overloadErrors) => [
|
|
5469
|
-
400,
|
|
5470
|
-
deindent`
|
|
5471
|
-
This endpoint has multiple overloads, but they all failed to process the request.
|
|
5472
|
-
|
|
5473
|
-
${overloadErrors.map((e40, i) => deindent`
|
|
5474
|
-
Overload ${i + 1}: ${JSON.stringify(e40, void 0, 2)}
|
|
5475
|
-
`).join("\n\n")}
|
|
5476
|
-
`,
|
|
5477
|
-
{ overload_errors: overloadErrors }
|
|
5478
|
-
], (json) => [json?.overload_errors ?? throwErr("overload_errors not found in AllOverloadsFailed details")]);
|
|
5479
|
-
var ProjectAuthenticationError = createKnownErrorConstructor(KnownError, "PROJECT_AUTHENTICATION_ERROR", "inherit", "inherit");
|
|
5480
|
-
var InvalidProjectAuthentication = createKnownErrorConstructor(ProjectAuthenticationError, "INVALID_PROJECT_AUTHENTICATION", "inherit", "inherit");
|
|
5481
|
-
var ProjectKeyWithoutAccessType = createKnownErrorConstructor(InvalidProjectAuthentication, "PROJECT_KEY_WITHOUT_ACCESS_TYPE", () => [400, "Either an API key or an admin access token was provided, but the x-hexclave-access-type header is missing. Set it to 'client', 'server', or 'admin' as appropriate. (The legacy x-stack-access-type header is also accepted.)"], () => []);
|
|
5482
|
-
var InvalidAccessType = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_ACCESS_TYPE", (accessType) => [400, `The x-hexclave-access-type header must be 'client', 'server', or 'admin', but was '${accessType}'. (The legacy x-stack-access-type header is also accepted.)`], (json) => [json?.accessType ?? throwErr("accessType not found in InvalidAccessType details")]);
|
|
5483
|
-
var AccessTypeWithoutProjectId = createKnownErrorConstructor(InvalidProjectAuthentication, "ACCESS_TYPE_WITHOUT_PROJECT_ID", (accessType) => [
|
|
5484
|
-
400,
|
|
5485
|
-
deindent`
|
|
5486
|
-
The x-hexclave-access-type header was '${accessType}', but the x-hexclave-project-id header was not provided. (The legacy x-stack-access-type and x-stack-project-id headers are also accepted.)
|
|
5487
|
-
|
|
5488
|
-
For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication
|
|
5489
|
-
`,
|
|
5490
|
-
{ request_type: accessType }
|
|
5491
|
-
], (json) => [json.request_type]);
|
|
5492
|
-
var AccessTypeRequired = createKnownErrorConstructor(InvalidProjectAuthentication, "ACCESS_TYPE_REQUIRED", () => [400, deindent`
|
|
5493
|
-
You must specify an access level for this Hexclave project. Make sure project API keys are provided (eg. x-hexclave-publishable-client-key) and you set the x-hexclave-access-type header to 'client', 'server', or 'admin'. (The legacy x-stack-* equivalents are also accepted.)
|
|
5494
|
-
|
|
5495
|
-
For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication
|
|
5496
|
-
`], () => []);
|
|
5497
|
-
var InsufficientAccessType = createKnownErrorConstructor(InvalidProjectAuthentication, "INSUFFICIENT_ACCESS_TYPE", (actualAccessType, allowedAccessTypes) => [
|
|
5498
|
-
401,
|
|
5499
|
-
`The x-hexclave-access-type header must be ${allowedAccessTypes.map((s8) => `'${s8}'`).join(" or ")}, but was '${actualAccessType}'. (The legacy x-stack-access-type header is also accepted.)`,
|
|
5500
|
-
{
|
|
5501
|
-
actual_access_type: actualAccessType,
|
|
5502
|
-
allowed_access_types: allowedAccessTypes
|
|
5503
|
-
}
|
|
5504
|
-
], (json) => [json.actual_access_type, json.allowed_access_types]);
|
|
5505
|
-
var InvalidPublishableClientKey = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_PUBLISHABLE_CLIENT_KEY", (projectId) => [
|
|
5506
|
-
401,
|
|
5507
|
-
`The publishable key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,
|
|
5508
|
-
{ project_id: projectId }
|
|
5509
|
-
], (json) => [json.project_id]);
|
|
5510
|
-
var InvalidSecretServerKey = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_SECRET_SERVER_KEY", (projectId) => [
|
|
5511
|
-
401,
|
|
5512
|
-
`The secret server key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,
|
|
5513
|
-
{ project_id: projectId }
|
|
5514
|
-
], (json) => [json.project_id]);
|
|
5515
|
-
var InvalidSuperSecretAdminKey = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_SUPER_SECRET_ADMIN_KEY", (projectId) => [
|
|
5516
|
-
401,
|
|
5517
|
-
`The super secret admin key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,
|
|
5518
|
-
{ project_id: projectId }
|
|
5519
|
-
], (json) => [json.project_id]);
|
|
5520
|
-
var InvalidAdminAccessToken = createKnownErrorConstructor(InvalidProjectAuthentication, "INVALID_ADMIN_ACCESS_TOKEN", "inherit", "inherit");
|
|
5521
|
-
var UnparsableAdminAccessToken = createKnownErrorConstructor(InvalidAdminAccessToken, "UNPARSABLE_ADMIN_ACCESS_TOKEN", () => [401, "Admin access token is not parsable."], () => []);
|
|
5522
|
-
var AdminAccessTokenExpired = createKnownErrorConstructor(InvalidAdminAccessToken, "ADMIN_ACCESS_TOKEN_EXPIRED", (expiredAt) => [
|
|
5523
|
-
401,
|
|
5524
|
-
`Admin access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : ""}`,
|
|
5525
|
-
{ expired_at_millis: expiredAt?.getTime() ?? null }
|
|
5526
|
-
], (json) => [json.expired_at_millis ? new Date(json.expired_at_millis) : void 0]);
|
|
5527
|
-
var InvalidProjectForAdminAccessToken = createKnownErrorConstructor(InvalidAdminAccessToken, "INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN", () => [401, "Admin access tokens must be created on the internal project."], () => []);
|
|
5528
|
-
var AdminAccessTokenIsNotAdmin = createKnownErrorConstructor(InvalidAdminAccessToken, "ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN", () => [401, "Admin access token does not have the required permissions to access this project."], () => []);
|
|
5529
|
-
var ProjectAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationError, "PROJECT_AUTHENTICATION_REQUIRED", "inherit", "inherit");
|
|
5530
|
-
var ClientAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_AUTHENTICATION_REQUIRED", () => [401, "The publishable client key must be provided."], () => []);
|
|
5531
|
-
var PublishableClientKeyRequiredForProject = createKnownErrorConstructor(ProjectAuthenticationRequired, "PUBLISHABLE_CLIENT_KEY_REQUIRED_FOR_PROJECT", (projectId) => [
|
|
5532
|
-
401,
|
|
5533
|
-
"Publishable client keys are required for this project. Create one in Project Keys, or disable this requirement there to allow keyless client access.",
|
|
5534
|
-
{ project_id: projectId ?? null }
|
|
5535
|
-
], (json) => [json.project_id ?? void 0]);
|
|
5536
|
-
var ServerAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "SERVER_AUTHENTICATION_REQUIRED", () => [401, "The secret server key must be provided."], () => []);
|
|
5537
|
-
var ClientOrServerAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED", () => [401, "Either the publishable client key or the secret server key must be provided."], () => []);
|
|
5538
|
-
var ClientOrAdminAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED", () => [401, "Either the publishable client key or the super secret admin key must be provided."], () => []);
|
|
5539
|
-
var ClientOrServerOrAdminAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED", () => [401, "Either the publishable client key, the secret server key, or the super secret admin key must be provided."], () => []);
|
|
5540
|
-
var AdminAuthenticationRequired = createKnownErrorConstructor(ProjectAuthenticationRequired, "ADMIN_AUTHENTICATION_REQUIRED", () => [401, "The super secret admin key must be provided."], () => []);
|
|
5541
|
-
var ExpectedInternalProject = createKnownErrorConstructor(ProjectAuthenticationError, "EXPECTED_INTERNAL_PROJECT", () => [401, "The project ID is expected to be internal."], () => []);
|
|
5542
|
-
var SessionAuthenticationError = createKnownErrorConstructor(KnownError, "SESSION_AUTHENTICATION_ERROR", "inherit", "inherit");
|
|
5543
|
-
var InvalidSessionAuthentication = createKnownErrorConstructor(SessionAuthenticationError, "INVALID_SESSION_AUTHENTICATION", "inherit", "inherit");
|
|
5544
|
-
var InvalidAccessToken = createKnownErrorConstructor(InvalidSessionAuthentication, "INVALID_ACCESS_TOKEN", "inherit", "inherit");
|
|
5545
|
-
var UnparsableAccessToken = createKnownErrorConstructor(InvalidAccessToken, "UNPARSABLE_ACCESS_TOKEN", () => [401, "Access token is not parsable."], () => []);
|
|
5546
|
-
var AccessTokenExpired = createKnownErrorConstructor(InvalidAccessToken, "ACCESS_TOKEN_EXPIRED", (expiredAt, projectId, userId, refreshTokenId) => [
|
|
5547
|
-
401,
|
|
5548
|
-
deindent`
|
|
5549
|
-
Access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : ""}${projectId ? ` Project ID: ${projectId}.` : ""}${userId ? ` User ID: ${userId}.` : ""}${refreshTokenId ? ` Refresh token ID: ${refreshTokenId}.` : ""}
|
|
5550
|
-
|
|
5551
|
-
Debug info: Most likely, you fetched the access token before it expired (for example, in a server component, pre-rendered page, or on page load), but then didn't refresh it before it expired. If this is the case, and you're using the SDK, make sure you call getAccessToken() every time you need to use the access token. If you're not using the SDK, make sure you refresh the access token with the refresh endpoint.
|
|
5552
|
-
`,
|
|
5553
|
-
{
|
|
5554
|
-
expired_at_millis: expiredAt?.getTime() ?? null,
|
|
5555
|
-
project_id: projectId ?? null,
|
|
5556
|
-
user_id: userId ?? null,
|
|
5557
|
-
refresh_token_id: refreshTokenId ?? null
|
|
5558
|
-
}
|
|
5559
|
-
], (json) => [
|
|
5560
|
-
json.expired_at_millis ? new Date(json.expired_at_millis) : void 0,
|
|
5561
|
-
json.project_id ?? void 0,
|
|
5562
|
-
json.user_id ?? void 0,
|
|
5563
|
-
json.refresh_token_id ?? void 0
|
|
5564
|
-
]);
|
|
5565
|
-
var InvalidProjectForAccessToken = createKnownErrorConstructor(InvalidAccessToken, "INVALID_PROJECT_FOR_ACCESS_TOKEN", (expectedProjectId, actualProjectId) => [
|
|
5566
|
-
401,
|
|
5567
|
-
`Access token not valid for this project. Expected project ID ${JSON.stringify(expectedProjectId)}, but the token is for project ID ${JSON.stringify(actualProjectId)}.`,
|
|
5568
|
-
{
|
|
5569
|
-
expected_project_id: expectedProjectId,
|
|
5570
|
-
actual_project_id: actualProjectId
|
|
5571
|
-
}
|
|
5572
|
-
], (json) => [json.expected_project_id, json.actual_project_id]);
|
|
5573
|
-
var RefreshTokenError = createKnownErrorConstructor(KnownError, "REFRESH_TOKEN_ERROR", "inherit", "inherit");
|
|
5574
|
-
var RefreshTokenNotFoundOrExpired = createKnownErrorConstructor(RefreshTokenError, "REFRESH_TOKEN_NOT_FOUND_OR_EXPIRED", () => [401, "Refresh token not found for this project, or the session has expired/been revoked."], () => []);
|
|
5575
|
-
var CannotDeleteCurrentSession = createKnownErrorConstructor(RefreshTokenError, "CANNOT_DELETE_CURRENT_SESSION", () => [400, "Cannot delete the current session."], () => []);
|
|
5576
|
-
var ProviderRejected = createKnownErrorConstructor(RefreshTokenError, "PROVIDER_REJECTED", () => [401, "The provider refused to refresh their token. This usually means that the provider used to authenticate the user no longer regards this session as valid, and the user must re-authenticate."], () => []);
|
|
5577
|
-
var UserWithEmailAlreadyExists = createKnownErrorConstructor(KnownError, "USER_EMAIL_ALREADY_EXISTS", (email, wouldWorkIfEmailWasVerified = false) => [
|
|
5578
|
-
409,
|
|
5579
|
-
`A user with email ${JSON.stringify(email)} already exists${wouldWorkIfEmailWasVerified ? " but the email is not verified. Please login to your existing account with the method you used to sign up, and then verify your email to sign in with this login method." : "."}`,
|
|
5580
|
-
{
|
|
5581
|
-
email,
|
|
5582
|
-
would_work_if_email_was_verified: wouldWorkIfEmailWasVerified
|
|
5583
|
-
}
|
|
5584
|
-
], (json) => [json.email, json.would_work_if_email_was_verified ?? false]);
|
|
5585
|
-
var EmailNotVerified = createKnownErrorConstructor(KnownError, "EMAIL_NOT_VERIFIED", () => [400, "The email is not verified."], () => []);
|
|
5586
|
-
var CannotGetOwnUserWithoutUser = createKnownErrorConstructor(KnownError, "CANNOT_GET_OWN_USER_WITHOUT_USER", () => [400, "You have specified 'me' as a userId, but did not provide authentication for a user."], () => []);
|
|
5587
|
-
var UserIdDoesNotExist = createKnownErrorConstructor(KnownError, "USER_ID_DOES_NOT_EXIST", (userId) => [
|
|
5588
|
-
400,
|
|
5589
|
-
`The given user with the ID ${userId} does not exist.`,
|
|
5590
|
-
{ user_id: userId }
|
|
5591
|
-
], (json) => [json.user_id]);
|
|
5592
|
-
var UserNotFound = createKnownErrorConstructor(KnownError, "USER_NOT_FOUND", () => [404, "User not found."], () => []);
|
|
5593
|
-
var RestrictedUserNotAllowed = createKnownErrorConstructor(KnownError, "RESTRICTED_USER_NOT_ALLOWED", (restrictedReason) => [
|
|
5594
|
-
403,
|
|
5595
|
-
`The user in the access token is in restricted state. Reason: ${restrictedReason.type}. Please pass the X-Stack-Allow-Restricted-User header if this is intended.`,
|
|
5596
|
-
{ restricted_reason: restrictedReason }
|
|
5597
|
-
], (json) => [json.restricted_reason ?? { type: "anonymous" }]);
|
|
5598
|
-
var ProjectNotFound = createKnownErrorConstructor(KnownError, "PROJECT_NOT_FOUND", (projectId) => {
|
|
5599
|
-
if (typeof projectId !== "string") throw new HexclaveAssertionError("projectId of KnownErrors.ProjectNotFound must be a string");
|
|
5600
|
-
return [
|
|
5601
|
-
404,
|
|
5602
|
-
`Project ${projectId} not found or is not accessible with the current user.`,
|
|
5603
|
-
{ project_id: projectId }
|
|
5604
|
-
];
|
|
5605
|
-
}, (json) => [json.project_id]);
|
|
5606
|
-
var CurrentProjectNotFound = createKnownErrorConstructor(KnownError, "CURRENT_PROJECT_NOT_FOUND", (projectId) => [
|
|
5607
|
-
400,
|
|
5608
|
-
`The current project with ID ${projectId} was not found. Please check the value of the x-hexclave-project-id header. (The legacy x-stack-project-id header is also accepted.)`,
|
|
5609
|
-
{ project_id: projectId }
|
|
5610
|
-
], (json) => [json.project_id]);
|
|
5611
|
-
var BranchDoesNotExist = createKnownErrorConstructor(KnownError, "BRANCH_DOES_NOT_EXIST", (branchId) => [
|
|
5612
|
-
400,
|
|
5613
|
-
`The branch with ID ${branchId} does not exist.`,
|
|
5614
|
-
{ branch_id: branchId }
|
|
5615
|
-
], (json) => [json.branch_id]);
|
|
5616
|
-
var SignUpNotEnabled = createKnownErrorConstructor(KnownError, "SIGN_UP_NOT_ENABLED", () => [400, "Creation of new accounts is not enabled for this project. Please ask the project owner to enable it."], () => []);
|
|
5617
|
-
var SignUpRejected = createKnownErrorConstructor(KnownError, "SIGN_UP_REJECTED", (message) => [
|
|
5618
|
-
403,
|
|
5619
|
-
message ?? "Your sign up was rejected by an administrator's sign-up rule.",
|
|
5620
|
-
{ message: message ?? "Your sign up was rejected by an administrator's sign-up rule." }
|
|
5621
|
-
], (json) => [json.message]);
|
|
5622
|
-
var BotChallengeRequired = createKnownErrorConstructor(KnownError, "BOT_CHALLENGE_REQUIRED", () => [409, "An additional bot challenge is required before sign-up can continue."], () => []);
|
|
5623
|
-
var BotChallengeFailed = createKnownErrorConstructor(KnownError, "BOT_CHALLENGE_FAILED", (message) => [
|
|
5624
|
-
400,
|
|
5625
|
-
message,
|
|
5626
|
-
{ message }
|
|
5627
|
-
], (json) => [json.message]);
|
|
5628
|
-
var PasswordAuthenticationNotEnabled = createKnownErrorConstructor(KnownError, "PASSWORD_AUTHENTICATION_NOT_ENABLED", () => [400, "Password authentication is not enabled for this project."], () => []);
|
|
5629
|
-
var DataVaultStoreDoesNotExist = createKnownErrorConstructor(KnownError, "DATA_VAULT_STORE_DOES_NOT_EXIST", (storeId) => [
|
|
5630
|
-
400,
|
|
5631
|
-
`Data vault store with ID ${storeId} does not exist.`,
|
|
5632
|
-
{ store_id: storeId }
|
|
5633
|
-
], (json) => [json.store_id]);
|
|
5634
|
-
var DataVaultStoreHashedKeyDoesNotExist = createKnownErrorConstructor(KnownError, "DATA_VAULT_STORE_HASHED_KEY_DOES_NOT_EXIST", (storeId, hashedKey) => [
|
|
5635
|
-
400,
|
|
5636
|
-
`Data vault store with ID ${storeId} does not contain a key with hash ${hashedKey}.`,
|
|
5637
|
-
{
|
|
5638
|
-
store_id: storeId,
|
|
5639
|
-
hashed_key: hashedKey
|
|
5640
|
-
}
|
|
5641
|
-
], (json) => [json.store_id, json.hashed_key]);
|
|
5642
|
-
var PasskeyAuthenticationNotEnabled = createKnownErrorConstructor(KnownError, "PASSKEY_AUTHENTICATION_NOT_ENABLED", () => [400, "Passkey authentication is not enabled for this project."], () => []);
|
|
5643
|
-
var AnonymousAccountsNotEnabled = createKnownErrorConstructor(KnownError, "ANONYMOUS_ACCOUNTS_NOT_ENABLED", () => [400, "Anonymous accounts are not enabled for this project."], () => []);
|
|
5644
|
-
var AnonymousAuthenticationNotAllowed = createKnownErrorConstructor(KnownError, "ANONYMOUS_AUTHENTICATION_NOT_ALLOWED", () => [401, "X-Stack-Access-Token is for an anonymous user, but anonymous users are not enabled. Set the X-Stack-Allow-Anonymous-User header of this request to 'true' to allow anonymous users."], () => []);
|
|
5645
|
-
var EmailPasswordMismatch = createKnownErrorConstructor(KnownError, "EMAIL_PASSWORD_MISMATCH", () => [400, "Wrong e-mail or password."], () => []);
|
|
5646
|
-
var RedirectUrlNotWhitelisted = createKnownErrorConstructor(KnownError, "REDIRECT_URL_NOT_WHITELISTED", (redirectUrl) => [
|
|
5647
|
-
400,
|
|
5648
|
-
"Redirect URL not whitelisted. Did you forget to add this domain to the trusted domains list on the Hexclave dashboard?",
|
|
5649
|
-
redirectUrl === void 0 ? void 0 : { redirect_url: redirectUrl }
|
|
5650
|
-
], (json) => [json?.redirect_url]);
|
|
5651
|
-
var PasswordRequirementsNotMet = createKnownErrorConstructor(KnownError, "PASSWORD_REQUIREMENTS_NOT_MET", "inherit", "inherit");
|
|
5652
|
-
var PasswordTooShort = createKnownErrorConstructor(PasswordRequirementsNotMet, "PASSWORD_TOO_SHORT", (minLength) => [
|
|
5653
|
-
400,
|
|
5654
|
-
`Password too short. Minimum length is ${minLength}.`,
|
|
5655
|
-
{ min_length: minLength }
|
|
5656
|
-
], (json) => [json?.min_length ?? throwErr("min_length not found in PasswordTooShort details")]);
|
|
5657
|
-
var PasswordTooLong = createKnownErrorConstructor(PasswordRequirementsNotMet, "PASSWORD_TOO_LONG", (maxLength) => [
|
|
5658
|
-
400,
|
|
5659
|
-
`Password too long. Maximum length is ${maxLength}.`,
|
|
5660
|
-
{ maxLength }
|
|
5661
|
-
], (json) => [json?.maxLength ?? throwErr("maxLength not found in PasswordTooLong details")]);
|
|
5662
|
-
var UserDoesNotHavePassword = createKnownErrorConstructor(KnownError, "USER_DOES_NOT_HAVE_PASSWORD", () => [400, "This user does not have password authentication enabled."], () => []);
|
|
5663
|
-
var VerificationCodeError = createKnownErrorConstructor(KnownError, "VERIFICATION_ERROR", "inherit", "inherit");
|
|
5664
|
-
var VerificationCodeNotFound = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_NOT_FOUND", () => [404, "The verification code does not exist for this project."], () => []);
|
|
5665
|
-
var VerificationCodeExpired = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_EXPIRED", () => [400, "The verification code has expired."], () => []);
|
|
5666
|
-
var VerificationCodeAlreadyUsed = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_ALREADY_USED", () => [409, "The verification link has already been used."], () => []);
|
|
5667
|
-
var VerificationCodeMaxAttemptsReached = createKnownErrorConstructor(VerificationCodeError, "VERIFICATION_CODE_MAX_ATTEMPTS_REACHED", () => [400, "The verification code nonce has reached the maximum number of attempts. This code is not valid anymore."], () => []);
|
|
5668
|
-
var PasswordConfirmationMismatch = createKnownErrorConstructor(KnownError, "PASSWORD_CONFIRMATION_MISMATCH", () => [400, "Passwords do not match."], () => []);
|
|
5669
|
-
var EmailAlreadyVerified = createKnownErrorConstructor(KnownError, "EMAIL_ALREADY_VERIFIED", () => [409, "The e-mail is already verified."], () => []);
|
|
5670
|
-
var EmailNotAssociatedWithUser = createKnownErrorConstructor(KnownError, "EMAIL_NOT_ASSOCIATED_WITH_USER", () => [400, "The e-mail is not associated with a user that could log in with that e-mail."], () => []);
|
|
5671
|
-
var EmailIsNotPrimaryEmail = createKnownErrorConstructor(KnownError, "EMAIL_IS_NOT_PRIMARY_EMAIL", (email, primaryEmail) => [
|
|
5672
|
-
400,
|
|
5673
|
-
`The given e-mail (${email}) must equal the user's primary e-mail (${primaryEmail}).`,
|
|
5674
|
-
{
|
|
5675
|
-
email,
|
|
5676
|
-
primary_email: primaryEmail
|
|
5677
|
-
}
|
|
5678
|
-
], (json) => [json.email, json.primary_email]);
|
|
5679
|
-
var PasskeyRegistrationFailed = createKnownErrorConstructor(KnownError, "PASSKEY_REGISTRATION_FAILED", (message) => [400, message], (json) => [json.message]);
|
|
5680
|
-
var PasskeyWebAuthnError = createKnownErrorConstructor(KnownError, "PASSKEY_WEBAUTHN_ERROR", (message, code) => [
|
|
5681
|
-
400,
|
|
5682
|
-
message,
|
|
5683
|
-
{
|
|
5684
|
-
message,
|
|
5685
|
-
code
|
|
5686
|
-
}
|
|
5687
|
-
], (json) => [json.message, json.code]);
|
|
5688
|
-
var PasskeyAuthenticationFailed = createKnownErrorConstructor(KnownError, "PASSKEY_AUTHENTICATION_FAILED", (message) => [400, message], (json) => [json.message]);
|
|
5689
|
-
var PermissionNotFound = createKnownErrorConstructor(KnownError, "PERMISSION_NOT_FOUND", (permissionId) => [
|
|
5690
|
-
404,
|
|
5691
|
-
`Permission "${permissionId}" not found. Make sure you created it on the dashboard.`,
|
|
5692
|
-
{ permission_id: permissionId }
|
|
5693
|
-
], (json) => [json.permission_id]);
|
|
5694
|
-
var PermissionScopeMismatch = createKnownErrorConstructor(KnownError, "WRONG_PERMISSION_SCOPE", (permissionId, expectedScope, actualScope) => [
|
|
5695
|
-
404,
|
|
5696
|
-
`Permission ${JSON.stringify(permissionId)} not found. (It was found for a different scope ${JSON.stringify(actualScope)}, but scope ${JSON.stringify(expectedScope)} was expected.)`,
|
|
5697
|
-
{
|
|
5698
|
-
permission_id: permissionId,
|
|
5699
|
-
expected_scope: expectedScope,
|
|
5700
|
-
actual_scope: actualScope
|
|
5701
|
-
}
|
|
5702
|
-
], (json) => [
|
|
5703
|
-
json.permission_id,
|
|
5704
|
-
json.expected_scope,
|
|
5705
|
-
json.actual_scope
|
|
5706
|
-
]);
|
|
5707
|
-
var ContainedPermissionNotFound = createKnownErrorConstructor(KnownError, "CONTAINED_PERMISSION_NOT_FOUND", (permissionId) => [
|
|
5708
|
-
400,
|
|
5709
|
-
`Contained permission with ID "${permissionId}" not found. Make sure you created it on the dashboard.`,
|
|
5710
|
-
{ permission_id: permissionId }
|
|
5711
|
-
], (json) => [json.permission_id]);
|
|
5712
|
-
var TeamNotFound = createKnownErrorConstructor(KnownError, "TEAM_NOT_FOUND", (teamId) => [
|
|
5713
|
-
404,
|
|
5714
|
-
`Team ${teamId} not found.`,
|
|
5715
|
-
{ team_id: teamId }
|
|
5716
|
-
], (json) => [json.team_id]);
|
|
5717
|
-
createKnownErrorConstructor(KnownError, "TEAM_ALREADY_EXISTS", (teamId) => [
|
|
5718
|
-
409,
|
|
5719
|
-
`Team ${teamId} already exists.`,
|
|
5720
|
-
{ team_id: teamId }
|
|
5721
|
-
], (json) => [json.team_id]);
|
|
5722
|
-
var TeamMembershipNotFound = createKnownErrorConstructor(KnownError, "TEAM_MEMBERSHIP_NOT_FOUND", (teamId, userId) => [
|
|
5723
|
-
404,
|
|
5724
|
-
`User ${userId} is not found in team ${teamId}.`,
|
|
5725
|
-
{
|
|
5726
|
-
team_id: teamId,
|
|
5727
|
-
user_id: userId
|
|
5728
|
-
}
|
|
5729
|
-
], (json) => [json.team_id, json.user_id]);
|
|
5730
|
-
var TeamInvitationRestrictedUserNotAllowed = createKnownErrorConstructor(KnownError, "TEAM_INVITATION_RESTRICTED_USER_NOT_ALLOWED", (restrictedReason) => [
|
|
5731
|
-
403,
|
|
5732
|
-
`Restricted users cannot accept team invitations. Reason: ${restrictedReason.type}. Please complete the onboarding process before accepting team invitations.`,
|
|
5733
|
-
{ restricted_reason: restrictedReason }
|
|
5734
|
-
], (json) => [json.restricted_reason ?? { type: "anonymous" }]);
|
|
5735
|
-
var TeamInvitationEmailMismatch = createKnownErrorConstructor(KnownError, "TEAM_INVITATION_EMAIL_MISMATCH", () => [403, "This team invitation was sent to a different email address. Sign in with the invited email, or add and verify that email on your account, then try again."], () => []);
|
|
5736
|
-
var EmailTemplateAlreadyExists = createKnownErrorConstructor(KnownError, "EMAIL_TEMPLATE_ALREADY_EXISTS", () => [409, "Email template already exists."], () => []);
|
|
5737
|
-
var OAuthConnectionNotConnectedToUser = createKnownErrorConstructor(KnownError, "OAUTH_CONNECTION_NOT_CONNECTED_TO_USER", () => [400, "The OAuth connection is not connected to any user."], () => []);
|
|
5738
|
-
var OAuthConnectionAlreadyConnectedToAnotherUser = createKnownErrorConstructor(KnownError, "OAUTH_CONNECTION_ALREADY_CONNECTED_TO_ANOTHER_USER", () => [409, "The OAuth connection is already connected to another user."], () => []);
|
|
5739
|
-
var OAuthConnectionDoesNotHaveRequiredScope = createKnownErrorConstructor(KnownError, "OAUTH_CONNECTION_DOES_NOT_HAVE_REQUIRED_SCOPE", () => [400, "The OAuth connection does not have the required scope."], () => []);
|
|
5740
|
-
var OAuthAccessTokenNotAvailable = createKnownErrorConstructor(KnownError, "OAUTH_ACCESS_TOKEN_NOT_AVAILABLE", (provider, details) => [
|
|
5741
|
-
400,
|
|
5742
|
-
`Failed to retrieve an OAuth access token for the connected account (provider: ${provider}). ${details}`,
|
|
5743
|
-
{
|
|
5744
|
-
provider,
|
|
5745
|
-
details
|
|
5746
|
-
}
|
|
5747
|
-
], (json) => [json.provider, json.details]);
|
|
5748
|
-
var OAuthExtraScopeNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(KnownError, "OAUTH_EXTRA_SCOPE_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS", () => [400, "Extra scopes are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use extra scopes."], () => []);
|
|
5749
|
-
var OAuthAccessTokenNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(KnownError, "OAUTH_ACCESS_TOKEN_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS", () => [400, "Access tokens are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use access tokens."], () => []);
|
|
5750
|
-
var InvalidOAuthClientIdOrSecret = createKnownErrorConstructor(KnownError, "INVALID_OAUTH_CLIENT_ID_OR_SECRET", (clientId) => [
|
|
5751
|
-
400,
|
|
5752
|
-
"The OAuth client ID or secret is invalid. The client ID must be equal to the project ID (potentially with a hash and a branch ID), and the client secret must be a publishable client key.",
|
|
5753
|
-
{ client_id: clientId ?? null }
|
|
5754
|
-
], (json) => [json.client_id ?? void 0]);
|
|
5755
|
-
var InvalidScope = createKnownErrorConstructor(KnownError, "INVALID_SCOPE", (scope) => [400, `The scope "${scope}" is not a valid OAuth scope for Stack.`], (json) => [json.scope]);
|
|
5756
|
-
var UserAlreadyConnectedToAnotherOAuthConnection = createKnownErrorConstructor(KnownError, "USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION", () => [409, "The user is already connected to another OAuth account. Did you maybe selected the wrong account?"], () => []);
|
|
5757
|
-
var OuterOAuthTimeout = createKnownErrorConstructor(KnownError, "OUTER_OAUTH_TIMEOUT", () => [408, "The OAuth flow has timed out. Please sign in again."], () => []);
|
|
5758
|
-
var OAuthProviderNotFoundOrNotEnabled = createKnownErrorConstructor(KnownError, "OAUTH_PROVIDER_NOT_FOUND_OR_NOT_ENABLED", () => [400, "The OAuth provider is not found or not enabled."], () => []);
|
|
5759
|
-
var AppleBundleIdNotConfigured = createKnownErrorConstructor(KnownError, "APPLE_BUNDLE_ID_NOT_CONFIGURED", () => [400, "Apple Sign In is enabled, but no Bundle IDs are configured. Please add your app's Bundle ID in the Hexclave dashboard under OAuth Providers > Apple > Apple Bundle IDs."], () => []);
|
|
5760
|
-
var OAuthProviderAccountIdAlreadyUsedForSignIn = createKnownErrorConstructor(KnownError, "OAUTH_PROVIDER_ACCOUNT_ID_ALREADY_USED_FOR_SIGN_IN", () => [400, `A provider with the same account ID is already used for signing in.`], () => []);
|
|
5761
|
-
var MultiFactorAuthenticationRequired = createKnownErrorConstructor(KnownError, "MULTI_FACTOR_AUTHENTICATION_REQUIRED", (attemptCode) => [
|
|
5762
|
-
400,
|
|
5763
|
-
`Multi-factor authentication is required for this user.`,
|
|
5764
|
-
{ attempt_code: attemptCode }
|
|
5765
|
-
], (json) => [json.attempt_code]);
|
|
5766
|
-
var InvalidTotpCode = createKnownErrorConstructor(KnownError, "INVALID_TOTP_CODE", () => [400, "The TOTP code is invalid. Please try again."], () => []);
|
|
5767
|
-
var UserAuthenticationRequired = createKnownErrorConstructor(KnownError, "USER_AUTHENTICATION_REQUIRED", () => [401, "User authentication required for this endpoint."], () => []);
|
|
5768
|
-
var TeamMembershipAlreadyExists = createKnownErrorConstructor(KnownError, "TEAM_MEMBERSHIP_ALREADY_EXISTS", () => [409, "Team membership already exists."], () => []);
|
|
5769
|
-
var ProjectPermissionRequired = createKnownErrorConstructor(KnownError, "PROJECT_PERMISSION_REQUIRED", (userId, permissionId) => [
|
|
5770
|
-
401,
|
|
5771
|
-
`User ${userId} does not have permission ${permissionId}.`,
|
|
5772
|
-
{
|
|
5773
|
-
user_id: userId,
|
|
5774
|
-
permission_id: permissionId
|
|
5775
|
-
}
|
|
5776
|
-
], (json) => [json.user_id, json.permission_id]);
|
|
5777
|
-
var TeamPermissionRequired = createKnownErrorConstructor(KnownError, "TEAM_PERMISSION_REQUIRED", (teamId, userId, permissionId) => [
|
|
5778
|
-
401,
|
|
5779
|
-
`User ${userId} does not have permission ${permissionId} in team ${teamId}.`,
|
|
5780
|
-
{
|
|
5781
|
-
team_id: teamId,
|
|
5782
|
-
user_id: userId,
|
|
5783
|
-
permission_id: permissionId
|
|
4898
|
+
], (json) => [json.user_id, json.permission_id]);
|
|
4899
|
+
var TeamPermissionRequired = createKnownErrorConstructor(KnownError, "TEAM_PERMISSION_REQUIRED", (teamId, userId, permissionId) => [
|
|
4900
|
+
401,
|
|
4901
|
+
`User ${userId} does not have permission ${permissionId} in team ${teamId}.`,
|
|
4902
|
+
{
|
|
4903
|
+
team_id: teamId,
|
|
4904
|
+
user_id: userId,
|
|
4905
|
+
permission_id: permissionId
|
|
5784
4906
|
}
|
|
5785
4907
|
], (json) => [
|
|
5786
4908
|
json.team_id,
|
|
@@ -6140,49 +5262,6 @@ This is likely an error in Hexclave. Please make sure you are running the newest
|
|
|
6140
5262
|
knownErrorCodes.add(KnownError2.errorCode);
|
|
6141
5263
|
}
|
|
6142
5264
|
|
|
6143
|
-
// ../shared/dist/esm/utils/bytes.js
|
|
6144
|
-
function decodeBase64(input) {
|
|
6145
|
-
return new Uint8Array(atob(input).split("").map((char) => char.charCodeAt(0)));
|
|
6146
|
-
}
|
|
6147
|
-
function isBase64(input) {
|
|
6148
|
-
return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(input);
|
|
6149
|
-
}
|
|
6150
|
-
|
|
6151
|
-
// ../shared/dist/esm/utils/urls.js
|
|
6152
|
-
function createUrlIfValid(...args) {
|
|
6153
|
-
try {
|
|
6154
|
-
return new URL(...args);
|
|
6155
|
-
} catch (e40) {
|
|
6156
|
-
return null;
|
|
6157
|
-
}
|
|
6158
|
-
}
|
|
6159
|
-
function isValidUrl(url) {
|
|
6160
|
-
return !!createUrlIfValid(url);
|
|
6161
|
-
}
|
|
6162
|
-
function isValidHostname(hostname) {
|
|
6163
|
-
if (!hostname || hostname.startsWith(".") || hostname.endsWith(".") || hostname.includes("..")) return false;
|
|
6164
|
-
const url = createUrlIfValid(`https://${hostname}`);
|
|
6165
|
-
if (!url) return false;
|
|
6166
|
-
return url.hostname === hostname;
|
|
6167
|
-
}
|
|
6168
|
-
function isValidHostnameWithWildcards(hostname) {
|
|
6169
|
-
if (!hostname) return false;
|
|
6170
|
-
if (!hostname.includes("*")) return isValidHostname(hostname);
|
|
6171
|
-
if (hostname.startsWith(".") || hostname.endsWith(".")) return false;
|
|
6172
|
-
if (hostname.includes("..")) return false;
|
|
6173
|
-
const testHostname = hostname.replace(/\*+/g, "wildcard");
|
|
6174
|
-
if (!/^[a-zA-Z0-9.-]+$/.test(testHostname)) return false;
|
|
6175
|
-
const segments = hostname.split(/\*+/);
|
|
6176
|
-
for (let i = 0; i < segments.length; i++) {
|
|
6177
|
-
const segment = segments[i];
|
|
6178
|
-
if (segment === "") continue;
|
|
6179
|
-
if (i === 0 && segment.startsWith(".")) return false;
|
|
6180
|
-
if (i === segments.length - 1 && segment.endsWith(".")) return false;
|
|
6181
|
-
if (segment.includes("..")) return false;
|
|
6182
|
-
}
|
|
6183
|
-
return true;
|
|
6184
|
-
}
|
|
6185
|
-
|
|
6186
5265
|
// ../../node_modules/.pnpm/yup@1.7.1/node_modules/yup/index.esm.js
|
|
6187
5266
|
var import_property_expr = __toESM(require_property_expr());
|
|
6188
5267
|
var import_tiny_case = __toESM(require_tiny_case());
|
|
@@ -6222,11 +5301,11 @@ This is likely an error in Hexclave. Please make sure you are running the newest
|
|
|
6222
5301
|
function toArray(value) {
|
|
6223
5302
|
return value == null ? [] : [].concat(value);
|
|
6224
5303
|
}
|
|
6225
|
-
var _Symbol$
|
|
5304
|
+
var _Symbol$toStringTag;
|
|
6226
5305
|
var _Symbol$hasInstance;
|
|
6227
|
-
var _Symbol$
|
|
5306
|
+
var _Symbol$toStringTag2;
|
|
6228
5307
|
var strReg = /\$\{\s*(\w+)\s*\}/g;
|
|
6229
|
-
_Symbol$
|
|
5308
|
+
_Symbol$toStringTag = Symbol.toStringTag;
|
|
6230
5309
|
var ValidationErrorNoStack = class {
|
|
6231
5310
|
constructor(errorOrErrors, value, field, type) {
|
|
6232
5311
|
this.name = void 0;
|
|
@@ -6237,7 +5316,7 @@ This is likely an error in Hexclave. Please make sure you are running the newest
|
|
|
6237
5316
|
this.params = void 0;
|
|
6238
5317
|
this.errors = void 0;
|
|
6239
5318
|
this.inner = void 0;
|
|
6240
|
-
this[_Symbol$
|
|
5319
|
+
this[_Symbol$toStringTag] = "Error";
|
|
6241
5320
|
this.name = "ValidationError";
|
|
6242
5321
|
this.value = value;
|
|
6243
5322
|
this.path = field;
|
|
@@ -6257,7 +5336,7 @@ This is likely an error in Hexclave. Please make sure you are running the newest
|
|
|
6257
5336
|
}
|
|
6258
5337
|
};
|
|
6259
5338
|
_Symbol$hasInstance = Symbol.hasInstance;
|
|
6260
|
-
_Symbol$
|
|
5339
|
+
_Symbol$toStringTag2 = Symbol.toStringTag;
|
|
6261
5340
|
var ValidationError = class _ValidationError extends Error {
|
|
6262
5341
|
static formatError(message, params) {
|
|
6263
5342
|
const path = params.label || params.path || "this";
|
|
@@ -6284,7 +5363,7 @@ This is likely an error in Hexclave. Please make sure you are running the newest
|
|
|
6284
5363
|
this.params = void 0;
|
|
6285
5364
|
this.errors = [];
|
|
6286
5365
|
this.inner = [];
|
|
6287
|
-
this[_Symbol$
|
|
5366
|
+
this[_Symbol$toStringTag2] = "Error";
|
|
6288
5367
|
this.name = errorNoStack.name;
|
|
6289
5368
|
this.message = errorNoStack.message;
|
|
6290
5369
|
this.type = errorNoStack.type;
|
|
@@ -9460,283 +8539,1204 @@ attempted value: ${formattedValue}
|
|
|
9460
8539
|
workflow_path: yupString().optional()
|
|
9461
8540
|
}), yupObject({ type: yupString().oneOf(["pushed-from-unknown"]).defined() }), yupObject({ type: yupString().oneOf(["unlinked"]).defined() }));
|
|
9462
8541
|
|
|
9463
|
-
// ../../node_modules/.pnpm/async-mutex@0.5.0/node_modules/async-mutex/index.mjs
|
|
9464
|
-
var E_TIMEOUT = new Error("timeout while waiting for mutex to become available");
|
|
9465
|
-
var E_ALREADY_LOCKED = new Error("mutex already locked");
|
|
9466
|
-
var E_CANCELED = new Error("request for lock canceled");
|
|
9467
|
-
var __awaiter$2 = function(thisArg, _arguments, P, generator) {
|
|
9468
|
-
function adopt(value) {
|
|
9469
|
-
return value instanceof P ? value : new P(function(resolve) {
|
|
9470
|
-
resolve(value);
|
|
9471
|
-
});
|
|
9472
|
-
}
|
|
9473
|
-
return new (P || (P = Promise))(function(resolve, reject) {
|
|
9474
|
-
function fulfilled(value) {
|
|
9475
|
-
try {
|
|
9476
|
-
step(generator.next(value));
|
|
9477
|
-
} catch (e40) {
|
|
9478
|
-
reject(e40);
|
|
9479
|
-
}
|
|
9480
|
-
}
|
|
9481
|
-
function rejected2(value) {
|
|
9482
|
-
try {
|
|
9483
|
-
step(generator["throw"](value));
|
|
9484
|
-
} catch (e40) {
|
|
9485
|
-
reject(e40);
|
|
8542
|
+
// ../../node_modules/.pnpm/async-mutex@0.5.0/node_modules/async-mutex/index.mjs
|
|
8543
|
+
var E_TIMEOUT = new Error("timeout while waiting for mutex to become available");
|
|
8544
|
+
var E_ALREADY_LOCKED = new Error("mutex already locked");
|
|
8545
|
+
var E_CANCELED = new Error("request for lock canceled");
|
|
8546
|
+
var __awaiter$2 = function(thisArg, _arguments, P, generator) {
|
|
8547
|
+
function adopt(value) {
|
|
8548
|
+
return value instanceof P ? value : new P(function(resolve) {
|
|
8549
|
+
resolve(value);
|
|
8550
|
+
});
|
|
8551
|
+
}
|
|
8552
|
+
return new (P || (P = Promise))(function(resolve, reject) {
|
|
8553
|
+
function fulfilled(value) {
|
|
8554
|
+
try {
|
|
8555
|
+
step(generator.next(value));
|
|
8556
|
+
} catch (e40) {
|
|
8557
|
+
reject(e40);
|
|
8558
|
+
}
|
|
8559
|
+
}
|
|
8560
|
+
function rejected2(value) {
|
|
8561
|
+
try {
|
|
8562
|
+
step(generator["throw"](value));
|
|
8563
|
+
} catch (e40) {
|
|
8564
|
+
reject(e40);
|
|
8565
|
+
}
|
|
8566
|
+
}
|
|
8567
|
+
function step(result) {
|
|
8568
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected2);
|
|
8569
|
+
}
|
|
8570
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8571
|
+
});
|
|
8572
|
+
};
|
|
8573
|
+
var Semaphore = class {
|
|
8574
|
+
constructor(_value, _cancelError = E_CANCELED) {
|
|
8575
|
+
this._value = _value;
|
|
8576
|
+
this._cancelError = _cancelError;
|
|
8577
|
+
this._queue = [];
|
|
8578
|
+
this._weightedWaiters = [];
|
|
8579
|
+
}
|
|
8580
|
+
acquire(weight = 1, priority = 0) {
|
|
8581
|
+
if (weight <= 0)
|
|
8582
|
+
throw new Error(`invalid weight ${weight}: must be positive`);
|
|
8583
|
+
return new Promise((resolve, reject) => {
|
|
8584
|
+
const task = { resolve, reject, weight, priority };
|
|
8585
|
+
const i = findIndexFromEnd(this._queue, (other) => priority <= other.priority);
|
|
8586
|
+
if (i === -1 && weight <= this._value) {
|
|
8587
|
+
this._dispatchItem(task);
|
|
8588
|
+
} else {
|
|
8589
|
+
this._queue.splice(i + 1, 0, task);
|
|
8590
|
+
}
|
|
8591
|
+
});
|
|
8592
|
+
}
|
|
8593
|
+
runExclusive(callback_1) {
|
|
8594
|
+
return __awaiter$2(this, arguments, void 0, function* (callback, weight = 1, priority = 0) {
|
|
8595
|
+
const [value, release] = yield this.acquire(weight, priority);
|
|
8596
|
+
try {
|
|
8597
|
+
return yield callback(value);
|
|
8598
|
+
} finally {
|
|
8599
|
+
release();
|
|
8600
|
+
}
|
|
8601
|
+
});
|
|
8602
|
+
}
|
|
8603
|
+
waitForUnlock(weight = 1, priority = 0) {
|
|
8604
|
+
if (weight <= 0)
|
|
8605
|
+
throw new Error(`invalid weight ${weight}: must be positive`);
|
|
8606
|
+
if (this._couldLockImmediately(weight, priority)) {
|
|
8607
|
+
return Promise.resolve();
|
|
8608
|
+
} else {
|
|
8609
|
+
return new Promise((resolve) => {
|
|
8610
|
+
if (!this._weightedWaiters[weight - 1])
|
|
8611
|
+
this._weightedWaiters[weight - 1] = [];
|
|
8612
|
+
insertSorted(this._weightedWaiters[weight - 1], { resolve, priority });
|
|
8613
|
+
});
|
|
8614
|
+
}
|
|
8615
|
+
}
|
|
8616
|
+
isLocked() {
|
|
8617
|
+
return this._value <= 0;
|
|
8618
|
+
}
|
|
8619
|
+
getValue() {
|
|
8620
|
+
return this._value;
|
|
8621
|
+
}
|
|
8622
|
+
setValue(value) {
|
|
8623
|
+
this._value = value;
|
|
8624
|
+
this._dispatchQueue();
|
|
8625
|
+
}
|
|
8626
|
+
release(weight = 1) {
|
|
8627
|
+
if (weight <= 0)
|
|
8628
|
+
throw new Error(`invalid weight ${weight}: must be positive`);
|
|
8629
|
+
this._value += weight;
|
|
8630
|
+
this._dispatchQueue();
|
|
8631
|
+
}
|
|
8632
|
+
cancel() {
|
|
8633
|
+
this._queue.forEach((entry) => entry.reject(this._cancelError));
|
|
8634
|
+
this._queue = [];
|
|
8635
|
+
}
|
|
8636
|
+
_dispatchQueue() {
|
|
8637
|
+
this._drainUnlockWaiters();
|
|
8638
|
+
while (this._queue.length > 0 && this._queue[0].weight <= this._value) {
|
|
8639
|
+
this._dispatchItem(this._queue.shift());
|
|
8640
|
+
this._drainUnlockWaiters();
|
|
8641
|
+
}
|
|
8642
|
+
}
|
|
8643
|
+
_dispatchItem(item) {
|
|
8644
|
+
const previousValue = this._value;
|
|
8645
|
+
this._value -= item.weight;
|
|
8646
|
+
item.resolve([previousValue, this._newReleaser(item.weight)]);
|
|
8647
|
+
}
|
|
8648
|
+
_newReleaser(weight) {
|
|
8649
|
+
let called = false;
|
|
8650
|
+
return () => {
|
|
8651
|
+
if (called)
|
|
8652
|
+
return;
|
|
8653
|
+
called = true;
|
|
8654
|
+
this.release(weight);
|
|
8655
|
+
};
|
|
8656
|
+
}
|
|
8657
|
+
_drainUnlockWaiters() {
|
|
8658
|
+
if (this._queue.length === 0) {
|
|
8659
|
+
for (let weight = this._value; weight > 0; weight--) {
|
|
8660
|
+
const waiters = this._weightedWaiters[weight - 1];
|
|
8661
|
+
if (!waiters)
|
|
8662
|
+
continue;
|
|
8663
|
+
waiters.forEach((waiter) => waiter.resolve());
|
|
8664
|
+
this._weightedWaiters[weight - 1] = [];
|
|
8665
|
+
}
|
|
8666
|
+
} else {
|
|
8667
|
+
const queuedPriority = this._queue[0].priority;
|
|
8668
|
+
for (let weight = this._value; weight > 0; weight--) {
|
|
8669
|
+
const waiters = this._weightedWaiters[weight - 1];
|
|
8670
|
+
if (!waiters)
|
|
8671
|
+
continue;
|
|
8672
|
+
const i = waiters.findIndex((waiter) => waiter.priority <= queuedPriority);
|
|
8673
|
+
(i === -1 ? waiters : waiters.splice(0, i)).forEach((waiter) => waiter.resolve());
|
|
8674
|
+
}
|
|
8675
|
+
}
|
|
8676
|
+
}
|
|
8677
|
+
_couldLockImmediately(weight, priority) {
|
|
8678
|
+
return (this._queue.length === 0 || this._queue[0].priority < priority) && weight <= this._value;
|
|
8679
|
+
}
|
|
8680
|
+
};
|
|
8681
|
+
function insertSorted(a26, v) {
|
|
8682
|
+
const i = findIndexFromEnd(a26, (other) => v.priority <= other.priority);
|
|
8683
|
+
a26.splice(i + 1, 0, v);
|
|
8684
|
+
}
|
|
8685
|
+
function findIndexFromEnd(a26, predicate) {
|
|
8686
|
+
for (let i = a26.length - 1; i >= 0; i--) {
|
|
8687
|
+
if (predicate(a26[i])) {
|
|
8688
|
+
return i;
|
|
8689
|
+
}
|
|
8690
|
+
}
|
|
8691
|
+
return -1;
|
|
8692
|
+
}
|
|
8693
|
+
|
|
8694
|
+
// ../shared/dist/esm/utils/locks.js
|
|
8695
|
+
var ReadWriteLock = class {
|
|
8696
|
+
constructor() {
|
|
8697
|
+
this.semaphore = new Semaphore(1);
|
|
8698
|
+
this.readers = 0;
|
|
8699
|
+
this.readersMutex = new Semaphore(1);
|
|
8700
|
+
}
|
|
8701
|
+
async withReadLock(callback) {
|
|
8702
|
+
await this._acquireReadLock();
|
|
8703
|
+
try {
|
|
8704
|
+
return await callback();
|
|
8705
|
+
} finally {
|
|
8706
|
+
await this._releaseReadLock();
|
|
8707
|
+
}
|
|
8708
|
+
}
|
|
8709
|
+
async withWriteLock(callback) {
|
|
8710
|
+
await this._acquireWriteLock();
|
|
8711
|
+
try {
|
|
8712
|
+
return await callback();
|
|
8713
|
+
} finally {
|
|
8714
|
+
await this._releaseWriteLock();
|
|
8715
|
+
}
|
|
8716
|
+
}
|
|
8717
|
+
async _acquireReadLock() {
|
|
8718
|
+
await this.readersMutex.acquire();
|
|
8719
|
+
try {
|
|
8720
|
+
this.readers += 1;
|
|
8721
|
+
if (this.readers === 1) await this.semaphore.acquire();
|
|
8722
|
+
} finally {
|
|
8723
|
+
this.readersMutex.release();
|
|
8724
|
+
}
|
|
8725
|
+
}
|
|
8726
|
+
async _releaseReadLock() {
|
|
8727
|
+
await this.readersMutex.acquire();
|
|
8728
|
+
try {
|
|
8729
|
+
this.readers -= 1;
|
|
8730
|
+
if (this.readers === 0) this.semaphore.release();
|
|
8731
|
+
} finally {
|
|
8732
|
+
this.readersMutex.release();
|
|
8733
|
+
}
|
|
8734
|
+
}
|
|
8735
|
+
async _acquireWriteLock() {
|
|
8736
|
+
await this.semaphore.acquire();
|
|
8737
|
+
}
|
|
8738
|
+
async _releaseWriteLock() {
|
|
8739
|
+
this.semaphore.release();
|
|
8740
|
+
}
|
|
8741
|
+
};
|
|
8742
|
+
|
|
8743
|
+
// ../shared/dist/esm/utils/stores.js
|
|
8744
|
+
var storeLock = new ReadWriteLock();
|
|
8745
|
+
|
|
8746
|
+
// ../shared/dist/esm/interface/client-interface.js
|
|
8747
|
+
var USER_AGENT;
|
|
8748
|
+
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT = `oauth4webapi/v3.8.5`;
|
|
8749
|
+
var ERR_INVALID_ARG_VALUE = "ERR_INVALID_ARG_VALUE";
|
|
8750
|
+
function CodedTypeError(message, code, cause) {
|
|
8751
|
+
const err = new TypeError(message, { cause });
|
|
8752
|
+
Object.assign(err, { code });
|
|
8753
|
+
return err;
|
|
8754
|
+
}
|
|
8755
|
+
var allowInsecureRequests = Symbol();
|
|
8756
|
+
var clockSkew = Symbol();
|
|
8757
|
+
var clockTolerance = Symbol();
|
|
8758
|
+
var customFetch = Symbol();
|
|
8759
|
+
var jweDecrypt = Symbol();
|
|
8760
|
+
var encoder = new TextEncoder();
|
|
8761
|
+
var decoder = new TextDecoder();
|
|
8762
|
+
var encodeBase64Url;
|
|
8763
|
+
if (Uint8Array.prototype.toBase64) encodeBase64Url = (input) => {
|
|
8764
|
+
if (input instanceof ArrayBuffer) input = new Uint8Array(input);
|
|
8765
|
+
return input.toBase64({
|
|
8766
|
+
alphabet: "base64url",
|
|
8767
|
+
omitPadding: true
|
|
8768
|
+
});
|
|
8769
|
+
};
|
|
8770
|
+
else {
|
|
8771
|
+
const CHUNK_SIZE = 32768;
|
|
8772
|
+
encodeBase64Url = (input) => {
|
|
8773
|
+
if (input instanceof ArrayBuffer) input = new Uint8Array(input);
|
|
8774
|
+
const arr = [];
|
|
8775
|
+
for (let i = 0; i < input.byteLength; i += CHUNK_SIZE) arr.push(String.fromCharCode.apply(null, input.subarray(i, i + CHUNK_SIZE)));
|
|
8776
|
+
return btoa(arr.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
8777
|
+
};
|
|
8778
|
+
}
|
|
8779
|
+
var decodeBase64Url;
|
|
8780
|
+
if (Uint8Array.fromBase64) decodeBase64Url = (input) => {
|
|
8781
|
+
try {
|
|
8782
|
+
return Uint8Array.fromBase64(input, { alphabet: "base64url" });
|
|
8783
|
+
} catch (cause) {
|
|
8784
|
+
throw CodedTypeError("The input to be decoded is not correctly encoded.", ERR_INVALID_ARG_VALUE, cause);
|
|
8785
|
+
}
|
|
8786
|
+
};
|
|
8787
|
+
else decodeBase64Url = (input) => {
|
|
8788
|
+
try {
|
|
8789
|
+
const binary = atob(input.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, ""));
|
|
8790
|
+
const bytes = new Uint8Array(binary.length);
|
|
8791
|
+
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
8792
|
+
return bytes;
|
|
8793
|
+
} catch (cause) {
|
|
8794
|
+
throw CodedTypeError("The input to be decoded is not correctly encoded.", ERR_INVALID_ARG_VALUE, cause);
|
|
8795
|
+
}
|
|
8796
|
+
};
|
|
8797
|
+
var URLParse = URL.parse ? (url, base) => URL.parse(url, base) : (url, base) => {
|
|
8798
|
+
try {
|
|
8799
|
+
return new URL(url, base);
|
|
8800
|
+
} catch {
|
|
8801
|
+
return null;
|
|
8802
|
+
}
|
|
8803
|
+
};
|
|
8804
|
+
var tokenMatch = "[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+";
|
|
8805
|
+
var token68Match = "[a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2}";
|
|
8806
|
+
var quotedParamMatcher = "(" + tokenMatch + ')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"';
|
|
8807
|
+
var paramMatcher = "(" + tokenMatch + ")\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)";
|
|
8808
|
+
var schemeRE = new RegExp("^[,\\s]*(" + tokenMatch + ")");
|
|
8809
|
+
var quotedParamRE = new RegExp("^[,\\s]*" + quotedParamMatcher + "[,\\s]*(.*)");
|
|
8810
|
+
var unquotedParamRE = new RegExp("^[,\\s]*" + paramMatcher + "[,\\s]*(.*)");
|
|
8811
|
+
var token68ParamRE = new RegExp("^(" + token68Match + ")(?:$|[,\\s])(.*)");
|
|
8812
|
+
var nopkce = Symbol();
|
|
8813
|
+
var expectNoNonce = Symbol();
|
|
8814
|
+
var skipAuthTimeCheck = Symbol();
|
|
8815
|
+
var skipStateCheck = Symbol();
|
|
8816
|
+
var expectNoState = Symbol();
|
|
8817
|
+
var _expectedIssuer = Symbol();
|
|
8818
|
+
var botChallengeKnownErrors = [KnownErrors.BotChallengeRequired, KnownErrors.BotChallengeFailed];
|
|
8819
|
+
|
|
8820
|
+
// ../shared/dist/esm/utils/maps.js
|
|
8821
|
+
var _Symbol$toStringTag3;
|
|
8822
|
+
var _Symbol$toStringTag22;
|
|
8823
|
+
var _Symbol$toStringTag32;
|
|
8824
|
+
var WeakRefIfAvailable = class {
|
|
8825
|
+
constructor(value) {
|
|
8826
|
+
if (typeof WeakRef === "undefined") this._ref = { deref: () => value };
|
|
8827
|
+
else this._ref = new WeakRef(value);
|
|
8828
|
+
}
|
|
8829
|
+
deref() {
|
|
8830
|
+
return this._ref.deref();
|
|
8831
|
+
}
|
|
8832
|
+
};
|
|
8833
|
+
var _a2;
|
|
8834
|
+
var IterableWeakMap = (_a2 = class {
|
|
8835
|
+
constructor(entries) {
|
|
8836
|
+
this[_Symbol$toStringTag3] = "IterableWeakMap";
|
|
8837
|
+
const mappedEntries = entries?.map((e40) => [e40[0], {
|
|
8838
|
+
value: e40[1],
|
|
8839
|
+
keyRef: new WeakRefIfAvailable(e40[0])
|
|
8840
|
+
}]);
|
|
8841
|
+
this._weakMap = new WeakMap(mappedEntries ?? []);
|
|
8842
|
+
this._keyRefs = new Set(mappedEntries?.map((e40) => e40[1].keyRef) ?? []);
|
|
8843
|
+
}
|
|
8844
|
+
get(key) {
|
|
8845
|
+
return this._weakMap.get(key)?.value;
|
|
8846
|
+
}
|
|
8847
|
+
set(key, value) {
|
|
8848
|
+
const updated = {
|
|
8849
|
+
value,
|
|
8850
|
+
keyRef: this._weakMap.get(key)?.keyRef ?? new WeakRefIfAvailable(key)
|
|
8851
|
+
};
|
|
8852
|
+
this._weakMap.set(key, updated);
|
|
8853
|
+
this._keyRefs.add(updated.keyRef);
|
|
8854
|
+
return this;
|
|
8855
|
+
}
|
|
8856
|
+
delete(key) {
|
|
8857
|
+
const res = this._weakMap.get(key);
|
|
8858
|
+
if (res) {
|
|
8859
|
+
this._weakMap.delete(key);
|
|
8860
|
+
this._keyRefs.delete(res.keyRef);
|
|
8861
|
+
return true;
|
|
8862
|
+
}
|
|
8863
|
+
return false;
|
|
8864
|
+
}
|
|
8865
|
+
has(key) {
|
|
8866
|
+
return this._weakMap.has(key) && this._keyRefs.has(this._weakMap.get(key).keyRef);
|
|
8867
|
+
}
|
|
8868
|
+
*[Symbol.iterator]() {
|
|
8869
|
+
for (const keyRef of this._keyRefs) {
|
|
8870
|
+
const key = keyRef.deref();
|
|
8871
|
+
const existing = key ? this._weakMap.get(key) : void 0;
|
|
8872
|
+
if (!key) this._keyRefs.delete(keyRef);
|
|
8873
|
+
else if (existing) yield [key, existing.value];
|
|
8874
|
+
}
|
|
8875
|
+
}
|
|
8876
|
+
}, _Symbol$toStringTag3 = Symbol.toStringTag, _a2);
|
|
8877
|
+
var _a3;
|
|
8878
|
+
var MaybeWeakMap = (_a3 = class {
|
|
8879
|
+
constructor(entries) {
|
|
8880
|
+
this[_Symbol$toStringTag22] = "MaybeWeakMap";
|
|
8881
|
+
const entriesArray = [...entries ?? []];
|
|
8882
|
+
this._primitiveMap = new Map(entriesArray.filter((e40) => !this._isAllowedInWeakMap(e40[0])));
|
|
8883
|
+
this._weakMap = new IterableWeakMap(entriesArray.filter((e40) => this._isAllowedInWeakMap(e40[0])));
|
|
8884
|
+
}
|
|
8885
|
+
_isAllowedInWeakMap(key) {
|
|
8886
|
+
return typeof key === "object" && key !== null || typeof key === "symbol" && Symbol.keyFor(key) === void 0;
|
|
8887
|
+
}
|
|
8888
|
+
get(key) {
|
|
8889
|
+
if (this._isAllowedInWeakMap(key)) return this._weakMap.get(key);
|
|
8890
|
+
else return this._primitiveMap.get(key);
|
|
8891
|
+
}
|
|
8892
|
+
set(key, value) {
|
|
8893
|
+
if (this._isAllowedInWeakMap(key)) this._weakMap.set(key, value);
|
|
8894
|
+
else this._primitiveMap.set(key, value);
|
|
8895
|
+
return this;
|
|
8896
|
+
}
|
|
8897
|
+
delete(key) {
|
|
8898
|
+
if (this._isAllowedInWeakMap(key)) return this._weakMap.delete(key);
|
|
8899
|
+
else return this._primitiveMap.delete(key);
|
|
8900
|
+
}
|
|
8901
|
+
has(key) {
|
|
8902
|
+
if (this._isAllowedInWeakMap(key)) return this._weakMap.has(key);
|
|
8903
|
+
else return this._primitiveMap.has(key);
|
|
8904
|
+
}
|
|
8905
|
+
*[Symbol.iterator]() {
|
|
8906
|
+
yield* this._primitiveMap;
|
|
8907
|
+
yield* this._weakMap;
|
|
8908
|
+
}
|
|
8909
|
+
}, _Symbol$toStringTag22 = Symbol.toStringTag, _a3);
|
|
8910
|
+
var _a4;
|
|
8911
|
+
var DependenciesMap = (_a4 = class {
|
|
8912
|
+
constructor() {
|
|
8913
|
+
this._inner = {
|
|
8914
|
+
map: new MaybeWeakMap(),
|
|
8915
|
+
hasValue: false,
|
|
8916
|
+
value: void 0
|
|
8917
|
+
};
|
|
8918
|
+
this[_Symbol$toStringTag32] = "DependenciesMap";
|
|
8919
|
+
}
|
|
8920
|
+
_valueToResult(inner) {
|
|
8921
|
+
if (inner.hasValue) return Result.ok(inner.value);
|
|
8922
|
+
else return Result.error(void 0);
|
|
8923
|
+
}
|
|
8924
|
+
_unwrapFromInner(dependencies, inner) {
|
|
8925
|
+
if (dependencies.length === 0) return this._valueToResult(inner);
|
|
8926
|
+
else {
|
|
8927
|
+
const [key, ...rest] = dependencies;
|
|
8928
|
+
const newInner = inner.map.get(key);
|
|
8929
|
+
if (!newInner) return Result.error(void 0);
|
|
8930
|
+
return this._unwrapFromInner(rest, newInner);
|
|
8931
|
+
}
|
|
8932
|
+
}
|
|
8933
|
+
_setInInner(dependencies, value, inner) {
|
|
8934
|
+
if (dependencies.length === 0) {
|
|
8935
|
+
const res = this._valueToResult(inner);
|
|
8936
|
+
if (value.status === "ok") {
|
|
8937
|
+
inner.hasValue = true;
|
|
8938
|
+
inner.value = value.data;
|
|
8939
|
+
} else {
|
|
8940
|
+
inner.hasValue = false;
|
|
8941
|
+
inner.value = void 0;
|
|
8942
|
+
}
|
|
8943
|
+
return res;
|
|
8944
|
+
} else {
|
|
8945
|
+
const [key, ...rest] = dependencies;
|
|
8946
|
+
let newInner = inner.map.get(key);
|
|
8947
|
+
if (!newInner) inner.map.set(key, newInner = {
|
|
8948
|
+
map: new MaybeWeakMap(),
|
|
8949
|
+
hasValue: false,
|
|
8950
|
+
value: void 0
|
|
8951
|
+
});
|
|
8952
|
+
return this._setInInner(rest, value, newInner);
|
|
8953
|
+
}
|
|
8954
|
+
}
|
|
8955
|
+
*_iterateInner(dependencies, inner) {
|
|
8956
|
+
if (inner.hasValue) yield [dependencies, inner.value];
|
|
8957
|
+
for (const [key, value] of inner.map) yield* this._iterateInner([...dependencies, key], value);
|
|
8958
|
+
}
|
|
8959
|
+
get(dependencies) {
|
|
8960
|
+
return Result.or(this._unwrapFromInner(dependencies, this._inner), void 0);
|
|
8961
|
+
}
|
|
8962
|
+
set(dependencies, value) {
|
|
8963
|
+
this._setInInner(dependencies, Result.ok(value), this._inner);
|
|
8964
|
+
return this;
|
|
8965
|
+
}
|
|
8966
|
+
delete(dependencies) {
|
|
8967
|
+
return this._setInInner(dependencies, Result.error(void 0), this._inner).status === "ok";
|
|
8968
|
+
}
|
|
8969
|
+
has(dependencies) {
|
|
8970
|
+
return this._unwrapFromInner(dependencies, this._inner).status === "ok";
|
|
8971
|
+
}
|
|
8972
|
+
clear() {
|
|
8973
|
+
this._inner = {
|
|
8974
|
+
map: new MaybeWeakMap(),
|
|
8975
|
+
hasValue: false,
|
|
8976
|
+
value: void 0
|
|
8977
|
+
};
|
|
8978
|
+
}
|
|
8979
|
+
*[Symbol.iterator]() {
|
|
8980
|
+
yield* this._iterateInner([], this._inner);
|
|
8981
|
+
}
|
|
8982
|
+
}, _Symbol$toStringTag32 = Symbol.toStringTag, _a4);
|
|
8983
|
+
|
|
8984
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/platform/browser/globalThis.js
|
|
8985
|
+
var _globalThis = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
|
|
8986
|
+
|
|
8987
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/version.js
|
|
8988
|
+
var VERSION = "1.9.0";
|
|
8989
|
+
|
|
8990
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/semver.js
|
|
8991
|
+
var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
|
|
8992
|
+
function _makeCompatibilityCheck(ownVersion) {
|
|
8993
|
+
var acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
|
|
8994
|
+
var rejectedVersions = /* @__PURE__ */ new Set();
|
|
8995
|
+
var myVersionMatch = ownVersion.match(re);
|
|
8996
|
+
if (!myVersionMatch) {
|
|
8997
|
+
return function() {
|
|
8998
|
+
return false;
|
|
8999
|
+
};
|
|
9000
|
+
}
|
|
9001
|
+
var ownVersionParsed = {
|
|
9002
|
+
major: +myVersionMatch[1],
|
|
9003
|
+
minor: +myVersionMatch[2],
|
|
9004
|
+
patch: +myVersionMatch[3],
|
|
9005
|
+
prerelease: myVersionMatch[4]
|
|
9006
|
+
};
|
|
9007
|
+
if (ownVersionParsed.prerelease != null) {
|
|
9008
|
+
return function isExactmatch(globalVersion) {
|
|
9009
|
+
return globalVersion === ownVersion;
|
|
9010
|
+
};
|
|
9011
|
+
}
|
|
9012
|
+
function _reject(v) {
|
|
9013
|
+
rejectedVersions.add(v);
|
|
9014
|
+
return false;
|
|
9015
|
+
}
|
|
9016
|
+
function _accept(v) {
|
|
9017
|
+
acceptedVersions.add(v);
|
|
9018
|
+
return true;
|
|
9019
|
+
}
|
|
9020
|
+
return function isCompatible2(globalVersion) {
|
|
9021
|
+
if (acceptedVersions.has(globalVersion)) {
|
|
9022
|
+
return true;
|
|
9023
|
+
}
|
|
9024
|
+
if (rejectedVersions.has(globalVersion)) {
|
|
9025
|
+
return false;
|
|
9026
|
+
}
|
|
9027
|
+
var globalVersionMatch = globalVersion.match(re);
|
|
9028
|
+
if (!globalVersionMatch) {
|
|
9029
|
+
return _reject(globalVersion);
|
|
9030
|
+
}
|
|
9031
|
+
var globalVersionParsed = {
|
|
9032
|
+
major: +globalVersionMatch[1],
|
|
9033
|
+
minor: +globalVersionMatch[2],
|
|
9034
|
+
patch: +globalVersionMatch[3],
|
|
9035
|
+
prerelease: globalVersionMatch[4]
|
|
9036
|
+
};
|
|
9037
|
+
if (globalVersionParsed.prerelease != null) {
|
|
9038
|
+
return _reject(globalVersion);
|
|
9039
|
+
}
|
|
9040
|
+
if (ownVersionParsed.major !== globalVersionParsed.major) {
|
|
9041
|
+
return _reject(globalVersion);
|
|
9042
|
+
}
|
|
9043
|
+
if (ownVersionParsed.major === 0) {
|
|
9044
|
+
if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) {
|
|
9045
|
+
return _accept(globalVersion);
|
|
9046
|
+
}
|
|
9047
|
+
return _reject(globalVersion);
|
|
9048
|
+
}
|
|
9049
|
+
if (ownVersionParsed.minor <= globalVersionParsed.minor) {
|
|
9050
|
+
return _accept(globalVersion);
|
|
9051
|
+
}
|
|
9052
|
+
return _reject(globalVersion);
|
|
9053
|
+
};
|
|
9054
|
+
}
|
|
9055
|
+
var isCompatible = _makeCompatibilityCheck(VERSION);
|
|
9056
|
+
|
|
9057
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
|
|
9058
|
+
var major = VERSION.split(".")[0];
|
|
9059
|
+
var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for("opentelemetry.js.api." + major);
|
|
9060
|
+
var _global = _globalThis;
|
|
9061
|
+
function registerGlobal(type, instance, diag, allowOverride) {
|
|
9062
|
+
var _a5;
|
|
9063
|
+
if (allowOverride === void 0) {
|
|
9064
|
+
allowOverride = false;
|
|
9065
|
+
}
|
|
9066
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a5 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a5 !== void 0 ? _a5 : {
|
|
9067
|
+
version: VERSION
|
|
9068
|
+
};
|
|
9069
|
+
if (!allowOverride && api[type]) {
|
|
9070
|
+
var err = new Error("@opentelemetry/api: Attempted duplicate registration of API: " + type);
|
|
9071
|
+
diag.error(err.stack || err.message);
|
|
9072
|
+
return false;
|
|
9073
|
+
}
|
|
9074
|
+
if (api.version !== VERSION) {
|
|
9075
|
+
var err = new Error("@opentelemetry/api: Registration of version v" + api.version + " for " + type + " does not match previously registered API v" + VERSION);
|
|
9076
|
+
diag.error(err.stack || err.message);
|
|
9077
|
+
return false;
|
|
9078
|
+
}
|
|
9079
|
+
api[type] = instance;
|
|
9080
|
+
diag.debug("@opentelemetry/api: Registered a global for " + type + " v" + VERSION + ".");
|
|
9081
|
+
return true;
|
|
9082
|
+
}
|
|
9083
|
+
function getGlobal(type) {
|
|
9084
|
+
var _a5, _b;
|
|
9085
|
+
var globalVersion = (_a5 = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a5 === void 0 ? void 0 : _a5.version;
|
|
9086
|
+
if (!globalVersion || !isCompatible(globalVersion)) {
|
|
9087
|
+
return;
|
|
9088
|
+
}
|
|
9089
|
+
return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
|
|
9090
|
+
}
|
|
9091
|
+
function unregisterGlobal(type, diag) {
|
|
9092
|
+
diag.debug("@opentelemetry/api: Unregistering a global for " + type + " v" + VERSION + ".");
|
|
9093
|
+
var api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
|
|
9094
|
+
if (api) {
|
|
9095
|
+
delete api[type];
|
|
9096
|
+
}
|
|
9097
|
+
}
|
|
9098
|
+
|
|
9099
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
|
|
9100
|
+
var __read = function(o21, n9) {
|
|
9101
|
+
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
9102
|
+
if (!m5) return o21;
|
|
9103
|
+
var i = m5.call(o21), r7, ar = [], e40;
|
|
9104
|
+
try {
|
|
9105
|
+
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
9106
|
+
} catch (error) {
|
|
9107
|
+
e40 = { error };
|
|
9108
|
+
} finally {
|
|
9109
|
+
try {
|
|
9110
|
+
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
9111
|
+
} finally {
|
|
9112
|
+
if (e40) throw e40.error;
|
|
9113
|
+
}
|
|
9114
|
+
}
|
|
9115
|
+
return ar;
|
|
9116
|
+
};
|
|
9117
|
+
var __spreadArray = function(to, from, pack) {
|
|
9118
|
+
if (pack || arguments.length === 2) for (var i = 0, l3 = from.length, ar; i < l3; i++) {
|
|
9119
|
+
if (ar || !(i in from)) {
|
|
9120
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
9121
|
+
ar[i] = from[i];
|
|
9122
|
+
}
|
|
9123
|
+
}
|
|
9124
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9125
|
+
};
|
|
9126
|
+
var DiagComponentLogger = (
|
|
9127
|
+
/** @class */
|
|
9128
|
+
function() {
|
|
9129
|
+
function DiagComponentLogger2(props) {
|
|
9130
|
+
this._namespace = props.namespace || "DiagComponentLogger";
|
|
9131
|
+
}
|
|
9132
|
+
DiagComponentLogger2.prototype.debug = function() {
|
|
9133
|
+
var args = [];
|
|
9134
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9135
|
+
args[_i] = arguments[_i];
|
|
9136
|
+
}
|
|
9137
|
+
return logProxy("debug", this._namespace, args);
|
|
9138
|
+
};
|
|
9139
|
+
DiagComponentLogger2.prototype.error = function() {
|
|
9140
|
+
var args = [];
|
|
9141
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9142
|
+
args[_i] = arguments[_i];
|
|
9143
|
+
}
|
|
9144
|
+
return logProxy("error", this._namespace, args);
|
|
9145
|
+
};
|
|
9146
|
+
DiagComponentLogger2.prototype.info = function() {
|
|
9147
|
+
var args = [];
|
|
9148
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9149
|
+
args[_i] = arguments[_i];
|
|
9150
|
+
}
|
|
9151
|
+
return logProxy("info", this._namespace, args);
|
|
9152
|
+
};
|
|
9153
|
+
DiagComponentLogger2.prototype.warn = function() {
|
|
9154
|
+
var args = [];
|
|
9155
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9156
|
+
args[_i] = arguments[_i];
|
|
9157
|
+
}
|
|
9158
|
+
return logProxy("warn", this._namespace, args);
|
|
9159
|
+
};
|
|
9160
|
+
DiagComponentLogger2.prototype.verbose = function() {
|
|
9161
|
+
var args = [];
|
|
9162
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9163
|
+
args[_i] = arguments[_i];
|
|
9164
|
+
}
|
|
9165
|
+
return logProxy("verbose", this._namespace, args);
|
|
9166
|
+
};
|
|
9167
|
+
return DiagComponentLogger2;
|
|
9168
|
+
}()
|
|
9169
|
+
);
|
|
9170
|
+
function logProxy(funcName, namespace, args) {
|
|
9171
|
+
var logger = getGlobal("diag");
|
|
9172
|
+
if (!logger) {
|
|
9173
|
+
return;
|
|
9174
|
+
}
|
|
9175
|
+
args.unshift(namespace);
|
|
9176
|
+
return logger[funcName].apply(logger, __spreadArray([], __read(args), false));
|
|
9177
|
+
}
|
|
9178
|
+
|
|
9179
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/types.js
|
|
9180
|
+
var DiagLogLevel;
|
|
9181
|
+
(function(DiagLogLevel2) {
|
|
9182
|
+
DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
|
|
9183
|
+
DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
|
|
9184
|
+
DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN";
|
|
9185
|
+
DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO";
|
|
9186
|
+
DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG";
|
|
9187
|
+
DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE";
|
|
9188
|
+
DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
|
|
9189
|
+
})(DiagLogLevel || (DiagLogLevel = {}));
|
|
9190
|
+
|
|
9191
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
|
|
9192
|
+
function createLogLevelDiagLogger(maxLevel, logger) {
|
|
9193
|
+
if (maxLevel < DiagLogLevel.NONE) {
|
|
9194
|
+
maxLevel = DiagLogLevel.NONE;
|
|
9195
|
+
} else if (maxLevel > DiagLogLevel.ALL) {
|
|
9196
|
+
maxLevel = DiagLogLevel.ALL;
|
|
9197
|
+
}
|
|
9198
|
+
logger = logger || {};
|
|
9199
|
+
function _filterFunc(funcName, theLevel) {
|
|
9200
|
+
var theFunc = logger[funcName];
|
|
9201
|
+
if (typeof theFunc === "function" && maxLevel >= theLevel) {
|
|
9202
|
+
return theFunc.bind(logger);
|
|
9203
|
+
}
|
|
9204
|
+
return function() {
|
|
9205
|
+
};
|
|
9206
|
+
}
|
|
9207
|
+
return {
|
|
9208
|
+
error: _filterFunc("error", DiagLogLevel.ERROR),
|
|
9209
|
+
warn: _filterFunc("warn", DiagLogLevel.WARN),
|
|
9210
|
+
info: _filterFunc("info", DiagLogLevel.INFO),
|
|
9211
|
+
debug: _filterFunc("debug", DiagLogLevel.DEBUG),
|
|
9212
|
+
verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
|
|
9213
|
+
};
|
|
9214
|
+
}
|
|
9215
|
+
|
|
9216
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/diag.js
|
|
9217
|
+
var __read2 = function(o21, n9) {
|
|
9218
|
+
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
9219
|
+
if (!m5) return o21;
|
|
9220
|
+
var i = m5.call(o21), r7, ar = [], e40;
|
|
9221
|
+
try {
|
|
9222
|
+
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
9223
|
+
} catch (error) {
|
|
9224
|
+
e40 = { error };
|
|
9225
|
+
} finally {
|
|
9226
|
+
try {
|
|
9227
|
+
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
9228
|
+
} finally {
|
|
9229
|
+
if (e40) throw e40.error;
|
|
9230
|
+
}
|
|
9231
|
+
}
|
|
9232
|
+
return ar;
|
|
9233
|
+
};
|
|
9234
|
+
var __spreadArray2 = function(to, from, pack) {
|
|
9235
|
+
if (pack || arguments.length === 2) for (var i = 0, l3 = from.length, ar; i < l3; i++) {
|
|
9236
|
+
if (ar || !(i in from)) {
|
|
9237
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
9238
|
+
ar[i] = from[i];
|
|
9239
|
+
}
|
|
9240
|
+
}
|
|
9241
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9242
|
+
};
|
|
9243
|
+
var API_NAME = "diag";
|
|
9244
|
+
var DiagAPI = (
|
|
9245
|
+
/** @class */
|
|
9246
|
+
function() {
|
|
9247
|
+
function DiagAPI2() {
|
|
9248
|
+
function _logProxy(funcName) {
|
|
9249
|
+
return function() {
|
|
9250
|
+
var args = [];
|
|
9251
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
9252
|
+
args[_i] = arguments[_i];
|
|
9253
|
+
}
|
|
9254
|
+
var logger = getGlobal("diag");
|
|
9255
|
+
if (!logger)
|
|
9256
|
+
return;
|
|
9257
|
+
return logger[funcName].apply(logger, __spreadArray2([], __read2(args), false));
|
|
9258
|
+
};
|
|
9259
|
+
}
|
|
9260
|
+
var self2 = this;
|
|
9261
|
+
var setLogger = function(logger, optionsOrLogLevel) {
|
|
9262
|
+
var _a5, _b, _c;
|
|
9263
|
+
if (optionsOrLogLevel === void 0) {
|
|
9264
|
+
optionsOrLogLevel = { logLevel: DiagLogLevel.INFO };
|
|
9265
|
+
}
|
|
9266
|
+
if (logger === self2) {
|
|
9267
|
+
var err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
|
|
9268
|
+
self2.error((_a5 = err.stack) !== null && _a5 !== void 0 ? _a5 : err.message);
|
|
9269
|
+
return false;
|
|
9270
|
+
}
|
|
9271
|
+
if (typeof optionsOrLogLevel === "number") {
|
|
9272
|
+
optionsOrLogLevel = {
|
|
9273
|
+
logLevel: optionsOrLogLevel
|
|
9274
|
+
};
|
|
9275
|
+
}
|
|
9276
|
+
var oldLogger = getGlobal("diag");
|
|
9277
|
+
var newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
|
|
9278
|
+
if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
|
|
9279
|
+
var stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
|
|
9280
|
+
oldLogger.warn("Current logger will be overwritten from " + stack);
|
|
9281
|
+
newLogger.warn("Current logger will overwrite one already registered from " + stack);
|
|
9282
|
+
}
|
|
9283
|
+
return registerGlobal("diag", newLogger, self2, true);
|
|
9284
|
+
};
|
|
9285
|
+
self2.setLogger = setLogger;
|
|
9286
|
+
self2.disable = function() {
|
|
9287
|
+
unregisterGlobal(API_NAME, self2);
|
|
9288
|
+
};
|
|
9289
|
+
self2.createComponentLogger = function(options) {
|
|
9290
|
+
return new DiagComponentLogger(options);
|
|
9291
|
+
};
|
|
9292
|
+
self2.verbose = _logProxy("verbose");
|
|
9293
|
+
self2.debug = _logProxy("debug");
|
|
9294
|
+
self2.info = _logProxy("info");
|
|
9295
|
+
self2.warn = _logProxy("warn");
|
|
9296
|
+
self2.error = _logProxy("error");
|
|
9297
|
+
}
|
|
9298
|
+
DiagAPI2.instance = function() {
|
|
9299
|
+
if (!this._instance) {
|
|
9300
|
+
this._instance = new DiagAPI2();
|
|
9301
|
+
}
|
|
9302
|
+
return this._instance;
|
|
9303
|
+
};
|
|
9304
|
+
return DiagAPI2;
|
|
9305
|
+
}()
|
|
9306
|
+
);
|
|
9307
|
+
|
|
9308
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/context/context.js
|
|
9309
|
+
function createContextKey(description) {
|
|
9310
|
+
return Symbol.for(description);
|
|
9311
|
+
}
|
|
9312
|
+
var BaseContext = (
|
|
9313
|
+
/** @class */
|
|
9314
|
+
/* @__PURE__ */ function() {
|
|
9315
|
+
function BaseContext2(parentContext) {
|
|
9316
|
+
var self2 = this;
|
|
9317
|
+
self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
|
|
9318
|
+
self2.getValue = function(key) {
|
|
9319
|
+
return self2._currentContext.get(key);
|
|
9320
|
+
};
|
|
9321
|
+
self2.setValue = function(key, value) {
|
|
9322
|
+
var context = new BaseContext2(self2._currentContext);
|
|
9323
|
+
context._currentContext.set(key, value);
|
|
9324
|
+
return context;
|
|
9325
|
+
};
|
|
9326
|
+
self2.deleteValue = function(key) {
|
|
9327
|
+
var context = new BaseContext2(self2._currentContext);
|
|
9328
|
+
context._currentContext.delete(key);
|
|
9329
|
+
return context;
|
|
9330
|
+
};
|
|
9331
|
+
}
|
|
9332
|
+
return BaseContext2;
|
|
9333
|
+
}()
|
|
9334
|
+
);
|
|
9335
|
+
var ROOT_CONTEXT = new BaseContext();
|
|
9336
|
+
|
|
9337
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
|
|
9338
|
+
var __read3 = function(o21, n9) {
|
|
9339
|
+
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
9340
|
+
if (!m5) return o21;
|
|
9341
|
+
var i = m5.call(o21), r7, ar = [], e40;
|
|
9342
|
+
try {
|
|
9343
|
+
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
9344
|
+
} catch (error) {
|
|
9345
|
+
e40 = { error };
|
|
9346
|
+
} finally {
|
|
9347
|
+
try {
|
|
9348
|
+
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
9349
|
+
} finally {
|
|
9350
|
+
if (e40) throw e40.error;
|
|
9351
|
+
}
|
|
9352
|
+
}
|
|
9353
|
+
return ar;
|
|
9354
|
+
};
|
|
9355
|
+
var __spreadArray3 = function(to, from, pack) {
|
|
9356
|
+
if (pack || arguments.length === 2) for (var i = 0, l3 = from.length, ar; i < l3; i++) {
|
|
9357
|
+
if (ar || !(i in from)) {
|
|
9358
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
9359
|
+
ar[i] = from[i];
|
|
9360
|
+
}
|
|
9361
|
+
}
|
|
9362
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9363
|
+
};
|
|
9364
|
+
var NoopContextManager = (
|
|
9365
|
+
/** @class */
|
|
9366
|
+
function() {
|
|
9367
|
+
function NoopContextManager2() {
|
|
9368
|
+
}
|
|
9369
|
+
NoopContextManager2.prototype.active = function() {
|
|
9370
|
+
return ROOT_CONTEXT;
|
|
9371
|
+
};
|
|
9372
|
+
NoopContextManager2.prototype.with = function(_context, fn, thisArg) {
|
|
9373
|
+
var args = [];
|
|
9374
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
9375
|
+
args[_i - 3] = arguments[_i];
|
|
9376
|
+
}
|
|
9377
|
+
return fn.call.apply(fn, __spreadArray3([thisArg], __read3(args), false));
|
|
9378
|
+
};
|
|
9379
|
+
NoopContextManager2.prototype.bind = function(_context, target) {
|
|
9380
|
+
return target;
|
|
9381
|
+
};
|
|
9382
|
+
NoopContextManager2.prototype.enable = function() {
|
|
9383
|
+
return this;
|
|
9384
|
+
};
|
|
9385
|
+
NoopContextManager2.prototype.disable = function() {
|
|
9386
|
+
return this;
|
|
9387
|
+
};
|
|
9388
|
+
return NoopContextManager2;
|
|
9389
|
+
}()
|
|
9390
|
+
);
|
|
9391
|
+
|
|
9392
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/context.js
|
|
9393
|
+
var __read4 = function(o21, n9) {
|
|
9394
|
+
var m5 = typeof Symbol === "function" && o21[Symbol.iterator];
|
|
9395
|
+
if (!m5) return o21;
|
|
9396
|
+
var i = m5.call(o21), r7, ar = [], e40;
|
|
9397
|
+
try {
|
|
9398
|
+
while ((n9 === void 0 || n9-- > 0) && !(r7 = i.next()).done) ar.push(r7.value);
|
|
9399
|
+
} catch (error) {
|
|
9400
|
+
e40 = { error };
|
|
9401
|
+
} finally {
|
|
9402
|
+
try {
|
|
9403
|
+
if (r7 && !r7.done && (m5 = i["return"])) m5.call(i);
|
|
9404
|
+
} finally {
|
|
9405
|
+
if (e40) throw e40.error;
|
|
9406
|
+
}
|
|
9407
|
+
}
|
|
9408
|
+
return ar;
|
|
9409
|
+
};
|
|
9410
|
+
var __spreadArray4 = function(to, from, pack) {
|
|
9411
|
+
if (pack || arguments.length === 2) for (var i = 0, l3 = from.length, ar; i < l3; i++) {
|
|
9412
|
+
if (ar || !(i in from)) {
|
|
9413
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
9414
|
+
ar[i] = from[i];
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9417
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9418
|
+
};
|
|
9419
|
+
var API_NAME2 = "context";
|
|
9420
|
+
var NOOP_CONTEXT_MANAGER = new NoopContextManager();
|
|
9421
|
+
var ContextAPI = (
|
|
9422
|
+
/** @class */
|
|
9423
|
+
function() {
|
|
9424
|
+
function ContextAPI2() {
|
|
9425
|
+
}
|
|
9426
|
+
ContextAPI2.getInstance = function() {
|
|
9427
|
+
if (!this._instance) {
|
|
9428
|
+
this._instance = new ContextAPI2();
|
|
9429
|
+
}
|
|
9430
|
+
return this._instance;
|
|
9431
|
+
};
|
|
9432
|
+
ContextAPI2.prototype.setGlobalContextManager = function(contextManager) {
|
|
9433
|
+
return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
|
|
9434
|
+
};
|
|
9435
|
+
ContextAPI2.prototype.active = function() {
|
|
9436
|
+
return this._getContextManager().active();
|
|
9437
|
+
};
|
|
9438
|
+
ContextAPI2.prototype.with = function(context, fn, thisArg) {
|
|
9439
|
+
var _a5;
|
|
9440
|
+
var args = [];
|
|
9441
|
+
for (var _i = 3; _i < arguments.length; _i++) {
|
|
9442
|
+
args[_i - 3] = arguments[_i];
|
|
9443
|
+
}
|
|
9444
|
+
return (_a5 = this._getContextManager()).with.apply(_a5, __spreadArray4([context, fn, thisArg], __read4(args), false));
|
|
9445
|
+
};
|
|
9446
|
+
ContextAPI2.prototype.bind = function(context, target) {
|
|
9447
|
+
return this._getContextManager().bind(context, target);
|
|
9448
|
+
};
|
|
9449
|
+
ContextAPI2.prototype._getContextManager = function() {
|
|
9450
|
+
return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
|
|
9451
|
+
};
|
|
9452
|
+
ContextAPI2.prototype.disable = function() {
|
|
9453
|
+
this._getContextManager().disable();
|
|
9454
|
+
unregisterGlobal(API_NAME2, DiagAPI.instance());
|
|
9455
|
+
};
|
|
9456
|
+
return ContextAPI2;
|
|
9457
|
+
}()
|
|
9458
|
+
);
|
|
9459
|
+
|
|
9460
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
|
|
9461
|
+
var TraceFlags;
|
|
9462
|
+
(function(TraceFlags2) {
|
|
9463
|
+
TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
|
|
9464
|
+
TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
|
|
9465
|
+
})(TraceFlags || (TraceFlags = {}));
|
|
9466
|
+
|
|
9467
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
|
|
9468
|
+
var INVALID_SPANID = "0000000000000000";
|
|
9469
|
+
var INVALID_TRACEID = "00000000000000000000000000000000";
|
|
9470
|
+
var INVALID_SPAN_CONTEXT = {
|
|
9471
|
+
traceId: INVALID_TRACEID,
|
|
9472
|
+
spanId: INVALID_SPANID,
|
|
9473
|
+
traceFlags: TraceFlags.NONE
|
|
9474
|
+
};
|
|
9475
|
+
|
|
9476
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
|
|
9477
|
+
var NonRecordingSpan = (
|
|
9478
|
+
/** @class */
|
|
9479
|
+
function() {
|
|
9480
|
+
function NonRecordingSpan2(_spanContext) {
|
|
9481
|
+
if (_spanContext === void 0) {
|
|
9482
|
+
_spanContext = INVALID_SPAN_CONTEXT;
|
|
9486
9483
|
}
|
|
9484
|
+
this._spanContext = _spanContext;
|
|
9487
9485
|
}
|
|
9488
|
-
function
|
|
9489
|
-
|
|
9486
|
+
NonRecordingSpan2.prototype.spanContext = function() {
|
|
9487
|
+
return this._spanContext;
|
|
9488
|
+
};
|
|
9489
|
+
NonRecordingSpan2.prototype.setAttribute = function(_key, _value) {
|
|
9490
|
+
return this;
|
|
9491
|
+
};
|
|
9492
|
+
NonRecordingSpan2.prototype.setAttributes = function(_attributes) {
|
|
9493
|
+
return this;
|
|
9494
|
+
};
|
|
9495
|
+
NonRecordingSpan2.prototype.addEvent = function(_name, _attributes) {
|
|
9496
|
+
return this;
|
|
9497
|
+
};
|
|
9498
|
+
NonRecordingSpan2.prototype.addLink = function(_link) {
|
|
9499
|
+
return this;
|
|
9500
|
+
};
|
|
9501
|
+
NonRecordingSpan2.prototype.addLinks = function(_links) {
|
|
9502
|
+
return this;
|
|
9503
|
+
};
|
|
9504
|
+
NonRecordingSpan2.prototype.setStatus = function(_status) {
|
|
9505
|
+
return this;
|
|
9506
|
+
};
|
|
9507
|
+
NonRecordingSpan2.prototype.updateName = function(_name) {
|
|
9508
|
+
return this;
|
|
9509
|
+
};
|
|
9510
|
+
NonRecordingSpan2.prototype.end = function(_endTime) {
|
|
9511
|
+
};
|
|
9512
|
+
NonRecordingSpan2.prototype.isRecording = function() {
|
|
9513
|
+
return false;
|
|
9514
|
+
};
|
|
9515
|
+
NonRecordingSpan2.prototype.recordException = function(_exception, _time) {
|
|
9516
|
+
};
|
|
9517
|
+
return NonRecordingSpan2;
|
|
9518
|
+
}()
|
|
9519
|
+
);
|
|
9520
|
+
|
|
9521
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
|
|
9522
|
+
var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
|
|
9523
|
+
function getSpan(context) {
|
|
9524
|
+
return context.getValue(SPAN_KEY) || void 0;
|
|
9525
|
+
}
|
|
9526
|
+
function getActiveSpan() {
|
|
9527
|
+
return getSpan(ContextAPI.getInstance().active());
|
|
9528
|
+
}
|
|
9529
|
+
function setSpan(context, span) {
|
|
9530
|
+
return context.setValue(SPAN_KEY, span);
|
|
9531
|
+
}
|
|
9532
|
+
function deleteSpan(context) {
|
|
9533
|
+
return context.deleteValue(SPAN_KEY);
|
|
9534
|
+
}
|
|
9535
|
+
function setSpanContext(context, spanContext) {
|
|
9536
|
+
return setSpan(context, new NonRecordingSpan(spanContext));
|
|
9537
|
+
}
|
|
9538
|
+
function getSpanContext(context) {
|
|
9539
|
+
var _a5;
|
|
9540
|
+
return (_a5 = getSpan(context)) === null || _a5 === void 0 ? void 0 : _a5.spanContext();
|
|
9541
|
+
}
|
|
9542
|
+
|
|
9543
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
|
|
9544
|
+
var VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;
|
|
9545
|
+
var VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;
|
|
9546
|
+
function isValidTraceId(traceId) {
|
|
9547
|
+
return VALID_TRACEID_REGEX.test(traceId) && traceId !== INVALID_TRACEID;
|
|
9548
|
+
}
|
|
9549
|
+
function isValidSpanId(spanId) {
|
|
9550
|
+
return VALID_SPANID_REGEX.test(spanId) && spanId !== INVALID_SPANID;
|
|
9551
|
+
}
|
|
9552
|
+
function isSpanContextValid(spanContext) {
|
|
9553
|
+
return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
|
|
9554
|
+
}
|
|
9555
|
+
function wrapSpanContext(spanContext) {
|
|
9556
|
+
return new NonRecordingSpan(spanContext);
|
|
9557
|
+
}
|
|
9558
|
+
|
|
9559
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
|
|
9560
|
+
var contextApi = ContextAPI.getInstance();
|
|
9561
|
+
var NoopTracer = (
|
|
9562
|
+
/** @class */
|
|
9563
|
+
function() {
|
|
9564
|
+
function NoopTracer2() {
|
|
9490
9565
|
}
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
if (weight <= 0)
|
|
9503
|
-
throw new Error(`invalid weight ${weight}: must be positive`);
|
|
9504
|
-
return new Promise((resolve, reject) => {
|
|
9505
|
-
const task = { resolve, reject, weight, priority };
|
|
9506
|
-
const i = findIndexFromEnd(this._queue, (other) => priority <= other.priority);
|
|
9507
|
-
if (i === -1 && weight <= this._value) {
|
|
9508
|
-
this._dispatchItem(task);
|
|
9566
|
+
NoopTracer2.prototype.startSpan = function(name, options, context) {
|
|
9567
|
+
if (context === void 0) {
|
|
9568
|
+
context = contextApi.active();
|
|
9569
|
+
}
|
|
9570
|
+
var root = Boolean(options === null || options === void 0 ? void 0 : options.root);
|
|
9571
|
+
if (root) {
|
|
9572
|
+
return new NonRecordingSpan();
|
|
9573
|
+
}
|
|
9574
|
+
var parentFromContext = context && getSpanContext(context);
|
|
9575
|
+
if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
|
|
9576
|
+
return new NonRecordingSpan(parentFromContext);
|
|
9509
9577
|
} else {
|
|
9510
|
-
|
|
9578
|
+
return new NonRecordingSpan();
|
|
9511
9579
|
}
|
|
9512
|
-
}
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
return
|
|
9519
|
-
}
|
|
9520
|
-
|
|
9580
|
+
};
|
|
9581
|
+
NoopTracer2.prototype.startActiveSpan = function(name, arg2, arg3, arg4) {
|
|
9582
|
+
var opts;
|
|
9583
|
+
var ctx;
|
|
9584
|
+
var fn;
|
|
9585
|
+
if (arguments.length < 2) {
|
|
9586
|
+
return;
|
|
9587
|
+
} else if (arguments.length === 2) {
|
|
9588
|
+
fn = arg2;
|
|
9589
|
+
} else if (arguments.length === 3) {
|
|
9590
|
+
opts = arg2;
|
|
9591
|
+
fn = arg3;
|
|
9592
|
+
} else {
|
|
9593
|
+
opts = arg2;
|
|
9594
|
+
ctx = arg3;
|
|
9595
|
+
fn = arg4;
|
|
9521
9596
|
}
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
this._value = value;
|
|
9545
|
-
this._dispatchQueue();
|
|
9546
|
-
}
|
|
9547
|
-
release(weight = 1) {
|
|
9548
|
-
if (weight <= 0)
|
|
9549
|
-
throw new Error(`invalid weight ${weight}: must be positive`);
|
|
9550
|
-
this._value += weight;
|
|
9551
|
-
this._dispatchQueue();
|
|
9552
|
-
}
|
|
9553
|
-
cancel() {
|
|
9554
|
-
this._queue.forEach((entry) => entry.reject(this._cancelError));
|
|
9555
|
-
this._queue = [];
|
|
9556
|
-
}
|
|
9557
|
-
_dispatchQueue() {
|
|
9558
|
-
this._drainUnlockWaiters();
|
|
9559
|
-
while (this._queue.length > 0 && this._queue[0].weight <= this._value) {
|
|
9560
|
-
this._dispatchItem(this._queue.shift());
|
|
9561
|
-
this._drainUnlockWaiters();
|
|
9597
|
+
var parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
|
|
9598
|
+
var span = this.startSpan(name, opts, parentContext);
|
|
9599
|
+
var contextWithSpanSet = setSpan(parentContext, span);
|
|
9600
|
+
return contextApi.with(contextWithSpanSet, fn, void 0, span);
|
|
9601
|
+
};
|
|
9602
|
+
return NoopTracer2;
|
|
9603
|
+
}()
|
|
9604
|
+
);
|
|
9605
|
+
function isSpanContext(spanContext) {
|
|
9606
|
+
return typeof spanContext === "object" && typeof spanContext["spanId"] === "string" && typeof spanContext["traceId"] === "string" && typeof spanContext["traceFlags"] === "number";
|
|
9607
|
+
}
|
|
9608
|
+
|
|
9609
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
|
|
9610
|
+
var NOOP_TRACER = new NoopTracer();
|
|
9611
|
+
var ProxyTracer = (
|
|
9612
|
+
/** @class */
|
|
9613
|
+
function() {
|
|
9614
|
+
function ProxyTracer2(_provider, name, version, options) {
|
|
9615
|
+
this._provider = _provider;
|
|
9616
|
+
this.name = name;
|
|
9617
|
+
this.version = version;
|
|
9618
|
+
this.options = options;
|
|
9562
9619
|
}
|
|
9563
|
-
|
|
9564
|
-
|
|
9565
|
-
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
_newReleaser(weight) {
|
|
9570
|
-
let called = false;
|
|
9571
|
-
return () => {
|
|
9572
|
-
if (called)
|
|
9573
|
-
return;
|
|
9574
|
-
called = true;
|
|
9575
|
-
this.release(weight);
|
|
9620
|
+
ProxyTracer2.prototype.startSpan = function(name, options, context) {
|
|
9621
|
+
return this._getTracer().startSpan(name, options, context);
|
|
9622
|
+
};
|
|
9623
|
+
ProxyTracer2.prototype.startActiveSpan = function(_name, _options, _context, _fn) {
|
|
9624
|
+
var tracer2 = this._getTracer();
|
|
9625
|
+
return Reflect.apply(tracer2.startActiveSpan, tracer2, arguments);
|
|
9576
9626
|
};
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
for (let weight = this._value; weight > 0; weight--) {
|
|
9581
|
-
const waiters = this._weightedWaiters[weight - 1];
|
|
9582
|
-
if (!waiters)
|
|
9583
|
-
continue;
|
|
9584
|
-
waiters.forEach((waiter) => waiter.resolve());
|
|
9585
|
-
this._weightedWaiters[weight - 1] = [];
|
|
9627
|
+
ProxyTracer2.prototype._getTracer = function() {
|
|
9628
|
+
if (this._delegate) {
|
|
9629
|
+
return this._delegate;
|
|
9586
9630
|
}
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
const waiters = this._weightedWaiters[weight - 1];
|
|
9591
|
-
if (!waiters)
|
|
9592
|
-
continue;
|
|
9593
|
-
const i = waiters.findIndex((waiter) => waiter.priority <= queuedPriority);
|
|
9594
|
-
(i === -1 ? waiters : waiters.splice(0, i)).forEach((waiter) => waiter.resolve());
|
|
9631
|
+
var tracer2 = this._provider.getDelegateTracer(this.name, this.version, this.options);
|
|
9632
|
+
if (!tracer2) {
|
|
9633
|
+
return NOOP_TRACER;
|
|
9595
9634
|
}
|
|
9596
|
-
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
return
|
|
9600
|
-
}
|
|
9601
|
-
|
|
9602
|
-
function insertSorted(a26, v) {
|
|
9603
|
-
const i = findIndexFromEnd(a26, (other) => v.priority <= other.priority);
|
|
9604
|
-
a26.splice(i + 1, 0, v);
|
|
9605
|
-
}
|
|
9606
|
-
function findIndexFromEnd(a26, predicate) {
|
|
9607
|
-
for (let i = a26.length - 1; i >= 0; i--) {
|
|
9608
|
-
if (predicate(a26[i])) {
|
|
9609
|
-
return i;
|
|
9610
|
-
}
|
|
9611
|
-
}
|
|
9612
|
-
return -1;
|
|
9613
|
-
}
|
|
9635
|
+
this._delegate = tracer2;
|
|
9636
|
+
return this._delegate;
|
|
9637
|
+
};
|
|
9638
|
+
return ProxyTracer2;
|
|
9639
|
+
}()
|
|
9640
|
+
);
|
|
9614
9641
|
|
|
9615
|
-
//
|
|
9616
|
-
var
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
this.readersMutex = new Semaphore(1);
|
|
9621
|
-
}
|
|
9622
|
-
async withReadLock(callback) {
|
|
9623
|
-
await this._acquireReadLock();
|
|
9624
|
-
try {
|
|
9625
|
-
return await callback();
|
|
9626
|
-
} finally {
|
|
9627
|
-
await this._releaseReadLock();
|
|
9642
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
|
|
9643
|
+
var NoopTracerProvider = (
|
|
9644
|
+
/** @class */
|
|
9645
|
+
function() {
|
|
9646
|
+
function NoopTracerProvider2() {
|
|
9628
9647
|
}
|
|
9629
|
-
|
|
9630
|
-
|
|
9631
|
-
|
|
9632
|
-
|
|
9633
|
-
|
|
9634
|
-
|
|
9635
|
-
|
|
9648
|
+
NoopTracerProvider2.prototype.getTracer = function(_name, _version, _options) {
|
|
9649
|
+
return new NoopTracer();
|
|
9650
|
+
};
|
|
9651
|
+
return NoopTracerProvider2;
|
|
9652
|
+
}()
|
|
9653
|
+
);
|
|
9654
|
+
|
|
9655
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
|
|
9656
|
+
var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
|
|
9657
|
+
var ProxyTracerProvider = (
|
|
9658
|
+
/** @class */
|
|
9659
|
+
function() {
|
|
9660
|
+
function ProxyTracerProvider2() {
|
|
9636
9661
|
}
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9662
|
+
ProxyTracerProvider2.prototype.getTracer = function(name, version, options) {
|
|
9663
|
+
var _a5;
|
|
9664
|
+
return (_a5 = this.getDelegateTracer(name, version, options)) !== null && _a5 !== void 0 ? _a5 : new ProxyTracer(this, name, version, options);
|
|
9665
|
+
};
|
|
9666
|
+
ProxyTracerProvider2.prototype.getDelegate = function() {
|
|
9667
|
+
var _a5;
|
|
9668
|
+
return (_a5 = this._delegate) !== null && _a5 !== void 0 ? _a5 : NOOP_TRACER_PROVIDER;
|
|
9669
|
+
};
|
|
9670
|
+
ProxyTracerProvider2.prototype.setDelegate = function(delegate) {
|
|
9671
|
+
this._delegate = delegate;
|
|
9672
|
+
};
|
|
9673
|
+
ProxyTracerProvider2.prototype.getDelegateTracer = function(name, version, options) {
|
|
9674
|
+
var _a5;
|
|
9675
|
+
return (_a5 = this._delegate) === null || _a5 === void 0 ? void 0 : _a5.getTracer(name, version, options);
|
|
9676
|
+
};
|
|
9677
|
+
return ProxyTracerProvider2;
|
|
9678
|
+
}()
|
|
9679
|
+
);
|
|
9680
|
+
|
|
9681
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/api/trace.js
|
|
9682
|
+
var API_NAME3 = "trace";
|
|
9683
|
+
var TraceAPI = (
|
|
9684
|
+
/** @class */
|
|
9685
|
+
function() {
|
|
9686
|
+
function TraceAPI2() {
|
|
9687
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
9688
|
+
this.wrapSpanContext = wrapSpanContext;
|
|
9689
|
+
this.isSpanContextValid = isSpanContextValid;
|
|
9690
|
+
this.deleteSpan = deleteSpan;
|
|
9691
|
+
this.getSpan = getSpan;
|
|
9692
|
+
this.getActiveSpan = getActiveSpan;
|
|
9693
|
+
this.getSpanContext = getSpanContext;
|
|
9694
|
+
this.setSpan = setSpan;
|
|
9695
|
+
this.setSpanContext = setSpanContext;
|
|
9645
9696
|
}
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9697
|
+
TraceAPI2.getInstance = function() {
|
|
9698
|
+
if (!this._instance) {
|
|
9699
|
+
this._instance = new TraceAPI2();
|
|
9700
|
+
}
|
|
9701
|
+
return this._instance;
|
|
9702
|
+
};
|
|
9703
|
+
TraceAPI2.prototype.setGlobalTracerProvider = function(provider) {
|
|
9704
|
+
var success = registerGlobal(API_NAME3, this._proxyTracerProvider, DiagAPI.instance());
|
|
9705
|
+
if (success) {
|
|
9706
|
+
this._proxyTracerProvider.setDelegate(provider);
|
|
9707
|
+
}
|
|
9708
|
+
return success;
|
|
9709
|
+
};
|
|
9710
|
+
TraceAPI2.prototype.getTracerProvider = function() {
|
|
9711
|
+
return getGlobal(API_NAME3) || this._proxyTracerProvider;
|
|
9712
|
+
};
|
|
9713
|
+
TraceAPI2.prototype.getTracer = function(name, version) {
|
|
9714
|
+
return this.getTracerProvider().getTracer(name, version);
|
|
9715
|
+
};
|
|
9716
|
+
TraceAPI2.prototype.disable = function() {
|
|
9717
|
+
unregisterGlobal(API_NAME3, DiagAPI.instance());
|
|
9718
|
+
this._proxyTracerProvider = new ProxyTracerProvider();
|
|
9719
|
+
};
|
|
9720
|
+
return TraceAPI2;
|
|
9721
|
+
}()
|
|
9722
|
+
);
|
|
9723
|
+
|
|
9724
|
+
// ../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
9725
|
+
var trace = TraceAPI.getInstance();
|
|
9726
|
+
|
|
9727
|
+
// ../shared/dist/esm/utils/telemetry.js
|
|
9728
|
+
var tracer = trace.getTracer("stack-tracer");
|
|
9729
|
+
async function traceSpan(optionsOrDescription, fn) {
|
|
9730
|
+
let options = typeof optionsOrDescription === "string" ? { description: optionsOrDescription } : optionsOrDescription;
|
|
9731
|
+
return await tracer.startActiveSpan(`STACK: ${options.description}`, async (span) => {
|
|
9732
|
+
if (options.attributes) for (const [key, value] of Object.entries(options.attributes)) span.setAttribute(key, value);
|
|
9649
9733
|
try {
|
|
9650
|
-
|
|
9651
|
-
if (this.readers === 0) this.semaphore.release();
|
|
9734
|
+
return await fn(span);
|
|
9652
9735
|
} finally {
|
|
9653
|
-
|
|
9736
|
+
span.end();
|
|
9654
9737
|
}
|
|
9655
|
-
}
|
|
9656
|
-
async _acquireWriteLock() {
|
|
9657
|
-
await this.semaphore.acquire();
|
|
9658
|
-
}
|
|
9659
|
-
async _releaseWriteLock() {
|
|
9660
|
-
this.semaphore.release();
|
|
9661
|
-
}
|
|
9662
|
-
};
|
|
9663
|
-
|
|
9664
|
-
// ../shared/dist/esm/utils/stores.js
|
|
9665
|
-
var storeLock = new ReadWriteLock();
|
|
9666
|
-
|
|
9667
|
-
// ../shared/dist/esm/interface/client-interface.js
|
|
9668
|
-
var USER_AGENT;
|
|
9669
|
-
if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT = `oauth4webapi/v3.8.5`;
|
|
9670
|
-
var ERR_INVALID_ARG_VALUE = "ERR_INVALID_ARG_VALUE";
|
|
9671
|
-
function CodedTypeError(message, code, cause) {
|
|
9672
|
-
const err = new TypeError(message, { cause });
|
|
9673
|
-
Object.assign(err, { code });
|
|
9674
|
-
return err;
|
|
9675
|
-
}
|
|
9676
|
-
var allowInsecureRequests = Symbol();
|
|
9677
|
-
var clockSkew = Symbol();
|
|
9678
|
-
var clockTolerance = Symbol();
|
|
9679
|
-
var customFetch = Symbol();
|
|
9680
|
-
var jweDecrypt = Symbol();
|
|
9681
|
-
var encoder = new TextEncoder();
|
|
9682
|
-
var decoder = new TextDecoder();
|
|
9683
|
-
var encodeBase64Url;
|
|
9684
|
-
if (Uint8Array.prototype.toBase64) encodeBase64Url = (input) => {
|
|
9685
|
-
if (input instanceof ArrayBuffer) input = new Uint8Array(input);
|
|
9686
|
-
return input.toBase64({
|
|
9687
|
-
alphabet: "base64url",
|
|
9688
|
-
omitPadding: true
|
|
9689
9738
|
});
|
|
9690
|
-
};
|
|
9691
|
-
else {
|
|
9692
|
-
const CHUNK_SIZE = 32768;
|
|
9693
|
-
encodeBase64Url = (input) => {
|
|
9694
|
-
if (input instanceof ArrayBuffer) input = new Uint8Array(input);
|
|
9695
|
-
const arr = [];
|
|
9696
|
-
for (let i = 0; i < input.byteLength; i += CHUNK_SIZE) arr.push(String.fromCharCode.apply(null, input.subarray(i, i + CHUNK_SIZE)));
|
|
9697
|
-
return btoa(arr.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
9698
|
-
};
|
|
9699
9739
|
}
|
|
9700
|
-
var decodeBase64Url;
|
|
9701
|
-
if (Uint8Array.fromBase64) decodeBase64Url = (input) => {
|
|
9702
|
-
try {
|
|
9703
|
-
return Uint8Array.fromBase64(input, { alphabet: "base64url" });
|
|
9704
|
-
} catch (cause) {
|
|
9705
|
-
throw CodedTypeError("The input to be decoded is not correctly encoded.", ERR_INVALID_ARG_VALUE, cause);
|
|
9706
|
-
}
|
|
9707
|
-
};
|
|
9708
|
-
else decodeBase64Url = (input) => {
|
|
9709
|
-
try {
|
|
9710
|
-
const binary = atob(input.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, ""));
|
|
9711
|
-
const bytes = new Uint8Array(binary.length);
|
|
9712
|
-
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
9713
|
-
return bytes;
|
|
9714
|
-
} catch (cause) {
|
|
9715
|
-
throw CodedTypeError("The input to be decoded is not correctly encoded.", ERR_INVALID_ARG_VALUE, cause);
|
|
9716
|
-
}
|
|
9717
|
-
};
|
|
9718
|
-
var URLParse = URL.parse ? (url, base) => URL.parse(url, base) : (url, base) => {
|
|
9719
|
-
try {
|
|
9720
|
-
return new URL(url, base);
|
|
9721
|
-
} catch {
|
|
9722
|
-
return null;
|
|
9723
|
-
}
|
|
9724
|
-
};
|
|
9725
|
-
var tokenMatch = "[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+";
|
|
9726
|
-
var token68Match = "[a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2}";
|
|
9727
|
-
var quotedParamMatcher = "(" + tokenMatch + ')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"';
|
|
9728
|
-
var paramMatcher = "(" + tokenMatch + ")\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)";
|
|
9729
|
-
var schemeRE = new RegExp("^[,\\s]*(" + tokenMatch + ")");
|
|
9730
|
-
var quotedParamRE = new RegExp("^[,\\s]*" + quotedParamMatcher + "[,\\s]*(.*)");
|
|
9731
|
-
var unquotedParamRE = new RegExp("^[,\\s]*" + paramMatcher + "[,\\s]*(.*)");
|
|
9732
|
-
var token68ParamRE = new RegExp("^(" + token68Match + ")(?:$|[,\\s])(.*)");
|
|
9733
|
-
var nopkce = Symbol();
|
|
9734
|
-
var expectNoNonce = Symbol();
|
|
9735
|
-
var skipAuthTimeCheck = Symbol();
|
|
9736
|
-
var skipStateCheck = Symbol();
|
|
9737
|
-
var expectNoState = Symbol();
|
|
9738
|
-
var _expectedIssuer = Symbol();
|
|
9739
|
-
var botChallengeKnownErrors = [KnownErrors.BotChallengeRequired, KnownErrors.BotChallengeFailed];
|
|
9740
9740
|
|
|
9741
9741
|
// ../shared/dist/esm/utils/promises.js
|
|
9742
9742
|
var neverResolvePromise = pending(new Promise(() => {
|