@karmaniverous/get-dotenv 7.0.0 → 7.0.2
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/chunks/{AwsRestJsonProtocol-DeiE3wkO.mjs → AwsRestJsonProtocol-Bh3OvjNM.mjs} +158 -81
- package/dist/chunks/{createCli-B9-MIwWj.mjs → createCli-wmAcTdWR.mjs} +4 -4
- package/dist/chunks/{externalDataInterceptor-gi2RH4ez.mjs → externalDataInterceptor-BBvsYwZE.mjs} +2 -2
- package/dist/chunks/{getSSOTokenFromFile-BfAhZf_d.mjs → getSSOTokenFromFile-BSeYpbLi.mjs} +4 -4
- package/dist/chunks/{index-98yxYe1W.mjs → index-BZrYAvLs.mjs} +281 -205
- package/dist/chunks/{index-CAtxK29A.mjs → index-BhMXFr37.mjs} +12 -9
- package/dist/chunks/{index-DY7wYcXW.mjs → index-C-9h7h7x.mjs} +14 -17
- package/dist/chunks/{index-AssUn9IY.mjs → index-CGG9e0xu.mjs} +11157 -8059
- package/dist/chunks/{index-CMSCF_uw.mjs → index-CQoEnkSc.mjs} +493 -254
- package/dist/chunks/{index-xRi3oKvY.mjs → index-CnnI9zSQ.mjs} +10 -12
- package/dist/chunks/{index-D8S1lJ24.mjs → index-DLciMnJ6.mjs} +271 -181
- package/dist/chunks/{index-B6r8O7PJ.mjs → index-DmynYewb.mjs} +14 -17
- package/dist/chunks/{index-C21RHLO4.mjs → index-DyRIwYWf.mjs} +33 -18
- package/dist/chunks/{index-mPj0Vhpw.mjs → index-GcL_Hrrr.mjs} +13 -15
- package/dist/chunks/{index-DfvhftMN.mjs → index-aUz_8rS_.mjs} +29 -28
- package/dist/chunks/index-cIL2r09o.mjs +31 -0
- package/dist/chunks/{index-Ccay5Db0.mjs → index-tlD9zcww.mjs} +16 -19
- package/dist/chunks/{loadSso-C-y9gQEz.mjs → loadSso-9hx2nl0k.mjs} +242 -180
- package/dist/chunks/{package-DiDNabNr.mjs → package-DbbYaehr.mjs} +1 -1
- package/dist/chunks/{parseKnownFiles-KczcjlE0.mjs → parseKnownFiles-CewXrtbo.mjs} +1 -1
- package/dist/chunks/{readDotenvCascade-HLU7FsEQ.mjs → readDotenvCascade-Dgx4SC1p.mjs} +3 -7
- package/dist/chunks/{readMergedOptions-D6niy_Ep.mjs → readMergedOptions-atT1xkoe.mjs} +5 -3
- package/dist/chunks/{resolveCliOptions-PWF1aEM9.mjs → resolveCliOptions-BLSqCGm7.mjs} +1 -1
- package/dist/chunks/{sdk-stream-mixin-blFikF4G.mjs → sdk-stream-mixin-CMdQ7nO8.mjs} +145 -5
- package/dist/chunks/{spawnEnv-5kdIVv0x.mjs → spawnEnv-CKgnHGpr.mjs} +5 -5
- package/dist/chunks/{types-Bp3u5-IH.mjs → types-BdKCfPRW.mjs} +1 -1
- package/dist/cli.mjs +12 -14
- package/dist/cliHost.mjs +5 -5
- package/dist/env-overlay.mjs +2 -2
- package/dist/getdotenv.cli.mjs +12 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +16 -18
- package/dist/plugins-aws.mjs +3 -3
- package/dist/plugins-batch.mjs +3 -3
- package/dist/plugins-cmd.mjs +5 -5
- package/dist/plugins-init.mjs +4 -4
- package/dist/plugins.mjs +11 -13
- package/package.json +1 -1
- package/dist/chunks/index-DtdHVcXz.mjs +0 -27
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { m as HttpProtocol, z as NormalizedSchema, n as HttpRequest, aU as translateTraits, a3 as extendedEncodeURIComponent, X as collectBody, aP as splitHeader, S as SerdeContext, F as FromStringShapeDeserializer, aT as toUtf8, a8 as fromUtf8, a9 as generateIdempotencyToken, L as LazyJsonString, aR as toBase64, a0 as determineTimestampFormat, _ as dateToUtcString, G as NumericValue, K as SerdeContextConfig, U as UnionSerde, a6 as fromBase64, av as parseEpochTimestamp, az as parseRfc7231DateTime, ay as parseRfc3339DateTimeWithOffset, P as ProtocolLib } from './index-CGG9e0xu.mjs';
|
|
2
|
+
import 'node:crypto';
|
|
3
|
+
import { s as sdkStreamMixin } from './sdk-stream-mixin-CMdQ7nO8.mjs';
|
|
3
4
|
|
|
4
5
|
function quoteHeader(part) {
|
|
5
6
|
if (part.includes(",") || part.includes('"')) {
|
|
@@ -35,15 +36,14 @@ function splitEvery(value, delimiter, numDelimiters) {
|
|
|
35
36
|
|
|
36
37
|
class HttpBindingProtocol extends HttpProtocol {
|
|
37
38
|
async serializeRequest(operationSchema, _input, context) {
|
|
38
|
-
const input = {
|
|
39
|
-
...(_input ?? {}),
|
|
40
|
-
};
|
|
39
|
+
const input = _input && typeof _input === "object" ? _input : {};
|
|
41
40
|
const serializer = this.serializer;
|
|
42
41
|
const query = {};
|
|
43
42
|
const headers = {};
|
|
44
43
|
const endpoint = await context.endpoint();
|
|
45
44
|
const ns = NormalizedSchema.of(operationSchema?.input);
|
|
46
|
-
const
|
|
45
|
+
const payloadMemberNames = [];
|
|
46
|
+
const payloadMemberSchemas = [];
|
|
47
47
|
let hasNonHttpBindingMember = false;
|
|
48
48
|
let payload;
|
|
49
49
|
const request = new HttpRequest({
|
|
@@ -70,13 +70,20 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
70
70
|
request.path += path;
|
|
71
71
|
}
|
|
72
72
|
const traitSearchParams = new URLSearchParams(search ?? "");
|
|
73
|
-
|
|
73
|
+
for (const [key, value] of traitSearchParams) {
|
|
74
|
+
query[key] = value;
|
|
75
|
+
}
|
|
74
76
|
}
|
|
75
77
|
}
|
|
76
78
|
for (const [memberName, memberNs] of ns.structIterator()) {
|
|
77
79
|
const memberTraits = memberNs.getMergedTraits() ?? {};
|
|
78
80
|
const inputMemberValue = input[memberName];
|
|
79
81
|
if (inputMemberValue == null && !memberNs.isIdempotencyToken()) {
|
|
82
|
+
if (memberTraits.httpLabel) {
|
|
83
|
+
if (request.path.includes(`{${memberName}+}`) || request.path.includes(`{${memberName}}`)) {
|
|
84
|
+
throw new Error(`No value provided for input HTTP label: ${memberName}.`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
80
87
|
continue;
|
|
81
88
|
}
|
|
82
89
|
if (memberTraits.httpPayload) {
|
|
@@ -99,7 +106,6 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
99
106
|
serializer.write(memberNs, inputMemberValue);
|
|
100
107
|
payload = serializer.flush();
|
|
101
108
|
}
|
|
102
|
-
delete input[memberName];
|
|
103
109
|
}
|
|
104
110
|
else if (memberTraits.httpLabel) {
|
|
105
111
|
serializer.write(memberNs, inputMemberValue);
|
|
@@ -110,31 +116,47 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
110
116
|
else if (request.path.includes(`{${memberName}}`)) {
|
|
111
117
|
request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
|
|
112
118
|
}
|
|
113
|
-
delete input[memberName];
|
|
114
119
|
}
|
|
115
120
|
else if (memberTraits.httpHeader) {
|
|
116
121
|
serializer.write(memberNs, inputMemberValue);
|
|
117
122
|
headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
|
|
118
|
-
delete input[memberName];
|
|
119
123
|
}
|
|
120
124
|
else if (typeof memberTraits.httpPrefixHeaders === "string") {
|
|
121
|
-
for (const
|
|
125
|
+
for (const key in inputMemberValue) {
|
|
126
|
+
const val = inputMemberValue[key];
|
|
122
127
|
const amalgam = memberTraits.httpPrefixHeaders + key;
|
|
123
128
|
serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
|
|
124
129
|
headers[amalgam.toLowerCase()] = serializer.flush();
|
|
125
130
|
}
|
|
126
|
-
delete input[memberName];
|
|
127
131
|
}
|
|
128
132
|
else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
|
|
129
133
|
this.serializeQuery(memberNs, inputMemberValue, query);
|
|
130
|
-
delete input[memberName];
|
|
131
134
|
}
|
|
132
135
|
else {
|
|
133
136
|
hasNonHttpBindingMember = true;
|
|
137
|
+
payloadMemberNames.push(memberName);
|
|
138
|
+
payloadMemberSchemas.push(memberNs);
|
|
134
139
|
}
|
|
135
140
|
}
|
|
136
141
|
if (hasNonHttpBindingMember && input) {
|
|
137
|
-
|
|
142
|
+
const [namespace, name] = (ns.getName(true) ?? "#Unknown").split("#");
|
|
143
|
+
const requiredMembers = ns.getSchema()[6];
|
|
144
|
+
const payloadSchema = [
|
|
145
|
+
3,
|
|
146
|
+
namespace,
|
|
147
|
+
name,
|
|
148
|
+
ns.getMergedTraits(),
|
|
149
|
+
payloadMemberNames,
|
|
150
|
+
payloadMemberSchemas,
|
|
151
|
+
undefined,
|
|
152
|
+
];
|
|
153
|
+
if (requiredMembers) {
|
|
154
|
+
payloadSchema[6] = requiredMembers;
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
payloadSchema.pop();
|
|
158
|
+
}
|
|
159
|
+
serializer.write(payloadSchema, input);
|
|
138
160
|
payload = serializer.flush();
|
|
139
161
|
}
|
|
140
162
|
request.headers = headers;
|
|
@@ -146,8 +168,9 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
146
168
|
const serializer = this.serializer;
|
|
147
169
|
const traits = ns.getMergedTraits();
|
|
148
170
|
if (traits.httpQueryParams) {
|
|
149
|
-
for (const
|
|
171
|
+
for (const key in data) {
|
|
150
172
|
if (!(key in query)) {
|
|
173
|
+
const val = data[key];
|
|
151
174
|
const valueSchema = ns.getValueSchema();
|
|
152
175
|
Object.assign(valueSchema.getMergedTraits(), {
|
|
153
176
|
...traits,
|
|
@@ -199,7 +222,9 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
199
222
|
if (bytes.byteLength > 0) {
|
|
200
223
|
const dataFromBody = await deserializer.read(ns, bytes);
|
|
201
224
|
for (const member of nonHttpBindingMembers) {
|
|
202
|
-
|
|
225
|
+
if (dataFromBody[member] != null) {
|
|
226
|
+
dataObject[member] = dataFromBody[member];
|
|
227
|
+
}
|
|
203
228
|
}
|
|
204
229
|
}
|
|
205
230
|
}
|
|
@@ -273,8 +298,9 @@ class HttpBindingProtocol extends HttpProtocol {
|
|
|
273
298
|
}
|
|
274
299
|
else if (memberTraits.httpPrefixHeaders !== undefined) {
|
|
275
300
|
dataObject[memberName] = {};
|
|
276
|
-
for (const
|
|
301
|
+
for (const header in response.headers) {
|
|
277
302
|
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
|
303
|
+
const value = response.headers[header];
|
|
278
304
|
const valueSchema = memberSchema.getValueSchema();
|
|
279
305
|
valueSchema.getMergedTraits().httpHeader = header;
|
|
280
306
|
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(valueSchema, value);
|
|
@@ -405,7 +431,7 @@ class ToStringShapeSerializer extends SerdeContext {
|
|
|
405
431
|
break;
|
|
406
432
|
default:
|
|
407
433
|
if (ns.isIdempotencyToken()) {
|
|
408
|
-
this.stringBuffer =
|
|
434
|
+
this.stringBuffer = generateIdempotencyToken();
|
|
409
435
|
}
|
|
410
436
|
else {
|
|
411
437
|
this.stringBuffer = String(value);
|
|
@@ -487,35 +513,47 @@ const parseJsonBody = (streamBody, context) => collectBodyString(streamBody, con
|
|
|
487
513
|
}
|
|
488
514
|
return {};
|
|
489
515
|
});
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
cleanValue = cleanValue.toString();
|
|
496
|
-
}
|
|
497
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
498
|
-
cleanValue = cleanValue.split(",")[0];
|
|
499
|
-
}
|
|
500
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
501
|
-
cleanValue = cleanValue.split(":")[0];
|
|
502
|
-
}
|
|
503
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
504
|
-
cleanValue = cleanValue.split("#")[1];
|
|
505
|
-
}
|
|
506
|
-
return cleanValue;
|
|
507
|
-
};
|
|
508
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
509
|
-
if (headerKey !== undefined) {
|
|
510
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
516
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
517
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
518
|
+
let cleanValue = rawValue;
|
|
519
|
+
if (typeof cleanValue === "number") {
|
|
520
|
+
cleanValue = cleanValue.toString();
|
|
511
521
|
}
|
|
512
|
-
if (
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
522
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
523
|
+
cleanValue = cleanValue.split(",")[0];
|
|
524
|
+
}
|
|
525
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
526
|
+
cleanValue = cleanValue.split(":")[0];
|
|
527
|
+
}
|
|
528
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
529
|
+
cleanValue = cleanValue.split("#")[1];
|
|
530
|
+
}
|
|
531
|
+
return cleanValue;
|
|
532
|
+
};
|
|
533
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
534
|
+
return loadErrorCode(output, data, ["header", "code", "type"]);
|
|
535
|
+
};
|
|
536
|
+
const loadErrorCode = ({ headers }, data, order) => {
|
|
537
|
+
while (order.length > 0) {
|
|
538
|
+
const location = order.shift();
|
|
539
|
+
switch (location) {
|
|
540
|
+
case "header":
|
|
541
|
+
const headerKey = findKey(headers ?? {}, "x-amzn-errortype");
|
|
542
|
+
if (headerKey !== undefined) {
|
|
543
|
+
return sanitizeErrorCode(headers[headerKey]);
|
|
544
|
+
}
|
|
545
|
+
break;
|
|
546
|
+
case "code":
|
|
547
|
+
const codeKey = findKey(data ?? {}, "code");
|
|
548
|
+
if (codeKey && data[codeKey] !== undefined) {
|
|
549
|
+
return sanitizeErrorCode(data[codeKey]);
|
|
550
|
+
}
|
|
551
|
+
break;
|
|
552
|
+
case "type":
|
|
553
|
+
if (data?.__type !== undefined) {
|
|
554
|
+
return sanitizeErrorCode(data.__type);
|
|
555
|
+
}
|
|
556
|
+
break;
|
|
519
557
|
}
|
|
520
558
|
}
|
|
521
559
|
};
|
|
@@ -537,45 +575,58 @@ class JsonShapeDeserializer extends SerdeContextConfig {
|
|
|
537
575
|
const ns = NormalizedSchema.of(schema);
|
|
538
576
|
if (isObject) {
|
|
539
577
|
if (ns.isStructSchema()) {
|
|
578
|
+
const record = value;
|
|
540
579
|
const union = ns.isUnionSchema();
|
|
541
580
|
const out = {};
|
|
581
|
+
let nameMap = void 0;
|
|
582
|
+
const { jsonName } = this.settings;
|
|
583
|
+
if (jsonName) {
|
|
584
|
+
nameMap = {};
|
|
585
|
+
}
|
|
542
586
|
let unionSerde;
|
|
543
587
|
if (union) {
|
|
544
|
-
unionSerde = new UnionSerde(
|
|
588
|
+
unionSerde = new UnionSerde(record, out);
|
|
545
589
|
}
|
|
546
|
-
for (const [memberName, memberSchema] of
|
|
547
|
-
|
|
590
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
591
|
+
let fromKey = memberName;
|
|
592
|
+
if (jsonName) {
|
|
593
|
+
fromKey = memberSchema.getMergedTraits().jsonName ?? fromKey;
|
|
594
|
+
nameMap[fromKey] = memberName;
|
|
595
|
+
}
|
|
548
596
|
if (union) {
|
|
549
597
|
unionSerde.mark(fromKey);
|
|
550
598
|
}
|
|
551
|
-
if (
|
|
552
|
-
out[memberName] = this._read(memberSchema,
|
|
599
|
+
if (record[fromKey] != null) {
|
|
600
|
+
out[memberName] = this._read(memberSchema, record[fromKey]);
|
|
553
601
|
}
|
|
554
602
|
}
|
|
555
603
|
if (union) {
|
|
556
604
|
unionSerde.writeUnknown();
|
|
557
605
|
}
|
|
606
|
+
else if (typeof record.__type === "string") {
|
|
607
|
+
for (const k in record) {
|
|
608
|
+
const v = record[k];
|
|
609
|
+
const t = jsonName ? nameMap[k] ?? k : k;
|
|
610
|
+
if (!(t in out)) {
|
|
611
|
+
out[t] = v;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
558
615
|
return out;
|
|
559
616
|
}
|
|
560
617
|
if (Array.isArray(value) && ns.isListSchema()) {
|
|
561
618
|
const listMember = ns.getValueSchema();
|
|
562
619
|
const out = [];
|
|
563
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
564
620
|
for (const item of value) {
|
|
565
|
-
|
|
566
|
-
out.push(this._read(listMember, item));
|
|
567
|
-
}
|
|
621
|
+
out.push(this._read(listMember, item));
|
|
568
622
|
}
|
|
569
623
|
return out;
|
|
570
624
|
}
|
|
571
625
|
if (ns.isMapSchema()) {
|
|
572
626
|
const mapMember = ns.getValueSchema();
|
|
573
627
|
const out = {};
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
if (sparse || _v != null) {
|
|
577
|
-
out[_k] = this._read(mapMember, _v);
|
|
578
|
-
}
|
|
628
|
+
for (const _k in value) {
|
|
629
|
+
out[_k] = this._read(mapMember, value[_k]);
|
|
579
630
|
}
|
|
580
631
|
return out;
|
|
581
632
|
}
|
|
@@ -632,7 +683,8 @@ class JsonShapeDeserializer extends SerdeContextConfig {
|
|
|
632
683
|
if (ns.isDocumentSchema()) {
|
|
633
684
|
if (isObject) {
|
|
634
685
|
const out = Array.isArray(value) ? [] : {};
|
|
635
|
-
for (const
|
|
686
|
+
for (const k in value) {
|
|
687
|
+
const v = value[k];
|
|
636
688
|
if (v instanceof NumericValue) {
|
|
637
689
|
out[k] = v;
|
|
638
690
|
}
|
|
@@ -709,12 +761,6 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
709
761
|
this.rootSchema = NormalizedSchema.of(schema);
|
|
710
762
|
this.buffer = this._write(this.rootSchema, value);
|
|
711
763
|
}
|
|
712
|
-
writeDiscriminatedDocument(schema, value) {
|
|
713
|
-
this.write(schema, value);
|
|
714
|
-
if (typeof this.buffer === "object") {
|
|
715
|
-
this.buffer.__type = NormalizedSchema.of(schema).getName(true);
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
764
|
flush() {
|
|
719
765
|
const { rootSchema, useReplacer } = this;
|
|
720
766
|
this.rootSchema = undefined;
|
|
@@ -728,27 +774,53 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
728
774
|
}
|
|
729
775
|
return this.buffer;
|
|
730
776
|
}
|
|
777
|
+
writeDiscriminatedDocument(schema, value) {
|
|
778
|
+
this.write(schema, value);
|
|
779
|
+
if (typeof this.buffer === "object") {
|
|
780
|
+
this.buffer.__type = NormalizedSchema.of(schema).getName(true);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
731
783
|
_write(schema, value, container) {
|
|
732
784
|
const isObject = value !== null && typeof value === "object";
|
|
733
785
|
const ns = NormalizedSchema.of(schema);
|
|
734
786
|
if (isObject) {
|
|
735
787
|
if (ns.isStructSchema()) {
|
|
788
|
+
const record = value;
|
|
736
789
|
const out = {};
|
|
737
|
-
|
|
738
|
-
|
|
790
|
+
const { jsonName } = this.settings;
|
|
791
|
+
let nameMap = void 0;
|
|
792
|
+
if (jsonName) {
|
|
793
|
+
nameMap = {};
|
|
794
|
+
}
|
|
795
|
+
let outCount = 0;
|
|
796
|
+
for (const [memberName, memberSchema] of ns.structIterator()) {
|
|
797
|
+
const serializableValue = this._write(memberSchema, record[memberName], ns);
|
|
739
798
|
if (serializableValue !== undefined) {
|
|
740
|
-
|
|
741
|
-
|
|
799
|
+
let targetKey = memberName;
|
|
800
|
+
if (jsonName) {
|
|
801
|
+
targetKey = memberSchema.getMergedTraits().jsonName ?? memberName;
|
|
802
|
+
nameMap[memberName] = targetKey;
|
|
803
|
+
}
|
|
742
804
|
out[targetKey] = serializableValue;
|
|
805
|
+
outCount++;
|
|
743
806
|
}
|
|
744
807
|
}
|
|
745
|
-
if (ns.isUnionSchema() &&
|
|
746
|
-
const { $unknown } =
|
|
808
|
+
if (ns.isUnionSchema() && outCount === 0) {
|
|
809
|
+
const { $unknown } = record;
|
|
747
810
|
if (Array.isArray($unknown)) {
|
|
748
811
|
const [k, v] = $unknown;
|
|
749
812
|
out[k] = this._write(15, v);
|
|
750
813
|
}
|
|
751
814
|
}
|
|
815
|
+
else if (typeof record.__type === "string") {
|
|
816
|
+
for (const k in record) {
|
|
817
|
+
const v = record[k];
|
|
818
|
+
const targetKey = jsonName ? nameMap[k] ?? k : k;
|
|
819
|
+
if (!(targetKey in out)) {
|
|
820
|
+
out[targetKey] = this._write(15, v);
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
}
|
|
752
824
|
return out;
|
|
753
825
|
}
|
|
754
826
|
if (Array.isArray(value) && ns.isListSchema()) {
|
|
@@ -766,7 +838,8 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
766
838
|
const mapMember = ns.getValueSchema();
|
|
767
839
|
const out = {};
|
|
768
840
|
const sparse = !!ns.getMergedTraits().sparse;
|
|
769
|
-
for (const
|
|
841
|
+
for (const _k in value) {
|
|
842
|
+
const _v = value[_k];
|
|
770
843
|
if (sparse || _v != null) {
|
|
771
844
|
out[_k] = this._write(mapMember, _v);
|
|
772
845
|
}
|
|
@@ -802,7 +875,7 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
802
875
|
}
|
|
803
876
|
if (ns.isStringSchema()) {
|
|
804
877
|
if (typeof value === "undefined" && ns.isIdempotencyToken()) {
|
|
805
|
-
return
|
|
878
|
+
return generateIdempotencyToken();
|
|
806
879
|
}
|
|
807
880
|
const mediaType = ns.getMergedTraits().mediaType;
|
|
808
881
|
if (value != null && mediaType) {
|
|
@@ -831,7 +904,8 @@ class JsonShapeSerializer extends SerdeContextConfig {
|
|
|
831
904
|
if (ns.isDocumentSchema()) {
|
|
832
905
|
if (isObject) {
|
|
833
906
|
const out = Array.isArray(value) ? [] : {};
|
|
834
|
-
for (const
|
|
907
|
+
for (const k in value) {
|
|
908
|
+
const v = value[k];
|
|
835
909
|
if (v instanceof NumericValue) {
|
|
836
910
|
this.useReplacer = true;
|
|
837
911
|
out[k] = v;
|
|
@@ -873,9 +947,10 @@ class AwsRestJsonProtocol extends HttpBindingProtocol {
|
|
|
873
947
|
deserializer;
|
|
874
948
|
codec;
|
|
875
949
|
mixin = new ProtocolLib();
|
|
876
|
-
constructor({ defaultNamespace }) {
|
|
950
|
+
constructor({ defaultNamespace, errorTypeRegistries, }) {
|
|
877
951
|
super({
|
|
878
952
|
defaultNamespace,
|
|
953
|
+
errorTypeRegistries,
|
|
879
954
|
});
|
|
880
955
|
const settings = {
|
|
881
956
|
timestampFormat: {
|
|
@@ -925,16 +1000,18 @@ class AwsRestJsonProtocol extends HttpBindingProtocol {
|
|
|
925
1000
|
}
|
|
926
1001
|
async handleError(operationSchema, context, response, dataObject, metadata) {
|
|
927
1002
|
const errorIdentifier = loadRestJsonErrorCode(response, dataObject) ?? "Unknown";
|
|
1003
|
+
this.mixin.compose(this.compositeErrorRegistry, errorIdentifier, this.options.defaultNamespace);
|
|
928
1004
|
const { errorSchema, errorMetadata } = await this.mixin.getErrorSchemaOrThrowBaseException(errorIdentifier, this.options.defaultNamespace, response, dataObject, metadata);
|
|
929
1005
|
const ns = NormalizedSchema.of(errorSchema);
|
|
930
|
-
const message = dataObject.message ?? dataObject.Message ?? "
|
|
931
|
-
const ErrorCtor =
|
|
932
|
-
const exception = new ErrorCtor(
|
|
1006
|
+
const message = dataObject.message ?? dataObject.Message ?? "UnknownError";
|
|
1007
|
+
const ErrorCtor = this.compositeErrorRegistry.getErrorCtor(errorSchema) ?? Error;
|
|
1008
|
+
const exception = new ErrorCtor({});
|
|
933
1009
|
await this.deserializeHttpMessage(errorSchema, context, response, dataObject);
|
|
934
1010
|
const output = {};
|
|
1011
|
+
const errorDeserializer = this.codec.createDeserializer();
|
|
935
1012
|
for (const [name, member] of ns.structIterator()) {
|
|
936
1013
|
const target = member.getMergedTraits().jsonName ?? name;
|
|
937
|
-
output[name] =
|
|
1014
|
+
output[name] = errorDeserializer.readObject(member, dataObject[target]);
|
|
938
1015
|
}
|
|
939
1016
|
throw this.mixin.decorateServiceException(Object.assign(exception, errorMetadata, {
|
|
940
1017
|
$fault: ns.getMergedTraits().error,
|
|
@@ -6,19 +6,19 @@ import 'fs-extra';
|
|
|
6
6
|
import 'node:path';
|
|
7
7
|
import 'radash';
|
|
8
8
|
import 'node:buffer';
|
|
9
|
-
import {
|
|
9
|
+
import { d as defaultsDeep, h as getDotenvCliOptions2Options, c as baseRootOptionDefaults, G as GetDotenvCli, b as attachRootOptions } from './readMergedOptions-atT1xkoe.mjs';
|
|
10
10
|
import 'crypto';
|
|
11
11
|
import 'url';
|
|
12
12
|
import '@commander-js/extra-typings';
|
|
13
13
|
import 'dotenv';
|
|
14
14
|
import 'execa';
|
|
15
15
|
import { t as toHelpConfig } from './helpConfig-CGejgwWW.mjs';
|
|
16
|
-
import { r as resolveCliOptions } from './resolveCliOptions-
|
|
16
|
+
import { r as resolveCliOptions } from './resolveCliOptions-BLSqCGm7.mjs';
|
|
17
17
|
import { v as validateEnvAgainstSources } from './validate-CDl0rE6k.mjs';
|
|
18
18
|
import { awsPlugin } from '../plugins-aws.mjs';
|
|
19
|
-
import {
|
|
19
|
+
import { R as awsWhoamiPlugin } from './index-CGG9e0xu.mjs';
|
|
20
20
|
import { batchPlugin } from '../plugins-batch.mjs';
|
|
21
|
-
import { c as cmdPlugin } from './index-
|
|
21
|
+
import { c as cmdPlugin } from './index-BhMXFr37.mjs';
|
|
22
22
|
import { initPlugin } from '../plugins-init.mjs';
|
|
23
23
|
|
|
24
24
|
const dbg = (...args) => {
|
package/dist/chunks/{externalDataInterceptor-gi2RH4ez.mjs → externalDataInterceptor-BBvsYwZE.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as tokenIntercept } from './getSSOTokenFromFile-
|
|
2
|
-
import {
|
|
1
|
+
import { t as tokenIntercept } from './getSSOTokenFromFile-BSeYpbLi.mjs';
|
|
2
|
+
import { a4 as fileIntercept } from './index-CGG9e0xu.mjs';
|
|
3
3
|
|
|
4
4
|
const externalDataInterceptor = {
|
|
5
5
|
getFileRecord() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { readFile } from 'fs/promises';
|
|
2
|
-
import { createHash } from 'crypto';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
import {
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { af as getHomeDir } from './index-CGG9e0xu.mjs';
|
|
5
5
|
|
|
6
6
|
const getSSOTokenFilepath = (id) => {
|
|
7
7
|
const hasher = createHash("sha1");
|