@smithy/core 3.1.4 → 3.2.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.
@@ -0,0 +1,41 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/submodules/serde/index.ts
20
+ var serde_exports = {};
21
+ __export(serde_exports, {
22
+ NumericValue: () => NumericValue,
23
+ nv: () => nv
24
+ });
25
+ module.exports = __toCommonJS(serde_exports);
26
+
27
+ // src/submodules/serde/value/NumericValue.ts
28
+ var NumericValue = class {
29
+ constructor(string, type) {
30
+ this.string = string;
31
+ this.type = type;
32
+ }
33
+ };
34
+ function nv(string) {
35
+ return new NumericValue(string, "bigDecimal");
36
+ }
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ NumericValue,
40
+ nv
41
+ });
@@ -0,0 +1 @@
1
+ export * from "./value/NumericValue";
@@ -0,0 +1,9 @@
1
+ export class NumericValue {
2
+ constructor(string, type) {
3
+ this.string = string;
4
+ this.type = type;
5
+ }
6
+ }
7
+ export function nv(string) {
8
+ return new NumericValue(string, "bigDecimal");
9
+ }
@@ -0,0 +1 @@
1
+ export * from "./value/NumericValue";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Types which may be represented by {@link NumericValue}.
3
+ *
4
+ * There is currently only one option, because BigInteger and Long should
5
+ * use JS BigInt directly, and all other numeric types can be contained in JS Number.
6
+ *
7
+ * @public
8
+ */
9
+ export type NumericType = "bigDecimal";
10
+ /**
11
+ * Serialization container for Smithy simple types that do not have a
12
+ * direct JavaScript runtime representation.
13
+ *
14
+ * This container does not perform numeric mathematical operations.
15
+ * It is a container for discerning a value's true type.
16
+ *
17
+ * It allows storage of numeric types not representable in JS without
18
+ * making a decision on what numeric library to use.
19
+ *
20
+ * @public
21
+ */
22
+ export declare class NumericValue {
23
+ readonly string: string;
24
+ readonly type: NumericType;
25
+ constructor(string: string, type: NumericType);
26
+ }
27
+ /**
28
+ * Serde shortcut.
29
+ * @internal
30
+ */
31
+ export declare function nv(string: string): NumericValue;
@@ -0,0 +1 @@
1
+ export * from "./value/NumericValue";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Types which may be represented by {@link NumericValue}.
3
+ *
4
+ * There is currently only one option, because BigInteger and Long should
5
+ * use JS BigInt directly, and all other numeric types can be contained in JS Number.
6
+ *
7
+ * @public
8
+ */
9
+ export type NumericType = "bigDecimal";
10
+ /**
11
+ * Serialization container for Smithy simple types that do not have a
12
+ * direct JavaScript runtime representation.
13
+ *
14
+ * This container does not perform numeric mathematical operations.
15
+ * It is a container for discerning a value's true type.
16
+ *
17
+ * It allows storage of numeric types not representable in JS without
18
+ * making a decision on what numeric library to use.
19
+ *
20
+ * @public
21
+ */
22
+ export declare class NumericValue {
23
+ readonly string: string;
24
+ readonly type: NumericType;
25
+ constructor(string: string, type: NumericType);
26
+ }
27
+ /**
28
+ * Serde shortcut.
29
+ * @internal
30
+ */
31
+ export declare function nv(string: string): NumericValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.1.4",
3
+ "version": "3.2.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",
@@ -45,6 +45,13 @@
45
45
  "import": "./dist-es/submodules/protocols/index.js",
46
46
  "require": "./dist-cjs/submodules/protocols/index.js",
47
47
  "types": "./dist-types/submodules/protocols/index.d.ts"
48
+ },
49
+ "./serde": {
50
+ "module": "./dist-es/submodules/serde/index.js",
51
+ "node": "./dist-cjs/submodules/serde/index.js",
52
+ "import": "./dist-es/submodules/serde/index.js",
53
+ "require": "./dist-cjs/submodules/serde/index.js",
54
+ "types": "./dist-types/submodules/serde/index.d.ts"
48
55
  }
49
56
  },
50
57
  "author": {
@@ -54,12 +61,12 @@
54
61
  },
55
62
  "license": "Apache-2.0",
56
63
  "dependencies": {
57
- "@smithy/middleware-serde": "^4.0.2",
58
- "@smithy/protocol-http": "^5.0.1",
59
- "@smithy/types": "^4.1.0",
64
+ "@smithy/middleware-serde": "^4.0.3",
65
+ "@smithy/protocol-http": "^5.1.0",
66
+ "@smithy/types": "^4.2.0",
60
67
  "@smithy/util-body-length-browser": "^4.0.0",
61
- "@smithy/util-middleware": "^4.0.1",
62
- "@smithy/util-stream": "^4.1.1",
68
+ "@smithy/util-middleware": "^4.0.2",
69
+ "@smithy/util-stream": "^4.2.0",
63
70
  "@smithy/util-utf8": "^4.0.0",
64
71
  "tslib": "^2.6.2"
65
72
  },
@@ -78,12 +85,14 @@
78
85
  "./cbor.js",
79
86
  "./protocols.d.ts",
80
87
  "./protocols.js",
88
+ "./serde.d.ts",
89
+ "./serde.js",
81
90
  "dist-*/**"
82
91
  ],
83
- "homepage": "https://github.com/awslabs/smithy-typescript/tree/main/packages/core",
92
+ "homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/core",
84
93
  "repository": {
85
94
  "type": "git",
86
- "url": "https://github.com/awslabs/smithy-typescript.git",
95
+ "url": "https://github.com/smithy-lang/smithy-typescript.git",
87
96
  "directory": "packages/core"
88
97
  },
89
98
  "devDependencies": {
package/serde.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Do not edit:
3
+ * This is a compatibility redirect for contexts that do not understand package.json exports field.
4
+ */
5
+ declare module "@smithy/core/serde" {
6
+ export * from "@smithy/core/dist-types/submodules/serde/index.d";
7
+ }
package/serde.js ADDED
@@ -0,0 +1,6 @@
1
+
2
+ /**
3
+ * Do not edit:
4
+ * This is a compatibility redirect for contexts that do not understand package.json exports field.
5
+ */
6
+ module.exports = require("./dist-cjs/submodules/serde/index.js");