@semiont/graph 0.5.24 → 0.5.25
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/{chunk-7X77XSVD.js → chunk-JWG64MVA.js} +7 -7
- package/dist/{chunk-7X77XSVD.js.map → chunk-JWG64MVA.js.map} +1 -1
- package/dist/{chunk-ZPTG6NGD.js → chunk-RBRHTAJN.js} +2 -2
- package/dist/{chunk-NO67W7EF.js → chunk-RKAR27K2.js} +678 -265
- package/dist/chunk-RKAR27K2.js.map +1 -0
- package/dist/{chunk-FR442V6O.js → chunk-UKT6IXAM.js} +3 -3
- package/dist/{chunk-AJ4W3DS7.js → chunk-Y62BMZ25.js} +2 -2
- package/dist/{chunk-7WLIHNPO.js → chunk-YYVVWLB2.js} +1 -2
- package/dist/{dist-es-TBYZWFUA.js → dist-es-BGEPUOPB.js} +19 -19
- package/dist/dist-es-BGEPUOPB.js.map +1 -0
- package/dist/{dist-es-63RSTSM2.js → dist-es-BUTLC2YS.js} +12 -12
- package/dist/{dist-es-R36PCSLH.js → dist-es-ILOZ33QI.js} +4 -4
- package/dist/{dist-es-QDQUKRHU.js → dist-es-LN4LZWKV.js} +2 -2
- package/dist/{dist-es-5CNHCO76.js → dist-es-M72B762W.js} +4 -4
- package/dist/{dist-es-BTCEI257.js → dist-es-NGG7JHEH.js} +3 -3
- package/dist/{dist-es-OHWBFB6Z.js → dist-es-TLOL2VHU.js} +6 -6
- package/dist/{dist-es-C3XGVVKR.js → dist-es-WLYFLMD3.js} +39 -32
- package/dist/dist-es-WLYFLMD3.js.map +1 -0
- package/dist/{dist-es-ZOQMUI6H.js → dist-es-WS6NDSQ5.js} +4 -4
- package/dist/index.js +1 -1
- package/dist/{loadSso-OMYS2YH5.js → loadSso-GOLDOL76.js} +6 -6
- package/dist/{signin-OZ4KQMKS.js → signin-TS4P2IEW.js} +6 -6
- package/dist/{sso-oidc-K2XXESPI.js → sso-oidc-QHNBBLAM.js} +6 -6
- package/dist/{sts-4YKAIUZO.js → sts-ZKQ7LNEG.js} +6 -6
- package/package.json +6 -6
- package/dist/chunk-NO67W7EF.js.map +0 -1
- package/dist/dist-es-C3XGVVKR.js.map +0 -1
- package/dist/dist-es-TBYZWFUA.js.map +0 -1
- /package/dist/{chunk-ZPTG6NGD.js.map → chunk-RBRHTAJN.js.map} +0 -0
- /package/dist/{chunk-FR442V6O.js.map → chunk-UKT6IXAM.js.map} +0 -0
- /package/dist/{chunk-AJ4W3DS7.js.map → chunk-Y62BMZ25.js.map} +0 -0
- /package/dist/{chunk-7WLIHNPO.js.map → chunk-YYVVWLB2.js.map} +0 -0
- /package/dist/{dist-es-63RSTSM2.js.map → dist-es-BUTLC2YS.js.map} +0 -0
- /package/dist/{dist-es-R36PCSLH.js.map → dist-es-ILOZ33QI.js.map} +0 -0
- /package/dist/{dist-es-QDQUKRHU.js.map → dist-es-LN4LZWKV.js.map} +0 -0
- /package/dist/{dist-es-5CNHCO76.js.map → dist-es-M72B762W.js.map} +0 -0
- /package/dist/{dist-es-BTCEI257.js.map → dist-es-NGG7JHEH.js.map} +0 -0
- /package/dist/{dist-es-OHWBFB6Z.js.map → dist-es-TLOL2VHU.js.map} +0 -0
- /package/dist/{dist-es-ZOQMUI6H.js.map → dist-es-WS6NDSQ5.js.map} +0 -0
- /package/dist/{loadSso-OMYS2YH5.js.map → loadSso-GOLDOL76.js.map} +0 -0
- /package/dist/{signin-OZ4KQMKS.js.map → signin-TS4P2IEW.js.map} +0 -0
- /package/dist/{sso-oidc-K2XXESPI.js.map → sso-oidc-QHNBBLAM.js.map} +0 -0
- /package/dist/{sts-4YKAIUZO.js.map → sts-ZKQ7LNEG.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
memoizeIdentityProvider,
|
|
7
7
|
normalizeProvider as normalizeProvider2,
|
|
8
8
|
setCredentialFeature
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RBRHTAJN.js";
|
|
10
10
|
import {
|
|
11
11
|
FromStringShapeDeserializer,
|
|
12
12
|
HttpBindingProtocol,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
escapeUri,
|
|
22
22
|
extendedEncodeURIComponent,
|
|
23
23
|
loadConfig
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-YYVVWLB2.js";
|
|
25
25
|
import {
|
|
26
26
|
HttpRequest,
|
|
27
27
|
HttpResponse,
|
|
@@ -1053,6 +1053,24 @@ var UnionSerde = class {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
};
|
|
1055
1055
|
|
|
1056
|
+
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js
|
|
1057
|
+
var canParseBuffer;
|
|
1058
|
+
function detectBufferParsing() {
|
|
1059
|
+
if (canParseBuffer === void 0) {
|
|
1060
|
+
try {
|
|
1061
|
+
if (typeof Buffer !== "function") {
|
|
1062
|
+
canParseBuffer = false;
|
|
1063
|
+
} else {
|
|
1064
|
+
const result = JSON.parse(Buffer.from([123, 125]));
|
|
1065
|
+
canParseBuffer = result !== null && typeof result === "object";
|
|
1066
|
+
}
|
|
1067
|
+
} catch {
|
|
1068
|
+
canParseBuffer = false;
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
return canParseBuffer;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1056
1074
|
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/jsonReviver.js
|
|
1057
1075
|
function jsonReviver(key, value, context) {
|
|
1058
1076
|
if (context?.source) {
|
|
@@ -1133,24 +1151,6 @@ function _check(ns, seen) {
|
|
|
1133
1151
|
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/common.js
|
|
1134
1152
|
var collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => (context?.utf8Encoder ?? toUtf8)(body));
|
|
1135
1153
|
|
|
1136
|
-
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/detectBufferParsing.js
|
|
1137
|
-
var canParseBuffer;
|
|
1138
|
-
function detectBufferParsing() {
|
|
1139
|
-
if (canParseBuffer === void 0) {
|
|
1140
|
-
try {
|
|
1141
|
-
if (typeof Buffer !== "function") {
|
|
1142
|
-
canParseBuffer = false;
|
|
1143
|
-
} else {
|
|
1144
|
-
const result = JSON.parse(Buffer.from([123, 125]));
|
|
1145
|
-
canParseBuffer = result !== null && typeof result === "object";
|
|
1146
|
-
}
|
|
1147
|
-
} catch {
|
|
1148
|
-
canParseBuffer = false;
|
|
1149
|
-
}
|
|
1150
|
-
}
|
|
1151
|
-
return canParseBuffer;
|
|
1152
|
-
}
|
|
1153
|
-
|
|
1154
1154
|
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/parseJsonBody.js
|
|
1155
1155
|
async function parseJsonBody(streamBody, context, schema) {
|
|
1156
1156
|
let parsingInput;
|
|
@@ -1232,8 +1232,8 @@ function writeKey(obj) {
|
|
|
1232
1232
|
Object.defineProperty(obj, "__proto__", { value: void 0, writable: true, enumerable: true, configurable: true });
|
|
1233
1233
|
}
|
|
1234
1234
|
|
|
1235
|
-
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/
|
|
1236
|
-
var
|
|
1235
|
+
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeDeserializer2.js
|
|
1236
|
+
var JsonShapeDeserializer2 = class extends SerdeContextConfig {
|
|
1237
1237
|
settings;
|
|
1238
1238
|
constructor(settings) {
|
|
1239
1239
|
super();
|
|
@@ -1241,7 +1241,22 @@ var JsonShapeDeserializer = class extends SerdeContextConfig {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
async read(schema, data) {
|
|
1243
1243
|
const reviver = needsReviver(schema) ? jsonReviver : void 0;
|
|
1244
|
-
|
|
1244
|
+
let parsed;
|
|
1245
|
+
if (typeof data === "string") {
|
|
1246
|
+
if (data.length === 0) {
|
|
1247
|
+
return {};
|
|
1248
|
+
}
|
|
1249
|
+
parsed = JSON.parse(data, reviver);
|
|
1250
|
+
} else if (data instanceof Uint8Array && detectBufferParsing()) {
|
|
1251
|
+
if (data.byteLength === 0) {
|
|
1252
|
+
return {};
|
|
1253
|
+
}
|
|
1254
|
+
const buf = Buffer.isBuffer(data) ? data : Buffer.from(data.buffer, data.byteOffset, data.byteLength);
|
|
1255
|
+
parsed = JSON.parse(buf, reviver);
|
|
1256
|
+
} else {
|
|
1257
|
+
parsed = await parseJsonBody(data, this.serdeContext, schema);
|
|
1258
|
+
}
|
|
1259
|
+
return this._read(schema, parsed);
|
|
1245
1260
|
}
|
|
1246
1261
|
readObject(schema, data) {
|
|
1247
1262
|
return this._read(schema, data);
|
|
@@ -1251,62 +1266,29 @@ var JsonShapeDeserializer = class extends SerdeContextConfig {
|
|
|
1251
1266
|
const ns = NormalizedSchema.of(schema);
|
|
1252
1267
|
if (isObject) {
|
|
1253
1268
|
if (ns.isStructSchema()) {
|
|
1254
|
-
|
|
1255
|
-
const union = ns.isUnionSchema();
|
|
1256
|
-
const out = {};
|
|
1257
|
-
let nameMap = void 0;
|
|
1258
|
-
const { jsonName } = this.settings;
|
|
1259
|
-
if (jsonName) {
|
|
1260
|
-
nameMap = {};
|
|
1261
|
-
}
|
|
1262
|
-
let unionSerde;
|
|
1263
|
-
if (union) {
|
|
1264
|
-
unionSerde = new UnionSerde(record, out);
|
|
1265
|
-
}
|
|
1266
|
-
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
1267
|
-
let fromKey = memberName;
|
|
1268
|
-
if (jsonName) {
|
|
1269
|
-
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
|
|
1270
|
-
nameMap[fromKey] = memberName;
|
|
1271
|
-
}
|
|
1272
|
-
if (union) {
|
|
1273
|
-
unionSerde.mark(fromKey);
|
|
1274
|
-
}
|
|
1275
|
-
if (record[fromKey] != null) {
|
|
1276
|
-
out[memberName] = this._read(memberSchema, record[fromKey]);
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
|
-
if (union) {
|
|
1280
|
-
unionSerde.writeUnknown();
|
|
1281
|
-
} else if (typeof record.__type === "string") {
|
|
1282
|
-
for (const k in record) {
|
|
1283
|
-
const v = record[k];
|
|
1284
|
-
const t = jsonName ? nameMap[k] ?? k : k;
|
|
1285
|
-
if (!(t in out)) {
|
|
1286
|
-
out[t] = v;
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
return out;
|
|
1269
|
+
return this._readStruct(ns, value);
|
|
1291
1270
|
}
|
|
1292
1271
|
if (Array.isArray(value) && ns.isListSchema()) {
|
|
1293
1272
|
const listMember = ns.getValueSchema();
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1273
|
+
if (this.needsTransform(listMember)) {
|
|
1274
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1275
|
+
value[i] = this._read(listMember, value[i]);
|
|
1276
|
+
}
|
|
1297
1277
|
}
|
|
1298
|
-
return
|
|
1278
|
+
return value;
|
|
1299
1279
|
}
|
|
1300
1280
|
if (ns.isMapSchema()) {
|
|
1301
1281
|
const mapMember = ns.getValueSchema();
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1282
|
+
const map = value;
|
|
1283
|
+
if (this.needsTransform(mapMember)) {
|
|
1284
|
+
for (const k in map) {
|
|
1285
|
+
if (k === "__proto__") {
|
|
1286
|
+
writeKey(map);
|
|
1287
|
+
}
|
|
1288
|
+
map[k] = this._read(mapMember, map[k]);
|
|
1306
1289
|
}
|
|
1307
|
-
out[_k] = this._read(mapMember, value[_k]);
|
|
1308
1290
|
}
|
|
1309
|
-
return
|
|
1291
|
+
return map;
|
|
1310
1292
|
}
|
|
1311
1293
|
}
|
|
1312
1294
|
if (ns.isBlobSchema() && typeof value === "string") {
|
|
@@ -1360,271 +1342,702 @@ var JsonShapeDeserializer = class extends SerdeContextConfig {
|
|
|
1360
1342
|
}
|
|
1361
1343
|
if (ns.isDocumentSchema()) {
|
|
1362
1344
|
if (isObject) {
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1345
|
+
if (Array.isArray(value)) {
|
|
1346
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1347
|
+
const v = value[i];
|
|
1348
|
+
if (!(v instanceof NumericValue)) {
|
|
1349
|
+
value[i] = this._read(ns, v);
|
|
1350
|
+
}
|
|
1367
1351
|
}
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1352
|
+
} else {
|
|
1353
|
+
const doc = value;
|
|
1354
|
+
for (const k in doc) {
|
|
1355
|
+
if (k === "__proto__") {
|
|
1356
|
+
writeKey(doc);
|
|
1357
|
+
}
|
|
1358
|
+
const v = doc[k];
|
|
1359
|
+
if (!(v instanceof NumericValue)) {
|
|
1360
|
+
doc[k] = this._read(ns, v);
|
|
1361
|
+
}
|
|
1373
1362
|
}
|
|
1374
1363
|
}
|
|
1375
|
-
return out;
|
|
1376
|
-
} else {
|
|
1377
|
-
return structuredClone(value);
|
|
1378
1364
|
}
|
|
1379
1365
|
}
|
|
1380
1366
|
return value;
|
|
1381
1367
|
}
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
return v;
|
|
1368
|
+
_readStruct(ns, record) {
|
|
1369
|
+
const union = ns.isUnionSchema();
|
|
1370
|
+
const out = {};
|
|
1371
|
+
let nameMap;
|
|
1372
|
+
const hasType = typeof record.__type === "string";
|
|
1373
|
+
const { jsonName } = this.settings;
|
|
1374
|
+
if (jsonName && hasType) {
|
|
1375
|
+
nameMap = {};
|
|
1376
|
+
}
|
|
1377
|
+
let unionSerde;
|
|
1378
|
+
if (union) {
|
|
1379
|
+
unionSerde = new UnionSerde(record, out);
|
|
1380
|
+
}
|
|
1381
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
1382
|
+
let fromKey = memberName;
|
|
1383
|
+
if (jsonName) {
|
|
1384
|
+
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
|
|
1385
|
+
if (hasType) {
|
|
1386
|
+
nameMap[fromKey] = memberName;
|
|
1387
|
+
}
|
|
1403
1388
|
}
|
|
1404
|
-
if (
|
|
1405
|
-
|
|
1406
|
-
const v = `${NUMERIC_CONTROL_CHAR + "b" + this.counter++}_` + s;
|
|
1407
|
-
this.values.set(`"${v}"`, s);
|
|
1408
|
-
return v;
|
|
1389
|
+
if (union) {
|
|
1390
|
+
unionSerde.mark(fromKey);
|
|
1409
1391
|
}
|
|
1410
|
-
|
|
1411
|
-
|
|
1392
|
+
if (record[fromKey] != null) {
|
|
1393
|
+
out[memberName] = this._read(memberSchema, record[fromKey]);
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
if (union) {
|
|
1397
|
+
unionSerde.writeUnknown();
|
|
1398
|
+
} else if (hasType) {
|
|
1399
|
+
for (const k in record) {
|
|
1400
|
+
const v = record[k];
|
|
1401
|
+
const t = jsonName ? nameMap[k] ?? k : k;
|
|
1402
|
+
if (!(t in out)) {
|
|
1403
|
+
out[t] = v;
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
return out;
|
|
1408
|
+
}
|
|
1409
|
+
needsTransform(ns) {
|
|
1410
|
+
if (ns.isBlobSchema() || ns.isTimestampSchema() || ns.isBigIntegerSchema() || ns.isBigDecimalSchema()) {
|
|
1411
|
+
return true;
|
|
1412
|
+
}
|
|
1413
|
+
if (ns.isDocumentSchema() || ns.isStructSchema() || ns.isListSchema() || ns.isMapSchema()) {
|
|
1414
|
+
return true;
|
|
1415
|
+
}
|
|
1416
|
+
if (ns.isStringSchema() && ns.getMergedTraits().mediaType) {
|
|
1417
|
+
return true;
|
|
1418
|
+
}
|
|
1419
|
+
return false;
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
|
|
1423
|
+
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonBytesStringAdapter.js
|
|
1424
|
+
var JsonBytesStringAdapter = class _JsonBytesStringAdapter extends Uint8Array {
|
|
1425
|
+
string = null;
|
|
1426
|
+
static allocUnsafe(bytes) {
|
|
1427
|
+
if (typeof Buffer === "function") {
|
|
1428
|
+
const buffer = Buffer.allocUnsafe(bytes);
|
|
1429
|
+
return new _JsonBytesStringAdapter(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
1430
|
+
}
|
|
1431
|
+
return new _JsonBytesStringAdapter(bytes);
|
|
1432
|
+
}
|
|
1433
|
+
toString() {
|
|
1434
|
+
return this.s();
|
|
1435
|
+
}
|
|
1436
|
+
valueOf() {
|
|
1437
|
+
return this.s();
|
|
1438
|
+
}
|
|
1439
|
+
includes(searchString, position) {
|
|
1440
|
+
if (typeof searchString === "string") {
|
|
1441
|
+
return this.s().includes(searchString, position);
|
|
1442
|
+
}
|
|
1443
|
+
return Uint8Array.prototype.includes.call(this, searchString, position);
|
|
1412
1444
|
}
|
|
1413
|
-
|
|
1414
|
-
if (
|
|
1415
|
-
|
|
1445
|
+
indexOf(searchString, position) {
|
|
1446
|
+
if (typeof searchString === "string") {
|
|
1447
|
+
return this.s().indexOf(searchString, position);
|
|
1416
1448
|
}
|
|
1417
|
-
|
|
1418
|
-
|
|
1449
|
+
return Uint8Array.prototype.indexOf.call(this, searchString, position);
|
|
1450
|
+
}
|
|
1451
|
+
lastIndexOf(searchString, position) {
|
|
1452
|
+
if (typeof searchString === "string") {
|
|
1453
|
+
return this.s().lastIndexOf(searchString, position);
|
|
1419
1454
|
}
|
|
1420
|
-
|
|
1421
|
-
if (
|
|
1422
|
-
return
|
|
1455
|
+
const fn = Uint8Array.prototype.lastIndexOf;
|
|
1456
|
+
if (position !== void 0) {
|
|
1457
|
+
return fn.call(this, searchString, position);
|
|
1423
1458
|
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1459
|
+
return fn.call(this, searchString);
|
|
1460
|
+
}
|
|
1461
|
+
startsWith(searchString, position) {
|
|
1462
|
+
return this.s().startsWith(searchString, position);
|
|
1463
|
+
}
|
|
1464
|
+
endsWith(searchString, endPosition) {
|
|
1465
|
+
return this.s().endsWith(searchString, endPosition);
|
|
1466
|
+
}
|
|
1467
|
+
match(regexp) {
|
|
1468
|
+
return this.s().match(regexp);
|
|
1469
|
+
}
|
|
1470
|
+
replace(searchValue, replaceValue) {
|
|
1471
|
+
return this.s().replace(searchValue, replaceValue);
|
|
1472
|
+
}
|
|
1473
|
+
search(regexp) {
|
|
1474
|
+
return this.s().search(regexp);
|
|
1475
|
+
}
|
|
1476
|
+
split(separator, limit) {
|
|
1477
|
+
return this.s().split(separator, limit);
|
|
1478
|
+
}
|
|
1479
|
+
substring(start, end) {
|
|
1480
|
+
return this.s().substring(start, end);
|
|
1481
|
+
}
|
|
1482
|
+
trim() {
|
|
1483
|
+
return this.s().trim();
|
|
1484
|
+
}
|
|
1485
|
+
trimStart() {
|
|
1486
|
+
return this.s().trimStart();
|
|
1487
|
+
}
|
|
1488
|
+
trimEnd() {
|
|
1489
|
+
return this.s().trimEnd();
|
|
1490
|
+
}
|
|
1491
|
+
charAt(pos) {
|
|
1492
|
+
return this.s().charAt(pos);
|
|
1493
|
+
}
|
|
1494
|
+
charCodeAt(index) {
|
|
1495
|
+
return this.s().charCodeAt(index);
|
|
1496
|
+
}
|
|
1497
|
+
padStart(maxLength, fillString) {
|
|
1498
|
+
return this.s().padStart(maxLength, fillString);
|
|
1499
|
+
}
|
|
1500
|
+
padEnd(maxLength, fillString) {
|
|
1501
|
+
return this.s().padEnd(maxLength, fillString);
|
|
1502
|
+
}
|
|
1503
|
+
repeat(count) {
|
|
1504
|
+
return this.s().repeat(count);
|
|
1505
|
+
}
|
|
1506
|
+
toUpperCase() {
|
|
1507
|
+
return this.s().toUpperCase();
|
|
1508
|
+
}
|
|
1509
|
+
toLowerCase() {
|
|
1510
|
+
return this.s().toLowerCase();
|
|
1511
|
+
}
|
|
1512
|
+
s() {
|
|
1513
|
+
if (this.string == null) {
|
|
1514
|
+
const n = Date.now();
|
|
1515
|
+
if (n > warned + 6e4) {
|
|
1516
|
+
console.warn("@aws-sdk/core/protocols - WARN - JsonCodec2: you have called a string method on a Uint8Array request body. It has been automatically converted to string. In a future version this will throw an error.");
|
|
1517
|
+
warned = n;
|
|
1518
|
+
}
|
|
1519
|
+
this.string = toUtf8(this);
|
|
1426
1520
|
}
|
|
1427
|
-
return
|
|
1521
|
+
return this.string;
|
|
1428
1522
|
}
|
|
1429
1523
|
};
|
|
1524
|
+
var warned = 0;
|
|
1430
1525
|
|
|
1431
|
-
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/
|
|
1432
|
-
var
|
|
1526
|
+
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonShapeSerializer2.js
|
|
1527
|
+
var encoder = new TextEncoder();
|
|
1528
|
+
var OPEN_BRACE = 123;
|
|
1529
|
+
var CLOSE_BRACE = 125;
|
|
1530
|
+
var OPEN_BRACKET = 91;
|
|
1531
|
+
var CLOSE_BRACKET = 93;
|
|
1532
|
+
var QUOTE = 34;
|
|
1533
|
+
var COLON = 58;
|
|
1534
|
+
var COMMA = 44;
|
|
1535
|
+
var BACKSLASH = 92;
|
|
1536
|
+
var TRUE = new Uint8Array([116, 114, 117, 101]);
|
|
1537
|
+
var FALSE = new Uint8Array([102, 97, 108, 115, 101]);
|
|
1538
|
+
var NULL = new Uint8Array([110, 117, 108, 108]);
|
|
1539
|
+
var ESCAPE_TABLE = new Array(128).fill(null);
|
|
1540
|
+
ESCAPE_TABLE[8] = "b";
|
|
1541
|
+
ESCAPE_TABLE[9] = "t";
|
|
1542
|
+
ESCAPE_TABLE[10] = "n";
|
|
1543
|
+
ESCAPE_TABLE[12] = "f";
|
|
1544
|
+
ESCAPE_TABLE[13] = "r";
|
|
1545
|
+
ESCAPE_TABLE[34] = '"';
|
|
1546
|
+
ESCAPE_TABLE[92] = "\\";
|
|
1547
|
+
for (let i = 0; i < 32; i++) {
|
|
1548
|
+
if (ESCAPE_TABLE[i] === null) {
|
|
1549
|
+
ESCAPE_TABLE[i] = "u00" + i.toString(16).padStart(2, "0");
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
var INITIAL_BUFFER_SIZE = 2048;
|
|
1553
|
+
function alloc(size) {
|
|
1554
|
+
return JsonBytesStringAdapter.allocUnsafe(size);
|
|
1555
|
+
}
|
|
1556
|
+
var JsonShapeSerializer2 = class _JsonShapeSerializer2 extends SerdeContextConfig {
|
|
1433
1557
|
settings;
|
|
1434
|
-
|
|
1435
|
-
|
|
1558
|
+
json;
|
|
1559
|
+
i = 0;
|
|
1436
1560
|
rootSchema;
|
|
1561
|
+
rawValue;
|
|
1562
|
+
passthrough = false;
|
|
1437
1563
|
constructor(settings) {
|
|
1438
1564
|
super();
|
|
1439
1565
|
this.settings = settings;
|
|
1566
|
+
this.json = alloc(INITIAL_BUFFER_SIZE);
|
|
1440
1567
|
}
|
|
1441
1568
|
write(schema, value) {
|
|
1569
|
+
this.i = 0;
|
|
1570
|
+
this.rawValue = value;
|
|
1442
1571
|
this.rootSchema = NormalizedSchema.of(schema);
|
|
1443
|
-
this.
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
const { rootSchema, useReplacer } = this;
|
|
1447
|
-
this.rootSchema = void 0;
|
|
1448
|
-
this.useReplacer = false;
|
|
1449
|
-
if (rootSchema?.isStructSchema() || rootSchema?.isDocumentSchema()) {
|
|
1450
|
-
if (!useReplacer) {
|
|
1451
|
-
return JSON.stringify(this.buffer);
|
|
1452
|
-
}
|
|
1453
|
-
const replacer = new JsonReplacer();
|
|
1454
|
-
return replacer.replaceInJson(JSON.stringify(this.buffer, replacer.createReplacer(), 0));
|
|
1572
|
+
this.passthrough = this.rootSchema.isBlobSchema() || this.rootSchema.isStringSchema();
|
|
1573
|
+
if (!this.passthrough) {
|
|
1574
|
+
this.writeValue(this.rootSchema, value, void 0);
|
|
1455
1575
|
}
|
|
1456
|
-
return this.buffer;
|
|
1457
1576
|
}
|
|
1458
1577
|
writeDiscriminatedDocument(schema, value) {
|
|
1459
|
-
this.
|
|
1460
|
-
|
|
1461
|
-
|
|
1578
|
+
this.i = 0;
|
|
1579
|
+
this.rootSchema = NormalizedSchema.of(schema);
|
|
1580
|
+
const ns = this.rootSchema;
|
|
1581
|
+
if (ns.isStructSchema() && value != null && typeof value === "object") {
|
|
1582
|
+
this.writeValue(ns, value, void 0);
|
|
1583
|
+
const prefix = `"__type":"${ns.getName(true) ?? "Unknown"}",`;
|
|
1584
|
+
const z = prefix.length;
|
|
1585
|
+
this.ensure(z);
|
|
1586
|
+
this.json.copyWithin(1 + z, 1, this.i);
|
|
1587
|
+
encoder.encodeInto(prefix, this.json.subarray(1));
|
|
1588
|
+
this.i += z;
|
|
1589
|
+
} else {
|
|
1590
|
+
this.writeValue(ns, value, void 0);
|
|
1462
1591
|
}
|
|
1463
1592
|
}
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
const
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1593
|
+
flush() {
|
|
1594
|
+
this.rootSchema = void 0;
|
|
1595
|
+
const finalPosition = this.i;
|
|
1596
|
+
this.i = 0;
|
|
1597
|
+
const raw = this.rawValue;
|
|
1598
|
+
this.rawValue = void 0;
|
|
1599
|
+
if (finalPosition === 0) {
|
|
1600
|
+
return raw;
|
|
1601
|
+
}
|
|
1602
|
+
const result = this.json.subarray(0, finalPosition);
|
|
1603
|
+
this.json = alloc(INITIAL_BUFFER_SIZE);
|
|
1604
|
+
return result;
|
|
1605
|
+
}
|
|
1606
|
+
ensure(byteCount) {
|
|
1607
|
+
const { i, json } = this;
|
|
1608
|
+
if (i + byteCount > json.length) {
|
|
1609
|
+
let newSize = json.length * 2;
|
|
1610
|
+
while (newSize < i + byteCount) {
|
|
1611
|
+
newSize *= 2;
|
|
1612
|
+
}
|
|
1613
|
+
const next = alloc(newSize);
|
|
1614
|
+
next.set(this.json);
|
|
1615
|
+
this.json = next;
|
|
1616
|
+
}
|
|
1617
|
+
}
|
|
1618
|
+
writeAscii(s) {
|
|
1619
|
+
const z = s.length;
|
|
1620
|
+
this.ensure(z);
|
|
1621
|
+
let { i, json } = this;
|
|
1622
|
+
for (let j = 0; j < z; ++j) {
|
|
1623
|
+
json[i] = s.charCodeAt(j);
|
|
1624
|
+
i += 1;
|
|
1625
|
+
}
|
|
1626
|
+
this.i = i;
|
|
1627
|
+
}
|
|
1628
|
+
writeAsciiQuoted(s) {
|
|
1629
|
+
const z = s.length;
|
|
1630
|
+
this.ensure(z + 4);
|
|
1631
|
+
let { json, i } = this;
|
|
1632
|
+
json[i++] = QUOTE;
|
|
1633
|
+
for (let j = 0; j < z; ++j) {
|
|
1634
|
+
json[i++] = s.charCodeAt(j);
|
|
1635
|
+
}
|
|
1636
|
+
json[i++] = QUOTE;
|
|
1637
|
+
this.i = i;
|
|
1638
|
+
}
|
|
1639
|
+
writeJsonString(s) {
|
|
1640
|
+
this.ensure(s.length * 3 + 2);
|
|
1641
|
+
this.json[this.i++] = QUOTE;
|
|
1642
|
+
const z = s.length;
|
|
1643
|
+
for (let j = 0; j < z; ++j) {
|
|
1644
|
+
const c = s.charCodeAt(j);
|
|
1645
|
+
if (c > 34 && c < 92) {
|
|
1646
|
+
this.json[this.i++] = c;
|
|
1647
|
+
} else if (c < 128) {
|
|
1648
|
+
const esc = ESCAPE_TABLE[c];
|
|
1649
|
+
if (esc !== null) {
|
|
1650
|
+
this.ensure(esc.length + 1);
|
|
1651
|
+
this.json[this.i++] = BACKSLASH;
|
|
1652
|
+
for (let k = 0; k < esc.length; k++) {
|
|
1653
|
+
this.json[this.i++] = esc.charCodeAt(k);
|
|
1487
1654
|
}
|
|
1655
|
+
} else {
|
|
1656
|
+
this.json[this.i++] = c;
|
|
1488
1657
|
}
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1658
|
+
} else if (c >= 55296 && c <= 56319) {
|
|
1659
|
+
const next = j + 1 < z ? s.charCodeAt(j + 1) : 0;
|
|
1660
|
+
if (next >= 56320 && next <= 57343) {
|
|
1661
|
+
this.ensure(4);
|
|
1662
|
+
const { written } = encoder.encodeInto(s.substring(j, j + 2), this.json.subarray(this.i));
|
|
1663
|
+
this.i += written;
|
|
1664
|
+
++j;
|
|
1665
|
+
} else {
|
|
1666
|
+
this.ensure(6);
|
|
1667
|
+
this.writeUnicodeEscape(c);
|
|
1668
|
+
}
|
|
1669
|
+
} else if (c >= 56320 && c <= 57343) {
|
|
1670
|
+
this.ensure(6);
|
|
1671
|
+
this.writeUnicodeEscape(c);
|
|
1672
|
+
} else {
|
|
1673
|
+
let { i, json } = this;
|
|
1674
|
+
if (c < 2048) {
|
|
1675
|
+
json[i++] = 192 | c >> 6;
|
|
1676
|
+
json[i++] = 128 | c & 63;
|
|
1677
|
+
} else {
|
|
1678
|
+
json[i++] = 224 | c >> 12;
|
|
1679
|
+
json[i++] = 128 | c >> 6 & 63;
|
|
1680
|
+
json[i++] = 128 | c & 63;
|
|
1681
|
+
}
|
|
1682
|
+
this.i = i;
|
|
1683
|
+
}
|
|
1684
|
+
}
|
|
1685
|
+
this.json[this.i++] = QUOTE;
|
|
1686
|
+
}
|
|
1687
|
+
writeUnicodeEscape(code) {
|
|
1688
|
+
let { json, i } = this;
|
|
1689
|
+
json[i++] = BACKSLASH;
|
|
1690
|
+
json[i++] = 117;
|
|
1691
|
+
const hex = code.toString(16).padStart(4, "0");
|
|
1692
|
+
for (let j = 0; j < 4; ++j) {
|
|
1693
|
+
json[i++] = hex.charCodeAt(j);
|
|
1694
|
+
}
|
|
1695
|
+
this.i = i;
|
|
1696
|
+
}
|
|
1697
|
+
static B64 = (() => {
|
|
1698
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1699
|
+
const table = new Uint8Array(64);
|
|
1700
|
+
for (let i = 0; i < 64; ++i) {
|
|
1701
|
+
table[i] = chars.charCodeAt(i);
|
|
1702
|
+
}
|
|
1703
|
+
return table;
|
|
1704
|
+
})();
|
|
1705
|
+
writeBase64(data) {
|
|
1706
|
+
const b64Len = Math.ceil(data.length / 3) * 4;
|
|
1707
|
+
this.ensure(b64Len + 2);
|
|
1708
|
+
const json = this.json;
|
|
1709
|
+
const B64 = _JsonShapeSerializer2.B64;
|
|
1710
|
+
let i = this.i;
|
|
1711
|
+
json[i++] = QUOTE;
|
|
1712
|
+
const len = data.length;
|
|
1713
|
+
const remainder = len % 3;
|
|
1714
|
+
const mainLen = len - remainder;
|
|
1715
|
+
for (let j = 0; j < mainLen; j += 3) {
|
|
1716
|
+
const a = data[j];
|
|
1717
|
+
const b = data[j + 1];
|
|
1718
|
+
const c = data[j + 2];
|
|
1719
|
+
json[i++] = B64[a >> 2];
|
|
1720
|
+
json[i++] = B64[(a & 3) << 4 | b >> 4];
|
|
1721
|
+
json[i++] = B64[(b & 15) << 2 | c >> 6];
|
|
1722
|
+
json[i++] = B64[c & 63];
|
|
1723
|
+
}
|
|
1724
|
+
if (remainder === 2) {
|
|
1725
|
+
const a = data[mainLen];
|
|
1726
|
+
const b = data[mainLen + 1];
|
|
1727
|
+
json[i++] = B64[a >> 2];
|
|
1728
|
+
json[i++] = B64[(a & 3) << 4 | b >> 4];
|
|
1729
|
+
json[i++] = B64[(b & 15) << 2];
|
|
1730
|
+
json[i++] = 61;
|
|
1731
|
+
} else if (remainder === 1) {
|
|
1732
|
+
const a = data[mainLen];
|
|
1733
|
+
json[i++] = B64[a >> 2];
|
|
1734
|
+
json[i++] = B64[(a & 3) << 4];
|
|
1735
|
+
json[i++] = 61;
|
|
1736
|
+
json[i++] = 61;
|
|
1737
|
+
}
|
|
1738
|
+
json[i++] = QUOTE;
|
|
1739
|
+
this.i = i;
|
|
1740
|
+
}
|
|
1741
|
+
writeValue(schema, value, container) {
|
|
1742
|
+
if (value == null) {
|
|
1743
|
+
if (container?.isStructSchema()) {
|
|
1744
|
+
if (value === void 0) {
|
|
1745
|
+
const ns2 = NormalizedSchema.of(schema);
|
|
1746
|
+
if (ns2.isIdempotencyToken()) {
|
|
1747
|
+
this.writeAsciiQuoted(generateIdempotencyToken());
|
|
1748
|
+
return;
|
|
1505
1749
|
}
|
|
1506
1750
|
}
|
|
1507
|
-
return
|
|
1751
|
+
return;
|
|
1508
1752
|
}
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1753
|
+
this.ensure(4);
|
|
1754
|
+
this.json.set(NULL, this.i);
|
|
1755
|
+
this.i += 4;
|
|
1756
|
+
return;
|
|
1757
|
+
}
|
|
1758
|
+
const ns = NormalizedSchema.of(schema);
|
|
1759
|
+
const isObject = typeof value === "object";
|
|
1760
|
+
if (ns.isStringSchema()) {
|
|
1761
|
+
const mediaType = ns.getMergedTraits().mediaType;
|
|
1762
|
+
if (mediaType) {
|
|
1763
|
+
const isJson = mediaType === "application/json" || mediaType.endsWith("+json");
|
|
1764
|
+
if (isJson) {
|
|
1765
|
+
this.writeJsonString(LazyJsonString.from(value).toString());
|
|
1766
|
+
return;
|
|
1517
1767
|
}
|
|
1518
|
-
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
if (isObject) {
|
|
1771
|
+
if (ns.isStructSchema()) {
|
|
1772
|
+
this.writeStruct(ns, value);
|
|
1773
|
+
return;
|
|
1774
|
+
}
|
|
1775
|
+
if (Array.isArray(value) && (ns.isListSchema() || ns.isDocumentSchema())) {
|
|
1776
|
+
this.writeList(ns, value, ns.isDocumentSchema());
|
|
1777
|
+
return;
|
|
1519
1778
|
}
|
|
1520
1779
|
if (ns.isMapSchema()) {
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
1524
|
-
for (const _k in value) {
|
|
1525
|
-
const _v = value[_k];
|
|
1526
|
-
if (sparse || _v != null) {
|
|
1527
|
-
if (_k === "__proto__") {
|
|
1528
|
-
writeKey(out);
|
|
1529
|
-
}
|
|
1530
|
-
out[_k] = this._write(mapMember, _v);
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
return out;
|
|
1780
|
+
this.writeMap(ns, value, false);
|
|
1781
|
+
return;
|
|
1534
1782
|
}
|
|
1535
1783
|
if (value instanceof Uint8Array && (ns.isBlobSchema() || ns.isDocumentSchema())) {
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
}
|
|
1539
|
-
return (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
1784
|
+
this.writeBase64(value);
|
|
1785
|
+
return;
|
|
1540
1786
|
}
|
|
1541
1787
|
if (value instanceof Date && (ns.isTimestampSchema() || ns.isDocumentSchema())) {
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
case 5:
|
|
1545
|
-
return value.toISOString().replace(".000Z", "Z");
|
|
1546
|
-
case 6:
|
|
1547
|
-
return dateToUtcString(value);
|
|
1548
|
-
case 7:
|
|
1549
|
-
return value.getTime() / 1e3;
|
|
1550
|
-
default:
|
|
1551
|
-
console.warn("Missing timestamp format, using epoch seconds", value);
|
|
1552
|
-
return value.getTime() / 1e3;
|
|
1553
|
-
}
|
|
1788
|
+
this.writeTimestamp(ns, value);
|
|
1789
|
+
return;
|
|
1554
1790
|
}
|
|
1555
1791
|
if (value instanceof NumericValue) {
|
|
1556
|
-
this.
|
|
1557
|
-
|
|
1558
|
-
}
|
|
1559
|
-
if (value === null && container?.isStructSchema()) {
|
|
1560
|
-
return void 0;
|
|
1561
|
-
}
|
|
1562
|
-
if (ns.isStringSchema()) {
|
|
1563
|
-
if (typeof value === "undefined" && ns.isIdempotencyToken()) {
|
|
1564
|
-
return generateIdempotencyToken();
|
|
1792
|
+
this.writeAscii(value.string);
|
|
1793
|
+
return;
|
|
1565
1794
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1795
|
+
if (ns.isDocumentSchema()) {
|
|
1796
|
+
if (Array.isArray(value)) {
|
|
1797
|
+
this.writeList(ns, value, true);
|
|
1798
|
+
} else {
|
|
1799
|
+
this.writeMap(ns, value, true);
|
|
1571
1800
|
}
|
|
1801
|
+
return;
|
|
1572
1802
|
}
|
|
1573
|
-
|
|
1803
|
+
const json = JSON.stringify(value);
|
|
1804
|
+
this.writeAscii(json);
|
|
1805
|
+
return;
|
|
1574
1806
|
}
|
|
1575
|
-
if (typeof value === "
|
|
1576
|
-
if (
|
|
1577
|
-
|
|
1807
|
+
if (typeof value === "string") {
|
|
1808
|
+
if (ns.isBlobSchema()) {
|
|
1809
|
+
const b64 = (this.serdeContext?.base64Encoder ?? toBase64)(value);
|
|
1810
|
+
this.writeAsciiQuoted(b64);
|
|
1811
|
+
return;
|
|
1578
1812
|
}
|
|
1579
|
-
|
|
1813
|
+
this.writeJsonString(value);
|
|
1814
|
+
return;
|
|
1580
1815
|
}
|
|
1581
|
-
if (typeof value === "
|
|
1582
|
-
if (
|
|
1583
|
-
|
|
1816
|
+
if (typeof value === "number") {
|
|
1817
|
+
if (Math.abs(value) === Infinity || Number.isNaN(value)) {
|
|
1818
|
+
this.writeAsciiQuoted(String(value));
|
|
1819
|
+
return;
|
|
1584
1820
|
}
|
|
1585
|
-
|
|
1821
|
+
const numStr = String(value);
|
|
1822
|
+
this.writeAscii(numStr);
|
|
1823
|
+
return;
|
|
1824
|
+
}
|
|
1825
|
+
if (typeof value === "boolean") {
|
|
1826
|
+
this.ensure(5);
|
|
1827
|
+
let { i, json } = this;
|
|
1828
|
+
if (value) {
|
|
1829
|
+
json.set(TRUE, i);
|
|
1830
|
+
i += 4;
|
|
1831
|
+
} else {
|
|
1832
|
+
json.set(FALSE, i);
|
|
1833
|
+
i += 5;
|
|
1834
|
+
}
|
|
1835
|
+
this.i = i;
|
|
1836
|
+
return;
|
|
1586
1837
|
}
|
|
1587
1838
|
if (typeof value === "bigint") {
|
|
1588
|
-
this.
|
|
1839
|
+
this.writeAscii(value.toString());
|
|
1840
|
+
return;
|
|
1589
1841
|
}
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1842
|
+
this.writeAscii(String(value));
|
|
1843
|
+
}
|
|
1844
|
+
writeStruct(ns, value) {
|
|
1845
|
+
this.ensure(2);
|
|
1846
|
+
this.json[this.i++] = OPEN_BRACE;
|
|
1847
|
+
let wroteAny = false;
|
|
1848
|
+
const hasType = typeof value.__type === "string";
|
|
1849
|
+
let writtenKeys;
|
|
1850
|
+
if (hasType) {
|
|
1851
|
+
writtenKeys = /* @__PURE__ */ new Set();
|
|
1852
|
+
}
|
|
1853
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
1854
|
+
const item = value[memberName];
|
|
1855
|
+
if (item == null && !memberSchema.isIdempotencyToken()) {
|
|
1856
|
+
continue;
|
|
1857
|
+
}
|
|
1858
|
+
if (wroteAny) {
|
|
1859
|
+
this.ensure(1);
|
|
1860
|
+
this.json[this.i++] = COMMA;
|
|
1861
|
+
}
|
|
1862
|
+
wroteAny = true;
|
|
1863
|
+
const targetKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;
|
|
1864
|
+
if (writtenKeys) {
|
|
1865
|
+
writtenKeys.add(memberName);
|
|
1866
|
+
writtenKeys.add(targetKey);
|
|
1867
|
+
}
|
|
1868
|
+
this.writeAsciiQuoted(targetKey);
|
|
1869
|
+
this.json[this.i++] = COLON;
|
|
1870
|
+
this.writeValue(memberSchema, item, ns);
|
|
1871
|
+
}
|
|
1872
|
+
if (!wroteAny && ns.isUnionSchema()) {
|
|
1873
|
+
const { $unknown } = value;
|
|
1874
|
+
if (Array.isArray($unknown)) {
|
|
1875
|
+
const [k, v] = $unknown;
|
|
1876
|
+
this.writeAsciiQuoted(k);
|
|
1877
|
+
this.ensure(1);
|
|
1878
|
+
this.json[this.i++] = COLON;
|
|
1879
|
+
this.writeValue(15, v, ns);
|
|
1880
|
+
}
|
|
1881
|
+
} else if (hasType) {
|
|
1882
|
+
for (const k in value) {
|
|
1883
|
+
if (writtenKeys.has(k)) {
|
|
1884
|
+
continue;
|
|
1885
|
+
}
|
|
1886
|
+
writtenKeys.add(k);
|
|
1887
|
+
const v = value[k];
|
|
1888
|
+
if (wroteAny) {
|
|
1889
|
+
this.ensure(1);
|
|
1890
|
+
this.json[this.i++] = COMMA;
|
|
1891
|
+
}
|
|
1892
|
+
wroteAny = true;
|
|
1893
|
+
this.writeAsciiQuoted(k);
|
|
1894
|
+
this.ensure(1);
|
|
1895
|
+
this.json[this.i++] = COLON;
|
|
1896
|
+
this.writeValue(15, v, void 0);
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
this.ensure(1);
|
|
1900
|
+
this.json[this.i++] = CLOSE_BRACE;
|
|
1901
|
+
}
|
|
1902
|
+
writeList(ns, value, isDocument) {
|
|
1903
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
1904
|
+
const valueSchema = ns.getValueSchema();
|
|
1905
|
+
if (!isDocument) {
|
|
1906
|
+
if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
|
|
1907
|
+
let hasSpecials = false;
|
|
1908
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1909
|
+
const v = value[i];
|
|
1910
|
+
if (Number.isNaN(v) || v === Infinity || v === -Infinity || v == null && !sparse) {
|
|
1911
|
+
hasSpecials = true;
|
|
1912
|
+
break;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
let json;
|
|
1916
|
+
if (!hasSpecials) {
|
|
1917
|
+
json = JSON.stringify(value);
|
|
1918
|
+
} else {
|
|
1919
|
+
const out = [];
|
|
1920
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1921
|
+
const v = value[i];
|
|
1922
|
+
if (v == null && !sparse)
|
|
1923
|
+
continue;
|
|
1924
|
+
if (Number.isNaN(v) || v === Infinity || v === -Infinity) {
|
|
1925
|
+
out.push(String(v));
|
|
1926
|
+
} else {
|
|
1927
|
+
out.push(v);
|
|
1928
|
+
}
|
|
1929
|
+
}
|
|
1930
|
+
json = JSON.stringify(out);
|
|
1931
|
+
}
|
|
1932
|
+
this.ensure(json.length * 3);
|
|
1933
|
+
this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
|
|
1934
|
+
return;
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
this.ensure(2);
|
|
1938
|
+
this.json[this.i++] = OPEN_BRACKET;
|
|
1939
|
+
let wroteFirstItem = false;
|
|
1940
|
+
for (let i = 0; i < value.length; ++i) {
|
|
1941
|
+
const item = value[i];
|
|
1942
|
+
if (isDocument ? item === void 0 : item == null && !sparse) {
|
|
1943
|
+
continue;
|
|
1944
|
+
}
|
|
1945
|
+
if (wroteFirstItem) {
|
|
1946
|
+
this.ensure(1);
|
|
1947
|
+
this.json[this.i++] = COMMA;
|
|
1948
|
+
}
|
|
1949
|
+
this.writeValue(valueSchema, item, void 0);
|
|
1950
|
+
wroteFirstItem = true;
|
|
1951
|
+
}
|
|
1952
|
+
this.ensure(1);
|
|
1953
|
+
this.json[this.i++] = CLOSE_BRACKET;
|
|
1954
|
+
}
|
|
1955
|
+
writeMap(ns, value, isDocument) {
|
|
1956
|
+
const sparse = !!ns.getMergedTraits().sparse;
|
|
1957
|
+
const valueSchema = ns.getValueSchema();
|
|
1958
|
+
if (!isDocument) {
|
|
1959
|
+
if (valueSchema.isStringSchema() || valueSchema.isNumericSchema() || valueSchema.isBooleanSchema()) {
|
|
1960
|
+
let modifications;
|
|
1593
1961
|
for (const k in value) {
|
|
1594
1962
|
const v = value[k];
|
|
1595
|
-
if (
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
if (v
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
} else {
|
|
1602
|
-
out[k] = this._write(ns, v);
|
|
1963
|
+
if (Number.isNaN(v) || v === Infinity || v === -Infinity) {
|
|
1964
|
+
(modifications ??= {})[k] = v;
|
|
1965
|
+
value[k] = String(v);
|
|
1966
|
+
} else if (v === null && !sparse) {
|
|
1967
|
+
(modifications ??= {})[k] = null;
|
|
1968
|
+
value[k] = void 0;
|
|
1603
1969
|
}
|
|
1604
1970
|
}
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1971
|
+
const json = JSON.stringify(value);
|
|
1972
|
+
if (modifications) {
|
|
1973
|
+
Object.assign(value, modifications);
|
|
1974
|
+
}
|
|
1975
|
+
this.ensure(json.length * 3);
|
|
1976
|
+
this.i += encoder.encodeInto(json, this.json.subarray(this.i)).written;
|
|
1977
|
+
return;
|
|
1978
|
+
}
|
|
1979
|
+
}
|
|
1980
|
+
this.ensure(2);
|
|
1981
|
+
this.json[this.i++] = OPEN_BRACE;
|
|
1982
|
+
let first = true;
|
|
1983
|
+
for (const k in value) {
|
|
1984
|
+
const v = value[k];
|
|
1985
|
+
if (isDocument ? v === void 0 : v == null && !sparse) {
|
|
1986
|
+
continue;
|
|
1987
|
+
}
|
|
1988
|
+
if (!first) {
|
|
1989
|
+
this.ensure(1);
|
|
1990
|
+
this.json[this.i++] = COMMA;
|
|
1991
|
+
}
|
|
1992
|
+
first = false;
|
|
1993
|
+
this.writeJsonString(k);
|
|
1994
|
+
this.ensure(1);
|
|
1995
|
+
this.json[this.i++] = COLON;
|
|
1996
|
+
this.writeValue(valueSchema, v, void 0);
|
|
1997
|
+
}
|
|
1998
|
+
this.ensure(1);
|
|
1999
|
+
this.json[this.i++] = CLOSE_BRACE;
|
|
2000
|
+
}
|
|
2001
|
+
writeTimestamp(ns, value) {
|
|
2002
|
+
const format = determineTimestampFormat(ns, this.settings);
|
|
2003
|
+
switch (format) {
|
|
2004
|
+
case 5: {
|
|
2005
|
+
const iso = value.toISOString().replace(".000Z", "Z");
|
|
2006
|
+
this.writeAsciiQuoted(iso);
|
|
2007
|
+
return;
|
|
2008
|
+
}
|
|
2009
|
+
case 6: {
|
|
2010
|
+
this.writeAsciiQuoted(dateToUtcString(value));
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
case 7: {
|
|
2014
|
+
const epochSecs = String(value.getTime() / 1e3);
|
|
2015
|
+
this.writeAscii(epochSecs);
|
|
2016
|
+
return;
|
|
2017
|
+
}
|
|
2018
|
+
default: {
|
|
2019
|
+
const epochSecs = String(value.getTime() / 1e3);
|
|
2020
|
+
this.writeAscii(epochSecs);
|
|
2021
|
+
return;
|
|
1608
2022
|
}
|
|
1609
2023
|
}
|
|
1610
|
-
return value;
|
|
1611
2024
|
}
|
|
1612
2025
|
};
|
|
1613
2026
|
|
|
1614
|
-
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/
|
|
1615
|
-
var
|
|
2027
|
+
// ../../node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/codec-v2/JsonCodec2.js
|
|
2028
|
+
var JsonCodec2 = class extends SerdeContextConfig {
|
|
1616
2029
|
settings;
|
|
1617
2030
|
constructor(settings) {
|
|
1618
2031
|
super();
|
|
1619
2032
|
this.settings = settings;
|
|
1620
2033
|
}
|
|
1621
2034
|
createSerializer() {
|
|
1622
|
-
const serializer = new
|
|
2035
|
+
const serializer = new JsonShapeSerializer2(this.settings);
|
|
1623
2036
|
serializer.setSerdeContext(this.serdeContext);
|
|
1624
2037
|
return serializer;
|
|
1625
2038
|
}
|
|
1626
2039
|
createDeserializer() {
|
|
1627
|
-
const deserializer = new
|
|
2040
|
+
const deserializer = new JsonShapeDeserializer2(this.settings);
|
|
1628
2041
|
deserializer.setSerdeContext(this.serdeContext);
|
|
1629
2042
|
return deserializer;
|
|
1630
2043
|
}
|
|
@@ -1636,7 +2049,7 @@ var AwsRestJsonProtocol = class extends HttpBindingProtocol {
|
|
|
1636
2049
|
deserializer;
|
|
1637
2050
|
codec;
|
|
1638
2051
|
mixin = new ProtocolLib();
|
|
1639
|
-
constructor({ defaultNamespace, errorTypeRegistries }) {
|
|
2052
|
+
constructor({ defaultNamespace, errorTypeRegistries, jsonCodec }) {
|
|
1640
2053
|
super({
|
|
1641
2054
|
defaultNamespace,
|
|
1642
2055
|
errorTypeRegistries
|
|
@@ -1649,7 +2062,7 @@ var AwsRestJsonProtocol = class extends HttpBindingProtocol {
|
|
|
1649
2062
|
httpBindings: true,
|
|
1650
2063
|
jsonName: true
|
|
1651
2064
|
};
|
|
1652
|
-
this.codec = new
|
|
2065
|
+
this.codec = jsonCodec ?? new JsonCodec2(settings);
|
|
1653
2066
|
this.serializer = new HttpInterceptingShapeSerializer(this.codec.createSerializer(), settings);
|
|
1654
2067
|
this.deserializer = new HttpInterceptingShapeDeserializer(this.codec.createDeserializer(), settings);
|
|
1655
2068
|
}
|
|
@@ -2402,4 +2815,4 @@ export {
|
|
|
2402
2815
|
AwsRestJsonProtocol,
|
|
2403
2816
|
AwsQueryProtocol
|
|
2404
2817
|
};
|
|
2405
|
-
//# sourceMappingURL=chunk-
|
|
2818
|
+
//# sourceMappingURL=chunk-RKAR27K2.js.map
|