@scayle/storefront-core 8.8.0 → 8.10.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 (65) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/helpers/advancedAttributeHelpers.d.ts +27 -0
  3. package/dist/helpers/arrayHelpers.d.ts +7 -0
  4. package/dist/helpers/attributeHelpers.d.ts +32 -0
  5. package/dist/helpers/basketHelpers.d.ts +7 -0
  6. package/dist/helpers/categoryHelper.d.ts +38 -0
  7. package/dist/helpers/filterHelper.d.ts +96 -10
  8. package/dist/helpers/formHelpers.d.ts +57 -24
  9. package/dist/helpers/imageHelpers.d.ts +18 -0
  10. package/dist/helpers/localization.d.ts +6 -4
  11. package/dist/helpers/objectHelpers.d.ts +7 -0
  12. package/dist/helpers/orderHelpers.d.ts +31 -16
  13. package/dist/helpers/productDisruptorHelper.d.ts +43 -0
  14. package/dist/helpers/productHelpers.d.ts +169 -0
  15. package/dist/helpers/sanitizationHelpers.d.ts +61 -0
  16. package/dist/helpers/sortingHelper.d.ts +16 -0
  17. package/dist/helpers/stringHelpers.d.ts +14 -0
  18. package/dist/index.d.ts +3 -1
  19. package/dist/rpc/methods/basket/basket.d.ts +95 -10
  20. package/dist/rpc/methods/basket/basket.mjs +4 -5
  21. package/dist/rpc/methods/brands.d.ts +26 -0
  22. package/dist/rpc/methods/campaign.d.ts +8 -4
  23. package/dist/rpc/methods/categories.d.ts +65 -5
  24. package/dist/rpc/methods/categories.mjs +2 -1
  25. package/dist/rpc/methods/cbd.d.ts +10 -0
  26. package/dist/rpc/methods/checkout/checkout.d.ts +42 -3
  27. package/dist/rpc/methods/checkout/checkout.mjs +2 -3
  28. package/dist/rpc/methods/checkout/order.d.ts +12 -0
  29. package/dist/rpc/methods/checkout/shopUser.d.ts +20 -0
  30. package/dist/rpc/methods/checkout/shopUserAddresses.d.ts +7 -0
  31. package/dist/rpc/methods/navigationTrees.d.ts +27 -0
  32. package/dist/rpc/methods/oauth/idp.d.ts +24 -0
  33. package/dist/rpc/methods/products.d.ts +160 -36
  34. package/dist/rpc/methods/products.mjs +8 -11
  35. package/dist/rpc/methods/promotion.d.ts +46 -4
  36. package/dist/rpc/methods/search.d.ts +17 -12
  37. package/dist/rpc/methods/search.mjs +4 -2
  38. package/dist/rpc/methods/session.d.ts +71 -0
  39. package/dist/rpc/methods/session.mjs +13 -13
  40. package/dist/rpc/methods/shopConfiguration.d.ts +12 -1
  41. package/dist/rpc/methods/shopConfiguration.mjs +2 -1
  42. package/dist/rpc/methods/user.d.ts +34 -4
  43. package/dist/rpc/methods/variants.d.ts +30 -2
  44. package/dist/rpc/methods/variants.mjs +1 -2
  45. package/dist/rpc/methods/wishlist.d.ts +42 -7
  46. package/dist/rpc/methods/wishlist.mjs +3 -4
  47. package/dist/test/factories/user.d.ts +10 -0
  48. package/dist/types/api/auth.d.ts +67 -0
  49. package/dist/types/api/context.d.ts +82 -1
  50. package/dist/types/api/rpc.d.ts +19 -0
  51. package/dist/types/breadcrumb.d.ts +9 -0
  52. package/dist/types/promises.d.ts +10 -0
  53. package/dist/types/sapi/basket.d.ts +26 -1
  54. package/dist/types/sapi/filter.d.ts +37 -0
  55. package/dist/types/sapi/navigation.d.ts +16 -4
  56. package/dist/types/sapi/order.d.ts +137 -242
  57. package/dist/types/sapi/product.d.ts +85 -0
  58. package/dist/types/sapi/productFilter.d.ts +14 -0
  59. package/dist/types/sapi/router.d.ts +3 -0
  60. package/dist/types/sapi/search.d.ts +19 -0
  61. package/dist/types/sapi/sorting.d.ts +7 -0
  62. package/dist/types/sapi/wishlist.d.ts +6 -0
  63. package/dist/types/user.d.ts +102 -0
  64. package/dist/utils/campaign.d.ts +25 -10
  65. package/package.json +4 -4
