@jjrawlins/cdk-ami-builder 0.0.48 → 0.0.50

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 (150) hide show
  1. package/.jsii +11 -11
  2. package/cdk-ami-builder/jsii/jsii.go +2 -2
  3. package/cdk-ami-builder/version +1 -1
  4. package/lib/ImagePipeline/ImagePipeline.js +1 -1
  5. package/lib/Lambdas/CheckStateMachineStatus/CheckStateMachineStatus-function.js +1 -1
  6. package/lib/Lambdas/StartStateMachine/StartStateMachine-function.js +1 -1
  7. package/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js +88090 -87044
  8. package/node_modules/@aws-sdk/client-ec2/package.json +6 -6
  9. package/node_modules/@aws-sdk/client-ecs/dist-cjs/index.js +4836 -5148
  10. package/node_modules/@aws-sdk/client-ecs/package.json +6 -6
  11. package/node_modules/@aws-sdk/client-kms/dist-cjs/index.js +3963 -4397
  12. package/node_modules/@aws-sdk/client-kms/package.json +6 -6
  13. package/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +11771 -11916
  14. package/node_modules/@aws-sdk/client-s3/package.json +10 -10
  15. package/node_modules/@aws-sdk/client-secrets-manager/dist-cjs/index.js +1582 -1740
  16. package/node_modules/@aws-sdk/client-secrets-manager/package.json +6 -6
  17. package/node_modules/@aws-sdk/client-sfn/dist-cjs/index.js +3292 -3664
  18. package/node_modules/@aws-sdk/client-sfn/package.json +6 -6
  19. package/node_modules/@aws-sdk/client-sns/dist-cjs/index.js +4326 -4601
  20. package/node_modules/@aws-sdk/client-sns/package.json +6 -6
  21. package/node_modules/@aws-sdk/client-sqs/dist-cjs/index.js +2114 -2361
  22. package/node_modules/@aws-sdk/client-sqs/package.json +6 -6
  23. package/node_modules/@aws-sdk/client-ssm/dist-cjs/index.js +12508 -13696
  24. package/node_modules/@aws-sdk/client-ssm/package.json +6 -6
  25. package/node_modules/@aws-sdk/client-sso/dist-cjs/index.js +478 -596
  26. package/node_modules/@aws-sdk/client-sso/package.json +5 -5
  27. package/node_modules/@aws-sdk/core/dist-cjs/index.js +1969 -6
  28. package/node_modules/@aws-sdk/core/dist-cjs/submodules/account-id-endpoint/index.js +48 -88
  29. package/node_modules/@aws-sdk/core/dist-cjs/submodules/client/index.js +35 -74
  30. package/node_modules/@aws-sdk/core/dist-cjs/submodules/httpAuthSchemes/index.js +273 -365
  31. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1581 -1863
  32. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +2 -2
  33. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +2 -2
  34. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +4 -4
  35. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +4 -4
  36. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +3 -3
  37. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +4 -4
  38. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +2 -2
  39. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +4 -4
  40. package/node_modules/@aws-sdk/core/dist-types/submodules/account-id-endpoint/AccountIdEndpointModeConfigResolver.d.ts +1 -1
  41. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4ASigner.d.ts +1 -1
  42. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/AwsSdkSigV4Signer.d.ts +1 -1
  43. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4AConfig.d.ts +1 -1
  44. package/node_modules/@aws-sdk/core/dist-types/submodules/httpAuthSchemes/aws_sdk/resolveAwsSdkSigV4Config.d.ts +1 -1
  45. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +1 -1
  46. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonCodec.d.ts +1 -1
  47. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +1 -1
  48. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
  49. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QuerySerializerSettings.d.ts +1 -1
  50. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlCodec.d.ts +1 -1
  51. package/node_modules/@aws-sdk/core/package.json +1 -1
  52. package/node_modules/@aws-sdk/credential-provider-env/dist-cjs/index.js +38 -73
  53. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  54. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  55. package/node_modules/@aws-sdk/credential-provider-ini/dist-cjs/index.js +194 -259
  56. package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
  57. package/node_modules/@aws-sdk/credential-provider-node/dist-cjs/index.js +72 -132
  58. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  59. package/node_modules/@aws-sdk/credential-provider-process/dist-cjs/index.js +71 -107
  60. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  61. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/index.js +176 -249
  62. package/node_modules/@aws-sdk/credential-provider-sso/dist-cjs/loadSso-CVy8iqsZ.js +14 -0
  63. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  64. package/node_modules/@aws-sdk/credential-provider-web-identity/dist-cjs/index.js +16 -25
  65. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  66. package/node_modules/@aws-sdk/middleware-flexible-checksums/dist-cjs/index.js +381 -478
  67. package/node_modules/@aws-sdk/middleware-flexible-checksums/package.json +2 -2
  68. package/node_modules/@aws-sdk/middleware-sdk-s3/dist-cjs/index.js +511 -641
  69. package/node_modules/@aws-sdk/middleware-sdk-s3/package.json +2 -2
  70. package/node_modules/@aws-sdk/middleware-user-agent/dist-cjs/index.js +170 -203
  71. package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
  72. package/node_modules/@aws-sdk/nested-clients/dist-cjs/index.js +2 -2
  73. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +583 -858
  74. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +795 -928
  75. package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
  76. package/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +108 -137
  77. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +2 -2
  78. package/node_modules/@aws-sdk/token-providers/dist-cjs/index.js +147 -222
  79. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  80. package/node_modules/@aws-sdk/util-user-agent-browser/README.md +22 -3
  81. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/createUserAgentStringParsingProvider.js +57 -0
  82. package/node_modules/@aws-sdk/util-user-agent-browser/dist-cjs/index.js +39 -8
  83. package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/createUserAgentStringParsingProvider.js +20 -0
  84. package/node_modules/@aws-sdk/util-user-agent-browser/dist-es/index.js +37 -6
  85. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/createUserAgentStringParsingProvider.d.ts +14 -0
  86. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.d.ts +14 -4
  87. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/index.native.d.ts +4 -3
  88. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/createUserAgentStringParsingProvider.d.ts +9 -0
  89. package/node_modules/@aws-sdk/util-user-agent-browser/dist-types/ts3.4/index.d.ts +5 -0
  90. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +1 -1
  91. package/node_modules/@aws-sdk/util-user-agent-node/dist-cjs/index.js +50 -94
  92. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/crt-availability.d.ts +1 -2
  93. package/node_modules/@aws-sdk/util-user-agent-node/dist-types/defaultUserAgent.d.ts +10 -5
  94. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  95. package/node_modules/@smithy/chunked-blob-reader-native/package.json +2 -2
  96. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +1 -1
  97. package/node_modules/@smithy/core/dist-cjs/submodules/event-streams/index.js +5 -3
  98. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +32 -30
  99. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +133 -202
  100. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +126 -34
  101. package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +2 -2
  102. package/node_modules/@smithy/core/dist-es/submodules/event-streams/EventStreamSerde.js +5 -3
  103. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +4 -4
  104. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +3 -3
  105. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +2 -2
  106. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +19 -17
  107. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +4 -4
  108. package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +5 -6
  109. package/node_modules/@smithy/core/dist-es/submodules/schema/index.js +1 -0
  110. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +82 -176
  111. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/translateTraits.js +22 -0
  112. package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +1 -0
  113. package/node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +110 -0
  114. package/node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js +4 -26
  115. package/node_modules/@smithy/core/dist-types/submodules/schema/index.d.ts +1 -0
  116. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
  117. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +2 -0
  118. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/translateTraits.d.ts +7 -0
  119. package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +1 -0
  120. package/node_modules/@smithy/core/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
  121. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/index.d.ts +1 -0
  122. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +5 -24
  123. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +2 -0
  124. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +7 -0
  125. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  126. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
  127. package/node_modules/@smithy/core/package.json +3 -3
  128. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  129. package/node_modules/@smithy/hash-blob-browser/package.json +2 -2
  130. package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
  131. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  132. package/node_modules/@smithy/smithy-client/package.json +4 -4
  133. package/node_modules/@smithy/util-base64/dist-cjs/constants.browser.js +9 -32
  134. package/node_modules/@smithy/util-base64/dist-es/constants.browser.js +9 -28
  135. package/node_modules/@smithy/util-base64/dist-types/constants.browser.d.ts +5 -6
  136. package/node_modules/@smithy/util-base64/dist-types/ts3.4/constants.browser.d.ts +5 -6
  137. package/node_modules/@smithy/util-base64/package.json +1 -1
  138. package/node_modules/@smithy/util-body-length-node/dist-cjs/index.js +8 -6
  139. package/node_modules/@smithy/util-body-length-node/dist-es/calculateBodyLength.js +8 -6
  140. package/node_modules/@smithy/util-body-length-node/package.json +1 -1
  141. package/node_modules/@smithy/util-defaults-mode-browser/dist-cjs/resolveDefaultsModeConfig.js +11 -9
  142. package/node_modules/@smithy/util-defaults-mode-browser/dist-es/resolveDefaultsModeConfig.js +11 -8
  143. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -3
  144. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  145. package/node_modules/@smithy/util-stream/dist-cjs/index.js +3 -5
  146. package/node_modules/@smithy/util-stream/dist-es/blob/Uint8ArrayBlobAdapter.js +3 -5
  147. package/node_modules/@smithy/util-stream/dist-types/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
  148. package/node_modules/@smithy/util-stream/dist-types/ts3.4/blob/Uint8ArrayBlobAdapter.d.ts +1 -0
  149. package/node_modules/@smithy/util-stream/package.json +3 -3
  150. package/package.json +11 -11
