@aws-sdk/client-healthlake 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
@@ -470,7 +470,7 @@ var de_CreateFHIRDatastoreCommand = /* @__PURE__ */ __name(async (output, contex
470
470
  if (output.statusCode >= 300) {
471
471
  return de_CommandError(output, context);
472
472
  }
473
- const data = await parseBody(output.body, context);
473
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
474
474
  let contents = {};
475
475
  contents = (0, import_smithy_client._json)(data);
476
476
  const response = {
@@ -483,7 +483,7 @@ var de_DeleteFHIRDatastoreCommand = /* @__PURE__ */ __name(async (output, contex
483
483
  if (output.statusCode >= 300) {
484
484
  return de_CommandError(output, context);
485
485
  }
486
- const data = await parseBody(output.body, context);
486
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
487
487
  let contents = {};
488
488
  contents = (0, import_smithy_client._json)(data);
489
489
  const response = {
@@ -496,7 +496,7 @@ var de_DescribeFHIRDatastoreCommand = /* @__PURE__ */ __name(async (output, cont
496
496
  if (output.statusCode >= 300) {
497
497
  return de_CommandError(output, context);
498
498
  }
499
- const data = await parseBody(output.body, context);
499
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
500
500
  let contents = {};
501
501
  contents = de_DescribeFHIRDatastoreResponse(data, context);
502
502
  const response = {
@@ -509,7 +509,7 @@ var de_DescribeFHIRExportJobCommand = /* @__PURE__ */ __name(async (output, cont
509
509
  if (output.statusCode >= 300) {
510
510
  return de_CommandError(output, context);
511
511
  }
512
- const data = await parseBody(output.body, context);
512
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
513
513
  let contents = {};
514
514
  contents = de_DescribeFHIRExportJobResponse(data, context);
515
515
  const response = {
@@ -522,7 +522,7 @@ var de_DescribeFHIRImportJobCommand = /* @__PURE__ */ __name(async (output, cont
522
522
  if (output.statusCode >= 300) {
523
523
  return de_CommandError(output, context);
524
524
  }
525
- const data = await parseBody(output.body, context);
525
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
526
526
  let contents = {};
527
527
  contents = de_DescribeFHIRImportJobResponse(data, context);
528
528
  const response = {
@@ -535,7 +535,7 @@ var de_ListFHIRDatastoresCommand = /* @__PURE__ */ __name(async (output, context
535
535
  if (output.statusCode >= 300) {
536
536
  return de_CommandError(output, context);
537
537
  }
538
- const data = await parseBody(output.body, context);
538
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
539
539
  let contents = {};
540
540
  contents = de_ListFHIRDatastoresResponse(data, context);
541
541
  const response = {
@@ -548,7 +548,7 @@ var de_ListFHIRExportJobsCommand = /* @__PURE__ */ __name(async (output, context
548
548
  if (output.statusCode >= 300) {
549
549
  return de_CommandError(output, context);
550
550
  }
551
- const data = await parseBody(output.body, context);
551
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
552
552
  let contents = {};
553
553
  contents = de_ListFHIRExportJobsResponse(data, context);
554
554
  const response = {
@@ -561,7 +561,7 @@ var de_ListFHIRImportJobsCommand = /* @__PURE__ */ __name(async (output, context
561
561
  if (output.statusCode >= 300) {
562
562
  return de_CommandError(output, context);
563
563
  }
564
- const data = await parseBody(output.body, context);
564
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
565
565
  let contents = {};
566
566
  contents = de_ListFHIRImportJobsResponse(data, context);
567
567
  const response = {
@@ -574,7 +574,7 @@ var de_ListTagsForResourceCommand = /* @__PURE__ */ __name(async (output, contex
574
574
  if (output.statusCode >= 300) {
575
575
  return de_CommandError(output, context);
576
576
  }
577
- const data = await parseBody(output.body, context);
577
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
578
578
  let contents = {};
579
579
  contents = (0, import_smithy_client._json)(data);
580
580
  const response = {
@@ -587,7 +587,7 @@ var de_StartFHIRExportJobCommand = /* @__PURE__ */ __name(async (output, context
587
587
  if (output.statusCode >= 300) {
588
588
  return de_CommandError(output, context);
589
589
  }
590
- const data = await parseBody(output.body, context);
590
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
591
591
  let contents = {};
592
592
  contents = (0, import_smithy_client._json)(data);
593
593
  const response = {
@@ -600,7 +600,7 @@ var de_StartFHIRImportJobCommand = /* @__PURE__ */ __name(async (output, context
600
600
  if (output.statusCode >= 300) {
601
601
  return de_CommandError(output, context);
602
602
  }
603
- const data = await parseBody(output.body, context);
603
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
604
604
  let contents = {};
605
605
  contents = (0, import_smithy_client._json)(data);
606
606
  const response = {
@@ -613,7 +613,7 @@ var de_TagResourceCommand = /* @__PURE__ */ __name(async (output, context) => {
613
613
  if (output.statusCode >= 300) {
614
614
  return de_CommandError(output, context);
615
615
  }
616
- const data = await parseBody(output.body, context);
616
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
617
617
  let contents = {};
618
618
  contents = (0, import_smithy_client._json)(data);
619
619
  const response = {
@@ -626,7 +626,7 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
626
626
  if (output.statusCode >= 300) {
627
627
  return de_CommandError(output, context);
628
628
  }
629
- const data = await parseBody(output.body, context);
629
+ const data = await (0, import_core2.parseJsonBody)(output.body, context);
630
630
  let contents = {};
631
631
  contents = (0, import_smithy_client._json)(data);
632
632
  const response = {
@@ -638,9 +638,9 @@ var de_UntagResourceCommand = /* @__PURE__ */ __name(async (output, context) =>
638
638
  var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
639
639
  const parsedOutput = {
640
640
  ...output,
641
- body: await parseErrorBody(output.body, context)
641
+ body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
642
642
  };
643
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
643
+ const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
644
644
  switch (errorCode) {
645
645
  case "AccessDeniedException":
646
646
  case "com.amazonaws.healthlake#AccessDeniedException":
@@ -901,7 +901,6 @@ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
901
901
  extendedRequestId: output.headers["x-amz-id-2"],
902
902
  cfId: output.headers["x-amz-cf-id"]
903
903
  }), "deserializeMetadata");
904
- var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
905
904
  var throwDefaultError = (0, import_smithy_client.withBaseException)(HealthLakeServiceException);
906
905
  var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
907
906
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
@@ -928,46 +927,6 @@ function sharedHeaders(operation) {
928
927
  };
929
928
  }
930
929
  __name(sharedHeaders, "sharedHeaders");
931
- var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
932
- if (encoded.length) {
933
- return JSON.parse(encoded);
934
- }
935
- return {};
936
- }), "parseBody");
937
- var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
938
- const value = await parseBody(errorBody, context);
939
- value.message = value.message ?? value.Message;
940
- return value;
941
- }, "parseErrorBody");
942
- var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
943
- const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
944
- const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
945
- let cleanValue = rawValue;
946
- if (typeof cleanValue === "number") {
947
- cleanValue = cleanValue.toString();
948
- }
949
- if (cleanValue.indexOf(",") >= 0) {
950
- cleanValue = cleanValue.split(",")[0];
951
- }
952
- if (cleanValue.indexOf(":") >= 0) {
953
- cleanValue = cleanValue.split(":")[0];
954
- }
955
- if (cleanValue.indexOf("#") >= 0) {
956
- cleanValue = cleanValue.split("#")[1];
957
- }
958
- return cleanValue;
959
- }, "sanitizeErrorCode");
960
- const headerKey = findKey(output.headers, "x-amzn-errortype");
961
- if (headerKey !== void 0) {
962
- return sanitizeErrorCode(output.headers[headerKey]);
963
- }
964
- if (data.code !== void 0) {
965
- return sanitizeErrorCode(data.code);
966
- }
967
- if (data["__type"] !== void 0) {
968
- return sanitizeErrorCode(data["__type"]);
969
- }
970
- }, "loadRestJsonErrorCode");
971
930
 
972
931
  // src/commands/CreateFHIRDatastoreCommand.ts
973
932
  var _CreateFHIRDatastoreCommand = class _CreateFHIRDatastoreCommand 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, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, limitedParseDouble as __limitedParseDouble, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
4
  import { v4 as generateIdempotencyToken } from "uuid";
@@ -549,43 +549,3 @@ function sharedHeaders(operation) {
549
549
  "x-amz-target": `HealthLake.${operation}`,
550
550
  };
551
551
  }
552
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
553
- if (encoded.length) {
554
- return JSON.parse(encoded);
555
- }
556
- return {};
557
- });
558
- const parseErrorBody = async (errorBody, context) => {
559
- const value = await parseBody(errorBody, context);
560
- value.message = value.message ?? value.Message;
561
- return value;
562
- };
563
- const loadRestJsonErrorCode = (output, data) => {
564
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
565
- const sanitizeErrorCode = (rawValue) => {
566
- let cleanValue = rawValue;
567
- if (typeof cleanValue === "number") {
568
- cleanValue = cleanValue.toString();
569
- }
570
- if (cleanValue.indexOf(",") >= 0) {
571
- cleanValue = cleanValue.split(",")[0];
572
- }
573
- if (cleanValue.indexOf(":") >= 0) {
574
- cleanValue = cleanValue.split(":")[0];
575
- }
576
- if (cleanValue.indexOf("#") >= 0) {
577
- cleanValue = cleanValue.split("#")[1];
578
- }
579
- return cleanValue;
580
- };
581
- const headerKey = findKey(output.headers, "x-amzn-errortype");
582
- if (headerKey !== undefined) {
583
- return sanitizeErrorCode(output.headers[headerKey]);
584
- }
585
- if (data.code !== undefined) {
586
- return sanitizeErrorCode(data.code);
587
- }
588
- if (data["__type"] !== undefined) {
589
- return sanitizeErrorCode(data["__type"]);
590
- }
591
- };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-healthlake",
3
3
  "description": "AWS SDK for JavaScript Healthlake 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-healthlake",
@@ -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",