@smithy/core 3.33.1 → 3.33.3

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 (52) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist-cjs/index.js +3 -1
  3. package/dist-cjs/submodules/cbor/index.js +126 -39
  4. package/dist-cjs/submodules/client/index.js +14 -3
  5. package/dist-cjs/submodules/endpoints/index.browser.js +3 -1
  6. package/dist-cjs/submodules/endpoints/index.js +3 -1
  7. package/dist-cjs/submodules/event-streams/index.browser.js +10 -1
  8. package/dist-cjs/submodules/event-streams/index.js +10 -1
  9. package/dist-cjs/submodules/protocols/index.js +16 -2
  10. package/dist-cjs/submodules/retry/index.browser.js +4 -1
  11. package/dist-cjs/submodules/retry/index.js +4 -1
  12. package/dist-cjs/submodules/serde/index.browser.js +4 -1
  13. package/dist-cjs/submodules/serde/index.js +4 -1
  14. package/dist-cjs/submodules/serde/index.native.js +4 -1
  15. package/dist-cjs/submodules/transport/index.js +7 -0
  16. package/dist-es/legacy-root-exports/util-identity-and-auth/DefaultIdentityProviderConfig.js +3 -0
  17. package/dist-es/submodules/cbor/cbor-decode.js +29 -13
  18. package/dist-es/submodules/cbor/cbor-encode.js +12 -4
  19. package/dist-es/submodules/cbor/codec-v1/CborShapeDeserializer.js +9 -0
  20. package/dist-es/submodules/cbor/codec-v1/CborShapeSerializer.js +7 -0
  21. package/dist-es/submodules/cbor/codec-v2/CborShapeDeserializer2.js +44 -15
  22. package/dist-es/submodules/cbor/codec-v2/CborShapeSerializer2.js +22 -4
  23. package/dist-es/submodules/cbor/parseCborBody.js +5 -0
  24. package/dist-es/submodules/client/smithy-client/extensions/checksum.js +3 -0
  25. package/dist-es/submodules/client/smithy-client/get-value-from-text-node.js +4 -1
  26. package/dist-es/submodules/client/smithy-client/object-mapping.js +6 -1
  27. package/dist-es/submodules/client/smithy-client/serde-json.js +4 -1
  28. package/dist-es/submodules/endpoints/util-endpoints/resolveEndpoint.js +3 -0
  29. package/dist-es/submodules/event-streams/EventStreamSerde.js +7 -0
  30. package/dist-es/submodules/event-streams/eventstream-codec/HeaderMarshaller.js +4 -1
  31. package/dist-es/submodules/protocols/HttpBindingProtocol.js +9 -0
  32. package/dist-es/submodules/protocols/HttpProtocol.js +5 -0
  33. package/dist-es/submodules/protocols/RpcProtocol.js +3 -0
  34. package/dist-es/submodules/retry/middleware-retry/parseRetryAfterHeader.js +4 -1
  35. package/dist-es/submodules/serde/index.browser.js +1 -0
  36. package/dist-es/submodules/serde/index.js +1 -0
  37. package/dist-es/submodules/serde/index.native.js +1 -0
  38. package/dist-es/submodules/serde/parse-utils.js +3 -0
  39. package/dist-es/submodules/transport/hasOwn.js +3 -0
  40. package/dist-es/submodules/transport/index.js +1 -0
  41. package/dist-es/submodules/transport/toEndpointV1.js +3 -0
  42. package/dist-types/submodules/serde/index.browser.d.ts +1 -0
  43. package/dist-types/submodules/serde/index.d.ts +1 -0
  44. package/dist-types/submodules/serde/index.native.d.ts +1 -0
  45. package/dist-types/submodules/transport/hasOwn.d.ts +4 -0
  46. package/dist-types/submodules/transport/index.d.ts +1 -0
  47. package/dist-types/ts3.4/submodules/serde/index.browser.d.ts +1 -0
  48. package/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  49. package/dist-types/ts3.4/submodules/serde/index.native.d.ts +1 -0
  50. package/dist-types/ts3.4/submodules/transport/hasOwn.d.ts +4 -0
  51. package/dist-types/ts3.4/submodules/transport/index.d.ts +1 -0
  52. package/package.json +2 -2
