@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.
- package/CHANGELOG.md +85 -0
- package/dist/helpers/advancedAttributeHelpers.d.ts +27 -0
- package/dist/helpers/arrayHelpers.d.ts +7 -0
- package/dist/helpers/attributeHelpers.d.ts +32 -0
- package/dist/helpers/basketHelpers.d.ts +7 -0
- package/dist/helpers/categoryHelper.d.ts +38 -0
- package/dist/helpers/filterHelper.d.ts +96 -10
- package/dist/helpers/formHelpers.d.ts +57 -24
- package/dist/helpers/imageHelpers.d.ts +18 -0
- package/dist/helpers/localization.d.ts +6 -4
- package/dist/helpers/objectHelpers.d.ts +7 -0
- package/dist/helpers/orderHelpers.d.ts +31 -16
- package/dist/helpers/productDisruptorHelper.d.ts +43 -0
- package/dist/helpers/productHelpers.d.ts +169 -0
- package/dist/helpers/sanitizationHelpers.d.ts +61 -0
- package/dist/helpers/sortingHelper.d.ts +16 -0
- package/dist/helpers/stringHelpers.d.ts +14 -0
- package/dist/index.d.ts +3 -1
- package/dist/rpc/methods/basket/basket.d.ts +95 -10
- package/dist/rpc/methods/basket/basket.mjs +4 -5
- package/dist/rpc/methods/brands.d.ts +26 -0
- package/dist/rpc/methods/campaign.d.ts +8 -4
- package/dist/rpc/methods/categories.d.ts +65 -5
- package/dist/rpc/methods/categories.mjs +2 -1
- package/dist/rpc/methods/cbd.d.ts +10 -0
- package/dist/rpc/methods/checkout/checkout.d.ts +42 -3
- package/dist/rpc/methods/checkout/checkout.mjs +2 -3
- package/dist/rpc/methods/checkout/order.d.ts +12 -0
- package/dist/rpc/methods/checkout/shopUser.d.ts +20 -0
- package/dist/rpc/methods/checkout/shopUserAddresses.d.ts +7 -0
- package/dist/rpc/methods/navigationTrees.d.ts +27 -0
- package/dist/rpc/methods/oauth/idp.d.ts +24 -0
- package/dist/rpc/methods/products.d.ts +160 -36
- package/dist/rpc/methods/products.mjs +8 -11
- package/dist/rpc/methods/promotion.d.ts +46 -4
- package/dist/rpc/methods/search.d.ts +17 -12
- package/dist/rpc/methods/search.mjs +4 -2
- package/dist/rpc/methods/session.d.ts +71 -0
- package/dist/rpc/methods/session.mjs +13 -13
- package/dist/rpc/methods/shopConfiguration.d.ts +12 -1
- package/dist/rpc/methods/shopConfiguration.mjs +2 -1
- package/dist/rpc/methods/user.d.ts +34 -4
- package/dist/rpc/methods/variants.d.ts +30 -2
- package/dist/rpc/methods/variants.mjs +1 -2
- package/dist/rpc/methods/wishlist.d.ts +42 -7
- package/dist/rpc/methods/wishlist.mjs +3 -4
- package/dist/test/factories/user.d.ts +10 -0
- package/dist/types/api/auth.d.ts +67 -0
- package/dist/types/api/context.d.ts +82 -1
- package/dist/types/api/rpc.d.ts +19 -0
- package/dist/types/breadcrumb.d.ts +9 -0
- package/dist/types/promises.d.ts +10 -0
- package/dist/types/sapi/basket.d.ts +26 -1
- package/dist/types/sapi/filter.d.ts +37 -0
- package/dist/types/sapi/navigation.d.ts +16 -4
- package/dist/types/sapi/order.d.ts +137 -242
- package/dist/types/sapi/product.d.ts +85 -0
- package/dist/types/sapi/productFilter.d.ts +14 -0
- package/dist/types/sapi/router.d.ts +3 -0
- package/dist/types/sapi/search.d.ts +19 -0
- package/dist/types/sapi/sorting.d.ts +7 -0
- package/dist/types/sapi/wishlist.d.ts +6 -0
- package/dist/types/user.d.ts +102 -0
- package/dist/utils/campaign.d.ts +25 -10
- 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
|
-
|
|
87
|
-
|
|
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:
|
|
93
|
-
minimum:
|
|
18
|
+
maximum: string;
|
|
19
|
+
minimum: string;
|
|
94
20
|
};
|
|
95
21
|
deliveryStatus: 'open' | 'shipment_pending' | 'delegation_pending' | 'shipment_completed' | 'cancellation_completed';
|
|
96
|
-
returnIdentCode?:
|
|
97
|
-
shipmentKey?:
|
|
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,
|
|
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
|
-
*
|
|
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
|
-
|
|
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?:
|
|
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:
|
|
266
|
-
withTax:
|
|
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:
|
|
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:
|
|
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:
|
|
182
|
+
amount: number;
|
|
312
183
|
};
|
|
313
184
|
};
|
|
314
|
-
|
|
315
|
-
|
|
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:
|
|
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:
|
|
372
|
-
name:
|
|
248
|
+
code: string;
|
|
249
|
+
name: string;
|
|
373
250
|
[k: string]: unknown;
|
|
374
251
|
};
|
|
375
252
|
order: {
|
|
376
|
-
code:
|
|
377
|
-
name:
|
|
253
|
+
code: string;
|
|
254
|
+
name: string;
|
|
378
255
|
[k: string]: unknown;
|
|
379
256
|
};
|
|
380
257
|
shipping: {
|
|
381
|
-
code:
|
|
382
|
-
name:
|
|
258
|
+
code: string;
|
|
259
|
+
name: string;
|
|
383
260
|
[k: string]: unknown;
|
|
384
261
|
};
|
|
385
262
|
[k: string]: unknown;
|
|
386
263
|
};
|
|
387
|
-
invoicedAt?:
|
|
264
|
+
invoicedAt?: string;
|
|
388
265
|
items?: {
|
|
389
|
-
id?:
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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:
|
|
465
|
-
rate:
|
|
350
|
+
amount: number;
|
|
351
|
+
rate: number;
|
|
466
352
|
};
|
|
467
353
|
};
|
|
468
|
-
undiscountedWithOutTax?:
|
|
469
|
-
undiscountedWithTax?:
|
|
470
|
-
|
|
471
|
-
|
|
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
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
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?:
|
|
405
|
+
isGiftCard?: boolean;
|
|
511
406
|
key?: string;
|
|
512
407
|
options?: {
|
|
513
|
-
countOfInstallments?:
|
|
514
|
-
hasPaybreak?:
|
|
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:
|
|
555
|
-
updatedAt:
|
|
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
|
}
|