@wix/auto_sdk_ecom_recommendations 1.0.5 → 1.0.6
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/build/{es/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → ecom-recommendations-v1-recommendation-recommendations.universal-DXecA95A.d.mts} +29 -13
- package/build/{internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → ecom-recommendations-v1-recommendation-recommendations.universal-DXecA95A.d.ts} +29 -13
- package/build/{internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → index.d.mts} +11 -8
- package/build/{cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → index.d.ts} +11 -8
- package/build/index.js +179 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +153 -0
- package/build/index.mjs.map +1 -0
- package/build/{cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → internal/ecom-recommendations-v1-recommendation-recommendations.universal-DXecA95A.d.mts} +29 -13
- package/build/internal/{es/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → ecom-recommendations-v1-recommendation-recommendations.universal-DXecA95A.d.ts} +29 -13
- package/build/{es/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → internal/index.d.mts} +11 -8
- package/build/internal/{cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → index.d.ts} +11 -8
- package/build/internal/index.js +179 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +153 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +162 -0
- package/build/internal/meta.d.ts +162 -0
- package/build/internal/meta.js +128 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +100 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/meta.d.mts +162 -0
- package/build/meta.d.ts +162 -0
- package/build/meta.js +128 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +100 -0
- package/build/meta.mjs.map +1 -0
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -10
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -94
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -66
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -20
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -10
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -258
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -158
- package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -6
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -89
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -38
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -14
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -7
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -258
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -130
- package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -10
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -94
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -66
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -20
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -10
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -258
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -158
- package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -6
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -89
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -38
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -14
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -7
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -258
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -130
- package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
-
export interface Recommendation {
|
|
3
|
-
/**
|
|
4
|
-
* Recommended items.
|
|
5
|
-
* @maxSize 100
|
|
6
|
-
*/
|
|
7
|
-
items?: CatalogReference[];
|
|
8
|
-
/** The algorithm used to provide the recommendation. */
|
|
9
|
-
algorithm?: Algorithm;
|
|
10
|
-
}
|
|
11
|
-
/** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
|
|
12
|
-
export interface CatalogReference {
|
|
13
|
-
/**
|
|
14
|
-
* ID of the item within the catalog it belongs to.
|
|
15
|
-
* @minLength 1
|
|
16
|
-
* @maxLength 36
|
|
17
|
-
*/
|
|
18
|
-
catalogItemId?: string;
|
|
19
|
-
/**
|
|
20
|
-
* ID of the app providing the catalog.
|
|
21
|
-
*
|
|
22
|
-
* You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
|
|
23
|
-
*
|
|
24
|
-
* For items from Wix catalogs, the following values always apply:
|
|
25
|
-
* + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
|
|
26
|
-
* + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
|
|
27
|
-
* + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
|
|
28
|
-
* @minLength 1
|
|
29
|
-
*/
|
|
30
|
-
appId?: string;
|
|
31
|
-
/**
|
|
32
|
-
* 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.
|
|
33
|
-
*
|
|
34
|
-
* For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).
|
|
35
|
-
*/
|
|
36
|
-
options?: Record<string, any> | null;
|
|
37
|
-
}
|
|
38
|
-
export interface Algorithm {
|
|
39
|
-
/**
|
|
40
|
-
* Algorithm ID defined by the app providing the algorithm.
|
|
41
|
-
* @format GUID
|
|
42
|
-
*/
|
|
43
|
-
_id?: string;
|
|
44
|
-
/**
|
|
45
|
-
* App ID of the Wix or 3rd-party app providing the algorithm.
|
|
46
|
-
*
|
|
47
|
-
* 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>.
|
|
48
|
-
* @minLength 1
|
|
49
|
-
* @maxLength 36
|
|
50
|
-
*/
|
|
51
|
-
appId?: string;
|
|
52
|
-
}
|
|
53
|
-
export interface ListAvailableAlgorithmsRequest {
|
|
54
|
-
}
|
|
55
|
-
export interface ListAvailableAlgorithmsResponse {
|
|
56
|
-
/**
|
|
57
|
-
* Algorithms available for use on your Wix site or project. See the method description for more information.
|
|
58
|
-
* @maxSize 500
|
|
59
|
-
*/
|
|
60
|
-
availableAlgorithms?: AlgorithmInfo[];
|
|
61
|
-
}
|
|
62
|
-
export interface AlgorithmInfo {
|
|
63
|
-
/** How the algorithm is configured. */
|
|
64
|
-
config?: AlgorithmConfig;
|
|
65
|
-
/**
|
|
66
|
-
* The app ID of the application providing the algorithm.
|
|
67
|
-
*
|
|
68
|
-
* 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>.
|
|
69
|
-
* @minLength 1
|
|
70
|
-
* @maxLength 36
|
|
71
|
-
*/
|
|
72
|
-
appId?: string;
|
|
73
|
-
/**
|
|
74
|
-
* App IDs of catalogs to which the algorithm can be applied.
|
|
75
|
-
*
|
|
76
|
-
* 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>.
|
|
77
|
-
* @minSize 1
|
|
78
|
-
* @maxSize 100
|
|
79
|
-
* @minLength 1
|
|
80
|
-
* @maxLength 36
|
|
81
|
-
*/
|
|
82
|
-
catalogAppIds?: string[];
|
|
83
|
-
}
|
|
84
|
-
export interface AlgorithmConfig {
|
|
85
|
-
/**
|
|
86
|
-
* Algorithm name. This value is not translatable.
|
|
87
|
-
* @minLength 1
|
|
88
|
-
* @maxLength 50
|
|
89
|
-
*/
|
|
90
|
-
name?: string;
|
|
91
|
-
/**
|
|
92
|
-
* 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.
|
|
93
|
-
* @minLength 1
|
|
94
|
-
* @maxLength 500
|
|
95
|
-
*/
|
|
96
|
-
description?: string;
|
|
97
|
-
/**
|
|
98
|
-
* 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.
|
|
99
|
-
* @minLength 1
|
|
100
|
-
* @maxLength 300
|
|
101
|
-
*/
|
|
102
|
-
additionalInfo?: string | null;
|
|
103
|
-
/**
|
|
104
|
-
* Algorithms may have the following types:
|
|
105
|
-
* * `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.
|
|
106
|
-
* * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.
|
|
107
|
-
*/
|
|
108
|
-
algorithmType?: AlgorithmType;
|
|
109
|
-
/**
|
|
110
|
-
* 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.
|
|
111
|
-
* @format GUID
|
|
112
|
-
*/
|
|
113
|
-
algorithmId?: string;
|
|
114
|
-
}
|
|
115
|
-
export declare enum AlgorithmType {
|
|
116
|
-
UNSPECIFIED = "UNSPECIFIED",
|
|
117
|
-
RELATED_ITEMS = "RELATED_ITEMS",
|
|
118
|
-
GLOBAL = "GLOBAL"
|
|
119
|
-
}
|
|
120
|
-
export interface GetRecommendationRequest {
|
|
121
|
-
/**
|
|
122
|
-
* The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.
|
|
123
|
-
* @maxSize 300
|
|
124
|
-
*/
|
|
125
|
-
items?: CatalogReference[];
|
|
126
|
-
/**
|
|
127
|
-
* A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
|
|
128
|
-
* See the method description for more information.
|
|
129
|
-
*
|
|
130
|
-
* If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
|
|
131
|
-
* @minSize 1
|
|
132
|
-
* @maxSize 10
|
|
133
|
-
*/
|
|
134
|
-
algorithms: Algorithm[];
|
|
135
|
-
/**
|
|
136
|
-
* The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
|
|
137
|
-
*
|
|
138
|
-
* Max: `100`
|
|
139
|
-
* @max 100
|
|
140
|
-
*/
|
|
141
|
-
minimumRecommendedItems?: number;
|
|
142
|
-
}
|
|
143
|
-
export interface GetRecommendationResponse {
|
|
144
|
-
/** 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. */
|
|
145
|
-
recommendation?: Recommendation;
|
|
146
|
-
}
|
|
147
|
-
export interface ItemAppIdNotSupportedByProvider {
|
|
148
|
-
/**
|
|
149
|
-
* Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.
|
|
150
|
-
* @minSize 1
|
|
151
|
-
* @maxSize 300
|
|
152
|
-
*/
|
|
153
|
-
items?: CatalogReference[];
|
|
154
|
-
/**
|
|
155
|
-
* Algorithms that don't support the requested items.
|
|
156
|
-
* @minSize 1
|
|
157
|
-
* @maxSize 10
|
|
158
|
-
*/
|
|
159
|
-
algorithms?: Algorithm[];
|
|
160
|
-
}
|
|
161
|
-
export interface RecommendationAlgorithmNotSupported {
|
|
162
|
-
/**
|
|
163
|
-
* Algorithms not supported by the provider.
|
|
164
|
-
* @minSize 1
|
|
165
|
-
* @maxSize 10
|
|
166
|
-
*/
|
|
167
|
-
unsupportedAlgorithms?: Algorithm[];
|
|
168
|
-
}
|
|
169
|
-
type RecommendationNonNullablePaths = `items` | `items.${number}.catalogItemId` | `items.${number}.appId` | `algorithm._id` | `algorithm.appId`;
|
|
170
|
-
/**
|
|
171
|
-
* 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.
|
|
172
|
-
*
|
|
173
|
-
* 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.
|
|
174
|
-
*
|
|
175
|
-
* 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.
|
|
176
|
-
*
|
|
177
|
-
*
|
|
178
|
-
* For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
|
|
179
|
-
* 1. The algorithm’s `appId` must match the ID of an installed Wix app.
|
|
180
|
-
* 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
|
|
181
|
-
*
|
|
182
|
-
* 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).
|
|
183
|
-
* @public
|
|
184
|
-
* @permissionId RECOMMENDATIONS.READ
|
|
185
|
-
* @permissionScope Manage Stores - all permissions
|
|
186
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
187
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
188
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
189
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
190
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
191
|
-
* @permissionScope Picasso private app mega scope
|
|
192
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
193
|
-
* @applicableIdentity APP
|
|
194
|
-
* @applicableIdentity VISITOR
|
|
195
|
-
* @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms
|
|
196
|
-
*/
|
|
197
|
-
export declare function listAvailableAlgorithms(): Promise<NonNullablePaths<ListAvailableAlgorithmsResponse, `availableAlgorithms` | `availableAlgorithms.${number}.config.name` | `availableAlgorithms.${number}.config.description` | `availableAlgorithms.${number}.config.algorithmType` | `availableAlgorithms.${number}.config.algorithmId` | `availableAlgorithms.${number}.appId` | `availableAlgorithms.${number}.catalogAppIds`>>;
|
|
198
|
-
/**
|
|
199
|
-
* Returns a recommendation object containing a list of items to recommend to the customer.
|
|
200
|
-
*
|
|
201
|
-
* `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
|
|
202
|
-
*
|
|
203
|
-
* `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
|
|
204
|
-
*
|
|
205
|
-
* Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
|
|
206
|
-
* For example, Wix Stores provides algorithms that can only be used on its own catalogs.
|
|
207
|
-
* To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
|
|
208
|
-
* For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
|
|
209
|
-
*
|
|
210
|
-
* `getRecommendation()` operates as follows:
|
|
211
|
-
* 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.
|
|
212
|
-
* 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.
|
|
213
|
-
* 3. The app runs the algorithms.
|
|
214
|
-
* 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.
|
|
215
|
-
* 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.
|
|
216
|
-
* 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
|
|
217
|
-
* @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
|
|
218
|
-
* See the method description for more information.
|
|
219
|
-
*
|
|
220
|
-
* If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
|
|
221
|
-
* @public
|
|
222
|
-
* @requiredField algorithms
|
|
223
|
-
* @requiredField algorithms._id
|
|
224
|
-
* @requiredField algorithms.appId
|
|
225
|
-
* @requiredField options.items.appId
|
|
226
|
-
* @requiredField options.items.catalogItemId
|
|
227
|
-
* @param options - Get recommendation options.
|
|
228
|
-
* @permissionId RECOMMENDATIONS.READ
|
|
229
|
-
* @permissionScope Manage Stores - all permissions
|
|
230
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
231
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
232
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
233
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
234
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
235
|
-
* @permissionScope Picasso private app mega scope
|
|
236
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
237
|
-
* @applicableIdentity APP
|
|
238
|
-
* @applicableIdentity VISITOR
|
|
239
|
-
* @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation
|
|
240
|
-
*/
|
|
241
|
-
export declare function getRecommendation(algorithms: NonNullablePaths<Algorithm, `_id` | `appId`>[], options?: NonNullablePaths<GetRecommendationOptions, `items.${number}.appId` | `items.${number}.catalogItemId`>): Promise<NonNullablePaths<GetRecommendationResponse, {
|
|
242
|
-
[P in RecommendationNonNullablePaths]: `recommendation.${P}`;
|
|
243
|
-
}[RecommendationNonNullablePaths]>>;
|
|
244
|
-
export interface GetRecommendationOptions {
|
|
245
|
-
/**
|
|
246
|
-
* The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.
|
|
247
|
-
* @maxSize 300
|
|
248
|
-
*/
|
|
249
|
-
items?: CatalogReference[];
|
|
250
|
-
/**
|
|
251
|
-
* The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
|
|
252
|
-
*
|
|
253
|
-
* Max: `100`
|
|
254
|
-
* @max 100
|
|
255
|
-
*/
|
|
256
|
-
minimumRecommendedItems?: number;
|
|
257
|
-
}
|
|
258
|
-
export {};
|
package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
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
|
-
* @permissionId RECOMMENDATIONS.READ
|
|
51
|
-
* @permissionScope Manage Stores - all permissions
|
|
52
|
-
* @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
|
|
53
|
-
* @permissionScope Read eCommerce - all read permissions
|
|
54
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
|
|
55
|
-
* @permissionScope Manage eCommerce - all permissions
|
|
56
|
-
* @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
|
|
57
|
-
* @permissionScope Picasso private app mega scope
|
|
58
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
59
|
-
* @applicableIdentity APP
|
|
60
|
-
* @applicableIdentity VISITOR
|
|
61
|
-
* @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms
|
|
62
|
-
*/
|
|
63
|
-
async function listAvailableAlgorithms() {
|
|
64
|
-
// @ts-ignore
|
|
65
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
66
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
|
|
67
|
-
const reqOpts = ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(payload);
|
|
68
|
-
sideEffects?.onSiteCall?.();
|
|
69
|
-
try {
|
|
70
|
-
const result = await httpClient.request(reqOpts);
|
|
71
|
-
sideEffects?.onSuccess?.(result);
|
|
72
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
73
|
-
}
|
|
74
|
-
catch (err) {
|
|
75
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
76
|
-
spreadPathsToArguments: {},
|
|
77
|
-
explicitPathsToArguments: {},
|
|
78
|
-
singleArgumentUnchanged: false,
|
|
79
|
-
}, []);
|
|
80
|
-
sideEffects?.onError?.(err);
|
|
81
|
-
throw transformedError;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
exports.listAvailableAlgorithms = listAvailableAlgorithms;
|
|
85
|
-
/**
|
|
86
|
-
* Returns a recommendation object containing a list of items to recommend to the customer.
|
|
87
|
-
*
|
|
88
|
-
* `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
|
|
89
|
-
*
|
|
90
|
-
* `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
|
|
91
|
-
*
|
|
92
|
-
* Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
|
|
93
|
-
* For example, Wix Stores provides algorithms that can only be used on its own catalogs.
|
|
94
|
-
* To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
|
|
95
|
-
* For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
|
|
96
|
-
*
|
|
97
|
-
* `getRecommendation()` operates as follows:
|
|
98
|
-
* 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.
|
|
99
|
-
* 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.
|
|
100
|
-
* 3. The app runs the algorithms.
|
|
101
|
-
* 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.
|
|
102
|
-
* 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.
|
|
103
|
-
* 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
|
|
104
|
-
* @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
|
|
105
|
-
* See the method description for more information.
|
|
106
|
-
*
|
|
107
|
-
* If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
|
|
108
|
-
* @public
|
|
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
|
-
* @permissionScope Picasso private app mega scope
|
|
123
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
124
|
-
* @applicableIdentity APP
|
|
125
|
-
* @applicableIdentity VISITOR
|
|
126
|
-
* @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation
|
|
127
|
-
*/
|
|
128
|
-
async function getRecommendation(algorithms, options) {
|
|
129
|
-
// @ts-ignore
|
|
130
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
131
|
-
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
|
|
132
|
-
algorithms: algorithms,
|
|
133
|
-
items: options?.items,
|
|
134
|
-
minimumRecommendedItems: options?.minimumRecommendedItems,
|
|
135
|
-
});
|
|
136
|
-
const reqOpts = ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);
|
|
137
|
-
sideEffects?.onSiteCall?.();
|
|
138
|
-
try {
|
|
139
|
-
const result = await httpClient.request(reqOpts);
|
|
140
|
-
sideEffects?.onSuccess?.(result);
|
|
141
|
-
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
142
|
-
}
|
|
143
|
-
catch (err) {
|
|
144
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
145
|
-
spreadPathsToArguments: {},
|
|
146
|
-
explicitPathsToArguments: {
|
|
147
|
-
algorithms: '$[0]',
|
|
148
|
-
items: '$[1].items',
|
|
149
|
-
minimumRecommendedItems: '$[1].minimumRecommendedItems',
|
|
150
|
-
},
|
|
151
|
-
singleArgumentUnchanged: false,
|
|
152
|
-
}, ['algorithms', 'options']);
|
|
153
|
-
sideEffects?.onError?.(err);
|
|
154
|
-
throw transformedError;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.getRecommendation = getRecommendation;
|
|
158
|
-
//# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.universal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAyHrI,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AA8DD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,uBAAuB;IAY3C,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;AA7CD,0DA6CC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACI,KAAK,UAAU,iBAAiB,CACrC,UAA0D,EAC1D,OAGC;IASD,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;AArDD,8CAqDC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/ecom-recommendations-v1-recommendation-recommendations.context.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../index.ts"],"names":[],"mappings":"AAAA,cAAc,yEAAyE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/ecom-recommendations-v1-recommendation-recommendations.universal.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,2EAA2E,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/ecom-recommendations-v1-recommendation-recommendations.meta.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meta.js","sourceRoot":"","sources":["../../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,sEAAsE,CAAC"}
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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, GetRecommendationOptions, } from './ecom-recommendations-v1-recommendation-recommendations.universal.js';
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
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
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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>;
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
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
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
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, ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsResponse>;
|
|
14
|
-
export declare function getRecommendation(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationRequest, ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationRequest, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationResponse, ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationResponse>;
|