@wix/auto_sdk_ecom_recommendations 1.0.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.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +6 -0
  11. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js +10 -0
  12. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +1 -0
  13. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +37 -0
  14. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js +94 -0
  15. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +1 -0
  16. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +14 -0
  17. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +66 -0
  18. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +1 -0
  19. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts +53 -0
  20. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js +20 -0
  21. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +1 -0
  22. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts +142 -0
  23. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js +10 -0
  24. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +1 -0
  25. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +222 -0
  26. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +156 -0
  27. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +6 -0
  39. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js +6 -0
  40. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +1 -0
  41. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +37 -0
  42. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js +89 -0
  43. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +1 -0
  44. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +14 -0
  45. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +38 -0
  46. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +1 -0
  47. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts +53 -0
  48. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js +14 -0
  49. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +1 -0
  50. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts +142 -0
  51. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js +7 -0
  52. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +1 -0
  53. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +222 -0
  54. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +128 -0
  55. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +6 -0
  66. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js +10 -0
  67. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +1 -0
  68. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +37 -0
  69. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js +94 -0
  70. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +1 -0
  71. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +14 -0
  72. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +66 -0
  73. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts +53 -0
  75. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js +20 -0
  76. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +1 -0
  77. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts +142 -0
  78. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js +10 -0
  79. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +1 -0
  80. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +222 -0
  81. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +156 -0
  82. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +6 -0
  93. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js +6 -0
  94. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +1 -0
  95. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +37 -0
  96. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js +89 -0
  97. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +1 -0
  98. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +14 -0
  99. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +38 -0
  100. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +1 -0
  101. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts +53 -0
  102. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js +14 -0
  103. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +1 -0
  104. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts +142 -0
  105. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js +7 -0
  106. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +1 -0
  107. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +222 -0
  108. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +128 -0
  109. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,222 @@
