@cdk8s/awscdk-resolver 0.0.161 → 0.0.163

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 (78) hide show
  1. package/.jsii +2 -2
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@smithy/abort-controller/package.json +2 -2
  4. package/node_modules/@smithy/config-resolver/package.json +4 -4
  5. package/node_modules/@smithy/core/package.json +8 -8
  6. package/node_modules/@smithy/credential-provider-imds/package.json +5 -5
  7. package/node_modules/@smithy/fetch-http-handler/package.json +5 -5
  8. package/node_modules/@smithy/hash-node/package.json +2 -2
  9. package/node_modules/@smithy/invalid-dependency/package.json +2 -2
  10. package/node_modules/@smithy/middleware-content-length/package.json +4 -4
  11. package/node_modules/@smithy/middleware-endpoint/dist-cjs/adaptors/getEndpointFromConfig.js +1 -1
  12. package/node_modules/@smithy/middleware-endpoint/dist-cjs/index.js +16 -2
  13. package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromConfig.js +1 -1
  14. package/node_modules/@smithy/middleware-endpoint/dist-es/adaptors/getEndpointFromInstructions.js +7 -1
  15. package/node_modules/@smithy/middleware-endpoint/dist-es/resolveEndpointConfig.js +10 -1
  16. package/node_modules/@smithy/middleware-endpoint/dist-types/adaptors/getEndpointFromConfig.d.ts +4 -1
  17. package/node_modules/@smithy/middleware-endpoint/dist-types/resolveEndpointConfig.d.ts +11 -0
  18. package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/adaptors/getEndpointFromConfig.d.ts +4 -1
  19. package/node_modules/@smithy/middleware-endpoint/dist-types/ts3.4/resolveEndpointConfig.d.ts +11 -0
  20. package/node_modules/@smithy/middleware-endpoint/package.json +7 -7
  21. package/node_modules/@smithy/middleware-retry/package.json +9 -9
  22. package/node_modules/@smithy/middleware-serde/package.json +3 -3
  23. package/node_modules/@smithy/middleware-stack/package.json +2 -2
  24. package/node_modules/@smithy/node-config-provider/package.json +4 -4
  25. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +86 -46
  26. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +10 -10
  27. package/node_modules/@smithy/node-http-handler/dist-es/set-connection-timeout.js +27 -13
  28. package/node_modules/@smithy/node-http-handler/dist-es/set-socket-keep-alive.js +18 -5
  29. package/node_modules/@smithy/node-http-handler/dist-es/set-socket-timeout.js +12 -4
  30. package/node_modules/@smithy/node-http-handler/dist-types/set-connection-timeout.d.ts +6 -1
  31. package/node_modules/@smithy/node-http-handler/dist-types/set-socket-keep-alive.d.ts +6 -1
  32. package/node_modules/@smithy/node-http-handler/dist-types/set-socket-timeout.d.ts +6 -1
  33. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-connection-timeout.d.ts +2 -1
  34. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-keep-alive.d.ts +2 -1
  35. package/node_modules/@smithy/node-http-handler/dist-types/ts3.4/set-socket-timeout.d.ts +2 -1
  36. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  37. package/node_modules/@smithy/property-provider/package.json +2 -2
  38. package/node_modules/@smithy/protocol-http/package.json +2 -2
  39. package/node_modules/@smithy/querystring-builder/package.json +2 -2
  40. package/node_modules/@smithy/querystring-parser/package.json +2 -2
  41. package/node_modules/@smithy/service-error-classification/package.json +2 -2
  42. package/node_modules/@smithy/shared-ini-file-loader/package.json +2 -2
  43. package/node_modules/@smithy/signature-v4/package.json +4 -4
  44. package/node_modules/@smithy/smithy-client/dist-cjs/index.js +21 -4
  45. package/node_modules/@smithy/smithy-client/dist-es/client.js +22 -4
  46. package/node_modules/@smithy/smithy-client/dist-types/client.d.ts +22 -1
  47. package/node_modules/@smithy/smithy-client/dist-types/ts3.4/client.d.ts +22 -1
  48. package/node_modules/@smithy/smithy-client/package.json +6 -6
  49. package/node_modules/@smithy/types/README.md +36 -1
  50. package/node_modules/@smithy/types/dist-types/command.d.ts +14 -1
  51. package/node_modules/@smithy/types/dist-types/endpoint.d.ts +1 -1
  52. package/node_modules/@smithy/types/dist-types/transform/client-method-transforms.d.ts +6 -6
  53. package/node_modules/@smithy/types/dist-types/transform/client-payload-blob-type-narrow.d.ts +12 -6
  54. package/node_modules/@smithy/types/dist-types/transform/no-undefined.d.ts +8 -3
  55. package/node_modules/@smithy/types/dist-types/ts3.4/command.d.ts +14 -1
  56. package/node_modules/@smithy/types/dist-types/ts3.4/endpoint.d.ts +1 -1
  57. package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-method-transforms.d.ts +6 -6
  58. package/node_modules/@smithy/types/dist-types/ts3.4/transform/client-payload-blob-type-narrow.d.ts +8 -10
  59. package/node_modules/@smithy/types/dist-types/ts3.4/transform/no-undefined.d.ts +6 -9
  60. package/node_modules/@smithy/types/package.json +1 -1
  61. package/node_modules/@smithy/url-parser/package.json +3 -3
  62. package/node_modules/@smithy/util-defaults-mode-browser/package.json +4 -4
  63. package/node_modules/@smithy/util-defaults-mode-node/package.json +7 -7
  64. package/node_modules/@smithy/util-endpoints/dist-cjs/cache/EndpointCache.js +1 -0
  65. package/node_modules/@smithy/util-endpoints/dist-cjs/index.js +73 -11
  66. package/node_modules/@smithy/util-endpoints/dist-es/cache/EndpointCache.js +49 -0
  67. package/node_modules/@smithy/util-endpoints/dist-es/index.js +1 -0
  68. package/node_modules/@smithy/util-endpoints/dist-es/resolveEndpoint.js +0 -10
  69. package/node_modules/@smithy/util-endpoints/dist-types/cache/EndpointCache.d.ts +34 -0
  70. package/node_modules/@smithy/util-endpoints/dist-types/index.d.ts +1 -0
  71. package/node_modules/@smithy/util-endpoints/dist-types/ts3.4/cache/EndpointCache.d.ts +34 -0
  72. package/node_modules/@smithy/util-endpoints/dist-types/ts3.4/index.d.ts +1 -0
  73. package/node_modules/@smithy/util-endpoints/package.json +3 -3
  74. package/node_modules/@smithy/util-middleware/package.json +2 -2
  75. package/node_modules/@smithy/util-retry/package.json +3 -3
  76. package/node_modules/@smithy/util-stream/package.json +5 -5
  77. package/node_modules/@smithy/util-waiter/package.json +3 -3
  78. package/package.json +5 -5
