@aws-sdk/client-cloudfront-keyvaluestore 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
@@ -140,7 +140,8 @@ var import_middleware_serde = require("@smithy/middleware-serde");
140
140
  var import_types = require("@smithy/types");
141
141
 
142
142
  // src/protocols/Aws_restJson1.ts
143
- var import_core = require("@smithy/core");
143
+ var import_core = require("@aws-sdk/core");
144
+ var import_core2 = require("@smithy/core");
144
145
 
145
146
 
146
147
  // src/models/CloudFrontKeyValueStoreServiceException.ts
@@ -294,7 +295,7 @@ var UpdateKeysRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
294
295
 
295
296
  // src/protocols/Aws_restJson1.ts
296
297
  var se_DeleteKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
297
- const b = (0, import_core.requestBuilder)(input, context);
298
+ const b = (0, import_core2.requestBuilder)(input, context);
298
299
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
299
300
  [_im]: input[_IM]
300
301
  });
@@ -306,7 +307,7 @@ var se_DeleteKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
306
307
  return b.build();
307
308
  }, "se_DeleteKeyCommand");
308
309
  var se_DescribeKeyValueStoreCommand = /* @__PURE__ */ __name(async (input, context) => {
309
- const b = (0, import_core.requestBuilder)(input, context);
310
+ const b = (0, import_core2.requestBuilder)(input, context);
310
311
  const headers = {};
311
312
  b.bp("/key-value-stores/{KvsARN}");
312
313
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
@@ -315,7 +316,7 @@ var se_DescribeKeyValueStoreCommand = /* @__PURE__ */ __name(async (input, conte
315
316
  return b.build();
316
317
  }, "se_DescribeKeyValueStoreCommand");
317
318
  var se_GetKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
318
- const b = (0, import_core.requestBuilder)(input, context);
319
+ const b = (0, import_core2.requestBuilder)(input, context);
319
320
  const headers = {};
320
321
  b.bp("/key-value-stores/{KvsARN}/keys/{Key}");
321
322
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
@@ -325,7 +326,7 @@ var se_GetKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
325
326
  return b.build();
326
327
  }, "se_GetKeyCommand");
327
328
  var se_ListKeysCommand = /* @__PURE__ */ __name(async (input, context) => {
328
- const b = (0, import_core.requestBuilder)(input, context);
329
+ const b = (0, import_core2.requestBuilder)(input, context);
329
330
  const headers = {};
330
331
  b.bp("/key-value-stores/{KvsARN}/keys");
331
332
  b.p("KvsARN", () => input.KvsARN, "{KvsARN}", false);
@@ -338,7 +339,7 @@ var se_ListKeysCommand = /* @__PURE__ */ __name(async (input, context) => {
338
339
  return b.build();
339
340
  }, "se_ListKeysCommand");
340
341
  var se_PutKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
341
- const b = (0, import_core.requestBuilder)(input, context);
342
+ const b = (0, import_core2.requestBuilder)(input, context);
342
343
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
343
344
  "content-type": "application/json",
344
345
  [_im]: input[_IM]
@@ -356,7 +357,7 @@ var se_PutKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
356
357
  return b.build();
357
358
  }, "se_PutKeyCommand");
