@aws-sdk/client-sagemaker-runtime 3.523.0 → 3.529.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
@@ -419,6 +419,7 @@ var InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = /* @__PURE__ */ _
419
419
  }), "InvokeEndpointWithResponseStreamOutputFilterSensitiveLog");
420
420
 
421
421
  // src/protocols/Aws_restJson1.ts
422
+ var import_core2 = require("@aws-sdk/core");
422
423
 
423
424
 
424
425
  var se_InvokeEndpointCommand = /* @__PURE__ */ __name(async (input, context) => {
@@ -503,7 +504,7 @@ var de_InvokeEndpointAsyncCommand = /* @__PURE__ */ __name(async (output, contex
503
504
  [_OL]: [, output.headers[_xaso]],
504
505
  [_FL]: [, output.headers[_xasf]]
505
506
  });
506
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
507
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
507
508
  const doc = (0, import_smithy_client.take)(data, {
508
509
  InferenceId: import_smithy_client.expectString
509
510
  });
@@ -527,9 +528,9 @@ var de_InvokeEndpointWithResponseStreamCommand = /* @__PURE__ */ __name(async (o
527
528
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
528
529
  const parsedOutput = {
529
530
  ...output,
530
- body: await parseErrorBody(output.body, context)
531
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
531
532
  };
532
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
533
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
533
534
  switch (errorCode) {
534
535
  case "InternalDependencyException":
535
536
  case "com.amazonaws.sagemakerruntime#InternalDependencyException":
@@ -696,14 +697,14 @@ var de_ResponseStream = /* @__PURE__ */ __name((output, context) => {
696
697
  var de_InternalStreamFailure_event = /* @__PURE__ */ __name(async (output, context) => {
697
698
  const parsedOutput = {
698
699
  ...output,
699
- body: await parseBody(output.body, context)
700
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
700
701
  };
701
702
  return de_InternalStreamFailureRes(parsedOutput, context);
702
703
  }, "de_InternalStreamFailure_event");
703
704
  var de_ModelStreamError_event = /* @__PURE__ */ __name(async (output, context) => {
704
705
  const parsedOutput = {
705
706
  ...output,
706
- body: await parseBody(output.body, context)
707
+ body: await (0, import_core2.parseJsonBody)(output.body, context)
707
708
  };
708
709
  return de_ModelStreamErrorRes(parsedOutput, context);
709
710
  }, "de_ModelStreamError_event");
@@ -718,7 +719,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
718
719
  extendedRequestId: output.headers["x-amz-id-2"],
719
720
  cfId: output.headers["x-amz-cf-id"]
720
721
  }), "deserializeMetadata");
721
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
722
722
  var isSerializableHeaderValue = /* @__PURE__ */ __name((value) => value !== void 0 && value !== null && value !== "" && (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) && (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0), "isSerializableHeaderValue");
723
723
  var _A = "Accept";
724
724
  var _CA = "CustomAttributes";
@@ -752,46 +752,6 @@ var _xasr = "x-amzn-sagemaker-requestttlseconds";
752
752
  var _xastch = "x-amzn-sagemaker-target-container-hostname";
753
753
  var _xastm = "x-amzn-sagemaker-target-model";
754
754
  var _xastv = "x-amzn-sagemaker-target-variant";
755
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
756
- if (encoded.length) {
757
- return JSON.parse(encoded);
758
- }
759
- return {};
760
- }), "parseBody");
761
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
762
- const value = await parseBody(errorBody, context);
763
- value.message = value.message ?? value.Message;
764
- return value;
765
- }, "parseErrorBody");
766
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
767
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
768
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
769
- let cleanValue = rawValue;
770
- if (typeof cleanValue === "number") {
771
- cleanValue = cleanValue.toString();
772
- }
773
- if (cleanValue.indexOf(",") >= 0) {
774
- cleanValue = cleanValue.split(",")[0];
775
- }
776
- if (cleanValue.indexOf(":") >= 0) {
777
- cleanValue = cleanValue.split(":")[0];
778
- }
779
- if (cleanValue.indexOf("#") >= 0) {
780
- cleanValue = cleanValue.split("#")[1];
781
- }
782
- return cleanValue;
783
- }, "sanitizeErrorCode");
784
- const headerKey = findKey(output.headers, "x-amzn-errortype");
785
- if (headerKey !== void 0) {
786
- return sanitizeErrorCode(output.headers[headerKey]);
787
- }
788
- if (data.code !== void 0) {
789
- return sanitizeErrorCode(data.code);
790
- }
791
- if (data["__type"] !== void 0) {
792
- return sanitizeErrorCode(data["__type"]);
793
- }
794
- }, "loadRestJsonErrorCode");
795
755
 
796
756
  // src/commands/InvokeEndpointAsyncCommand.ts
797
757
  var _InvokeEndpointAsyncCommand = class _InvokeEndpointAsyncCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,3 +1,4 @@
1
+ import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
1
2
  import { requestBuilder as rb } from "@smithy/core";