@@ -0,0 +1,49 @@
1
+ export class EndpointCache {
2
+ constructor({ size, params }) {
3
+ this.data = new Map();
4
+ this.parameters = [];
5
+ this.capacity = size ?? 50;
6
+ if (params) {
7
+ this.parameters = params;
8
+ }
9
+ }
10
+ get(endpointParams, resolver) {
11
+ const key = this.hash(endpointParams);
12
+ if (key === false) {
13
+ return resolver();
14
+ }
15
+ if (!this.data.has(key)) {
16
+ if (this.data.size > this.capacity + 10) {
17
+ const keys = this.data.keys();
18
+ let i = 0;
19
+ while (true) {
20
+ const { value, done } = keys.next();
21
+ this.data.delete(value);
22
+ if (done || ++i > 10) {
23
+ break;
24
+ }
25
+ }
26
+ }
27
+ this.data.set(key, resolver());
28
+ }
29
+ return this.data.get(key);
30
+ }
31
+ size() {
32
+ return this.data.size;
33
+ }
34
+ hash(endpointParams) {
35
+ let buffer = "";
36
+ const { parameters } = this;
37
+ if (parameters.length === 0) {
38
+ return false;
39
+ }
40
+ for (const param of parameters) {
41
+ const val = String(endpointParams[param] ?? "");
42
+ if (val.includes("|;")) {
43
+ return false;
44
+ }
45
+ buffer += val + "|;";
46
+ }
47
+ return buffer;
48
+ }
49
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./cache/EndpointCache";
1
2
  export * from "./lib/isIpAddress";
2
3
  export * from "./lib/isValidHostLabel";
3
4
  export * from "./utils/customEndpointFunctions";
@@ -22,16 +22,6 @@ export const resolveEndpoint = (ruleSetObject, options) => {
22
22
  }
23
23
  }
