@aws-sdk/client-personalize-events 3.121.0 → 3.130.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.130.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.129.0...v3.130.0) (2022-07-14)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **codegen:** fix error code parsing when it's a number ([#3371](https://github.com/aws/aws-sdk-js-v3/issues/3371)) ([c2d8522](https://github.com/aws/aws-sdk-js-v3/commit/c2d852279a3d23958521a6ceb4f4c642b0cb1848))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.128.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.127.0...v3.128.0) (2022-07-12)
18
+
19
+ **Note:** Version bump only for package @aws-sdk/client-personalize-events
20
+
21
+
22
+
23
+
24
+
25
+ # [3.127.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.126.0...v3.127.0) (2022-07-11)
26
+
27
+ **Note:** Version bump only for package @aws-sdk/client-personalize-events
28
+
29
+
30
+
31
+
32
+
6
33
  # [3.121.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.120.0...v3.121.0) (2022-06-30)
7
34
 
8
35
 
@@ -13,11 +13,10 @@ const serializeAws_restJson1PutEventsCommand = async (input, context) => {
13
13
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/events";
14
14
  let body;
15
15
  body = JSON.stringify({
16
- ...(input.eventList !== undefined &&
17
- input.eventList !== null && { eventList: serializeAws_restJson1EventList(input.eventList, context) }),
18
- ...(input.sessionId !== undefined && input.sessionId !== null && { sessionId: input.sessionId }),
19
- ...(input.trackingId !== undefined && input.trackingId !== null && { trackingId: input.trackingId }),
20
- ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }),
16
+ ...(input.eventList != null && { eventList: serializeAws_restJson1EventList(input.eventList, context) }),
17
+ ...(input.sessionId != null && { sessionId: input.sessionId }),
18
+ ...(input.trackingId != null && { trackingId: input.trackingId }),
19
+ ...(input.userId != null && { userId: input.userId }),
21
20
  });
