@aws-sdk/client-verifiedpermissions 3.528.0 → 3.529.1

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
@@ -1143,7 +1143,7 @@ var de_BatchIsAuthorizedCommand = /* @__PURE__ */ __name(async (output, context)
1143
1143
  if (output.statusCode >= 300) {
1144
1144
  return de_CommandError(output, context);
1145
1145
  }
1146
- const data = await parseBody(output.body, context);
1146
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1147
1147
  let contents = {};
1148
1148
  contents = de_BatchIsAuthorizedOutput(data, context);
1149
1149
  const response = {
@@ -1156,7 +1156,7 @@ var de_CreateIdentitySourceCommand = /* @__PURE__ */ __name(async (output, conte
1156
1156
  if (output.statusCode >= 300) {
1157
1157
  return de_CommandError(output, context);
1158
1158
  }
1159
- const data = await parseBody(output.body, context);
1159
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1160
1160
  let contents = {};
1161
1161
  contents = de_CreateIdentitySourceOutput(data, context);
1162
1162
  const response = {
@@ -1169,7 +1169,7 @@ var de_CreatePolicyCommand = /* @__PURE__ */ __name(async (output, context) => {
1169
1169
  if (output.statusCode >= 300) {
1170
1170
  return de_CommandError(output, context);
1171
1171
  }
1172
- const data = await parseBody(output.body, context);
1172
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1173
1173
  let contents = {};
1174
1174
  contents = de_CreatePolicyOutput(data, context);
1175
1175
  const response = {
@@ -1182,7 +1182,7 @@ var de_CreatePolicyStoreCommand = /* @__PURE__ */ __name(async (output, context)
1182
1182
  if (output.statusCode >= 300) {
1183
1183
  return de_CommandError(output, context);
1184
1184
  }
1185
- const data = await parseBody(output.body, context);
1185
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1186
1186
  let contents = {};
1187
1187
  contents = de_CreatePolicyStoreOutput(data, context);
1188
1188
  const response = {
@@ -1195,7 +1195,7 @@ var de_CreatePolicyTemplateCommand = /* @__PURE__ */ __name(async (output, conte
1195
1195
  if (output.statusCode >= 300) {
1196
1196
  return de_CommandError(output, context);
1197
1197
  }
1198
- const data = await parseBody(output.body, context);
1198
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1199
1199
  let contents = {};
1200
1200
  contents = de_CreatePolicyTemplateOutput(data, context);
1201
1201
  const response = {
@@ -1208,7 +1208,7 @@ var de_DeleteIdentitySourceCommand = /* @__PURE__ */ __name(async (output, conte
1208
1208
  if (output.statusCode >= 300) {
1209
1209
  return de_CommandError(output, context);
1210
1210
  }
1211
- const data = await parseBody(output.body, context);
1211
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1212
1212
  let contents = {};
1213
1213
  contents = (0, import_smithy_client._json)(data);
1214
1214
  const response = {
@@ -1221,7 +1221,7 @@ var de_DeletePolicyCommand = /* @__PURE__ */ __name(async (output, context) => {
1221
1221
  if (output.statusCode >= 300) {
1222
1222
  return de_CommandError(output, context);
1223
1223
  }
1224
- const data = await parseBody(output.body, context);
1224
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1225
1225
  let contents = {};
1226
1226
  contents = (0, import_smithy_client._json)(data);
1227
1227
  const response = {
@@ -1234,7 +1234,7 @@ var de_DeletePolicyStoreCommand = /* @__PURE__ */ __name(async (output, context)
1234
1234
  if (output.statusCode >= 300) {
1235
1235
  return de_CommandError(output, context);
1236
1236
  }
1237
- const data = await parseBody(output.body, context);
1237
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1238
1238
  let contents = {};
1239
1239
  contents = (0, import_smithy_client._json)(data);
1240
1240
  const response = {
@@ -1247,7 +1247,7 @@ var de_DeletePolicyTemplateCommand = /* @__PURE__ */ __name(async (output, conte
1247
1247
  if (output.statusCode >= 300) {
1248
1248
  return de_CommandError(output, context);
1249
1249
  }
1250
- const data = await parseBody(output.body, context);
1250
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1251
1251
  let contents = {};
1252
1252
  contents = (0, import_smithy_client._json)(data);
1253
1253
  const response = {
@@ -1260,7 +1260,7 @@ var de_GetIdentitySourceCommand = /* @__PURE__ */ __name(async (output, context)
1260
1260
  if (output.statusCode >= 300) {
1261
1261
  return de_CommandError(output, context);
1262
1262
  }
1263
- const data = await parseBody(output.body, context);
1263
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1264
1264
  let contents = {};
1265
1265
  contents = de_GetIdentitySourceOutput(data, context);
1266
1266
  const response = {
@@ -1273,7 +1273,7 @@ var de_GetPolicyCommand = /* @__PURE__ */ __name(async (output, context) => {
1273
1273
  if (output.statusCode >= 300) {
1274
1274
  return de_CommandError(output, context);
1275
1275
  }
1276
- const data = await parseBody(output.body, context);
1276
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1277
1277
  let contents = {};
1278
1278
  contents = de_GetPolicyOutput(data, context);
1279
1279
  const response = {
@@ -1286,7 +1286,7 @@ var de_GetPolicyStoreCommand = /* @__PURE__ */ __name(async (output, context) =>
1286
1286
  if (output.statusCode >= 300) {
1287
1287
  return de_CommandError(output, context);
1288
1288
  }
1289
- const data = await parseBody(output.body, context);
1289
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1290
1290
  let contents = {};
1291
1291
  contents = de_GetPolicyStoreOutput(data, context);
1292
1292
  const response = {
@@ -1299,7 +1299,7 @@ var de_GetPolicyTemplateCommand = /* @__PURE__ */ __name(async (output, context)
1299
1299
  if (output.statusCode >= 300) {
1300
1300
  return de_CommandError(output, context);
1301
1301
  }
1302
- const data = await parseBody(output.body, context);
1302
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1303
1303
  let contents = {};
1304
1304
  contents = de_GetPolicyTemplateOutput(data, context);
1305
1305
  const response = {
@@ -1312,7 +1312,7 @@ var de_GetSchemaCommand = /* @__PURE__ */ __name(async (output, context) => {
1312
1312
  if (output.statusCode >= 300) {
1313
1313
  return de_CommandError(output, context);
1314
1314
  }
1315
- const data = await parseBody(output.body, context);
1315
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1316
1316
  let contents = {};
1317
1317
  contents = de_GetSchemaOutput(data, context);
1318
1318
  const response = {
@@ -1325,7 +1325,7 @@ var de_IsAuthorizedCommand = /* @__PURE__ */ __name(async (output, context) => {
1325
1325
  if (output.statusCode >= 300) {
1326
1326
  return de_CommandError(output, context);
1327
1327
  }
1328
- const data = await parseBody(output.body, context);
1328
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1329
1329
  let contents = {};
1330
1330
  contents = (0, import_smithy_client._json)(data);
1331
1331
  const response = {
@@ -1338,7 +1338,7 @@ var de_IsAuthorizedWithTokenCommand = /* @__PURE__ */ __name(async (output, cont
1338
1338
  if (output.statusCode >= 300) {
1339
1339
  return de_CommandError(output, context);
1340
1340
  }
1341
- const data = await parseBody(output.body, context);
1341
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1342
1342
  let contents = {};
1343
1343
  contents = (0, import_smithy_client._json)(data);
1344
1344
  const response = {
@@ -1351,7 +1351,7 @@ var de_ListIdentitySourcesCommand = /* @__PURE__ */ __name(async (output, contex
1351
1351
  if (output.statusCode >= 300) {
1352
1352
  return de_CommandError(output, context);
1353
1353
  }
1354
- const data = await parseBody(output.body, context);
1354
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1355
1355
  let contents = {};
1356
1356
  contents = de_ListIdentitySourcesOutput(data, context);
1357
1357
  const response = {
@@ -1364,7 +1364,7 @@ var de_ListPoliciesCommand = /* @__PURE__ */ __name(async (output, context) => {
1364
1364
  if (output.statusCode >= 300) {
1365
1365
  return de_CommandError(output, context);
1366
1366
  }
1367
- const data = await parseBody(output.body, context);
1367
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1368
1368
  let contents = {};
1369
1369
  contents = de_ListPoliciesOutput(data, context);
1370
1370
  const response = {
@@ -1377,7 +1377,7 @@ var de_ListPolicyStoresCommand = /* @__PURE__ */ __name(async (output, context)
1377
1377
  if (output.statusCode >= 300) {
1378
1378
  return de_CommandError(output, context);
1379
1379
  }
1380
- const data = await parseBody(output.body, context);
1380
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1381
1381
  let contents = {};
1382
1382
  contents = de_ListPolicyStoresOutput(data, context);
1383
1383
  const response = {
@@ -1390,7 +1390,7 @@ var de_ListPolicyTemplatesCommand = /* @__PURE__ */ __name(async (output, contex
1390
1390
  if (output.statusCode >= 300) {
1391
1391
  return de_CommandError(output, context);
1392
1392
  }
1393
- const data = await parseBody(output.body, context);
1393
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1394
1394
  let contents = {};
1395
1395
  contents = de_ListPolicyTemplatesOutput(data, context);
1396
1396
  const response = {
@@ -1403,7 +1403,7 @@ var de_PutSchemaCommand = /* @__PURE__ */ __name(async (output, context) => {
1403
1403
  if (output.statusCode >= 300) {
1404
1404
  return de_CommandError(output, context);
1405
1405
  }
1406
- const data = await parseBody(output.body, context);
1406
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1407
1407
  let contents = {};
1408
1408
  contents = de_PutSchemaOutput(data, context);
1409
1409
  const response = {
@@ -1416,7 +1416,7 @@ var de_UpdateIdentitySourceCommand = /* @__PURE__ */ __name(async (output, conte
1416
1416
  if (output.statusCode >= 300) {
1417
1417
  return de_CommandError(output, context);
1418
1418
  }
1419
- const data = await parseBody(output.body, context);
1419
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1420
1420
  let contents = {};
1421
1421
  contents = de_UpdateIdentitySourceOutput(data, context);
1422
1422
  const response = {
@@ -1429,7 +1429,7 @@ var de_UpdatePolicyCommand = /* @__PURE__ */ __name(async (output, context) => {
1429
1429
  if (output.statusCode >= 300) {
1430
1430
  return de_CommandError(output, context);
1431
1431
  }
1432
- const data = await parseBody(output.body, context);
1432
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1433
1433
  let contents = {};
1434
1434
  contents = de_UpdatePolicyOutput(data, context);
1435
1435
  const response = {
@@ -1442,7 +1442,7 @@ var de_UpdatePolicyStoreCommand = /* @__PURE__ */ __name(async (output, context)
1442
1442
  if (output.statusCode >= 300) {
1443
1443
  return de_CommandError(output, context);
1444
1444
  }
1445
- const data = await parseBody(output.body, context);
1445
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1446
1446
  let contents = {};
1447
1447
  contents = de_UpdatePolicyStoreOutput(data, context);
1448
1448
  const response = {
@@ -1455,7 +1455,7 @@ var de_UpdatePolicyTemplateCommand = /* @__PURE__ */ __name(async (output, conte
1455
1455
  if (output.statusCode >= 300) {
1456
1456
  return de_CommandError(output, context);
1457
1457
  }
1458
- const data = await parseBody(output.body, context);
1458
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
1459
1459
  let contents = {};
1460
1460
  contents = de_UpdatePolicyTemplateOutput(data, context);
1461
1461
  const response = {
@@ -1467,9 +1467,9 @@ var de_UpdatePolicyTemplateCommand = /* @__PURE__ */ __name(async (output, conte
1467
1467
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
1468
1468
  const parsedOutput = {
1469
1469
  ...output,
1470
- body: await parseErrorBody(output.body, context)
1470
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
1471
1471
  };
1472
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1472
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
1473
1473
  switch (errorCode) {
1474
1474
  case "AccessDeniedException":
1475
1475
  case "com.amazonaws.verifiedpermissions#AccessDeniedException":
@@ -2013,7 +2013,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
2013
2013
  extendedRequestId: output.headers["x-amz-id-2"],
2014
2014
  cfId: output.headers["x-amz-cf-id"]
2015
2015
  }), "deserializeMetadata");
2016
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
2017
2016
  var throwDefaultError = (0, import_smithy_client.withBaseException)(VerifiedPermissionsServiceException);
2018
2017
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
2019
2018
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -2040,46 +2039,6 @@ function sharedHeaders(operation) {
2040
2039
  };
2041
2040
  }
2042
2041
  __name(sharedHeaders, "sharedHeaders");
2043
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
2044
- if (encoded.length) {
2045
- return JSON.parse(encoded);
2046
- }
2047
- return {};
2048
- }), "parseBody");
2049
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
2050
- const value = await parseBody(errorBody, context);
2051
- value.message = value.message ?? value.Message;
2052
- return value;
2053
- }, "parseErrorBody");
2054
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
2055
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
2056
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
2057
- let cleanValue = rawValue;
2058
- if (typeof cleanValue === "number") {
2059
- cleanValue = cleanValue.toString();
2060
- }
2061
- if (cleanValue.indexOf(",") >= 0) {
2062
- cleanValue = cleanValue.split(",")[0];
2063
- }
2064
- if (cleanValue.indexOf(":") >= 0) {
2065
- cleanValue = cleanValue.split(":")[0];
2066
- }
2067
- if (cleanValue.indexOf("#") >= 0) {
2068
- cleanValue = cleanValue.split("#")[1];
2069
- }
2070
- return cleanValue;
2071
- }, "sanitizeErrorCode");
2072
- const headerKey = findKey(output.headers, "x-amzn-errortype");
2073
- if (headerKey !== void 0) {
2074
- return sanitizeErrorCode(output.headers[headerKey]);
2075
- }
2076
- if (data.code !== void 0) {
2077
- return sanitizeErrorCode(data.code);
2078
- }
2079
- if (data["__type"] !== void 0) {
2080
- return sanitizeErrorCode(data["__type"]);
2081
- }
2082
- }, "loadRestJsonErrorCode");
2083
2042
 
2084
2043
  // src/commands/BatchIsAuthorizedCommand.ts
2085
2044
  var _BatchIsAuthorizedCommand = class _BatchIsAuthorizedCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -1,4 +1,4 @@
1
- import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
1
+ import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
2
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
3
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectLong as __expectLong, expectNonNull as __expectNonNull, expectString as __expectString, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
@@ -1072,43 +1072,3 @@ function sharedHeaders(operation) {
1072
1072
  "x-amz-target": `VerifiedPermissions.${operation}`,
1073
1073
  };
1074
1074
  }
1075
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1076
- if (encoded.length) {
1077
- return JSON.parse(encoded);
1078
- }
1079
- return {};
1080
- });
1081
- const parseErrorBody = async (errorBody, context) => {
1082
- const value = await parseBody(errorBody, context);
1083
- value.message = value.message ?? value.Message;
1084
- return value;
1085
- };
1086
- const loadRestJsonErrorCode = (output, data) => {
1087
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1088
- const sanitizeErrorCode = (rawValue) => {
1089
- let cleanValue = rawValue;
1090
- if (typeof cleanValue === "number") {
1091
- cleanValue = cleanValue.toString();
1092
- }
1093
- if (cleanValue.indexOf(",") >= 0) {
1094
- cleanValue = cleanValue.split(",")[0];
1095
- }
1096
- if (cleanValue.indexOf(":") >= 0) {
1097
- cleanValue = cleanValue.split(":")[0];
1098
- }
1099
- if (cleanValue.indexOf("#") >= 0) {
1100
- cleanValue = cleanValue.split("#")[1];
1101
- }
1102
- return cleanValue;
1103
- };
1104
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1105
- if (headerKey !== undefined) {
1106
- return sanitizeErrorCode(output.headers[headerKey]);
1107
- }
1108
- if (data.code !== undefined) {
1109
- return sanitizeErrorCode(data.code);
1110
- }
1111
- if (data["__type"] !== undefined) {
1112
- return sanitizeErrorCode(data["__type"]);
1113
- }
1114
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-verifiedpermissions",
3
3
  "description": "AWS SDK for JavaScript Verifiedpermissions Client for Node.js, Browser and React Native",
4
- "version": "3.528.0",
4
+ "version": "3.529.1",
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-verifiedpermissions",
@@ -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.1",
24
+ "@aws-sdk/core": "3.529.1",
25
+ "@aws-sdk/credential-provider-node": "3.529.1",
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",