@@ -1,28 +1,9 @@
1
- const alphabetByEncoding = {};
2
- const alphabetByValue = new Array(64);
3
- for (let i = 0, start = "A".charCodeAt(0), limit = "Z".charCodeAt(0); i + start <= limit; i++) {
4
- const char = String.fromCharCode(i + start);
5
- alphabetByEncoding[char] = i;
6
- alphabetByValue[i] = char;
7
- }
8
- for (let i = 0, start = "a".charCodeAt(0), limit = "z".charCodeAt(0); i + start <= limit; i++) {
9
- const char = String.fromCharCode(i + start);
10
- const index = i + 26;
11
- alphabetByEncoding[char] = index;
12
- alphabetByValue[index] = char;
13
- }
14
- for (let i = 0; i < 10; i++) {
15
- alphabetByEncoding[i.toString(10)] = i + 52;
16
- const char = i.toString(10);
17
- const index = i + 52;
18
- alphabetByEncoding[char] = index;
19
- alphabetByValue[index] = char;
20
- }
21
- alphabetByEncoding["+"] = 62;
22
- alphabetByValue[62] = "+";
23
- alphabetByEncoding["/"] = 63;
24
- alphabetByValue[63] = "/";
25
- const bitsPerLetter = 6;
26
- const bitsPerByte = 8;
27
- const maxLetterValue = 0b111111;
28
- export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue };
1
+ const chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
2
+ export const alphabetByEncoding = Object.entries(chars).reduce((acc, [i, c]) => {
3
+ acc[c] = Number(i);
4
+ return acc;
5
+ }, {});
6
+ export const alphabetByValue = chars.split("");
7
+ export const bitsPerLetter = 6;
8
+ export const bitsPerByte = 8;
9
+ export const maxLetterValue = 0b111111;
@@ -1,6 +1,5 @@
1
- declare const alphabetByEncoding: Record<string, number>;
2
- declare const alphabetByValue: Array<string>;
3
- declare const bitsPerLetter = 6;
4
- declare const bitsPerByte = 8;
5
- declare const maxLetterValue = 63;
6
- export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue };
1
+ export declare const alphabetByEncoding: Record<string, number>;
2
+ export declare const alphabetByValue: Array<string>;
3
+ export declare const bitsPerLetter = 6;
4
+ export declare const bitsPerByte = 8;
5
+ export declare const maxLetterValue = 63;
@@ -1,6 +1,5 @@
1
- declare const alphabetByEncoding: Record<string, number>;
2
- declare const alphabetByValue: Array<string>;
3
- declare const bitsPerLetter = 6;
4
- declare const bitsPerByte = 8;
5
- declare const maxLetterValue = 63;
6
- export { alphabetByEncoding, alphabetByValue, bitsPerLetter, bitsPerByte, maxLetterValue };
1
+ export declare const alphabetByEncoding: Record<string, number>;
2
+ export declare const alphabetByValue: Array<string>;
3
+ export declare const bitsPerLetter = 6;
4
+ export declare const bitsPerByte = 8;
5
+ export declare const maxLetterValue = 63;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-base64",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "description": "A Base64 <-> UInt8Array converter",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var fs = require('fs');
3
+ var node_fs = require('node:fs');
4
4
 