22
21
  return new protocol_http_1.HttpRequest({
23
22
  protocol,
@@ -38,9 +37,8 @@ const serializeAws_restJson1PutItemsCommand = async (input, context) => {
38
37
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/items";
39
38
  let body;
40
39
  body = JSON.stringify({
41
- ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }),
42
- ...(input.items !== undefined &&
43
- input.items !== null && { items: serializeAws_restJson1ItemList(input.items, context) }),
40
+ ...(input.datasetArn != null && { datasetArn: input.datasetArn }),
41
+ ...(input.items != null && { items: serializeAws_restJson1ItemList(input.items, context) }),
44
42
  });
45
43
  return new protocol_http_1.HttpRequest({
46
44
  protocol,
@@ -61,9 +59,8 @@ const serializeAws_restJson1PutUsersCommand = async (input, context) => {
61
59
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/users";
62
60
  let body;
63
61
  body = JSON.stringify({
64
- ...(input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn }),
65
- ...(input.users !== undefined &&
66
- input.users !== null && { users: serializeAws_restJson1UserList(input.users, context) }),
62
+ ...(input.datasetArn != null && { datasetArn: input.datasetArn }),
63
+ ...(input.users != null && { users: serializeAws_restJson1UserList(input.users, context) }),
67
64
  });
68
65
  return new protocol_http_1.HttpRequest({
69
66
  protocol,
@@ -228,18 +225,14 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
228
225
  };
229
226
  const serializeAws_restJson1Event = (input, context) => {
230
227
  return {
231
- ...(input.eventId !== undefined && input.eventId !== null && { eventId: input.eventId }),
232
- ...(input.eventType !== undefined && input.eventType !== null && { eventType: input.eventType }),
233
- ...(input.eventValue !== undefined &&
234
- input.eventValue !== null && { eventValue: (0, smithy_client_1.serializeFloat)(input.eventValue) }),
235
- ...(input.impression !== undefined &&
236
- input.impression !== null && { impression: serializeAws_restJson1Impression(input.impression, context) }),
237
- ...(input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId }),
238
- ...(input.properties !== undefined &&
239
- input.properties !== null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
240
- ...(input.recommendationId !== undefined &&
241
- input.recommendationId !== null && { recommendationId: input.recommendationId }),
242
- ...(input.sentAt !== undefined && input.sentAt !== null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }),
228
+ ...(input.eventId != null && { eventId: input.eventId }),
229
+ ...(input.eventType != null && { eventType: input.eventType }),
230
+ ...(input.eventValue != null && { eventValue: (0, smithy_client_1.serializeFloat)(input.eventValue) }),
231
+ ...(input.impression != null && { impression: serializeAws_restJson1Impression(input.impression, context) }),
232
+ ...(input.itemId != null && { itemId: input.itemId }),
233
+ ...(input.properties != null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
234
+ ...(input.recommendationId != null && { recommendationId: input.recommendationId }),
235
+ ...(input.sentAt != null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }),
243
236
  };
244
237
  };
245
238
  const serializeAws_restJson1EventList = (input, context) => {
@@ -264,9 +257,8 @@ const serializeAws_restJson1Impression = (input, context) => {
264
257
  };
265
258
  const serializeAws_restJson1Item = (input, context) => {
266
259
  return {
267
- ...(input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId }),
268
- ...(input.properties !== undefined &&
269
- input.properties !== null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
260
+ ...(input.itemId != null && { itemId: input.itemId }),
261
+ ...(input.properties != null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
270
262
  };
271
263
  };
272
264
  const serializeAws_restJson1ItemList = (input, context) => {
@@ -281,9 +273,8 @@ const serializeAws_restJson1ItemList = (input, context) => {
281
273
  };
282
274
  const serializeAws_restJson1User = (input, context) => {
283
275
  return {
284
- ...(input.properties !== undefined &&
285
- input.properties !== null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
286
- ...(input.userId !== undefined && input.userId !== null && { userId: input.userId }),
276
+ ...(input.properties != null && { properties: smithy_client_1.LazyJsonString.fromObject(input.properties) }),
277
+ ...(input.userId != null && { userId: input.userId }),
287
278
  };
288
279
  };
289
280
  const serializeAws_restJson1UserList = (input, context) => {
@@ -327,6 +318,9 @@ const loadRestJsonErrorCode = (output, data) => {
327
318
  const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
328
319
  const sanitizeErrorCode = (rawValue) => {
329
320
  let cleanValue = rawValue;
321
+ if (typeof cleanValue === "number") {
322
+ cleanValue = cleanValue.toString();
323
+ }
330
324
  if (cleanValue.indexOf(":") >= 0) {
331
325
  cleanValue = cleanValue.split(":")[0];
332
326
  }
@@ -14,8 +14,7 @@ export var serializeAws_restJson1PutEventsCommand = function (input, context) {
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 || "") + "/events";
17
- body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.eventList !== undefined &&
18
- input.eventList !== null && { eventList: serializeAws_restJson1EventList(input.eventList, context) })), (input.sessionId !== undefined && input.sessionId !== null && { sessionId: input.sessionId })), (input.trackingId !== undefined && input.trackingId !== null && { trackingId: input.trackingId })), (input.userId !== undefined && input.userId !== null && { userId: input.userId })));
17
+ body = JSON.stringify(__assign(__assign(__assign(__assign({}, (input.eventList != null && { eventList: serializeAws_restJson1EventList(input.eventList, context) })), (input.sessionId != null && { sessionId: input.sessionId })), (input.trackingId != null && { trackingId: input.trackingId })), (input.userId != null && { userId: input.userId })));
19
18
  return [2, new __HttpRequest({
20
19
  protocol: protocol,
21
20
  hostname: hostname,
@@ -39,8 +38,7 @@ export var serializeAws_restJson1PutItemsCommand = function (input, context) { r
39
38
  "content-type": "application/json",
40
39
  };
41
40
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/items";
42
- body = JSON.stringify(__assign(__assign({}, (input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn })), (input.items !== undefined &&
43
- input.items !== null && { items: serializeAws_restJson1ItemList(input.items, context) })));
41
+ body = JSON.stringify(__assign(__assign({}, (input.datasetArn != null && { datasetArn: input.datasetArn })), (input.items != null && { items: serializeAws_restJson1ItemList(input.items, context) })));
44
42
  return [2, new __HttpRequest({
45
43
  protocol: protocol,
46
44
  hostname: hostname,
@@ -64,8 +62,7 @@ export var serializeAws_restJson1PutUsersCommand = function (input, context) { r
64
62
  "content-type": "application/json",
65
63
  };
66
64
  resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/users";
67
- body = JSON.stringify(__assign(__assign({}, (input.datasetArn !== undefined && input.datasetArn !== null && { datasetArn: input.datasetArn })), (input.users !== undefined &&
68
- input.users !== null && { users: serializeAws_restJson1UserList(input.users, context) })));
65
+ body = JSON.stringify(__assign(__assign({}, (input.datasetArn != null && { datasetArn: input.datasetArn })), (input.users != null && { users: serializeAws_restJson1UserList(input.users, context) })));
69
66
  return [2, new __HttpRequest({
70
67
  protocol: protocol,
71
68
  hostname: hostname,
@@ -284,11 +281,7 @@ var deserializeAws_restJson1ResourceNotFoundExceptionResponse = function (parsed
284
281
  });
285
282
  }); };
286
283
  var serializeAws_restJson1Event = function (input, context) {
287
- return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.eventId !== undefined && input.eventId !== null && { eventId: input.eventId })), (input.eventType !== undefined && input.eventType !== null && { eventType: input.eventType })), (input.eventValue !== undefined &&
288
- input.eventValue !== null && { eventValue: __serializeFloat(input.eventValue) })), (input.impression !== undefined &&
289
- input.impression !== null && { impression: serializeAws_restJson1Impression(input.impression, context) })), (input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId })), (input.properties !== undefined &&
290
- input.properties !== null && { properties: __LazyJsonString.fromObject(input.properties) })), (input.recommendationId !== undefined &&
291
- input.recommendationId !== null && { recommendationId: input.recommendationId })), (input.sentAt !== undefined && input.sentAt !== null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }));
284
+ return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.eventId != null && { eventId: input.eventId })), (input.eventType != null && { eventType: input.eventType })), (input.eventValue != null && { eventValue: __serializeFloat(input.eventValue) })), (input.impression != null && { impression: serializeAws_restJson1Impression(input.impression, context) })), (input.itemId != null && { itemId: input.itemId })), (input.properties != null && { properties: __LazyJsonString.fromObject(input.properties) })), (input.recommendationId != null && { recommendationId: input.recommendationId })), (input.sentAt != null && { sentAt: Math.round(input.sentAt.getTime() / 1000) }));
292
285
  };
