@cdk8s/awscdk-resolver 0.0.297 → 0.0.299
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/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +5 -5
- package/node_modules/@aws-sdk/client-sso/package.json +4 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +2 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/httpAuthSchemes/index.js +1 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/httpAuthSchemes/index.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +1 -1
- 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/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
- package/node_modules/@aws-sdk/token-providers/README.md +9 -0
- package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +18 -1
- package/node_modules/@aws-sdk/token-providers/dist-es/fromEnvSigningName.js +13 -0
- package/node_modules/@aws-sdk/token-providers/dist-es/index.js +1 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/fromEnvSigningName.d.ts +18 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/index.d.ts +1 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/fromEnvSigningName.d.ts +11 -0
- package/node_modules/@aws-sdk/token-providers/dist-types/ts3.4/index.d.ts +1 -0
- package/node_modules/@aws-sdk/token-providers/package.json +3 -2
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/resolveCustomEndpointsConfig.d.ts +5 -0
- package/node_modules/@smithy/config-resolver/dist-types/endpointsConfig/resolveEndpointsConfig.d.ts +3 -0
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/EndpointVariant.d.ts +3 -2
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/EndpointVariantTag.d.ts +4 -1
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/PartitionHash.d.ts +3 -2
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/RegionHash.d.ts +3 -2
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/getHostnameFromVariants.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/getRegionInfo.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/getResolvedHostname.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/getResolvedPartition.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/regionInfo/getResolvedSigningRegion.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/resolveCustomEndpointsConfig.d.ts +5 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/endpointsConfig/resolveEndpointsConfig.d.ts +3 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariant.d.ts +3 -2
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/EndpointVariantTag.d.ts +4 -1
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/PartitionHash.d.ts +3 -2
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/RegionHash.d.ts +3 -2
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/getHostnameFromVariants.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/getRegionInfo.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/getResolvedHostname.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/getResolvedPartition.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/dist-types/ts3.4/regionInfo/getResolvedSigningRegion.d.ts +2 -0
- package/node_modules/@smithy/config-resolver/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +3 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +625 -2
- package/node_modules/@smithy/core/dist-es/submodules/cbor/parseCborBody.js +3 -2
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +6 -0
- package/node_modules/@smithy/core/package.json +7 -6
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/dist-types/fetch-http-handler.d.ts +1 -1
- package/node_modules/@smithy/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts +1 -1
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/dist-cjs/index.js +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/package.json +8 -8
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +0 -2
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-manager.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/node-http2-connection-pool.d.ts +1 -2
- package/node_modules/@smithy/node-http-handler/dist-types/readable.mock.d.ts +0 -3
- package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +0 -7
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/collector.d.ts +0 -3
- package/node_modules/@smithy/node-http-handler/dist-types/stream-collector/readable.mock.d.ts +0 -3
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-manager.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-connection-pool.d.ts +1 -2
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/readable.mock.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/collector.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/stream-collector/readable.mock.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/write-request-body.d.ts +0 -1
- package/node_modules/@smithy/node-http-handler/dist-types/write-request-body.d.ts +0 -2
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/dist-types/chain.d.ts +1 -1
- package/node_modules/@smithy/property-provider/dist-types/ts3.4/chain.d.ts +1 -1
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/dist-types/extensions/httpExtensionConfiguration.d.ts +3 -7
- package/node_modules/@smithy/protocol-http/dist-types/ts3.4/extensions/httpExtensionConfiguration.d.ts +3 -7
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +4 -4
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +32 -617
- package/node_modules/@smithy/smithy-client/dist-es/index.js +1 -6
- package/node_modules/@smithy/smithy-client/dist-types/index.d.ts +1 -6
- package/node_modules/@smithy/smithy-client/dist-types/ts3.4/index.d.ts +1 -6
- package/node_modules/@smithy/smithy-client/package.json +8 -8
- package/node_modules/@smithy/types/dist-cjs/schema/schema.js +1 -0
- package/node_modules/@smithy/types/dist-cjs/schema/sentinels.js +1 -0
- package/node_modules/@smithy/types/dist-cjs/schema/traits.js +1 -0
- package/node_modules/@smithy/types/dist-cjs/transform/mutable.js +1 -0
- package/node_modules/@smithy/types/dist-es/index.js +3 -0
- package/node_modules/@smithy/types/dist-es/schema/schema.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/sentinels.js +1 -0
- package/node_modules/@smithy/types/dist-es/schema/traits.js +1 -0
- package/node_modules/@smithy/types/dist-es/transform/mutable.js +1 -0
- package/node_modules/@smithy/types/dist-types/blob/blob-payload-input-types.d.ts +0 -3
- package/node_modules/@smithy/types/dist-types/command.d.ts +2 -0
- package/node_modules/@smithy/types/dist-types/http/httpHandlerInitialization.d.ts +0 -2
- package/node_modules/@smithy/types/dist-types/index.d.ts +3 -0
- package/node_modules/@smithy/types/dist-types/schema/schema.d.ts +263 -0
- package/node_modules/@smithy/types/dist-types/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/types/dist-types/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/types/dist-types/serde.d.ts +2 -0
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-common-types.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-input-types.d.ts +0 -3
- package/node_modules/@smithy/types/dist-types/streaming-payload/streaming-blob-payload-output-types.d.ts +0 -2
- package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +0 -2
- package/node_modules/@smithy/types/dist-types/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/blob/blob-payload-input-types.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +2 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/http/httpHandlerInitialization.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/index.d.ts +3 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +278 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/sentinels.d.ts +65 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/traits.d.ts +46 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/serde.d.ts +2 -0
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-common-types.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-input-types.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/streaming-payload/streaming-blob-payload-output-types.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +0 -1
- package/node_modules/@smithy/types/dist-types/ts3.4/transform/mutable.d.ts +6 -0
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/dist-types/defaultRetryToken.d.ts +1 -1
- package/node_modules/@smithy/util-retry/dist-types/ts3.4/defaultRetryToken.d.ts +1 -1
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/dist-cjs/checksum/createChecksumStream.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadable.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/createBufferedReadableStream.js +6 -6
- package/node_modules/@smithy/util-stream/dist-cjs/headStream.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/splitStream.browser.js +1 -2
- package/node_modules/@smithy/util-stream/dist-cjs/splitStream.js +1 -2
- package/node_modules/@smithy/util-stream/dist-types/ByteArrayCollector.d.ts +1 -1
- package/node_modules/@smithy/util-stream/dist-types/checksum/ChecksumStream.d.ts +0 -3
- package/node_modules/@smithy/util-stream/dist-types/checksum/createChecksumStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/createBufferedReadable.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/getAwsChunkedEncodingStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/splitStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/ByteArrayCollector.d.ts +1 -1
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/checksum/ChecksumStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/checksum/createChecksumStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/createBufferedReadable.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/getAwsChunkedEncodingStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/dist-types/ts3.4/splitStream.d.ts +0 -1
- package/node_modules/@smithy/util-stream/package.json +4 -4
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/package.json +5 -5
- package/node_modules/@smithy/smithy-client/dist-cjs/date-utils.js +0 -1
- package/node_modules/@smithy/smithy-client/dist-cjs/lazy-json.js +0 -1
- package/node_modules/@smithy/smithy-client/dist-cjs/parse-utils.js +0 -1
- package/node_modules/@smithy/smithy-client/dist-cjs/quote-header.js +0 -1
- package/node_modules/@smithy/smithy-client/dist-cjs/split-every.js +0 -1
- package/node_modules/@smithy/smithy-client/dist-cjs/split-header.js +0 -1
- /package/node_modules/@smithy/{smithy-client/dist-es → core/dist-es/submodules/serde}/date-utils.js +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-es → core/dist-es/submodules/serde}/lazy-json.js +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-es → core/dist-es/submodules/serde}/parse-utils.js +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-es → core/dist-es/submodules/serde}/quote-header.js +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-es → core/dist-es/submodules/serde}/split-every.js +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-es → core/dist-es/submodules/serde}/split-header.js +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types → core/dist-types/submodules/serde}/date-utils.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types → core/dist-types/submodules/serde}/lazy-json.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types → core/dist-types/submodules/serde}/parse-utils.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types → core/dist-types/submodules/serde}/quote-header.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types → core/dist-types/submodules/serde}/split-every.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types → core/dist-types/submodules/serde}/split-header.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/serde}/date-utils.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/serde}/lazy-json.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/serde}/parse-utils.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/serde}/quote-header.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/serde}/split-every.d.ts +0 -0
- /package/node_modules/@smithy/{smithy-client/dist-types/ts3.4 → core/dist-types/ts3.4/submodules/serde}/split-header.d.ts +0 -0
@@ -19,11 +19,546 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
19
19
|
// src/submodules/serde/index.ts
|
20
20
|
var serde_exports = {};
|
21
21
|
__export(serde_exports, {
|
22
|
+
LazyJsonString: () => LazyJsonString,
|
22
23
|
NumericValue: () => NumericValue,
|
23
|
-
|
24
|
+
dateToUtcString: () => dateToUtcString,
|
25
|
+
expectBoolean: () => expectBoolean,
|
26
|
+
expectByte: () => expectByte,
|
27
|
+
expectFloat32: () => expectFloat32,
|
28
|
+
expectInt: () => expectInt,
|
29
|
+
expectInt32: () => expectInt32,
|
30
|
+
expectLong: () => expectLong,
|
31
|
+
expectNonNull: () => expectNonNull,
|
32
|
+
expectNumber: () => expectNumber,
|
33
|
+
expectObject: () => expectObject,
|
34
|
+
expectShort: () => expectShort,
|
35
|
+
expectString: () => expectString,
|
36
|
+
expectUnion: () => expectUnion,
|
37
|
+
handleFloat: () => handleFloat,
|
38
|
+
limitedParseDouble: () => limitedParseDouble,
|
39
|
+
limitedParseFloat: () => limitedParseFloat,
|
40
|
+
limitedParseFloat32: () => limitedParseFloat32,
|
41
|
+
logger: () => logger,
|
42
|
+
nv: () => nv,
|
43
|
+
parseBoolean: () => parseBoolean,
|
44
|
+
parseEpochTimestamp: () => parseEpochTimestamp,
|
45
|
+
parseRfc3339DateTime: () => parseRfc3339DateTime,
|
46
|
+
parseRfc3339DateTimeWithOffset: () => parseRfc3339DateTimeWithOffset,
|
47
|
+
parseRfc7231DateTime: () => parseRfc7231DateTime,
|
48
|
+
quoteHeader: () => quoteHeader,
|
49
|
+
splitEvery: () => splitEvery,
|
50
|
+
splitHeader: () => splitHeader,
|
51
|
+
strictParseByte: () => strictParseByte,
|
52
|
+
strictParseDouble: () => strictParseDouble,
|
53
|
+
strictParseFloat: () => strictParseFloat,
|
54
|
+
strictParseFloat32: () => strictParseFloat32,
|
55
|
+
strictParseInt: () => strictParseInt,
|
56
|
+
strictParseInt32: () => strictParseInt32,
|
57
|
+
strictParseLong: () => strictParseLong,
|
58
|
+
strictParseShort: () => strictParseShort
|
24
59
|
});
|
25
60
|
module.exports = __toCommonJS(serde_exports);
|
26
61
|
|
62
|
+
// src/submodules/serde/parse-utils.ts
|
63
|
+
var parseBoolean = (value) => {
|
64
|
+
switch (value) {
|
65
|
+
case "true":
|
66
|
+
return true;
|
67
|
+
case "false":
|
68
|
+
return false;
|
69
|
+
default:
|
70
|
+
throw new Error(`Unable to parse boolean value "${value}"`);
|
71
|
+
}
|
72
|
+
};
|
73
|
+
var expectBoolean = (value) => {
|
74
|
+
if (value === null || value === void 0) {
|
75
|
+
return void 0;
|
76
|
+
}
|
77
|
+
if (typeof value === "number") {
|
78
|
+
if (value === 0 || value === 1) {
|
79
|
+
logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
|
80
|
+
}
|
81
|
+
if (value === 0) {
|
82
|
+
return false;
|
83
|
+
}
|
84
|
+
if (value === 1) {
|
85
|
+
return true;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
if (typeof value === "string") {
|
89
|
+
const lower = value.toLowerCase();
|
90
|
+
if (lower === "false" || lower === "true") {
|
91
|
+
logger.warn(stackTraceWarning(`Expected boolean, got ${typeof value}: ${value}`));
|
92
|
+
}
|
93
|
+
if (lower === "false") {
|
94
|
+
return false;
|
95
|
+
}
|
96
|
+
if (lower === "true") {
|
97
|
+
return true;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
if (typeof value === "boolean") {
|
101
|
+
return value;
|
102
|
+
}
|
103
|
+
throw new TypeError(`Expected boolean, got ${typeof value}: ${value}`);
|
104
|
+
};
|
105
|
+
var expectNumber = (value) => {
|
106
|
+
if (value === null || value === void 0) {
|
107
|
+
return void 0;
|
108
|
+
}
|
109
|
+
if (typeof value === "string") {
|
110
|
+
const parsed = parseFloat(value);
|
111
|
+
if (!Number.isNaN(parsed)) {
|
112
|
+
if (String(parsed) !== String(value)) {
|
113
|
+
logger.warn(stackTraceWarning(`Expected number but observed string: ${value}`));
|
114
|
+
}
|
115
|
+
return parsed;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
if (typeof value === "number") {
|
119
|
+
return value;
|
120
|
+
}
|
121
|
+
throw new TypeError(`Expected number, got ${typeof value}: ${value}`);
|
122
|
+
};
|
123
|
+
var MAX_FLOAT = Math.ceil(2 ** 127 * (2 - 2 ** -23));
|
124
|
+
var expectFloat32 = (value) => {
|
125
|
+
const expected = expectNumber(value);
|
126
|
+
if (expected !== void 0 && !Number.isNaN(expected) && expected !== Infinity && expected !== -Infinity) {
|
127
|
+
if (Math.abs(expected) > MAX_FLOAT) {
|
128
|
+
throw new TypeError(`Expected 32-bit float, got ${value}`);
|
129
|
+
}
|
130
|
+
}
|
131
|
+
return expected;
|
132
|
+
};
|
133
|
+
var expectLong = (value) => {
|
134
|
+
if (value === null || value === void 0) {
|
135
|
+
return void 0;
|
136
|
+
}
|
137
|
+
if (Number.isInteger(value) && !Number.isNaN(value)) {
|
138
|
+
return value;
|
139
|
+
}
|
140
|
+
throw new TypeError(`Expected integer, got ${typeof value}: ${value}`);
|
141
|
+
};
|
142
|
+
var expectInt = expectLong;
|
143
|
+
var expectInt32 = (value) => expectSizedInt(value, 32);
|
144
|
+
var expectShort = (value) => expectSizedInt(value, 16);
|
145
|
+
var expectByte = (value) => expectSizedInt(value, 8);
|
146
|
+
var expectSizedInt = (value, size) => {
|
147
|
+
const expected = expectLong(value);
|
148
|
+
if (expected !== void 0 && castInt(expected, size) !== expected) {
|
149
|
+
throw new TypeError(`Expected ${size}-bit integer, got ${value}`);
|
150
|
+
}
|
151
|
+
return expected;
|
152
|
+
};
|
153
|
+
var castInt = (value, size) => {
|
154
|
+
switch (size) {
|
155
|
+
case 32:
|
156
|
+
return Int32Array.of(value)[0];
|
157
|
+
case 16:
|
158
|
+
return Int16Array.of(value)[0];
|
159
|
+
case 8:
|
160
|
+
return Int8Array.of(value)[0];
|
161
|
+
}
|
162
|
+
};
|
163
|
+
var expectNonNull = (value, location) => {
|
164
|
+
if (value === null || value === void 0) {
|
165
|
+
if (location) {
|
166
|
+
throw new TypeError(`Expected a non-null value for ${location}`);
|
167
|
+
}
|
168
|
+
throw new TypeError("Expected a non-null value");
|
169
|
+
}
|
170
|
+
return value;
|
171
|
+
};
|
172
|
+
var expectObject = (value) => {
|
173
|
+
if (value === null || value === void 0) {
|
174
|
+
return void 0;
|
175
|
+
}
|
176
|
+
if (typeof value === "object" && !Array.isArray(value)) {
|
177
|
+
return value;
|
178
|
+
}
|
179
|
+
const receivedType = Array.isArray(value) ? "array" : typeof value;
|
180
|
+
throw new TypeError(`Expected object, got ${receivedType}: ${value}`);
|
181
|
+
};
|
182
|
+
var expectString = (value) => {
|
183
|
+
if (value === null || value === void 0) {
|
184
|
+
return void 0;
|
185
|
+
}
|
186
|
+
if (typeof value === "string") {
|
187
|
+
return value;
|
188
|
+
}
|
189
|
+
if (["boolean", "number", "bigint"].includes(typeof value)) {
|
190
|
+
logger.warn(stackTraceWarning(`Expected string, got ${typeof value}: ${value}`));
|
191
|
+
return String(value);
|
192
|
+
}
|
193
|
+
throw new TypeError(`Expected string, got ${typeof value}: ${value}`);
|
194
|
+
};
|
195
|
+
var expectUnion = (value) => {
|
196
|
+
if (value === null || value === void 0) {
|
197
|
+
return void 0;
|
198
|
+
}
|
199
|
+
const asObject = expectObject(value);
|
200
|
+
const setKeys = Object.entries(asObject).filter(([, v]) => v != null).map(([k]) => k);
|
201
|
+
if (setKeys.length === 0) {
|
202
|
+
throw new TypeError(`Unions must have exactly one non-null member. None were found.`);
|
203
|
+
}
|
204
|
+
if (setKeys.length > 1) {
|
205
|
+
throw new TypeError(`Unions must have exactly one non-null member. Keys ${setKeys} were not null.`);
|
206
|
+
}
|
207
|
+
return asObject;
|
208
|
+
};
|
209
|
+
var strictParseDouble = (value) => {
|
210
|
+
if (typeof value == "string") {
|
211
|
+
return expectNumber(parseNumber(value));
|
212
|
+
}
|
213
|
+
return expectNumber(value);
|
214
|
+
};
|
215
|
+
var strictParseFloat = strictParseDouble;
|
216
|
+
var strictParseFloat32 = (value) => {
|
217
|
+
if (typeof value == "string") {
|
218
|
+
return expectFloat32(parseNumber(value));
|
219
|
+
}
|
220
|
+
return expectFloat32(value);
|
221
|
+
};
|
222
|
+
var NUMBER_REGEX = /(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g;
|
223
|
+
var parseNumber = (value) => {
|
224
|
+
const matches = value.match(NUMBER_REGEX);
|
225
|
+
if (matches === null || matches[0].length !== value.length) {
|
226
|
+
throw new TypeError(`Expected real number, got implicit NaN`);
|
227
|
+
}
|
228
|
+
return parseFloat(value);
|
229
|
+
};
|
230
|
+
var limitedParseDouble = (value) => {
|
231
|
+
if (typeof value == "string") {
|
232
|
+
return parseFloatString(value);
|
233
|
+
}
|
234
|
+
return expectNumber(value);
|
235
|
+
};
|
236
|
+
var handleFloat = limitedParseDouble;
|
237
|
+
var limitedParseFloat = limitedParseDouble;
|
238
|
+
var limitedParseFloat32 = (value) => {
|
239
|
+
if (typeof value == "string") {
|
240
|
+
return parseFloatString(value);
|
241
|
+
}
|
242
|
+
return expectFloat32(value);
|
243
|
+
};
|
244
|
+
var parseFloatString = (value) => {
|
245
|
+
switch (value) {
|
246
|
+
case "NaN":
|
247
|
+
return NaN;
|
248
|
+
case "Infinity":
|
249
|
+
return Infinity;
|
250
|
+
case "-Infinity":
|
251
|
+
return -Infinity;
|
252
|
+
default:
|
253
|
+
throw new Error(`Unable to parse float value: ${value}`);
|
254
|
+
}
|
255
|
+
};
|
256
|
+
var strictParseLong = (value) => {
|
257
|
+
if (typeof value === "string") {
|
258
|
+
return expectLong(parseNumber(value));
|
259
|
+
}
|
260
|
+
return expectLong(value);
|
261
|
+
};
|
262
|
+
var strictParseInt = strictParseLong;
|
263
|
+
var strictParseInt32 = (value) => {
|
264
|
+
if (typeof value === "string") {
|
265
|
+
return expectInt32(parseNumber(value));
|
266
|
+
}
|
267
|
+
return expectInt32(value);
|
268
|
+
};
|
269
|
+
var strictParseShort = (value) => {
|
270
|
+
if (typeof value === "string") {
|
271
|
+
return expectShort(parseNumber(value));
|
272
|
+
}
|
273
|
+
return expectShort(value);
|
274
|
+
};
|
275
|
+
var strictParseByte = (value) => {
|
276
|
+
if (typeof value === "string") {
|
277
|
+
return expectByte(parseNumber(value));
|
278
|
+
}
|
279
|
+
return expectByte(value);
|
280
|
+
};
|
281
|
+
var stackTraceWarning = (message) => {
|
282
|
+
return String(new TypeError(message).stack || message).split("\n").slice(0, 5).filter((s) => !s.includes("stackTraceWarning")).join("\n");
|
283
|
+
};
|
284
|
+
var logger = {
|
285
|
+
warn: console.warn
|
286
|
+
};
|
287
|
+
|
288
|
+
// src/submodules/serde/date-utils.ts
|
289
|
+
var DAYS = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
290
|
+
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
291
|
+
function dateToUtcString(date) {
|
292
|
+
const year = date.getUTCFullYear();
|
293
|
+
const month = date.getUTCMonth();
|
294
|
+
const dayOfWeek = date.getUTCDay();
|
295
|
+
const dayOfMonthInt = date.getUTCDate();
|
296
|
+
const hoursInt = date.getUTCHours();
|
297
|
+
const minutesInt = date.getUTCMinutes();
|
298
|
+
const secondsInt = date.getUTCSeconds();
|
299
|
+
const dayOfMonthString = dayOfMonthInt < 10 ? `0${dayOfMonthInt}` : `${dayOfMonthInt}`;
|
300
|
+
const hoursString = hoursInt < 10 ? `0${hoursInt}` : `${hoursInt}`;
|
301
|
+
const minutesString = minutesInt < 10 ? `0${minutesInt}` : `${minutesInt}`;
|
302
|
+
const secondsString = secondsInt < 10 ? `0${secondsInt}` : `${secondsInt}`;
|
303
|
+
return `${DAYS[dayOfWeek]}, ${dayOfMonthString} ${MONTHS[month]} ${year} ${hoursString}:${minutesString}:${secondsString} GMT`;
|
304
|
+
}
|
305
|
+
var RFC3339 = new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/);
|
306
|
+
var parseRfc3339DateTime = (value) => {
|
307
|
+
if (value === null || value === void 0) {
|
308
|
+
return void 0;
|
309
|
+
}
|
310
|
+
if (typeof value !== "string") {
|
311
|
+
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
312
|
+
}
|
313
|
+
const match = RFC3339.exec(value);
|
314
|
+
if (!match) {
|
315
|
+
throw new TypeError("Invalid RFC-3339 date-time value");
|
316
|
+
}
|
317
|
+
const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
318
|
+
const year = strictParseShort(stripLeadingZeroes(yearStr));
|
319
|
+
const month = parseDateValue(monthStr, "month", 1, 12);
|
320
|
+
const day = parseDateValue(dayStr, "day", 1, 31);
|
321
|
+
return buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
|
322
|
+
};
|
323
|
+
var RFC3339_WITH_OFFSET = new RegExp(
|
324
|
+
/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/
|
325
|
+
);
|
326
|
+
var parseRfc3339DateTimeWithOffset = (value) => {
|
327
|
+
if (value === null || value === void 0) {
|
328
|
+
return void 0;
|
329
|
+
}
|
330
|
+
if (typeof value !== "string") {
|
331
|
+
throw new TypeError("RFC-3339 date-times must be expressed as strings");
|
332
|
+
}
|
333
|
+
const match = RFC3339_WITH_OFFSET.exec(value);
|
334
|
+
if (!match) {
|
335
|
+
throw new TypeError("Invalid RFC-3339 date-time value");
|
336
|
+
}
|
337
|
+
const [_, yearStr, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, offsetStr] = match;
|
338
|
+
const year = strictParseShort(stripLeadingZeroes(yearStr));
|
339
|
+
const month = parseDateValue(monthStr, "month", 1, 12);
|
340
|
+
const day = parseDateValue(dayStr, "day", 1, 31);
|
341
|
+
const date = buildDate(year, month, day, { hours, minutes, seconds, fractionalMilliseconds });
|
342
|
+
if (offsetStr.toUpperCase() != "Z") {
|
343
|
+
date.setTime(date.getTime() - parseOffsetToMilliseconds(offsetStr));
|
344
|
+
}
|
345
|
+
return date;
|
346
|
+
};
|
347
|
+
var IMF_FIXDATE = new RegExp(
|
348
|
+
/^(?: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$/
|
349
|
+
);
|
350
|
+
var RFC_850_DATE = new RegExp(
|
351
|
+
/^(?: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$/
|
352
|
+
);
|
353
|
+
var ASC_TIME = new RegExp(
|
354
|
+
/^(?: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})$/
|
355
|
+
);
|
356
|
+
var parseRfc7231DateTime = (value) => {
|
357
|
+
if (value === null || value === void 0) {
|
358
|
+
return void 0;
|
359
|
+
}
|
360
|
+
if (typeof value !== "string") {
|
361
|
+
throw new TypeError("RFC-7231 date-times must be expressed as strings");
|
362
|
+
}
|
363
|
+
let match = IMF_FIXDATE.exec(value);
|
364
|
+
if (match) {
|
365
|
+
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
366
|
+
return buildDate(
|
367
|
+
strictParseShort(stripLeadingZeroes(yearStr)),
|
368
|
+
parseMonthByShortName(monthStr),
|
369
|
+
parseDateValue(dayStr, "day", 1, 31),
|
370
|
+
{ hours, minutes, seconds, fractionalMilliseconds }
|
371
|
+
);
|
372
|
+
}
|
373
|
+
match = RFC_850_DATE.exec(value);
|
374
|
+
if (match) {
|
375
|
+
const [_, dayStr, monthStr, yearStr, hours, minutes, seconds, fractionalMilliseconds] = match;
|
376
|
+
return adjustRfc850Year(
|
377
|
+
buildDate(parseTwoDigitYear(yearStr), parseMonthByShortName(monthStr), parseDateValue(dayStr, "day", 1, 31), {
|
378
|
+
hours,
|
379
|
+
minutes,
|
380
|
+
seconds,
|
381
|
+
fractionalMilliseconds
|
382
|
+
})
|
383
|
+
);
|
384
|
+
}
|
385
|
+
match = ASC_TIME.exec(value);
|
386
|
+
if (match) {
|
387
|
+
const [_, monthStr, dayStr, hours, minutes, seconds, fractionalMilliseconds, yearStr] = match;
|
388
|
+
return buildDate(
|
389
|
+
strictParseShort(stripLeadingZeroes(yearStr)),
|
390
|
+
parseMonthByShortName(monthStr),
|
391
|
+
parseDateValue(dayStr.trimLeft(), "day", 1, 31),
|
392
|
+
{ hours, minutes, seconds, fractionalMilliseconds }
|
393
|
+
);
|
394
|
+
}
|
395
|
+
throw new TypeError("Invalid RFC-7231 date-time value");
|
396
|
+
};
|
397
|
+
var parseEpochTimestamp = (value) => {
|
398
|
+
if (value === null || value === void 0) {
|
399
|
+
return void 0;
|
400
|
+
}
|
401
|
+
let valueAsDouble;
|
402
|
+
if (typeof value === "number") {
|
403
|
+
valueAsDouble = value;
|
404
|
+
} else if (typeof value === "string") {
|
405
|
+
valueAsDouble = strictParseDouble(value);
|
406
|
+
} else if (typeof value === "object" && value.tag === 1) {
|
407
|
+
valueAsDouble = value.value;
|
408
|
+
} else {
|
409
|
+
throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");
|
410
|
+
}
|
411
|
+
if (Number.isNaN(valueAsDouble) || valueAsDouble === Infinity || valueAsDouble === -Infinity) {
|
412
|
+
throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");
|
413
|
+
}
|
414
|
+
return new Date(Math.round(valueAsDouble * 1e3));
|
415
|
+
};
|
416
|
+
var buildDate = (year, month, day, time) => {
|
417
|
+
const adjustedMonth = month - 1;
|
418
|
+
validateDayOfMonth(year, adjustedMonth, day);
|
419
|
+
return new Date(
|
420
|
+
Date.UTC(
|
421
|
+
year,
|
422
|
+
adjustedMonth,
|
423
|
+
day,
|
424
|
+
parseDateValue(time.hours, "hour", 0, 23),
|
425
|
+
parseDateValue(time.minutes, "minute", 0, 59),
|
426
|
+
// seconds can go up to 60 for leap seconds
|
427
|
+
parseDateValue(time.seconds, "seconds", 0, 60),
|
428
|
+
parseMilliseconds(time.fractionalMilliseconds)
|
429
|
+
)
|
430
|
+
);
|
431
|
+
};
|
432
|
+
var parseTwoDigitYear = (value) => {
|
433
|
+
const thisYear = (/* @__PURE__ */ new Date()).getUTCFullYear();
|
434
|
+
const valueInThisCentury = Math.floor(thisYear / 100) * 100 + strictParseShort(stripLeadingZeroes(value));
|
435
|
+
if (valueInThisCentury < thisYear) {
|
436
|
+
return valueInThisCentury + 100;
|
437
|
+
}
|
438
|
+
return valueInThisCentury;
|
439
|
+
};
|
440
|
+
var FIFTY_YEARS_IN_MILLIS = 50 * 365 * 24 * 60 * 60 * 1e3;
|
441
|
+
var adjustRfc850Year = (input) => {
|
442
|
+
if (input.getTime() - (/* @__PURE__ */ new Date()).getTime() > FIFTY_YEARS_IN_MILLIS) {
|
443
|
+
return new Date(
|
444
|
+
Date.UTC(
|
445
|
+
input.getUTCFullYear() - 100,
|
446
|
+
input.getUTCMonth(),
|
447
|
+
input.getUTCDate(),
|
448
|
+
input.getUTCHours(),
|
449
|
+
input.getUTCMinutes(),
|
450
|
+
input.getUTCSeconds(),
|
451
|
+
input.getUTCMilliseconds()
|
452
|
+
)
|
453
|
+
);
|
454
|
+
}
|
455
|
+
return input;
|
456
|
+
};
|
457
|
+
var parseMonthByShortName = (value) => {
|
458
|
+
const monthIdx = MONTHS.indexOf(value);
|
459
|
+
if (monthIdx < 0) {
|
460
|
+
throw new TypeError(`Invalid month: ${value}`);
|
461
|
+
}
|
462
|
+
return monthIdx + 1;
|
463
|
+
};
|
464
|
+
var DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
465
|
+
var validateDayOfMonth = (year, month, day) => {
|
466
|
+
let maxDays = DAYS_IN_MONTH[month];
|
467
|
+
if (month === 1 && isLeapYear(year)) {
|
468
|
+
maxDays = 29;
|
469
|
+
}
|
470
|
+
if (day > maxDays) {
|
471
|
+
throw new TypeError(`Invalid day for ${MONTHS[month]} in ${year}: ${day}`);
|
472
|
+
}
|
473
|
+
};
|
474
|
+
var isLeapYear = (year) => {
|
475
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
476
|
+
};
|
477
|
+
var parseDateValue = (value, type, lower, upper) => {
|
478
|
+
const dateVal = strictParseByte(stripLeadingZeroes(value));
|
479
|
+
if (dateVal < lower || dateVal > upper) {
|
480
|
+
throw new TypeError(`${type} must be between ${lower} and ${upper}, inclusive`);
|
481
|
+
}
|
482
|
+
return dateVal;
|
483
|
+
};
|
484
|
+
var parseMilliseconds = (value) => {
|
485
|
+
if (value === null || value === void 0) {
|
486
|
+
return 0;
|
487
|
+
}
|
488
|
+
return strictParseFloat32("0." + value) * 1e3;
|
489
|
+
};
|
490
|
+
var parseOffsetToMilliseconds = (value) => {
|
491
|
+
const directionStr = value[0];
|
492
|
+
let direction = 1;
|
493
|
+
if (directionStr == "+") {
|
494
|
+
direction = 1;
|
495
|
+
} else if (directionStr == "-") {
|
496
|
+
direction = -1;
|
497
|
+
} else {
|
498
|
+
throw new TypeError(`Offset direction, ${directionStr}, must be "+" or "-"`);
|
499
|
+
}
|
500
|
+
const hour = Number(value.substring(1, 3));
|
501
|
+
const minute = Number(value.substring(4, 6));
|
502
|
+
return direction * (hour * 60 + minute) * 60 * 1e3;
|
503
|
+
};
|
504
|
+
var stripLeadingZeroes = (value) => {
|
505
|
+
let idx = 0;
|
506
|
+
while (idx < value.length - 1 && value.charAt(idx) === "0") {
|
507
|
+
idx++;
|
508
|
+
}
|
509
|
+
if (idx === 0) {
|
510
|
+
return value;
|
511
|
+
}
|
512
|
+
return value.slice(idx);
|
513
|
+
};
|
514
|
+
|
515
|
+
// src/submodules/serde/quote-header.ts
|
516
|
+
function quoteHeader(part) {
|
517
|
+
if (part.includes(",") || part.includes('"')) {
|
518
|
+
part = `"${part.replace(/"/g, '\\"')}"`;
|
519
|
+
}
|
520
|
+
return part;
|
521
|
+
}
|
522
|
+
|
523
|
+
// src/submodules/serde/split-header.ts
|
524
|
+
var splitHeader = (value) => {
|
525
|
+
const z = value.length;
|
526
|
+
const values = [];
|
527
|
+
let withinQuotes = false;
|
528
|
+
let prevChar = void 0;
|
529
|
+
let anchor = 0;
|
530
|
+
for (let i = 0; i < z; ++i) {
|
531
|
+
const char = value[i];
|
532
|
+
switch (char) {
|
533
|
+
case `"`:
|
534
|
+
if (prevChar !== "\\") {
|
535
|
+
withinQuotes = !withinQuotes;
|
536
|
+
}
|
537
|
+
break;
|
538
|
+
case ",":
|
539
|
+
if (!withinQuotes) {
|
540
|
+
values.push(value.slice(anchor, i));
|
541
|
+
anchor = i + 1;
|
542
|
+
}
|
543
|
+
break;
|
544
|
+
default:
|
545
|
+
}
|
546
|
+
prevChar = char;
|
547
|
+
}
|
548
|
+
values.push(value.slice(anchor));
|
549
|
+
return values.map((v) => {
|
550
|
+
v = v.trim();
|
551
|
+
const z2 = v.length;
|
552
|
+
if (z2 < 2) {
|
553
|
+
return v;
|
554
|
+
}
|
555
|
+
if (v[0] === `"` && v[z2 - 1] === `"`) {
|
556
|
+
v = v.slice(1, z2 - 1);
|
557
|
+
}
|
558
|
+
return v.replace(/\\"/g, '"');
|
559
|
+
});
|
560
|
+
};
|
561
|
+
|
27
562
|
// src/submodules/serde/value/NumericValue.ts
|
28
563
|
var NumericValue = class {
|
29
564
|
constructor(string, type) {
|
@@ -34,8 +569,96 @@ var NumericValue = class {
|
|
34
569
|
function nv(string) {
|
35
570
|
return new NumericValue(string, "bigDecimal");
|
36
571
|
}
|
572
|
+
|
573
|
+
// src/submodules/serde/lazy-json.ts
|
574
|
+
var LazyJsonString = function LazyJsonString2(val) {
|
575
|
+
const str = Object.assign(new String(val), {
|
576
|
+
deserializeJSON() {
|
577
|
+
return JSON.parse(String(val));
|
578
|
+
},
|
579
|
+
toString() {
|
580
|
+
return String(val);
|
581
|
+
},
|
582
|
+
toJSON() {
|
583
|
+
return String(val);
|
584
|
+
}
|
585
|
+
});
|
586
|
+
return str;
|
587
|
+
};
|
588
|
+
LazyJsonString.from = (object) => {
|
589
|
+
if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) {
|
590
|
+
return object;
|
591
|
+
} else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) {
|
592
|
+
return LazyJsonString(String(object));
|
593
|
+
}
|
594
|
+
return LazyJsonString(JSON.stringify(object));
|
595
|
+
};
|
596
|
+
LazyJsonString.fromObject = LazyJsonString.from;
|
597
|
+
|
598
|
+
// src/submodules/serde/split-every.ts
|
599
|
+
function splitEvery(value, delimiter, numDelimiters) {
|
600
|
+
if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {
|
601
|
+
throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
|
602
|
+
}
|
603
|
+
const segments = value.split(delimiter);
|
604
|
+
if (numDelimiters === 1) {
|
605
|
+
return segments;
|
606
|
+
}
|
607
|
+
const compoundSegments = [];
|
608
|
+
let currentSegment = "";
|
609
|
+
for (let i = 0; i < segments.length; i++) {
|
610
|
+
if (currentSegment === "") {
|
611
|
+
currentSegment = segments[i];
|
612
|
+
} else {
|
613
|
+
currentSegment += delimiter + segments[i];
|
614
|
+
}
|
615
|
+
if ((i + 1) % numDelimiters === 0) {
|
616
|
+
compoundSegments.push(currentSegment);
|
617
|
+
currentSegment = "";
|
618
|
+
}
|
619
|
+
}
|
620
|
+
if (currentSegment !== "") {
|
621
|
+
compoundSegments.push(currentSegment);
|
622
|
+
}
|
623
|
+
return compoundSegments;
|
624
|
+
}
|
37
625
|
// Annotate the CommonJS export names for ESM import in node:
|
38
626
|
0 && (module.exports = {
|
627
|
+
LazyJsonString,
|
39
628
|
NumericValue,
|
40
|
-
|
629
|
+
dateToUtcString,
|
630
|
+
expectBoolean,
|
631
|
+
expectByte,
|
632
|
+
expectFloat32,
|
633
|
+
expectInt,
|
634
|
+
expectInt32,
|
635
|
+
expectLong,
|
636
|
+
expectNonNull,
|
637
|
+
expectNumber,
|
638
|
+
expectObject,
|
639
|
+
expectShort,
|
640
|
+
expectString,
|
641
|
+
expectUnion,
|
642
|
+
handleFloat,
|
643
|
+
limitedParseDouble,
|
644
|
+
limitedParseFloat,
|
645
|
+
limitedParseFloat32,
|
646
|
+
logger,
|
647
|
+
nv,
|
648
|
+
parseBoolean,
|
649
|
+
parseEpochTimestamp,
|
650
|
+
parseRfc3339DateTime,
|
651
|
+
parseRfc3339DateTimeWithOffset,
|
652
|
+
parseRfc7231DateTime,
|
653
|
+
quoteHeader,
|
654
|
+
splitEvery,
|
655
|
+
splitHeader,
|
656
|
+
strictParseByte,
|
657
|
+
strictParseDouble,
|
658
|
+
strictParseFloat,
|
659
|
+
strictParseFloat32,
|
660
|
+
strictParseInt,
|
661
|
+
strictParseInt32,
|
662
|
+
strictParseLong,
|
663
|
+
strictParseShort
|
41
664
|
});
|
@@ -50,8 +50,9 @@ export const loadSmithyRpcV2CborErrorCode = (output, data) => {
|
|
50
50
|
if (data["__type"] !== undefined) {
|
51
51
|
return sanitizeErrorCode(data["__type"]);
|
52
52
|
}
|
53
|
-
|
54
|
-
|
53
|
+
const codeKey = Object.keys(data).find((key) => key.toLowerCase() === "code");
|
54
|
+
if (codeKey && data[codeKey] !== undefined) {
|
55
|
+
return sanitizeErrorCode(data[codeKey]);
|
55
56
|
}
|
56
57
|
};
|
57
58
|
export const checkCborResponse = (response) => {
|