@karmaniverous/get-dotenv 7.0.1 → 7.0.3

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.
Files changed (50) hide show
  1. package/dist/chunks/{AwsRestJsonProtocol-DeiE3wkO.mjs → AwsRestJsonProtocol-fgUvbh0C.mjs} +158 -81
  2. package/dist/chunks/{createCli-B9-MIwWj.mjs → createCli-B9De0dbB.mjs} +5 -5
  3. package/dist/chunks/{externalDataInterceptor-gi2RH4ez.mjs → externalDataInterceptor-m2kSL8CB.mjs} +2 -2
  4. package/dist/chunks/{getSSOTokenFromFile-BfAhZf_d.mjs → getSSOTokenFromFile-Vx7XHoYM.mjs} +4 -4
  5. package/dist/chunks/{index-CMSCF_uw.mjs → index-BdwUJ997.mjs} +494 -255
  6. package/dist/chunks/{index-mPj0Vhpw.mjs → index-BupFFAuS.mjs} +14 -16
  7. package/dist/chunks/{index-xRi3oKvY.mjs → index-C2z1IV4R.mjs} +11 -13
  8. package/dist/chunks/{index-CAtxK29A.mjs → index-CcxIt23B.mjs} +12 -9
  9. package/dist/chunks/{index-DfvhftMN.mjs → index-D1FUmkpH.mjs} +30 -29
  10. package/dist/chunks/{index-C21RHLO4.mjs → index-D8mqch7I.mjs} +34 -19
  11. package/dist/chunks/{index-D8S1lJ24.mjs → index-DavD95qI.mjs} +272 -182
  12. package/dist/chunks/{index-AssUn9IY.mjs → index-DbDfog26.mjs} +11158 -8060
  13. package/dist/chunks/index-DmR_hk_x.mjs +31 -0
  14. package/dist/chunks/{index-DY7wYcXW.mjs → index-R829pajs.mjs} +15 -18
  15. package/dist/chunks/{index-98yxYe1W.mjs → index-ScWmGA41.mjs} +282 -206
  16. package/dist/chunks/{index-B6r8O7PJ.mjs → index-UolIX-qt.mjs} +15 -18
  17. package/dist/chunks/{index-Ccay5Db0.mjs → index-WAaC3U5P.mjs} +17 -20
  18. package/dist/chunks/{loadSso-C-y9gQEz.mjs → loadSso-BZQzknAq.mjs} +243 -181
  19. package/dist/chunks/{loader-CE4HSRN4.mjs → loader-V1vbmtyw.mjs} +2 -0
  20. package/dist/chunks/{package-DiDNabNr.mjs → package-DbbYaehr.mjs} +1 -1
  21. package/dist/chunks/{parseKnownFiles-KczcjlE0.mjs → parseKnownFiles-CCiikesE.mjs} +1 -1
  22. package/dist/chunks/{readDotenvCascade-HLU7FsEQ.mjs → readDotenvCascade-Dgx4SC1p.mjs} +3 -7
  23. package/dist/chunks/{readMergedOptions-D6niy_Ep.mjs → readMergedOptions-BRLqvCpt.mjs} +37 -10
  24. package/dist/chunks/{resolveCliOptions-PWF1aEM9.mjs → resolveCliOptions-Bbv0tNSF.mjs} +1 -1
  25. package/dist/chunks/{sdk-stream-mixin-blFikF4G.mjs → sdk-stream-mixin-pKJE9QhL.mjs} +145 -5
  26. package/dist/chunks/{spawnEnv-5kdIVv0x.mjs → spawnEnv-CKgnHGpr.mjs} +5 -5
  27. package/dist/chunks/{types-Bp3u5-IH.mjs → types-BfKw9R-k.mjs} +1 -1
  28. package/dist/cli.d.ts +4 -0
  29. package/dist/cli.mjs +13 -15
  30. package/dist/cliHost.d.ts +4 -0
  31. package/dist/cliHost.mjs +6 -6
  32. package/dist/config.d.ts +2 -0
  33. package/dist/config.mjs +1 -1
  34. package/dist/env-overlay.d.ts +2 -0
  35. package/dist/env-overlay.mjs +2 -2
  36. package/dist/getdotenv.cli.mjs +13 -15
  37. package/dist/index.d.ts +6 -0
  38. package/dist/index.mjs +17 -19
  39. package/dist/plugins-aws.d.ts +2 -0
  40. package/dist/plugins-aws.mjs +4 -4
  41. package/dist/plugins-batch.d.ts +2 -0
  42. package/dist/plugins-batch.mjs +4 -4
  43. package/dist/plugins-cmd.d.ts +2 -0
  44. package/dist/plugins-cmd.mjs +6 -6
  45. package/dist/plugins-init.d.ts +2 -0
  46. package/dist/plugins-init.mjs +5 -5
  47. package/dist/plugins.d.ts +2 -0
  48. package/dist/plugins.mjs +12 -14
  49. package/package.json +1 -1
  50. package/dist/chunks/index-DtdHVcXz.mjs +0 -27
