@jr2804/livesync-cli 1.0.30-cli.1 → 1.0.51-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/LICENSE +0 -0
- package/README.md +4 -1
- package/dist/{AwsRestJsonProtocol-BPmCQzXa.cjs → AwsRestJsonProtocol-8bfuD33v.cjs} +26 -24
- package/dist/{common-B3KclSP_.cjs → HttpInterceptingShapeSerializer-CdZ0h50h.cjs} +294 -23
- package/dist/XmlShapeDeserializer-B7URh4O0.cjs +435 -0
- package/dist/{dist-es-DhxfSNMj.cjs → dist-es-BM2h2Gys.cjs} +3 -4
- package/dist/dist-es-Cc6BAzq1.cjs +68 -0
- package/dist/{dist-es-BU2b9jKG.cjs → dist-es-CyUUay9V.cjs} +3 -3
- package/dist/{dist-es-FcX9AtZC.cjs → dist-es-DvWHLSEe.cjs} +6 -6
- package/dist/{dist-es-CaaxKLO9.cjs → dist-es-bSvKL25L.cjs} +1 -1
- package/dist/{event-streams-DmrxQXpO.cjs → event-streams-_ny8BA_d.cjs} +4 -4
- package/dist/{extensions-DkDzTVCO.cjs → extensions-BY32lT5G.cjs} +302 -35
- package/dist/index.cjs +49035 -34168
- package/dist/{loadSso-Dn78jIWR.cjs → loadSso-BTCpyZdX.cjs} +36 -14
- package/dist/{sdk-stream-mixin-YBLWtp6l.cjs → sdk-stream-mixin-DkgFkSQp.cjs} +4 -4
- package/dist/{signin-DHnd2WFx.cjs → signin-C5HI1JED.cjs} +39 -17
- package/dist/{sso-oidc-B4fkm2gn.cjs → sso-oidc-CgmbzBa9.cjs} +36 -14
- package/dist/{stream-collector-jwXXBEUn.cjs → stream-collector-DMWbWhbd.cjs} +291 -7
- package/dist/{sts-C9aqjeec.cjs → sts-BN3zvW2j.cjs} +56 -23
- package/dist/toUtf8-Dj4WWtpp.cjs +56 -0
- package/package.json +8 -8
- package/dist/XmlShapeDeserializer-B1_gcW92.cjs +0 -2097
- package/dist/date-utils-Dr5LXq4_.cjs +0 -338
- package/dist/serde-DtADB-gG.cjs +0 -597
package/dist/serde-DtADB-gG.cjs
DELETED
|
@@ -1,597 +0,0 @@
|
|
|
1
|
-
const require_date_utils = require("./date-utils-Dr5LXq4_.cjs");
|
|
2
|
-
let node_crypto = require("node:crypto");
|
|
3
|
-
let node_stream = require("node:stream");
|
|
4
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.js
|
|
5
|
-
var BASE64_REGEX = /^[A-Za-z0-9+/]*={0,2}$/;
|
|
6
|
-
var fromBase64$1 = (input) => {
|
|
7
|
-
if (input.length * 3 % 4 !== 0) throw new TypeError(`Incorrect padding on base64 string.`);
|
|
8
|
-
if (!BASE64_REGEX.exec(input)) throw new TypeError(`Invalid base64 string.`);
|
|
9
|
-
const buffer = require_date_utils.fromString(input, "base64");
|
|
10
|
-
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.js
|
|
14
|
-
var toBase64$1 = (_input) => {
|
|
15
|
-
let input;
|
|
16
|
-
if (typeof _input === "string") input = require_date_utils.fromUtf8(_input);
|
|
17
|
-
else input = _input;
|
|
18
|
-
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
|
|
19
|
-
return require_date_utils.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("base64");
|
|
20
|
-
};
|
|
21
|
-
//#endregion
|
|
22
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/blob/Uint8ArrayBlobAdapter.js
|
|
23
|
-
function bindUint8ArrayBlobAdapter(toUtf8, fromUtf8, toBase64, fromBase64) {
|
|
24
|
-
return class Uint8ArrayBlobAdapter extends Uint8Array {
|
|
25
|
-
static fromString(source, encoding = "utf-8") {
|
|
26
|
-
if (typeof source === "string") {
|
|
27
|
-
if (encoding === "base64") return Uint8ArrayBlobAdapter.mutate(fromBase64(source));
|
|
28
|
-
return Uint8ArrayBlobAdapter.mutate(fromUtf8(source));
|
|
29
|
-
}
|
|
30
|
-
throw new Error(`Unsupported conversion from ${typeof source} to Uint8ArrayBlobAdapter.`);
|
|
31
|
-
}
|
|
32
|
-
static mutate(source) {
|
|
33
|
-
Object.setPrototypeOf(source, Uint8ArrayBlobAdapter.prototype);
|
|
34
|
-
return source;
|
|
35
|
-
}
|
|
36
|
-
transformToString(encoding = "utf-8") {
|
|
37
|
-
if (encoding === "base64") return toBase64(this);
|
|
38
|
-
return toUtf8(this);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
//#endregion
|
|
43
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/uuid/v4.js
|
|
44
|
-
var decimalToHex = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
45
|
-
function bindV4(getRandomValues) {
|
|
46
|
-
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return () => crypto.randomUUID();
|
|
47
|
-
return () => {
|
|
48
|
-
const rnds = new Uint8Array(16);
|
|
49
|
-
getRandomValues(rnds);
|
|
50
|
-
rnds[6] = rnds[6] & 15 | 64;
|
|
51
|
-
rnds[8] = rnds[8] & 63 | 128;
|
|
52
|
-
return decimalToHex[rnds[0]] + decimalToHex[rnds[1]] + decimalToHex[rnds[2]] + decimalToHex[rnds[3]] + "-" + decimalToHex[rnds[4]] + decimalToHex[rnds[5]] + "-" + decimalToHex[rnds[6]] + decimalToHex[rnds[7]] + "-" + decimalToHex[rnds[8]] + decimalToHex[rnds[9]] + "-" + decimalToHex[rnds[10]] + decimalToHex[rnds[11]] + decimalToHex[rnds[12]] + decimalToHex[rnds[13]] + decimalToHex[rnds[14]] + decimalToHex[rnds[15]];
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/lazy-json.js
|
|
57
|
-
var LazyJsonString = function LazyJsonString(val) {
|
|
58
|
-
return Object.assign(new String(val), {
|
|
59
|
-
deserializeJSON() {
|
|
60
|
-
return JSON.parse(String(val));
|
|
61
|
-
},
|
|
62
|
-
toString() {
|
|
63
|
-
return String(val);
|
|
64
|
-
},
|
|
65
|
-
toJSON() {
|
|
66
|
-
return String(val);
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
LazyJsonString.from = (object) => {
|
|
71
|
-
if (object && typeof object === "object" && (object instanceof LazyJsonString || "deserializeJSON" in object)) return object;
|
|
72
|
-
else if (typeof object === "string" || Object.getPrototypeOf(object) === String.prototype) return LazyJsonString(String(object));
|
|
73
|
-
return LazyJsonString(JSON.stringify(object));
|
|
74
|
-
};
|
|
75
|
-
LazyJsonString.fromObject = LazyJsonString.from;
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/quote-header.js
|
|
78
|
-
function quoteHeader(part) {
|
|
79
|
-
if (part.includes(",") || part.includes("\"")) part = `"${part.replace(/"/g, "\\\"")}"`;
|
|
80
|
-
return part;
|
|
81
|
-
}
|
|
82
|
-
//#endregion
|
|
83
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/schema-serde-lib/schema-date-utils.js
|
|
84
|
-
var ddd = `(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)(?:[ne|u?r]?s?day)?`;
|
|
85
|
-
var mmm = `(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)`;
|
|
86
|
-
var time = `(\\d?\\d):(\\d{2}):(\\d{2})(?:\\.(\\d+))?`;
|
|
87
|
-
var date = `(\\d?\\d)`;
|
|
88
|
-
var year = `(\\d{4})`;
|
|
89
|
-
var RFC3339_WITH_OFFSET = /* @__PURE__ */ new RegExp(/^(\d{4})-(\d\d)-(\d\d)[tT](\d\d):(\d\d):(\d\d)(\.(\d+))?(([-+]\d\d:\d\d)|[zZ])$/);
|
|
90
|
-
var IMF_FIXDATE = new RegExp(`^${ddd}, ${date} ${mmm} ${year} ${time} GMT$`);
|
|
91
|
-
var RFC_850_DATE = new RegExp(`^${ddd}, ${date}-${mmm}-(\\d\\d) ${time} GMT$`);
|
|
92
|
-
var ASC_TIME = new RegExp(`^${ddd} ${mmm} ( [1-9]|\\d\\d) ${time} ${year}$`);
|
|
93
|
-
var months = [
|
|
94
|
-
"Jan",
|
|
95
|
-
"Feb",
|
|
96
|
-
"Mar",
|
|
97
|
-
"Apr",
|
|
98
|
-
"May",
|
|
99
|
-
"Jun",
|
|
100
|
-
"Jul",
|
|
101
|
-
"Aug",
|
|
102
|
-
"Sep",
|
|
103
|
-
"Oct",
|
|
104
|
-
"Nov",
|
|
105
|
-
"Dec"
|
|
106
|
-
];
|
|
107
|
-
var _parseEpochTimestamp = (value) => {
|
|
108
|
-
if (value == null) return;
|
|
109
|
-
let num = NaN;
|
|
110
|
-
if (typeof value === "number") num = value;
|
|
111
|
-
else if (typeof value === "string") {
|
|
112
|
-
if (!/^-?\d*\.?\d+$/.test(value)) throw new TypeError(`parseEpochTimestamp - numeric string invalid.`);
|
|
113
|
-
num = Number.parseFloat(value);
|
|
114
|
-
} else if (typeof value === "object" && value.tag === 1) num = value.value;
|
|
115
|
-
if (isNaN(num) || Math.abs(num) === Infinity) throw new TypeError("Epoch timestamps must be valid finite numbers.");
|
|
116
|
-
return new Date(Math.round(num * 1e3));
|
|
117
|
-
};
|
|
118
|
-
var _parseRfc3339DateTimeWithOffset = (value) => {
|
|
119
|
-
if (value == null) return;
|
|
120
|
-
if (typeof value !== "string") throw new TypeError("RFC3339 timestamps must be strings");
|
|
121
|
-
const matches = RFC3339_WITH_OFFSET.exec(value);
|
|
122
|
-
if (!matches) throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
|
|
123
|
-
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
|
|
124
|
-
range(monthStr, 1, 12);
|
|
125
|
-
range(dayStr, 1, 31);
|
|
126
|
-
range(hours, 0, 23);
|
|
127
|
-
range(minutes, 0, 59);
|
|
128
|
-
range(seconds, 0, 60);
|
|
129
|
-
const date = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1e3) : 0));
|
|
130
|
-
date.setUTCFullYear(Number(yearStr));
|
|
131
|
-
if (offsetStr.toUpperCase() != "Z") {
|
|
132
|
-
const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [
|
|
133
|
-
void 0,
|
|
134
|
-
"+",
|
|
135
|
-
0,
|
|
136
|
-
0
|
|
137
|
-
];
|
|
138
|
-
const scalar = sign === "-" ? 1 : -1;
|
|
139
|
-
date.setTime(date.getTime() + scalar * (Number(offsetH) * 60 * 60 * 1e3 + Number(offsetM) * 60 * 1e3));
|
|
140
|
-
}
|
|
141
|
-
return date;
|
|
142
|
-
};
|
|
143
|
-
var _parseRfc7231DateTime = (value) => {
|
|
144
|
-
if (value == null) return;
|
|
145
|
-
if (typeof value !== "string") throw new TypeError("RFC7231 timestamps must be strings.");
|
|
146
|
-
let day;
|
|
147
|
-
let month;
|
|
148
|
-
let year;
|
|
149
|
-
let hour;
|
|
150
|
-
let minute;
|
|
151
|
-
let second;
|
|
152
|
-
let fraction;
|
|
153
|
-
let matches;
|
|
154
|
-
if (matches = IMF_FIXDATE.exec(value)) [, day, month, year, hour, minute, second, fraction] = matches;
|
|
155
|
-
else if (matches = RFC_850_DATE.exec(value)) {
|
|
156
|
-
[, day, month, year, hour, minute, second, fraction] = matches;
|
|
157
|
-
year = (Number(year) + 1900).toString();
|
|
158
|
-
} else if (matches = ASC_TIME.exec(value)) [, month, day, hour, minute, second, fraction, year] = matches;
|
|
159
|
-
if (year && second) {
|
|
160
|
-
const timestamp = Date.UTC(Number(year), months.indexOf(month), Number(day), Number(hour), Number(minute), Number(second), fraction ? Math.round(parseFloat(`0.${fraction}`) * 1e3) : 0);
|
|
161
|
-
range(day, 1, 31);
|
|
162
|
-
range(hour, 0, 23);
|
|
163
|
-
range(minute, 0, 59);
|
|
164
|
-
range(second, 0, 60);
|
|
165
|
-
const date = new Date(timestamp);
|
|
166
|
-
date.setUTCFullYear(Number(year));
|
|
167
|
-
return date;
|
|
168
|
-
}
|
|
169
|
-
throw new TypeError(`Invalid RFC7231 date-time value ${value}.`);
|
|
170
|
-
};
|
|
171
|
-
function range(v, min, max) {
|
|
172
|
-
const _v = Number(v);
|
|
173
|
-
if (_v < min || _v > max) throw new Error(`Value ${_v} out of range [${min}, ${max}]`);
|
|
174
|
-
}
|
|
175
|
-
//#endregion
|
|
176
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/split-every.js
|
|
177
|
-
function splitEvery(value, delimiter, numDelimiters) {
|
|
178
|
-
if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) throw new Error("Invalid number of delimiters (" + numDelimiters + ") for splitEvery.");
|
|
179
|
-
const segments = value.split(delimiter);
|
|
180
|
-
if (numDelimiters === 1) return segments;
|
|
181
|
-
const compoundSegments = [];
|
|
182
|
-
let currentSegment = "";
|
|
183
|
-
for (let i = 0; i < segments.length; i++) {
|
|
184
|
-
if (currentSegment === "") currentSegment = segments[i];
|
|
185
|
-
else currentSegment += delimiter + segments[i];
|
|
186
|
-
if ((i + 1) % numDelimiters === 0) {
|
|
187
|
-
compoundSegments.push(currentSegment);
|
|
188
|
-
currentSegment = "";
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
if (currentSegment !== "") compoundSegments.push(currentSegment);
|
|
192
|
-
return compoundSegments;
|
|
193
|
-
}
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/split-header.js
|
|
196
|
-
var splitHeader = (value) => {
|
|
197
|
-
const z = value.length;
|
|
198
|
-
const values = [];
|
|
199
|
-
let withinQuotes = false;
|
|
200
|
-
let prevChar = void 0;
|
|
201
|
-
let anchor = 0;
|
|
202
|
-
for (let i = 0; i < z; ++i) {
|
|
203
|
-
const char = value[i];
|
|
204
|
-
switch (char) {
|
|
205
|
-
case `"`:
|
|
206
|
-
if (prevChar !== "\\") withinQuotes = !withinQuotes;
|
|
207
|
-
break;
|
|
208
|
-
case ",":
|
|
209
|
-
if (!withinQuotes) {
|
|
210
|
-
values.push(value.slice(anchor, i));
|
|
211
|
-
anchor = i + 1;
|
|
212
|
-
}
|
|
213
|
-
break;
|
|
214
|
-
default:
|
|
215
|
-
}
|
|
216
|
-
prevChar = char;
|
|
217
|
-
}
|
|
218
|
-
values.push(value.slice(anchor));
|
|
219
|
-
return values.map((v) => {
|
|
220
|
-
v = v.trim();
|
|
221
|
-
const z = v.length;
|
|
222
|
-
if (z < 2) return v;
|
|
223
|
-
if (v[0] === `"` && v[z - 1] === `"`) v = v.slice(1, z - 1);
|
|
224
|
-
return v.replace(/\\"/g, "\"");
|
|
225
|
-
});
|
|
226
|
-
};
|
|
227
|
-
//#endregion
|
|
228
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/value/NumericValue.js
|
|
229
|
-
var format = /^-?\d*(\.\d+)?$/;
|
|
230
|
-
var NumericValue = class NumericValue {
|
|
231
|
-
string;
|
|
232
|
-
type;
|
|
233
|
-
constructor(string, type) {
|
|
234
|
-
this.string = string;
|
|
235
|
-
this.type = type;
|
|
236
|
-
if (!format.test(string)) throw new Error(`@smithy/core/serde - NumericValue must only contain [0-9], at most one decimal point ".", and an optional negation prefix "-".`);
|
|
237
|
-
}
|
|
238
|
-
toString() {
|
|
239
|
-
return this.string;
|
|
240
|
-
}
|
|
241
|
-
static [Symbol.hasInstance](object) {
|
|
242
|
-
if (!object || typeof object !== "object") return false;
|
|
243
|
-
const _nv = object;
|
|
244
|
-
return NumericValue.prototype.isPrototypeOf(object) || _nv.type === "bigDecimal" && format.test(_nv.string);
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-hex-encoding/hex-encoding.js
|
|
249
|
-
var SHORT_TO_HEX = {};
|
|
250
|
-
var HEX_TO_SHORT = {};
|
|
251
|
-
for (let i = 0; i < 256; i++) {
|
|
252
|
-
let encodedByte = i.toString(16).toLowerCase();
|
|
253
|
-
if (encodedByte.length === 1) encodedByte = `0${encodedByte}`;
|
|
254
|
-
SHORT_TO_HEX[i] = encodedByte;
|
|
255
|
-
HEX_TO_SHORT[encodedByte] = i;
|
|
256
|
-
}
|
|
257
|
-
function toHex(bytes) {
|
|
258
|
-
let out = "";
|
|
259
|
-
for (let i = 0; i < bytes.byteLength; i++) out += SHORT_TO_HEX[bytes[i]];
|
|
260
|
-
return out;
|
|
261
|
-
}
|
|
262
|
-
//#endregion
|
|
263
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUint8Array.js
|
|
264
|
-
var toUint8Array = (data) => {
|
|
265
|
-
if (typeof data === "string") return require_date_utils.fromUtf8(data);
|
|
266
|
-
if (ArrayBuffer.isView(data)) return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
267
|
-
return new Uint8Array(data);
|
|
268
|
-
};
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-type-check.js
|
|
271
|
-
var isReadableStream = (stream) => typeof ReadableStream === "function" && (stream?.constructor?.name === ReadableStream.name || stream instanceof ReadableStream);
|
|
272
|
-
//#endregion
|
|
273
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/fromUtf8.browser.js
|
|
274
|
-
var fromUtf8 = (input) => new TextEncoder().encode(input);
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/constants-for-browser.js
|
|
277
|
-
var chars = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;
|
|
278
|
-
var alphabetByEncoding = Object.entries(chars).reduce((acc, [i, c]) => {
|
|
279
|
-
acc[c] = Number(i);
|
|
280
|
-
return acc;
|
|
281
|
-
}, {});
|
|
282
|
-
var alphabetByValue = chars.split("");
|
|
283
|
-
//#endregion
|
|
284
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/toBase64.browser.js
|
|
285
|
-
function toBase64(_input) {
|
|
286
|
-
let input;
|
|
287
|
-
if (typeof _input === "string") input = fromUtf8(_input);
|
|
288
|
-
else input = _input;
|
|
289
|
-
const isArrayLike = typeof input === "object" && typeof input.length === "number";
|
|
290
|
-
const isUint8Array = typeof input === "object" && typeof input.byteOffset === "number" && typeof input.byteLength === "number";
|
|
291
|
-
if (!isArrayLike && !isUint8Array) throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");
|
|
292
|
-
let str = "";
|
|
293
|
-
for (let i = 0; i < input.length; i += 3) {
|
|
294
|
-
let bits = 0;
|
|
295
|
-
let bitLength = 0;
|
|
296
|
-
for (let j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {
|
|
297
|
-
bits |= input[j] << (limit - j - 1) * 8;
|
|
298
|
-
bitLength += 8;
|
|
299
|
-
}
|
|
300
|
-
const bitClusterCount = Math.ceil(bitLength / 6);
|
|
301
|
-
bits <<= bitClusterCount * 6 - bitLength;
|
|
302
|
-
for (let k = 1; k <= bitClusterCount; k++) {
|
|
303
|
-
const offset = (bitClusterCount - k) * 6;
|
|
304
|
-
str += alphabetByValue[(bits & 63 << offset) >> offset];
|
|
305
|
-
}
|
|
306
|
-
str += "==".slice(0, 4 - bitClusterCount);
|
|
307
|
-
}
|
|
308
|
-
return str;
|
|
309
|
-
}
|
|
310
|
-
//#endregion
|
|
311
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-utf8/toUtf8.browser.js
|
|
312
|
-
var toUtf8 = (input) => {
|
|
313
|
-
if (typeof input === "string") return input;
|
|
314
|
-
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
|
315
|
-
return new TextDecoder("utf-8").decode(input);
|
|
316
|
-
};
|
|
317
|
-
//#endregion
|
|
318
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-base64/fromBase64.browser.js
|
|
319
|
-
var fromBase64 = (input) => {
|
|
320
|
-
let totalByteLength = input.length / 4 * 3;
|
|
321
|
-
if (input.slice(-2) === "==") totalByteLength -= 2;
|
|
322
|
-
else if (input.slice(-1) === "=") totalByteLength--;
|
|
323
|
-
const out = new ArrayBuffer(totalByteLength);
|
|
324
|
-
const dataView = new DataView(out);
|
|
325
|
-
for (let i = 0; i < input.length; i += 4) {
|
|
326
|
-
let bits = 0;
|
|
327
|
-
let bitLength = 0;
|
|
328
|
-
for (let j = i, limit = i + 3; j <= limit; j++) if (input[j] !== "=") {
|
|
329
|
-
if (!(input[j] in alphabetByEncoding)) throw new TypeError(`Invalid character ${input[j]} in base64 string.`);
|
|
330
|
-
bits |= alphabetByEncoding[input[j]] << (limit - j) * 6;
|
|
331
|
-
bitLength += 6;
|
|
332
|
-
} else bits >>= 6;
|
|
333
|
-
const chunkOffset = i / 4 * 3;
|
|
334
|
-
bits >>= bitLength % 8;
|
|
335
|
-
const byteLength = Math.floor(bitLength / 8);
|
|
336
|
-
for (let k = 0; k < byteLength; k++) {
|
|
337
|
-
const offset = (byteLength - k - 1) * 8;
|
|
338
|
-
dataView.setUint8(chunkOffset + k, (bits & 255 << offset) >> offset);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
return new Uint8Array(out);
|
|
342
|
-
};
|
|
343
|
-
//#endregion
|
|
344
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.browser.js
|
|
345
|
-
var streamCollector$1 = async (stream) => {
|
|
346
|
-
if (typeof Blob === "function" && stream instanceof Blob || stream.constructor?.name === "Blob") {
|
|
347
|
-
if (Blob.prototype.arrayBuffer !== void 0) return new Uint8Array(await stream.arrayBuffer());
|
|
348
|
-
return collectBlob(stream);
|
|
349
|
-
}
|
|
350
|
-
return collectStream(stream);
|
|
351
|
-
};
|
|
352
|
-
async function collectBlob(blob) {
|
|
353
|
-
const arrayBuffer = fromBase64(await readToBase64(blob));
|
|
354
|
-
return new Uint8Array(arrayBuffer);
|
|
355
|
-
}
|
|
356
|
-
async function collectStream(stream) {
|
|
357
|
-
const chunks = [];
|
|
358
|
-
const reader = stream.getReader();
|
|
359
|
-
let isDone = false;
|
|
360
|
-
let length = 0;
|
|
361
|
-
while (!isDone) {
|
|
362
|
-
const { done, value } = await reader.read();
|
|
363
|
-
if (value) {
|
|
364
|
-
chunks.push(value);
|
|
365
|
-
length += value.length;
|
|
366
|
-
}
|
|
367
|
-
isDone = done;
|
|
368
|
-
}
|
|
369
|
-
const collected = new Uint8Array(length);
|
|
370
|
-
let offset = 0;
|
|
371
|
-
for (const chunk of chunks) {
|
|
372
|
-
collected.set(chunk, offset);
|
|
373
|
-
offset += chunk.length;
|
|
374
|
-
}
|
|
375
|
-
return collected;
|
|
376
|
-
}
|
|
377
|
-
function readToBase64(blob) {
|
|
378
|
-
return new Promise((resolve, reject) => {
|
|
379
|
-
const reader = new FileReader();
|
|
380
|
-
reader.onloadend = () => {
|
|
381
|
-
if (reader.readyState !== 2) return reject(/* @__PURE__ */ new Error("Reader aborted too early"));
|
|
382
|
-
const result = reader.result ?? "";
|
|
383
|
-
const commaIndex = result.indexOf(",");
|
|
384
|
-
const dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;
|
|
385
|
-
resolve(result.substring(dataOffset));
|
|
386
|
-
};
|
|
387
|
-
reader.onabort = () => reject(/* @__PURE__ */ new Error("Read aborted"));
|
|
388
|
-
reader.onerror = () => reject(reader.error);
|
|
389
|
-
reader.readAsDataURL(blob);
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
//#endregion
|
|
393
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.browser.js
|
|
394
|
-
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1 = "The stream has already been transformed.";
|
|
395
|
-
var sdkStreamMixin$1 = (stream) => {
|
|
396
|
-
if (!isBlobInstance(stream) && !isReadableStream(stream)) {
|
|
397
|
-
const name = stream?.__proto__?.constructor?.name || stream;
|
|
398
|
-
throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${name}`);
|
|
399
|
-
}
|
|
400
|
-
let transformed = false;
|
|
401
|
-
const transformToByteArray = async () => {
|
|
402
|
-
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
|
|
403
|
-
transformed = true;
|
|
404
|
-
return await streamCollector$1(stream);
|
|
405
|
-
};
|
|
406
|
-
const blobToWebStream = (blob) => {
|
|
407
|
-
if (typeof blob.stream !== "function") throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");
|
|
408
|
-
return blob.stream();
|
|
409
|
-
};
|
|
410
|
-
return Object.assign(stream, {
|
|
411
|
-
transformToByteArray,
|
|
412
|
-
transformToString: async (encoding) => {
|
|
413
|
-
const buf = await transformToByteArray();
|
|
414
|
-
if (encoding === "base64") return toBase64(buf);
|
|
415
|
-
else if (encoding === "hex") return toHex(buf);
|
|
416
|
-
else if (encoding === void 0 || encoding === "utf8" || encoding === "utf-8") return toUtf8(buf);
|
|
417
|
-
else if (typeof TextDecoder === "function") return new TextDecoder(encoding).decode(buf);
|
|
418
|
-
else throw new Error("TextDecoder is not available, please make sure polyfill is provided.");
|
|
419
|
-
},
|
|
420
|
-
transformToWebStream: () => {
|
|
421
|
-
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED$1);
|
|
422
|
-
transformed = true;
|
|
423
|
-
if (isBlobInstance(stream)) return blobToWebStream(stream);
|
|
424
|
-
else if (isReadableStream(stream)) return stream;
|
|
425
|
-
else throw new Error(`Cannot transform payload to web stream, got ${stream}`);
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
};
|
|
429
|
-
var isBlobInstance = (stream) => typeof Blob === "function" && stream instanceof Blob;
|
|
430
|
-
//#endregion
|
|
431
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/stream-collector.js
|
|
432
|
-
var Collector = class extends node_stream.Writable {
|
|
433
|
-
bufferedBytes = [];
|
|
434
|
-
_write(chunk, encoding, callback) {
|
|
435
|
-
this.bufferedBytes.push(chunk);
|
|
436
|
-
callback();
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
var isReadableStreamInstance = (stream) => typeof ReadableStream === "function" && stream instanceof ReadableStream;
|
|
440
|
-
async function collectReadableStream(stream) {
|
|
441
|
-
const chunks = [];
|
|
442
|
-
const reader = stream.getReader();
|
|
443
|
-
let isDone = false;
|
|
444
|
-
let length = 0;
|
|
445
|
-
while (!isDone) {
|
|
446
|
-
const { done, value } = await reader.read();
|
|
447
|
-
if (value) {
|
|
448
|
-
chunks.push(value);
|
|
449
|
-
length += value.length;
|
|
450
|
-
}
|
|
451
|
-
isDone = done;
|
|
452
|
-
}
|
|
453
|
-
const collected = new Uint8Array(length);
|
|
454
|
-
let offset = 0;
|
|
455
|
-
for (const chunk of chunks) {
|
|
456
|
-
collected.set(chunk, offset);
|
|
457
|
-
offset += chunk.length;
|
|
458
|
-
}
|
|
459
|
-
return collected;
|
|
460
|
-
}
|
|
461
|
-
var streamCollector = (stream) => {
|
|
462
|
-
if (isReadableStreamInstance(stream)) return collectReadableStream(stream);
|
|
463
|
-
return new Promise((resolve, reject) => {
|
|
464
|
-
const collector = new Collector();
|
|
465
|
-
stream.pipe(collector);
|
|
466
|
-
stream.on("error", (err) => {
|
|
467
|
-
collector.end();
|
|
468
|
-
reject(err);
|
|
469
|
-
});
|
|
470
|
-
collector.on("error", reject);
|
|
471
|
-
collector.on("finish", function() {
|
|
472
|
-
resolve(new Uint8Array(Buffer.concat(this.bufferedBytes)));
|
|
473
|
-
});
|
|
474
|
-
});
|
|
475
|
-
};
|
|
476
|
-
//#endregion
|
|
477
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/util-stream/sdk-stream-mixin.js
|
|
478
|
-
var ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED = "The stream has already been transformed.";
|
|
479
|
-
var sdkStreamMixin = (stream) => {
|
|
480
|
-
if (!(stream instanceof node_stream.Readable)) try {
|
|
481
|
-
return sdkStreamMixin$1(stream);
|
|
482
|
-
} catch (e) {
|
|
483
|
-
const name = stream?.__proto__?.constructor?.name || stream;
|
|
484
|
-
throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${name}`);
|
|
485
|
-
}
|
|
486
|
-
let transformed = false;
|
|
487
|
-
const transformToByteArray = async () => {
|
|
488
|
-
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
489
|
-
transformed = true;
|
|
490
|
-
return await streamCollector(stream);
|
|
491
|
-
};
|
|
492
|
-
return Object.assign(stream, {
|
|
493
|
-
transformToByteArray,
|
|
494
|
-
transformToString: async (encoding) => {
|
|
495
|
-
const buf = await transformToByteArray();
|
|
496
|
-
if (encoding === void 0 || Buffer.isEncoding(encoding)) return require_date_utils.fromArrayBuffer(buf.buffer, buf.byteOffset, buf.byteLength).toString(encoding);
|
|
497
|
-
else return new TextDecoder(encoding).decode(buf);
|
|
498
|
-
},
|
|
499
|
-
transformToWebStream: () => {
|
|
500
|
-
if (transformed) throw new Error(ERR_MSG_STREAM_HAS_BEEN_TRANSFORMED);
|
|
501
|
-
if (stream.readableFlowing !== null) throw new Error("The stream has been consumed by other callbacks.");
|
|
502
|
-
if (typeof node_stream.Readable.toWeb !== "function") throw new Error("Readable.toWeb() is not supported. Please ensure a polyfill is available.");
|
|
503
|
-
transformed = true;
|
|
504
|
-
return node_stream.Readable.toWeb(stream);
|
|
505
|
-
}
|
|
506
|
-
});
|
|
507
|
-
};
|
|
508
|
-
//#endregion
|
|
509
|
-
//#region ../../../node_modules/@smithy/core/dist-es/submodules/serde/index.js
|
|
510
|
-
var Uint8ArrayBlobAdapter = class extends bindUint8ArrayBlobAdapter(require_date_utils.toUtf8, require_date_utils.fromUtf8, toBase64$1, fromBase64$1) {};
|
|
511
|
-
var _getRandomValues = node_crypto.getRandomValues;
|
|
512
|
-
var generateIdempotencyToken = bindV4(_getRandomValues);
|
|
513
|
-
//#endregion
|
|
514
|
-
Object.defineProperty(exports, "LazyJsonString", {
|
|
515
|
-
enumerable: true,
|
|
516
|
-
get: function() {
|
|
517
|
-
return LazyJsonString;
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
Object.defineProperty(exports, "NumericValue", {
|
|
521
|
-
enumerable: true,
|
|
522
|
-
get: function() {
|
|
523
|
-
return NumericValue;
|
|
524
|
-
}
|
|
525
|
-
});
|
|
526
|
-
Object.defineProperty(exports, "Uint8ArrayBlobAdapter", {
|
|
527
|
-
enumerable: true,
|
|
528
|
-
get: function() {
|
|
529
|
-
return Uint8ArrayBlobAdapter;
|
|
530
|
-
}
|
|
531
|
-
});
|
|
532
|
-
Object.defineProperty(exports, "_parseEpochTimestamp", {
|
|
533
|
-
enumerable: true,
|
|
534
|
-
get: function() {
|
|
535
|
-
return _parseEpochTimestamp;
|
|
536
|
-
}
|
|
537
|
-
});
|
|
538
|
-
Object.defineProperty(exports, "_parseRfc3339DateTimeWithOffset", {
|
|
539
|
-
enumerable: true,
|
|
540
|
-
get: function() {
|
|
541
|
-
return _parseRfc3339DateTimeWithOffset;
|
|
542
|
-
}
|
|
543
|
-
});
|
|
544
|
-
Object.defineProperty(exports, "_parseRfc7231DateTime", {
|
|
545
|
-
enumerable: true,
|
|
546
|
-
get: function() {
|
|
547
|
-
return _parseRfc7231DateTime;
|
|
548
|
-
}
|
|
549
|
-
});
|
|
550
|
-
Object.defineProperty(exports, "fromBase64", {
|
|
551
|
-
enumerable: true,
|
|
552
|
-
get: function() {
|
|
553
|
-
return fromBase64$1;
|
|
554
|
-
}
|
|
555
|
-
});
|
|
556
|
-
Object.defineProperty(exports, "generateIdempotencyToken", {
|
|
557
|
-
enumerable: true,
|
|
558
|
-
get: function() {
|
|
559
|
-
return generateIdempotencyToken;
|
|
560
|
-
}
|
|
561
|
-
});
|
|
562
|
-
Object.defineProperty(exports, "quoteHeader", {
|
|
563
|
-
enumerable: true,
|
|
564
|
-
get: function() {
|
|
565
|
-
return quoteHeader;
|
|
566
|
-
}
|
|
567
|
-
});
|
|
568
|
-
Object.defineProperty(exports, "sdkStreamMixin", {
|
|
569
|
-
enumerable: true,
|
|
570
|
-
get: function() {
|
|
571
|
-
return sdkStreamMixin;
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
Object.defineProperty(exports, "splitEvery", {
|
|
575
|
-
enumerable: true,
|
|
576
|
-
get: function() {
|
|
577
|
-
return splitEvery;
|
|
578
|
-
}
|
|
579
|
-
});
|
|
580
|
-
Object.defineProperty(exports, "splitHeader", {
|
|
581
|
-
enumerable: true,
|
|
582
|
-
get: function() {
|
|
583
|
-
return splitHeader;
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
Object.defineProperty(exports, "toBase64", {
|
|
587
|
-
enumerable: true,
|
|
588
|
-
get: function() {
|
|
589
|
-
return toBase64$1;
|
|
590
|
-
}
|
|
591
|
-
});
|
|
592
|
-
Object.defineProperty(exports, "toUint8Array", {
|
|
593
|
-
enumerable: true,
|
|
594
|
-
get: function() {
|
|
595
|
-
return toUint8Array;
|
|
596
|
-
}
|
|
597
|
-
});
|