@jjrawlins/cdk-iam-policy-builder-helper 0.0.51 → 0.0.53
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/.jsii +3 -3
- package/cdk-iam-policy-builder-helper/go.mod +1 -1
- package/cdk-iam-policy-builder-helper/jsii/jsii.go +2 -2
- package/cdk-iam-policy-builder-helper/version +1 -1
- package/node_modules/@aws-sdk/client-iam/dist-cjs/index.js +13439 -13574
- package/node_modules/@aws-sdk/client-iam/package.json +5 -5
- package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +478 -596
- package/node_modules/@aws-sdk/client-sso/package.json +4 -4
- package/node_modules/@aws-sdk/core/dist-cjs/index.js +1969 -6
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +48 -88
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +35 -74
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +273 -365
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1581 -1863
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -3
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -2
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +4 -4
- package/node_modules/@aws-sdk/core/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +1 -1
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlCodec.d.ts +1 -1
- package/node_modules/@aws-sdk/core/package.json +1 -1
- package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +38 -73
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +194 -259
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +72 -132
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +71 -107
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +176 -249
- package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js +14 -0
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +16 -25
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +170 -203
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +2 -2
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +583 -858
- package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +795 -928
- package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +147 -222
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +50 -94
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
- package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +5 -3
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +32 -30
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +133 -202
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +126 -34
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +3 -3
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -2
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +19 -17
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +4 -4
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +5 -6
- package/node_modules/@smithy/core/dist-es/submodules/schema/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +82 -176
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +22 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +110 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +4 -26
- package/node_modules/@smithy/core/dist-types/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +2 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
- package/node_modules/@smithy/core/package.json +3 -3
- package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +2 -2
- package/node_modules/@smithy/smithy-client/package.json +4 -4
- package/node_modules/@smithy/util-base64/dist-cjs/constants.browser.js +9 -32
- package/node_modules/@smithy/util-base64/dist-es/constants.browser.js +9 -28
- package/node_modules/@smithy/util-base64/dist-types/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/dist-types/ts3.4/constants.browser.d.ts +5 -6
- package/node_modules/@smithy/util-base64/package.json +1 -1
- package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +8 -6
- package/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js +8 -6
- package/node_modules/@smithy/util-body-length-node/package.json +1 -1
- package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +11 -9
- package/node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js +11 -8
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -3
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/node_modules/@smithy/util-stream/dist-cjs/index.js +3 -5
- package/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js +3 -5
- package/node_modules/@smithy/util-stream/dist-types/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
- package/node_modules/@smithy/util-stream/package.json +3 -3
- package/package.json +3 -3
|
@@ -269,7 +269,7 @@ const parseRfc3339DateTime = (value) => {
|
|
|
269
269
|
const day = parseDateValue(dayStr, "day", 1, 31);
|
|
270
270
|
return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
|
|
271
271
|
};
|
|
272
|
-
const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
|
|
272
|
+
const RFC3339_WITH_OFFSET$1 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/);
|
|
273
273
|
const parseRfc3339DateTimeWithOffset = (value) => {
|
|
274
274
|
if (value === null || value === undefined) {
|
|
275
275
|
return undefined;
|
|
@@ -277,7 +277,7 @@ const parseRfc3339DateTimeWithOffset = (value) => {
|
|
|
277
277
|
if (typeof value !== "string") {
|
|
278
278
|
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
|
279
279
|
}
|
|
280
|
-
const match = RFC3339_WITH_OFFSET.exec(value);
|
|
280
|
+
const match = RFC3339_WITH_OFFSET$1.exec(value);
|
|
281
281
|
if (!match) {
|
|
282
282
|
throw new TypeError("Invalid RFC-3339 date-time value");
|
|
283
283
|
}
|
|
@@ -291,9 +291,9 @@ const parseRfc3339DateTimeWithOffset = (value) => {
|
|
|
291
291
|
}
|
|
292
292
|
return date;
|
|
293
293
|
};
|
|
294
|
-
const IMF_FIXDATE = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
|
|
295
|
-
const RFC_850_DATE = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
|
|
296
|
-
const ASC_TIME = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
|
|
294
|
+
const IMF_FIXDATE$1 = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
|
|
295
|
+
const RFC_850_DATE$1 = new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/);
|
|
296
|
+
const ASC_TIME$1 = new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/);
|
|
297
297
|
const parseRfc7231DateTime = (value) => {
|
|
298
298
|
if (value === null || value === undefined) {
|
|
299
299
|
return undefined;
|
|
@@ -301,12 +301,12 @@ const parseRfc7231DateTime = (value) => {
|
|
|
301
301
|
if (typeof value !== "string") {
|
|
302
302
|
throw new TypeError("RFC-7231 date-times must be expressed as strings");
|
|
303
303
|
}
|
|
304
|
-
let match = IMF_FIXDATE.exec(value);
|
|
304
|
+
let match = IMF_FIXDATE$1.exec(value);
|
|
305
305
|
if (match) {
|
|
306
306
|
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
|
307
307
|
return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
|
|
308
308
|
}
|
|
309
|
-
match = RFC_850_DATE.exec(value);
|
|
309
|
+
match = RFC_850_DATE$1.exec(value);
|
|
310
310
|
if (match) {
|
|
311
311
|
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
|
312
312
|
return adjustRfc850Year(buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
|
|
@@ -316,7 +316,7 @@ const parseRfc7231DateTime = (value) => {
|
|
|
316
316
|
fractionalMilliseconds,
|
|
317
317
|
}));
|
|
318
318
|
}
|
|
319
|
-
match = ASC_TIME.exec(value);
|
|
319
|
+
match = ASC_TIME$1.exec(value);
|
|
320
320
|
if (match) {
|
|
321
321
|
const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
|
|
322
322
|
return buildDate(strictParseShort(stripLeadingZeroes(yearStr)), parseMonthByShortName(monthStr), parseDateValue(dayStr.trimLeft(), "day", 1, 31), { hours, minutes, seconds, fractionalMilliseconds });
|
|
@@ -457,6 +457,117 @@ function quoteHeader(part) {
|
|
|
457
457
|
return part;
|
|
458
458
|
}
|
|
459
459
|
|
|
460
|
+
const ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;
|
|
461
|
+
const mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;
|
|
462
|
+
const time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`;
|
|
463
|
+
const date = `(\\d?\\d)`;
|
|
464
|
+
const year = `(\\d{4})`;
|
|
465
|
+
const RFC3339_WITH_OFFSET = new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/);
|
|
466
|
+
const IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);
|
|
467
|
+
const RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`);
|
|
468
|
+
const ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`);
|
|
469
|
+
const months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
470
|
+
const _parseEpochTimestamp = (value) => {
|
|
471
|
+
if (value == null) {
|
|
472
|
+
return void 0;
|
|
473
|
+
}
|
|
474
|
+
let num = NaN;
|
|
475
|
+
if (typeof value === "number") {
|
|
476
|
+
num = value;
|
|
477
|
+
}
|
|
478
|
+
else if (typeof value === "string") {
|
|
479
|
+
if (!/^-?\d*\.?\d+$/.test(value)) {
|
|
480
|
+
throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);
|
|
481
|
+
}
|
|
482
|
+
num = Number.parseFloat(value);
|
|
483
|
+
}
|
|
484
|
+
else if (typeof value === "object" && value.tag === 1) {
|
|
485
|
+
num = value.value;
|
|
486
|
+
}
|
|
487
|
+
if (isNaN(num) || Math.abs(num) === Infinity) {
|
|
488
|
+
throw new TypeError("Epoch timestamps must be valid finite numbers.");
|
|
489
|
+
}
|
|
490
|
+
return new Date(Math.round(num * 1000));
|
|
491
|
+
};
|
|
492
|
+
const _parseRfc3339DateTimeWithOffset = (value) => {
|
|
493
|
+
if (value == null) {
|
|
494
|
+
return void 0;
|
|
495
|
+
}
|
|
496
|
+
if (typeof value !== "string") {
|
|
497
|
+
throw new TypeError("RFC3339 timestamps must be strings");
|
|
498
|
+
}
|
|
499
|
+
const matches = RFC3339_WITH_OFFSET.exec(value);
|
|
500
|
+
if (!matches) {
|
|
501
|
+
throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
|
|
502
|
+
}
|
|
503
|
+
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
|
|
504
|
+
range(monthStr, 1, 12);
|
|
505
|
+
range(dayStr, 1, 31);
|
|
506
|
+
range(hours, 0, 23);
|
|
507
|
+
range(minutes, 0, 59);
|
|
508
|
+
range(seconds, 0, 60);
|
|
509
|
+
const date = new Date();
|
|
510
|
+
date.setUTCFullYear(Number(yearStr), Number(monthStr) - 1, Number(dayStr));
|
|
511
|
+
date.setUTCHours(Number(hours));
|
|
512
|
+
date.setUTCMinutes(Number(minutes));
|
|
513
|
+
date.setUTCSeconds(Number(seconds));
|
|
514
|
+
date.setUTCMilliseconds(Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1000) : 0);
|
|
515
|
+
if (offsetStr.toUpperCase() != "Z") {
|
|
516
|
+
const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0];
|
|
517
|
+
const scalar = sign === "-" ? 1 : -1;
|
|
518
|
+
date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1000 + Number(offsetM) * 60 * 1000));
|
|
519
|
+
}
|
|
520
|
+
return date;
|
|
521
|
+
};
|
|
522
|
+
const _parseRfc7231DateTime = (value) => {
|
|
523
|
+
if (value == null) {
|
|
524
|
+
return void 0;
|
|
525
|
+
}
|
|
526
|
+
if (typeof value !== "string") {
|
|
527
|
+
throw new TypeError("RFC7231 timestamps must be strings.");
|
|
528
|
+
}
|
|
529
|
+
let day;
|
|
530
|
+
let month;
|
|
531
|
+
let year;
|
|
532
|
+
let hour;
|
|
533
|
+
let minute;
|
|
534
|
+
let second;
|
|
535
|
+
let fraction;
|
|
536
|
+
let matches;
|
|
537
|
+
if ((matches = IMF_FIXDATE.exec(value))) {
|
|
538
|
+
[, day, month, year, hour, minute, second, fraction] = matches;
|
|
539
|
+
}
|
|
540
|
+
else if ((matches = RFC_850_DATE.exec(value))) {
|
|
541
|
+
[, day, month, year, hour, minute, second, fraction] = matches;
|
|
542
|
+
year = (Number(year) + 1900).toString();
|
|
543
|
+
}
|
|
544
|
+
else if ((matches = ASC_TIME.exec(value))) {
|
|
545
|
+
[, month, day, hour, minute, second, fraction, year] = matches;
|
|
546
|
+
}
|
|
547
|
+
if (year && second) {
|
|
548
|
+
const date = new Date();
|
|
549
|
+
date.setUTCFullYear(Number(year));
|
|
550
|
+
date.setUTCMonth(months.indexOf(month));
|
|
551
|
+
range(day, 1, 31);
|
|
552
|
+
date.setUTCDate(Number(day));
|
|
553
|
+
range(hour, 0, 23);
|
|
554
|
+
date.setUTCHours(Number(hour));
|
|
555
|
+
range(minute, 0, 59);
|
|
556
|
+
date.setUTCMinutes(Number(minute));
|
|
557
|
+
range(second, 0, 60);
|
|
558
|
+
date.setUTCSeconds(Number(second));
|
|
559
|
+
date.setUTCMilliseconds(fraction ? Math.round(parseFloat(`0.${fraction}`) * 1000) : 0);
|
|
560
|
+
return date;
|
|
561
|
+
}
|
|
562
|
+
throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);
|
|
563
|
+
};
|
|
564
|
+
function range(v, min, max) {
|
|
565
|
+
const _v = Number(v);
|
|
566
|
+
if (_v < min || _v > max) {
|
|
567
|
+
throw new Error(`Value ${_v} out of range [${min}, ${max}]`);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
|
|
460
571
|
function splitEvery(value, delimiter, numDelimiters) {
|
|
461
572
|
if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {
|
|
462
573
|
throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
|
|
@@ -522,28 +633,15 @@ const splitHeader = (value) => {
|
|
|
522
633
|
});
|
|
523
634
|
};
|
|
524
635
|
|
|
636
|
+
const format = /^-?\d*(\.\d+)?$/;
|
|
525
637
|
class NumericValue {
|
|
526
638
|
string;
|
|
527
639
|
type;
|
|
528
640
|
constructor(string, type) {
|
|
529
641
|
this.string = string;
|
|
530
642
|
this.type = type;
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
const char = string.charCodeAt(i);
|
|
534
|
-
if (i === 0 && char === 45) {
|
|
535
|
-
continue;
|
|
536
|
-
}
|
|
537
|
-
if (char === 46) {
|
|
538
|
-
if (dot) {
|
|
539
|
-
throw new Error("@smithy/core/serde - NumericValue must contain at most one decimal point.");
|
|
540
|
-
}
|
|
541
|
-
dot = 1;
|
|
542
|
-
continue;
|
|
543
|
-
}
|
|
544
|
-
if (char < 48 || char > 57) {
|
|
545
|
-
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
546
|
-
}
|
|
643
|
+
if (!format.test(string)) {
|
|
644
|
+
throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
547
645
|
}
|
|
548
646
|
}
|
|
549
647
|
toString() {
|
|
@@ -554,16 +652,7 @@ class NumericValue {
|
|
|
554
652
|
return false;
|
|
555
653
|
}
|
|
556
654
|
const _nv = object;
|
|
557
|
-
|
|
558
|
-
if (prototypeMatch) {
|
|
559
|
-
return prototypeMatch;
|
|
560
|
-
}
|
|
561
|
-
if (typeof _nv.string === "string" &&
|
|
562
|
-
typeof _nv.type === "string" &&
|
|
563
|
-
_nv.constructor?.name?.endsWith("NumericValue")) {
|
|
564
|
-
return true;
|
|
565
|
-
}
|
|
566
|
-
return prototypeMatch;
|
|
655
|
+
return NumericValue.prototype.isPrototypeOf(object) || (_nv.type === "bigDecimal" && format.test(_nv.string));
|
|
567
656
|
}
|
|
568
657
|
}
|
|
569
658
|
function nv(input) {
|
|
@@ -576,6 +665,9 @@ Object.defineProperty(exports, "generateIdempotencyToken", {
|
|
|
576
665
|
});
|
|
577
666
|
exports.LazyJsonString = LazyJsonString;
|
|
578
667
|
exports.NumericValue = NumericValue;
|
|
668
|
+
exports._parseEpochTimestamp = _parseEpochTimestamp;
|
|
669
|
+
exports._parseRfc3339DateTimeWithOffset = _parseRfc3339DateTimeWithOffset;
|
|
670
|
+
exports._parseRfc7231DateTime = _parseRfc7231DateTime;
|
|
579
671
|
exports.copyDocumentWithTransform = copyDocumentWithTransform;
|
|
580
672
|
exports.dateToUtcString = dateToUtcString;
|
|
581
673
|
exports.expectBoolean = expectBoolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
-
import {
|
|
2
|
+
import { _parseEpochTimestamp, generateIdempotencyToken } from "@smithy/core/serde";
|
|
3
3
|
import { fromBase64 } from "@smithy/util-base64";
|
|
4
4
|
import { cbor } from "./cbor";
|
|
5
5
|
import { dateToTag } from "./parseCborBody";
|
|
@@ -110,7 +110,7 @@ export class CborShapeDeserializer {
|
|
|
110
110
|
readValue(_schema, value) {
|
|
111
111
|
const ns = NormalizedSchema.of(_schema);
|
|
112
112
|
if (ns.isTimestampSchema() && typeof value === "number") {
|
|
113
|
-
return
|
|
113
|
+
return _parseEpochTimestamp(value);
|
|
114
114
|
}
|
|
115
115
|
if (ns.isBlobSchema()) {
|
|
116
116
|
if (typeof value === "string") {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SCHEMA } from "@smithy/core/schema";
|
|
2
1
|
import { fromUtf8 } from "@smithy/util-utf8";
|
|
3
2
|
export class EventStreamSerde {
|
|
4
3
|
marshaller;
|
|
@@ -128,12 +127,15 @@ export class EventStreamSerde {
|
|
|
128
127
|
let eventType = unionMember;
|
|
129
128
|
let explicitPayloadMember = null;
|
|
130
129
|
let explicitPayloadContentType;
|
|
131
|
-
const isKnownSchema =
|
|
130
|
+
const isKnownSchema = (() => {
|
|
131
|
+
const struct = unionSchema.getSchema();
|
|
132
|
+
return struct.memberNames.includes(unionMember);
|
|
133
|
+
})();
|
|
132
134
|
const additionalHeaders = {};
|
|
133
135
|
if (!isKnownSchema) {
|
|
134
136
|
const [type, value] = event[unionMember];
|
|
135
137
|
eventType = type;
|
|
136
|
-
serializer.write(
|
|
138
|
+
serializer.write(15, value);
|
|
137
139
|
}
|
|
138
140
|
else {
|
|
139
141
|
const eventSchema = unionSchema.getMemberSchema(unionMember);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedSchema,
|
|
1
|
+
import { NormalizedSchema, translateTraits } from "@smithy/core/schema";
|
|
2
2
|
import { splitEvery, splitHeader } from "@smithy/core/serde";
|
|
3
3
|
import { HttpRequest } from "@smithy/protocol-http";
|
|
4
4
|
import { sdkStreamMixin } from "@smithy/util-stream";
|
|
@@ -31,7 +31,7 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
31
31
|
if (endpoint) {
|
|
32
32
|
this.updateServiceEndpoint(request, endpoint);
|
|
33
33
|
this.setHostPrefix(request, operationSchema, input);
|
|
34
|
-
const opTraits =
|
|
34
|
+
const opTraits = translateTraits(operationSchema.traits);
|
|
35
35
|
if (opTraits.http) {
|
|
36
36
|
request.method = opTraits.http[0];
|
|
37
37
|
const [path, search] = opTraits.http[1].split("?");
|
|
@@ -155,7 +155,7 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
155
155
|
if (response.statusCode >= 300) {
|
|
156
156
|
const bytes = await collectBody(response.body, context);
|
|
157
157
|
if (bytes.byteLength > 0) {
|
|
158
|
-
Object.assign(dataObject, await deserializer.read(
|
|
158
|
+
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
159
159
|
}
|
|
160
160
|
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
161
161
|
throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
|
|
@@ -221,7 +221,7 @@ export class HttpBindingProtocol extends HttpProtocol {
|
|
|
221
221
|
headerListValueSchema.getMergedTraits().httpHeader = key;
|
|
222
222
|
let sections;
|
|
223
223
|
if (headerListValueSchema.isTimestampSchema() &&
|
|
224
|
-
headerListValueSchema.getSchema() ===
|
|
224
|
+
headerListValueSchema.getSchema() === 4) {
|
|
225
225
|
sections = splitEvery(value, ",", 2);
|
|
226
226
|
}
|
|
227
227
|
else {
|
|
@@ -29,10 +29,10 @@ export class HttpProtocol {
|
|
|
29
29
|
request.fragment = endpoint.url.hash || void 0;
|
|
30
30
|
request.username = endpoint.url.username || void 0;
|
|
31
31
|
request.password = endpoint.url.password || void 0;
|
|
32
|
+
if (!request.query) {
|
|
33
|
+
request.query = {};
|
|
34
|
+
}
|
|
32
35
|
for (const [k, v] of endpoint.url.searchParams.entries()) {
|
|
33
|
-
if (!request.query) {
|
|
34
|
-
request.query = {};
|
|
35
|
-
}
|
|
36
36
|
request.query[k] = v;
|
|
37
37
|
}
|
|
38
38
|
return request;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedSchema
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
2
|
import { HttpRequest } from "@smithy/protocol-http";
|
|
3
3
|
import { collectBody } from "./collect-stream-body";
|
|
4
4
|
import { HttpProtocol } from "./HttpProtocol";
|
|
@@ -64,7 +64,7 @@ export class RpcProtocol extends HttpProtocol {
|
|
|
64
64
|
if (response.statusCode >= 300) {
|
|
65
65
|
const bytes = await collectBody(response.body, context);
|
|
66
66
|
if (bytes.byteLength > 0) {
|
|
67
|
-
Object.assign(dataObject, await deserializer.read(
|
|
67
|
+
Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
68
68
|
}
|
|
69
69
|
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
70
70
|
throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
|
package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NormalizedSchema
|
|
2
|
-
import {
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
|
+
import { _parseEpochTimestamp, _parseRfc3339DateTimeWithOffset, _parseRfc7231DateTime, LazyJsonString, NumericValue, splitHeader, } from "@smithy/core/serde";
|
|
3
3
|
import { fromBase64 } from "@smithy/util-base64";
|
|
4
4
|
import { toUtf8 } from "@smithy/util-utf8";
|
|
5
5
|
import { determineTimestampFormat } from "./determineTimestampFormat";
|
|
@@ -23,12 +23,12 @@ export class FromStringShapeDeserializer {
|
|
|
23
23
|
if (ns.isTimestampSchema()) {
|
|
24
24
|
const format = determineTimestampFormat(ns, this.settings);
|
|
25
25
|
switch (format) {
|
|
26
|
-
case
|
|
27
|
-
return
|
|
28
|
-
case
|
|
29
|
-
return
|
|
30
|
-
case
|
|
31
|
-
return
|
|
26
|
+
case 5:
|
|
27
|
+
return _parseRfc3339DateTimeWithOffset(data);
|
|
28
|
+
case 6:
|
|
29
|
+
return _parseRfc7231DateTime(data);
|
|
30
|
+
case 7:
|
|
31
|
+
return _parseEpochTimestamp(data);
|
|
32
32
|
default:
|
|
33
33
|
console.warn("Missing timestamp format, parsing value with Date constructor:", data);
|
|
34
34
|
return new Date(data);
|
|
@@ -48,15 +48,17 @@ export class FromStringShapeDeserializer {
|
|
|
48
48
|
return intermediateValue;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
if (ns.isNumericSchema()) {
|
|
52
|
+
return Number(data);
|
|
53
|
+
}
|
|
54
|
+
if (ns.isBigIntegerSchema()) {
|
|
55
|
+
return BigInt(data);
|
|
56
|
+
}
|
|
57
|
+
if (ns.isBigDecimalSchema()) {
|
|
58
|
+
return new NumericValue(data, "bigDecimal");
|
|
59
|
+
}
|
|
60
|
+
if (ns.isBooleanSchema()) {
|
|
61
|
+
return String(data).toLowerCase() === "true";
|
|
60
62
|
}
|
|
61
63
|
return data;
|
|
62
64
|
}
|
package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedSchema
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
|
2
2
|
import { dateToUtcString, LazyJsonString, quoteHeader } from "@smithy/core/serde";
|
|
3
3
|
import { toBase64 } from "@smithy/util-base64";
|
|
4
4
|
import { determineTimestampFormat } from "./determineTimestampFormat";
|
|
@@ -26,13 +26,13 @@ export class ToStringShapeSerializer {
|
|
|
26
26
|
}
|
|
27
27
|
const format = determineTimestampFormat(ns, this.settings);
|
|
28
28
|
switch (format) {
|
|
29
|
-
case
|
|
29
|
+
case 5:
|
|
30
30
|
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
31
31
|
break;
|
|
32
|
-
case
|
|
32
|
+
case 6:
|
|
33
33
|
this.stringBuffer = dateToUtcString(value);
|
|
34
34
|
break;
|
|
35
|
-
case
|
|
35
|
+
case 7:
|
|
36
36
|
this.stringBuffer = String(value.getTime() / 1000);
|
|
37
37
|
break;
|
|
38
38
|
default:
|
package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { SCHEMA } from "@smithy/core/schema";
|
|
2
1
|
export function determineTimestampFormat(ns, settings) {
|
|
3
2
|
if (settings.timestampFormat.useTrait) {
|
|
4
3
|
if (ns.isTimestampSchema() &&
|
|
5
|
-
(ns.getSchema() ===
|
|
6
|
-
ns.getSchema() ===
|
|
7
|
-
ns.getSchema() ===
|
|
4
|
+
(ns.getSchema() === 5 ||
|
|
5
|
+
ns.getSchema() === 6 ||
|
|
6
|
+
ns.getSchema() === 7)) {
|
|
8
7
|
return ns.getSchema();
|
|
9
8
|
}
|
|
10
9
|
}
|
|
11
10
|
const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
|
|
12
11
|
const bindingFormat = settings.httpBindings
|
|
13
12
|
? typeof httpPrefixHeaders === "string" || Boolean(httpHeader)
|
|
14
|
-
?
|
|
13
|
+
? 6
|
|
15
14
|
: Boolean(httpQuery) || Boolean(httpLabel)
|
|
16
|
-
?
|
|
15
|
+
? 5
|
|
17
16
|
: undefined
|
|
18
17
|
: undefined;
|
|
19
18
|
return bindingFormat ?? settings.timestampFormat.default;
|