@aws-sdk/client-machine-learning 3.489.0 → 3.495.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.
Files changed (75) hide show
  1. package/dist-cjs/MachineLearning.js +1 -67
  2. package/dist-cjs/MachineLearningClient.js +1 -43
  3. package/dist-cjs/auth/httpAuthExtensionConfiguration.js +1 -0
  4. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  5. package/dist-cjs/commands/AddTagsCommand.js +1 -28
  6. package/dist-cjs/commands/CreateBatchPredictionCommand.js +1 -28
  7. package/dist-cjs/commands/CreateDataSourceFromRDSCommand.js +1 -29
  8. package/dist-cjs/commands/CreateDataSourceFromRedshiftCommand.js +1 -29
  9. package/dist-cjs/commands/CreateDataSourceFromS3Command.js +1 -28
  10. package/dist-cjs/commands/CreateEvaluationCommand.js +1 -28
  11. package/dist-cjs/commands/CreateMLModelCommand.js +1 -28
  12. package/dist-cjs/commands/CreateRealtimeEndpointCommand.js +1 -28
  13. package/dist-cjs/commands/DeleteBatchPredictionCommand.js +1 -28
  14. package/dist-cjs/commands/DeleteDataSourceCommand.js +1 -28
  15. package/dist-cjs/commands/DeleteEvaluationCommand.js +1 -28
  16. package/dist-cjs/commands/DeleteMLModelCommand.js +1 -28
  17. package/dist-cjs/commands/DeleteRealtimeEndpointCommand.js +1 -28
  18. package/dist-cjs/commands/DeleteTagsCommand.js +1 -28
  19. package/dist-cjs/commands/DescribeBatchPredictionsCommand.js +1 -28
  20. package/dist-cjs/commands/DescribeDataSourcesCommand.js +1 -28
  21. package/dist-cjs/commands/DescribeEvaluationsCommand.js +1 -28
  22. package/dist-cjs/commands/DescribeMLModelsCommand.js +1 -28
  23. package/dist-cjs/commands/DescribeTagsCommand.js +1 -28
  24. package/dist-cjs/commands/GetBatchPredictionCommand.js +1 -28
  25. package/dist-cjs/commands/GetDataSourceCommand.js +1 -28
  26. package/dist-cjs/commands/GetEvaluationCommand.js +1 -28
  27. package/dist-cjs/commands/GetMLModelCommand.js +1 -28
  28. package/dist-cjs/commands/PredictCommand.js +1 -30
  29. package/dist-cjs/commands/UpdateBatchPredictionCommand.js +1 -28
  30. package/dist-cjs/commands/UpdateDataSourceCommand.js +1 -28
  31. package/dist-cjs/commands/UpdateEvaluationCommand.js +1 -28
  32. package/dist-cjs/commands/UpdateMLModelCommand.js +1 -28
  33. package/dist-cjs/commands/index.js +1 -31
  34. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  35. package/dist-cjs/extensionConfiguration.js +1 -2
  36. package/dist-cjs/index.js +2979 -12
  37. package/dist-cjs/models/MachineLearningServiceException.js +1 -12
  38. package/dist-cjs/models/index.js +1 -4
  39. package/dist-cjs/models/models_0.js +1 -223
  40. package/dist-cjs/pagination/DescribeBatchPredictionsPaginator.js +1 -7
  41. package/dist-cjs/pagination/DescribeDataSourcesPaginator.js +1 -7
  42. package/dist-cjs/pagination/DescribeEvaluationsPaginator.js +1 -7
  43. package/dist-cjs/pagination/DescribeMLModelsPaginator.js +1 -7
  44. package/dist-cjs/pagination/Interfaces.js +1 -2
  45. package/dist-cjs/pagination/index.js +1 -8
  46. package/dist-cjs/protocols/Aws_json1_1.js +1 -1720
  47. package/dist-cjs/runtimeConfig.shared.js +10 -0
  48. package/dist-cjs/runtimeExtensions.js +1 -22
  49. package/dist-cjs/waiters/index.js +1 -7
  50. package/dist-cjs/waiters/waitForBatchPredictionAvailable.js +1 -59
  51. package/dist-cjs/waiters/waitForDataSourceAvailable.js +1 -59
  52. package/dist-cjs/waiters/waitForEvaluationAvailable.js +1 -59
  53. package/dist-cjs/waiters/waitForMLModelAvailable.js +1 -59
  54. package/dist-es/MachineLearningClient.js +17 -4
  55. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  56. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  57. package/dist-es/runtimeConfig.shared.js +10 -0
  58. package/dist-es/runtimeExtensions.js +3 -0
  59. package/dist-types/MachineLearningClient.d.ts +13 -11
  60. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  61. package/dist-types/auth/httpAuthSchemeProvider.d.ts +61 -0
  62. package/dist-types/extensionConfiguration.d.ts +2 -1
  63. package/dist-types/runtimeConfig.browser.d.ts +5 -3
  64. package/dist-types/runtimeConfig.d.ts +5 -3
  65. package/dist-types/runtimeConfig.native.d.ts +6 -4
  66. package/dist-types/runtimeConfig.shared.d.ts +2 -0
  67. package/dist-types/ts3.4/MachineLearningClient.d.ts +11 -9
  68. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  69. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +44 -0
  70. package/dist-types/ts3.4/extensionConfiguration.d.ts +3 -1
  71. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +5 -5
  72. package/dist-types/ts3.4/runtimeConfig.d.ts +5 -5
  73. package/dist-types/ts3.4/runtimeConfig.native.d.ts +8 -8
  74. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +2 -0
  75. package/package.json +42 -42
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getRuntimeConfig = void 0;
4
+ const core_1 = require("@aws-sdk/core");
4
5
  const smithy_client_1 = require("@smithy/smithy-client");