1
+ export interface Recommendation {
2
+ /** Recommended items. */
3
+ items?: CatalogReference[];
4
+ /** The algorithm used to provide the recommendation. */
5
+ algorithm?: Algorithm;
6
+ }
7
+ /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
8
+ export interface CatalogReference {
9
+ /** ID of the item within the catalog it belongs to. */
10
+ catalogItemId?: string;
11
+ /**
12
+ * ID of the app providing the catalog.
13
+ *
14
+ * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
15
+ *
16
+ * For items from Wix catalogs, the following values always apply:
17
+ * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
18
+ * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
19
+ * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
20
+ */
21
+ appId?: string;
22
+ /**
23
+ * Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.
24
+ *
25
+ * For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration).
26
+ */
27
+ options?: Record<string, any> | null;
28
+ }
29
+ export interface Algorithm {
30
+ /** Algorithm ID defined by the app providing the algorithm. */
31
+ _id?: string;
32
+ /**
33
+ * App ID of the Wix or 3rd-party app providing the algorithm.
34
+ *
35
+ * Wix app IDs are <a href="https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions" target="_blank">listed here</a>.
36
+ */
37
+ appId?: string;
38
+ }
39
+ export interface ListAvailableAlgorithmsRequest {
40
+ }
41
+ export interface ListAvailableAlgorithmsResponse {
42
+ /** Algorithms available for use on your Wix site or project. See the method description for more information. */
43
+ availableAlgorithms?: AlgorithmInfo[];
44
+ }
45
+ export interface AlgorithmInfo {
46
+ /** How the algorithm is configured. */
47
+ config?: AlgorithmConfig;
48
+ /**
49
+ * The app ID of the application providing the algorithm.
50
+ *
51
+ * Wix app IDs are <a href="https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions" target="_blank">listed here</a>.
52
+ */
53
+ appId?: string;
54
+ /**
55
+ * App IDs of catalogs to which the algorithm can be applied.
56
+ *
57
+ * Wix app IDs are <a href="https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions" target="_blank">listed here</a>.
58
+ */
59
+ catalogAppIds?: string[];
60
+ }
61
+ export interface AlgorithmConfig {
62
+ /** Algorithm name. This value is not translatable. */
63
+ name?: string;
64
+ /** Algorithm description. This describes how the algorithm works and if it has any limitations regarding site content, number of items in the catalog, site traffic, and so on. This value is not translatable. */
65
+ description?: string;
66
+ /** A supplemental `description`. It can be used to help break up and organize information. You can, for example, display this information as a tooltip or as an additional section that is collapsed by default. */
67
+ additionalInfo?: string | null;
68
+ /**
69
+ * Algorithms may have the following types:
70
+ * * `RELATED_ITEMS` - This type of algorithm provides recommendations based on 1 or more other provided items. For example, when an item is added to a cart, the algorithm can suggest other items frequently bought together with that item.
71
+ * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.
72
+ */
73
+ algorithmType?: AlgorithmType;
74
+ /** Algorithm ID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project. */
75
+ algorithmId?: string;
76
+ }
77
+ export declare enum AlgorithmType {
78
+ UNSPECIFIED = "UNSPECIFIED",
79
+ RELATED_ITEMS = "RELATED_ITEMS",
80
+ GLOBAL = "GLOBAL"
81
+ }
82
+ export interface GetRecommendationRequest {
83
+ /** The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`. */
84
+ items?: CatalogReference[];
85
+ /**
86
+ * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
87
+ * See the method description for more information.
88
+ *
89
+ * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
90
+ */
91
+ algorithms: Algorithm[];
92
+ /**
93
+ * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
94
+ *
95
+ * Max: `100`
96
+ */
97
+ minimumRecommendedItems?: number;
98
+ }
99
+ export interface GetRecommendationResponse {
100
+ /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */
101
+ recommendation?: Recommendation;
102
+ }
103
+ export interface ItemAppIdNotSupportedByProvider {
104
+ /** Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center. */
105
+ items?: CatalogReference[];
106
+ /** Algorithms that don't support the requested items. */
107
+ algorithms?: Algorithm[];
108
+ }
109
+ export interface RecommendationAlgorithmNotSupported {
110
+ /** Algorithms not supported by the provider. */
111
+ unsupportedAlgorithms?: Algorithm[];
112
+ }
113
+ interface AlgorithmConfigNonNullableFields {
114
+ name: string;
115
+ description: string;
116
+ algorithmType: AlgorithmType;
117
+ algorithmId: string;
118
+ }
119
+ interface AlgorithmInfoNonNullableFields {
120
+ config?: AlgorithmConfigNonNullableFields;
121
+ appId: string;
122
+ catalogAppIds: string[];
123
+ }
124
+ export interface ListAvailableAlgorithmsResponseNonNullableFields {
125
+ availableAlgorithms: AlgorithmInfoNonNullableFields[];
126
+ }
127
+ interface CatalogReferenceNonNullableFields {
128
+ catalogItemId: string;
129
+ appId: string;
130
+ }
131
+ interface AlgorithmNonNullableFields {
132
+ _id: string;
133
+ appId: string;
134
+ }
135
+ interface RecommendationNonNullableFields {
136
+ items: CatalogReferenceNonNullableFields[];
137
+ algorithm?: AlgorithmNonNullableFields;
138
+ }
139
+ export interface GetRecommendationResponseNonNullableFields {
140
+ recommendation?: RecommendationNonNullableFields;
141
+ }
142
+ /**
143
+ * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
144
+ *
145
+ * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
146
+ *
147
+ * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
148
+ *
149
+ *
150
+ * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
151
+ * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
152
+ * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
153
+ *
154
+ * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
155
+ * @public
156
+ * @documentationMaturity preview
157
+ * @permissionId RECOMMENDATIONS.READ
158
+ * @permissionScope Manage Stores - all permissions
159
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
160
+ * @permissionScope Read eCommerce - all read permissions
161
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
162
+ * @permissionScope Manage eCommerce - all permissions
163
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
164
+ * @applicableIdentity APP
165
+ * @applicableIdentity VISITOR
166
+ * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms
167
+ */
168
+ export declare function listAvailableAlgorithms(): Promise<ListAvailableAlgorithmsResponse & ListAvailableAlgorithmsResponseNonNullableFields>;
169
+ /**
170
+ * Returns a recommendation object containing a list of items to recommend to the customer.
171
+ *
172
+ * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
173
+ *
174
+ * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
175
+ *
176
+ * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
177
+ * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
178
+ * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
179
+ * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
180
+ *
181
+ * `getRecommendation()` operates as follows:
182
+ * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
183
+ * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
184
+ * 3. The app runs the algorithms.
185
+ * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
186
+ * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
187
+ * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
188
+ * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
189
+ * See the method description for more information.
190
+ *
191
+ * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
192
+ * @public
193
+ * @documentationMaturity preview
194
+ * @requiredField algorithms
195
+ * @requiredField algorithms._id
196
+ * @requiredField algorithms.appId
197
+ * @requiredField options.items.appId
198
+ * @requiredField options.items.catalogItemId
199
+ * @param options - Get recommendation options.
200
+ * @permissionId RECOMMENDATIONS.READ
201
+ * @permissionScope Manage Stores - all permissions
202
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
203
+ * @permissionScope Read eCommerce - all read permissions
204
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
205
+ * @permissionScope Manage eCommerce - all permissions
206
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
207
+ * @applicableIdentity APP
208
+ * @applicableIdentity VISITOR
209
+ * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation
210
+ */
211
+ export declare function getRecommendation(algorithms: Algorithm[], options?: GetRecommendationOptions): Promise<GetRecommendationResponse & GetRecommendationResponseNonNullableFields>;
212
+ export interface GetRecommendationOptions {
213
+ /** The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`. */
214
+ items?: CatalogReference[];
215
+ /**
216
+ * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
217
+ *
218
+ * Max: `100`
219
+ */
220
+ minimumRecommendedItems?: number;
221
+ }
222
+ export {};
@@ -0,0 +1,156 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.getRecommendation = exports.listAvailableAlgorithms = exports.AlgorithmType = void 0;
27
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
+ const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
+ const ambassadorWixEcomRecommendationsV1Recommendation = __importStar(require("./ecom-recommendations-v1-recommendation-recommendations.http.js"));
30
+ var AlgorithmType;
31
+ (function (AlgorithmType) {
32
+ AlgorithmType["UNSPECIFIED"] = "UNSPECIFIED";
33
+ AlgorithmType["RELATED_ITEMS"] = "RELATED_ITEMS";
34
+ AlgorithmType["GLOBAL"] = "GLOBAL";
35
+ })(AlgorithmType || (exports.AlgorithmType = AlgorithmType = {}));
36
+ /**
37
+ * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
38
+ *
39
+ * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
40
+ *
41
+ * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
42
+ *
43
+ *
44
+ * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
45
+ * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
46
+ * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
47
+ *
48
+ * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
49
+ * @public
50
+ * @documentationMaturity preview
51
+ * @permissionId RECOMMENDATIONS.READ
52
+ * @permissionScope Manage Stores - all permissions
53
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
54
+ * @permissionScope Read eCommerce - all read permissions
55
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
56
+ * @permissionScope Manage eCommerce - all permissions
57
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
58
+ * @applicableIdentity APP
59
+ * @applicableIdentity VISITOR
60
+ * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms
61
+ */
62
+ async function listAvailableAlgorithms() {
63
+ // @ts-ignore
64
+ const { httpClient, sideEffects } = arguments[0];
65
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
66
+ const reqOpts = ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(payload);
67
+ sideEffects?.onSiteCall?.();
68
+ try {
69
+ const result = await httpClient.request(reqOpts);
70
+ sideEffects?.onSuccess?.(result);
71
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
72
+ }
73
+ catch (err) {
74
+ const transformedError = (0, transform_error_1.transformError)(err, {
75
+ spreadPathsToArguments: {},
76
+ explicitPathsToArguments: {},
77
+ singleArgumentUnchanged: false,
78
+ }, []);
79
+ sideEffects?.onError?.(err);
80
+ throw transformedError;
81
+ }
82
+ }
83
+ exports.listAvailableAlgorithms = listAvailableAlgorithms;
84
+ /**
85
+ * Returns a recommendation object containing a list of items to recommend to the customer.
86
+ *
87
+ * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
88
+ *
89
+ * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
90
+ *
91
+ * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
92
+ * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
93
+ * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
94
+ * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
95
+ *
96
+ * `getRecommendation()` operates as follows:
97
+ * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
98
+ * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
99
+ * 3. The app runs the algorithms.
100
+ * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
101
+ * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
102
+ * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
103
+ * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
104
+ * See the method description for more information.
105
+ *
106
+ * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
107
+ * @public
108
+ * @documentationMaturity preview
109
+ * @requiredField algorithms
110
+ * @requiredField algorithms._id
111
+ * @requiredField algorithms.appId
112
+ * @requiredField options.items.appId
113
+ * @requiredField options.items.catalogItemId
114
+ * @param options - Get recommendation options.
115
+ * @permissionId RECOMMENDATIONS.READ
116
+ * @permissionScope Manage Stores - all permissions
117
+ * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
118
+ * @permissionScope Read eCommerce - all read permissions
119
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
120
+ * @permissionScope Manage eCommerce - all permissions
121
+ * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
122
+ * @applicableIdentity APP
123
+ * @applicableIdentity VISITOR
124
+ * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation
125
+ */
126
+ async function getRecommendation(algorithms, options) {
127
+ // @ts-ignore
128
+ const { httpClient, sideEffects } = arguments[2];
129
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
130
+ algorithms: algorithms,
131
+ items: options?.items,
132
+ minimumRecommendedItems: options?.minimumRecommendedItems,
133
+ });
134
+ const reqOpts = ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);
135
+ sideEffects?.onSiteCall?.();
136
+ try {
137
+ const result = await httpClient.request(reqOpts);
138
+ sideEffects?.onSuccess?.(result);
139
+ return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
140
+ }
141
+ catch (err) {
142
+ const transformedError = (0, transform_error_1.transformError)(err, {
143
+ spreadPathsToArguments: {},
144
+ explicitPathsToArguments: {
145
+ algorithms: '$[0]',
146
+ items: '$[1].items',
147
+ minimumRecommendedItems: '$[1].minimumRecommendedItems',
148
+ },
149
+ singleArgumentUnchanged: false,
150
+ }, ['algorithms', 'options']);
151
+ sideEffects?.onError?.(err);
152
+ throw transformedError;
153
+ }
154
+ }
155
+ exports.getRecommendation = getRecommendation;
156
+ //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.universal.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,mJAAqI;AAoFrI,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAyED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,KAAK,UAAU,uBAAuB;IAI3C,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC,EAAE,CAAC,CAAC;IAE1D,MAAM,OAAO,GACX,gDAAgD,CAAC,uBAAuB,CACtE,OAAO,CACR,CAAC;IAEJ,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE;YAC5B,uBAAuB,EAAE,KAAK;SAC/B,EACD,EAAE,CACH,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AArCD,0DAqCC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACI,KAAK,UAAU,iBAAiB,CACrC,UAAuB,EACvB,OAAkC;IAIlC,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC;QACpD,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,uBAAuB,EAAE,OAAO,EAAE,uBAAuB;KAC1D,CAAC,CAAC;IAEH,MAAM,OAAO,GACX,gDAAgD,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE9E,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE;gBACxB,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,YAAY;gBACnB,uBAAuB,EAAE,8BAA8B;aACxD;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,YAAY,EAAE,SAAS,CAAC,CAC1B,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AA7CD,8CA6CC"}
@@ -0,0 +1 @@
1
+ export * from './src/ecom-recommendations-v1-recommendation-recommendations.context.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/ecom-recommendations-v1-recommendation-recommendations.context.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,yEAAyE,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/ecom-recommendations-v1-recommendation-recommendations.universal.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/ecom-recommendations-v1-recommendation-recommendations.universal.js';
2
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,2EAA2E,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/ecom-recommendations-v1-recommendation-recommendations.meta.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/ecom-recommendations-v1-recommendation-recommendations.meta.js';
2
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,sEAAsE,CAAC"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,6 @@
1
+ import { listAvailableAlgorithms as publicListAvailableAlgorithms, getRecommendation as publicGetRecommendation } from './ecom-recommendations-v1-recommendation-recommendations.public.js';
2
+ import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
3
+ export declare const listAvailableAlgorithms: MaybeContext<BuildRESTFunction<typeof publicListAvailableAlgorithms> & typeof publicListAvailableAlgorithms>;
4
+ export declare const getRecommendation: MaybeContext<BuildRESTFunction<typeof publicGetRecommendation> & typeof publicGetRecommendation>;
5
+ export { AlgorithmType } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';
6
+ export { Recommendation, CatalogReference, Algorithm, ListAvailableAlgorithmsRequest, ListAvailableAlgorithmsResponse, AlgorithmInfo, AlgorithmConfig, GetRecommendationRequest, GetRecommendationResponse, ItemAppIdNotSupportedByProvider, RecommendationAlgorithmNotSupported, ListAvailableAlgorithmsResponseNonNullableFields, GetRecommendationResponseNonNullableFields, GetRecommendationOptions, } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';
@@ -0,0 +1,6 @@
1
+ import { listAvailableAlgorithms as publicListAvailableAlgorithms, getRecommendation as publicGetRecommendation, } from './ecom-recommendations-v1-recommendation-recommendations.public.js';
2
+ import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
3
+ export const listAvailableAlgorithms = /*#__PURE__*/ createRESTModule(publicListAvailableAlgorithms);
4
+ export const getRecommendation = /*#__PURE__*/ createRESTModule(publicGetRecommendation);
5
+ export { AlgorithmType } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';
6
+ //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.context.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.context.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,IAAI,6BAA6B,EACxD,iBAAiB,IAAI,uBAAuB,GAC7C,MAAM,oEAAoE,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,CAAC,MAAM,uBAAuB,GAGhC,aAAa,CAAC,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,iBAAiB,GAG1B,aAAa,CAAC,gBAAgB,CAAC,uBAAuB,CAAC,CAAC;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,uEAAuE,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ /**
3
+ * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
4
+ *
5
+ * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
6
+ *
7
+ * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
8
+ *
9
+ *
10
+ * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
11
+ * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
12
+ * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
13
+ *
14
+ * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
15
+ */
16
+ export declare function listAvailableAlgorithms(payload: object): RequestOptionsFactory<any>;
17
+ /**
18
+ * Returns a recommendation object containing a list of items to recommend to the customer.
19
+ *
20
+ * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
21
+ *
22
+ * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
23
+ *
24
+ * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
25
+ * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
26
+ * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
27
+ * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
28
+ *
29
+ * `getRecommendation()` operates as follows:
30
+ * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
31
+ * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
32
+ * 3. The app runs the algorithms.
33
+ * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
34
+ * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
35
+ * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
36
+ */
37
+ export declare function getRecommendation(payload: object): RequestOptionsFactory<any>;
@@ -0,0 +1,89 @@
1
+ import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';
2
+ import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
3
+ function resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(opts) {
4
+ const domainToMappings = {
5
+ 'www.wixapis.com': [
6
+ {
7
+ srcPath: '/v1/recommendations',
8
+ destPath: '/v1/recommendations',
9
+ },
10
+ {
11
+ srcPath: '/ecom/v1/recommendations',
12
+ destPath: '/v1/recommendations',
13
+ },
14
+ ],
15
+ };
16
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
17
+ }
18
+ const PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';
19
+ /**
20
+ * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
21
+ *
22
+ * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
23
+ *
24
+ * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
25
+ *
26
+ *
27
+ * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
28
+ * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
29
+ * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
30
+ *
31
+ * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
32
+ */
33
+ export function listAvailableAlgorithms(payload) {
34
+ function __listAvailableAlgorithms({ host }) {
35
+ const metadata = {
36
+ entityFqdn: 'wix.ecom.recommendations.v1.recommendation',
37
+ method: 'GET',
38
+ methodFqn: 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',
39
+ packageName: PACKAGE_NAME,
40
+ url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({
41
+ protoPath: '/v1/recommendations/algorithms',
42
+ data: payload,
43
+ host,
44
+ }),
45
+ params: toURLSearchParams(payload),
46
+ };
47
+ return metadata;
48
+ }
49
+ return __listAvailableAlgorithms;
50
+ }
51
+ /**
52
+ * Returns a recommendation object containing a list of items to recommend to the customer.
53
+ *
54
+ * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
55
+ *
56
+ * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
57
+ *
58
+ * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
59
+ * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
60
+ * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
61
+ * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
62
+ *
63
+ * `getRecommendation()` operates as follows:
64
+ * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
65
+ * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
66
+ * 3. The app runs the algorithms.
67
+ * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
68
+ * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
69
+ * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
70
+ */
71
+ export function getRecommendation(payload) {
72
+ function __getRecommendation({ host }) {
73
+ const metadata = {
74
+ entityFqdn: 'wix.ecom.recommendations.v1.recommendation',
75
+ method: 'POST',
76
+ methodFqn: 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',
77
+ packageName: PACKAGE_NAME,
78
+ url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({
79
+ protoPath: '/v1/recommendations/get',
80
+ data: payload,
81
+ host,
82
+ }),
83
+ data: payload,
84
+ };
85
+ return metadata;
86
+ }
87
+ return __getRecommendation;
88
+ }
89
+ //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.http.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,SAAS,2DAA2D,CAClE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,qBAAqB;aAChC;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,qBAAqB;aAChC;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,YAAY,GAAG,oCAAoC,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAe;IAEf,SAAS,yBAAyB,CAAC,EAAE,IAAI,EAAO;QAC9C,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,4CAA4C;YACxD,MAAM,EAAE,KAAY;YACpB,SAAS,EACP,gFAAgF;YAClF,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,2DAA2D,CAAC;gBAC/D,SAAS,EAAE,gCAAgC;gBAC3C,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC;SACnC,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,SAAS,mBAAmB,CAAC,EAAE,IAAI,EAAO;QACxC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,4CAA4C;YACxD,MAAM,EAAE,MAAa;YACrB,SAAS,EACP,0EAA0E;YAC5E,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,2DAA2D,CAAC;gBAC/D,SAAS,EAAE,yBAAyB;gBACpC,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import * as ambassadorWixEcomRecommendationsV1RecommendationTypes from './ecom-recommendations-v1-recommendation-recommendations.types.js';
2
+ import * as ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes from './ecom-recommendations-v1-recommendation-recommendations.universal.js';
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
+ getUrl: (context: any) => string;
5
+ httpMethod: K;
6
+ path: string;
7
+ pathParams: M;
8
+ __requestType: T;
9
+ __originalRequestType: S;
10
+ __responseType: Q;
11
+ __originalResponseType: R;
12
+ };
13
+ export declare function listAvailableAlgorithms(): __PublicMethodMetaInfo<'GET', {}, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsRequest, ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsRequest, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsResponse & ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsResponseNonNullableFields, ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsResponse & ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsResponseNonNullableFields>;
14
+ export declare function getRecommendation(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationRequest, ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationRequest, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationResponse & ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationResponseNonNullableFields, ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationResponse & ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationResponseNonNullableFields>;
@@ -0,0 +1,38 @@
1
+ import * as ambassadorWixEcomRecommendationsV1Recommendation from './ecom-recommendations-v1-recommendation-recommendations.http.js';
2
+ export function listAvailableAlgorithms() {
3
+ const payload = {};
4
+ const getRequestOptions = ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(payload);
5
+ const getUrl = (context) => {
6
+ const { url } = getRequestOptions(context);
7
+ return url;
8
+ };
9
+ return {
10
+ getUrl,
11
+ httpMethod: 'GET',
12
+ path: '/v1/recommendations/algorithms',
13
+ pathParams: {},
14
+ __requestType: null,
15
+ __originalRequestType: null,
16
+ __responseType: null,
17
+ __originalResponseType: null,
18
+ };
19
+ }
20
+ export function getRecommendation() {
21
+ const payload = {};
22
+ const getRequestOptions = ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);
23
+ const getUrl = (context) => {
24
+ const { url } = getRequestOptions(context);
25
+ return url;
26
+ };
27
+ return {
28
+ getUrl,
29
+ httpMethod: 'POST',
30
+ path: '/v1/recommendations/get',
31
+ pathParams: {},
32
+ __requestType: null,
33
+ __originalRequestType: null,
34
+ __responseType: null,
35
+ __originalResponseType: null,
36
+ };
37
+ }
38
+ //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.meta.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gDAAgD,MAAM,kEAAkE,CAAC;AAsBrI,MAAM,UAAU,uBAAuB;IAUrC,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,gDAAgD,CAAC,uBAAuB,CACtE,OAAO,CACR,CAAC;IAEJ,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,gCAAgC;QACtC,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB;IAU/B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,gDAAgD,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,yBAAyB;QAC/B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC"}