293
286
  var serializeAws_restJson1EventList = function (input, context) {
294
287
  return input
@@ -311,8 +304,7 @@ var serializeAws_restJson1Impression = function (input, context) {
311
304
  });
312
305
  };
313
306
  var serializeAws_restJson1Item = function (input, context) {
314
- return __assign(__assign({}, (input.itemId !== undefined && input.itemId !== null && { itemId: input.itemId })), (input.properties !== undefined &&
315
- input.properties !== null && { properties: __LazyJsonString.fromObject(input.properties) }));
307
+ return __assign(__assign({}, (input.itemId != null && { itemId: input.itemId })), (input.properties != null && { properties: __LazyJsonString.fromObject(input.properties) }));
316
308
  };
317
309
  var serializeAws_restJson1ItemList = function (input, context) {
318
310
  return input
@@ -325,8 +317,7 @@ var serializeAws_restJson1ItemList = function (input, context) {
325
317
  });
326
318
  };
327
319
  var serializeAws_restJson1User = function (input, context) {
328
- return __assign(__assign({}, (input.properties !== undefined &&
329
- input.properties !== null && { properties: __LazyJsonString.fromObject(input.properties) })), (input.userId !== undefined && input.userId !== null && { userId: input.userId }));
320
+ return __assign(__assign({}, (input.properties != null && { properties: __LazyJsonString.fromObject(input.properties) })), (input.userId != null && { userId: input.userId }));
330
321
  };
331
322
  var serializeAws_restJson1UserList = function (input, context) {
332
323
  return input
@@ -376,6 +367,9 @@ var loadRestJsonErrorCode = function (output, data) {
376
367
  var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
377
368
  var sanitizeErrorCode = function (rawValue) {
378
369
  var cleanValue = rawValue;
370
+ if (typeof cleanValue === "number") {
371
+ cleanValue = cleanValue.toString();
372
+ }
379
373
  if (cleanValue.indexOf(":") >= 0) {
380
374
  cleanValue = cleanValue.split(":")[0];
381
375
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-personalize-events",
3
3
  "description": "AWS SDK for JavaScript Personalize Events Client for Node.js, Browser and React Native",
4
- "version": "3.121.0",
4
+ "version": "3.130.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.121.0",
22
- "@aws-sdk/config-resolver": "3.110.0",
23
- "@aws-sdk/credential-provider-node": "3.121.0",
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.130.0",
22
+ "@aws-sdk/config-resolver": "3.130.0",
23
+ "@aws-sdk/credential-provider-node": "3.130.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.130.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.130.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"