358
359
  var se_UpdateKeysCommand = /* @__PURE__ */ __name(async (input, context) => {
359
- const b = (0, import_core.requestBuilder)(input, context);
360
+ const b = (0, import_core2.requestBuilder)(input, context);
360
361
  const headers = (0, import_smithy_client.map)({}, isSerializableHeaderValue, {
361
362
  "content-type": "application/json",
362
363
  [_im]: input[_IM]
@@ -381,7 +382,7 @@ var de_DeleteKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
381
382
  $metadata: deserializeMetadata(output),
382
383
  [_ET]: [, output.headers[_e]]
383
384
  });
384
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
385
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core.parseJsonBody)(output.body, context)), "body");
385
386
  const doc = (0, import_smithy_client.take)(data, {
386
387
  ItemCount: import_smithy_client.expectInt32,
387
388
  TotalSizeInBytes: import_smithy_client.expectLong
@@ -397,7 +398,7 @@ var de_DescribeKeyValueStoreCommand = /* @__PURE__ */ __name(async (output, cont
397
398
  $metadata: deserializeMetadata(output),
398
399
  [_ET]: [, output.headers[_e]]
399
400
  });
400
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
401
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core.parseJsonBody)(output.body, context)), "body");
401
402
  const doc = (0, import_smithy_client.take)(data, {
402
403
  Created: (_) => (0, import_smithy_client.expectNonNull)((0, import_smithy_client.parseEpochTimestamp)((0, import_smithy_client.expectNumber)(_))),
403
404
  FailureReason: import_smithy_client.expectString,
@@ -417,7 +418,7 @@ var de_GetKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
417
418
  const contents = (0, import_smithy_client.map)({
418
419
  $metadata: deserializeMetadata(output)
419
420
  });
420
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
421
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core.parseJsonBody)(output.body, context)), "body");
421
422
  const doc = (0, import_smithy_client.take)(data, {
422
423
  ItemCount: import_smithy_client.expectInt32,
423
424
  Key: import_smithy_client.expectString,
@@ -434,7 +435,7 @@ var de_ListKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
434
435
  const contents = (0, import_smithy_client.map)({
435
436
  $metadata: deserializeMetadata(output)
436
437
  });
437
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
438
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core.parseJsonBody)(output.body, context)), "body");
438
439
  const doc = (0, import_smithy_client.take)(data, {
439
440
  Items: import_smithy_client._json,
440
441
  NextToken: import_smithy_client.expectString
@@ -450,7 +451,7 @@ var de_PutKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
450
451
  $metadata: deserializeMetadata(output),
451
452
  [_ET]: [, output.headers[_e]]
452
453
  });
453
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
454
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core.parseJsonBody)(output.body, context)), "body");
454
455
  const doc = (0, import_smithy_client.take)(data, {
455
456
  ItemCount: import_smithy_client.expectInt32,
456
457
  TotalSizeInBytes: import_smithy_client.expectLong
@@ -466,7 +467,7 @@ var de_UpdateKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
466
467
  $metadata: deserializeMetadata(output),
467
468
  [_ET]: [, output.headers[_e]]
468
469
  });
469
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
470
+ const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core.parseJsonBody)(output.body, context)), "body");
470
471
  const doc = (0, import_smithy_client.take)(data, {
471
472
  ItemCount: import_smithy_client.expectInt32,
472
473
  TotalSizeInBytes: import_smithy_client.expectLong
@@ -477,9 +478,9 @@ var de_UpdateKeysCommand = /* @__PURE__ */ __name(async (output, context) => {
477
478
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
478
479
  const parsedOutput = {
479
480
  ...output,
480
- body: await parseErrorBody(output.body, context)
481
+ body: await (0, import_core.parseJsonErrorBody)(output.body, context)
481
482
  };
482
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
483
+ const errorCode = (0, import_core.loadRestJsonErrorCode)(output, parsedOutput.body);
483
484
  switch (errorCode) {
484
485
  case "AccessDeniedException":
485
486
  case "com.amazonaws.cloudfrontkeyvaluestore#AccessDeniedException":
@@ -593,7 +594,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
593
594
  extendedRequestId: output.headers["x-amz-id-2"],
594
595
  cfId: output.headers["x-amz-cf-id"]
595
596
  }), "deserializeMetadata");
596
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
597
597
  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");
598
598
  var _ET = "ETag";
599
599
  var _IM = "IfMatch";
@@ -601,46 +601,6 @@ var _MR = "MaxResults";
601
601
  var _NT = "NextToken";
602
602
  var _e = "etag";
603
603
  var _im = "if-match";
604
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
605
- if (encoded.length) {
606
- return JSON.parse(encoded);
607
- }
608
- return {};
609
- }), "parseBody");
610
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
611
- const value = await parseBody(errorBody, context);
612
- value.message = value.message ?? value.Message;
613
- return value;
614
- }, "parseErrorBody");
615
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
616
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
617
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
618
- let cleanValue = rawValue;
619
- if (typeof cleanValue === "number") {
620
- cleanValue = cleanValue.toString();
621
- }
622
- if (cleanValue.indexOf(",") >= 0) {
623
- cleanValue = cleanValue.split(",")[0];
624
- }
625
- if (cleanValue.indexOf(":") >= 0) {
626
- cleanValue = cleanValue.split(":")[0];
627
- }
628
- if (cleanValue.indexOf("#") >= 0) {
629
- cleanValue = cleanValue.split("#")[1];
630
- }
631
- return cleanValue;
632
- }, "sanitizeErrorCode");
633
- const headerKey = findKey(output.headers, "x-amzn-errortype");
634
- if (headerKey !== void 0) {
635
- return sanitizeErrorCode(output.headers[headerKey]);
636
- }
637
- if (data.code !== void 0) {
638
- return sanitizeErrorCode(data.code);
639
- }
640
- if (data["__type"] !== void 0) {
641
- return sanitizeErrorCode(data["__type"]);
642
- }
643
- }, "loadRestJsonErrorCode");
644
604
 
