@aws-sdk/client-sagemaker-runtime 3.1074.0 → 3.1076.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-cjs/index.js +538 -16
- package/dist-types/runtimeConfig.browser.d.ts +1 -1
- package/dist-types/runtimeConfig.d.ts +1 -1
- package/dist-types/runtimeConfig.native.d.ts +1 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +7 -1
- package/dist-types/ts3.4/runtimeConfig.d.ts +7 -1
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +7 -1
- package/package.json +8 -8
- package/dist-cjs/auth/httpAuthSchemeProvider.js +0 -40
- package/dist-cjs/endpoint/bdd.js +0 -52
- package/dist-cjs/endpoint/endpointResolver.js +0 -14
- package/dist-cjs/models/SageMakerRuntimeServiceException.js +0 -8
- package/dist-cjs/models/errors.js +0 -121
- package/dist-cjs/runtimeConfig.browser.js +0 -34
- package/dist-cjs/runtimeConfig.js +0 -47
- package/dist-cjs/runtimeConfig.native.js +0 -12
- package/dist-cjs/runtimeConfig.shared.js +0 -38
- package/dist-cjs/schemas/schemas_0.js +0 -212
package/dist-cjs/index.js
CHANGED
|
@@ -1,22 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
const { getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
|
|
1
|
+
const { awsEndpointFunctions, emitWarningIfUnsupportedVersion: emitWarningIfUnsupportedVersion$1, createDefaultUserAgentProvider, NODE_APP_ID_CONFIG_OPTIONS, getAwsRegionExtensionConfiguration, resolveAwsRegionExtensionConfiguration, resolveUserAgentConfig, resolveHostHeaderConfig, getUserAgentPlugin, getHostHeaderPlugin, getLoggerPlugin, getRecursionDetectionPlugin } = require("@aws-sdk/core/client");
|
|
3
2
|
const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin } = require("@smithy/core");
|
|
4
|
-
const { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
|
|
3
|
+
const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
|
|
5
4
|
exports.$Command = Command;
|
|
6
5
|
exports.__Client = Client;
|
|
7
|
-
const { resolveRegionConfig } = require("@smithy/core/config");
|
|
8
|
-
const { resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
|
|
9
|
-
const { resolveEventStreamSerdeConfig } = require("@smithy/core/event-streams");
|
|
10
|
-
const { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
|
|
11
|
-
const { resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
|
|
12
|
-
const { getSchemaSerdePlugin } = require("@smithy/core/schema");
|
|
13
|
-
const {
|
|
14
|
-
const {
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
const { resolveDefaultsModeConfig, loadConfig, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_REGION_CONFIG_FILE_OPTIONS, resolveRegionConfig } = require("@smithy/core/config");
|
|
7
|
+
const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
|
|
8
|
+
const { eventStreamSerdeProvider, resolveEventStreamSerdeConfig } = require("@smithy/core/event-streams");
|
|
9
|
+
const { parseUrl, getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
|
|
10
|
+
const { DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
|
|
11
|
+
const { TypeRegistry, getSchemaSerdePlugin } = require("@smithy/core/schema");
|
|
12
|
+
const { resolveAwsSdkSigV4Config, AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
|
|
13
|
+
const { defaultProvider } = require("@aws-sdk/credential-provider-node");
|
|
14
|
+
const { toUtf8, fromUtf8, toBase64, fromBase64, Hash, calculateBodyLength } = require("@smithy/core/serde");
|
|
15
|
+
const { streamCollector, NodeHttpHandler } = require("@smithy/node-http-handler");
|
|
16
|
+
const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
|
|
17
|
+
|
|
18
|
+
const defaultSageMakerRuntimeHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
19
|
+
return {
|
|
20
|
+
operation: getSmithyContext(context).operation,
|
|
21
|
+
region: await normalizeProvider(config.region)() || (() => {
|
|
22
|
+
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
23
|
+
})(),
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
27
|
+
return {
|
|
28
|
+
schemeId: "aws.auth#sigv4",
|
|
29
|
+
signingProperties: {
|
|
30
|
+
name: "sagemaker",
|
|
31
|
+
region: authParameters.region,
|
|
32
|
+
},
|
|
33
|
+
propertiesExtractor: (config, context) => ({
|
|
34
|
+
signingProperties: {
|
|
35
|
+
config,
|
|
36
|
+
context,
|
|
37
|
+
},
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const defaultSageMakerRuntimeHttpAuthSchemeProvider = (authParameters) => {
|
|
42
|
+
const options = [];
|
|
43
|
+
switch (authParameters.operation) {
|
|
44
|
+
default: {
|
|
45
|
+
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return options;
|
|
49
|
+
};
|
|
50
|
+
const resolveHttpAuthSchemeConfig = (config) => {
|
|
51
|
+
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
52
|
+
return Object.assign(config_0, {
|
|
53
|
+
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
54
|
+
});
|
|
55
|
+
};
|
|
20
56
|
|
|
21
57
|
const resolveClientEndpointParameters = (options) => {
|
|
22
58
|
return Object.assign(options, {
|
|
@@ -32,6 +68,462 @@ const commonParams = {
|
|
|
32
68
|
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
33
69
|
};
|
|
34
70
|
|
|
71
|
+
var version = "3.1075.0";
|
|
72
|
+
var packageInfo = {
|
|
73
|
+
version: version};
|
|
74
|
+
|
|
75
|
+
const m = "ref";
|
|
76
|
+
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = "stringEquals", h = { [m]: "Endpoint" }, i = { [m]: d }, j = { "fn": f, "argv": [i, "name"] }, k = {}, l = [{ [m]: "Region" }];
|
|
77
|
+
const _data = {
|
|
78
|
+
conditions: [
|
|
79
|
+
[c, [h]],
|
|
80
|
+
[c, l],
|
|
81
|
+
["aws.partition", l, d],
|
|
82
|
+
[e, [{ [m]: "UseFIPS" }, b]],
|
|
83
|
+
[e, [{ [m]: "UseDualStack" }, b]],
|
|
84
|
+
[e, [{ fn: f, argv: [i, "supportsDualStack"] }, b]],
|
|
85
|
+
[e, [{ fn: f, argv: [i, "supportsFIPS"] }, b]],
|
|
86
|
+
[g, [j, "aws"]],
|
|
87
|
+
[g, [j, "aws-us-gov"]]
|
|
88
|
+
],
|
|
89
|
+
results: [
|
|
90
|
+
[a],
|
|
91
|
+
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
92
|
+
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
93
|
+
[h, k],
|
|
94
|
+
["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
|
|
95
|
+
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
96
|
+
["https://runtime-fips.sagemaker.{Region}.amazonaws.com", k],
|
|
97
|
+
["https://runtime.sagemaker.{Region}.amazonaws.com", k],
|
|
98
|
+
["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", k],
|
|
99
|
+
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
100
|
+
["https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
|
|
101
|
+
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
102
|
+
["https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", k],
|
|
103
|
+
[a, "Invalid Configuration: Missing Region"]
|
|
104
|
+
]
|
|
105
|
+
};
|
|
106
|
+
const root = 2;
|
|
107
|
+
const r = 100_000_000;
|
|
108
|
+
const nodes = new Int32Array([
|
|
109
|
+
-1, 1, -1,
|
|
110
|
+
0, 14, 3,
|
|
111
|
+
1, 4, r + 13,
|
|
112
|
+
2, 5, r + 13,
|
|
113
|
+
3, 8, 6,
|
|
114
|
+
4, 7, r + 12,
|
|
115
|
+
5, r + 10, r + 11,
|
|
116
|
+
4, 12, 9,
|
|
117
|
+
6, 10, r + 9,
|
|
118
|
+
7, r + 6, 11,
|
|
119
|
+
8, r + 7, r + 8,
|
|
120
|
+
5, 13, r + 5,
|
|
121
|
+
6, r + 4, r + 5,
|
|
122
|
+
3, r + 1, 15,
|
|
123
|
+
4, r + 2, r + 3,
|
|
124
|
+
]);
|
|
125
|
+
const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
126
|
+
|
|
127
|
+
const cache = new EndpointCache({
|
|
128
|
+
size: 50,
|
|
129
|
+
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
130
|
+
});
|
|
131
|
+
const defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
132
|
+
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
133
|
+
endpointParams: endpointParams,
|
|
134
|
+
logger: context.logger,
|
|
135
|
+
}));
|
|
136
|
+
};
|
|
137
|
+
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
138
|
+
|
|
139
|
+
class SageMakerRuntimeServiceException extends ServiceException {
|
|
140
|
+
constructor(options) {
|
|
141
|
+
super(options);
|
|
142
|
+
Object.setPrototypeOf(this, SageMakerRuntimeServiceException.prototype);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
class InternalDependencyException extends SageMakerRuntimeServiceException {
|
|
147
|
+
name = "InternalDependencyException";
|
|
148
|
+
$fault = "server";
|
|
149
|
+
Message;
|
|
150
|
+
constructor(opts) {
|
|
151
|
+
super({
|
|
152
|
+
name: "InternalDependencyException",
|
|
153
|
+
$fault: "server",
|
|
154
|
+
...opts,
|
|
155
|
+
});
|
|
156
|
+
Object.setPrototypeOf(this, InternalDependencyException.prototype);
|
|
157
|
+
this.Message = opts.Message;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
class InternalFailure extends SageMakerRuntimeServiceException {
|
|
161
|
+
name = "InternalFailure";
|
|
162
|
+
$fault = "server";
|
|
163
|
+
Message;
|
|
164
|
+
constructor(opts) {
|
|
165
|
+
super({
|
|
166
|
+
name: "InternalFailure",
|
|
167
|
+
$fault: "server",
|
|
168
|
+
...opts,
|
|
169
|
+
});
|
|
170
|
+
Object.setPrototypeOf(this, InternalFailure.prototype);
|
|
171
|
+
this.Message = opts.Message;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
class ModelError extends SageMakerRuntimeServiceException {
|
|
175
|
+
name = "ModelError";
|
|
176
|
+
$fault = "client";
|
|
177
|
+
Message;
|
|
178
|
+
OriginalStatusCode;
|
|
179
|
+
OriginalMessage;
|
|
180
|
+
LogStreamArn;
|
|
181
|
+
constructor(opts) {
|
|
182
|
+
super({
|
|
183
|
+
name: "ModelError",
|
|
184
|
+
$fault: "client",
|
|
185
|
+
...opts,
|
|
186
|
+
});
|
|
187
|
+
Object.setPrototypeOf(this, ModelError.prototype);
|
|
188
|
+
this.Message = opts.Message;
|
|
189
|
+
this.OriginalStatusCode = opts.OriginalStatusCode;
|
|
190
|
+
this.OriginalMessage = opts.OriginalMessage;
|
|
191
|
+
this.LogStreamArn = opts.LogStreamArn;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
class ModelNotReadyException extends SageMakerRuntimeServiceException {
|
|
195
|
+
name = "ModelNotReadyException";
|
|
196
|
+
$fault = "client";
|
|
197
|
+
Message;
|
|
198
|
+
constructor(opts) {
|
|
199
|
+
super({
|
|
200
|
+
name: "ModelNotReadyException",
|
|
201
|
+
$fault: "client",
|
|
202
|
+
...opts,
|
|
203
|
+
});
|
|
204
|
+
Object.setPrototypeOf(this, ModelNotReadyException.prototype);
|
|
205
|
+
this.Message = opts.Message;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
class ServiceUnavailable extends SageMakerRuntimeServiceException {
|
|
209
|
+
name = "ServiceUnavailable";
|
|
210
|
+
$fault = "server";
|
|
211
|
+
Message;
|
|
212
|
+
constructor(opts) {
|
|
213
|
+
super({
|
|
214
|
+
name: "ServiceUnavailable",
|
|
215
|
+
$fault: "server",
|
|
216
|
+
...opts,
|
|
217
|
+
});
|
|
218
|
+
Object.setPrototypeOf(this, ServiceUnavailable.prototype);
|
|
219
|
+
this.Message = opts.Message;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
class ValidationError extends SageMakerRuntimeServiceException {
|
|
223
|
+
name = "ValidationError";
|
|
224
|
+
$fault = "client";
|
|
225
|
+
Message;
|
|
226
|
+
constructor(opts) {
|
|
227
|
+
super({
|
|
228
|
+
name: "ValidationError",
|
|
229
|
+
$fault: "client",
|
|
230
|
+
...opts,
|
|
231
|
+
});
|
|
232
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
233
|
+
this.Message = opts.Message;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
class InternalStreamFailure extends SageMakerRuntimeServiceException {
|
|
237
|
+
name = "InternalStreamFailure";
|
|
238
|
+
$fault = "server";
|
|
239
|
+
Message;
|
|
240
|
+
constructor(opts) {
|
|
241
|
+
super({
|
|
242
|
+
name: "InternalStreamFailure",
|
|
243
|
+
$fault: "server",
|
|
244
|
+
...opts,
|
|
245
|
+
});
|
|
246
|
+
Object.setPrototypeOf(this, InternalStreamFailure.prototype);
|
|
247
|
+
this.Message = opts.Message;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
class ModelStreamError extends SageMakerRuntimeServiceException {
|
|
251
|
+
name = "ModelStreamError";
|
|
252
|
+
$fault = "client";
|
|
253
|
+
Message;
|
|
254
|
+
ErrorCode;
|
|
255
|
+
constructor(opts) {
|
|
256
|
+
super({
|
|
257
|
+
name: "ModelStreamError",
|
|
258
|
+
$fault: "client",
|
|
259
|
+
...opts,
|
|
260
|
+
});
|
|
261
|
+
Object.setPrototypeOf(this, ModelStreamError.prototype);
|
|
262
|
+
this.Message = opts.Message;
|
|
263
|
+
this.ErrorCode = opts.ErrorCode;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const _A = "Accept";
|
|
268
|
+
const _ABB = "AsyncBodyBlob";
|
|
269
|
+
const _B = "Body";
|
|
270
|
+
const _BB = "BodyBlob";
|
|
271
|
+
const _By = "Bytes";
|
|
272
|
+
const _CA = "CustomAttributes";
|
|
273
|
+
const _CAH = "CustomAttributesHeader";
|
|
274
|
+
const _CSI = "ClosedSessionId";
|
|
275
|
+
const _CT = "ContentType";
|
|
276
|
+
const _CT_ = "Content-Type";
|
|
277
|
+
const _EC = "ErrorCode";
|
|
278
|
+
const _EE = "EnableExplanations";
|
|
279
|
+
const _EN = "EndpointName";
|
|
280
|
+
const _F = "Filename";
|
|
281
|
+
const _FL = "FailureLocation";
|
|
282
|
+
const _ICN = "InferenceComponentName";
|
|
283
|
+
const _IDE = "InternalDependencyException";
|
|
284
|
+
const _IE = "InvokeEndpoint";
|
|
285
|
+
const _IEA = "InvokeEndpointAsync";
|
|
286
|
+
const _IEAI = "InvokeEndpointAsyncInput";
|
|
287
|
+
const _IEAO = "InvokeEndpointAsyncOutput";
|
|
288
|
+
const _IEI = "InvokeEndpointInput";
|
|
289
|
+
const _IEO = "InvokeEndpointOutput";
|
|
290
|
+
const _IEWRS = "InvokeEndpointWithResponseStream";
|
|
291
|
+
const _IEWRSI = "InvokeEndpointWithResponseStreamInput";
|
|
292
|
+
const _IEWRSO = "InvokeEndpointWithResponseStreamOutput";
|
|
293
|
+
const _IF = "InternalFailure";
|
|
294
|
+
const _II = "InferenceId";
|
|
295
|
+
const _IL = "InputLocation";
|
|
296
|
+
const _IPV = "InvokedProductionVariant";
|
|
297
|
+
const _ISF = "InternalStreamFailure";
|
|
298
|
+
const _ITS = "InvocationTimeoutSeconds";
|
|
299
|
+
const _LSA = "LogStreamArn";
|
|
300
|
+
const _M = "Message";
|
|
301
|
+
const _ME = "ModelError";
|
|
302
|
+
const _MNRE = "ModelNotReadyException";
|
|
303
|
+
const _MSE = "ModelStreamError";
|
|
304
|
+
const _NSI = "NewSessionId";
|
|
305
|
+
const _OL = "OutputLocation";
|
|
306
|
+
const _OM = "OriginalMessage";
|
|
307
|
+
const _OSC = "OriginalStatusCode";
|
|
308
|
+
const _PB = "PartBlob";
|
|
309
|
+
const _PP = "PayloadPart";
|
|
310
|
+
const _RS = "ResponseStream";
|
|
311
|
+
const _RTTLS = "RequestTTLSeconds";
|
|
312
|
+
const _SI = "SessionId";
|
|
313
|
+
const _SOPE = "S3OutputPathExtension";
|
|
314
|
+
const _SU = "ServiceUnavailable";
|
|
315
|
+
const _TCH = "TargetContainerHostname";
|
|
316
|
+
const _TM = "TargetModel";
|
|
317
|
+
const _TV = "TargetVariant";
|
|
318
|
+
const _VE = "ValidationError";
|
|
319
|
+
const _XASA = "X-Amzn-SageMaker-Accept";
|
|
320
|
+
const _XASCA = "X-Amzn-SageMaker-Custom-Attributes";
|
|
321
|
+
const _XASCSI = "X-Amzn-SageMaker-Closed-Session-Id";
|
|
322
|
+
const _XASCT = "X-Amzn-SageMaker-Content-Type";
|
|
323
|
+
const _XASEE = "X-Amzn-SageMaker-Enable-Explanations";
|
|
324
|
+
const _XASF = "X-Amzn-SageMaker-Filename";
|
|
325
|
+
const _XASF_ = "X-Amzn-SageMaker-FailureLocation";
|
|
326
|
+
const _XASI = "X-Amzn-SageMaker-InputLocation";
|
|
327
|
+
const _XASIC = "X-Amzn-SageMaker-Inference-Component";
|
|
328
|
+
const _XASII = "X-Amzn-SageMaker-Inference-Id";
|
|
329
|
+
const _XASI_ = "X-Amzn-SageMaker-InvocationTimeoutSeconds";
|
|
330
|
+
const _XASNSI = "X-Amzn-SageMaker-New-Session-Id";
|
|
331
|
+
const _XASO = "X-Amzn-SageMaker-OutputLocation";
|
|
332
|
+
const _XASR = "X-Amzn-SageMaker-RequestTTLSeconds";
|
|
333
|
+
const _XASS = "X-Amzn-SageMaker-S3OutputPathExtension";
|
|
334
|
+
const _XASSI = "X-Amzn-SageMaker-Session-Id";
|
|
335
|
+
const _XASTCH = "X-Amzn-SageMaker-Target-Container-Hostname";
|
|
336
|
+
const _XASTM = "X-Amzn-SageMaker-Target-Model";
|
|
337
|
+
const _XASTV = "X-Amzn-SageMaker-Target-Variant";
|
|
338
|
+
const _aQE = "awsQueryError";
|
|
339
|
+
const _c = "client";
|
|
340
|
+
const _e = "error";
|
|
341
|
+
const _eP = "eventPayload";
|
|
342
|
+
const _h = "http";
|
|
343
|
+
const _hE = "httpError";
|
|
344
|
+
const _hH = "httpHeader";
|
|
345
|
+
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sagemakerruntime";
|
|
346
|
+
const _se = "server";
|
|
347
|
+
const _st = "streaming";
|
|
348
|
+
const _xAIPV = "x-Amzn-Invoked-Production-Variant";
|
|
349
|
+
const n0 = "com.amazonaws.sagemakerruntime";
|
|
350
|
+
const _s_registry = TypeRegistry.for(_s);
|
|
351
|
+
var SageMakerRuntimeServiceException$ = [-3, _s, "SageMakerRuntimeServiceException", 0, [], []];
|
|
352
|
+
_s_registry.registerError(SageMakerRuntimeServiceException$, SageMakerRuntimeServiceException);
|
|
353
|
+
const n0_registry = TypeRegistry.for(n0);
|
|
354
|
+
var InternalDependencyException$ = [-3, n0, _IDE,
|
|
355
|
+
{ [_e]: _se, [_hE]: 530 },
|
|
356
|
+
[_M],
|
|
357
|
+
[0]
|
|
358
|
+
];
|
|
359
|
+
n0_registry.registerError(InternalDependencyException$, InternalDependencyException);
|
|
360
|
+
var InternalFailure$ = [-3, n0, _IF,
|
|
361
|
+
{ [_e]: _se, [_hE]: 500 },
|
|
362
|
+
[_M],
|
|
363
|
+
[0]
|
|
364
|
+
];
|
|
365
|
+
n0_registry.registerError(InternalFailure$, InternalFailure);
|
|
366
|
+
var InternalStreamFailure$ = [-3, n0, _ISF,
|
|
367
|
+
{ [_e]: _se },
|
|
368
|
+
[_M],
|
|
369
|
+
[0]
|
|
370
|
+
];
|
|
371
|
+
n0_registry.registerError(InternalStreamFailure$, InternalStreamFailure);
|
|
372
|
+
var ModelError$ = [-3, n0, _ME,
|
|
373
|
+
{ [_e]: _c, [_hE]: 424 },
|
|
374
|
+
[_M, _OSC, _OM, _LSA],
|
|
375
|
+
[0, 1, 0, 0]
|
|
376
|
+
];
|
|
377
|
+
n0_registry.registerError(ModelError$, ModelError);
|
|
378
|
+
var ModelNotReadyException$ = [-3, n0, _MNRE,
|
|
379
|
+
{ [_aQE]: [`ModelNotReadyException`, 429], [_e]: _c, [_hE]: 429 },
|
|
380
|
+
[_M],
|
|
381
|
+
[0]
|
|
382
|
+
];
|
|
383
|
+
n0_registry.registerError(ModelNotReadyException$, ModelNotReadyException);
|
|
384
|
+
var ModelStreamError$ = [-3, n0, _MSE,
|
|
385
|
+
{ [_e]: _c },
|
|
386
|
+
[_M, _EC],
|
|
387
|
+
[0, 0]
|
|
388
|
+
];
|
|
389
|
+
n0_registry.registerError(ModelStreamError$, ModelStreamError);
|
|
390
|
+
var ServiceUnavailable$ = [-3, n0, _SU,
|
|
391
|
+
{ [_e]: _se, [_hE]: 503 },
|
|
392
|
+
[_M],
|
|
393
|
+
[0]
|
|
394
|
+
];
|
|
395
|
+
n0_registry.registerError(ServiceUnavailable$, ServiceUnavailable);
|
|
396
|
+
var ValidationError$ = [-3, n0, _VE,
|
|
397
|
+
{ [_e]: _c, [_hE]: 400 },
|
|
398
|
+
[_M],
|
|
399
|
+
[0]
|
|
400
|
+
];
|
|
401
|
+
n0_registry.registerError(ValidationError$, ValidationError);
|
|
402
|
+
const errorTypeRegistries = [
|
|
403
|
+
_s_registry,
|
|
404
|
+
n0_registry,
|
|
405
|
+
];
|
|
406
|
+
var AsyncBodyBlob = [0, n0, _ABB, 8, 21];
|
|
407
|
+
var BodyBlob = [0, n0, _BB, 8, 21];
|
|
408
|
+
var CustomAttributesHeader = [0, n0, _CAH, 8, 0];
|
|
409
|
+
var PartBlob = [0, n0, _PB, 8, 21];
|
|
410
|
+
var InvokeEndpointAsyncInput$ = [3, n0, _IEAI,
|
|
411
|
+
0,
|
|
412
|
+
[_EN, _CT, _A, _CA, _II, _IL, _SOPE, _F, _RTTLS, _ITS, _B],
|
|
413
|
+
[[0, 1], [0, { [_hH]: _XASCT }], [0, { [_hH]: _XASA }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASII }], [0, { [_hH]: _XASI }], [0, { [_hH]: _XASS }], [0, { [_hH]: _XASF }], [1, { [_hH]: _XASR }], [1, { [_hH]: _XASI_ }], [() => AsyncBodyBlob, 16]], 1
|
|
414
|
+
];
|
|
415
|
+
var InvokeEndpointAsyncOutput$ = [3, n0, _IEAO,
|
|
416
|
+
0,
|
|
417
|
+
[_II, _OL, _FL],
|
|
418
|
+
[0, [0, { [_hH]: _XASO }], [0, { [_hH]: _XASF_ }]]
|
|
419
|
+
];
|
|
420
|
+
var InvokeEndpointInput$ = [3, n0, _IEI,
|
|
421
|
+
0,
|
|
422
|
+
[_EN, _B, _CT, _A, _CA, _TM, _TV, _TCH, _II, _EE, _ICN, _SI],
|
|
423
|
+
[[0, 1], [() => BodyBlob, 16], [0, { [_hH]: _CT_ }], [0, { [_hH]: _A }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASTM }], [0, { [_hH]: _XASTV }], [0, { [_hH]: _XASTCH }], [0, { [_hH]: _XASII }], [0, { [_hH]: _XASEE }], [0, { [_hH]: _XASIC }], [0, { [_hH]: _XASSI }]], 2
|
|
424
|
+
];
|
|
425
|
+
var InvokeEndpointOutput$ = [3, n0, _IEO,
|
|
426
|
+
0,
|
|
427
|
+
[_B, _CT, _IPV, _CA, _NSI, _CSI],
|
|
428
|
+
[[() => BodyBlob, 16], [0, { [_hH]: _CT_ }], [0, { [_hH]: _xAIPV }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASNSI }], [0, { [_hH]: _XASCSI }]], 1
|
|
429
|
+
];
|
|
430
|
+
var InvokeEndpointWithResponseStreamInput$ = [3, n0, _IEWRSI,
|
|
431
|
+
0,
|
|
432
|
+
[_EN, _B, _CT, _A, _CA, _TV, _TCH, _II, _ICN, _SI],
|
|
433
|
+
[[0, 1], [() => BodyBlob, 16], [0, { [_hH]: _CT_ }], [0, { [_hH]: _XASA }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASTV }], [0, { [_hH]: _XASTCH }], [0, { [_hH]: _XASII }], [0, { [_hH]: _XASIC }], [0, { [_hH]: _XASSI }]], 2
|
|
434
|
+
];
|
|
435
|
+
var InvokeEndpointWithResponseStreamOutput$ = [3, n0, _IEWRSO,
|
|
436
|
+
0,
|
|
437
|
+
[_B, _CT, _IPV, _CA],
|
|
438
|
+
[[() => ResponseStream$, 16], [0, { [_hH]: _XASCT }], [0, { [_hH]: _xAIPV }], [() => CustomAttributesHeader, { [_hH]: _XASCA }]], 1
|
|
439
|
+
];
|
|
440
|
+
var PayloadPart$ = [3, n0, _PP,
|
|
441
|
+
0,
|
|
442
|
+
[_By],
|
|
443
|
+
[[() => PartBlob, { [_eP]: 1 }]]
|
|
444
|
+
];
|
|
445
|
+
var ResponseStream$ = [4, n0, _RS,
|
|
446
|
+
{ [_st]: 1 },
|
|
447
|
+
[_PP, _MSE, _ISF],
|
|
448
|
+
[[() => PayloadPart$, 0], [() => ModelStreamError$, 0], [() => InternalStreamFailure$, 0]]
|
|
449
|
+
];
|
|
450
|
+
var InvokeEndpoint$ = [9, n0, _IE,
|
|
451
|
+
{ [_h]: ["POST", "/endpoints/{EndpointName}/invocations", 200] }, () => InvokeEndpointInput$, () => InvokeEndpointOutput$
|
|
452
|
+
];
|
|
453
|
+
var InvokeEndpointAsync$ = [9, n0, _IEA,
|
|
454
|
+
{ [_h]: ["POST", "/endpoints/{EndpointName}/async-invocations", 202] }, () => InvokeEndpointAsyncInput$, () => InvokeEndpointAsyncOutput$
|
|
455
|
+
];
|
|
456
|
+
var InvokeEndpointWithResponseStream$ = [9, n0, _IEWRS,
|
|
457
|
+
{ [_h]: ["POST", "/endpoints/{EndpointName}/invocations-response-stream", 200] }, () => InvokeEndpointWithResponseStreamInput$, () => InvokeEndpointWithResponseStreamOutput$
|
|
458
|
+
];
|
|
459
|
+
|
|
460
|
+
const getRuntimeConfig$1 = (config) => {
|
|
461
|
+
return {
|
|
462
|
+
apiVersion: "2017-05-13",
|
|
463
|
+
base64Decoder: config?.base64Decoder ?? fromBase64,
|
|
464
|
+
base64Encoder: config?.base64Encoder ?? toBase64,
|
|
465
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
466
|
+
endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
|
|
467
|
+
extensions: config?.extensions ?? [],
|
|
468
|
+
httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSageMakerRuntimeHttpAuthSchemeProvider,
|
|
469
|
+
httpAuthSchemes: config?.httpAuthSchemes ?? [
|
|
470
|
+
{
|
|
471
|
+
schemeId: "aws.auth#sigv4",
|
|
472
|
+
identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
|
|
473
|
+
signer: new AwsSdkSigV4Signer(),
|
|
474
|
+
},
|
|
475
|
+
],
|
|
476
|
+
logger: config?.logger ?? new NoOpLogger(),
|
|
477
|
+
protocol: config?.protocol ?? AwsRestJsonProtocol,
|
|
478
|
+
protocolSettings: config?.protocolSettings ?? {
|
|
479
|
+
defaultNamespace: "com.amazonaws.sagemakerruntime",
|
|
480
|
+
errorTypeRegistries,
|
|
481
|
+
version: "2017-05-13",
|
|
482
|
+
serviceTarget: "AmazonSageMakerRuntime",
|
|
483
|
+
},
|
|
484
|
+
serviceId: config?.serviceId ?? "SageMaker Runtime",
|
|
485
|
+
urlParser: config?.urlParser ?? parseUrl,
|
|
486
|
+
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
487
|
+
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
const getRuntimeConfig = (config) => {
|
|
492
|
+
emitWarningIfUnsupportedVersion(process.version);
|
|
493
|
+
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
494
|
+
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
495
|
+
const clientSharedValues = getRuntimeConfig$1(config);
|
|
496
|
+
emitWarningIfUnsupportedVersion$1(process.version);
|
|
497
|
+
const loaderConfig = {
|
|
498
|
+
profile: config?.profile,
|
|
499
|
+
logger: clientSharedValues.logger,
|
|
500
|
+
};
|
|
501
|
+
return {
|
|
502
|
+
...clientSharedValues,
|
|
503
|
+
...config,
|
|
504
|
+
runtime: "node",
|
|
505
|
+
defaultsMode,
|
|
506
|
+
authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
507
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
508
|
+
credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
|
|
509
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
510
|
+
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
|
|
511
|
+
maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
512
|
+
region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
513
|
+
requestHandler: NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
514
|
+
retryMode: config?.retryMode ??
|
|
515
|
+
loadConfig({
|
|
516
|
+
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
517
|
+
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
518
|
+
}, config),
|
|
519
|
+
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
520
|
+
streamCollector: config?.streamCollector ?? streamCollector,
|
|
521
|
+
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
522
|
+
useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
523
|
+
userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
|
|
35
527
|
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
36
528
|
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
37
529
|
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
@@ -162,8 +654,38 @@ class SageMakerRuntime extends SageMakerRuntimeClient {
|
|
|
162
654
|
}
|
|
163
655
|
createAggregatedClient(commands, SageMakerRuntime);
|
|
164
656
|
|
|
657
|
+
exports.InternalDependencyException = InternalDependencyException;
|
|
658
|
+
exports.InternalDependencyException$ = InternalDependencyException$;
|
|
659
|
+
exports.InternalFailure = InternalFailure;
|
|
660
|
+
exports.InternalFailure$ = InternalFailure$;
|
|
661
|
+
exports.InternalStreamFailure = InternalStreamFailure;
|
|
662
|
+
exports.InternalStreamFailure$ = InternalStreamFailure$;
|
|
663
|
+
exports.InvokeEndpoint$ = InvokeEndpoint$;
|
|
664
|
+
exports.InvokeEndpointAsync$ = InvokeEndpointAsync$;
|
|
165
665
|
exports.InvokeEndpointAsyncCommand = InvokeEndpointAsyncCommand;
|
|
666
|
+
exports.InvokeEndpointAsyncInput$ = InvokeEndpointAsyncInput$;
|
|
667
|
+
exports.InvokeEndpointAsyncOutput$ = InvokeEndpointAsyncOutput$;
|
|
166
668
|
exports.InvokeEndpointCommand = InvokeEndpointCommand;
|
|
669
|
+
exports.InvokeEndpointInput$ = InvokeEndpointInput$;
|
|
670
|
+
exports.InvokeEndpointOutput$ = InvokeEndpointOutput$;
|
|
671
|
+
exports.InvokeEndpointWithResponseStream$ = InvokeEndpointWithResponseStream$;
|
|
167
672
|
exports.InvokeEndpointWithResponseStreamCommand = InvokeEndpointWithResponseStreamCommand;
|
|
673
|
+
exports.InvokeEndpointWithResponseStreamInput$ = InvokeEndpointWithResponseStreamInput$;
|
|
674
|
+
exports.InvokeEndpointWithResponseStreamOutput$ = InvokeEndpointWithResponseStreamOutput$;
|
|
675
|
+
exports.ModelError = ModelError;
|
|
676
|
+
exports.ModelError$ = ModelError$;
|
|
677
|
+
exports.ModelNotReadyException = ModelNotReadyException;
|
|
678
|
+
exports.ModelNotReadyException$ = ModelNotReadyException$;
|
|
679
|
+
exports.ModelStreamError = ModelStreamError;
|
|
680
|
+
exports.ModelStreamError$ = ModelStreamError$;
|
|
681
|
+
exports.PayloadPart$ = PayloadPart$;
|
|
682
|
+
exports.ResponseStream$ = ResponseStream$;
|
|
168
683
|
exports.SageMakerRuntime = SageMakerRuntime;
|
|
169
684
|
exports.SageMakerRuntimeClient = SageMakerRuntimeClient;
|
|
685
|
+
exports.SageMakerRuntimeServiceException = SageMakerRuntimeServiceException;
|
|
686
|
+
exports.SageMakerRuntimeServiceException$ = SageMakerRuntimeServiceException$;
|
|
687
|
+
exports.ServiceUnavailable = ServiceUnavailable;
|
|
688
|
+
exports.ServiceUnavailable$ = ServiceUnavailable$;
|
|
689
|
+
exports.ValidationError = ValidationError;
|
|
690
|
+
exports.ValidationError$ = ValidationError$;
|
|
691
|
+
exports.errorTypeRegistries = errorTypeRegistries;
|
|
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
|
|
|
15
15
|
requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
|
|
16
16
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
17
17
|
sha256: import("@smithy/types").HashConstructor;
|
|
18
|
-
streamCollector: import("
|
|
18
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
19
19
|
useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
|
|
20
20
|
useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
|
|
21
21
|
cacheMiddleware?: boolean | undefined;
|
|
@@ -16,7 +16,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
|
|
|
16
16
|
requestHandler: RequestHandler | import("@smithy/core/protocols").HttpHandler<any>;
|
|
17
17
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
18
18
|
sha256: import("@smithy/types").HashConstructor;
|
|
19
|
-
streamCollector: import("
|
|
19
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
20
20
|
useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
21
21
|
useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
22
22
|
userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
|
|
@@ -15,7 +15,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
|
|
|
15
15
|
apiVersion: string;
|
|
16
16
|
urlParser: import("@smithy/types").UrlParser;
|
|
17
17
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
18
|
-
streamCollector: import("
|
|
18
|
+
streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
|
|
19
19
|
base64Decoder: import("@smithy/types").Decoder;
|
|
20
20
|
base64Encoder: (_input: Uint8Array | string) => string;
|
|
21
21
|
utf8Decoder: import("@smithy/types").Decoder;
|
|
@@ -24,7 +24,13 @@ export declare const getRuntimeConfig: (
|
|
|
24
24
|
| RequestHandler;
|
|
25
25
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
26
26
|
sha256: import("@smithy/types").HashConstructor;
|
|
27
|
-
streamCollector:
|
|
27
|
+
streamCollector: (
|
|
28
|
+
stream:
|
|
29
|
+
| import("stream").Readable
|
|
30
|
+
| import("stream/web").ReadableStream
|
|
31
|
+
| ReadableStream
|
|
32
|
+
| Blob
|
|
33
|
+
) => Promise<Uint8Array>;
|
|
28
34
|
useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
|
|
29
35
|
(boolean | import("@smithy/types").Provider<boolean | undefined>);
|
|
30
36
|
useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
|
|
@@ -25,7 +25,13 @@ export declare const getRuntimeConfig: (
|
|
|
25
25
|
| import("@smithy/core/protocols").HttpHandler<any>;
|
|
26
26
|
retryMode: string | import("@smithy/types").Provider<string>;
|
|
27
27
|
sha256: import("@smithy/types").HashConstructor;
|
|
28
|
-
streamCollector:
|
|
28
|
+
streamCollector: (
|
|
29
|
+
stream:
|
|
30
|
+
| import("stream").Readable
|
|
31
|
+
| import("stream/web").ReadableStream
|
|
32
|
+
| ReadableStream
|
|
33
|
+
| Blob
|
|
34
|
+
) => Promise<Uint8Array>;
|
|
29
35
|
useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
30
36
|
useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
|
|
31
37
|
userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
|
|
@@ -22,7 +22,13 @@ export declare const getRuntimeConfig: (
|
|
|
22
22
|
apiVersion: string;
|
|
23
23
|
urlParser: import("@smithy/types").UrlParser;
|
|
24
24
|
bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
|
|
25
|
-
streamCollector:
|
|
25
|
+
streamCollector: (
|
|
26
|
+
stream:
|
|
27
|
+
| import("stream").Readable
|
|
28
|
+
| import("stream/web").ReadableStream
|
|
29
|
+
| ReadableStream
|
|
30
|
+
| Blob
|
|
31
|
+
) => Promise<Uint8Array>;
|
|
26
32
|
base64Decoder: import("@smithy/types").Decoder;
|
|
27
33
|
base64Encoder: (_input: Uint8Array | string) => string;
|
|
28
34
|
utf8Decoder: import("@smithy/types").Decoder;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws-sdk/client-sagemaker-runtime",
|
|
3
3
|
"description": "AWS SDK for JavaScript Sagemaker Runtime Client for Node.js, Browser and React Native",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1076.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
7
7
|
"build:cjs": "node ../../scripts/compilation/inline",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
23
23
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
24
|
-
"@aws-sdk/core": "^3.974.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
26
|
-
"@aws-sdk/types": "^3.973.
|
|
27
|
-
"@smithy/core": "^3.
|
|
28
|
-
"@smithy/fetch-http-handler": "^5.
|
|
29
|
-
"@smithy/node-http-handler": "^4.
|
|
30
|
-
"@smithy/types": "^4.
|
|
24
|
+
"@aws-sdk/core": "^3.974.24",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "^3.972.59",
|
|
26
|
+
"@aws-sdk/types": "^3.973.14",
|
|
27
|
+
"@smithy/core": "^3.27.0",
|
|
28
|
+
"@smithy/fetch-http-handler": "^5.6.0",
|
|
29
|
+
"@smithy/node-http-handler": "^4.9.0",
|
|
30
|
+
"@smithy/types": "^4.15.0",
|
|
31
31
|
"tslib": "^2.6.2"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const { resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
|
|
2
|
-
const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
|
|
3
|
-
exports.defaultSageMakerRuntimeHttpAuthSchemeParametersProvider = async (config, context, input) => {
|
|
4
|
-
return {
|
|
5
|
-
operation: getSmithyContext(context).operation,
|
|
6
|
-
region: await normalizeProvider(config.region)() || (() => {
|
|
7
|
-
throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
|
|
8
|
-
})(),
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
function createAwsAuthSigv4HttpAuthOption(authParameters) {
|
|
12
|
-
return {
|
|
13
|
-
schemeId: "aws.auth#sigv4",
|
|
14
|
-
signingProperties: {
|
|
15
|
-
name: "sagemaker",
|
|
16
|
-
region: authParameters.region,
|
|
17
|
-
},
|
|
18
|
-
propertiesExtractor: (config, context) => ({
|
|
19
|
-
signingProperties: {
|
|
20
|
-
config,
|
|
21
|
-
context,
|
|
22
|
-
},
|
|
23
|
-
}),
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
exports.defaultSageMakerRuntimeHttpAuthSchemeProvider = (authParameters) => {
|
|
27
|
-
const options = [];
|
|
28
|
-
switch (authParameters.operation) {
|
|
29
|
-
default: {
|
|
30
|
-
options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return options;
|
|
34
|
-
};
|
|
35
|
-
exports.resolveHttpAuthSchemeConfig = (config) => {
|
|
36
|
-
const config_0 = resolveAwsSdkSigV4Config(config);
|
|
37
|
-
return Object.assign(config_0, {
|
|
38
|
-
authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
|
|
39
|
-
});
|
|
40
|
-
};
|
package/dist-cjs/endpoint/bdd.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
|
|
2
|
-
const m = "ref";
|
|
3
|
-
const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "booleanEquals", f = "getAttr", g = "stringEquals", h = { [m]: "Endpoint" }, i = { [m]: d }, j = { "fn": f, "argv": [i, "name"] }, k = {}, l = [{ [m]: "Region" }];
|
|
4
|
-
const _data = {
|
|
5
|
-
conditions: [
|
|
6
|
-
[c, [h]],
|
|
7
|
-
[c, l],
|
|
8
|
-
["aws.partition", l, d],
|
|
9
|
-
[e, [{ [m]: "UseFIPS" }, b]],
|
|
10
|
-
[e, [{ [m]: "UseDualStack" }, b]],
|
|
11
|
-
[e, [{ fn: f, argv: [i, "supportsDualStack"] }, b]],
|
|
12
|
-
[e, [{ fn: f, argv: [i, "supportsFIPS"] }, b]],
|
|
13
|
-
[g, [j, "aws"]],
|
|
14
|
-
[g, [j, "aws-us-gov"]]
|
|
15
|
-
],
|
|
16
|
-
results: [
|
|
17
|
-
[a],
|
|
18
|
-
[a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
|
|
19
|
-
[a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
|
|
20
|
-
[h, k],
|
|
21
|
-
["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
|
|
22
|
-
[a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
|
|
23
|
-
["https://runtime-fips.sagemaker.{Region}.amazonaws.com", k],
|
|
24
|
-
["https://runtime.sagemaker.{Region}.amazonaws.com", k],
|
|
25
|
-
["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", k],
|
|
26
|
-
[a, "FIPS is enabled but this partition does not support FIPS"],
|
|
27
|
-
["https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
|
|
28
|
-
[a, "DualStack is enabled but this partition does not support DualStack"],
|
|
29
|
-
["https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", k],
|
|
30
|
-
[a, "Invalid Configuration: Missing Region"]
|
|
31
|
-
]
|
|
32
|
-
};
|
|
33
|
-
const root = 2;
|
|
34
|
-
const r = 100_000_000;
|
|
35
|
-
const nodes = new Int32Array([
|
|
36
|
-
-1, 1, -1,
|
|
37
|
-
0, 14, 3,
|
|
38
|
-
1, 4, r + 13,
|
|
39
|
-
2, 5, r + 13,
|
|
40
|
-
3, 8, 6,
|
|
41
|
-
4, 7, r + 12,
|
|
42
|
-
5, r + 10, r + 11,
|
|
43
|
-
4, 12, 9,
|
|
44
|
-
6, 10, r + 9,
|
|
45
|
-
7, r + 6, 11,
|
|
46
|
-
8, r + 7, r + 8,
|
|
47
|
-
5, 13, r + 5,
|
|
48
|
-
6, r + 4, r + 5,
|
|
49
|
-
3, r + 1, 15,
|
|
50
|
-
4, r + 2, r + 3,
|
|
51
|
-
]);
|
|
52
|
-
exports.bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const { awsEndpointFunctions } = require("@aws-sdk/core/client");
|
|
2
|
-
const { customEndpointFunctions, decideEndpoint, EndpointCache } = require("@smithy/core/endpoints");
|
|
3
|
-
const { bdd } = require("./bdd");
|
|
4
|
-
const cache = new EndpointCache({
|
|
5
|
-
size: 50,
|
|
6
|
-
params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
|
|
7
|
-
});
|
|
8
|
-
exports.defaultEndpointResolver = (endpointParams, context = {}) => {
|
|
9
|
-
return cache.get(endpointParams, () => decideEndpoint(bdd, {
|
|
10
|
-
endpointParams: endpointParams,
|
|
11
|
-
logger: context.logger,
|
|
12
|
-
}));
|
|
13
|
-
};
|
|
14
|
-
customEndpointFunctions.aws = awsEndpointFunctions;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const { ServiceException: __ServiceException } = require("@smithy/core/client");
|
|
2
|
-
exports.__ServiceException = __ServiceException;
|
|
3
|
-
exports.SageMakerRuntimeServiceException = class SageMakerRuntimeServiceException extends __ServiceException {
|
|
4
|
-
constructor(options) {
|
|
5
|
-
super(options);
|
|
6
|
-
Object.setPrototypeOf(this, SageMakerRuntimeServiceException.prototype);
|
|
7
|
-
}
|
|
8
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
const { SageMakerRuntimeServiceException: __BaseException } = require("./SageMakerRuntimeServiceException");
|
|
2
|
-
exports.InternalDependencyException = class InternalDependencyException extends __BaseException {
|
|
3
|
-
name = "InternalDependencyException";
|
|
4
|
-
$fault = "server";
|
|
5
|
-
Message;
|
|
6
|
-
constructor(opts) {
|
|
7
|
-
super({
|
|
8
|
-
name: "InternalDependencyException",
|
|
9
|
-
$fault: "server",
|
|
10
|
-
...opts,
|
|
11
|
-
});
|
|
12
|
-
Object.setPrototypeOf(this, InternalDependencyException.prototype);
|
|
13
|
-
this.Message = opts.Message;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
exports.InternalFailure = class InternalFailure extends __BaseException {
|
|
17
|
-
name = "InternalFailure";
|
|
18
|
-
$fault = "server";
|
|
19
|
-
Message;
|
|
20
|
-
constructor(opts) {
|
|
21
|
-
super({
|
|
22
|
-
name: "InternalFailure",
|
|
23
|
-
$fault: "server",
|
|
24
|
-
...opts,
|
|
25
|
-
});
|
|
26
|
-
Object.setPrototypeOf(this, InternalFailure.prototype);
|
|
27
|
-
this.Message = opts.Message;
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
exports.ModelError = class ModelError extends __BaseException {
|
|
31
|
-
name = "ModelError";
|
|
32
|
-
$fault = "client";
|
|
33
|
-
Message;
|
|
34
|
-
OriginalStatusCode;
|
|
35
|
-
OriginalMessage;
|
|
36
|
-
LogStreamArn;
|
|
37
|
-
constructor(opts) {
|
|
38
|
-
super({
|
|
39
|
-
name: "ModelError",
|
|
40
|
-
$fault: "client",
|
|
41
|
-
...opts,
|
|
42
|
-
});
|
|
43
|
-
Object.setPrototypeOf(this, ModelError.prototype);
|
|
44
|
-
this.Message = opts.Message;
|
|
45
|
-
this.OriginalStatusCode = opts.OriginalStatusCode;
|
|
46
|
-
this.OriginalMessage = opts.OriginalMessage;
|
|
47
|
-
this.LogStreamArn = opts.LogStreamArn;
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.ModelNotReadyException = class ModelNotReadyException extends __BaseException {
|
|
51
|
-
name = "ModelNotReadyException";
|
|
52
|
-
$fault = "client";
|
|
53
|
-
Message;
|
|
54
|
-
constructor(opts) {
|
|
55
|
-
super({
|
|
56
|
-
name: "ModelNotReadyException",
|
|
57
|
-
$fault: "client",
|
|
58
|
-
...opts,
|
|
59
|
-
});
|
|
60
|
-
Object.setPrototypeOf(this, ModelNotReadyException.prototype);
|
|
61
|
-
this.Message = opts.Message;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
exports.ServiceUnavailable = class ServiceUnavailable extends __BaseException {
|
|
65
|
-
name = "ServiceUnavailable";
|
|
66
|
-
$fault = "server";
|
|
67
|
-
Message;
|
|
68
|
-
constructor(opts) {
|
|
69
|
-
super({
|
|
70
|
-
name: "ServiceUnavailable",
|
|
71
|
-
$fault: "server",
|
|
72
|
-
...opts,
|
|
73
|
-
});
|
|
74
|
-
Object.setPrototypeOf(this, ServiceUnavailable.prototype);
|
|
75
|
-
this.Message = opts.Message;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
exports.ValidationError = class ValidationError extends __BaseException {
|
|
79
|
-
name = "ValidationError";
|
|
80
|
-
$fault = "client";
|
|
81
|
-
Message;
|
|
82
|
-
constructor(opts) {
|
|
83
|
-
super({
|
|
84
|
-
name: "ValidationError",
|
|
85
|
-
$fault: "client",
|
|
86
|
-
...opts,
|
|
87
|
-
});
|
|
88
|
-
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
89
|
-
this.Message = opts.Message;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
exports.InternalStreamFailure = class InternalStreamFailure extends __BaseException {
|
|
93
|
-
name = "InternalStreamFailure";
|
|
94
|
-
$fault = "server";
|
|
95
|
-
Message;
|
|
96
|
-
constructor(opts) {
|
|
97
|
-
super({
|
|
98
|
-
name: "InternalStreamFailure",
|
|
99
|
-
$fault: "server",
|
|
100
|
-
...opts,
|
|
101
|
-
});
|
|
102
|
-
Object.setPrototypeOf(this, InternalStreamFailure.prototype);
|
|
103
|
-
this.Message = opts.Message;
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
exports.ModelStreamError = class ModelStreamError extends __BaseException {
|
|
107
|
-
name = "ModelStreamError";
|
|
108
|
-
$fault = "client";
|
|
109
|
-
Message;
|
|
110
|
-
ErrorCode;
|
|
111
|
-
constructor(opts) {
|
|
112
|
-
super({
|
|
113
|
-
name: "ModelStreamError",
|
|
114
|
-
$fault: "client",
|
|
115
|
-
...opts,
|
|
116
|
-
});
|
|
117
|
-
Object.setPrototypeOf(this, ModelStreamError.prototype);
|
|
118
|
-
this.Message = opts.Message;
|
|
119
|
-
this.ErrorCode = opts.ErrorCode;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const packageInfo = require("../package.json");
|
|
2
|
-
const { Sha256 } = require("@aws-crypto/sha256-browser");
|
|
3
|
-
const { createDefaultUserAgentProvider } = require("@aws-sdk/core/client");
|
|
4
|
-
const { invalidProvider, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
5
|
-
const { DEFAULT_USE_DUALSTACK_ENDPOINT, DEFAULT_USE_FIPS_ENDPOINT, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
6
|
-
const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
|
|
7
|
-
const { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } = require("@smithy/core/retry");
|
|
8
|
-
const { calculateBodyLength } = require("@smithy/core/serde");
|
|
9
|
-
const { FetchHttpHandler: RequestHandler, streamCollector } = require("@smithy/fetch-http-handler");
|
|
10
|
-
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
11
|
-
const getRuntimeConfig = (config) => {
|
|
12
|
-
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
13
|
-
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
14
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
15
|
-
return {
|
|
16
|
-
...clientSharedValues,
|
|
17
|
-
...config,
|
|
18
|
-
runtime: "browser",
|
|
19
|
-
defaultsMode,
|
|
20
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
21
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
22
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
23
|
-
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
|
|
24
|
-
maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
|
|
25
|
-
region: config?.region ?? invalidProvider("Region is missing"),
|
|
26
|
-
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
-
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
|
|
28
|
-
sha256: config?.sha256 ?? Sha256,
|
|
29
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
30
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
|
|
31
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const packageInfo = require("../package.json");
|
|
2
|
-
const { createDefaultUserAgentProvider, emitWarningIfUnsupportedVersion: awsCheckVersion, NODE_APP_ID_CONFIG_OPTIONS } = require("@aws-sdk/core/client");
|
|
3
|
-
const { NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
|
|
4
|
-
const { defaultProvider: credentialDefaultProvider } = require("@aws-sdk/credential-provider-node");
|
|
5
|
-
const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
|
|
6
|
-
const { loadConfig: loadNodeConfig, NODE_REGION_CONFIG_FILE_OPTIONS, NODE_REGION_CONFIG_OPTIONS, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, resolveDefaultsModeConfig } = require("@smithy/core/config");
|
|
7
|
-
const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
|
|
8
|
-
const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
|
|
9
|
-
const { calculateBodyLength, Hash } = require("@smithy/core/serde");
|
|
10
|
-
const { NodeHttpHandler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
|
|
11
|
-
const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
|
|
12
|
-
const getRuntimeConfig = (config) => {
|
|
13
|
-
emitWarningIfUnsupportedVersion(process.version);
|
|
14
|
-
const defaultsMode = resolveDefaultsModeConfig(config);
|
|
15
|
-
const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
|
|
16
|
-
const clientSharedValues = getSharedRuntimeConfig(config);
|
|
17
|
-
awsCheckVersion(process.version);
|
|
18
|
-
const loaderConfig = {
|
|
19
|
-
profile: config?.profile,
|
|
20
|
-
logger: clientSharedValues.logger,
|
|
21
|
-
};
|
|
22
|
-
return {
|
|
23
|
-
...clientSharedValues,
|
|
24
|
-
...config,
|
|
25
|
-
runtime: "node",
|
|
26
|
-
defaultsMode,
|
|
27
|
-
authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
|
|
28
|
-
bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
|
|
29
|
-
credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
|
|
30
|
-
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
|
|
31
|
-
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
|
|
32
|
-
maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
33
|
-
region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
|
|
34
|
-
requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
35
|
-
retryMode: config?.retryMode ??
|
|
36
|
-
loadNodeConfig({
|
|
37
|
-
...NODE_RETRY_MODE_CONFIG_OPTIONS,
|
|
38
|
-
default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
|
|
39
|
-
}, config),
|
|
40
|
-
sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
|
|
41
|
-
streamCollector: config?.streamCollector ?? streamCollector,
|
|
42
|
-
useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
43
|
-
useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
|
|
44
|
-
userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const { Sha256 } = require("@aws-crypto/sha256-js");
|
|
2
|
-
const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
|
|
3
|
-
const getRuntimeConfig = (config) => {
|
|
4
|
-
const browserDefaults = getBrowserRuntimeConfig(config);
|
|
5
|
-
return {
|
|
6
|
-
...browserDefaults,
|
|
7
|
-
...config,
|
|
8
|
-
runtime: "react-native",
|
|
9
|
-
sha256: config?.sha256 ?? Sha256,
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
const { AwsSdkSigV4Signer } = require("@aws-sdk/core/httpAuthSchemes");
|
|
2
|
-
const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
|
|
3
|
-
const { NoOpLogger } = require("@smithy/core/client");
|
|
4
|
-
const { parseUrl } = require("@smithy/core/protocols");
|
|
5
|
-
const { fromBase64, fromUtf8, toBase64, toUtf8 } = require("@smithy/core/serde");
|
|
6
|
-
const { defaultSageMakerRuntimeHttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
|
|
7
|
-
const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
|
|
8
|
-
const { errorTypeRegistries } = require("./schemas/schemas_0");
|
|
9
|
-
exports.getRuntimeConfig = (config) => {
|
|
10
|
-
return {
|
|
11
|
-
apiVersion: "2017-05-13",
|
|
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 ?? defaultSageMakerRuntimeHttpAuthSchemeProvider,
|
|
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 ?? AwsRestJsonProtocol,
|
|
27
|
-
protocolSettings: config?.protocolSettings ?? {
|
|
28
|
-
defaultNamespace: "com.amazonaws.sagemakerruntime",
|
|
29
|
-
errorTypeRegistries,
|
|
30
|
-
version: "2017-05-13",
|
|
31
|
-
serviceTarget: "AmazonSageMakerRuntime",
|
|
32
|
-
},
|
|
33
|
-
serviceId: config?.serviceId ?? "SageMaker Runtime",
|
|
34
|
-
urlParser: config?.urlParser ?? parseUrl,
|
|
35
|
-
utf8Decoder: config?.utf8Decoder ?? fromUtf8,
|
|
36
|
-
utf8Encoder: config?.utf8Encoder ?? toUtf8,
|
|
37
|
-
};
|
|
38
|
-
};
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
const _A = "Accept";
|
|
2
|
-
const _ABB = "AsyncBodyBlob";
|
|
3
|
-
const _B = "Body";
|
|
4
|
-
const _BB = "BodyBlob";
|
|
5
|
-
const _By = "Bytes";
|
|
6
|
-
const _CA = "CustomAttributes";
|
|
7
|
-
const _CAH = "CustomAttributesHeader";
|
|
8
|
-
const _CSI = "ClosedSessionId";
|
|
9
|
-
const _CT = "ContentType";
|
|
10
|
-
const _CT_ = "Content-Type";
|
|
11
|
-
const _EC = "ErrorCode";
|
|
12
|
-
const _EE = "EnableExplanations";
|
|
13
|
-
const _EN = "EndpointName";
|
|
14
|
-
const _F = "Filename";
|
|
15
|
-
const _FL = "FailureLocation";
|
|
16
|
-
const _ICN = "InferenceComponentName";
|
|
17
|
-
const _IDE = "InternalDependencyException";
|
|
18
|
-
const _IE = "InvokeEndpoint";
|
|
19
|
-
const _IEA = "InvokeEndpointAsync";
|
|
20
|
-
const _IEAI = "InvokeEndpointAsyncInput";
|
|
21
|
-
const _IEAO = "InvokeEndpointAsyncOutput";
|
|
22
|
-
const _IEI = "InvokeEndpointInput";
|
|
23
|
-
const _IEO = "InvokeEndpointOutput";
|
|
24
|
-
const _IEWRS = "InvokeEndpointWithResponseStream";
|
|
25
|
-
const _IEWRSI = "InvokeEndpointWithResponseStreamInput";
|
|
26
|
-
const _IEWRSO = "InvokeEndpointWithResponseStreamOutput";
|
|
27
|
-
const _IF = "InternalFailure";
|
|
28
|
-
const _II = "InferenceId";
|
|
29
|
-
const _IL = "InputLocation";
|
|
30
|
-
const _IPV = "InvokedProductionVariant";
|
|
31
|
-
const _ISF = "InternalStreamFailure";
|
|
32
|
-
const _ITS = "InvocationTimeoutSeconds";
|
|
33
|
-
const _LSA = "LogStreamArn";
|
|
34
|
-
const _M = "Message";
|
|
35
|
-
const _ME = "ModelError";
|
|
36
|
-
const _MNRE = "ModelNotReadyException";
|
|
37
|
-
const _MSE = "ModelStreamError";
|
|
38
|
-
const _NSI = "NewSessionId";
|
|
39
|
-
const _OL = "OutputLocation";
|
|
40
|
-
const _OM = "OriginalMessage";
|
|
41
|
-
const _OSC = "OriginalStatusCode";
|
|
42
|
-
const _PB = "PartBlob";
|
|
43
|
-
const _PP = "PayloadPart";
|
|
44
|
-
const _RS = "ResponseStream";
|
|
45
|
-
const _RTTLS = "RequestTTLSeconds";
|
|
46
|
-
const _SI = "SessionId";
|
|
47
|
-
const _SOPE = "S3OutputPathExtension";
|
|
48
|
-
const _SU = "ServiceUnavailable";
|
|
49
|
-
const _TCH = "TargetContainerHostname";
|
|
50
|
-
const _TM = "TargetModel";
|
|
51
|
-
const _TV = "TargetVariant";
|
|
52
|
-
const _VE = "ValidationError";
|
|
53
|
-
const _XASA = "X-Amzn-SageMaker-Accept";
|
|
54
|
-
const _XASCA = "X-Amzn-SageMaker-Custom-Attributes";
|
|
55
|
-
const _XASCSI = "X-Amzn-SageMaker-Closed-Session-Id";
|
|
56
|
-
const _XASCT = "X-Amzn-SageMaker-Content-Type";
|
|
57
|
-
const _XASEE = "X-Amzn-SageMaker-Enable-Explanations";
|
|
58
|
-
const _XASF = "X-Amzn-SageMaker-Filename";
|
|
59
|
-
const _XASF_ = "X-Amzn-SageMaker-FailureLocation";
|
|
60
|
-
const _XASI = "X-Amzn-SageMaker-InputLocation";
|
|
61
|
-
const _XASIC = "X-Amzn-SageMaker-Inference-Component";
|
|
62
|
-
const _XASII = "X-Amzn-SageMaker-Inference-Id";
|
|
63
|
-
const _XASI_ = "X-Amzn-SageMaker-InvocationTimeoutSeconds";
|
|
64
|
-
const _XASNSI = "X-Amzn-SageMaker-New-Session-Id";
|
|
65
|
-
const _XASO = "X-Amzn-SageMaker-OutputLocation";
|
|
66
|
-
const _XASR = "X-Amzn-SageMaker-RequestTTLSeconds";
|
|
67
|
-
const _XASS = "X-Amzn-SageMaker-S3OutputPathExtension";
|
|
68
|
-
const _XASSI = "X-Amzn-SageMaker-Session-Id";
|
|
69
|
-
const _XASTCH = "X-Amzn-SageMaker-Target-Container-Hostname";
|
|
70
|
-
const _XASTM = "X-Amzn-SageMaker-Target-Model";
|
|
71
|
-
const _XASTV = "X-Amzn-SageMaker-Target-Variant";
|
|
72
|
-
const _aQE = "awsQueryError";
|
|
73
|
-
const _c = "client";
|
|
74
|
-
const _e = "error";
|
|
75
|
-
const _eP = "eventPayload";
|
|
76
|
-
const _h = "http";
|
|
77
|
-
const _hE = "httpError";
|
|
78
|
-
const _hH = "httpHeader";
|
|
79
|
-
const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sagemakerruntime";
|
|
80
|
-
const _se = "server";
|
|
81
|
-
const _st = "streaming";
|
|
82
|
-
const _xAIPV = "x-Amzn-Invoked-Production-Variant";
|
|
83
|
-
const n0 = "com.amazonaws.sagemakerruntime";
|
|
84
|
-
const { TypeRegistry } = require("@smithy/core/schema");
|
|
85
|
-
const { InternalDependencyException, InternalFailure, InternalStreamFailure, ModelError, ModelNotReadyException, ModelStreamError, ServiceUnavailable, ValidationError } = require("../models/errors");
|
|
86
|
-
const { SageMakerRuntimeServiceException } = require("../models/SageMakerRuntimeServiceException");
|
|
87
|
-
const _s_registry = TypeRegistry.for(_s);
|
|
88
|
-
const SageMakerRuntimeServiceException$ = [-3, _s, "SageMakerRuntimeServiceException", 0, [], []];
|
|
89
|
-
exports.SageMakerRuntimeServiceException$ = SageMakerRuntimeServiceException$;
|
|
90
|
-
_s_registry.registerError(SageMakerRuntimeServiceException$, SageMakerRuntimeServiceException);
|
|
91
|
-
const n0_registry = TypeRegistry.for(n0);
|
|
92
|
-
const InternalDependencyException$ = [-3, n0, _IDE,
|
|
93
|
-
{ [_e]: _se, [_hE]: 530 },
|
|
94
|
-
[_M],
|
|
95
|
-
[0]
|
|
96
|
-
];
|
|
97
|
-
exports.InternalDependencyException$ = InternalDependencyException$;
|
|
98
|
-
n0_registry.registerError(InternalDependencyException$, InternalDependencyException);
|
|
99
|
-
const InternalFailure$ = [-3, n0, _IF,
|
|
100
|
-
{ [_e]: _se, [_hE]: 500 },
|
|
101
|
-
[_M],
|
|
102
|
-
[0]
|
|
103
|
-
];
|
|
104
|
-
exports.InternalFailure$ = InternalFailure$;
|
|
105
|
-
n0_registry.registerError(InternalFailure$, InternalFailure);
|
|
106
|
-
const InternalStreamFailure$ = [-3, n0, _ISF,
|
|
107
|
-
{ [_e]: _se },
|
|
108
|
-
[_M],
|
|
109
|
-
[0]
|
|
110
|
-
];
|
|
111
|
-
exports.InternalStreamFailure$ = InternalStreamFailure$;
|
|
112
|
-
n0_registry.registerError(InternalStreamFailure$, InternalStreamFailure);
|
|
113
|
-
const ModelError$ = [-3, n0, _ME,
|
|
114
|
-
{ [_e]: _c, [_hE]: 424 },
|
|
115
|
-
[_M, _OSC, _OM, _LSA],
|
|
116
|
-
[0, 1, 0, 0]
|
|
117
|
-
];
|
|
118
|
-
exports.ModelError$ = ModelError$;
|
|
119
|
-
n0_registry.registerError(ModelError$, ModelError);
|
|
120
|
-
const ModelNotReadyException$ = [-3, n0, _MNRE,
|
|
121
|
-
{ [_aQE]: [`ModelNotReadyException`, 429], [_e]: _c, [_hE]: 429 },
|
|
122
|
-
[_M],
|
|
123
|
-
[0]
|
|
124
|
-
];
|
|
125
|
-
exports.ModelNotReadyException$ = ModelNotReadyException$;
|
|
126
|
-
n0_registry.registerError(ModelNotReadyException$, ModelNotReadyException);
|
|
127
|
-
const ModelStreamError$ = [-3, n0, _MSE,
|
|
128
|
-
{ [_e]: _c },
|
|
129
|
-
[_M, _EC],
|
|
130
|
-
[0, 0]
|
|
131
|
-
];
|
|
132
|
-
exports.ModelStreamError$ = ModelStreamError$;
|
|
133
|
-
n0_registry.registerError(ModelStreamError$, ModelStreamError);
|
|
134
|
-
const ServiceUnavailable$ = [-3, n0, _SU,
|
|
135
|
-
{ [_e]: _se, [_hE]: 503 },
|
|
136
|
-
[_M],
|
|
137
|
-
[0]
|
|
138
|
-
];
|
|
139
|
-
exports.ServiceUnavailable$ = ServiceUnavailable$;
|
|
140
|
-
n0_registry.registerError(ServiceUnavailable$, ServiceUnavailable);
|
|
141
|
-
const ValidationError$ = [-3, n0, _VE,
|
|
142
|
-
{ [_e]: _c, [_hE]: 400 },
|
|
143
|
-
[_M],
|
|
144
|
-
[0]
|
|
145
|
-
];
|
|
146
|
-
exports.ValidationError$ = ValidationError$;
|
|
147
|
-
n0_registry.registerError(ValidationError$, ValidationError);
|
|
148
|
-
exports.errorTypeRegistries = [
|
|
149
|
-
_s_registry,
|
|
150
|
-
n0_registry,
|
|
151
|
-
];
|
|
152
|
-
var AsyncBodyBlob = [0, n0, _ABB, 8, 21];
|
|
153
|
-
var BodyBlob = [0, n0, _BB, 8, 21];
|
|
154
|
-
var CustomAttributesHeader = [0, n0, _CAH, 8, 0];
|
|
155
|
-
var PartBlob = [0, n0, _PB, 8, 21];
|
|
156
|
-
const InvokeEndpointAsyncInput$ = [3, n0, _IEAI,
|
|
157
|
-
0,
|
|
158
|
-
[_EN, _CT, _A, _CA, _II, _IL, _SOPE, _F, _RTTLS, _ITS, _B],
|
|
159
|
-
[[0, 1], [0, { [_hH]: _XASCT }], [0, { [_hH]: _XASA }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASII }], [0, { [_hH]: _XASI }], [0, { [_hH]: _XASS }], [0, { [_hH]: _XASF }], [1, { [_hH]: _XASR }], [1, { [_hH]: _XASI_ }], [() => AsyncBodyBlob, 16]], 1
|
|
160
|
-
];
|
|
161
|
-
exports.InvokeEndpointAsyncInput$ = InvokeEndpointAsyncInput$;
|
|
162
|
-
const InvokeEndpointAsyncOutput$ = [3, n0, _IEAO,
|
|
163
|
-
0,
|
|
164
|
-
[_II, _OL, _FL],
|
|
165
|
-
[0, [0, { [_hH]: _XASO }], [0, { [_hH]: _XASF_ }]]
|
|
166
|
-
];
|
|
167
|
-
exports.InvokeEndpointAsyncOutput$ = InvokeEndpointAsyncOutput$;
|
|
168
|
-
const InvokeEndpointInput$ = [3, n0, _IEI,
|
|
169
|
-
0,
|
|
170
|
-
[_EN, _B, _CT, _A, _CA, _TM, _TV, _TCH, _II, _EE, _ICN, _SI],
|
|
171
|
-
[[0, 1], [() => BodyBlob, 16], [0, { [_hH]: _CT_ }], [0, { [_hH]: _A }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASTM }], [0, { [_hH]: _XASTV }], [0, { [_hH]: _XASTCH }], [0, { [_hH]: _XASII }], [0, { [_hH]: _XASEE }], [0, { [_hH]: _XASIC }], [0, { [_hH]: _XASSI }]], 2
|
|
172
|
-
];
|
|
173
|
-
exports.InvokeEndpointInput$ = InvokeEndpointInput$;
|
|
174
|
-
const InvokeEndpointOutput$ = [3, n0, _IEO,
|
|
175
|
-
0,
|
|
176
|
-
[_B, _CT, _IPV, _CA, _NSI, _CSI],
|
|
177
|
-
[[() => BodyBlob, 16], [0, { [_hH]: _CT_ }], [0, { [_hH]: _xAIPV }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASNSI }], [0, { [_hH]: _XASCSI }]], 1
|
|
178
|
-
];
|
|
179
|
-
exports.InvokeEndpointOutput$ = InvokeEndpointOutput$;
|
|
180
|
-
const InvokeEndpointWithResponseStreamInput$ = [3, n0, _IEWRSI,
|
|
181
|
-
0,
|
|
182
|
-
[_EN, _B, _CT, _A, _CA, _TV, _TCH, _II, _ICN, _SI],
|
|
183
|
-
[[0, 1], [() => BodyBlob, 16], [0, { [_hH]: _CT_ }], [0, { [_hH]: _XASA }], [() => CustomAttributesHeader, { [_hH]: _XASCA }], [0, { [_hH]: _XASTV }], [0, { [_hH]: _XASTCH }], [0, { [_hH]: _XASII }], [0, { [_hH]: _XASIC }], [0, { [_hH]: _XASSI }]], 2
|
|
184
|
-
];
|
|
185
|
-
exports.InvokeEndpointWithResponseStreamInput$ = InvokeEndpointWithResponseStreamInput$;
|
|
186
|
-
const InvokeEndpointWithResponseStreamOutput$ = [3, n0, _IEWRSO,
|
|
187
|
-
0,
|
|
188
|
-
[_B, _CT, _IPV, _CA],
|
|
189
|
-
[[() => ResponseStream$, 16], [0, { [_hH]: _XASCT }], [0, { [_hH]: _xAIPV }], [() => CustomAttributesHeader, { [_hH]: _XASCA }]], 1
|
|
190
|
-
];
|
|
191
|
-
exports.InvokeEndpointWithResponseStreamOutput$ = InvokeEndpointWithResponseStreamOutput$;
|
|
192
|
-
const PayloadPart$ = [3, n0, _PP,
|
|
193
|
-
0,
|
|
194
|
-
[_By],
|
|
195
|
-
[[() => PartBlob, { [_eP]: 1 }]]
|
|
196
|
-
];
|
|
197
|
-
exports.PayloadPart$ = PayloadPart$;
|
|
198
|
-
const ResponseStream$ = [4, n0, _RS,
|
|
199
|
-
{ [_st]: 1 },
|
|
200
|
-
[_PP, _MSE, _ISF],
|
|
201
|
-
[[() => PayloadPart$, 0], [() => ModelStreamError$, 0], [() => InternalStreamFailure$, 0]]
|
|
202
|
-
];
|
|
203
|
-
exports.ResponseStream$ = ResponseStream$;
|
|
204
|
-
exports.InvokeEndpoint$ = [9, n0, _IE,
|
|
205
|
-
{ [_h]: ["POST", "/endpoints/{EndpointName}/invocations", 200] }, () => InvokeEndpointInput$, () => InvokeEndpointOutput$
|
|
206
|
-
];
|
|
207
|
-
exports.InvokeEndpointAsync$ = [9, n0, _IEA,
|
|
208
|
-
{ [_h]: ["POST", "/endpoints/{EndpointName}/async-invocations", 202] }, () => InvokeEndpointAsyncInput$, () => InvokeEndpointAsyncOutput$
|
|
209
|
-
];
|
|
210
|
-
exports.InvokeEndpointWithResponseStream$ = [9, n0, _IEWRS,
|
|
211
|
-
{ [_h]: ["POST", "/endpoints/{EndpointName}/invocations-response-stream", 200] }, () => InvokeEndpointWithResponseStreamInput$, () => InvokeEndpointWithResponseStreamOutput$
|
|
212
|
-
];
|