@cdk8s/awscdk-resolver 0.0.478 → 0.0.480

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 (84) hide show
  1. package/.jsii +3 -3
  2. package/lib/resolve.js +1 -1
  3. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/LICENSE +201 -0
  4. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/README.md +6 -0
  5. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-cjs/index.js +415 -0
  6. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-cjs/lib/aws/partitions.json +267 -0
  7. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/aws.js +10 -0
  8. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/index.js +6 -0
  9. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/index.js +3 -0
  10. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/isVirtualHostableS3Bucket.js +25 -0
  11. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/parseArn.js +18 -0
  12. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partition.js +41 -0
  13. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/lib/aws/partitions.json +267 -0
  14. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/lib/isIpAddress.js +1 -0
  15. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/resolveDefaultAwsRegionalEndpointsConfig.js +21 -0
  16. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/resolveEndpoint.js +1 -0
  17. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointError.js +1 -0
  18. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/EndpointRuleObject.js +1 -0
  19. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/ErrorRuleObject.js +1 -0
  20. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/RuleSetObject.js +1 -0
  21. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/TreeRuleObject.js +1 -0
  22. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/index.js +6 -0
  23. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-es/types/shared.js +1 -0
  24. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/aws.d.ts +2 -0
  25. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/index.d.ts +6 -0
  26. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/index.d.ts +3 -0
  27. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/isVirtualHostableS3Bucket.d.ts +5 -0
  28. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/parseArn.d.ts +7 -0
  29. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/lib/aws/partition.d.ts +38 -0
  30. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/lib/isIpAddress.d.ts +1 -0
  31. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/resolveDefaultAwsRegionalEndpointsConfig.d.ts +56 -0
  32. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/resolveEndpoint.d.ts +1 -0
  33. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/aws.d.ts +2 -0
  34. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/index.d.ts +6 -0
  35. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/index.d.ts +3 -0
  36. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/isVirtualHostableS3Bucket.d.ts +4 -0
  37. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/parseArn.d.ts +2 -0
  38. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/aws/partition.d.ts +28 -0
  39. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/lib/isIpAddress.d.ts +1 -0
  40. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveDefaultAwsRegionalEndpointsConfig.d.ts +35 -0
  41. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/resolveEndpoint.d.ts +1 -0
  42. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointError.d.ts +1 -0
  43. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/EndpointRuleObject.d.ts +6 -0
  44. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/ErrorRuleObject.d.ts +1 -0
  45. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/RuleSetObject.d.ts +5 -0
  46. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/TreeRuleObject.d.ts +1 -0
  47. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/index.d.ts +6 -0
  48. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/ts3.4/types/shared.d.ts +12 -0
  49. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointError.d.ts +1 -0
  50. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/EndpointRuleObject.d.ts +1 -0
  51. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/ErrorRuleObject.d.ts +1 -0
  52. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/RuleSetObject.d.ts +1 -0
  53. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/TreeRuleObject.d.ts +1 -0
  54. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/index.d.ts +6 -0
  55. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/dist-types/types/shared.d.ts +1 -0
  56. package/node_modules/@aws-sdk/client-cloudformation/node_modules/@aws-sdk/util-endpoints/package.json +60 -0
  57. package/node_modules/@aws-sdk/client-cloudformation/package.json +2 -2
  58. package/node_modules/@smithy/core/dist-cjs/submodules/cbor/index.js +13 -10
  59. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +5 -0
  60. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +24 -5
  61. package/node_modules/@smithy/core/dist-es/submodules/cbor/SmithyRpcV2CborProtocol.js +15 -11
  62. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +6 -1
  63. package/node_modules/@smithy/core/dist-es/submodules/schema/TypeRegistry.js +24 -5
  64. package/node_modules/@smithy/core/dist-types/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +7 -1
  65. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +5 -1
  66. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpProtocol.d.ts +14 -1
  67. package/node_modules/@smithy/core/dist-types/submodules/protocols/RpcProtocol.d.ts +5 -0
  68. package/node_modules/@smithy/core/dist-types/submodules/schema/TypeRegistry.d.ts +8 -1
  69. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/cbor/SmithyRpcV2CborProtocol.d.ts +7 -1
  70. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpBindingProtocol.d.ts +5 -1
  71. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/HttpProtocol.d.ts +14 -1
  72. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/protocols/RpcProtocol.d.ts +5 -0
  73. package/node_modules/@smithy/core/dist-types/ts3.4/submodules/schema/TypeRegistry.d.ts +8 -1
  74. package/node_modules/@smithy/core/package.json +2 -2
  75. package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
  76. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  77. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +9 -2
  78. package/node_modules/@smithy/node-http-handler/dist-es/write-request-body.js +9 -2
  79. package/node_modules/@smithy/node-http-handler/package.json +1 -1
  80. package/node_modules/@smithy/smithy-client/package.json +4 -4
  81. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  82. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  83. package/node_modules/@smithy/util-stream/package.json +2 -2
  84. package/package.json +4 -4
