@justworkflowit/cdk-constructs 0.0.47 → 0.0.48

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.
@@ -2199,7 +2199,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2199
2199
  this.config?.httpAgent?.destroy();
2200
2200
  this.config?.httpsAgent?.destroy();
2201
2201
  }
2202
- async handle(request, { abortSignal } = {}) {
2202
+ async handle(request, { abortSignal, requestTimeout } = {}) {
2203
2203
  if (!this.config) {
2204
2204
  this.config = await this.configProvider;
2205
2205
  }
@@ -2300,8 +2300,9 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2300
2300
  abortSignal.onabort = onAbort;
2301
2301
  }
2302
2302
  }
2303
+ const effectiveRequestTimeout = requestTimeout ?? this.config.requestTimeout;
2303
2304
  timeouts.push(setConnectionTimeout(req, reject, this.config.connectionTimeout));
2304
- timeouts.push(setSocketTimeout(req, reject, this.config.requestTimeout));
2305
+ timeouts.push(setSocketTimeout(req, reject, effectiveRequestTimeout));
2305
2306
  const httpAgent = nodeHttpsOptions.agent;
2306
2307
  if (typeof httpAgent === "object" && "keepAlive" in httpAgent) {
2307
2308
  timeouts.push(
@@ -2313,7 +2314,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2313
2314
  })
2314
2315
  );
2315
2316
  }
2316
- writeRequestBodyPromise = writeRequestBody(req, request, this.config.requestTimeout).catch((e3) => {
2317
+ writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout).catch((e3) => {
2317
2318
  timeouts.forEach(timing.clearTimeout);
2318
2319
  return _reject(e3);
2319
2320
  });
@@ -2490,7 +2491,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2490
2491
  destroy() {
2491
2492
  this.connectionManager.destroy();
2492
2493
  }
2493
- async handle(request, { abortSignal } = {}) {
2494
+ async handle(request, { abortSignal, requestTimeout } = {}) {
2494
2495
  if (!this.config) {
2495
2496
  this.config = await this.configProvider;
2496
2497
  this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false);
@@ -2498,7 +2499,8 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2498
2499
  this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams);
2499
2500
  }
2500
2501
  }
2501
- const { requestTimeout, disableConcurrentStreams } = this.config;
2502
+ const { requestTimeout: configRequestTimeout, disableConcurrentStreams } = this.config;
2503
+ const effectiveRequestTimeout = requestTimeout ?? configRequestTimeout;
2502
2504
  return new Promise((_resolve, _reject) => {
2503
2505
  let fulfilled = false;
2504
2506
  let writeRequestBodyPromise = void 0;
@@ -2564,10 +2566,10 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2564
2566
  this.connectionManager.deleteSession(authority, session);
2565
2567
  }
2566
2568
  });
2567
- if (requestTimeout) {
2568
- req.setTimeout(requestTimeout, () => {
2569
+ if (effectiveRequestTimeout) {
2570
+ req.setTimeout(effectiveRequestTimeout, () => {
2569
2571
  req.close();
2570
- const timeoutError = new Error(`Stream timed out because of no activity for ${requestTimeout} ms`);
2572
+ const timeoutError = new Error(`Stream timed out because of no activity for ${effectiveRequestTimeout} ms`);
2571
2573
  timeoutError.name = "TimeoutError";
2572
2574
  rejectWithDestroy(timeoutError);
2573
2575
  });
@@ -2605,7 +2607,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
2605
2607
  rejectWithDestroy(new Error("Unexpected error: http2 request did not get a response"));
2606
2608
  }
2607
2609
  });
2608
- writeRequestBodyPromise = writeRequestBody(req, request, requestTimeout);
2610
+ writeRequestBodyPromise = writeRequestBody(req, request, effectiveRequestTimeout);
2609
2611
  });
2610
2612
  }
