@aws-sdk/client-sustainability 3.1031.0 → 3.1033.0
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.
- package/dist-cjs/endpoint/bdd.js +41 -0
- package/dist-cjs/endpoint/endpointResolver.js +2 -2
- package/dist-es/endpoint/bdd.js +38 -0
- package/dist-es/endpoint/endpointResolver.js +3 -3
- package/dist-types/endpoint/bdd.d.ts +2 -0
- package/dist-types/ts3.4/endpoint/bdd.d.ts +2 -0
- package/package.json +6 -6
- package/dist-cjs/endpoint/ruleset.js +0 -7
- package/dist-es/endpoint/ruleset.js +0 -4
- package/dist-types/endpoint/ruleset.d.ts +0 -2
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +0 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bdd = void 0;
|
|
4
|
+
const util_endpoints_1 = require("@smithy/util-endpoints");
|
|
5
|
+
const k = "ref", l = "authSchemes", m = "name", n = "signingRegion";
|
|
6
|
+
const a = "isSet", b = "PartitionResult", c = "stringEquals", d = "sigv4", e = { [k]: "Endpoint" }, f = { "fn": "getAttr", "argv": [{ [k]: b }, "name"] }, g = { [m]: "sigv4a", "signingRegionSet": ["*"] }, h = { [l]: [g, { [m]: d, [n]: "us-gov-west-1" }] }, i = { [l]: [g, { [m]: d, [n]: "{PartitionResult#implicitGlobalRegion}" }] }, j = [{ [k]: "Region" }];
|
|
7
|
+
const _data = {
|
|
8
|
+
conditions: [
|
|
9
|
+
[a, [e]],
|
|
10
|
+
[a, j],
|
|
11
|
+
["aws.partition", j, b],
|
|
12
|
+
["booleanEquals", [{ [k]: "UseFIPS" }, true]],
|
|
13
|
+
[c, [f, "aws"]],
|
|
14
|
+
[c, [f, "aws-us-gov"]]
|
|
15
|
+
],
|
|
16
|
+
results: [
|
|
17
|
+
[-1],
|
|
18
|
+
[-1, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
19
|
+
[e, { [l]: [g, { [m]: d }] }],
|
|
20
|
+
["https://api.sustainability.{Region}.{PartitionResult#dualStackDnsSuffix}", { [l]: [g, { [m]: d, [n]: "us-east-1" }] }],
|
|
21
|
+
["https://sustainability.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
|
|
22
|
+
["https://sustainability-fips.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
|
|
23
|
+
["https://sustainability-fips.global.{PartitionResult#dualStackDnsSuffix}", i],
|
|
24
|
+
["https://sustainability.global.{PartitionResult#dualStackDnsSuffix}", i],
|
|
25
|
+
[-1, "Invalid Configuration: Missing Region"]
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
const root = 2;
|
|
29
|
+
const r = 100_000_000;
|
|
30
|
+
const nodes = new Int32Array([
|
|
31
|
+
-1, 1, -1,
|
|
32
|
+
0, 9, 3,
|
|
33
|
+
1, 4, r + 8,
|
|
34
|
+
2, 5, r + 8,
|
|
35
|
+
3, 8, 6,
|
|
36
|
+
4, r + 3, 7,
|
|
37
|
+
5, r + 4, r + 7,
|
|
38
|
+
5, r + 5, r + 6,
|
|
39
|
+
3, r + 1, r + 2,
|
|
40
|
+
]);
|
|
41
|
+
exports.bdd = util_endpoints_1.BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaultEndpointResolver = void 0;
|
|
4
4
|
const util_endpoints_1 = require("@aws-sdk/util-endpoints");
|
|
5
5
|
const util_endpoints_2 = require("@smithy/util-endpoints");
|
|
6
|
-
const
|
|
6
|
+
const bdd_1 = require("./bdd");
|
|
7
7
|
const cache = new util_endpoints_2.EndpointCache({
|
|
8
8
|
size: 50,
|
|
9
9
|
params: ["Endpoint", "Region", "UseFIPS"],
|
|
10
10
|
});
|
|
11
11
|
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
12
|
-
return cache.get(endpointParams, () => (0, util_endpoints_2.
|
|
12
|
+
return cache.get(endpointParams, () => (0, util_endpoints_2.decideEndpoint)(bdd_1.bdd, {
|
|
13
13
|
endpointParams: endpointParams,
|
|
14
14
|
logger: context.logger,
|
|
15
15
|
}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BinaryDecisionDiagram } from "@smithy/util-endpoints";
|
|
2
|
+
const k = "ref", l = "authSchemes", m = "name", n = "signingRegion";
|
|
3
|
+
const a = "isSet", b = "PartitionResult", c = "stringEquals", d = "sigv4", e = { [k]: "Endpoint" }, f = { "fn": "getAttr", "argv": [{ [k]: b }, "name"] }, g = { [m]: "sigv4a", "signingRegionSet": ["*"] }, h = { [l]: [g, { [m]: d, [n]: "us-gov-west-1" }] }, i = { [l]: [g, { [m]: d, [n]: "{PartitionResult#implicitGlobalRegion}" }] }, j = [{ [k]: "Region" }];
|
|
4
|
+
const _data = {
|
|
5
|
+
conditions: [
|
|
6
|
+
[a, [e]],
|
|
7
|
+
[a, j],
|
|
8
|
+
["aws.partition", j, b],
|
|
9
|
+
["booleanEquals", [{ [k]: "UseFIPS" }, true]],
|
|
10
|
+
[c, [f, "aws"]],
|
|
11
|
+
[c, [f, "aws-us-gov"]]
|
|
12
|
+
],
|
|
13
|
+
results: [
|
|
14
|
+
[-1],
|
|
15
|
+
[-1, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
16
|
+
[e, { [l]: [g, { [m]: d }] }],
|
|
17
|
+
["https://api.sustainability.{Region}.{PartitionResult#dualStackDnsSuffix}", { [l]: [g, { [m]: d, [n]: "us-east-1" }] }],
|
|
18
|
+
["https://sustainability.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
|
|
19
|
+
["https://sustainability-fips.us-gov.{PartitionResult#dualStackDnsSuffix}", h],
|
|
20
|
+
["https://sustainability-fips.global.{PartitionResult#dualStackDnsSuffix}", i],
|
|
21
|
+
["https://sustainability.global.{PartitionResult#dualStackDnsSuffix}", i],
|
|
22
|
+
[-1, "Invalid Configuration: Missing Region"]
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
const root = 2;
|
|
26
|
+
const r = 100_000_000;
|
|
27
|
+
const nodes = new Int32Array([
|
|
28
|
+
-1, 1, -1,
|
|
29
|
+
0, 9, 3,
|
|
30
|
+
1, 4, r + 8,
|
|
31
|
+
2, 5, r + 8,
|
|
32
|
+
3, 8, 6,
|
|
33
|
+
4, r + 3, 7,
|
|
34
|
+
5, r + 4, r + 7,
|
|
35
|
+
5, r + 5, r + 6,
|
|
36
|
+
3, r + 1, r + 2,
|
|
37
|
+
]);
|
|
38
|
+
export const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
|
|
2
|
-
import { customEndpointFunctions,
|
|
3
|
-
import {
|
|
2
|
+
import { customEndpointFunctions, decideEndpoint, EndpointCache } from "@smithy/util-endpoints";
|
|
3
|
+
import { bdd } from "./bdd";
|
|
4
4
|
const cache = new EndpointCache({
|
|
5
5
|
size: 50,
|
|
6
6
|
params: ["Endpoint", "Region", "UseFIPS"],
|
|
7
7
|
});
|
|
8
8
|
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
9
|
-
return cache.get(endpointParams, () =>
|
|
9
|
+
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
10
10
|
endpointParams: endpointParams,
|
|
11
11
|
logger: context.logger,
|
|
12
12
|
}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-sustainability",
|
|
3
3
|
"description": "AWS SDK for JavaScript Sustainability Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1033.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-sustainability",
|
|
@@ -21,18 +21,18 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
24
|
-
"@aws-sdk/core": "^3.974.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
24
|
+
"@aws-sdk/core": "^3.974.2",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "^3.972.33",
|
|
26
26
|
"@aws-sdk/middleware-host-header": "^3.972.10",
|
|
27
27
|
"@aws-sdk/middleware-logger": "^3.972.10",
|
|
28
28
|
"@aws-sdk/middleware-recursion-detection": "^3.972.11",
|
|
29
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
29
|
+
"@aws-sdk/middleware-user-agent": "^3.972.32",
|
|
30
30
|
"@aws-sdk/region-config-resolver": "^3.972.12",
|
|
31
|
-
"@aws-sdk/signature-v4-multi-region": "^3.996.
|
|
31
|
+
"@aws-sdk/signature-v4-multi-region": "^3.996.19",
|
|
32
32
|
"@aws-sdk/types": "^3.973.8",
|
|
33
33
|
"@aws-sdk/util-endpoints": "^3.996.7",
|
|
34
34
|
"@aws-sdk/util-user-agent-browser": "^3.972.10",
|
|
35
|
-
"@aws-sdk/util-user-agent-node": "^3.973.
|
|
35
|
+
"@aws-sdk/util-user-agent-node": "^3.973.18",
|
|
36
36
|
"@smithy/config-resolver": "^4.4.16",
|
|
37
37
|
"@smithy/core": "^3.23.15",
|
|
38
38
|
"@smithy/fetch-http-handler": "^5.3.17",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ruleSet = void 0;
|
|
4
|
-
const v = "argv", w = "ref", x = "authSchemes", y = "name", z = "signingRegion";
|
|
5
|
-
const a = true, b = false, c = "isSet", d = "error", e = "sigv4", f = "endpoint", g = "tree", h = "PartitionResult", i = "stringEquals", j = { "required": false, "type": "string" }, k = { [w]: "Endpoint" }, l = { "fn": "booleanEquals", [v]: [{ [w]: "UseFIPS" }, true] }, m = { [y]: "sigv4a", "signingRegionSet": ["*"] }, n = {}, o = { "fn": "getAttr", [v]: [{ [w]: h }, "name"] }, p = { "fn": "booleanEquals", [v]: [{ [w]: "UseFIPS" }, false] }, q = { "fn": i, [v]: [o, "aws-us-gov"] }, r = { [x]: [m, { [y]: e, [z]: "us-gov-west-1" }] }, s = { [x]: [m, { [y]: e, [z]: "{PartitionResult#implicitGlobalRegion}" }] }, t = [l], u = [{ [w]: "Region" }];
|
|
6
|
-
const _data = { version: "1.0", parameters: { UseFIPS: { required: a, default: b, type: "boolean" }, Endpoint: j, Region: j }, rules: [{ conditions: [{ fn: c, [v]: [k] }], rules: [{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: { [x]: [m, { [y]: e }] }, headers: n }, type: f }], type: g }, { rules: [{ conditions: [{ fn: c, [v]: u }], rules: [{ conditions: [{ fn: "aws.partition", [v]: u, assign: h }], rules: [{ conditions: [{ fn: i, [v]: [o, "aws"] }, p], endpoint: { url: "https://api.sustainability.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: { [x]: [m, { [y]: e, [z]: "us-east-1" }] }, headers: n }, type: f }, { conditions: [q, p], endpoint: { url: "https://sustainability.us-gov.{PartitionResult#dualStackDnsSuffix}", properties: r, headers: n }, type: f }, { conditions: [q, l], endpoint: { url: "https://sustainability-fips.us-gov.{PartitionResult#dualStackDnsSuffix}", properties: r, headers: n }, type: f }, { conditions: t, endpoint: { url: "https://sustainability-fips.global.{PartitionResult#dualStackDnsSuffix}", properties: s, headers: n }, type: f }, { endpoint: { url: "https://sustainability.global.{PartitionResult#dualStackDnsSuffix}", properties: s, headers: n }, type: f }], type: g }], type: g }, { error: "Invalid Configuration: Missing Region", type: d }], type: g }] };
|
|
7
|
-
exports.ruleSet = _data;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
const v = "argv", w = "ref", x = "authSchemes", y = "name", z = "signingRegion";
|
|
2
|
-
const a = true, b = false, c = "isSet", d = "error", e = "sigv4", f = "endpoint", g = "tree", h = "PartitionResult", i = "stringEquals", j = { "required": false, "type": "string" }, k = { [w]: "Endpoint" }, l = { "fn": "booleanEquals", [v]: [{ [w]: "UseFIPS" }, true] }, m = { [y]: "sigv4a", "signingRegionSet": ["*"] }, n = {}, o = { "fn": "getAttr", [v]: [{ [w]: h }, "name"] }, p = { "fn": "booleanEquals", [v]: [{ [w]: "UseFIPS" }, false] }, q = { "fn": i, [v]: [o, "aws-us-gov"] }, r = { [x]: [m, { [y]: e, [z]: "us-gov-west-1" }] }, s = { [x]: [m, { [y]: e, [z]: "{PartitionResult#implicitGlobalRegion}" }] }, t = [l], u = [{ [w]: "Region" }];
|
|
3
|
-
const _data = { version: "1.0", parameters: { UseFIPS: { required: a, default: b, type: "boolean" }, Endpoint: j, Region: j }, rules: [{ conditions: [{ fn: c, [v]: [k] }], rules: [{ conditions: t, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { endpoint: { url: k, properties: { [x]: [m, { [y]: e }] }, headers: n }, type: f }], type: g }, { rules: [{ conditions: [{ fn: c, [v]: u }], rules: [{ conditions: [{ fn: "aws.partition", [v]: u, assign: h }], rules: [{ conditions: [{ fn: i, [v]: [o, "aws"] }, p], endpoint: { url: "https://api.sustainability.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: { [x]: [m, { [y]: e, [z]: "us-east-1" }] }, headers: n }, type: f }, { conditions: [q, p], endpoint: { url: "https://sustainability.us-gov.{PartitionResult#dualStackDnsSuffix}", properties: r, headers: n }, type: f }, { conditions: [q, l], endpoint: { url: "https://sustainability-fips.us-gov.{PartitionResult#dualStackDnsSuffix}", properties: r, headers: n }, type: f }, { conditions: t, endpoint: { url: "https://sustainability-fips.global.{PartitionResult#dualStackDnsSuffix}", properties: s, headers: n }, type: f }, { endpoint: { url: "https://sustainability.global.{PartitionResult#dualStackDnsSuffix}", properties: s, headers: n }, type: f }], type: g }], type: g }, { error: "Invalid Configuration: Missing Region", type: d }], type: g }] };
|
|
4
|
-
export const ruleSet = _data;
|