@@ -1,116 +1,39 @@
1
- /**
2
- * This file was automatically generated by json-schema-to-typescript.
3
- * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
- * and run json-schema-to-typescript to regenerate this file.
5
- */
6
- export type TimestampOfOrderConfirmation = string;
7
- export type ThisFieldRepresentsTheAdditionalFeesExcludingTheTaxes = number;
8
- export type ThisFieldRepresentsTheAdditionalFeesIncludingTheTaxes = number;
9
- export type TheIncludedVATAmount = number;
10
- export type TheIncludedVATRateInPercentAsIntegerRepresentation = number;
11
- export type ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes = number;
12
- export type AbsoluteValueOfTheAppliedTax = number;
13
- /**
14
- * This price excludes taxes, but also includes all applicable reductions.
15
- */
16
- export type ItemPriceExcludingTaxes = number;
17
- /**
18
- * The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provdided on the request).
19
- */
20
- export type ItemPriceIncludingTaxes = number;
21
- /**
22
- * The three character [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code that identifies the currency. The currency is defined on the configuration of the shop, and can be modified in the cloud panel.
23
- */
24
- export type CharacterCurrencyCode = string;
25
- export type UniqueIdentifierOfTheState = string;
26
- export type NameOfTheState = string;
27
- export type UniqueIdentifierOfTheState1 = string;
28
- export type NameOfTheState1 = string;
29
- export type UniqueIdentifierOfTheState2 = string;
30
- export type NameOfTheState2 = string;
31
- export type TimestampOfOrderInvoice = string;
32
- export type UniqueNumericIdentifierOfTheItem = number;
33
- /**
34
- * The number of deliverable items available in the warehouse for immediate shipping.
35
- */
36
- export type AvailableQuantityInTheWarehouse = number;
37
- /**
38
- * The three character [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code that identifies the currency. The currency is defined on the configuration of the shop, and can be modified in the cloud panel.
39
- */
40
- export type CharacterCurrencyCode1 = string;
41
- /**
42
- * Whether the return shipment got triggered manually. Is missing in case there is no return shipment.
43
- */
44
- export type TheReturnShipmentHasBeenTriggeredByCCI = boolean;
45
- export type UniqueIdentifierOfTheItem = string;
46
1
  /**
47
2
  * Items are grouped by package, depending on the item's supplier configuration. The `packageId` references an entry in the packages list with delivery estimates and expected carrier.
48
3
  */
49
4
  export type PackageReference = number;
50
- export type ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1 = number;
51
- export type AbsoluteValueOfTheAppliedTax1 = number;
52
- export type RelativeValueOfTheAppliedTax = number;
53
- export type UndiscountedItemPriceExcludingTaxes = number;
54
- export type UndiscountedItemPriceIncludingTaxes = number;
55
- /**
56
- * This price excludes taxes, but also includes all applicable reductions.
57
- */
58
- export type ItemPriceExcludingTaxes1 = number;
59
- /**
60
- * The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provdided on the request).
61
- */
62
- export type ItemPriceIncludingTaxes1 = number;
63
- /**
64
- * the warehouse id where the item are being picking from.
65
- */
66
- export type PickingWarehouseId = null | number;
67
- /**
68
- * The package identification inside of the warehouse.
69
- */
70
- export type WarehousePackageReference = null | number;
71
- export type TimestampOfItemCreation = string;
72
- export type TimestampOfLastItemUpdate = string;
73
- /**
74
- * Basket and order items are matched to a package by cross-referencing the `item[].packageId`.
75
- */
76
- export type ReferenceByWhichThePackageIsIdentified = number;
77
- export type CarrierShippingTheItem = string;
78
- export type LatestExpectedDeliveryDate = string;
79
- export type EarliestExpectedDeliveryDate = string;
80
- export type ReturnIdentCodeOfTheItem = null | string;
81
- export type ShipmentKeyOfTheItem = string;
82
5
  /**
83
6
  * The distribution of items across packages is calculated based on the supplierId. Once shipments are processed, the packages may be updated to reflect the actual shipments.
84
7
  */
