@jr2804/livesync-cli 0.25.82-cli → 1.0.0-cli.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AwsRestJsonProtocol-BPmCQzXa.cjs +391 -0
- package/dist/CredentialsProviderError-DQ_v7TCm.cjs +45 -0
- package/dist/XmlShapeDeserializer-B1_gcW92.cjs +2097 -0
- package/dist/bundle.cjs +152019 -0
- package/dist/chain-D9g13I5f.cjs +21 -0
- package/dist/common-B3KclSP_.cjs +375 -0
- package/dist/configLoader-Cur07c2S.cjs +149 -0
- package/dist/date-utils-Dr5LXq4_.cjs +338 -0
- package/dist/dist-es-BU2b9jKG.cjs +274 -0
- package/dist/dist-es-CaaxKLO9.cjs +52 -0
- package/dist/dist-es-D7nIauPC.cjs +60 -0
- package/dist/dist-es-DhxfSNMj.cjs +128 -0
- package/dist/dist-es-FcX9AtZC.cjs +433 -0
- package/dist/dist-es-vq3O1QUl.cjs +331 -0
- package/dist/esbuild.config.cjs +24 -0
- package/dist/event-streams-DmrxQXpO.cjs +195 -0
- package/dist/extensions-DkDzTVCO.cjs +4823 -0
- package/dist/externalDataInterceptor-D7DaIG7M.cjs +24 -0
- package/dist/getSSOTokenFromFile-D0KPH2qZ.cjs +36 -0
- package/dist/httpRequest-C7Ex2WeE.cjs +59 -0
- package/dist/index.cjs +32679 -37133
- package/dist/loadSharedConfigFiles-CqEQHuLW.cjs +117 -0
- package/dist/loadSso-Dn78jIWR.cjs +639 -0
- package/dist/package-BC7A0_n0.cjs +158 -0
- package/dist/parseKnownFiles-DLeTaAhg.cjs +21 -0
- package/dist/readFile-B3ey_wDD.cjs +46 -0
- package/dist/sdk-stream-mixin-YBLWtp6l.cjs +146 -0
- package/dist/serde-DtADB-gG.cjs +597 -0
- package/dist/setCredentialFeature-qcUbSyqa.cjs +13 -0
- package/dist/signin-DHnd2WFx.cjs +715 -0
- package/dist/sso-oidc-B4fkm2gn.cjs +901 -0
- package/dist/stream-collector-jwXXBEUn.cjs +584 -0
- package/dist/sts-C9aqjeec.cjs +1531 -0
- package/package.json +2 -4
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
const require_stream_collector = require("./stream-collector-jwXXBEUn.cjs");
|
|
2
|
+
const require_extensions = require("./extensions-DkDzTVCO.cjs");
|
|
3
|
+
const require_date_utils = require("./date-utils-Dr5LXq4_.cjs");
|
|
4
|
+
const require_serde = require("./serde-DtADB-gG.cjs");
|
|
5
|
+
const require_common = require("./common-B3KclSP_.cjs");
|
|
6
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js
|
|
7
|
+
function jsonReviver(key, value, context) {
|
|
8
|
+
if (context?.source) {
|
|
9
|
+
const numericString = context.source;
|
|
10
|
+
if (typeof value === "number") {
|
|
11
|
+
if (value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER || numericString !== String(value)) if (numericString.includes(".")) return new require_serde.NumericValue(numericString, "bigDecimal");
|
|
12
|
+
else return BigInt(numericString);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js
|
|
19
|
+
var parseJsonBody = (streamBody, context) => require_common.collectBodyString(streamBody, context).then((encoded) => {
|
|
20
|
+
if (encoded.length) try {
|
|
21
|
+
return JSON.parse(encoded);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
if (e?.name === "SyntaxError") Object.defineProperty(e, "$responseBodyText", { value: encoded });
|
|
24
|
+
throw e;
|
|
25
|
+
}
|
|
26
|
+
return {};
|
|
27
|
+
});
|
|
28
|
+
var loadRestJsonErrorCode = (output, data) => {
|
|
29
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
30
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
31
|
+
let cleanValue = rawValue;
|
|
32
|
+
if (typeof cleanValue === "number") cleanValue = cleanValue.toString();
|
|
33
|
+
if (cleanValue.indexOf(",") >= 0) cleanValue = cleanValue.split(",")[0];
|
|
34
|
+
if (cleanValue.indexOf(":") >= 0) cleanValue = cleanValue.split(":")[0];
|
|
35
|
+
if (cleanValue.indexOf("#") >= 0) cleanValue = cleanValue.split("#")[1];
|
|
36
|
+
return cleanValue;
|
|
37
|
+
};
|
|
38
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
39
|
+
if (headerKey !== void 0) return sanitizeErrorCode(output.headers[headerKey]);
|
|
40
|
+
if (data && typeof data === "object") {
|
|
41
|
+
const codeKey = findKey(data, "code");
|
|
42
|
+
if (codeKey && data[codeKey] !== void 0) return sanitizeErrorCode(data[codeKey]);
|
|
43
|
+
if (data["__type"] !== void 0) return sanitizeErrorCode(data["__type"]);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
47
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeDeserializer.js
|
|
48
|
+
var JsonShapeDeserializer = class extends require_extensions.SerdeContextConfig {
|
|
49
|
+
settings;
|
|
50
|
+
constructor(settings) {
|
|
51
|
+
super();
|
|
52
|
+
this.settings = settings;
|
|
53
|
+
}
|
|
54
|
+
async read(schema, data) {
|
|
55
|
+
return this._read(schema, typeof data === "string" ? JSON.parse(data, jsonReviver) : await parseJsonBody(data, this.serdeContext));
|
|
56
|
+
}
|
|
57
|
+
readObject(schema, data) {
|
|
58
|
+
return this._read(schema, data);
|
|
59
|
+
}
|
|
60
|
+
_read(schema, value) {
|
|
61
|
+
const isObject = value !== null && typeof value === "object";
|
|
62
|
+
const ns = require_extensions.NormalizedSchema.of(schema);
|
|
63
|
+
if (isObject) {
|
|
64
|
+
if (ns.isStructSchema()) {
|
|
65
|
+
const record = value;
|
|
66
|
+
const union = ns.isUnionSchema();
|
|
67
|
+
const out = {};
|
|
68
|
+
let nameMap = void 0;
|
|
69
|
+
const { jsonName } = this.settings;
|
|
70
|
+
if (jsonName) nameMap = {};
|
|
71
|
+
let unionSerde;
|
|
72
|
+
if (union) unionSerde = new require_extensions.UnionSerde(record, out);
|
|
73
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
74
|
+
let fromKey = memberName;
|
|
75
|
+
if (jsonName) {
|
|
76
|
+
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
|
|
77
|
+
nameMap[fromKey] = memberName;
|
|
78
|
+
}
|
|
79
|
+
if (union) unionSerde.mark(fromKey);
|
|
80
|
+
if (record[fromKey] != null) out[memberName] = this._read(memberSchema, record[fromKey]);
|
|
81
|
+
}
|
|
82
|
+
if (union) unionSerde.writeUnknown();
|
|
83
|
+
else if (typeof record.__type === "string") for (const [k, v] of Object.entries(record)) {
|
|
84
|
+
const t = jsonName ? nameMap[k] ?? k : k;
|
|
85
|
+
if (!(t in out)) out[t] = v;
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
if (Array.isArray(value) && ns.isListSchema()) {
|
|
90
|
+
const listMember = ns.getValueSchema();
|
|
91
|
+
const out = [];
|
|
92
|
+
for (const item of value) out.push(this._read(listMember, item));
|
|
93
|
+
return out;
|
|
94
|
+
}
|
|
95
|
+
if (ns.isMapSchema()) {
|
|
96
|
+
const mapMember = ns.getValueSchema();
|
|
97
|
+
const out = {};
|
|
98
|
+
for (const [_k, _v] of Object.entries(value)) out[_k] = this._read(mapMember, _v);
|
|
99
|
+
return out;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (ns.isBlobSchema() && typeof value === "string") return require_stream_collector.fromBase64(value);
|
|
103
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
104
|
+
if (ns.isStringSchema() && typeof value === "string" && mediaType) {
|
|
105
|
+
if (mediaType === "application/json" || mediaType.endsWith("+json")) return require_serde.LazyJsonString.from(value);
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
108
|
+
if (ns.isTimestampSchema() && value != null) switch (require_extensions.determineTimestampFormat(ns, this.settings)) {
|
|
109
|
+
case 5: return require_date_utils.parseRfc3339DateTimeWithOffset(value);
|
|
110
|
+
case 6: return require_date_utils.parseRfc7231DateTime(value);
|
|
111
|
+
case 7: return require_date_utils.parseEpochTimestamp(value);
|
|
112
|
+
default:
|
|
113
|
+
console.warn("Missing timestamp format, parsing value with Date constructor:", value);
|
|
114
|
+
return new Date(value);
|
|
115
|
+
}
|
|
116
|
+
if (ns.isBigIntegerSchema() && (typeof value === "number" || typeof value === "string")) return BigInt(value);
|
|
117
|
+
if (ns.isBigDecimalSchema() && value != void 0) {
|
|
118
|
+
if (value instanceof require_serde.NumericValue) return value;
|
|
119
|
+
const untyped = value;
|
|
120
|
+
if (untyped.type === "bigDecimal" && "string" in untyped) return new require_serde.NumericValue(untyped.string, untyped.type);
|
|
121
|
+
return new require_serde.NumericValue(String(value), "bigDecimal");
|
|
122
|
+
}
|
|
123
|
+
if (ns.isNumericSchema() && typeof value === "string") {
|
|
124
|
+
switch (value) {
|
|
125
|
+
case "Infinity": return Infinity;
|
|
126
|
+
case "-Infinity": return -Infinity;
|
|
127
|
+
case "NaN": return NaN;
|
|
128
|
+
}
|
|
129
|
+
return value;
|
|
130
|
+
}
|
|
131
|
+
if (ns.isDocumentSchema()) if (isObject) {
|
|
132
|
+
const out = Array.isArray(value) ? [] : {};
|
|
133
|
+
for (const [k, v] of Object.entries(value)) if (v instanceof require_serde.NumericValue) out[k] = v;
|
|
134
|
+
else out[k] = this._read(ns, v);
|
|
135
|
+
return out;
|
|
136
|
+
} else return structuredClone(value);
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReplacer.js
|
|
142
|
+
var JsonReplacer = class {
|
|
143
|
+
values = /* @__PURE__ */ new Map();
|
|
144
|
+
counter = 0;
|
|
145
|
+
stage = 0;
|
|
146
|
+
createReplacer() {
|
|
147
|
+
if (this.stage === 1) throw new Error("@aws-sdk/core/protocols - JsonReplacer already created.");
|
|
148
|
+
if (this.stage === 2) throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
|
|
149
|
+
this.stage = 1;
|
|
150
|
+
return (key, value) => {
|
|
151
|
+
if (value instanceof require_serde.NumericValue) {
|
|
152
|
+
const v = `${"Νnv" + this.counter++}_` + value.string;
|
|
153
|
+
this.values.set(`"${v}"`, value.string);
|
|
154
|
+
return v;
|
|
155
|
+
}
|
|
156
|
+
if (typeof value === "bigint") {
|
|
157
|
+
const s = value.toString();
|
|
158
|
+
const v = `${"Νb" + this.counter++}_` + s;
|
|
159
|
+
this.values.set(`"${v}"`, s);
|
|
160
|
+
return v;
|
|
161
|
+
}
|
|
162
|
+
return value;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
replaceInJson(json) {
|
|
166
|
+
if (this.stage === 0) throw new Error("@aws-sdk/core/protocols - JsonReplacer not created yet.");
|
|
167
|
+
if (this.stage === 2) throw new Error("@aws-sdk/core/protocols - JsonReplacer exhausted.");
|
|
168
|
+
this.stage = 2;
|
|
169
|
+
if (this.counter === 0) return json;
|
|
170
|
+
for (const [key, value] of this.values) json = json.replace(key, value);
|
|
171
|
+
return json;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
//#endregion
|
|
175
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js
|
|
176
|
+
var JsonShapeSerializer = class extends require_extensions.SerdeContextConfig {
|
|
177
|
+
settings;
|
|
178
|
+
buffer;
|
|
179
|
+
useReplacer = false;
|
|
180
|
+
rootSchema;
|
|
181
|
+
constructor(settings) {
|
|
182
|
+
super();
|
|
183
|
+
this.settings = settings;
|
|
184
|
+
}
|
|
185
|
+
write(schema, value) {
|
|
186
|
+
this.rootSchema = require_extensions.NormalizedSchema.of(schema);
|
|
187
|
+
this.buffer = this._write(this.rootSchema, value);
|
|
188
|
+
}
|
|
189
|
+
writeDiscriminatedDocument(schema, value) {
|
|
190
|
+
this.write(schema, value);
|
|
191
|
+
if (typeof this.buffer === "object") this.buffer.__type = require_extensions.NormalizedSchema.of(schema).getName(true);
|
|
192
|
+
}
|
|
193
|
+
flush() {
|
|
194
|
+
const { rootSchema, useReplacer } = this;
|
|
195
|
+
this.rootSchema = void 0;
|
|
196
|
+
this.useReplacer = false;
|
|
197
|
+
if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
|
|
198
|
+
if (!useReplacer) return JSON.stringify(this.buffer);
|
|
199
|
+
const replacer = new JsonReplacer();
|
|
200
|
+
return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
|
|
201
|
+
}
|
|
202
|
+
return this.buffer;
|
|
203
|
+
}
|
|
204
|
+
_write(schema, value, container) {
|
|
205
|
+
const isObject = value !== null && typeof value === "object";
|
|
206
|
+
const ns = require_extensions.NormalizedSchema.of(schema);
|
|
207
|
+
if (isObject) {
|
|
208
|
+
if (ns.isStructSchema()) {
|
|
209
|
+
const record = value;
|
|
210
|
+
const out = {};
|
|
211
|
+
const { jsonName } = this.settings;
|
|
212
|
+
let nameMap = void 0;
|
|
213
|
+
if (jsonName) nameMap = {};
|
|
214
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
215
|
+
const serializableValue = this._write(memberSchema, record[memberName], ns);
|
|
216
|
+
if (serializableValue !== void 0) {
|
|
217
|
+
let targetKey = memberName;
|
|
218
|
+
if (jsonName) {
|
|
219
|
+
targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
|
|
220
|
+
nameMap[memberName] = targetKey;
|
|
221
|
+
}
|
|
222
|
+
out[targetKey] = serializableValue;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (ns.isUnionSchema() && Object.keys(out).length === 0) {
|
|
226
|
+
const { $unknown } = record;
|
|
227
|
+
if (Array.isArray($unknown)) {
|
|
228
|
+
const [k, v] = $unknown;
|
|
229
|
+
out[k] = this._write(15, v);
|
|
230
|
+
}
|
|
231
|
+
} else if (typeof record.__type === "string") for (const [k, v] of Object.entries(record)) {
|
|
232
|
+
const targetKey = jsonName ? nameMap[k] ?? k : k;
|
|
233
|
+
if (!(targetKey in out)) out[targetKey] = this._write(15, v);
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
if (Array.isArray(value) && ns.isListSchema()) {
|
|
238
|
+
const listMember = ns.getValueSchema();
|
|
239
|
+
const out = [];
|
|
240
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
241
|
+
for (const item of value) if (sparse || item != null) out.push(this._write(listMember, item));
|
|
242
|
+
return out;
|
|
243
|
+
}
|
|
244
|
+
if (ns.isMapSchema()) {
|
|
245
|
+
const mapMember = ns.getValueSchema();
|
|
246
|
+
const out = {};
|
|
247
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
248
|
+
for (const [_k, _v] of Object.entries(value)) if (sparse || _v != null) out[_k] = this._write(mapMember, _v);
|
|
249
|
+
return out;
|
|
250
|
+
}
|
|
251
|
+
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
|
|
252
|
+
if (ns === this.rootSchema) return value;
|
|
253
|
+
return (this.serdeContext?.base64Encoder ?? require_stream_collector.toBase64)(value);
|
|
254
|
+
}
|
|
255
|
+
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) switch (require_extensions.determineTimestampFormat(ns, this.settings)) {
|
|
256
|
+
case 5: return value.toISOString().replace(".000Z", "Z");
|
|
257
|
+
case 6: return require_date_utils.dateToUtcString(value);
|
|
258
|
+
case 7: return value.getTime() / 1e3;
|
|
259
|
+
default:
|
|
260
|
+
console.warn("Missing timestamp format, using epoch seconds", value);
|
|
261
|
+
return value.getTime() / 1e3;
|
|
262
|
+
}
|
|
263
|
+
if (value instanceof require_serde.NumericValue) this.useReplacer = true;
|
|
264
|
+
}
|
|
265
|
+
if (value === null && container?.isStructSchema()) return;
|
|
266
|
+
if (ns.isStringSchema()) {
|
|
267
|
+
if (typeof value === "undefined" && ns.isIdempotencyToken()) return require_serde.generateIdempotencyToken();
|
|
268
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
269
|
+
if (value != null && mediaType) {
|
|
270
|
+
if (mediaType === "application/json" || mediaType.endsWith("+json")) return require_serde.LazyJsonString.from(value);
|
|
271
|
+
}
|
|
272
|
+
return value;
|
|
273
|
+
}
|
|
274
|
+
if (typeof value === "number" && ns.isNumericSchema()) {
|
|
275
|
+
if (Math.abs(value) === Infinity || isNaN(value)) return String(value);
|
|
276
|
+
return value;
|
|
277
|
+
}
|
|
278
|
+
if (typeof value === "string" && ns.isBlobSchema()) {
|
|
279
|
+
if (ns === this.rootSchema) return value;
|
|
280
|
+
return (this.serdeContext?.base64Encoder ?? require_stream_collector.toBase64)(value);
|
|
281
|
+
}
|
|
282
|
+
if (typeof value === "bigint") this.useReplacer = true;
|
|
283
|
+
if (ns.isDocumentSchema()) if (isObject) {
|
|
284
|
+
const out = Array.isArray(value) ? [] : {};
|
|
285
|
+
for (const [k, v] of Object.entries(value)) if (v instanceof require_serde.NumericValue) {
|
|
286
|
+
this.useReplacer = true;
|
|
287
|
+
out[k] = v;
|
|
288
|
+
} else out[k] = this._write(ns, v);
|
|
289
|
+
return out;
|
|
290
|
+
} else return structuredClone(value);
|
|
291
|
+
return value;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonCodec.js
|
|
296
|
+
var JsonCodec = class extends require_extensions.SerdeContextConfig {
|
|
297
|
+
settings;
|
|
298
|
+
constructor(settings) {
|
|
299
|
+
super();
|
|
300
|
+
this.settings = settings;
|
|
301
|
+
}
|
|
302
|
+
createSerializer() {
|
|
303
|
+
const serializer = new JsonShapeSerializer(this.settings);
|
|
304
|
+
serializer.setSerdeContext(this.serdeContext);
|
|
305
|
+
return serializer;
|
|
306
|
+
}
|
|
307
|
+
createDeserializer() {
|
|
308
|
+
const deserializer = new JsonShapeDeserializer(this.settings);
|
|
309
|
+
deserializer.setSerdeContext(this.serdeContext);
|
|
310
|
+
return deserializer;
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
//#endregion
|
|
314
|
+
//#region ../../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/AwsRestJsonProtocol.js
|
|
315
|
+
var AwsRestJsonProtocol = class extends require_common.HttpBindingProtocol {
|
|
316
|
+
serializer;
|
|
317
|
+
deserializer;
|
|
318
|
+
codec;
|
|
319
|
+
mixin = new require_extensions.ProtocolLib();
|
|
320
|
+
constructor({ defaultNamespace, errorTypeRegistries }) {
|
|
321
|
+
super({
|
|
322
|
+
defaultNamespace,
|
|
323
|
+
errorTypeRegistries
|
|
324
|
+
});
|
|
325
|
+
const settings = {
|
|
326
|
+
timestampFormat: {
|
|
327
|
+
useTrait: true,
|
|
328
|
+
default: 7
|
|
329
|
+
},
|
|
330
|
+
httpBindings: true,
|
|
331
|
+
jsonName: true
|
|
332
|
+
};
|
|
333
|
+
this.codec = new JsonCodec(settings);
|
|
334
|
+
this.serializer = new require_common.HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
|
|
335
|
+
this.deserializer = new require_common.HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
|
|
336
|
+
}
|
|
337
|
+
getShapeId() {
|
|
338
|
+
return "aws.protocols#restJson1";
|
|
339
|
+
}
|
|
340
|
+
getPayloadCodec() {
|
|
341
|
+
return this.codec;
|
|
342
|
+
}
|
|
343
|
+
setSerdeContext(serdeContext) {
|
|
344
|
+
this.codec.setSerdeContext(serdeContext);
|
|
345
|
+
super.setSerdeContext(serdeContext);
|
|
346
|
+
}
|
|
347
|
+
async serializeRequest(operationSchema, input, context) {
|
|
348
|
+
const request = await super.serializeRequest(operationSchema, input, context);
|
|
349
|
+
const inputSchema = require_extensions.NormalizedSchema.of(operationSchema.input);
|
|
350
|
+
if (!request.headers["content-type"]) {
|
|
351
|
+
const contentType = this.mixin.resolveRestContentType(this.getDefaultContentType(), inputSchema);
|
|
352
|
+
if (contentType) request.headers["content-type"] = contentType;
|
|
353
|
+
}
|
|
354
|
+
if (request.body == null && request.headers["content-type"] === this.getDefaultContentType()) request.body = "{}";
|
|
355
|
+
return request;
|
|
356
|
+
}
|
|
357
|
+
async deserializeResponse(operationSchema, context, response) {
|
|
358
|
+
const output = await super.deserializeResponse(operationSchema, context, response);
|
|
359
|
+
const outputSchema = require_extensions.NormalizedSchema.of(operationSchema.output);
|
|
360
|
+
for (const [name, member] of outputSchema.structIterator()) if (member.getMemberTraits().httpPayload && !(name in output)) output[name] = null;
|
|
361
|
+
return output;
|
|
362
|
+
}
|
|
363
|
+
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
364
|
+
const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
|
|
365
|
+
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
366
|
+
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
367
|
+
const ns = require_extensions.NormalizedSchema.of(errorSchema);
|
|
368
|
+
const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
369
|
+
const exception = new ((this.compositeErrorRegistry.getErrorCtor(errorSchema)) ?? Error)(message);
|
|
370
|
+
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
371
|
+
const output = {};
|
|
372
|
+
for (const [name, member] of ns.structIterator()) {
|
|
373
|
+
const target = member.getMergedTraits().jsonName ?? name;
|
|
374
|
+
output[name] = this.codec.createDeserializer().readObject(member, dataObject[target]);
|
|
375
|
+
}
|
|
376
|
+
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
377
|
+
$fault: ns.getMergedTraits().error,
|
|
378
|
+
message
|
|
379
|
+
}, output), dataObject);
|
|
380
|
+
}
|
|
381
|
+
getDefaultContentType() {
|
|
382
|
+
return "application/json";
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
//#endregion
|
|
386
|
+
Object.defineProperty(exports, "AwsRestJsonProtocol", {
|
|
387
|
+
enumerable: true,
|
|
388
|
+
get: function() {
|
|
389
|
+
return AwsRestJsonProtocol;
|
|
390
|
+
}
|
|
391
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region ../../../node_modules/@smithy/property-provider/dist-es/ProviderError.js
|
|
2
|
+
var ProviderError = class ProviderError extends Error {
|
|
3
|
+
name = "ProviderError";
|
|
4
|
+
tryNextLink;
|
|
5
|
+
constructor(message, options = true) {
|
|
6
|
+
let logger;
|
|
7
|
+
let tryNextLink = true;
|
|
8
|
+
if (typeof options === "boolean") {
|
|
9
|
+
logger = void 0;
|
|
10
|
+
tryNextLink = options;
|
|
11
|
+
} else if (options != null && typeof options === "object") {
|
|
12
|
+
logger = options.logger;
|
|
13
|
+
tryNextLink = options.tryNextLink ?? true;
|
|
14
|
+
}
|
|
15
|
+
super(message);
|
|
16
|
+
this.tryNextLink = tryNextLink;
|
|
17
|
+
Object.setPrototypeOf(this, ProviderError.prototype);
|
|
18
|
+
logger?.debug?.(`@smithy/property-provider ${tryNextLink ? "->" : "(!)"} ${message}`);
|
|
19
|
+
}
|
|
20
|
+
static from(error, options = true) {
|
|
21
|
+
return Object.assign(new this(error.message, options), error);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region ../../../node_modules/@smithy/property-provider/dist-es/CredentialsProviderError.js
|
|
26
|
+
var CredentialsProviderError = class CredentialsProviderError extends ProviderError {
|
|
27
|
+
name = "CredentialsProviderError";
|
|
28
|
+
constructor(message, options = true) {
|
|
29
|
+
super(message, options);
|
|
30
|
+
Object.setPrototypeOf(this, CredentialsProviderError.prototype);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
Object.defineProperty(exports, "CredentialsProviderError", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function() {
|
|
37
|
+
return CredentialsProviderError;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, "ProviderError", {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function() {
|
|
43
|
+
return ProviderError;
|
|
44
|
+
}
|
|
45
|
+
});
|