5
5
  const calculateBodyLength = (body) => {
6
6
  if (!body) {
@@ -18,11 +18,13 @@ const calculateBodyLength = (body) => {
18
18
  else if (typeof body.start === "number" && typeof body.end === "number") {
19
19
  return body.end + 1 - body.start;
20
20
  }
21
- else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
22
- return fs.lstatSync(body.path).size;
23
- }
24
- else if (typeof body.fd === "number") {
25
- return fs.fstatSync(body.fd).size;
21
+ else if (body instanceof node_fs.ReadStream) {
22
+ if (body.path != null) {
23
+ return node_fs.lstatSync(body.path).size;
24
+ }
25
+ else if (typeof body.fd === "number") {
26
+ return node_fs.fstatSync(body.fd).size;
27
+ }
26
28
  }
27
29
  throw new Error(`Body Length computation failed for ${body}`);
28
30
  };
@@ -1,4 +1,4 @@
1
- import { fstatSync, lstatSync } from "fs";
1
+ import { fstatSync, lstatSync, ReadStream } from "node:fs";
2
2
  export const calculateBodyLength = (body) => {
3
3
  if (!body) {
4
4
  return 0;
@@ -15,11 +15,13 @@ export const calculateBodyLength = (body) => {
15
15
  else if (typeof body.start === "number" && typeof body.end === "number") {
16
16
  return body.end + 1 - body.start;
17
17
  }
18
- else if (typeof body.path === "string" || Buffer.isBuffer(body.path)) {
19
- return lstatSync(body.path).size;
20
- }
21
- else if (typeof body.fd === "number") {
22
- return fstatSync(body.fd).size;
18
+ else if (body instanceof ReadStream) {
19
+ if (body.path != null) {
20
+ return lstatSync(body.path).size;
21
+ }
22
+ else if (typeof body.fd === "number") {
23
+ return fstatSync(body.fd).size;
24
+ }
23
25
  }
24
26
  throw new Error(`Body Length computation failed for ${body}`);
25
27
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@smithy/util-body-length-node",
3
3
  "description": "Determines the length of a request body in node.js",
4
- "version": "4.2.0",
4
+ "version": "4.2.1",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
7
7
  "build:cjs": "node ../../scripts/inline util-body-length-node",
@@ -1,15 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveDefaultsModeConfig = void 0;
4
- const tslib_1 = require("tslib");
5
4
  const property_provider_1 = require("@smithy/property-provider");
6
- const bowser_1 = tslib_1.__importDefault(require("bowser"));
7
5
  const constants_1 = require("./constants");
8
6
  const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => (0, property_provider_1.memoize)(async () => {
9
7
  const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
10
8
  switch (mode?.toLowerCase()) {
11
9
  case "auto":
12
- return Promise.resolve(isMobileBrowser() ? "mobile" : "standard");
10
+ return Promise.resolve(useMobileConfiguration() ? "mobile" : "standard");
13
11
  case "mobile":
14
12
  case "in-region":
15
13
  case "cross-region":
@@ -23,10 +21,14 @@ const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => (0, property_provi
23
21
  }
24
22
  });
25
23
  exports.resolveDefaultsModeConfig = resolveDefaultsModeConfig;
26
- const isMobileBrowser = () => {
27
- const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent
28
- ? bowser_1.default.parse(window.navigator.userAgent)
29
- : undefined;
30
- const platform = parsedUA?.platform?.type;
31
- return platform === "tablet" || platform === "mobile";
24
+ const useMobileConfiguration = () => {
25
+ const navigator = window?.navigator;
26
+ if (navigator?.connection) {
27
+ const { effectiveType, rtt, downlink } = navigator?.connection;
28
+ const slow = (typeof effectiveType === "string" && effectiveType !== "4g") || Number(rtt) > 100 || Number(downlink) < 10;
29
+ if (slow) {
30
+ return true;
31
+ }
32
+ }
33
+ return (navigator?.userAgentData?.mobile || (typeof navigator?.maxTouchPoints === "number" && navigator?.maxTouchPoints > 1));
32
34
  };
@@ -1,11 +1,10 @@
1
1
  import { memoize } from "@smithy/property-provider";
2
- import bowser from "bowser";
3
2
  import { DEFAULTS_MODE_OPTIONS } from "./constants";
4
3
  export const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => memoize(async () => {
5
4
  const mode = typeof defaultsMode === "function" ? await defaultsMode() : defaultsMode;
6
5
  switch (mode?.toLowerCase()) {
7
6
  case "auto":
8
- return Promise.resolve(isMobileBrowser() ? "mobile" : "standard");
7
+ return Promise.resolve(useMobileConfiguration() ? "mobile" : "standard");
9
8
  case "mobile":
10
9
  case "in-region":
11
10
  case "cross-region":
@@ -18,10 +17,14 @@ export const resolveDefaultsModeConfig = ({ defaultsMode, } = {}) => memoize(asy
18
17
  throw new Error(`Invalid parameter for "defaultsMode", expect ${DEFAULTS_MODE_OPTIONS.join(", ")}, got ${mode}`);
19
18
  }
20
19
  });
21
- const isMobileBrowser = () => {
22
- const parsedUA = typeof window !== "undefined" && window?.navigator?.userAgent
23
- ? bowser.parse(window.navigator.userAgent)
24
- : undefined;
25
- const platform = parsedUA?.platform?.type;
26
- return platform === "tablet" || platform === "mobile";
20
+ const useMobileConfiguration = () => {
21
+ const navigator = window?.navigator;
22
+ if (navigator?.connection) {
23
+ const { effectiveType, rtt, downlink } = navigator?.connection;
24
+ const slow = (typeof effectiveType === "string" && effectiveType !== "4g") || Number(rtt) > 100 || Number(downlink) < 10;
25
+ if (slow) {
26
+ return true;
27
+ }
28
+ }
29
+ return (navigator?.userAgentData?.mobile || (typeof navigator?.maxTouchPoints === "number" && navigator?.maxTouchPoints > 1));
27
30
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-browser",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-defaults-mode-browser",
@@ -25,9 +25,8 @@
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
27
  "@smithy/property-provider": "^4.2.0",
28
- "@smithy/smithy-client": "^4.7.0",
28
+ "@smithy/smithy-client": "^4.7.1",
29
29
  "@smithy/types": "^4.6.0",
30
- "bowser": "^2.11.0",
31
30
  "tslib": "^2.6.2"
32
31
  },
33
32
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-node",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-defaults-mode-node",
@@ -28,7 +28,7 @@
28
28
  "@smithy/credential-provider-imds": "^4.2.0",
29
29
  "@smithy/node-config-provider": "^4.3.0",
30
30
  "@smithy/property-provider": "^4.2.0",
31
- "@smithy/smithy-client": "^4.7.0",
31
+ "@smithy/smithy-client": "^4.7.1",
32
32
  "@smithy/types": "^4.6.0",
33
33
  "tslib": "^2.6.2"
34
34
  },
@@ -26,12 +26,10 @@ function transformFromString(str, encoding) {
26
26
 
27
27
  class Uint8ArrayBlobAdapter extends Uint8Array {
28
28
  static fromString(source, encoding = "utf-8") {
29
- switch (typeof source) {
30
- case "string":
31
- return transformFromString(source, encoding);
32
- default:
33
- throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
29
+ if (typeof source === "string") {
30
+ return transformFromString(source, encoding);
34
31
  }
32
+ throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
35
33
  }
36
34
  static mutate(source) {
37
35
  Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
@@ -1,12 +1,10 @@
1
1
  import { transformFromString, transformToString } from "./transforms";
2
2
  export class Uint8ArrayBlobAdapter extends Uint8Array {
3
3
  static fromString(source, encoding = "utf-8") {
4
- switch (typeof source) {
5
- case "string":
6
- return transformFromString(source, encoding);
7
- default:
8
- throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
4
+ if (typeof source === "string") {
5
+ return transformFromString(source, encoding);
9
6
  }
7
+ throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
10
8
  }
11
9
  static mutate(source) {
12
10
  Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
@@ -5,6 +5,7 @@
5
5
  export declare class Uint8ArrayBlobAdapter extends Uint8Array {
6
6
  /**
7
7
  * @param source - such as a string or Stream.
8
+ * @param encoding - utf-8 or base64.
8
9
  * @returns a new Uint8ArrayBlobAdapter extending Uint8Array.
9
10
  */
10
11
  static fromString(source: string, encoding?: string): Uint8ArrayBlobAdapter;
@@ -5,6 +5,7 @@
5
5
  export declare class Uint8ArrayBlobAdapter extends Uint8Array {
6
6
  /**
7
7
  * @param source - such as a string or Stream.
8
+ * @param encoding - utf-8 or base64.
8
9
  * @returns a new Uint8ArrayBlobAdapter extending Uint8Array.
9
10
  */
10
11
  static fromString(source: string, encoding?: string): Uint8ArrayBlobAdapter;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-stream",
3
- "version": "4.4.0",
3
+ "version": "4.5.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-stream",
@@ -29,10 +29,10 @@
29
29
  "license": "Apache-2.0",
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
- "@smithy/fetch-http-handler": "^5.3.0",
32
+ "@smithy/fetch-http-handler": "^5.3.1",
33
33
  "@smithy/node-http-handler": "^4.3.0",
34
34
  "@smithy/types": "^4.6.0",
35
- "@smithy/util-base64": "^4.2.0",
35
+ "@smithy/util-base64": "^4.3.0",
36
36
  "@smithy/util-buffer-from": "^4.2.0",
37
37
  "@smithy/util-hex-encoding": "^4.2.0",
38
38
  "@smithy/util-utf8": "^4.2.0",
package/package.json CHANGED
@@ -50,7 +50,7 @@
50
50
  "@types/axios": "^0.14.4",
51
51
  "@types/jest": "^29.5.14",
52
52
  "@types/lodash": "^4.17.20",
53
- "@types/node": "^20.19.19",
53
+ "@types/node": "^20.19.20",
54
54
  "@typescript-eslint/eslint-plugin": "^8",
55
55
  "@typescript-eslint/parser": "^8",
56
56
  "aws-cdk": "2.1029.2",
@@ -77,15 +77,15 @@
77
77
  "constructs": "^10.0.5"
78
78
  },
79
79
  "dependencies": {
80
- "@aws-sdk/client-ec2": "^3.901.0",
81
- "@aws-sdk/client-ecs": "^3.901.0",
82
- "@aws-sdk/client-kms": "^3.901.0",
83
- "@aws-sdk/client-s3": "^3.901.0",
84
- "@aws-sdk/client-secrets-manager": "^3.901.0",
85
- "@aws-sdk/client-sfn": "^3.901.0",
86
- "@aws-sdk/client-sns": "^3.901.0",
87
- "@aws-sdk/client-sqs": "^3.901.0",
88
- "@aws-sdk/client-ssm": "^3.901.0",
80
+ "@aws-sdk/client-ec2": "^3.907.0",
81
+ "@aws-sdk/client-ecs": "^3.907.0",
82
+ "@aws-sdk/client-kms": "^3.907.0",
83
+ "@aws-sdk/client-s3": "^3.907.0",
84
+ "@aws-sdk/client-secrets-manager": "^3.907.0",
85
+ "@aws-sdk/client-sfn": "^3.907.0",
86
+ "@aws-sdk/client-sns": "^3.907.0",
87
+ "@aws-sdk/client-sqs": "^3.907.0",
88
+ "@aws-sdk/client-ssm": "^3.907.0",
89
89
  "@types/aws-lambda": "^8.10.155",
90
90
  "@types/crypto-js": "^4.2.2",
91
91
  "@types/js-yaml": "^4.0.9",
@@ -135,7 +135,7 @@
135
135
  "publishConfig": {
136
136
  "access": "public"
137
137
  },
138
- "version": "0.0.48",
138
+ "version": "0.0.50",
139
139
  "jest": {
140
140
  "coverageProvider": "v8",
141
141
  "testMatch": [