85
8
  export type ListOfPackages = {
86
- id: ReferenceByWhichThePackageIsIdentified;
87
- carrierKey: CarrierShippingTheItem;
9
+ /**
10
+ * Basket and order items are matched to a package by cross-referencing the `item[].packageId`.
11
+ */
12
+ id: number;
13
+ carrierKey: string;
88
14
  /**
89
15
  * The delivery dates are calculated based on the hour-to-hour estimates configured per supplier in the cloud panel. Once the order has been confirmed and shipments have been received, the calculation is based on the warehouse cut-off times and transport duration. If the carrier provides a delivery estimate, this is applied.
90
16
  */
91
17
  deliveryDate: {
92
- maximum: LatestExpectedDeliveryDate;
93
- minimum: EarliestExpectedDeliveryDate;
18
+ maximum: string;
19
+ minimum: string;
94
20
  };
95
21
  deliveryStatus: 'open' | 'shipment_pending' | 'delegation_pending' | 'shipment_completed' | 'cancellation_completed';
96
- returnIdentCode?: ReturnIdentCodeOfTheItem;
97
- shipmentKey?: ShipmentKeyOfTheItem;
22
+ returnIdentCode?: null | string;
23
+ shipmentKey?: string;
98
24
  tracking?: {
99
25
  id?: string;
100
26
  url?: string;
101
27
  };
102
28
  }[];
103
- export type WhetherThePaymentMethodIsAGiftCard = boolean;
104
- export type NumberOfInstallmentsChosenByTheCustomerForTheOrder = number;
105
- export type IfTrueTheCustomerElectedToHaveADelayInPaymentCapture = boolean;
106
- export type TimestampOfOrderCreation = string;
107
- export type TimestampOfLastOrderUpdate = string;
108
- export interface ThisFieldHoldsDetailsAboutTheIncludedVATTax {
109
- amount: TheIncludedVATAmount;
110
- rate: TheIncludedVATRateInPercentAsIntegerRepresentation;
111
- }
112
29
  /**
113
- * When an item cannot be shipped within the regular delivery timeframe, and the warehouse is already aware of this, prior to the customer placing the order (ie it is not an unintentionally delayed delivery). This is generally the case when the item is out of stock and: the warehouse is waiting for incoming returns to restock the item, the warehouse has ordered fresh stocks from the supplier/manufacturer and is waiting for these to be shipped to the warehouse.
30
+ * When an item cannot be shipped within the regular delivery timeframe,
31
+ * and the warehouse is already aware of this, prior to the customer placing the
32
+ * order (ie it is not an unintentionally delayed delivery).
33
+ * This is generally the case when the item is out of stock and:
34
+ * the warehouse is waiting for incoming returns to restock the item,
35
+ * the warehouse has ordered fresh stocks from the supplier/manufacturer and is
36
+ * waiting for these to be shipped to the warehouse.
114
37
  */
