@aws-sdk/client-sagemaker-runtime-http2 3.938.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 (71) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +219 -0
  3. package/dist-cjs/auth/httpAuthSchemeProvider.js +47 -0
  4. package/dist-cjs/endpoint/endpointResolver.js +18 -0
  5. package/dist-cjs/endpoint/ruleset.js +7 -0
  6. package/dist-cjs/index.js +537 -0
  7. package/dist-cjs/runtimeConfig.browser.js +43 -0
  8. package/dist-cjs/runtimeConfig.js +60 -0
  9. package/dist-cjs/runtimeConfig.native.js +18 -0
  10. package/dist-cjs/runtimeConfig.shared.js +36 -0
  11. package/dist-es/SageMakerRuntimeHTTP2.js +9 -0
  12. package/dist-es/SageMakerRuntimeHTTP2Client.js +54 -0
  13. package/dist-es/auth/httpAuthExtensionConfiguration.js +38 -0
  14. package/dist-es/auth/httpAuthSchemeProvider.js +41 -0
  15. package/dist-es/commands/InvokeEndpointWithBidirectionalStreamCommand.js +22 -0
  16. package/dist-es/commands/index.js +1 -0
  17. package/dist-es/endpoint/EndpointParameters.js +13 -0
  18. package/dist-es/endpoint/endpointResolver.js +14 -0
  19. package/dist-es/endpoint/ruleset.js +4 -0
  20. package/dist-es/extensionConfiguration.js +1 -0
  21. package/dist-es/index.js +5 -0
  22. package/dist-es/models/SageMakerRuntimeHTTP2ServiceException.js +8 -0
  23. package/dist-es/models/errors.js +101 -0
  24. package/dist-es/models/models_0.js +1 -0
  25. package/dist-es/runtimeConfig.browser.js +38 -0
  26. package/dist-es/runtimeConfig.js +55 -0
  27. package/dist-es/runtimeConfig.native.js +14 -0
  28. package/dist-es/runtimeConfig.shared.js +32 -0
  29. package/dist-es/runtimeExtensions.js +9 -0
  30. package/dist-es/schemas/schemas_0.js +273 -0
  31. package/dist-types/SageMakerRuntimeHTTP2.d.ts +17 -0
  32. package/dist-types/SageMakerRuntimeHTTP2Client.d.ts +209 -0
  33. package/dist-types/auth/httpAuthExtensionConfiguration.d.ts +29 -0
  34. package/dist-types/auth/httpAuthSchemeProvider.d.ts +75 -0
  35. package/dist-types/commands/InvokeEndpointWithBidirectionalStreamCommand.d.ts +118 -0
  36. package/dist-types/commands/index.d.ts +1 -0
  37. package/dist-types/endpoint/EndpointParameters.d.ts +38 -0
  38. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  39. package/dist-types/endpoint/ruleset.d.ts +2 -0
  40. package/dist-types/extensionConfiguration.d.ts +9 -0
  41. package/dist-types/index.d.ts +14 -0
  42. package/dist-types/models/SageMakerRuntimeHTTP2ServiceException.d.ts +14 -0
  43. package/dist-types/models/errors.d.ts +144 -0
  44. package/dist-types/models/models_0.d.ts +190 -0
  45. package/dist-types/runtimeConfig.browser.d.ts +53 -0
  46. package/dist-types/runtimeConfig.d.ts +53 -0
  47. package/dist-types/runtimeConfig.native.d.ts +52 -0
  48. package/dist-types/runtimeConfig.shared.d.ts +22 -0
  49. package/dist-types/runtimeExtensions.d.ts +17 -0
  50. package/dist-types/schemas/schemas_0.d.ts +16 -0
  51. package/dist-types/ts3.4/SageMakerRuntimeHTTP2.d.ts +30 -0
  52. package/dist-types/ts3.4/SageMakerRuntimeHTTP2Client.d.ts +148 -0
  53. package/dist-types/ts3.4/auth/httpAuthExtensionConfiguration.d.ts +32 -0
  54. package/dist-types/ts3.4/auth/httpAuthSchemeProvider.d.ts +47 -0
  55. package/dist-types/ts3.4/commands/InvokeEndpointWithBidirectionalStreamCommand.d.ts +47 -0
  56. package/dist-types/ts3.4/commands/index.d.ts +1 -0
  57. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +51 -0
  58. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  59. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  60. package/dist-types/ts3.4/extensionConfiguration.d.ts +9 -0
  61. package/dist-types/ts3.4/index.d.ts +9 -0
  62. package/dist-types/ts3.4/models/SageMakerRuntimeHTTP2ServiceException.d.ts +9 -0
  63. package/dist-types/ts3.4/models/errors.d.ts +54 -0
  64. package/dist-types/ts3.4/models/models_0.d.ts +78 -0
  65. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +100 -0
  66. package/dist-types/ts3.4/runtimeConfig.d.ts +95 -0
  67. package/dist-types/ts3.4/runtimeConfig.native.d.ts +104 -0
  68. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +27 -0
  69. package/dist-types/ts3.4/runtimeExtensions.d.ts +13 -0
  70. package/dist-types/ts3.4/schemas/schemas_0.d.ts +21 -0
  71. package/package.json +104 -0
