@smithy/core 3.14.0 → 3.16.0

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 (62) hide show
  1. package/dist-cjs/submodules/cbor/index.js +4 -16
  2. package/dist-cjs/submodules/event-streams/index.js +5 -3
  3. package/dist-cjs/submodules/protocols/index.js +48 -44
  4. package/dist-cjs/submodules/schema/index.js +273 -319
  5. package/dist-cjs/submodules/serde/index.js +126 -34
  6. package/dist-es/index.js +1 -1
  7. package/dist-es/submodules/cbor/CborCodec.js +6 -17
  8. package/dist-es/submodules/event-streams/EventStreamSerde.js +5 -3
  9. package/dist-es/submodules/protocols/HttpBindingProtocol.js +4 -4
  10. package/dist-es/submodules/protocols/HttpProtocol.js +6 -5
  11. package/dist-es/submodules/protocols/RpcProtocol.js +2 -2
  12. package/dist-es/submodules/protocols/SerdeContext.js +6 -0
  13. package/dist-es/submodules/protocols/index.js +1 -0
  14. package/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +22 -22
  15. package/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +3 -2
  16. package/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +7 -9
  17. package/dist-es/submodules/protocols/serde/determineTimestampFormat.js +5 -6
  18. package/dist-es/submodules/schema/TypeRegistry.js +4 -4
  19. package/dist-es/submodules/schema/index.js +1 -0
  20. package/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +5 -1
  21. package/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +5 -1
  22. package/dist-es/submodules/schema/schemas/NormalizedSchema.js +104 -180
  23. package/dist-es/submodules/schema/schemas/translateTraits.js +22 -0
  24. package/dist-es/submodules/serde/index.js +1 -0
  25. package/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js +110 -0
  26. package/dist-es/submodules/serde/value/NumericValue.js +4 -26
  27. package/dist-types/index.d.ts +1 -1
  28. package/dist-types/submodules/cbor/CborCodec.d.ts +5 -10
  29. package/dist-types/submodules/protocols/HttpProtocol.d.ts +5 -2
  30. package/dist-types/submodules/protocols/SerdeContext.d.ts +8 -0
  31. package/dist-types/submodules/protocols/index.d.ts +1 -0
  32. package/dist-types/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +3 -4
  33. package/dist-types/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +5 -2
  34. package/dist-types/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +5 -2
  35. package/dist-types/submodules/protocols/serde/ToStringShapeSerializer.d.ts +3 -4
  36. package/dist-types/submodules/schema/TypeRegistry.d.ts +4 -4
  37. package/dist-types/submodules/schema/index.d.ts +1 -0
  38. package/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +26 -24
  39. package/dist-types/submodules/schema/schemas/sentinels.d.ts +2 -0
  40. package/dist-types/submodules/schema/schemas/translateTraits.d.ts +7 -0
  41. package/dist-types/submodules/serde/index.d.ts +1 -0
  42. package/dist-types/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
  43. package/dist-types/ts3.4/index.d.ts +1 -1
  44. package/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -10
  45. package/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +5 -2
  46. package/dist-types/ts3.4/submodules/protocols/SerdeContext.d.ts +8 -0
  47. package/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
  48. package/dist-types/ts3.4/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +3 -4
  49. package/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +5 -2
  50. package/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +5 -2
  51. package/dist-types/ts3.4/submodules/protocols/serde/ToStringShapeSerializer.d.ts +3 -4
  52. package/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +4 -4
  53. package/dist-types/ts3.4/submodules/schema/index.d.ts +1 -0
  54. package/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +26 -24
  55. package/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +2 -0
  56. package/dist-types/ts3.4/submodules/schema/schemas/translateTraits.d.ts +7 -0
  57. package/dist-types/ts3.4/submodules/serde/index.d.ts +1 -0
  58. package/dist-types/ts3.4/submodules/serde/schema-serde-lib/schema-date-utils.d.ts +47 -0
  59. package/package.json +8 -8
  60. /package/dist-es/{protocols → request-builder}/requestBuilder.js +0 -0
  61. /package/dist-types/{protocols → request-builder}/requestBuilder.d.ts +0 -0
  62. /package/dist-types/ts3.4/{protocols → request-builder}/requestBuilder.d.ts +0 -0
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @internal
3
+ *
4
+ * Parses a value into a Date. Returns undefined if the input is null or
5
+ * undefined, throws an error if the input is not a number or a parseable string.
6
+ *
7
+ * Input strings must be an integer or floating point number. Fractional seconds are supported.
8
+ *
9
+ * @param value - the value to parse
10
+ * @returns a Date or undefined
11
+ */
12
+ export declare const _parseEpochTimestamp: (value: unknown) => Date | undefined;
13
+ /**
14
+ * @internal
15
+ *
16
+ * Parses a value into a Date. Returns undefined if the input is null or
17
+ * undefined, throws an error if the input is not a string that can be parsed
18
+ * as an RFC 3339 date.
19
+ *
20
+ * Input strings must conform to RFC3339 section 5.6, and can have a UTC
21
+ * offset. Fractional precision is supported.
22
+ *
23
+ * @see {@link https://xml2rfc.tools.ietf.org/public/rfc/html/rfc3339.html#anchor14}
24
+ *
25
+ * @param value - the value to parse
26
+ * @returns a Date or undefined
27
+ */
28
+ export declare const _parseRfc3339DateTimeWithOffset: (value: unknown) => Date | undefined;
29
+ /**
30
+ * @internal
31
+ *
32
+ * Parses a value into a Date. Returns undefined if the input is null or
33
+ * undefined, throws an error if the input is not a string that can be parsed
34
+ * as an RFC 7231 date.
35
+ *
36
+ * Input strings must conform to RFC7231 section 7.1.1.1. Fractional seconds are supported.
37
+ *
38
+ * RFC 850 and unix asctime formats are also accepted.
39
+ * todo: practically speaking, are RFC 850 and asctime even used anymore?
40
+ * todo: can we remove those parts?
41
+ *
42
+ * @see {@link https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1}
43
+ *
44
+ * @param value - the value to parse.
45
+ * @returns a Date or undefined.
46
+ */
47
+ export declare const _parseRfc7231DateTime: (value: unknown) => Date | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.14.0",
3
+ "version": "3.16.0",
4
4
  "scripts": {
5
5
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline core",
@@ -77,13 +77,13 @@
77
77
  "license": "Apache-2.0",
78
78
  "sideEffects": false,
79
79
  "dependencies": {
80
- "@smithy/middleware-serde": "^4.2.0",
81
- "@smithy/protocol-http": "^5.3.0",
82
- "@smithy/types": "^4.6.0",
83
- "@smithy/util-base64": "^4.2.0",
80
+ "@smithy/middleware-serde": "^4.2.1",
81
+ "@smithy/protocol-http": "^5.3.1",
82
+ "@smithy/types": "^4.7.0",
83
+ "@smithy/util-base64": "^4.3.0",
84
84
  "@smithy/util-body-length-browser": "^4.2.0",
85
- "@smithy/util-middleware": "^4.2.0",
86
- "@smithy/util-stream": "^4.4.0",
85
+ "@smithy/util-middleware": "^4.2.1",
86
+ "@smithy/util-stream": "^4.5.1",
87
87
  "@smithy/util-utf8": "^4.2.0",
88
88
  "@smithy/uuid": "^1.1.0",
89
89
  "tslib": "^2.6.2"
@@ -118,7 +118,7 @@
118
118
  "directory": "packages/core"
119
119
  },
120
120
  "devDependencies": {
121
- "@smithy/eventstream-serde-node": "^4.2.0",
121
+ "@smithy/eventstream-serde-node": "^4.2.1",
122
122
  "@types/node": "^18.11.9",
123
123
  "concurrently": "7.0.0",
124
124
  "downlevel-dts": "0.10.1",