@cdk8s/awscdk-resolver 0.0.301 → 0.0.303
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/.jsii +3 -3
- package/lib/resolve.js +1 -1
- package/node_modules/@aws-sdk/client-cloudformation/package.json +34 -34
- package/node_modules/@aws-sdk/client-sso/package.json +32 -32
- package/node_modules/@aws-sdk/core/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
- package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +13 -13
- package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
- package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +6 -6
- package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +7 -7
- package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
- package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
- package/node_modules/@aws-sdk/token-providers/package.json +7 -7
- package/node_modules/@aws-sdk/types/package.json +2 -2
- package/node_modules/@aws-sdk/util-endpoints/package.json +4 -4
- package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
- package/node_modules/@smithy/abort-controller/package.json +2 -2
- package/node_modules/@smithy/config-resolver/package.json +4 -4
- package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +209 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +667 -2
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +771 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +108 -53
- package/node_modules/@smithy/core/dist-es/submodules/cbor/CborCodec.js +136 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +74 -0
- package/node_modules/@smithy/core/dist-es/submodules/cbor/index.js +3 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +183 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +164 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +68 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +7 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js +64 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js +38 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js +30 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js +87 -0
- package/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js +20 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +49 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/deref.js +6 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/index.js +12 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/getSchemaSerdePlugin.js +23 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schema-middleware-types.js +1 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +60 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +16 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +17 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +15 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +16 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +291 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/OperationSchema.js +16 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/Schema.js +6 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +15 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +22 -0
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/sentinels.js +16 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/copyDocumentWithTransform.js +53 -0
- package/node_modules/@smithy/core/dist-es/submodules/serde/index.js +4 -3
- package/node_modules/@smithy/core/dist-types/submodules/cbor/CborCodec.d.ts +29 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +22 -0
- package/node_modules/@smithy/core/dist-types/submodules/cbor/index.d.ts +3 -1
- package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +29 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +14 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/ToStringShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/serde/determineTimestampFormat.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +55 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/deref.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/index.d.ts +12 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/getSchemaSerdePlugin.d.ts +14 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/schema-middleware-types.d.ts +8 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/schemaDeserializationMiddleware.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/middleware/schemaSerializationMiddleware.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/ErrorSchema.d.ts +38 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/ListSchema.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/MapSchema.d.ts +25 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +122 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/OperationSchema.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/Schema.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/SimpleSchema.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/StructureSchema.d.ts +21 -0
- package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/sentinels.d.ts +21 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/copyDocumentWithTransform.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/submodules/serde/index.d.ts +4 -3
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/CborCodec.d.ts +29 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +22 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/index.d.ts +3 -1
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpBindingProtocol.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +29 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/index.d.ts +7 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/serde/FromStringShapeDeserializer.d.ts +14 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeDeserializer.d.ts +18 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/serde/HttpInterceptingShapeSerializer.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/serde/ToStringShapeSerializer.d.ts +15 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/serde/determineTimestampFormat.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +55 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/deref.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/index.d.ts +12 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/middleware/getSchemaSerdePlugin.d.ts +14 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/middleware/schema-middleware-types.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/middleware/schemaDeserializationMiddleware.d.ts +9 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/middleware/schemaSerializationMiddleware.d.ts +6 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/ErrorSchema.d.ts +38 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/ListSchema.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/MapSchema.d.ts +25 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +125 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/OperationSchema.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/Schema.d.ts +11 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/SimpleSchema.d.ts +20 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/StructureSchema.d.ts +24 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/sentinels.d.ts +21 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/copyDocumentWithTransform.d.ts +5 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/serde/index.d.ts +4 -3
- package/node_modules/@smithy/core/package.json +17 -7
- package/node_modules/@smithy/core/schema.d.ts +7 -0
- package/node_modules/@smithy/core/schema.js +6 -0
- package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
- package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
- package/node_modules/@smithy/hash-node/package.json +2 -2
- package/node_modules/@smithy/invalid-dependency/package.json +2 -2
- package/node_modules/@smithy/middleware-content-length/package.json +3 -3
- package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
- package/node_modules/@smithy/middleware-retry/package.json +8 -8
- package/node_modules/@smithy/middleware-serde/dist-types/deserializerMiddleware.d.ts +1 -0
- package/node_modules/@smithy/middleware-serde/dist-types/serdePlugin.d.ts +7 -1
- package/node_modules/@smithy/middleware-serde/dist-types/serializerMiddleware.d.ts +1 -0
- package/node_modules/@smithy/middleware-serde/dist-types/ts3.4/deserializerMiddleware.d.ts +1 -0
- package/node_modules/@smithy/middleware-serde/dist-types/ts3.4/serdePlugin.d.ts +7 -1
- package/node_modules/@smithy/middleware-serde/dist-types/ts3.4/serializerMiddleware.d.ts +1 -0
- package/node_modules/@smithy/middleware-serde/package.json +3 -3
- package/node_modules/@smithy/middleware-stack/package.json +2 -2
- package/node_modules/@smithy/node-config-provider/package.json +4 -4
- package/node_modules/@smithy/node-http-handler/package.json +5 -5
- package/node_modules/@smithy/property-provider/package.json +2 -2
- package/node_modules/@smithy/protocol-http/package.json +2 -2
- package/node_modules/@smithy/querystring-builder/package.json +2 -2
- package/node_modules/@smithy/querystring-parser/package.json +2 -2
- package/node_modules/@smithy/service-error-classification/package.json +2 -2
- package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
- package/node_modules/@smithy/signature-v4/package.json +4 -4
- package/node_modules/@smithy/smithy-client/dist-cjs/index.js +10 -0
- package/node_modules/@smithy/smithy-client/dist-es/command.js +6 -0
- package/node_modules/@smithy/smithy-client/dist-types/command.d.ts +7 -1
- package/node_modules/@smithy/smithy-client/dist-types/ts3.4/command.d.ts +7 -1
- package/node_modules/@smithy/smithy-client/package.json +7 -7
- package/node_modules/@smithy/types/dist-types/command.d.ts +5 -2
- package/node_modules/@smithy/types/dist-types/schema/schema.d.ts +2 -4
- package/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +5 -2
- package/node_modules/@smithy/types/dist-types/ts3.4/schema/schema.d.ts +2 -4
- package/node_modules/@smithy/types/package.json +1 -1
- package/node_modules/@smithy/url-parser/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
- package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
- package/node_modules/@smithy/util-endpoints/package.json +3 -3
- package/node_modules/@smithy/util-middleware/package.json +2 -2
- package/node_modules/@smithy/util-retry/package.json +3 -3
- package/node_modules/@smithy/util-stream/package.json +4 -4
- package/node_modules/@smithy/util-waiter/package.json +3 -3
- package/package.json +6 -6
@@ -0,0 +1,17 @@
|
|
1
|
+
import { TypeRegistry } from "../TypeRegistry";
|
2
|
+
import { StructureSchema } from "./StructureSchema";
|
3
|
+
export class ErrorSchema extends StructureSchema {
|
4
|
+
constructor(name, traits, memberNames, memberList, ctor) {
|
5
|
+
super(name, traits, memberNames, memberList);
|
6
|
+
this.name = name;
|
7
|
+
this.traits = traits;
|
8
|
+
this.memberNames = memberNames;
|
9
|
+
this.memberList = memberList;
|
10
|
+
this.ctor = ctor;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
export function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
|
14
|
+
const schema = new ErrorSchema(namespace + "#" + name, traits, memberNames, memberList, ctor);
|
15
|
+
TypeRegistry.for(namespace).register(name, schema);
|
16
|
+
return schema;
|
17
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { TypeRegistry } from "../TypeRegistry";
|
2
|
+
import { Schema } from "./Schema";
|
3
|
+
export class ListSchema extends Schema {
|
4
|
+
constructor(name, traits, valueSchema) {
|
5
|
+
super(name, traits);
|
6
|
+
this.name = name;
|
7
|
+
this.traits = traits;
|
8
|
+
this.valueSchema = valueSchema;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
export function list(namespace, name, traits = {}, valueSchema) {
|
12
|
+
const schema = new ListSchema(namespace + "#" + name, traits, typeof valueSchema === "function" ? valueSchema() : valueSchema);
|
13
|
+
TypeRegistry.for(namespace).register(name, schema);
|
14
|
+
return schema;
|
15
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { TypeRegistry } from "../TypeRegistry";
|
2
|
+
import { Schema } from "./Schema";
|
3
|
+
export class MapSchema extends Schema {
|
4
|
+
constructor(name, traits, keySchema, valueSchema) {
|
5
|
+
super(name, traits);
|
6
|
+
this.name = name;
|
7
|
+
this.traits = traits;
|
8
|
+
this.keySchema = keySchema;
|
9
|
+
this.valueSchema = valueSchema;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
export function map(namespace, name, traits = {}, keySchema, valueSchema) {
|
13
|
+
const schema = new MapSchema(namespace + "#" + name, traits, keySchema, typeof valueSchema === "function" ? valueSchema() : valueSchema);
|
14
|
+
TypeRegistry.for(namespace).register(name, schema);
|
15
|
+
return schema;
|
16
|
+
}
|
@@ -0,0 +1,291 @@
|
|
1
|
+
import { deref } from "../deref";
|
2
|
+
import { ListSchema } from "./ListSchema";
|
3
|
+
import { MapSchema } from "./MapSchema";
|
4
|
+
import { SCHEMA } from "./sentinels";
|
5
|
+
import { SimpleSchema } from "./SimpleSchema";
|
6
|
+
import { StructureSchema } from "./StructureSchema";
|
7
|
+
export class NormalizedSchema {
|
8
|
+
constructor(ref, memberName) {
|
9
|
+
this.ref = ref;
|
10
|
+
this.memberName = memberName;
|
11
|
+
const traitStack = [];
|
12
|
+
let _ref = ref;
|
13
|
+
let schema = ref;
|
14
|
+
this._isMemberSchema = false;
|
15
|
+
while (Array.isArray(_ref)) {
|
16
|
+
traitStack.push(_ref[1]);
|
17
|
+
_ref = _ref[0];
|
18
|
+
schema = deref(_ref);
|
19
|
+
this._isMemberSchema = true;
|
20
|
+
}
|
21
|
+
if (traitStack.length > 0) {
|
22
|
+
this.memberTraits = {};
|
23
|
+
for (let i = traitStack.length - 1; i >= 0; --i) {
|
24
|
+
const traitSet = traitStack[i];
|
25
|
+
Object.assign(this.memberTraits, NormalizedSchema.translateTraits(traitSet));
|
26
|
+
}
|
27
|
+
}
|
28
|
+
else {
|
29
|
+
this.memberTraits = 0;
|
30
|
+
}
|
31
|
+
if (schema instanceof NormalizedSchema) {
|
32
|
+
this.name = schema.name;
|
33
|
+
this.traits = schema.traits;
|
34
|
+
this._isMemberSchema = schema._isMemberSchema;
|
35
|
+
this.schema = schema.schema;
|
36
|
+
this.memberTraits = Object.assign({}, schema.getMemberTraits(), this.getMemberTraits());
|
37
|
+
this.normalizedTraits = void 0;
|
38
|
+
this.ref = schema.ref;
|
39
|
+
this.memberName = memberName ?? schema.memberName;
|
40
|
+
return;
|
41
|
+
}
|
42
|
+
this.schema = deref(schema);
|
43
|
+
if (this.schema && typeof this.schema === "object") {
|
44
|
+
this.traits = this.schema?.traits ?? {};
|
45
|
+
}
|
46
|
+
else {
|
47
|
+
this.traits = 0;
|
48
|
+
}
|
49
|
+
this.name =
|
50
|
+
(typeof this.schema === "object" ? this.schema?.name : void 0) ?? this.memberName ?? this.getSchemaName();
|
51
|
+
if (this._isMemberSchema && !memberName) {
|
52
|
+
throw new Error(`@smithy/core/schema - NormalizedSchema member schema ${this.getName(true)} must initialize with memberName argument.`);
|
53
|
+
}
|
54
|
+
}
|
55
|
+
static of(ref, memberName) {
|
56
|
+
if (ref instanceof NormalizedSchema) {
|
57
|
+
return ref;
|
58
|
+
}
|
59
|
+
return new NormalizedSchema(ref, memberName);
|
60
|
+
}
|
61
|
+
static translateTraits(indicator) {
|
62
|
+
if (typeof indicator === "object") {
|
63
|
+
return indicator;
|
64
|
+
}
|
65
|
+
indicator = indicator | 0;
|
66
|
+
const traits = {};
|
67
|
+
if ((indicator & 1) === 1) {
|
68
|
+
traits.httpLabel = 1;
|
69
|
+
}
|
70
|
+
if (((indicator >> 1) & 1) === 1) {
|
71
|
+
traits.idempotent = 1;
|
72
|
+
}
|
73
|
+
if (((indicator >> 2) & 1) === 1) {
|
74
|
+
traits.idempotencyToken = 1;
|
75
|
+
}
|
76
|
+
if (((indicator >> 3) & 1) === 1) {
|
77
|
+
traits.sensitive = 1;
|
78
|
+
}
|
79
|
+
if (((indicator >> 4) & 1) === 1) {
|
80
|
+
traits.httpPayload = 1;
|
81
|
+
}
|
82
|
+
if (((indicator >> 5) & 1) === 1) {
|
83
|
+
traits.httpResponseCode = 1;
|
84
|
+
}
|
85
|
+
if (((indicator >> 6) & 1) === 1) {
|
86
|
+
traits.httpQueryParams = 1;
|
87
|
+
}
|
88
|
+
return traits;
|
89
|
+
}
|
90
|
+
static memberFrom(memberSchema, memberName) {
|
91
|
+
if (memberSchema instanceof NormalizedSchema) {
|
92
|
+
memberSchema.memberName = memberName;
|
93
|
+
memberSchema._isMemberSchema = true;
|
94
|
+
return memberSchema;
|
95
|
+
}
|
96
|
+
return new NormalizedSchema(memberSchema, memberName);
|
97
|
+
}
|
98
|
+
getSchema() {
|
99
|
+
if (this.schema instanceof NormalizedSchema) {
|
100
|
+
return (this.schema = this.schema.getSchema());
|
101
|
+
}
|
102
|
+
if (this.schema instanceof SimpleSchema) {
|
103
|
+
return deref(this.schema.schemaRef);
|
104
|
+
}
|
105
|
+
return deref(this.schema);
|
106
|
+
}
|
107
|
+
getName(withNamespace = false) {
|
108
|
+
if (!withNamespace) {
|
109
|
+
if (this.name && this.name.includes("#")) {
|
110
|
+
return this.name.split("#")[1];
|
111
|
+
}
|
112
|
+
}
|
113
|
+
return this.name || undefined;
|
114
|
+
}
|
115
|
+
getMemberName() {
|
116
|
+
if (!this.isMemberSchema()) {
|
117
|
+
throw new Error(`@smithy/core/schema - cannot get member name on non-member schema: ${this.getName(true)}`);
|
118
|
+
}
|
119
|
+
return this.memberName;
|
120
|
+
}
|
121
|
+
isMemberSchema() {
|
122
|
+
return this._isMemberSchema;
|
123
|
+
}
|
124
|
+
isUnitSchema() {
|
125
|
+
return this.getSchema() === "unit";
|
126
|
+
}
|
127
|
+
isListSchema() {
|
128
|
+
const inner = this.getSchema();
|
129
|
+
if (typeof inner === "number") {
|
130
|
+
return inner >= SCHEMA.LIST_MODIFIER && inner < SCHEMA.MAP_MODIFIER;
|
131
|
+
}
|
132
|
+
return inner instanceof ListSchema;
|
133
|
+
}
|
134
|
+
isMapSchema() {
|
135
|
+
const inner = this.getSchema();
|
136
|
+
if (typeof inner === "number") {
|
137
|
+
return inner >= SCHEMA.MAP_MODIFIER && inner <= 255;
|
138
|
+
}
|
139
|
+
return inner instanceof MapSchema;
|
140
|
+
}
|
141
|
+
isDocumentSchema() {
|
142
|
+
return this.getSchema() === SCHEMA.DOCUMENT;
|
143
|
+
}
|
144
|
+
isStructSchema() {
|
145
|
+
const inner = this.getSchema();
|
146
|
+
return (inner !== null && typeof inner === "object" && "members" in inner) || inner instanceof StructureSchema;
|
147
|
+
}
|
148
|
+
isBlobSchema() {
|
149
|
+
return this.getSchema() === SCHEMA.BLOB || this.getSchema() === SCHEMA.STREAMING_BLOB;
|
150
|
+
}
|
151
|
+
isTimestampSchema() {
|
152
|
+
const schema = this.getSchema();
|
153
|
+
return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
|
154
|
+
}
|
155
|
+
isStringSchema() {
|
156
|
+
return this.getSchema() === SCHEMA.STRING;
|
157
|
+
}
|
158
|
+
isBooleanSchema() {
|
159
|
+
return this.getSchema() === SCHEMA.BOOLEAN;
|
160
|
+
}
|
161
|
+
isNumericSchema() {
|
162
|
+
return this.getSchema() === SCHEMA.NUMERIC;
|
163
|
+
}
|
164
|
+
isBigIntegerSchema() {
|
165
|
+
return this.getSchema() === SCHEMA.BIG_INTEGER;
|
166
|
+
}
|
167
|
+
isBigDecimalSchema() {
|
168
|
+
return this.getSchema() === SCHEMA.BIG_DECIMAL;
|
169
|
+
}
|
170
|
+
isStreaming() {
|
171
|
+
const streaming = !!this.getMergedTraits().streaming;
|
172
|
+
if (streaming) {
|
173
|
+
return true;
|
174
|
+
}
|
175
|
+
return this.getSchema() === SCHEMA.STREAMING_BLOB;
|
176
|
+
}
|
177
|
+
getMergedTraits() {
|
178
|
+
if (this.normalizedTraits) {
|
179
|
+
return this.normalizedTraits;
|
180
|
+
}
|
181
|
+
this.normalizedTraits = {
|
182
|
+
...this.getOwnTraits(),
|
183
|
+
...this.getMemberTraits(),
|
184
|
+
};
|
185
|
+
return this.normalizedTraits;
|
186
|
+
}
|
187
|
+
getMemberTraits() {
|
188
|
+
return NormalizedSchema.translateTraits(this.memberTraits);
|
189
|
+
}
|
190
|
+
getOwnTraits() {
|
191
|
+
return NormalizedSchema.translateTraits(this.traits);
|
192
|
+
}
|
193
|
+
getKeySchema() {
|
194
|
+
if (this.isDocumentSchema()) {
|
195
|
+
return NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], "key");
|
196
|
+
}
|
197
|
+
if (!this.isMapSchema()) {
|
198
|
+
throw new Error(`@smithy/core/schema - cannot get key schema for non-map schema: ${this.getName(true)}`);
|
199
|
+
}
|
200
|
+
const schema = this.getSchema();
|
201
|
+
if (typeof schema === "number") {
|
202
|
+
return NormalizedSchema.memberFrom([63 & schema, 0], "key");
|
203
|
+
}
|
204
|
+
return NormalizedSchema.memberFrom([schema.keySchema, 0], "key");
|
205
|
+
}
|
206
|
+
getValueSchema() {
|
207
|
+
const schema = this.getSchema();
|
208
|
+
if (typeof schema === "number") {
|
209
|
+
if (this.isMapSchema()) {
|
210
|
+
return NormalizedSchema.memberFrom([63 & schema, 0], "value");
|
211
|
+
}
|
212
|
+
else if (this.isListSchema()) {
|
213
|
+
return NormalizedSchema.memberFrom([63 & schema, 0], "member");
|
214
|
+
}
|
215
|
+
}
|
216
|
+
if (schema && typeof schema === "object") {
|
217
|
+
if (this.isStructSchema()) {
|
218
|
+
throw new Error(`cannot call getValueSchema() with StructureSchema ${this.getName(true)}`);
|
219
|
+
}
|
220
|
+
const collection = schema;
|
221
|
+
if ("valueSchema" in collection) {
|
222
|
+
if (this.isMapSchema()) {
|
223
|
+
return NormalizedSchema.memberFrom([collection.valueSchema, 0], "value");
|
224
|
+
}
|
225
|
+
else if (this.isListSchema()) {
|
226
|
+
return NormalizedSchema.memberFrom([collection.valueSchema, 0], "member");
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
if (this.isDocumentSchema()) {
|
231
|
+
return NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], "value");
|
232
|
+
}
|
233
|
+
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have a value member.`);
|
234
|
+
}
|
235
|
+
getMemberSchema(member) {
|
236
|
+
if (this.isStructSchema()) {
|
237
|
+
const struct = this.getSchema();
|
238
|
+
if (!(member in struct.members)) {
|
239
|
+
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have a member with name=${member}.`);
|
240
|
+
}
|
241
|
+
return NormalizedSchema.memberFrom(struct.members[member], member);
|
242
|
+
}
|
243
|
+
if (this.isDocumentSchema()) {
|
244
|
+
return NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], member);
|
245
|
+
}
|
246
|
+
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have members.`);
|
247
|
+
}
|
248
|
+
getMemberSchemas() {
|
249
|
+
const { schema } = this;
|
250
|
+
const struct = schema;
|
251
|
+
if (!struct || typeof struct !== "object") {
|
252
|
+
return {};
|
253
|
+
}
|
254
|
+
if ("members" in struct) {
|
255
|
+
const buffer = {};
|
256
|
+
for (const member of struct.memberNames) {
|
257
|
+
buffer[member] = this.getMemberSchema(member);
|
258
|
+
}
|
259
|
+
return buffer;
|
260
|
+
}
|
261
|
+
return {};
|
262
|
+
}
|
263
|
+
*structIterator() {
|
264
|
+
if (!this.isStructSchema()) {
|
265
|
+
throw new Error("@smithy/core/schema - cannot acquire structIterator on non-struct schema.");
|
266
|
+
}
|
267
|
+
const struct = this.getSchema();
|
268
|
+
for (let i = 0; i < struct.memberNames.length; ++i) {
|
269
|
+
yield [struct.memberNames[i], NormalizedSchema.memberFrom([struct.memberList[i], 0], struct.memberNames[i])];
|
270
|
+
}
|
271
|
+
}
|
272
|
+
getSchemaName() {
|
273
|
+
const schema = this.getSchema();
|
274
|
+
if (typeof schema === "number") {
|
275
|
+
const _schema = 63 & schema;
|
276
|
+
const container = 192 & schema;
|
277
|
+
const type = Object.entries(SCHEMA).find(([, value]) => {
|
278
|
+
return value === _schema;
|
279
|
+
})?.[0] ?? "Unknown";
|
280
|
+
switch (container) {
|
281
|
+
case SCHEMA.MAP_MODIFIER:
|
282
|
+
return `${type}Map`;
|
283
|
+
case SCHEMA.LIST_MODIFIER:
|
284
|
+
return `${type}List`;
|
285
|
+
case 0:
|
286
|
+
return type;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
return "Unknown";
|
290
|
+
}
|
291
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { TypeRegistry } from "../TypeRegistry";
|
2
|
+
import { Schema } from "./Schema";
|
3
|
+
export class OperationSchema extends Schema {
|
4
|
+
constructor(name, traits, input, output) {
|
5
|
+
super(name, traits);
|
6
|
+
this.name = name;
|
7
|
+
this.traits = traits;
|
8
|
+
this.input = input;
|
9
|
+
this.output = output;
|
10
|
+
}
|
11
|
+
}
|
12
|
+
export function op(namespace, name, traits = {}, input, output) {
|
13
|
+
const schema = new OperationSchema(namespace + "#" + name, traits, input, output);
|
14
|
+
TypeRegistry.for(namespace).register(name, schema);
|
15
|
+
return schema;
|
16
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { TypeRegistry } from "../TypeRegistry";
|
2
|
+
import { Schema } from "./Schema";
|
3
|
+
export class SimpleSchema extends Schema {
|
4
|
+
constructor(name, schemaRef, traits) {
|
5
|
+
super(name, traits);
|
6
|
+
this.name = name;
|
7
|
+
this.schemaRef = schemaRef;
|
8
|
+
this.traits = traits;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
export function sim(namespace, name, schemaRef, traits) {
|
12
|
+
const schema = new SimpleSchema(namespace + "#" + name, schemaRef, traits);
|
13
|
+
TypeRegistry.for(namespace).register(name, schema);
|
14
|
+
return schema;
|
15
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { TypeRegistry } from "../TypeRegistry";
|
2
|
+
import { Schema } from "./Schema";
|
3
|
+
export class StructureSchema extends Schema {
|
4
|
+
constructor(name, traits, memberNames, memberList) {
|
5
|
+
super(name, traits);
|
6
|
+
this.name = name;
|
7
|
+
this.traits = traits;
|
8
|
+
this.memberNames = memberNames;
|
9
|
+
this.memberList = memberList;
|
10
|
+
this.members = {};
|
11
|
+
for (let i = 0; i < memberNames.length; ++i) {
|
12
|
+
this.members[memberNames[i]] = Array.isArray(memberList[i])
|
13
|
+
? memberList[i]
|
14
|
+
: [memberList[i], 0];
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
export function struct(namespace, name, traits, memberNames, memberList) {
|
19
|
+
const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
|
20
|
+
TypeRegistry.for(namespace).register(name, schema);
|
21
|
+
return schema;
|
22
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
export const SCHEMA = {
|
2
|
+
BLOB: 21,
|
3
|
+
STREAMING_BLOB: 42,
|
4
|
+
BOOLEAN: 2,
|
5
|
+
STRING: 0,
|
6
|
+
NUMERIC: 1,
|
7
|
+
BIG_INTEGER: 17,
|
8
|
+
BIG_DECIMAL: 19,
|
9
|
+
DOCUMENT: 15,
|
10
|
+
TIMESTAMP_DEFAULT: 4,
|
11
|
+
TIMESTAMP_DATE_TIME: 5,
|
12
|
+
TIMESTAMP_HTTP_DATE: 6,
|
13
|
+
TIMESTAMP_EPOCH_SECONDS: 7,
|
14
|
+
LIST_MODIFIER: 64,
|
15
|
+
MAP_MODIFIER: 128,
|
16
|
+
};
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
2
|
+
export const copyDocumentWithTransform = (source, schemaRef, transform = (_) => _) => {
|
3
|
+
const ns = NormalizedSchema.of(schemaRef);
|
4
|
+
switch (typeof source) {
|
5
|
+
case "undefined":
|
6
|
+
case "boolean":
|
7
|
+
case "number":
|
8
|
+
case "string":
|
9
|
+
case "bigint":
|
10
|
+
case "symbol":
|
11
|
+
return transform(source, ns);
|
12
|
+
case "function":
|
13
|
+
case "object":
|
14
|
+
if (source === null) {
|
15
|
+
return transform(null, ns);
|
16
|
+
}
|
17
|
+
if (Array.isArray(source)) {
|
18
|
+
const newArray = new Array(source.length);
|
19
|
+
let i = 0;
|
20
|
+
for (const item of source) {
|
21
|
+
newArray[i++] = copyDocumentWithTransform(item, ns.getValueSchema(), transform);
|
22
|
+
}
|
23
|
+
return transform(newArray, ns);
|
24
|
+
}
|
25
|
+
if ("byteLength" in source) {
|
26
|
+
const newBytes = new Uint8Array(source.byteLength);
|
27
|
+
newBytes.set(source, 0);
|
28
|
+
return transform(newBytes, ns);
|
29
|
+
}
|
30
|
+
if (source instanceof Date) {
|
31
|
+
return transform(source, ns);
|
32
|
+
}
|
33
|
+
const newObject = {};
|
34
|
+
if (ns.isMapSchema()) {
|
35
|
+
for (const key of Object.keys(source)) {
|
36
|
+
newObject[key] = copyDocumentWithTransform(source[key], ns.getValueSchema(), transform);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
else if (ns.isStructSchema()) {
|
40
|
+
for (const [key, memberSchema] of ns.structIterator()) {
|
41
|
+
newObject[key] = copyDocumentWithTransform(source[key], memberSchema, transform);
|
42
|
+
}
|
43
|
+
}
|
44
|
+
else if (ns.isDocumentSchema()) {
|
45
|
+
for (const key of Object.keys(source)) {
|
46
|
+
newObject[key] = copyDocumentWithTransform(source[key], ns.getValueSchema(), transform);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
return transform(newObject, ns);
|
50
|
+
default:
|
51
|
+
return transform(source, ns);
|
52
|
+
}
|
53
|
+
};
|
@@ -1,7 +1,8 @@
|
|
1
|
-
export * from "./
|
1
|
+
export * from "./copyDocumentWithTransform";
|
2
2
|
export * from "./date-utils";
|
3
|
+
export * from "./lazy-json";
|
4
|
+
export * from "./parse-utils";
|
3
5
|
export * from "./quote-header";
|
6
|
+
export * from "./split-every";
|
4
7
|
export * from "./split-header";
|
5
8
|
export * from "./value/NumericValue";
|
6
|
-
export * from "./lazy-json";
|
7
|
-
export * from "./split-every";
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { Codec, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* @alpha
|
4
|
+
*/
|
5
|
+
export declare class CborCodec implements Codec<Uint8Array, Uint8Array> {
|
6
|
+
private serdeContext?;
|
7
|
+
createSerializer(): CborShapeSerializer;
|
8
|
+
createDeserializer(): CborShapeDeserializer;
|
9
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
10
|
+
}
|
11
|
+
/**
|
12
|
+
* @alpha
|
13
|
+
*/
|
14
|
+
export declare class CborShapeSerializer implements ShapeSerializer {
|
15
|
+
private serdeContext?;
|
16
|
+
private value;
|
17
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
18
|
+
write(schema: Schema, value: unknown): void;
|
19
|
+
flush(): Uint8Array;
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* @alpha
|
23
|
+
*/
|
24
|
+
export declare class CborShapeDeserializer implements ShapeDeserializer {
|
25
|
+
private serdeContext?;
|
26
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
27
|
+
read(schema: Schema, bytes: Uint8Array): any;
|
28
|
+
private readValue;
|
29
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { RpcProtocol } from "@smithy/core/protocols";
|
2
|
+
import { OperationSchema } from "@smithy/core/schema";
|
3
|
+
import type { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, ResponseMetadata, SerdeFunctions } from "@smithy/types";
|
4
|
+
import { CborCodec } from "./CborCodec";
|
5
|
+
/**
|
6
|
+
* Client protocol for Smithy RPCv2 CBOR.
|
7
|
+
*
|
8
|
+
* @alpha
|
9
|
+
*/
|
10
|
+
export declare class SmithyRpcV2CborProtocol extends RpcProtocol {
|
11
|
+
private codec;
|
12
|
+
protected serializer: import("./CborCodec").CborShapeSerializer;
|
13
|
+
protected deserializer: import("./CborCodec").CborShapeDeserializer;
|
14
|
+
constructor({ defaultNamespace }: {
|
15
|
+
defaultNamespace: string;
|
16
|
+
});
|
17
|
+
getShapeId(): string;
|
18
|
+
getPayloadCodec(): CborCodec;
|
19
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
20
|
+
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
21
|
+
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
22
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { NormalizedSchema } from "@smithy/core/schema";
|
2
|
+
import { HttpRequest } from "@smithy/protocol-http";
|
3
|
+
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, SerdeFunctions } from "@smithy/types";
|
4
|
+
import { HttpProtocol } from "./HttpProtocol";
|
5
|
+
/**
|
6
|
+
* Base for HTTP-binding protocols. Downstream examples
|
7
|
+
* include AWS REST JSON and AWS REST XML.
|
8
|
+
*
|
9
|
+
* @alpha
|
10
|
+
*/
|
11
|
+
export declare abstract class HttpBindingProtocol extends HttpProtocol {
|
12
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
13
|
+
protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
|
14
|
+
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
15
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { ClientProtocol, Codec, Endpoint, EndpointBearer, EndpointV2, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, ResponseMetadata, Schema, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* Abstract base for HTTP-based client protocols.
|
4
|
+
*
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare abstract class HttpProtocol implements ClientProtocol<IHttpRequest, IHttpResponse> {
|
8
|
+
readonly options: {
|
9
|
+
defaultNamespace: string;
|
10
|
+
};
|
11
|
+
protected abstract serializer: ShapeSerializer<string | Uint8Array>;
|
12
|
+
protected abstract deserializer: ShapeDeserializer<string | Uint8Array>;
|
13
|
+
protected serdeContext?: SerdeFunctions;
|
14
|
+
protected constructor(options: {
|
15
|
+
defaultNamespace: string;
|
16
|
+
});
|
17
|
+
abstract getShapeId(): string;
|
18
|
+
abstract getPayloadCodec(): Codec<any, any>;
|
19
|
+
getRequestType(): new (...args: any[]) => IHttpRequest;
|
20
|
+
getResponseType(): new (...args: any[]) => IHttpResponse;
|
21
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
22
|
+
abstract serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
23
|
+
updateServiceEndpoint(request: IHttpRequest, endpoint: EndpointV2 | Endpoint): IHttpRequest;
|
24
|
+
abstract deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
25
|
+
protected setHostPrefix<Input extends object>(request: IHttpRequest, operationSchema: OperationSchema, input: Input): void;
|
26
|
+
protected abstract handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
27
|
+
protected deserializeMetadata(output: IHttpResponse): ResponseMetadata;
|
28
|
+
protected deserializeHttpMessage(schema: Schema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, headerBindings: Set<string>, dataObject: any): Promise<string[]>;
|
29
|
+
}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { EndpointBearer, HandlerExecutionContext, HttpRequest as IHttpRequest, HttpResponse as IHttpResponse, MetadataBearer, OperationSchema, SerdeFunctions } from "@smithy/types";
|
2
|
+
import { HttpProtocol } from "./HttpProtocol";
|
3
|
+
/**
|
4
|
+
* Abstract base for RPC-over-HTTP protocols.
|
5
|
+
*
|
6
|
+
* @alpha
|
7
|
+
*/
|
8
|
+
export declare abstract class RpcProtocol extends HttpProtocol {
|
9
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
10
|
+
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
11
|
+
}
|
@@ -1,4 +1,11 @@
|
|
1
1
|
export * from "./collect-stream-body";
|
2
2
|
export * from "./extended-encode-uri-component";
|
3
|
+
export * from "./HttpBindingProtocol";
|
4
|
+
export * from "./RpcProtocol";
|
3
5
|
export * from "./requestBuilder";
|
4
6
|
export * from "./resolve-path";
|
7
|
+
export * from "./serde/FromStringShapeDeserializer";
|
8
|
+
export * from "./serde/HttpInterceptingShapeDeserializer";
|
9
|
+
export * from "./serde/HttpInterceptingShapeSerializer";
|
10
|
+
export * from "./serde/ToStringShapeSerializer";
|
11
|
+
export * from "./serde/determineTimestampFormat";
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* This deserializer reads strings.
|
4
|
+
*
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare class FromStringShapeDeserializer implements ShapeDeserializer<string> {
|
8
|
+
private settings;
|
9
|
+
private serdeContext;
|
10
|
+
constructor(settings: CodecSettings);
|
11
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
12
|
+
read(_schema: Schema, data: string): any;
|
13
|
+
private base64ToUtf8;
|
14
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { CodecSettings, Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* This deserializer is a dispatcher that decides whether to use a string deserializer
|
4
|
+
* or a codec deserializer based on HTTP traits.
|
5
|
+
*
|
6
|
+
* For example, in a JSON HTTP message, the deserialization of a field will differ depending on whether
|
7
|
+
* it is bound to the HTTP header (string) or body (JSON).
|
8
|
+
*
|
9
|
+
* @alpha
|
10
|
+
*/
|
11
|
+
export declare class HttpInterceptingShapeDeserializer<CodecShapeDeserializer extends ShapeDeserializer<any>> implements ShapeDeserializer<string | Uint8Array> {
|
12
|
+
private codecDeserializer;
|
13
|
+
private stringDeserializer;
|
14
|
+
private serdeContext;
|
15
|
+
constructor(codecDeserializer: CodecShapeDeserializer, codecSettings: CodecSettings);
|
16
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
17
|
+
read(schema: Schema, data: string | Uint8Array): any | Promise<any>;
|
18
|
+
}
|