@smithy/core 3.15.0 → 3.16.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.
- package/dist-cjs/submodules/cbor/index.js +3 -15
- package/dist-cjs/submodules/protocols/index.js +16 -14
- package/dist-cjs/submodules/schema/index.js +226 -190
- package/dist-es/index.js +1 -1
- package/dist-es/submodules/cbor/CborCodec.js +4 -15
- package/dist-es/submodules/protocols/HttpProtocol.js +3 -2
- package/dist-es/submodules/protocols/SerdeContext.js +6 -0
- package/dist-es/submodules/protocols/index.js +1 -0
- package/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +3 -5
- package/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +3 -2
- package/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +3 -5
- package/dist-es/submodules/schema/TypeRegistry.js +18 -11
- package/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +5 -1
- package/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +5 -1
- package/dist-es/submodules/schema/schemas/NormalizedSchema.js +24 -6
- package/dist-es/submodules/schema/schemas/Schema.js +0 -2
- package/dist-es/submodules/schema/schemas/SimpleSchema.js +6 -0
- package/dist-types/index.d.ts +1 -1
- package/dist-types/submodules/cbor/CborCodec.d.ts +5 -10
- package/dist-types/submodules/protocols/HttpProtocol.d.ts +5 -2
- package/dist-types/submodules/protocols/SerdeContext.d.ts +8 -0
- package/dist-types/submodules/protocols/index.d.ts +1 -0
- package/dist-types/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +3 -4
- package/dist-types/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +5 -2
- package/dist-types/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +5 -2
- package/dist-types/submodules/protocols/serde/ToStringShapeSerializer.d.ts +3 -4
- package/dist-types/submodules/schema/TypeRegistry.d.ts +5 -6
- package/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +22 -1
- package/dist-types/submodules/schema/schemas/SimpleSchema.d.ts +5 -0
- package/dist-types/ts3.4/index.d.ts +1 -1
- package/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +5 -10
- package/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +5 -2
- package/dist-types/ts3.4/submodules/protocols/SerdeContext.d.ts +8 -0
- package/dist-types/ts3.4/submodules/protocols/index.d.ts +1 -0
- package/dist-types/ts3.4/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +3 -4
- package/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +5 -2
- package/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +5 -2
- package/dist-types/ts3.4/submodules/protocols/serde/ToStringShapeSerializer.d.ts +3 -4
- package/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +5 -6
- package/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +22 -1
- package/dist-types/ts3.4/submodules/schema/schemas/SimpleSchema.d.ts +5 -0
- package/package.json +7 -7
- /package/dist-es/{protocols → request-builder}/requestBuilder.js +0 -0
- /package/dist-types/{protocols → request-builder}/requestBuilder.d.ts +0 -0
- /package/dist-types/ts3.4/{protocols → request-builder}/requestBuilder.d.ts +0 -0
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { CodecSettings, Schema,
|
|
1
|
+
import { CodecSettings, Schema, ShapeSerializer } from "@smithy/types";
|
|
2
|
+
import { SerdeContext } from "../SerdeContext";
|
|
2
3
|
/**
|
|
3
4
|
* Serializes a shape to string.
|
|
4
5
|
*
|
|
5
6
|
* @alpha
|
|
6
7
|
*/
|
|
7
|
-
export declare class ToStringShapeSerializer implements ShapeSerializer<string> {
|
|
8
|
+
export declare class ToStringShapeSerializer extends SerdeContext implements ShapeSerializer<string> {
|
|
8
9
|
private settings;
|
|
9
10
|
private stringBuffer;
|
|
10
|
-
private serdeContext;
|
|
11
11
|
constructor(settings: CodecSettings);
|
|
12
|
-
setSerdeContext(serdeContext: SerdeFunctions): void;
|
|
13
12
|
write(schema: Schema, value: unknown): void;
|
|
14
13
|
flush(): string;
|
|
15
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Schema as ISchema } from "@smithy/types";
|
|
1
|
+
import { Schema as ISchema, StaticErrorSchema } from "@smithy/types";
|
|
2
2
|
import { ErrorSchema } from "./schemas/ErrorSchema";
|
|
3
3
|
/**
|
|
4
4
|
* A way to look up schema by their ShapeId values.
|
|
@@ -31,12 +31,12 @@ export declare class TypeRegistry {
|
|
|
31
31
|
/**
|
|
32
32
|
* Associates an error schema with its constructor.
|
|
33
33
|
*/
|
|
34
|
-
registerError(
|
|
34
|
+
registerError(es: ErrorSchema | StaticErrorSchema, ctor: any): void;
|
|
35
35
|
/**
|
|
36
|
-
* @param
|
|
36
|
+
* @param es - query.
|
|
37
37
|
* @returns Error constructor that extends the service's base exception.
|
|
38
38
|
*/
|
|
39
|
-
getErrorCtor(
|
|
39
|
+
getErrorCtor(es: ErrorSchema | StaticErrorSchema): any;
|
|
40
40
|
/**
|
|
41
41
|
* The smithy-typescript code generator generates a synthetic (i.e. unmodeled) base exception,
|
|
42
42
|
* because generated SDKs before the introduction of schemas have the notion of a ServiceBaseException, which
|
|
@@ -50,7 +50,7 @@ export declare class TypeRegistry {
|
|
|
50
50
|
*
|
|
51
51
|
* @returns the synthetic base exception of the service namespace associated with this registry instance.
|
|
52
52
|
*/
|
|
53
|
-
getBaseException():
|
|
53
|
+
getBaseException(): StaticErrorSchema | undefined;
|
|
54
54
|
/**
|
|
55
55
|
* @param predicate - criterion.
|
|
56
56
|
* @returns a schema in this registry matching the predicate.
|
|
@@ -61,5 +61,4 @@ export declare class TypeRegistry {
|
|
|
61
61
|
*/
|
|
62
62
|
clear(): void;
|
|
63
63
|
private normalizeShapeId;
|
|
64
|
-
private getNamespace;
|
|
65
64
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import { MemberSchema, NormalizedSchema as INormalizedSchema, Schema as ISchema, SchemaRef, SchemaTraitsObject } from "@smithy/types";
|
|
1
|
+
import { MemberSchema, NormalizedSchema as INormalizedSchema, Schema as ISchema, SchemaRef, SchemaTraitsObject, StaticErrorSchema, StaticListSchema, StaticMapSchema, StaticOperationSchema, StaticSchema, StaticSimpleSchema, StaticStructureSchema } from "@smithy/types";
|
|
2
|
+
import { ErrorSchema } from "./ErrorSchema";
|
|
3
|
+
import { ListSchema } from "./ListSchema";
|
|
4
|
+
import { MapSchema } from "./MapSchema";
|
|
5
|
+
import { OperationSchema } from "./OperationSchema";
|
|
6
|
+
import { SimpleSchema } from "./SimpleSchema";
|
|
7
|
+
import { StructureSchema } from "./StructureSchema";
|
|
2
8
|
/**
|
|
3
9
|
* Wraps both class instances, numeric sentinel values, and member schema pairs.
|
|
4
10
|
* Presents a consistent interface for interacting with polymorphic schema representations.
|
|
@@ -124,3 +130,18 @@ export declare class NormalizedSchema implements INormalizedSchema {
|
|
|
124
130
|
NormalizedSchema
|
|
125
131
|
], undefined, undefined>;
|
|
126
132
|
}
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
* @returns a class instance version of a static schema.
|
|
136
|
+
*/
|
|
137
|
+
export declare function hydrate(ss: StaticSimpleSchema): SimpleSchema;
|
|
138
|
+
export declare function hydrate(ss: StaticListSchema): ListSchema;
|
|
139
|
+
export declare function hydrate(ss: StaticMapSchema): MapSchema;
|
|
140
|
+
export declare function hydrate(ss: StaticStructureSchema): StructureSchema;
|
|
141
|
+
export declare function hydrate(ss: StaticErrorSchema): ErrorSchema;
|
|
142
|
+
export declare function hydrate(ss: StaticOperationSchema): OperationSchema;
|
|
143
|
+
export declare function hydrate(ss: StaticSchema): SimpleSchema | ListSchema | MapSchema | StructureSchema | ErrorSchema | OperationSchema;
|
|
144
|
+
/**
|
|
145
|
+
* @internal
|
|
146
|
+
*/
|
|
147
|
+
export declare const isStaticSchema: (sc: SchemaRef) => sc is StaticSchema;
|
|
@@ -19,3 +19,8 @@ export declare class SimpleSchema extends Schema implements TraitsSchema {
|
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export declare const sim: (namespace: string, name: string, schemaRef: SchemaRef, traits: SchemaTraits) => SimpleSchema;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
export declare const simAdapter: (namespace: string, name: string, traits: SchemaTraits, schemaRef: SchemaRef) => SimpleSchema;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.1",
|
|
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.
|
|
81
|
-
"@smithy/protocol-http": "^5.3.
|
|
82
|
-
"@smithy/types": "^4.
|
|
80
|
+
"@smithy/middleware-serde": "^4.2.2",
|
|
81
|
+
"@smithy/protocol-http": "^5.3.2",
|
|
82
|
+
"@smithy/types": "^4.7.1",
|
|
83
83
|
"@smithy/util-base64": "^4.3.0",
|
|
84
84
|
"@smithy/util-body-length-browser": "^4.2.0",
|
|
85
|
-
"@smithy/util-middleware": "^4.2.
|
|
86
|
-
"@smithy/util-stream": "^4.5.
|
|
85
|
+
"@smithy/util-middleware": "^4.2.2",
|
|
86
|
+
"@smithy/util-stream": "^4.5.2",
|
|
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.
|
|
121
|
+
"@smithy/eventstream-serde-node": "^4.2.2",
|
|
122
122
|
"@types/node": "^18.11.9",
|
|
123
123
|
"concurrently": "7.0.0",
|
|
124
124
|
"downlevel-dts": "0.10.1",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|