24
24
  const endpoint = evaluateRules(rules, { endpointParams, logger, referenceRecord: {} });
25
- if (options.endpointParams?.Endpoint) {
26
- try {
27
- const givenEndpoint = new URL(options.endpointParams.Endpoint);
28
- const { protocol, port } = givenEndpoint;
29
- endpoint.url.protocol = protocol;
30
- endpoint.url.port = port;
31
- }
32
- catch (e) {
33
- }
34
- }
35
25
  options.logger?.debug?.(`${debugId} Resolved endpoint: ${toDebugString(endpoint)}`);
36
26
  return endpoint;
37
27
  };
@@ -0,0 +1,34 @@
1
+ import type { EndpointParams, EndpointV2 } from "@smithy/types";
2
+ /**
3
+ * @internal
4
+ *
5
+ * Cache for endpoint ruleSet resolution.
6
+ */
7
+ export declare class EndpointCache {
8
+ private capacity;
9
+ private data;
10
+ private parameters;
11
+ /**
12
+ * @param [size] - desired average maximum capacity. A buffer of 10 additional keys will be allowed
13
+ * before keys are dropped.
14
+ * @param [params] - list of params to consider as part of the cache key.
15
+ *
16
+ * If the params list is not populated, no caching will happen.
17
+ * This may be out of order depending on how the object is created and arrives to this class.
18
+ */
19
+ constructor({ size, params }: {
20
+ size?: number;
21
+ params?: string[];
22
+ });
23
+ /**
24
+ * @param endpointParams - query for endpoint.
25
+ * @param resolver - provider of the value if not present.
26
+ * @returns endpoint corresponding to the query.
27
+ */
28
+ get(endpointParams: EndpointParams, resolver: () => EndpointV2): EndpointV2;
29
+ size(): number;
30
+ /**
31
+ * @returns cache key or false if not cachable.
32
+ */
33
+ private hash;
34
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./cache/EndpointCache";
1
2
  export * from "./lib/isIpAddress";
2
3
  export * from "./lib/isValidHostLabel";
3
4
  export * from "./utils/customEndpointFunctions";
@@ -0,0 +1,34 @@
1
+ import { EndpointParams, EndpointV2 } from "@smithy/types";
2
+ /**
3
+ * @internal
4
+ *
5
+ * Cache for endpoint ruleSet resolution.
6
+ */
7
+ export declare class EndpointCache {
8
+ private capacity;
9
+ private data;
10
+ private parameters;
11
+ /**
12
+ * @param [size] - desired average maximum capacity. A buffer of 10 additional keys will be allowed
13
+ * before keys are dropped.
14
+ * @param [params] - list of params to consider as part of the cache key.
15
+ *
16
+ * If the params list is not populated, no caching will happen.
17
+ * This may be out of order depending on how the object is created and arrives to this class.
18
+ */
19
+ constructor({ size, params }: {
20
+ size?: number;
21
+ params?: string[];
22
+ });
23
+ /**
24
+ * @param endpointParams - query for endpoint.
25
+ * @param resolver - provider of the value if not present.
26
+ * @returns endpoint corresponding to the query.
27
+ */
28
+ get(endpointParams: EndpointParams, resolver: () => EndpointV2): EndpointV2;
29
+ size(): number;
30
+ /**
31
+ * @returns cache key or false if not cachable.
32
+ */
33
+ private hash;
34
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./cache/EndpointCache";
1
2
  export * from "./lib/isIpAddress";
2
3
  export * from "./lib/isValidHostLabel";
3
4
  export * from "./utils/customEndpointFunctions";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-endpoints",
3
- "version": "2.0.5",
3
+ "version": "2.1.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,8 +26,8 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@smithy/node-config-provider": "^3.1.4",
30
- "@smithy/types": "^3.3.0",
29
+ "@smithy/node-config-provider": "^3.1.5",
30
+ "@smithy/types": "^3.4.0",
31
31
  "tslib": "^2.6.2"
32
32
  },
33
33
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-middleware",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
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",
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "dependencies": {
29
- "@smithy/types": "^3.3.0",
29
+ "@smithy/types": "^3.4.0",
30
30
  "tslib": "^2.6.2"
31
31
  },
32
32
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-retry",
3
- "version": "3.0.3",
3
+ "version": "3.0.4",
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",
@@ -27,8 +27,8 @@
27
27
  },
