@cdk8s/awscdk-resolver 0.0.318 → 0.0.319

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 (134) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/package.json +14 -14
  4. package/node_modules/@aws-sdk/client-sso/package.json +13 -13
  5. package/node_modules/@aws-sdk/core/package.json +4 -4
  6. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  7. package/node_modules/@aws-sdk/credential-provider-http/package.json +6 -6
  8. package/node_modules/@aws-sdk/credential-provider-ini/package.json +8 -8
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  12. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  13. package/node_modules/@aws-sdk/middleware-user-agent/package.json +4 -4
  14. package/node_modules/@aws-sdk/nested-clients/package.json +13 -13
  15. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  16. package/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +30 -0
  17. package/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +1 -0
  18. package/node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js +21 -0
  19. package/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts +1 -0
  20. package/node_modules/@aws-sdk/util-endpoints/dist-types/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -0
  21. package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts +1 -0
  22. package/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveDefaultAwsRegionalEndpointsConfig.d.ts +35 -0
  23. package/node_modules/@aws-sdk/util-endpoints/package.json +2 -1
  24. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  25. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +20 -20
  26. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +80 -6
  27. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +20 -20
  28. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js +10 -0
  29. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js +10 -0
  30. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js +10 -0
  31. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/NormalizedSchema.js +10 -0
  32. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js +10 -0
  33. package/node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js +10 -0
  34. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +1 -1
  35. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/ErrorSchema.d.ts +3 -0
  36. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/ListSchema.d.ts +3 -0
  37. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/MapSchema.d.ts +3 -0
  38. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/NormalizedSchema.d.ts +3 -0
  39. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/SimpleSchema.d.ts +3 -0
  40. package/node_modules/@smithy/core/dist-types/submodules/schema/schemas/StructureSchema.d.ts +3 -0
  41. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpBindingProtocol.d.ts +1 -1
  42. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/ErrorSchema.d.ts +3 -0
  43. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/ListSchema.d.ts +3 -0
  44. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/MapSchema.d.ts +3 -0
  45. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/NormalizedSchema.d.ts +3 -0
  46. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/SimpleSchema.d.ts +3 -0
  47. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/schemas/StructureSchema.d.ts +3 -0
  48. package/node_modules/@smithy/core/package.json +2 -2
  49. package/node_modules/@smithy/fetch-http-handler/dist-cjs/index.js +2 -2
  50. package/node_modules/@smithy/fetch-http-handler/dist-es/fetch-http-handler.js +4 -4
  51. package/node_modules/@smithy/fetch-http-handler/dist-types/fetch-http-handler.d.ts +1 -1
  52. package/node_modules/@smithy/fetch-http-handler/dist-types/ts3.4/fetch-http-handler.d.ts +1 -1
  53. package/node_modules/@smithy/fetch-http-handler/package.json +1 -1
  54. package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +5 -2
  55. package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/createConfigValueProvider.js +3 -0
  56. package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js +1 -1
  57. package/node_modules/@smithy/middleware-endpoint/dist-es/endpointMiddleware.js +1 -1
  58. package/node_modules/@smithy/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts +5 -2
  59. package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts +5 -2
  60. package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
  61. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  62. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +11 -9
  63. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +4 -3
  64. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +7 -6
  65. package/node_modules/@smithy/node-http-handler/dist-types/node-http-handler.d.ts +1 -1
  66. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +1 -1
  67. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http-handler.d.ts +1 -1
  68. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/node-http2-handler.d.ts +1 -1
  69. package/node_modules/@smithy/node-http-handler/package.json +1 -1
  70. package/node_modules/@smithy/smithy-client/package.json +4 -4
  71. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  72. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  73. package/node_modules/@smithy/util-stream/package.json +3 -3
  74. package/node_modules/fast-xml-parser/CHANGELOG.md +77 -0
  75. package/node_modules/fast-xml-parser/README.md +39 -52
  76. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  77. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  78. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  79. package/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
  80. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  81. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  82. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  83. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  84. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  85. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  86. package/node_modules/fast-xml-parser/package.json +36 -20
  87. package/node_modules/fast-xml-parser/src/cli/cli.js +16 -12
  88. package/node_modules/fast-xml-parser/src/cli/man.js +6 -1
  89. package/node_modules/fast-xml-parser/src/cli/read.js +30 -79
  90. package/node_modules/fast-xml-parser/src/fxp.d.ts +52 -9
  91. package/node_modules/fast-xml-parser/src/fxp.js +11 -8
  92. package/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
  93. package/node_modules/fast-xml-parser/src/util.js +14 -18
  94. package/node_modules/fast-xml-parser/src/{v5 → v6}/CharsSymbol.js +1 -1
  95. package/node_modules/fast-xml-parser/src/{v5/valueParsers → v6}/EntitiesParser.js +3 -6
  96. package/node_modules/fast-xml-parser/src/{v5 → v6}/OptionsBuilder.js +3 -6
  97. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/BaseOutputBuilder.js +1 -3
  98. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsArrBuilder.js +3 -3
  99. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsMinArrBuilder.js +3 -5
  100. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsObjBuilder.js +3 -5
  101. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/ParserOptionsBuilder.js +6 -11
  102. package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPath.js +1 -1
  103. package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPathMatcher.js +3 -5
  104. package/node_modules/fast-xml-parser/src/{v5 → v6}/XMLParser.js +3 -5
  105. package/node_modules/fast-xml-parser/src/{v5 → v6}/Xml2JsParser.js +8 -10
  106. package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlPartReader.js +24 -26
  107. package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlSpecialTagsReader.js +5 -12
  108. package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/BufferSource.js +1 -3
  109. package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/StringSource.js +1 -3
  110. package/node_modules/fast-xml-parser/src/{v5 → v6/valueParsers}/EntitiesParser.js +3 -5
  111. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParser.js +1 -2
  112. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParserExt.js +1 -2
  113. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/currency.js +1 -3
  114. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/join.js +1 -2
  115. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/number.js +2 -4
  116. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/trim.js +1 -3
  117. package/node_modules/fast-xml-parser/src/validator.js +5 -5
  118. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +17 -13
  119. package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +1 -2
  120. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +288 -71
  121. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +3 -5
  122. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +28 -23
  123. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -8
  124. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +8 -2
  125. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +22 -7
  126. package/node_modules/strnum/.github/SECURITY.md +5 -0
  127. package/node_modules/strnum/CHANGELOG.md +11 -0
  128. package/node_modules/strnum/algo.stflow +84 -0
  129. package/node_modules/strnum/package.json +2 -1
  130. package/node_modules/strnum/strnum.js +53 -35
  131. package/node_modules/strnum/strnum.test.js +9 -1
  132. package/node_modules/strnum/test.js +9 -0
  133. package/package.json +4 -4
  134. /package/node_modules/fast-xml-parser/src/{v5 → v6}/Report.js +0 -0