645
605
  // src/commands/DeleteKeyCommand.ts
646
606
  var _DeleteKeyCommand = class _DeleteKeyCommand extends import_smithy_client.Command.classBuilder().ep({
@@ -762,8 +722,8 @@ var CloudFrontKeyValueStore = _CloudFrontKeyValueStore;
762
722
  (0, import_smithy_client.createAggregatedClient)(commands, CloudFrontKeyValueStore);
763
723
 
764
724
  // src/pagination/ListKeysPaginator.ts
765
-
766
- var paginateListKeys = (0, import_core.createPaginator)(CloudFrontKeyValueStoreClient, ListKeysCommand, "NextToken", "NextToken", "MaxResults");
725
+ var import_core3 = require("@smithy/core");
726
+ var paginateListKeys = (0, import_core3.createPaginator)(CloudFrontKeyValueStoreClient, ListKeysCommand, "NextToken", "NextToken", "MaxResults");
767
727
 
768
728
  // src/index.ts
769
729
  var import_util_endpoints = require("@aws-sdk/util-endpoints");
@@ -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 { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { CloudFrontKeyValueStoreServiceException as __BaseException } from "../models/CloudFrontKeyValueStoreServiceException";
@@ -310,43 +311,3 @@ const _MR = "MaxResults";
310
311
  const _NT = "NextToken";
311
312
  const _e = "etag";
312
313
  const _im = "if-match";
313
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
314
- if (encoded.length) {
315
- return JSON.parse(encoded);
316
- }
317
- return {};
318
- });
319
- const parseErrorBody = async (errorBody, context) => {
320
- const value = await parseBody(errorBody, context);
321
- value.message = value.message ?? value.Message;
322
- return value;
323
- };
324
- const loadRestJsonErrorCode = (output, data) => {
325
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
326
- const sanitizeErrorCode = (rawValue) => {
327
- let cleanValue = rawValue;
328
- if (typeof cleanValue === "number") {
329
- cleanValue = cleanValue.toString();
330
- }
331
- if (cleanValue.indexOf(",") >= 0) {
332
- cleanValue = cleanValue.split(",")[0];
333
- }
334
- if (cleanValue.indexOf(":") >= 0) {
335
- cleanValue = cleanValue.split(":")[0];
336
- }
337
- if (cleanValue.indexOf("#") >= 0) {
338
- cleanValue = cleanValue.split("#")[1];
339
- }
340
- return cleanValue;
341
- };
342
- const headerKey = findKey(output.headers, "x-amzn-errortype");
343
- if (headerKey !== undefined) {
344
- return sanitizeErrorCode(output.headers[headerKey]);
345
- }
346
- if (data.code !== undefined) {
347
- return sanitizeErrorCode(data.code);
348
- }
349
- if (data["__type"] !== undefined) {
350
- return sanitizeErrorCode(data["__type"]);
351
- }
352
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-cloudfront-keyvaluestore",
3
3
  "description": "AWS SDK for JavaScript Cloudfront Keyvaluestore 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-cloudfront-keyvaluestore",
@@ -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",