@@ -0,0 +1,9 @@
1
+ import { createAggregatedClient } from "@smithy/smithy-client";
2
+ import { InvokeEndpointWithBidirectionalStreamCommand, } from "./commands/InvokeEndpointWithBidirectionalStreamCommand";
3
+ import { SageMakerRuntimeHTTP2Client } from "./SageMakerRuntimeHTTP2Client";
4
+ const commands = {
5
+ InvokeEndpointWithBidirectionalStreamCommand,
6
+ };
7
+ export class SageMakerRuntimeHTTP2 extends SageMakerRuntimeHTTP2Client {
8
+ }
9
+ createAggregatedClient(commands, SageMakerRuntimeHTTP2);
@@ -0,0 +1,54 @@
1
+ import { resolveEventStreamConfig, } from "@aws-sdk/middleware-eventstream";
2
+ import { getHostHeaderPlugin, resolveHostHeaderConfig, } from "@aws-sdk/middleware-host-header";
3
+ import { getLoggerPlugin } from "@aws-sdk/middleware-logger";
4
+ import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection";
5
+ import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
6
+ import { resolveRegionConfig } from "@smithy/config-resolver";
7
+ import { DefaultIdentityProviderConfig, getHttpAuthSchemeEndpointRuleSetPlugin, getHttpSigningPlugin, } from "@smithy/core";
8
+ import { getSchemaSerdePlugin } from "@smithy/core/schema";
9
+ import { resolveEventStreamSerdeConfig, } from "@smithy/eventstream-serde-config-resolver";
10
+ import { getContentLengthPlugin } from "@smithy/middleware-content-length";
11
+ import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
12
+ import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
13
+ import { Client as __Client, } from "@smithy/smithy-client";
14
+ import { defaultSageMakerRuntimeHTTP2HttpAuthSchemeParametersProvider, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider";
15
+ import { resolveClientEndpointParameters, } from "./endpoint/EndpointParameters";
16
+ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
17
+ import { resolveRuntimeExtensions } from "./runtimeExtensions";
18
+ export { __Client };
19
+ export class SageMakerRuntimeHTTP2Client extends __Client {
20
+ config;
21
+ constructor(...[configuration]) {
22
+ const _config_0 = __getRuntimeConfig(configuration || {});
23
+ super(_config_0);
24
+ this.initConfig = _config_0;
25
+ const _config_1 = resolveClientEndpointParameters(_config_0);
26
+ const _config_2 = resolveUserAgentConfig(_config_1);
27
+ const _config_3 = resolveRetryConfig(_config_2);
28
+ const _config_4 = resolveRegionConfig(_config_3);
29
+ const _config_5 = resolveHostHeaderConfig(_config_4);
30
+ const _config_6 = resolveEndpointConfig(_config_5);
31
+ const _config_7 = resolveEventStreamSerdeConfig(_config_6);
32
+ const _config_8 = resolveHttpAuthSchemeConfig(_config_7);
33
+ const _config_9 = resolveEventStreamConfig(_config_8);
34
+ const _config_10 = resolveRuntimeExtensions(_config_9, configuration?.extensions || []);
35
+ this.config = _config_10;
36
+ this.middlewareStack.use(getSchemaSerdePlugin(this.config));
37
+ this.middlewareStack.use(getUserAgentPlugin(this.config));
38
+ this.middlewareStack.use(getRetryPlugin(this.config));
39
+ this.middlewareStack.use(getContentLengthPlugin(this.config));
40
+ this.middlewareStack.use(getHostHeaderPlugin(this.config));
41
+ this.middlewareStack.use(getLoggerPlugin(this.config));
42
+ this.middlewareStack.use(getRecursionDetectionPlugin(this.config));
43
+ this.middlewareStack.use(getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
44
+ httpAuthSchemeParametersProvider: defaultSageMakerRuntimeHTTP2HttpAuthSchemeParametersProvider,
45
+ identityProviderConfigProvider: async (config) => new DefaultIdentityProviderConfig({
46
+ "aws.auth#sigv4": config.credentials,
47
+ }),
48
+ }));
49
+ this.middlewareStack.use(getHttpSigningPlugin(this.config));
50
+ }
51
+ destroy() {
52
+ super.destroy();
53
+ }
54
+ }
@@ -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 defaultSageMakerRuntimeHTTP2HttpAuthSchemeParametersProvider = 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: "sagemaker",
17
+ region: authParameters.region,
18
+ },
19
+ propertiesExtractor: (config, context) => ({
20
+ signingProperties: {
21
+ config,
22
+ context,
23
+ },
24
+ }),
25
+ };
26
+ }
27
+ export const defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider = (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 Object.assign(config_0, {
39
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
40
+ });
41
+ };
@@ -0,0 +1,22 @@
1
+ import { getEventStreamPlugin } from "@aws-sdk/middleware-eventstream";
2
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { commonParams } from "../endpoint/EndpointParameters";
5
+ import { InvokeEndpointWithBidirectionalStream } from "../schemas/schemas_0";
6
+ export { $Command };
7
+ export class InvokeEndpointWithBidirectionalStreamCommand extends $Command
8
+ .classBuilder()
9
+ .ep(commonParams)
10
+ .m(function (Command, cs, config, o) {
11
+ return [getEndpointPlugin(config, Command.getEndpointParameterInstructions()), getEventStreamPlugin(config)];
12
+ })
13
+ .s("AmazonSageMakerRuntimeHttp2", "InvokeEndpointWithBidirectionalStream", {
14
+ eventStream: {
15
+ input: true,
16
+ output: true,
17
+ },
18
+ })
19
+ .n("SageMakerRuntimeHTTP2Client", "InvokeEndpointWithBidirectionalStreamCommand")
20
+ .sc(InvokeEndpointWithBidirectionalStream)
21
+ .build() {
22
+ }
@@ -0,0 +1 @@
1
+ export * from "./InvokeEndpointWithBidirectionalStreamCommand";
@@ -0,0 +1,13 @@
1
+ export const resolveClientEndpointParameters = (options) => {
2
+ return Object.assign(options, {
3
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
4
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
5
+ defaultSigningName: "sagemaker",
6
+ });
7
+ };
8
+ export const commonParams = {
9
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
10
+ Endpoint: { type: "builtInParams", name: "endpoint" },
11
+ Region: { type: "builtInParams", name: "region" },
12
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
13
+ };
@@ -0,0 +1,14 @@
1
+ import { awsEndpointFunctions } from "@aws-sdk/util-endpoints";
2
+ import { customEndpointFunctions, EndpointCache, resolveEndpoint } from "@smithy/util-endpoints";
3
+ import { ruleSet } from "./ruleset";
4
+ const cache = new EndpointCache({
5
+ size: 50,
6
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
7
+ });
8
+ export const defaultEndpointResolver = (endpointParams, context = {}) => {
9
+ return cache.get(endpointParams, () => resolveEndpoint(ruleSet, {
10
+ endpointParams: endpointParams,
11
+ logger: context.logger,
12
+ }));
13
+ };
14
+ customEndpointFunctions.aws = awsEndpointFunctions;
@@ -0,0 +1,4 @@
1
+ const D = "required", E = "fn", F = "argv", G = "ref", H = "url", I = "properties", J = "headers";
2
+ const a = true, b = "isSet", c = "booleanEquals", d = "error", e = "endpoint", f = "tree", g = "PartitionResult", h = { [D]: true, "default": false, "type": "boolean" }, i = { [D]: false, "type": "string" }, j = { [G]: "Endpoint" }, k = { [E]: c, [F]: [{ [G]: "UseFIPS" }, true] }, l = { [E]: c, [F]: [{ [G]: "UseDualStack" }, true] }, m = {}, n = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws"] }, o = { [E]: c, [F]: [{ [G]: "UseFIPS" }, false] }, p = { [E]: c, [F]: [{ [G]: "UseDualStack" }, false] }, q = { [H]: "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", [I]: {}, [J]: {} }, r = { [H]: "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", [I]: {}, [J]: {} }, s = { [H]: "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", [I]: {}, [J]: {} }, t = { [H]: "https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", [I]: {}, [J]: {} }, u = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws-cn"] }, v = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws-us-gov"] }, w = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws-iso"] }, x = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws-iso-b"] }, y = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws-iso-f"] }, z = { [E]: "stringEquals", [F]: [{ [E]: "getAttr", [F]: [{ [G]: g }, "name"] }, "aws-eusc"] }, A = { [E]: "getAttr", [F]: [{ [G]: g }, "supportsFIPS"] }, B = { [E]: c, [F]: [true, { [E]: "getAttr", [F]: [{ [G]: g }, "supportsDualStack"] }] }, C = [{ [G]: "Region" }];
3
+ const _data = { version: "1.0", parameters: { UseDualStack: h, UseFIPS: h, Endpoint: i, Region: i }, rules: [{ conditions: [{ [E]: b, [F]: [j] }], rules: [{ conditions: [k], error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: d }, { rules: [{ conditions: [l], error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: d }, { endpoint: { [H]: j, [I]: m, [J]: m }, type: e }], type: f }], type: f }, { rules: [{ conditions: [{ [E]: b, [F]: C }], rules: [{ conditions: [{ [E]: "aws.partition", [F]: C, assign: g }], rules: [{ conditions: [n, o, p], endpoint: q, type: e }, { conditions: [n, o, l], endpoint: r, type: e }, { conditions: [n, k, p], endpoint: s, type: e }, { conditions: [n, k, l], endpoint: t, type: e }, { conditions: [u, o, p], endpoint: q, type: e }, { conditions: [u, o, l], endpoint: r, type: e }, { conditions: [u, k, p], endpoint: s, type: e }, { conditions: [u, k, l], endpoint: t, type: e }, { conditions: [v, o, p], endpoint: q, type: e }, { conditions: [v, o, l], endpoint: r, type: e }, { conditions: [v, k, p], endpoint: s, type: e }, { conditions: [v, k, l], endpoint: t, type: e }, { conditions: [w, o, p], endpoint: q, type: e }, { conditions: [w, o, l], endpoint: r, type: e }, { conditions: [w, k, p], endpoint: s, type: e }, { conditions: [w, k, l], endpoint: t, type: e }, { conditions: [x, o, p], endpoint: q, type: e }, { conditions: [x, o, l], endpoint: r, type: e }, { conditions: [x, k, p], endpoint: s, type: e }, { conditions: [x, k, l], endpoint: t, type: e }, { conditions: [y, o, p], endpoint: q, type: e }, { conditions: [y, o, l], endpoint: r, type: e }, { conditions: [y, k, p], endpoint: s, type: e }, { conditions: [y, k, l], endpoint: t, type: e }, { conditions: [z, o, p], endpoint: q, type: e }, { conditions: [z, o, l], endpoint: r, type: e }, { conditions: [z, k, p], endpoint: s, type: e }, { conditions: [z, k, l], endpoint: t, type: e }, { conditions: [k, l], rules: [{ conditions: [{ [E]: c, [F]: [a, A] }, B], rules: [{ endpoint: { [H]: "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", [I]: m, [J]: m }, type: e }], type: f }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: d }], type: f }, { conditions: [k, p], rules: [{ conditions: [{ [E]: c, [F]: [A, a] }], rules: [{ endpoint: { [H]: "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", [I]: m, [J]: m }, type: e }], type: f }, { error: "FIPS is enabled but this partition does not support FIPS", type: d }], type: f }, { conditions: [o, l], rules: [{ conditions: [B], rules: [{ endpoint: { [H]: "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", [I]: m, [J]: m }, type: e }], type: f }, { error: "DualStack is enabled but this partition does not support DualStack", type: d }], type: f }, { endpoint: { [H]: "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", [I]: m, [J]: m }, type: e }], type: f }], type: f }, { error: "Invalid Configuration: Missing Region", type: d }], type: f }] };
4
+ export const ruleSet = _data;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./SageMakerRuntimeHTTP2Client";
2
+ export * from "./SageMakerRuntimeHTTP2";
3
+ export * from "./commands";
4
+ export * from "./models/errors";
5
+ export { SageMakerRuntimeHTTP2ServiceException } from "./models/SageMakerRuntimeHTTP2ServiceException";
@@ -0,0 +1,8 @@
1
+ import { ServiceException as __ServiceException, } from "@smithy/smithy-client";
2
+ export { __ServiceException };
3
+ export class SageMakerRuntimeHTTP2ServiceException extends __ServiceException {
4
+ constructor(options) {
5
+ super(options);
6
+ Object.setPrototypeOf(this, SageMakerRuntimeHTTP2ServiceException.prototype);
7
+ }
8
+ }
@@ -0,0 +1,101 @@
1
+ import { SageMakerRuntimeHTTP2ServiceException as __BaseException } from "./SageMakerRuntimeHTTP2ServiceException";
2
+ export class InputValidationError extends __BaseException {
3
+ name = "InputValidationError";
4
+ $fault = "client";
5
+ Message;
6
+ ErrorCode;
7
+ constructor(opts) {
8
+ super({
9
+ name: "InputValidationError",
10
+ $fault: "client",
11
+ ...opts,
12
+ });
13
+ Object.setPrototypeOf(this, InputValidationError.prototype);
14
+ this.Message = opts.Message;
15
+ this.ErrorCode = opts.ErrorCode;
16
+ }
17
+ }
18
+ export class InternalServerError extends __BaseException {
19
+ name = "InternalServerError";
20
+ $fault = "server";
21
+ Message;
22
+ ErrorCode;
23
+ constructor(opts) {
24
+ super({
25
+ name: "InternalServerError",
26
+ $fault: "server",
27
+ ...opts,
28
+ });
29
+ Object.setPrototypeOf(this, InternalServerError.prototype);
30
+ this.Message = opts.Message;
31
+ this.ErrorCode = opts.ErrorCode;
32
+ }
33
+ }
34
+ export class InternalStreamFailure extends __BaseException {
35
+ name = "InternalStreamFailure";
36
+ $fault = "server";
37
+ Message;
38
+ constructor(opts) {
39
+ super({
40
+ name: "InternalStreamFailure",
41
+ $fault: "server",
42
+ ...opts,
43
+ });
44
+ Object.setPrototypeOf(this, InternalStreamFailure.prototype);
45
+ this.Message = opts.Message;
46
+ }
47
+ }
48
+ export class ModelStreamError extends __BaseException {
49
+ name = "ModelStreamError";
50
+ $fault = "client";
51
+ Message;
52
+ ErrorCode;
53
+ constructor(opts) {
54
+ super({
55
+ name: "ModelStreamError",
56
+ $fault: "client",
57
+ ...opts,
58
+ });
59
+ Object.setPrototypeOf(this, ModelStreamError.prototype);
60
+ this.Message = opts.Message;
61
+ this.ErrorCode = opts.ErrorCode;
62
+ }
63
+ }
64
+ export class ModelError extends __BaseException {
65
+ name = "ModelError";
66
+ $fault = "client";
67
+ Message;
68
+ OriginalStatusCode;
69
+ OriginalMessage;
70
+ LogStreamArn;
71
+ ErrorCode;
72
+ constructor(opts) {
73
+ super({
74
+ name: "ModelError",
75
+ $fault: "client",
76
+ ...opts,
77
+ });
78
+ Object.setPrototypeOf(this, ModelError.prototype);
79
+ this.Message = opts.Message;
80
+ this.OriginalStatusCode = opts.OriginalStatusCode;
81
+ this.OriginalMessage = opts.OriginalMessage;
82
+ this.LogStreamArn = opts.LogStreamArn;
83
+ this.ErrorCode = opts.ErrorCode;
84
+ }
85
+ }
86
+ export class ServiceUnavailableError extends __BaseException {
87
+ name = "ServiceUnavailableError";
88
+ $fault = "server";
89
+ Message;
90
+ ErrorCode;
91
+ constructor(opts) {
92
+ super({
93
+ name: "ServiceUnavailableError",
94
+ $fault: "server",
95
+ ...opts,
96
+ });
97
+ Object.setPrototypeOf(this, ServiceUnavailableError.prototype);
98
+ this.Message = opts.Message;
99
+ this.ErrorCode = opts.ErrorCode;
100
+ }
101
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,38 @@
1
+ import packageInfo from "../package.json";
2
+ import { Sha256 } from "@aws-crypto/sha256-browser";
3
+ import { createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-browser";
4
+ import { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT } from "@smithy/config-resolver";
5
+ import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-browser";
6
+ import { FetchHttpHandler as RequestHandler, streamCollector } from "@smithy/fetch-http-handler";
7
+ import { invalidFunction, invalidProvider } from "@smithy/invalid-dependency";
8
+ import { calculateBodyLength } from "@smithy/util-body-length-browser";
9
+ import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@smithy/util-retry";
10
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
11
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
12
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-browser";
13
+ export const getRuntimeConfig = (config) => {
14
+ const defaultsMode = resolveDefaultsModeConfig(config);
15
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
16
+ const clientSharedValues = getSharedRuntimeConfig(config);
17
+ return {
18
+ ...clientSharedValues,
19
+ ...config,
20
+ runtime: "browser",
21
+ defaultsMode,
22
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
23
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
24
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
25
+ createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
26
+ eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
27
+ (() => ({ handle: invalidFunction("event stream request is not supported in browser.") })),
28
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
29
+ maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
30
+ region: config?.region ?? invalidProvider("Region is missing"),
31
+ requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
32
+ retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
33
+ sha256: config?.sha256 ?? Sha256,
34
+ streamCollector: config?.streamCollector ?? streamCollector,
35
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
36
+ useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
37
+ };
38
+ };
@@ -0,0 +1,55 @@
1
+ import packageInfo from "../package.json";
2
+ import { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, emitWarningIfUnsupportedVersion as awsCheckVersion } from "@aws-sdk/core";
3
+ import { defaultProvider as credentialDefaultProvider } from "@aws-sdk/credential-provider-node";
4
+ import { eventStreamPayloadHandlerProvider } from "@aws-sdk/eventstream-handler-node";
5
+ import { NODE_APP_ID_CONFIG_OPTIONS, createDefaultUserAgentProvider } from "@aws-sdk/util-user-agent-node";
6
+ import { NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, } from "@smithy/config-resolver";
7
+ import { eventStreamSerdeProvider } from "@smithy/eventstream-serde-node";
8
+ import { Hash } from "@smithy/hash-node";
9
+ import { NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } from "@smithy/middleware-retry";
10
+ import { loadConfig as loadNodeConfig } from "@smithy/node-config-provider";
11
+ import { NodeHttp2Handler as RequestHandler, streamCollector } from "@smithy/node-http-handler";
12
+ import { calculateBodyLength } from "@smithy/util-body-length-node";
13
+ import { DEFAULT_RETRY_MODE } from "@smithy/util-retry";
14
+ import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
15
+ import { loadConfigsForDefaultMode } from "@smithy/smithy-client";
16
+ import { resolveDefaultsModeConfig } from "@smithy/util-defaults-mode-node";
17
+ import { emitWarningIfUnsupportedVersion } from "@smithy/smithy-client";
18
+ export const getRuntimeConfig = (config) => {
19
+ emitWarningIfUnsupportedVersion(process.version);
20
+ const defaultsMode = resolveDefaultsModeConfig(config);
21
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
22
+ const clientSharedValues = getSharedRuntimeConfig(config);
23
+ awsCheckVersion(process.version);
24
+ const loaderConfig = {
25
+ profile: config?.profile,
26
+ logger: clientSharedValues.logger,
27
+ };
28
+ return {
29
+ ...clientSharedValues,
30
+ ...config,
31
+ runtime: "node",
32
+ defaultsMode,
33
+ authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
34
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
35
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
36
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ??
37
+ createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
38
+ eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
39
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
40
+ maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
41
+ region: config?.region ??
42
+ loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
43
+ requestHandler: RequestHandler.create(config?.requestHandler ?? (async () => ({ ...(await defaultConfigProvider()), disableConcurrentStreams: true }))),
44
+ retryMode: config?.retryMode ??
45
+ loadNodeConfig({
46
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
47
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
48
+ }, config),
49
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
50
+ streamCollector: config?.streamCollector ?? streamCollector,
51
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
52
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
53
+ userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
54
+ };
55
+ };
@@ -0,0 +1,14 @@
1
+ import { Sha256 } from "@aws-crypto/sha256-js";
2
+ import { invalidFunction } from "@smithy/invalid-dependency";
3
+ import { getRuntimeConfig as getBrowserRuntimeConfig } from "./runtimeConfig.browser";
4
+ export const getRuntimeConfig = (config) => {
5
+ const browserDefaults = getBrowserRuntimeConfig(config);
6
+ return {
7
+ ...browserDefaults,
8
+ ...config,
9
+ runtime: "react-native",
10
+ eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ??
11
+ (() => ({ handle: invalidFunction("event stream request is not supported in ReactNative.") })),
12
+ sha256: config?.sha256 ?? Sha256,
13
+ };
14
+ };
@@ -0,0 +1,32 @@
1
+ import { AwsSdkSigV4Signer } from "@aws-sdk/core";
2
+ import { AwsRestJsonProtocol } from "@aws-sdk/core/protocols";
3
+ import { NoOpLogger } from "@smithy/smithy-client";
4
+ import { parseUrl } from "@smithy/url-parser";
5
+ import { fromBase64, toBase64 } from "@smithy/util-base64";
6
+ import { fromUtf8, toUtf8 } from "@smithy/util-utf8";
7
+ import { defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider } from "./auth/httpAuthSchemeProvider";
8
+ import { defaultEndpointResolver } from "./endpoint/endpointResolver";
9
+ export const getRuntimeConfig = (config) => {
10
+ return {
11
+ apiVersion: "2025-10-01",
12
+ base64Decoder: config?.base64Decoder ?? fromBase64,
13
+ base64Encoder: config?.base64Encoder ?? toBase64,
14
+ disableHostPrefix: config?.disableHostPrefix ?? false,
15
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
16
+ extensions: config?.extensions ?? [],
17
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider,
18
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
19
+ {
20
+ schemeId: "aws.auth#sigv4",
21
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
22
+ signer: new AwsSdkSigV4Signer(),
23
+ },
24
+ ],
25
+ logger: config?.logger ?? new NoOpLogger(),
26
+ protocol: config?.protocol ?? new AwsRestJsonProtocol({ defaultNamespace: "com.amazonaws.sagemakerruntimehttp2" }),
27
+ serviceId: config?.serviceId ?? "SageMaker Runtime HTTP2",
28
+ urlParser: config?.urlParser ?? parseUrl,
29
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
30
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
31
+ };
32
+ };
@@ -0,0 +1,9 @@
1
+ import { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, } from "@aws-sdk/region-config-resolver";
2
+ import { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig } from "@smithy/protocol-http";
3
+ import { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig } from "@smithy/smithy-client";
4
+ import { getHttpAuthExtensionConfiguration, resolveHttpAuthRuntimeConfig } from "./auth/httpAuthExtensionConfiguration";
5
+ export const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
6
+ const extensionConfiguration = Object.assign(getAwsRegionExtensionConfiguration(runtimeConfig), getDefaultExtensionConfiguration(runtimeConfig), getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
7
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
8
+ return Object.assign(runtimeConfig, resolveAwsRegionExtensionConfiguration(extensionConfiguration), resolveDefaultRuntimeConfig(extensionConfiguration), resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
9
+ };