@aws-sdk/client-personalize-runtime 3.565.0 → 3.567.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 +24 -3
- package/dist-es/commands/GetPersonalizedRankingCommand.js +2 -2
- package/dist-es/commands/GetRecommendationsCommand.js +2 -2
- package/dist-es/models/models_0.js +14 -0
- package/dist-es/protocols/Aws_restJson1.js +1 -0
- package/dist-types/commands/GetPersonalizedRankingCommand.d.ts +3 -0
- package/dist-types/commands/GetRecommendationsCommand.d.ts +3 -0
- package/dist-types/models/models_0.d.ts +37 -0
- package/dist-types/ts3.4/models/models_0.d.ts +10 -0
- package/package.json +14 -15
package/dist-cjs/index.js
CHANGED
|
@@ -25,12 +25,15 @@ __export(src_exports, {
|
|
|
25
25
|
GetActionRecommendationsRequestFilterSensitiveLog: () => GetActionRecommendationsRequestFilterSensitiveLog,
|
|
26
26
|
GetPersonalizedRankingCommand: () => GetPersonalizedRankingCommand,
|
|
27
27
|
GetPersonalizedRankingRequestFilterSensitiveLog: () => GetPersonalizedRankingRequestFilterSensitiveLog,
|
|
28
|
+
GetPersonalizedRankingResponseFilterSensitiveLog: () => GetPersonalizedRankingResponseFilterSensitiveLog,
|
|
28
29
|
GetRecommendationsCommand: () => GetRecommendationsCommand,
|
|
29
30
|
GetRecommendationsRequestFilterSensitiveLog: () => GetRecommendationsRequestFilterSensitiveLog,
|
|
31
|
+
GetRecommendationsResponseFilterSensitiveLog: () => GetRecommendationsResponseFilterSensitiveLog,
|
|
30
32
|
InvalidInputException: () => InvalidInputException,
|
|
31
33
|
PersonalizeRuntime: () => PersonalizeRuntime,
|
|
32
34
|
PersonalizeRuntimeClient: () => PersonalizeRuntimeClient,
|
|
33
35
|
PersonalizeRuntimeServiceException: () => PersonalizeRuntimeServiceException,
|
|
36
|
+
PredictedItemFilterSensitiveLog: () => PredictedItemFilterSensitiveLog,
|
|
34
37
|
PromotionFilterSensitiveLog: () => PromotionFilterSensitiveLog,
|
|
35
38
|
ResourceNotFoundException: () => ResourceNotFoundException,
|
|
36
39
|
__Client: () => import_smithy_client.Client
|
|
@@ -250,6 +253,16 @@ var GetPersonalizedRankingRequestFilterSensitiveLog = /* @__PURE__ */ __name((ob
|
|
|
250
253
|
...obj.context && { context: import_smithy_client.SENSITIVE_STRING },
|
|
251
254
|
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING }
|
|
252
255
|
}), "GetPersonalizedRankingRequestFilterSensitiveLog");
|
|
256
|
+
var PredictedItemFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
257
|
+
...obj,
|
|
258
|
+
...obj.metadata && { metadata: import_smithy_client.SENSITIVE_STRING }
|
|
259
|
+
}), "PredictedItemFilterSensitiveLog");
|
|
260
|
+
var GetPersonalizedRankingResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
261
|
+
...obj,
|
|
262
|
+
...obj.personalizedRanking && {
|
|
263
|
+
personalizedRanking: obj.personalizedRanking.map((item) => PredictedItemFilterSensitiveLog(item))
|
|
264
|
+
}
|
|
265
|
+
}), "GetPersonalizedRankingResponseFilterSensitiveLog");
|
|
253
266
|
var PromotionFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
254
267
|
...obj,
|
|
255
268
|
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING }
|
|
@@ -260,6 +273,10 @@ var GetRecommendationsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) =
|
|
|
260
273
|
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING },
|
|
261
274
|
...obj.promotions && { promotions: obj.promotions.map((item) => PromotionFilterSensitiveLog(item)) }
|
|
262
275
|
}), "GetRecommendationsRequestFilterSensitiveLog");
|
|
276
|
+
var GetRecommendationsResponseFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
277
|
+
...obj,
|
|
278
|
+
...obj.itemList && { itemList: obj.itemList.map((item) => PredictedItemFilterSensitiveLog(item)) }
|
|
279
|
+
}), "GetRecommendationsResponseFilterSensitiveLog");
|
|
263
280
|
|
|
264
281
|
// src/protocols/Aws_restJson1.ts
|
|
265
282
|
var import_core2 = require("@aws-sdk/core");
|
|
@@ -446,6 +463,7 @@ var de_PredictedItem = /* @__PURE__ */ __name((output, context) => {
|
|
|
446
463
|
itemId: import_smithy_client.expectString,
|
|
447
464
|
metadata: import_smithy_client._json,
|
|
448
465
|
promotionName: import_smithy_client.expectString,
|
|
466
|
+
reason: import_smithy_client._json,
|
|
449
467
|
score: import_smithy_client.limitedParseDouble
|
|
450
468
|
});
|
|
451
469
|
}, "de_PredictedItem");
|
|
@@ -481,7 +499,7 @@ var _GetPersonalizedRankingCommand = class _GetPersonalizedRankingCommand extend
|
|
|
481
499
|
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
482
500
|
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
483
501
|
];
|
|
484
|
-
}).s("AmazonPersonalizeRuntime", "GetPersonalizedRanking", {}).n("PersonalizeRuntimeClient", "GetPersonalizedRankingCommand").f(GetPersonalizedRankingRequestFilterSensitiveLog,
|
|
502
|
+
}).s("AmazonPersonalizeRuntime", "GetPersonalizedRanking", {}).n("PersonalizeRuntimeClient", "GetPersonalizedRankingCommand").f(GetPersonalizedRankingRequestFilterSensitiveLog, GetPersonalizedRankingResponseFilterSensitiveLog).ser(se_GetPersonalizedRankingCommand).de(de_GetPersonalizedRankingCommand).build() {
|
|
485
503
|
};
|
|
486
504
|
__name(_GetPersonalizedRankingCommand, "GetPersonalizedRankingCommand");
|
|
487
505
|
var GetPersonalizedRankingCommand = _GetPersonalizedRankingCommand;
|
|
@@ -498,7 +516,7 @@ var _GetRecommendationsCommand = class _GetRecommendationsCommand extends import
|
|
|
498
516
|
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
499
517
|
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
500
518
|
];
|
|
501
|
-
}).s("AmazonPersonalizeRuntime", "GetRecommendations", {}).n("PersonalizeRuntimeClient", "GetRecommendationsCommand").f(GetRecommendationsRequestFilterSensitiveLog,
|
|
519
|
+
}).s("AmazonPersonalizeRuntime", "GetRecommendations", {}).n("PersonalizeRuntimeClient", "GetRecommendationsCommand").f(GetRecommendationsRequestFilterSensitiveLog, GetRecommendationsResponseFilterSensitiveLog).ser(se_GetRecommendationsCommand).de(de_GetRecommendationsCommand).build() {
|
|
502
520
|
};
|
|
503
521
|
__name(_GetRecommendationsCommand, "GetRecommendationsCommand");
|
|
504
522
|
var GetRecommendationsCommand = _GetRecommendationsCommand;
|
|
@@ -529,7 +547,10 @@ var PersonalizeRuntime = _PersonalizeRuntime;
|
|
|
529
547
|
ResourceNotFoundException,
|
|
530
548
|
GetActionRecommendationsRequestFilterSensitiveLog,
|
|
531
549
|
GetPersonalizedRankingRequestFilterSensitiveLog,
|
|
550
|
+
PredictedItemFilterSensitiveLog,
|
|
551
|
+
GetPersonalizedRankingResponseFilterSensitiveLog,
|
|
532
552
|
PromotionFilterSensitiveLog,
|
|
533
|
-
GetRecommendationsRequestFilterSensitiveLog
|
|
553
|
+
GetRecommendationsRequestFilterSensitiveLog,
|
|
554
|
+
GetRecommendationsResponseFilterSensitiveLog
|
|
534
555
|
});
|
|
535
556
|
|
|
@@ -2,7 +2,7 @@ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
|
2
2
|
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
4
|
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
-
import { GetPersonalizedRankingRequestFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { GetPersonalizedRankingRequestFilterSensitiveLog, GetPersonalizedRankingResponseFilterSensitiveLog, } from "../models/models_0";
|
|
6
6
|
import { de_GetPersonalizedRankingCommand, se_GetPersonalizedRankingCommand } from "../protocols/Aws_restJson1";
|
|
7
7
|
export { $Command };
|
|
8
8
|
export class GetPersonalizedRankingCommand extends $Command
|
|
@@ -18,7 +18,7 @@ export class GetPersonalizedRankingCommand extends $Command
|
|
|
18
18
|
})
|
|
19
19
|
.s("AmazonPersonalizeRuntime", "GetPersonalizedRanking", {})
|
|
20
20
|
.n("PersonalizeRuntimeClient", "GetPersonalizedRankingCommand")
|
|
21
|
-
.f(GetPersonalizedRankingRequestFilterSensitiveLog,
|
|
21
|
+
.f(GetPersonalizedRankingRequestFilterSensitiveLog, GetPersonalizedRankingResponseFilterSensitiveLog)
|
|
22
22
|
.ser(se_GetPersonalizedRankingCommand)
|
|
23
23
|
.de(de_GetPersonalizedRankingCommand)
|
|
24
24
|
.build() {
|
|
@@ -2,7 +2,7 @@ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
|
2
2
|
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
3
|
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
4
|
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
-
import { GetRecommendationsRequestFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { GetRecommendationsRequestFilterSensitiveLog, GetRecommendationsResponseFilterSensitiveLog, } from "../models/models_0";
|
|
6
6
|
import { de_GetRecommendationsCommand, se_GetRecommendationsCommand } from "../protocols/Aws_restJson1";
|
|
7
7
|
export { $Command };
|
|
8
8
|
export class GetRecommendationsCommand extends $Command
|
|
@@ -18,7 +18,7 @@ export class GetRecommendationsCommand extends $Command
|
|
|
18
18
|
})
|
|
19
19
|
.s("AmazonPersonalizeRuntime", "GetRecommendations", {})
|
|
20
20
|
.n("PersonalizeRuntimeClient", "GetRecommendationsCommand")
|
|
21
|
-
.f(GetRecommendationsRequestFilterSensitiveLog,
|
|
21
|
+
.f(GetRecommendationsRequestFilterSensitiveLog, GetRecommendationsResponseFilterSensitiveLog)
|
|
22
22
|
.ser(se_GetRecommendationsCommand)
|
|
23
23
|
.de(de_GetRecommendationsCommand)
|
|
24
24
|
.build() {
|
|
@@ -33,6 +33,16 @@ export const GetPersonalizedRankingRequestFilterSensitiveLog = (obj) => ({
|
|
|
33
33
|
...(obj.context && { context: SENSITIVE_STRING }),
|
|
34
34
|
...(obj.filterValues && { filterValues: SENSITIVE_STRING }),
|
|
35
35
|
});
|
|
36
|
+
export const PredictedItemFilterSensitiveLog = (obj) => ({
|
|
37
|
+
...obj,
|
|
38
|
+
...(obj.metadata && { metadata: SENSITIVE_STRING }),
|
|
39
|
+
});
|
|
40
|
+
export const GetPersonalizedRankingResponseFilterSensitiveLog = (obj) => ({
|
|
41
|
+
...obj,
|
|
42
|
+
...(obj.personalizedRanking && {
|
|
43
|
+
personalizedRanking: obj.personalizedRanking.map((item) => PredictedItemFilterSensitiveLog(item)),
|
|
44
|
+
}),
|
|
45
|
+
});
|
|
36
46
|
export const PromotionFilterSensitiveLog = (obj) => ({
|
|
37
47
|
...obj,
|
|
38
48
|
...(obj.filterValues && { filterValues: SENSITIVE_STRING }),
|
|
@@ -43,3 +53,7 @@ export const GetRecommendationsRequestFilterSensitiveLog = (obj) => ({
|
|
|
43
53
|
...(obj.filterValues && { filterValues: SENSITIVE_STRING }),
|
|
44
54
|
...(obj.promotions && { promotions: obj.promotions.map((item) => PromotionFilterSensitiveLog(item)) }),
|
|
45
55
|
});
|
|
56
|
+
export const GetRecommendationsResponseFilterSensitiveLog = (obj) => ({
|
|
57
|
+
...obj,
|
|
58
|
+
...(obj.itemList && { itemList: obj.itemList.map((item) => PredictedItemFilterSensitiveLog(item)) }),
|
|
59
|
+
});
|
|
@@ -68,6 +68,9 @@ declare const GetPersonalizedRankingCommand_base: {
|
|
|
68
68
|
* // metadata: { // Metadata
|
|
69
69
|
* // "<keys>": "STRING_VALUE",
|
|
70
70
|
* // },
|
|
71
|
+
* // reason: [ // ReasonList
|
|
72
|
+
* // "STRING_VALUE",
|
|
73
|
+
* // ],
|
|
71
74
|
* // },
|
|
72
75
|
* // ],
|
|
73
76
|
* // recommendationId: "STRING_VALUE",
|
|
@@ -190,6 +190,31 @@ export interface PredictedItem {
|
|
|
190
190
|
* @public
|
|
191
191
|
*/
|
|
192
192
|
metadata?: Record<string, string>;
|
|
193
|
+
/**
|
|
194
|
+
* <p>If you use User-Personalization-v2, a list of reasons for why the item was included in recommendations. Possible reasons include the following:</p>
|
|
195
|
+
* <ul>
|
|
196
|
+
* <li>
|
|
197
|
+
* <p>Promoted item - Indicates the item was included as part of a promotion that you applied in your recommendation request.</p>
|
|
198
|
+
* </li>
|
|
199
|
+
* <li>
|
|
200
|
+
* <p>Exploration - Indicates the item was included with exploration.
|
|
201
|
+
* With exploration, recommendations include items with less interactions data or relevance for the user.
|
|
202
|
+
* For more information about exploration, see
|
|
203
|
+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#about-exploration">Exploration</a>.</p>
|
|
204
|
+
* </li>
|
|
205
|
+
* <li>
|
|
206
|
+
* <p>
|
|
207
|
+
* Popular item - Indicates the item was included as a placeholder popular item.
|
|
208
|
+
* If you use a filter, depending on how many recommendations the filter removes,
|
|
209
|
+
* Amazon Personalize might add placeholder items to meet the <code>numResults</code> for your
|
|
210
|
+
* recommendation request. These items are popular items, based on interactions data, that satisfy your filter criteria.
|
|
211
|
+
* They don't have a relevance score for the user.
|
|
212
|
+
* </p>
|
|
213
|
+
* </li>
|
|
214
|
+
* </ul>
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
reason?: string[];
|
|
193
218
|
}
|
|
194
219
|
/**
|
|
195
220
|
* @public
|
|
@@ -345,6 +370,14 @@ export declare const GetActionRecommendationsRequestFilterSensitiveLog: (obj: Ge
|
|
|
345
370
|
* @internal
|
|
346
371
|
*/
|
|
347
372
|
export declare const GetPersonalizedRankingRequestFilterSensitiveLog: (obj: GetPersonalizedRankingRequest) => any;
|
|
373
|
+
/**
|
|
374
|
+
* @internal
|
|
375
|
+
*/
|
|
376
|
+
export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => any;
|
|
377
|
+
/**
|
|
378
|
+
* @internal
|
|
379
|
+
*/
|
|
380
|
+
export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
|
|
348
381
|
/**
|
|
349
382
|
* @internal
|
|
350
383
|
*/
|
|
@@ -353,3 +386,7 @@ export declare const PromotionFilterSensitiveLog: (obj: Promotion) => any;
|
|
|
353
386
|
* @internal
|
|
354
387
|
*/
|
|
355
388
|
export declare const GetRecommendationsRequestFilterSensitiveLog: (obj: GetRecommendationsRequest) => any;
|
|
389
|
+
/**
|
|
390
|
+
* @internal
|
|
391
|
+
*/
|
|
392
|
+
export declare const GetRecommendationsResponseFilterSensitiveLog: (obj: GetRecommendationsResponse) => any;
|
|
@@ -43,6 +43,7 @@ export interface PredictedItem {
|
|
|
43
43
|
score?: number;
|
|
44
44
|
promotionName?: string;
|
|
45
45
|
metadata?: Record<string, string>;
|
|
46
|
+
reason?: string[];
|
|
46
47
|
}
|
|
47
48
|
export interface GetPersonalizedRankingResponse {
|
|
48
49
|
personalizedRanking?: PredictedItem[];
|
|
@@ -76,7 +77,16 @@ export declare const GetActionRecommendationsRequestFilterSensitiveLog: (
|
|
|
76
77
|
export declare const GetPersonalizedRankingRequestFilterSensitiveLog: (
|
|
77
78
|
obj: GetPersonalizedRankingRequest
|
|
78
79
|
) => any;
|
|
80
|
+
export declare const PredictedItemFilterSensitiveLog: (
|
|
81
|
+
obj: PredictedItem
|
|
82
|
+
) => any;
|
|
83
|
+
export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (
|
|
84
|
+
obj: GetPersonalizedRankingResponse
|
|
85
|
+
) => any;
|
|
79
86
|
export declare const PromotionFilterSensitiveLog: (obj: Promotion) => any;
|
|
80
87
|
export declare const GetRecommendationsRequestFilterSensitiveLog: (
|
|
81
88
|
obj: GetRecommendationsRequest
|
|
82
89
|
) => any;
|
|
90
|
+
export declare const GetRecommendationsResponseFilterSensitiveLog: (
|
|
91
|
+
obj: GetRecommendationsResponse
|
|
92
|
+
) => any;
|
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.
|
|
4
|
+
"version": "3.567.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-personalize-runtime",
|
|
@@ -20,17 +20,17 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
22
22
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
23
|
-
"@aws-sdk/core": "3.
|
|
24
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
25
|
-
"@aws-sdk/middleware-host-header": "3.
|
|
26
|
-
"@aws-sdk/middleware-logger": "3.
|
|
27
|
-
"@aws-sdk/middleware-recursion-detection": "3.
|
|
28
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
29
|
-
"@aws-sdk/region-config-resolver": "3.
|
|
30
|
-
"@aws-sdk/types": "3.
|
|
31
|
-
"@aws-sdk/util-endpoints": "3.
|
|
32
|
-
"@aws-sdk/util-user-agent-browser": "3.
|
|
33
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
23
|
+
"@aws-sdk/core": "3.567.0",
|
|
24
|
+
"@aws-sdk/credential-provider-node": "3.567.0",
|
|
25
|
+
"@aws-sdk/middleware-host-header": "3.567.0",
|
|
26
|
+
"@aws-sdk/middleware-logger": "3.567.0",
|
|
27
|
+
"@aws-sdk/middleware-recursion-detection": "3.567.0",
|
|
28
|
+
"@aws-sdk/middleware-user-agent": "3.567.0",
|
|
29
|
+
"@aws-sdk/region-config-resolver": "3.567.0",
|
|
30
|
+
"@aws-sdk/types": "3.567.0",
|
|
31
|
+
"@aws-sdk/util-endpoints": "3.567.0",
|
|
32
|
+
"@aws-sdk/util-user-agent-browser": "3.567.0",
|
|
33
|
+
"@aws-sdk/util-user-agent-node": "3.567.0",
|
|
34
34
|
"@smithy/config-resolver": "^2.2.0",
|
|
35
35
|
"@smithy/core": "^1.4.2",
|
|
36
36
|
"@smithy/fetch-http-handler": "^2.5.0",
|
|
@@ -59,8 +59,7 @@
|
|
|
59
59
|
"tslib": "^2.6.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@
|
|
63
|
-
"@tsconfig/node14": "1.0.3",
|
|
62
|
+
"@tsconfig/node16": "16.1.3",
|
|
64
63
|
"@types/node": "^14.14.31",
|
|
65
64
|
"concurrently": "7.0.0",
|
|
66
65
|
"downlevel-dts": "0.10.1",
|
|
@@ -68,7 +67,7 @@
|
|
|
68
67
|
"typescript": "~4.9.5"
|
|
69
68
|
},
|
|
70
69
|
"engines": {
|
|
71
|
-
"node": ">=
|
|
70
|
+
"node": ">=16.0.0"
|
|
72
71
|
},
|
|
73
72
|
"typesVersions": {
|
|
74
73
|
"<4.0": {
|