@smithy/core 3.24.0 → 3.24.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.
Files changed (60) hide show
  1. package/dist-cjs/submodules/schema/index.js +12 -0
  2. package/dist-cjs/submodules/serde/index.browser.js +37 -36
  3. package/dist-cjs/submodules/serde/index.js +39 -37
  4. package/dist-cjs/submodules/serde/index.native.js +37 -36
  5. package/dist-es/submodules/schema/TypeRegistry.js +12 -0
  6. package/dist-es/submodules/serde/index.browser.js +4 -2
  7. package/dist-es/submodules/serde/index.js +5 -2
  8. package/dist-es/submodules/serde/index.native.js +4 -2
  9. package/dist-es/submodules/serde/uuid/v4.js +30 -29
  10. package/dist-types/pagination/createPaginator.d.ts +2 -2
  11. package/dist-types/request-builder/requestBuilder.d.ts +2 -1
  12. package/dist-types/setFeature.d.ts +3 -3
  13. package/dist-types/submodules/cbor/cbor-decode.d.ts +4 -3
  14. package/dist-types/submodules/cbor/cbor-types.d.ts +4 -4
  15. package/dist-types/submodules/cbor/cbor.d.ts +3 -4
  16. package/dist-types/submodules/checksum/chunked-blob-reader/chunked-blob-reader.d.ts +2 -1
  17. package/dist-types/submodules/client/smithy-client/client.d.ts +2 -5
  18. package/dist-types/submodules/client/smithy-client/default-error-handler.d.ts +2 -2
  19. package/dist-types/submodules/client/smithy-client/emitWarningIfUnsupportedVersion.d.ts +1 -2
  20. package/dist-types/submodules/client/smithy-client/exceptions.d.ts +2 -2
  21. package/dist-types/submodules/client/smithy-client/extensions/defaultExtensionConfiguration.d.ts +7 -7
  22. package/dist-types/submodules/client/smithy-client/get-array-if-single-item.d.ts +2 -2
  23. package/dist-types/submodules/client/smithy-client/get-value-from-text-node.d.ts +2 -2
  24. package/dist-types/submodules/client/smithy-client/object-mapping.d.ts +22 -21
  25. package/dist-types/submodules/client/smithy-client/ser-utils.d.ts +1 -2
  26. package/dist-types/submodules/client/smithy-client/serde-json.d.ts +1 -3
  27. package/dist-types/submodules/client/util-waiter/utils/validate.d.ts +2 -2
  28. package/dist-types/submodules/config/config-resolver/endpointsConfig/resolveEndpointsConfig.d.ts +2 -2
  29. package/dist-types/submodules/config/property-provider/CredentialsProviderError.d.ts +2 -3
  30. package/dist-types/submodules/config/property-provider/ProviderError.d.ts +2 -3
  31. package/dist-types/submodules/config/property-provider/TokenProviderError.d.ts +2 -3
  32. package/dist-types/submodules/config/property-provider/chain.d.ts +2 -3
  33. package/dist-types/submodules/config/shared-ini-file-loader/getSSOTokenFromFile.d.ts +2 -1
  34. package/dist-types/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.d.ts +6 -5
  35. package/dist-types/submodules/endpoints/util-endpoints/cache/EndpointCache.d.ts +2 -2
  36. package/dist-types/submodules/endpoints/util-endpoints/getEndpointUrlConfig.d.ts +2 -1
  37. package/dist-types/submodules/protocols/collect-stream-body.d.ts +2 -2
  38. package/dist-types/submodules/protocols/extended-encode-uri-component.d.ts +2 -2
  39. package/dist-types/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.d.ts +4 -4
  40. package/dist-types/submodules/protocols/protocol-http/httpHandler.d.ts +2 -5
  41. package/dist-types/submodules/protocols/requestBuilder.d.ts +2 -1
  42. package/dist-types/submodules/retry/util-retry/constants.d.ts +4 -4
  43. package/dist-types/submodules/serde/date-utils.d.ts +7 -19
  44. package/dist-types/submodules/serde/index.browser.d.ts +2 -2
  45. package/dist-types/submodules/serde/index.d.ts +2 -2
  46. package/dist-types/submodules/serde/index.native.d.ts +2 -2
  47. package/dist-types/submodules/serde/lazy-json.d.ts +4 -6
  48. package/dist-types/submodules/serde/parse-utils.d.ts +31 -51
  49. package/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +3 -12
  50. package/dist-types/submodules/serde/split-every.d.ts +1 -2
  51. package/dist-types/submodules/serde/util-stream/createBufferedReadable.browser.d.ts +2 -1
  52. package/dist-types/submodules/serde/util-stream/createBufferedReadable.d.ts +2 -1
  53. package/dist-types/submodules/serde/util-stream/stream-collector.browser.d.ts +2 -1
  54. package/dist-types/submodules/serde/uuid/v4.d.ts +12 -7
  55. package/dist-types/util-identity-and-auth/memoizeIdentityProvider.d.ts +2 -1
  56. package/package.json +1 -1
  57. package/dist-es/submodules/serde/generateIdempotencyToken.js +0 -2
  58. package/dist-es/submodules/serde/uuid/randomUUID.js +0 -3
  59. package/dist-types/submodules/serde/generateIdempotencyToken.d.ts +0 -2
  60. package/dist-types/submodules/serde/uuid/randomUUID.d.ts +0 -1
