@aws-sdk/client-personalize-runtime 3.493.0 → 3.495.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/PersonalizeRuntime.js +1 -17
- package/dist-cjs/PersonalizeRuntimeClient.js +1 -43
- package/dist-cjs/commands/GetActionRecommendationsCommand.js +1 -29
- package/dist-cjs/commands/GetPersonalizedRankingCommand.js +1 -29
- package/dist-cjs/commands/GetRecommendationsCommand.js +1 -29
- package/dist-cjs/commands/index.js +1 -6
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +560 -10
- package/dist-cjs/models/PersonalizeRuntimeServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -54
- package/dist-cjs/protocols/Aws_restJson1.js +1 -291
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +40 -40
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PersonalizeRuntime = void 0;
|
|
4
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
-
const GetActionRecommendationsCommand_1 = require("./commands/GetActionRecommendationsCommand");
|
|
6
|
-
const GetPersonalizedRankingCommand_1 = require("./commands/GetPersonalizedRankingCommand");
|
|
7
|
-
const GetRecommendationsCommand_1 = require("./commands/GetRecommendationsCommand");
|
|
8
|
-
const PersonalizeRuntimeClient_1 = require("./PersonalizeRuntimeClient");
|
|
9
|
-
const commands = {
|
|
10
|
-
GetActionRecommendationsCommand: GetActionRecommendationsCommand_1.GetActionRecommendationsCommand,
|
|
11
|
-
GetPersonalizedRankingCommand: GetPersonalizedRankingCommand_1.GetPersonalizedRankingCommand,
|
|
12
|
-
GetRecommendationsCommand: GetRecommendationsCommand_1.GetRecommendationsCommand,
|
|
13
|
-
};
|
|
14
|
-
class PersonalizeRuntime extends PersonalizeRuntimeClient_1.PersonalizeRuntimeClient {
|
|
15
|
-
}
|
|
16
|
-
exports.PersonalizeRuntime = PersonalizeRuntime;
|
|
17
|
-
(0, smithy_client_1.createAggregatedClient)(commands, PersonalizeRuntime);
|
|
1
|
+
module.exports = require("./index.js");
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PersonalizeRuntimeClient = exports.__Client = void 0;
|
|
4
|
-
const middleware_host_header_1 = require("@aws-sdk/middleware-host-header");
|
|
5
|
-
const middleware_logger_1 = require("@aws-sdk/middleware-logger");
|
|
6
|
-
const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-detection");
|
|
7
|
-
const middleware_signing_1 = require("@aws-sdk/middleware-signing");
|
|
8
|
-
const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
|
|
9
|
-
const config_resolver_1 = require("@smithy/config-resolver");
|
|
10
|
-
const middleware_content_length_1 = require("@smithy/middleware-content-length");
|
|
11
|
-
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
12
|
-
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
13
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
14
|
-
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
|
|
15
|
-
const EndpointParameters_1 = require("./endpoint/EndpointParameters");
|
|
16
|
-
const runtimeConfig_1 = require("./runtimeConfig");
|
|
17
|
-
const runtimeExtensions_1 = require("./runtimeExtensions");
|
|
18
|
-
class PersonalizeRuntimeClient extends smithy_client_1.Client {
|
|
19
|
-
constructor(...[configuration]) {
|
|
20
|
-
const _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
|
|
21
|
-
const _config_1 = (0, EndpointParameters_1.resolveClientEndpointParameters)(_config_0);
|
|
22
|
-
const _config_2 = (0, config_resolver_1.resolveRegionConfig)(_config_1);
|
|
23
|
-
const _config_3 = (0, middleware_endpoint_1.resolveEndpointConfig)(_config_2);
|
|
24
|
-
const _config_4 = (0, middleware_retry_1.resolveRetryConfig)(_config_3);
|
|
25
|
-
const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
|
|
26
|
-
const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5);
|
|
27
|
-
const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6);
|
|
28
|
-
const _config_8 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_7, configuration?.extensions || []);
|
|
29
|
-
super(_config_8);
|
|
30
|
-
this.config = _config_8;
|
|
31
|
-
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
|
|
32
|
-
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
|
33
|
-
this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
|
|
34
|
-
this.middlewareStack.use((0, middleware_logger_1.getLoggerPlugin)(this.config));
|
|
35
|
-
this.middlewareStack.use((0, middleware_recursion_detection_1.getRecursionDetectionPlugin)(this.config));
|
|
36
|
-
this.middlewareStack.use((0, middleware_signing_1.getAwsAuthPlugin)(this.config));
|
|
37
|
-
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
38
|
-
}
|
|
39
|
-
destroy() {
|
|
40
|
-
super.destroy();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.PersonalizeRuntimeClient = PersonalizeRuntimeClient;
|
|
1
|
+
module.exports = require("./index.js");
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetActionRecommendationsCommand = exports.$Command = void 0;
|
|
4
|
-
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
-
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
-
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
-
const EndpointParameters_1 = require("../endpoint/EndpointParameters");
|
|
9
|
-
const models_0_1 = require("../models/models_0");
|
|
10
|
-
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
11
|
-
class GetActionRecommendationsCommand extends smithy_client_1.Command
|
|
12
|
-
.classBuilder()
|
|
13
|
-
.ep({
|
|
14
|
-
...EndpointParameters_1.commonParams,
|
|
15
|
-
})
|
|
16
|
-
.m(function (Command, cs, config, o) {
|
|
17
|
-
return [
|
|
18
|
-
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
19
|
-
(0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
|
|
20
|
-
];
|
|
21
|
-
})
|
|
22
|
-
.s("AmazonPersonalizeRuntime", "GetActionRecommendations", {})
|
|
23
|
-
.n("PersonalizeRuntimeClient", "GetActionRecommendationsCommand")
|
|
24
|
-
.f(models_0_1.GetActionRecommendationsRequestFilterSensitiveLog, void 0)
|
|
25
|
-
.ser(Aws_restJson1_1.se_GetActionRecommendationsCommand)
|
|
26
|
-
.de(Aws_restJson1_1.de_GetActionRecommendationsCommand)
|
|
27
|
-
.build() {
|
|
28
|
-
}
|
|
29
|
-
exports.GetActionRecommendationsCommand = GetActionRecommendationsCommand;
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetPersonalizedRankingCommand = exports.$Command = void 0;
|
|
4
|
-
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
-
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
-
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
-
const EndpointParameters_1 = require("../endpoint/EndpointParameters");
|
|
9
|
-
const models_0_1 = require("../models/models_0");
|
|
10
|
-
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
11
|
-
class GetPersonalizedRankingCommand extends smithy_client_1.Command
|
|
12
|
-
.classBuilder()
|
|
13
|
-
.ep({
|
|
14
|
-
...EndpointParameters_1.commonParams,
|
|
15
|
-
})
|
|
16
|
-
.m(function (Command, cs, config, o) {
|
|
17
|
-
return [
|
|
18
|
-
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
19
|
-
(0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
|
|
20
|
-
];
|
|
21
|
-
})
|
|
22
|
-
.s("AmazonPersonalizeRuntime", "GetPersonalizedRanking", {})
|
|
23
|
-
.n("PersonalizeRuntimeClient", "GetPersonalizedRankingCommand")
|
|
24
|
-
.f(models_0_1.GetPersonalizedRankingRequestFilterSensitiveLog, void 0)
|
|
25
|
-
.ser(Aws_restJson1_1.se_GetPersonalizedRankingCommand)
|
|
26
|
-
.de(Aws_restJson1_1.de_GetPersonalizedRankingCommand)
|
|
27
|
-
.build() {
|
|
28
|
-
}
|
|
29
|
-
exports.GetPersonalizedRankingCommand = GetPersonalizedRankingCommand;
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetRecommendationsCommand = exports.$Command = void 0;
|
|
4
|
-
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
-
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
-
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
-
const EndpointParameters_1 = require("../endpoint/EndpointParameters");
|
|
9
|
-
const models_0_1 = require("../models/models_0");
|
|
10
|
-
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
11
|
-
class GetRecommendationsCommand extends smithy_client_1.Command
|
|
12
|
-
.classBuilder()
|
|
13
|
-
.ep({
|
|
14
|
-
...EndpointParameters_1.commonParams,
|
|
15
|
-
})
|
|
16
|
-
.m(function (Command, cs, config, o) {
|
|
17
|
-
return [
|
|
18
|
-
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
19
|
-
(0, middleware_endpoint_1.getEndpointPlugin)(config, Command.getEndpointParameterInstructions()),
|
|
20
|
-
];
|
|
21
|
-
})
|
|
22
|
-
.s("AmazonPersonalizeRuntime", "GetRecommendations", {})
|
|
23
|
-
.n("PersonalizeRuntimeClient", "GetRecommendationsCommand")
|
|
24
|
-
.f(models_0_1.GetRecommendationsRequestFilterSensitiveLog, void 0)
|
|
25
|
-
.ser(Aws_restJson1_1.se_GetRecommendationsCommand)
|
|
26
|
-
.de(Aws_restJson1_1.de_GetRecommendationsCommand)
|
|
27
|
-
.build() {
|
|
28
|
-
}
|
|
29
|
-
exports.GetRecommendationsCommand = GetRecommendationsCommand;
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./GetActionRecommendationsCommand"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./GetPersonalizedRankingCommand"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./GetRecommendationsCommand"), exports);
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.commonParams = exports.resolveClientEndpointParameters = void 0;
|
|
4
|
-
const resolveClientEndpointParameters = (options) => {
|
|
5
|
-
return {
|
|
6
|
-
...options,
|
|
7
|
-
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
8
|
-
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
9
|
-
defaultSigningName: "personalize",
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
exports.resolveClientEndpointParameters = resolveClientEndpointParameters;
|
|
13
|
-
exports.commonParams = {
|
|
14
|
-
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
15
|
-
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
16
|
-
Region: { type: "builtInParams", name: "region" },
|
|
17
|
-
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
18
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
module.exports = require("./index.js");
|
package/dist-cjs/index.js
CHANGED
|
@@ -1,11 +1,561 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/index.ts
|
|
22
|
+
var src_exports = {};
|
|
23
|
+
__export(src_exports, {
|
|
24
|
+
GetActionRecommendationsCommand: () => GetActionRecommendationsCommand,
|
|
25
|
+
GetActionRecommendationsRequestFilterSensitiveLog: () => GetActionRecommendationsRequestFilterSensitiveLog,
|
|
26
|
+
GetPersonalizedRankingCommand: () => GetPersonalizedRankingCommand,
|
|
27
|
+
GetPersonalizedRankingRequestFilterSensitiveLog: () => GetPersonalizedRankingRequestFilterSensitiveLog,
|
|
28
|
+
GetRecommendationsCommand: () => GetRecommendationsCommand,
|
|
29
|
+
GetRecommendationsRequestFilterSensitiveLog: () => GetRecommendationsRequestFilterSensitiveLog,
|
|
30
|
+
InvalidInputException: () => InvalidInputException,
|
|
31
|
+
PersonalizeRuntime: () => PersonalizeRuntime,
|
|
32
|
+
PersonalizeRuntimeClient: () => PersonalizeRuntimeClient,
|
|
33
|
+
PersonalizeRuntimeServiceException: () => PersonalizeRuntimeServiceException,
|
|
34
|
+
PromotionFilterSensitiveLog: () => PromotionFilterSensitiveLog,
|
|
35
|
+
ResourceNotFoundException: () => ResourceNotFoundException,
|
|
36
|
+
__Client: () => import_smithy_client.Client
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(src_exports);
|
|
39
|
+
|
|
40
|
+
// src/PersonalizeRuntimeClient.ts
|
|
41
|
+
var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
|
|
42
|
+
var import_middleware_logger = require("@aws-sdk/middleware-logger");
|
|
43
|
+
var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
|
|
44
|
+
var import_middleware_signing = require("@aws-sdk/middleware-signing");
|
|
45
|
+
var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
|
|
46
|
+
var import_config_resolver = require("@smithy/config-resolver");
|
|
47
|
+
var import_middleware_content_length = require("@smithy/middleware-content-length");
|
|
48
|
+
var import_middleware_endpoint = require("@smithy/middleware-endpoint");
|
|
49
|
+
var import_middleware_retry = require("@smithy/middleware-retry");
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
// src/endpoint/EndpointParameters.ts
|
|
53
|
+
var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
|
|
54
|
+
return {
|
|
55
|
+
...options,
|
|
56
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
57
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
58
|
+
defaultSigningName: "personalize"
|
|
59
|
+
};
|
|
60
|
+
}, "resolveClientEndpointParameters");
|
|
61
|
+
var commonParams = {
|
|
62
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
63
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
64
|
+
Region: { type: "builtInParams", name: "region" },
|
|
65
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/PersonalizeRuntimeClient.ts
|
|
69
|
+
var import_runtimeConfig = require("././runtimeConfig");
|
|
70
|
+
|
|
71
|
+
// src/runtimeExtensions.ts
|
|
72
|
+
var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
|
|
73
|
+
var import_protocol_http = require("@smithy/protocol-http");
|
|
74
|
+
var import_smithy_client = require("@smithy/smithy-client");
|
|
75
|
+
var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
|
|
76
|
+
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
|
|
77
|
+
const extensionConfiguration = {
|
|
78
|
+
...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
|
|
79
|
+
...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
80
|
+
...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
|
|
81
|
+
};
|
|
82
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
83
|
+
return {
|
|
84
|
+
...runtimeConfig,
|
|
85
|
+
...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
86
|
+
...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
87
|
+
...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
|
|
88
|
+
};
|
|
89
|
+
}, "resolveRuntimeExtensions");
|
|
90
|
+
|
|
91
|
+
// src/PersonalizeRuntimeClient.ts
|
|
92
|
+
var _PersonalizeRuntimeClient = class _PersonalizeRuntimeClient extends import_smithy_client.Client {
|
|
93
|
+
constructor(...[configuration]) {
|
|
94
|
+
const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
|
|
95
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
96
|
+
const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
|
|
97
|
+
const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
|
|
98
|
+
const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
|
|
99
|
+
const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
|
|
100
|
+
const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
|
|
101
|
+
const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
|
|
102
|
+
const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
|
|
103
|
+
super(_config_8);
|
|
104
|
+
this.config = _config_8;
|
|
105
|
+
this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
|
|
106
|
+
this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
|
|
107
|
+
this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
|
|
108
|
+
this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
|
|
109
|
+
this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
|
|
110
|
+
this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
|
|
111
|
+
this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Destroy underlying resources, like sockets. It's usually not necessary to do this.
|
|
115
|
+
* However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
|
|
116
|
+
* Otherwise, sockets might stay open for quite a long time before the server terminates them.
|
|
117
|
+
*/
|
|
118
|
+
destroy() {
|
|
119
|
+
super.destroy();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
__name(_PersonalizeRuntimeClient, "PersonalizeRuntimeClient");
|
|
123
|
+
var PersonalizeRuntimeClient = _PersonalizeRuntimeClient;
|
|
124
|
+
|
|
125
|
+
// src/PersonalizeRuntime.ts
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
// src/commands/GetActionRecommendationsCommand.ts
|
|
129
|
+
|
|
130
|
+
var import_middleware_serde = require("@smithy/middleware-serde");
|
|
131
|
+
|
|
132
|
+
var import_types = require("@smithy/types");
|
|
133
|
+
|
|
134
|
+
// src/models/models_0.ts
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
// src/models/PersonalizeRuntimeServiceException.ts
|
|
138
|
+
|
|
139
|
+
var _PersonalizeRuntimeServiceException = class _PersonalizeRuntimeServiceException extends import_smithy_client.ServiceException {
|
|
140
|
+
/**
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
constructor(options) {
|
|
144
|
+
super(options);
|
|
145
|
+
Object.setPrototypeOf(this, _PersonalizeRuntimeServiceException.prototype);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
__name(_PersonalizeRuntimeServiceException, "PersonalizeRuntimeServiceException");
|
|
149
|
+
var PersonalizeRuntimeServiceException = _PersonalizeRuntimeServiceException;
|
|
150
|
+
|
|
151
|
+
// src/models/models_0.ts
|
|
152
|
+
var _InvalidInputException = class _InvalidInputException extends PersonalizeRuntimeServiceException {
|
|
153
|
+
/**
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
constructor(opts) {
|
|
157
|
+
super({
|
|
158
|
+
name: "InvalidInputException",
|
|
159
|
+
$fault: "client",
|
|
160
|
+
...opts
|
|
161
|
+
});
|
|
162
|
+
this.name = "InvalidInputException";
|
|
163
|
+
this.$fault = "client";
|
|
164
|
+
Object.setPrototypeOf(this, _InvalidInputException.prototype);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
__name(_InvalidInputException, "InvalidInputException");
|
|
168
|
+
var InvalidInputException = _InvalidInputException;
|
|
169
|
+
var _ResourceNotFoundException = class _ResourceNotFoundException extends PersonalizeRuntimeServiceException {
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
constructor(opts) {
|
|
174
|
+
super({
|
|
175
|
+
name: "ResourceNotFoundException",
|
|
176
|
+
$fault: "client",
|
|
177
|
+
...opts
|
|
178
|
+
});
|
|
179
|
+
this.name = "ResourceNotFoundException";
|
|
180
|
+
this.$fault = "client";
|
|
181
|
+
Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
__name(_ResourceNotFoundException, "ResourceNotFoundException");
|
|
185
|
+
var ResourceNotFoundException = _ResourceNotFoundException;
|
|
186
|
+
var GetActionRecommendationsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
187
|
+
...obj,
|
|
188
|
+
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING }
|
|
189
|
+
}), "GetActionRecommendationsRequestFilterSensitiveLog");
|
|
190
|
+
var GetPersonalizedRankingRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
191
|
+
...obj,
|
|
192
|
+
...obj.context && { context: import_smithy_client.SENSITIVE_STRING },
|
|
193
|
+
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING }
|
|
194
|
+
}), "GetPersonalizedRankingRequestFilterSensitiveLog");
|
|
195
|
+
var PromotionFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
196
|
+
...obj,
|
|
197
|
+
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING }
|
|
198
|
+
}), "PromotionFilterSensitiveLog");
|
|
199
|
+
var GetRecommendationsRequestFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
200
|
+
...obj,
|
|
201
|
+
...obj.context && { context: import_smithy_client.SENSITIVE_STRING },
|
|
202
|
+
...obj.filterValues && { filterValues: import_smithy_client.SENSITIVE_STRING },
|
|
203
|
+
...obj.promotions && { promotions: obj.promotions.map((item) => PromotionFilterSensitiveLog(item)) }
|
|
204
|
+
}), "GetRecommendationsRequestFilterSensitiveLog");
|
|
205
|
+
|
|
206
|
+
// src/protocols/Aws_restJson1.ts
|
|
207
|
+
var import_core = require("@smithy/core");
|
|
208
|
+
|
|
209
|
+
var se_GetActionRecommendationsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
210
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
211
|
+
const headers = {
|
|
212
|
+
"content-type": "application/json"
|
|
213
|
+
};
|
|
214
|
+
b.bp("/action-recommendations");
|
|
215
|
+
let body;
|
|
216
|
+
body = JSON.stringify(
|
|
217
|
+
(0, import_smithy_client.take)(input, {
|
|
218
|
+
campaignArn: [],
|
|
219
|
+
filterArn: [],
|
|
220
|
+
filterValues: (_) => (0, import_smithy_client._json)(_),
|
|
221
|
+
numResults: [],
|
|
222
|
+
userId: []
|
|
223
|
+
})
|
|
224
|
+
);
|
|
225
|
+
b.m("POST").h(headers).b(body);
|
|
226
|
+
return b.build();
|
|
227
|
+
}, "se_GetActionRecommendationsCommand");
|
|
228
|
+
var se_GetPersonalizedRankingCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
229
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
230
|
+
const headers = {
|
|
231
|
+
"content-type": "application/json"
|
|
232
|
+
};
|
|
233
|
+
b.bp("/personalize-ranking");
|
|
234
|
+
let body;
|
|
235
|
+
body = JSON.stringify(
|
|
236
|
+
(0, import_smithy_client.take)(input, {
|
|
237
|
+
campaignArn: [],
|
|
238
|
+
context: (_) => (0, import_smithy_client._json)(_),
|
|
239
|
+
filterArn: [],
|
|
240
|
+
filterValues: (_) => (0, import_smithy_client._json)(_),
|
|
241
|
+
inputList: (_) => (0, import_smithy_client._json)(_),
|
|
242
|
+
metadataColumns: (_) => (0, import_smithy_client._json)(_),
|
|
243
|
+
userId: []
|
|
244
|
+
})
|
|
245
|
+
);
|
|
246
|
+
b.m("POST").h(headers).b(body);
|
|
247
|
+
return b.build();
|
|
248
|
+
}, "se_GetPersonalizedRankingCommand");
|
|
249
|
+
var se_GetRecommendationsCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
250
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
251
|
+
const headers = {
|
|
252
|
+
"content-type": "application/json"
|
|
253
|
+
};
|
|
254
|
+
b.bp("/recommendations");
|
|
255
|
+
let body;
|
|
256
|
+
body = JSON.stringify(
|
|
257
|
+
(0, import_smithy_client.take)(input, {
|
|
258
|
+
campaignArn: [],
|
|
259
|
+
context: (_) => (0, import_smithy_client._json)(_),
|
|
260
|
+
filterArn: [],
|
|
261
|
+
filterValues: (_) => (0, import_smithy_client._json)(_),
|
|
262
|
+
itemId: [],
|
|
263
|
+
metadataColumns: (_) => (0, import_smithy_client._json)(_),
|
|
264
|
+
numResults: [],
|
|
265
|
+
promotions: (_) => (0, import_smithy_client._json)(_),
|
|
266
|
+
recommenderArn: [],
|
|
267
|
+
userId: []
|
|
268
|
+
})
|
|
269
|
+
);
|
|
270
|
+
b.m("POST").h(headers).b(body);
|
|
271
|
+
return b.build();
|
|
272
|
+
}, "se_GetRecommendationsCommand");
|
|
273
|
+
var de_GetActionRecommendationsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
274
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
275
|
+
return de_GetActionRecommendationsCommandError(output, context);
|
|
276
|
+
}
|
|
277
|
+
const contents = (0, import_smithy_client.map)({
|
|
278
|
+
$metadata: deserializeMetadata(output)
|
|
279
|
+
});
|
|
280
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
281
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
282
|
+
actionList: (_) => de_ActionList(_, context),
|
|
283
|
+
recommendationId: import_smithy_client.expectString
|
|
284
|
+
});
|
|
285
|
+
Object.assign(contents, doc);
|
|
286
|
+
return contents;
|
|
287
|
+
}, "de_GetActionRecommendationsCommand");
|
|
288
|
+
var de_GetActionRecommendationsCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
289
|
+
const parsedOutput = {
|
|
290
|
+
...output,
|
|
291
|
+
body: await parseErrorBody(output.body, context)
|
|
292
|
+
};
|
|
293
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
294
|
+
switch (errorCode) {
|
|
295
|
+
case "InvalidInputException":
|
|
296
|
+
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
297
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
298
|
+
case "ResourceNotFoundException":
|
|
299
|
+
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
300
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
301
|
+
default:
|
|
302
|
+
const parsedBody = parsedOutput.body;
|
|
303
|
+
return throwDefaultError({
|
|
304
|
+
output,
|
|
305
|
+
parsedBody,
|
|
306
|
+
errorCode
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}, "de_GetActionRecommendationsCommandError");
|
|
310
|
+
var de_GetPersonalizedRankingCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
311
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
312
|
+
return de_GetPersonalizedRankingCommandError(output, context);
|
|
313
|
+
}
|
|
314
|
+
const contents = (0, import_smithy_client.map)({
|
|
315
|
+
$metadata: deserializeMetadata(output)
|
|
316
|
+
});
|
|
317
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
318
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
319
|
+
personalizedRanking: (_) => de_ItemList(_, context),
|
|
320
|
+
recommendationId: import_smithy_client.expectString
|
|
321
|
+
});
|
|
322
|
+
Object.assign(contents, doc);
|
|
323
|
+
return contents;
|
|
324
|
+
}, "de_GetPersonalizedRankingCommand");
|
|
325
|
+
var de_GetPersonalizedRankingCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
326
|
+
const parsedOutput = {
|
|
327
|
+
...output,
|
|
328
|
+
body: await parseErrorBody(output.body, context)
|
|
329
|
+
};
|
|
330
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
331
|
+
switch (errorCode) {
|
|
332
|
+
case "InvalidInputException":
|
|
333
|
+
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
334
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
335
|
+
case "ResourceNotFoundException":
|
|
336
|
+
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
337
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
338
|
+
default:
|
|
339
|
+
const parsedBody = parsedOutput.body;
|
|
340
|
+
return throwDefaultError({
|
|
341
|
+
output,
|
|
342
|
+
parsedBody,
|
|
343
|
+
errorCode
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
}, "de_GetPersonalizedRankingCommandError");
|
|
347
|
+
var de_GetRecommendationsCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
348
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
349
|
+
return de_GetRecommendationsCommandError(output, context);
|
|
350
|
+
}
|
|
351
|
+
const contents = (0, import_smithy_client.map)({
|
|
352
|
+
$metadata: deserializeMetadata(output)
|
|
353
|
+
});
|
|
354
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await parseBody(output.body, context)), "body");
|
|
355
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
356
|
+
itemList: (_) => de_ItemList(_, context),
|
|
357
|
+
recommendationId: import_smithy_client.expectString
|
|
358
|
+
});
|
|
359
|
+
Object.assign(contents, doc);
|
|
360
|
+
return contents;
|
|
361
|
+
}, "de_GetRecommendationsCommand");
|
|
362
|
+
var de_GetRecommendationsCommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
363
|
+
const parsedOutput = {
|
|
364
|
+
...output,
|
|
365
|
+
body: await parseErrorBody(output.body, context)
|
|
366
|
+
};
|
|
367
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
368
|
+
switch (errorCode) {
|
|
369
|
+
case "InvalidInputException":
|
|
370
|
+
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
371
|
+
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
372
|
+
case "ResourceNotFoundException":
|
|
373
|
+
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
374
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
375
|
+
default:
|
|
376
|
+
const parsedBody = parsedOutput.body;
|
|
377
|
+
return throwDefaultError({
|
|
378
|
+
output,
|
|
379
|
+
parsedBody,
|
|
380
|
+
errorCode
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
}, "de_GetRecommendationsCommandError");
|
|
384
|
+
var throwDefaultError = (0, import_smithy_client.withBaseException)(PersonalizeRuntimeServiceException);
|
|
385
|
+
var de_InvalidInputExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
386
|
+
const contents = (0, import_smithy_client.map)({});
|
|
387
|
+
const data = parsedOutput.body;
|
|
388
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
389
|
+
message: import_smithy_client.expectString
|
|
390
|
+
});
|
|
391
|
+
Object.assign(contents, doc);
|
|
392
|
+
const exception = new InvalidInputException({
|
|
393
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
394
|
+
...contents
|
|
395
|
+
});
|
|
396
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
397
|
+
}, "de_InvalidInputExceptionRes");
|
|
398
|
+
var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
399
|
+
const contents = (0, import_smithy_client.map)({});
|
|
400
|
+
const data = parsedOutput.body;
|
|
401
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
402
|
+
message: import_smithy_client.expectString
|
|
403
|
+
});
|
|
404
|
+
Object.assign(contents, doc);
|
|
405
|
+
const exception = new ResourceNotFoundException({
|
|
406
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
407
|
+
...contents
|
|
408
|
+
});
|
|
409
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
410
|
+
}, "de_ResourceNotFoundExceptionRes");
|
|
411
|
+
var de_ActionList = /* @__PURE__ */ __name((output, context) => {
|
|
412
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
413
|
+
return de_PredictedAction(entry, context);
|
|
414
|
+
});
|
|
415
|
+
return retVal;
|
|
416
|
+
}, "de_ActionList");
|
|
417
|
+
var de_ItemList = /* @__PURE__ */ __name((output, context) => {
|
|
418
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
419
|
+
return de_PredictedItem(entry, context);
|
|
420
|
+
});
|
|
421
|
+
return retVal;
|
|
422
|
+
}, "de_ItemList");
|
|
423
|
+
var de_PredictedAction = /* @__PURE__ */ __name((output, context) => {
|
|
424
|
+
return (0, import_smithy_client.take)(output, {
|
|
425
|
+
actionId: import_smithy_client.expectString,
|
|
426
|
+
score: import_smithy_client.limitedParseDouble
|
|
427
|
+
});
|
|
428
|
+
}, "de_PredictedAction");
|
|
429
|
+
var de_PredictedItem = /* @__PURE__ */ __name((output, context) => {
|
|
430
|
+
return (0, import_smithy_client.take)(output, {
|
|
431
|
+
itemId: import_smithy_client.expectString,
|
|
432
|
+
metadata: import_smithy_client._json,
|
|
433
|
+
promotionName: import_smithy_client.expectString,
|
|
434
|
+
score: import_smithy_client.limitedParseDouble
|
|
435
|
+
});
|
|
436
|
+
}, "de_PredictedItem");
|
|
437
|
+
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
438
|
+
httpStatusCode: output.statusCode,
|
|
439
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
440
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
441
|
+
cfId: output.headers["x-amz-cf-id"]
|
|
442
|
+
}), "deserializeMetadata");
|
|
443
|
+
var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
|
|
444
|
+
var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
445
|
+
if (encoded.length) {
|
|
446
|
+
return JSON.parse(encoded);
|
|
447
|
+
}
|
|
448
|
+
return {};
|
|
449
|
+
}), "parseBody");
|
|
450
|
+
var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
|
|
451
|
+
const value = await parseBody(errorBody, context);
|
|
452
|
+
value.message = value.message ?? value.Message;
|
|
453
|
+
return value;
|
|
454
|
+
}, "parseErrorBody");
|
|
455
|
+
var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
|
|
456
|
+
const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
|
|
457
|
+
const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
|
|
458
|
+
let cleanValue = rawValue;
|
|
459
|
+
if (typeof cleanValue === "number") {
|
|
460
|
+
cleanValue = cleanValue.toString();
|
|
461
|
+
}
|
|
462
|
+
if (cleanValue.indexOf(",") >= 0) {
|
|
463
|
+
cleanValue = cleanValue.split(",")[0];
|
|
464
|
+
}
|
|
465
|
+
if (cleanValue.indexOf(":") >= 0) {
|
|
466
|
+
cleanValue = cleanValue.split(":")[0];
|
|
467
|
+
}
|
|
468
|
+
if (cleanValue.indexOf("#") >= 0) {
|
|
469
|
+
cleanValue = cleanValue.split("#")[1];
|
|
470
|
+
}
|
|
471
|
+
return cleanValue;
|
|
472
|
+
}, "sanitizeErrorCode");
|
|
473
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
474
|
+
if (headerKey !== void 0) {
|
|
475
|
+
return sanitizeErrorCode(output.headers[headerKey]);
|
|
476
|
+
}
|
|
477
|
+
if (data.code !== void 0) {
|
|
478
|
+
return sanitizeErrorCode(data.code);
|
|
479
|
+
}
|
|
480
|
+
if (data["__type"] !== void 0) {
|
|
481
|
+
return sanitizeErrorCode(data["__type"]);
|
|
482
|
+
}
|
|
483
|
+
}, "loadRestJsonErrorCode");
|
|
484
|
+
|
|
485
|
+
// src/commands/GetActionRecommendationsCommand.ts
|
|
486
|
+
var _GetActionRecommendationsCommand = class _GetActionRecommendationsCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
487
|
+
...commonParams
|
|
488
|
+
}).m(function(Command, cs, config, o) {
|
|
489
|
+
return [
|
|
490
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
491
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
492
|
+
];
|
|
493
|
+
}).s("AmazonPersonalizeRuntime", "GetActionRecommendations", {}).n("PersonalizeRuntimeClient", "GetActionRecommendationsCommand").f(GetActionRecommendationsRequestFilterSensitiveLog, void 0).ser(se_GetActionRecommendationsCommand).de(de_GetActionRecommendationsCommand).build() {
|
|
494
|
+
};
|
|
495
|
+
__name(_GetActionRecommendationsCommand, "GetActionRecommendationsCommand");
|
|
496
|
+
var GetActionRecommendationsCommand = _GetActionRecommendationsCommand;
|
|
497
|
+
|
|
498
|
+
// src/commands/GetPersonalizedRankingCommand.ts
|
|
499
|
+
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
var _GetPersonalizedRankingCommand = class _GetPersonalizedRankingCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
504
|
+
...commonParams
|
|
505
|
+
}).m(function(Command, cs, config, o) {
|
|
506
|
+
return [
|
|
507
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
508
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
509
|
+
];
|
|
510
|
+
}).s("AmazonPersonalizeRuntime", "GetPersonalizedRanking", {}).n("PersonalizeRuntimeClient", "GetPersonalizedRankingCommand").f(GetPersonalizedRankingRequestFilterSensitiveLog, void 0).ser(se_GetPersonalizedRankingCommand).de(de_GetPersonalizedRankingCommand).build() {
|
|
511
|
+
};
|
|
512
|
+
__name(_GetPersonalizedRankingCommand, "GetPersonalizedRankingCommand");
|
|
513
|
+
var GetPersonalizedRankingCommand = _GetPersonalizedRankingCommand;
|
|
514
|
+
|
|
515
|
+
// src/commands/GetRecommendationsCommand.ts
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
var _GetRecommendationsCommand = class _GetRecommendationsCommand extends import_smithy_client.Command.classBuilder().ep({
|
|
521
|
+
...commonParams
|
|
522
|
+
}).m(function(Command, cs, config, o) {
|
|
523
|
+
return [
|
|
524
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
525
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
526
|
+
];
|
|
527
|
+
}).s("AmazonPersonalizeRuntime", "GetRecommendations", {}).n("PersonalizeRuntimeClient", "GetRecommendationsCommand").f(GetRecommendationsRequestFilterSensitiveLog, void 0).ser(se_GetRecommendationsCommand).de(de_GetRecommendationsCommand).build() {
|
|
528
|
+
};
|
|
529
|
+
__name(_GetRecommendationsCommand, "GetRecommendationsCommand");
|
|
530
|
+
var GetRecommendationsCommand = _GetRecommendationsCommand;
|
|
531
|
+
|
|
532
|
+
// src/PersonalizeRuntime.ts
|
|
533
|
+
var commands = {
|
|
534
|
+
GetActionRecommendationsCommand,
|
|
535
|
+
GetPersonalizedRankingCommand,
|
|
536
|
+
GetRecommendationsCommand
|
|
537
|
+
};
|
|
538
|
+
var _PersonalizeRuntime = class _PersonalizeRuntime extends PersonalizeRuntimeClient {
|
|
539
|
+
};
|
|
540
|
+
__name(_PersonalizeRuntime, "PersonalizeRuntime");
|
|
541
|
+
var PersonalizeRuntime = _PersonalizeRuntime;
|
|
542
|
+
(0, import_smithy_client.createAggregatedClient)(commands, PersonalizeRuntime);
|
|
543
|
+
|
|
544
|
+
// src/index.ts
|
|
545
|
+
var import_util_endpoints = require("@aws-sdk/util-endpoints");
|
|
546
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
547
|
+
0 && (module.exports = {
|
|
548
|
+
GetActionRecommendationsCommand,
|
|
549
|
+
GetActionRecommendationsRequestFilterSensitiveLog,
|
|
550
|
+
GetPersonalizedRankingCommand,
|
|
551
|
+
GetPersonalizedRankingRequestFilterSensitiveLog,
|
|
552
|
+
GetRecommendationsCommand,
|
|
553
|
+
GetRecommendationsRequestFilterSensitiveLog,
|
|
554
|
+
InvalidInputException,
|
|
555
|
+
PersonalizeRuntime,
|
|
556
|
+
PersonalizeRuntimeClient,
|
|
557
|
+
PersonalizeRuntimeServiceException,
|
|
558
|
+
PromotionFilterSensitiveLog,
|
|
559
|
+
ResourceNotFoundException,
|
|
560
|
+
__Client
|
|
561
|
+
});
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PersonalizeRuntimeServiceException = exports.__ServiceException = void 0;
|
|
4
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
-
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
|
|
6
|
-
class PersonalizeRuntimeServiceException extends smithy_client_1.ServiceException {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
super(options);
|
|
9
|
-
Object.setPrototypeOf(this, PersonalizeRuntimeServiceException.prototype);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.PersonalizeRuntimeServiceException = PersonalizeRuntimeServiceException;
|
|
1
|
+
module.exports = require("../index.js");
|
package/dist-cjs/models/index.js
CHANGED
|
@@ -1,54 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetRecommendationsRequestFilterSensitiveLog = exports.PromotionFilterSensitiveLog = exports.GetPersonalizedRankingRequestFilterSensitiveLog = exports.GetActionRecommendationsRequestFilterSensitiveLog = exports.ResourceNotFoundException = exports.InvalidInputException = void 0;
|
|
4
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
-
const PersonalizeRuntimeServiceException_1 = require("./PersonalizeRuntimeServiceException");
|
|
6
|
-
class InvalidInputException extends PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException {
|
|
7
|
-
constructor(opts) {
|
|
8
|
-
super({
|
|
9
|
-
name: "InvalidInputException",
|
|
10
|
-
$fault: "client",
|
|
11
|
-
...opts,
|
|
12
|
-
});
|
|
13
|
-
this.name = "InvalidInputException";
|
|
14
|
-
this.$fault = "client";
|
|
15
|
-
Object.setPrototypeOf(this, InvalidInputException.prototype);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.InvalidInputException = InvalidInputException;
|
|
19
|
-
class ResourceNotFoundException extends PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException {
|
|
20
|
-
constructor(opts) {
|
|
21
|
-
super({
|
|
22
|
-
name: "ResourceNotFoundException",
|
|
23
|
-
$fault: "client",
|
|
24
|
-
...opts,
|
|
25
|
-
});
|
|
26
|
-
this.name = "ResourceNotFoundException";
|
|
27
|
-
this.$fault = "client";
|
|
28
|
-
Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
exports.ResourceNotFoundException = ResourceNotFoundException;
|
|
32
|
-
const GetActionRecommendationsRequestFilterSensitiveLog = (obj) => ({
|
|
33
|
-
...obj,
|
|
34
|
-
...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
|
|
35
|
-
});
|
|
36
|
-
exports.GetActionRecommendationsRequestFilterSensitiveLog = GetActionRecommendationsRequestFilterSensitiveLog;
|
|
37
|
-
const GetPersonalizedRankingRequestFilterSensitiveLog = (obj) => ({
|
|
38
|
-
...obj,
|
|
39
|
-
...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
|
|
40
|
-
...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
|
|
41
|
-
});
|
|
42
|
-
exports.GetPersonalizedRankingRequestFilterSensitiveLog = GetPersonalizedRankingRequestFilterSensitiveLog;
|
|
43
|
-
const PromotionFilterSensitiveLog = (obj) => ({
|
|
44
|
-
...obj,
|
|
45
|
-
...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
|
|
46
|
-
});
|
|
47
|
-
exports.PromotionFilterSensitiveLog = PromotionFilterSensitiveLog;
|
|
48
|
-
const GetRecommendationsRequestFilterSensitiveLog = (obj) => ({
|
|
49
|
-
...obj,
|
|
50
|
-
...(obj.context && { context: smithy_client_1.SENSITIVE_STRING }),
|
|
51
|
-
...(obj.filterValues && { filterValues: smithy_client_1.SENSITIVE_STRING }),
|
|
52
|
-
...(obj.promotions && { promotions: obj.promotions.map((item) => (0, exports.PromotionFilterSensitiveLog)(item)) }),
|
|
53
|
-
});
|
|
54
|
-
exports.GetRecommendationsRequestFilterSensitiveLog = GetRecommendationsRequestFilterSensitiveLog;
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,291 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_GetRecommendationsCommand = exports.de_GetPersonalizedRankingCommand = exports.de_GetActionRecommendationsCommand = exports.se_GetRecommendationsCommand = exports.se_GetPersonalizedRankingCommand = exports.se_GetActionRecommendationsCommand = void 0;
|
|
4
|
-
const core_1 = require("@smithy/core");
|
|
5
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const models_0_1 = require("../models/models_0");
|
|
7
|
-
const PersonalizeRuntimeServiceException_1 = require("../models/PersonalizeRuntimeServiceException");
|
|
8
|
-
const se_GetActionRecommendationsCommand = async (input, context) => {
|
|
9
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
10
|
-
const headers = {
|
|
11
|
-
"content-type": "application/json",
|
|
12
|
-
};
|
|
13
|
-
b.bp("/action-recommendations");
|
|
14
|
-
let body;
|
|
15
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
16
|
-
campaignArn: [],
|
|
17
|
-
filterArn: [],
|
|
18
|
-
filterValues: (_) => (0, smithy_client_1._json)(_),
|
|
19
|
-
numResults: [],
|
|
20
|
-
userId: [],
|
|
21
|
-
}));
|
|
22
|
-
b.m("POST").h(headers).b(body);
|
|
23
|
-
return b.build();
|
|
24
|
-
};
|
|
25
|
-
exports.se_GetActionRecommendationsCommand = se_GetActionRecommendationsCommand;
|
|
26
|
-
const se_GetPersonalizedRankingCommand = async (input, context) => {
|
|
27
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
28
|
-
const headers = {
|
|
29
|
-
"content-type": "application/json",
|
|
30
|
-
};
|
|
31
|
-
b.bp("/personalize-ranking");
|
|
32
|
-
let body;
|
|
33
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
34
|
-
campaignArn: [],
|
|
35
|
-
context: (_) => (0, smithy_client_1._json)(_),
|
|
36
|
-
filterArn: [],
|
|
37
|
-
filterValues: (_) => (0, smithy_client_1._json)(_),
|
|
38
|
-
inputList: (_) => (0, smithy_client_1._json)(_),
|
|
39
|
-
metadataColumns: (_) => (0, smithy_client_1._json)(_),
|
|
40
|
-
userId: [],
|
|
41
|
-
}));
|
|
42
|
-
b.m("POST").h(headers).b(body);
|
|
43
|
-
return b.build();
|
|
44
|
-
};
|
|
45
|
-
exports.se_GetPersonalizedRankingCommand = se_GetPersonalizedRankingCommand;
|
|
46
|
-
const se_GetRecommendationsCommand = async (input, context) => {
|
|
47
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
48
|
-
const headers = {
|
|
49
|
-
"content-type": "application/json",
|
|
50
|
-
};
|
|
51
|
-
b.bp("/recommendations");
|
|
52
|
-
let body;
|
|
53
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
54
|
-
campaignArn: [],
|
|
55
|
-
context: (_) => (0, smithy_client_1._json)(_),
|
|
56
|
-
filterArn: [],
|
|
57
|
-
filterValues: (_) => (0, smithy_client_1._json)(_),
|
|
58
|
-
itemId: [],
|
|
59
|
-
metadataColumns: (_) => (0, smithy_client_1._json)(_),
|
|
60
|
-
numResults: [],
|
|
61
|
-
promotions: (_) => (0, smithy_client_1._json)(_),
|
|
62
|
-
recommenderArn: [],
|
|
63
|
-
userId: [],
|
|
64
|
-
}));
|
|
65
|
-
b.m("POST").h(headers).b(body);
|
|
66
|
-
return b.build();
|
|
67
|
-
};
|
|
68
|
-
exports.se_GetRecommendationsCommand = se_GetRecommendationsCommand;
|
|
69
|
-
const de_GetActionRecommendationsCommand = async (output, context) => {
|
|
70
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
71
|
-
return de_GetActionRecommendationsCommandError(output, context);
|
|
72
|
-
}
|
|
73
|
-
const contents = (0, smithy_client_1.map)({
|
|
74
|
-
$metadata: deserializeMetadata(output),
|
|
75
|
-
});
|
|
76
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
77
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
78
|
-
actionList: (_) => de_ActionList(_, context),
|
|
79
|
-
recommendationId: smithy_client_1.expectString,
|
|
80
|
-
});
|
|
81
|
-
Object.assign(contents, doc);
|
|
82
|
-
return contents;
|
|
83
|
-
};
|
|
84
|
-
exports.de_GetActionRecommendationsCommand = de_GetActionRecommendationsCommand;
|
|
85
|
-
const de_GetActionRecommendationsCommandError = async (output, context) => {
|
|
86
|
-
const parsedOutput = {
|
|
87
|
-
...output,
|
|
88
|
-
body: await parseErrorBody(output.body, context),
|
|
89
|
-
};
|
|
90
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
91
|
-
switch (errorCode) {
|
|
92
|
-
case "InvalidInputException":
|
|
93
|
-
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
94
|
-
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
95
|
-
case "ResourceNotFoundException":
|
|
96
|
-
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
97
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
98
|
-
default:
|
|
99
|
-
const parsedBody = parsedOutput.body;
|
|
100
|
-
return throwDefaultError({
|
|
101
|
-
output,
|
|
102
|
-
parsedBody,
|
|
103
|
-
errorCode,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const de_GetPersonalizedRankingCommand = async (output, context) => {
|
|
108
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
109
|
-
return de_GetPersonalizedRankingCommandError(output, context);
|
|
110
|
-
}
|
|
111
|
-
const contents = (0, smithy_client_1.map)({
|
|
112
|
-
$metadata: deserializeMetadata(output),
|
|
113
|
-
});
|
|
114
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
115
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
116
|
-
personalizedRanking: (_) => de_ItemList(_, context),
|
|
117
|
-
recommendationId: smithy_client_1.expectString,
|
|
118
|
-
});
|
|
119
|
-
Object.assign(contents, doc);
|
|
120
|
-
return contents;
|
|
121
|
-
};
|
|
122
|
-
exports.de_GetPersonalizedRankingCommand = de_GetPersonalizedRankingCommand;
|
|
123
|
-
const de_GetPersonalizedRankingCommandError = async (output, context) => {
|
|
124
|
-
const parsedOutput = {
|
|
125
|
-
...output,
|
|
126
|
-
body: await parseErrorBody(output.body, context),
|
|
127
|
-
};
|
|
128
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
129
|
-
switch (errorCode) {
|
|
130
|
-
case "InvalidInputException":
|
|
131
|
-
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
132
|
-
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
133
|
-
case "ResourceNotFoundException":
|
|
134
|
-
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
135
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
136
|
-
default:
|
|
137
|
-
const parsedBody = parsedOutput.body;
|
|
138
|
-
return throwDefaultError({
|
|
139
|
-
output,
|
|
140
|
-
parsedBody,
|
|
141
|
-
errorCode,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
const de_GetRecommendationsCommand = async (output, context) => {
|
|
146
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
147
|
-
return de_GetRecommendationsCommandError(output, context);
|
|
148
|
-
}
|
|
149
|
-
const contents = (0, smithy_client_1.map)({
|
|
150
|
-
$metadata: deserializeMetadata(output),
|
|
151
|
-
});
|
|
152
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
153
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
154
|
-
itemList: (_) => de_ItemList(_, context),
|
|
155
|
-
recommendationId: smithy_client_1.expectString,
|
|
156
|
-
});
|
|
157
|
-
Object.assign(contents, doc);
|
|
158
|
-
return contents;
|
|
159
|
-
};
|
|
160
|
-
exports.de_GetRecommendationsCommand = de_GetRecommendationsCommand;
|
|
161
|
-
const de_GetRecommendationsCommandError = async (output, context) => {
|
|
162
|
-
const parsedOutput = {
|
|
163
|
-
...output,
|
|
164
|
-
body: await parseErrorBody(output.body, context),
|
|
165
|
-
};
|
|
166
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
167
|
-
switch (errorCode) {
|
|
168
|
-
case "InvalidInputException":
|
|
169
|
-
case "com.amazonaws.personalizeruntime#InvalidInputException":
|
|
170
|
-
throw await de_InvalidInputExceptionRes(parsedOutput, context);
|
|
171
|
-
case "ResourceNotFoundException":
|
|
172
|
-
case "com.amazonaws.personalizeruntime#ResourceNotFoundException":
|
|
173
|
-
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
174
|
-
default:
|
|
175
|
-
const parsedBody = parsedOutput.body;
|
|
176
|
-
return throwDefaultError({
|
|
177
|
-
output,
|
|
178
|
-
parsedBody,
|
|
179
|
-
errorCode,
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(PersonalizeRuntimeServiceException_1.PersonalizeRuntimeServiceException);
|
|
184
|
-
const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
|
|
185
|
-
const contents = (0, smithy_client_1.map)({});
|
|
186
|
-
const data = parsedOutput.body;
|
|
187
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
188
|
-
message: smithy_client_1.expectString,
|
|
189
|
-
});
|
|
190
|
-
Object.assign(contents, doc);
|
|
191
|
-
const exception = new models_0_1.InvalidInputException({
|
|
192
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
193
|
-
...contents,
|
|
194
|
-
});
|
|
195
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
196
|
-
};
|
|
197
|
-
const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
198
|
-
const contents = (0, smithy_client_1.map)({});
|
|
199
|
-
const data = parsedOutput.body;
|
|
200
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
201
|
-
message: smithy_client_1.expectString,
|
|
202
|
-
});
|
|
203
|
-
Object.assign(contents, doc);
|
|
204
|
-
const exception = new models_0_1.ResourceNotFoundException({
|
|
205
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
206
|
-
...contents,
|
|
207
|
-
});
|
|
208
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
209
|
-
};
|
|
210
|
-
const de_ActionList = (output, context) => {
|
|
211
|
-
const retVal = (output || [])
|
|
212
|
-
.filter((e) => e != null)
|
|
213
|
-
.map((entry) => {
|
|
214
|
-
return de_PredictedAction(entry, context);
|
|
215
|
-
});
|
|
216
|
-
return retVal;
|
|
217
|
-
};
|
|
218
|
-
const de_ItemList = (output, context) => {
|
|
219
|
-
const retVal = (output || [])
|
|
220
|
-
.filter((e) => e != null)
|
|
221
|
-
.map((entry) => {
|
|
222
|
-
return de_PredictedItem(entry, context);
|
|
223
|
-
});
|
|
224
|
-
return retVal;
|
|
225
|
-
};
|
|
226
|
-
const de_PredictedAction = (output, context) => {
|
|
227
|
-
return (0, smithy_client_1.take)(output, {
|
|
228
|
-
actionId: smithy_client_1.expectString,
|
|
229
|
-
score: smithy_client_1.limitedParseDouble,
|
|
230
|
-
});
|
|
231
|
-
};
|
|
232
|
-
const de_PredictedItem = (output, context) => {
|
|
233
|
-
return (0, smithy_client_1.take)(output, {
|
|
234
|
-
itemId: smithy_client_1.expectString,
|
|
235
|
-
metadata: smithy_client_1._json,
|
|
236
|
-
promotionName: smithy_client_1.expectString,
|
|
237
|
-
score: smithy_client_1.limitedParseDouble,
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
const deserializeMetadata = (output) => ({
|
|
241
|
-
httpStatusCode: output.statusCode,
|
|
242
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
243
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
244
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
245
|
-
});
|
|
246
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
247
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
248
|
-
value !== null &&
|
|
249
|
-
value !== "" &&
|
|
250
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
251
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
252
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
253
|
-
if (encoded.length) {
|
|
254
|
-
return JSON.parse(encoded);
|
|
255
|
-
}
|
|
256
|
-
return {};
|
|
257
|
-
});
|
|
258
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
259
|
-
const value = await parseBody(errorBody, context);
|
|
260
|
-
value.message = value.message ?? value.Message;
|
|
261
|
-
return value;
|
|
262
|
-
};
|
|
263
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
264
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
265
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
266
|
-
let cleanValue = rawValue;
|
|
267
|
-
if (typeof cleanValue === "number") {
|
|
268
|
-
cleanValue = cleanValue.toString();
|
|
269
|
-
}
|
|
270
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
271
|
-
cleanValue = cleanValue.split(",")[0];
|
|
272
|
-
}
|
|
273
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
274
|
-
cleanValue = cleanValue.split(":")[0];
|
|
275
|
-
}
|
|
276
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
277
|
-
cleanValue = cleanValue.split("#")[1];
|
|
278
|
-
}
|
|
279
|
-
return cleanValue;
|
|
280
|
-
};
|
|
281
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
282
|
-
if (headerKey !== undefined) {
|
|
283
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
284
|
-
}
|
|
285
|
-
if (data.code !== undefined) {
|
|
286
|
-
return sanitizeErrorCode(data.code);
|
|
287
|
-
}
|
|
288
|
-
if (data["__type"] !== undefined) {
|
|
289
|
-
return sanitizeErrorCode(data["__type"]);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|
|
@@ -1,22 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveRuntimeExtensions = void 0;
|
|
4
|
-
const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
|
|
5
|
-
const protocol_http_1 = require("@smithy/protocol-http");
|
|
6
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
-
const asPartial = (t) => t;
|
|
8
|
-
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
9
|
-
const extensionConfiguration = {
|
|
10
|
-
...asPartial((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig)),
|
|
11
|
-
...asPartial((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig)),
|
|
12
|
-
...asPartial((0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig)),
|
|
13
|
-
};
|
|
14
|
-
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
15
|
-
return {
|
|
16
|
-
...runtimeConfig,
|
|
17
|
-
...(0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
18
|
-
...(0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
19
|
-
...(0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|
|
1
|
+
module.exports = require("./index.js");
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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.495.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
|
|
7
|
-
"build:cjs": "
|
|
7
|
+
"build:cjs": "node ../../scripts/compilation/inline client-personalize-runtime",
|
|
8
8
|
"build:es": "tsc -p tsconfig.es.json",
|
|
9
9
|
"build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
|
|
10
10
|
"build:types": "tsc -p tsconfig.types.json",
|
|
@@ -20,47 +20,47 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@aws-crypto/sha256-browser": "3.0.0",
|
|
22
22
|
"@aws-crypto/sha256-js": "3.0.0",
|
|
23
|
-
"@aws-sdk/client-sts": "3.
|
|
24
|
-
"@aws-sdk/core": "3.
|
|
25
|
-
"@aws-sdk/credential-provider-node": "3.
|
|
26
|
-
"@aws-sdk/middleware-host-header": "3.
|
|
27
|
-
"@aws-sdk/middleware-logger": "3.
|
|
28
|
-
"@aws-sdk/middleware-recursion-detection": "3.
|
|
29
|
-
"@aws-sdk/middleware-signing": "3.
|
|
30
|
-
"@aws-sdk/middleware-user-agent": "3.
|
|
31
|
-
"@aws-sdk/region-config-resolver": "3.
|
|
32
|
-
"@aws-sdk/types": "3.
|
|
33
|
-
"@aws-sdk/util-endpoints": "3.
|
|
34
|
-
"@aws-sdk/util-user-agent-browser": "3.
|
|
35
|
-
"@aws-sdk/util-user-agent-node": "3.
|
|
36
|
-
"@smithy/config-resolver": "^2.0
|
|
37
|
-
"@smithy/core": "^1.
|
|
38
|
-
"@smithy/fetch-http-handler": "^2.
|
|
39
|
-
"@smithy/hash-node": "^2.0
|
|
40
|
-
"@smithy/invalid-dependency": "^2.0
|
|
41
|
-
"@smithy/middleware-content-length": "^2.0
|
|
42
|
-
"@smithy/middleware-endpoint": "^2.
|
|
43
|
-
"@smithy/middleware-retry": "^2.0
|
|
44
|
-
"@smithy/middleware-serde": "^2.0
|
|
45
|
-
"@smithy/middleware-stack": "^2.0
|
|
46
|
-
"@smithy/node-config-provider": "^2.
|
|
47
|
-
"@smithy/node-http-handler": "^2.
|
|
48
|
-
"@smithy/protocol-http": "^3.0
|
|
49
|
-
"@smithy/smithy-client": "^2.
|
|
50
|
-
"@smithy/types": "^2.
|
|
51
|
-
"@smithy/url-parser": "^2.0
|
|
52
|
-
"@smithy/util-base64": "^2.0
|
|
53
|
-
"@smithy/util-body-length-browser": "^2.0
|
|
54
|
-
"@smithy/util-body-length-node": "^2.
|
|
55
|
-
"@smithy/util-defaults-mode-browser": "^2.0
|
|
56
|
-
"@smithy/util-defaults-mode-node": "^2.0
|
|
57
|
-
"@smithy/util-endpoints": "^1.0
|
|
58
|
-
"@smithy/util-retry": "^2.0
|
|
59
|
-
"@smithy/util-utf8": "^2.0
|
|
23
|
+
"@aws-sdk/client-sts": "3.495.0",
|
|
24
|
+
"@aws-sdk/core": "3.495.0",
|
|
25
|
+
"@aws-sdk/credential-provider-node": "3.495.0",
|
|
26
|
+
"@aws-sdk/middleware-host-header": "3.495.0",
|
|
27
|
+
"@aws-sdk/middleware-logger": "3.495.0",
|
|
28
|
+
"@aws-sdk/middleware-recursion-detection": "3.495.0",
|
|
29
|
+
"@aws-sdk/middleware-signing": "3.495.0",
|
|
30
|
+
"@aws-sdk/middleware-user-agent": "3.495.0",
|
|
31
|
+
"@aws-sdk/region-config-resolver": "3.495.0",
|
|
32
|
+
"@aws-sdk/types": "3.495.0",
|
|
33
|
+
"@aws-sdk/util-endpoints": "3.495.0",
|
|
34
|
+
"@aws-sdk/util-user-agent-browser": "3.495.0",
|
|
35
|
+
"@aws-sdk/util-user-agent-node": "3.495.0",
|
|
36
|
+
"@smithy/config-resolver": "^2.1.0",
|
|
37
|
+
"@smithy/core": "^1.3.0",
|
|
38
|
+
"@smithy/fetch-http-handler": "^2.4.0",
|
|
39
|
+
"@smithy/hash-node": "^2.1.0",
|
|
40
|
+
"@smithy/invalid-dependency": "^2.1.0",
|
|
41
|
+
"@smithy/middleware-content-length": "^2.1.0",
|
|
42
|
+
"@smithy/middleware-endpoint": "^2.4.0",
|
|
43
|
+
"@smithy/middleware-retry": "^2.1.0",
|
|
44
|
+
"@smithy/middleware-serde": "^2.1.0",
|
|
45
|
+
"@smithy/middleware-stack": "^2.1.0",
|
|
46
|
+
"@smithy/node-config-provider": "^2.2.0",
|
|
47
|
+
"@smithy/node-http-handler": "^2.3.0",
|
|
48
|
+
"@smithy/protocol-http": "^3.1.0",
|
|
49
|
+
"@smithy/smithy-client": "^2.3.0",
|
|
50
|
+
"@smithy/types": "^2.9.0",
|
|
51
|
+
"@smithy/url-parser": "^2.1.0",
|
|
52
|
+
"@smithy/util-base64": "^2.1.0",
|
|
53
|
+
"@smithy/util-body-length-browser": "^2.1.0",
|
|
54
|
+
"@smithy/util-body-length-node": "^2.2.0",
|
|
55
|
+
"@smithy/util-defaults-mode-browser": "^2.1.0",
|
|
56
|
+
"@smithy/util-defaults-mode-node": "^2.1.0",
|
|
57
|
+
"@smithy/util-endpoints": "^1.1.0",
|
|
58
|
+
"@smithy/util-retry": "^2.1.0",
|
|
59
|
+
"@smithy/util-utf8": "^2.1.0",
|
|
60
60
|
"tslib": "^2.5.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@smithy/service-client-documentation-generator": "^2.
|
|
63
|
+
"@smithy/service-client-documentation-generator": "^2.1.0",
|
|
64
64
|
"@tsconfig/node14": "1.0.3",
|
|
65
65
|
"@types/node": "^14.14.31",
|
|
66
66
|
"concurrently": "7.0.0",
|