@aws-sdk/client-personalize-runtime 3.118.1 → 3.128.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/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.128.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.127.0...v3.128.0) (2022-07-12)
7
+
8
+ **Note:** Version bump only for package @aws-sdk/client-personalize-runtime
9
+
10
+
11
+
12
+
13
+
14
+ # [3.127.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.126.0...v3.127.0) (2022-07-11)
15
+
16
+ **Note:** Version bump only for package @aws-sdk/client-personalize-runtime
17
+
18
+
19
+
20
+
21
+
22
+ # [3.121.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.120.0...v3.121.0) (2022-06-30)
23
+
24
+
25
+ ### Features
26
+
27
+ * **clients:** fallback to status code for unmodeled errors ([#3752](https://github.com/aws/aws-sdk-js-v3/issues/3752)) ([49bcc4f](https://github.com/aws/aws-sdk-js-v3/commit/49bcc4f153e890e798a8e82fd5fc397b2dcc449f))
28
+
29
+
30
+
31
+
32
+
6
33
  ## [3.118.1](https://github.com/aws/aws-sdk-js-v3/compare/v3.118.0...v3.118.1) (2022-06-27)
7
34
 
8
35
  **Note:** Version bump only for package @aws-sdk/client-personalize-runtime
@@ -13,15 +13,14 @@ const serializeAws_restJson1GetPersonalizedRankingCommand = async (input, contex
13
13
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/personalize-ranking";
14
14
  let body;
15
15
  body = JSON.stringify({
16
- ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }),
17
- ...(input.context !== undefined &&
18
- input.context !== null && { context: serializeAws_restJson1Context(input.context, context) }),
19
- ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }),
20
- ...(input.filterValues !== undefined &&
21
- input.filterValues !== null && { filterValues: serializeAws_restJson1FilterValues(input.filterValues, context) }),
22
- ...(input.inputList !== undefined &&
23
- input.inputList !== null && { inputList: serializeAws_restJson1InputList(input.inputList, context) }),
24
- ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }),
16
+ ...(input.campaignArn != null && { campaignArn: input.campaignArn }),
17
+ ...(input.context != null && { context: serializeAws_restJson1Context(input.context, context) }),
18
+ ...(input.filterArn != null && { filterArn: input.filterArn }),
19
+ ...(input.filterValues != null && {
20
+ filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
21
+ }),
22
+ ...(input.inputList != null && { inputList: serializeAws_restJson1InputList(input.inputList, context) }),
23
+ ...(input.userId != null && { userId: input.userId }),
25
24
  });
26
25
  return new protocol_http_1.HttpRequest({
27
26
  protocol,
@@ -42,17 +41,16 @@ const serializeAws_restJson1GetRecommendationsCommand = async (input, context) =
42
41
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/recommendations";
43
42
  let body;
44
43
  body = JSON.stringify({
45
- ...(input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn }),
46
- ...(input.context !== undefined &&
47
- input.context !== null && { context: serializeAws_restJson1Context(input.context, context) }),
48
- ...(input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn }),
49
- ...(input.filterValues !== undefined &&
50
- input.filterValues !== null && { filterValues: serializeAws_restJson1FilterValues(input.filterValues, context) }),
51
- ...(input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId }),
52
- ...(input.numResults !== undefined && input.numResults !== null && { numResults: input.numResults }),
53
- ...(input.recommenderArn !== undefined &&
54
- input.recommenderArn !== null && { recommenderArn: input.recommenderArn }),
55
- ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }),
44
+ ...(input.campaignArn != null && { campaignArn: input.campaignArn }),
45
+ ...(input.context != null && { context: serializeAws_restJson1Context(input.context, context) }),
46
+ ...(input.filterArn != null && { filterArn: input.filterArn }),
47
+ ...(input.filterValues != null && {
48
+ filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
49
+ }),
50
+ ...(input.itemId != null && { itemId: input.itemId }),
51
+ ...(input.numResults != null && { numResults: input.numResults }),
52
+ ...(input.recommenderArn != null && { recommenderArn: input.recommenderArn }),
53
+ ...(input.userId != null && { userId: input.userId }),
56
54
  });