@@ -0,0 +1,35 @@
1
+ import {
2
+ Endpoint,
3
+ EndpointParameters,
4
+ EndpointV2,
5
+ Logger,
6
+ Provider,
7
+ } from "@smithy/types";
8
+ export type DefaultAwsRegionalEndpointsInputConfig = {
9
+ endpoint?: unknown;
10
+ };
11
+ type PreviouslyResolved = {
12
+ logger?: Logger;
13
+ region?: undefined | string | Provider<string | undefined>;
14
+ useFipsEndpoint?: undefined | boolean | Provider<string | boolean>;
15
+ useDualstackEndpoint?: undefined | boolean | Provider<string | boolean>;
16
+ endpointProvider: (
17
+ endpointParams: EndpointParameters | DefaultRegionalEndpointParameters,
18
+ context?: {
19
+ logger?: Logger;
20
+ }
21
+ ) => EndpointV2;
22
+ };
23
+ type DefaultRegionalEndpointParameters = {
24
+ Region?: string | undefined;
25
+ UseDualStack?: boolean | undefined;
26
+ UseFIPS?: boolean | undefined;
27
+ };
28
+ export interface DefaultAwsRegionalEndpointsResolvedConfig {
29
+ endpoint: Provider<Endpoint>;
30
+ }
31
+ export declare const resolveDefaultAwsRegionalEndpointsConfig: <T>(
32
+ input: T & DefaultAwsRegionalEndpointsInputConfig & PreviouslyResolved
33
+ ) => T & DefaultAwsRegionalEndpointsResolvedConfig;
34
+ export declare const toEndpointV1: (endpoint: EndpointV2) => Endpoint;
35
+ export {};
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-endpoints",
3
- "version": "3.840.0",
3
+ "version": "3.844.0",
4
4
  "description": "Utilities to help with endpoint resolution",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -26,6 +26,7 @@
