@wix/ditto-codegen-public 1.0.6 → 1.0.8

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.
@@ -0,0 +1,147 @@
1
+
2
+ <recommendations_provider_service_plugin>
3
+ <purpose>URI where the application implementing the SPI is deployed.</purpose>
4
+ <use_cases>
5
+ - Handle algorithmIds: List of algorithms used to find recommended items. Items will be returned in a separate object for each algorithm
6
+ - Handle items: The set of items used by algorithms with the `RELATED_ITEMS` `algorithmType` to determine related item recommendations.
7
+ </use_cases>
8
+ <required_handlers>
9
+ - getRecommendations() - Handler to process: The set of items used by algorithms with the `RELATED_ITEMS` `algorithmType` to determine related item recommendations.
10
+ </required_handlers>
11
+ <import>import { recommendationsProvider } from '@wix/ecom/service-plugins'</import>
12
+ <types>
13
+
14
+ **AlgorithmConfig**
15
+ Properties:
16
+ - additionalInfo: string - 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.
17
+
18
+ minLength 1, maxLength 300
19
+ - algorithmId: string - 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.
20
+
21
+ format GUID
22
+ - algorithmType: AlgorithmType - Algorithms may have the following types:
23
+ * `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.
24
+ * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.
25
+ - description: string - 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.
26
+
27
+ minLength 1, maxLength 500
28
+ - name: string - Algorithm name. This value is not translatable.
29
+
30
+ minLength 1, maxLength 50
31
+
32
+ **AlgorithmNotSupportedWixError**
33
+ Properties:
34
+ - data: RecommendationAlgorithmNotSupported
35
+
36
+ **AlgorithmType**
37
+ Enum values:
38
+ - GLOBAL
39
+ - RELATED_ITEMS
40
+ - UNSPECIFIED
41
+
42
+ **CatalogReference**
43
+ Properties:
44
+ - appId: string - ID of the app providing the catalog.
45
+
46
+ You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
47
+
48
+ For items from Wix catalogs, the following values always apply:
49
+ + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
50
+ + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
51
+ + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
52
+
53
+ minLength 1
54
+ - catalogItemId: string - ID of the item within the catalog it belongs to.
55
+
56
+ minLength 1, maxLength 36
57
+ - options: Record<string, any> - 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.
58
+
59
+ 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)).
60
+
61
+ **Context**
62
+ Properties:
63
+ - currency: string - [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
64
+
65
+ format CURRENCY
66
+ - identity: IdentificationData - An object that describes the identity that triggered this request.
67
+ - instanceId: string - The service provider app's instance ID.
68
+
69
+ format GUID
70
+ - languages: string[] - A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`.
71
+ - requestId: string - A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs.
72
+
73
+ **GetRecommendationsEnvelope**
74
+ Properties:
75
+ - metadata: Context
76
+ - request: GetRecommendationsRequest
77
+
78
+ **GetRecommendationsRequest**
79
+ Properties:
80
+ - algorithmIds: string[] - List of algorithms used to find recommended items. Items will be returned in a separate object for each algorithm
81
+
82
+ minSize 1, maxSize 10, format GUID
83
+ - items: CatalogReference[] - The set of items used by algorithms with the `RELATED_ITEMS` `algorithmType` to determine related item recommendations.
84
+
85
+ maxSize 300
86
+
87
+ **GetRecommendationsResponse**
88
+ Properties:
89
+ - recommendationPerAlgorithm: RecommendationForAlgorithm[] - Related items returned by each algorithm.
90
+
91
+ Each object in the array contains an `algorithmId` and a list of the item recommendations provided by that algorithm.
92
+
93
+ maxSize 10
94
+
95
+ **IdentificationData**
96
+ Properties:
97
+ - identityType: IdentityType
98
+ One of (id):
99
+ - anonymousVisitorId: string - ID of a site visitor that has not logged in to the site.
100
+ - appId: string - ID of an app.
101
+ - memberId: string - ID of a site visitor that has logged in to the site.
102
+ - wixUserId: string - ID of a Wix user (site owner, contributor, etc.).
103
+
104
+ **IdentityType**
105
+ Enum values:
106
+ - ANONYMOUS_VISITOR
107
+ - APP
108
+ - MEMBER
109
+ - UNKNOWN
110
+ - WIX_USER
111
+
112
+ **ItemAppIdNotSupportedError**
113
+ Properties:
114
+ - items: CatalogReference[] - Items with not supported catalogs.
115
+
116
+ minSize 1, maxSize 300
117
+
118
+ **ItemAppIdNotSupportedWixError**
119
+ Properties:
120
+ - data: ItemAppIdNotSupportedError
121
+
122
+ **RecommendationAlgorithmNotSupported**
123
+ Properties:
124
+ - unsupportedAlgorithms: string[] - Not supported algorithms.
125
+
126
+ minSize 1, maxSize 10
127
+
128
+ **RecommendationForAlgorithm**
129
+ Properties:
130
+ - algorithmId: string - Id of the algorithm that provided the recommendation.
131
+
132
+ format GUID
133
+ - recommendedItems: CatalogReference[] - Item recommendations provided by the algorithm. Depending on the algorithm, these recommendations may be influenced by the items provided in the request.
134
+
135
+ maxSize 100
136
+
137
+ **RecommendationsProviderConfig**
138
+ Properties:
139
+ - catalogAppIds: string[] - App IDs of catalogs for which recommended items can be found.
140
+
141
+ minSize 1, maxSize 100, minLength 1, maxLength 36
142
+ - deploymentUri: string - URI where the application implementing the SPI is deployed.
143
+ - supportedAlgorithms: AlgorithmConfig[] - The algorithms that this application can use to calculate item recommendations.
144
+
145
+ minSize 1, maxSize 100
146
+ </types>
147
+ </recommendations_provider_service_plugin>
@@ -0,0 +1,352 @@
1
+
2
+ <shipping_rates_service_plugin>
3
+ <purpose>Base URI where the endpoints are called.
4
+ Wix eCommerce appends the endpoint path to the base URI.
5
+ For example, to call the Get Shipping Rates endpoint at `https://my-shipping-provider.com/v1/getRates`,
6
+ the base URI you provide here is `https://my-shipping-provider.com/`.</purpose>
7
+ <use_cases>
8
+ - Handle buyerContactDetails: Buyer's contact details.
9
+ - Handle deliveryPreferences: List of delivery preferences, for example preferred delivery code (`shippingOptionId`).
10
+ - Handle externalReferences: Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.
11
+ Used for integration and tracking across different platforms.
12
+ - Handle lineItems: The line items to be shipped.
13
+ - Handle purchaseFlowId: Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.
14
+ - Handle shippingDestination: Address to ship to.
15
+ - Handle shippingOrigin: Address item is shipped from. This is the site owner's business address.
16
+ - Handle taxIncludedInPrices: Whether tax is included in the items' prices.
17
+ - Handle weightUnit: Weight measurement unit used for all items in the shipment.
18
+
19
+ Supported values:
20
+ + `"KG"`: kilograms
21
+ + `"LB"`: pounds
22
+ </use_cases>
23
+ <required_handlers>
24
+ - getShippingRates() - Handler to process: Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.
25
+ Used for integration and tracking across different platforms.
26
+ </required_handlers>
27
+ <import>import { shippingRates } from '@wix/ecom/service-plugins'</import>
28
+ <types>
29
+
30
+ **AdditionalCharge**
31
+ Properties:
32
+ - details: string - Details of the additional charge. For example, `"Handling fee of $5 applied for gift wrapping"`.
33
+ - price: string - Cost of additional charge. For example, `12.5`.
34
+
35
+ format DECIMAL_VALUE
36
+ - type: string - Additional charge type.
37
+
38
+ **Address**
39
+ Properties:
40
+ - addressLine1: string - Main address line, usually street and number as free text.
41
+ - addressLine2: string - Free text providing more detailed address info. Usually contains Apt, Suite, and Floor.
42
+ - city: string - City name.
43
+ - country: string - Country code.
44
+
45
+ format COUNTRY
46
+ - postalCode: string - Zip/postal code.
47
+ - subdivision: string - Subdivision shorthand. Usually, a short code (2 or 3 letters) that represents a state, region, prefecture, or province. e.g. NY
48
+ One of (street):
49
+ - addressLine: string - Main address line, usually street and number as free text.
50
+ - streetAddress: StreetAddress - Street name and number.
51
+
52
+ **ApplicationError**
53
+ Properties:
54
+ - code: string - Error code.
55
+ - data: Record<string, any> - Data related to the error.
56
+ - description: string - Description of the error.
57
+
58
+ **CatalogReference**
59
+ Properties:
60
+ - appId: string - ID of the app providing the catalog.
61
+
62
+ You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
63
+
64
+ For items from Wix catalogs, the following values always apply:
65
+ + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
66
+ + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
67
+ + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
68
+
69
+ minLength 1
70
+ - catalogItemId: string - ID of the item within the catalog it belongs to.
71
+
72
+ minLength 1, maxLength 36
73
+ - options: Record<string, any> - 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.
74
+
75
+ 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)).
76
+
77
+ **Context**
78
+ Properties:
79
+ - currency: string - [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
80
+
81
+ format CURRENCY
82
+ - identity: IdentificationData - An object that describes the identity that triggered this request.
83
+ - instanceId: string - The service provider app's instance ID.
84
+
85
+ format GUID
86
+ - languages: string[] - A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`.
87
+ - requestId: string - A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs.
88
+
89
+ **DeliveryLogistics**
90
+ Properties:
91
+ - deliveryTime: string - When the item is expected to be delivered in free text. For example, `"3-5 business days"`.
92
+ - instructions: string - Instructions for delivery. For example, for pickup: `"Ensure to come during business hours, and please don't park in the disabled spot"`.
93
+ - pickupDetails: PickupDetails - Pickup details. Should be returned only if order is for pickup.
94
+
95
+ **DeliveryPreferences**
96
+ Properties:
97
+ - preferredCode: string
98
+
99
+ **ExternalReference**
100
+ Properties:
101
+ - appId: string - ID of the app associated with the purchase flow.
102
+ For example, the Wix Pay Links app ID.
103
+
104
+ format GUID, immutable
105
+ - resourceId: string - Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.
106
+ For example, a Wix Pay Link ID.
107
+
108
+ minLength 1, maxLength 100, immutable
109
+
110
+ **FieldViolation**
111
+ Properties:
112
+ - data: Record<string, any>
113
+ - description: string
114
+ - field: string
115
+ - ruleName: string - applicable when violated_rule=OTHER
116
+ - violatedRule: RuleType
117
+
118
+ **FullAddressContactDetails**
119
+ Properties:
120
+ - company: string - Contact's company name.
121
+ - email: string - Email associated with the address.
122
+
123
+ format EMAIL
124
+ - firstName: string - Contact's first name.
125
+ - lastName: string - Contact's last name.
126
+ - phone: string - Contact's phone number.
127
+
128
+ format PHONE
129
+ - vatId: VatId - Tax info. Currently usable only in Brazil.
130
+
131
+ **GenericShippingRatesError**
132
+ Properties:
133
+ - errors: ApplicationError[]
134
+
135
+ **GenericShippingRatesWixError**
136
+ Properties:
137
+ - data: GenericShippingRatesError
138
+
139
+ **GetShippingRatesEnvelope**
140
+ Properties:
141
+ - metadata: Context
142
+ - request: GetShippingRatesRequest
143
+
144
+ **GetShippingRatesRequest**
145
+ Properties:
146
+ - buyerContactDetails: FullAddressContactDetails - Buyer's contact details.
147
+ - deliveryPreferences: DeliveryPreferences - List of delivery preferences, for example preferred delivery code (`shippingOptionId`).
148
+ - externalReferences: ExternalReference[] - Reference to an external resource ID. Used to link the purchase flow to a specific entity in an external system.
149
+ Used for integration and tracking across different platforms.
150
+
151
+ maxSize 20
152
+ - lineItems: ProductItem[] - The line items to be shipped.
153
+
154
+ minSize 1, maxSize 500
155
+ - purchaseFlowId: string - Persistent ID that correlates between the various eCommerce elements: cart, checkout, and order.
156
+
157
+ format GUID
158
+ - shippingDestination: Address - Address to ship to.
159
+ - shippingOrigin: Address - Address item is shipped from. This is the site owner's business address.
160
+ - taxIncludedInPrices: boolean (deprecated) - Whether tax is included in the items' prices.
161
+ - weightUnit: WeightUnit - Weight measurement unit used for all items in the shipment.
162
+
163
+ Supported values:
164
+ + `"KG"`: kilograms
165
+ + `"LB"`: pounds
166
+
167
+ **GetShippingRatesResponse**
168
+ Properties:
169
+ - shippingRates: ShippingOption[] - Available shipping rates. These define the shipping rate options that are displayed to site visitors on the cart and checkout pages.
170
+
171
+ **IdentificationData**
172
+ Properties:
173
+ - identityType: IdentityType
174
+ One of (id):
175
+ - anonymousVisitorId: string - ID of a site visitor that has not logged in to the site.
176
+ - appId: string - ID of an app.
177
+ - memberId: string - ID of a site visitor that has logged in to the site.
178
+ - wixUserId: string - ID of a Wix user (site owner, contributor, etc.).
179
+
180
+ **IdentityType**
181
+ Enum values:
182
+ - ANONYMOUS_VISITOR
183
+ - APP
184
+ - MEMBER
185
+ - UNKNOWN
186
+ - WIX_USER
187
+
188
+ **InvalidAddressError**
189
+ Properties:
190
+ - fields: FieldViolation[]
191
+
192
+ **InvalidAddressWixError**
193
+ Properties:
194
+ - data: InvalidAddressError
195
+
196
+ **InvalidPostalCodeError**
197
+ Properties:
198
+ - error: ApplicationError
199
+
200
+ **InvalidPostalCodeWixError**
201
+ Properties:
202
+ - data: InvalidPostalCodeError
203
+
204
+ **MissingPostalCodeError**
205
+ Properties:
206
+ - error: ApplicationError
207
+
208
+ **MissingPostalCodeWixError**
209
+ Properties:
210
+ - data: MissingPostalCodeError
211
+
212
+ **PhysicalProperties**
213
+ Properties:
214
+ - shippable: boolean - Whether this line item is shippable.
215
+ - sku: string - Stock-keeping unit. Learn more about [SKUs](https://www.wix.com/encyclopedia/definition/stock-keeping-unit-sku).
216
+
217
+ maxLength 40
218
+ - weight: number - Line item weight. Measurement unit matches the weight unit specified in `weightUnit` in the request.
219
+
220
+ **PickupDetails**
221
+ Properties:
222
+ - address: Address - Pickup address.
223
+ - pickupMethod: PickupMethod - Pickup method.
224
+
225
+ Supported values:
226
+ + `"STORE_PICKUP"`: When pickup is from the merchant's brick and mortar store.
227
+ + `"PICKUP_POINT"`: When item is shipped to a specified pickup point.
228
+
229
+ **PickupMethod**
230
+ Enum values:
231
+ - PICKUP_POINT
232
+ - STORE_PICKUP
233
+ - UNKNOWN_METHOD
234
+
235
+ **ProductItem**
236
+ Properties:
237
+ - catalogReference: CatalogReference - Reference to the item's origin catalog.
238
+ - deliveryDestinationIndex: number - item delivery destination index in the shipping addresses list
239
+ - deliveryOriginIndex: number - where the item is delivered from index in the from addresses list
240
+ - name: string - Item name.
241
+ - physicalProperties: PhysicalProperties - Physical properties of the item.
242
+ - price: string - Price of a single item after discounts.
243
+
244
+ format DECIMAL_VALUE
245
+ - priceBeforeDiscount: string - Price of a single item before discounts.
246
+
247
+ format DECIMAL_VALUE
248
+ - quantity: number - The number of items ordered.
249
+
250
+ max 999999999
251
+ - taxIncludedInPrice: boolean - whether tax is included in line item price
252
+ - totalPrice: string - Total line item price after discounts. This is equal to `price` multiplied by `quantity`.
253
+
254
+ format DECIMAL_VALUE
255
+ - totalPriceBeforeDiscount: string - Total line item price before discounts.
256
+
257
+ format DECIMAL_VALUE
258
+
259
+ **RuleType**
260
+ Enum values:
261
+ - DECIMAL_GT
262
+ - DECIMAL_GTE
263
+ - DECIMAL_LT
264
+ - DECIMAL_LTE
265
+ - DECIMAL_MAX_SCALE
266
+ - EXACT_LENGTH
267
+ - EXACT_SIZE
268
+ - FIELD_NOT_ALLOWED
269
+ - FORMAT
270
+ - INVALID_ENUM_VALUE
271
+ - MAX
272
+ - MAX_LENGTH
273
+ - MAX_SIZE
274
+ - MIN
275
+ - MIN_LENGTH
276
+ - MIN_SIZE
277
+ - ONE_OF_ALIGNMENT
278
+ - OTHER
279
+ - REQUIRED_FIELD
280
+ - REQUIRED_ONE_OF_FIELD
281
+ - VALIDATION
282
+
283
+ **ShippingOption**
284
+ Properties:
285
+ - code: string - Unique code that acts as an ID for a shipping rate. For example, `"usps_std_overnight"`.
286
+ - cost: ShippingPrice - Shipping cost.
287
+ - logistics: DeliveryLogistics - Shipping logistics.
288
+ - title: string - Shipping rate title. For example, `"USPS Standard Overnight Delivery"`, `"Standard"`, or `"First-Class Package International"`.
289
+
290
+ **ShippingPrice**
291
+ Properties:
292
+ - additionalCharges: AdditionalCharge[] - Additional costs. For example, a handling fee for packaging fragile items.
293
+ - currency: string - Currency of the shipping rate price as a 3-letter [ISO-4217 currency code](https://en.wikipedia.org/wiki/ISO_4217). Must align with the `currency` passed to the function under the `metadata` field.
294
+
295
+ format CURRENCY
296
+ - price: string - The shipping rate's price. Must align with the [currency's decimal separator](https://en.wikipedia.org/wiki/ISO_4217#Active_codes).
297
+
298
+ format DECIMAL_VALUE
299
+
300
+ **ShippingRatesConfig**
301
+ Properties:
302
+ - dashboardUrl: string - URL to reach the shipping provider app's dashboard.
303
+
304
+ minLength 1, maxLength 2048, format WEB_URL
305
+ - deploymentUri: string - Base URI where the endpoints are called.
306
+ Wix eCommerce appends the endpoint path to the base URI.
307
+ For example, to call the Get Shipping Rates endpoint at `https://my-shipping-provider.com/v1/getRates`,
308
+ the base URI you provide here is `https://my-shipping-provider.com/`.
309
+
310
+ minLength 1
311
+ - description: string - Description of the shipping provider.
312
+
313
+ maxLength 200
314
+ - fallbackDefinitionMandatory: boolean - Whether to require the site owner to define a fallback/default rate. Set to `true` if you do not provide rates as part of the integration.
315
+ - learnMoreUrl: string - URL to more info about the shipping provider.
316
+
317
+ maxLength 200
318
+ - name: string - Human-readable name of the shipping provider.
319
+
320
+ minLength 1, maxLength 64
321
+ - thumbnailUrl: string - Thumbnail image of the shipping rates provider. Displayed in the shipping settings section in the Dashboard.
322
+ The URL must be of an image uploaded to the [Wix Media Manager](https://support.wix.com/en/article/wix-media-uploading-media-to-the-media-manager).
323
+
324
+ format WEB_URL
325
+
326
+ **StreetAddress**
327
+ Properties:
328
+ - name: string - Street name.
329
+ - number: string - Street number.
330
+
331
+ **VatId**
332
+ Properties:
333
+ - _id: string - Customer's tax ID.
334
+ - type: VatType - Tax type.
335
+
336
+ Supported values:
337
+ + `CPF`: for individual tax payers
338
+ + `CNPJ`: for corporations
339
+
340
+ **VatType**
341
+ Enum values:
342
+ - CNPJ: CNPJ - for corporations
343
+ - CPF: CPF - for individual tax payers.
344
+ - UNSPECIFIED
345
+
346
+ **WeightUnit**
347
+ Enum values:
348
+ - KG: Kilograms.
349
+ - LB: Pounds.
350
+ - UNSPECIFIED_WEIGHT_UNIT: Weight unit can't be classified due to an error.
351
+ </types>
352
+ </shipping_rates_service_plugin>