@aws-sdk/client-kendra-ranking 3.310.0 → 3.312.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.
@@ -7,90 +7,63 @@ const uuid_1 = require("uuid");
7
7
  const KendraRankingServiceException_1 = require("../models/KendraRankingServiceException");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const se_CreateRescoreExecutionPlanCommand = async (input, context) => {
10
- const headers = {
11
- "content-type": "application/x-amz-json-1.0",
12
- "x-amz-target": "AWSKendraRerankingFrontendService.CreateRescoreExecutionPlan",
13
- };
10
+ const headers = sharedHeaders("CreateRescoreExecutionPlan");
14
11
  let body;
15
12
  body = JSON.stringify(se_CreateRescoreExecutionPlanRequest(input, context));
16
13
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
14
  };
18
15
  exports.se_CreateRescoreExecutionPlanCommand = se_CreateRescoreExecutionPlanCommand;
19
16
  const se_DeleteRescoreExecutionPlanCommand = async (input, context) => {
20
- const headers = {
21
- "content-type": "application/x-amz-json-1.0",
22
- "x-amz-target": "AWSKendraRerankingFrontendService.DeleteRescoreExecutionPlan",
23
- };
17
+ const headers = sharedHeaders("DeleteRescoreExecutionPlan");
24
18
  let body;
25
19
  body = JSON.stringify(se_DeleteRescoreExecutionPlanRequest(input, context));
26
20
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
21
  };
28
22
  exports.se_DeleteRescoreExecutionPlanCommand = se_DeleteRescoreExecutionPlanCommand;
29
23
  const se_DescribeRescoreExecutionPlanCommand = async (input, context) => {
30
- const headers = {
31
- "content-type": "application/x-amz-json-1.0",
32
- "x-amz-target": "AWSKendraRerankingFrontendService.DescribeRescoreExecutionPlan",
33
- };
24
+ const headers = sharedHeaders("DescribeRescoreExecutionPlan");
34
25
  let body;
35
26
  body = JSON.stringify(se_DescribeRescoreExecutionPlanRequest(input, context));
36
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
37
28
  };
38
29
  exports.se_DescribeRescoreExecutionPlanCommand = se_DescribeRescoreExecutionPlanCommand;
39
30
  const se_ListRescoreExecutionPlansCommand = async (input, context) => {
40
- const headers = {
41
- "content-type": "application/x-amz-json-1.0",
42
- "x-amz-target": "AWSKendraRerankingFrontendService.ListRescoreExecutionPlans",
43
- };
31
+ const headers = sharedHeaders("ListRescoreExecutionPlans");
44
32
  let body;
45
33
  body = JSON.stringify(se_ListRescoreExecutionPlansRequest(input, context));
46
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
35
  };
48
36
  exports.se_ListRescoreExecutionPlansCommand = se_ListRescoreExecutionPlansCommand;
49
37
  const se_ListTagsForResourceCommand = async (input, context) => {
50
- const headers = {
51
- "content-type": "application/x-amz-json-1.0",
52
- "x-amz-target": "AWSKendraRerankingFrontendService.ListTagsForResource",
53
- };
38
+ const headers = sharedHeaders("ListTagsForResource");
54
39
  let body;
55
40
  body = JSON.stringify(se_ListTagsForResourceRequest(input, context));
56
41
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
57
42
  };
58
43
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
59
44
  const se_RescoreCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.0",
62
- "x-amz-target": "AWSKendraRerankingFrontendService.Rescore",
63
- };
45
+ const headers = sharedHeaders("Rescore");
64
46
  let body;
65
47
  body = JSON.stringify(se_RescoreRequest(input, context));
66
48
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
49
  };
68
50
  exports.se_RescoreCommand = se_RescoreCommand;
69
51
  const se_TagResourceCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.0",
72
- "x-amz-target": "AWSKendraRerankingFrontendService.TagResource",
73
- };
52
+ const headers = sharedHeaders("TagResource");
74
53
  let body;
75
54
  body = JSON.stringify(se_TagResourceRequest(input, context));
76
55
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
56
  };
78
57
  exports.se_TagResourceCommand = se_TagResourceCommand;
79
58
  const se_UntagResourceCommand = async (input, context) => {
80
- const headers = {
81
- "content-type": "application/x-amz-json-1.0",
82
- "x-amz-target": "AWSKendraRerankingFrontendService.UntagResource",
83
- };
59
+ const headers = sharedHeaders("UntagResource");
84
60
  let body;
85
61
  body = JSON.stringify(se_UntagResourceRequest(input, context));
86
62
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
87
63
  };
88
64
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
89
65
  const se_UpdateRescoreExecutionPlanCommand = async (input, context) => {
90
- const headers = {
91
- "content-type": "application/x-amz-json-1.0",
92
- "x-amz-target": "AWSKendraRerankingFrontendService.UpdateRescoreExecutionPlan",
93
- };
66
+ const headers = sharedHeaders("UpdateRescoreExecutionPlan");
94
67
  let body;
95
68
  body = JSON.stringify(se_UpdateRescoreExecutionPlanRequest(input, context));
96
69
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -874,6 +847,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
874
847
  }
875
848
  return new protocol_http_1.HttpRequest(contents);
876
849
  };