28
28
  "license": "Apache-2.0",
29
29
  "dependencies": {
30
- "@smithy/service-error-classification": "^3.0.3",
31
- "@smithy/types": "^3.3.0",
30
+ "@smithy/service-error-classification": "^3.0.4",
31
+ "@smithy/types": "^3.4.0",
32
32
  "tslib": "^2.6.2"
33
33
  },
34
34
  "devDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-stream",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-stream",
@@ -24,9 +24,9 @@
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "dependencies": {
27
- "@smithy/fetch-http-handler": "^3.2.4",
28
- "@smithy/node-http-handler": "^3.1.4",
29
- "@smithy/types": "^3.3.0",
27
+ "@smithy/fetch-http-handler": "^3.2.5",
28
+ "@smithy/node-http-handler": "^3.2.0",
29
+ "@smithy/types": "^3.4.0",
30
30
  "@smithy/util-base64": "^3.0.0",
31
31
  "@smithy/util-buffer-from": "^3.0.0",
32
32
  "@smithy/util-hex-encoding": "^3.0.0",
@@ -34,7 +34,7 @@
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "devDependencies": {
37
- "@smithy/util-test": "^0.2.6",
37
+ "@smithy/util-test": "^0.2.7",
38
38
  "@types/node": "^16.18.96",
39
39
  "concurrently": "7.0.0",
40
40
  "downlevel-dts": "0.10.1",
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@smithy/util-waiter",
3
- "version": "3.1.2",
3
+ "version": "3.1.3",
4
4
  "description": "Shared utilities for client waiters for the AWS SDK",
5
5
  "dependencies": {
6
- "@smithy/abort-controller": "^3.1.1",
7
- "@smithy/types": "^3.3.0",
6
+ "@smithy/abort-controller": "^3.1.2",
7
+ "@smithy/types": "^3.4.0",
8
8
  "tslib": "^2.6.2"
9
9
  },
10
10
  "scripts": {
package/package.json CHANGED
@@ -48,10 +48,10 @@
48
48
  "@types/node": "16.18.78",
49
49
  "@typescript-eslint/eslint-plugin": "^7",
50
50
  "@typescript-eslint/parser": "^7",
51
- "aws-cdk": "^2.156.0",
51
+ "aws-cdk": "^2.157.0",
52
52
  "aws-cdk-lib": "2.109.0",
53
53
  "cdk8s": "2.68.91",
54
- "cdk8s-cli": "^2.198.212",
54
+ "cdk8s-cli": "^2.198.213",
55
55
  "commit-and-tag-version": "^12",
56
56
  "constructs": "10.3.0",
57
57
  "eslint": "^8",
@@ -65,10 +65,10 @@
65
65
  "jsii-docgen": "^10.5.0",
66
66
  "jsii-pacmak": "^1.103.1",
67
67
  "jsii-rosetta": "^5",
68
- "projen": "^0.87.0",
68
+ "projen": "^0.87.2",
69
69
  "ts-jest": "^27",
70
70
  "ts-node": "^10.9.2",
71
- "typescript": "^5.5.4"
71
+ "typescript": "^5.6.2"
72
72
  },
73
73
  "peerDependencies": {
74
74
  "aws-cdk-lib": "^2.106.1",
@@ -92,7 +92,7 @@
92
92
  "publishConfig": {
93
93
  "access": "public"
94
94
  },
95
- "version": "0.0.161",
95
+ "version": "0.0.163",
96
96
  "jest": {
97
97
  "coverageProvider": "v8",
98
98
  "testMatch": [