57
55
  return new protocol_http_1.HttpRequest({
58
56
  protocol,
@@ -90,8 +88,7 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
90
88
  body: await parseBody(output.body, context),
91
89
  };
92
90
  let response;
93
- let errorCode = "UnknownError";
94
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
91
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
95
92
  switch (errorCode) {
96
93
  case "InvalidInputException":
97
94
  case "com.amazonaws.personalizeruntime#InvalidInputException":
@@ -101,10 +98,12 @@ const deserializeAws_restJson1GetPersonalizedRankingCommandError = async (output
101
98
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
102
99
  default:
103
100
  const parsedBody = parsedOutput.body;
101
+ const $metadata = deserializeMetadata(output);
102
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
104
103
  response = new PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException({
105
- name: parsedBody.code || parsedBody.Code || errorCode,
104
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
106
105
  $fault: "client",
107
- $metadata: deserializeMetadata(output),
106
+ $metadata,
108
107
  });
109
108
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
110
109
  }
@@ -134,8 +133,7 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
134
133
  body: await parseBody(output.body, context),
135
134
  };
136
135
  let response;
137
- let errorCode = "UnknownError";
138
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
136
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
139
137
  switch (errorCode) {
140
138
  case "InvalidInputException":
141
139
  case "com.amazonaws.personalizeruntime#InvalidInputException":
@@ -145,10 +143,12 @@ const deserializeAws_restJson1GetRecommendationsCommandError = async (output, co
145
143
  throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
146
144
  default:
147
145
  const parsedBody = parsedOutput.body;
146
+ const $metadata = deserializeMetadata(output);
147
+ const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
148
148
  response = new PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException({
149
- name: parsedBody.code || parsedBody.Code || errorCode,
149
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
150
150
  $fault: "client",
151
- $metadata: deserializeMetadata(output),
151
+ $metadata,
152
152
  });
153
153
  throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
154
154
  }
@@ -275,5 +275,4 @@ const loadRestJsonErrorCode = (output, data) => {
275
275
  if (data["__type"] !== undefined) {
276
276
  return sanitizeErrorCode(data["__type"]);
277
277
  }
278
- return "";
279
278
  };
@@ -14,10 +14,9 @@ export var serializeAws_restJson1GetPersonalizedRankingCommand = function (input
14
14
  "content-type": "application/json",
15
15
  };
16
16
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/personalize-ranking";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn })), (input.context !== undefined &&
18
- input.context !== null && { context: serializeAws_restJson1Context(input.context, context) })), (input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn })), (input.filterValues !== undefined &&
19
- input.filterValues !== null && { filterValues: serializeAws_restJson1FilterValues(input.filterValues, context) })), (input.inputList !== undefined &&
20
- input.inputList !== null && { inputList: serializeAws_restJson1InputList(input.inputList, context) })), (input.userId !== undefined && input.userId !== null && { userId: input.userId })));
17
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.campaignArn != null && { campaignArn: input.campaignArn })), (input.context != null && { context: serializeAws_restJson1Context(input.context, context) })), (input.filterArn != null && { filterArn: input.filterArn })), (input.filterValues != null && {
18
+ filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
19
+ })), (input.inputList != null && { inputList: serializeAws_restJson1InputList(input.inputList, context) })), (input.userId != null && { userId: input.userId })));
21
20
  return [2, new __HttpRequest({
22
21
  protocol: protocol,
23
22
  hostname: hostname,
@@ -41,10 +40,9 @@ export var serializeAws_restJson1GetRecommendationsCommand = function (input, co
41
40
  "content-type": "application/json",
42
41
  };
43
42
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/recommendations";
44
- body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.campaignArn !== undefined && input.campaignArn !== null && { campaignArn: input.campaignArn })), (input.context !== undefined &&
45
- input.context !== null && { context: serializeAws_restJson1Context(input.context, context) })), (input.filterArn !== undefined && input.filterArn !== null && { filterArn: input.filterArn })), (input.filterValues !== undefined &&
46
- input.filterValues !== null && { filterValues: serializeAws_restJson1FilterValues(input.filterValues, context) })), (input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId })), (input.numResults !== undefined && input.numResults !== null && { numResults: input.numResults })), (input.recommenderArn !== undefined &&
47
- input.recommenderArn !== null && { recommenderArn: input.recommenderArn })), (input.userId !== undefined && input.userId !== null && { userId: input.userId })));
43
+ body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.campaignArn != null && { campaignArn: input.campaignArn })), (input.context != null && { context: serializeAws_restJson1Context(input.context, context) })), (input.filterArn != null && { filterArn: input.filterArn })), (input.filterValues != null && {
44
+ filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
45
+ })), (input.itemId != null && { itemId: input.itemId })), (input.numResults != null && { numResults: input.numResults })), (input.recommenderArn != null && { recommenderArn: input.recommenderArn })), (input.userId != null && { userId: input.userId })));
48
46
  return [2, new __HttpRequest({
49
47
  protocol: protocol,
50
48
  hostname: hostname,
@@ -86,7 +84,7 @@ export var deserializeAws_restJson1GetPersonalizedRankingCommand = function (out
86
84
  });
87
85
  }); };
