@aws-sdk/client-sagemaker-runtime-http2 3.1075.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 CHANGED
@@ -1,23 +1,60 @@
1
- var __exportStar = (m, e) => { Object.assign(e, m); };
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 { resolveEventStreamConfig, getEventStreamPlugin } = require("@aws-sdk/middleware-eventstream");
4
3
  const { getHttpAuthSchemeEndpointRuleSetPlugin, DefaultIdentityProviderConfig, getHttpSigningPlugin } = require("@smithy/core");
5
- const { getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
4
+ const { normalizeProvider, getSmithyContext, ServiceException, NoOpLogger, emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode, getDefaultExtensionConfiguration, resolveDefaultRuntimeConfig, Client, Command, createAggregatedClient } = require("@smithy/core/client");
6
5
  exports.$Command = Command;
7
6
  exports.__Client = Client;
8
- const { resolveRegionConfig } = require("@smithy/core/config");
9
- const { resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
10
- const { resolveEventStreamSerdeConfig } = require("@smithy/core/event-streams");
11
- const { getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
12
- const { resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
13
- const { getSchemaSerdePlugin } = require("@smithy/core/schema");
14
- const { resolveHttpAuthSchemeConfig, defaultSageMakerRuntimeHTTP2HttpAuthSchemeParametersProvider } = require("./auth/httpAuthSchemeProvider");
15
- const { getRuntimeConfig } = require("./runtimeConfig");
16
- const { InvokeEndpointWithBidirectionalStream$ } = require("./schemas/schemas_0");
17
- __exportStar(require("./schemas/schemas_0"), exports);
18
- __exportStar(require("./models/errors"), exports);
19
- const { SageMakerRuntimeHTTP2ServiceException } = require("./models/SageMakerRuntimeHTTP2ServiceException");
20
- exports.SageMakerRuntimeHTTP2ServiceException = SageMakerRuntimeHTTP2ServiceException;
7
+ 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");
8
+ const { BinaryDecisionDiagram, EndpointCache, decideEndpoint, customEndpointFunctions, resolveEndpointConfig, getEndpointPlugin } = require("@smithy/core/endpoints");
9
+ const { eventStreamSerdeProvider, resolveEventStreamSerdeConfig } = require("@smithy/core/event-streams");
10
+ const { parseUrl, getHttpHandlerExtensionConfiguration, resolveHttpHandlerRuntimeConfig, getContentLengthPlugin } = require("@smithy/core/protocols");
11
+ const { DEFAULT_RETRY_MODE, NODE_RETRY_MODE_CONFIG_OPTIONS, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, resolveRetryConfig, getRetryPlugin } = require("@smithy/core/retry");
12
+ const { TypeRegistry, getSchemaSerdePlugin } = require("@smithy/core/schema");
13
+ const { resolveAwsSdkSigV4Config, AwsSdkSigV4Signer, NODE_AUTH_SCHEME_PREFERENCE_OPTIONS } = require("@aws-sdk/core/httpAuthSchemes");
14
+ const { defaultProvider } = require("@aws-sdk/credential-provider-node");
15
+ const { eventStreamPayloadHandlerProvider } = require("@aws-sdk/eventstream-handler-node");
16
+ const { toUtf8, fromUtf8, toBase64, fromBase64, Hash, calculateBodyLength } = require("@smithy/core/serde");
17
+ const { streamCollector, NodeHttp2Handler } = require("@smithy/node-http-handler");
18
+ const { AwsRestJsonProtocol } = require("@aws-sdk/core/protocols");
19
+
20
+ const defaultSageMakerRuntimeHTTP2HttpAuthSchemeParametersProvider = async (config, context, input) => {
21
+ return {
22
+ operation: getSmithyContext(context).operation,
23
+ region: await normalizeProvider(config.region)() || (() => {
24
+ throw new Error("expected `region` to be configured for `aws.auth#sigv4`");
25
+ })(),
26
+ };
27
+ };
28
+ function createAwsAuthSigv4HttpAuthOption(authParameters) {
29
+ return {
30
+ schemeId: "aws.auth#sigv4",
31
+ signingProperties: {
32
+ name: "sagemaker",
33
+ region: authParameters.region,
34
+ },
35
+ propertiesExtractor: (config, context) => ({
36
+ signingProperties: {
37
+ config,
38
+ context,
39
+ },
40
+ }),
41
+ };
42
+ }
43
+ const defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider = (authParameters) => {
44
+ const options = [];
45
+ switch (authParameters.operation) {
46
+ default: {
47
+ options.push(createAwsAuthSigv4HttpAuthOption(authParameters));
48
+ }
49
+ }
50
+ return options;
51
+ };
52
+ const resolveHttpAuthSchemeConfig = (config) => {
53
+ const config_0 = resolveAwsSdkSigV4Config(config);
54
+ return Object.assign(config_0, {
55
+ authSchemePreference: normalizeProvider(config.authSchemePreference ?? []),
56
+ });
57
+ };
21
58
 
22
59
  const resolveClientEndpointParameters = (options) => {
23
60
  return Object.assign(options, {
@@ -33,6 +70,392 @@ const commonParams = {
33
70
  UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
34
71
  };
35
72
 
73
+ var version = "3.1075.0";
74
+ var packageInfo = {
75
+ version: version};
76
+
77
+ const m = "ref";
78
+ const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "stringEquals", f = "booleanEquals", g = "getAttr", h = { [m]: "Endpoint" }, i = { "fn": g, "argv": [{ [m]: d }, "name"] }, j = { [m]: d }, k = {}, l = [{ [m]: "Region" }];
79
+ const _data = {
80
+ conditions: [
81
+ [c, [h]],
82
+ [c, l],
83
+ ["aws.partition", l, d],
84
+ [e, [i, "aws"]],
85
+ [e, [i, "aws-cn"]],
86
+ [e, [i, "aws-us-gov"]],
87
+ [e, [i, "aws-iso"]],
88
+ [e, [i, "aws-iso-b"]],
89
+ [e, [i, "aws-eusc"]],
90
+ [e, [i, "aws-iso-f"]],
91
+ [f, [{ [m]: "UseFIPS" }, b]],
92
+ [f, [{ fn: g, argv: [j, "supportsFIPS"] }, b]],
93
+ [f, [{ [m]: "UseDualStack" }, b]],
94
+ [f, [{ fn: g, argv: [j, "supportsDualStack"] }, b]]
95
+ ],
96
+ results: [
97
+ [a],
98
+ [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
99
+ [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
100
+ [h, k],
101
+ ["https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", k],
102
+ ["https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", k],
103
+ ["https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", k],
104
+ ["https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", k],
105
+ ["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
106
+ [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
107
+ ["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", k],
108
+ [a, "FIPS is enabled but this partition does not support FIPS"],
109
+ ["https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
110
+ [a, "DualStack is enabled but this partition does not support DualStack"],
111
+ ["https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", k],
112
+ [a, "Invalid Configuration: Missing Region"]
113
+ ]
114
+ };
115
+ const root = 2;
116
+ const r = 100_000_000;
117
+ const nodes = new Int32Array([
118
+ -1, 1, -1,
119
+ 0, 22, 3,
120
+ 1, 4, r + 15,
121
+ 2, 5, r + 15,
122
+ 3, 19, 6,
123
+ 4, 19, 7,
124
+ 5, 19, 8,
125
+ 6, 19, 9,
126
+ 7, 19, 10,
127
+ 8, 19, 11,
128
+ 9, 19, 12,
129
+ 10, 15, 13,
130
+ 12, 14, r + 14,
131
+ 13, r + 12, r + 13,
132
+ 11, 17, 16,
133
+ 12, r + 9, r + 11,
134
+ 12, 18, r + 10,
135
+ 13, r + 8, r + 9,
136
+ 10, 21, 20,
137
+ 12, r + 5, r + 4,
138
+ 12, r + 7, r + 6,
139
+ 10, r + 1, 23,
140
+ 12, r + 2, r + 3,
141
+ ]);
142
+ const bdd = BinaryDecisionDiagram.from(nodes, root, _data.conditions, _data.results);
143
+
144
+ const cache = new EndpointCache({
145
+ size: 50,
146
+ params: ["Endpoint", "Region", "UseDualStack", "UseFIPS"],
147
+ });
148
+ const defaultEndpointResolver = (endpointParams, context = {}) => {
149
+ return cache.get(endpointParams, () => decideEndpoint(bdd, {
150
+ endpointParams: endpointParams,
151
+ logger: context.logger,
152
+ }));
153
+ };
154
+ customEndpointFunctions.aws = awsEndpointFunctions;
155
+
156
+ class SageMakerRuntimeHTTP2ServiceException extends ServiceException {
157
+ constructor(options) {
158
+ super(options);
159
+ Object.setPrototypeOf(this, SageMakerRuntimeHTTP2ServiceException.prototype);
160
+ }
161
+ }
162
+
163
+ class InputValidationError extends SageMakerRuntimeHTTP2ServiceException {
164
+ name = "InputValidationError";
165
+ $fault = "client";
166
+ Message;
167
+ ErrorCode;
168
+ constructor(opts) {
169
+ super({
170
+ name: "InputValidationError",
171
+ $fault: "client",
172
+ ...opts,
173
+ });
174
+ Object.setPrototypeOf(this, InputValidationError.prototype);
175
+ this.Message = opts.Message;
176
+ this.ErrorCode = opts.ErrorCode;
177
+ }
178
+ }
179
+ class InternalServerError extends SageMakerRuntimeHTTP2ServiceException {
180
+ name = "InternalServerError";
181
+ $fault = "server";
182
+ Message;
183
+ ErrorCode;
184
+ constructor(opts) {
185
+ super({
186
+ name: "InternalServerError",
187
+ $fault: "server",
188
+ ...opts,
189
+ });
190
+ Object.setPrototypeOf(this, InternalServerError.prototype);
191
+ this.Message = opts.Message;
192
+ this.ErrorCode = opts.ErrorCode;
193
+ }
194
+ }
195
+ class InternalStreamFailure extends SageMakerRuntimeHTTP2ServiceException {
196
+ name = "InternalStreamFailure";
197
+ $fault = "server";
198
+ Message;
199
+ constructor(opts) {
200
+ super({
201
+ name: "InternalStreamFailure",
202
+ $fault: "server",
203
+ ...opts,
204
+ });
205
+ Object.setPrototypeOf(this, InternalStreamFailure.prototype);
206
+ this.Message = opts.Message;
207
+ }
208
+ }
209
+ class ModelStreamError extends SageMakerRuntimeHTTP2ServiceException {
210
+ name = "ModelStreamError";
211
+ $fault = "client";
212
+ Message;
213
+ ErrorCode;
214
+ constructor(opts) {
215
+ super({
216
+ name: "ModelStreamError",
217
+ $fault: "client",
218
+ ...opts,
219
+ });
220
+ Object.setPrototypeOf(this, ModelStreamError.prototype);
221
+ this.Message = opts.Message;
222
+ this.ErrorCode = opts.ErrorCode;
223
+ }
224
+ }
225
+ class ModelError extends SageMakerRuntimeHTTP2ServiceException {
226
+ name = "ModelError";
227
+ $fault = "client";
228
+ Message;
229
+ OriginalStatusCode;
230
+ OriginalMessage;
231
+ LogStreamArn;
232
+ ErrorCode;
233
+ constructor(opts) {
234
+ super({
235
+ name: "ModelError",
236
+ $fault: "client",
237
+ ...opts,
238
+ });
239
+ Object.setPrototypeOf(this, ModelError.prototype);
240
+ this.Message = opts.Message;
241
+ this.OriginalStatusCode = opts.OriginalStatusCode;
242
+ this.OriginalMessage = opts.OriginalMessage;
243
+ this.LogStreamArn = opts.LogStreamArn;
244
+ this.ErrorCode = opts.ErrorCode;
245
+ }
246
+ }
247
+ class ServiceUnavailableError extends SageMakerRuntimeHTTP2ServiceException {
248
+ name = "ServiceUnavailableError";
249
+ $fault = "server";
250
+ Message;
251
+ ErrorCode;
252
+ constructor(opts) {
253
+ super({
254
+ name: "ServiceUnavailableError",
255
+ $fault: "server",
256
+ ...opts,
257
+ });
258
+ Object.setPrototypeOf(this, ServiceUnavailableError.prototype);
259
+ this.Message = opts.Message;
260
+ this.ErrorCode = opts.ErrorCode;
261
+ }
262
+ }
263
+
264
+ const _B = "Body";
265
+ const _By = "Bytes";
266
+ const _CS = "CompletionState";
267
+ const _DT = "DataType";
268
+ const _EC = "ErrorCode";
269
+ const _EN = "EndpointName";
270
+ const _IEWBS = "InvokeEndpointWithBidirectionalStream";
271
+ const _IEWBSI = "InvokeEndpointWithBidirectionalStreamInput";
272
+ const _IEWBSO = "InvokeEndpointWithBidirectionalStreamOutput";
273
+ const _IPV = "InvokedProductionVariant";
274
+ const _ISE = "InternalServerError";
275
+ const _ISF = "InternalStreamFailure";
276
+ const _IVE = "InputValidationError";
277
+ const _LSA = "LogStreamArn";
278
+ const _M = "Message";
279
+ const _ME = "ModelError";
280
+ const _MIP = "ModelInvocationPath";
281
+ const _MQS = "ModelQueryString";
282
+ const _MSE = "ModelStreamError";
283
+ const _OM = "OriginalMessage";
284
+ const _OSC = "OriginalStatusCode";
285
+ const _P = "P";
286
+ const _PP = "PayloadPart";
287
+ const _RPP = "RequestPayloadPart";
288
+ const _RPPe = "ResponsePayloadPart";
289
+ const _RSE = "RequestStreamEvent";
290
+ const _RSEe = "ResponseStreamEvent";
291
+ const _SB = "SensitiveBlob";
292
+ const _SUE = "ServiceUnavailableError";
293
+ const _TV = "TargetVariant";
294
+ const _XAIPV = "X-Amzn-Invoked-Production-Variant";
295
+ const _XASMIP = "X-Amzn-SageMaker-Model-Invocation-Path";
296
+ const _XASMQS = "X-Amzn-SageMaker-Model-Query-String";
297
+ const _XASTV = "X-Amzn-SageMaker-Target-Variant";
298
+ const _c = "client";
299
+ const _e = "error";
300
+ const _eH = "eventHeader";
301
+ const _eP = "eventPayload";
302
+ const _h = "http";
303
+ const _hE = "httpError";
304
+ const _hH = "httpHeader";
305
+ const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sagemakerruntimehttp2";
306
+ const _se = "server";
307
+ const _st = "streaming";
308
+ const n0 = "com.amazonaws.sagemakerruntimehttp2";
309
+ const _s_registry = TypeRegistry.for(_s);
310
+ var SageMakerRuntimeHTTP2ServiceException$ = [-3, _s, "SageMakerRuntimeHTTP2ServiceException", 0, [], []];
311
+ _s_registry.registerError(SageMakerRuntimeHTTP2ServiceException$, SageMakerRuntimeHTTP2ServiceException);
312
+ const n0_registry = TypeRegistry.for(n0);
313
+ var InputValidationError$ = [-3, n0, _IVE,
314
+ { [_e]: _c, [_hE]: 400 },
315
+ [_M, _EC],
316
+ [0, 0]
317
+ ];
318
+ n0_registry.registerError(InputValidationError$, InputValidationError);
319
+ var InternalServerError$ = [-3, n0, _ISE,
320
+ { [_e]: _se, [_hE]: 500 },
321
+ [_M, _EC],
322
+ [0, 0]
323
+ ];
324
+ n0_registry.registerError(InternalServerError$, InternalServerError);
325
+ var InternalStreamFailure$ = [-3, n0, _ISF,
326
+ { [_e]: _se },
327
+ [_M],
328
+ [0]
329
+ ];
330
+ n0_registry.registerError(InternalStreamFailure$, InternalStreamFailure);
331
+ var ModelError$ = [-3, n0, _ME,
332
+ { [_e]: _c, [_hE]: 424 },
333
+ [_M, _OSC, _OM, _LSA, _EC],
334
+ [0, 1, 0, 0, 0]
335
+ ];
336
+ n0_registry.registerError(ModelError$, ModelError);
337
+ var ModelStreamError$ = [-3, n0, _MSE,
338
+ { [_e]: _c },
339
+ [_M, _EC],
340
+ [0, 0]
341
+ ];
342
+ n0_registry.registerError(ModelStreamError$, ModelStreamError);
343
+ var ServiceUnavailableError$ = [-3, n0, _SUE,
344
+ { [_e]: _se, [_hE]: 503 },
345
+ [_M, _EC],
346
+ [0, 0]
347
+ ];
348
+ n0_registry.registerError(ServiceUnavailableError$, ServiceUnavailableError);
349
+ const errorTypeRegistries = [
350
+ _s_registry,
351
+ n0_registry,
352
+ ];
353
+ var SensitiveBlob = [0, n0, _SB, 8, 21];
354
+ var InvokeEndpointWithBidirectionalStreamInput$ = [3, n0, _IEWBSI,
355
+ 0,
356
+ [_EN, _B, _TV, _MIP, _MQS],
357
+ [[0, 1], [() => RequestStreamEvent$, 16], [0, { [_hH]: _XASTV }], [0, { [_hH]: _XASMIP }], [0, { [_hH]: _XASMQS }]], 2
358
+ ];
359
+ var InvokeEndpointWithBidirectionalStreamOutput$ = [3, n0, _IEWBSO,
360
+ 0,
361
+ [_B, _IPV],
362
+ [[() => ResponseStreamEvent$, 16], [0, { [_hH]: _XAIPV }]], 1
363
+ ];
364
+ var RequestPayloadPart$ = [3, n0, _RPP,
365
+ 0,
366
+ [_By, _DT, _CS, _P],
367
+ [[() => SensitiveBlob, { [_eP]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }]]
368
+ ];
369
+ var ResponsePayloadPart$ = [3, n0, _RPPe,
370
+ 0,
371
+ [_By, _DT, _CS, _P],
372
+ [[() => SensitiveBlob, { [_eP]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }]]
373
+ ];
374
+ var RequestStreamEvent$ = [4, n0, _RSE,
375
+ { [_st]: 1 },
376
+ [_PP],
377
+ [[() => RequestPayloadPart$, 0]]
378
+ ];
379
+ var ResponseStreamEvent$ = [4, n0, _RSEe,
380
+ { [_st]: 1 },
381
+ [_PP, _MSE, _ISF],
382
+ [[() => ResponsePayloadPart$, 0], [() => ModelStreamError$, 0], [() => InternalStreamFailure$, 0]]
383
+ ];
384
+ var InvokeEndpointWithBidirectionalStream$ = [9, n0, _IEWBS,
385
+ { [_h]: ["POST", "/endpoints/{EndpointName}/invocations-bidirectional-stream", 200] }, () => InvokeEndpointWithBidirectionalStreamInput$, () => InvokeEndpointWithBidirectionalStreamOutput$
386
+ ];
387
+
388
+ const getRuntimeConfig$1 = (config) => {
389
+ return {
390
+ apiVersion: "2025-10-01",
391
+ base64Decoder: config?.base64Decoder ?? fromBase64,
392
+ base64Encoder: config?.base64Encoder ?? toBase64,
393
+ disableHostPrefix: config?.disableHostPrefix ?? false,
394
+ endpointProvider: config?.endpointProvider ?? defaultEndpointResolver,
395
+ extensions: config?.extensions ?? [],
396
+ httpAuthSchemeProvider: config?.httpAuthSchemeProvider ?? defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider,
397
+ httpAuthSchemes: config?.httpAuthSchemes ?? [
398
+ {
399
+ schemeId: "aws.auth#sigv4",
400
+ identityProvider: (ipc) => ipc.getIdentityProvider("aws.auth#sigv4"),
401
+ signer: new AwsSdkSigV4Signer(),
402
+ },
403
+ ],
404
+ logger: config?.logger ?? new NoOpLogger(),
405
+ protocol: config?.protocol ?? AwsRestJsonProtocol,
406
+ protocolSettings: config?.protocolSettings ?? {
407
+ defaultNamespace: "com.amazonaws.sagemakerruntimehttp2",
408
+ errorTypeRegistries,
409
+ version: "2025-10-01",
410
+ serviceTarget: "AmazonSageMakerRuntimeHttp2",
411
+ },
412
+ serviceId: config?.serviceId ?? "SageMaker Runtime HTTP2",
413
+ urlParser: config?.urlParser ?? parseUrl,
414
+ utf8Decoder: config?.utf8Decoder ?? fromUtf8,
415
+ utf8Encoder: config?.utf8Encoder ?? toUtf8,
416
+ };
417
+ };
418
+
419
+ const getRuntimeConfig = (config) => {
420
+ emitWarningIfUnsupportedVersion(process.version);
421
+ const defaultsMode = resolveDefaultsModeConfig(config);
422
+ const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
423
+ const clientSharedValues = getRuntimeConfig$1(config);
424
+ emitWarningIfUnsupportedVersion$1(process.version);
425
+ const loaderConfig = {
426
+ profile: config?.profile,
427
+ logger: clientSharedValues.logger,
428
+ };
429
+ return {
430
+ ...clientSharedValues,
431
+ ...config,
432
+ runtime: "node",
433
+ defaultsMode,
434
+ authSchemePreference: config?.authSchemePreference ?? loadConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
435
+ bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
436
+ credentialDefaultProvider: config?.credentialDefaultProvider ?? defaultProvider,
437
+ defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
438
+ eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
439
+ eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
440
+ maxAttempts: config?.maxAttempts ?? loadConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
441
+ region: config?.region ?? loadConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
442
+ requestHandler: NodeHttp2Handler.create(config?.requestHandler ?? (async () => ({
443
+ ...await defaultConfigProvider(),
444
+ disableConcurrentStreams: true
445
+ }))),
446
+ retryMode: config?.retryMode ??
447
+ loadConfig({
448
+ ...NODE_RETRY_MODE_CONFIG_OPTIONS,
449
+ default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
450
+ }, config),
451
+ sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
452
+ streamCollector: config?.streamCollector ?? streamCollector,
453
+ useDualstackEndpoint: config?.useDualstackEndpoint ?? loadConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
454
+ useFipsEndpoint: config?.useFipsEndpoint ?? loadConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
455
+ userAgentAppId: config?.userAgentAppId ?? loadConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
456
+ };
457
+ };
458
+
36
459
  const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
37
460
  const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
38
461
  let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
@@ -142,6 +565,28 @@ class SageMakerRuntimeHTTP2 extends SageMakerRuntimeHTTP2Client {
142
565
  }
143
566
  createAggregatedClient(commands, SageMakerRuntimeHTTP2);
144
567
 
568
+ exports.InputValidationError = InputValidationError;
569
+ exports.InputValidationError$ = InputValidationError$;
570
+ exports.InternalServerError = InternalServerError;
571
+ exports.InternalServerError$ = InternalServerError$;
572
+ exports.InternalStreamFailure = InternalStreamFailure;
573
+ exports.InternalStreamFailure$ = InternalStreamFailure$;
574
+ exports.InvokeEndpointWithBidirectionalStream$ = InvokeEndpointWithBidirectionalStream$;
145
575
  exports.InvokeEndpointWithBidirectionalStreamCommand = InvokeEndpointWithBidirectionalStreamCommand;
576
+ exports.InvokeEndpointWithBidirectionalStreamInput$ = InvokeEndpointWithBidirectionalStreamInput$;
577
+ exports.InvokeEndpointWithBidirectionalStreamOutput$ = InvokeEndpointWithBidirectionalStreamOutput$;
578
+ exports.ModelError = ModelError;
579
+ exports.ModelError$ = ModelError$;
580
+ exports.ModelStreamError = ModelStreamError;
581
+ exports.ModelStreamError$ = ModelStreamError$;
582
+ exports.RequestPayloadPart$ = RequestPayloadPart$;
583
+ exports.RequestStreamEvent$ = RequestStreamEvent$;
584
+ exports.ResponsePayloadPart$ = ResponsePayloadPart$;
585
+ exports.ResponseStreamEvent$ = ResponseStreamEvent$;
146
586
  exports.SageMakerRuntimeHTTP2 = SageMakerRuntimeHTTP2;
147
587
  exports.SageMakerRuntimeHTTP2Client = SageMakerRuntimeHTTP2Client;
588
+ exports.SageMakerRuntimeHTTP2ServiceException = SageMakerRuntimeHTTP2ServiceException;
589
+ exports.SageMakerRuntimeHTTP2ServiceException$ = SageMakerRuntimeHTTP2ServiceException$;
590
+ exports.ServiceUnavailableError = ServiceUnavailableError;
591
+ exports.ServiceUnavailableError$ = ServiceUnavailableError$;
592
+ exports.errorTypeRegistries = errorTypeRegistries;
@@ -16,7 +16,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeHTTP2ClientConfi
16
16
  requestHandler: import("@smithy/core/protocols").HttpHandler<any> | RequestHandler;
17
17
  retryMode: string | import("@smithy/types").Provider<string>;
18
18
  sha256: import("@smithy/types").HashConstructor;
19
- streamCollector: import("@smithy/types").StreamCollector;
19
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
20
20
  useDualstackEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
21
21
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) & (boolean | import("@smithy/types").Provider<boolean | undefined>);
22
22
  cacheMiddleware?: boolean | undefined;
@@ -17,7 +17,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeHTTP2ClientConfi
17
17
  requestHandler: RequestHandler | import("@smithy/core/protocols").HttpHandler<any>;
18
18
  retryMode: string | import("@smithy/types").Provider<string>;
19
19
  sha256: import("@smithy/types").HashConstructor;
20
- streamCollector: import("@smithy/types").StreamCollector;
20
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
21
21
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
22
22
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
23
23
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -16,7 +16,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeHTTP2ClientConfi
16
16
  apiVersion: string;
17
17
  urlParser: import("@smithy/types").UrlParser;
18
18
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
19
- streamCollector: import("@smithy/types").StreamCollector;
19
+ streamCollector: (stream: import("stream").Readable | import("stream/web").ReadableStream | ReadableStream | Blob) => Promise<Uint8Array>;
20
20
  base64Decoder: import("@smithy/types").Decoder;
21
21
  base64Encoder: (_input: Uint8Array | string) => string;
22
22
  utf8Decoder: import("@smithy/types").Decoder;
@@ -25,7 +25,13 @@ export declare const getRuntimeConfig: (
25
25
  | RequestHandler;
26
26
  retryMode: string | import("@smithy/types").Provider<string>;
27
27
  sha256: import("@smithy/types").HashConstructor;
28
- streamCollector: import("@smithy/types").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
  (boolean | import("@smithy/types").Provider<boolean | undefined>);
31
37
  useFipsEndpoint: (boolean | import("@smithy/types").Provider<boolean>) &
@@ -26,7 +26,13 @@ export declare const getRuntimeConfig: (
26
26
  | import("@smithy/core/protocols").HttpHandler<any>;
27
27
  retryMode: string | import("@smithy/types").Provider<string>;
28
28
  sha256: import("@smithy/types").HashConstructor;
29
- streamCollector: import("@smithy/types").StreamCollector;
29
+ streamCollector: (
30
+ stream:
31
+ | import("stream").Readable
32
+ | import("stream/web").ReadableStream
33
+ | ReadableStream
34
+ | Blob
35
+ ) => Promise<Uint8Array>;
30
36
  useDualstackEndpoint: boolean | import("@smithy/types").Provider<boolean>;
31
37
  useFipsEndpoint: boolean | import("@smithy/types").Provider<boolean>;
32
38
  userAgentAppId: string | import("@smithy/types").Provider<string | undefined>;
@@ -23,7 +23,13 @@ export declare const getRuntimeConfig: (
23
23
  apiVersion: string;
24
24
  urlParser: import("@smithy/types").UrlParser;
25
25
  bodyLengthChecker: import("@smithy/types").BodyLengthCalculator;
26
- streamCollector: import("@smithy/types").StreamCollector;
26
+ streamCollector: (
27
+ stream:
28
+ | import("stream").Readable
29
+ | import("stream/web").ReadableStream
30
+ | ReadableStream
31
+ | Blob
32
+ ) => Promise<Uint8Array>;
27
33
  base64Decoder: import("@smithy/types").Decoder;
28
34
  base64Encoder: (_input: Uint8Array | string) => string;
29
35
  utf8Decoder: import("@smithy/types").Decoder;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-runtime-http2",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Runtime Http2 Client for Node.js, Browser and React Native",
4
- "version": "3.1075.0",
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",
@@ -25,19 +25,19 @@
25
25
  "dependencies": {
26
26
  "@aws-crypto/sha256-browser": "5.2.0",
27
27
  "@aws-crypto/sha256-js": "5.2.0",
28
- "@aws-sdk/core": "^3.974.23",
29
- "@aws-sdk/credential-provider-node": "^3.972.58",
30
- "@aws-sdk/eventstream-handler-node": "^3.972.22",
31
- "@aws-sdk/middleware-eventstream": "^3.972.18",
32
- "@aws-sdk/types": "^3.973.13",
33
- "@smithy/core": "^3.24.6",
34
- "@smithy/fetch-http-handler": "^5.4.6",
35
- "@smithy/node-http-handler": "^4.7.6",
36
- "@smithy/types": "^4.14.3",
28
+ "@aws-sdk/core": "^3.974.24",
29
+ "@aws-sdk/credential-provider-node": "^3.972.59",
30
+ "@aws-sdk/eventstream-handler-node": "^3.972.23",
31
+ "@aws-sdk/middleware-eventstream": "^3.972.19",
32
+ "@aws-sdk/types": "^3.973.14",
33
+ "@smithy/core": "^3.27.0",
34
+ "@smithy/fetch-http-handler": "^5.6.0",
35
+ "@smithy/node-http-handler": "^4.9.0",
36
+ "@smithy/types": "^4.15.0",
37
37
  "tslib": "^2.6.2"
38
38
  },
39
39
  "devDependencies": {
40
- "@smithy/snapshot-testing": "^2.1.7",
40
+ "@smithy/snapshot-testing": "^2.2.3",
41
41
  "@tsconfig/node20": "20.1.8",
42
42
  "@types/node": "^20.14.8",
43
43
  "concurrently": "7.0.0",
@@ -1,40 +0,0 @@
1
- const { resolveAwsSdkSigV4Config } = require("@aws-sdk/core/httpAuthSchemes");
2
- const { getSmithyContext, normalizeProvider } = require("@smithy/core/client");
3
- exports.defaultSageMakerRuntimeHTTP2HttpAuthSchemeParametersProvider = 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.defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider = (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
- };
@@ -1,67 +0,0 @@
1
- const { BinaryDecisionDiagram } = require("@smithy/core/endpoints");
2
- const m = "ref";
3
- const a = -1, b = true, c = "isSet", d = "PartitionResult", e = "stringEquals", f = "booleanEquals", g = "getAttr", h = { [m]: "Endpoint" }, i = { "fn": g, "argv": [{ [m]: d }, "name"] }, j = { [m]: d }, k = {}, l = [{ [m]: "Region" }];
4
- const _data = {
5
- conditions: [
6
- [c, [h]],
7
- [c, l],
8
- ["aws.partition", l, d],
9
- [e, [i, "aws"]],
10
- [e, [i, "aws-cn"]],
11
- [e, [i, "aws-us-gov"]],
12
- [e, [i, "aws-iso"]],
13
- [e, [i, "aws-iso-b"]],
14
- [e, [i, "aws-eusc"]],
15
- [e, [i, "aws-iso-f"]],
16
- [f, [{ [m]: "UseFIPS" }, b]],
17
- [f, [{ fn: g, argv: [j, "supportsFIPS"] }, b]],
18
- [f, [{ [m]: "UseDualStack" }, b]],
19
- [f, [{ fn: g, argv: [j, "supportsDualStack"] }, b]]
20
- ],
21
- results: [
22
- [a],
23
- [a, "Invalid Configuration: FIPS and custom endpoint are not supported"],
24
- [a, "Invalid Configuration: Dualstack and custom endpoint are not supported"],
25
- [h, k],
26
- ["https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", k],
27
- ["https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", k],
28
- ["https://runtime-fips.sagemaker.{Region}.{PartitionResult#dnsSuffix}:8443", k],
29
- ["https://runtime-fips.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}:8443", k],
30
- ["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
31
- [a, "FIPS and DualStack are enabled, but this partition does not support one or both"],
32
- ["https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", k],
33
- [a, "FIPS is enabled but this partition does not support FIPS"],
34
- ["https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", k],
35
- [a, "DualStack is enabled but this partition does not support DualStack"],
36
- ["https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", k],
37
- [a, "Invalid Configuration: Missing Region"]
38
- ]
39
- };
40
- const root = 2;
41
- const r = 100_000_000;
42
- const nodes = new Int32Array([
43
- -1, 1, -1,
44
- 0, 22, 3,
45
- 1, 4, r + 15,
46
- 2, 5, r + 15,
47
- 3, 19, 6,
48
- 4, 19, 7,
49
- 5, 19, 8,
50
- 6, 19, 9,
51
- 7, 19, 10,
52
- 8, 19, 11,
53
- 9, 19, 12,
54
- 10, 15, 13,
55
- 12, 14, r + 14,
56
- 13, r + 12, r + 13,
57
- 11, 17, 16,
58
- 12, r + 9, r + 11,
59
- 12, 18, r + 10,
60
- 13, r + 8, r + 9,
61
- 10, 21, 20,
62
- 12, r + 5, r + 4,
63
- 12, r + 7, r + 6,
64
- 10, r + 1, 23,
65
- 12, r + 2, r + 3,
66
- ]);
67
- 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.SageMakerRuntimeHTTP2ServiceException = class SageMakerRuntimeHTTP2ServiceException extends __ServiceException {
4
- constructor(options) {
5
- super(options);
6
- Object.setPrototypeOf(this, SageMakerRuntimeHTTP2ServiceException.prototype);
7
- }
8
- };
@@ -1,101 +0,0 @@
1
- const { SageMakerRuntimeHTTP2ServiceException: __BaseException } = require("./SageMakerRuntimeHTTP2ServiceException");
2
- exports.InputValidationError = 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
- exports.InternalServerError = 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
- exports.InternalStreamFailure = 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
- exports.ModelStreamError = 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
- exports.ModelError = 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
- exports.ServiceUnavailableError = 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
- };
@@ -1,37 +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 { invalidFunction, 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
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? (() => ({
24
- handle: invalidFunction("event stream request is not supported in browser."),
25
- })),
26
- eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
27
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
28
- region: config?.region ?? invalidProvider("Region is missing"),
29
- requestHandler: RequestHandler.create(config?.requestHandler ?? defaultConfigProvider),
30
- retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE),
31
- sha256: config?.sha256 ?? Sha256,
32
- streamCollector: config?.streamCollector ?? streamCollector,
33
- useDualstackEndpoint: config?.useDualstackEndpoint ?? (() => Promise.resolve(DEFAULT_USE_DUALSTACK_ENDPOINT)),
34
- useFipsEndpoint: config?.useFipsEndpoint ?? (() => Promise.resolve(DEFAULT_USE_FIPS_ENDPOINT)),
35
- };
36
- };
37
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,52 +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 { eventStreamPayloadHandlerProvider } = require("@aws-sdk/eventstream-handler-node");
6
- const { emitWarningIfUnsupportedVersion, loadConfigsForDefaultMode } = require("@smithy/core/client");
7
- 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");
8
- const { eventStreamSerdeProvider } = require("@smithy/core/event-streams");
9
- const { DEFAULT_RETRY_MODE, NODE_MAX_ATTEMPT_CONFIG_OPTIONS, NODE_RETRY_MODE_CONFIG_OPTIONS } = require("@smithy/core/retry");
10
- const { calculateBodyLength, Hash } = require("@smithy/core/serde");
11
- const { NodeHttp2Handler: RequestHandler, streamCollector } = require("@smithy/node-http-handler");
12
- const { getRuntimeConfig: getSharedRuntimeConfig } = require("./runtimeConfig.shared");
13
- const getRuntimeConfig = (config) => {
14
- emitWarningIfUnsupportedVersion(process.version);
15
- const defaultsMode = resolveDefaultsModeConfig(config);
16
- const defaultConfigProvider = () => defaultsMode().then(loadConfigsForDefaultMode);
17
- const clientSharedValues = getSharedRuntimeConfig(config);
18
- awsCheckVersion(process.version);
19
- const loaderConfig = {
20
- profile: config?.profile,
21
- logger: clientSharedValues.logger,
22
- };
23
- return {
24
- ...clientSharedValues,
25
- ...config,
26
- runtime: "node",
27
- defaultsMode,
28
- authSchemePreference: config?.authSchemePreference ?? loadNodeConfig(NODE_AUTH_SCHEME_PREFERENCE_OPTIONS, loaderConfig),
29
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
30
- credentialDefaultProvider: config?.credentialDefaultProvider ?? credentialDefaultProvider,
31
- defaultUserAgentProvider: config?.defaultUserAgentProvider ?? createDefaultUserAgentProvider({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
32
- eventStreamPayloadHandlerProvider: config?.eventStreamPayloadHandlerProvider ?? eventStreamPayloadHandlerProvider,
33
- eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventStreamSerdeProvider,
34
- maxAttempts: config?.maxAttempts ?? loadNodeConfig(NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
35
- region: config?.region ?? loadNodeConfig(NODE_REGION_CONFIG_OPTIONS, { ...NODE_REGION_CONFIG_FILE_OPTIONS, ...loaderConfig }),
36
- requestHandler: RequestHandler.create(config?.requestHandler ?? (async () => ({
37
- ...await defaultConfigProvider(),
38
- disableConcurrentStreams: true
39
- }))),
40
- retryMode: config?.retryMode ??
41
- loadNodeConfig({
42
- ...NODE_RETRY_MODE_CONFIG_OPTIONS,
43
- default: async () => (await defaultConfigProvider()).retryMode || DEFAULT_RETRY_MODE,
44
- }, config),
45
- sha256: config?.sha256 ?? Hash.bind(null, "sha256"),
46
- streamCollector: config?.streamCollector ?? streamCollector,
47
- useDualstackEndpoint: config?.useDualstackEndpoint ?? loadNodeConfig(NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
48
- useFipsEndpoint: config?.useFipsEndpoint ?? loadNodeConfig(NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, loaderConfig),
49
- userAgentAppId: config?.userAgentAppId ?? loadNodeConfig(NODE_APP_ID_CONFIG_OPTIONS, loaderConfig),
50
- };
51
- };
52
- exports.getRuntimeConfig = getRuntimeConfig;
@@ -1,16 +0,0 @@
1
- const { Sha256 } = require("@aws-crypto/sha256-js");
2
- const { invalidFunction } = require("@smithy/core/client");
3
- const { getRuntimeConfig: getBrowserRuntimeConfig } = require("./runtimeConfig.browser");
4
- 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
- })),
13
- sha256: config?.sha256 ?? Sha256,
14
- };
15
- };
16
- 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 { defaultSageMakerRuntimeHTTP2HttpAuthSchemeProvider } = require("./auth/httpAuthSchemeProvider");
7
- const { defaultEndpointResolver } = require("./endpoint/endpointResolver");
8
- const { errorTypeRegistries } = require("./schemas/schemas_0");
9
- exports.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 ?? AwsRestJsonProtocol,
27
- protocolSettings: config?.protocolSettings ?? {
28
- defaultNamespace: "com.amazonaws.sagemakerruntimehttp2",
29
- errorTypeRegistries,
30
- version: "2025-10-01",
31
- serviceTarget: "AmazonSageMakerRuntimeHttp2",
32
- },
33
- serviceId: config?.serviceId ?? "SageMaker Runtime HTTP2",
34
- urlParser: config?.urlParser ?? parseUrl,
35
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
36
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
37
- };
38
- };
@@ -1,139 +0,0 @@
1
- const _B = "Body";
2
- const _By = "Bytes";
3
- const _CS = "CompletionState";
4
- const _DT = "DataType";
5
- const _EC = "ErrorCode";
6
- const _EN = "EndpointName";
7
- const _IEWBS = "InvokeEndpointWithBidirectionalStream";
8
- const _IEWBSI = "InvokeEndpointWithBidirectionalStreamInput";
9
- const _IEWBSO = "InvokeEndpointWithBidirectionalStreamOutput";
10
- const _IPV = "InvokedProductionVariant";
11
- const _ISE = "InternalServerError";
12
- const _ISF = "InternalStreamFailure";
13
- const _IVE = "InputValidationError";
14
- const _LSA = "LogStreamArn";
15
- const _M = "Message";
16
- const _ME = "ModelError";
17
- const _MIP = "ModelInvocationPath";
18
- const _MQS = "ModelQueryString";
19
- const _MSE = "ModelStreamError";
20
- const _OM = "OriginalMessage";
21
- const _OSC = "OriginalStatusCode";
22
- const _P = "P";
23
- const _PP = "PayloadPart";
24
- const _RPP = "RequestPayloadPart";
25
- const _RPPe = "ResponsePayloadPart";
26
- const _RSE = "RequestStreamEvent";
27
- const _RSEe = "ResponseStreamEvent";
28
- const _SB = "SensitiveBlob";
29
- const _SUE = "ServiceUnavailableError";
30
- const _TV = "TargetVariant";
31
- const _XAIPV = "X-Amzn-Invoked-Production-Variant";
32
- const _XASMIP = "X-Amzn-SageMaker-Model-Invocation-Path";
33
- const _XASMQS = "X-Amzn-SageMaker-Model-Query-String";
34
- const _XASTV = "X-Amzn-SageMaker-Target-Variant";
35
- const _c = "client";
36
- const _e = "error";
37
- const _eH = "eventHeader";
38
- const _eP = "eventPayload";
39
- const _h = "http";
40
- const _hE = "httpError";
41
- const _hH = "httpHeader";
42
- const _s = "smithy.ts.sdk.synthetic.com.amazonaws.sagemakerruntimehttp2";
43
- const _se = "server";
44
- const _st = "streaming";
45
- const n0 = "com.amazonaws.sagemakerruntimehttp2";
46
- const { TypeRegistry } = require("@smithy/core/schema");
47
- const { InputValidationError, InternalServerError, InternalStreamFailure, ModelError, ModelStreamError, ServiceUnavailableError } = require("../models/errors");
48
- const { SageMakerRuntimeHTTP2ServiceException } = require("../models/SageMakerRuntimeHTTP2ServiceException");
49
- const _s_registry = TypeRegistry.for(_s);
50
- const SageMakerRuntimeHTTP2ServiceException$ = [-3, _s, "SageMakerRuntimeHTTP2ServiceException", 0, [], []];
51
- exports.SageMakerRuntimeHTTP2ServiceException$ = SageMakerRuntimeHTTP2ServiceException$;
52
- _s_registry.registerError(SageMakerRuntimeHTTP2ServiceException$, SageMakerRuntimeHTTP2ServiceException);
53
- const n0_registry = TypeRegistry.for(n0);
54
- const InputValidationError$ = [-3, n0, _IVE,
55
- { [_e]: _c, [_hE]: 400 },
56
- [_M, _EC],
57
- [0, 0]
58
- ];
59
- exports.InputValidationError$ = InputValidationError$;
60
- n0_registry.registerError(InputValidationError$, InputValidationError);
61
- const InternalServerError$ = [-3, n0, _ISE,
62
- { [_e]: _se, [_hE]: 500 },
63
- [_M, _EC],
64
- [0, 0]
65
- ];
66
- exports.InternalServerError$ = InternalServerError$;
67
- n0_registry.registerError(InternalServerError$, InternalServerError);
68
- const InternalStreamFailure$ = [-3, n0, _ISF,
69
- { [_e]: _se },
70
- [_M],
71
- [0]
72
- ];
73
- exports.InternalStreamFailure$ = InternalStreamFailure$;
74
- n0_registry.registerError(InternalStreamFailure$, InternalStreamFailure);
75
- const ModelError$ = [-3, n0, _ME,
76
- { [_e]: _c, [_hE]: 424 },
77
- [_M, _OSC, _OM, _LSA, _EC],
78
- [0, 1, 0, 0, 0]
79
- ];
80
- exports.ModelError$ = ModelError$;
81
- n0_registry.registerError(ModelError$, ModelError);
82
- const ModelStreamError$ = [-3, n0, _MSE,
83
- { [_e]: _c },
84
- [_M, _EC],
85
- [0, 0]
86
- ];
87
- exports.ModelStreamError$ = ModelStreamError$;
88
- n0_registry.registerError(ModelStreamError$, ModelStreamError);
89
- const ServiceUnavailableError$ = [-3, n0, _SUE,
90
- { [_e]: _se, [_hE]: 503 },
91
- [_M, _EC],
92
- [0, 0]
93
- ];
94
- exports.ServiceUnavailableError$ = ServiceUnavailableError$;
95
- n0_registry.registerError(ServiceUnavailableError$, ServiceUnavailableError);
96
- exports.errorTypeRegistries = [
97
- _s_registry,
98
- n0_registry,
99
- ];
100
- var SensitiveBlob = [0, n0, _SB, 8, 21];
101
- const InvokeEndpointWithBidirectionalStreamInput$ = [3, n0, _IEWBSI,
102
- 0,
103
- [_EN, _B, _TV, _MIP, _MQS],
104
- [[0, 1], [() => RequestStreamEvent$, 16], [0, { [_hH]: _XASTV }], [0, { [_hH]: _XASMIP }], [0, { [_hH]: _XASMQS }]], 2
105
- ];
106
- exports.InvokeEndpointWithBidirectionalStreamInput$ = InvokeEndpointWithBidirectionalStreamInput$;
107
- const InvokeEndpointWithBidirectionalStreamOutput$ = [3, n0, _IEWBSO,
108
- 0,
109
- [_B, _IPV],
110
- [[() => ResponseStreamEvent$, 16], [0, { [_hH]: _XAIPV }]], 1
111
- ];
112
- exports.InvokeEndpointWithBidirectionalStreamOutput$ = InvokeEndpointWithBidirectionalStreamOutput$;
113
- const RequestPayloadPart$ = [3, n0, _RPP,
114
- 0,
115
- [_By, _DT, _CS, _P],
116
- [[() => SensitiveBlob, { [_eP]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }]]
117
- ];
118
- exports.RequestPayloadPart$ = RequestPayloadPart$;
119
- const ResponsePayloadPart$ = [3, n0, _RPPe,
120
- 0,
121
- [_By, _DT, _CS, _P],
122
- [[() => SensitiveBlob, { [_eP]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }], [0, { [_eH]: 1 }]]
123
- ];
124
- exports.ResponsePayloadPart$ = ResponsePayloadPart$;
125
- const RequestStreamEvent$ = [4, n0, _RSE,
126
- { [_st]: 1 },
127
- [_PP],
128
- [[() => RequestPayloadPart$, 0]]
129
- ];
130
- exports.RequestStreamEvent$ = RequestStreamEvent$;
131
- const ResponseStreamEvent$ = [4, n0, _RSEe,
132
- { [_st]: 1 },
133
- [_PP, _MSE, _ISF],
134
- [[() => ResponsePayloadPart$, 0], [() => ModelStreamError$, 0], [() => InternalStreamFailure$, 0]]
135
- ];
136
- exports.ResponseStreamEvent$ = ResponseStreamEvent$;
137
- exports.InvokeEndpointWithBidirectionalStream$ = [9, n0, _IEWBS,
138
- { [_h]: ["POST", "/endpoints/{EndpointName}/invocations-bidirectional-stream", 200] }, () => InvokeEndpointWithBidirectionalStreamInput$, () => InvokeEndpointWithBidirectionalStreamOutput$
139
- ];