@@ -43,3 +43,4 @@ export { streamCollector } from "./util-stream/stream-collector.browser";
43
43
  const _getRandomValues = (array) => crypto.getRandomValues(array);
44
44
  export const v4 = bindV4(_getRandomValues);
45
45
  export const generateIdempotencyToken = v4;
46
+ export { hasOwn } from "@smithy/core/transport";
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "@smithy/core/transport";
1
2
  export const parseBoolean = (value) => {
2
3
  switch (value) {
3
4
  case "true":
@@ -137,6 +138,8 @@ export const expectUnion = (value) => {
137
138
  const asObject = expectObject(value);
138
139
  const setKeys = [];
139
140
  for (const k in asObject) {
141
+ if (!hasOwn(asObject, k))
142
+ continue;
140
143
  if (asObject[k] != null) {
141
144
  setKeys.push(k);
142
145
  }
@@ -0,0 +1,3 @@
1
+ export function hasOwn(o, k) {
2
+ return Object.prototype.hasOwnProperty.call(o, k);
3
+ }
@@ -1,4 +1,5 @@
1
1
  export { getSmithyContext } from "./getSmithyContext";
2
+ export { hasOwn } from "./hasOwn";
2
3
  export { HttpRequest } from "./httpRequest";
3
4
  export { HttpResponse } from "./httpResponse";
4
5
  export { isValidHostLabel } from "./isValidHostLabel";
@@ -1,3 +1,4 @@
1
+ import { hasOwn } from "./hasOwn";
1
2
  import { parseUrl } from "./parseUrl";
2
3
  export const toEndpointV1 = (endpoint) => {
3
4
  if (typeof endpoint === "object") {
@@ -6,6 +7,8 @@ export const toEndpointV1 = (endpoint) => {
6
7
  if (endpoint.headers) {
7
8
  v1Endpoint.headers = {};
8
9
  for (const name in endpoint.headers) {
10
+ if (!hasOwn(endpoint.headers, name))
11
+ continue;
9
12
  v1Endpoint.headers[name.toLowerCase()] = endpoint.headers[name].join(", ");
10
13
  }
11
14
  }
@@ -39,3 +39,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
39
39
  export { streamCollector } from "./util-stream/stream-collector.browser";
40
40
  export declare const v4: () => string;
41
41
  export declare const generateIdempotencyToken: () => string;
42
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector.browser";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare function hasOwn(o: object, k: string): boolean;
@@ -1,4 +1,5 @@
1
1
  export { getSmithyContext } from "./getSmithyContext";
2
+ export { hasOwn } from "./hasOwn";
2
3
  export { HttpRequest } from "./httpRequest";
3
4
  export type { IHttpRequest } from "./httpRequest";
4
5
  export { HttpResponse } from "./httpResponse";
@@ -39,3 +39,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
39
39
  export { streamCollector } from "./util-stream/stream-collector.browser";
40
40
  export declare const v4: () => string;
41
41
  export declare const generateIdempotencyToken: () => string;
42
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -37,3 +37,4 @@ export { isReadableStream, isBlob } from "./util-stream/stream-type-check";
37
37
  export { streamCollector } from "./util-stream/stream-collector.browser";
38
38
  export declare const v4: () => string;
39
39
  export declare const generateIdempotencyToken: () => string;
40
+ export { hasOwn } from "@smithy/core/transport";
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare function hasOwn(o: object, k: string): boolean;
@@ -1,4 +1,5 @@
1
1
  export { getSmithyContext } from "./getSmithyContext";
2
+ export { hasOwn } from "./hasOwn";
2
3
  export { HttpRequest } from "./httpRequest";
3
4
  export { IHttpRequest } from "./httpRequest";
4
5
  export { HttpResponse } from "./httpResponse";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.33.1",
3
+ "version": "3.33.3",
4
4
  "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -232,7 +232,7 @@
232
232
  "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
233
233
  },
234
234
  "dependencies": {
235
- "@smithy/types": "^4.17.1",
235
+ "@smithy/types": "^4.17.2",
236
236
  "tslib": "^2.6.2"
237
237
  },
238
238
  "devDependencies": {