2611
2613
  updateHttpClientConfig(key, value) {
@@ -2765,11 +2767,11 @@ var require_dist_cjs13 = __commonJS({
2765
2767
  }
2766
2768
  destroy() {
2767
2769
  }
2768
- async handle(request, { abortSignal } = {}) {
2770
+ async handle(request, { abortSignal, requestTimeout: requestTimeout2 } = {}) {
2769
2771
  if (!this.config) {
2770
2772
  this.config = await this.configProvider;
2771
2773
  }
2772
- const requestTimeoutInMs = this.config.requestTimeout;
2774
+ const requestTimeoutInMs = requestTimeout2 ?? this.config.requestTimeout;
2773
2775
  const keepAlive = this.config.keepAlive === true;
2774
2776
  const credentials = this.config.credentials;
2775
2777
  if (abortSignal?.aborted) {
@@ -3394,14 +3396,24 @@ var init_ListSchema = __esm({
3394
3396
  "../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ListSchema.js"() {
3395
3397
  init_TypeRegistry();
3396
3398
  init_Schema();
3397
- ListSchema = class extends Schema {
3399
+ ListSchema = class _ListSchema extends Schema {
3398
3400
  constructor(name, traits, valueSchema) {
3399
3401
  super(name, traits);
3400
3402
  this.name = name;
3401
3403
  this.traits = traits;
3402
3404
  this.valueSchema = valueSchema;
3405
+ this.symbol = _ListSchema.symbol;
3406
+ }
3407
+ static [Symbol.hasInstance](lhs) {
3408
+ const isPrototype = _ListSchema.prototype.isPrototypeOf(lhs);
3409
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
3410
+ const list = lhs;
3411
+ return list.symbol === _ListSchema.symbol;
3412
+ }
3413
+ return isPrototype;
3403
3414
  }
3404
3415
  };
3416
+ ListSchema.symbol = Symbol.for("@smithy/core/schema::ListSchema");
3405
3417
  }
3406
3418
  });
3407
3419
 
@@ -3411,15 +3423,25 @@ var init_MapSchema = __esm({
3411
3423
  "../node_modules/@smithy/core/dist-es/submodules/schema/schemas/MapSchema.js"() {
3412
3424
  init_TypeRegistry();
3413
3425
  init_Schema();
3414
- MapSchema = class extends Schema {
3426
+ MapSchema = class _MapSchema extends Schema {
3415
3427
  constructor(name, traits, keySchema, valueSchema) {
3416
3428
  super(name, traits);
3417
3429
  this.name = name;
3418
3430
  this.traits = traits;
3419
3431
  this.keySchema = keySchema;
3420
3432
  this.valueSchema = valueSchema;
3433
+ this.symbol = _MapSchema.symbol;
3434
+ }
3435
+ static [Symbol.hasInstance](lhs) {
3436
+ const isPrototype = _MapSchema.prototype.isPrototypeOf(lhs);
3437
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
3438
+ const map2 = lhs;
3439
+ return map2.symbol === _MapSchema.symbol;
3440
+ }
3441
+ return isPrototype;
3421
3442
  }
3422
3443
  };
3444
+ MapSchema.symbol = Symbol.for("@smithy/core/schema::MapSchema");
3423
3445
  }
3424
3446
  });
3425
3447
 
@@ -3437,27 +3459,58 @@ var init_StructureSchema = __esm({
3437
3459
  "../node_modules/@smithy/core/dist-es/submodules/schema/schemas/StructureSchema.js"() {
3438
3460
  init_TypeRegistry();
3439
3461
  init_Schema();
3440
- StructureSchema = class extends Schema {
3462
+ StructureSchema = class _StructureSchema extends Schema {
3441
3463
  constructor(name, traits, memberNames, memberList) {
3442
3464
  super(name, traits);
3443
3465
  this.name = name;
3444
3466
  this.traits = traits;
3445
3467
  this.memberNames = memberNames;
3446
3468
  this.memberList = memberList;
3469
+ this.symbol = _StructureSchema.symbol;
3447
3470
  this.members = {};
3448
3471
  for (let i3 = 0; i3 < memberNames.length; ++i3) {
3449
3472
  this.members[memberNames[i3]] = Array.isArray(memberList[i3]) ? memberList[i3] : [memberList[i3], 0];
3450
3473
  }
3451
3474
  }
3475
+ static [Symbol.hasInstance](lhs) {
3476
+ const isPrototype = _StructureSchema.prototype.isPrototypeOf(lhs);
3477
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
3478
+ const struct = lhs;
3479
+ return struct.symbol === _StructureSchema.symbol;
3480
+ }
3481
+ return isPrototype;
3482
+ }
3452
3483
  };
3484
+ StructureSchema.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
3453
3485
  }
3454
3486
  });
3455
3487
 
3456
3488
  // ../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js
3489
+ var ErrorSchema;
3457
3490
  var init_ErrorSchema = __esm({
3458
3491
  "../node_modules/@smithy/core/dist-es/submodules/schema/schemas/ErrorSchema.js"() {
3459
3492
  init_TypeRegistry();
3460
3493
  init_StructureSchema();
3494
+ ErrorSchema = class _ErrorSchema extends StructureSchema {
3495
+ constructor(name, traits, memberNames, memberList, ctor) {
3496
+ super(name, traits, memberNames, memberList);
3497
+ this.name = name;
3498
+ this.traits = traits;
3499
+ this.memberNames = memberNames;
3500
+ this.memberList = memberList;
3501
+ this.ctor = ctor;
3502
+ this.symbol = _ErrorSchema.symbol;
3503
+ }
3504
+ static [Symbol.hasInstance](lhs) {
3505
+ const isPrototype = _ErrorSchema.prototype.isPrototypeOf(lhs);
3506
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
3507
+ const err = lhs;
3508
+ return err.symbol === _ErrorSchema.symbol;
3509
+ }
3510
+ return isPrototype;
3511
+ }
3512
+ };
3513
+ ErrorSchema.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
3461
3514
  }
3462
3515
  });
3463
3516
 
@@ -3490,14 +3543,24 @@ var init_SimpleSchema = __esm({
3490
3543
  "../node_modules/@smithy/core/dist-es/submodules/schema/schemas/SimpleSchema.js"() {
3491
3544
  init_TypeRegistry();
3492
3545
  init_Schema();
3493
- SimpleSchema = class extends Schema {
3546
+ SimpleSchema = class _SimpleSchema extends Schema {
3494
3547
  constructor(name, schemaRef, traits) {
3495
3548
  super(name, traits);
3496
3549
  this.name = name;
3497
3550
  this.schemaRef = schemaRef;
3498
3551
  this.traits = traits;
3552
+ this.symbol = _SimpleSchema.symbol;
3553
+ }
3554
+ static [Symbol.hasInstance](lhs) {
3555
+ const isPrototype = _SimpleSchema.prototype.isPrototypeOf(lhs);
3556
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
3557
+ const sim = lhs;
3558
+ return sim.symbol === _SimpleSchema.symbol;
3559
+ }
3560
+ return isPrototype;
3499
3561
  }
3500
3562
  };
3563
+ SimpleSchema.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
3501
3564
  }
3502
3565
  });
3503
3566
 
@@ -3515,6 +3578,7 @@ var init_NormalizedSchema = __esm({
3515
3578
  constructor(ref, memberName) {
3516
3579
  this.ref = ref;
3517
3580
  this.memberName = memberName;
3581
+ this.symbol = _NormalizedSchema.symbol;
3518
3582
  const traitStack = [];
3519
3583
  let _ref = ref;
3520
3584
  let schema = ref;
@@ -3556,6 +3620,14 @@ var init_NormalizedSchema = __esm({
3556
3620
  throw new Error(`@smithy/core/schema - NormalizedSchema member schema ${this.getName(true)} must initialize with memberName argument.`);
3557
3621
  }
3558
3622
  }
3623
+ static [Symbol.hasInstance](lhs) {
3624
+ const isPrototype = _NormalizedSchema.prototype.isPrototypeOf(lhs);
3625
+ if (!isPrototype && typeof lhs === "object" && lhs !== null) {
3626
+ const ns = lhs;
3627
+ return ns.symbol === _NormalizedSchema.symbol;
3628
+ }
3629
+ return isPrototype;
3630
+ }
3559
3631
  static of(ref, memberName) {
3560
3632
  if (ref instanceof _NormalizedSchema) {
3561
3633
  return ref;
@@ -3794,6 +3866,7 @@ var init_NormalizedSchema = __esm({
3794
3866
  return "Unknown";
3795
3867
  }
3796
3868
  };
3869
+ NormalizedSchema.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
3797
3870
  }
3798
3871
  });
3799
3872
 
@@ -4691,7 +4764,10 @@ var init_HttpBindingProtocol = __esm({
4691
4764
  init_extended_encode_uri_component();
4692
4765
  init_HttpProtocol();
4693
4766
  HttpBindingProtocol = class extends HttpProtocol {
4694
- async serializeRequest(operationSchema, input, context) {
4767
+ async serializeRequest(operationSchema, _input, context) {
4768
+ const input = {
4769
+ ..._input ?? {}
4770
+ };
4695
4771
  const serializer = this.serializer;
4696
4772
  const query = {};
4697
4773
  const headers = {};
@@ -4726,16 +4802,12 @@ var init_HttpBindingProtocol = __esm({
4726
4802
  Object.assign(query, Object.fromEntries(traitSearchParams));
4727
4803
  }
4728
4804
  }
4729
- const _input = {
4730
- ...input
4731
- };
4732
- for (const memberName of Object.keys(_input)) {
4733
- const memberNs = ns.getMemberSchema(memberName);
4734
- if (memberNs === void 0) {
4805
+ for (const [memberName, memberNs] of ns.structIterator()) {
4806
+ const memberTraits = memberNs.getMergedTraits() ?? {};
4807
+ const inputMemberValue = input[memberName];
4808
+ if (inputMemberValue == null) {
4735
4809
  continue;
4736
4810
  }
4737
- const memberTraits = memberNs.getMergedTraits();
4738
- const inputMember = _input[memberName];
4739
4811
  if (memberTraits.httpPayload) {
4740
4812
  const isStreaming = memberNs.isStreaming();
4741
4813
  if (isStreaming) {
@@ -4743,41 +4815,42 @@ var init_HttpBindingProtocol = __esm({
4743
4815
  if (isEventStream) {
4744
4816
  throw new Error("serialization of event streams is not yet implemented");
4745
4817
  } else {
4746
- payload = inputMember;
4818
+ payload = inputMemberValue;
4747
4819
  }
4748
4820
  } else {
4749
- serializer.write(memberNs, inputMember);
4821
+ serializer.write(memberNs, inputMemberValue);
4750
4822
  payload = serializer.flush();
4751
4823
  }
4824
+ delete input[memberName];
4752
4825
  } else if (memberTraits.httpLabel) {
4753
- serializer.write(memberNs, inputMember);
4826
+ serializer.write(memberNs, inputMemberValue);
4754
4827
  const replacement = serializer.flush();
4755
4828
  if (request.path.includes(`{${memberName}+}`)) {
4756
4829
  request.path = request.path.replace(`{${memberName}+}`, replacement.split("/").map(extendedEncodeURIComponent2).join("/"));
4757
4830
  } else if (request.path.includes(`{${memberName}}`)) {
4758
4831
  request.path = request.path.replace(`{${memberName}}`, extendedEncodeURIComponent2(replacement));
4759
4832
  }
4760
- delete _input[memberName];
4833
+ delete input[memberName];
4761
4834
  } else if (memberTraits.httpHeader) {
4762
- serializer.write(memberNs, inputMember);
4835
+ serializer.write(memberNs, inputMemberValue);
4763
4836
  headers[memberTraits.httpHeader.toLowerCase()] = String(serializer.flush());
4764
- delete _input[memberName];
4837
+ delete input[memberName];
4765
4838
  } else if (typeof memberTraits.httpPrefixHeaders === "string") {
4766
- for (const [key, val2] of Object.entries(inputMember)) {
4839
+ for (const [key, val2] of Object.entries(inputMemberValue)) {
4767
4840
  const amalgam = memberTraits.httpPrefixHeaders + key;
4768
4841
  serializer.write([memberNs.getValueSchema(), { httpHeader: amalgam }], val2);
4769
4842
  headers[amalgam.toLowerCase()] = serializer.flush();
4770
4843
  }
4771
- delete _input[memberName];
4844
+ delete input[memberName];
4772
4845
  } else if (memberTraits.httpQuery || memberTraits.httpQueryParams) {
4773
- this.serializeQuery(memberNs, inputMember, query);
4774
- delete _input[memberName];
4846
+ this.serializeQuery(memberNs, inputMemberValue, query);
4847
+ delete input[memberName];
4775
4848
  } else {
4776
4849
  hasNonHttpBindingMember = true;
4777
4850
  }
4778
4851
  }
4779
4852
  if (hasNonHttpBindingMember && input) {
4780
- serializer.write(schema, _input);
4853
+ serializer.write(schema, input);
4781
4854
  payload = serializer.flush();
4782
4855
  }
4783
4856
  request.headers = headers;
@@ -21600,6 +21673,9 @@ var require_dist_cjs46 = __commonJS({
21600
21673
  }
21601
21674
  if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
21602
21675
  return async () => {
21676
+ if (config.isCustomEndpoint === false) {
21677
+ return void 0;
21678
+ }
21603
21679
  const endpoint2 = await configProvider();
21604
21680
  if (endpoint2 && typeof endpoint2 === "object") {
21605
21681
  if ("url" in endpoint2) {
@@ -21627,7 +21703,7 @@ var require_dist_cjs46 = __commonJS({
21627
21703
  return (0, import_url_parser3.parseUrl)(endpoint2);
21628
21704
  }, "toEndpointV1");
21629
21705
  var getEndpointFromInstructions = /* @__PURE__ */ __name(async (commandInput, instructionsSupplier, clientConfig, context) => {
21630
- if (!clientConfig.endpoint) {
21706
+ if (!clientConfig.isCustomEndpoint) {
21631
21707
  let endpointFromConfig;
21632
21708
  if (clientConfig.serviceConfiguredEndpoint) {
21633
21709
  endpointFromConfig = await clientConfig.serviceConfiguredEndpoint();
@@ -21682,7 +21758,7 @@ var require_dist_cjs46 = __commonJS({
21682
21758
  instructions
21683
21759
  }) => {
21684
21760
  return (next, context) => async (args) => {
21685
- if (config.endpoint) {
21761
+ if (config.isCustomEndpoint) {
21686
21762
  (0, import_core31.setFeature)(context, "ENDPOINT_OVERRIDE", "N");
21687
21763
  }
21688
21764
  const endpoint2 = await getEndpointFromInstructions(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@justworkflowit/cdk-constructs",
3
3
  "description": "",
4
- "version": "0.0.47",
4
+ "version": "0.0.48",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "publishConfig": {