@aws-sdk/client-personalize-runtime 3.474.0 → 3.477.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.
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.de_GetRecommendationsCommand = exports.de_GetPersonalizedRankingCommand = exports.de_GetActionRecommendationsCommand = exports.se_GetRecommendationsCommand = exports.se_GetPersonalizedRankingCommand = exports.se_GetActionRecommendationsCommand = void 0;
4
- const protocol_http_1 = require("@smithy/protocol-http");
4
+ const core_1 = require("@smithy/core");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const PersonalizeRuntimeServiceException_1 = require("../models/PersonalizeRuntimeServiceException");
8
8
  const se_GetActionRecommendationsCommand = async (input, context) => {
9
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
10
  const headers = {
11
11
  "content-type": "application/json",
12
12
  };
13
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/action-recommendations";
13
+ b.bp("/action-recommendations");
14
14
  let body;
15
15
  body = JSON.stringify((0, smithy_client_1.take)(input, {
16
16
  campaignArn: [],
@@ -19,23 +19,16 @@ const se_GetActionRecommendationsCommand = async (input, context) => {
19
19
  numResults: [],
20
20
  userId: [],
21
21
  }));
22
- return new protocol_http_1.HttpRequest({
23
- protocol,
24
- hostname,
25
- port,
26
- method: "POST",
27
- headers,
28
- path: resolvedPath,
29
- body,
30
- });
22
+ b.m("POST").h(headers).b(body);
23
+ return b.build();
31
24
  };
32
25
  exports.se_GetActionRecommendationsCommand = se_GetActionRecommendationsCommand;
33
26
  const se_GetPersonalizedRankingCommand = async (input, context) => {
34
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
27
+ const b = (0, core_1.requestBuilder)(input, context);
35
28
  const headers = {
36
29
  "content-type": "application/json",
37
30
  };
38
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/personalize-ranking";
31
+ b.bp("/personalize-ranking");
39
32
  let body;
40
33
  body = JSON.stringify((0, smithy_client_1.take)(input, {
41
34
  campaignArn: [],
@@ -46,23 +39,16 @@ const se_GetPersonalizedRankingCommand = async (input, context) => {
46
39
  metadataColumns: (_) => (0, smithy_client_1._json)(_),
47
40
  userId: [],
48
41
  }));
49
- return new protocol_http_1.HttpRequest({
50
- protocol,
51
- hostname,
52
- port,
53
- method: "POST",
54
- headers,
55
- path: resolvedPath,
56
- body,
57
- });
42
+ b.m("POST").h(headers).b(body);
43
+ return b.build();
58
44
  };
59
45
  exports.se_GetPersonalizedRankingCommand = se_GetPersonalizedRankingCommand;
60
46
  const se_GetRecommendationsCommand = async (input, context) => {
61
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
47
+ const b = (0, core_1.requestBuilder)(input, context);
62
48
  const headers = {
63
49
  "content-type": "application/json",
64
50
  };
65
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/recommendations";
51
+ b.bp("/recommendations");
66
52
  let body;
67
53
  body = JSON.stringify((0, smithy_client_1.take)(input, {
68
54
  campaignArn: [],
@@ -76,15 +62,8 @@ const se_GetRecommendationsCommand = async (input, context) => {
76
62
  recommenderArn: [],
77
63
  userId: [],
78
64
  }));
79
- return new protocol_http_1.HttpRequest({
80
- protocol,
81
- hostname,
82
- port,
83
- method: "POST",
84
- headers,
85
- path: resolvedPath,
86
- body,
87
- });
65
+ b.m("POST").h(headers).b(body);
66
+ return b.build();
88
67
  };
89
68
  exports.se_GetRecommendationsCommand = se_GetRecommendationsCommand;
90
69
  const de_GetActionRecommendationsCommand = async (output, context) => {
@@ -1,13 +1,13 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
2
  import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { InvalidInputException, ResourceNotFoundException, } from "../models/models_0";
4
4
  import { PersonalizeRuntimeServiceException as __BaseException } from "../models/PersonalizeRuntimeServiceException";
5
5
  export const se_GetActionRecommendationsCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
6
+ const b = rb(input, context);
7
7
  const headers = {
8
8
  "content-type": "application/json",
9
9
  };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/action-recommendations";
10
+ b.bp("/action-recommendations");
11
11
  let body;
12
12
  body = JSON.stringify(take(input, {
13
13
  campaignArn: [],
@@ -16,22 +16,15 @@ export const se_GetActionRecommendationsCommand = async (input, context) => {
16
16
  numResults: [],
17
17
  userId: [],
18
18
  }));
19
- return new __HttpRequest({
20
- protocol,
21
- hostname,
22
- port,
23
- method: "POST",
24
- headers,
25
- path: resolvedPath,
26
- body,
27
- });
19
+ b.m("POST").h(headers).b(body);
20
+ return b.build();
28
21
  };
29
22
  export const se_GetPersonalizedRankingCommand = async (input, context) => {
30
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
23
+ const b = rb(input, context);
31
24
  const headers = {
32
25
  "content-type": "application/json",
33
26
  };
34
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/personalize-ranking";
27
+ b.bp("/personalize-ranking");
35
28
  let body;
36
29
  body = JSON.stringify(take(input, {
37
30
  campaignArn: [],
@@ -42,22 +35,15 @@ export const se_GetPersonalizedRankingCommand = async (input, context) => {
42
35
  metadataColumns: (_) => _json(_),
43
36
  userId: [],
44
37
  }));
45
- return new __HttpRequest({
46
- protocol,
47
- hostname,
48
- port,
49
- method: "POST",
50
- headers,
51
- path: resolvedPath,
52
- body,
53
- });
38
+ b.m("POST").h(headers).b(body);
39
+ return b.build();
54
40
  };
55
41
  export const se_GetRecommendationsCommand = async (input, context) => {
56
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
42
+ const b = rb(input, context);
57
43
  const headers = {
58
44
  "content-type": "application/json",
59
45
  };
60
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/recommendations";
46
+ b.bp("/recommendations");
61
47
  let body;
62
48
  body = JSON.stringify(take(input, {
63
49
  campaignArn: [],
@@ -71,15 +57,8 @@ export const se_GetRecommendationsCommand = async (input, context) => {
71
57
  recommenderArn: [],
72
58
  userId: [],
73
59
  }));
74
- return new __HttpRequest({
75
- protocol,
76
- hostname,
77
- port,
78
- method: "POST",
79
- headers,
80
- path: resolvedPath,
81
- body,
82
- });
60
+ b.m("POST").h(headers).b(body);
61
+ return b.build();
83
62
  };
84
63
  export const de_GetActionRecommendationsCommand = async (output, context) => {
85
64
  if (output.statusCode !== 200 && output.statusCode >= 300) {
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.474.0",
4
+ "version": "3.477.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",
@@ -20,9 +20,9 @@
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.474.0",
24
- "@aws-sdk/core": "3.474.0",
25
- "@aws-sdk/credential-provider-node": "3.474.0",
23
+ "@aws-sdk/client-sts": "3.477.0",
24
+ "@aws-sdk/core": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.477.0",
26
26
  "@aws-sdk/middleware-host-header": "3.468.0",
27
27
  "@aws-sdk/middleware-logger": "3.468.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
@@ -34,6 +34,7 @@
34
34
  "@aws-sdk/util-user-agent-browser": "3.468.0",
35
35
  "@aws-sdk/util-user-agent-node": "3.470.0",
36
36
  "@smithy/config-resolver": "^2.0.21",
37
+ "@smithy/core": "^1.2.0",
37
38
  "@smithy/fetch-http-handler": "^2.3.1",
38
39
  "@smithy/hash-node": "^2.0.17",
39
40
  "@smithy/invalid-dependency": "^2.0.15",