115
38
  export interface DeliveryForecastFromWarehouse {
116
39
  deliverable?: {
@@ -122,123 +45,68 @@ export interface DeliveryForecastFromWarehouse {
122
45
  [k: string]: unknown;
123
46
  };
124
47
  }
48
+ export type OrderAddressRecipientGender = 'm' | 'f' | 'd';
49
+ export type OrderAddressRecipientType = 'personal' | 'retail' | 'organization' | 'family';
50
+ export interface OrderAddress {
51
+ id: number;
52
+ additional?: string;
53
+ city: string;
54
+ collectionPoint?: {
55
+ customerKey?: string;
56
+ description?: string;
57
+ key: string;
58
+ type: string;
59
+ };
60
+ countryCode: string;
61
+ houseNumber?: string;
62
+ isBillingAddress?: boolean;
63
+ isDefault: {
64
+ billing: boolean;
65
+ shipping: boolean;
66
+ };
67
+ isShippingAddress?: boolean;
68
+ recipient: {
69
+ firstName?: string;
70
+ gender?: OrderAddressRecipientGender;
71
+ lastName: string;
72
+ title?: string | null;
73
+ type: OrderAddressRecipientType;
74
+ };
75
+ referenceKey?: string;
76
+ street: string;
77
+ zipCode: string;
78
+ createdAt: string;
79
+ updatedAt: string;
80
+ state?: string;
81
+ }
82
+ export interface OrderForwardAddress {
83
+ additional?: string;
84
+ city?: string;
85
+ collectionPoint?: {
86
+ customerKey?: string;
87
+ description?: string;
88
+ key?: string;
89
+ type?: string;
90
+ };
91
+ countryCode?: string;
92
+ houseNumber?: string;
93
+ recipient?: {
94
+ firstName?: string;
95
+ gender?: OrderAddressRecipientGender;
96
+ lastName?: string;
97
+ title?: string | null;
98
+ type?: OrderAddressRecipientType;
99
+ };
100
+ }
125
101
  export interface Order {
126
102
  /**
127
- * This `id` can be applied as a parameter on the url to retrieve an individual order in the [Fetch Order by ID](#fetch-order-by-id) endpoint.
103
+ * The `id` can be applied as a parameter on the url to retrieve an individual order in the [Fetch Order by ID](#fetch-order-by-id) endpoint.
128
104
  */
129
105
  id: number;
130
106
  address?: {
131
- billing: {
132
- id: number;
133
- /**
134
- * Additional data pertaining to the address, such as `c/o AboutYou`.
135
- */
136
- additional?: string;
137
- city: string;
138
- /**
139
- * A collection point is an alternate shipping address, which will hold the customer's packages until pickup. Examples for collection points are DHL Packstations, DHL Post Offices and Hermes Paketshops.
140
- */
141
- collectionPoint?: {
142
- customerKey?: string;
143
- description?: string;
144
- key: string;
145
- type: ('hermes_parcelshop' | 'dhl_packstation' | 'dhl_postoffice' | 'postsk_postoffice' | 'postsk_parcelbox' | 'gls_postoffice' | 'gls_packstation' | 'gls_parcelshop' | 'post_office' | 'postsi_postoffice' | 'postsi_packstation' | 'omniva_parcel_shop' | 'omniva_packstation' | 'offline-store' | 'fastwayie_packstation' | 'fastwayie_parcelshop' | 'generic' | 'packstation' | 'parcel_shop' | 'posteitaliane_packstation' | 'posteitaliane_parcelshop' | 'postifi_packstation' | 'postifi_parcelshop' | 'zasilcz_parcelshop' | 'zasilcz_packstation' | 'reba_packstation' | 'reba_parcel_shop') | string;
146
- };
147
- countryCode: string;
148
- houseNumber?: string;
149
- isBillingAddress?: boolean;
150
- isDefault: {
151
- billing: boolean;
152
- shipping: boolean;
153
- };
154
- isShippingAddress?: boolean;
155
- recipient: {
156
- firstName?: string;
157
- gender?: 'm' | 'f' | 'd';
158
- lastName: string;
159
- title?: null | string;
160
- type: 'personal' | 'retail' | 'organization' | 'family';
161
- };
162
- /**
163
- * External reference set by the client to integrate a 3rd party system
164
- */
165
- referenceKey?: string;
166
- street: string;
167
- zipCode: string;
168
- createdAt: string;
169
- updatedAt: string;
170
- state?: string;
171
- };
172
- forward?: {
173
- /**
174
- * Additional data pertaining to the address, such as `c/o AboutYou`.
175
- */
176
- additional?: string;
177
- city?: string;
178
- /**
179
- * A collection point is an alternate shipping address, which will hold the customer's packages until pickup. Examples for collection points are DHL Packstations, DHL Post Offices and Hermes Paketshops.
180
- */
181
- collectionPoint?: {
182
- customerKey?: string;
183
- description?: string;
184
- key?: string;
185
- type?: ('hermes_parcelshop' | 'dhl_packstation' | 'dhl_postoffice' | 'postsk_postoffice' | 'postsk_parcelbox' | 'gls_postoffice' | 'gls_packstation' | 'gls_parcelshop' | 'post_office' | 'postsi_postoffice' | 'postsi_packstation' | 'omniva_parcel_shop' | 'omniva_packstation' | 'offline-store' | 'fastwayie_packstation' | 'fastwayie_parcelshop' | 'generic' | 'packstation' | 'parcel_shop' | 'posteitaliane_packstation' | 'posteitaliane_parcelshop' | 'postifi_packstation' | 'postifi_parcelshop' | 'zasilcz_parcelshop' | 'zasilcz_packstation' | 'reba_packstation' | 'reba_parcel_shop') | string;
186
- };
187
- countryCode?: string;
188
- houseNumber?: string;
189
- recipient?: {
190
- firstName?: string;
191
- gender?: 'm' | 'f' | 'd';
192
- lastName?: string;
193
- title?: null | string;
194
- type?: 'personal' | 'retail' | 'organization' | 'family';
195
- };
196
- street?: string;
197
- zipCode?: string;
198
- createdAt?: string;
199
- updatedAt?: string;
200
- };
201
- shipping: {
202
- id: number;
203
- /**
204
- * Additional data pertaining to the address, such as `c/o AboutYou`.
205
- */
206
- additional?: string;
207
- city: string;
208
- /**
209
- * A collection point is an alternate shipping address, which will hold the customer's packages until pickup. Examples for collection points are DHL Packstations, DHL Post Offices and Hermes Paketshops.
210
- */
211
- collectionPoint?: {
212
- customerKey?: string;
213
- description?: string;
214
- key: string;
215
- type: ('hermes_parcelshop' | 'dhl_packstation' | 'dhl_postoffice' | 'postsk_postoffice' | 'postsk_parcelbox' | 'gls_postoffice' | 'gls_packstation' | 'gls_parcelshop' | 'post_office' | 'postsi_postoffice' | 'postsi_packstation' | 'omniva_parcel_shop' | 'omniva_packstation' | 'offline-store' | 'fastwayie_packstation' | 'fastwayie_parcelshop' | 'generic' | 'packstation' | 'parcel_shop' | 'posteitaliane_packstation' | 'posteitaliane_parcelshop' | 'postifi_packstation' | 'postifi_parcelshop' | 'zasilcz_parcelshop' | 'zasilcz_packstation' | 'reba_packstation' | 'reba_parcel_shop') | string;
216
- };
217
- countryCode: string;
218
- houseNumber?: string;
219
- isBillingAddress?: boolean;
220
- isDefault: {
221
- billing: boolean;
222
- shipping: boolean;
223
- };
224
- isShippingAddress?: boolean;
225
- recipient: {
226
- firstName?: string;
227
- gender?: 'm' | 'f' | 'd';
228
- lastName: string;
229
- title?: null | string;
230
- type: 'personal' | 'retail' | 'organization' | 'family';
231
- };
232
- /**
233
- * External reference set by the client to integrate a 3rd party system
234
- */
235
- referenceKey?: string;
236
- street: string;
237
- zipCode: string;
238
- createdAt: string;
239
- updatedAt: string;
240
- state?: string;
241
- };
107
+ billing: OrderAddress;
108
+ forward?: OrderForwardAddress;
109
+ shipping: OrderAddress;
242
110
  };
243
111
  /**
244
112
  * Reference to the basket attached to this order
@@ -248,7 +116,7 @@ export interface Order {
248
116
  * Reference to the campaign applied to this order
249
117
  */
250
118
  campaignKey?: string;
251
- confirmedAt?: TimestampOfOrderConfirmation;
119
+ confirmedAt?: string;
252
120
  contacts?: {
253
121
  type?: string;
254
122
  value?: string;
@@ -262,14 +130,17 @@ export interface Order {
262
130
  */
263
131
  appliedFees?: {
264
132
  amount: {
265
- withoutTax: ThisFieldRepresentsTheAdditionalFeesExcludingTheTaxes;
266
- withTax: ThisFieldRepresentsTheAdditionalFeesIncludingTheTaxes;
133
+ withoutTax: number;
134
+ withTax: number;
267
135
  };
268
136
  category: 'payment' | 'delivery' | 'percentage_payment' | 'return';
269
137
  key: string;
270
138
  option?: string;
271
139
  tax?: {
272
- vat: ThisFieldHoldsDetailsAboutTheIncludedVATTax;
140
+ vat: {
141
+ amount: number;
142
+ rate: number;
143
+ };
273
144
  };
274
145
  }[];
275
146
  /**
@@ -277,7 +148,7 @@ export interface Order {
277
148
  */
278
149
  appliedReductions?: {
279
150
  amount: {
280
- absoluteWithTax: ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes;
151
+ absoluteWithTax: number;
281
152
  /**
282
153
  * The `rate` is calculated on the basis of the reduction in relation to the `preDiscountPrice` price.
283
154
  */
@@ -308,13 +179,19 @@ export interface Order {
308
179
  * List of all taxes applied in calculating the `price.withTax`
309
180
  */
310
181
  vat?: {
311
- amount: AbsoluteValueOfTheAppliedTax;
182
+ amount: number;
312
183
  };
313
184
  };
314
- withoutTax: ItemPriceExcludingTaxes;
315
- withTax: ItemPriceIncludingTaxes;
185
+ /**
186
+ * This price excludes taxes, but also includes all applicable reductions.
187
+ */
188
+ withoutTax: number;
189
+ /**
190
+ * The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provdided on the request).
191
+ */
192
+ withTax: number;
316
193
  };
317
- currencyCode: CharacterCurrencyCode;
194
+ currencyCode: string;
318
195
  customData?: {
319
196
  score?: {
320
197
  [k: string]: unknown;
@@ -368,27 +245,33 @@ export interface Order {
368
245
  };
369
246
  detailedStatus: {
370
247
  billing: {
371
- code: UniqueIdentifierOfTheState;
372
- name: NameOfTheState;
248
+ code: string;
249
+ name: string;
373
250
  [k: string]: unknown;
374
251
  };
375
252
  order: {
376
- code: UniqueIdentifierOfTheState1;
377
- name: NameOfTheState1;
253
+ code: string;
254
+ name: string;
378
255
  [k: string]: unknown;
379
256
  };
380
257
  shipping: {
381
- code: UniqueIdentifierOfTheState2;
382
- name: NameOfTheState2;
258
+ code: string;
259
+ name: string;
383
260
  [k: string]: unknown;
384
261
  };
385
262
  [k: string]: unknown;
386
263
  };
387
- invoicedAt?: TimestampOfOrderInvoice;
264
+ invoicedAt?: string;
388
265
  items?: {
389
- id?: UniqueNumericIdentifierOfTheItem;
390
- availableQuantity?: AvailableQuantityInTheWarehouse;
391
- currency?: CharacterCurrencyCode1;
266
+ id?: string;
267
+ /**
268
+ * The number of deliverable items available in the warehouse for immediate shipping.
269
+ */
270
+ availableQuantity?: number;
271
+ /**
272
+ * The three character [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes) currency code that identifies the currency. The currency is defined on the configuration of the shop, and can be modified in the cloud panel.
273
+ */
274
+ currency?: string;
392
275
  /**
393
276
  * customData allows the tenant to attach data to an item. The data will remain attached to the item from the basket through the process of order creation and delegation and may be displayed to the customer during the order lifecycle.
394
277
  */
@@ -396,7 +279,10 @@ export interface Order {
396
279
  [k: string]: unknown;
397
280
  };
398
281
  deliveryForecast?: DeliveryForecastFromWarehouse;
399
- isManuallyReturnedByCci?: TheReturnShipmentHasBeenTriggeredByCCI;
282
+ /**
283
+ * Whether the return shipment got triggered manually. Is missing in case there is no return shipment.
284
+ */
285
+ isManuallyReturnedByCci?: boolean;
400
286
  itemGroup?: null | {
401
287
  /**
402
288
  * Item group ID
@@ -411,7 +297,7 @@ export interface Order {
411
297
  */
412
298
  isRequired: boolean;
413
299
  };
414
- key: UniqueIdentifierOfTheItem;
300
+ key: string;
415
301
  lowestPriorPrice?: null | {
416
302
  /**
417
303
  * Difference to the current price
@@ -439,7 +325,7 @@ export interface Order {
439
325
  */
440
326
  appliedReductions?: {
441
327
  amount: {
442
- absoluteWithTax: ThisFieldRepresentsTheDiscountAmountIncludingTheTaxes1;
328
+ absoluteWithTax: number;
443
329
  /**
444
330
  * The `rate` is calculated on the basis of the reduction in relation to the `preDiscountPrice` price.
445
331
  */
@@ -461,14 +347,20 @@ export interface Order {
461
347
  */
462
348
  tax: {
463
349
  [k: string]: {
464
- amount: AbsoluteValueOfTheAppliedTax1;
465
- rate: RelativeValueOfTheAppliedTax;
350
+ amount: number;
351
+ rate: number;
466
352
  };
467
353
  };
468
- undiscountedWithOutTax?: UndiscountedItemPriceExcludingTaxes;
469
- undiscountedWithTax?: UndiscountedItemPriceIncludingTaxes;
470
- withoutTax: ItemPriceExcludingTaxes1;
471
- withTax: ItemPriceIncludingTaxes1;
354
+ undiscountedWithOutTax?: number;
355
+ undiscountedWithTax?: number;
356
+ /**
357
+ * This price excludes taxes, but also includes all applicable reductions.
358
+ */
359
+ withoutTax: number;
360
+ /**
361
+ * The price is calculated including taxes and all applicable reductions such as discounts for sale and campaigns (should a campaign key be provided on the request).
362
+ */
363
+ withTax: number;
472
364
  };
473
365
  product: {
474
366
  [k: string]: unknown;
@@ -481,10 +373,13 @@ export interface Order {
481
373
  variant: {
482
374
  [k: string]: unknown;
483
375
  };
484
- warehouseId?: PickingWarehouseId;
485
- warehousePackageGroupId?: WarehousePackageReference;
486
- createdAt: TimestampOfItemCreation;
487
- updatedAt: TimestampOfLastItemUpdate;
376
+ /**
377
+ * The warehouse id where the item are being picking from.
378
+ */
379
+ warehouseId?: null | number;
380
+ warehousePackageGroupId?: null | number;
381
+ createdAt: string;
382
+ updatedAt: string;
488
383
  }[];
489
384
  loyaltyCard?: {
490
385
  cardNumber?: string;
@@ -507,11 +402,11 @@ export interface Order {
507
402
  amount?: number;
508
403
  type?: 'annualInterest' | 'firstInstallment' | 'subsequentInstallments';
509
404
  }[];
510
- isGiftCard?: WhetherThePaymentMethodIsAGiftCard;
405
+ isGiftCard?: boolean;
511
406
  key?: string;
512
407
  options?: {
513
- countOfInstallments?: NumberOfInstallmentsChosenByTheCustomerForTheOrder;
514
- hasPaybreak?: IfTrueTheCustomerElectedToHaveADelayInPaymentCapture;
408
+ countOfInstallments?: number;
409
+ hasPaybreak?: boolean;
515
410
  };
516
411
  transactionKey?: string;
517
412
  }[];
@@ -551,6 +446,6 @@ export interface Order {
551
446
  type: 'absolute' | 'relative';
552
447
  value: number;
553
448
  }[];
554
- createdAt: TimestampOfOrderCreation;
555
- updatedAt: TimestampOfLastOrderUpdate;
449
+ createdAt: string;
450
+ updatedAt: string;
556
451
  }
@@ -9,46 +9,98 @@ export type { AdvancedAttribute, AdvancedAttributes, Attributes, Product, Varian
9
9
  export type { ProductSortConfig, ProductsSearchEndpointParameters, ProductsSearchEndpointResponseData, } from '@scayle/storefront-api';
10
10
  export type { ProductWith, VariantWith, ProductSearchQuery };
11
11
  export type VariantId = number;
12
+ /**
13
+ * Represents a set of fields within an Attribute Group.
14
+ * This is a two-dimensional array used for structured attribute data,
15
+ * particularly in Complex Attribute Groups which handle combinations of
16
+ * different attributes (e.g., material composition).
17
+ * Each inner array represents a group of fields, and each object within
18
+ * represents a single field with key-value pairs (string, number, null, or undefined values).
19
+ *
20
+ * Example: In a "Material Composition" attribute group,
21
+ * a `FieldSet` might represent "cotton" with fields like
22
+ * `"material name"`: `"cotton"`, `"percentage"`: `70`.
23
+ *
24
+ * @see https://scayle.dev/en/user-guide/settings/product-structure/attribute-groups#advanced-attribute-groups
25
+ */
12
26
  export type FieldSet = Array<Array<{
13
27
  [key: string]: string | number | null | undefined;
14
28
  }>>;
29
+ /**
30
+ * Represents a hierarchical group of attributes, used for structured data
31
+ * like material composition. Contains a `fieldSet` for the current group's fields
32
+ * and a `groupSet` for nested groups, enabling complex structures.
33
+ * Values are managed in the SCAYLE Panel.
34
+ * Attribute Groups containing dates or numbers should not be translatable.
35
+ *
36
+ * Example:
37
+ * - Simple: `"material: 70% cotton, 30% polyester"`
38
+ * - Complex: `"inner material: 100% polyester, upper material: 70% cotton, 30% polyester"`
39
+ *
40
+ * @see https://scayle.dev/en/user-guide/settings/product-structure/attribute-groups#advanced-attribute-groups
41
+ */
15
42
  export declare type GroupSet = Array<{
16
43
  fieldSet: FieldSet;
17
44
  groupSet: GroupSet;
18
45
  }>;
46
+ /**
47
+ * Represents a product color.
48
+ */
19
49
  export interface ProductColor {
20
50
  id: number;
21
51
  label: string;
22
52
  value: string;
23
53
  }
54
+ /**
55
+ * Parameters for fetching a single product.
56
+ */
24
57
  export interface FetchProductParams {
25
58
  id: number;
59
+ /** Additional data to include with the product. */
26
60
  with?: ProductWith;
27
61
  pricePromotionKey?: string;
28
62
  includeSellableForFree?: boolean;
29
63
  }
64
+ /**
65
+ * Parameters for fetching multiple products.
66
+ */
30
67
  export interface FetchProductsParams {
31
68
  ids: number[];
69
+ /** Additional data to include with the products. */
32
70
  with?: ProductWith;
33
71
  pricePromotionKey?: string;
34
72
  includeSellableForFree?: boolean;
35
73
  }
74
+ /**
75
+ * Parameters for fetching multiple products by their IDs.
76
+ */
36
77
  export interface FetchProductsByIdsParams {
37
78
  ids: number[];
79
+ /** Additional data to include with the products. */
38
80
  with?: ProductWith;
39
81
  pricePromotionKey?: string;
40
82
  }
83
+ /**
84
+ * Parameters for fetching multiple products by their reference keys.
85
+ */
41
86
  export interface FetchProductsByReferenceKeysParams {
87
+ /** The reference keys of the products to fetch. */
42
88
  referenceKeys: string[];
89
+ /** Additional data to include with the products. */
43
90
  with?: ProductWith;
44
91
  pricePromotionKey?: string;
45
92
  }
93
+ /**
94
+ * Parameters for fetching products by category.
95
+ */
46
96
  export type FetchProductsByCategoryParams = {
97
+ /** Additional data to include with the products. */
47
98
  with?: ProductWith;
48
99
  cache?: CacheOptions;
49
100
  includedFilters?: Array<string>;
50
101
  perPage?: number;
51
102
  page?: number;
103
+ /** Search query parameters. */
52
104
  where?: {
53
105
  term?: ProductSearchQuery['term'];
54
106
  minPrice?: ProductSearchQuery['minPrice'];
@@ -57,11 +109,18 @@ export type FetchProductsByCategoryParams = {
57
109
  disableFuzziness?: ProductSearchQuery['disableFuzziness'];
58
110
  whitelistAttributes?: ProductSearchQuery['attributes'];
59
111
  };
112
+ /** Sort parameters. */
60
113
  sort?: FilterParams['sort'];
61
114
  pricePromotionKey?: string;
62
115
  includeSellableForFree?: boolean;
63
116
  includeSoldOut?: boolean;
117
+ /** OR filters operator. */
64
118
  orFiltersOperator?: ProductsSearchEndpointParameters['orFiltersOperator'];
119
+ /**
120
+ * Whether to track search analytics event.
121
+ *
122
+ * @see https://scayle.dev/en/developer-guide/products/search#search-analytics-and-tracking
123
+ */
65
124
  trackSearchAnalyticsEvent?: boolean;
66
125
  } & ({
67
126
  category?: string;
@@ -70,11 +129,20 @@ export type FetchProductsByCategoryParams = {
70
129
  categoryId: number;
71
130
  category?: undefined;
72
131
  });
132
+ /**
133
+ * Response from fetching products by category.
134
+ */
73
135
  export interface FetchProductsByCategoryResponse {
136
+ /** The fetched products. */
74
137
  products: Product[];
138
+ /** Pagination information. */
75
139
  pagination: ProductsByIdsEndpointResponseData['pagination'];
76
140
  }
141
+ /**
142
+ * Parameters for fetching the count of products.
143
+ */
77
144
  export type FetchProductsCountParams = {
145
+ /** Search query parameters. */
78
146
  where?: {
79
147
  term?: ProductSearchQuery['term'];
80
148
  minPrice?: ProductSearchQuery['minPrice'];
@@ -86,6 +154,7 @@ export type FetchProductsCountParams = {
86
154
  includedFilters?: Array<string>;
87
155
  includeSoldOut?: boolean;
88
156
  includeSellableForFree?: boolean;
157
+ /** OR filters operator. */
89
158
  orFiltersOperator?: ProductsSearchEndpointParameters['orFiltersOperator'];
90
159
  } & ({
91
160
  category?: string;
@@ -94,11 +163,27 @@ export type FetchProductsCountParams = {
94
163
  categoryId: number;
95
164
  category?: undefined;
96
165
  });
166
+ /**
167
+ * Response from fetching the count of products.
168
+ */
97
169
  export interface FetchProductsCountResponse {
98
170
  count: number;
99
171
  }
172
+ /**
173
+ * Represents a simplified view of a product sibling, used for displaying related products.
174
+ * Includes only ID, a representative image, and available colors.
175
+ * This simplified representation is used within the `getProductSiblings` function.
176
+ */
100
177
  export interface ProductSibling {
101
178
  id: number;
179
+ /**
180
+ * The URL of the product's bust image, front view.
181
+ * May be null if no suitable image is found.
182
+ */
102
183
  image: ProductImage | null;
184
+ /**
185
+ * An array of color values for the sibling product.
186
+ * May be an empty array if the specified color attribute is not found on the product.
187
+ */
103
188
  colors: Value[];
104
189
  }