@aws-sdk/client-signer 3.525.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
@@ -222,6 +222,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
222
222
  var import_types = require("@smithy/types");
223
223
 
224
224
  // src/protocols/Aws_restJson1.ts
225
+ var import_core2 = require("@aws-sdk/core");
225
226
 
226
227
 
227
228
 
@@ -763,7 +764,7 @@ var de_AddProfilePermissionCommand = /* @__PURE__ */ __name(async (output, conte
763
764
  const contents = (0, import_smithy_client.map)({
764
765
  $metadata: deserializeMetadata(output)
765
766
  });
766
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
767
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
767
768
  const doc = (0, import_smithy_client.take)(data, {
768
769
  revisionId: import_smithy_client.expectString
769
770
  });
@@ -787,7 +788,7 @@ var de_DescribeSigningJobCommand = /* @__PURE__ */ __name(async (output, context
787
788
  const contents = (0, import_smithy_client.map)({
788
789
  $metadata: deserializeMetadata(output)
789
790
  });
790
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
791
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
791
792
  const doc = (0, import_smithy_client.take)(data, {
792
793
  completedAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
793
794
  createdAt: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
@@ -819,7 +820,7 @@ var de_GetRevocationStatusCommand = /* @__PURE__ */ __name(async (output, contex
819
820
  const contents = (0, import_smithy_client.map)({
820
821
  $metadata: deserializeMetadata(output)
821
822
  });
822
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
823
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
823
824
  const doc = (0, import_smithy_client.take)(data, {
824
825
  revokedEntities: import_smithy_client._json
825
826
  });
@@ -833,7 +834,7 @@ var de_GetSigningPlatformCommand = /* @__PURE__ */ __name(async (output, context
833
834
  const contents = (0, import_smithy_client.map)({
834
835
  $metadata: deserializeMetadata(output)
835
836
  });
836
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
837
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
837
838
  const doc = (0, import_smithy_client.take)(data, {
838
839
  category: import_smithy_client.expectString,
839
840
  displayName: import_smithy_client.expectString,
@@ -855,7 +856,7 @@ var de_GetSigningProfileCommand = /* @__PURE__ */ __name(async (output, context)
855
856
  const contents = (0, import_smithy_client.map)({
856
857
  $metadata: deserializeMetadata(output)
857
858
  });
858
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
859
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
859
860
  const doc = (0, import_smithy_client.take)(data, {
860
861
  arn: import_smithy_client.expectString,
861
862
  overrides: import_smithy_client._json,
@@ -882,7 +883,7 @@ var de_ListProfilePermissionsCommand = /* @__PURE__ */ __name(async (output, con
882
883
  const contents = (0, import_smithy_client.map)({
883
884
  $metadata: deserializeMetadata(output)
884
885
  });
885
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
886
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
886
887
  const doc = (0, import_smithy_client.take)(data, {
887
888
  nextToken: import_smithy_client.expectString,
888
889
  permissions: import_smithy_client._json,
@@ -899,7 +900,7 @@ var de_ListSigningJobsCommand = /* @__PURE__ */ __name(async (output, context) =
899
900
  const contents = (0, import_smithy_client.map)({
900
901
  $metadata: deserializeMetadata(output)
901
902
  });
902
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
903
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
903
904
  const doc = (0, import_smithy_client.take)(data, {
904
905
  jobs: (_) => de_SigningJobs(_, context),
905
906
  nextToken: import_smithy_client.expectString
@@ -914,7 +915,7 @@ var de_ListSigningPlatformsCommand = /* @__PURE__ */ __name(async (output, conte
914
915
  const contents = (0, import_smithy_client.map)({
915
916
  $metadata: deserializeMetadata(output)
916
917
  });
917
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
918
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
918
919
  const doc = (0, import_smithy_client.take)(data, {
919
920
  nextToken: import_smithy_client.expectString,
920
921
  platforms: import_smithy_client._json
@@ -929,7 +930,7 @@ var de_ListSigningProfilesCommand = /* @__PURE__ */ __name(async (output, contex
929
930
  const contents = (0, import_smithy_client.map)({
930
931
  $metadata: deserializeMetadata(output)
931
932
  });
932
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
933
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
933
934
  const doc = (0, import_smithy_client.take)(data, {
934
935
  nextToken: import_smithy_client.expectString,
935
936
  profiles: import_smithy_client._json
@@ -944,7 +945,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
944
945
  const contents = (0, import_smithy_client.map)({
945
946
  $metadata: deserializeMetadata(output)
946
947
  });
947
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
948
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
948
949
  const doc = (0, import_smithy_client.take)(data, {
949
950
  tags: import_smithy_client._json
950
951
  });
@@ -958,7 +959,7 @@ var de_PutSigningProfileCommand = /* @__PURE__ */ __name(async (output, context)
958
959
  const contents = (0, import_smithy_client.map)({
959
960
  $metadata: deserializeMetadata(output)
960
961
  });
961
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
962
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
962
963
  const doc = (0, import_smithy_client.take)(data, {
963
964
  arn: import_smithy_client.expectString,
964
965
  profileVersion: import_smithy_client.expectString,
@@ -974,7 +975,7 @@ var de_RemoveProfilePermissionCommand = /* @__PURE__ */ __name(async (output, co
974
975
  const contents = (0, import_smithy_client.map)({
975
976
  $metadata: deserializeMetadata(output)
976
977
  });
977
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
978
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
978
979
  const doc = (0, import_smithy_client.take)(data, {
979
980
  revisionId: import_smithy_client.expectString
980
981
  });
@@ -1008,7 +1009,7 @@ var de_SignPayloadCommand = /* @__PURE__ */ __name(async (output, context) => {
1008
1009
  const contents = (0, import_smithy_client.map)({
1009
1010
  $metadata: deserializeMetadata(output)
1010
1011
  });
1011
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1012
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1012
1013
  const doc = (0, import_smithy_client.take)(data, {
1013
1014
  jobId: import_smithy_client.expectString,
1014
1015
  jobOwner: import_smithy_client.expectString,
@@ -1025,7 +1026,7 @@ var de_StartSigningJobCommand = /* @__PURE__ */ __name(async (output, context) =
1025
1026
  const contents = (0, import_smithy_client.map)({
1026
1027
  $metadata: deserializeMetadata(output)
1027
1028
  });
1028
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
1029
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
1029
1030
  const doc = (0, import_smithy_client.take)(data, {
1030
1031
  jobId: import_smithy_client.expectString,
1031
1032
  jobOwner: import_smithy_client.expectString
@@ -1056,9 +1057,9 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
1056
1057
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
1057
1058
  const parsedOutput = {
1058
1059
  ...output,
1059
- body: await parseErrorBody(output.body, context)
1060
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
1060
1061
  };
1061
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1062
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
1062
1063
  switch (errorCode) {
1063
1064
  case "AccessDeniedException":
1064
1065
  case "com.amazonaws.signer#AccessDeniedException":
@@ -1284,7 +1285,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
1284
1285
  extendedRequestId: output.headers["x-amz-id-2"],
1285
1286
  cfId: output.headers["x-amz-cf-id"]
1286
1287
  }), "deserializeMetadata");
1287
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
1288
1288
  var _c = "category";
1289
1289
  var _cH = "certificateHashes";
1290
1290
  var _iC = "includeCanceled";
@@ -1306,46 +1306,6 @@ var _sT = "signatureTimestamp";
1306
1306
  var _st = "statuses";
1307
1307
  var _t = "target";
1308
1308
  var _tK = "tagKeys";
1309
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1310
- if (encoded.length) {
1311
- return JSON.parse(encoded);
1312
- }
1313
- return {};
1314
- }), "parseBody");
1315
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
1316
- const value = await parseBody(errorBody, context);
1317
- value.message = value.message ?? value.Message;
1318
- return value;
1319
- }, "parseErrorBody");
1320
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
1321
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
1322
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
1323
- let cleanValue = rawValue;
1324
- if (typeof cleanValue === "number") {
1325
- cleanValue = cleanValue.toString();
1326
- }
1327
- if (cleanValue.indexOf(",") >= 0) {
1328
- cleanValue = cleanValue.split(",")[0];
1329
- }
1330
- if (cleanValue.indexOf(":") >= 0) {
1331
- cleanValue = cleanValue.split(":")[0];
1332
- }
1333
- if (cleanValue.indexOf("#") >= 0) {
1334
- cleanValue = cleanValue.split("#")[1];
1335
- }
1336
- return cleanValue;
1337
- }, "sanitizeErrorCode");
1338
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1339
- if (headerKey !== void 0) {
1340
- return sanitizeErrorCode(output.headers[headerKey]);
1341
- }
1342
- if (data.code !== void 0) {
1343
- return sanitizeErrorCode(data.code);
1344
- }
1345
- if (data["__type"] !== void 0) {
1346
- return sanitizeErrorCode(data["__type"]);
1347
- }
1348
- }, "loadRestJsonErrorCode");
1349
1309
 
1350
1310
  // src/commands/AddProfilePermissionCommand.ts
1351
1311
  var _AddProfilePermissionCommand = class _AddProfilePermissionCommand 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 { isValidHostname as __isValidHostname, } from "@smithy/protocol-http";
3
4
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
@@ -848,43 +849,3 @@ const _sT = "signatureTimestamp";
848
849
  const _st = "statuses";
849
850
  const _t = "target";
850
851
  const _tK = "tagKeys";
851
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
852
- if (encoded.length) {
853
- return JSON.parse(encoded);
854
- }
855
- return {};
856
- });
857
- const parseErrorBody = async (errorBody, context) => {
858
- const value = await parseBody(errorBody, context);
859
- value.message = value.message ?? value.Message;
860
- return value;
861
- };
862
- const loadRestJsonErrorCode = (output, data) => {
863
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
864
- const sanitizeErrorCode = (rawValue) => {
865
- let cleanValue = rawValue;
866
- if (typeof cleanValue === "number") {
867
- cleanValue = cleanValue.toString();
868
- }
869
- if (cleanValue.indexOf(",") >= 0) {
870
- cleanValue = cleanValue.split(",")[0];
871
- }
872
- if (cleanValue.indexOf(":") >= 0) {
873
- cleanValue = cleanValue.split(":")[0];
874
- }
875
- if (cleanValue.indexOf("#") >= 0) {
876
- cleanValue = cleanValue.split("#")[1];
877
- }
878
- return cleanValue;
879
- };
880
- const headerKey = findKey(output.headers, "x-amzn-errortype");
881
- if (headerKey !== undefined) {
882
- return sanitizeErrorCode(output.headers[headerKey]);
883
- }
884
- if (data.code !== undefined) {
885
- return sanitizeErrorCode(data.code);
886
- }
887
- if (data["__type"] !== undefined) {
888
- return sanitizeErrorCode(data["__type"]);
889
- }
890
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-signer",
3
3
  "description": "AWS SDK for JavaScript Signer Client for Node.js, Browser and React Native",
4
- "version": "3.525.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-signer",
@@ -20,9 +20,9 @@
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.525.0",
24
- "@aws-sdk/core": "3.525.0",
25
- "@aws-sdk/credential-provider-node": "3.525.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",