5
6
  const url_parser_1 = require("@smithy/url-parser");
6
7
  const util_base64_1 = require("@smithy/util-base64");
7
8
  const util_utf8_1 = require("@smithy/util-utf8");
9
+ const httpAuthSchemeProvider_1 = require("./auth/httpAuthSchemeProvider");
8
10
  const endpointResolver_1 = require("./endpoint/endpointResolver");
9
11
  const getRuntimeConfig = (config) => {
10
12
  return {
@@ -14,6 +16,14 @@ const getRuntimeConfig = (config) => {
14
16
  disableHostPrefix: config?.disableHostPrefix ?? false,
15
17
  endpointProvider: config?.endpointProvider ?? endpointResolver_1.defaultEndpointResolver,
16
18
  extensions: config?.extensions ?? [],
19
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? httpAuthSchemeProvider_1.defaultMachineLearningHttpAuthSchemeProvider,
20
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
21
+ {
22
+ schemeId: "aws.auth#sigv4",
23
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
24
+ signer: new core_1.AwsSdkSigV4Signer(),
25
+ },
26
+ ],
17
27
  logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
18
28
  serviceId: config?.serviceId ?? "Machine Learning",
19
29
  urlParser: config?.urlParser ?? url_parser_1.parseUrl,
@@ -1,22 +1 @@
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 asPartial = (t) => t;
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = {
10
- ...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
11
- ...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
12
- ...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
13
- };
14
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
15
- return {
16
- ...runtimeConfig,
17
- ...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
18
- ...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
19
- ...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
20
- };
21
- };
22
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
1
+ module.exports = require("./index.js");
@@ -1,7 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./waitForBatchPredictionAvailable"), exports);
5
- tslib_1.__exportStar(require("./waitForDataSourceAvailable"), exports);
6
- tslib_1.__exportStar(require("./waitForEvaluationAvailable"), exports);
7
- tslib_1.__exportStar(require("./waitForMLModelAvailable"), exports);
1
+ module.exports = require("../index.js");
@@ -1,59 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitUntilBatchPredictionAvailable = exports.waitForBatchPredictionAvailable = void 0;
4
- const util_waiter_1 = require("@smithy/util-waiter");
5
- const DescribeBatchPredictionsCommand_1 = require("../commands/DescribeBatchPredictionsCommand");
6
- const checkState = async (client, input) => {
7
- let reason;
8
- try {
9
- const result = await client.send(new DescribeBatchPredictionsCommand_1.DescribeBatchPredictionsCommand(input));
10
- reason = result;
11
- try {
12
- const returnComparator = () => {
13
- const flat_1 = [].concat(...result.Results);
14
- const projection_3 = flat_1.map((element_2) => {
15
- return element_2.Status;
16
- });
17
- return projection_3;
18
- };
19
- let allStringEq_5 = returnComparator().length > 0;
20
- for (const element_4 of returnComparator()) {
21
- allStringEq_5 = allStringEq_5 && element_4 == "COMPLETED";
22
- }
23
- if (allStringEq_5) {
24
- return { state: util_waiter_1.WaiterState.SUCCESS, reason };
25
- }
26
- }
27
- catch (e) { }
28
- try {
29
- const returnComparator = () => {
30
- const flat_1 = [].concat(...result.Results);
31
- const projection_3 = flat_1.map((element_2) => {
32
- return element_2.Status;
33
- });
34
- return projection_3;
35
- };
36
- for (const anyStringEq_4 of returnComparator()) {
37
- if (anyStringEq_4 == "FAILED") {
38
- return { state: util_waiter_1.WaiterState.FAILURE, reason };
39
- }
40
- }
41
- }
42
- catch (e) { }
43
- }
44
- catch (exception) {
45
- reason = exception;
46
- }
47
- return { state: util_waiter_1.WaiterState.RETRY, reason };
48
- };
49
- const waitForBatchPredictionAvailable = async (params, input) => {
50
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
51
- return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
52
- };
53
- exports.waitForBatchPredictionAvailable = waitForBatchPredictionAvailable;
54
- const waitUntilBatchPredictionAvailable = async (params, input) => {
55
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
56
- const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
57
- return (0, util_waiter_1.checkExceptions)(result);
58
- };
59
- exports.waitUntilBatchPredictionAvailable = waitUntilBatchPredictionAvailable;
1
+ module.exports = require("../index.js");
@@ -1,59 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitUntilDataSourceAvailable = exports.waitForDataSourceAvailable = void 0;
4
- const util_waiter_1 = require("@smithy/util-waiter");
5
- const DescribeDataSourcesCommand_1 = require("../commands/DescribeDataSourcesCommand");
6
- const checkState = async (client, input) => {
7
- let reason;
8
- try {
9
- const result = await client.send(new DescribeDataSourcesCommand_1.DescribeDataSourcesCommand(input));
10
- reason = result;
11
- try {
12
- const returnComparator = () => {
13
- const flat_1 = [].concat(...result.Results);
14
- const projection_3 = flat_1.map((element_2) => {
15
- return element_2.Status;
16
- });
17
- return projection_3;
18
- };
19
- let allStringEq_5 = returnComparator().length > 0;
20
- for (const element_4 of returnComparator()) {
21
- allStringEq_5 = allStringEq_5 && element_4 == "COMPLETED";
22
- }
23
- if (allStringEq_5) {
24
- return { state: util_waiter_1.WaiterState.SUCCESS, reason };
25
- }
26
- }
27
- catch (e) { }
28
- try {
29
- const returnComparator = () => {
30
- const flat_1 = [].concat(...result.Results);
31
- const projection_3 = flat_1.map((element_2) => {
32
- return element_2.Status;
33
- });
34
- return projection_3;
35
- };
36
- for (const anyStringEq_4 of returnComparator()) {
37
- if (anyStringEq_4 == "FAILED") {
38
- return { state: util_waiter_1.WaiterState.FAILURE, reason };
39
- }
40
- }
41
- }
42
- catch (e) { }
43
- }
44
- catch (exception) {
45
- reason = exception;
46
- }
47
- return { state: util_waiter_1.WaiterState.RETRY, reason };
48
- };
49
- const waitForDataSourceAvailable = async (params, input) => {
50
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
51
- return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
52
- };
53
- exports.waitForDataSourceAvailable = waitForDataSourceAvailable;
54
- const waitUntilDataSourceAvailable = async (params, input) => {
55
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
56
- const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
57
- return (0, util_waiter_1.checkExceptions)(result);
58
- };
59
- exports.waitUntilDataSourceAvailable = waitUntilDataSourceAvailable;
1
+ module.exports = require("../index.js");
@@ -1,59 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitUntilEvaluationAvailable = exports.waitForEvaluationAvailable = void 0;
4
- const util_waiter_1 = require("@smithy/util-waiter");
5
- const DescribeEvaluationsCommand_1 = require("../commands/DescribeEvaluationsCommand");
6
- const checkState = async (client, input) => {
7
- let reason;
8
- try {
9
- const result = await client.send(new DescribeEvaluationsCommand_1.DescribeEvaluationsCommand(input));
10
- reason = result;
11
- try {
12
- const returnComparator = () => {
13
- const flat_1 = [].concat(...result.Results);
14
- const projection_3 = flat_1.map((element_2) => {
15
- return element_2.Status;
16
- });
17
- return projection_3;
18
- };
19
- let allStringEq_5 = returnComparator().length > 0;
20
- for (const element_4 of returnComparator()) {
21
- allStringEq_5 = allStringEq_5 && element_4 == "COMPLETED";
22
- }
23
- if (allStringEq_5) {
24
- return { state: util_waiter_1.WaiterState.SUCCESS, reason };
25
- }
26
- }
27
- catch (e) { }
28
- try {
29
- const returnComparator = () => {
30
- const flat_1 = [].concat(...result.Results);
31
- const projection_3 = flat_1.map((element_2) => {
32
- return element_2.Status;
33
- });
34
- return projection_3;
35
- };
36
- for (const anyStringEq_4 of returnComparator()) {
37
- if (anyStringEq_4 == "FAILED") {
38
- return { state: util_waiter_1.WaiterState.FAILURE, reason };
39
- }
40
- }
41
- }
42
- catch (e) { }
43
- }
44
- catch (exception) {
45
- reason = exception;
46
- }
47
- return { state: util_waiter_1.WaiterState.RETRY, reason };
48
- };
49
- const waitForEvaluationAvailable = async (params, input) => {
50
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
51
- return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
52
- };
53
- exports.waitForEvaluationAvailable = waitForEvaluationAvailable;
54
- const waitUntilEvaluationAvailable = async (params, input) => {
55
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
56
- const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
57
- return (0, util_waiter_1.checkExceptions)(result);
58
- };
59
- exports.waitUntilEvaluationAvailable = waitUntilEvaluationAvailable;
1
+ module.exports = require("../index.js");
@@ -1,59 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitUntilMLModelAvailable = exports.waitForMLModelAvailable = void 0;
4
- const util_waiter_1 = require("@smithy/util-waiter");
5
- const DescribeMLModelsCommand_1 = require("../commands/DescribeMLModelsCommand");
6
- const checkState = async (client, input) => {
7
- let reason;
8
- try {
9
- const result = await client.send(new DescribeMLModelsCommand_1.DescribeMLModelsCommand(input));
10
- reason = result;
11
- try {
12
- const returnComparator = () => {
13
- const flat_1 = [].concat(...result.Results);
14
- const projection_3 = flat_1.map((element_2) => {
15
- return element_2.Status;
16
- });
17
- return projection_3;
18
- };
19
- let allStringEq_5 = returnComparator().length > 0;
20
- for (const element_4 of returnComparator()) {
21
- allStringEq_5 = allStringEq_5 && element_4 == "COMPLETED";
22
- }
23
- if (allStringEq_5) {
24
- return { state: util_waiter_1.WaiterState.SUCCESS, reason };
25
- }
26
- }
27
- catch (e) { }
28
- try {
29
- const returnComparator = () => {
30
- const flat_1 = [].concat(...result.Results);
31
- const projection_3 = flat_1.map((element_2) => {
32
- return element_2.Status;
33
- });
34
- return projection_3;
35
- };
36
- for (const anyStringEq_4 of returnComparator()) {
37
- if (anyStringEq_4 == "FAILED") {
38
- return { state: util_waiter_1.WaiterState.FAILURE, reason };
39
- }
40
- }
41
- }
42
- catch (e) { }
43
- }
44
- catch (exception) {
45
- reason = exception;
46
- }
47
- return { state: util_waiter_1.WaiterState.RETRY, reason };
48
- };
49
- const waitForMLModelAvailable = async (params, input) => {
50
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
51
- return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
52
- };
53
- exports.waitForMLModelAvailable = waitForMLModelAvailable;
54
- const waitUntilMLModelAvailable = async (params, input) => {
55
- const serviceDefaults = { minDelay: 30, maxDelay: 120 };
56
- const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
57
- return (0, util_waiter_1.checkExceptions)(result);
58
- };
59
- exports.waitUntilMLModelAvailable = waitUntilMLModelAvailable;
1
+ module.exports = require("../index.js");
@@ -1,13 +1,14 @@
1
1
  import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
2
2
  import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
3
3
  import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
4
- import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
5
4
  import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
5
  import { resolveRegionConfig } from "@smithy/config-resolver";
6
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
7
7
  import { getContentLengthPlugin } from "@smithy/middleware-content-length";
8
8
  import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
9
9
  import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
10
10
  import { Client as __Client, } from "@smithy/smithy-client";
11
+ import { defaultMachineLearningHttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
11
12
  import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
12
13
  import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
13
14
  import { resolveRuntimeExtensions } from "./runtimeExtensions";
@@ -20,8 +21,8 @@ export class MachineLearningClient extends __Client {
20
21
  const _config_3 = resolveEndpointConfig(_config_2);
21
22
  const _config_4 = resolveRetryConfig(_config_3);
22
23
  const _config_5 = resolveHostHeaderConfig(_config_4);
23
- const _config_6 = resolveAwsAuthConfig(_config_5);
24
- const _config_7 = resolveUserAgentConfig(_config_6);
24
+ const _config_6 = resolveUserAgentConfig(_config_5);
25
+ const _config_7 = resolveHttpAuthSchemeConfig(_config_6);
25
26
  const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
26
27
  super(_config_8);
27
28
  this.config = _config_8;
@@ -30,10 +31,22 @@ export class MachineLearningClient extends __Client {
30
31
  this.middlewareStack.use(getHostHeaderPlugin(this.config));
31
32
  this.middlewareStack.use(getLoggerPlugin(this.config));
32
33
  this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
33
- this.middlewareStack.use(getAwsAuthPlugin(this.config));
34
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));
35
40
  }
36
41
  destroy() {
37
42
  super.destroy();
38
43
  }
44
+ getDefaultHttpAuthSchemeParametersProvider() {
45
+ return defaultMachineLearningHttpAuthSchemeParametersProvider;
46
+ }
47
+ getIdentityProviderConfigProvider() {
48
+ return async (config) => new DefaultIdentityProviderConfig({
49
+ "aws.auth#sigv4": config.credentials,
50
+ });
51
+ }
39
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 defaultMachineLearningHttpAuthSchemeParametersProvider = 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: "machinelearning",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ export const defaultMachineLearningHttpAuthSchemeProvider = (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
+ };
@@ -1,7 +1,9 @@
1
+ import { AwsSdkSigV4Signer } from "@aws-sdk/core";
1
2
  import { NoOpLogger } from "@smithy/smithy-client";
2
3
  import { parseUrl } from "@smithy/url-parser";
3
4
  import { fromBase64, toBase64 } from "@smithy/util-base64";
4
5
  import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
6
+ import { defaultMachineLearningHttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
5
7
  import { defaultEndpointResolver } from "./endpoint/endpointResolver";
6
8
  export const getRuntimeConfig = (config) => {
7
9
  return {
@@ -11,6 +13,14 @@ export const getRuntimeConfig = (config) => {
11
13
  disableHostPrefix: config?.disableHostPrefix ?? false,
12
14
  endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
13
15
  extensions: config?.extensions ?? [],
16
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultMachineLearningHttpAuthSchemeProvider,
17
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
18
+ {
19
+ schemeId: "aws.auth#sigv4",
20
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
21
+ signer: new AwsSdkSigV4Signer(),
22
+ },
23
+ ],
14
24
  logger: config?.logger ?? new NoOpLogger(),
15
25
  serviceId: config?.serviceId ?? "Machine Learning",
16
26
  urlParser: config?.urlParser ?? parseUrl,
@@ -1,12 +1,14 @@
1
1
  import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
2
2
  import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
3
3
  import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
4
+ import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
4
5
  const asPartial = (t) => t;
5
6
  export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
6
7
  const extensionConfiguration = {
7
8
  ...asPartial(getAwsRegionExtensionConfiguration(runtimeConfig)),
8
9
  ...asPartial(getDefaultExtensionConfiguration(runtimeConfig)),
9
10
  ...asPartial(getHttpHandlerExtensionConfiguration(runtimeConfig)),
11
+ ...asPartial(getHttpAuthExtensionConfiguration(runtimeConfig)),
10
12
  };
11
13
  extensions.forEach((extension) => extension.configure(extensionConfiguration));
12
14
  return {
@@ -14,5 +16,6 @@ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
14
16
  ...resolveAwsRegionExtensionConfiguration(extensionConfiguration),
15
17
  ...resolveDefaultRuntimeConfig(extensionConfiguration),
16
18
  ...resolveHttpHandlerRuntimeConfig(extensionConfiguration),
19
+ ...resolveHttpAuthRuntimeConfig(extensionConfiguration),
17
20
  };
18
21
  };
@@ -1,13 +1,12 @@
1
1
  import { HostHeaderInputConfig, HostHeaderResolvedConfig } from "@aws-sdk/middleware-host-header";
2
- import { AwsAuthInputConfig, AwsAuthResolvedConfig } from "@aws-sdk/middleware-signing";
3
2
  import { UserAgentInputConfig, UserAgentResolvedConfig } from "@aws-sdk/middleware-user-agent";
4
- import { Credentials as __Credentials } from "@aws-sdk/types";
5
3
  import { RegionInputConfig, RegionResolvedConfig } from "@smithy/config-resolver";
6
4
  import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-endpoint";
7
5
  import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
8
6
  import { HttpHandler as __HttpHandler } from "@smithy/protocol-http";
9
7
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
10
- import { BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
8
+ import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
9
+ import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
11
10
  import { AddTagsCommandInput, AddTagsCommandOutput } from "./commands/AddTagsCommand";
12
11
  import { CreateBatchPredictionCommandInput, CreateBatchPredictionCommandOutput } from "./commands/CreateBatchPredictionCommand";
13
12
  import { CreateDataSourceFromRDSCommandInput, CreateDataSourceFromRDSCommandOutput } from "./commands/CreateDataSourceFromRDSCommand";
@@ -119,20 +118,21 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
119
118
  * Enables FIPS compatible endpoints.
120
119
  */
121
120
  useFipsEndpoint?: boolean | __Provider<boolean>;
121
+ /**
122
+ * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
123
+ * @internal
124
+ */
125
+ defaultUserAgentProvider?: Provider<__UserAgent>;
122
126
  /**
123
127
  * The AWS region to which this client will send requests
124
128
  */
125
129
  region?: string | __Provider<string>;
126
130
  /**
127
131
  * Default credentials provider; Not available in browser runtime.
132
+ * @deprecated
128
133
  * @internal
129
134
  */
130
- credentialDefaultProvider?: (input: any) => __Provider<__Credentials>;
131
- /**
132
- * The provider populating default tracking information to be sent with `user-agent`, `x-amz-user-agent` header
133
- * @internal
134
- */
135
- defaultUserAgentProvider?: Provider<__UserAgent>;
135
+ credentialDefaultProvider?: (input: any) => AwsCredentialIdentityProvider;
136
136
  /**
137
137
  * Value for how many times a request will be made at most in case of retry.
138
138
  */
@@ -159,7 +159,7 @@ export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__
159
159
  /**
160
160
  * @public
161
161
  */
162
- export type MachineLearningClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & AwsAuthInputConfig & UserAgentInputConfig & ClientInputEndpointParameters;
162
+ export type MachineLearningClientConfigType = Partial<__SmithyConfiguration<__HttpHandlerOptions>> & ClientDefaults & RegionInputConfig & EndpointInputConfig<EndpointParameters> & RetryInputConfig & HostHeaderInputConfig & UserAgentInputConfig & HttpAuthSchemeInputConfig & ClientInputEndpointParameters;
163
163
  /**
164
164
  * @public
165
165
  *
@@ -170,7 +170,7 @@ export interface MachineLearningClientConfig extends MachineLearningClientConfig
170
170
  /**
171
171
  * @public
172
172
  */
173
- export type MachineLearningClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & AwsAuthResolvedConfig & UserAgentResolvedConfig & ClientResolvedEndpointParameters;
173
+ export type MachineLearningClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHandlerOptions> & Required<ClientDefaults> & RuntimeExtensionsConfig & RegionResolvedConfig & EndpointResolvedConfig<EndpointParameters> & RetryResolvedConfig & HostHeaderResolvedConfig & UserAgentResolvedConfig & HttpAuthSchemeResolvedConfig & ClientResolvedEndpointParameters;
174
174
  /**
175
175
  * @public
176
176
  *
@@ -195,4 +195,6 @@ export declare class MachineLearningClient extends __Client<__HttpHandlerOptions
195
195
  * Otherwise, sockets might stay open for quite a long time before the server terminates them.
196
196
  */
197
197
  destroy(): void;
198
+ private getDefaultHttpAuthSchemeParametersProvider;
199
+ private getIdentityProviderConfigProvider;
198
200
  }
@@ -0,0 +1,29 @@
1
+ import { AwsCredentialIdentity, AwsCredentialIdentityProvider, HttpAuthScheme } from "@smithy/types";
2
+ import { MachineLearningHttpAuthSchemeProvider } from "./httpAuthSchemeProvider";
3
+ /**
4
+ * @internal
5
+ */
6
+ export interface HttpAuthExtensionConfiguration {
7
+ setHttpAuthScheme(httpAuthScheme: HttpAuthScheme): void;
8
+ httpAuthSchemes(): HttpAuthScheme[];
9
+ setHttpAuthSchemeProvider(httpAuthSchemeProvider: MachineLearningHttpAuthSchemeProvider): void;
10
+ httpAuthSchemeProvider(): MachineLearningHttpAuthSchemeProvider;
11
+ setCredentials(credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider): void;
12
+ credentials(): AwsCredentialIdentity | AwsCredentialIdentityProvider | undefined;
13
+ }
14
+ /**
15
+ * @internal
16
+ */
17
+ export type HttpAuthRuntimeConfig = Partial<{
18
+ httpAuthSchemes: HttpAuthScheme[];
19
+ httpAuthSchemeProvider: MachineLearningHttpAuthSchemeProvider;
20
+ credentials: AwsCredentialIdentity | AwsCredentialIdentityProvider;
21
+ }>;
22
+ /**
23
+ * @internal
24
+ */
25
+ export declare const getHttpAuthExtensionConfiguration: (runtimeConfig: HttpAuthRuntimeConfig) => HttpAuthExtensionConfiguration;
26
+ /**
27
+ * @internal
28
+ */
29
+ export declare const resolveHttpAuthRuntimeConfig: (config: HttpAuthExtensionConfiguration) => HttpAuthRuntimeConfig;
@@ -0,0 +1,61 @@
1
+ import { AwsSdkSigV4AuthInputConfig, AwsSdkSigV4AuthResolvedConfig, AwsSdkSigV4PreviouslyResolved } from "@aws-sdk/core";
2
+ import { HandlerExecutionContext, HttpAuthScheme, HttpAuthSchemeParameters, HttpAuthSchemeParametersProvider, HttpAuthSchemeProvider } from "@smithy/types";
3
+ import { MachineLearningClientResolvedConfig } from "../MachineLearningClient";
4
+ /**
5
+ * @internal
6
+ */
7
+ export interface MachineLearningHttpAuthSchemeParameters extends HttpAuthSchemeParameters {
8
+ region?: string;
9
+ }
10
+ /**
11
+ * @internal
12
+ */
13
+ export interface MachineLearningHttpAuthSchemeParametersProvider extends HttpAuthSchemeParametersProvider<MachineLearningClientResolvedConfig, HandlerExecutionContext, MachineLearningHttpAuthSchemeParameters, object> {
14
+ }
15
+ /**
16
+ * @internal
17
+ */
18
+ export declare const defaultMachineLearningHttpAuthSchemeParametersProvider: (config: MachineLearningClientResolvedConfig, context: HandlerExecutionContext, input: object) => Promise<MachineLearningHttpAuthSchemeParameters>;
19
+ /**
20
+ * @internal
21
+ */
22
+ export interface MachineLearningHttpAuthSchemeProvider extends HttpAuthSchemeProvider<MachineLearningHttpAuthSchemeParameters> {
23
+ }
24
+ /**
25
+ * @internal
26
+ */
27
+ export declare const defaultMachineLearningHttpAuthSchemeProvider: MachineLearningHttpAuthSchemeProvider;
28
+ /**
29
+ * @internal
30
+ */
31
+ export interface HttpAuthSchemeInputConfig extends AwsSdkSigV4AuthInputConfig {
32
+ /**
33
+ * experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
34
+ * @internal
35
+ */
36
+ httpAuthSchemes?: HttpAuthScheme[];
37
+ /**
38
+ * experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
39
+ * @internal
40
+ */
41
+ httpAuthSchemeProvider?: MachineLearningHttpAuthSchemeProvider;
42
+ }
43
+ /**
44
+ * @internal
45
+ */
46
+ export interface HttpAuthSchemeResolvedConfig extends AwsSdkSigV4AuthResolvedConfig {
47
+ /**
48
+ * experimentalIdentityAndAuth: Configuration of HttpAuthSchemes for a client which provides default identity providers and signers per auth scheme.
49
+ * @internal
50
+ */
51
+ readonly httpAuthSchemes: HttpAuthScheme[];
52
+ /**
53
+ * experimentalIdentityAndAuth: Configuration of an HttpAuthSchemeProvider for a client which resolves which HttpAuthScheme to use.
54
+ * @internal
55
+ */
56
+ readonly httpAuthSchemeProvider: MachineLearningHttpAuthSchemeProvider;
57
+ }
58
+ /**
59
+ * @internal
60
+ */
61
+ export declare const resolveHttpAuthSchemeConfig: <T>(config: T & HttpAuthSchemeInputConfig & AwsSdkSigV4PreviouslyResolved) => T & HttpAuthSchemeResolvedConfig;
@@ -1,8 +1,9 @@
1
1
  import { AwsRegionExtensionConfiguration } from "@aws-sdk/types";
2
2
  import { HttpHandlerExtensionConfiguration } from "@smithy/protocol-http";
3
3
  import { DefaultExtensionConfiguration } from "@smithy/types";
4
+ import { HttpAuthExtensionConfiguration } from "./auth/httpAuthExtensionConfiguration";
4
5
  /**
5
6
  * @internal
6
7
  */
7
- export interface MachineLearningExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration {
8
+ export interface MachineLearningExtensionConfiguration extends HttpHandlerExtensionConfiguration, DefaultExtensionConfiguration, AwsRegionExtensionConfiguration, HttpAuthExtensionConfiguration {
8
9
  }