@cdk8s/awscdk-resolver 0.0.304 → 0.0.306
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 +5 -5
- package/node_modules/@aws-sdk/client-sso/package.json +4 -4
- package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +1466 -14
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/ConfigurableSerdeContext.js +6 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/index.js +13 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_0Protocol.js +14 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJson1_1Protocol.js +14 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsJsonRpcProtocol.js +89 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js +123 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js +20 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js +105 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +106 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js +46 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js +18 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsEc2QueryProtocol.js +3 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/AwsQueryProtocol.js +134 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/query/QueryShapeSerializer.js +143 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/AwsRestXmlProtocol.js +131 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlCodec.js +20 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeDeserializer.js +154 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/XmlShapeSerializer.js +279 -0
- package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/xml/simpleFormatXml.js +27 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts +8 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/common.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/index.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts +12 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts +12 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +18 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts +19 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonCodec.d.ts +19 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/jsonReplacer.d.ts +21 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/jsonReviver.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/parseJsonBody.d.ts +3 -3
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsQueryProtocol.d.ts +29 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QueryShapeSerializer.d.ts +14 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +21 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlCodec.d.ts +14 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlShapeDeserializer.d.ts +20 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -0
- package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/simpleFormatXml.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/ConfigurableSerdeContext.d.ts +5 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/common.d.ts +2 -2
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/index.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_0Protocol.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJson1_1Protocol.d.ts +6 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsJsonRpcProtocol.d.ts +33 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/AwsRestJsonProtocol.d.ts +34 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonCodec.d.ts +16 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeDeserializer.d.ts +13 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReplacer.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/jsonReviver.d.ts +7 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/parseJsonBody.d.ts +3 -3
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsEc2QueryProtocol.d.ts +2 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/AwsQueryProtocol.d.ts +52 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/query/QueryShapeSerializer.d.ts +14 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/AwsRestXmlProtocol.d.ts +39 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlCodec.d.ts +17 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeDeserializer.d.ts +15 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/XmlShapeSerializer.d.ts +21 -0
- package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/xml/simpleFormatXml.d.ts +1 -0
- package/node_modules/@aws-sdk/core/package.json +5 -1
- package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
- package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
- package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
- package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
- package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
- package/node_modules/@aws-sdk/middleware-user-agent/package.json +2 -2
- package/node_modules/@aws-sdk/nested-clients/package.json +4 -4
- package/node_modules/@aws-sdk/token-providers/package.json +3 -3
- package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
- package/node_modules/@aws-sdk/xml-builder/LICENSE +201 -0
- package/node_modules/@aws-sdk/xml-builder/README.md +10 -0
- package/node_modules/@aws-sdk/xml-builder/dist-cjs/index.js +173 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/XmlNode.js +88 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/XmlText.js +10 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/escape-attribute.js +3 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/escape-element.js +12 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/index.js +2 -0
- package/node_modules/@aws-sdk/xml-builder/dist-es/stringable.js +1 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/XmlNode.d.ts +49 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/XmlText.d.ts +11 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/escape-attribute.d.ts +6 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/escape-element.d.ts +6 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/index.d.ts +8 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/stringable.d.ts +6 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/XmlNode.d.ts +29 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/XmlText.d.ts +6 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/escape-attribute.d.ts +1 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/escape-element.d.ts +1 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/index.d.ts +2 -0
- package/node_modules/@aws-sdk/xml-builder/dist-types/ts3.4/stringable.d.ts +3 -0
- package/node_modules/@aws-sdk/xml-builder/package.json +54 -0
- package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +9 -8
- package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +4 -1
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +1 -6
- package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +9 -2
- package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +1 -1
- package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +3 -0
- package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +4 -0
- package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +4 -0
- package/node_modules/@smithy/core/package.json +1 -1
- package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
- package/node_modules/@smithy/middleware-retry/package.json +2 -2
- package/node_modules/@smithy/smithy-client/package.json +3 -3
- package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
- package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
- package/package.json +4 -4
@@ -0,0 +1,279 @@
|
|
1
|
+
import { XmlNode, XmlText } from "@aws-sdk/xml-builder";
|
2
|
+
import { NormalizedSchema, SCHEMA } from "@smithy/core/schema";
|
3
|
+
import { NumericValue } from "@smithy/core/serde";
|
4
|
+
import { dateToUtcString } from "@smithy/smithy-client";
|
5
|
+
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
6
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
7
|
+
export class XmlShapeSerializer extends SerdeContextConfig {
|
8
|
+
settings;
|
9
|
+
stringBuffer;
|
10
|
+
byteBuffer;
|
11
|
+
buffer;
|
12
|
+
constructor(settings) {
|
13
|
+
super();
|
14
|
+
this.settings = settings;
|
15
|
+
}
|
16
|
+
write(schema, value) {
|
17
|
+
const ns = NormalizedSchema.of(schema);
|
18
|
+
if (ns.isStringSchema() && typeof value === "string") {
|
19
|
+
this.stringBuffer = value;
|
20
|
+
}
|
21
|
+
else if (ns.isBlobSchema()) {
|
22
|
+
this.byteBuffer =
|
23
|
+
"byteLength" in value
|
24
|
+
? value
|
25
|
+
: (this.serdeContext?.base64Decoder ?? fromBase64)(value);
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
this.buffer = this.writeStruct(ns, value, undefined);
|
29
|
+
const traits = ns.getMergedTraits();
|
30
|
+
if (traits.httpPayload && !traits.xmlName) {
|
31
|
+
this.buffer.withName(ns.getName());
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
flush() {
|
36
|
+
if (this.byteBuffer !== undefined) {
|
37
|
+
const bytes = this.byteBuffer;
|
38
|
+
delete this.byteBuffer;
|
39
|
+
return bytes;
|
40
|
+
}
|
41
|
+
if (this.stringBuffer !== undefined) {
|
42
|
+
const str = this.stringBuffer;
|
43
|
+
delete this.stringBuffer;
|
44
|
+
return str;
|
45
|
+
}
|
46
|
+
const buffer = this.buffer;
|
47
|
+
if (this.settings.xmlNamespace) {
|
48
|
+
if (!buffer?.attributes?.["xmlns"]) {
|
49
|
+
buffer.addAttribute("xmlns", this.settings.xmlNamespace);
|
50
|
+
}
|
51
|
+
}
|
52
|
+
delete this.buffer;
|
53
|
+
return buffer.toString();
|
54
|
+
}
|
55
|
+
writeStruct(ns, value, parentXmlns) {
|
56
|
+
const traits = ns.getMergedTraits();
|
57
|
+
const name = ns.isMemberSchema() && !traits.httpPayload
|
58
|
+
? ns.getMemberTraits().xmlName ?? ns.getMemberName()
|
59
|
+
: traits.xmlName ?? ns.getName();
|
60
|
+
if (!name || !ns.isStructSchema()) {
|
61
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write struct with empty name or non-struct, schema=${ns.getName(true)}.`);
|
62
|
+
}
|
63
|
+
const structXmlNode = XmlNode.of(name);
|
64
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);
|
65
|
+
if (xmlns) {
|
66
|
+
structXmlNode.addAttribute(xmlnsAttr, xmlns);
|
67
|
+
}
|
68
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
69
|
+
const val = value[memberName];
|
70
|
+
if (val != null) {
|
71
|
+
if (memberSchema.getMergedTraits().xmlAttribute) {
|
72
|
+
structXmlNode.addAttribute(memberSchema.getMergedTraits().xmlName ?? memberName, this.writeSimple(memberSchema, val));
|
73
|
+
continue;
|
74
|
+
}
|
75
|
+
if (memberSchema.isListSchema()) {
|
76
|
+
this.writeList(memberSchema, val, structXmlNode, xmlns);
|
77
|
+
}
|
78
|
+
else if (memberSchema.isMapSchema()) {
|
79
|
+
this.writeMap(memberSchema, val, structXmlNode, xmlns);
|
80
|
+
}
|
81
|
+
else if (memberSchema.isStructSchema()) {
|
82
|
+
structXmlNode.addChildNode(this.writeStruct(memberSchema, val, xmlns));
|
83
|
+
}
|
84
|
+
else {
|
85
|
+
const memberNode = XmlNode.of(memberSchema.getMergedTraits().xmlName ?? memberSchema.getMemberName());
|
86
|
+
this.writeSimpleInto(memberSchema, val, memberNode, xmlns);
|
87
|
+
structXmlNode.addChildNode(memberNode);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
return structXmlNode;
|
92
|
+
}
|
93
|
+
writeList(listMember, array, container, parentXmlns) {
|
94
|
+
if (!listMember.isMemberSchema()) {
|
95
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member list: ${listMember.getName(true)}`);
|
96
|
+
}
|
97
|
+
const listTraits = listMember.getMergedTraits();
|
98
|
+
const listValueSchema = listMember.getValueSchema();
|
99
|
+
const listValueTraits = listValueSchema.getMergedTraits();
|
100
|
+
const sparse = !!listValueTraits.sparse;
|
101
|
+
const flat = !!listTraits.xmlFlattened;
|
102
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(listMember, parentXmlns);
|
103
|
+
const writeItem = (container, value) => {
|
104
|
+
if (listValueSchema.isListSchema()) {
|
105
|
+
this.writeList(listValueSchema, Array.isArray(value) ? value : [value], container, xmlns);
|
106
|
+
}
|
107
|
+
else if (listValueSchema.isMapSchema()) {
|
108
|
+
this.writeMap(listValueSchema, value, container, xmlns);
|
109
|
+
}
|
110
|
+
else if (listValueSchema.isStructSchema()) {
|
111
|
+
const struct = this.writeStruct(listValueSchema, value, xmlns);
|
112
|
+
container.addChildNode(struct.withName(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member"));
|
113
|
+
}
|
114
|
+
else {
|
115
|
+
const listItemNode = XmlNode.of(flat ? listTraits.xmlName ?? listMember.getMemberName() : listValueTraits.xmlName ?? "member");
|
116
|
+
this.writeSimpleInto(listValueSchema, value, listItemNode, xmlns);
|
117
|
+
container.addChildNode(listItemNode);
|
118
|
+
}
|
119
|
+
};
|
120
|
+
if (flat) {
|
121
|
+
for (const value of array) {
|
122
|
+
if (sparse || value != null) {
|
123
|
+
writeItem(container, value);
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
else {
|
128
|
+
const listNode = XmlNode.of(listTraits.xmlName ?? listMember.getMemberName());
|
129
|
+
if (xmlns) {
|
130
|
+
listNode.addAttribute(xmlnsAttr, xmlns);
|
131
|
+
}
|
132
|
+
for (const value of array) {
|
133
|
+
if (sparse || value != null) {
|
134
|
+
writeItem(listNode, value);
|
135
|
+
}
|
136
|
+
}
|
137
|
+
container.addChildNode(listNode);
|
138
|
+
}
|
139
|
+
}
|
140
|
+
writeMap(mapMember, map, container, parentXmlns, containerIsMap = false) {
|
141
|
+
if (!mapMember.isMemberSchema()) {
|
142
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, cannot write non-member map: ${mapMember.getName(true)}`);
|
143
|
+
}
|
144
|
+
const mapTraits = mapMember.getMergedTraits();
|
145
|
+
const mapKeySchema = mapMember.getKeySchema();
|
146
|
+
const mapKeyTraits = mapKeySchema.getMergedTraits();
|
147
|
+
const keyTag = mapKeyTraits.xmlName ?? "key";
|
148
|
+
const mapValueSchema = mapMember.getValueSchema();
|
149
|
+
const mapValueTraits = mapValueSchema.getMergedTraits();
|
150
|
+
const valueTag = mapValueTraits.xmlName ?? "value";
|
151
|
+
const sparse = !!mapValueTraits.sparse;
|
152
|
+
const flat = !!mapTraits.xmlFlattened;
|
153
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(mapMember, parentXmlns);
|
154
|
+
const addKeyValue = (entry, key, val) => {
|
155
|
+
const keyNode = XmlNode.of(keyTag, key);
|
156
|
+
const [keyXmlnsAttr, keyXmlns] = this.getXmlnsAttribute(mapKeySchema, xmlns);
|
157
|
+
if (keyXmlns) {
|
158
|
+
keyNode.addAttribute(keyXmlnsAttr, keyXmlns);
|
159
|
+
}
|
160
|
+
entry.addChildNode(keyNode);
|
161
|
+
let valueNode = XmlNode.of(valueTag);
|
162
|
+
if (mapValueSchema.isListSchema()) {
|
163
|
+
this.writeList(mapValueSchema, val, valueNode, xmlns);
|
164
|
+
}
|
165
|
+
else if (mapValueSchema.isMapSchema()) {
|
166
|
+
this.writeMap(mapValueSchema, val, valueNode, xmlns, true);
|
167
|
+
}
|
168
|
+
else if (mapValueSchema.isStructSchema()) {
|
169
|
+
valueNode = this.writeStruct(mapValueSchema, val, xmlns);
|
170
|
+
}
|
171
|
+
else {
|
172
|
+
this.writeSimpleInto(mapValueSchema, val, valueNode, xmlns);
|
173
|
+
}
|
174
|
+
entry.addChildNode(valueNode);
|
175
|
+
};
|
176
|
+
if (flat) {
|
177
|
+
for (const [key, val] of Object.entries(map)) {
|
178
|
+
if (sparse || val != null) {
|
179
|
+
const entry = XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());
|
180
|
+
addKeyValue(entry, key, val);
|
181
|
+
container.addChildNode(entry);
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
else {
|
186
|
+
let mapNode;
|
187
|
+
if (!containerIsMap) {
|
188
|
+
mapNode = XmlNode.of(mapTraits.xmlName ?? mapMember.getMemberName());
|
189
|
+
if (xmlns) {
|
190
|
+
mapNode.addAttribute(xmlnsAttr, xmlns);
|
191
|
+
}
|
192
|
+
container.addChildNode(mapNode);
|
193
|
+
}
|
194
|
+
for (const [key, val] of Object.entries(map)) {
|
195
|
+
if (sparse || val != null) {
|
196
|
+
const entry = XmlNode.of("entry");
|
197
|
+
addKeyValue(entry, key, val);
|
198
|
+
(containerIsMap ? container : mapNode).addChildNode(entry);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
}
|
203
|
+
writeSimple(_schema, value) {
|
204
|
+
if (null === value) {
|
205
|
+
throw new Error("@aws-sdk/core/protocols - (XML serializer) cannot write null value.");
|
206
|
+
}
|
207
|
+
const ns = NormalizedSchema.of(_schema);
|
208
|
+
let nodeContents = null;
|
209
|
+
if (value && typeof value === "object") {
|
210
|
+
if (ns.isBlobSchema()) {
|
211
|
+
nodeContents = (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
212
|
+
}
|
213
|
+
else if (ns.isTimestampSchema() && value instanceof Date) {
|
214
|
+
const options = this.settings.timestampFormat;
|
215
|
+
const format = options.useTrait
|
216
|
+
? ns.getSchema() === SCHEMA.TIMESTAMP_DEFAULT
|
217
|
+
? options.default
|
218
|
+
: ns.getSchema() ?? options.default
|
219
|
+
: options.default;
|
220
|
+
switch (format) {
|
221
|
+
case SCHEMA.TIMESTAMP_DATE_TIME:
|
222
|
+
nodeContents = value.toISOString().replace(".000Z", "Z");
|
223
|
+
break;
|
224
|
+
case SCHEMA.TIMESTAMP_HTTP_DATE:
|
225
|
+
nodeContents = dateToUtcString(value);
|
226
|
+
break;
|
227
|
+
case SCHEMA.TIMESTAMP_EPOCH_SECONDS:
|
228
|
+
nodeContents = String(value.getTime() / 1000);
|
229
|
+
break;
|
230
|
+
default:
|
231
|
+
console.warn("Missing timestamp format, using http date", value);
|
232
|
+
nodeContents = dateToUtcString(value);
|
233
|
+
break;
|
234
|
+
}
|
235
|
+
}
|
236
|
+
else if (ns.isBigDecimalSchema() && value) {
|
237
|
+
if (value instanceof NumericValue) {
|
238
|
+
return value.string;
|
239
|
+
}
|
240
|
+
return String(value);
|
241
|
+
}
|
242
|
+
else if (ns.isMapSchema() || ns.isListSchema()) {
|
243
|
+
throw new Error("@aws-sdk/core/protocols - xml serializer, cannot call _write() on List/Map schema, call writeList or writeMap() instead.");
|
244
|
+
}
|
245
|
+
else {
|
246
|
+
throw new Error(`@aws-sdk/core/protocols - xml serializer, unhandled schema type for object value and schema: ${ns.getName(true)}`);
|
247
|
+
}
|
248
|
+
}
|
249
|
+
if (ns.isStringSchema() ||
|
250
|
+
ns.isBooleanSchema() ||
|
251
|
+
ns.isNumericSchema() ||
|
252
|
+
ns.isBigIntegerSchema() ||
|
253
|
+
ns.isBigDecimalSchema()) {
|
254
|
+
nodeContents = String(value);
|
255
|
+
}
|
256
|
+
if (nodeContents === null) {
|
257
|
+
throw new Error(`Unhandled schema-value pair ${ns.getName(true)}=${value}`);
|
258
|
+
}
|
259
|
+
return nodeContents;
|
260
|
+
}
|
261
|
+
writeSimpleInto(_schema, value, into, parentXmlns) {
|
262
|
+
const nodeContents = this.writeSimple(_schema, value);
|
263
|
+
const ns = NormalizedSchema.of(_schema);
|
264
|
+
const content = new XmlText(nodeContents);
|
265
|
+
const [xmlnsAttr, xmlns] = this.getXmlnsAttribute(ns, parentXmlns);
|
266
|
+
if (xmlns) {
|
267
|
+
into.addAttribute(xmlnsAttr, xmlns);
|
268
|
+
}
|
269
|
+
into.addChildNode(content);
|
270
|
+
}
|
271
|
+
getXmlnsAttribute(ns, parentXmlns) {
|
272
|
+
const traits = ns.getMergedTraits();
|
273
|
+
const [prefix, xmlns] = traits.xmlNamespace ?? [];
|
274
|
+
if (xmlns && xmlns !== parentXmlns) {
|
275
|
+
return [prefix ? `xmlns:${prefix}` : "xmlns", xmlns];
|
276
|
+
}
|
277
|
+
return [void 0, void 0];
|
278
|
+
}
|
279
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
export function simpleFormatXml(xml) {
|
2
|
+
let b = "";
|
3
|
+
let indentation = 0;
|
4
|
+
for (let i = 0; i < xml.length; ++i) {
|
5
|
+
const c = xml[i];
|
6
|
+
if (c === "<") {
|
7
|
+
if (xml[i + 1] === "/") {
|
8
|
+
b += "\n" + " ".repeat(indentation - 2) + c;
|
9
|
+
indentation -= 4;
|
10
|
+
}
|
11
|
+
else {
|
12
|
+
b += c;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
else if (c === ">") {
|
16
|
+
indentation += 2;
|
17
|
+
b += c + "\n" + " ".repeat(indentation);
|
18
|
+
}
|
19
|
+
else {
|
20
|
+
b += c;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
return b
|
24
|
+
.split("\n")
|
25
|
+
.filter((s) => !!s.trim())
|
26
|
+
.join("\n");
|
27
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/ConfigurableSerdeContext.d.ts
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ConfigurableSerdeContext, SerdeFunctions } from "@smithy/types";
|
2
|
+
/**
|
3
|
+
* @internal
|
4
|
+
*/
|
5
|
+
export declare class SerdeContextConfig implements ConfigurableSerdeContext {
|
6
|
+
protected serdeContext?: SerdeFunctions;
|
7
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
8
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
export declare const collectBodyString: (streamBody: any, context:
|
1
|
+
import type { SerdeFunctions } from "@smithy/types";
|
2
|
+
export declare const collectBodyString: (streamBody: any, context: SerdeFunctions) => Promise<string>;
|
@@ -1,4 +1,17 @@
|
|
1
1
|
export * from "./coercing-serializers";
|
2
|
+
export * from "./json/AwsJson1_0Protocol";
|
3
|
+
export * from "./json/AwsJson1_1Protocol";
|
4
|
+
export * from "./json/AwsJsonRpcProtocol";
|
5
|
+
export * from "./json/AwsRestJsonProtocol";
|
6
|
+
export * from "./json/JsonCodec";
|
7
|
+
export * from "./json/JsonShapeDeserializer";
|
8
|
+
export * from "./json/JsonShapeSerializer";
|
2
9
|
export * from "./json/awsExpectUnion";
|
3
10
|
export * from "./json/parseJsonBody";
|
11
|
+
export * from "./query/AwsEc2QueryProtocol";
|
12
|
+
export * from "./query/AwsQueryProtocol";
|
13
|
+
export * from "./xml/AwsRestXmlProtocol";
|
14
|
+
export * from "./xml/XmlCodec";
|
15
|
+
export * from "./xml/XmlShapeDeserializer";
|
16
|
+
export * from "./xml/XmlShapeSerializer";
|
4
17
|
export * from "./xml/parseXmlBody";
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_0Protocol.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
|
2
|
+
/**
|
3
|
+
* @alpha
|
4
|
+
* @see https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html#differences-between-awsjson1-0-and-awsjson1-1
|
5
|
+
*/
|
6
|
+
export declare class AwsJson1_0Protocol extends AwsJsonRpcProtocol {
|
7
|
+
constructor({ defaultNamespace }: {
|
8
|
+
defaultNamespace: string;
|
9
|
+
});
|
10
|
+
getShapeId(): string;
|
11
|
+
protected getJsonRpcVersion(): "1.0";
|
12
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJson1_1Protocol.d.ts
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { AwsJsonRpcProtocol } from "./AwsJsonRpcProtocol";
|
2
|
+
/**
|
3
|
+
* @alpha
|
4
|
+
* @see https://smithy.io/2.0/aws/protocols/aws-json-1_1-protocol.html#differences-between-awsjson1-0-and-awsjson1-1
|
5
|
+
*/
|
6
|
+
export declare class AwsJson1_1Protocol extends AwsJsonRpcProtocol {
|
7
|
+
constructor({ defaultNamespace }: {
|
8
|
+
defaultNamespace: string;
|
9
|
+
});
|
10
|
+
getShapeId(): string;
|
11
|
+
protected getJsonRpcVersion(): "1.1";
|
12
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsJsonRpcProtocol.d.ts
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
import { RpcProtocol } from "@smithy/core/protocols";
|
2
|
+
import { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
3
|
+
import { JsonCodec } from "./JsonCodec";
|
4
|
+
/**
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare abstract class AwsJsonRpcProtocol extends RpcProtocol {
|
8
|
+
protected serializer: ShapeSerializer<string | Uint8Array>;
|
9
|
+
protected deserializer: ShapeDeserializer<string | Uint8Array>;
|
10
|
+
private codec;
|
11
|
+
protected constructor({ defaultNamespace }: {
|
12
|
+
defaultNamespace: string;
|
13
|
+
});
|
14
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
|
15
|
+
getPayloadCodec(): JsonCodec;
|
16
|
+
protected abstract getJsonRpcVersion(): "1.1" | "1.0";
|
17
|
+
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
18
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/AwsRestJsonProtocol.d.ts
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
import { HttpBindingProtocol } from "@smithy/core/protocols";
|
2
|
+
import { EndpointBearer, HandlerExecutionContext, HttpRequest, HttpResponse, OperationSchema, ResponseMetadata, SerdeFunctions, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
3
|
+
import { JsonCodec } from "./JsonCodec";
|
4
|
+
/**
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare class AwsRestJsonProtocol extends HttpBindingProtocol {
|
8
|
+
protected serializer: ShapeSerializer<string | Uint8Array>;
|
9
|
+
protected deserializer: ShapeDeserializer<string | Uint8Array>;
|
10
|
+
private readonly codec;
|
11
|
+
constructor({ defaultNamespace }: {
|
12
|
+
defaultNamespace: string;
|
13
|
+
});
|
14
|
+
getShapeId(): string;
|
15
|
+
getPayloadCodec(): JsonCodec;
|
16
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
17
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
|
18
|
+
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: HttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
19
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Codec, CodecSettings } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
import { JsonShapeDeserializer } from "./JsonShapeDeserializer";
|
4
|
+
import { JsonShapeSerializer } from "./JsonShapeSerializer";
|
5
|
+
/**
|
6
|
+
* @alpha
|
7
|
+
*/
|
8
|
+
export type JsonSettings = CodecSettings & {
|
9
|
+
jsonName: boolean;
|
10
|
+
};
|
11
|
+
/**
|
12
|
+
* @public
|
13
|
+
*/
|
14
|
+
export declare class JsonCodec extends SerdeContextConfig implements Codec<string, string> {
|
15
|
+
settings: JsonSettings;
|
16
|
+
constructor(settings: JsonSettings);
|
17
|
+
createSerializer(): JsonShapeSerializer;
|
18
|
+
createDeserializer(): JsonShapeDeserializer;
|
19
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeDeserializer.d.ts
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
import { DocumentType, Schema, ShapeDeserializer } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
import { JsonSettings } from "./JsonCodec";
|
4
|
+
/**
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare class JsonShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<string> {
|
8
|
+
settings: JsonSettings;
|
9
|
+
constructor(settings: JsonSettings);
|
10
|
+
read(schema: Schema, data: string | Uint8Array | unknown): Promise<any>;
|
11
|
+
readObject(schema: Schema, data: DocumentType): any;
|
12
|
+
private _read;
|
13
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
import { Schema, ShapeSerializer } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
import { JsonSettings } from "./JsonCodec";
|
4
|
+
/**
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare class JsonShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string> {
|
8
|
+
settings: JsonSettings;
|
9
|
+
private buffer;
|
10
|
+
private rootSchema;
|
11
|
+
constructor(settings: JsonSettings);
|
12
|
+
write(schema: Schema, value: unknown): void;
|
13
|
+
flush(): string;
|
14
|
+
private _write;
|
15
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/**
|
2
|
+
* Serializes BigInt and NumericValue to JSON-number.
|
3
|
+
* @internal
|
4
|
+
*/
|
5
|
+
export declare class JsonReplacer {
|
6
|
+
/**
|
7
|
+
* Stores placeholder key to true serialized value lookup.
|
8
|
+
*/
|
9
|
+
private readonly values;
|
10
|
+
private counter;
|
11
|
+
private stage;
|
12
|
+
/**
|
13
|
+
* Creates a jsonReplacer function that reserves big integer and big decimal values
|
14
|
+
* for later replacement.
|
15
|
+
*/
|
16
|
+
createReplacer(): (key: string, value: unknown) => unknown;
|
17
|
+
/**
|
18
|
+
* Replaces placeholder keys with their true values.
|
19
|
+
*/
|
20
|
+
replaceInJson(json: string): string;
|
21
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/**
|
2
|
+
* @param key - JSON object key.
|
3
|
+
* @param value - parsed value.
|
4
|
+
* @param context - original JSON string for reference. Not available until Node.js 21 and unavailable in Safari as
|
5
|
+
* of April 2025.
|
6
|
+
*
|
7
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#browser_compatibility
|
8
|
+
*
|
9
|
+
* @alpha
|
10
|
+
*
|
11
|
+
* @returns transformed value.
|
12
|
+
*/
|
13
|
+
export declare function jsonReviver(key: string, value: any, context?: {
|
14
|
+
source?: string;
|
15
|
+
}): any;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import type { HttpResponse,
|
1
|
+
import type { HttpResponse, SerdeFunctions } from "@smithy/types";
|
2
2
|
/**
|
3
3
|
* @internal
|
4
4
|
*/
|
5
|
-
export declare const parseJsonBody: (streamBody: any, context:
|
5
|
+
export declare const parseJsonBody: (streamBody: any, context: SerdeFunctions) => any;
|
6
6
|
/**
|
7
7
|
* @internal
|
8
8
|
*/
|
9
|
-
export declare const parseJsonErrorBody: (errorBody: any, context:
|
9
|
+
export declare const parseJsonErrorBody: (errorBody: any, context: SerdeFunctions) => Promise<any>;
|
10
10
|
/**
|
11
11
|
* @internal
|
12
12
|
*/
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/AwsQueryProtocol.d.ts
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
import { RpcProtocol } from "@smithy/core/protocols";
|
2
|
+
import { Codec, EndpointBearer, HandlerExecutionContext, HttpRequest, MetadataBearer, OperationSchema, ResponseMetadata, SerdeFunctions } from "@smithy/types";
|
3
|
+
import type { HttpResponse as IHttpResponse } from "@smithy/types/dist-types/http";
|
4
|
+
import { XmlShapeDeserializer } from "../xml/XmlShapeDeserializer";
|
5
|
+
import { QueryShapeSerializer } from "./QueryShapeSerializer";
|
6
|
+
/**
|
7
|
+
* @alpha
|
8
|
+
*/
|
9
|
+
export declare class AwsQueryProtocol extends RpcProtocol {
|
10
|
+
options: {
|
11
|
+
defaultNamespace: string;
|
12
|
+
xmlNamespace: string;
|
13
|
+
version: string;
|
14
|
+
};
|
15
|
+
protected serializer: QueryShapeSerializer;
|
16
|
+
protected deserializer: XmlShapeDeserializer;
|
17
|
+
constructor(options: {
|
18
|
+
defaultNamespace: string;
|
19
|
+
xmlNamespace: string;
|
20
|
+
version: string;
|
21
|
+
});
|
22
|
+
getShapeId(): string;
|
23
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
24
|
+
getPayloadCodec(): Codec<any, any>;
|
25
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<HttpRequest>;
|
26
|
+
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
27
|
+
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
28
|
+
protected loadQueryErrorCode(output: IHttpResponse, data: any): string | undefined;
|
29
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/query/QueryShapeSerializer.d.ts
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { CodecSettings, Schema, ShapeSerializer } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
/**
|
4
|
+
* @alpha
|
5
|
+
*/
|
6
|
+
export declare class QueryShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string | Uint8Array> {
|
7
|
+
private settings;
|
8
|
+
private buffer;
|
9
|
+
constructor(settings: CodecSettings);
|
10
|
+
write(schema: Schema, value: unknown, prefix?: string): void;
|
11
|
+
flush(): string | Uint8Array;
|
12
|
+
protected writeKey(key: string): void;
|
13
|
+
protected writeValue(value: string): void;
|
14
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/AwsRestXmlProtocol.d.ts
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
import { HttpBindingProtocol } 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, ShapeDeserializer, ShapeSerializer } from "@smithy/types";
|
4
|
+
import { XmlCodec } from "./XmlCodec";
|
5
|
+
/**
|
6
|
+
* @alpha
|
7
|
+
*/
|
8
|
+
export declare class AwsRestXmlProtocol extends HttpBindingProtocol {
|
9
|
+
private readonly codec;
|
10
|
+
protected serializer: ShapeSerializer<string | Uint8Array>;
|
11
|
+
protected deserializer: ShapeDeserializer<string | Uint8Array>;
|
12
|
+
constructor(options: {
|
13
|
+
defaultNamespace: string;
|
14
|
+
xmlNamespace: string;
|
15
|
+
});
|
16
|
+
getPayloadCodec(): XmlCodec;
|
17
|
+
getShapeId(): string;
|
18
|
+
serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
|
19
|
+
deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
|
20
|
+
protected handleError(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse, dataObject: any, metadata: ResponseMetadata): Promise<never>;
|
21
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { Codec, CodecSettings } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
import { XmlShapeDeserializer } from "./XmlShapeDeserializer";
|
4
|
+
import { XmlShapeSerializer } from "./XmlShapeSerializer";
|
5
|
+
export type XmlSettings = CodecSettings & {
|
6
|
+
xmlNamespace: string;
|
7
|
+
serviceNamespace: string;
|
8
|
+
};
|
9
|
+
export declare class XmlCodec extends SerdeContextConfig implements Codec<Uint8Array | string, Uint8Array | string> {
|
10
|
+
readonly settings: XmlSettings;
|
11
|
+
constructor(settings: XmlSettings);
|
12
|
+
createSerializer(): XmlShapeSerializer;
|
13
|
+
createDeserializer(): XmlShapeDeserializer;
|
14
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlShapeDeserializer.d.ts
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Schema, SerdeFunctions, ShapeDeserializer } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
import { XmlSettings } from "./XmlCodec";
|
4
|
+
/**
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare class XmlShapeDeserializer extends SerdeContextConfig implements ShapeDeserializer<Uint8Array | string> {
|
8
|
+
readonly settings: XmlSettings;
|
9
|
+
private stringDeserializer;
|
10
|
+
constructor(settings: XmlSettings);
|
11
|
+
setSerdeContext(serdeContext: SerdeFunctions): void;
|
12
|
+
/**
|
13
|
+
* @param schema - describing the data.
|
14
|
+
* @param bytes - serialized data.
|
15
|
+
* @param key - used by AwsQuery to step one additional depth into the object before reading it.
|
16
|
+
*/
|
17
|
+
read(schema: Schema, bytes: Uint8Array | string, key?: string): any;
|
18
|
+
readSchema(_schema: Schema, value: any): any;
|
19
|
+
protected parseXml(xml: string): any;
|
20
|
+
}
|
package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/xml/XmlShapeSerializer.d.ts
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
import type { Schema as ISchema, ShapeSerializer } from "@smithy/types";
|
2
|
+
import { SerdeContextConfig } from "../ConfigurableSerdeContext";
|
3
|
+
import { XmlSettings } from "./XmlCodec";
|
4
|
+
/**
|
5
|
+
* @alpha
|
6
|
+
*/
|
7
|
+
export declare class XmlShapeSerializer extends SerdeContextConfig implements ShapeSerializer<string | Uint8Array> {
|
8
|
+
readonly settings: XmlSettings;
|
9
|
+
private stringBuffer?;
|
10
|
+
private byteBuffer?;
|
11
|
+
private buffer?;
|
12
|
+
constructor(settings: XmlSettings);
|
13
|
+
write(schema: ISchema, value: unknown): void;
|
14
|
+
flush(): string | Uint8Array;
|
15
|
+
private writeStruct;
|
16
|
+
private writeList;
|
17
|
+
private writeMap;
|
18
|
+
private writeSimple;
|
19
|
+
private writeSimpleInto;
|
20
|
+
private getXmlnsAttribute;
|
21
|
+
}
|