@aws-sdk/client-personalize-runtime 3.142.0 → 3.150.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 +27 -0
- package/dist-cjs/models/models_0.js +7 -1
- package/dist-cjs/protocols/Aws_restJson1.js +19 -0
- package/dist-es/models/models_0.js +2 -1
- package/dist-es/protocols/Aws_restJson1.js +15 -2
- package/dist-types/models/models_0.d.ts +45 -1
- package/dist-types/ts3.4/models/models_0.d.ts +17 -0
- package/package.json +8 -3
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.150.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.149.0...v3.150.0) (2022-08-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aws-sdk/client-personalize-runtime
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.149.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.148.0...v3.149.0) (2022-08-12)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **client-personalize-runtime:** This release provides support for promotions in AWS Personalize runtime. ([f7e4104](https://github.com/aws/aws-sdk-js-v3/commit/f7e410466be43961aec27fa05f5e0aa3eae0df8b))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [3.145.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.144.0...v3.145.0) (2022-08-08)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @aws-sdk/client-personalize-runtime
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
# [3.142.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.141.0...v3.142.0) (2022-08-02)
|
|
7
34
|
|
|
8
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetRecommendationsResponseFilterSensitiveLog = exports.GetRecommendationsRequestFilterSensitiveLog = exports.GetPersonalizedRankingResponseFilterSensitiveLog = exports.PredictedItemFilterSensitiveLog = exports.GetPersonalizedRankingRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.InvalidInputException = void 0;
|
|
3
|
+
exports.GetRecommendationsResponseFilterSensitiveLog = exports.GetRecommendationsRequestFilterSensitiveLog = exports.PromotionFilterSensitiveLog = exports.GetPersonalizedRankingResponseFilterSensitiveLog = exports.PredictedItemFilterSensitiveLog = exports.GetPersonalizedRankingRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.InvalidInputException = void 0;
|
|
4
4
|
const smithy_client_1 = require("@aws-sdk/smithy-client");
|
|
5
5
|
const PersonalizeRuntimeServiceException_1 = require("./PersonalizeRuntimeServiceException");
|
|
6
6
|
class InvalidInputException extends PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException {
|
|
@@ -43,10 +43,16 @@ const GetPersonalizedRankingResponseFilterSensitiveLog = (obj) => ({
|
|
|
43
43
|
...obj,
|
|
44
44
|
});
|
|
45
45
|
exports.GetPersonalizedRankingResponseFilterSensitiveLog = GetPersonalizedRankingResponseFilterSensitiveLog;
|
|
46
|
+
const PromotionFilterSensitiveLog = (obj) => ({
|
|
47
|
+
...obj,
|
|
48
|
+
...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
|
|
49
|
+
});
|
|
50
|
+
exports.PromotionFilterSensitiveLog = PromotionFilterSensitiveLog;
|
|
46
51
|
const GetRecommendationsRequestFilterSensitiveLog = (obj) => ({
|
|
47
52
|
...obj,
|
|
48
53
|
...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
|
|
49
54
|
...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
|
|
55
|
+
...(obj.promotions && { promotions: obj.promotions.map((item) => (0, exports.PromotionFilterSensitiveLog)(item)) }),
|
|
50
56
|
});
|
|
51
57
|
exports.GetRecommendationsRequestFilterSensitiveLog = GetRecommendationsRequestFilterSensitiveLog;
|
|
52
58
|
const GetRecommendationsResponseFilterSensitiveLog = (obj) => ({
|
|
@@ -49,6 +49,7 @@ const serializeAws_restJson1GetRecommendationsCommand = async (input, context) =
|
|
|
49
49
|
}),
|
|
50
50
|
...(input.itemId != null && { itemId: input.itemId }),
|
|
51
51
|
...(input.numResults != null && { numResults: input.numResults }),
|
|
52
|
+
...(input.promotions != null && { promotions: serializeAws_restJson1PromotionList(input.promotions, context) }),
|
|
52
53
|
...(input.recommenderArn != null && { recommenderArn: input.recommenderArn }),
|
|
53
54
|
...(input.userId != null && { userId: input.userId }),
|
|
54
55
|
});
|
|
@@ -197,6 +198,23 @@ const serializeAws_restJson1InputList = (input, context) => {
|
|
|
197
198
|
return entry;
|
|
198
199
|
});
|
|
199
200
|
};
|
|
201
|
+
const serializeAws_restJson1Promotion = (input, context) => {
|
|
202
|
+
return {
|
|
203
|
+
...(input.filterArn != null && { filterArn: input.filterArn }),
|
|
204
|
+
...(input.filterValues != null && {
|
|
205
|
+
filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
|
|
206
|
+
}),
|
|
207
|
+
...(input.name != null && { name: input.name }),
|
|
208
|
+
...(input.percentPromotedItems != null && { percentPromotedItems: input.percentPromotedItems }),
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
const serializeAws_restJson1PromotionList = (input, context) => {
|
|
212
|
+
return input
|
|
213
|
+
.filter((e) => e != null)
|
|
214
|
+
.map((entry) => {
|
|
215
|
+
return serializeAws_restJson1Promotion(entry, context);
|
|
216
|
+
});
|
|
217
|
+
};
|
|
200
218
|
const deserializeAws_restJson1ItemList = (output, context) => {
|
|
201
219
|
const retVal = (output || [])
|
|
202
220
|
.filter((e) => e != null)
|
|
@@ -211,6 +229,7 @@ const deserializeAws_restJson1ItemList = (output, context) => {
|
|
|
211
229
|
const deserializeAws_restJson1PredictedItem = (output, context) => {
|
|
212
230
|
return {
|
|
213
231
|
itemId: (0, smithy_client_1.expectString)(output.itemId),
|
|
232
|
+
promotionName: (0, smithy_client_1.expectString)(output.promotionName),
|
|
214
233
|
score: (0, smithy_client_1.limitedParseDouble)(output.score),
|
|
215
234
|
};
|
|
216
235
|
};
|
|
@@ -28,5 +28,6 @@ export { ResourceNotFoundException };
|
|
|
28
28
|
export var GetPersonalizedRankingRequestFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
|
|
29
29
|
export var PredictedItemFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
30
30
|
export var GetPersonalizedRankingResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
31
|
-
export var
|
|
31
|
+
export var PromotionFilterSensitiveLog = function (obj) { return (__assign(__assign({}, obj), (obj.filterValues && { filterValues: SENSITIVE_STRING }))); };
|
|
32
|
+
export var GetRecommendationsRequestFilterSensitiveLog = function (obj) { return (__assign(__assign(__assign(__assign({}, obj), (obj.context && { context: SENSITIVE_STRING })), (obj.filterValues && { filterValues: SENSITIVE_STRING })), (obj.promotions && { promotions: obj.promotions.map(function (item) { return PromotionFilterSensitiveLog(item); }) }))); };
|
|
32
33
|
export var GetRecommendationsResponseFilterSensitiveLog = function (obj) { return (__assign({}, obj)); };
|
|
@@ -40,9 +40,9 @@ export var serializeAws_restJson1GetRecommendationsCommand = function (input, co
|
|
|
40
40
|
"content-type": "application/json",
|
|
41
41
|
};
|
|
42
42
|
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/recommendations";
|
|
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 && {
|
|
43
|
+
body = JSON.stringify(__assign(__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
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 })));
|
|
45
|
+
})), (input.itemId != null && { itemId: input.itemId })), (input.numResults != null && { numResults: input.numResults })), (input.promotions != null && { promotions: serializeAws_restJson1PromotionList(input.promotions, context) })), (input.recommenderArn != null && { recommenderArn: input.recommenderArn })), (input.userId != null && { userId: input.userId })));
|
|
46
46
|
return [2, new __HttpRequest({
|
|
47
47
|
protocol: protocol,
|
|
48
48
|
hostname: hostname,
|
|
@@ -233,6 +233,18 @@ var serializeAws_restJson1InputList = function (input, context) {
|
|
|
233
233
|
return entry;
|
|
234
234
|
});
|
|
235
235
|
};
|
|
236
|
+
var serializeAws_restJson1Promotion = function (input, context) {
|
|
237
|
+
return __assign(__assign(__assign(__assign({}, (input.filterArn != null && { filterArn: input.filterArn })), (input.filterValues != null && {
|
|
238
|
+
filterValues: serializeAws_restJson1FilterValues(input.filterValues, context),
|
|
239
|
+
})), (input.name != null && { name: input.name })), (input.percentPromotedItems != null && { percentPromotedItems: input.percentPromotedItems }));
|
|
240
|
+
};
|
|
241
|
+
var serializeAws_restJson1PromotionList = function (input, context) {
|
|
242
|
+
return input
|
|
243
|
+
.filter(function (e) { return e != null; })
|
|
244
|
+
.map(function (entry) {
|
|
245
|
+
return serializeAws_restJson1Promotion(entry, context);
|
|
246
|
+
});
|
|
247
|
+
};
|
|
236
248
|
var deserializeAws_restJson1ItemList = function (output, context) {
|
|
237
249
|
var retVal = (output || [])
|
|
238
250
|
.filter(function (e) { return e != null; })
|
|
@@ -247,6 +259,7 @@ var deserializeAws_restJson1ItemList = function (output, context) {
|
|
|
247
259
|
var deserializeAws_restJson1PredictedItem = function (output, context) {
|
|
248
260
|
return {
|
|
249
261
|
itemId: __expectString(output.itemId),
|
|
262
|
+
promotionName: __expectString(output.promotionName),
|
|
250
263
|
score: __limitedParseDouble(output.score),
|
|
251
264
|
};
|
|
252
265
|
};
|
|
@@ -56,6 +56,10 @@ export interface PredictedItem {
|
|
|
56
56
|
* selection. For more information on scoring logic, see <a>how-scores-work</a>.</p>
|
|
57
57
|
*/
|
|
58
58
|
score?: number;
|
|
59
|
+
/**
|
|
60
|
+
* <p>The name of the promotion that included the predicted item.</p>
|
|
61
|
+
*/
|
|
62
|
+
promotionName?: string;
|
|
59
63
|
}
|
|
60
64
|
export interface GetPersonalizedRankingResponse {
|
|
61
65
|
/**
|
|
@@ -89,6 +93,37 @@ export declare class ResourceNotFoundException extends __BaseException {
|
|
|
89
93
|
*/
|
|
90
94
|
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
|
|
91
95
|
}
|
|
96
|
+
/**
|
|
97
|
+
* <p>Contains information on a promotion. A promotion defines additional business rules that apply to a configurable subset of recommended items.</p>
|
|
98
|
+
*/
|
|
99
|
+
export interface Promotion {
|
|
100
|
+
/**
|
|
101
|
+
* <p>The name of the promotion.</p>
|
|
102
|
+
*/
|
|
103
|
+
name?: string;
|
|
104
|
+
/**
|
|
105
|
+
* <p>The percentage of recommended items to apply the promotion to.</p>
|
|
106
|
+
*/
|
|
107
|
+
percentPromotedItems?: number;
|
|
108
|
+
/**
|
|
109
|
+
* <p>The Amazon Resource Name (ARN) of the filter used by the promotion. This filter defines the criteria for promoted items. For more information, see
|
|
110
|
+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/promoting-items.html#promotion-filters">Promotion filters</a>.</p>
|
|
111
|
+
*/
|
|
112
|
+
filterArn?: string;
|
|
113
|
+
/**
|
|
114
|
+
* <p>The values to use when promoting items.
|
|
115
|
+
* For each placeholder parameter in your promotion's filter expression, provide the parameter name (in matching case) as a key and the filter value(s) as the corresponding value. Separate multiple values for one parameter with a comma.
|
|
116
|
+
* </p>
|
|
117
|
+
* <p>For filter expressions that use an <code>INCLUDE</code> element to include items,
|
|
118
|
+
* you must provide values for all parameters that are defined in the expression. For
|
|
119
|
+
* filters with expressions that use an <code>EXCLUDE</code> element to exclude items, you
|
|
120
|
+
* can omit the <code>filter-values</code>. In this case, Amazon Personalize doesn't use that portion of
|
|
121
|
+
* the expression to filter recommendations.</p>
|
|
122
|
+
* <p>For more information on creating filters, see
|
|
123
|
+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/filter.html">Filtering recommendations and user segments</a>.</p>
|
|
124
|
+
*/
|
|
125
|
+
filterValues?: Record<string, string>;
|
|
126
|
+
}
|
|
92
127
|
export interface GetRecommendationsRequest {
|
|
93
128
|
/**
|
|
94
129
|
* <p>The Amazon Resource Name (ARN) of the campaign to use for getting recommendations.</p>
|
|
@@ -130,7 +165,7 @@ export interface GetRecommendationsRequest {
|
|
|
130
165
|
* can omit the <code>filter-values</code>.In this case, Amazon Personalize doesn't use that portion of
|
|
131
166
|
* the expression to filter recommendations.</p>
|
|
132
167
|
* <p>For more information, see
|
|
133
|
-
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/filter.html">Filtering
|
|
168
|
+
* <a href="https://docs.aws.amazon.com/personalize/latest/dg/filter.html">Filtering recommendations and user segments</a>.</p>
|
|
134
169
|
*/
|
|
135
170
|
filterValues?: Record<string, string>;
|
|
136
171
|
/**
|
|
@@ -138,6 +173,11 @@ export interface GetRecommendationsRequest {
|
|
|
138
173
|
* created a Domain dataset group with a recommender for a domain use case.</p>
|
|
139
174
|
*/
|
|
140
175
|
recommenderArn?: string;
|
|
176
|
+
/**
|
|
177
|
+
* <p>The promotions to apply to the recommendation request.
|
|
178
|
+
* A promotion defines additional business rules that apply to a configurable subset of recommended items.</p>
|
|
179
|
+
*/
|
|
180
|
+
promotions?: Promotion[];
|
|
141
181
|
}
|
|
142
182
|
export interface GetRecommendationsResponse {
|
|
143
183
|
/**
|
|
@@ -162,6 +202,10 @@ export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => an
|
|
|
162
202
|
* @internal
|
|
163
203
|
*/
|
|
164
204
|
export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
|
|
205
|
+
/**
|
|
206
|
+
* @internal
|
|
207
|
+
*/
|
|
208
|
+
export declare const PromotionFilterSensitiveLog: (obj: Promotion) => any;
|
|
165
209
|
/**
|
|
166
210
|
* @internal
|
|
167
211
|
*/
|
|
@@ -20,6 +20,8 @@ export interface PredictedItem {
|
|
|
20
20
|
itemId?: string;
|
|
21
21
|
|
|
22
22
|
score?: number;
|
|
23
|
+
|
|
24
|
+
promotionName?: string;
|
|
23
25
|
}
|
|
24
26
|
export interface GetPersonalizedRankingResponse {
|
|
25
27
|
|
|
@@ -41,6 +43,17 @@ export declare class ResourceNotFoundException extends __BaseException {
|
|
|
41
43
|
|
|
42
44
|
constructor(opts: __ExceptionOptionType<ResourceNotFoundException, __BaseException>);
|
|
43
45
|
}
|
|
46
|
+
|
|
47
|
+
export interface Promotion {
|
|
48
|
+
|
|
49
|
+
name?: string;
|
|
50
|
+
|
|
51
|
+
percentPromotedItems?: number;
|
|
52
|
+
|
|
53
|
+
filterArn?: string;
|
|
54
|
+
|
|
55
|
+
filterValues?: Record<string, string>;
|
|
56
|
+
}
|
|
44
57
|
export interface GetRecommendationsRequest {
|
|
45
58
|
|
|
46
59
|
campaignArn?: string;
|
|
@@ -58,6 +71,8 @@ export interface GetRecommendationsRequest {
|
|
|
58
71
|
filterValues?: Record<string, string>;
|
|
59
72
|
|
|
60
73
|
recommenderArn?: string;
|
|
74
|
+
|
|
75
|
+
promotions?: Promotion[];
|
|
61
76
|
}
|
|
62
77
|
export interface GetRecommendationsResponse {
|
|
63
78
|
|
|
@@ -72,6 +87,8 @@ export declare const PredictedItemFilterSensitiveLog: (obj: PredictedItem) => an
|
|
|
72
87
|
|
|
73
88
|
export declare const GetPersonalizedRankingResponseFilterSensitiveLog: (obj: GetPersonalizedRankingResponse) => any;
|
|
74
89
|
|
|
90
|
+
export declare const PromotionFilterSensitiveLog: (obj: Promotion) => any;
|
|
91
|
+
|
|
75
92
|
export declare const GetRecommendationsRequestFilterSensitiveLog: (obj: GetRecommendationsRequest) => any;
|
|
76
93
|
|
|
77
94
|
export declare const GetRecommendationsResponseFilterSensitiveLog: (obj: GetRecommendationsResponse) => 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.150.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,9 +18,9 @@
|
|
|
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.
|
|
21
|
+
"@aws-sdk/client-sts": "3.150.0",
|
|
22
22
|
"@aws-sdk/config-resolver": "3.130.0",
|
|
23
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
23
|
+
"@aws-sdk/credential-provider-node": "3.150.0",
|
|
24
24
|
"@aws-sdk/fetch-http-handler": "3.131.0",
|
|
25
25
|
"@aws-sdk/hash-node": "3.127.0",
|
|
26
26
|
"@aws-sdk/invalid-dependency": "3.127.0",
|
|
@@ -61,6 +61,11 @@
|
|
|
61
61
|
"typedoc": "0.19.2",
|
|
62
62
|
"typescript": "~4.6.2"
|
|
63
63
|
},
|
|
64
|
+
"overrides": {
|
|
65
|
+
"typedoc": {
|
|
66
|
+
"typescript": "~4.6.2"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
64
69
|
"engines": {
|
|
65
70
|
"node": ">=12.0.0"
|
|
66
71
|
},
|