850
+ function sharedHeaders(operation) {
851
+ return {
852
+ "content-type": "application/x-amz-json-1.0",
853
+ "x-amz-target": `AWSKendraRerankingFrontendService.${operation}`,
854
+ };
855
+ }
877
856
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
878
857
  if (encoded.length) {
879
858
  return JSON.parse(encoded);
@@ -4,82 +4,55 @@ import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { KendraRankingServiceException as __BaseException } from "../models/KendraRankingServiceException";
5
5
  import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ResourceUnavailableException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
6
  export const se_CreateRescoreExecutionPlanCommand = async (input, context) => {
7
- const headers = {
8
- "content-type": "application/x-amz-json-1.0",
9
- "x-amz-target": "AWSKendraRerankingFrontendService.CreateRescoreExecutionPlan",
10
- };
7
+ const headers = sharedHeaders("CreateRescoreExecutionPlan");
11
8
  let body;
12
9
  body = JSON.stringify(se_CreateRescoreExecutionPlanRequest(input, context));
13
10
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
14
11
  };
15
12
  export const se_DeleteRescoreExecutionPlanCommand = async (input, context) => {
16
- const headers = {
17
- "content-type": "application/x-amz-json-1.0",
18
- "x-amz-target": "AWSKendraRerankingFrontendService.DeleteRescoreExecutionPlan",
19
- };
13
+ const headers = sharedHeaders("DeleteRescoreExecutionPlan");
20
14
  let body;
21
15
  body = JSON.stringify(se_DeleteRescoreExecutionPlanRequest(input, context));
22
16
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
17
  };
24
18
  export const se_DescribeRescoreExecutionPlanCommand = async (input, context) => {
25
- const headers = {
26
- "content-type": "application/x-amz-json-1.0",
27
- "x-amz-target": "AWSKendraRerankingFrontendService.DescribeRescoreExecutionPlan",
28
- };
19
+ const headers = sharedHeaders("DescribeRescoreExecutionPlan");
29
20
  let body;
30
21
  body = JSON.stringify(se_DescribeRescoreExecutionPlanRequest(input, context));
31
22
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
32
23
  };
33
24
  export const se_ListRescoreExecutionPlansCommand = async (input, context) => {
34
- const headers = {
35
- "content-type": "application/x-amz-json-1.0",
36
- "x-amz-target": "AWSKendraRerankingFrontendService.ListRescoreExecutionPlans",
37
- };
25
+ const headers = sharedHeaders("ListRescoreExecutionPlans");
38
26
  let body;
39
27
  body = JSON.stringify(se_ListRescoreExecutionPlansRequest(input, context));
40
28
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
29
  };
42
30
  export const se_ListTagsForResourceCommand = async (input, context) => {
43
- const headers = {
44
- "content-type": "application/x-amz-json-1.0",
45
- "x-amz-target": "AWSKendraRerankingFrontendService.ListTagsForResource",
46
- };
31
+ const headers = sharedHeaders("ListTagsForResource");
47
32
  let body;
48
33
  body = JSON.stringify(se_ListTagsForResourceRequest(input, context));
49
34
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
50
35
  };
51
36
  export const se_RescoreCommand = async (input, context) => {
52
- const headers = {
53
- "content-type": "application/x-amz-json-1.0",
54
- "x-amz-target": "AWSKendraRerankingFrontendService.Rescore",
55
- };
37
+ const headers = sharedHeaders("Rescore");
56
38
  let body;
57
39
  body = JSON.stringify(se_RescoreRequest(input, context));
58
40
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
41
  };
60
42
  export const se_TagResourceCommand = async (input, context) => {
61
- const headers = {
62
- "content-type": "application/x-amz-json-1.0",
63
- "x-amz-target": "AWSKendraRerankingFrontendService.TagResource",
64
- };
43
+ const headers = sharedHeaders("TagResource");
65
44
  let body;
66
45
  body = JSON.stringify(se_TagResourceRequest(input, context));
67
46
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
47
  };
69
48
  export const se_UntagResourceCommand = async (input, context) => {
70
- const headers = {
71
- "content-type": "application/x-amz-json-1.0",
72
- "x-amz-target": "AWSKendraRerankingFrontendService.UntagResource",
73
- };
49
+ const headers = sharedHeaders("UntagResource");
74
50
  let body;
75
51
  body = JSON.stringify(se_UntagResourceRequest(input, context));
76
52
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
53
  };
78
54
  export const se_UpdateRescoreExecutionPlanCommand = async (input, context) => {
79
- const headers = {
80
- "content-type": "application/x-amz-json-1.0",
81
- "x-amz-target": "AWSKendraRerankingFrontendService.UpdateRescoreExecutionPlan",
82
- };
55
+ const headers = sharedHeaders("UpdateRescoreExecutionPlan");
83
56
  let body;
84
57
  body = JSON.stringify(se_UpdateRescoreExecutionPlanRequest(input, context));
85
58
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
@@ -853,6 +826,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
853
826
  }
854
827
  return new __HttpRequest(contents);
855
828
  };
829
+ function sharedHeaders(operation) {
830
+ return {
831
+ "content-type": "application/x-amz-json-1.0",
832
+ "x-amz-target": `AWSKendraRerankingFrontendService.${operation}`,
833
+ };
834
+ }
856
835
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
857
836
  if (encoded.length) {
858
837
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kendra-ranking",
3
3
  "description": "AWS SDK for JavaScript Kendra Ranking Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.312.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,7 +21,7 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.312.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
26
  "@aws-sdk/credential-provider-node": "3.310.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",