@@ -622,6 +622,18 @@ class TypeRegistry {
622
622
  getSchema(shapeId) {
623
623
  const id = this.normalizeShapeId(shapeId);
624
624
  if (!this.schemas.has(id)) {
625
+ if (!shapeId.includes("#")) {
626
+ const suffix = "#" + shapeId;
627
+ const candidates = [];
628
+ for (const [shapeId, schema] of this.schemas.entries()) {
629
+ if (shapeId.endsWith(suffix)) {
630
+ candidates.push(schema);
631
+ }
632
+ }
633
+ if (candidates.length === 1) {
634
+ return candidates[0];
635
+ }
636
+ }
625
637
  throw new Error(`@smithy/core/schema - schema not found for ${id}`);
626
638
  }
627
639
  return this.schemas.get(id);
@@ -3,6 +3,39 @@
3
3
  var protocols = require('@smithy/core/protocols');
4
4
  var endpoints = require('@smithy/core/endpoints');
5
5
 
6
+ const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
7
+ function bindV4(getRandomValues) {
8
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
9
+ return () => crypto.randomUUID();
10
+ }
11
+ return () => {
12
+ const rnds = new Uint8Array(16);
13
+ getRandomValues(rnds);
14
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
15
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
16
+ return (decimalToHex[rnds[0]] +
17
+ decimalToHex[rnds[1]] +
18
+ decimalToHex[rnds[2]] +
19
+ decimalToHex[rnds[3]] +
20
+ "-" +
21
+ decimalToHex[rnds[4]] +
22
+ decimalToHex[rnds[5]] +
23
+ "-" +
24
+ decimalToHex[rnds[6]] +
25
+ decimalToHex[rnds[7]] +
26
+ "-" +
27
+ decimalToHex[rnds[8]] +
28
+ decimalToHex[rnds[9]] +
29
+ "-" +
30
+ decimalToHex[rnds[10]] +
31
+ decimalToHex[rnds[11]] +
32
+ decimalToHex[rnds[12]] +
33
+ decimalToHex[rnds[13]] +
34
+ decimalToHex[rnds[14]] +
35
+ decimalToHex[rnds[15]]);
36
+ };
37
+ }
38
+
6
39
  const copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;
7
40
 
8
41
  const parseBoolean = (value) => {
@@ -429,41 +462,6 @@ const stripLeadingZeroes = (value) => {
429
462
  return value.slice(idx);
430
463
  };
431
464
 
432
- const randomUUID = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function"
433
- ? crypto.randomUUID.bind(crypto)
434
- : undefined;
435
-
436
- const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
437
- const v4 = () => {
438
- if (randomUUID) {
439
- return randomUUID();
440
- }
441
- const rnds = new Uint8Array(16);
442
- crypto.getRandomValues(rnds);
443
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
444
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
445
- return (decimalToHex[rnds[0]] +
446
- decimalToHex[rnds[1]] +
447
- decimalToHex[rnds[2]] +
448
- decimalToHex[rnds[3]] +
449
- "-" +
450
- decimalToHex[rnds[4]] +
451
- decimalToHex[rnds[5]] +
452
- "-" +
453
- decimalToHex[rnds[6]] +
454
- decimalToHex[rnds[7]] +
455
- "-" +
456
- decimalToHex[rnds[8]] +
457
- decimalToHex[rnds[9]] +
458
- "-" +
459
- decimalToHex[rnds[10]] +
460
- decimalToHex[rnds[11]] +
461
- decimalToHex[rnds[12]] +
462
- decimalToHex[rnds[13]] +
463
- decimalToHex[rnds[14]] +
464
- decimalToHex[rnds[15]]);
465
- };
466
-
467
465
  const LazyJsonString = function LazyJsonString(val) {
468
466
  const str = Object.assign(new String(val), {
469
467
  deserializeJSON() {
@@ -1379,6 +1377,9 @@ async function splitStream(stream) {
1379
1377
 
1380
1378
  const no = Symbol.for("node-only");
1381
1379
  const Hash = no;
1380
+ const _getRandomValues = (array) => crypto.getRandomValues(array);
1381
+ const v4 = bindV4(_getRandomValues);
1382
+ const generateIdempotencyToken = v4;
1382
1383
 
1383
1384
  exports.ChecksumStream = ChecksumStream;
1384
1385
  exports.Hash = Hash;
@@ -1412,7 +1413,7 @@ exports.fromBase64 = fromBase64$1;
1412
1413
  exports.fromHex = fromHex;
1413
1414
  exports.fromString = fromString;
1414
1415
  exports.fromUtf8 = fromUtf8;
1415
- exports.generateIdempotencyToken = v4;
1416
+ exports.generateIdempotencyToken = generateIdempotencyToken;
1416
1417
  exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
1417
1418
  exports.getSerdePlugin = getSerdePlugin;
1418
1419
  exports.handleFloat = handleFloat;
@@ -1,11 +1,44 @@
1
1
  'use strict';
2
2
 
3
+ var node_crypto = require('node:crypto');
3
4
  var node_fs = require('node:fs');
4
5
  var protocols = require('@smithy/core/protocols');
5
6
  var endpoints = require('@smithy/core/endpoints');
6
- var node_crypto = require('node:crypto');
7
7
  var node_stream = require('node:stream');
8
8
 
9
+ const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
10
+ function bindV4(getRandomValues) {
11
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
12
+ return () => crypto.randomUUID();
13
+ }
14
+ return () => {
15
+ const rnds = new Uint8Array(16);
16
+ getRandomValues(rnds);
17
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
18
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
19
+ return (decimalToHex[rnds[0]] +
20
+ decimalToHex[rnds[1]] +
21
+ decimalToHex[rnds[2]] +
22
+ decimalToHex[rnds[3]] +
23
+ "-" +
24
+ decimalToHex[rnds[4]] +
25
+ decimalToHex[rnds[5]] +
26
+ "-" +
27
+ decimalToHex[rnds[6]] +
28
+ decimalToHex[rnds[7]] +
29
+ "-" +
30
+ decimalToHex[rnds[8]] +
31
+ decimalToHex[rnds[9]] +
32
+ "-" +
33
+ decimalToHex[rnds[10]] +
34
+ decimalToHex[rnds[11]] +
35
+ decimalToHex[rnds[12]] +
36
+ decimalToHex[rnds[13]] +
37
+ decimalToHex[rnds[14]] +
38
+ decimalToHex[rnds[15]]);
39
+ };
40
+ }
41
+
9
42
  const copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;
10
43
 
11
44
  const parseBoolean = (value) => {
@@ -432,41 +465,6 @@ const stripLeadingZeroes = (value) => {
432
465
  return value.slice(idx);
433
466
  };
434
467
 
435
- const randomUUID = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function"
436
- ? crypto.randomUUID.bind(crypto)
437
- : undefined;
438
-
439
- const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
440
- const v4 = () => {
441
- if (randomUUID) {
442
- return randomUUID();
443
- }
444
- const rnds = new Uint8Array(16);
445
- crypto.getRandomValues(rnds);
446
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
447
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
448
- return (decimalToHex[rnds[0]] +
449
- decimalToHex[rnds[1]] +
450
- decimalToHex[rnds[2]] +
451
- decimalToHex[rnds[3]] +
452
- "-" +
453
- decimalToHex[rnds[4]] +
454
- decimalToHex[rnds[5]] +
455
- "-" +
456
- decimalToHex[rnds[6]] +
457
- decimalToHex[rnds[7]] +
458
- "-" +
459
- decimalToHex[rnds[8]] +
460
- decimalToHex[rnds[9]] +
461
- "-" +
462
- decimalToHex[rnds[10]] +
463
- decimalToHex[rnds[11]] +
464
- decimalToHex[rnds[12]] +
465
- decimalToHex[rnds[13]] +
466
- decimalToHex[rnds[14]] +
467
- decimalToHex[rnds[15]]);
468
- };
469
-
470
468
  const LazyJsonString = function LazyJsonString(val) {
471
469
  const str = Object.assign(new String(val), {
472
470
  deserializeJSON() {
@@ -1619,6 +1617,10 @@ async function splitStream(stream) {
1619
1617
  return [stream1, stream2];
1620
1618
  }
1621
1619
 
1620
+ const _getRandomValues = node_crypto.getRandomValues;
1621
+ const v4 = bindV4(_getRandomValues);
1622
+ const generateIdempotencyToken = v4;
1623
+
1622
1624
  exports.ChecksumStream = ChecksumStream$1;
1623
1625
  exports.Hash = Hash;
1624
1626
  exports.LazyJsonString = LazyJsonString;
@@ -1651,7 +1653,7 @@ exports.fromBase64 = fromBase64;
1651
1653
  exports.fromHex = fromHex;
1652
1654
  exports.fromString = fromString;
1653
1655
  exports.fromUtf8 = fromUtf8;
1654
- exports.generateIdempotencyToken = v4;
1656
+ exports.generateIdempotencyToken = generateIdempotencyToken;
1655
1657
  exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
1656
1658
  exports.getSerdePlugin = getSerdePlugin;
1657
1659
  exports.handleFloat = handleFloat;
@@ -3,6 +3,39 @@
3
3
  var protocols = require('@smithy/core/protocols');
4
4
  var endpoints = require('@smithy/core/endpoints');
5
5
 
6
+ const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
7
+ function bindV4(getRandomValues) {
8
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
9
+ return () => crypto.randomUUID();
10
+ }
11
+ return () => {
12
+ const rnds = new Uint8Array(16);
13
+ getRandomValues(rnds);
14
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
15
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
16
+ return (decimalToHex[rnds[0]] +
17
+ decimalToHex[rnds[1]] +
18
+ decimalToHex[rnds[2]] +
19
+ decimalToHex[rnds[3]] +
20
+ "-" +
21
+ decimalToHex[rnds[4]] +
22
+ decimalToHex[rnds[5]] +
23
+ "-" +
24
+ decimalToHex[rnds[6]] +
25
+ decimalToHex[rnds[7]] +
26
+ "-" +
27
+ decimalToHex[rnds[8]] +
28
+ decimalToHex[rnds[9]] +
29
+ "-" +
30
+ decimalToHex[rnds[10]] +
31
+ decimalToHex[rnds[11]] +
32
+ decimalToHex[rnds[12]] +
33
+ decimalToHex[rnds[13]] +
34
+ decimalToHex[rnds[14]] +
35
+ decimalToHex[rnds[15]]);
36
+ };
37
+ }
38
+
6
39
  const copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => source;
7
40
 
8
41
  const parseBoolean = (value) => {
@@ -429,41 +462,6 @@ const stripLeadingZeroes = (value) => {
429
462
  return value.slice(idx);
430
463
  };
431
464
 
432
- const randomUUID = typeof crypto !== "undefined" && typeof crypto.randomUUID === "function"
433
- ? crypto.randomUUID.bind(crypto)
434
- : undefined;
435
-
436
- const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
437
- const v4 = () => {
438
- if (randomUUID) {
439
- return randomUUID();
440
- }
441
- const rnds = new Uint8Array(16);
442
- crypto.getRandomValues(rnds);
443
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
444
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
445
- return (decimalToHex[rnds[0]] +
446
- decimalToHex[rnds[1]] +
447
- decimalToHex[rnds[2]] +
448
- decimalToHex[rnds[3]] +
449
- "-" +
450
- decimalToHex[rnds[4]] +
451
- decimalToHex[rnds[5]] +
452
- "-" +
453
- decimalToHex[rnds[6]] +
454
- decimalToHex[rnds[7]] +
455
- "-" +
456
- decimalToHex[rnds[8]] +
457
- decimalToHex[rnds[9]] +
458
- "-" +
459
- decimalToHex[rnds[10]] +
460
- decimalToHex[rnds[11]] +
461
- decimalToHex[rnds[12]] +
462
- decimalToHex[rnds[13]] +
463
- decimalToHex[rnds[14]] +
464
- decimalToHex[rnds[15]]);
465
- };
466
-
467
465
  const LazyJsonString = function LazyJsonString(val) {
468
466
  const str = Object.assign(new String(val), {
469
467
  deserializeJSON() {
@@ -1379,6 +1377,9 @@ async function splitStream(stream) {
1379
1377
 
1380
1378
  const no = Symbol.for("node-only");
1381
1379
  const Hash = no;
1380
+ const _getRandomValues = (array) => crypto.getRandomValues(array);
1381
+ const v4 = bindV4(_getRandomValues);
1382
+ const generateIdempotencyToken = v4;
1382
1383
 
1383
1384
  exports.ChecksumStream = ChecksumStream;
1384
1385
  exports.Hash = Hash;
@@ -1412,7 +1413,7 @@ exports.fromBase64 = fromBase64$1;
1412
1413
  exports.fromHex = fromHex;
1413
1414
  exports.fromString = fromString;
1414
1415
  exports.fromUtf8 = fromUtf8;
1415
- exports.generateIdempotencyToken = v4;
1416
+ exports.generateIdempotencyToken = generateIdempotencyToken;
1416
1417
  exports.getAwsChunkedEncodingStream = getAwsChunkedEncodingStream;
1417
1418
  exports.getSerdePlugin = getSerdePlugin;
1418
1419
  exports.handleFloat = handleFloat;
@@ -36,6 +36,18 @@ export class TypeRegistry {
36
36
  getSchema(shapeId) {
37
37
  const id = this.normalizeShapeId(shapeId);
38
38
  if (!this.schemas.has(id)) {
39
+ if (!shapeId.includes("#")) {
40
+ const suffix = "#" + shapeId;
41
+ const candidates = [];
42
+ for (const [shapeId, schema] of this.schemas.entries()) {
43
+ if (shapeId.endsWith(suffix)) {
44
+ candidates.push(schema);
45
+ }
46
+ }
47
+ if (candidates.length === 1) {
48
+ return candidates[0];
49
+ }
50
+ }
39
51
  throw new Error(`@smithy/core/schema - schema not found for ${id}`);
40
52
  }
41
53
  return this.schemas.get(id);
@@ -1,7 +1,7 @@
1
+ import { bindV4 } from "./uuid/v4";
1
2
  const no = Symbol.for("node-only");
2
3
  export { copyDocumentWithTransform } from "./copyDocumentWithTransform";
3
4
  export { dateToUtcString, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, parseEpochTimestamp, } from "./date-utils";
4
- export { generateIdempotencyToken } from "./generateIdempotencyToken";
5
5
  export { LazyJsonString } from "./lazy-json";
6
6
  export { logger, parseBoolean, expectBoolean, expectNumber, expectFloat32, expectInt, expectInt32, expectShort, expectByte, expectNonNull, expectObject, expectString, expectUnion, expectLong, strictParseDouble, strictParseFloat, strictParseFloat32, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, } from "./parse-utils";
7
7
  export { quoteHeader } from "./quote-header";
@@ -31,4 +31,6 @@ export { headStream } from "./util-stream/headStream.browser";
31
31
  export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin.browser";
32
32
  export { splitStream } from "./util-stream/splitStream.browser";
33
33
  export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
34
- export { v4 } from "./uuid/v4";
34
+ const _getRandomValues = (array) => crypto.getRandomValues(array);
35
+ export const v4 = bindV4(_getRandomValues);
36
+ export const generateIdempotencyToken = v4;
@@ -1,6 +1,7 @@
1
+ import { getRandomValues } from "node:crypto";
2
+ import { bindV4 } from "./uuid/v4";
1
3
  export { copyDocumentWithTransform } from "./copyDocumentWithTransform";
2
4
  export { dateToUtcString, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, parseEpochTimestamp, } from "./date-utils";
3
- export { generateIdempotencyToken } from "./generateIdempotencyToken";
4
5
  export { LazyJsonString } from "./lazy-json";
5
6
  export { logger, parseBoolean, expectBoolean, expectNumber, expectFloat32, expectInt, expectInt32, expectShort, expectByte, expectNonNull, expectObject, expectString, expectUnion, expectLong, strictParseDouble, strictParseFloat, strictParseFloat32, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, } from "./parse-utils";
6
7
  export { quoteHeader } from "./quote-header";
@@ -30,4 +31,6 @@ export { headStream } from "./util-stream/headStream";
30
31
  export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin";
31
32
  export { splitStream } from "./util-stream/splitStream";
32
33
  export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
33
- export { v4 } from "./uuid/v4";
34
+ const _getRandomValues = getRandomValues;
35
+ export const v4 = bindV4(_getRandomValues);
36
+ export const generateIdempotencyToken = v4;
@@ -1,7 +1,7 @@
1
+ import { bindV4 } from "./uuid/v4";
1
2
  const no = Symbol.for("node-only");
2
3
  export { copyDocumentWithTransform } from "./copyDocumentWithTransform";
3
4
  export { dateToUtcString, parseRfc3339DateTime, parseRfc3339DateTimeWithOffset, parseRfc7231DateTime, parseEpochTimestamp, } from "./date-utils";
4
- export { generateIdempotencyToken } from "./generateIdempotencyToken";
5
5
  export { LazyJsonString } from "./lazy-json";
6
6
  export { logger, parseBoolean, expectBoolean, expectNumber, expectFloat32, expectInt, expectInt32, expectShort, expectByte, expectNonNull, expectObject, expectString, expectUnion, expectLong, strictParseDouble, strictParseFloat, strictParseFloat32, strictParseLong, strictParseInt, strictParseInt32, strictParseShort, strictParseByte, limitedParseDouble, handleFloat, limitedParseFloat, limitedParseFloat32, } from "./parse-utils";
7
7
  export { quoteHeader } from "./quote-header";
@@ -31,4 +31,6 @@ export { headStream } from "./util-stream/headStream.browser";
31
31
  export { sdkStreamMixin } from "./util-stream/sdk-stream-mixin.browser";
32
32
  export { splitStream } from "./util-stream/splitStream.browser";
33
33
  export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
34
- export { v4 } from "./uuid/v4";
34
+ const _getRandomValues = (array) => crypto.getRandomValues(array);
35
+ export const v4 = bindV4(_getRandomValues);
36
+ export const generateIdempotencyToken = v4;
@@ -1,31 +1,32 @@
1
- import { randomUUID } from "./randomUUID";
2
1
  const decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
3
- export const v4 = () => {
4
- if (randomUUID) {
5
- return randomUUID();
2
+ export function bindV4(getRandomValues) {
3
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
4
+ return () => crypto.randomUUID();
6
5
  }
7
- const rnds = new Uint8Array(16);
8
- crypto.getRandomValues(rnds);
9
- rnds[6] = (rnds[6] & 0x0f) | 0x40;
10
- rnds[8] = (rnds[8] & 0x3f) | 0x80;
11
- return (decimalToHex[rnds[0]] +
12
- decimalToHex[rnds[1]] +
13
- decimalToHex[rnds[2]] +
14
- decimalToHex[rnds[3]] +
15
- "-" +
16
- decimalToHex[rnds[4]] +
17
- decimalToHex[rnds[5]] +
18
- "-" +
19
- decimalToHex[rnds[6]] +
20
- decimalToHex[rnds[7]] +
21
- "-" +
22
- decimalToHex[rnds[8]] +
23
- decimalToHex[rnds[9]] +
24
- "-" +
25
- decimalToHex[rnds[10]] +
26
- decimalToHex[rnds[11]] +
27
- decimalToHex[rnds[12]] +
28
- decimalToHex[rnds[13]] +
29
- decimalToHex[rnds[14]] +
30
- decimalToHex[rnds[15]]);
31
- };
6
+ return () => {
7
+ const rnds = new Uint8Array(16);
8
+ getRandomValues(rnds);
9
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
10
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
11
+ return (decimalToHex[rnds[0]] +
12
+ decimalToHex[rnds[1]] +
13
+ decimalToHex[rnds[2]] +
14
+ decimalToHex[rnds[3]] +
15
+ "-" +
16
+ decimalToHex[rnds[4]] +
17
+ decimalToHex[rnds[5]] +
18
+ "-" +
19
+ decimalToHex[rnds[6]] +
20
+ decimalToHex[rnds[7]] +
21
+ "-" +
22
+ decimalToHex[rnds[8]] +
23
+ decimalToHex[rnds[9]] +
24
+ "-" +
25
+ decimalToHex[rnds[10]] +
26
+ decimalToHex[rnds[11]] +
27
+ decimalToHex[rnds[12]] +
28
+ decimalToHex[rnds[13]] +
29
+ decimalToHex[rnds[14]] +
30
+ decimalToHex[rnds[15]]);
31
+ };
32
+ }
@@ -1,7 +1,7 @@
1
1
  import type { PaginationConfiguration, Paginator } from "@smithy/types";
2
2
  /**
3
- * @internal
4
- *
5
3
  * Creates a paginator.
4
+ *
5
+ * @internal
6
6
  */
7
7
  export declare function createPaginator<PaginationConfigType extends PaginationConfiguration, InputType extends object, OutputType extends object>(ClientCtor: any, CommandCtor: any, inputTokenName: string, outputTokenName: string, pageSizeTokenName?: string): (config: PaginationConfigType, input: InputType, ...additionalArguments: any[]) => Paginator<OutputType>;
@@ -1,5 +1,6 @@
1
1
  /**
2
- * @internal
3
2
  * Backwards compatibility re-export.
3
+ *
4
+ * @internal
4
5
  */
5
6
  export { requestBuilder } from "@smithy/core/protocols";
@@ -1,12 +1,12 @@
1
1
  import type { HandlerExecutionContext, SmithyFeatures } from "@smithy/types";
2
2
  /**
3
- * @internal
4
3
  * Indicates to the request context that a given feature is active.
4
+ * specification asks the library not to include a runtime lookup of all
5
+ * the feature identifiers.
5
6
  *
7
+ * @internal
6
8
  * @param context - handler execution context.
7
9
  * @param feature - readable name of feature.
8
10
  * @param value - encoding value of feature. This is required because the
9
- * specification asks the library not to include a runtime lookup of all
10
- * the feature identifiers.
11
11
  */
12
12
  export declare function setFeature<F extends keyof SmithyFeatures>(context: HandlerExecutionContext, feature: F, value: SmithyFeatures[F]): void;
@@ -1,14 +1,15 @@
1
1
  import { type CborValueType, type Float32, type Uint8, type Uint32 } from "./cbor-types";
2
2
  /**
3
+ * Sets the decode bytearray source and its data view.
4
+ *
3
5
  * @internal
4
6
  * @param bytes - to be set as the decode source.
5
- *
6
- * Sets the decode bytearray source and its data view.
7
7
  */
8
8
  export declare function setPayload(bytes: Uint8Array): void;
9
9
  /**
10
- * @internal
11
10
  * Decodes the data between the two indices.
11
+ *
12
+ * @internal
12
13
  */
13
14
  export declare function decode(at: Uint32, to: Uint32): CborValueType;
14
15
  /**
@@ -39,17 +39,17 @@ export declare const extendedFloat64 = 27;
39
39
  export declare const minorIndefinite = 31;
40
40
  export declare function alloc(size: number): Uint8Array;
41
41
  /**
42
- * @public
43
- *
44
42
  * The presence of this symbol as an object key indicates it should be considered a tag
45
43
  * for CBOR serialization purposes.
46
- *
47
44
  * The object must also have the properties "tag" and "value".
45
+ *
46
+ * @public
48
47
  */
49
48
  export declare const tagSymbol: unique symbol;
50
49
  /**
51
- * @public
52
50
  * Applies the tag symbol to the object.
51
+ *
52
+ * @public
53
53
  */
54
54
  export declare function tag(data: {
55
55
  tag: number | bigint;
@@ -12,15 +12,14 @@ export declare const cbor: {
12
12
  deserialize(payload: Uint8Array): any;
13
13
  serialize(input: any): Uint8Array;
14
14
  /**
15
- * @public
16
- * @param size - byte length to allocate.
17
- *
18
15
  * This may be used to garbage collect the CBOR
19
16
  * shared encoding buffer space,
20
17
  * e.g. resizeEncodingBuffer(0);
21
- *
22
18
  * This may also be used to pre-allocate more space for
23
19
  * CBOR encoding, e.g. resizeEncodingBuffer(100_000_000);
20
+ *
21
+ * @public
22
+ * @param size - byte length to allocate.
24
23
  */
25
24
  resizeEncodingBuffer(size: number): void;
26
25
  };
@@ -1,5 +1,6 @@
1
1
  /**
2
- * @internal
3
2
  * Reads the blob data into the onChunk consumer.
3
+ *
4
+ * @internal
4
5
  */
5
6
  export declare function blobReader(blob: Blob, onChunk: (chunk: Uint8Array) => void, chunkSize?: number): Promise<void>;
@@ -8,19 +8,16 @@ export interface SmithyConfiguration<HandlerOptions> {
8
8
  */
9
9
  requestHandler: RequestHandler<any, any, HandlerOptions> | NodeHttpHandlerOptions | FetchHttpHandlerOptions | Record<string, unknown>;
10
10
  /**
11
- * @public
12
- *
13
11
  * Default false.
14
- *
15
12
  * When true, the client will only resolve the middleware stack once per
16
13
  * Command class. This means modifying the middlewareStack of the
17
14
  * command or client after requests have been made will not be
18
15
  * recognized.
19
- *
20
16
  * Calling client.destroy() also clears this cache.
21
- *
22
17
  * Enable this only if needing the additional time saved (0-1ms per request)
23
18
  * and not needing middleware modifications between requests.
19
+ *
20
+ * @public
24
21
  */
25
22
  cacheMiddleware?: boolean;
26
23
  /**
@@ -6,9 +6,9 @@
6
6
  */
7
7
  export declare const throwDefaultError: ({ output, parsedBody, exceptionCtor, errorCode }: any) => never;
8
8
  /**
9
- * @internal
10
- *
11
9
  * Creates {@link throwDefaultError} with bound ExceptionCtor.
10
+ *
11
+ * @internal
12
12
  */
13
13
  export declare const withBaseException: (ExceptionCtor: {
14
14
  new (...args: any): any;
@@ -1,8 +1,7 @@
1
1
  /**
2
- * @internal
3
- *
4
2
  * Emits warning if the provided Node.js version string is pending deprecation.
5
3
  *
4
+ * @internal
6
5
  * @param version - The Node.js version string.
7
6
  */
8
7
  export declare const emitWarningIfUnsupportedVersion: (version: string) => void;
@@ -13,9 +13,9 @@ export interface ServiceExceptionOptions extends SmithyException, MetadataBearer
13
13
  message?: string;
14
14
  }
15
15
  /**
16
- * @public
17
- *
18
16
  * Base exception class for the exceptions from the server-side.
17
+ *
18
+ * @public
19
19
  */
20
20
  export declare class ServiceException extends Error implements SmithyException, MetadataBearer {
21
21
  readonly $fault: "client" | "server";
@@ -6,9 +6,9 @@ import { type PartialRetryRuntimeConfigType } from "./retry";
6
6
  */
7
7
  export type DefaultExtensionRuntimeConfigType = PartialRetryRuntimeConfigType & PartialChecksumRuntimeConfigType;
8
8
  /**
9
- * @internal
10
- *
11
9
  * Helper function to resolve default extension configuration from runtime config
10
+ *
11
+ * @internal
12
12
  */
13
13
  export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => {
14
14
  addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void;
@@ -18,10 +18,10 @@ export declare const getDefaultExtensionConfiguration: (runtimeConfig: DefaultEx
18
18
  retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategyV2 | import("@smithy/types").RetryStrategy>;
19
19
  };
20
20
  /**
21
- * @deprecated use getDefaultExtensionConfiguration
22
- * @internal
23
- *
24
21
  * Helper function to resolve default extension configuration from runtime config
22
+ *
23
+ * @internal
24
+ * @deprecated use getDefaultExtensionConfiguration
25
25
  */
26
26
  export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExtensionRuntimeConfigType) => {
27
27
  addChecksumAlgorithm(algo: import("@smithy/types").ChecksumAlgorithm): void;
@@ -31,8 +31,8 @@ export declare const getDefaultClientConfiguration: (runtimeConfig: DefaultExten
31
31
  retryStrategy(): import("@smithy/types").Provider<import("@smithy/types").RetryStrategyV2 | import("@smithy/types").RetryStrategy>;
32
32
  };
33
33
  /**
34
- * @internal
35
- *
36
34
  * Helper function to resolve runtime config from default extension configuration
35
+ *
36
+ * @internal
37
37
  */
38
38
  export declare const resolveDefaultRuntimeConfig: (config: DefaultExtensionConfiguration) => DefaultExtensionRuntimeConfigType;