@alienplatform/sdk 1.11.2 → 1.13.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.
- package/.turbo/turbo-build.log +18 -44
- package/dist/bearerTokenAuthenticationPolicy.js +40 -40
- package/dist/{serde.js → checksum.js} +1103 -469
- package/dist/dist-cjs.js +15256 -1
- package/dist/dist.js +37 -23
- package/dist/es5.js +107 -11
- package/dist/esm.js +4803 -4946
- package/dist/esm2.js +298 -236
- package/dist/event-streams.js +571 -4
- package/dist/generated/artifact_registry.d.ts +14 -14
- package/dist/generated/artifact_registry.d.ts.map +1 -1
- package/dist/generated/build.d.ts +6 -6
- package/dist/generated/build.d.ts.map +1 -1
- package/dist/generated/container.d.ts +6 -6
- package/dist/generated/container.d.ts.map +1 -1
- package/dist/generated/control.d.ts +8 -8
- package/dist/generated/control.d.ts.map +1 -1
- package/dist/generated/kv.d.ts +10 -10
- package/dist/generated/kv.d.ts.map +1 -1
- package/dist/generated/queue.d.ts +6 -6
- package/dist/generated/queue.d.ts.map +1 -1
- package/dist/generated/service_account.d.ts +4 -4
- package/dist/generated/service_account.d.ts.map +1 -1
- package/dist/generated/storage.d.ts +28 -28
- package/dist/generated/storage.d.ts.map +1 -1
- package/dist/generated/vault.d.ts +6 -6
- package/dist/generated/vault.d.ts.map +1 -1
- package/dist/generated/wait_until.d.ts +8 -8
- package/dist/generated/wait_until.d.ts.map +1 -1
- package/dist/generated/worker.d.ts +4 -4
- package/dist/generated/worker.d.ts.map +1 -1
- package/dist/index.js +311 -278
- package/dist/open.js +2 -1
- package/dist/rolldown-runtime.js +9 -2
- package/dist/src.js +10240 -10043
- package/dist/src2.js +15 -13
- package/package.json +4 -4
- package/src/generated/artifact_registry.ts +125 -35
- package/src/generated/build.ts +67 -19
- package/src/generated/container.ts +28 -10
- package/src/generated/control.ts +130 -34
- package/src/generated/google/protobuf/duration.ts +1 -1
- package/src/generated/google/protobuf/timestamp.ts +1 -1
- package/src/generated/kv.ts +53 -21
- package/src/generated/queue.ts +37 -13
- package/src/generated/service_account.ts +64 -16
- package/src/generated/storage.ts +189 -61
- package/src/generated/vault.ts +37 -13
- package/src/generated/wait_until.ts +68 -20
- package/src/generated/worker.ts +29 -11
- package/dist/client.js +0 -2376
- package/dist/dist-cjs2.js +0 -718
- package/dist/dist-cjs3.js +0 -2486
- package/dist/dist-cjs4.js +0 -171
- package/dist/dist-cjs5.js +0 -429
- package/dist/dist-cjs6.js +0 -60
- package/dist/dist-cjs7.js +0 -978
- package/dist/dist-cjs8.js +0 -86
- package/dist/dist-cjs9.js +0 -319
- package/dist/package.js +0 -4
- package/dist/protocols.js +0 -954
- package/dist/protocols2.js +0 -5565
- package/dist/signin.js +0 -723
- package/dist/sso-oidc.js +0 -940
- package/dist/sts.js +0 -1329
- package/dist/tslib.es6.js +0 -543
package/dist/protocols.js
DELETED
|
@@ -1,954 +0,0 @@
|
|
|
1
|
-
import { n as __esmMin, r as __exportAll } from "./rolldown-runtime.js";
|
|
2
|
-
import { $t as TypeRegistry, Dt as fromUtf8, Et as toBase64, On as require_dist_cjs, Sn as HttpResponse, Zt as init_schema, at as splitHeader, ct as _parseEpochTimestamp, dn as init_transport, gt as dateToUtcString, hn as parseQueryString, in as translateTraits, kt as fromBase64, lt as _parseRfc3339DateTimeWithOffset, mt as LazyJsonString, n as generateIdempotencyToken, pn as parseUrl, pt as quoteHeader, r as init_serde, s as sdkStreamMixin, st as splitEvery, t as Uint8ArrayBlobAdapter, tn as NormalizedSchema, tt as NumericValue, ut as _parseRfc7231DateTime, wn as HttpRequest, wt as toUtf8, yn as isValidHostname } from "./serde.js";
|
|
3
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/collect-stream-body.js
|
|
4
|
-
var collectBody;
|
|
5
|
-
var init_collect_stream_body = __esmMin((() => {
|
|
6
|
-
init_serde();
|
|
7
|
-
collectBody = async (streamBody = new Uint8Array(), context) => {
|
|
8
|
-
if (streamBody instanceof Uint8Array) return Uint8ArrayBlobAdapter.mutate(streamBody);
|
|
9
|
-
if (!streamBody) return Uint8ArrayBlobAdapter.mutate(new Uint8Array());
|
|
10
|
-
const fromContext = context.streamCollector(streamBody);
|
|
11
|
-
return Uint8ArrayBlobAdapter.mutate(await fromContext);
|
|
12
|
-
};
|
|
13
|
-
}));
|
|
14
|
-
//#endregion
|
|
15
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/extended-encode-uri-component.js
|
|
16
|
-
function extendedEncodeURIComponent(str) {
|
|
17
|
-
return encodeURIComponent(str).replace(/[!'()*]/g, function(c) {
|
|
18
|
-
return "%" + c.charCodeAt(0).toString(16).toUpperCase();
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
var init_extended_encode_uri_component = __esmMin((() => {}));
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/SerdeContext.js
|
|
24
|
-
var SerdeContext;
|
|
25
|
-
var init_SerdeContext = __esmMin((() => {
|
|
26
|
-
SerdeContext = class {
|
|
27
|
-
serdeContext;
|
|
28
|
-
setSerdeContext(serdeContext) {
|
|
29
|
-
this.serdeContext = serdeContext;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}));
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js
|
|
35
|
-
var HttpProtocol;
|
|
36
|
-
var init_HttpProtocol = __esmMin((() => {
|
|
37
|
-
init_schema();
|
|
38
|
-
init_transport();
|
|
39
|
-
init_SerdeContext();
|
|
40
|
-
HttpProtocol = class extends SerdeContext {
|
|
41
|
-
options;
|
|
42
|
-
compositeErrorRegistry;
|
|
43
|
-
constructor(options) {
|
|
44
|
-
super();
|
|
45
|
-
this.options = options;
|
|
46
|
-
this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace);
|
|
47
|
-
for (const etr of options.errorTypeRegistries ?? []) this.compositeErrorRegistry.copyFrom(etr);
|
|
48
|
-
}
|
|
49
|
-
getRequestType() {
|
|
50
|
-
return HttpRequest;
|
|
51
|
-
}
|
|
52
|
-
getResponseType() {
|
|
53
|
-
return HttpResponse;
|
|
54
|
-
}
|
|
55
|
-
setSerdeContext(serdeContext) {
|
|
56
|
-
this.serdeContext = serdeContext;
|
|
57
|
-
this.serializer.setSerdeContext(serdeContext);
|
|
58
|
-
this.deserializer.setSerdeContext(serdeContext);
|
|
59
|
-
if (this.getPayloadCodec()) this.getPayloadCodec().setSerdeContext(serdeContext);
|
|
60
|
-
}
|
|
61
|
-
updateServiceEndpoint(request, endpoint) {
|
|
62
|
-
if ("url" in endpoint) {
|
|
63
|
-
request.protocol = endpoint.url.protocol;
|
|
64
|
-
request.hostname = endpoint.url.hostname;
|
|
65
|
-
request.port = endpoint.url.port ? Number(endpoint.url.port) : void 0;
|
|
66
|
-
request.path = endpoint.url.pathname;
|
|
67
|
-
request.fragment = endpoint.url.hash || void 0;
|
|
68
|
-
request.username = endpoint.url.username || void 0;
|
|
69
|
-
request.password = endpoint.url.password || void 0;
|
|
70
|
-
if (!request.query) request.query = {};
|
|
71
|
-
for (const [k, v] of endpoint.url.searchParams.entries()) request.query[k] = v;
|
|
72
|
-
if (endpoint.headers) for (const name in endpoint.headers) request.headers[name] = endpoint.headers[name].join(", ");
|
|
73
|
-
return request;
|
|
74
|
-
} else {
|
|
75
|
-
request.protocol = endpoint.protocol;
|
|
76
|
-
request.hostname = endpoint.hostname;
|
|
77
|
-
request.port = endpoint.port ? Number(endpoint.port) : void 0;
|
|
78
|
-
request.path = endpoint.path;
|
|
79
|
-
request.query = { ...endpoint.query };
|
|
80
|
-
if (endpoint.headers) for (const name in endpoint.headers) request.headers[name] = endpoint.headers[name];
|
|
81
|
-
return request;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
setHostPrefix(request, operationSchema, input) {
|
|
85
|
-
if (this.serdeContext?.disableHostPrefix) return;
|
|
86
|
-
const inputNs = NormalizedSchema.of(operationSchema.input);
|
|
87
|
-
const opTraits = translateTraits(operationSchema.traits ?? {});
|
|
88
|
-
if (opTraits.endpoint) {
|
|
89
|
-
let hostPrefix = opTraits.endpoint?.[0];
|
|
90
|
-
if (typeof hostPrefix === "string") {
|
|
91
|
-
for (const [name, member] of inputNs.structIterator()) {
|
|
92
|
-
if (!member.getMergedTraits().hostLabel) continue;
|
|
93
|
-
const replacement = input[name];
|
|
94
|
-
if (typeof replacement !== "string") throw new Error(`@smithy/core/schema - ${name} in input must be a string as hostLabel.`);
|
|
95
|
-
hostPrefix = hostPrefix.replace(`{${name}}`, replacement);
|
|
96
|
-
}
|
|
97
|
-
request.hostname = hostPrefix + request.hostname;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
deserializeMetadata(output) {
|
|
102
|
-
return {
|
|
103
|
-
httpStatusCode: output.statusCode,
|
|
104
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
105
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
106
|
-
cfId: output.headers["x-amz-cf-id"]
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
async serializeEventStream({ eventStream, requestSchema, initialRequest }) {
|
|
110
|
-
return (await this.loadEventStreamCapability()).serializeEventStream({
|
|
111
|
-
eventStream,
|
|
112
|
-
requestSchema,
|
|
113
|
-
initialRequest
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
async deserializeEventStream({ response, responseSchema, initialResponseContainer }) {
|
|
117
|
-
return (await this.loadEventStreamCapability()).deserializeEventStream({
|
|
118
|
-
response,
|
|
119
|
-
responseSchema,
|
|
120
|
-
initialResponseContainer
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
async loadEventStreamCapability() {
|
|
124
|
-
const { EventStreamSerde } = await import("./event-streams.js");
|
|
125
|
-
return new EventStreamSerde({
|
|
126
|
-
marshaller: this.getEventStreamMarshaller(),
|
|
127
|
-
serializer: this.serializer,
|
|
128
|
-
deserializer: this.deserializer,
|
|
129
|
-
serdeContext: this.serdeContext,
|
|
130
|
-
defaultContentType: this.getDefaultContentType()
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
getDefaultContentType() {
|
|
134
|
-
throw new Error(`@smithy/core/protocols - ${this.constructor.name} getDefaultContentType() implementation missing.`);
|
|
135
|
-
}
|
|
136
|
-
async deserializeHttpMessage(schema, context, response, arg4, arg5) {
|
|
137
|
-
return [];
|
|
138
|
-
}
|
|
139
|
-
getEventStreamMarshaller() {
|
|
140
|
-
const context = this.serdeContext;
|
|
141
|
-
if (!context.eventStreamMarshaller) throw new Error("@smithy/core - HttpProtocol: eventStreamMarshaller missing in serdeContext.");
|
|
142
|
-
return context.eventStreamMarshaller;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
}));
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js
|
|
148
|
-
var HttpBindingProtocol;
|
|
149
|
-
var init_HttpBindingProtocol = __esmMin((() => {
|
|
150
|
-
init_schema();
|
|
151
|
-
init_serde();
|
|
152
|
-
init_transport();
|
|
153
|
-
init_HttpProtocol();
|
|
154
|
-
init_collect_stream_body();
|
|
155
|
-
init_extended_encode_uri_component();
|
|
156
|
-
HttpBindingProtocol = class extends HttpProtocol {
|
|
157
|
-
async serializeRequest(operationSchema, _input, context) {
|
|
158
|
-
const input = _input && typeof _input === "object" ? _input : {};
|
|
159
|
-
const serializer = this.serializer;
|
|
160
|
-
const query = {};
|
|
161
|
-
const headers = {};
|
|
162
|
-
const endpoint = await context.endpoint();
|
|
163
|
-
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
164
|
-
const payloadMemberNames = [];
|
|
165
|
-
const payloadMemberSchemas = [];
|
|
166
|
-
let hasNonHttpBindingMember = false;
|
|
167
|
-
let payload;
|
|
168
|
-
const request = new HttpRequest({
|
|
169
|
-
protocol: "",
|
|
170
|
-
hostname: "",
|
|
171
|
-
port: void 0,
|
|
172
|
-
path: "",
|
|
173
|
-
fragment: void 0,
|
|
174
|
-
query,
|
|
175
|
-
headers,
|
|
176
|
-
body: void 0
|
|
177
|
-
});
|
|
178
|
-
if (endpoint) {
|
|
179
|
-
this.updateServiceEndpoint(request, endpoint);
|
|
180
|
-
this.setHostPrefix(request, operationSchema, input);
|
|
181
|
-
const opTraits = translateTraits(operationSchema.traits);
|
|
182
|
-
if (opTraits.http) {
|
|
183
|
-
request.method = opTraits.http[0];
|
|
184
|
-
const [path, search] = opTraits.http[1].split("?");
|
|
185
|
-
if (request.path == "/") request.path = path;
|
|
186
|
-
else request.path += path;
|
|
187
|
-
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
188
|
-
for (const [key, value] of traitSearchParams) query[key] = value;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
for (const [memberName, memberNs] of ns.structIterator()) {
|
|
192
|
-
const memberTraits = memberNs.getMergedTraits() ?? {};
|
|
193
|
-
const inputMemberValue = input[memberName];
|
|
194
|
-
if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
|
|
195
|
-
if (memberTraits.httpLabel) {
|
|
196
|
-
if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) throw new Error(`No value provided for input HTTP label: ${memberName}.`);
|
|
197
|
-
}
|
|
198
|
-
continue;
|
|
199
|
-
}
|
|
200
|
-
if (memberTraits.httpPayload) if (memberNs.isStreaming()) if (memberNs.isStructSchema()) {
|
|
201
|
-
if (input[memberName]) payload = await this.serializeEventStream({
|
|
202
|
-
eventStream: input[memberName],
|
|
203
|
-
requestSchema: ns
|
|
204
|
-
});
|
|
205
|
-
} else payload = inputMemberValue;
|
|
206
|
-
else {
|
|
207
|
-
serializer.write(memberNs, inputMemberValue);
|
|
208
|
-
payload = serializer.flush();
|
|
209
|
-
}
|
|
210
|
-
else if (memberTraits.httpLabel) {
|
|
211
|
-
serializer.write(memberNs, inputMemberValue);
|
|
212
|
-
const replacement = serializer.flush();
|
|
213
|
-
if (request.path.includes(`{${memberName}+}`)) request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
|
|
214
|
-
else if (request.path.includes(`{${memberName}}`)) request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
|
|
215
|
-
} else if (memberTraits.httpHeader) {
|
|
216
|
-
serializer.write(memberNs, inputMemberValue);
|
|
217
|
-
headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
|
|
218
|
-
} else if (typeof memberTraits.httpPrefixHeaders === "string") for (const key in inputMemberValue) {
|
|
219
|
-
const val = inputMemberValue[key];
|
|
220
|
-
const amalgam = memberTraits.httpPrefixHeaders + key;
|
|
221
|
-
serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
|
|
222
|
-
headers[amalgam.toLowerCase()] = serializer.flush();
|
|
223
|
-
}
|
|
224
|
-
else if (memberTraits.httpQuery || memberTraits.httpQueryParams) this.serializeQuery(memberNs, inputMemberValue, query);
|
|
225
|
-
else {
|
|
226
|
-
hasNonHttpBindingMember = true;
|
|
227
|
-
payloadMemberNames.push(memberName);
|
|
228
|
-
payloadMemberSchemas.push(memberNs);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (hasNonHttpBindingMember && input) {
|
|
232
|
-
const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
|
|
233
|
-
const requiredMembers = ns.getSchema()[6];
|
|
234
|
-
const payloadSchema = [
|
|
235
|
-
3,
|
|
236
|
-
namespace,
|
|
237
|
-
name,
|
|
238
|
-
ns.getMergedTraits(),
|
|
239
|
-
payloadMemberNames,
|
|
240
|
-
payloadMemberSchemas,
|
|
241
|
-
void 0
|
|
242
|
-
];
|
|
243
|
-
if (requiredMembers) payloadSchema[6] = requiredMembers;
|
|
244
|
-
else payloadSchema.pop();
|
|
245
|
-
serializer.write(payloadSchema, input);
|
|
246
|
-
payload = serializer.flush();
|
|
247
|
-
}
|
|
248
|
-
request.headers = headers;
|
|
249
|
-
request.query = query;
|
|
250
|
-
request.body = payload;
|
|
251
|
-
return request;
|
|
252
|
-
}
|
|
253
|
-
serializeQuery(ns, data, query) {
|
|
254
|
-
const serializer = this.serializer;
|
|
255
|
-
const traits = ns.getMergedTraits();
|
|
256
|
-
if (traits.httpQueryParams) {
|
|
257
|
-
for (const key in data) if (!(key in query)) {
|
|
258
|
-
const val = data[key];
|
|
259
|
-
const valueSchema = ns.getValueSchema();
|
|
260
|
-
Object.assign(valueSchema.getMergedTraits(), {
|
|
261
|
-
...traits,
|
|
262
|
-
httpQuery: key,
|
|
263
|
-
httpQueryParams: void 0
|
|
264
|
-
});
|
|
265
|
-
this.serializeQuery(valueSchema, val, query);
|
|
266
|
-
}
|
|
267
|
-
return;
|
|
268
|
-
}
|
|
269
|
-
if (ns.isListSchema()) {
|
|
270
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
271
|
-
const buffer = [];
|
|
272
|
-
for (const item of data) {
|
|
273
|
-
serializer.write([ns.getValueSchema(), traits], item);
|
|
274
|
-
const serializable = serializer.flush();
|
|
275
|
-
if (sparse || serializable !== void 0) buffer.push(serializable);
|
|
276
|
-
}
|
|
277
|
-
query[traits.httpQuery] = buffer;
|
|
278
|
-
} else {
|
|
279
|
-
serializer.write([ns, traits], data);
|
|
280
|
-
query[traits.httpQuery] = serializer.flush();
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
async deserializeResponse(operationSchema, context, response) {
|
|
284
|
-
const deserializer = this.deserializer;
|
|
285
|
-
const ns = NormalizedSchema.of(operationSchema.output);
|
|
286
|
-
const dataObject = {};
|
|
287
|
-
if (response.statusCode >= 300) {
|
|
288
|
-
const bytes = await collectBody(response.body, context);
|
|
289
|
-
if (bytes.byteLength > 0) Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
290
|
-
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
291
|
-
throw new Error("@smithy/core/protocols - HTTP Protocol error handler failed to throw.");
|
|
292
|
-
}
|
|
293
|
-
for (const header in response.headers) {
|
|
294
|
-
const value = response.headers[header];
|
|
295
|
-
delete response.headers[header];
|
|
296
|
-
response.headers[header.toLowerCase()] = value;
|
|
297
|
-
}
|
|
298
|
-
const nonHttpBindingMembers = await this.deserializeHttpMessage(ns, context, response, dataObject);
|
|
299
|
-
if (nonHttpBindingMembers.length) {
|
|
300
|
-
const bytes = await collectBody(response.body, context);
|
|
301
|
-
if (bytes.byteLength > 0) {
|
|
302
|
-
const dataFromBody = await deserializer.read(ns, bytes);
|
|
303
|
-
for (const member of nonHttpBindingMembers) if (dataFromBody[member] != null) dataObject[member] = dataFromBody[member];
|
|
304
|
-
}
|
|
305
|
-
} else if (nonHttpBindingMembers.discardResponseBody) await collectBody(response.body, context);
|
|
306
|
-
dataObject.$metadata = this.deserializeMetadata(response);
|
|
307
|
-
return dataObject;
|
|
308
|
-
}
|
|
309
|
-
async deserializeHttpMessage(schema, context, response, arg4, arg5) {
|
|
310
|
-
let dataObject;
|
|
311
|
-
if (arg4 instanceof Set) dataObject = arg5;
|
|
312
|
-
else dataObject = arg4;
|
|
313
|
-
let discardResponseBody = true;
|
|
314
|
-
const deserializer = this.deserializer;
|
|
315
|
-
const ns = NormalizedSchema.of(schema);
|
|
316
|
-
const nonHttpBindingMembers = [];
|
|
317
|
-
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
318
|
-
const memberTraits = memberSchema.getMemberTraits();
|
|
319
|
-
if (memberTraits.httpPayload) {
|
|
320
|
-
discardResponseBody = false;
|
|
321
|
-
if (memberSchema.isStreaming()) if (memberSchema.isStructSchema()) dataObject[memberName] = await this.deserializeEventStream({
|
|
322
|
-
response,
|
|
323
|
-
responseSchema: ns
|
|
324
|
-
});
|
|
325
|
-
else dataObject[memberName] = sdkStreamMixin(response.body);
|
|
326
|
-
else if (response.body) {
|
|
327
|
-
const bytes = await collectBody(response.body, context);
|
|
328
|
-
if (bytes.byteLength > 0) dataObject[memberName] = await deserializer.read(memberSchema, bytes);
|
|
329
|
-
}
|
|
330
|
-
} else if (memberTraits.httpHeader) {
|
|
331
|
-
const key = String(memberTraits.httpHeader).toLowerCase();
|
|
332
|
-
const value = response.headers[key];
|
|
333
|
-
if (null != value) if (memberSchema.isListSchema()) {
|
|
334
|
-
const headerListValueSchema = memberSchema.getValueSchema();
|
|
335
|
-
headerListValueSchema.getMergedTraits().httpHeader = key;
|
|
336
|
-
let sections;
|
|
337
|
-
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === 4) sections = splitEvery(value, ",", 2);
|
|
338
|
-
else sections = splitHeader(value);
|
|
339
|
-
const list = [];
|
|
340
|
-
for (const section of sections) list.push(await deserializer.read(headerListValueSchema, section.trim()));
|
|
341
|
-
dataObject[memberName] = list;
|
|
342
|
-
} else dataObject[memberName] = await deserializer.read(memberSchema, value);
|
|
343
|
-
} else if (memberTraits.httpPrefixHeaders !== void 0) {
|
|
344
|
-
dataObject[memberName] = {};
|
|
345
|
-
for (const header in response.headers) if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
|
346
|
-
const value = response.headers[header];
|
|
347
|
-
const valueSchema = memberSchema.getValueSchema();
|
|
348
|
-
valueSchema.getMergedTraits().httpHeader = header;
|
|
349
|
-
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
|
|
350
|
-
}
|
|
351
|
-
} else if (memberTraits.httpResponseCode) dataObject[memberName] = response.statusCode;
|
|
352
|
-
else nonHttpBindingMembers.push(memberName);
|
|
353
|
-
}
|
|
354
|
-
nonHttpBindingMembers.discardResponseBody = discardResponseBody;
|
|
355
|
-
return nonHttpBindingMembers;
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
|
-
}));
|
|
359
|
-
//#endregion
|
|
360
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js
|
|
361
|
-
var RpcProtocol;
|
|
362
|
-
var init_RpcProtocol = __esmMin((() => {
|
|
363
|
-
init_schema();
|
|
364
|
-
init_transport();
|
|
365
|
-
init_HttpProtocol();
|
|
366
|
-
init_collect_stream_body();
|
|
367
|
-
RpcProtocol = class extends HttpProtocol {
|
|
368
|
-
async serializeRequest(operationSchema, _input, context) {
|
|
369
|
-
const serializer = this.serializer;
|
|
370
|
-
const query = {};
|
|
371
|
-
const headers = {};
|
|
372
|
-
const endpoint = await context.endpoint();
|
|
373
|
-
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
374
|
-
const schema = ns.getSchema();
|
|
375
|
-
let payload;
|
|
376
|
-
const input = _input && typeof _input === "object" ? _input : {};
|
|
377
|
-
const request = new HttpRequest({
|
|
378
|
-
protocol: "",
|
|
379
|
-
hostname: "",
|
|
380
|
-
port: void 0,
|
|
381
|
-
path: "/",
|
|
382
|
-
fragment: void 0,
|
|
383
|
-
query,
|
|
384
|
-
headers,
|
|
385
|
-
body: void 0
|
|
386
|
-
});
|
|
387
|
-
if (endpoint) {
|
|
388
|
-
this.updateServiceEndpoint(request, endpoint);
|
|
389
|
-
this.setHostPrefix(request, operationSchema, input);
|
|
390
|
-
}
|
|
391
|
-
if (input) {
|
|
392
|
-
const eventStreamMember = ns.getEventStreamMember();
|
|
393
|
-
if (eventStreamMember) {
|
|
394
|
-
if (input[eventStreamMember]) {
|
|
395
|
-
const initialRequest = {};
|
|
396
|
-
for (const [memberName, memberSchema] of ns.structIterator()) if (memberName !== eventStreamMember && input[memberName]) {
|
|
397
|
-
serializer.write(memberSchema, input[memberName]);
|
|
398
|
-
initialRequest[memberName] = serializer.flush();
|
|
399
|
-
}
|
|
400
|
-
payload = await this.serializeEventStream({
|
|
401
|
-
eventStream: input[eventStreamMember],
|
|
402
|
-
requestSchema: ns,
|
|
403
|
-
initialRequest
|
|
404
|
-
});
|
|
405
|
-
}
|
|
406
|
-
} else {
|
|
407
|
-
serializer.write(schema, input);
|
|
408
|
-
payload = serializer.flush();
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
request.headers = Object.assign(request.headers, headers);
|
|
412
|
-
request.query = query;
|
|
413
|
-
request.body = payload;
|
|
414
|
-
request.method = "POST";
|
|
415
|
-
return request;
|
|
416
|
-
}
|
|
417
|
-
async deserializeResponse(operationSchema, context, response) {
|
|
418
|
-
const deserializer = this.deserializer;
|
|
419
|
-
const ns = NormalizedSchema.of(operationSchema.output);
|
|
420
|
-
const dataObject = {};
|
|
421
|
-
if (response.statusCode >= 300) {
|
|
422
|
-
const bytes = await collectBody(response.body, context);
|
|
423
|
-
if (bytes.byteLength > 0) Object.assign(dataObject, await deserializer.read(15, bytes));
|
|
424
|
-
await this.handleError(operationSchema, context, response, dataObject, this.deserializeMetadata(response));
|
|
425
|
-
throw new Error("@smithy/core/protocols - RPC Protocol error handler failed to throw.");
|
|
426
|
-
}
|
|
427
|
-
for (const header in response.headers) {
|
|
428
|
-
const value = response.headers[header];
|
|
429
|
-
delete response.headers[header];
|
|
430
|
-
response.headers[header.toLowerCase()] = value;
|
|
431
|
-
}
|
|
432
|
-
const eventStreamMember = ns.getEventStreamMember();
|
|
433
|
-
if (eventStreamMember) dataObject[eventStreamMember] = await this.deserializeEventStream({
|
|
434
|
-
response,
|
|
435
|
-
responseSchema: ns,
|
|
436
|
-
initialResponseContainer: dataObject
|
|
437
|
-
});
|
|
438
|
-
else {
|
|
439
|
-
const bytes = await collectBody(response.body, context);
|
|
440
|
-
if (bytes.byteLength > 0) Object.assign(dataObject, await deserializer.read(ns, bytes));
|
|
441
|
-
}
|
|
442
|
-
dataObject.$metadata = this.deserializeMetadata(response);
|
|
443
|
-
return dataObject;
|
|
444
|
-
}
|
|
445
|
-
};
|
|
446
|
-
}));
|
|
447
|
-
//#endregion
|
|
448
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/resolve-path.js
|
|
449
|
-
var resolvedPath;
|
|
450
|
-
var init_resolve_path = __esmMin((() => {
|
|
451
|
-
init_extended_encode_uri_component();
|
|
452
|
-
resolvedPath = (resolvedPath, input, memberName, labelValueProvider, uriLabel, isGreedyLabel) => {
|
|
453
|
-
if (input != null && input[memberName] !== void 0) {
|
|
454
|
-
const labelValue = labelValueProvider();
|
|
455
|
-
if (labelValue == null || labelValue.length <= 0) throw new Error("Empty value provided for input HTTP label: " + memberName + ".");
|
|
456
|
-
resolvedPath = resolvedPath.replace(uriLabel, isGreedyLabel ? labelValue.split("/").map((segment) => extendedEncodeURIComponent(segment)).join("/") : extendedEncodeURIComponent(labelValue));
|
|
457
|
-
} else throw new Error("No value provided for input HTTP label: " + memberName + ".");
|
|
458
|
-
return resolvedPath;
|
|
459
|
-
};
|
|
460
|
-
}));
|
|
461
|
-
//#endregion
|
|
462
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js
|
|
463
|
-
function requestBuilder(input, context) {
|
|
464
|
-
return new RequestBuilder(input, context);
|
|
465
|
-
}
|
|
466
|
-
var RequestBuilder;
|
|
467
|
-
var init_requestBuilder = __esmMin((() => {
|
|
468
|
-
init_transport();
|
|
469
|
-
init_resolve_path();
|
|
470
|
-
RequestBuilder = class {
|
|
471
|
-
input;
|
|
472
|
-
context;
|
|
473
|
-
query = {};
|
|
474
|
-
method = "";
|
|
475
|
-
headers = {};
|
|
476
|
-
path = "";
|
|
477
|
-
body = null;
|
|
478
|
-
hostname = "";
|
|
479
|
-
resolvePathStack = [];
|
|
480
|
-
constructor(input, context) {
|
|
481
|
-
this.input = input;
|
|
482
|
-
this.context = context;
|
|
483
|
-
}
|
|
484
|
-
async build() {
|
|
485
|
-
const { hostname, protocol = "https", port, path: basePath } = await this.context.endpoint();
|
|
486
|
-
this.path = basePath;
|
|
487
|
-
for (const resolvePath of this.resolvePathStack) resolvePath(this.path);
|
|
488
|
-
return new HttpRequest({
|
|
489
|
-
protocol,
|
|
490
|
-
hostname: this.hostname || hostname,
|
|
491
|
-
port,
|
|
492
|
-
method: this.method,
|
|
493
|
-
path: this.path,
|
|
494
|
-
query: this.query,
|
|
495
|
-
body: this.body,
|
|
496
|
-
headers: this.headers
|
|
497
|
-
});
|
|
498
|
-
}
|
|
499
|
-
hn(hostname) {
|
|
500
|
-
this.hostname = hostname;
|
|
501
|
-
return this;
|
|
502
|
-
}
|
|
503
|
-
bp(uriLabel) {
|
|
504
|
-
this.resolvePathStack.push((basePath) => {
|
|
505
|
-
this.path = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + uriLabel;
|
|
506
|
-
});
|
|
507
|
-
return this;
|
|
508
|
-
}
|
|
509
|
-
p(memberName, labelValueProvider, uriLabel, isGreedyLabel) {
|
|
510
|
-
this.resolvePathStack.push((path) => {
|
|
511
|
-
this.path = resolvedPath(path, this.input, memberName, labelValueProvider, uriLabel, isGreedyLabel);
|
|
512
|
-
});
|
|
513
|
-
return this;
|
|
514
|
-
}
|
|
515
|
-
h(headers) {
|
|
516
|
-
this.headers = headers;
|
|
517
|
-
return this;
|
|
518
|
-
}
|
|
519
|
-
q(query) {
|
|
520
|
-
this.query = query;
|
|
521
|
-
return this;
|
|
522
|
-
}
|
|
523
|
-
b(body) {
|
|
524
|
-
this.body = body;
|
|
525
|
-
return this;
|
|
526
|
-
}
|
|
527
|
-
m(method) {
|
|
528
|
-
this.method = method;
|
|
529
|
-
return this;
|
|
530
|
-
}
|
|
531
|
-
};
|
|
532
|
-
}));
|
|
533
|
-
//#endregion
|
|
534
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/serde/determineTimestampFormat.js
|
|
535
|
-
function determineTimestampFormat(ns, settings) {
|
|
536
|
-
if (settings.timestampFormat.useTrait) {
|
|
537
|
-
if (ns.isTimestampSchema() && (ns.getSchema() === 5 || ns.getSchema() === 6 || ns.getSchema() === 7)) return ns.getSchema();
|
|
538
|
-
}
|
|
539
|
-
const { httpLabel, httpPrefixHeaders, httpHeader, httpQuery } = ns.getMergedTraits();
|
|
540
|
-
return (settings.httpBindings ? typeof httpPrefixHeaders === "string" || Boolean(httpHeader) ? 6 : Boolean(httpQuery) || Boolean(httpLabel) ? 5 : void 0 : void 0) ?? settings.timestampFormat.default;
|
|
541
|
-
}
|
|
542
|
-
var init_determineTimestampFormat = __esmMin((() => {}));
|
|
543
|
-
//#endregion
|
|
544
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/serde/FromStringShapeDeserializer.js
|
|
545
|
-
var FromStringShapeDeserializer;
|
|
546
|
-
var init_FromStringShapeDeserializer = __esmMin((() => {
|
|
547
|
-
init_schema();
|
|
548
|
-
init_serde();
|
|
549
|
-
init_SerdeContext();
|
|
550
|
-
init_determineTimestampFormat();
|
|
551
|
-
FromStringShapeDeserializer = class extends SerdeContext {
|
|
552
|
-
settings;
|
|
553
|
-
constructor(settings) {
|
|
554
|
-
super();
|
|
555
|
-
this.settings = settings;
|
|
556
|
-
}
|
|
557
|
-
read(_schema, data) {
|
|
558
|
-
const ns = NormalizedSchema.of(_schema);
|
|
559
|
-
if (ns.isListSchema()) return splitHeader(data).map((item) => this.read(ns.getValueSchema(), item));
|
|
560
|
-
if (ns.isBlobSchema()) return (this.serdeContext?.base64Decoder ?? fromBase64)(data);
|
|
561
|
-
if (ns.isTimestampSchema()) switch (determineTimestampFormat(ns, this.settings)) {
|
|
562
|
-
case 5: return _parseRfc3339DateTimeWithOffset(data);
|
|
563
|
-
case 6: return _parseRfc7231DateTime(data);
|
|
564
|
-
case 7: return _parseEpochTimestamp(data);
|
|
565
|
-
default:
|
|
566
|
-
console.warn("Missing timestamp format, parsing value with Date constructor:", data);
|
|
567
|
-
return new Date(data);
|
|
568
|
-
}
|
|
569
|
-
if (ns.isStringSchema()) {
|
|
570
|
-
const mediaType = ns.getMergedTraits().mediaType;
|
|
571
|
-
let intermediateValue = data;
|
|
572
|
-
if (mediaType) {
|
|
573
|
-
if (ns.getMergedTraits().httpHeader) intermediateValue = this.base64ToUtf8(intermediateValue);
|
|
574
|
-
if (mediaType === "application/json" || mediaType.endsWith("+json")) intermediateValue = LazyJsonString.from(intermediateValue);
|
|
575
|
-
return intermediateValue;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
if (ns.isNumericSchema()) return Number(data);
|
|
579
|
-
if (ns.isBigIntegerSchema()) return BigInt(data);
|
|
580
|
-
if (ns.isBigDecimalSchema()) return new NumericValue(data, "bigDecimal");
|
|
581
|
-
if (ns.isBooleanSchema()) return String(data).toLowerCase() === "true";
|
|
582
|
-
return data;
|
|
583
|
-
}
|
|
584
|
-
base64ToUtf8(base64String) {
|
|
585
|
-
return (this.serdeContext?.utf8Encoder ?? toUtf8)((this.serdeContext?.base64Decoder ?? fromBase64)(base64String));
|
|
586
|
-
}
|
|
587
|
-
};
|
|
588
|
-
}));
|
|
589
|
-
//#endregion
|
|
590
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeDeserializer.js
|
|
591
|
-
var HttpInterceptingShapeDeserializer;
|
|
592
|
-
var init_HttpInterceptingShapeDeserializer = __esmMin((() => {
|
|
593
|
-
init_schema();
|
|
594
|
-
init_serde();
|
|
595
|
-
init_SerdeContext();
|
|
596
|
-
init_FromStringShapeDeserializer();
|
|
597
|
-
HttpInterceptingShapeDeserializer = class extends SerdeContext {
|
|
598
|
-
codecDeserializer;
|
|
599
|
-
stringDeserializer;
|
|
600
|
-
constructor(codecDeserializer, codecSettings) {
|
|
601
|
-
super();
|
|
602
|
-
this.codecDeserializer = codecDeserializer;
|
|
603
|
-
this.stringDeserializer = new FromStringShapeDeserializer(codecSettings);
|
|
604
|
-
}
|
|
605
|
-
setSerdeContext(serdeContext) {
|
|
606
|
-
this.stringDeserializer.setSerdeContext(serdeContext);
|
|
607
|
-
this.codecDeserializer.setSerdeContext(serdeContext);
|
|
608
|
-
this.serdeContext = serdeContext;
|
|
609
|
-
}
|
|
610
|
-
read(schema, data) {
|
|
611
|
-
const ns = NormalizedSchema.of(schema);
|
|
612
|
-
const traits = ns.getMergedTraits();
|
|
613
|
-
const toString = this.serdeContext?.utf8Encoder ?? toUtf8;
|
|
614
|
-
if (traits.httpHeader || traits.httpResponseCode) return this.stringDeserializer.read(ns, toString(data));
|
|
615
|
-
if (traits.httpPayload) {
|
|
616
|
-
if (ns.isBlobSchema()) {
|
|
617
|
-
const toBytes = this.serdeContext?.utf8Decoder ?? fromUtf8;
|
|
618
|
-
if (typeof data === "string") return toBytes(data);
|
|
619
|
-
return data;
|
|
620
|
-
} else if (ns.isStringSchema()) {
|
|
621
|
-
if ("byteLength" in data) return toString(data);
|
|
622
|
-
return data;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
return this.codecDeserializer.read(ns, data);
|
|
626
|
-
}
|
|
627
|
-
};
|
|
628
|
-
}));
|
|
629
|
-
//#endregion
|
|
630
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/serde/ToStringShapeSerializer.js
|
|
631
|
-
var ToStringShapeSerializer;
|
|
632
|
-
var init_ToStringShapeSerializer = __esmMin((() => {
|
|
633
|
-
init_schema();
|
|
634
|
-
init_serde();
|
|
635
|
-
init_SerdeContext();
|
|
636
|
-
init_determineTimestampFormat();
|
|
637
|
-
ToStringShapeSerializer = class extends SerdeContext {
|
|
638
|
-
settings;
|
|
639
|
-
stringBuffer = "";
|
|
640
|
-
constructor(settings) {
|
|
641
|
-
super();
|
|
642
|
-
this.settings = settings;
|
|
643
|
-
}
|
|
644
|
-
write(schema, value) {
|
|
645
|
-
const ns = NormalizedSchema.of(schema);
|
|
646
|
-
switch (typeof value) {
|
|
647
|
-
case "object":
|
|
648
|
-
if (value === null) {
|
|
649
|
-
this.stringBuffer = "null";
|
|
650
|
-
return;
|
|
651
|
-
}
|
|
652
|
-
if (ns.isTimestampSchema()) {
|
|
653
|
-
if (!(value instanceof Date)) throw new Error(`@smithy/core/protocols - received non-Date value ${value} when schema expected Date in ${ns.getName(true)}`);
|
|
654
|
-
switch (determineTimestampFormat(ns, this.settings)) {
|
|
655
|
-
case 5:
|
|
656
|
-
this.stringBuffer = value.toISOString().replace(".000Z", "Z");
|
|
657
|
-
break;
|
|
658
|
-
case 6:
|
|
659
|
-
this.stringBuffer = dateToUtcString(value);
|
|
660
|
-
break;
|
|
661
|
-
case 7:
|
|
662
|
-
this.stringBuffer = String(value.getTime() / 1e3);
|
|
663
|
-
break;
|
|
664
|
-
default:
|
|
665
|
-
console.warn("Missing timestamp format, using epoch seconds", value);
|
|
666
|
-
this.stringBuffer = String(value.getTime() / 1e3);
|
|
667
|
-
}
|
|
668
|
-
return;
|
|
669
|
-
}
|
|
670
|
-
if (ns.isBlobSchema() && "byteLength" in value) {
|
|
671
|
-
this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
672
|
-
return;
|
|
673
|
-
}
|
|
674
|
-
if (ns.isListSchema() && Array.isArray(value)) {
|
|
675
|
-
let buffer = "";
|
|
676
|
-
for (const item of value) {
|
|
677
|
-
this.write([ns.getValueSchema(), ns.getMergedTraits()], item);
|
|
678
|
-
const headerItem = this.flush();
|
|
679
|
-
const serialized = ns.getValueSchema().isTimestampSchema() ? headerItem : quoteHeader(headerItem);
|
|
680
|
-
if (buffer !== "") buffer += ", ";
|
|
681
|
-
buffer += serialized;
|
|
682
|
-
}
|
|
683
|
-
this.stringBuffer = buffer;
|
|
684
|
-
return;
|
|
685
|
-
}
|
|
686
|
-
this.stringBuffer = JSON.stringify(value, null, 2);
|
|
687
|
-
break;
|
|
688
|
-
case "string":
|
|
689
|
-
const mediaType = ns.getMergedTraits().mediaType;
|
|
690
|
-
let intermediateValue = value;
|
|
691
|
-
if (mediaType) {
|
|
692
|
-
if (mediaType === "application/json" || mediaType.endsWith("+json")) intermediateValue = LazyJsonString.from(intermediateValue);
|
|
693
|
-
if (ns.getMergedTraits().httpHeader) {
|
|
694
|
-
this.stringBuffer = (this.serdeContext?.base64Encoder ?? toBase64)(intermediateValue.toString());
|
|
695
|
-
return;
|
|
696
|
-
}
|
|
697
|
-
}
|
|
698
|
-
this.stringBuffer = value;
|
|
699
|
-
break;
|
|
700
|
-
default: if (ns.isIdempotencyToken()) this.stringBuffer = generateIdempotencyToken();
|
|
701
|
-
else this.stringBuffer = String(value);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
flush() {
|
|
705
|
-
const buffer = this.stringBuffer;
|
|
706
|
-
this.stringBuffer = "";
|
|
707
|
-
return buffer;
|
|
708
|
-
}
|
|
709
|
-
};
|
|
710
|
-
}));
|
|
711
|
-
//#endregion
|
|
712
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/serde/HttpInterceptingShapeSerializer.js
|
|
713
|
-
var HttpInterceptingShapeSerializer;
|
|
714
|
-
var init_HttpInterceptingShapeSerializer = __esmMin((() => {
|
|
715
|
-
init_schema();
|
|
716
|
-
init_ToStringShapeSerializer();
|
|
717
|
-
HttpInterceptingShapeSerializer = class {
|
|
718
|
-
codecSerializer;
|
|
719
|
-
stringSerializer;
|
|
720
|
-
buffer;
|
|
721
|
-
constructor(codecSerializer, codecSettings, stringSerializer = new ToStringShapeSerializer(codecSettings)) {
|
|
722
|
-
this.codecSerializer = codecSerializer;
|
|
723
|
-
this.stringSerializer = stringSerializer;
|
|
724
|
-
}
|
|
725
|
-
setSerdeContext(serdeContext) {
|
|
726
|
-
this.codecSerializer.setSerdeContext(serdeContext);
|
|
727
|
-
this.stringSerializer.setSerdeContext(serdeContext);
|
|
728
|
-
}
|
|
729
|
-
write(schema, value) {
|
|
730
|
-
const ns = NormalizedSchema.of(schema);
|
|
731
|
-
const traits = ns.getMergedTraits();
|
|
732
|
-
if (traits.httpHeader || traits.httpLabel || traits.httpQuery) {
|
|
733
|
-
this.stringSerializer.write(ns, value);
|
|
734
|
-
this.buffer = this.stringSerializer.flush();
|
|
735
|
-
return;
|
|
736
|
-
}
|
|
737
|
-
return this.codecSerializer.write(ns, value);
|
|
738
|
-
}
|
|
739
|
-
flush() {
|
|
740
|
-
if (this.buffer !== void 0) {
|
|
741
|
-
const buffer = this.buffer;
|
|
742
|
-
this.buffer = void 0;
|
|
743
|
-
return buffer;
|
|
744
|
-
}
|
|
745
|
-
return this.codecSerializer.flush();
|
|
746
|
-
}
|
|
747
|
-
};
|
|
748
|
-
}));
|
|
749
|
-
//#endregion
|
|
750
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/Field.js
|
|
751
|
-
var import_dist_cjs, Field;
|
|
752
|
-
var init_Field = __esmMin((() => {
|
|
753
|
-
import_dist_cjs = require_dist_cjs();
|
|
754
|
-
Field = class {
|
|
755
|
-
name;
|
|
756
|
-
kind;
|
|
757
|
-
values;
|
|
758
|
-
constructor({ name, kind = import_dist_cjs.FieldPosition.HEADER, values = [] }) {
|
|
759
|
-
this.name = name;
|
|
760
|
-
this.kind = kind;
|
|
761
|
-
this.values = values;
|
|
762
|
-
}
|
|
763
|
-
add(value) {
|
|
764
|
-
this.values.push(value);
|
|
765
|
-
}
|
|
766
|
-
set(values) {
|
|
767
|
-
this.values = values;
|
|
768
|
-
}
|
|
769
|
-
remove(value) {
|
|
770
|
-
this.values = this.values.filter((v) => v !== value);
|
|
771
|
-
}
|
|
772
|
-
toString() {
|
|
773
|
-
return this.values.map((v) => v.includes(",") || v.includes(" ") ? `"${v}"` : v).join(", ");
|
|
774
|
-
}
|
|
775
|
-
get() {
|
|
776
|
-
return this.values;
|
|
777
|
-
}
|
|
778
|
-
};
|
|
779
|
-
}));
|
|
780
|
-
//#endregion
|
|
781
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/Fields.js
|
|
782
|
-
var Fields;
|
|
783
|
-
var init_Fields = __esmMin((() => {
|
|
784
|
-
Fields = class {
|
|
785
|
-
entries = {};
|
|
786
|
-
encoding;
|
|
787
|
-
constructor({ fields = [], encoding = "utf-8" }) {
|
|
788
|
-
fields.forEach(this.setField.bind(this));
|
|
789
|
-
this.encoding = encoding;
|
|
790
|
-
}
|
|
791
|
-
setField(field) {
|
|
792
|
-
this.entries[field.name.toLowerCase()] = field;
|
|
793
|
-
}
|
|
794
|
-
getField(name) {
|
|
795
|
-
return this.entries[name.toLowerCase()];
|
|
796
|
-
}
|
|
797
|
-
removeField(name) {
|
|
798
|
-
delete this.entries[name.toLowerCase()];
|
|
799
|
-
}
|
|
800
|
-
getByType(kind) {
|
|
801
|
-
return Object.values(this.entries).filter((field) => field.kind === kind);
|
|
802
|
-
}
|
|
803
|
-
};
|
|
804
|
-
}));
|
|
805
|
-
//#endregion
|
|
806
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/protocol-http/extensions/httpExtensionConfiguration.js
|
|
807
|
-
var getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig;
|
|
808
|
-
var init_httpExtensionConfiguration = __esmMin((() => {
|
|
809
|
-
getHttpHandlerExtensionConfiguration = (runtimeConfig) => {
|
|
810
|
-
return {
|
|
811
|
-
setHttpHandler(handler) {
|
|
812
|
-
runtimeConfig.httpHandler = handler;
|
|
813
|
-
},
|
|
814
|
-
httpHandler() {
|
|
815
|
-
return runtimeConfig.httpHandler;
|
|
816
|
-
},
|
|
817
|
-
updateHttpClientConfig(key, value) {
|
|
818
|
-
runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);
|
|
819
|
-
},
|
|
820
|
-
httpHandlerConfigs() {
|
|
821
|
-
return runtimeConfig.httpHandler.httpHandlerConfigs();
|
|
822
|
-
}
|
|
823
|
-
};
|
|
824
|
-
};
|
|
825
|
-
resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {
|
|
826
|
-
return { httpHandler: httpHandlerExtensionConfiguration.httpHandler() };
|
|
827
|
-
};
|
|
828
|
-
}));
|
|
829
|
-
//#endregion
|
|
830
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js
|
|
831
|
-
function contentLengthMiddleware(bodyLengthChecker) {
|
|
832
|
-
return (next) => async (args) => {
|
|
833
|
-
const request = args.request;
|
|
834
|
-
if (HttpRequest.isInstance(request)) {
|
|
835
|
-
const { body, headers } = request;
|
|
836
|
-
if (body && Object.keys(headers).map((str) => str.toLowerCase()).indexOf(CONTENT_LENGTH_HEADER) === -1) try {
|
|
837
|
-
const length = bodyLengthChecker(body);
|
|
838
|
-
request.headers = {
|
|
839
|
-
...request.headers,
|
|
840
|
-
[CONTENT_LENGTH_HEADER]: String(length)
|
|
841
|
-
};
|
|
842
|
-
} catch (error) {}
|
|
843
|
-
}
|
|
844
|
-
return next({
|
|
845
|
-
...args,
|
|
846
|
-
request
|
|
847
|
-
});
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
var CONTENT_LENGTH_HEADER, contentLengthMiddlewareOptions, getContentLengthPlugin;
|
|
851
|
-
var init_contentLengthMiddleware = __esmMin((() => {
|
|
852
|
-
init_transport();
|
|
853
|
-
CONTENT_LENGTH_HEADER = "content-length";
|
|
854
|
-
contentLengthMiddlewareOptions = {
|
|
855
|
-
step: "build",
|
|
856
|
-
tags: ["SET_CONTENT_LENGTH", "CONTENT_LENGTH"],
|
|
857
|
-
name: "contentLengthMiddleware",
|
|
858
|
-
override: true
|
|
859
|
-
};
|
|
860
|
-
getContentLengthPlugin = (options) => ({ applyToStack: (clientStack) => {
|
|
861
|
-
clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);
|
|
862
|
-
} });
|
|
863
|
-
}));
|
|
864
|
-
//#endregion
|
|
865
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri.js
|
|
866
|
-
var escapeUri, hexEncode;
|
|
867
|
-
var init_escape_uri = __esmMin((() => {
|
|
868
|
-
escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);
|
|
869
|
-
hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;
|
|
870
|
-
}));
|
|
871
|
-
//#endregion
|
|
872
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/util-uri-escape/escape-uri-path.js
|
|
873
|
-
var escapeUriPath;
|
|
874
|
-
var init_escape_uri_path = __esmMin((() => {
|
|
875
|
-
init_escape_uri();
|
|
876
|
-
escapeUriPath = (uri) => uri.split("/").map(escapeUri).join("/");
|
|
877
|
-
}));
|
|
878
|
-
//#endregion
|
|
879
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/querystring-builder/buildQueryString.js
|
|
880
|
-
function buildQueryString(query) {
|
|
881
|
-
const parts = [];
|
|
882
|
-
for (let key of Object.keys(query).sort()) {
|
|
883
|
-
const value = query[key];
|
|
884
|
-
key = escapeUri(key);
|
|
885
|
-
if (Array.isArray(value)) for (let i = 0, iLen = value.length; i < iLen; i++) parts.push(`${key}=${escapeUri(value[i])}`);
|
|
886
|
-
else {
|
|
887
|
-
let qsEntry = key;
|
|
888
|
-
if (value || typeof value === "string") qsEntry += `=${escapeUri(value)}`;
|
|
889
|
-
parts.push(qsEntry);
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
return parts.join("&");
|
|
893
|
-
}
|
|
894
|
-
var init_buildQueryString = __esmMin((() => {
|
|
895
|
-
init_escape_uri();
|
|
896
|
-
}));
|
|
897
|
-
//#endregion
|
|
898
|
-
//#region ../../node_modules/.pnpm/@smithy+core@3.24.7/node_modules/@smithy/core/dist-es/submodules/protocols/index.js
|
|
899
|
-
var protocols_exports = /* @__PURE__ */ __exportAll({
|
|
900
|
-
Field: () => Field,
|
|
901
|
-
Fields: () => Fields,
|
|
902
|
-
FromStringShapeDeserializer: () => FromStringShapeDeserializer,
|
|
903
|
-
HttpBindingProtocol: () => HttpBindingProtocol,
|
|
904
|
-
HttpInterceptingShapeDeserializer: () => HttpInterceptingShapeDeserializer,
|
|
905
|
-
HttpInterceptingShapeSerializer: () => HttpInterceptingShapeSerializer,
|
|
906
|
-
HttpProtocol: () => HttpProtocol,
|
|
907
|
-
HttpRequest: () => HttpRequest,
|
|
908
|
-
HttpResponse: () => HttpResponse,
|
|
909
|
-
RequestBuilder: () => RequestBuilder,
|
|
910
|
-
RpcProtocol: () => RpcProtocol,
|
|
911
|
-
SerdeContext: () => SerdeContext,
|
|
912
|
-
ToStringShapeSerializer: () => ToStringShapeSerializer,
|
|
913
|
-
buildQueryString: () => buildQueryString,
|
|
914
|
-
collectBody: () => collectBody,
|
|
915
|
-
contentLengthMiddleware: () => contentLengthMiddleware,
|
|
916
|
-
contentLengthMiddlewareOptions: () => contentLengthMiddlewareOptions,
|
|
917
|
-
determineTimestampFormat: () => determineTimestampFormat,
|
|
918
|
-
escapeUri: () => escapeUri,
|
|
919
|
-
escapeUriPath: () => escapeUriPath,
|
|
920
|
-
extendedEncodeURIComponent: () => extendedEncodeURIComponent,
|
|
921
|
-
getContentLengthPlugin: () => getContentLengthPlugin,
|
|
922
|
-
getHttpHandlerExtensionConfiguration: () => getHttpHandlerExtensionConfiguration,
|
|
923
|
-
isValidHostname: () => isValidHostname,
|
|
924
|
-
parseQueryString: () => parseQueryString,
|
|
925
|
-
parseUrl: () => parseUrl,
|
|
926
|
-
requestBuilder: () => requestBuilder,
|
|
927
|
-
resolveHttpHandlerRuntimeConfig: () => resolveHttpHandlerRuntimeConfig,
|
|
928
|
-
resolvedPath: () => resolvedPath
|
|
929
|
-
});
|
|
930
|
-
var init_protocols = __esmMin((() => {
|
|
931
|
-
init_collect_stream_body();
|
|
932
|
-
init_extended_encode_uri_component();
|
|
933
|
-
init_HttpBindingProtocol();
|
|
934
|
-
init_HttpProtocol();
|
|
935
|
-
init_RpcProtocol();
|
|
936
|
-
init_requestBuilder();
|
|
937
|
-
init_resolve_path();
|
|
938
|
-
init_FromStringShapeDeserializer();
|
|
939
|
-
init_HttpInterceptingShapeDeserializer();
|
|
940
|
-
init_HttpInterceptingShapeSerializer();
|
|
941
|
-
init_ToStringShapeSerializer();
|
|
942
|
-
init_determineTimestampFormat();
|
|
943
|
-
init_SerdeContext();
|
|
944
|
-
init_Field();
|
|
945
|
-
init_Fields();
|
|
946
|
-
init_transport();
|
|
947
|
-
init_httpExtensionConfiguration();
|
|
948
|
-
init_contentLengthMiddleware();
|
|
949
|
-
init_escape_uri();
|
|
950
|
-
init_escape_uri_path();
|
|
951
|
-
init_buildQueryString();
|
|
952
|
-
}));
|
|
953
|
-
//#endregion
|
|
954
|
-
export { init_SerdeContext as C, init_collect_stream_body as D, collectBody as E, SerdeContext as S, init_extended_encode_uri_component as T, requestBuilder as _, getHttpHandlerExtensionConfiguration as a, HttpBindingProtocol as b, HttpInterceptingShapeSerializer as c, init_HttpInterceptingShapeDeserializer as d, FromStringShapeDeserializer as f, init_requestBuilder as g, init_determineTimestampFormat as h, init_contentLengthMiddleware as i, init_HttpInterceptingShapeSerializer as l, determineTimestampFormat as m, protocols_exports as n, init_httpExtensionConfiguration as o, init_FromStringShapeDeserializer as p, getContentLengthPlugin as r, resolveHttpHandlerRuntimeConfig as s, init_protocols as t, HttpInterceptingShapeDeserializer as u, RpcProtocol as v, extendedEncodeURIComponent as w, init_HttpBindingProtocol as x, init_RpcProtocol as y };
|