cloudstructs 0.13.0 → 0.13.1

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 (103) hide show
  1. package/.jsii +3 -3
  2. package/assets/ssl-server-test/analyze.lambda/index.js +4 -1
  3. package/assets/toolkit-cleaner/clean.lambda/index.js +4 -1
  4. package/lib/codecommit-mirror/index.js +2 -2
  5. package/lib/dmarc/index.js +1 -1
  6. package/lib/ecs-service-roller/index.js +2 -2
  7. package/lib/email-receiver/receiver.js +1 -1
  8. package/lib/saml-identity-provider/index.js +2 -2
  9. package/lib/slack-app/manifest.js +1 -1
  10. package/lib/slack-app/slack-app.js +2 -2
  11. package/lib/slack-events/index.js +1 -1
  12. package/lib/slack-textract/index.js +1 -1
  13. package/lib/ssl-server-test/index.js +1 -1
  14. package/lib/state-machine-cr-provider/index.js +1 -1
  15. package/lib/static-website/index.js +1 -1
  16. package/lib/toolkit-cleaner/index.js +1 -1
  17. package/lib/url-shortener/index.js +1 -1
  18. package/node_modules/@aws/durable-execution-sdk-js/dist/index.mjs +7 -2
  19. package/node_modules/@aws/durable-execution-sdk-js/dist/index.mjs.map +1 -1
  20. package/node_modules/@aws/durable-execution-sdk-js/dist-cjs/index.js +7 -2
  21. package/node_modules/@aws/durable-execution-sdk-js/dist-cjs/index.js.map +1 -1
  22. package/node_modules/@aws/durable-execution-sdk-js/dist-types/utils/checkpoint/checkpoint-manager.d.ts.map +1 -1
  23. package/node_modules/@aws/durable-execution-sdk-js/package.json +1 -1
  24. package/node_modules/@aws-sdk/client-lambda/package.json +38 -38
  25. package/node_modules/@aws-sdk/core/dist-cjs/index.js +6 -6
  26. package/node_modules/@aws-sdk/core/dist-cjs/submodules/protocols/index.js +6 -6
  27. package/node_modules/@aws-sdk/core/dist-es/submodules/protocols/json/JsonShapeSerializer.js +6 -6
  28. package/node_modules/@aws-sdk/core/dist-types/submodules/protocols/json/JsonShapeSerializer.d.ts +2 -2
  29. package/node_modules/@aws-sdk/core/dist-types/ts3.4/submodules/protocols/json/JsonShapeSerializer.d.ts +1 -1
  30. package/node_modules/@aws-sdk/core/package.json +11 -11
  31. package/node_modules/@aws-sdk/credential-provider-env/package.json +5 -5
  32. package/node_modules/@aws-sdk/credential-provider-http/package.json +10 -10
  33. package/node_modules/@aws-sdk/credential-provider-ini/package.json +14 -14
  34. package/node_modules/@aws-sdk/credential-provider-login/package.json +8 -8
  35. package/node_modules/@aws-sdk/credential-provider-node/package.json +12 -12
  36. package/node_modules/@aws-sdk/credential-provider-process/package.json +6 -6
  37. package/node_modules/@aws-sdk/credential-provider-sso/package.json +8 -8
  38. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +7 -7
  39. package/node_modules/@aws-sdk/middleware-host-header/package.json +4 -4
  40. package/node_modules/@aws-sdk/middleware-logger/package.json +3 -3
  41. package/node_modules/@aws-sdk/middleware-recursion-detection/package.json +4 -4
  42. package/node_modules/@aws-sdk/middleware-user-agent/package.json +8 -8
  43. package/node_modules/@aws-sdk/nested-clients/package.json +32 -32
  44. package/node_modules/@aws-sdk/region-config-resolver/package.json +5 -5
  45. package/node_modules/@aws-sdk/token-providers/package.json +7 -7
  46. package/node_modules/@aws-sdk/types/package.json +2 -2
  47. package/node_modules/@aws-sdk/util-endpoints/package.json +5 -5
  48. package/node_modules/@aws-sdk/util-user-agent-browser/package.json +3 -3
  49. package/node_modules/@aws-sdk/util-user-agent-node/package.json +5 -5
  50. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  51. package/node_modules/@smithy/config-resolver/package.json +5 -5
  52. package/node_modules/@smithy/core/package.json +7 -7
  53. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  54. package/node_modules/@smithy/eventstream-codec/package.json +2 -2
  55. package/node_modules/@smithy/eventstream-serde-browser/package.json +3 -3
  56. package/node_modules/@smithy/eventstream-serde-config-resolver/package.json +2 -2
  57. package/node_modules/@smithy/eventstream-serde-node/package.json +3 -3
  58. package/node_modules/@smithy/eventstream-serde-universal/package.json +3 -3
  59. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  60. package/node_modules/@smithy/hash-node/package.json +2 -2
  61. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  62. package/node_modules/@smithy/middleware-content-length/package.json +3 -3
  63. package/node_modules/@smithy/middleware-endpoint/package.json +8 -8
  64. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  65. package/node_modules/@smithy/middleware-serde/package.json +4 -4
  66. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  67. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  68. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +6 -6
  69. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-connection-manager.js +1 -1
  70. package/node_modules/@smithy/node-http-handler/dist-es/node-http2-handler.js +5 -5
  71. package/node_modules/@smithy/node-http-handler/dist-types/node-http2-handler.d.ts +14 -1
  72. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  73. package/node_modules/@smithy/property-provider/package.json +2 -2
  74. package/node_modules/@smithy/protocol-http/package.json +2 -2
  75. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  76. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  77. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  78. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  79. package/node_modules/@smithy/signature-v4/dist-cjs/index.js +11 -5
  80. package/node_modules/@smithy/signature-v4/dist-es/SignatureV4.js +11 -5
  81. package/node_modules/@smithy/signature-v4/dist-types/SignatureV4.d.ts +3 -3
  82. package/node_modules/@smithy/signature-v4/package.json +4 -4
  83. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +8 -1
  84. package/node_modules/@smithy/smithy-client/dist-es/command.js +8 -1
  85. package/node_modules/@smithy/smithy-client/package.json +7 -7
  86. package/node_modules/@smithy/types/dist-types/connection/config.d.ts +5 -0
  87. package/node_modules/@smithy/types/dist-types/signature.d.ts +20 -3
  88. package/node_modules/@smithy/types/package.json +1 -1
  89. package/node_modules/@smithy/url-parser/package.json +3 -3
  90. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  91. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  92. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +15 -19
  93. package/node_modules/@smithy/util-endpoints/dist-es/decideEndpoint.js +4 -3
  94. package/node_modules/@smithy/util-endpoints/dist-es/lib/getAttr.js +2 -1
  95. package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +8 -13
  96. package/node_modules/@smithy/util-endpoints/dist-es/utils/getEndpointHeaders.js +1 -1
  97. package/node_modules/@smithy/util-endpoints/dist-types/bdd/BinaryDecisionDiagram.d.ts +2 -2
  98. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  99. package/node_modules/@smithy/util-middleware/package.json +2 -2
  100. package/node_modules/@smithy/util-retry/package.json +3 -3
  101. package/node_modules/@smithy/util-stream/package.json +4 -4
  102. package/node_modules/@smithy/util-waiter/package.json +3 -3
  103. package/package.json +15 -15