88
86
  var deserializeAws_restJson1GetPersonalizedRankingCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
89
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
87
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
90
88
  var _c;
91
89
  return __generator(this, function (_d) {
92
90
  switch (_d.label) {
@@ -96,7 +94,6 @@ var deserializeAws_restJson1GetPersonalizedRankingCommandError = function (outpu
96
94
  return [4, parseBody(output.body, context)];
97
95
  case 1:
98
96
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
99
- errorCode = "UnknownError";
100
97
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
101
98
  _b = errorCode;
102
99
  switch (_b) {
@@ -112,10 +109,12 @@ var deserializeAws_restJson1GetPersonalizedRankingCommandError = function (outpu
112
109
  case 5: throw _d.sent();
113
110
  case 6:
114
111
  parsedBody = parsedOutput.body;
112
+ $metadata = deserializeMetadata(output);
113
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
115
114
  response = new __BaseException({
116
- name: parsedBody.code || parsedBody.Code || errorCode,
115
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
117
116
  $fault: "client",
118
- $metadata: deserializeMetadata(output),
117
+ $metadata: $metadata,
119
118
  });
120
119
  throw __decorateServiceException(response, parsedBody);
121
120
  }
@@ -150,7 +149,7 @@ export var deserializeAws_restJson1GetRecommendationsCommand = function (output,
150
149
  });
151
150
  }); };
152
151
  var deserializeAws_restJson1GetRecommendationsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
153
- var parsedOutput, _a, response, errorCode, _b, parsedBody;
152
+ var parsedOutput, _a, response, errorCode, _b, parsedBody, $metadata, statusCode;
154
153
  var _c;
155
154
  return __generator(this, function (_d) {
156
155
  switch (_d.label) {
@@ -160,7 +159,6 @@ var deserializeAws_restJson1GetRecommendationsCommandError = function (output, c
160
159
  return [4, parseBody(output.body, context)];
161
160
  case 1:
162
161
  parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
163
- errorCode = "UnknownError";
164
162
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
165
163
  _b = errorCode;
166
164
  switch (_b) {
@@ -176,10 +174,12 @@ var deserializeAws_restJson1GetRecommendationsCommandError = function (output, c
176
174
  case 5: throw _d.sent();
177
175
  case 6:
178
176
  parsedBody = parsedOutput.body;
177
+ $metadata = deserializeMetadata(output);
178
+ statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
179
179
  response = new __BaseException({
180
- name: parsedBody.code || parsedBody.Code || errorCode,
180
+ name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
181
181
  $fault: "client",
182
- $metadata: deserializeMetadata(output),
182
+ $metadata: $metadata,
183
183
  });
184
184
  throw __decorateServiceException(response, parsedBody);
185
185
  }
@@ -312,5 +312,4 @@ var loadRestJsonErrorCode = function (output, data) {
312
312
  if (data["__type"] !== undefined) {
313
313
  return sanitizeErrorCode(data["__type"]);
314
314
  }
315
- return "";
316
315
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-personalize-runtime",
3
3
  "description": "AWS SDK for JavaScript Personalize Runtime Client for Node.js, Browser and React Native",
4
- "version": "3.118.1",
4
+ "version": "3.128.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",
@@ -18,35 +18,35 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.118.1",
22
- "@aws-sdk/config-resolver": "3.110.0",
23
- "@aws-sdk/credential-provider-node": "3.118.1",
24
- "@aws-sdk/fetch-http-handler": "3.110.0",
25
- "@aws-sdk/hash-node": "3.110.0",
26
- "@aws-sdk/invalid-dependency": "3.110.0",
27
- "@aws-sdk/middleware-content-length": "3.110.0",
28
- "@aws-sdk/middleware-host-header": "3.110.0",
29
- "@aws-sdk/middleware-logger": "3.110.0",
30
- "@aws-sdk/middleware-recursion-detection": "3.110.0",
31
- "@aws-sdk/middleware-retry": "3.118.1",
32
- "@aws-sdk/middleware-serde": "3.110.0",
33
- "@aws-sdk/middleware-signing": "3.110.0",
34
- "@aws-sdk/middleware-stack": "3.110.0",
35
- "@aws-sdk/middleware-user-agent": "3.110.0",
36
- "@aws-sdk/node-config-provider": "3.110.0",
37
- "@aws-sdk/node-http-handler": "3.118.1",
38
- "@aws-sdk/protocol-http": "3.110.0",
39
- "@aws-sdk/smithy-client": "3.110.0",
40
- "@aws-sdk/types": "3.110.0",
41
- "@aws-sdk/url-parser": "3.110.0",
21
+ "@aws-sdk/client-sts": "3.128.0",
22
+ "@aws-sdk/config-resolver": "3.128.0",
23
+ "@aws-sdk/credential-provider-node": "3.128.0",
24
+ "@aws-sdk/fetch-http-handler": "3.127.0",
25
+ "@aws-sdk/hash-node": "3.127.0",
26
+ "@aws-sdk/invalid-dependency": "3.127.0",
27
+ "@aws-sdk/middleware-content-length": "3.127.0",
28
+ "@aws-sdk/middleware-host-header": "3.127.0",
29
+ "@aws-sdk/middleware-logger": "3.127.0",
30
+ "@aws-sdk/middleware-recursion-detection": "3.127.0",
31
+ "@aws-sdk/middleware-retry": "3.127.0",
32
+ "@aws-sdk/middleware-serde": "3.127.0",
33
+ "@aws-sdk/middleware-signing": "3.128.0",
34
+ "@aws-sdk/middleware-stack": "3.127.0",
35
+ "@aws-sdk/middleware-user-agent": "3.127.0",
36
+ "@aws-sdk/node-config-provider": "3.127.0",
37
+ "@aws-sdk/node-http-handler": "3.127.0",
38
+ "@aws-sdk/protocol-http": "3.127.0",
39
+ "@aws-sdk/smithy-client": "3.127.0",
40
+ "@aws-sdk/types": "3.127.0",
41
+ "@aws-sdk/url-parser": "3.127.0",
42
42
  "@aws-sdk/util-base64-browser": "3.109.0",
43
43
  "@aws-sdk/util-base64-node": "3.55.0",
44
44
  "@aws-sdk/util-body-length-browser": "3.55.0",
45
45
  "@aws-sdk/util-body-length-node": "3.55.0",
46
- "@aws-sdk/util-defaults-mode-browser": "3.110.0",
47
- "@aws-sdk/util-defaults-mode-node": "3.110.0",
48
- "@aws-sdk/util-user-agent-browser": "3.110.0",
49
- "@aws-sdk/util-user-agent-node": "3.118.0",
46
+ "@aws-sdk/util-defaults-mode-browser": "3.127.0",
47
+ "@aws-sdk/util-defaults-mode-node": "3.128.0",
48
+ "@aws-sdk/util-user-agent-browser": "3.127.0",
49
+ "@aws-sdk/util-user-agent-node": "3.127.0",
50
50
  "@aws-sdk/util-utf8-browser": "3.109.0",
51
51
  "@aws-sdk/util-utf8-node": "3.109.0",
52
52
  "tslib": "^2.3.1"