@continuous-excellence/ze-great-dashboard-aws 0.27.13 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +9 -8
- package/dist/index.js +9 -8
- package/dist/lambda.mjs +1043 -259
- package/package.json +1 -1
package/dist/lambda.mjs
CHANGED
|
@@ -733,8 +733,8 @@ var init_transport = __esm({
|
|
|
733
733
|
var invalidFunction;
|
|
734
734
|
var init_invalidFunction = __esm({
|
|
735
735
|
"node_modules/@smithy/core/dist-es/submodules/client/invalid-dependency/invalidFunction.js"() {
|
|
736
|
-
invalidFunction = (
|
|
737
|
-
throw new Error(
|
|
736
|
+
invalidFunction = (message2) => () => {
|
|
737
|
+
throw new Error(message2);
|
|
738
738
|
};
|
|
739
739
|
}
|
|
740
740
|
});
|
|
@@ -743,7 +743,7 @@ var init_invalidFunction = __esm({
|
|
|
743
743
|
var invalidProvider;
|
|
744
744
|
var init_invalidProvider = __esm({
|
|
745
745
|
"node_modules/@smithy/core/dist-es/submodules/client/invalid-dependency/invalidProvider.js"() {
|
|
746
|
-
invalidProvider = (
|
|
746
|
+
invalidProvider = (message2) => () => Promise.reject(message2);
|
|
747
747
|
}
|
|
748
748
|
});
|
|
749
749
|
|
|
@@ -833,9 +833,9 @@ var init_poller = __esm({
|
|
|
833
833
|
if (currentAttempt > 0) {
|
|
834
834
|
const delayMs = exponentialBackoffWithJitter(minDelayMs, maxDelayMs, currentAttempt, waitUntil);
|
|
835
835
|
if (abortController?.signal?.aborted || abortSignal?.aborted) {
|
|
836
|
-
const
|
|
837
|
-
observedResponses[
|
|
838
|
-
observedResponses[
|
|
836
|
+
const message2 = "AbortController signal aborted.";
|
|
837
|
+
observedResponses[message2] |= 0;
|
|
838
|
+
observedResponses[message2] += 1;
|
|
839
839
|
return { state: WaiterState.ABORTED, observedResponses };
|
|
840
840
|
}
|
|
841
841
|
if (Date.now() + delayMs > waitUntil) {
|
|
@@ -845,9 +845,9 @@ var init_poller = __esm({
|
|
|
845
845
|
}
|
|
846
846
|
const { state: state2, reason } = await acceptorChecks(client, input2);
|
|
847
847
|
if (reason) {
|
|
848
|
-
const
|
|
849
|
-
observedResponses[
|
|
850
|
-
observedResponses[
|
|
848
|
+
const message2 = createMessageFromResponse(reason);
|
|
849
|
+
observedResponses[message2] |= 0;
|
|
850
|
+
observedResponses[message2] += 1;
|
|
851
851
|
}
|
|
852
852
|
if (state2 !== WaiterState.RETRY) {
|
|
853
853
|
return { state: state2, reason, final: reason, observedResponses };
|
|
@@ -2123,8 +2123,8 @@ var init_exceptions = __esm({
|
|
|
2123
2123
|
exception[k5] = v;
|
|
2124
2124
|
}
|
|
2125
2125
|
});
|
|
2126
|
-
const
|
|
2127
|
-
exception.message =
|
|
2126
|
+
const message2 = exception.message || exception.Message || "UnknownError";
|
|
2127
|
+
exception.message = message2;
|
|
2128
2128
|
delete exception.Message;
|
|
2129
2129
|
return exception;
|
|
2130
2130
|
};
|
|
@@ -2983,8 +2983,8 @@ var init_parse_utils = __esm({
|
|
|
2983
2983
|
}
|
|
2984
2984
|
return expectByte(value);
|
|
2985
2985
|
};
|
|
2986
|
-
stackTraceWarning = (
|
|
2987
|
-
return String(new TypeError(
|
|
2986
|
+
stackTraceWarning = (message2) => {
|
|
2987
|
+
return String(new TypeError(message2).stack || message2).split("\n").slice(0, 5).filter((s2) => !s2.includes("stackTraceWarning")).join("\n");
|
|
2988
2988
|
};
|
|
2989
2989
|
logger = {
|
|
2990
2990
|
warn: console.warn
|
|
@@ -3615,7 +3615,7 @@ var init_ProviderError = __esm({
|
|
|
3615
3615
|
ProviderError = class _ProviderError extends Error {
|
|
3616
3616
|
name = "ProviderError";
|
|
3617
3617
|
tryNextLink;
|
|
3618
|
-
constructor(
|
|
3618
|
+
constructor(message2, options = true) {
|
|
3619
3619
|
let logger2;
|
|
3620
3620
|
let tryNextLink = true;
|
|
3621
3621
|
if (typeof options === "boolean") {
|
|
@@ -3625,10 +3625,10 @@ var init_ProviderError = __esm({
|
|
|
3625
3625
|
logger2 = options.logger;
|
|
3626
3626
|
tryNextLink = options.tryNextLink ?? true;
|
|
3627
3627
|
}
|
|
3628
|
-
super(
|
|
3628
|
+
super(message2);
|
|
3629
3629
|
this.tryNextLink = tryNextLink;
|
|
3630
3630
|
Object.setPrototypeOf(this, _ProviderError.prototype);
|
|
3631
|
-
logger2?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${
|
|
3631
|
+
logger2?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message2}`);
|
|
3632
3632
|
}
|
|
3633
3633
|
static from(error62, options = true) {
|
|
3634
3634
|
return Object.assign(new this(error62.message, options), error62);
|
|
@@ -3644,8 +3644,8 @@ var init_CredentialsProviderError = __esm({
|
|
|
3644
3644
|
init_ProviderError();
|
|
3645
3645
|
CredentialsProviderError = class _CredentialsProviderError extends ProviderError {
|
|
3646
3646
|
name = "CredentialsProviderError";
|
|
3647
|
-
constructor(
|
|
3648
|
-
super(
|
|
3647
|
+
constructor(message2, options = true) {
|
|
3648
|
+
super(message2, options);
|
|
3649
3649
|
Object.setPrototypeOf(this, _CredentialsProviderError.prototype);
|
|
3650
3650
|
}
|
|
3651
3651
|
};
|
|
@@ -3659,8 +3659,8 @@ var init_TokenProviderError = __esm({
|
|
|
3659
3659
|
init_ProviderError();
|
|
3660
3660
|
TokenProviderError = class _TokenProviderError extends ProviderError {
|
|
3661
3661
|
name = "TokenProviderError";
|
|
3662
|
-
constructor(
|
|
3663
|
-
super(
|
|
3662
|
+
constructor(message2, options = true) {
|
|
3663
|
+
super(message2, options);
|
|
3664
3664
|
Object.setPrototypeOf(this, _TokenProviderError.prototype);
|
|
3665
3665
|
}
|
|
3666
3666
|
};
|
|
@@ -5194,8 +5194,8 @@ var EndpointError;
|
|
|
5194
5194
|
var init_EndpointError = __esm({
|
|
5195
5195
|
"node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/types/EndpointError.js"() {
|
|
5196
5196
|
EndpointError = class extends Error {
|
|
5197
|
-
constructor(
|
|
5198
|
-
super(
|
|
5197
|
+
constructor(message2) {
|
|
5198
|
+
super(message2);
|
|
5199
5199
|
this.name = "EndpointError";
|
|
5200
5200
|
}
|
|
5201
5201
|
};
|
|
@@ -6257,7 +6257,7 @@ var init_createChecksumStream_browser = __esm({
|
|
|
6257
6257
|
if (!isReadableStream(source)) {
|
|
6258
6258
|
throw new Error(`@smithy/util-stream: unsupported source type ${source?.constructor?.name ?? source} in ChecksumStream.`);
|
|
6259
6259
|
}
|
|
6260
|
-
const
|
|
6260
|
+
const encoder3 = base64Encoder ?? toBase642;
|
|
6261
6261
|
if (typeof TransformStream !== "function") {
|
|
6262
6262
|
throw new Error("@smithy/util-stream: unable to instantiate ChecksumStream because API unavailable: ReadableStream/TransformStream.");
|
|
6263
6263
|
}
|
|
@@ -6270,7 +6270,7 @@ var init_createChecksumStream_browser = __esm({
|
|
|
6270
6270
|
},
|
|
6271
6271
|
async flush(controller) {
|
|
6272
6272
|
const digest2 = await checksum.digest();
|
|
6273
|
-
const received =
|
|
6273
|
+
const received = encoder3(digest2);
|
|
6274
6274
|
if (expectedChecksum !== received) {
|
|
6275
6275
|
const error62 = new Error(`Checksum mismatch: expected "${expectedChecksum}" but received "${received}" in response header "${checksumSourceLocation}".`);
|
|
6276
6276
|
controller.error(error62);
|
|
@@ -6850,8 +6850,8 @@ var init_sdk_stream_mixin = __esm({
|
|
|
6850
6850
|
if (encoding === void 0 || Buffer.isEncoding(encoding)) {
|
|
6851
6851
|
return fromArrayBuffer(buf2.buffer, buf2.byteOffset, buf2.byteLength).toString(encoding);
|
|
6852
6852
|
} else {
|
|
6853
|
-
const
|
|
6854
|
-
return
|
|
6853
|
+
const decoder2 = new TextDecoder(encoding);
|
|
6854
|
+
return decoder2.decode(buf2);
|
|
6855
6855
|
}
|
|
6856
6856
|
},
|
|
6857
6857
|
transformToWebStream: () => {
|
|
@@ -7729,8 +7729,8 @@ var init_Sha256WebCrypto = __esm({
|
|
|
7729
7729
|
if (this.secret) {
|
|
7730
7730
|
this.finished = true;
|
|
7731
7731
|
const key = await subtle.importKey("raw", this.secret, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
7732
|
-
const
|
|
7733
|
-
return new Uint8Array(
|
|
7732
|
+
const sig2 = await subtle.sign("HMAC", key, data);
|
|
7733
|
+
return new Uint8Array(sig2);
|
|
7734
7734
|
}
|
|
7735
7735
|
const hash2 = await subtle.digest("SHA-256", data);
|
|
7736
7736
|
return new Uint8Array(hash2);
|
|
@@ -8090,18 +8090,18 @@ var init_EventStreamCodec = __esm({
|
|
|
8090
8090
|
this.messageBuffer = [];
|
|
8091
8091
|
this.isEndOfStream = false;
|
|
8092
8092
|
}
|
|
8093
|
-
feed(
|
|
8094
|
-
this.messageBuffer.push(this.decode(
|
|
8093
|
+
feed(message2) {
|
|
8094
|
+
this.messageBuffer.push(this.decode(message2));
|
|
8095
8095
|
}
|
|
8096
8096
|
endOfStream() {
|
|
8097
8097
|
this.isEndOfStream = true;
|
|
8098
8098
|
}
|
|
8099
8099
|
getMessage() {
|
|
8100
|
-
const
|
|
8100
|
+
const message2 = this.messageBuffer.pop();
|
|
8101
8101
|
const isEndOfStream = this.isEndOfStream;
|
|
8102
8102
|
return {
|
|
8103
8103
|
getMessage() {
|
|
8104
|
-
return
|
|
8104
|
+
return message2;
|
|
8105
8105
|
},
|
|
8106
8106
|
isEndOfStream() {
|
|
8107
8107
|
return isEndOfStream;
|
|
@@ -8137,8 +8137,8 @@ var init_EventStreamCodec = __esm({
|
|
|
8137
8137
|
view2.setUint32(length - 4, checksum.digestSync(), false);
|
|
8138
8138
|
return out;
|
|
8139
8139
|
}
|
|
8140
|
-
decode(
|
|
8141
|
-
const { headers, body } = splitMessage(
|
|
8140
|
+
decode(message2) {
|
|
8141
|
+
const { headers, body } = splitMessage(message2);
|
|
8142
8142
|
return { headers: this.headerMarshaller.parse(headers), body };
|
|
8143
8143
|
}
|
|
8144
8144
|
formatHeaders(rawHeaders) {
|
|
@@ -8208,8 +8208,8 @@ var init_SmithyMessageDecoderStream = __esm({
|
|
|
8208
8208
|
return this.asyncIterator();
|
|
8209
8209
|
}
|
|
8210
8210
|
async *asyncIterator() {
|
|
8211
|
-
for await (const
|
|
8212
|
-
const deserialized = await this.options.deserializer(
|
|
8211
|
+
for await (const message2 of this.options.messageStream) {
|
|
8212
|
+
const deserialized = await this.options.deserializer(message2);
|
|
8213
8213
|
if (deserialized === void 0)
|
|
8214
8214
|
continue;
|
|
8215
8215
|
yield deserialized;
|
|
@@ -8317,8 +8317,8 @@ function getUnmarshalledStream(source, options) {
|
|
|
8317
8317
|
return {
|
|
8318
8318
|
[Symbol.asyncIterator]: async function* () {
|
|
8319
8319
|
for await (const chunk of source) {
|
|
8320
|
-
const
|
|
8321
|
-
const type = await messageUnmarshaller(
|
|
8320
|
+
const message2 = options.eventStreamCodec.decode(chunk);
|
|
8321
|
+
const type = await messageUnmarshaller(message2);
|
|
8322
8322
|
if (type === void 0)
|
|
8323
8323
|
continue;
|
|
8324
8324
|
yield type;
|
|
@@ -8327,32 +8327,32 @@ function getUnmarshalledStream(source, options) {
|
|
|
8327
8327
|
};
|
|
8328
8328
|
}
|
|
8329
8329
|
function getMessageUnmarshaller(deserializer, toUtf83) {
|
|
8330
|
-
return async function(
|
|
8331
|
-
const { value: messageType } =
|
|
8330
|
+
return async function(message2) {
|
|
8331
|
+
const { value: messageType } = message2.headers[":message-type"];
|
|
8332
8332
|
if (messageType === "error") {
|
|
8333
|
-
const unmodeledError = new Error(
|
|
8334
|
-
unmodeledError.name =
|
|
8333
|
+
const unmodeledError = new Error(message2.headers[":error-message"].value || "UnknownError");
|
|
8334
|
+
unmodeledError.name = message2.headers[":error-code"].value;
|
|
8335
8335
|
throw unmodeledError;
|
|
8336
8336
|
} else if (messageType === "exception") {
|
|
8337
|
-
const code =
|
|
8338
|
-
const exception = { [code]:
|
|
8337
|
+
const code = message2.headers[":exception-type"].value;
|
|
8338
|
+
const exception = { [code]: message2 };
|
|
8339
8339
|
const deserializedException = await deserializer(exception);
|
|
8340
8340
|
if (deserializedException.$unknown) {
|
|
8341
|
-
const error62 = new Error(toUtf83(
|
|
8341
|
+
const error62 = new Error(toUtf83(message2.body));
|
|
8342
8342
|
error62.name = code;
|
|
8343
8343
|
throw error62;
|
|
8344
8344
|
}
|
|
8345
8345
|
throw deserializedException[code];
|
|
8346
8346
|
} else if (messageType === "event") {
|
|
8347
8347
|
const event = {
|
|
8348
|
-
[
|
|
8348
|
+
[message2.headers[":event-type"].value]: message2
|
|
8349
8349
|
};
|
|
8350
8350
|
const deserialized = await deserializer(event);
|
|
8351
8351
|
if (deserialized.$unknown)
|
|
8352
8352
|
return;
|
|
8353
8353
|
return deserialized;
|
|
8354
8354
|
} else {
|
|
8355
|
-
throw Error(`Unrecognizable event type: ${
|
|
8355
|
+
throw Error(`Unrecognizable event type: ${message2.headers[":event-type"].value}`);
|
|
8356
8356
|
}
|
|
8357
8357
|
};
|
|
8358
8358
|
}
|
|
@@ -8682,14 +8682,14 @@ var init_EventStreamSerde = __esm({
|
|
|
8682
8682
|
}
|
|
8683
8683
|
const dataObject = hasBindings ? out : body.byteLength === 0 ? {} : await this.deserializer.read(eventStreamSchema, body);
|
|
8684
8684
|
if (ErrCtor) {
|
|
8685
|
-
const
|
|
8685
|
+
const message2 = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
8686
8686
|
const metadata = {};
|
|
8687
8687
|
const $fault = eventStreamSchema.getMergedTraits().error;
|
|
8688
8688
|
if ($fault) {
|
|
8689
8689
|
metadata.$fault = $fault;
|
|
8690
8690
|
}
|
|
8691
8691
|
return Object.assign(new ErrCtor({}), metadata, {
|
|
8692
|
-
message
|
|
8692
|
+
message: message2
|
|
8693
8693
|
}, dataObject);
|
|
8694
8694
|
}
|
|
8695
8695
|
return dataObject;
|
|
@@ -14086,7 +14086,7 @@ ${toHex2(hashedRequest)}`;
|
|
|
14086
14086
|
var cacheQueue = [];
|
|
14087
14087
|
var createScope = (shortDate, region, service) => `${shortDate}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;
|
|
14088
14088
|
var getSigningKey = async (sha256Constructor, credentials, shortDate, region, service) => {
|
|
14089
|
-
const credsHash = await
|
|
14089
|
+
const credsHash = await hmac2(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId);
|
|
14090
14090
|
const cacheKey = `${shortDate}:${region}:${service}:${toHex2(credsHash)}:${credentials.sessionToken}`;
|
|
14091
14091
|
if (cacheKey in signingKeyCache) {
|
|
14092
14092
|
return signingKeyCache[cacheKey];
|
|
@@ -14097,7 +14097,7 @@ ${toHex2(hashedRequest)}`;
|
|
|
14097
14097
|
}
|
|
14098
14098
|
let key = `AWS4${credentials.secretAccessKey}`;
|
|
14099
14099
|
for (const signable of [shortDate, region, service, KEY_TYPE_IDENTIFIER]) {
|
|
14100
|
-
key = await
|
|
14100
|
+
key = await hmac2(sha256Constructor, key, signable);
|
|
14101
14101
|
}
|
|
14102
14102
|
return signingKeyCache[cacheKey] = key;
|
|
14103
14103
|
};
|
|
@@ -14107,7 +14107,7 @@ ${toHex2(hashedRequest)}`;
|
|
|
14107
14107
|
delete signingKeyCache[cacheKey];
|
|
14108
14108
|
});
|
|
14109
14109
|
};
|
|
14110
|
-
var
|
|
14110
|
+
var hmac2 = (ctor, secret, data) => {
|
|
14111
14111
|
const hash2 = new ctor(secret);
|
|
14112
14112
|
hash2.update(toUint8Array2(data));
|
|
14113
14113
|
return hash2.digest();
|
|
@@ -14725,8 +14725,8 @@ var require_dist_cjs4 = __commonJS({
|
|
|
14725
14725
|
var InstanceMetadataV1FallbackError = class _InstanceMetadataV1FallbackError extends CredentialsProviderError2 {
|
|
14726
14726
|
tryNextLink;
|
|
14727
14727
|
name = "InstanceMetadataV1FallbackError";
|
|
14728
|
-
constructor(
|
|
14729
|
-
super(
|
|
14728
|
+
constructor(message2, tryNextLink = true) {
|
|
14729
|
+
super(message2, tryNextLink);
|
|
14730
14730
|
this.tryNextLink = tryNextLink;
|
|
14731
14731
|
Object.setPrototypeOf(this, _InstanceMetadataV1FallbackError.prototype);
|
|
14732
14732
|
}
|
|
@@ -16203,9 +16203,9 @@ function loadCborStructIterator(ns) {
|
|
|
16203
16203
|
for (let i5 = 0; i5 < memberNames.length; ++i5) {
|
|
16204
16204
|
encodedKeys[i5] = encodeCborStringKey(memberNames[i5]);
|
|
16205
16205
|
}
|
|
16206
|
-
const
|
|
16207
|
-
schema[CBOR_STRUCT_CACHE] =
|
|
16208
|
-
return
|
|
16206
|
+
const cache6 = { memberNames, memberSchemas, encodedKeys };
|
|
16207
|
+
schema[CBOR_STRUCT_CACHE] = cache6;
|
|
16208
|
+
return cache6;
|
|
16209
16209
|
}
|
|
16210
16210
|
function encodeCborStringKey(s2) {
|
|
16211
16211
|
let utf8Bytes;
|
|
@@ -16255,8 +16255,8 @@ function writeValue(ns, value, container, serdeContext) {
|
|
|
16255
16255
|
encodeHeader(majorMap, 0);
|
|
16256
16256
|
return;
|
|
16257
16257
|
}
|
|
16258
|
-
const
|
|
16259
|
-
if (
|
|
16258
|
+
const isObject3 = typeof value === "object";
|
|
16259
|
+
if (isObject3) {
|
|
16260
16260
|
if (ns.isBlobSchema()) {
|
|
16261
16261
|
if (value instanceof Uint8Array) {
|
|
16262
16262
|
writeBytes(value);
|
|
@@ -16370,8 +16370,8 @@ function writeStruct(ns, value, serdeContext) {
|
|
|
16370
16370
|
}
|
|
16371
16371
|
return;
|
|
16372
16372
|
}
|
|
16373
|
-
const
|
|
16374
|
-
const { memberNames, memberSchemas, encodedKeys } =
|
|
16373
|
+
const cache6 = loadCborStructIterator(ns);
|
|
16374
|
+
const { memberNames, memberSchemas, encodedKeys } = cache6;
|
|
16375
16375
|
const z2 = memberNames.length;
|
|
16376
16376
|
let headerSize;
|
|
16377
16377
|
if (z2 < 24) {
|
|
@@ -16837,8 +16837,8 @@ function readMap(ns) {
|
|
|
16837
16837
|
}
|
|
16838
16838
|
function readStruct(ns, count, startPos) {
|
|
16839
16839
|
const isUnion = ns.isUnionSchema();
|
|
16840
|
-
const
|
|
16841
|
-
const { memberSchemas, encodedKeys, memberNames } =
|
|
16840
|
+
const cache6 = loadCborStructIterator(ns);
|
|
16841
|
+
const { memberSchemas, encodedKeys, memberNames } = cache6;
|
|
16842
16842
|
const z2 = encodedKeys.length;
|
|
16843
16843
|
const result = {};
|
|
16844
16844
|
let unknownKey;
|
|
@@ -17021,8 +17021,8 @@ function readListIndefinite(ns) {
|
|
|
17021
17021
|
function readMapIndefinite(ns) {
|
|
17022
17022
|
pos += 1;
|
|
17023
17023
|
if (ns.isStructSchema()) {
|
|
17024
|
-
const
|
|
17025
|
-
const { memberSchemas, encodedKeys, memberNames } =
|
|
17024
|
+
const cache6 = loadCborStructIterator(ns);
|
|
17025
|
+
const { memberSchemas, encodedKeys, memberNames } = cache6;
|
|
17026
17026
|
const z2 = encodedKeys.length;
|
|
17027
17027
|
const isUnion = ns.isUnionSchema();
|
|
17028
17028
|
const result = {};
|
|
@@ -17525,7 +17525,7 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
17525
17525
|
}
|
|
17526
17526
|
const ns = NormalizedSchema.of(errorSchema);
|
|
17527
17527
|
const ErrorCtor = registry2.getErrorCtor(errorSchema);
|
|
17528
|
-
const
|
|
17528
|
+
const message2 = dataObject.message ?? dataObject.Message ?? "Unknown";
|
|
17529
17529
|
const exception = new ErrorCtor({});
|
|
17530
17530
|
const output2 = {};
|
|
17531
17531
|
for (const [name, member2] of ns.structIterator()) {
|
|
@@ -17533,7 +17533,7 @@ var init_SmithyRpcV2CborProtocol = __esm({
|
|
|
17533
17533
|
}
|
|
17534
17534
|
throw Object.assign(exception, errorMetadata, {
|
|
17535
17535
|
$fault: ns.getMergedTraits().error,
|
|
17536
|
-
message
|
|
17536
|
+
message: message2
|
|
17537
17537
|
}, output2);
|
|
17538
17538
|
}
|
|
17539
17539
|
getDefaultContentType() {
|
|
@@ -17614,8 +17614,8 @@ var init_ProtocolLib = __esm({
|
|
|
17614
17614
|
throw this.decorateServiceException(Object.assign(new ErrorCtor({ name: errorName }), errorMetadata), dataObject);
|
|
17615
17615
|
}
|
|
17616
17616
|
const d5 = dataObject;
|
|
17617
|
-
const
|
|
17618
|
-
throw this.decorateServiceException(Object.assign(new Error(
|
|
17617
|
+
const message2 = d5?.message ?? d5?.Message ?? d5?.Error?.Message ?? d5?.Error?.message;
|
|
17618
|
+
throw this.decorateServiceException(Object.assign(new Error(message2), {
|
|
17619
17619
|
name: errorName
|
|
17620
17620
|
}, errorMetadata), dataObject);
|
|
17621
17621
|
}
|
|
@@ -17728,7 +17728,7 @@ var init_AwsSmithyRpcV2CborProtocol = __esm({
|
|
|
17728
17728
|
this.mixin.compose(this.compositeErrorRegistry, errorName, this.options.defaultNamespace);
|
|
17729
17729
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorName, this.options.defaultNamespace, response, dataObject, metadata, this.awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0);
|
|
17730
17730
|
const ns = NormalizedSchema.of(errorSchema);
|
|
17731
|
-
const
|
|
17731
|
+
const message2 = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
17732
17732
|
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
17733
17733
|
const exception = new ErrorCtor({});
|
|
17734
17734
|
const output2 = {};
|
|
@@ -17742,7 +17742,7 @@ var init_AwsSmithyRpcV2CborProtocol = __esm({
|
|
|
17742
17742
|
}
|
|
17743
17743
|
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
17744
17744
|
$fault: ns.getMergedTraits().error,
|
|
17745
|
-
message
|
|
17745
|
+
message: message2
|
|
17746
17746
|
}, output2), dataObject);
|
|
17747
17747
|
}
|
|
17748
17748
|
};
|
|
@@ -18139,9 +18139,9 @@ var init_JsonShapeDeserializer2 = __esm({
|
|
|
18139
18139
|
return this._read(schema, data);
|
|
18140
18140
|
}
|
|
18141
18141
|
_read(schema, value) {
|
|
18142
|
-
const
|
|
18142
|
+
const isObject3 = value !== null && typeof value === "object";
|
|
18143
18143
|
const ns = NormalizedSchema.of(schema);
|
|
18144
|
-
if (
|
|
18144
|
+
if (isObject3) {
|
|
18145
18145
|
if (ns.isStructSchema()) {
|
|
18146
18146
|
return this._readStruct(ns, value);
|
|
18147
18147
|
}
|
|
@@ -18218,7 +18218,7 @@ var init_JsonShapeDeserializer2 = __esm({
|
|
|
18218
18218
|
return value;
|
|
18219
18219
|
}
|
|
18220
18220
|
if (ns.isDocumentSchema()) {
|
|
18221
|
-
if (
|
|
18221
|
+
if (isObject3) {
|
|
18222
18222
|
if (Array.isArray(value)) {
|
|
18223
18223
|
for (let i5 = 0; i5 < value.length; ++i5) {
|
|
18224
18224
|
const v = value[i5];
|
|
@@ -18589,11 +18589,11 @@ var init_JsonShapeSerializer2 = __esm({
|
|
|
18589
18589
|
}
|
|
18590
18590
|
static B64 = (() => {
|
|
18591
18591
|
const chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
18592
|
-
const
|
|
18592
|
+
const table2 = new Uint8Array(64);
|
|
18593
18593
|
for (let i5 = 0; i5 < 64; ++i5) {
|
|
18594
|
-
|
|
18594
|
+
table2[i5] = chars2.charCodeAt(i5);
|
|
18595
18595
|
}
|
|
18596
|
-
return
|
|
18596
|
+
return table2;
|
|
18597
18597
|
})();
|
|
18598
18598
|
writeBase64(data) {
|
|
18599
18599
|
const b64Len = Math.ceil(data.length / 3) * 4;
|
|
@@ -18649,7 +18649,7 @@ var init_JsonShapeSerializer2 = __esm({
|
|
|
18649
18649
|
return;
|
|
18650
18650
|
}
|
|
18651
18651
|
const ns = NormalizedSchema.of(schema);
|
|
18652
|
-
const
|
|
18652
|
+
const isObject3 = typeof value === "object";
|
|
18653
18653
|
if (ns.isStringSchema()) {
|
|
18654
18654
|
const mediaType = ns.getMergedTraits().mediaType;
|
|
18655
18655
|
if (mediaType) {
|
|
@@ -18660,7 +18660,7 @@ var init_JsonShapeSerializer2 = __esm({
|
|
|
18660
18660
|
}
|
|
18661
18661
|
}
|
|
18662
18662
|
}
|
|
18663
|
-
if (
|
|
18663
|
+
if (isObject3) {
|
|
18664
18664
|
if (ns.isStructSchema()) {
|
|
18665
18665
|
this.writeStruct(ns, value);
|
|
18666
18666
|
return;
|
|
@@ -19007,7 +19007,7 @@ var init_AwsJsonRpcProtocol = __esm({
|
|
|
19007
19007
|
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
19008
19008
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata, awsQueryCompatible ? this.mixin.findQueryCompatibleError : void 0);
|
|
19009
19009
|
const ns = NormalizedSchema.of(errorSchema);
|
|
19010
|
-
const
|
|
19010
|
+
const message2 = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
19011
19011
|
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
19012
19012
|
const exception = new ErrorCtor({});
|
|
19013
19013
|
const output2 = {};
|
|
@@ -19022,7 +19022,7 @@ var init_AwsJsonRpcProtocol = __esm({
|
|
|
19022
19022
|
}
|
|
19023
19023
|
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
19024
19024
|
$fault: ns.getMergedTraits().error,
|
|
19025
|
-
message
|
|
19025
|
+
message: message2
|
|
19026
19026
|
}, output2), dataObject);
|
|
19027
19027
|
}
|
|
19028
19028
|
};
|
|
@@ -19155,7 +19155,7 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
19155
19155
|
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
19156
19156
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
19157
19157
|
const ns = NormalizedSchema.of(errorSchema);
|
|
19158
|
-
const
|
|
19158
|
+
const message2 = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
19159
19159
|
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
19160
19160
|
const exception = new ErrorCtor({});
|
|
19161
19161
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
@@ -19167,7 +19167,7 @@ var init_AwsRestJsonProtocol = __esm({
|
|
|
19167
19167
|
}
|
|
19168
19168
|
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
19169
19169
|
$fault: ns.getMergedTraits().error,
|
|
19170
|
-
message
|
|
19170
|
+
message: message2
|
|
19171
19171
|
}, output2), dataObject);
|
|
19172
19172
|
}
|
|
19173
19173
|
getDefaultContentType() {
|
|
@@ -19205,9 +19205,9 @@ var init_JsonShapeDeserializer = __esm({
|
|
|
19205
19205
|
return this._read(schema, data);
|
|
19206
19206
|
}
|
|
19207
19207
|
_read(schema, value) {
|
|
19208
|
-
const
|
|
19208
|
+
const isObject3 = value !== null && typeof value === "object";
|
|
19209
19209
|
const ns = NormalizedSchema.of(schema);
|
|
19210
|
-
if (
|
|
19210
|
+
if (isObject3) {
|
|
19211
19211
|
if (ns.isStructSchema()) {
|
|
19212
19212
|
const record2 = value;
|
|
19213
19213
|
const union2 = ns.isUnionSchema();
|
|
@@ -19317,7 +19317,7 @@ var init_JsonShapeDeserializer = __esm({
|
|
|
19317
19317
|
return value;
|
|
19318
19318
|
}
|
|
19319
19319
|
if (ns.isDocumentSchema()) {
|
|
19320
|
-
if (
|
|
19320
|
+
if (isObject3) {
|
|
19321
19321
|
const out = Array.isArray(value) ? [] : {};
|
|
19322
19322
|
for (const k5 in value) {
|
|
19323
19323
|
if (k5 === "__proto__") {
|
|
@@ -19437,9 +19437,9 @@ var init_JsonShapeSerializer = __esm({
|
|
|
19437
19437
|
}
|
|
19438
19438
|
}
|
|
19439
19439
|
_write(schema, value, container) {
|
|
19440
|
-
const
|
|
19440
|
+
const isObject3 = value !== null && typeof value === "object";
|
|
19441
19441
|
const ns = NormalizedSchema.of(schema);
|
|
19442
|
-
if (
|
|
19442
|
+
if (isObject3) {
|
|
19443
19443
|
if (ns.isStructSchema()) {
|
|
19444
19444
|
const record2 = value;
|
|
19445
19445
|
const out = {};
|
|
@@ -19563,7 +19563,7 @@ var init_JsonShapeSerializer = __esm({
|
|
|
19563
19563
|
this.useReplacer = true;
|
|
19564
19564
|
}
|
|
19565
19565
|
if (ns.isDocumentSchema()) {
|
|
19566
|
-
if (
|
|
19566
|
+
if (isObject3) {
|
|
19567
19567
|
if (value instanceof Uint8Array) {
|
|
19568
19568
|
return (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
19569
19569
|
}
|
|
@@ -19820,9 +19820,9 @@ var require_dist_cjs7 = __commonJS({
|
|
|
19820
19820
|
parseTag() {
|
|
19821
19821
|
const p3 = this;
|
|
19822
19822
|
++p3.i;
|
|
19823
|
-
let
|
|
19823
|
+
let tag2 = "";
|
|
19824
19824
|
while (p3.i < p3.z && !" \r\n>/".includes(p3.x[p3.i])) {
|
|
19825
|
-
|
|
19825
|
+
tag2 += p3.x[p3.i++];
|
|
19826
19826
|
}
|
|
19827
19827
|
let hasAttrs = false;
|
|
19828
19828
|
const attrs = {};
|
|
@@ -19856,7 +19856,7 @@ var require_dist_cjs7 = __commonJS({
|
|
|
19856
19856
|
throw new Error("@aws-sdk XML parse error: expected > at the end of self-closing tag.");
|
|
19857
19857
|
}
|
|
19858
19858
|
++p3.i;
|
|
19859
|
-
return { tag, value: hasAttrs ? attrs : "" };
|
|
19859
|
+
return { tag: tag2, value: hasAttrs ? attrs : "" };
|
|
19860
19860
|
}
|
|
19861
19861
|
if (p3.x[p3.i] !== ">") {
|
|
19862
19862
|
throw new Error("@aws-sdk XML parse error: expected > at the end of opening tag.");
|
|
@@ -19890,22 +19890,22 @@ var require_dist_cjs7 = __commonJS({
|
|
|
19890
19890
|
}
|
|
19891
19891
|
}
|
|
19892
19892
|
if (!p3.isNext("</")) {
|
|
19893
|
-
throw new Error(`@aws-sdk XML parse error: missing closing tag </${
|
|
19893
|
+
throw new Error(`@aws-sdk XML parse error: missing closing tag </${tag2}>.`);
|
|
19894
19894
|
}
|
|
19895
19895
|
p3.i += 2;
|
|
19896
19896
|
const closeTag = p3.readTo(">").trim();
|
|
19897
|
-
if (closeTag !==
|
|
19898
|
-
throw new Error(`@aws-sdk XML parse error: mismatched tags <${
|
|
19897
|
+
if (closeTag !== tag2) {
|
|
19898
|
+
throw new Error(`@aws-sdk XML parse error: mismatched tags <${tag2}> and </${closeTag}>.`);
|
|
19899
19899
|
}
|
|
19900
19900
|
if (!hasAttrs && textParts.length === 0 && !hasElementChild) {
|
|
19901
|
-
return { tag, value: "" };
|
|
19901
|
+
return { tag: tag2, value: "" };
|
|
19902
19902
|
}
|
|
19903
19903
|
if (!hasAttrs && !hasElementChild) {
|
|
19904
19904
|
const text = textParts.length === 1 ? textParts[0] : textParts.join("");
|
|
19905
19905
|
if (text.trim() === "" && text.includes("\n")) {
|
|
19906
|
-
return { tag, value: "" };
|
|
19906
|
+
return { tag: tag2, value: "" };
|
|
19907
19907
|
}
|
|
19908
|
-
return { tag, value: text };
|
|
19908
|
+
return { tag: tag2, value: text };
|
|
19909
19909
|
}
|
|
19910
19910
|
const obj = {};
|
|
19911
19911
|
for (const text of textParts) {
|
|
@@ -19934,7 +19934,7 @@ var require_dist_cjs7 = __commonJS({
|
|
|
19934
19934
|
}
|
|
19935
19935
|
obj[k5] = v;
|
|
19936
19936
|
}
|
|
19937
|
-
return { tag, value: obj };
|
|
19937
|
+
return { tag: tag2, value: obj };
|
|
19938
19938
|
}
|
|
19939
19939
|
static ENTITIES = {
|
|
19940
19940
|
amp: "&",
|
|
@@ -20407,12 +20407,12 @@ var init_AwsQueryProtocol = __esm({
|
|
|
20407
20407
|
const errorIdentifier = this.loadQueryErrorCode(response, dataObject) ?? "Unknown";
|
|
20408
20408
|
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
20409
20409
|
const errorData = this.loadQueryError(dataObject) ?? {};
|
|
20410
|
-
const
|
|
20411
|
-
errorData.message =
|
|
20410
|
+
const message2 = this.loadQueryErrorMessage(dataObject);
|
|
20411
|
+
errorData.message = message2;
|
|
20412
20412
|
errorData.Error = {
|
|
20413
20413
|
Type: errorData.Type,
|
|
20414
20414
|
Code: errorData.Code,
|
|
20415
|
-
Message:
|
|
20415
|
+
Message: message2
|
|
20416
20416
|
};
|
|
20417
20417
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, errorData, metadata, this.mixin.findQueryCompatibleError);
|
|
20418
20418
|
const ns = NormalizedSchema.of(errorSchema);
|
|
@@ -20430,7 +20430,7 @@ var init_AwsQueryProtocol = __esm({
|
|
|
20430
20430
|
}
|
|
20431
20431
|
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
20432
20432
|
$fault: ns.getMergedTraits().error,
|
|
20433
|
-
message
|
|
20433
|
+
message: message2
|
|
20434
20434
|
}, output2), dataObject);
|
|
20435
20435
|
}
|
|
20436
20436
|
loadQueryErrorCode(output2, data) {
|
|
@@ -20909,7 +20909,7 @@ var init_AwsRestXmlProtocol = __esm({
|
|
|
20909
20909
|
}
|
|
20910
20910
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
20911
20911
|
const ns = NormalizedSchema.of(errorSchema);
|
|
20912
|
-
const
|
|
20912
|
+
const message2 = dataObject.Error?.message ?? dataObject.Error?.Message ?? dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
20913
20913
|
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
20914
20914
|
const exception = new ErrorCtor({});
|
|
20915
20915
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
@@ -20922,7 +20922,7 @@ var init_AwsRestXmlProtocol = __esm({
|
|
|
20922
20922
|
}
|
|
20923
20923
|
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
20924
20924
|
$fault: ns.getMergedTraits().error,
|
|
20925
|
-
message
|
|
20925
|
+
message: message2
|
|
20926
20926
|
}, output2), dataObject);
|
|
20927
20927
|
}
|
|
20928
20928
|
getDefaultContentType() {
|
|
@@ -25309,21 +25309,21 @@ var require_dist_cjs11 = __commonJS({
|
|
|
25309
25309
|
} catch (error62) {
|
|
25310
25310
|
if (error62.name === "AccessDeniedException") {
|
|
25311
25311
|
const errorType = error62.error;
|
|
25312
|
-
let
|
|
25312
|
+
let message2;
|
|
25313
25313
|
switch (errorType) {
|
|
25314
25314
|
case "TOKEN_EXPIRED":
|
|
25315
|
-
|
|
25315
|
+
message2 = "Your session has expired. Please reauthenticate.";
|
|
25316
25316
|
break;
|
|
25317
25317
|
case "USER_CREDENTIALS_CHANGED":
|
|
25318
|
-
|
|
25318
|
+
message2 = "Unable to refresh credentials because of a change in your password. Please reauthenticate with your new password.";
|
|
25319
25319
|
break;
|
|
25320
25320
|
case "INSUFFICIENT_PERMISSIONS":
|
|
25321
|
-
|
|
25321
|
+
message2 = "Unable to refresh credentials due to insufficient permissions. You may be missing permission for the 'CreateOAuth2Token' action.";
|
|
25322
25322
|
break;
|
|
25323
25323
|
default:
|
|
25324
|
-
|
|
25324
|
+
message2 = `Failed to refresh token: ${String(error62)}. Please re-authenticate using \`aws login\``;
|
|
25325
25325
|
}
|
|
25326
|
-
throw new CredentialsProviderError2(
|
|
25326
|
+
throw new CredentialsProviderError2(message2, {
|
|
25327
25327
|
logger: this.logger,
|
|
25328
25328
|
tryNextLink: false
|
|
25329
25329
|
});
|
|
@@ -25450,11 +25450,11 @@ var require_dist_cjs11 = __commonJS({
|
|
|
25450
25450
|
};
|
|
25451
25451
|
const headerB64 = Buffer.from(JSON.stringify(header)).toString("base64url");
|
|
25452
25452
|
const payloadB64 = Buffer.from(JSON.stringify(payload2)).toString("base64url");
|
|
25453
|
-
const
|
|
25454
|
-
const asn1Signature = sign2("sha256", Buffer.from(
|
|
25453
|
+
const message2 = `${headerB64}.${payloadB64}`;
|
|
25454
|
+
const asn1Signature = sign2("sha256", Buffer.from(message2), privateKey);
|
|
25455
25455
|
const rawSignature = this.derToRawSignature(asn1Signature);
|
|
25456
25456
|
const signatureB64 = rawSignature.toString("base64url");
|
|
25457
|
-
return `${
|
|
25457
|
+
return `${message2}.${signatureB64}`;
|
|
25458
25458
|
} catch (error62) {
|
|
25459
25459
|
throw new CredentialsProviderError2(`Failed to generate Dpop proof: ${error62 instanceof Error ? error62.message : String(error62)}`, { logger: this.logger, tryNextLink: false });
|
|
25460
25460
|
}
|
|
@@ -26146,12 +26146,12 @@ var require_dist_cjs16 = __commonJS({
|
|
|
26146
26146
|
r5 + 3
|
|
26147
26147
|
]);
|
|
26148
26148
|
var bdd5 = BinaryDecisionDiagram2.from(nodes5, root5, _data5.conditions, _data5.results);
|
|
26149
|
-
var
|
|
26149
|
+
var cache6 = new EndpointCache2({
|
|
26150
26150
|
size: 50,
|
|
26151
26151
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
|
|
26152
26152
|
});
|
|
26153
26153
|
var defaultEndpointResolver5 = (endpointParams, context = {}) => {
|
|
26154
|
-
return
|
|
26154
|
+
return cache6.get(endpointParams, () => decideEndpoint2(bdd5, {
|
|
26155
26155
|
endpointParams,
|
|
26156
26156
|
logger: context.logger
|
|
26157
26157
|
}));
|
|
@@ -27906,12 +27906,12 @@ var require_dist_cjs17 = __commonJS({
|
|
|
27906
27906
|
r5 + 3
|
|
27907
27907
|
]);
|
|
27908
27908
|
var bdd5 = BinaryDecisionDiagram2.from(nodes5, root5, _data5.conditions, _data5.results);
|
|
27909
|
-
var
|
|
27909
|
+
var cache6 = new EndpointCache2({
|
|
27910
27910
|
size: 50,
|
|
27911
27911
|
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"]
|
|
27912
27912
|
});
|
|
27913
27913
|
var defaultEndpointResolver5 = (endpointParams, context = {}) => {
|
|
27914
|
-
return
|
|
27914
|
+
return cache6.get(endpointParams, () => decideEndpoint2(bdd5, {
|
|
27915
27915
|
endpointParams,
|
|
27916
27916
|
logger: context.logger
|
|
27917
27917
|
}));
|
|
@@ -42122,12 +42122,12 @@ var require_directives = __commonJS({
|
|
|
42122
42122
|
* Given a fully resolved tag, returns its printable string form,
|
|
42123
42123
|
* taking into account current tag prefixes and defaults.
|
|
42124
42124
|
*/
|
|
42125
|
-
tagString(
|
|
42125
|
+
tagString(tag2) {
|
|
42126
42126
|
for (const [handle2, prefix] of Object.entries(this.tags)) {
|
|
42127
|
-
if (
|
|
42128
|
-
return handle2 + escapeTagName(
|
|
42127
|
+
if (tag2.startsWith(prefix))
|
|
42128
|
+
return handle2 + escapeTagName(tag2.substring(prefix.length));
|
|
42129
42129
|
}
|
|
42130
|
-
return
|
|
42130
|
+
return tag2[0] === "!" ? tag2 : `!<${tag2}>`;
|
|
42131
42131
|
}
|
|
42132
42132
|
toString(doc) {
|
|
42133
42133
|
const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
|
|
@@ -43104,7 +43104,7 @@ ${indent}${start}${value}${end2}`;
|
|
|
43104
43104
|
const str = value.replace(/\n+/g, `$&
|
|
43105
43105
|
${indent}`);
|
|
43106
43106
|
if (actualString) {
|
|
43107
|
-
const test = (
|
|
43107
|
+
const test = (tag2) => tag2.default && tag2.tag !== "tag:yaml.org,2002:str" && tag2.test?.test(str);
|
|
43108
43108
|
const { compat, tags } = ctx.doc.schema;
|
|
43109
43109
|
if (tags.some(test) || compat?.some(test))
|
|
43110
43110
|
return quotedString(value, ctx);
|
|
@@ -43234,9 +43234,9 @@ var require_stringify = __commonJS({
|
|
|
43234
43234
|
anchors$1.add(anchor2);
|
|
43235
43235
|
props.push(`&${anchor2}`);
|
|
43236
43236
|
}
|
|
43237
|
-
const
|
|
43238
|
-
if (
|
|
43239
|
-
props.push(doc.directives.tagString(
|
|
43237
|
+
const tag2 = node2.tag ?? (tagObj.default ? null : tagObj.tag);
|
|
43238
|
+
if (tag2)
|
|
43239
|
+
props.push(doc.directives.tagString(tag2));
|
|
43240
43240
|
return props.join(" ");
|
|
43241
43241
|
}
|
|
43242
43242
|
function stringify(item, ctx, onComment, onChompKeep) {
|
|
@@ -43444,7 +43444,7 @@ var require_merge = __commonJS({
|
|
|
43444
43444
|
}),
|
|
43445
43445
|
stringify: () => MERGE_KEY
|
|
43446
43446
|
};
|
|
43447
|
-
var isMergeKey = (ctx, key) => (merge3.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge3.identify(key.value)) && ctx?.doc.schema.tags.some((
|
|
43447
|
+
var isMergeKey = (ctx, key) => (merge3.identify(key) || identity.isScalar(key) && (!key.type || key.type === Scalar.Scalar.PLAIN) && merge3.identify(key.value)) && ctx?.doc.schema.tags.some((tag2) => tag2.tag === merge3.tag && tag2.default);
|
|
43448
43448
|
function addMergeToJSMap(ctx, map4, value) {
|
|
43449
43449
|
const source = resolveAliasValue(ctx, value);
|
|
43450
43450
|
if (identity.isSeq(source))
|
|
@@ -44111,14 +44111,14 @@ var require_bool = __commonJS({
|
|
|
44111
44111
|
var require_stringifyNumber = __commonJS({
|
|
44112
44112
|
"node_modules/yaml/dist/stringify/stringifyNumber.js"(exports) {
|
|
44113
44113
|
"use strict";
|
|
44114
|
-
function stringifyNumber({ format: format2, minFractionDigits, tag, value }) {
|
|
44114
|
+
function stringifyNumber({ format: format2, minFractionDigits, tag: tag2, value }) {
|
|
44115
44115
|
if (typeof value === "bigint")
|
|
44116
44116
|
return String(value);
|
|
44117
44117
|
const num = typeof value === "number" ? value : Number(value);
|
|
44118
44118
|
if (!isFinite(num))
|
|
44119
44119
|
return isNaN(num) ? ".nan" : num < 0 ? "-.inf" : ".inf";
|
|
44120
44120
|
let n3 = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
44121
|
-
if (!format2 && minFractionDigits && (!
|
|
44121
|
+
if (!format2 && minFractionDigits && (!tag2 || tag2 === "tag:yaml.org,2002:float") && /^-?\d/.test(n3) && !n3.includes("e")) {
|
|
44122
44122
|
let i5 = n3.indexOf(".");
|
|
44123
44123
|
if (i5 < 0) {
|
|
44124
44124
|
i5 = n3.length;
|
|
@@ -44993,17 +44993,17 @@ var require_tags = __commonJS({
|
|
|
44993
44993
|
}
|
|
44994
44994
|
}
|
|
44995
44995
|
if (Array.isArray(customTags)) {
|
|
44996
|
-
for (const
|
|
44997
|
-
tags = tags.concat(
|
|
44996
|
+
for (const tag2 of customTags)
|
|
44997
|
+
tags = tags.concat(tag2);
|
|
44998
44998
|
} else if (typeof customTags === "function") {
|
|
44999
44999
|
tags = customTags(tags.slice());
|
|
45000
45000
|
}
|
|
45001
45001
|
if (addMergeTag)
|
|
45002
45002
|
tags = tags.concat(merge3.merge);
|
|
45003
|
-
return tags.reduce((tags2,
|
|
45004
|
-
const tagObj = typeof
|
|
45003
|
+
return tags.reduce((tags2, tag2) => {
|
|
45004
|
+
const tagObj = typeof tag2 === "string" ? tagsByName[tag2] : tag2;
|
|
45005
45005
|
if (!tagObj) {
|
|
45006
|
-
const tagName = JSON.stringify(
|
|
45006
|
+
const tagName = JSON.stringify(tag2);
|
|
45007
45007
|
const keys = Object.keys(tagsByName).map((key) => JSON.stringify(key)).join(", ");
|
|
45008
45008
|
throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
|
|
45009
45009
|
}
|
|
@@ -45243,7 +45243,7 @@ var require_Document = __commonJS({
|
|
|
45243
45243
|
options = replacer;
|
|
45244
45244
|
replacer = void 0;
|
|
45245
45245
|
}
|
|
45246
|
-
const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};
|
|
45246
|
+
const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag: tag2 } = options ?? {};
|
|
45247
45247
|
const { onAnchor, setAnchors, sourceObjects } = anchors.createNodeAnchors(
|
|
45248
45248
|
this,
|
|
45249
45249
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
@@ -45258,7 +45258,7 @@ var require_Document = __commonJS({
|
|
|
45258
45258
|
schema: this.schema,
|
|
45259
45259
|
sourceObjects
|
|
45260
45260
|
};
|
|
45261
|
-
const node2 = createNode.createNode(value,
|
|
45261
|
+
const node2 = createNode.createNode(value, tag2, ctx);
|
|
45262
45262
|
if (flow && identity.isCollection(node2))
|
|
45263
45263
|
node2.flow = true;
|
|
45264
45264
|
setAnchors();
|
|
@@ -45443,22 +45443,22 @@ var require_errors = __commonJS({
|
|
|
45443
45443
|
"node_modules/yaml/dist/errors.js"(exports) {
|
|
45444
45444
|
"use strict";
|
|
45445
45445
|
var YAMLError = class extends Error {
|
|
45446
|
-
constructor(name, pos2, code,
|
|
45446
|
+
constructor(name, pos2, code, message2) {
|
|
45447
45447
|
super();
|
|
45448
45448
|
this.name = name;
|
|
45449
45449
|
this.code = code;
|
|
45450
|
-
this.message =
|
|
45450
|
+
this.message = message2;
|
|
45451
45451
|
this.pos = pos2;
|
|
45452
45452
|
}
|
|
45453
45453
|
};
|
|
45454
45454
|
var YAMLParseError2 = class extends YAMLError {
|
|
45455
|
-
constructor(pos2, code,
|
|
45456
|
-
super("YAMLParseError", pos2, code,
|
|
45455
|
+
constructor(pos2, code, message2) {
|
|
45456
|
+
super("YAMLParseError", pos2, code, message2);
|
|
45457
45457
|
}
|
|
45458
45458
|
};
|
|
45459
45459
|
var YAMLWarning = class extends YAMLError {
|
|
45460
|
-
constructor(pos2, code,
|
|
45461
|
-
super("YAMLWarning", pos2, code,
|
|
45460
|
+
constructor(pos2, code, message2) {
|
|
45461
|
+
super("YAMLWarning", pos2, code, message2);
|
|
45462
45462
|
}
|
|
45463
45463
|
};
|
|
45464
45464
|
var prettifyError2 = (src, lc) => (error62) => {
|
|
@@ -45517,7 +45517,7 @@ var require_resolve_props = __commonJS({
|
|
|
45517
45517
|
let reqSpace = false;
|
|
45518
45518
|
let tab = null;
|
|
45519
45519
|
let anchor2 = null;
|
|
45520
|
-
let
|
|
45520
|
+
let tag2 = null;
|
|
45521
45521
|
let newlineAfterProp = null;
|
|
45522
45522
|
let comma = null;
|
|
45523
45523
|
let found = null;
|
|
@@ -45563,7 +45563,7 @@ var require_resolve_props = __commonJS({
|
|
|
45563
45563
|
commentSep += token.source;
|
|
45564
45564
|
atNewline = true;
|
|
45565
45565
|
hasNewline = true;
|
|
45566
|
-
if (anchor2 ||
|
|
45566
|
+
if (anchor2 || tag2)
|
|
45567
45567
|
newlineAfterProp = token;
|
|
45568
45568
|
hasSpace = true;
|
|
45569
45569
|
break;
|
|
@@ -45579,9 +45579,9 @@ var require_resolve_props = __commonJS({
|
|
|
45579
45579
|
reqSpace = true;
|
|
45580
45580
|
break;
|
|
45581
45581
|
case "tag": {
|
|
45582
|
-
if (
|
|
45582
|
+
if (tag2)
|
|
45583
45583
|
onError(token, "MULTIPLE_TAGS", "A node can have at most one tag");
|
|
45584
|
-
|
|
45584
|
+
tag2 = token;
|
|
45585
45585
|
start ?? (start = token.offset);
|
|
45586
45586
|
atNewline = false;
|
|
45587
45587
|
hasSpace = false;
|
|
@@ -45589,7 +45589,7 @@ var require_resolve_props = __commonJS({
|
|
|
45589
45589
|
break;
|
|
45590
45590
|
}
|
|
45591
45591
|
case indicator:
|
|
45592
|
-
if (anchor2 ||
|
|
45592
|
+
if (anchor2 || tag2)
|
|
45593
45593
|
onError(token, "BAD_PROP_ORDER", `Anchors and tags must be after the ${token.source} indicator`);
|
|
45594
45594
|
if (found)
|
|
45595
45595
|
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
|
|
@@ -45627,7 +45627,7 @@ var require_resolve_props = __commonJS({
|
|
|
45627
45627
|
comment,
|
|
45628
45628
|
hasNewline,
|
|
45629
45629
|
anchor: anchor2,
|
|
45630
|
-
tag,
|
|
45630
|
+
tag: tag2,
|
|
45631
45631
|
newlineAfterProp,
|
|
45632
45632
|
end: end2,
|
|
45633
45633
|
start: start ?? end2
|
|
@@ -45724,8 +45724,8 @@ var require_resolve_block_map = __commonJS({
|
|
|
45724
45724
|
var utilFlowIndentCheck = require_util_flow_indent_check();
|
|
45725
45725
|
var utilMapIncludes = require_util_map_includes();
|
|
45726
45726
|
var startColMsg = "All mapping items must start at the same column";
|
|
45727
|
-
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError,
|
|
45728
|
-
const NodeClass =
|
|
45727
|
+
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag2) {
|
|
45728
|
+
const NodeClass = tag2?.nodeClass ?? YAMLMap.YAMLMap;
|
|
45729
45729
|
const map4 = new NodeClass(ctx.schema);
|
|
45730
45730
|
if (ctx.atRoot)
|
|
45731
45731
|
ctx.atRoot = false;
|
|
@@ -45828,8 +45828,8 @@ var require_resolve_block_seq = __commonJS({
|
|
|
45828
45828
|
var YAMLSeq = require_YAMLSeq();
|
|
45829
45829
|
var resolveProps = require_resolve_props();
|
|
45830
45830
|
var utilFlowIndentCheck = require_util_flow_indent_check();
|
|
45831
|
-
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError,
|
|
45832
|
-
const NodeClass =
|
|
45831
|
+
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag2) {
|
|
45832
|
+
const NodeClass = tag2?.nodeClass ?? YAMLSeq.YAMLSeq;
|
|
45833
45833
|
const seq = new NodeClass(ctx.schema);
|
|
45834
45834
|
if (ctx.atRoot)
|
|
45835
45835
|
ctx.atRoot = false;
|
|
@@ -45929,10 +45929,10 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
45929
45929
|
var utilMapIncludes = require_util_map_includes();
|
|
45930
45930
|
var blockMsg = "Block collections are not allowed within flow collections";
|
|
45931
45931
|
var isBlock = (token) => token && (token.type === "block-map" || token.type === "block-seq");
|
|
45932
|
-
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError,
|
|
45932
|
+
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag2) {
|
|
45933
45933
|
const isMap = fc.start.source === "{";
|
|
45934
45934
|
const fcName = isMap ? "flow map" : "flow sequence";
|
|
45935
|
-
const NodeClass =
|
|
45935
|
+
const NodeClass = tag2?.nodeClass ?? (isMap ? YAMLMap.YAMLMap : YAMLSeq.YAMLSeq);
|
|
45936
45936
|
const coll = new NodeClass(ctx.schema);
|
|
45937
45937
|
coll.flow = true;
|
|
45938
45938
|
const atRoot = ctx.atRoot;
|
|
@@ -46120,8 +46120,8 @@ var require_compose_collection = __commonJS({
|
|
|
46120
46120
|
var resolveBlockMap = require_resolve_block_map();
|
|
46121
46121
|
var resolveBlockSeq = require_resolve_block_seq();
|
|
46122
46122
|
var resolveFlowCollection = require_resolve_flow_collection();
|
|
46123
|
-
function resolveCollection(CN, ctx, token, onError, tagName,
|
|
46124
|
-
const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError,
|
|
46123
|
+
function resolveCollection(CN, ctx, token, onError, tagName, tag2) {
|
|
46124
|
+
const coll = token.type === "block-map" ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag2) : token.type === "block-seq" ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag2) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag2);
|
|
46125
46125
|
const Coll = coll.constructor;
|
|
46126
46126
|
if (tagName === "!" || tagName === Coll.tagName) {
|
|
46127
46127
|
coll.tag = Coll.tagName;
|
|
@@ -46138,20 +46138,20 @@ var require_compose_collection = __commonJS({
|
|
|
46138
46138
|
const { anchor: anchor2, newlineAfterProp: nl } = props;
|
|
46139
46139
|
const lastProp = anchor2 && tagToken ? anchor2.offset > tagToken.offset ? anchor2 : tagToken : anchor2 ?? tagToken;
|
|
46140
46140
|
if (lastProp && (!nl || nl.offset < lastProp.offset)) {
|
|
46141
|
-
const
|
|
46142
|
-
onError(lastProp, "MISSING_CHAR",
|
|
46141
|
+
const message2 = "Missing newline after block sequence props";
|
|
46142
|
+
onError(lastProp, "MISSING_CHAR", message2);
|
|
46143
46143
|
}
|
|
46144
46144
|
}
|
|
46145
46145
|
const expType = token.type === "block-map" ? "map" : token.type === "block-seq" ? "seq" : token.start.source === "{" ? "map" : "seq";
|
|
46146
46146
|
if (!tagToken || !tagName || tagName === "!" || tagName === YAMLMap.YAMLMap.tagName && expType === "map" || tagName === YAMLSeq.YAMLSeq.tagName && expType === "seq") {
|
|
46147
46147
|
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
46148
46148
|
}
|
|
46149
|
-
let
|
|
46150
|
-
if (!
|
|
46149
|
+
let tag2 = ctx.schema.tags.find((t) => t.tag === tagName && t.collection === expType);
|
|
46150
|
+
if (!tag2) {
|
|
46151
46151
|
const kt = ctx.schema.knownTags[tagName];
|
|
46152
46152
|
if (kt?.collection === expType) {
|
|
46153
46153
|
ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
|
|
46154
|
-
|
|
46154
|
+
tag2 = kt;
|
|
46155
46155
|
} else {
|
|
46156
46156
|
if (kt) {
|
|
46157
46157
|
onError(tagToken, "BAD_COLLECTION_TYPE", `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? "scalar"}`, true);
|
|
@@ -46161,13 +46161,13 @@ var require_compose_collection = __commonJS({
|
|
|
46161
46161
|
return resolveCollection(CN, ctx, token, onError, tagName);
|
|
46162
46162
|
}
|
|
46163
46163
|
}
|
|
46164
|
-
const coll = resolveCollection(CN, ctx, token, onError, tagName,
|
|
46165
|
-
const res =
|
|
46164
|
+
const coll = resolveCollection(CN, ctx, token, onError, tagName, tag2);
|
|
46165
|
+
const res = tag2.resolve?.(coll, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg), ctx.options) ?? coll;
|
|
46166
46166
|
const node2 = identity.isNode(res) ? res : new Scalar.Scalar(res);
|
|
46167
46167
|
node2.range = coll.range;
|
|
46168
46168
|
node2.tag = tagName;
|
|
46169
|
-
if (
|
|
46170
|
-
node2.format =
|
|
46169
|
+
if (tag2?.format)
|
|
46170
|
+
node2.format = tag2.format;
|
|
46171
46171
|
return node2;
|
|
46172
46172
|
}
|
|
46173
46173
|
exports.composeCollection = composeCollection;
|
|
@@ -46211,15 +46211,15 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
46211
46211
|
trimIndent = indent.length;
|
|
46212
46212
|
} else {
|
|
46213
46213
|
if (indent.length < trimIndent) {
|
|
46214
|
-
const
|
|
46215
|
-
onError(offset + indent.length, "MISSING_CHAR",
|
|
46214
|
+
const message2 = "Block scalars with more-indented leading empty lines must use an explicit indentation indicator";
|
|
46215
|
+
onError(offset + indent.length, "MISSING_CHAR", message2);
|
|
46216
46216
|
}
|
|
46217
46217
|
if (header.indent === 0)
|
|
46218
46218
|
trimIndent = indent.length;
|
|
46219
46219
|
contentStart = i5;
|
|
46220
46220
|
if (trimIndent === 0 && !ctx.atRoot) {
|
|
46221
|
-
const
|
|
46222
|
-
onError(offset, "BAD_INDENT",
|
|
46221
|
+
const message2 = "Block scalar values in collections must be indented";
|
|
46222
|
+
onError(offset, "BAD_INDENT", message2);
|
|
46223
46223
|
}
|
|
46224
46224
|
break;
|
|
46225
46225
|
}
|
|
@@ -46242,8 +46242,8 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
46242
46242
|
content = content.slice(0, -1);
|
|
46243
46243
|
if (content && indent.length < trimIndent) {
|
|
46244
46244
|
const src = header.indent ? "explicit indentation indicator" : "first line";
|
|
46245
|
-
const
|
|
46246
|
-
onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT",
|
|
46245
|
+
const message2 = `Block scalar lines must not be less indented than their ${src}`;
|
|
46246
|
+
onError(offset - content.length - (crlf ? 2 : 1), "BAD_INDENT", message2);
|
|
46247
46247
|
indent = "";
|
|
46248
46248
|
}
|
|
46249
46249
|
if (type === Scalar.Scalar.BLOCK_LITERAL) {
|
|
@@ -46321,8 +46321,8 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
46321
46321
|
break;
|
|
46322
46322
|
case "comment":
|
|
46323
46323
|
if (strict && !hasSpace) {
|
|
46324
|
-
const
|
|
46325
|
-
onError(token, "MISSING_CHAR",
|
|
46324
|
+
const message2 = "Comments must be separated from other tokens by white space characters";
|
|
46325
|
+
onError(token, "MISSING_CHAR", message2);
|
|
46326
46326
|
}
|
|
46327
46327
|
length += token.source.length;
|
|
46328
46328
|
comment = token.source.substring(1);
|
|
@@ -46333,8 +46333,8 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
46333
46333
|
break;
|
|
46334
46334
|
/* istanbul ignore next should not happen */
|
|
46335
46335
|
default: {
|
|
46336
|
-
const
|
|
46337
|
-
onError(token, "UNEXPECTED_TOKEN",
|
|
46336
|
+
const message2 = `Unexpected token in block scalar header: ${token.type}`;
|
|
46337
|
+
onError(token, "UNEXPECTED_TOKEN", message2);
|
|
46338
46338
|
const ts = token.source;
|
|
46339
46339
|
if (ts && typeof ts === "string")
|
|
46340
46340
|
length += ts.length;
|
|
@@ -46588,18 +46588,18 @@ var require_compose_scalar = __commonJS({
|
|
|
46588
46588
|
function composeScalar(ctx, token, tagToken, onError) {
|
|
46589
46589
|
const { value, type, comment, range: range2 } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
|
|
46590
46590
|
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
|
|
46591
|
-
let
|
|
46591
|
+
let tag2;
|
|
46592
46592
|
if (ctx.options.stringKeys && ctx.atKey) {
|
|
46593
|
-
|
|
46593
|
+
tag2 = ctx.schema[identity.SCALAR];
|
|
46594
46594
|
} else if (tagName)
|
|
46595
|
-
|
|
46595
|
+
tag2 = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
|
|
46596
46596
|
else if (token.type === "scalar")
|
|
46597
|
-
|
|
46597
|
+
tag2 = findScalarTagByTest(ctx, value, token, onError);
|
|
46598
46598
|
else
|
|
46599
|
-
|
|
46599
|
+
tag2 = ctx.schema[identity.SCALAR];
|
|
46600
46600
|
let scalar;
|
|
46601
46601
|
try {
|
|
46602
|
-
const res =
|
|
46602
|
+
const res = tag2.resolve(value, (msg) => onError(tagToken ?? token, "TAG_RESOLVE_FAILED", msg), ctx.options);
|
|
46603
46603
|
scalar = identity.isScalar(res) ? res : new Scalar.Scalar(res);
|
|
46604
46604
|
} catch (error62) {
|
|
46605
46605
|
const msg = error62 instanceof Error ? error62.message : String(error62);
|
|
@@ -46612,8 +46612,8 @@ var require_compose_scalar = __commonJS({
|
|
|
46612
46612
|
scalar.type = type;
|
|
46613
46613
|
if (tagName)
|
|
46614
46614
|
scalar.tag = tagName;
|
|
46615
|
-
if (
|
|
46616
|
-
scalar.format =
|
|
46615
|
+
if (tag2.format)
|
|
46616
|
+
scalar.format = tag2.format;
|
|
46617
46617
|
if (comment)
|
|
46618
46618
|
scalar.comment = comment;
|
|
46619
46619
|
return scalar;
|
|
@@ -46622,17 +46622,17 @@ var require_compose_scalar = __commonJS({
|
|
|
46622
46622
|
if (tagName === "!")
|
|
46623
46623
|
return schema[identity.SCALAR];
|
|
46624
46624
|
const matchWithTest = [];
|
|
46625
|
-
for (const
|
|
46626
|
-
if (!
|
|
46627
|
-
if (
|
|
46628
|
-
matchWithTest.push(
|
|
46625
|
+
for (const tag2 of schema.tags) {
|
|
46626
|
+
if (!tag2.collection && tag2.tag === tagName) {
|
|
46627
|
+
if (tag2.default && tag2.test)
|
|
46628
|
+
matchWithTest.push(tag2);
|
|
46629
46629
|
else
|
|
46630
|
-
return
|
|
46630
|
+
return tag2;
|
|
46631
46631
|
}
|
|
46632
46632
|
}
|
|
46633
|
-
for (const
|
|
46634
|
-
if (
|
|
46635
|
-
return
|
|
46633
|
+
for (const tag2 of matchWithTest)
|
|
46634
|
+
if (tag2.test?.test(value))
|
|
46635
|
+
return tag2;
|
|
46636
46636
|
const kt = schema.knownTags[tagName];
|
|
46637
46637
|
if (kt && !kt.collection) {
|
|
46638
46638
|
schema.tags.push(Object.assign({}, kt, { default: false, test: void 0 }));
|
|
@@ -46642,17 +46642,17 @@ var require_compose_scalar = __commonJS({
|
|
|
46642
46642
|
return schema[identity.SCALAR];
|
|
46643
46643
|
}
|
|
46644
46644
|
function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
|
|
46645
|
-
const
|
|
46645
|
+
const tag2 = schema.tags.find((tag3) => (tag3.default === true || atKey && tag3.default === "key") && tag3.test?.test(value)) || schema[identity.SCALAR];
|
|
46646
46646
|
if (schema.compat) {
|
|
46647
|
-
const compat = schema.compat.find((
|
|
46648
|
-
if (
|
|
46649
|
-
const ts = directives.tagString(
|
|
46647
|
+
const compat = schema.compat.find((tag3) => tag3.default && tag3.test?.test(value)) ?? schema[identity.SCALAR];
|
|
46648
|
+
if (tag2.tag !== compat.tag) {
|
|
46649
|
+
const ts = directives.tagString(tag2.tag);
|
|
46650
46650
|
const cs = directives.tagString(compat.tag);
|
|
46651
46651
|
const msg = `Value may be parsed as either ${ts} or ${cs}`;
|
|
46652
46652
|
onError(token, "TAG_RESOLVE_FAILED", msg, true);
|
|
46653
46653
|
}
|
|
46654
46654
|
}
|
|
46655
|
-
return
|
|
46655
|
+
return tag2;
|
|
46656
46656
|
}
|
|
46657
46657
|
exports.composeScalar = composeScalar;
|
|
46658
46658
|
}
|
|
@@ -46701,20 +46701,20 @@ var require_compose_node = __commonJS({
|
|
|
46701
46701
|
var CN = { composeNode, composeEmptyNode };
|
|
46702
46702
|
function composeNode(ctx, token, props, onError) {
|
|
46703
46703
|
const atKey = ctx.atKey;
|
|
46704
|
-
const { spaceBefore, comment, anchor: anchor2, tag } = props;
|
|
46704
|
+
const { spaceBefore, comment, anchor: anchor2, tag: tag2 } = props;
|
|
46705
46705
|
let node2;
|
|
46706
46706
|
let isSrcToken = true;
|
|
46707
46707
|
switch (token.type) {
|
|
46708
46708
|
case "alias":
|
|
46709
46709
|
node2 = composeAlias(ctx, token, onError);
|
|
46710
|
-
if (anchor2 ||
|
|
46710
|
+
if (anchor2 || tag2)
|
|
46711
46711
|
onError(token, "ALIAS_PROPS", "An alias node must not specify any properties");
|
|
46712
46712
|
break;
|
|
46713
46713
|
case "scalar":
|
|
46714
46714
|
case "single-quoted-scalar":
|
|
46715
46715
|
case "double-quoted-scalar":
|
|
46716
46716
|
case "block-scalar":
|
|
46717
|
-
node2 = composeScalar.composeScalar(ctx, token,
|
|
46717
|
+
node2 = composeScalar.composeScalar(ctx, token, tag2, onError);
|
|
46718
46718
|
if (anchor2)
|
|
46719
46719
|
node2.anchor = anchor2.source.substring(1);
|
|
46720
46720
|
break;
|
|
@@ -46726,13 +46726,13 @@ var require_compose_node = __commonJS({
|
|
|
46726
46726
|
if (anchor2)
|
|
46727
46727
|
node2.anchor = anchor2.source.substring(1);
|
|
46728
46728
|
} catch (error62) {
|
|
46729
|
-
const
|
|
46730
|
-
onError(token, "RESOURCE_EXHAUSTION",
|
|
46729
|
+
const message2 = error62 instanceof Error ? error62.message : String(error62);
|
|
46730
|
+
onError(token, "RESOURCE_EXHAUSTION", message2);
|
|
46731
46731
|
}
|
|
46732
46732
|
break;
|
|
46733
46733
|
default: {
|
|
46734
|
-
const
|
|
46735
|
-
onError(token, "UNEXPECTED_TOKEN",
|
|
46734
|
+
const message2 = token.type === "error" ? token.message : `Unsupported token (type: ${token.type})`;
|
|
46735
|
+
onError(token, "UNEXPECTED_TOKEN", message2);
|
|
46736
46736
|
isSrcToken = false;
|
|
46737
46737
|
}
|
|
46738
46738
|
}
|
|
@@ -46741,7 +46741,7 @@ var require_compose_node = __commonJS({
|
|
|
46741
46741
|
onError(anchor2, "BAD_ALIAS", "Anchor cannot be an empty string");
|
|
46742
46742
|
if (atKey && ctx.options.stringKeys && (!identity.isScalar(node2) || typeof node2.value !== "string" || node2.tag && node2.tag !== "tag:yaml.org,2002:str")) {
|
|
46743
46743
|
const msg = "With stringKeys, all keys must be strings";
|
|
46744
|
-
onError(
|
|
46744
|
+
onError(tag2 ?? token, "NON_STRING_KEY", msg);
|
|
46745
46745
|
}
|
|
46746
46746
|
if (spaceBefore)
|
|
46747
46747
|
node2.spaceBefore = true;
|
|
@@ -46755,14 +46755,14 @@ var require_compose_node = __commonJS({
|
|
|
46755
46755
|
node2.srcToken = token;
|
|
46756
46756
|
return node2;
|
|
46757
46757
|
}
|
|
46758
|
-
function composeEmptyNode(ctx, offset, before, pos2, { spaceBefore, comment, anchor: anchor2, tag, end: end2 }, onError) {
|
|
46758
|
+
function composeEmptyNode(ctx, offset, before, pos2, { spaceBefore, comment, anchor: anchor2, tag: tag2, end: end2 }, onError) {
|
|
46759
46759
|
const token = {
|
|
46760
46760
|
type: "scalar",
|
|
46761
46761
|
offset: utilEmptyScalarPosition.emptyScalarPosition(offset, before, pos2),
|
|
46762
46762
|
indent: -1,
|
|
46763
46763
|
source: ""
|
|
46764
46764
|
};
|
|
46765
|
-
const node2 = composeScalar.composeScalar(ctx, token,
|
|
46765
|
+
const node2 = composeScalar.composeScalar(ctx, token, tag2, onError);
|
|
46766
46766
|
if (anchor2) {
|
|
46767
46767
|
node2.anchor = anchor2.source.substring(1);
|
|
46768
46768
|
if (node2.anchor === "")
|
|
@@ -46888,12 +46888,12 @@ var require_composer = __commonJS({
|
|
|
46888
46888
|
this.prelude = [];
|
|
46889
46889
|
this.errors = [];
|
|
46890
46890
|
this.warnings = [];
|
|
46891
|
-
this.onError = (source, code,
|
|
46891
|
+
this.onError = (source, code, message2, warning2) => {
|
|
46892
46892
|
const pos2 = getErrorPos(source);
|
|
46893
46893
|
if (warning2)
|
|
46894
|
-
this.warnings.push(new errors.YAMLWarning(pos2, code,
|
|
46894
|
+
this.warnings.push(new errors.YAMLWarning(pos2, code, message2));
|
|
46895
46895
|
else
|
|
46896
|
-
this.errors.push(new errors.YAMLParseError(pos2, code,
|
|
46896
|
+
this.errors.push(new errors.YAMLParseError(pos2, code, message2));
|
|
46897
46897
|
};
|
|
46898
46898
|
this.directives = new directives.Directives({ version: options.version || "1.2" });
|
|
46899
46899
|
this.options = options;
|
|
@@ -46963,10 +46963,10 @@ ${cb}` : comment;
|
|
|
46963
46963
|
console.dir(token, { depth: null });
|
|
46964
46964
|
switch (token.type) {
|
|
46965
46965
|
case "directive":
|
|
46966
|
-
this.directives.add(token.source, (offset,
|
|
46966
|
+
this.directives.add(token.source, (offset, message2, warning2) => {
|
|
46967
46967
|
const pos2 = getErrorPos(token);
|
|
46968
46968
|
pos2[0] += offset;
|
|
46969
|
-
this.onError(pos2, "BAD_DIRECTIVE",
|
|
46969
|
+
this.onError(pos2, "BAD_DIRECTIVE", message2, warning2);
|
|
46970
46970
|
});
|
|
46971
46971
|
this.prelude.push(token.source);
|
|
46972
46972
|
this.atDirectives = true;
|
|
@@ -47055,12 +47055,12 @@ var require_cst_scalar = __commonJS({
|
|
|
47055
47055
|
var stringifyString = require_stringifyString();
|
|
47056
47056
|
function resolveAsScalar(token, strict = true, onError) {
|
|
47057
47057
|
if (token) {
|
|
47058
|
-
const _onError = (pos2, code,
|
|
47058
|
+
const _onError = (pos2, code, message2) => {
|
|
47059
47059
|
const offset = typeof pos2 === "number" ? pos2 : Array.isArray(pos2) ? pos2[0] : pos2.offset;
|
|
47060
47060
|
if (onError)
|
|
47061
|
-
onError(offset, code,
|
|
47061
|
+
onError(offset, code, message2);
|
|
47062
47062
|
else
|
|
47063
|
-
throw new errors.YAMLParseError([offset, offset + 1], code,
|
|
47063
|
+
throw new errors.YAMLParseError([offset, offset + 1], code, message2);
|
|
47064
47064
|
};
|
|
47065
47065
|
switch (token.type) {
|
|
47066
47066
|
case "scalar":
|
|
@@ -48220,8 +48220,8 @@ var require_parser = __commonJS({
|
|
|
48220
48220
|
}
|
|
48221
48221
|
const type = cst.tokenType(source);
|
|
48222
48222
|
if (!type) {
|
|
48223
|
-
const
|
|
48224
|
-
yield* this.pop({ type: "error", offset: this.offset, message, source });
|
|
48223
|
+
const message2 = `Not a YAML token: ${source}`;
|
|
48224
|
+
yield* this.pop({ type: "error", offset: this.offset, message: message2, source });
|
|
48225
48225
|
this.offset += source.length;
|
|
48226
48226
|
} else if (type === "scalar") {
|
|
48227
48227
|
this.atNewLine = false;
|
|
@@ -48311,8 +48311,8 @@ var require_parser = __commonJS({
|
|
|
48311
48311
|
*pop(error62) {
|
|
48312
48312
|
const token = error62 ?? this.stack.pop();
|
|
48313
48313
|
if (!token) {
|
|
48314
|
-
const
|
|
48315
|
-
yield { type: "error", offset: this.offset, source: "", message };
|
|
48314
|
+
const message2 = "Tried to pop an empty stack";
|
|
48315
|
+
yield { type: "error", offset: this.offset, source: "", message: message2 };
|
|
48316
48316
|
} else if (this.stack.length === 0) {
|
|
48317
48317
|
yield token;
|
|
48318
48318
|
} else {
|
|
@@ -50587,8 +50587,8 @@ function prefixIssues(path, issues) {
|
|
|
50587
50587
|
return iss;
|
|
50588
50588
|
});
|
|
50589
50589
|
}
|
|
50590
|
-
function unwrapMessage(
|
|
50591
|
-
return typeof
|
|
50590
|
+
function unwrapMessage(message2) {
|
|
50591
|
+
return typeof message2 === "string" ? message2 : message2?.message;
|
|
50592
50592
|
}
|
|
50593
50593
|
function attachSchema(issues, start, inst) {
|
|
50594
50594
|
var _a4;
|
|
@@ -50606,7 +50606,7 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
50606
50606
|
iss.schema = iss.inst;
|
|
50607
50607
|
}
|
|
50608
50608
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
50609
|
-
const
|
|
50609
|
+
const message2 = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input";
|
|
50610
50610
|
const full = {};
|
|
50611
50611
|
for (const k5 of Object.keys(iss)) {
|
|
50612
50612
|
if (k5 === "inst" || k5 === "schema" || k5 === "continue" || k5 === "input" || k5 === "__proto__")
|
|
@@ -50614,7 +50614,7 @@ function finalizeIssue(iss, ctx, config2) {
|
|
|
50614
50614
|
full[k5] = iss[k5];
|
|
50615
50615
|
}
|
|
50616
50616
|
full.path ?? (full.path = []);
|
|
50617
|
-
full.message =
|
|
50617
|
+
full.message = message2;
|
|
50618
50618
|
if (ctx?.reportInput) {
|
|
50619
50619
|
full.input = iss.input;
|
|
50620
50620
|
}
|
|
@@ -50729,16 +50729,16 @@ var Class = class {
|
|
|
50729
50729
|
constructor(..._args) {
|
|
50730
50730
|
}
|
|
50731
50731
|
};
|
|
50732
|
-
function members(proto,
|
|
50733
|
-
for (const key in
|
|
50734
|
-
const desc = Object.getOwnPropertyDescriptor(
|
|
50732
|
+
function members(proto, table2) {
|
|
50733
|
+
for (const key in table2) {
|
|
50734
|
+
const desc = Object.getOwnPropertyDescriptor(table2, key);
|
|
50735
50735
|
if (desc.get)
|
|
50736
50736
|
Object.defineProperty(proto, key, { ...desc, enumerable: false });
|
|
50737
50737
|
else
|
|
50738
50738
|
defineBound(proto, key, desc.value);
|
|
50739
50739
|
}
|
|
50740
|
-
for (const sym of Object.getOwnPropertySymbols(
|
|
50741
|
-
defineBound(proto, sym,
|
|
50740
|
+
for (const sym of Object.getOwnPropertySymbols(table2)) {
|
|
50741
|
+
defineBound(proto, sym, table2[sym]);
|
|
50742
50742
|
}
|
|
50743
50743
|
}
|
|
50744
50744
|
function own(inst, key, value, enumerable = true) {
|
|
@@ -50749,10 +50749,10 @@ function hide(inst, key, value) {
|
|
|
50749
50749
|
return own(inst, key, value, false);
|
|
50750
50750
|
}
|
|
50751
50751
|
// @__NO_SIDE_EFFECTS__
|
|
50752
|
-
function derived(computes,
|
|
50752
|
+
function derived(computes, table2) {
|
|
50753
50753
|
for (const key in computes) {
|
|
50754
50754
|
const compute = computes[key];
|
|
50755
|
-
Object.defineProperty(
|
|
50755
|
+
Object.defineProperty(table2, key, {
|
|
50756
50756
|
configurable: true,
|
|
50757
50757
|
enumerable: true,
|
|
50758
50758
|
get() {
|
|
@@ -50763,7 +50763,7 @@ function derived(computes, table) {
|
|
|
50763
50763
|
}
|
|
50764
50764
|
});
|
|
50765
50765
|
}
|
|
50766
|
-
return
|
|
50766
|
+
return table2;
|
|
50767
50767
|
}
|
|
50768
50768
|
function defineBound(proto, key, fn) {
|
|
50769
50769
|
Object.defineProperty(proto, key, {
|
|
@@ -52897,7 +52897,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
52897
52897
|
}
|
|
52898
52898
|
return propValues;
|
|
52899
52899
|
});
|
|
52900
|
-
const
|
|
52900
|
+
const isObject3 = isObject;
|
|
52901
52901
|
const catchall = def.catchall;
|
|
52902
52902
|
let value;
|
|
52903
52903
|
const memo2 = globalConfig.memoizer;
|
|
@@ -52905,7 +52905,7 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
52905
52905
|
inst._zod.parse = (payload2, ctx) => {
|
|
52906
52906
|
value ?? (value = _normalized.value);
|
|
52907
52907
|
const input2 = payload2.value;
|
|
52908
|
-
if (!
|
|
52908
|
+
if (!isObject3(input2)) {
|
|
52909
52909
|
payload2.issues.push({
|
|
52910
52910
|
expected: "object",
|
|
52911
52911
|
code: "invalid_type",
|
|
@@ -53041,7 +53041,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
53041
53041
|
return doc.compile();
|
|
53042
53042
|
};
|
|
53043
53043
|
let fastpass;
|
|
53044
|
-
const
|
|
53044
|
+
const isObject3 = isObject;
|
|
53045
53045
|
const jit = !globalConfig.jitless;
|
|
53046
53046
|
const allowsEval2 = allowsEval;
|
|
53047
53047
|
const fastEnabled = jit && allowsEval2.value;
|
|
@@ -53050,7 +53050,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
53050
53050
|
inst._zod.parse = (payload2, ctx) => {
|
|
53051
53051
|
value ?? (value = _normalized.value);
|
|
53052
53052
|
const input2 = payload2.value;
|
|
53053
|
-
if (!
|
|
53053
|
+
if (!isObject3(input2)) {
|
|
53054
53054
|
payload2.issues.push({
|
|
53055
53055
|
expected: "object",
|
|
53056
53056
|
code: "invalid_type",
|
|
@@ -62151,8 +62151,8 @@ var globalRegistry = globalThis.__zod_globalRegistry;
|
|
|
62151
62151
|
var INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
62152
62152
|
var FALLBACK_FLAG = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
62153
62153
|
var ZodCompileAsyncError = class extends Error {
|
|
62154
|
-
constructor(
|
|
62155
|
-
super(
|
|
62154
|
+
constructor(message2 = "z.compile does not support async refinements, transforms, or checks") {
|
|
62155
|
+
super(message2);
|
|
62156
62156
|
this.name = "ZodCompileAsyncError";
|
|
62157
62157
|
}
|
|
62158
62158
|
};
|
|
@@ -64855,12 +64855,12 @@ function initializeContext(params) {
|
|
|
64855
64855
|
external: params?.external ?? void 0
|
|
64856
64856
|
};
|
|
64857
64857
|
}
|
|
64858
|
-
function handleUnrepresentable(schema, ctx, json2, params,
|
|
64859
|
-
const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message }) : ctx.unrepresentable;
|
|
64858
|
+
function handleUnrepresentable(schema, ctx, json2, params, message2) {
|
|
64859
|
+
const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message: message2 }) : ctx.unrepresentable;
|
|
64860
64860
|
if (result === "any")
|
|
64861
64861
|
return false;
|
|
64862
64862
|
if (result === void 0 || result === "throw")
|
|
64863
|
-
throw new Error(
|
|
64863
|
+
throw new Error(message2);
|
|
64864
64864
|
Object.assign(json2, result);
|
|
64865
64865
|
return true;
|
|
64866
64866
|
}
|
|
@@ -68743,21 +68743,21 @@ function visit(schema, fnOrHandlers) {
|
|
|
68743
68743
|
const h5 = fnOrHandlers[node2._zod.def.type];
|
|
68744
68744
|
return h5 ? h5(node2, rewritten) : node2;
|
|
68745
68745
|
};
|
|
68746
|
-
const
|
|
68746
|
+
const cache6 = /* @__PURE__ */ new Map();
|
|
68747
68747
|
function run(s2) {
|
|
68748
|
-
const cached2 =
|
|
68748
|
+
const cached2 = cache6.get(s2);
|
|
68749
68749
|
if (cached2 === RESOLVING) {
|
|
68750
68750
|
return new $ZodLazy({
|
|
68751
68751
|
type: "lazy",
|
|
68752
|
-
getter: () =>
|
|
68752
|
+
getter: () => cache6.get(s2)
|
|
68753
68753
|
});
|
|
68754
68754
|
}
|
|
68755
68755
|
if (cached2 !== void 0)
|
|
68756
68756
|
return cached2;
|
|
68757
|
-
|
|
68757
|
+
cache6.set(s2, RESOLVING);
|
|
68758
68758
|
const inner = mapInner(s2);
|
|
68759
68759
|
const mapped = fn(inner, inner !== s2);
|
|
68760
|
-
|
|
68760
|
+
cache6.set(s2, mapped);
|
|
68761
68761
|
return mapped;
|
|
68762
68762
|
}
|
|
68763
68763
|
function mapInner(s2) {
|
|
@@ -69218,14 +69218,14 @@ var boardSchema = external_exports.object({
|
|
|
69218
69218
|
});
|
|
69219
69219
|
})
|
|
69220
69220
|
});
|
|
69221
|
-
var authSchema = external_exports.
|
|
69221
|
+
var authSchema = external_exports.strictObject({
|
|
69222
69222
|
issuer: external_exports.url(),
|
|
69223
|
-
/**
|
|
69224
|
-
client_id: external_exports.string().min(1)
|
|
69225
|
-
|
|
69226
|
-
|
|
69227
|
-
|
|
69228
|
-
|
|
69223
|
+
/** Browser SPA client id. It is public, unlike every source credential. */
|
|
69224
|
+
client_id: external_exports.string().min(1),
|
|
69225
|
+
/** The separately registered API resource accepted by the dashboard proxy. */
|
|
69226
|
+
audience: external_exports.string().min(1),
|
|
69227
|
+
/** A deliberately portable, explicit identity boundary for the first direct-OIDC release. */
|
|
69228
|
+
allow: external_exports.strictObject({ subjects: external_exports.array(external_exports.string().min(1)).min(1) })
|
|
69229
69229
|
});
|
|
69230
69230
|
var boardConfigSchema = external_exports.object({
|
|
69231
69231
|
sources: external_exports.record(external_exports.string().min(1), sourceSchema).default({}),
|
|
@@ -69310,7 +69310,8 @@ var clientEnvSchema = external_exports.object({
|
|
|
69310
69310
|
/** Omitted entirely when unauthenticated — presence is what turns auth on. */
|
|
69311
69311
|
auth: external_exports.object({
|
|
69312
69312
|
issuer: external_exports.string().min(1),
|
|
69313
|
-
clientId: external_exports.string().min(1)
|
|
69313
|
+
clientId: external_exports.string().min(1),
|
|
69314
|
+
audience: external_exports.string().min(1)
|
|
69314
69315
|
}).optional()
|
|
69315
69316
|
});
|
|
69316
69317
|
var clientIdentityResponseSchema = clientEnvSchema.pick({ assetPath: true, assetPathId: true }).extend({ serverVersion: external_exports.string().min(1) });
|
|
@@ -70668,8 +70669,8 @@ function errorResponse2(kind, error62, panel, response) {
|
|
|
70668
70669
|
|
|
70669
70670
|
// packages/server/src/configuration-error.ts
|
|
70670
70671
|
var ConfigurationError = class extends Error {
|
|
70671
|
-
constructor(
|
|
70672
|
-
super(
|
|
70672
|
+
constructor(message2, diagnostics) {
|
|
70673
|
+
super(message2);
|
|
70673
70674
|
this.diagnostics = diagnostics;
|
|
70674
70675
|
}
|
|
70675
70676
|
diagnostics;
|
|
@@ -71016,13 +71017,13 @@ var getPattern = (label, next) => {
|
|
|
71016
71017
|
}
|
|
71017
71018
|
return null;
|
|
71018
71019
|
};
|
|
71019
|
-
var tryDecode = (str,
|
|
71020
|
+
var tryDecode = (str, decoder2) => {
|
|
71020
71021
|
try {
|
|
71021
|
-
return
|
|
71022
|
+
return decoder2(str);
|
|
71022
71023
|
} catch {
|
|
71023
71024
|
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match2) => {
|
|
71024
71025
|
try {
|
|
71025
|
-
return
|
|
71026
|
+
return decoder2(match2);
|
|
71026
71027
|
} catch {
|
|
71027
71028
|
return match2;
|
|
71028
71029
|
}
|
|
@@ -72973,6 +72974,762 @@ function safeOrigin(value) {
|
|
|
72973
72974
|
}
|
|
72974
72975
|
}
|
|
72975
72976
|
|
|
72977
|
+
// node_modules/jose/dist/webapi/lib/buffer_utils.js
|
|
72978
|
+
var encoder2 = new TextEncoder();
|
|
72979
|
+
var decoder = new TextDecoder();
|
|
72980
|
+
var strictDecoder = new TextDecoder("utf-8", { fatal: true });
|
|
72981
|
+
var MAX_INT32 = 2 ** 32;
|
|
72982
|
+
function concat(...buffers) {
|
|
72983
|
+
const size = buffers.reduce((acc, { length }) => acc + length, 0), buf2 = new Uint8Array(size);
|
|
72984
|
+
let i5 = 0;
|
|
72985
|
+
for (const buffer of buffers)
|
|
72986
|
+
buf2.set(buffer, i5), i5 += buffer.length;
|
|
72987
|
+
return buf2;
|
|
72988
|
+
}
|
|
72989
|
+
var NON_ASCII = /[^\x00-\x7f]/;
|
|
72990
|
+
function encode3(string4) {
|
|
72991
|
+
if (typeof string4 == "string" && string4.length >= 128) {
|
|
72992
|
+
if (NON_ASCII.test(string4))
|
|
72993
|
+
throw new TypeError("non-ASCII string encountered in encode()");
|
|
72994
|
+
return encoder2.encode(string4);
|
|
72995
|
+
}
|
|
72996
|
+
const bytes = new Uint8Array(string4.length);
|
|
72997
|
+
for (let i5 = 0; i5 < string4.length; i5++) {
|
|
72998
|
+
const code = string4.charCodeAt(i5);
|
|
72999
|
+
if (code > 127)
|
|
73000
|
+
throw new TypeError("non-ASCII string encountered in encode()");
|
|
73001
|
+
bytes[i5] = code;
|
|
73002
|
+
}
|
|
73003
|
+
return bytes;
|
|
73004
|
+
}
|
|
73005
|
+
function decodeBase642(encoded, url2 = false) {
|
|
73006
|
+
if (Uint8Array.fromBase64)
|
|
73007
|
+
return Uint8Array.fromBase64(encoded, { alphabet: url2 ? "base64url" : "base64" });
|
|
73008
|
+
if (url2) {
|
|
73009
|
+
if (encoded.includes("+") || encoded.includes("/"))
|
|
73010
|
+
throw new TypeError("Invalid base64url");
|
|
73011
|
+
encoded = encoded.replace(/-/g, "+").replace(/_/g, "/");
|
|
73012
|
+
}
|
|
73013
|
+
const binary = atob(encoded), bytes = new Uint8Array(binary.length);
|
|
73014
|
+
for (let i5 = 0; i5 < binary.length; i5++)
|
|
73015
|
+
bytes[i5] = binary.charCodeAt(i5);
|
|
73016
|
+
return bytes;
|
|
73017
|
+
}
|
|
73018
|
+
|
|
73019
|
+
// node_modules/jose/dist/webapi/util/errors.js
|
|
73020
|
+
var JOSEError = class extends Error {
|
|
73021
|
+
static code = "ERR_JOSE_GENERIC";
|
|
73022
|
+
code = "ERR_JOSE_GENERIC";
|
|
73023
|
+
constructor(message2, options) {
|
|
73024
|
+
super(message2, options), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
73025
|
+
}
|
|
73026
|
+
};
|
|
73027
|
+
var JWTClaimValidationFailed = class extends JOSEError {
|
|
73028
|
+
static code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
73029
|
+
code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
|
|
73030
|
+
claim;
|
|
73031
|
+
reason;
|
|
73032
|
+
payload;
|
|
73033
|
+
constructor(message2, payload2, claim2 = "unspecified", reason = "unspecified") {
|
|
73034
|
+
super(message2, { cause: { claim: claim2, reason, payload: payload2 } }), this.claim = claim2, this.reason = reason, this.payload = payload2;
|
|
73035
|
+
}
|
|
73036
|
+
};
|
|
73037
|
+
var JWTExpired = class extends JOSEError {
|
|
73038
|
+
static code = "ERR_JWT_EXPIRED";
|
|
73039
|
+
code = "ERR_JWT_EXPIRED";
|
|
73040
|
+
claim;
|
|
73041
|
+
reason;
|
|
73042
|
+
payload;
|
|
73043
|
+
constructor(message2, payload2, claim2 = "unspecified", reason = "unspecified") {
|
|
73044
|
+
super(message2, { cause: { claim: claim2, reason, payload: payload2 } }), this.claim = claim2, this.reason = reason, this.payload = payload2;
|
|
73045
|
+
}
|
|
73046
|
+
};
|
|
73047
|
+
var JOSEAlgNotAllowed = class extends JOSEError {
|
|
73048
|
+
static code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
73049
|
+
code = "ERR_JOSE_ALG_NOT_ALLOWED";
|
|
73050
|
+
};
|
|
73051
|
+
var JOSENotSupported = class extends JOSEError {
|
|
73052
|
+
static code = "ERR_JOSE_NOT_SUPPORTED";
|
|
73053
|
+
code = "ERR_JOSE_NOT_SUPPORTED";
|
|
73054
|
+
};
|
|
73055
|
+
var JWSInvalid = class extends JOSEError {
|
|
73056
|
+
static code = "ERR_JWS_INVALID";
|
|
73057
|
+
code = "ERR_JWS_INVALID";
|
|
73058
|
+
};
|
|
73059
|
+
var JWTInvalid = class extends JOSEError {
|
|
73060
|
+
static code = "ERR_JWT_INVALID";
|
|
73061
|
+
code = "ERR_JWT_INVALID";
|
|
73062
|
+
};
|
|
73063
|
+
var JWKSInvalid = class extends JOSEError {
|
|
73064
|
+
static code = "ERR_JWKS_INVALID";
|
|
73065
|
+
code = "ERR_JWKS_INVALID";
|
|
73066
|
+
};
|
|
73067
|
+
var JWKSNoMatchingKey = class extends JOSEError {
|
|
73068
|
+
static code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
73069
|
+
code = "ERR_JWKS_NO_MATCHING_KEY";
|
|
73070
|
+
constructor(message2 = "no applicable key found in the JSON Web Key Set", options) {
|
|
73071
|
+
super(message2, options);
|
|
73072
|
+
}
|
|
73073
|
+
};
|
|
73074
|
+
var JWKSMultipleMatchingKeys = class extends JOSEError {
|
|
73075
|
+
[Symbol.asyncIterator] = async function* () {
|
|
73076
|
+
};
|
|
73077
|
+
static code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
73078
|
+
code = "ERR_JWKS_MULTIPLE_MATCHING_KEYS";
|
|
73079
|
+
constructor(message2 = "multiple matching keys found in the JSON Web Key Set", options) {
|
|
73080
|
+
super(message2, options);
|
|
73081
|
+
}
|
|
73082
|
+
};
|
|
73083
|
+
var JWKSTimeout = class extends JOSEError {
|
|
73084
|
+
static code = "ERR_JWKS_TIMEOUT";
|
|
73085
|
+
code = "ERR_JWKS_TIMEOUT";
|
|
73086
|
+
constructor(message2 = "request timed out", options) {
|
|
73087
|
+
super(message2, options);
|
|
73088
|
+
}
|
|
73089
|
+
};
|
|
73090
|
+
var JWSSignatureVerificationFailed = class extends JOSEError {
|
|
73091
|
+
static code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
73092
|
+
code = "ERR_JWS_SIGNATURE_VERIFICATION_FAILED";
|
|
73093
|
+
constructor(message2 = "signature verification failed", options) {
|
|
73094
|
+
super(message2, options);
|
|
73095
|
+
}
|
|
73096
|
+
};
|
|
73097
|
+
|
|
73098
|
+
// node_modules/jose/dist/webapi/util/base64url.js
|
|
73099
|
+
var invalid = "The input to be decoded is not correctly encoded.";
|
|
73100
|
+
function decode3(input2) {
|
|
73101
|
+
try {
|
|
73102
|
+
return decodeBase642(typeof input2 == "string" ? input2 : decoder.decode(input2), true);
|
|
73103
|
+
} catch (cause) {
|
|
73104
|
+
throw new TypeError(invalid, { cause });
|
|
73105
|
+
}
|
|
73106
|
+
}
|
|
73107
|
+
|
|
73108
|
+
// node_modules/jose/dist/webapi/lib/validate.js
|
|
73109
|
+
function isObject2(input2) {
|
|
73110
|
+
if (typeof input2 != "object" || input2 === null || Object.prototype.toString.call(input2) !== "[object Object]")
|
|
73111
|
+
return false;
|
|
73112
|
+
const prototype = Object.getPrototypeOf(input2);
|
|
73113
|
+
return prototype === null || Object.getPrototypeOf(prototype) === null;
|
|
73114
|
+
}
|
|
73115
|
+
function isJwkSet(input2) {
|
|
73116
|
+
return isObject2(input2) && Array.isArray(input2.keys) && Array.from(input2.keys).every(isObject2);
|
|
73117
|
+
}
|
|
73118
|
+
function isDisjoint(...headers) {
|
|
73119
|
+
const parameters = /* @__PURE__ */ new Set();
|
|
73120
|
+
for (const header of headers)
|
|
73121
|
+
if (header)
|
|
73122
|
+
for (const parameter of Object.keys(header)) {
|
|
73123
|
+
if (parameters.has(parameter))
|
|
73124
|
+
return false;
|
|
73125
|
+
parameters.add(parameter);
|
|
73126
|
+
}
|
|
73127
|
+
return true;
|
|
73128
|
+
}
|
|
73129
|
+
function decodeBase64url(value, label, ErrorClass) {
|
|
73130
|
+
try {
|
|
73131
|
+
return decode3(value);
|
|
73132
|
+
} catch {
|
|
73133
|
+
throw new ErrorClass(`Failed to base64url decode the ${label}`);
|
|
73134
|
+
}
|
|
73135
|
+
}
|
|
73136
|
+
function encodeBase64url(value, label, ErrorClass) {
|
|
73137
|
+
try {
|
|
73138
|
+
return encode3(value);
|
|
73139
|
+
} catch {
|
|
73140
|
+
throw new ErrorClass(`The ${label} is not a valid base64url string`);
|
|
73141
|
+
}
|
|
73142
|
+
}
|
|
73143
|
+
function parseJoseHeader(b64, ErrorClass, message2) {
|
|
73144
|
+
let parsed;
|
|
73145
|
+
try {
|
|
73146
|
+
parsed = JSON.parse(strictDecoder.decode(decode3(b64)));
|
|
73147
|
+
} catch {
|
|
73148
|
+
throw new ErrorClass(message2);
|
|
73149
|
+
}
|
|
73150
|
+
if (!isObject2(parsed))
|
|
73151
|
+
throw new ErrorClass(message2);
|
|
73152
|
+
return parsed;
|
|
73153
|
+
}
|
|
73154
|
+
var JWS_RECOGNIZED = { __proto__: null, b64: true };
|
|
73155
|
+
function validateAlgorithms(option, algorithms) {
|
|
73156
|
+
if (algorithms !== void 0 && (!Array.isArray(algorithms) || algorithms.some((s2) => typeof s2 != "string")))
|
|
73157
|
+
throw new TypeError(`"${option}" option must be an array of strings`);
|
|
73158
|
+
return algorithms === void 0 ? void 0 : new Set(algorithms);
|
|
73159
|
+
}
|
|
73160
|
+
function validateCrit(Err, recognizedDefault, recognizedOption, protectedHeader, joseHeader) {
|
|
73161
|
+
if (joseHeader.crit !== void 0 && protectedHeader?.crit === void 0)
|
|
73162
|
+
throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');
|
|
73163
|
+
if (!protectedHeader || protectedHeader.crit === void 0)
|
|
73164
|
+
return [];
|
|
73165
|
+
if (!Array.isArray(protectedHeader.crit) || protectedHeader.crit.length === 0 || protectedHeader.crit.some((input2) => typeof input2 != "string" || input2.length === 0))
|
|
73166
|
+
throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');
|
|
73167
|
+
const recognized = recognizedOption === void 0 ? recognizedDefault : { __proto__: null, ...recognizedOption, ...recognizedDefault };
|
|
73168
|
+
for (const parameter of protectedHeader.crit) {
|
|
73169
|
+
if (!(parameter in recognized))
|
|
73170
|
+
throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);
|
|
73171
|
+
if (!Object.hasOwn(joseHeader, parameter) || joseHeader[parameter] === void 0)
|
|
73172
|
+
throw new Err(`Extension Header Parameter "${parameter}" is missing`);
|
|
73173
|
+
if (recognized[parameter] && (!Object.hasOwn(protectedHeader, parameter) || protectedHeader[parameter] === void 0))
|
|
73174
|
+
throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`);
|
|
73175
|
+
}
|
|
73176
|
+
return protectedHeader.crit;
|
|
73177
|
+
}
|
|
73178
|
+
function validateB64(protectedHeader, extensions) {
|
|
73179
|
+
if (extensions.includes("b64")) {
|
|
73180
|
+
const b64 = protectedHeader.b64;
|
|
73181
|
+
if (typeof b64 != "boolean")
|
|
73182
|
+
throw new JWSInvalid('The "b64" (base64url-encode payload) Header Parameter must be a boolean');
|
|
73183
|
+
return b64;
|
|
73184
|
+
}
|
|
73185
|
+
return true;
|
|
73186
|
+
}
|
|
73187
|
+
|
|
73188
|
+
// node_modules/jose/dist/webapi/lib/key.js
|
|
73189
|
+
var tag = (key) => key[Symbol.toStringTag];
|
|
73190
|
+
var jwkMatchesOp = (entry, key, usage) => {
|
|
73191
|
+
const { alg } = entry;
|
|
73192
|
+
if (key.use !== void 0) {
|
|
73193
|
+
const expected = usage === "sign" || usage === "verify" ? "sig" : "enc";
|
|
73194
|
+
if (key.use !== expected)
|
|
73195
|
+
throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
|
|
73196
|
+
}
|
|
73197
|
+
if (key.alg !== void 0 && key.alg !== alg)
|
|
73198
|
+
throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
|
|
73199
|
+
if (Array.isArray(key.key_ops)) {
|
|
73200
|
+
const expectedKeyOp = usage === "encrypt" || usage === "decrypt" ? entry.ops?.[usage === "encrypt" ? 0 : 1] : usage;
|
|
73201
|
+
if (expectedKeyOp && !key.key_ops.includes(expectedKeyOp))
|
|
73202
|
+
throw new TypeError(`Invalid key for this operation, its "key_ops" must include "${expectedKeyOp}" when present`);
|
|
73203
|
+
}
|
|
73204
|
+
};
|
|
73205
|
+
async function prepareKey(entry, key, usage) {
|
|
73206
|
+
const { alg, secret } = entry, privateKey = usage === "decrypt" || usage === "sign";
|
|
73207
|
+
if (secret && key instanceof Uint8Array)
|
|
73208
|
+
return key;
|
|
73209
|
+
let normalized, keyObject;
|
|
73210
|
+
if (isObject2(key)) {
|
|
73211
|
+
if (normalized = normalizeJwk(key), typeof normalized.kty != "string")
|
|
73212
|
+
throw invalidKeyType(alg, key, secret);
|
|
73213
|
+
if (!(secret ? normalized.kty === "oct" && typeof normalized.k == "string" : normalized.kty !== "oct" && (privateKey ? normalized.kty === "AKP" && typeof normalized.priv == "string" || typeof normalized.d == "string" : normalized.d === void 0 && normalized.priv === void 0)))
|
|
73214
|
+
throw new TypeError(secret ? 'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present' : `JSON Web Key for this operation must be a ${privateKey ? "private" : "public"} JWK`);
|
|
73215
|
+
if (jwkMatchesOp(entry, normalized, usage), normalized.kty === "oct")
|
|
73216
|
+
return decode3(normalized.k);
|
|
73217
|
+
if (!Object.isFrozen(key)) {
|
|
73218
|
+
const { key_ops } = key;
|
|
73219
|
+
Array.isArray(key_ops) && Object.freeze(key_ops), Object.freeze(key);
|
|
73220
|
+
}
|
|
73221
|
+
} else {
|
|
73222
|
+
if (!isKeyLike(key))
|
|
73223
|
+
throw invalidKeyType(alg, key, secret);
|
|
73224
|
+
const expectedType = secret ? "secret" : privateKey ? "private" : "public";
|
|
73225
|
+
if (key.type !== expectedType && (secret || ["secret", "public", "private"].includes(key.type)))
|
|
73226
|
+
throw new TypeError(`${tag(key)} instances must be of type "${expectedType}" for the ${alg} algorithm`);
|
|
73227
|
+
if (isCryptoKey(key))
|
|
73228
|
+
return key;
|
|
73229
|
+
if (keyObject = key, keyObject.type === "secret")
|
|
73230
|
+
return keyObject.export();
|
|
73231
|
+
}
|
|
73232
|
+
cache5 ||= /* @__PURE__ */ new WeakMap();
|
|
73233
|
+
const cacheKey = key;
|
|
73234
|
+
let cached2 = cache5.get(cacheKey);
|
|
73235
|
+
if (cached2?.[alg])
|
|
73236
|
+
return cached2[alg];
|
|
73237
|
+
if (cached2 || cache5.set(cacheKey, cached2 = {}), keyObject && typeof keyObject.toCryptoKey == "function") {
|
|
73238
|
+
const isPublic = keyObject.type === "public", crv = nist[keyObject.asymmetricKeyDetails?.namedCurve], params = entry.resolve?.({ crv, asymmetricKeyType: keyObject.asymmetricKeyType }) ?? entry.subtle;
|
|
73239
|
+
return cached2[alg] = keyObject.toCryptoKey(params, isPublic, entry.usages[isPublic ? 0 : 1]);
|
|
73240
|
+
}
|
|
73241
|
+
return normalized ??= keyObject.export({ format: "jwk" }), normalized.alg = alg, cached2[alg] = await jwkToKey(entry, normalized);
|
|
73242
|
+
}
|
|
73243
|
+
var cache5;
|
|
73244
|
+
var nist = {
|
|
73245
|
+
__proto__: null,
|
|
73246
|
+
prime256v1: "P-256",
|
|
73247
|
+
secp384r1: "P-384",
|
|
73248
|
+
secp521r1: "P-521"
|
|
73249
|
+
};
|
|
73250
|
+
var isCryptoKey = (key) => {
|
|
73251
|
+
if (key?.[Symbol.toStringTag] === "CryptoKey")
|
|
73252
|
+
return true;
|
|
73253
|
+
try {
|
|
73254
|
+
return key instanceof CryptoKey;
|
|
73255
|
+
} catch {
|
|
73256
|
+
return false;
|
|
73257
|
+
}
|
|
73258
|
+
};
|
|
73259
|
+
var isKeyObject = (key) => key?.[Symbol.toStringTag] === "KeyObject";
|
|
73260
|
+
var isKeyLike = (key) => isCryptoKey(key) || isKeyObject(key);
|
|
73261
|
+
function message(msg, actual, ...types) {
|
|
73262
|
+
if (types.length > 2) {
|
|
73263
|
+
const last = types.pop();
|
|
73264
|
+
msg += `one of type ${types.join(", ")}, or ${last}.`;
|
|
73265
|
+
} else types.length === 2 ? msg += `one of type ${types[0]} or ${types[1]}.` : msg += `of type ${types[0]}.`;
|
|
73266
|
+
return actual == null ? msg += ` Received ${actual}` : typeof actual == "function" && actual.name ? msg += ` Received function ${actual.name}` : typeof actual == "object" && actual != null && actual.constructor?.name && (msg += ` Received an instance of ${actual.constructor.name}`), msg;
|
|
73267
|
+
}
|
|
73268
|
+
function invalidKeyType(alg, actual, secret) {
|
|
73269
|
+
const types = ["CryptoKey", "KeyObject", "JSON Web Key"];
|
|
73270
|
+
return secret && types.push("Uint8Array"), new TypeError(message(`Key for the ${alg} algorithm must be `, actual, ...types));
|
|
73271
|
+
}
|
|
73272
|
+
var unusable = (name, prop = "algorithm.name") => new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`);
|
|
73273
|
+
function checkUsage(key, usage) {
|
|
73274
|
+
if (usage && !key.usages.includes(usage))
|
|
73275
|
+
throw new TypeError(`CryptoKey does not support this operation, its usages must include ${usage}.`);
|
|
73276
|
+
}
|
|
73277
|
+
function checkModulusLength(alg, key) {
|
|
73278
|
+
const { modulusLength } = key.algorithm;
|
|
73279
|
+
if (typeof modulusLength != "number" || modulusLength < 2048)
|
|
73280
|
+
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
|
|
73281
|
+
}
|
|
73282
|
+
function checkCryptoKey(key, expected, usage) {
|
|
73283
|
+
const algorithm = key.algorithm;
|
|
73284
|
+
if (algorithm.name !== expected.name)
|
|
73285
|
+
throw unusable(expected.name);
|
|
73286
|
+
if (expected.hash && algorithm.hash?.name !== expected.hash)
|
|
73287
|
+
throw unusable(expected.hash, "algorithm.hash");
|
|
73288
|
+
if (expected.namedCurve && algorithm.namedCurve !== expected.namedCurve)
|
|
73289
|
+
throw unusable(expected.namedCurve, "algorithm.namedCurve");
|
|
73290
|
+
if (expected.length !== void 0 && algorithm.length !== expected.length)
|
|
73291
|
+
throw unusable(expected.length, "algorithm.length");
|
|
73292
|
+
checkUsage(key, usage);
|
|
73293
|
+
}
|
|
73294
|
+
function snapshotJwk(jwk) {
|
|
73295
|
+
return { __proto__: null, ...jwk };
|
|
73296
|
+
}
|
|
73297
|
+
function normalizeJwk(jwk) {
|
|
73298
|
+
const normalized = snapshotJwk(jwk);
|
|
73299
|
+
if (normalized.ext !== void 0 && typeof normalized.ext != "boolean")
|
|
73300
|
+
throw new TypeError('"ext" (Extractable) Parameter must be a boolean');
|
|
73301
|
+
if (normalized.key_ops !== void 0) {
|
|
73302
|
+
const value = normalized.key_ops, keyOps = Array.isArray(value) ? [...value] : void 0;
|
|
73303
|
+
if (!keyOps || keyOps.some((operation2) => typeof operation2 != "string") || new Set(keyOps).size !== keyOps.length)
|
|
73304
|
+
throw new TypeError('"key_ops" (Key Operations) Parameter must be an array of unique strings');
|
|
73305
|
+
normalized.key_ops = keyOps;
|
|
73306
|
+
}
|
|
73307
|
+
return normalized;
|
|
73308
|
+
}
|
|
73309
|
+
async function jwkToKey(entry, jwk, extractable) {
|
|
73310
|
+
if (!entry.kty.includes(jwk.kty))
|
|
73311
|
+
throw new JOSENotSupported('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');
|
|
73312
|
+
const algorithm = entry.resolve?.({ kty: jwk.kty, crv: jwk.crv }) ?? entry.subtle, isPrivate = !!(jwk.d || jwk.priv), keyData = { ...jwk, ext: extractable ?? jwk.ext };
|
|
73313
|
+
return keyData.kty !== "AKP" && delete keyData.alg, delete keyData.use, crypto.subtle.importKey("jwk", keyData, algorithm, keyData.ext ?? !isPrivate, jwk.key_ops ?? entry.usages[isPrivate ? 1 : 0]);
|
|
73314
|
+
}
|
|
73315
|
+
async function rawKey(key, expected, usage, extractable = false) {
|
|
73316
|
+
return key instanceof Uint8Array && (key = await crypto.subtle.importKey("raw", key, expected, extractable, [usage])), checkCryptoKey(key, expected, usage), key;
|
|
73317
|
+
}
|
|
73318
|
+
|
|
73319
|
+
// node_modules/jose/dist/webapi/lib/key_descriptor.js
|
|
73320
|
+
function table(entries) {
|
|
73321
|
+
const out = { __proto__: null };
|
|
73322
|
+
for (const alg in entries)
|
|
73323
|
+
out[alg] = { ...entries[alg], alg };
|
|
73324
|
+
return out;
|
|
73325
|
+
}
|
|
73326
|
+
|
|
73327
|
+
// node_modules/jose/dist/webapi/lib/jws_algorithms.js
|
|
73328
|
+
var sig = [["verify"], ["sign"]];
|
|
73329
|
+
function hmac(bits) {
|
|
73330
|
+
const subtle2 = { name: "HMAC", hash: `SHA-${bits}` };
|
|
73331
|
+
return { kty: ["oct"], secret: true, subtle: subtle2, signing: subtle2, usages: sig };
|
|
73332
|
+
}
|
|
73333
|
+
function rsa(bits, saltLength) {
|
|
73334
|
+
const subtle2 = { name: saltLength ? "RSA-PSS" : "RSASSA-PKCS1-v1_5", hash: `SHA-${bits}` };
|
|
73335
|
+
return {
|
|
73336
|
+
kty: ["RSA"],
|
|
73337
|
+
subtle: subtle2,
|
|
73338
|
+
signing: saltLength ? { ...subtle2, saltLength } : subtle2,
|
|
73339
|
+
usages: sig,
|
|
73340
|
+
minRsaBits: 2048
|
|
73341
|
+
};
|
|
73342
|
+
}
|
|
73343
|
+
function ecdsa(crv, bits) {
|
|
73344
|
+
return {
|
|
73345
|
+
kty: ["EC"],
|
|
73346
|
+
crv,
|
|
73347
|
+
subtle: { name: "ECDSA", namedCurve: crv },
|
|
73348
|
+
signing: { name: "ECDSA", hash: `SHA-${bits}` },
|
|
73349
|
+
usages: sig
|
|
73350
|
+
};
|
|
73351
|
+
}
|
|
73352
|
+
function eddsa() {
|
|
73353
|
+
const subtle2 = { name: "Ed25519" };
|
|
73354
|
+
return {
|
|
73355
|
+
kty: ["OKP"],
|
|
73356
|
+
crv: "Ed25519",
|
|
73357
|
+
subtle: subtle2,
|
|
73358
|
+
signing: subtle2,
|
|
73359
|
+
usages: sig
|
|
73360
|
+
};
|
|
73361
|
+
}
|
|
73362
|
+
function mldsa(bits) {
|
|
73363
|
+
const subtle2 = { name: `ML-DSA-${bits}` };
|
|
73364
|
+
return {
|
|
73365
|
+
kty: ["AKP"],
|
|
73366
|
+
subtle: subtle2,
|
|
73367
|
+
signing: subtle2,
|
|
73368
|
+
usages: sig
|
|
73369
|
+
};
|
|
73370
|
+
}
|
|
73371
|
+
var JWS = table({
|
|
73372
|
+
HS256: hmac(256),
|
|
73373
|
+
HS384: hmac(384),
|
|
73374
|
+
HS512: hmac(512),
|
|
73375
|
+
RS256: rsa(256),
|
|
73376
|
+
RS384: rsa(384),
|
|
73377
|
+
RS512: rsa(512),
|
|
73378
|
+
PS256: rsa(256, 32),
|
|
73379
|
+
PS384: rsa(384, 48),
|
|
73380
|
+
PS512: rsa(512, 64),
|
|
73381
|
+
ES256: ecdsa("P-256", 256),
|
|
73382
|
+
ES384: ecdsa("P-384", 384),
|
|
73383
|
+
ES512: ecdsa("P-521", 512),
|
|
73384
|
+
EdDSA: eddsa(),
|
|
73385
|
+
Ed25519: eddsa(),
|
|
73386
|
+
"ML-DSA-44": mldsa(44),
|
|
73387
|
+
"ML-DSA-65": mldsa(65),
|
|
73388
|
+
"ML-DSA-87": mldsa(87)
|
|
73389
|
+
});
|
|
73390
|
+
function jwsAlgorithm(alg) {
|
|
73391
|
+
const entry = typeof alg == "string" ? JWS[alg] : void 0;
|
|
73392
|
+
if (!entry)
|
|
73393
|
+
throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
|
|
73394
|
+
return entry;
|
|
73395
|
+
}
|
|
73396
|
+
|
|
73397
|
+
// node_modules/jose/dist/webapi/lib/jws_verify.js
|
|
73398
|
+
function prepareVerify(options) {
|
|
73399
|
+
return [options && validateAlgorithms("algorithms", options.algorithms), options?.crit];
|
|
73400
|
+
}
|
|
73401
|
+
function parseProtectedHeader(encodedProtected) {
|
|
73402
|
+
return encodedProtected === void 0 ? {} : parseJoseHeader(encodedProtected, JWSInvalid, "JWS Protected Header is invalid");
|
|
73403
|
+
}
|
|
73404
|
+
function encodeCompactUnencodedPayload(payload2) {
|
|
73405
|
+
try {
|
|
73406
|
+
return encode3(payload2);
|
|
73407
|
+
} catch {
|
|
73408
|
+
throw new JWSInvalid("JWS Compact Serialization payload must use only ASCII characters");
|
|
73409
|
+
}
|
|
73410
|
+
}
|
|
73411
|
+
async function verifySignature(jws, shared, key, encodeUnencodedPayload, parsedProtected) {
|
|
73412
|
+
const { protected: encodedProtected, header, payload: inputPayload } = jws, parsedProt = parsedProtected ?? parseProtectedHeader(encodedProtected);
|
|
73413
|
+
if (!isDisjoint(parsedProt, header))
|
|
73414
|
+
throw new JWSInvalid("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");
|
|
73415
|
+
const joseHeader = { ...parsedProt, ...header }, b64 = validateB64(parsedProt, validateCrit(JWSInvalid, JWS_RECOGNIZED, shared[1], parsedProt, joseHeader)), { alg } = joseHeader;
|
|
73416
|
+
if (typeof alg != "string" || !alg)
|
|
73417
|
+
throw new JWSInvalid('JWS "alg" (Algorithm) Header Parameter missing or invalid');
|
|
73418
|
+
if (shared[0] && !shared[0].has(alg))
|
|
73419
|
+
throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');
|
|
73420
|
+
if (b64) {
|
|
73421
|
+
if (typeof inputPayload != "string")
|
|
73422
|
+
throw new JWSInvalid("JWS Payload must be a string");
|
|
73423
|
+
} else if (typeof inputPayload != "string" && !(inputPayload instanceof Uint8Array))
|
|
73424
|
+
throw new JWSInvalid("JWS Payload must be a string or an Uint8Array instance");
|
|
73425
|
+
const signingPayload = b64 || typeof inputPayload != "string" ? inputPayload : encodeUnencodedPayload(inputPayload);
|
|
73426
|
+
let resolvedKey = false;
|
|
73427
|
+
typeof key == "function" && (key = await key(parsedProt, jws), resolvedKey = true);
|
|
73428
|
+
const entry = jwsAlgorithm(alg), data = concat(encodedProtected !== void 0 ? encode3(encodedProtected) : new Uint8Array(), encode3("."), typeof signingPayload == "string" ? shared[2] ??= encodeBase64url(signingPayload, "payload", JWSInvalid) : signingPayload), signature = decodeBase64url(jws.signature, "signature", JWSInvalid), k5 = await prepareKey(entry, key, "verify"), cryptoKey = await rawKey(k5, entry.subtle, "verify");
|
|
73429
|
+
entry.minRsaBits && checkModulusLength(entry.alg, cryptoKey);
|
|
73430
|
+
let verified = false;
|
|
73431
|
+
try {
|
|
73432
|
+
verified = await crypto.subtle.verify(entry.signing, cryptoKey, signature, data);
|
|
73433
|
+
} catch {
|
|
73434
|
+
}
|
|
73435
|
+
if (!verified)
|
|
73436
|
+
throw new JWSSignatureVerificationFailed();
|
|
73437
|
+
const result = { payload: typeof signingPayload == "string" ? decodeBase64url(signingPayload, "payload", JWSInvalid) : signingPayload };
|
|
73438
|
+
return encodedProtected !== void 0 && (result.protectedHeader = parsedProt), header !== void 0 && (result.unprotectedHeader = header), resolvedKey ? [{ ...result, key: k5 }, b64] : [result, b64];
|
|
73439
|
+
}
|
|
73440
|
+
async function verifyCompact(jws, shared, key) {
|
|
73441
|
+
if (jws instanceof Uint8Array && (jws = decoder.decode(jws)), typeof jws != "string")
|
|
73442
|
+
throw new JWSInvalid("Compact JWS must be a string or Uint8Array");
|
|
73443
|
+
const { 0: protectedHeader, 1: payload2, 2: signature, length } = jws.split(".");
|
|
73444
|
+
if (length !== 3)
|
|
73445
|
+
throw new JWSInvalid("Invalid Compact JWS");
|
|
73446
|
+
return verifySignature({ payload: payload2, protected: protectedHeader, signature }, shared, key, encodeCompactUnencodedPayload);
|
|
73447
|
+
}
|
|
73448
|
+
|
|
73449
|
+
// node_modules/jose/dist/webapi/lib/jwt_claims_set.js
|
|
73450
|
+
var epoch = (date6) => Math.floor(date6.getTime() / 1e3);
|
|
73451
|
+
var multipliers = {
|
|
73452
|
+
s: 1,
|
|
73453
|
+
m: 60,
|
|
73454
|
+
h: 3600,
|
|
73455
|
+
d: 86400,
|
|
73456
|
+
w: 604800,
|
|
73457
|
+
y: 31557600
|
|
73458
|
+
};
|
|
73459
|
+
var REGEX = /^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;
|
|
73460
|
+
var checkFailed = "check_failed";
|
|
73461
|
+
function invalidDuration() {
|
|
73462
|
+
throw new TypeError("Invalid time period format");
|
|
73463
|
+
}
|
|
73464
|
+
function secs(str) {
|
|
73465
|
+
typeof str != "string" && invalidDuration();
|
|
73466
|
+
const matched = REGEX.exec(str);
|
|
73467
|
+
(!matched || matched[4] && matched[1]) && invalidDuration();
|
|
73468
|
+
const value = parseFloat(matched[2]), numericDate2 = Math.round(value * multipliers[matched[3][0].toLowerCase()]);
|
|
73469
|
+
return Number.isFinite(numericDate2) || invalidDuration(), matched[1] === "-" || matched[4] === "ago" ? -numericDate2 : numericDate2;
|
|
73470
|
+
}
|
|
73471
|
+
function validateInput(label, input2) {
|
|
73472
|
+
if (!Number.isFinite(input2))
|
|
73473
|
+
throw new TypeError(`Invalid ${label} input`);
|
|
73474
|
+
return input2;
|
|
73475
|
+
}
|
|
73476
|
+
var normalizeTyp = (value) => {
|
|
73477
|
+
const normalized = value.toLowerCase();
|
|
73478
|
+
return value.includes("/") ? normalized : `application/${normalized}`;
|
|
73479
|
+
};
|
|
73480
|
+
var checkAudiencePresence = (audPayload, audOption) => typeof audPayload == "string" ? audOption.includes(audPayload) : Array.isArray(audPayload) ? audOption.some((aud) => audPayload.includes(aud)) : false;
|
|
73481
|
+
function validateNumericDate(payload2, claim2, required2 = false) {
|
|
73482
|
+
const value = payload2[claim2];
|
|
73483
|
+
if (!(value === void 0 && !required2)) {
|
|
73484
|
+
if (typeof value != "number")
|
|
73485
|
+
throw new JWTClaimValidationFailed(`"${claim2}" claim must be a number`, payload2, claim2, "invalid");
|
|
73486
|
+
return value;
|
|
73487
|
+
}
|
|
73488
|
+
}
|
|
73489
|
+
function unexpectedClaim(payload2, claim2) {
|
|
73490
|
+
throw new JWTClaimValidationFailed(`unexpected "${claim2}" claim value`, payload2, claim2, checkFailed);
|
|
73491
|
+
}
|
|
73492
|
+
function validateClaimsSet(protectedHeader, encodedPayload, options = {}) {
|
|
73493
|
+
let payload2;
|
|
73494
|
+
try {
|
|
73495
|
+
payload2 = JSON.parse(strictDecoder.decode(encodedPayload));
|
|
73496
|
+
} catch {
|
|
73497
|
+
}
|
|
73498
|
+
if (!isObject2(payload2))
|
|
73499
|
+
throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");
|
|
73500
|
+
const { typ } = options;
|
|
73501
|
+
if (typ !== void 0 && (typeof protectedHeader.typ != "string" || normalizeTyp(protectedHeader.typ) !== normalizeTyp(typ)))
|
|
73502
|
+
throw new JWTClaimValidationFailed('unexpected "typ" JWT header value', payload2, "typ", checkFailed);
|
|
73503
|
+
const { requiredClaims = [], issuer, subject, audience, maxTokenAge } = options, presenceCheck = [...requiredClaims];
|
|
73504
|
+
maxTokenAge !== void 0 && presenceCheck.push("iat"), audience !== void 0 && presenceCheck.push("aud"), subject !== void 0 && presenceCheck.push("sub"), issuer !== void 0 && presenceCheck.push("iss");
|
|
73505
|
+
for (const claim2 of new Set(presenceCheck.reverse()))
|
|
73506
|
+
if (!Object.hasOwn(payload2, claim2))
|
|
73507
|
+
throw new JWTClaimValidationFailed(`missing required "${claim2}" claim`, payload2, claim2, "missing");
|
|
73508
|
+
issuer !== void 0 && !(Array.isArray(issuer) ? issuer : [issuer]).includes(payload2.iss) && unexpectedClaim(payload2, "iss"), subject !== void 0 && payload2.sub !== subject && unexpectedClaim(payload2, "sub"), audience !== void 0 && !checkAudiencePresence(payload2.aud, typeof audience == "string" ? [audience] : audience) && unexpectedClaim(payload2, "aud");
|
|
73509
|
+
const { clockTolerance } = options;
|
|
73510
|
+
let tolerance = 0;
|
|
73511
|
+
if (typeof clockTolerance == "string")
|
|
73512
|
+
tolerance = secs(clockTolerance);
|
|
73513
|
+
else if (clockTolerance !== void 0) {
|
|
73514
|
+
if (typeof clockTolerance != "number")
|
|
73515
|
+
throw new TypeError("Invalid clockTolerance option type");
|
|
73516
|
+
tolerance = clockTolerance;
|
|
73517
|
+
}
|
|
73518
|
+
validateInput("clockTolerance option", tolerance);
|
|
73519
|
+
const { currentDate } = options, now = validateInput("currentDate option", epoch(currentDate === void 0 ? /* @__PURE__ */ new Date() : currentDate)), iat = validateNumericDate(payload2, "iat", maxTokenAge !== void 0), nbf = validateNumericDate(payload2, "nbf");
|
|
73520
|
+
if (nbf !== void 0 && nbf > now + tolerance)
|
|
73521
|
+
throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed', payload2, "nbf", checkFailed);
|
|
73522
|
+
const exp = validateNumericDate(payload2, "exp");
|
|
73523
|
+
if (exp !== void 0 && exp <= now - tolerance)
|
|
73524
|
+
throw new JWTExpired('"exp" claim timestamp check failed', payload2, "exp", checkFailed);
|
|
73525
|
+
if (maxTokenAge !== void 0) {
|
|
73526
|
+
const age = now - iat, max = validateInput("maxTokenAge option", typeof maxTokenAge == "number" ? maxTokenAge : secs(maxTokenAge));
|
|
73527
|
+
if (age - tolerance > max)
|
|
73528
|
+
throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)', payload2, "iat", checkFailed);
|
|
73529
|
+
if (age < -tolerance)
|
|
73530
|
+
throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)', payload2, "iat", checkFailed);
|
|
73531
|
+
}
|
|
73532
|
+
return payload2;
|
|
73533
|
+
}
|
|
73534
|
+
|
|
73535
|
+
// node_modules/jose/dist/webapi/jwt/verify.js
|
|
73536
|
+
async function jwtVerify(jwt2, key, options) {
|
|
73537
|
+
const [verified, b64] = await verifyCompact(jwt2, prepareVerify(options), key);
|
|
73538
|
+
if (!b64)
|
|
73539
|
+
throw new JWTInvalid("JWTs MUST NOT use unencoded payload");
|
|
73540
|
+
const payload2 = validateClaimsSet(verified.protectedHeader, verified.payload, options);
|
|
73541
|
+
return { ...verified, payload: payload2 };
|
|
73542
|
+
}
|
|
73543
|
+
|
|
73544
|
+
// node_modules/jose/dist/webapi/jwks/local.js
|
|
73545
|
+
function isUsableJWK(jwk, entry, alg, kid) {
|
|
73546
|
+
const { kty, key_ops: keyOps, ext, kid: jwkKid, alg: jwkAlg, use, crv } = jwk;
|
|
73547
|
+
return (ext === void 0 || typeof ext == "boolean") && (keyOps === void 0 || Array.isArray(keyOps) && keyOps.every((operation2, index) => typeof operation2 == "string" && keyOps.indexOf(operation2) === index) && keyOps.includes("verify")) && entry.kty.includes(kty) && (kid === void 0 || typeof kid == "string" && kid === jwkKid) && (jwkAlg === void 0 ? kty !== "AKP" : alg === jwkAlg) && (use === void 0 || use === "sig") && (!entry.crv || crv === entry.crv);
|
|
73548
|
+
}
|
|
73549
|
+
async function importWithAlgCache(cache6, jwk, entry) {
|
|
73550
|
+
const cached2 = cache6.get(jwk) || cache6.set(jwk, {}).get(jwk), { alg } = entry;
|
|
73551
|
+
if (cached2[alg] === void 0) {
|
|
73552
|
+
const pending2 = jwkToKey(entry, jwk, true).then((key) => {
|
|
73553
|
+
if (key.type !== "public")
|
|
73554
|
+
throw new JWKSInvalid("JSON Web Key Set members must be public keys");
|
|
73555
|
+
return cached2[alg] = key, key;
|
|
73556
|
+
}).catch((error62) => {
|
|
73557
|
+
throw cached2[alg] === pending2 && delete cached2[alg], error62;
|
|
73558
|
+
});
|
|
73559
|
+
cached2[alg] = pending2;
|
|
73560
|
+
}
|
|
73561
|
+
return cached2[alg];
|
|
73562
|
+
}
|
|
73563
|
+
function createLocalJWKSet(jwks) {
|
|
73564
|
+
let snapshot;
|
|
73565
|
+
try {
|
|
73566
|
+
snapshot = structuredClone(jwks);
|
|
73567
|
+
} catch {
|
|
73568
|
+
}
|
|
73569
|
+
if (!isJwkSet(snapshot))
|
|
73570
|
+
throw new JWKSInvalid("JSON Web Key Set malformed");
|
|
73571
|
+
const metadata = snapshot.keys.map((jwk) => {
|
|
73572
|
+
const normalized = snapshotJwk(jwk);
|
|
73573
|
+
return Array.isArray(normalized.key_ops) && (normalized.key_ops = [...normalized.key_ops]), normalized;
|
|
73574
|
+
}), cached2 = /* @__PURE__ */ new WeakMap();
|
|
73575
|
+
return Object.defineProperty(async (protectedHeader, token) => {
|
|
73576
|
+
const { alg, kid } = { ...protectedHeader, ...token?.header }, entry = typeof alg == "string" ? JWS[alg] : void 0;
|
|
73577
|
+
if (!entry || entry.secret)
|
|
73578
|
+
throw new JOSENotSupported('Unsupported "alg" value for a JSON Web Key Set');
|
|
73579
|
+
const candidates = snapshot.keys.filter((_, index) => isUsableJWK(metadata[index], entry, alg, kid)), { 0: jwk, length } = candidates;
|
|
73580
|
+
if (!length)
|
|
73581
|
+
throw new JWKSNoMatchingKey();
|
|
73582
|
+
if (length !== 1) {
|
|
73583
|
+
const error62 = new JWKSMultipleMatchingKeys();
|
|
73584
|
+
throw error62[Symbol.asyncIterator] = async function* () {
|
|
73585
|
+
for (const jwk2 of candidates)
|
|
73586
|
+
try {
|
|
73587
|
+
yield await importWithAlgCache(cached2, jwk2, entry);
|
|
73588
|
+
} catch {
|
|
73589
|
+
}
|
|
73590
|
+
}, error62;
|
|
73591
|
+
}
|
|
73592
|
+
return importWithAlgCache(cached2, jwk, entry);
|
|
73593
|
+
}, "jwks", {
|
|
73594
|
+
value: () => structuredClone(snapshot)
|
|
73595
|
+
});
|
|
73596
|
+
}
|
|
73597
|
+
|
|
73598
|
+
// node_modules/jose/dist/webapi/jwks/remote.js
|
|
73599
|
+
function isCloudflareWorkers() {
|
|
73600
|
+
return typeof WebSocketPair < "u" || typeof navigator < "u" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime < "u" && EdgeRuntime === "vercel";
|
|
73601
|
+
}
|
|
73602
|
+
var USER_AGENT2;
|
|
73603
|
+
(typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (USER_AGENT2 = "jose/v6.2.12");
|
|
73604
|
+
var customFetch = /* @__PURE__ */ Symbol();
|
|
73605
|
+
async function fetchJwks(url2, headers, signal, fetchImpl = fetch) {
|
|
73606
|
+
const response = await fetchImpl(url2, {
|
|
73607
|
+
method: "GET",
|
|
73608
|
+
signal,
|
|
73609
|
+
redirect: "manual",
|
|
73610
|
+
headers
|
|
73611
|
+
}).catch((err) => {
|
|
73612
|
+
throw err.name === "TimeoutError" ? new JWKSTimeout() : err;
|
|
73613
|
+
});
|
|
73614
|
+
if (response.status !== 200)
|
|
73615
|
+
throw new JOSEError("Expected 200 OK from the JSON Web Key Set HTTP response");
|
|
73616
|
+
try {
|
|
73617
|
+
return await response.json();
|
|
73618
|
+
} catch {
|
|
73619
|
+
throw new JOSEError("Failed to parse the JSON Web Key Set HTTP response as JSON");
|
|
73620
|
+
}
|
|
73621
|
+
}
|
|
73622
|
+
var jwksCache = /* @__PURE__ */ Symbol();
|
|
73623
|
+
function isFreshFor(timestamp4, duration3) {
|
|
73624
|
+
return Number.isFinite(timestamp4) && Date.now() < timestamp4 + duration3;
|
|
73625
|
+
}
|
|
73626
|
+
function validateDuration(value, fallback2, option) {
|
|
73627
|
+
if (Number.isNaN(value))
|
|
73628
|
+
throw new TypeError(`"${option}" option must not be NaN`);
|
|
73629
|
+
return typeof value == "number" ? value : fallback2;
|
|
73630
|
+
}
|
|
73631
|
+
function createRemoteJWKSet(url2, options) {
|
|
73632
|
+
if (!(url2 instanceof URL))
|
|
73633
|
+
throw new TypeError("url must be an instance of URL");
|
|
73634
|
+
const href = new URL(url2.href).href, opts = options ?? {}, timeoutOption = opts.timeoutDuration;
|
|
73635
|
+
if (typeof timeoutOption == "number" && (!Number.isInteger(timeoutOption) || timeoutOption < 0))
|
|
73636
|
+
throw new TypeError('"timeoutDuration" option must be a non-negative integer');
|
|
73637
|
+
const timeoutDuration = typeof timeoutOption == "number" ? timeoutOption : 5e3, cooldownDuration = validateDuration(opts.cooldownDuration, 3e4, "cooldownDuration"), cacheMaxAge = validateDuration(opts.cacheMaxAge, 6e5, "cacheMaxAge"), headers = new Headers(opts.headers);
|
|
73638
|
+
USER_AGENT2 && !headers.has("User-Agent") && headers.set("User-Agent", USER_AGENT2), headers.has("accept") || headers.set("accept", "application/json, application/jwk-set+json");
|
|
73639
|
+
const fetchImpl = opts[customFetch], cache6 = opts[jwksCache];
|
|
73640
|
+
let jwksTimestamp, pendingFetch, reloadSequence = 0, appliedSequence = 0, local;
|
|
73641
|
+
if (cache6 && typeof cache6 == "object") {
|
|
73642
|
+
const { uat, jwks } = cache6;
|
|
73643
|
+
isFreshFor(uat, cacheMaxAge) && isJwkSet(jwks) && (jwksTimestamp = uat, local = createLocalJWKSet(jwks));
|
|
73644
|
+
}
|
|
73645
|
+
const reload = async () => {
|
|
73646
|
+
if (pendingFetch && isCloudflareWorkers() && (pendingFetch = void 0), !pendingFetch) {
|
|
73647
|
+
const sequence = ++reloadSequence, current = pendingFetch = fetchJwks(href, headers, AbortSignal.timeout(timeoutDuration), fetchImpl).then((json2) => {
|
|
73648
|
+
const next = createLocalJWKSet(json2);
|
|
73649
|
+
if (sequence <= appliedSequence)
|
|
73650
|
+
return;
|
|
73651
|
+
local = next;
|
|
73652
|
+
const updatedAt = Date.now();
|
|
73653
|
+
cache6 && (cache6.uat = updatedAt, cache6.jwks = json2), jwksTimestamp = updatedAt, appliedSequence = sequence;
|
|
73654
|
+
}).finally(() => {
|
|
73655
|
+
pendingFetch === current && (pendingFetch = void 0);
|
|
73656
|
+
});
|
|
73657
|
+
}
|
|
73658
|
+
await pendingFetch;
|
|
73659
|
+
};
|
|
73660
|
+
return Object.defineProperties(async (protectedHeader, token) => {
|
|
73661
|
+
(!local || !isFreshFor(jwksTimestamp, cacheMaxAge)) && await reload();
|
|
73662
|
+
try {
|
|
73663
|
+
return await local(protectedHeader, token);
|
|
73664
|
+
} catch (err) {
|
|
73665
|
+
if (err instanceof JWKSNoMatchingKey && !isFreshFor(jwksTimestamp, cooldownDuration))
|
|
73666
|
+
return await reload(), local(protectedHeader, token);
|
|
73667
|
+
throw err;
|
|
73668
|
+
}
|
|
73669
|
+
}, {
|
|
73670
|
+
coolingDown: {
|
|
73671
|
+
get: () => isFreshFor(jwksTimestamp, cooldownDuration),
|
|
73672
|
+
enumerable: true
|
|
73673
|
+
},
|
|
73674
|
+
fresh: {
|
|
73675
|
+
get: () => isFreshFor(jwksTimestamp, cacheMaxAge),
|
|
73676
|
+
enumerable: true
|
|
73677
|
+
},
|
|
73678
|
+
reload: {
|
|
73679
|
+
value: reload,
|
|
73680
|
+
enumerable: true
|
|
73681
|
+
},
|
|
73682
|
+
reloading: {
|
|
73683
|
+
get: () => !!pendingFetch,
|
|
73684
|
+
enumerable: true
|
|
73685
|
+
},
|
|
73686
|
+
jwks: {
|
|
73687
|
+
value: () => local?.jwks(),
|
|
73688
|
+
enumerable: true
|
|
73689
|
+
}
|
|
73690
|
+
});
|
|
73691
|
+
}
|
|
73692
|
+
|
|
73693
|
+
// packages/server/src/oidc-auth.ts
|
|
73694
|
+
async function createAccessTokenVerifier(auth, fetcher = globalThis.fetch) {
|
|
73695
|
+
const configuredIssuer = auth.issuer.replace(/\/$/, "");
|
|
73696
|
+
const discovery = await fetchJson(`${configuredIssuer}/.well-known/openid-configuration`, fetcher);
|
|
73697
|
+
if (typeof discovery.issuer !== "string" || discovery.issuer.replace(/\/$/, "") !== configuredIssuer || typeof discovery.jwks_uri !== "string") {
|
|
73698
|
+
throw new Error("OIDC discovery must name the configured issuer and a JWKS URI.");
|
|
73699
|
+
}
|
|
73700
|
+
const issuer = discovery.issuer;
|
|
73701
|
+
let jwksUrl;
|
|
73702
|
+
try {
|
|
73703
|
+
jwksUrl = new URL(discovery.jwks_uri);
|
|
73704
|
+
} catch {
|
|
73705
|
+
throw new Error("OIDC discovery returned an invalid JWKS URI.");
|
|
73706
|
+
}
|
|
73707
|
+
const keys = createRemoteJWKSet(jwksUrl, { [customFetch]: fetcher });
|
|
73708
|
+
return async (token) => {
|
|
73709
|
+
const { payload: payload2 } = await jwtVerify(token, keys, { issuer, audience: auth.audience });
|
|
73710
|
+
if (typeof payload2.sub !== "string" || !payload2.sub)
|
|
73711
|
+
throw new Error("Access token has no subject.");
|
|
73712
|
+
if (!auth.allow.subjects.includes(payload2.sub)) {
|
|
73713
|
+
const error62 = new Error("Authenticated subject is not allowed to view this dashboard.");
|
|
73714
|
+
error62.name = "UnauthorizedSubjectError";
|
|
73715
|
+
throw error62;
|
|
73716
|
+
}
|
|
73717
|
+
return { subject: payload2.sub };
|
|
73718
|
+
};
|
|
73719
|
+
}
|
|
73720
|
+
async function fetchJson(url2, fetcher) {
|
|
73721
|
+
const response = await fetcher(url2);
|
|
73722
|
+
if (!response.ok) throw new Error(`OIDC discovery request failed: ${response.status}`);
|
|
73723
|
+
try {
|
|
73724
|
+
return await response.json();
|
|
73725
|
+
} catch {
|
|
73726
|
+
throw new Error("OIDC discovery did not return JSON.");
|
|
73727
|
+
}
|
|
73728
|
+
}
|
|
73729
|
+
function unauthorizedSubject(error62) {
|
|
73730
|
+
return error62 instanceof Error && error62.name === "UnauthorizedSubjectError";
|
|
73731
|
+
}
|
|
73732
|
+
|
|
72976
73733
|
// packages/server/src/template.ts
|
|
72977
73734
|
var ASSET_PATH_SENTINEL = "/__ASSET_PATH__";
|
|
72978
73735
|
var TemplateFetchError = class extends Error {
|
|
@@ -73068,6 +73825,23 @@ function createApp(deps) {
|
|
|
73068
73825
|
await next();
|
|
73069
73826
|
c5.header("x-dashboard-request-id", id);
|
|
73070
73827
|
});
|
|
73828
|
+
app.use("/api/*", async (c5, next) => {
|
|
73829
|
+
if (!deps.boardConfig?.auth) return next();
|
|
73830
|
+
if (!deps.accessTokenVerifier)
|
|
73831
|
+
return c5.json({ error: "Authentication verification is unavailable." }, 503);
|
|
73832
|
+
const authorization = c5.req.header("authorization");
|
|
73833
|
+
if (!authorization?.startsWith("Bearer "))
|
|
73834
|
+
return c5.json({ error: "Authentication required." }, 401);
|
|
73835
|
+
try {
|
|
73836
|
+
await deps.accessTokenVerifier(authorization.slice("Bearer ".length));
|
|
73837
|
+
} catch (error62) {
|
|
73838
|
+
return c5.json(
|
|
73839
|
+
{ error: unauthorizedSubject(error62) ? "Access denied." : "Invalid access token." },
|
|
73840
|
+
unauthorizedSubject(error62) ? 403 : 401
|
|
73841
|
+
);
|
|
73842
|
+
}
|
|
73843
|
+
return next();
|
|
73844
|
+
});
|
|
73071
73845
|
app.onError((_error, c5) => {
|
|
73072
73846
|
const id = c5.get("dashboardRequestId");
|
|
73073
73847
|
logger2.log({
|
|
@@ -73380,7 +74154,14 @@ ${(0, import_yaml.stringify)(outputConfig, { sortMapEntries: true })}`,
|
|
|
73380
74154
|
assetPath: config2.assetPath,
|
|
73381
74155
|
assetPathId: diagnosticContext.configuredAssetPathId,
|
|
73382
74156
|
proxyPath: config2.proxyPath,
|
|
73383
|
-
board
|
|
74157
|
+
board,
|
|
74158
|
+
...deps.boardConfig?.auth ? {
|
|
74159
|
+
auth: {
|
|
74160
|
+
issuer: deps.boardConfig.auth.issuer,
|
|
74161
|
+
clientId: deps.boardConfig.auth.client_id,
|
|
74162
|
+
audience: deps.boardConfig.auth.audience
|
|
74163
|
+
}
|
|
74164
|
+
} : {}
|
|
73384
74165
|
};
|
|
73385
74166
|
return new Response(renderIndexHtml(template, env2), {
|
|
73386
74167
|
headers: {
|
|
@@ -73503,6 +74284,8 @@ async function startup(options = {}) {
|
|
|
73503
74284
|
secretReference: config2.secretReference,
|
|
73504
74285
|
credentialNames
|
|
73505
74286
|
});
|
|
74287
|
+
category = "authentication";
|
|
74288
|
+
const accessTokenVerifier = boardConfig.auth ? await createAccessTokenVerifier(boardConfig.auth, fetcher) : void 0;
|
|
73506
74289
|
category = "unknown";
|
|
73507
74290
|
warnAboutMissingAuth(resolvedConfig, logger2);
|
|
73508
74291
|
return {
|
|
@@ -73512,7 +74295,8 @@ async function startup(options = {}) {
|
|
|
73512
74295
|
boardConfig,
|
|
73513
74296
|
allowlist,
|
|
73514
74297
|
credentials,
|
|
73515
|
-
logger: logger2
|
|
74298
|
+
logger: logger2,
|
|
74299
|
+
accessTokenVerifier
|
|
73516
74300
|
}),
|
|
73517
74301
|
config: resolvedConfig
|
|
73518
74302
|
};
|