@@ -134,7 +134,8 @@ const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index) => {
134
134
  throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
135
135
  }
136
136
  else if (Array.isArray(acc)) {
137
- return acc[parseInt(index)];
137
+ const i = parseInt(index);
138
+ return acc[i < 0 ? acc.length + i : i];
138
139
  }
139
140
  return acc[index];
140
141
  }, value);
@@ -346,7 +347,7 @@ const evaluateCondition = ({ assign, ...fnArgs }, options) => {
346
347
  };
347
348
  };
348
349
 
349
- const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
350
+ const getEndpointHeaders = (headers, options) => Object.entries(headers ?? {}).reduce((acc, [headerKey, headerVal]) => ({
350
351
  ...acc,
351
352
  [headerKey]: headerVal.map((headerValEntry) => {
352
353
  const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
@@ -422,14 +423,14 @@ const decideEndpoint = (bdd, options) => {
422
423
  if (ref >= RESULT) {
423
424
  const result = results[ref - RESULT];
424
425
  if (result[0] === -1) {
425
- const [, errorMessage] = result;
426
- throw new EndpointError(errorMessage);
426
+ const [, errorExpression] = result;
427
+ throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
427
428
  }
428
429
  const [url, properties, headers] = result;
429
430
  return {
430
431
  url: getEndpointUrl(url, closure),
431
432
  properties: getEndpointProperties(properties, closure),
432
- headers: getEndpointHeaders(headers, closure),
433
+ headers: getEndpointHeaders(headers ?? {}, closure),
433
434
  };
434
435
  }
435
436
  throw new EndpointError(`No matching endpoint.`);
@@ -534,20 +535,15 @@ const resolveEndpoint = (ruleSetObject, options) => {
534
535
  const { endpointParams, logger } = options;
535
536
  const { parameters, rules } = ruleSetObject;
536
537
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
537
- const paramsWithDefault = Object.entries(parameters)
538
- .filter(([, v]) => v.default != null)
539
- .map(([k, v]) => [k, v.default]);
540
- if (paramsWithDefault.length > 0) {
541
- for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
542
- endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
543
- }
544
- }
545
- const requiredParams = Object.entries(parameters)
546
- .filter(([, v]) => v.required)
547
- .map(([k]) => k);
548
- for (const requiredParam of requiredParams) {
549
- if (endpointParams[requiredParam] == null) {
550
- throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
538
+ for (const paramKey in parameters) {
539
+ const parameter = parameters[paramKey];
540
+ const endpointParam = endpointParams[paramKey];
541
+ if (endpointParam == null && parameter.default != null) {
542
+ endpointParams[paramKey] = parameter.default;
543
+ continue;
544
+ }
545
+ if (parameter.required && endpointParam == null) {
546
+ throw new EndpointError(`Missing required parameter: '${paramKey}'`);
551
547
  }
552
548
  }
553
549
  const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
@@ -1,5 +1,6 @@
1
1
  import { EndpointError } from "./types";
2
2
  import { evaluateCondition } from "./utils/evaluateCondition";
3
+ import { evaluateExpression } from "./utils/evaluateExpression";
3
4
  import { getEndpointHeaders } from "./utils/getEndpointHeaders";
4
5
  import { getEndpointProperties } from "./utils/getEndpointProperties";
5
6
  import { getEndpointUrl } from "./utils/getEndpointUrl";
@@ -27,14 +28,14 @@ export const decideEndpoint = (bdd, options) => {
27
28
  if (ref >= RESULT) {
28
29
  const result = results[ref - RESULT];
29
30
  if (result[0] === -1) {
30
- const [, errorMessage] = result;
31
- throw new EndpointError(errorMessage);
31
+ const [, errorExpression] = result;
32
+ throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
32
33
  }
33
34
  const [url, properties, headers] = result;
34
35
  return {
35
36
  url: getEndpointUrl(url, closure),
36
37
  properties: getEndpointProperties(properties, closure),
37
- headers: getEndpointHeaders(headers, closure),
38
+ headers: getEndpointHeaders(headers ?? {}, closure),
38
39
  };
39
40
  }
40
41
  throw new EndpointError(`No matching endpoint.`);
@@ -5,7 +5,8 @@ export const getAttr = (value, path) => getAttrPathList(path).reduce((acc, index
5
5
  throw new EndpointError(`Index '${index}' in '${path}' not found in '${JSON.stringify(value)}'`);
6
6
  }
7
7
  else if (Array.isArray(acc)) {
8
- return acc[parseInt(index)];
8
+ const i = parseInt(index);
9
+ return acc[i < 0 ? acc.length + i : i];
9
10
  }
10
11
  return acc[index];
11
12
  }, value);
@@ -5,20 +5,15 @@ export const resolveEndpoint = (ruleSetObject, options) => {
5
5
  const { endpointParams, logger } = options;
6
6
  const { parameters, rules } = ruleSetObject;
7
7
  options.logger?.debug?.(`${debugId} Initial EndpointParams: ${toDebugString(endpointParams)}`);
8
- const paramsWithDefault = Object.entries(parameters)
9
- .filter(([, v]) => v.default != null)
10
- .map(([k, v]) => [k, v.default]);
11
- if (paramsWithDefault.length > 0) {
12
- for (const [paramKey, paramDefaultValue] of paramsWithDefault) {
13
- endpointParams[paramKey] = endpointParams[paramKey] ?? paramDefaultValue;
8
+ for (const paramKey in parameters) {
9
+ const parameter = parameters[paramKey];
10
+ const endpointParam = endpointParams[paramKey];
11
+ if (endpointParam == null && parameter.default != null) {
12
+ endpointParams[paramKey] = parameter.default;
13
+ continue;
14
14
  }
15
- }
16
- const requiredParams = Object.entries(parameters)
17
- .filter(([, v]) => v.required)
18
- .map(([k]) => k);
19
- for (const requiredParam of requiredParams) {
20
- if (endpointParams[requiredParam] == null) {
21
- throw new EndpointError(`Missing required parameter: '${requiredParam}'`);
15
+ if (parameter.required && endpointParam == null) {
16
+ throw new EndpointError(`Missing required parameter: '${paramKey}'`);
22
17
  }
23
18
  }
24
19
  const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
@@ -1,6 +1,6 @@
1
1
  import { EndpointError } from "../types";
2
2
  import { evaluateExpression } from "./evaluateExpression";
3
- export const getEndpointHeaders = (headers, options) => Object.entries(headers).reduce((acc, [headerKey, headerVal]) => ({
3
+ export const getEndpointHeaders = (headers, options) => Object.entries(headers ?? {}).reduce((acc, [headerKey, headerVal]) => ({
4
4
  ...acc,
5
5
  [headerKey]: headerVal.map((headerValEntry) => {
6
6
  const processedExpr = evaluateExpression(headerValEntry, "Header value entry", options);
@@ -1,5 +1,5 @@
1
1
  import type { EndpointObjectHeaders, ParameterObject } from "@smithy/types";
2
- import type { FunctionArgv } from "../types/shared";
2
+ import type { Expression, FunctionArgv } from "../types/shared";
3
3
  /**
4
4
  * @internal
5
5
  */
@@ -7,7 +7,7 @@ type BddCondition = [string, FunctionArgv] | [string, FunctionArgv, string];
7
7
  /**
8
8
  * @internal
9
9
  */
10
- type BddResult = [-1] | [-1, string] | [string, Record<string, ParameterObject>, EndpointObjectHeaders];
10
+ type BddResult = [-1] | [-1, Expression] | [string, Record<string, ParameterObject>, EndpointObjectHeaders] | [string, Record<string, ParameterObject>];
11
11
  /**
12
12
  * @internal
13
13
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-endpoints",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "Utilities to help with endpoint resolution.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -28,8 +28,8 @@
28
28
  "license": "Apache-2.0",
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
- "@smithy/node-config-provider": "^4.3.13",
32
- "@smithy/types": "^4.14.0",
31
+ "@smithy/node-config-provider": "^4.3.14",
32
+ "@smithy/types": "^4.14.1",
33
33
  "tslib": "^2.6.2"
34
34
  },
35
35
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-middleware",
3
- "version": "4.2.13",
3
+ "version": "4.2.14",
4
4
  "description": "Shared utilities for to be used in middleware packages.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -27,7 +27,7 @@
27
27
  "license": "Apache-2.0",
28
28
  "sideEffects": false,
29
29
  "dependencies": {
30
- "@smithy/types": "^4.14.0",
30
+ "@smithy/types": "^4.14.1",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-retry",
3
- "version": "4.3.1",
3
+ "version": "4.3.2",
4
4
  "description": "Shared retry utilities to be used in middleware packages.",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",
@@ -30,8 +30,8 @@
30
30
  "license": "Apache-2.0",
31
31
  "sideEffects": false,
32
32
  "dependencies": {
33
- "@smithy/service-error-classification": "^4.2.13",
34
- "@smithy/types": "^4.14.0",
33
+ "@smithy/service-error-classification": "^4.2.14",
34
+ "@smithy/types": "^4.14.1",
35
35
  "tslib": "^2.6.2"
36
36
  },
37
37
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-stream",
3
- "version": "4.5.22",
3
+ "version": "4.5.23",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:types' 'yarn:build:es:cjs'",
6
6
  "build:es:cjs": "yarn g:tsc -p tsconfig.es.json && node ../../scripts/inline util-stream",
@@ -28,9 +28,9 @@
28
28
  "license": "Apache-2.0",
29
29
  "sideEffects": false,
30
30
  "dependencies": {
31
- "@smithy/fetch-http-handler": "^5.3.16",
32
- "@smithy/node-http-handler": "^4.5.2",
33
- "@smithy/types": "^4.14.0",
31
+ "@smithy/fetch-http-handler": "^5.3.17",
32
+ "@smithy/node-http-handler": "^4.5.3",
33
+ "@smithy/types": "^4.14.1",
34
34
  "@smithy/util-base64": "^4.3.2",
35
35
  "@smithy/util-buffer-from": "^4.2.2",
36
36
  "@smithy/util-hex-encoding": "^4.2.2",
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@smithy/util-waiter",
3
- "version": "4.2.15",
3
+ "version": "4.2.16",
4
4
  "description": "Shared utilities for client waiters for the AWS SDK",
5
5
  "dependencies": {
6
- "@smithy/types": "^4.14.0",
6
+ "@smithy/types": "^4.14.1",
7
7
  "tslib": "^2.6.2"
8
8
  },
9
9
  "scripts": {
@@ -47,7 +47,7 @@
47
47
  "directory": "packages/util-waiter"
48
48
  },
49
49
  "devDependencies": {
50
- "@smithy/abort-controller": "^4.2.13",
50
+ "@smithy/abort-controller": "^4.2.14",
51
51
  "concurrently": "7.0.0",
52
52
  "downlevel-dts": "0.10.1",
53
53
  "premove": "4.0.0",
package/package.json CHANGED
@@ -76,18 +76,18 @@
76
76
  "organization": false
77
77
  },
78
78
  "devDependencies": {
79
- "@aws-sdk/client-cloudformation": "^3.1030.0",
80
- "@aws-sdk/client-dynamodb": "^3.1030.0",
81
- "@aws-sdk/client-ecr": "^3.1030.0",
82
- "@aws-sdk/client-ecs": "^3.1030.0",
83
- "@aws-sdk/client-eventbridge": "^3.1030.0",
84
- "@aws-sdk/client-iam": "^3.1030.0",
85
- "@aws-sdk/client-s3": "^3.1030.0",
86
- "@aws-sdk/client-secrets-manager": "^3.1030.0",
87
- "@aws-sdk/client-sfn": "^3.1030.0",
88
- "@aws-sdk/client-sns": "^3.1030.0",
89
- "@aws-sdk/client-textract": "^3.1030.0",
90
- "@aws-sdk/lib-dynamodb": "^3.1030.0",
79
+ "@aws-sdk/client-cloudformation": "^3.1031.0",
80
+ "@aws-sdk/client-dynamodb": "^3.1031.0",
81
+ "@aws-sdk/client-ecr": "^3.1031.0",
82
+ "@aws-sdk/client-ecs": "^3.1031.0",
83
+ "@aws-sdk/client-eventbridge": "^3.1031.0",
84
+ "@aws-sdk/client-iam": "^3.1031.0",
85
+ "@aws-sdk/client-s3": "^3.1031.0",
86
+ "@aws-sdk/client-secrets-manager": "^3.1031.0",
87
+ "@aws-sdk/client-sfn": "^3.1031.0",
88
+ "@aws-sdk/client-sns": "^3.1031.0",
89
+ "@aws-sdk/client-textract": "^3.1031.0",
90
+ "@aws-sdk/lib-dynamodb": "^3.1031.0",
91
91
  "@aws/durable-execution-sdk-js-testing": "^1.1.1",
92
92
  "@stylistic/eslint-plugin": "^2",
93
93
  "@types/aws-lambda": "^8.10.161",
@@ -114,7 +114,7 @@
114
114
  "jsii-pacmak": "^1.128.0",
115
115
  "jsii-rosetta": "5.x",
116
116
  "nock": "^13.5.6",
117
- "projen": "^0.99.48",
117
+ "projen": "^0.99.50",
118
118
  "ts-jest": "^29.4.9",
119
119
  "ts-node": "^10.9.2",
120
120
  "typescript": "^5.9.3"
@@ -124,7 +124,7 @@
124
124
  "constructs": "^10.5.1"
125
125
  },
126
126
  "dependencies": {
127
- "@aws/durable-execution-sdk-js": "^1.1.0",
127
+ "@aws/durable-execution-sdk-js": "^1.1.1",
128
128
  "@slack/web-api": "^7.15.1",
129
129
  "got": "^11.8.6"
130
130
  },
@@ -141,7 +141,7 @@
141
141
  "publishConfig": {
142
142
  "access": "public"
143
143
  },
144
- "version": "0.13.0",
144
+ "version": "0.13.1",
145
145
  "jest": {
146
146
  "coverageProvider": "v8",
147
147
  "testMatch": [