@scayle/storefront-core 8.12.3 → 8.14.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 +22 -0
- package/dist/api/customer.d.ts +1 -1
- package/dist/helpers/orderHelpers.d.ts +1 -65
- package/dist/rpc/methods/cbd.d.ts +1 -1
- package/dist/rpc/methods/checkout/checkout.mjs +1 -1
- package/dist/rpc/methods/checkout/order.d.ts +1 -1
- package/dist/types/sapi/order.d.ts +132 -137
- package/dist/types/user.d.ts +2 -1
- package/package.json +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 8.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Expose `PackageDeliveryStatus` type. This new type clearly defines the allowed values for a package's delivery status. This improves code clarity and helps prevent typos. It's used to replace the inline string literal types in the `ListOfPackages` type.
|
|
8
|
+
- Refactor the `Order` and `OrderItem` interfaces to be generic, allowing them to accept custom `Product` and `Variant` types. This allows to strongly type the `product` and `variant` data within orders and order items, leading to better type checking and potentially fewer runtime errors. This allows for compile-time checks and autocompletion when working with product and variant properties of `OrderItem` and items property of `Order`.
|
|
9
|
+
|
|
10
|
+
## 8.13.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- Expose `OrderStatus` and `OrderItem` interfaces from `order` types.
|
|
15
|
+
- Enhance the `OrderSummary` component by integrating the `OrderStatus` type
|
|
16
|
+
from the order `Order` interface. This update provides a more accurate and
|
|
17
|
+
detailed representation of the order status for users.
|
|
18
|
+
- Enhance order `detailedStatus` code type for `billing`, `order` and `shipping` properties and
|
|
19
|
+
expose `OrderStatusCode`, `BillingStatusCode` and `ShippingStatusCode`.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Added `fishery@>=2.2.3` as `peerDependencies`.
|
|
24
|
+
|
|
3
25
|
## 8.12.3
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/api/customer.d.ts
CHANGED
|
@@ -113,7 +113,7 @@ export declare class CustomerAPIClient {
|
|
|
113
113
|
*
|
|
114
114
|
* @see https://scayle.dev/en/api-guides/customer-account-api/resources/order/get-order
|
|
115
115
|
*/
|
|
116
|
-
getOrder(shopId: number, orderId: number): Promise<Order
|
|
116
|
+
getOrder(shopId: number, orderId: number): Promise<Order<Record<string, unknown>, Record<string, unknown>>>;
|
|
117
117
|
/**
|
|
118
118
|
* Update contact details of a customer.
|
|
119
119
|
*
|
|
@@ -6,71 +6,7 @@ import type { Order } from '../types';
|
|
|
6
6
|
*
|
|
7
7
|
* @returns An array of unique order items.
|
|
8
8
|
*/
|
|
9
|
-
export declare const getUniqueItemsFromOrder: (order: Order) =>
|
|
10
|
-
id?: string;
|
|
11
|
-
availableQuantity?: number;
|
|
12
|
-
currency?: string;
|
|
13
|
-
customData?: {
|
|
14
|
-
[k: string]: unknown;
|
|
15
|
-
};
|
|
16
|
-
deliveryForecast?: import("../types").DeliveryForecastFromWarehouse;
|
|
17
|
-
isManuallyReturnedByCci?: boolean;
|
|
18
|
-
itemGroup?: null | {
|
|
19
|
-
id: string;
|
|
20
|
-
isMainItem: boolean;
|
|
21
|
-
isRequired: boolean;
|
|
22
|
-
};
|
|
23
|
-
key: string;
|
|
24
|
-
lowestPriorPrice?: null | {
|
|
25
|
-
relativeDifferenceToPrice: number;
|
|
26
|
-
withTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
|
|
27
|
-
};
|
|
28
|
-
merchant?: {
|
|
29
|
-
id: number;
|
|
30
|
-
[k: string]: unknown;
|
|
31
|
-
};
|
|
32
|
-
packageId: import("../types").PackageReference;
|
|
33
|
-
price: {
|
|
34
|
-
appliedReductions?: {
|
|
35
|
-
amount: {
|
|
36
|
-
absoluteWithTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
|
|
37
|
-
relative: number;
|
|
38
|
-
};
|
|
39
|
-
category: "sale" | "campaign" | "voucher";
|
|
40
|
-
code?: string;
|
|
41
|
-
type: "relative" | "absolute";
|
|
42
|
-
}[];
|
|
43
|
-
overrideWithoutTax?: number;
|
|
44
|
-
overrideWithTax?: number;
|
|
45
|
-
reference?: {
|
|
46
|
-
size?: string;
|
|
47
|
-
unit?: string;
|
|
48
|
-
withTax?: number;
|
|
49
|
-
};
|
|
50
|
-
tax: {
|
|
51
|
-
[k: string]: {
|
|
52
|
-
amount: number;
|
|
53
|
-
rate: number;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
undiscountedWithOutTax?: number;
|
|
57
|
-
undiscountedWithTax?: number;
|
|
58
|
-
withoutTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
|
|
59
|
-
withTax: import("@scayle/storefront-api/dist/shared/storefront-api.CrBb99Bp").C;
|
|
60
|
-
};
|
|
61
|
-
product: {
|
|
62
|
-
[k: string]: unknown;
|
|
63
|
-
};
|
|
64
|
-
reservationKey?: string;
|
|
65
|
-
status: "available" | "cancelled" | "delivered" | "returned" | "unavailable";
|
|
66
|
-
variant: {
|
|
67
|
-
[k: string]: unknown;
|
|
68
|
-
};
|
|
69
|
-
warehouseId?: null | number;
|
|
70
|
-
warehousePackageGroupId?: null | number;
|
|
71
|
-
createdAt: string;
|
|
72
|
-
updatedAt: string;
|
|
73
|
-
}[] | undefined;
|
|
9
|
+
export declare const getUniqueItemsFromOrder: (order: Order) => import("../types").OrderItem<Record<string, unknown>, Record<string, unknown>>[] | undefined;
|
|
74
10
|
/**
|
|
75
11
|
* Gets the quantity of a specific item in an order based on its variant ID.
|
|
76
12
|
*
|
|
@@ -12,4 +12,4 @@ import type { Order, RpcContext } from '../../types';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const getOrderDataByCbd: ({ cbdToken }: {
|
|
14
14
|
cbdToken: string;
|
|
15
|
-
}, context: RpcContext) => Promise<ErrorResponse | Order
|
|
15
|
+
}, context: RpcContext) => Promise<ErrorResponse | Order<Record<string, unknown>, Record<string, unknown>>>;
|
|
@@ -36,7 +36,7 @@ export const getCheckoutToken = async function getCheckoutToken2(jwtPayload = {}
|
|
|
36
36
|
carrier,
|
|
37
37
|
basketId: context.basketKey,
|
|
38
38
|
campaignKey
|
|
39
|
-
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.
|
|
39
|
+
}).setIssuedAt(now).setNotBefore(now).setExpirationTime("1h").setIssuer(`${"@scayle/storefront-core"}@${"8.14.0"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
40
40
|
return {
|
|
41
41
|
accessToken: refreshedAccessToken,
|
|
42
42
|
checkoutJwt
|
|
@@ -14,4 +14,4 @@ import type { Order } from '../../../types';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const getOrderById: ({ orderId }: {
|
|
16
16
|
orderId: number;
|
|
17
|
-
}, context: import("../../../types").RpcContext) => Promise<ErrorResponse | Order
|
|
17
|
+
}, context: import("../../../types").RpcContext) => Promise<ErrorResponse | Order<Record<string, unknown>, Record<string, unknown>>>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { Gender } from '../user';
|
|
1
2
|
import type { CentAmount } from './product';
|
|
2
3
|
/**
|
|
3
4
|
* 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.
|
|
4
5
|
*/
|
|
5
6
|
export type PackageReference = number;
|
|
7
|
+
export type PackageDeliveryStatus = 'open' | 'shipment_pending' | 'delegation_pending' | 'shipment_completed' | 'cancellation_completed';
|
|
6
8
|
/**
|
|
7
9
|
* 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.
|
|
8
10
|
*/
|
|
@@ -19,7 +21,7 @@ export type ListOfPackages = {
|
|
|
19
21
|
maximum: string;
|
|
20
22
|
minimum: string;
|
|
21
23
|
};
|
|
22
|
-
deliveryStatus:
|
|
24
|
+
deliveryStatus: PackageDeliveryStatus;
|
|
23
25
|
returnIdentCode?: null | string;
|
|
24
26
|
shipmentKey?: string;
|
|
25
27
|
tracking?: {
|
|
@@ -99,7 +101,124 @@ export interface OrderForwardAddress {
|
|
|
99
101
|
type?: OrderAddressRecipientType;
|
|
100
102
|
};
|
|
101
103
|
}
|
|
102
|
-
export
|
|
104
|
+
export type OrderStatus = 'order_open' | 'payment_pending' | 'payment_reserved' | 'invoice_completed' | 'cancellation_pending' | 'cancellation_completed' | 'invoice_partially_completed';
|
|
105
|
+
export type OrderStatusCode = 'order_created' | 'order_open' | 'order_pended' | 'order_confirmed' | 'order_delegated' | 'order_shipped' | 'order_invoiced' | 'order_aborted' | 'order_cancelled' | 'order_imported' | 'order_invoice_error';
|
|
106
|
+
export type BillingStatusCode = 'billing_open' | 'billing_pending' | 'billing_payment_pending' | 'billing_completed' | 'billing_payment_cancelled' | 'billing_partially_refunded' | 'billing_refunded';
|
|
107
|
+
export type ShippingStatusCode = 'shipping_open' | 'shipping_not_deliveable' | 'shipping_ordered' | 'shipping_delivered' | 'shipping_cancelled' | 'shipping_undeliverable' | 'shipping_returned' | 'shipping_partially_returned' | 'shipping_partially_undeliverable';
|
|
108
|
+
export interface OrderItem<Product = Record<string, unknown>, Variant = Record<string, unknown>> {
|
|
109
|
+
id?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The number of deliverable items available in the warehouse for immediate shipping.
|
|
112
|
+
*/
|
|
113
|
+
availableQuantity?: number;
|
|
114
|
+
/**
|
|
115
|
+
* 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.
|
|
116
|
+
*/
|
|
117
|
+
currency?: string;
|
|
118
|
+
/**
|
|
119
|
+
* 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.
|
|
120
|
+
*/
|
|
121
|
+
customData?: Record<string, unknown>;
|
|
122
|
+
deliveryForecast?: DeliveryForecastFromWarehouse;
|
|
123
|
+
/**
|
|
124
|
+
* Whether the return shipment got triggered manually. Is missing in case there is no return shipment.
|
|
125
|
+
*/
|
|
126
|
+
isManuallyReturnedByCci?: boolean;
|
|
127
|
+
itemGroup?: null | {
|
|
128
|
+
/**
|
|
129
|
+
* Item group ID
|
|
130
|
+
*/
|
|
131
|
+
id: string;
|
|
132
|
+
/**
|
|
133
|
+
* Specifies the main item in the group (true for only one item in a group)
|
|
134
|
+
*/
|
|
135
|
+
isMainItem: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Specifies if the item is mandatory or optional
|
|
138
|
+
*/
|
|
139
|
+
isRequired: boolean;
|
|
140
|
+
};
|
|
141
|
+
key: string;
|
|
142
|
+
lowestPriorPrice?: null | {
|
|
143
|
+
/**
|
|
144
|
+
* Difference to the current price
|
|
145
|
+
*/
|
|
146
|
+
relativeDifferenceToPrice: number;
|
|
147
|
+
/**
|
|
148
|
+
* Lowest price including taxes
|
|
149
|
+
*/
|
|
150
|
+
withTax: CentAmount;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* the merchant id to which the item belongs.
|
|
154
|
+
*/
|
|
155
|
+
merchant?: {
|
|
156
|
+
id: number;
|
|
157
|
+
[k: string]: unknown;
|
|
158
|
+
};
|
|
159
|
+
packageId: PackageReference;
|
|
160
|
+
/**
|
|
161
|
+
* The price is provided in a currency's lowest denomination (e.g. cent for EUR). In a multi-supplier environment, the price displayed on an item is dictated by the supplier order of preference, which is configured in the cloud panel.
|
|
162
|
+
*/
|
|
163
|
+
price: {
|
|
164
|
+
/**
|
|
165
|
+
* The discounts detail the reductions included in the final `price.withTax` and `price.withoutTax` calculation.
|
|
166
|
+
*/
|
|
167
|
+
appliedReductions?: {
|
|
168
|
+
amount: {
|
|
169
|
+
absoluteWithTax: CentAmount;
|
|
170
|
+
/**
|
|
171
|
+
* The `rate` is calculated on the basis of the reduction in relation to the `preDiscountPrice` price.
|
|
172
|
+
*/
|
|
173
|
+
relative: number;
|
|
174
|
+
};
|
|
175
|
+
category: 'sale' | 'campaign' | 'voucher';
|
|
176
|
+
code?: string;
|
|
177
|
+
type: 'relative' | 'absolute';
|
|
178
|
+
}[];
|
|
179
|
+
overrideWithoutTax?: number;
|
|
180
|
+
overrideWithTax?: number;
|
|
181
|
+
reference?: {
|
|
182
|
+
size?: string;
|
|
183
|
+
unit?: string;
|
|
184
|
+
withTax?: number;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* List of all taxes applied in calculating the `price.withTax`
|
|
188
|
+
*/
|
|
189
|
+
tax: {
|
|
190
|
+
[k: string]: {
|
|
191
|
+
amount: number;
|
|
192
|
+
rate: number;
|
|
193
|
+
};
|
|
194
|
+
};
|
|
195
|
+
undiscountedWithOutTax?: number;
|
|
196
|
+
undiscountedWithTax?: number;
|
|
197
|
+
/**
|
|
198
|
+
* This price excludes taxes, but also includes all applicable reductions.
|
|
199
|
+
*/
|
|
200
|
+
withoutTax: CentAmount;
|
|
201
|
+
/**
|
|
202
|
+
* 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).
|
|
203
|
+
*/
|
|
204
|
+
withTax: CentAmount;
|
|
205
|
+
};
|
|
206
|
+
product: Product;
|
|
207
|
+
/**
|
|
208
|
+
* Reference set in the checkout when an item was reserved successfully.
|
|
209
|
+
*/
|
|
210
|
+
reservationKey?: string;
|
|
211
|
+
status: 'available' | 'cancelled' | 'delivered' | 'undeliverable' | 'returned' | 'unavailable';
|
|
212
|
+
variant: Variant;
|
|
213
|
+
/**
|
|
214
|
+
* The warehouse id where the item are being picking from.
|
|
215
|
+
*/
|
|
216
|
+
warehouseId?: null | number;
|
|
217
|
+
warehousePackageGroupId?: null | number;
|
|
218
|
+
createdAt: string;
|
|
219
|
+
updatedAt: string;
|
|
220
|
+
}
|
|
221
|
+
export interface Order<Product = Record<string, unknown>, Variant = Record<string, unknown>> {
|
|
103
222
|
/**
|
|
104
223
|
* 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.
|
|
105
224
|
*/
|
|
@@ -194,9 +313,7 @@ export interface Order {
|
|
|
194
313
|
};
|
|
195
314
|
currencyCode: string;
|
|
196
315
|
customData?: {
|
|
197
|
-
score?:
|
|
198
|
-
[k: string]: unknown;
|
|
199
|
-
} | string | number | unknown[] | boolean;
|
|
316
|
+
score?: Record<string, unknown> | string | number | unknown[] | boolean;
|
|
200
317
|
[k: string]: unknown;
|
|
201
318
|
};
|
|
202
319
|
customer?: {
|
|
@@ -213,14 +330,12 @@ export interface Order {
|
|
|
213
330
|
* Additional data attached by the client to enhance the customer
|
|
214
331
|
*/
|
|
215
332
|
customData?: {
|
|
216
|
-
score?:
|
|
217
|
-
[k: string]: unknown;
|
|
218
|
-
} | string | number | unknown[] | boolean;
|
|
333
|
+
score?: Record<string, unknown> | string | number | unknown[] | boolean;
|
|
219
334
|
[k: string]: unknown;
|
|
220
335
|
};
|
|
221
336
|
email?: string;
|
|
222
337
|
firstName?: string;
|
|
223
|
-
gender?:
|
|
338
|
+
gender?: Gender;
|
|
224
339
|
groups?: string[];
|
|
225
340
|
ipAddress?: string;
|
|
226
341
|
lastName: string;
|
|
@@ -245,143 +360,25 @@ export interface Order {
|
|
|
245
360
|
updatedAt: string;
|
|
246
361
|
};
|
|
247
362
|
detailedStatus: {
|
|
248
|
-
|
|
249
|
-
code:
|
|
363
|
+
order: {
|
|
364
|
+
code: OrderStatusCode;
|
|
250
365
|
name: string;
|
|
251
366
|
[k: string]: unknown;
|
|
252
367
|
};
|
|
253
|
-
|
|
254
|
-
code:
|
|
368
|
+
billing: {
|
|
369
|
+
code: BillingStatusCode;
|
|
255
370
|
name: string;
|
|
256
371
|
[k: string]: unknown;
|
|
257
372
|
};
|
|
258
373
|
shipping: {
|
|
259
|
-
code:
|
|
374
|
+
code: ShippingStatusCode;
|
|
260
375
|
name: string;
|
|
261
376
|
[k: string]: unknown;
|
|
262
377
|
};
|
|
263
378
|
[k: string]: unknown;
|
|
264
379
|
};
|
|
265
380
|
invoicedAt?: string;
|
|
266
|
-
items?:
|
|
267
|
-
id?: string;
|
|
268
|
-
/**
|
|
269
|
-
* The number of deliverable items available in the warehouse for immediate shipping.
|
|
270
|
-
*/
|
|
271
|
-
availableQuantity?: number;
|
|
272
|
-
/**
|
|
273
|
-
* 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.
|
|
274
|
-
*/
|
|
275
|
-
currency?: string;
|
|
276
|
-
/**
|
|
277
|
-
* 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.
|
|
278
|
-
*/
|
|
279
|
-
customData?: {
|
|
280
|
-
[k: string]: unknown;
|
|
281
|
-
};
|
|
282
|
-
deliveryForecast?: DeliveryForecastFromWarehouse;
|
|
283
|
-
/**
|
|
284
|
-
* Whether the return shipment got triggered manually. Is missing in case there is no return shipment.
|
|
285
|
-
*/
|
|
286
|
-
isManuallyReturnedByCci?: boolean;
|
|
287
|
-
itemGroup?: null | {
|
|
288
|
-
/**
|
|
289
|
-
* Item group ID
|
|
290
|
-
*/
|
|
291
|
-
id: string;
|
|
292
|
-
/**
|
|
293
|
-
* Specifies the main item in the group (true for only one item in a group)
|
|
294
|
-
*/
|
|
295
|
-
isMainItem: boolean;
|
|
296
|
-
/**
|
|
297
|
-
* Specifies if the item is mandatory or optional
|
|
298
|
-
*/
|
|
299
|
-
isRequired: boolean;
|
|
300
|
-
};
|
|
301
|
-
key: string;
|
|
302
|
-
lowestPriorPrice?: null | {
|
|
303
|
-
/**
|
|
304
|
-
* Difference to the current price
|
|
305
|
-
*/
|
|
306
|
-
relativeDifferenceToPrice: number;
|
|
307
|
-
/**
|
|
308
|
-
* Lowest price including taxes
|
|
309
|
-
*/
|
|
310
|
-
withTax: CentAmount;
|
|
311
|
-
};
|
|
312
|
-
/**
|
|
313
|
-
* the merchant id to which the item belongs.
|
|
314
|
-
*/
|
|
315
|
-
merchant?: {
|
|
316
|
-
id: number;
|
|
317
|
-
[k: string]: unknown;
|
|
318
|
-
};
|
|
319
|
-
packageId: PackageReference;
|
|
320
|
-
/**
|
|
321
|
-
* The price is provided in a currency's lowest denomination (e.g. cent for EUR). In a multi-supplier environment, the price displayed on an item is dictated by the supplier order of preference, which is configured in the cloud panel.
|
|
322
|
-
*/
|
|
323
|
-
price: {
|
|
324
|
-
/**
|
|
325
|
-
* The discounts detail the reductions included in the final `price.withTax` and `price.withoutTax` calculation.
|
|
326
|
-
*/
|
|
327
|
-
appliedReductions?: {
|
|
328
|
-
amount: {
|
|
329
|
-
absoluteWithTax: CentAmount;
|
|
330
|
-
/**
|
|
331
|
-
* The `rate` is calculated on the basis of the reduction in relation to the `preDiscountPrice` price.
|
|
332
|
-
*/
|
|
333
|
-
relative: number;
|
|
334
|
-
};
|
|
335
|
-
category: 'sale' | 'campaign' | 'voucher';
|
|
336
|
-
code?: string;
|
|
337
|
-
type: 'relative' | 'absolute';
|
|
338
|
-
}[];
|
|
339
|
-
overrideWithoutTax?: number;
|
|
340
|
-
overrideWithTax?: number;
|
|
341
|
-
reference?: {
|
|
342
|
-
size?: string;
|
|
343
|
-
unit?: string;
|
|
344
|
-
withTax?: number;
|
|
345
|
-
};
|
|
346
|
-
/**
|
|
347
|
-
* List of all taxes applied in calculating the `price.withTax`
|
|
348
|
-
*/
|
|
349
|
-
tax: {
|
|
350
|
-
[k: string]: {
|
|
351
|
-
amount: number;
|
|
352
|
-
rate: number;
|
|
353
|
-
};
|
|
354
|
-
};
|
|
355
|
-
undiscountedWithOutTax?: number;
|
|
356
|
-
undiscountedWithTax?: number;
|
|
357
|
-
/**
|
|
358
|
-
* This price excludes taxes, but also includes all applicable reductions.
|
|
359
|
-
*/
|
|
360
|
-
withoutTax: CentAmount;
|
|
361
|
-
/**
|
|
362
|
-
* 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).
|
|
363
|
-
*/
|
|
364
|
-
withTax: CentAmount;
|
|
365
|
-
};
|
|
366
|
-
product: {
|
|
367
|
-
[k: string]: unknown;
|
|
368
|
-
};
|
|
369
|
-
/**
|
|
370
|
-
* Reference set in the checkout when an item was reserved successfully.
|
|
371
|
-
*/
|
|
372
|
-
reservationKey?: string;
|
|
373
|
-
status: 'available' | 'cancelled' | 'delivered' | 'returned' | 'unavailable';
|
|
374
|
-
variant: {
|
|
375
|
-
[k: string]: unknown;
|
|
376
|
-
};
|
|
377
|
-
/**
|
|
378
|
-
* The warehouse id where the item are being picking from.
|
|
379
|
-
*/
|
|
380
|
-
warehouseId?: null | number;
|
|
381
|
-
warehousePackageGroupId?: null | number;
|
|
382
|
-
createdAt: string;
|
|
383
|
-
updatedAt: string;
|
|
384
|
-
}[];
|
|
381
|
+
items?: OrderItem<Product, Variant>[];
|
|
385
382
|
loyaltyCard?: {
|
|
386
383
|
cardNumber?: string;
|
|
387
384
|
points: number;
|
|
@@ -393,9 +390,7 @@ export interface Order {
|
|
|
393
390
|
/**
|
|
394
391
|
* The `data` attribute will contain the data pushed to the Checkout by the Payment Provider in use (or internally generated, should the payment not be provided by an external PSP). This object's structure depends on the PSP itself, however, it will contain the minimum dataset necessary for further processing of the Order.
|
|
395
392
|
*/
|
|
396
|
-
data?:
|
|
397
|
-
[k: string]: unknown;
|
|
398
|
-
};
|
|
393
|
+
data?: Record<string, unknown>;
|
|
399
394
|
/**
|
|
400
395
|
* Details about installments, included as a listing of the values involved in the Installments transaction.
|
|
401
396
|
*/
|
|
@@ -436,7 +431,7 @@ export interface Order {
|
|
|
436
431
|
*/
|
|
437
432
|
language: string;
|
|
438
433
|
};
|
|
439
|
-
status:
|
|
434
|
+
status: OrderStatus;
|
|
440
435
|
vouchers?: {
|
|
441
436
|
id: number;
|
|
442
437
|
applicableItems?: {
|
package/dist/types/user.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UseBasketParams } from './sapi/basket';
|
|
2
|
+
import type { OrderStatus } from './sapi/order';
|
|
2
3
|
import type { UseWishlistParams } from './sapi/wishlist';
|
|
3
4
|
/**
|
|
4
5
|
* Represents the gender of a user.
|
|
@@ -64,7 +65,7 @@ export interface OrderSummary {
|
|
|
64
65
|
/** The ID of the shop associated with the order. */
|
|
65
66
|
shopId: number;
|
|
66
67
|
/** The current status of the order. */
|
|
67
|
-
status?:
|
|
68
|
+
status?: OrderStatus;
|
|
68
69
|
}
|
|
69
70
|
/**
|
|
70
71
|
* Represents the status of a shop user.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.14.0",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
"access": "public",
|
|
9
9
|
"registry": "https://registry.npmjs.org/"
|
|
10
10
|
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"url": "git+https://github.com/scayle/storefront-core.git"
|
|
13
|
+
},
|
|
11
14
|
"website": "https://scayle.dev/en/storefront-guide/developer-guide/getting-started/about-storefront",
|
|
12
15
|
"sideEffects": false,
|
|
13
16
|
"exports": {
|
|
@@ -55,6 +58,9 @@
|
|
|
55
58
|
"test": "vitest --run --passWithNoTests",
|
|
56
59
|
"test:ci": "vitest --run --passWithNoTests --coverage --reporter=default --reporter=junit --outputFile=./coverage/junit.xml"
|
|
57
60
|
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"fishery": "^2.2.3"
|
|
63
|
+
},
|
|
58
64
|
"dependencies": {
|
|
59
65
|
"@scayle/storefront-api": "18.1.0",
|
|
60
66
|
"@scayle/unstorage-scayle-kv-driver": "0.1.1",
|
|
@@ -69,12 +75,13 @@
|
|
|
69
75
|
"devDependencies": {
|
|
70
76
|
"@scayle/eslint-config-storefront": "4.4.1",
|
|
71
77
|
"@types/crypto-js": "4.2.2",
|
|
72
|
-
"@types/node": "22.13.
|
|
78
|
+
"@types/node": "22.13.10",
|
|
73
79
|
"@types/webpack-env": "1.18.8",
|
|
74
80
|
"@vitest/coverage-v8": "2.1.9",
|
|
75
81
|
"dprint": "0.49.0",
|
|
76
|
-
"eslint": "9.
|
|
82
|
+
"eslint": "9.22.0",
|
|
77
83
|
"eslint-formatter-gitlab": "5.1.0",
|
|
84
|
+
"fishery": "2.2.3",
|
|
78
85
|
"publint": "0.2.12",
|
|
79
86
|
"rimraf": "6.0.1",
|
|
80
87
|
"typescript": "5.8.2",
|