@@ -0,0 +1,6 @@
1
+ export * from "./EndpointError";
2
+ export * from "./EndpointRuleObject";
3
+ export * from "./ErrorRuleObject";
4
+ export * from "./RuleSetObject";
5
+ export * from "./TreeRuleObject";
6
+ export * from "./shared";
@@ -0,0 +1,2 @@
1
+ import { EndpointFunctions } from "@smithy/util-endpoints";
2
+ export declare const awsEndpointFunctions: EndpointFunctions;
@@ -0,0 +1,6 @@
1
+ export * from "./aws";
2
+ export * from "./lib/aws/partition";
3
+ export * from "./lib/isIpAddress";
4
+ export * from "./resolveDefaultAwsRegionalEndpointsConfig";
5
+ export * from "./resolveEndpoint";
6
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ export * from "./isVirtualHostableS3Bucket";
2
+ export * from "./parseArn";
3
+ export * from "./partition";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Evaluates whether a string is a DNS compatible bucket name and can be used with
3
+ * virtual hosted style addressing.
4
+ */
5
+ export declare const isVirtualHostableS3Bucket: (value: string, allowSubDomains?: boolean) => boolean;
@@ -0,0 +1,7 @@
1
+ import { EndpointARN } from "@smithy/types";
2
+ /**
3
+ * Evaluates a single string argument value, and returns an object containing
4
+ * details about the parsed ARN.
5
+ * If the input was not a valid ARN, the function returns null.
6
+ */
7
+ export declare const parseArn: (value: string) => EndpointARN | null;
@@ -0,0 +1,38 @@
1
+ import { EndpointPartition } from "@smithy/types";
2
+ export type PartitionsInfo = {
3
+ partitions: Array<{
4
+ id: string;
5
+ outputs: {
6
+ dnsSuffix: string;
7
+ dualStackDnsSuffix: string;
8
+ name: string;
9
+ supportsDualStack: boolean;
10
+ supportsFIPS: boolean;
11
+ };
12
+ regionRegex: string;
13
+ regions: Record<string, {
14
+ description?: string;
15
+ } | undefined>;
16
+ }>;
17
+ };
18
+ /**
19
+ * Evaluates a single string argument value as a region, and matches the
20
+ * string value to an AWS partition.
21
+ * The matcher MUST always return a successful object describing the partition
22
+ * that the region has been determined to be a part of.
23
+ */
24
+ export declare const partition: (value: string) => EndpointPartition;
25
+ /**
26
+ * Set custom partitions.json data.
27
+ * @internal
28
+ */
29
+ export declare const setPartitionInfo: (partitionsInfo: PartitionsInfo, userAgentPrefix?: string) => void;
30
+ /**
31
+ * Reset to the default partitions.json data.
32
+ * @internal
33
+ */
34
+ export declare const useDefaultPartitionInfo: () => void;
35
+ /**
36
+ * @internal
37
+ */
38
+ export declare const getUserAgentPrefix: () => string;
@@ -0,0 +1 @@
1
+ export { isIpAddress } from "@smithy/util-endpoints";
@@ -0,0 +1,56 @@
1
+ import type { Endpoint, EndpointParameters, EndpointV2, Logger, Provider } from "@smithy/types";
2
+ /**
3
+ * This is an additional config resolver layer for clients using the default
4
+ * AWS regional endpoints ruleset. It makes the *resolved* config guarantee the presence of an
5
+ * endpoint provider function. This differs from the base behavior of the Endpoint
6
+ * config resolver, which only normalizes config.endpoint IFF one is provided by the caller.
7
+ *
8
+ * This is not used by AWS SDK clients, but rather
9
+ * generated clients that have the aws.api#service trait. This includes protocol tests
10
+ * and other customers.
11
+ *
12
+ * This resolver is MUTUALLY EXCLUSIVE with the EndpointRequired config resolver from
13
+ * |@smithy/middleware-endpoint.
14
+ *
15
+ * It must be placed after the `resolveEndpointConfig`
16
+ * resolver. This replaces the endpoints.json-based default endpoint provider.
17
+ *
18
+ * @public
19
+ */
20
+ export type DefaultAwsRegionalEndpointsInputConfig = {
21
+ endpoint?: unknown;
22
+ };
23
+ type PreviouslyResolved = {
24
+ logger?: Logger;
25
+ region?: undefined | string | Provider<string | undefined>;
26
+ useFipsEndpoint?: undefined | boolean | Provider<string | boolean>;
27
+ useDualstackEndpoint?: undefined | boolean | Provider<string | boolean>;
28
+ endpointProvider: (endpointParams: EndpointParameters | DefaultRegionalEndpointParameters, context?: {
29
+ logger?: Logger;
30
+ }) => EndpointV2;
31
+ };
32
+ /**
33
+ * @internal
34
+ */
35
+ type DefaultRegionalEndpointParameters = {
36
+ Region?: string | undefined;
37
+ UseDualStack?: boolean | undefined;
38
+ UseFIPS?: boolean | undefined;
39
+ };
40
+ /**
41
+ * @internal
42
+ */
43
+ export interface DefaultAwsRegionalEndpointsResolvedConfig {
44
+ endpoint: Provider<Endpoint>;
45
+ }
46
+ /**
47
+ * MUST resolve after `\@smithy/middleware-endpoint`::`resolveEndpointConfig`.
48
+ *
49
+ * @internal
50
+ */
51
+ export declare const resolveDefaultAwsRegionalEndpointsConfig: <T>(input: T & DefaultAwsRegionalEndpointsInputConfig & PreviouslyResolved) => T & DefaultAwsRegionalEndpointsResolvedConfig;
52
+ /**
53
+ * @internal
54
+ */
55
+ export declare const toEndpointV1: (endpoint: EndpointV2) => Endpoint;
56
+ export {};
@@ -0,0 +1 @@
1
+ export { resolveEndpoint } from "@smithy/util-endpoints";
@@ -0,0 +1,2 @@
1
+ import { EndpointFunctions } from "@smithy/util-endpoints";
2
+ export declare const awsEndpointFunctions: EndpointFunctions;
@@ -0,0 +1,6 @@
1
+ export * from "./aws";
2
+ export * from "./lib/aws/partition";
3
+ export * from "./lib/isIpAddress";
4
+ export * from "./resolveDefaultAwsRegionalEndpointsConfig";
5
+ export * from "./resolveEndpoint";
6
+ export * from "./types";
@@ -0,0 +1,3 @@
1
+ export * from "./isVirtualHostableS3Bucket";
2
+ export * from "./parseArn";
3
+ export * from "./partition";
@@ -0,0 +1,4 @@
1
+ export declare const isVirtualHostableS3Bucket: (
2
+ value: string,
3
+ allowSubDomains?: boolean
4
+ ) => boolean;
@@ -0,0 +1,2 @@
1
+ import { EndpointARN } from "@smithy/types";
2
+ export declare const parseArn: (value: string) => EndpointARN | null;
@@ -0,0 +1,28 @@
1
+ import { EndpointPartition } from "@smithy/types";
2
+ export type PartitionsInfo = {
3
+ partitions: Array<{
4
+ id: string;
5
+ outputs: {
6
+ dnsSuffix: string;
7
+ dualStackDnsSuffix: string;
8
+ name: string;
9
+ supportsDualStack: boolean;
10
+ supportsFIPS: boolean;
11
+ };
12
+ regionRegex: string;
13
+ regions: Record<
14
+ string,
15
+ | {
16
+ description?: string;
17
+ }
18
+ | undefined
19
+ >;
20
+ }>;
21
+ };
22
+ export declare const partition: (value: string) => EndpointPartition;
23
+ export declare const setPartitionInfo: (
24
+ partitionsInfo: PartitionsInfo,
25
+ userAgentPrefix?: string
26
+ ) => void;
27
+ export declare const useDefaultPartitionInfo: () => void;
28
+ export declare const getUserAgentPrefix: () => string;
@@ -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 {};
@@ -0,0 +1 @@
1
+ export { resolveEndpoint } from "@smithy/util-endpoints";
@@ -0,0 +1,6 @@
1
+ export {
2
+ EndpointObjectProperties,
3
+ EndpointObjectHeaders,
4
+ EndpointObject,
5
+ EndpointRuleObject,
6
+ } from "@smithy/util-endpoints";
@@ -0,0 +1,5 @@
1
+ export {
2
+ DeprecatedObject,
3
+ ParameterObject,
4
+ RuleSetObject,
5
+ } from "@smithy/util-endpoints";
@@ -0,0 +1 @@
1
+ export { RuleSetRules, TreeRuleObject } from "@smithy/util-endpoints";
@@ -0,0 +1,6 @@
1
+ export * from "./EndpointError";
2
+ export * from "./EndpointRuleObject";
3
+ export * from "./ErrorRuleObject";
4
+ export * from "./RuleSetObject";
5
+ export * from "./TreeRuleObject";
6
+ export * from "./shared";
@@ -0,0 +1,12 @@
1
+ export {
2
+ ReferenceObject,
3
+ FunctionObject,
4
+ FunctionArgv,
5
+ FunctionReturn,
6
+ ConditionObject,
7
+ Expression,
8
+ EndpointParams,
9
+ EndpointResolverOptions,
10
+ ReferenceRecord,
11
+ EvaluateOptions,
12
+ } from "@smithy/util-endpoints";
@@ -0,0 +1 @@
1
+ export { EndpointError } from "@smithy/util-endpoints";
@@ -0,0 +1 @@
1
+ export { EndpointObjectProperties, EndpointObjectHeaders, EndpointObject, EndpointRuleObject, } from "@smithy/util-endpoints";
@@ -0,0 +1 @@
1
+ export { ErrorRuleObject } from "@smithy/util-endpoints";
@@ -0,0 +1 @@
1
+ export { DeprecatedObject, ParameterObject, RuleSetObject } from "@smithy/util-endpoints";
@@ -0,0 +1 @@
1
+ export { RuleSetRules, TreeRuleObject } from "@smithy/util-endpoints";
@@ -0,0 +1,6 @@
1
+ export * from "./EndpointError";
2
+ export * from "./EndpointRuleObject";
3
+ export * from "./ErrorRuleObject";
4
+ export * from "./RuleSetObject";
5
+ export * from "./TreeRuleObject";
6
+ export * from "./shared";
@@ -0,0 +1 @@
1
+ export { ReferenceObject, FunctionObject, FunctionArgv, FunctionReturn, ConditionObject, Expression, EndpointParams, EndpointResolverOptions, ReferenceRecord, EvaluateOptions, } from "@smithy/util-endpoints";
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@aws-sdk/util-endpoints",
3
+ "version": "3.987.0",
4
+ "description": "Utilities to help with endpoint resolution",
5
+ "main": "./dist-cjs/index.js",
6
+ "module": "./dist-es/index.js",
7
+ "types": "./dist-types/index.d.ts",
8
+ "scripts": {
9
+ "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
10
+ "build:cjs": "node ../../scripts/compilation/inline util-endpoints",
11
+ "build:es": "tsc -p tsconfig.es.json",
12
+ "build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
13
+ "build:types": "tsc -p tsconfig.types.json",
14
+ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
15
+ "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
16
+ "test": "yarn g:vitest run",
17
+ "test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
18
+ "test:watch": "yarn g:vitest watch",
19
+ "test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
20
+ },
21
+ "sideEffects": true,
22
+ "author": {
23
+ "name": "AWS SDK for JavaScript Team",
24
+ "url": "https://aws.amazon.com/javascript/"
25
+ },
26
+ "license": "Apache-2.0",
27
+ "dependencies": {
28
+ "@aws-sdk/types": "^3.973.1",
29
+ "@smithy/types": "^4.12.0",
30
+ "@smithy/url-parser": "^4.2.8",
31
+ "@smithy/util-endpoints": "^3.2.8",
32
+ "tslib": "^2.6.2"
33
+ },
34
+ "engines": {
35
+ "node": ">=20.0.0"
36
+ },
37
+ "typesVersions": {
38
+ "<4.0": {
39
+ "dist-types/*": [
40
+ "dist-types/ts3.4/*"
41
+ ]
42
+ }
43
+ },
44
+ "files": [
45
+ "dist-*/**"
46
+ ],
47
+ "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/util-endpoints",
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "https://github.com/aws/aws-sdk-js-v3.git",
51
+ "directory": "packages/util-endpoints"
52
+ },
53
+ "devDependencies": {
54
+ "@tsconfig/recommended": "1.0.1",
55
+ "concurrently": "7.0.0",
56
+ "downlevel-dts": "0.10.1",
57
+ "premove": "4.0.0",
58
+ "typescript": "~5.8.3"
59
+ }
60
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudformation",
3
3
  "description": "AWS SDK for JavaScript Cloudformation Client for Node.js, Browser and React Native",
