@aws-sdk/client-controlcatalog 3.551.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/LICENSE +201 -0
- package/README.md +256 -0
- package/dist-cjs/ControlCatalog.js +17 -0
- package/dist-cjs/ControlCatalogClient.js +56 -0
- package/dist-cjs/auth/httpAuthExtensionConfiguration.js +43 -0
- package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
- package/dist-cjs/commands/ListCommonControlsCommand.js +28 -0
- package/dist-cjs/commands/ListDomainsCommand.js +28 -0
- package/dist-cjs/commands/ListObjectivesCommand.js +28 -0
- package/dist-cjs/commands/index.js +6 -0
- package/dist-cjs/endpoint/EndpointParameters.js +18 -0
- package/dist-cjs/endpoint/endpointResolver.js +14 -0
- package/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +11 -0
- package/dist-cjs/models/ControlCatalogServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +64 -0
- package/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist-cjs/pagination/ListCommonControlsPaginator.js +7 -0
- package/dist-cjs/pagination/ListDomainsPaginator.js +7 -0
- package/dist-cjs/pagination/ListObjectivesPaginator.js +7 -0
- package/dist-cjs/pagination/index.js +7 -0
- package/dist-cjs/protocols/Aws_restJson1.js +256 -0
- package/dist-cjs/runtimeConfig.browser.js +39 -0
- package/dist-cjs/runtimeConfig.js +49 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +34 -0
- package/dist-cjs/runtimeExtensions.js +25 -0
- package/dist-es/ControlCatalog.js +13 -0
- package/dist-es/ControlCatalogClient.js +52 -0
- package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
- package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
- package/dist-es/commands/ListCommonControlsCommand.js +24 -0
- package/dist-es/commands/ListDomainsCommand.js +24 -0
- package/dist-es/commands/ListObjectivesCommand.js +24 -0
- package/dist-es/commands/index.js +3 -0
- package/dist-es/endpoint/EndpointParameters.js +14 -0
- package/dist-es/endpoint/endpointResolver.js +10 -0
- package/dist-es/endpoint/ruleset.js +4 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +6 -0
- package/dist-es/models/ControlCatalogServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +57 -0
- package/dist-es/pagination/Interfaces.js +1 -0
- package/dist-es/pagination/ListCommonControlsPaginator.js +4 -0
- package/dist-es/pagination/ListDomainsPaginator.js +4 -0
- package/dist-es/pagination/ListObjectivesPaginator.js +4 -0
- package/dist-es/pagination/index.js +4 -0
- package/dist-es/protocols/Aws_restJson1.js +247 -0
- package/dist-es/runtimeConfig.browser.js +34 -0
- package/dist-es/runtimeConfig.js +44 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +30 -0
- package/dist-es/runtimeExtensions.js +21 -0
- package/dist-types/ControlCatalog.d.ts +61 -0
- package/dist-types/ControlCatalogClient.d.ts +201 -0
- package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
- package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
- package/dist-types/commands/ListCommonControlsCommand.d.ts +99 -0
- package/dist-types/commands/ListDomainsCommand.d.ts +81 -0
- package/dist-types/commands/ListObjectivesCommand.d.ts +94 -0
- package/dist-types/commands/index.d.ts +3 -0
- package/dist-types/endpoint/EndpointParameters.d.ts +40 -0
- package/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist-types/extensionConfiguration.d.ts +9 -0
- package/dist-types/index.d.ts +41 -0
- package/dist-types/models/ControlCatalogServiceException.d.ts +13 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +350 -0
- package/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist-types/pagination/ListCommonControlsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListDomainsPaginator.d.ts +7 -0
- package/dist-types/pagination/ListObjectivesPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +4 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +29 -0
- package/dist-types/runtimeConfig.browser.d.ts +45 -0
- package/dist-types/runtimeConfig.d.ts +45 -0
- package/dist-types/runtimeConfig.native.d.ts +44 -0
- package/dist-types/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/dist-types/ts3.4/ControlCatalog.d.ts +61 -0
- package/dist-types/ts3.4/ControlCatalogClient.d.ts +139 -0
- package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
- package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
- package/dist-types/ts3.4/commands/ListCommonControlsCommand.d.ts +39 -0
- package/dist-types/ts3.4/commands/ListDomainsCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/ListObjectivesCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/index.d.ts +3 -0
- package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
- package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
- package/dist-types/ts3.4/index.d.ts +9 -0
- package/dist-types/ts3.4/models/ControlCatalogServiceException.d.ts +8 -0
- package/dist-types/ts3.4/models/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +108 -0
- package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
- package/dist-types/ts3.4/pagination/ListCommonControlsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListDomainsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/ListObjectivesPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +4 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +41 -0
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +85 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +89 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +79 -0
- package/dist-types/ts3.4/runtimeConfig.shared.d.ts +21 -0
- package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
- package/package.json +101 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimeExtensions = void 0;
|
|
4
|
+
const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
|
|
5
|
+
const protocol_http_1 = require("@smithy/protocol-http");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
const httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
|
|
8
|
+
const asPartial = (t) => t;
|
|
9
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
10
|
+
const extensionConfiguration = {
|
|
11
|
+
...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
|
|
12
|
+
...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
13
|
+
...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
|
|
14
|
+
...asPartial((0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig)),
|
|
15
|
+
};
|
|
16
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
17
|
+
return {
|
|
18
|
+
...runtimeConfig,
|
|
19
|
+
...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
20
|
+
...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
21
|
+
...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
22
|
+
...(0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration),
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
2
|
+
import { ListCommonControlsCommand, } from "./commands/ListCommonControlsCommand";
|
|
3
|
+
import { ListDomainsCommand } from "./commands/ListDomainsCommand";
|
|
4
|
+
import { ListObjectivesCommand, } from "./commands/ListObjectivesCommand";
|
|
5
|
+
import { ControlCatalogClient } from "./ControlCatalogClient";
|
|
6
|
+
const commands = {
|
|
7
|
+
ListCommonControlsCommand,
|
|
8
|
+
ListDomainsCommand,
|
|
9
|
+
ListObjectivesCommand,
|
|
10
|
+
};
|
|
11
|
+
export class ControlCatalog extends ControlCatalogClient {
|
|
12
|
+
}
|
|
13
|
+
createAggregatedClient(commands, ControlCatalog);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
|
|
2
|
+
import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
|
|
3
|
+
import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
|
|
4
|
+
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
5
|
+
import { resolveRegionConfig } from "@smithy/config-resolver";
|
|
6
|
+
import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
|
|
7
|
+
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
8
|
+
import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
|
|
9
|
+
import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
|
|
10
|
+
import { Client as __Client, } from "@smithy/smithy-client";
|
|
11
|
+
import { defaultControlCatalogHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
|
|
12
|
+
import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
|
|
13
|
+
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
|
|
14
|
+
import { resolveRuntimeExtensions } from "./runtimeExtensions";
|
|
15
|
+
export { __Client };
|
|
16
|
+
export class ControlCatalogClient extends __Client {
|
|
17
|
+
constructor(...[configuration]) {
|
|
18
|
+
const _config_0 = __getRuntimeConfig(configuration || {});
|
|
19
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
20
|
+
const _config_2 = resolveRegionConfig(_config_1);
|
|
21
|
+
const _config_3 = resolveEndpointConfig(_config_2);
|
|
22
|
+
const _config_4 = resolveRetryConfig(_config_3);
|
|
23
|
+
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
24
|
+
const _config_6 = resolveUserAgentConfig(_config_5);
|
|
25
|
+
const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
|
|
26
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
|
|
27
|
+
super(_config_8);
|
|
28
|
+
this.config = _config_8;
|
|
29
|
+
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
30
|
+
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
31
|
+
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
32
|
+
this.middlewareStack.use(getLoggerPlugin(this.config));
|
|
33
|
+
this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
|
|
34
|
+
this.middlewareStack.use(getUserAgentPlugin(this.config));
|
|
35
|
+
this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
36
|
+
httpAuthSchemeParametersProvider: this.getDefaultHttpAuthSchemeParametersProvider(),
|
|
37
|
+
identityProviderConfigProvider: this.getIdentityProviderConfigProvider(),
|
|
38
|
+
}));
|
|
39
|
+
this.middlewareStack.use(getHttpSigningPlugin(this.config));
|
|
40
|
+
}
|
|
41
|
+
destroy() {
|
|
42
|
+
super.destroy();
|
|
43
|
+
}
|
|
44
|
+
getDefaultHttpAuthSchemeParametersProvider() {
|
|
45
|
+
return defaultControlCatalogHttpAuthSchemeParametersProvider;
|
|
46
|
+
}
|
|
47
|
+
getIdentityProviderConfigProvider() {
|
|
48
|
+
return async (config) => new DefaultIdentityProviderConfig({
|
|
49
|
+
"aws.auth#sigv4": config.credentials,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
2
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
3
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
4
|
+
let _credentials = runtimeConfig.credentials;
|
|
5
|
+
return {
|
|
6
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
7
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
8
|
+
if (index === -1) {
|
|
9
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
httpAuthSchemes() {
|
|
16
|
+
return _httpAuthSchemes;
|
|
17
|
+
},
|
|
18
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
19
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
20
|
+
},
|
|
21
|
+
httpAuthSchemeProvider() {
|
|
22
|
+
return _httpAuthSchemeProvider;
|
|
23
|
+
},
|
|
24
|
+
setCredentials(credentials) {
|
|
25
|
+
_credentials = credentials;
|
|
26
|
+
},
|
|
27
|
+
credentials() {
|
|
28
|
+
return _credentials;
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export const resolveHttpAuthRuntimeConfig = (config) => {
|
|
33
|
+
return {
|
|
34
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
35
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
36
|
+
credentials: config.credentials(),
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { resolveAwsSdkSigV4Config, } from "@aws-sdk/core";
|
|
2
|
+
import { getSmithyContext, normalizeProvider } from "@smithy/util-middleware";
|
|
3
|
+
export const defaultControlCatalogHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
4
|
+
return {
|
|
5
|
+
operation: getSmithyContext(context).operation,
|
|
6
|
+
region: (await normalizeProvider(config.region)()) ||
|
|
7
|
+
(() => {
|
|
8
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
9
|
+
})(),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
13
|
+
return {
|
|
14
|
+
schemeId: "aws.auth#sigv4",
|
|
15
|
+
signingProperties: {
|
|
16
|
+
name: "controlcatalog",
|
|
17
|
+
region: authParameters.region,
|
|
18
|
+
},
|
|
19
|
+
propertiesExtractor: (config, context) => ({
|
|
20
|
+
signingProperties: {
|
|
21
|
+
config,
|
|
22
|
+
context,
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export const defaultControlCatalogHttpAuthSchemeProvider = (authParameters) => {
|
|
28
|
+
const options = [];
|
|
29
|
+
switch (authParameters.operation) {
|
|
30
|
+
default: {
|
|
31
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return options;
|
|
35
|
+
};
|
|
36
|
+
export const resolveHttpAuthSchemeConfig = (config) => {
|
|
37
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
38
|
+
return {
|
|
39
|
+
...config_0,
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
+
import { de_ListCommonControlsCommand, se_ListCommonControlsCommand } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class ListCommonControlsCommand extends $Command
|
|
8
|
+
.classBuilder()
|
|
9
|
+
.ep({
|
|
10
|
+
...commonParams,
|
|
11
|
+
})
|
|
12
|
+
.m(function (Command, cs, config, o) {
|
|
13
|
+
return [
|
|
14
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
15
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
16
|
+
];
|
|
17
|
+
})
|
|
18
|
+
.s("ControlCatalog", "ListCommonControls", {})
|
|
19
|
+
.n("ControlCatalogClient", "ListCommonControlsCommand")
|
|
20
|
+
.f(void 0, void 0)
|
|
21
|
+
.ser(se_ListCommonControlsCommand)
|
|
22
|
+
.de(de_ListCommonControlsCommand)
|
|
23
|
+
.build() {
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
+
import { de_ListDomainsCommand, se_ListDomainsCommand } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class ListDomainsCommand extends $Command
|
|
8
|
+
.classBuilder()
|
|
9
|
+
.ep({
|
|
10
|
+
...commonParams,
|
|
11
|
+
})
|
|
12
|
+
.m(function (Command, cs, config, o) {
|
|
13
|
+
return [
|
|
14
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
15
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
16
|
+
];
|
|
17
|
+
})
|
|
18
|
+
.s("ControlCatalog", "ListDomains", {})
|
|
19
|
+
.n("ControlCatalogClient", "ListDomainsCommand")
|
|
20
|
+
.f(void 0, void 0)
|
|
21
|
+
.ser(se_ListDomainsCommand)
|
|
22
|
+
.de(de_ListDomainsCommand)
|
|
23
|
+
.build() {
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
+
import { de_ListObjectivesCommand, se_ListObjectivesCommand } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class ListObjectivesCommand extends $Command
|
|
8
|
+
.classBuilder()
|
|
9
|
+
.ep({
|
|
10
|
+
...commonParams,
|
|
11
|
+
})
|
|
12
|
+
.m(function (Command, cs, config, o) {
|
|
13
|
+
return [
|
|
14
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
15
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
16
|
+
];
|
|
17
|
+
})
|
|
18
|
+
.s("ControlCatalog", "ListObjectives", {})
|
|
19
|
+
.n("ControlCatalogClient", "ListObjectivesCommand")
|
|
20
|
+
.f(void 0, void 0)
|
|
21
|
+
.ser(se_ListObjectivesCommand)
|
|
22
|
+
.de(de_ListObjectivesCommand)
|
|
23
|
+
.build() {
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const resolveClientEndpointParameters = (options) => {
|
|
2
|
+
return {
|
|
3
|
+
...options,
|
|
4
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
5
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
6
|
+
defaultSigningName: "controlcatalog",
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export const commonParams = {
|
|
10
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
11
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
12
|
+
Region: { type: "builtInParams", name: "region" },
|
|
13
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
14
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
|
|
2
|
+
import { customEndpointFunctions, resolveEndpoint } from "@smithy/util-endpoints";
|
|
3
|
+
import { ruleSet } from "./ruleset";
|
|
4
|
+
export const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
5
|
+
return resolveEndpoint(ruleSet, {
|
|
6
|
+
endpointParams: endpointParams,
|
|
7
|
+
logger: context.logger,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const s = "required", t = "fn", u = "argv", v = "ref";
|
|
2
|
+
const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = { [s]: false, "type": "String" }, i = { [s]: true, "default": false, "type": "Boolean" }, j = { [v]: "Endpoint" }, k = { [t]: c, [u]: [{ [v]: "UseFIPS" }, true] }, l = { [t]: c, [u]: [{ [v]: "UseDualStack" }, true] }, m = {}, n = { [t]: "getAttr", [u]: [{ [v]: g }, "supportsFIPS"] }, o = { [t]: c, [u]: [true, { [t]: "getAttr", [u]: [{ [v]: g }, "supportsDualStack"] }] }, p = [k], q = [l], r = [{ [v]: "Region" }];
|
|
3
|
+
const _data = { version: "1.0", parameters: { Region: h, UseDualStack: i, UseFIPS: i, Endpoint: h }, rules: [{ conditions: [{ [t]: b, [u]: [j] }], rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { url: j, properties: m, headers: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [t]: b, [u]: r }], rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: g }], rules: [{ conditions: [k, l], rules: [{ conditions: [{ [t]: c, [u]: [a, n] }, o], rules: [{ rules: [{ endpoint: { url: "https://controlcatalog-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: p, rules: [{ conditions: [{ [t]: c, [u]: [n, a] }], rules: [{ rules: [{ endpoint: { url: "https://controlcatalog-fips.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: q, rules: [{ conditions: [o], rules: [{ rules: [{ endpoint: { url: "https://controlcatalog.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { rules: [{ endpoint: { url: "https://controlcatalog.{Region}.{PartitionResult#dnsSuffix}", properties: m, headers: m }, type: e }], type: f }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] };
|
|
4
|
+
export const ruleSet = _data;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist-es/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
|
|
2
|
+
export { __ServiceException };
|
|
3
|
+
export class ControlCatalogServiceException extends __ServiceException {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
Object.setPrototypeOf(this, ControlCatalogServiceException.prototype);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./models_0";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ControlCatalogServiceException as __BaseException } from "./ControlCatalogServiceException";
|
|
2
|
+
export class AccessDeniedException extends __BaseException {
|
|
3
|
+
constructor(opts) {
|
|
4
|
+
super({
|
|
5
|
+
name: "AccessDeniedException",
|
|
6
|
+
$fault: "client",
|
|
7
|
+
...opts,
|
|
8
|
+
});
|
|
9
|
+
this.name = "AccessDeniedException";
|
|
10
|
+
this.$fault = "client";
|
|
11
|
+
Object.setPrototypeOf(this, AccessDeniedException.prototype);
|
|
12
|
+
this.Message = opts.Message;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class InternalServerException extends __BaseException {
|
|
16
|
+
constructor(opts) {
|
|
17
|
+
super({
|
|
18
|
+
name: "InternalServerException",
|
|
19
|
+
$fault: "server",
|
|
20
|
+
...opts,
|
|
21
|
+
});
|
|
22
|
+
this.name = "InternalServerException";
|
|
23
|
+
this.$fault = "server";
|
|
24
|
+
this.$retryable = {};
|
|
25
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
26
|
+
this.Message = opts.Message;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class ThrottlingException extends __BaseException {
|
|
30
|
+
constructor(opts) {
|
|
31
|
+
super({
|
|
32
|
+
name: "ThrottlingException",
|
|
33
|
+
$fault: "client",
|
|
34
|
+
...opts,
|
|
35
|
+
});
|
|
36
|
+
this.name = "ThrottlingException";
|
|
37
|
+
this.$fault = "client";
|
|
38
|
+
this.$retryable = {
|
|
39
|
+
throttling: true,
|
|
40
|
+
};
|
|
41
|
+
Object.setPrototypeOf(this, ThrottlingException.prototype);
|
|
42
|
+
this.Message = opts.Message;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export class ValidationException extends __BaseException {
|
|
46
|
+
constructor(opts) {
|
|
47
|
+
super({
|
|
48
|
+
name: "ValidationException",
|
|
49
|
+
$fault: "client",
|
|
50
|
+
...opts,
|
|
51
|
+
});
|
|
52
|
+
this.name = "ValidationException";
|
|
53
|
+
this.$fault = "client";
|
|
54
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
55
|
+
this.Message = opts.Message;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createPaginator } from "@smithy/core";
|
|
2
|
+
import { ListCommonControlsCommand, } from "../commands/ListCommonControlsCommand";
|
|
3
|
+
import { ControlCatalogClient } from "../ControlCatalogClient";
|
|
4
|
+
export const paginateListCommonControls = createPaginator(ControlCatalogClient, ListCommonControlsCommand, "NextToken", "NextToken", "MaxResults");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createPaginator } from "@smithy/core";
|
|
2
|
+
import { ListDomainsCommand } from "../commands/ListDomainsCommand";
|
|
3
|
+
import { ControlCatalogClient } from "../ControlCatalogClient";
|
|
4
|
+
export const paginateListDomains = createPaginator(ControlCatalogClient, ListDomainsCommand, "NextToken", "NextToken", "MaxResults");
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createPaginator } from "@smithy/core";
|
|
2
|
+
import { ListObjectivesCommand, } from "../commands/ListObjectivesCommand";
|
|
3
|
+
import { ControlCatalogClient } from "../ControlCatalogClient";
|
|
4
|
+
export const paginateListObjectives = createPaginator(ControlCatalogClient, ListObjectivesCommand, "NextToken", "NextToken", "MaxResults");
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
2
|
+
import { requestBuilder as rb } from "@smithy/core";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { ControlCatalogServiceException as __BaseException } from "../models/ControlCatalogServiceException";
|
|
5
|
+
import { AccessDeniedException, InternalServerException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
|
+
export const se_ListCommonControlsCommand = async (input, context) => {
|
|
7
|
+
const b = rb(input, context);
|
|
8
|
+
const headers = {
|
|
9
|
+
"content-type": "application/json",
|
|
10
|
+
};
|
|
11
|
+
b.bp("/common-controls");
|
|
12
|
+
const query = map({
|
|
13
|
+
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
|
|
14
|
+
[_nT]: [, input[_NT]],
|
|
15
|
+
});
|
|
16
|
+
let body;
|
|
17
|
+
body = JSON.stringify(take(input, {
|
|
18
|
+
CommonControlFilter: (_) => _json(_),
|
|
19
|
+
}));
|
|
20
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
21
|
+
return b.build();
|
|
22
|
+
};
|
|
23
|
+
export const se_ListDomainsCommand = async (input, context) => {
|
|
24
|
+
const b = rb(input, context);
|
|
25
|
+
const headers = {};
|
|
26
|
+
b.bp("/domains");
|
|
27
|
+
const query = map({
|
|
28
|
+
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
|
|
29
|
+
[_nT]: [, input[_NT]],
|
|
30
|
+
});
|
|
31
|
+
let body;
|
|
32
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
33
|
+
return b.build();
|
|
34
|
+
};
|
|
35
|
+
export const se_ListObjectivesCommand = async (input, context) => {
|
|
36
|
+
const b = rb(input, context);
|
|
37
|
+
const headers = {
|
|
38
|
+
"content-type": "application/json",
|
|
39
|
+
};
|
|
40
|
+
b.bp("/objectives");
|
|
41
|
+
const query = map({
|
|
42
|
+
[_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
|
|
43
|
+
[_nT]: [, input[_NT]],
|
|
44
|
+
});
|
|
45
|
+
let body;
|
|
46
|
+
body = JSON.stringify(take(input, {
|
|
47
|
+
ObjectiveFilter: (_) => _json(_),
|
|
48
|
+
}));
|
|
49
|
+
b.m("POST").h(headers).q(query).b(body);
|
|
50
|
+
return b.build();
|
|
51
|
+
};
|
|
52
|
+
export const de_ListCommonControlsCommand = async (output, context) => {
|
|
53
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
54
|
+
return de_CommandError(output, context);
|
|
55
|
+
}
|
|
56
|
+
const contents = map({
|
|
57
|
+
$metadata: deserializeMetadata(output),
|
|
58
|
+
});
|
|
59
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
60
|
+
const doc = take(data, {
|
|
61
|
+
CommonControls: (_) => de_CommonControlSummaryList(_, context),
|
|
62
|
+
NextToken: __expectString,
|
|
63
|
+
});
|
|
64
|
+
Object.assign(contents, doc);
|
|
65
|
+
return contents;
|
|
66
|
+
};
|
|
67
|
+
export const de_ListDomainsCommand = async (output, context) => {
|
|
68
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
69
|
+
return de_CommandError(output, context);
|
|
70
|
+
}
|
|
71
|
+
const contents = map({
|
|
72
|
+
$metadata: deserializeMetadata(output),
|
|
73
|
+
});
|
|
74
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
75
|
+
const doc = take(data, {
|
|
76
|
+
Domains: (_) => de_DomainSummaryList(_, context),
|
|
77
|
+
NextToken: __expectString,
|
|
78
|
+
});
|
|
79
|
+
Object.assign(contents, doc);
|
|
80
|
+
return contents;
|
|
81
|
+
};
|
|
82
|
+
export const de_ListObjectivesCommand = async (output, context) => {
|
|
83
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
84
|
+
return de_CommandError(output, context);
|
|
85
|
+
}
|
|
86
|
+
const contents = map({
|
|
87
|
+
$metadata: deserializeMetadata(output),
|
|
88
|
+
});
|
|
89
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
90
|
+
const doc = take(data, {
|
|
91
|
+
NextToken: __expectString,
|
|
92
|
+
Objectives: (_) => de_ObjectiveSummaryList(_, context),
|
|
93
|
+
});
|
|
94
|
+
Object.assign(contents, doc);
|
|
95
|
+
return contents;
|
|
96
|
+
};
|
|
97
|
+
const de_CommandError = async (output, context) => {
|
|
98
|
+
const parsedOutput = {
|
|
99
|
+
...output,
|
|
100
|
+
body: await parseErrorBody(output.body, context),
|
|
101
|
+
};
|
|
102
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
103
|
+
switch (errorCode) {
|
|
104
|
+
case "AccessDeniedException":
|
|
105
|
+
case "com.amazonaws.controlcatalog#AccessDeniedException":
|
|
106
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
107
|
+
case "InternalServerException":
|
|
108
|
+
case "com.amazonaws.controlcatalog#InternalServerException":
|
|
109
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
110
|
+
case "ThrottlingException":
|
|
111
|
+
case "com.amazonaws.controlcatalog#ThrottlingException":
|
|
112
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
113
|
+
case "ValidationException":
|
|
114
|
+
case "com.amazonaws.controlcatalog#ValidationException":
|
|
115
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
116
|
+
default:
|
|
117
|
+
const parsedBody = parsedOutput.body;
|
|
118
|
+
return throwDefaultError({
|
|
119
|
+
output,
|
|
120
|
+
parsedBody,
|
|
121
|
+
errorCode,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const throwDefaultError = withBaseException(__BaseException);
|
|
126
|
+
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
127
|
+
const contents = map({});
|
|
128
|
+
const data = parsedOutput.body;
|
|
129
|
+
const doc = take(data, {
|
|
130
|
+
Message: __expectString,
|
|
131
|
+
});
|
|
132
|
+
Object.assign(contents, doc);
|
|
133
|
+
const exception = new AccessDeniedException({
|
|
134
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
135
|
+
...contents,
|
|
136
|
+
});
|
|
137
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
138
|
+
};
|
|
139
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
140
|
+
const contents = map({});
|
|
141
|
+
const data = parsedOutput.body;
|
|
142
|
+
const doc = take(data, {
|
|
143
|
+
Message: __expectString,
|
|
144
|
+
});
|
|
145
|
+
Object.assign(contents, doc);
|
|
146
|
+
const exception = new InternalServerException({
|
|
147
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
148
|
+
...contents,
|
|
149
|
+
});
|
|
150
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
151
|
+
};
|
|
152
|
+
const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
153
|
+
const contents = map({});
|
|
154
|
+
const data = parsedOutput.body;
|
|
155
|
+
const doc = take(data, {
|
|
156
|
+
Message: __expectString,
|
|
157
|
+
});
|
|
158
|
+
Object.assign(contents, doc);
|
|
159
|
+
const exception = new ThrottlingException({
|
|
160
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
161
|
+
...contents,
|
|
162
|
+
});
|
|
163
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
164
|
+
};
|
|
165
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
166
|
+
const contents = map({});
|
|
167
|
+
const data = parsedOutput.body;
|
|
168
|
+
const doc = take(data, {
|
|
169
|
+
Message: __expectString,
|
|
170
|
+
});
|
|
171
|
+
Object.assign(contents, doc);
|
|
172
|
+
const exception = new ValidationException({
|
|
173
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
174
|
+
...contents,
|
|
175
|
+
});
|
|
176
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
177
|
+
};
|
|
178
|
+
const de_CommonControlSummary = (output, context) => {
|
|
179
|
+
return take(output, {
|
|
180
|
+
Arn: __expectString,
|
|
181
|
+
CreateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
182
|
+
Description: __expectString,
|
|
183
|
+
Domain: _json,
|
|
184
|
+
LastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
185
|
+
Name: __expectString,
|
|
186
|
+
Objective: _json,
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
const de_CommonControlSummaryList = (output, context) => {
|
|
190
|
+
const retVal = (output || [])
|
|
191
|
+
.filter((e) => e != null)
|
|
192
|
+
.map((entry) => {
|
|
193
|
+
return de_CommonControlSummary(entry, context);
|
|
194
|
+
});
|
|
195
|
+
return retVal;
|
|
196
|
+
};
|
|
197
|
+
const de_DomainSummary = (output, context) => {
|
|
198
|
+
return take(output, {
|
|
199
|
+
Arn: __expectString,
|
|
200
|
+
CreateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
201
|
+
Description: __expectString,
|
|
202
|
+
LastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
203
|
+
Name: __expectString,
|
|
204
|
+
});
|
|
205
|
+
};
|
|
206
|
+
const de_DomainSummaryList = (output, context) => {
|
|
207
|
+
const retVal = (output || [])
|
|
208
|
+
.filter((e) => e != null)
|
|
209
|
+
.map((entry) => {
|
|
210
|
+
return de_DomainSummary(entry, context);
|
|
211
|
+
});
|
|
212
|
+
return retVal;
|
|
213
|
+
};
|
|
214
|
+
const de_ObjectiveSummary = (output, context) => {
|
|
215
|
+
return take(output, {
|
|
216
|
+
Arn: __expectString,
|
|
217
|
+
CreateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
218
|
+
Description: __expectString,
|
|
219
|
+
Domain: _json,
|
|
220
|
+
LastUpdateTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
|
|
221
|
+
Name: __expectString,
|
|
222
|
+
});
|
|
223
|
+
};
|
|
224
|
+
const de_ObjectiveSummaryList = (output, context) => {
|
|
225
|
+
const retVal = (output || [])
|
|
226
|
+
.filter((e) => e != null)
|
|
227
|
+
.map((entry) => {
|
|
228
|
+
return de_ObjectiveSummary(entry, context);
|
|
229
|
+
});
|
|
230
|
+
return retVal;
|
|
231
|
+
};
|
|
232
|
+
const deserializeMetadata = (output) => ({
|
|
233
|
+
httpStatusCode: output.statusCode,
|
|
234
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
235
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
236
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
237
|
+
});
|
|
238
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
239
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
240
|
+
value !== null &&
|
|
241
|
+
value !== "" &&
|
|
242
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
243
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
244
|
+
const _MR = "MaxResults";
|
|
245
|
+
const _NT = "NextToken";
|
|
246
|
+
const _mR = "maxResults";
|
|
247
|
+
const _nT = "nextToken";
|