2
3
  import { collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { InternalDependencyException, InternalFailure, InternalStreamFailure, ModelError, ModelNotReadyException, ModelStreamError, ServiceUnavailable, ValidationError, } from "../models/models_0";
@@ -337,43 +338,3 @@ const _xasr = "x-amzn-sagemaker-requestttlseconds";
337
338
  const _xastch = "x-amzn-sagemaker-target-container-hostname";
338
339
  const _xastm = "x-amzn-sagemaker-target-model";
339
340
  const _xastv = "x-amzn-sagemaker-target-variant";
340
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
341
- if (encoded.length) {
342
- return JSON.parse(encoded);
343
- }
344
- return {};
345
- });
346
- const parseErrorBody = async (errorBody, context) => {
347
- const value = await parseBody(errorBody, context);
348
- value.message = value.message ?? value.Message;
349
- return value;
350
- };
351
- const loadRestJsonErrorCode = (output, data) => {
352
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
353
- const sanitizeErrorCode = (rawValue) => {
354
- let cleanValue = rawValue;
355
- if (typeof cleanValue === "number") {
356
- cleanValue = cleanValue.toString();
357
- }
358
- if (cleanValue.indexOf(",") >= 0) {
359
- cleanValue = cleanValue.split(",")[0];
360
- }
361
- if (cleanValue.indexOf(":") >= 0) {
362
- cleanValue = cleanValue.split(":")[0];
363
- }
364
- if (cleanValue.indexOf("#") >= 0) {
365
- cleanValue = cleanValue.split("#")[1];
366
- }
367
- return cleanValue;
368
- };
369
- const headerKey = findKey(output.headers, "x-amzn-errortype");
370
- if (headerKey !== undefined) {
371
- return sanitizeErrorCode(output.headers[headerKey]);
372
- }
373
- if (data.code !== undefined) {
374
- return sanitizeErrorCode(data.code);
375
- }
376
- if (data["__type"] !== undefined) {
377
- return sanitizeErrorCode(data["__type"]);
378
- }
379
- };
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.523.0",
4
+ "version": "3.529.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-sagemaker-runtime",
@@ -20,20 +20,20 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.523.0",
24
- "@aws-sdk/core": "3.523.0",
25
- "@aws-sdk/credential-provider-node": "3.523.0",
23
+ "@aws-sdk/client-sts": "3.529.0",
24
+ "@aws-sdk/core": "3.529.0",
25
+ "@aws-sdk/credential-provider-node": "3.529.0",
26
26
  "@aws-sdk/middleware-host-header": "3.523.0",
27
27
  "@aws-sdk/middleware-logger": "3.523.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.523.0",
29
- "@aws-sdk/middleware-user-agent": "3.523.0",
30
- "@aws-sdk/region-config-resolver": "3.523.0",
29
+ "@aws-sdk/middleware-user-agent": "3.525.0",
30
+ "@aws-sdk/region-config-resolver": "3.525.0",
31
31
  "@aws-sdk/types": "3.523.0",
32
- "@aws-sdk/util-endpoints": "3.523.0",
32
+ "@aws-sdk/util-endpoints": "3.525.0",
33
33
  "@aws-sdk/util-user-agent-browser": "3.523.0",
34
- "@aws-sdk/util-user-agent-node": "3.523.0",
35
- "@smithy/config-resolver": "^2.1.3",
36
- "@smithy/core": "^1.3.4",
34
+ "@aws-sdk/util-user-agent-node": "3.525.0",
35
+ "@smithy/config-resolver": "^2.1.4",
36
+ "@smithy/core": "^1.3.5",
37
37
  "@smithy/eventstream-serde-browser": "^2.1.3",
38
38
  "@smithy/eventstream-serde-config-resolver": "^2.1.3",
39
39
  "@smithy/eventstream-serde-node": "^2.1.3",
@@ -41,22 +41,22 @@
41
41
  "@smithy/hash-node": "^2.1.3",
42
42
  "@smithy/invalid-dependency": "^2.1.3",
43
43
  "@smithy/middleware-content-length": "^2.1.3",
44
- "@smithy/middleware-endpoint": "^2.4.3",
45
- "@smithy/middleware-retry": "^2.1.3",
44
+ "@smithy/middleware-endpoint": "^2.4.4",
45
+ "@smithy/middleware-retry": "^2.1.4",
46
46
  "@smithy/middleware-serde": "^2.1.3",
47
47
  "@smithy/middleware-stack": "^2.1.3",
48
- "@smithy/node-config-provider": "^2.2.3",
48
+ "@smithy/node-config-provider": "^2.2.4",
49
49
  "@smithy/node-http-handler": "^2.4.1",
50
50
  "@smithy/protocol-http": "^3.2.1",
51
- "@smithy/smithy-client": "^2.4.1",
51
+ "@smithy/smithy-client": "^2.4.2",
52
52
  "@smithy/types": "^2.10.1",
53
53
  "@smithy/url-parser": "^2.1.3",
54
54
  "@smithy/util-base64": "^2.1.1",
55
55
  "@smithy/util-body-length-browser": "^2.1.1",
56
56
  "@smithy/util-body-length-node": "^2.2.1",
57
- "@smithy/util-defaults-mode-browser": "^2.1.3",
58
- "@smithy/util-defaults-mode-node": "^2.2.2",
59
- "@smithy/util-endpoints": "^1.1.3",
57
+ "@smithy/util-defaults-mode-browser": "^2.1.4",
58
+ "@smithy/util-defaults-mode-node": "^2.2.3",
59
+ "@smithy/util-endpoints": "^1.1.4",
60
60
  "@smithy/util-middleware": "^2.1.3",
61
61
  "@smithy/util-retry": "^2.1.3",
62
62
  "@smithy/util-stream": "^2.1.3",
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("../index.js");
@@ -1 +0,0 @@
1
- module.exports = require("./index.js");