4
- "version": "3.985.0",
4
+ "version": "3.987.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-cloudformation",
@@ -31,7 +31,7 @@
31
31
  "@aws-sdk/middleware-user-agent": "^3.972.7",
32
32
  "@aws-sdk/region-config-resolver": "^3.972.3",
33
33
  "@aws-sdk/types": "^3.973.1",
34
- "@aws-sdk/util-endpoints": "3.985.0",
34
+ "@aws-sdk/util-endpoints": "3.987.0",
35
35
  "@aws-sdk/util-user-agent-browser": "^3.972.3",
36
36
  "@aws-sdk/util-user-agent-node": "^3.972.5",
37
37
  "@smithy/config-resolver": "^4.4.6",
@@ -990,8 +990,8 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
990
990
  codec = new CborCodec();
991
991
  serializer = this.codec.createSerializer();
992
992
  deserializer = this.codec.createDeserializer();
993
- constructor({ defaultNamespace }) {
994
- super({ defaultNamespace });
993
+ constructor({ defaultNamespace, errorTypeRegistries, }) {
994
+ super({ defaultNamespace, errorTypeRegistries });
995
995
  }
996
996
  getShapeId() {
997
997
  return "smithy.protocols#rpcv2Cbor";
@@ -1035,15 +1035,17 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
1035
1035
  }
1036
1036
  async handleError(operationSchema, context, response, dataObject, metadata) {
1037
1037
  const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
1038
- let namespace = this.options.defaultNamespace;
1039
- if (errorName.includes("#")) {
1040
- [namespace] = errorName.split("#");
1041
- }
1042
1038
  const errorMetadata = {
1043
1039
  $metadata: metadata,
1044
1040
  $fault: response.statusCode <= 500 ? "client" : "server",
1045
1041
  };
1046
- const registry = schema.TypeRegistry.for(namespace);
1042
+ let namespace = this.options.defaultNamespace;
1043
+ if (errorName.includes("#")) {
1044
+ [namespace] = errorName.split("#");
1045
+ }
1046
+ const registry = this.compositeErrorRegistry;
1047
+ const nsRegistry = schema.TypeRegistry.for(namespace);
1048
+ registry.copyFrom(nsRegistry);
1047
1049
  let errorSchema;
1048
1050
  try {
1049
1051
  errorSchema = registry.getSchema(errorName);
@@ -1052,10 +1054,11 @@ class SmithyRpcV2CborProtocol extends protocols.RpcProtocol {
1052
1054
  if (dataObject.Message) {
1053
1055
  dataObject.message = dataObject.Message;
1054
1056
  }
1055
- const synthetic = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
1056
- const baseExceptionSchema = synthetic.getBaseException();
1057
+ const syntheticRegistry = schema.TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
1058
+ registry.copyFrom(syntheticRegistry);
1059
+ const baseExceptionSchema = registry.getBaseException();
1057
1060
  if (baseExceptionSchema) {
1058
- const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema);
1061
+ const ErrorCtor = registry.getErrorCtor(baseExceptionSchema);
1059
1062
  throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
1060
1063
  }
1061
1064
  throw Object.assign(new Error(errorName), errorMetadata, dataObject);
@@ -33,9 +33,14 @@ class SerdeContext {
33
33
 
34
34
  class HttpProtocol extends SerdeContext {
35
35
  options;
36
+ compositeErrorRegistry;
36
37
  constructor(options) {
37
38
  super();
38
39
  this.options = options;
40
+ this.compositeErrorRegistry = schema.TypeRegistry.for(options.defaultNamespace);
41
+ for (const etr of options.errorTypeRegistries ?? []) {
42
+ this.compositeErrorRegistry.copyFrom(etr);
43
+ }
39
44
  }
40
45
  getRequestType() {
41
46
  return protocolHttp.HttpRequest;
@@ -566,10 +566,24 @@ class TypeRegistry {
566
566
  }
567
567
  return TypeRegistry.registries.get(namespace);
568
568
  }
569
+ copyFrom(other) {
570
+ const { schemas, exceptions } = this;
571
+ for (const [k, v] of other.schemas) {
572
+ if (!schemas.has(k)) {
573
+ schemas.set(k, v);
574
+ }
575
+ }
576
+ for (const [k, v] of other.exceptions) {
577
+ if (!exceptions.has(k)) {
578
+ exceptions.set(k, v);
579
+ }
580
+ }
581
+ }
569
582
  register(shapeId, schema) {
570
583
  const qualifiedName = this.normalizeShapeId(shapeId);
571
- const registry = TypeRegistry.for(qualifiedName.split("#")[0]);
572
- registry.schemas.set(qualifiedName, schema);
584
+ for (const r of [this, TypeRegistry.for(qualifiedName.split("#")[0])]) {
585
+ r.schemas.set(qualifiedName, schema);
586
+ }
573
587
  }
574
588
  getSchema(shapeId) {
575
589
  const id = this.normalizeShapeId(shapeId);
@@ -580,12 +594,17 @@ class TypeRegistry {
580
594
  }
581
595
  registerError(es, ctor) {
582
596
  const $error = es;
583
- const registry = TypeRegistry.for($error[1]);
584
- registry.schemas.set($error[1] + "#" + $error[2], $error);
585
- registry.exceptions.set($error, ctor);
597
+ const ns = $error[1];
598
+ for (const r of [this, TypeRegistry.for(ns)]) {
599
+ r.schemas.set(ns + "#" + $error[2], $error);
600
+ r.exceptions.set($error, ctor);
601
+ }
586
602
  }
587
603
  getErrorCtor(es) {
588
604
  const $error = es;
605
+ if (this.exceptions.has($error)) {
606
+ return this.exceptions.get($error);
607
+ }
589
608
  const registry = TypeRegistry.for($error[1]);
590
609
  return registry.exceptions.get($error);
591
610
  }
@@ -1,5 +1,6 @@
1
1
  import { RpcProtocol } from "@smithy/core/protocols";
2
- import { deref, NormalizedSchema, TypeRegistry } from "@smithy/core/schema";
2
+ import { TypeRegistry } from "@smithy/core/schema";
3
+ import { deref, NormalizedSchema } from "@smithy/core/schema";
3
4
  import { getSmithyContext } from "@smithy/util-middleware";
4
5
  import { CborCodec } from "./CborCodec";
5
6
  import { loadSmithyRpcV2CborErrorCode } from "./parseCborBody";
@@ -7,8 +8,8 @@ export class SmithyRpcV2CborProtocol extends RpcProtocol {
7
8
  codec = new CborCodec();
8
9
  serializer = this.codec.createSerializer();
9
10
  deserializer = this.codec.createDeserializer();
10
- constructor({ defaultNamespace }) {
11
- super({ defaultNamespace });
11
+ constructor({ defaultNamespace, errorTypeRegistries, }) {
12
+ super({ defaultNamespace, errorTypeRegistries });
12
13
  }
13
14
  getShapeId() {
14
15
  return "smithy.protocols#rpcv2Cbor";
@@ -52,15 +53,17 @@ export class SmithyRpcV2CborProtocol extends RpcProtocol {
52
53
  }
53
54
  async handleError(operationSchema, context, response, dataObject, metadata) {
54
55
  const errorName = loadSmithyRpcV2CborErrorCode(response, dataObject) ?? "Unknown";
55
- let namespace = this.options.defaultNamespace;
56
- if (errorName.includes("#")) {
57
- [namespace] = errorName.split("#");
58
- }
59
56
  const errorMetadata = {
60
57
  $metadata: metadata,
61
58
  $fault: response.statusCode <= 500 ? "client" : "server",
62
59
  };
63
- const registry = TypeRegistry.for(namespace);
60
+ let namespace = this.options.defaultNamespace;
61
+ if (errorName.includes("#")) {
62
+ [namespace] = errorName.split("#");
63
+ }
64
+ const registry = this.compositeErrorRegistry;
65
+ const nsRegistry = TypeRegistry.for(namespace);
66
+ registry.copyFrom(nsRegistry);
64
67
  let errorSchema;
65
68
  try {
66
69
  errorSchema = registry.getSchema(errorName);
@@ -69,10 +72,11 @@ export class SmithyRpcV2CborProtocol extends RpcProtocol {
69
72
  if (dataObject.Message) {
70
73
  dataObject.message = dataObject.Message;
71
74
  }
72
- const synthetic = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
73
- const baseExceptionSchema = synthetic.getBaseException();
75
+ const syntheticRegistry = TypeRegistry.for("smithy.ts.sdk.synthetic." + namespace);
76
+ registry.copyFrom(syntheticRegistry);
77
+ const baseExceptionSchema = registry.getBaseException();
74
78
  if (baseExceptionSchema) {
75
- const ErrorCtor = synthetic.getErrorCtor(baseExceptionSchema);
79
+ const ErrorCtor = registry.getErrorCtor(baseExceptionSchema);
76
80
  throw Object.assign(new ErrorCtor({ name: errorName }), errorMetadata, dataObject);
77
81
  }
78
82
  throw Object.assign(new Error(errorName), errorMetadata, dataObject);
@@ -1,11 +1,16 @@
1
- import { NormalizedSchema, translateTraits } from "@smithy/core/schema";
1
+ import { NormalizedSchema, translateTraits, TypeRegistry } from "@smithy/core/schema";
2
2
  import { HttpRequest, HttpResponse } from "@smithy/protocol-http";
3
3
  import { SerdeContext } from "./SerdeContext";
4
4
  export class HttpProtocol extends SerdeContext {
5
5
  options;
6
+ compositeErrorRegistry;
6
7
  constructor(options) {
7
8
  super();
8
9
  this.options = options;
10
+ this.compositeErrorRegistry = TypeRegistry.for(options.defaultNamespace);
11
+ for (const etr of options.errorTypeRegistries ?? []) {
12
+ this.compositeErrorRegistry.copyFrom(etr);
13
+ }
9
14
  }
10
15
  getRequestType() {
11
16
  return HttpRequest;