26
26
  "dependencies": {
27
27
  "@aws-sdk/types": "3.840.0",
28
28
  "@smithy/types": "^4.3.1",
29
+ "@smithy/url-parser": "^4.0.4",
29
30
  "@smithy/util-endpoints": "^3.0.6",
30
31
  "tslib": "^2.6.2"
31
32
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-sdk/util-user-agent-node",
3
- "version": "3.840.0",
3
+ "version": "3.844.0",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
6
  "build:cjs": "node ../../scripts/compilation/inline util-user-agent-node",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "license": "Apache-2.0",
23
23
  "dependencies": {
24
- "@aws-sdk/middleware-user-agent": "3.840.0",
24
+ "@aws-sdk/middleware-user-agent": "3.844.0",
25
25
  "@aws-sdk/types": "3.840.0",
26
26
  "@smithy/node-config-provider": "^4.1.3",
27
27
  "@smithy/types": "^4.3.1",
@@ -225,7 +225,10 @@ var HttpProtocol = class {
225
225
 
226
226
  // src/submodules/protocols/HttpBindingProtocol.ts
227
227
  var HttpBindingProtocol = class extends HttpProtocol {
228
- async serializeRequest(operationSchema, input, context) {
228
+ async serializeRequest(operationSchema, _input, context) {
229
+ const input = {
230
+ ..._input ?? {}
231
+ };
229
232
  const serializer = this.serializer;
230
233
  const query = {};
231
234
  const headers = {};
@@ -260,16 +263,12 @@ var HttpBindingProtocol = class extends HttpProtocol {
260
263
  Object.assign(query, Object.fromEntries(traitSearchParams));
261
264
  }
262
265
  }
263
- const _input = {
264
- ...input
265
- };
266
- for (const memberName of Object.keys(_input)) {
267
- const memberNs = ns.getMemberSchema(memberName);
268
- if (memberNs === void 0) {
266
+ for (const [memberName, memberNs] of ns.structIterator()) {
267
+ const memberTraits = memberNs.getMergedTraits() ?? {};
268
+ const inputMemberValue = input[memberName];
269
+ if (inputMemberValue == null) {
269
270
  continue;
270
271
  }
271
- const memberTraits = memberNs.getMergedTraits();
272
- const inputMember = _input[memberName];
273
272
  if (memberTraits.httpPayload) {
274
273
  const isStreaming = memberNs.isStreaming();
275
274
  if (isStreaming) {
@@ -277,14 +276,15 @@ var HttpBindingProtocol = class extends HttpProtocol {
277
276
  if (isEventStream) {
278
277
  throw new Error("serialization of event streams is not yet implemented");
279
278
  } else {
280
- payload = inputMember;
279
+ payload = inputMemberValue;
281
280
  }
282
281
  } else {
283
- serializer.write(memberNs, inputMember);
282
+ serializer.write(memberNs, inputMemberValue);
284
283
  payload = serializer.flush();
285
284
  }
285
+ delete input[memberName];
286
286
  } else if (memberTraits.httpLabel) {
287
- serializer.write(memberNs, inputMember);
287
+ serializer.write(memberNs, inputMemberValue);
288
288
  const replacement = serializer.flush();
289
289
  if (request.path.includes(`{${memberName}+}`)) {
290
290
  request.path = request.path.replace(
@@ -294,27 +294,27 @@ var HttpBindingProtocol = class extends HttpProtocol {
294
294
  } else if (request.path.includes(`{${memberName}}`)) {
295
295
  request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
296
296
  }
297
- delete _input[memberName];
297
+ delete input[memberName];
298
298
  } else if (memberTraits.httpHeader) {
299
- serializer.write(memberNs, inputMember);
299
+ serializer.write(memberNs, inputMemberValue);
300
300
  headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
301
- delete _input[memberName];
301
+ delete input[memberName];
302
302
  } else if (typeof memberTraits.httpPrefixHeaders === "string") {
303
- for (const [key, val] of Object.entries(inputMember)) {
303
+ for (const [key, val] of Object.entries(inputMemberValue)) {
304
304
  const amalgam = memberTraits.httpPrefixHeaders + key;
305
305
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
306
306
  headers[amalgam.toLowerCase()] = serializer.flush();
307
307
  }
308
- delete _input[memberName];
308
+ delete input[memberName];
309
309
  } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
310
- this.serializeQuery(memberNs, inputMember, query);
311
- delete _input[memberName];
310
+ this.serializeQuery(memberNs, inputMemberValue, query);
311
+ delete input[memberName];
312
312
  } else {
313
313
  hasNonHttpBindingMember = true;
314
314
  }
315
315
  }
316
316
  if (hasNonHttpBindingMember && input) {
317
- serializer.write(schema, _input);
317
+ serializer.write(schema, input);
318
318
  payload = serializer.flush();
319
319
  }
320
320
  request.headers = headers;
@@ -247,12 +247,24 @@ var Schema = class {
247
247
  };
248
248
 
249
249
  // src/submodules/schema/schemas/ListSchema.ts
250
- var ListSchema = class extends Schema {
250
+ var ListSchema = class _ListSchema extends Schema {
251
251
  constructor(name, traits, valueSchema) {
252
252
  super(name, traits);
253
253
  this.name = name;
254
254
  this.traits = traits;
255
255
  this.valueSchema = valueSchema;
256
+ this.symbol = _ListSchema.symbol;
257
+ }
258
+ static {
259
+ this.symbol = Symbol.for("@smithy/core/schema::ListSchema");
260
+ }
261
+ static [Symbol.hasInstance](lhs) {
262
+ const isPrototype = _ListSchema.prototype.isPrototypeOf(lhs);
263
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
264
+ const list2 = lhs;
265
+ return list2.symbol === _ListSchema.symbol;
266
+ }
267
+ return isPrototype;
256
268
  }
257
269
  };
258
270
  function list(namespace, name, traits = {}, valueSchema) {
@@ -266,13 +278,25 @@ function list(namespace, name, traits = {}, valueSchema) {
266
278
  }
267
279
 
268
280
  // src/submodules/schema/schemas/MapSchema.ts
269
- var MapSchema = class extends Schema {
281
+ var MapSchema = class _MapSchema extends Schema {
270
282
  constructor(name, traits, keySchema, valueSchema) {
271
283
  super(name, traits);
272
284
  this.name = name;
273
285
  this.traits = traits;
274
286
  this.keySchema = keySchema;
275
287
  this.valueSchema = valueSchema;
288
+ this.symbol = _MapSchema.symbol;
289
+ }
290
+ static {
291
+ this.symbol = Symbol.for("@smithy/core/schema::MapSchema");
292
+ }
293
+ static [Symbol.hasInstance](lhs) {
294
+ const isPrototype = _MapSchema.prototype.isPrototypeOf(lhs);
295
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
296
+ const map2 = lhs;
297
+ return map2.symbol === _MapSchema.symbol;
298
+ }
299
+ return isPrototype;
276
300
  }
277
301
  };
278
302
  function map(namespace, name, traits = {}, keySchema, valueSchema) {
@@ -303,18 +327,30 @@ function op(namespace, name, traits = {}, input, output) {
303
327
  }
304
328
 
305
329
  // src/submodules/schema/schemas/StructureSchema.ts
306
- var StructureSchema = class extends Schema {
330
+ var StructureSchema = class _StructureSchema extends Schema {
307
331
  constructor(name, traits, memberNames, memberList) {
308
332
  super(name, traits);
309
333
  this.name = name;
310
334
  this.traits = traits;
311
335
  this.memberNames = memberNames;
312
336
  this.memberList = memberList;
337
+ this.symbol = _StructureSchema.symbol;
313
338
  this.members = {};
314
339
  for (let i = 0; i < memberNames.length; ++i) {
315
340
  this.members[memberNames[i]] = Array.isArray(memberList[i]) ? memberList[i] : [memberList[i], 0];
316
341
  }
317
342
  }
343
+ static {
344
+ this.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
345
+ }
346
+ static [Symbol.hasInstance](lhs) {
347
+ const isPrototype = _StructureSchema.prototype.isPrototypeOf(lhs);
348
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
349
+ const struct2 = lhs;
350
+ return struct2.symbol === _StructureSchema.symbol;
351
+ }
352
+ return isPrototype;
353
+ }
318
354
  };
319
355
  function struct(namespace, name, traits, memberNames, memberList) {
320
356
  const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
@@ -323,7 +359,7 @@ function struct(namespace, name, traits, memberNames, memberList) {
323
359
  }
324
360
 
325
361
  // src/submodules/schema/schemas/ErrorSchema.ts
326
- var ErrorSchema = class extends StructureSchema {
362
+ var ErrorSchema = class _ErrorSchema extends StructureSchema {
327
363
  constructor(name, traits, memberNames, memberList, ctor) {
328
364
  super(name, traits, memberNames, memberList);
329
365
  this.name = name;
@@ -331,6 +367,18 @@ var ErrorSchema = class extends StructureSchema {
331
367
  this.memberNames = memberNames;
332
368
  this.memberList = memberList;
333
369
  this.ctor = ctor;
370
+ this.symbol = _ErrorSchema.symbol;
371
+ }
372
+ static {
373
+ this.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
374
+ }
375
+ static [Symbol.hasInstance](lhs) {
376
+ const isPrototype = _ErrorSchema.prototype.isPrototypeOf(lhs);
377
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
378
+ const err = lhs;
379
+ return err.symbol === _ErrorSchema.symbol;
380
+ }
381
+ return isPrototype;
334
382
  }
335
383
  };
336
384
  function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
@@ -372,12 +420,24 @@ var SCHEMA = {
372
420
  };
373
421
 
374
422
  // src/submodules/schema/schemas/SimpleSchema.ts
375
- var SimpleSchema = class extends Schema {
423
+ var SimpleSchema = class _SimpleSchema extends Schema {
376
424
  constructor(name, schemaRef, traits) {
377
425
  super(name, traits);
378
426
  this.name = name;
379
427
  this.schemaRef = schemaRef;
380
428
  this.traits = traits;
429
+ this.symbol = _SimpleSchema.symbol;
430
+ }
431
+ static {
432
+ this.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
433
+ }
434
+ static [Symbol.hasInstance](lhs) {
435
+ const isPrototype = _SimpleSchema.prototype.isPrototypeOf(lhs);
436
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
437
+ const sim2 = lhs;
438
+ return sim2.symbol === _SimpleSchema.symbol;
439
+ }
440
+ return isPrototype;
381
441
  }
382
442
  };
383
443
  function sim(namespace, name, schemaRef, traits) {
@@ -395,6 +455,7 @@ var NormalizedSchema = class _NormalizedSchema {
395
455
  constructor(ref, memberName) {
396
456
  this.ref = ref;
397
457
  this.memberName = memberName;
458
+ this.symbol = _NormalizedSchema.symbol;
398
459
  const traitStack = [];
399
460
  let _ref = ref;
400
461
  let schema = ref;
@@ -434,10 +495,23 @@ var NormalizedSchema = class _NormalizedSchema {
434
495
  this.name = (typeof this.schema === "object" ? this.schema?.name : void 0) ?? this.memberName ?? this.getSchemaName();
435
496
  if (this._isMemberSchema && !memberName) {
436
497
  throw new Error(
437
- `@smithy/core/schema - NormalizedSchema member schema ${this.getName(true)} must initialize with memberName argument.`
498
+ `@smithy/core/schema - NormalizedSchema member schema ${this.getName(
499
+ true
500
+ )} must initialize with memberName argument.`
438
501
  );
439
502
  }
440
503
  }
504
+ static {
505
+ this.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
506
+ }
507
+ static [Symbol.hasInstance](lhs) {
508
+ const isPrototype = _NormalizedSchema.prototype.isPrototypeOf(lhs);
509
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
510
+ const ns = lhs;
511
+ return ns.symbol === _NormalizedSchema.symbol;
512
+ }
513
+ return isPrototype;
514
+ }
441
515
  /**
442
516
  * Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
443
517
  */
@@ -4,7 +4,10 @@ import { collectBody } from "./collect-stream-body";
4
4
  import { extendedEncodeURIComponent } from "./extended-encode-uri-component";
5
5
  import { HttpProtocol } from "./HttpProtocol";
6
6
  export class HttpBindingProtocol extends HttpProtocol {
7
- async serializeRequest(operationSchema, input, context) {
7
+ async serializeRequest(operationSchema, _input, context) {
8
+ const input = {
9
+ ...(_input ?? {}),
10
+ };
8
11
  const serializer = this.serializer;
9
12
  const query = {};
10
13
  const headers = {};
@@ -40,16 +43,12 @@ export class HttpBindingProtocol extends HttpProtocol {
40
43
  Object.assign(query, Object.fromEntries(traitSearchParams));
41
44
  }
42
45
  }
43
- const _input = {
44
- ...input,
45
- };
46
- for (const memberName of Object.keys(_input)) {
47
- const memberNs = ns.getMemberSchema(memberName);
48
- if (memberNs === undefined) {
46
+ for (const [memberName, memberNs] of ns.structIterator()) {
47
+ const memberTraits = memberNs.getMergedTraits() ?? {};
48
+ const inputMemberValue = input[memberName];
49
+ if (inputMemberValue == null) {
49
50
  continue;
50
51
  }
51
- const memberTraits = memberNs.getMergedTraits();
52
- const inputMember = _input[memberName];
53
52
  if (memberTraits.httpPayload) {
54
53
  const isStreaming = memberNs.isStreaming();
55
54
  if (isStreaming) {
@@ -58,16 +57,17 @@ export class HttpBindingProtocol extends HttpProtocol {
58
57
  throw new Error("serialization of event streams is not yet implemented");
59
58
  }
60
59
  else {
61
- payload = inputMember;
60
+ payload = inputMemberValue;
62
61
  }
63
62
  }
64
63
  else {
65
- serializer.write(memberNs, inputMember);
64
+ serializer.write(memberNs, inputMemberValue);
66
65
  payload = serializer.flush();
67
66
  }
67
+ delete input[memberName];
68
68
  }
69
69
  else if (memberTraits.httpLabel) {
70
- serializer.write(memberNs, inputMember);
70
+ serializer.write(memberNs, inputMemberValue);
71
71
  const replacement = serializer.flush();
72
72
  if (request.path.includes(`{${memberName}+}`)) {
73
73
  request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent).join("/"));
@@ -75,31 +75,31 @@ export class HttpBindingProtocol extends HttpProtocol {
75
75
  else if (request.path.includes(`{${memberName}}`)) {
76
76
  request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent(replacement));
77
77
  }
78
- delete _input[memberName];
78
+ delete input[memberName];
79
79
  }
80
80
  else if (memberTraits.httpHeader) {
81
- serializer.write(memberNs, inputMember);
81
+ serializer.write(memberNs, inputMemberValue);
82
82
  headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
83
- delete _input[memberName];
83
+ delete input[memberName];
84
84
  }
85
85
  else if (typeof memberTraits.httpPrefixHeaders === "string") {
86
- for (const [key, val] of Object.entries(inputMember)) {
86
+ for (const [key, val] of Object.entries(inputMemberValue)) {
87
87
  const amalgam = memberTraits.httpPrefixHeaders + key;
88
88
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val);
89
89
  headers[amalgam.toLowerCase()] = serializer.flush();
90
90
  }
91
- delete _input[memberName];
91
+ delete input[memberName];
92
92
  }
93
93
  else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
94
- this.serializeQuery(memberNs, inputMember, query);
95
- delete _input[memberName];
94
+ this.serializeQuery(memberNs, inputMemberValue, query);
95
+ delete input[memberName];
96
96
  }
97
97
  else {
98
98
  hasNonHttpBindingMember = true;
99
99
  }
100
100
  }
101
101
  if (hasNonHttpBindingMember && input) {
102
- serializer.write(schema, _input);
102
+ serializer.write(schema, input);
103
103
  payload = serializer.flush();
104
104
  }
105
105
  request.headers = headers;
@@ -8,8 +8,18 @@ export class ErrorSchema extends StructureSchema {
8
8
  this.memberNames = memberNames;
9
9
  this.memberList = memberList;
10
10
  this.ctor = ctor;
11
+ this.symbol = ErrorSchema.symbol;
12
+ }
13
+ static [Symbol.hasInstance](lhs) {
14
+ const isPrototype = ErrorSchema.prototype.isPrototypeOf(lhs);
15
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
16
+ const err = lhs;
17
+ return err.symbol === ErrorSchema.symbol;
18
+ }
19
+ return isPrototype;
11
20
  }
12
21
  }
22
+ ErrorSchema.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
13
23
  export function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
14
24
  const schema = new ErrorSchema(namespace + "#" + name, traits, memberNames, memberList, ctor);
15
25
  TypeRegistry.for(namespace).register(name, schema);
@@ -6,8 +6,18 @@ export class ListSchema extends Schema {
6
6
  this.name = name;
7
7
  this.traits = traits;
8
8
  this.valueSchema = valueSchema;
9
+ this.symbol = ListSchema.symbol;
10
+ }
11
+ static [Symbol.hasInstance](lhs) {
12
+ const isPrototype = ListSchema.prototype.isPrototypeOf(lhs);
13
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
14
+ const list = lhs;
15
+ return list.symbol === ListSchema.symbol;
16
+ }
17
+ return isPrototype;
9
18
  }
10
19
  }
20
+ ListSchema.symbol = Symbol.for("@smithy/core/schema::ListSchema");
11
21
  export function list(namespace, name, traits = {}, valueSchema) {
12
22
  const schema = new ListSchema(namespace + "#" + name, traits, typeof valueSchema === "function" ? valueSchema() : valueSchema);
13
23
  TypeRegistry.for(namespace).register(name, schema);
@@ -7,8 +7,18 @@ export class MapSchema extends Schema {
7
7
  this.traits = traits;
8
8
  this.keySchema = keySchema;
9
9
  this.valueSchema = valueSchema;
10
+ this.symbol = MapSchema.symbol;
11
+ }
12
+ static [Symbol.hasInstance](lhs) {
13
+ const isPrototype = MapSchema.prototype.isPrototypeOf(lhs);
14
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
15
+ const map = lhs;
16
+ return map.symbol === MapSchema.symbol;
17
+ }
18
+ return isPrototype;
10
19
  }
11
20
  }
21
+ MapSchema.symbol = Symbol.for("@smithy/core/schema::MapSchema");
12
22
  export function map(namespace, name, traits = {}, keySchema, valueSchema) {
13
23
  const schema = new MapSchema(namespace + "#" + name, traits, keySchema, typeof valueSchema === "function" ? valueSchema() : valueSchema);
14
24
  TypeRegistry.for(namespace).register(name, schema);
@@ -8,6 +8,7 @@ export class NormalizedSchema {
8
8
  constructor(ref, memberName) {
9
9
  this.ref = ref;
10
10
  this.memberName = memberName;
11
+ this.symbol = NormalizedSchema.symbol;
11
12
  const traitStack = [];
12
13
  let _ref = ref;
13
14
  let schema = ref;
@@ -52,6 +53,14 @@ export class NormalizedSchema {
52
53
  throw new Error(`@smithy/core/schema - NormalizedSchema member schema ${this.getName(true)} must initialize with memberName argument.`);
53
54
  }
54
55
  }
56
+ static [Symbol.hasInstance](lhs) {
57
+ const isPrototype = NormalizedSchema.prototype.isPrototypeOf(lhs);
58
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
59
+ const ns = lhs;
60
+ return ns.symbol === NormalizedSchema.symbol;
61
+ }
62
+ return isPrototype;
63
+ }
55
64
  static of(ref, memberName) {
56
65
  if (ref instanceof NormalizedSchema) {
57
66
  return ref;
@@ -292,3 +301,4 @@ export class NormalizedSchema {
292
301
  return "Unknown";
293
302
  }
294
303
  }
304
+ NormalizedSchema.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
@@ -6,8 +6,18 @@ export class SimpleSchema extends Schema {
6
6
  this.name = name;
7
7
  this.schemaRef = schemaRef;
8
8
  this.traits = traits;
9
+ this.symbol = SimpleSchema.symbol;
10
+ }
11
+ static [Symbol.hasInstance](lhs) {
12
+ const isPrototype = SimpleSchema.prototype.isPrototypeOf(lhs);
13
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
14
+ const sim = lhs;
15
+ return sim.symbol === SimpleSchema.symbol;
16
+ }
17
+ return isPrototype;
9
18
  }
10
19
  }
20
+ SimpleSchema.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
11
21
  export function sim(namespace, name, schemaRef, traits) {
12
22
  const schema = new SimpleSchema(namespace + "#" + name, schemaRef, traits);
13
23
  TypeRegistry.for(namespace).register(name, schema);
@@ -7,6 +7,7 @@ export class StructureSchema extends Schema {
7
7
  this.traits = traits;
8
8
  this.memberNames = memberNames;
9
9
  this.memberList = memberList;
10
+ this.symbol = StructureSchema.symbol;
10
11
  this.members = {};
11
12
  for (let i = 0; i < memberNames.length; ++i) {
12
13
  this.members[memberNames[i]] = Array.isArray(memberList[i])
@@ -14,7 +15,16 @@ export class StructureSchema extends Schema {
14
15
  : [memberList[i], 0];
15
16
  }
16
17
  }
18
+ static [Symbol.hasInstance](lhs) {
19
+ const isPrototype = StructureSchema.prototype.isPrototypeOf(lhs);
20
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
21
+ const struct = lhs;
22
+ return struct.symbol === StructureSchema.symbol;
23
+ }
24
+ return isPrototype;
25
+ }
17
26
  }
27
+ StructureSchema.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
18
28
  export function struct(namespace, name, traits, memberNames, memberList) {
19
29
  const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
20
30
  TypeRegistry.for(namespace).register(name, schema);
@@ -9,7 +9,7 @@ import { HttpProtocol } from "./HttpProtocol";
9
9
  * @alpha
10
10
  */
11
11
  export declare abstract class HttpBindingProtocol extends HttpProtocol {
12
- serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
12
+ serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
13
13
  protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
14
14
  deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
15
15
  }
@@ -17,11 +17,14 @@ export declare class ErrorSchema extends StructureSchema {
17
17
  * Constructor for a modeled service exception class that extends Error.
18
18
  */
19
19
  ctor: any;
20
+ static symbol: symbol;
21
+ protected symbol: symbol;
20
22
  constructor(name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[],
21
23
  /**
22
24
  * Constructor for a modeled service exception class that extends Error.
23
25
  */
24
26
  ctor: any);
27
+ static [Symbol.hasInstance](lhs: unknown): lhs is ErrorSchema;
25
28
  }
26
29
  /**
27
30
  * Factory for ErrorSchema, to reduce codegen output and register the schema.
@@ -10,7 +10,10 @@ export declare class ListSchema extends Schema implements IListSchema {
10
10
  name: string;
11
11
  traits: SchemaTraits;
12
12
  valueSchema: SchemaRef;
13
+ static symbol: symbol;
14
+ protected symbol: symbol;
13
15
  constructor(name: string, traits: SchemaTraits, valueSchema: SchemaRef);
16
+ static [Symbol.hasInstance](lhs: unknown): lhs is ListSchema;
14
17
  }
15
18
  /**
16
19
  * Factory for ListSchema.
@@ -12,11 +12,14 @@ export declare class MapSchema extends Schema implements IMapSchema {
12
12
  */
13
13
  keySchema: SchemaRef;
14
14
  valueSchema: SchemaRef;
15
+ static symbol: symbol;
16
+ protected symbol: symbol;
15
17
  constructor(name: string, traits: SchemaTraits,
16
18
  /**
17
19
  * This is expected to be StringSchema, but may have traits.
18
20
  */
19
21
  keySchema: SchemaRef, valueSchema: SchemaRef);
22
+ static [Symbol.hasInstance](lhs: unknown): lhs is MapSchema;
20
23
  }
21
24
  /**
22
25
  * Factory for MapSchema.
@@ -8,6 +8,8 @@ import type { MemberSchema, NormalizedSchema as INormalizedSchema, Schema as ISc
8
8
  export declare class NormalizedSchema implements INormalizedSchema {
9
9
  private readonly ref;
10
10
  private memberName?;
11
+ static symbol: symbol;
12
+ protected symbol: symbol;
11
13
  private readonly name;
12
14
  private readonly traits;
13
15
  private _isMemberSchema;
@@ -19,6 +21,7 @@ export declare class NormalizedSchema implements INormalizedSchema {
19
21
  * @param memberName - optional memberName if this NormalizedSchema should be considered a member schema.
20
22
  */
21
23
  constructor(ref: SchemaRef, memberName?: string | undefined);
24
+ static [Symbol.hasInstance](lhs: unknown): lhs is NormalizedSchema;
22
25
  /**
23
26
  * Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
24
27
  */
@@ -10,7 +10,10 @@ export declare class SimpleSchema extends Schema implements TraitsSchema {
10
10
  name: string;
11
11
  schemaRef: SchemaRef;
12
12
  traits: SchemaTraits;
13
+ static symbol: symbol;
14
+ protected symbol: symbol;
13
15
  constructor(name: string, schemaRef: SchemaRef, traits: SchemaTraits);
16
+ static [Symbol.hasInstance](lhs: unknown): lhs is SimpleSchema;
14
17
  }
15
18
  /**
16
19
  * Factory for simple schema class objects.
@@ -10,8 +10,11 @@ export declare class StructureSchema extends Schema implements IStructureSchema
10
10
  traits: SchemaTraits;
11
11
  memberNames: string[];
12
12
  memberList: SchemaRef[];
13
+ static symbol: symbol;
14
+ protected symbol: symbol;
13
15
  members: Record<string, [SchemaRef, SchemaTraits]>;
14
16
  constructor(name: string, traits: SchemaTraits, memberNames: string[], memberList: SchemaRef[]);
17
+ static [Symbol.hasInstance](lhs: unknown): lhs is StructureSchema;
15
18
  }
16
19
  /**
17
20
  * Factory for StructureSchema.
@@ -9,7 +9,7 @@ import { HttpProtocol } from "./HttpProtocol";
9
9
  * @alpha
10
10
  */
11
11
  export declare abstract class HttpBindingProtocol extends HttpProtocol {
12
- serializeRequest<Input extends object>(operationSchema: OperationSchema, input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
12
+ serializeRequest<Input extends object>(operationSchema: OperationSchema, _input: Input, context: HandlerExecutionContext & SerdeFunctions & EndpointBearer): Promise<IHttpRequest>;
13
13
  protected serializeQuery(ns: NormalizedSchema, data: any, query: HttpRequest["query"]): void;
14
14
  deserializeResponse<Output extends MetadataBearer>(operationSchema: OperationSchema, context: HandlerExecutionContext & SerdeFunctions, response: IHttpResponse): Promise<Output>;
15
15
  }