@@ -1,5 +1,6 @@
1
- import { av as HttpProtocol, aw as NormalizedSchema, H as HttpRequest, ax as translateTraits, ay as extendedEncodeURIComponent, az as collectBody, aA as splitHeader, aB as SerdeContext, aC as FromStringShapeDeserializer, t as toUtf8, i as fromUtf8, aD as v4, aE as LazyJsonString, n as toBase64, aF as determineTimestampFormat, aG as dateToUtcString, aH as NumericValue, aI as SerdeContextConfig, aJ as UnionSerde, aK as deserializingStructIterator, m as fromBase64, aL as parseEpochTimestamp, aM as parseRfc7231DateTime, aN as parseRfc3339DateTimeWithOffset, aO as serializingStructIterator, aP as ProtocolLib, an as TypeRegistry } from './index-AssUn9IY.mjs';
2
- import { s as sdkStreamMixin } from './sdk-stream-mixin-blFikF4G.mjs';
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-DbDfog26.mjs';
2
+ import 'node:crypto';
3
+ import { s as sdkStreamMixin } from './sdk-stream-mixin-pKJE9QhL.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 schema = ns.getSchema();
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
- Object.assign(query, Object.fromEntries(traitSearchParams));
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 [key, val] of Object.entries(inputMemberValue)) {
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
- serializer.write(schema, input);
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 [key, val] of Object.entries(data)) {
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
- dataObject[member] = dataFromBody[member];
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 [header, value] of Object.entries(response.headers)) {
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 = v4();
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 loadRestJsonErrorCode = (output, data) => {
491
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
492
- const sanitizeErrorCode = (rawValue) => {
493
- let cleanValue = rawValue;
494
- if (typeof cleanValue === "number") {
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 (data && typeof data === "object") {
513
- const codeKey = findKey(data, "code");
514
- if (codeKey && data[codeKey] !== undefined) {
515
- return sanitizeErrorCode(data[codeKey]);
516
- }
517
- if (data["__type"] !== undefined) {
518
- return sanitizeErrorCode(data["__type"]);
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(value, out);
588
+ unionSerde = new UnionSerde(record, out);
545
589
  }
546
- for (const [memberName, memberSchema] of deserializingStructIterator(ns, value, this.settings.jsonName ? "jsonName" : false)) {
547
- const fromKey = this.settings.jsonName ? memberSchema.getMergedTraits().jsonName ?? memberName : memberName;
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 (value[fromKey] != null) {
552
- out[memberName] = this._read(memberSchema, value[fromKey]);
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
- if (sparse || item != null) {
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 sparse = !!ns.getMergedTraits().sparse;
575
- for (const [_k, _v] of Object.entries(value)) {
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 [k, v] of Object.entries(value)) {
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
- for (const [memberName, memberSchema] of serializingStructIterator(ns, value)) {
738
- const serializableValue = this._write(memberSchema, value[memberName], ns);
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
- const jsonName = memberSchema.getMergedTraits().jsonName;
741
- const targetKey = this.settings.jsonName ? jsonName ?? memberName : memberName;
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() && Object.keys(out).length === 0) {
746
- const { $unknown } = value;
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 [_k, _v] of Object.entries(value)) {
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 v4();
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 [k, v] of Object.entries(value)) {
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 ?? "Unknown";
931
- const ErrorCtor = TypeRegistry.for(errorSchema[1]).getErrorCtor(errorSchema) ?? Error;
932
- const exception = new ErrorCtor(message);
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] = this.codec.createDeserializer().readObject(member, dataObject[target]);
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,
@@ -1,24 +1,24 @@
1
1
  import 'zod';
2
2
  import 'path';
3
- import { r as resolveGetDotenvConfigSources } from './loader-CE4HSRN4.mjs';
3
+ import { r as resolveGetDotenvConfigSources } from './loader-V1vbmtyw.mjs';
4
4
  import 'nanoid';
5
5
  import 'fs-extra';
6
6
  import 'node:path';
7
7
  import 'radash';
8
8
  import 'node:buffer';
9
- import { a as defaultsDeep, g as getDotenvCliOptions2Options, b as baseRootOptionDefaults, G as GetDotenvCli, c as attachRootOptions } from './readMergedOptions-D6niy_Ep.mjs';
9
+ import { d as defaultsDeep, h as getDotenvCliOptions2Options, c as baseRootOptionDefaults, G as GetDotenvCli, b as attachRootOptions } from './readMergedOptions-BRLqvCpt.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-PWF1aEM9.mjs';
16
+ import { r as resolveCliOptions } from './resolveCliOptions-Bbv0tNSF.mjs';
17
17
  import { v as validateEnvAgainstSources } from './validate-CDl0rE6k.mjs';
18
18
  import { awsPlugin } from '../plugins-aws.mjs';
19
- import { a as awsWhoamiPlugin } from './index-AssUn9IY.mjs';
19
+ import { R as awsWhoamiPlugin } from './index-DbDfog26.mjs';
20
20
  import { batchPlugin } from '../plugins-batch.mjs';
21
- import { c as cmdPlugin } from './index-CAtxK29A.mjs';
21
+ import { c as cmdPlugin } from './index-CcxIt23B.mjs';
22
22
  import { initPlugin } from '../plugins-init.mjs';
23
23
 
24
24
  const dbg = (...args) => {
@@ -1,5 +1,5 @@
1
- import { t as tokenIntercept } from './getSSOTokenFromFile-BfAhZf_d.mjs';
2
- import { h as fileIntercept } from './index-AssUn9IY.mjs';
1
+ import { t as tokenIntercept } from './getSSOTokenFromFile-Vx7XHoYM.mjs';
2
+ import { a4 as fileIntercept } from './index-DbDfog26.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 { j as getHomeDir } from './index-AssUn9IY.mjs';
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-DbDfog26.mjs';
5
5
 
6
6
  const getSSOTokenFilepath = (id) => {
7
7
  const hasher = createHash("sha1");