@scayle/storefront-core 8.32.1 → 8.33.1
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 +74 -58
- package/dist/rpc/methods/checkout/checkout.mjs +1 -1
- package/dist/test/factories/index.d.ts +1 -0
- package/dist/test/factories/index.mjs +1 -0
- package/dist/test/factories/order.d.ts +8 -0
- package/dist/test/factories/order.mjs +362 -0
- package/dist/types/sapi/order.d.ts +9 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @scayle/storefront-core
|
|
2
2
|
|
|
3
|
+
## 8.33.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependency `@scayle/storefront-api@18.9.0` to `@scayle/storefront-api@workspace:*`
|
|
8
|
+
- Updated dependency `@scayle/unstorage-scayle-kv-driver@1.0.2` to `@scayle/unstorage-scayle-kv-driver@workspace:*`
|
|
9
|
+
|
|
10
|
+
## 8.33.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- Added test factories for order and all related types.
|
|
15
|
+
|
|
16
|
+
It is now possible to build orders with factory functions for testing purposes.
|
|
17
|
+
This will reduce the amount of boilerplate code needed to create test data.
|
|
18
|
+
|
|
3
19
|
## 8.32.1
|
|
4
20
|
|
|
5
21
|
## 8.32.0
|
|
@@ -19,23 +35,23 @@
|
|
|
19
35
|
- Added `minReduction` and `maxReduction` filter parameters to `FetchProductsByCategoryParams.where` and `FetchFiltersParams.where` types, and updated the `getProductsByCategory` and `getFilters` RPC methods to accept and handle these new reduction-based filtering conditions.
|
|
20
36
|
|
|
21
37
|
```ts
|
|
22
|
-
const { data } = useRpc(
|
|
38
|
+
const { data } = useRpc('getFilters', 'getFiltersKey', () => ({
|
|
23
39
|
where: {
|
|
24
40
|
minReduction: 10,
|
|
25
41
|
maxReduction: 20,
|
|
26
42
|
},
|
|
27
|
-
}))
|
|
43
|
+
}))
|
|
28
44
|
|
|
29
45
|
const { data } = useRpc(
|
|
30
|
-
|
|
31
|
-
|
|
46
|
+
'getProductsByCategory',
|
|
47
|
+
'getProductsByCategoryKey',
|
|
32
48
|
() => ({
|
|
33
49
|
where: {
|
|
34
50
|
minReduction: 10,
|
|
35
51
|
maxReduction: 20,
|
|
36
52
|
},
|
|
37
53
|
}),
|
|
38
|
-
)
|
|
54
|
+
)
|
|
39
55
|
```
|
|
40
56
|
|
|
41
57
|
## 8.30.3
|
|
@@ -66,28 +82,28 @@ No changes in this release.
|
|
|
66
82
|
|
|
67
83
|
```ts
|
|
68
84
|
export const existingHandlerWithoutParams = async (_context: RpcContext) => {
|
|
69
|
-
return
|
|
70
|
-
}
|
|
85
|
+
return 'existing handler'
|
|
86
|
+
}
|
|
71
87
|
|
|
72
88
|
export const existingHandlerWithParams = async (
|
|
73
89
|
{ name }: { name: string },
|
|
74
90
|
_context: RpcContext,
|
|
75
91
|
) => {
|
|
76
|
-
return name
|
|
77
|
-
}
|
|
92
|
+
return name
|
|
93
|
+
}
|
|
78
94
|
|
|
79
95
|
// will become
|
|
80
96
|
|
|
81
97
|
export const existingHandlerWithoutParams = defineRpcHandler(
|
|
82
98
|
async (_context: RpcContext) => {
|
|
83
|
-
return
|
|
99
|
+
return 'existing handler'
|
|
84
100
|
},
|
|
85
|
-
)
|
|
101
|
+
)
|
|
86
102
|
export const existingHandlerWithParams = defineRpcHandler(
|
|
87
103
|
async ({ name }: { name: string }, _context: RpcContext) => {
|
|
88
|
-
return name
|
|
104
|
+
return name
|
|
89
105
|
},
|
|
90
|
-
)
|
|
106
|
+
)
|
|
91
107
|
```
|
|
92
108
|
|
|
93
109
|
### Patch Changes
|
|
@@ -104,15 +120,15 @@ No changes in this release.
|
|
|
104
120
|
- Added an optional `hideEmptyCategories` parameter to `getCategoryTree`. When enabled, the product count for each category is retrieved, and categories (including their children) without any products are removed. Enabling this option may increase response times, especially for large category trees.
|
|
105
121
|
|
|
106
122
|
```ts
|
|
107
|
-
import { rpcMethods } from
|
|
123
|
+
import { rpcMethods } from '@scayle/storefront-core'
|
|
108
124
|
|
|
109
|
-
rpcMethods.getCategoryTree({ hideEmptyCategories: true }, rpcContext)
|
|
125
|
+
rpcMethods.getCategoryTree({ hideEmptyCategories: true }, rpcContext)
|
|
110
126
|
```
|
|
111
127
|
|
|
112
128
|
or
|
|
113
129
|
|
|
114
130
|
```ts
|
|
115
|
-
import { useCategoryTree } from
|
|
131
|
+
import { useCategoryTree } from '#storefront/composables'
|
|
116
132
|
|
|
117
133
|
const { data: rootCategories, status } = useCategoryTree(
|
|
118
134
|
{
|
|
@@ -120,8 +136,8 @@ No changes in this release.
|
|
|
120
136
|
hideEmptyCategories: true,
|
|
121
137
|
},
|
|
122
138
|
},
|
|
123
|
-
|
|
124
|
-
)
|
|
139
|
+
'category-navigation-tree',
|
|
140
|
+
)
|
|
125
141
|
```
|
|
126
142
|
|
|
127
143
|
### Patch Changes
|
|
@@ -553,12 +569,12 @@ To get the default campaign key, you can call the RPC method:
|
|
|
553
569
|
```typescript
|
|
554
570
|
// Before
|
|
555
571
|
async function rpcMethod(context) {
|
|
556
|
-
const campaignKey = { context }
|
|
572
|
+
const campaignKey = { context }
|
|
557
573
|
// ...
|
|
558
574
|
}
|
|
559
575
|
// After
|
|
560
576
|
async function rpcMethod(context) {
|
|
561
|
-
const campaignKey = await context.callRpc?.(
|
|
577
|
+
const campaignKey = await context.callRpc?.('getCampaignKey')
|
|
562
578
|
// ...
|
|
563
579
|
}
|
|
564
580
|
```
|
|
@@ -747,43 +763,43 @@ See [Overriding core RPC Methods](https://scayle.dev/en/storefront-guide/develop
|
|
|
747
763
|
|
|
748
764
|
```ts
|
|
749
765
|
const BadgeLabel = {
|
|
750
|
-
NEW:
|
|
751
|
-
SOLD_OUT:
|
|
752
|
-
ONLINE_EXCLUSIVE:
|
|
753
|
-
SUSTAINABLE:
|
|
754
|
-
PREMIUM:
|
|
755
|
-
DEFAULT:
|
|
756
|
-
} as const
|
|
766
|
+
NEW: 'new',
|
|
767
|
+
SOLD_OUT: 'sold_out',
|
|
768
|
+
ONLINE_EXCLUSIVE: 'online_exclusive',
|
|
769
|
+
SUSTAINABLE: 'sustainable',
|
|
770
|
+
PREMIUM: 'premium',
|
|
771
|
+
DEFAULT: '',
|
|
772
|
+
} as const
|
|
757
773
|
|
|
758
774
|
type BadgeLabelParamsKeys =
|
|
759
|
-
|
|
|
760
|
-
|
|
|
761
|
-
|
|
|
762
|
-
|
|
|
763
|
-
|
|
|
764
|
-
type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean
|
|
775
|
+
| 'isNew'
|
|
776
|
+
| 'isSoldOut'
|
|
777
|
+
| 'isOnlineOnly'
|
|
778
|
+
| 'isSustainable'
|
|
779
|
+
| 'isPremium'
|
|
780
|
+
type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>
|
|
765
781
|
|
|
766
782
|
const getBadgeLabel = (params: BadgeLabelParams = {}): string => {
|
|
767
783
|
if (!params) {
|
|
768
|
-
return BadgeLabel.DEFAULT
|
|
784
|
+
return BadgeLabel.DEFAULT
|
|
769
785
|
}
|
|
770
786
|
const { isNew, isSoldOut, isOnlineOnly, isSustainable, isPremium } =
|
|
771
|
-
params
|
|
787
|
+
params
|
|
772
788
|
|
|
773
789
|
if (isNew) {
|
|
774
|
-
return BadgeLabel.NEW
|
|
790
|
+
return BadgeLabel.NEW
|
|
775
791
|
} else if (isSoldOut) {
|
|
776
|
-
return BadgeLabel.SOLD_OUT
|
|
792
|
+
return BadgeLabel.SOLD_OUT
|
|
777
793
|
} else if (isOnlineOnly) {
|
|
778
|
-
return BadgeLabel.ONLINE_EXCLUSIVE
|
|
794
|
+
return BadgeLabel.ONLINE_EXCLUSIVE
|
|
779
795
|
} else if (isSustainable) {
|
|
780
|
-
return BadgeLabel.SUSTAINABLE
|
|
796
|
+
return BadgeLabel.SUSTAINABLE
|
|
781
797
|
} else if (isPremium) {
|
|
782
|
-
return BadgeLabel.PREMIUM
|
|
798
|
+
return BadgeLabel.PREMIUM
|
|
783
799
|
} else {
|
|
784
|
-
return BadgeLabel.DEFAULT
|
|
800
|
+
return BadgeLabel.DEFAULT
|
|
785
801
|
}
|
|
786
|
-
}
|
|
802
|
+
}
|
|
787
803
|
```
|
|
788
804
|
|
|
789
805
|
- **\[💥 BREAKING\]** We've standardized our configuration to use `sapi` (Storefront API) throughout the codebase, replacing the deprecated `bapi` keyword. This change improves clarity and consistency by removing the `initBapi` function, replacing the `bapiClient` property with `sapiClient` within the `RPCContext`, and updating all code references accordingly. `BapiConfig` is not exported anymore and has been superseded by `SapiConfig`.
|
|
@@ -799,15 +815,15 @@ See [Overriding core RPC Methods](https://scayle.dev/en/storefront-guide/develop
|
|
|
799
815
|
storefront: {
|
|
800
816
|
// ...
|
|
801
817
|
bapi: {
|
|
802
|
-
host:
|
|
803
|
-
token:
|
|
818
|
+
host: '...',
|
|
819
|
+
token: '...',
|
|
804
820
|
},
|
|
805
821
|
// ...
|
|
806
822
|
},
|
|
807
823
|
// ...
|
|
808
824
|
},
|
|
809
825
|
// ...
|
|
810
|
-
}
|
|
826
|
+
}
|
|
811
827
|
```
|
|
812
828
|
|
|
813
829
|
- _Legacy Environment Variables:_
|
|
@@ -827,15 +843,15 @@ See [Overriding core RPC Methods](https://scayle.dev/en/storefront-guide/develop
|
|
|
827
843
|
storefront: {
|
|
828
844
|
// ...
|
|
829
845
|
sapi: {
|
|
830
|
-
host:
|
|
831
|
-
token:
|
|
846
|
+
host: '...',
|
|
847
|
+
token: '...',
|
|
832
848
|
},
|
|
833
849
|
// ...
|
|
834
850
|
},
|
|
835
851
|
// ...
|
|
836
852
|
},
|
|
837
853
|
// ...
|
|
838
|
-
}
|
|
854
|
+
}
|
|
839
855
|
```
|
|
840
856
|
|
|
841
857
|
- _New Environment Variables:_
|
|
@@ -853,19 +869,19 @@ See [Overriding core RPC Methods](https://scayle.dev/en/storefront-guide/develop
|
|
|
853
869
|
|
|
854
870
|
```ts
|
|
855
871
|
const { data, fetching, fetch, error, status } = useUser(
|
|
856
|
-
|
|
872
|
+
'getUser',
|
|
857
873
|
// ...
|
|
858
|
-
)
|
|
859
|
-
data.value.user.authentication.storefrontAccessToken
|
|
874
|
+
)
|
|
875
|
+
data.value.user.authentication.storefrontAccessToken
|
|
860
876
|
```
|
|
861
877
|
|
|
862
878
|
- _Current Usage of dedicated `getAccessToken` RPC method:_
|
|
863
879
|
|
|
864
880
|
```ts
|
|
865
881
|
const { data: accessToken } = useRpc(
|
|
866
|
-
|
|
882
|
+
'getAccessToken',
|
|
867
883
|
// ...
|
|
868
|
-
)
|
|
884
|
+
)
|
|
869
885
|
```
|
|
870
886
|
|
|
871
887
|
- **\[💥 BREAKING\]** We've enhanced security for basket and wishlist keys by switching the default hashing algorithm from MD5 to the more robust SHA256.
|
|
@@ -888,7 +904,7 @@ See [Overriding core RPC Methods](https://scayle.dev/en/storefront-guide/develop
|
|
|
888
904
|
// ...
|
|
889
905
|
},
|
|
890
906
|
// ...
|
|
891
|
-
})
|
|
907
|
+
})
|
|
892
908
|
```
|
|
893
909
|
|
|
894
910
|
- **\[💥 BREAKING\]** The attribute `loginShopId` is removed from the `ShopUser` interface as the shop now uses session cookies.
|
|
@@ -897,23 +913,23 @@ See [Overriding core RPC Methods](https://scayle.dev/en/storefront-guide/develop
|
|
|
897
913
|
- _Previous Usage of `searchProducts` RPC method:_
|
|
898
914
|
|
|
899
915
|
```ts
|
|
900
|
-
const getSearchSuggestionsRpc = useRpcCall(
|
|
916
|
+
const getSearchSuggestionsRpc = useRpcCall('searchProducts')
|
|
901
917
|
|
|
902
918
|
data.value = await searchProducts({
|
|
903
919
|
term: String(searchQuery.value),
|
|
904
920
|
...params,
|
|
905
|
-
})
|
|
921
|
+
})
|
|
906
922
|
```
|
|
907
923
|
|
|
908
924
|
- _Current Usage of `getSearchSuggestions` RPC method:_
|
|
909
925
|
|
|
910
926
|
```ts
|
|
911
|
-
const getSearchSuggestionsRpc = useRpcCall(
|
|
927
|
+
const getSearchSuggestionsRpc = useRpcCall('getSearchSuggestions')
|
|
912
928
|
|
|
913
929
|
data.value = await getSearchSuggestionsRpc({
|
|
914
930
|
term: String(searchQuery.value),
|
|
915
931
|
...params,
|
|
916
|
-
})
|
|
932
|
+
})
|
|
917
933
|
```
|
|
918
934
|
|
|
919
935
|
- **\[💥 BREAKING\]** Improved basket updating: Adding an item to your basket with a reduced quantity will now correctly update the basket contents.
|
|
@@ -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.33.1"}`).setProtectedHeader({ alg: "HS256", typ: "JWT" }).sign(secret);
|
|
40
40
|
return {
|
|
41
41
|
accessToken: refreshedAccessToken,
|
|
42
42
|
checkoutJwt
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import type { Order, OrderItem, OrderAdvancedAttribute, OrderCategory } from '../../types/sapi/order';
|
|
3
|
+
export declare const orderCategoryFactory: Factory<OrderCategory>;
|
|
4
|
+
export declare const orderAdvancedAttributeFactory: Factory<OrderAdvancedAttribute>;
|
|
5
|
+
export declare const orderProductFactory: Factory<Record<string, unknown>>;
|
|
6
|
+
export declare const orderVariantFactory: Factory<Record<string, unknown>>;
|
|
7
|
+
export declare const orderItemFactory: Factory<OrderItem<Record<string, unknown>, Record<string, unknown>>>;
|
|
8
|
+
export declare const orderFactory: Factory<Order<Record<string, unknown>, Record<string, unknown>>>;
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { Factory } from "fishery";
|
|
2
|
+
import {
|
|
3
|
+
attributeGroupMultiFactory,
|
|
4
|
+
attributeGroupSingleFactory
|
|
5
|
+
} from "@scayle/storefront-api/dist/test/factories";
|
|
6
|
+
export const orderCategoryFactory = Factory.define(() => ({
|
|
7
|
+
categoryId: 1,
|
|
8
|
+
categoryName: "Frauen",
|
|
9
|
+
categoryHidden: false,
|
|
10
|
+
categoryUrl: "/frauen",
|
|
11
|
+
categorySlug: "frauen"
|
|
12
|
+
}));
|
|
13
|
+
export const orderAdvancedAttributeFactory = Factory.define(() => ({
|
|
14
|
+
key: "orderAttribute",
|
|
15
|
+
label: "Order advanced attribute",
|
|
16
|
+
values: [
|
|
17
|
+
{
|
|
18
|
+
fieldSet: [
|
|
19
|
+
[
|
|
20
|
+
{
|
|
21
|
+
value: "Order"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
],
|
|
25
|
+
groupSet: [
|
|
26
|
+
{
|
|
27
|
+
fieldSet: [
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
value: "Attribute value"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
],
|
|
34
|
+
groupSet: []
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}));
|
|
40
|
+
export const orderProductFactory = Factory.define(() => ({
|
|
41
|
+
id: 1,
|
|
42
|
+
advancedAttributes: {
|
|
43
|
+
advColor: orderAdvancedAttributeFactory.build({ key: "advColor" }),
|
|
44
|
+
productName: orderAdvancedAttributeFactory.build({
|
|
45
|
+
key: "productName"
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
attributes: {
|
|
49
|
+
brand: attributeGroupSingleFactory.build({ key: "brand" }),
|
|
50
|
+
brandLogo: attributeGroupSingleFactory.build({ key: "brandLogo" }),
|
|
51
|
+
category: attributeGroupMultiFactory.build({ key: "category" }),
|
|
52
|
+
color: attributeGroupSingleFactory.build({ key: "color" }),
|
|
53
|
+
colorHex: attributeGroupSingleFactory.build({ key: "colorHex" }),
|
|
54
|
+
name: attributeGroupSingleFactory.build({ key: "name" }),
|
|
55
|
+
description: attributeGroupSingleFactory.build({
|
|
56
|
+
key: "description"
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
categories: [[orderCategoryFactory.build({ categoryId: 1 })]],
|
|
60
|
+
images: [
|
|
61
|
+
{
|
|
62
|
+
hash: "9f6c628a98106dcce2bc5a4ac1de9c14"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
masterKey: "480306626-1",
|
|
66
|
+
name: "Chelsea Boots",
|
|
67
|
+
createdAt: "2018-01-20T09:30:15+00:00",
|
|
68
|
+
updatedAt: "2018-01-20T09:30:15+00:00"
|
|
69
|
+
}));
|
|
70
|
+
export const orderVariantFactory = Factory.define(() => ({
|
|
71
|
+
id: 1,
|
|
72
|
+
attributes: {
|
|
73
|
+
size: attributeGroupSingleFactory.build({ key: "size" })
|
|
74
|
+
},
|
|
75
|
+
images: [
|
|
76
|
+
{
|
|
77
|
+
hash: "9f6c628a98106dcce2bc5a4ac1de9c14"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
referenceKey: "563843898",
|
|
81
|
+
stock: {
|
|
82
|
+
warehouseId: 1,
|
|
83
|
+
isSellableWithoutStock: false,
|
|
84
|
+
quantity: 18,
|
|
85
|
+
supplierId: 271
|
|
86
|
+
},
|
|
87
|
+
createdAt: "2018-01-20T09:30:15+00:00",
|
|
88
|
+
updatedAt: "2018-01-20T09:30:15+00:00",
|
|
89
|
+
lowestPriorPrice: {
|
|
90
|
+
withTax: 23,
|
|
91
|
+
relativeDifferenceToPrice: 24
|
|
92
|
+
}
|
|
93
|
+
}));
|
|
94
|
+
export const orderItemFactory = Factory.define(
|
|
95
|
+
() => ({
|
|
96
|
+
id: "1234",
|
|
97
|
+
availableQuantity: 20,
|
|
98
|
+
customData: {
|
|
99
|
+
key: "value"
|
|
100
|
+
},
|
|
101
|
+
deliveryForecast: {
|
|
102
|
+
subsequentDelivery: {
|
|
103
|
+
key: "christmas"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
key: "ac834d23e689u678",
|
|
107
|
+
packageId: 1,
|
|
108
|
+
price: {
|
|
109
|
+
appliedReductions: [
|
|
110
|
+
{
|
|
111
|
+
amount: {
|
|
112
|
+
absoluteWithTax: 100,
|
|
113
|
+
relative: 0.5
|
|
114
|
+
},
|
|
115
|
+
category: "sale",
|
|
116
|
+
type: "relative"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
reference: {
|
|
120
|
+
size: "100",
|
|
121
|
+
unit: "ml",
|
|
122
|
+
withTax: 595
|
|
123
|
+
},
|
|
124
|
+
tax: {
|
|
125
|
+
vat: {
|
|
126
|
+
amount: 190,
|
|
127
|
+
rate: 0.19
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
undiscountedWithOutTax: 1e3,
|
|
131
|
+
undiscountedWithTax: 1190,
|
|
132
|
+
withoutTax: 1e3,
|
|
133
|
+
withTax: 1190
|
|
134
|
+
},
|
|
135
|
+
product: orderProductFactory.build(),
|
|
136
|
+
variant: orderVariantFactory.build(),
|
|
137
|
+
reservationKey: "6nq69bzzkd5xufxliwg8",
|
|
138
|
+
status: "available",
|
|
139
|
+
createdAt: "2018-01-20T09:30:15+00:00",
|
|
140
|
+
updatedAt: "2018-01-20T09:30:15+00:00"
|
|
141
|
+
})
|
|
142
|
+
);
|
|
143
|
+
export const orderFactory = Factory.define(
|
|
144
|
+
() => ({
|
|
145
|
+
id: 1,
|
|
146
|
+
detailedStatus: {
|
|
147
|
+
order: {
|
|
148
|
+
code: "order_open",
|
|
149
|
+
name: "Order open"
|
|
150
|
+
},
|
|
151
|
+
shipping: {
|
|
152
|
+
code: "shipping_open",
|
|
153
|
+
name: "Shipping open"
|
|
154
|
+
},
|
|
155
|
+
billing: {
|
|
156
|
+
code: "billing_open",
|
|
157
|
+
name: "Billing open"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
address: {
|
|
161
|
+
billing: {
|
|
162
|
+
id: 998,
|
|
163
|
+
additional: "c/o SCAYLE",
|
|
164
|
+
city: "Hamburg",
|
|
165
|
+
countryCode: "DEU",
|
|
166
|
+
houseNumber: "12",
|
|
167
|
+
isDefault: {
|
|
168
|
+
billing: false,
|
|
169
|
+
shipping: false
|
|
170
|
+
},
|
|
171
|
+
recipient: {
|
|
172
|
+
firstName: "Anna",
|
|
173
|
+
gender: "m",
|
|
174
|
+
lastName: "Fischer",
|
|
175
|
+
type: "personal"
|
|
176
|
+
},
|
|
177
|
+
referenceKey: "InGidcPDmL8fGkv02a3sSAgAr7ySMBfa66iw4MriYgUNI3Boq369rBOZW3stlKLWSqIjB2dXCGNbCxoM5Xww4cI8cULUoGBFJHH0",
|
|
178
|
+
street: "Wolfgangsweg",
|
|
179
|
+
zipCode: "20459",
|
|
180
|
+
createdAt: "2018-11-29T05:20:13+01:00",
|
|
181
|
+
updatedAt: "2018-11-29T05:20:13+01:00"
|
|
182
|
+
},
|
|
183
|
+
forward: {
|
|
184
|
+
additional: "c/o SCAYLE",
|
|
185
|
+
city: "Hamburg",
|
|
186
|
+
countryCode: "DEU",
|
|
187
|
+
houseNumber: "12",
|
|
188
|
+
recipient: {
|
|
189
|
+
firstName: "Anna",
|
|
190
|
+
gender: "m",
|
|
191
|
+
lastName: "Fischer",
|
|
192
|
+
type: "personal"
|
|
193
|
+
},
|
|
194
|
+
street: "Wolfgangsweg",
|
|
195
|
+
zipCode: "20459",
|
|
196
|
+
createdAt: "2018-11-29T05:20:13+01:00",
|
|
197
|
+
updatedAt: "2018-11-29T05:20:13+01:00"
|
|
198
|
+
},
|
|
199
|
+
shipping: {
|
|
200
|
+
id: 998,
|
|
201
|
+
city: "Hamburg",
|
|
202
|
+
collectionPoint: {
|
|
203
|
+
customerKey: "bced-234-234",
|
|
204
|
+
description: "Pedro's Kiosk",
|
|
205
|
+
key: "12345-a",
|
|
206
|
+
type: "hermes_parcelshop"
|
|
207
|
+
},
|
|
208
|
+
countryCode: "DEU",
|
|
209
|
+
houseNumber: "10",
|
|
210
|
+
isDefault: {
|
|
211
|
+
billing: false,
|
|
212
|
+
shipping: true
|
|
213
|
+
},
|
|
214
|
+
recipient: {
|
|
215
|
+
firstName: "Anna",
|
|
216
|
+
gender: "m",
|
|
217
|
+
lastName: "Fischer",
|
|
218
|
+
type: "personal"
|
|
219
|
+
},
|
|
220
|
+
referenceKey: "InGidcPDmL8fGkv02a3sSAgAr7ySMBfa66iw4MriYgUNI3Boq369rBOZW3stlKLWSqIjB2dXCGNbCxoM5Xww4cI8cULUoGBFJHH0",
|
|
221
|
+
street: "Domstrasse",
|
|
222
|
+
zipCode: "20459",
|
|
223
|
+
createdAt: "2018-11-29T05:20:13+01:00",
|
|
224
|
+
updatedAt: "2018-11-29T05:20:13+01:00"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
basketKey: "basket-c6v7k4eer1",
|
|
228
|
+
confirmedAt: "2018-01-20T11:30:15+00:00",
|
|
229
|
+
cost: {
|
|
230
|
+
appliedFees: [
|
|
231
|
+
{
|
|
232
|
+
amount: {
|
|
233
|
+
withoutTax: 168,
|
|
234
|
+
withTax: 200
|
|
235
|
+
},
|
|
236
|
+
category: "delivery",
|
|
237
|
+
key: "hermes",
|
|
238
|
+
option: "express"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
amount: {
|
|
242
|
+
withoutTax: 168,
|
|
243
|
+
withTax: 200
|
|
244
|
+
},
|
|
245
|
+
category: "payment",
|
|
246
|
+
key: "computop_creditcard"
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
amount: {
|
|
250
|
+
withoutTax: 168,
|
|
251
|
+
withTax: 200
|
|
252
|
+
},
|
|
253
|
+
category: "payment",
|
|
254
|
+
key: "computop_creditcard",
|
|
255
|
+
option: "paybreak"
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
appliedReductions: [
|
|
259
|
+
{
|
|
260
|
+
amount: {
|
|
261
|
+
absoluteWithTax: 100,
|
|
262
|
+
relative: 0.5
|
|
263
|
+
},
|
|
264
|
+
category: "voucher",
|
|
265
|
+
type: "absolute"
|
|
266
|
+
}
|
|
267
|
+
],
|
|
268
|
+
tax: {},
|
|
269
|
+
withoutTax: 1168,
|
|
270
|
+
withTax: 1390
|
|
271
|
+
},
|
|
272
|
+
currencyCode: "EUR",
|
|
273
|
+
customData: {
|
|
274
|
+
score: {
|
|
275
|
+
generatedOn: "2018-05-20T19:45:15+00:00",
|
|
276
|
+
result: "green"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
customer: {
|
|
280
|
+
id: 9876,
|
|
281
|
+
authentication: {
|
|
282
|
+
type: "password"
|
|
283
|
+
},
|
|
284
|
+
birthDate: "1981-02-02",
|
|
285
|
+
customData: {
|
|
286
|
+
score: {
|
|
287
|
+
generatedOn: "2018-05-20T19:45:15+00:00",
|
|
288
|
+
result: "green"
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
email: "anna.fischer@scayle.com",
|
|
292
|
+
firstName: "Anna",
|
|
293
|
+
gender: "f",
|
|
294
|
+
groups: ["employee"],
|
|
295
|
+
lastName: "Fischer",
|
|
296
|
+
phone: "0049/1234567890",
|
|
297
|
+
publicKey: "666",
|
|
298
|
+
referenceKey: "InGidcPDmL8fGkv02a3sSAgAr7ySMBfa66iw4MriYgUNI3Boq369rBOZW3stlKLWSqIjB2dXCGNbCxoM5Xww4cI8cULUoGBFJHH0",
|
|
299
|
+
status: {
|
|
300
|
+
isActive: true,
|
|
301
|
+
isGuestCustomer: false,
|
|
302
|
+
isTestCustomer: false
|
|
303
|
+
},
|
|
304
|
+
title: "Prof.",
|
|
305
|
+
type: "personal",
|
|
306
|
+
createdAt: "2018-01-20T09:30:15+00:00",
|
|
307
|
+
updatedAt: "2018-01-20T09:30:15+00:00"
|
|
308
|
+
},
|
|
309
|
+
invoicedAt: "2018-01-22T11:30:15+00:00",
|
|
310
|
+
items: [orderItemFactory.build()],
|
|
311
|
+
packages: [
|
|
312
|
+
{
|
|
313
|
+
id: 1,
|
|
314
|
+
carrierKey: "dhl",
|
|
315
|
+
deliveryDate: {
|
|
316
|
+
maximum: "2018-02-05",
|
|
317
|
+
minimum: "2018-02-02"
|
|
318
|
+
},
|
|
319
|
+
deliveryStatus: "open",
|
|
320
|
+
shipmentKey: "shpmnt-123"
|
|
321
|
+
}
|
|
322
|
+
],
|
|
323
|
+
payment: [
|
|
324
|
+
{
|
|
325
|
+
amount: 1190,
|
|
326
|
+
data: {
|
|
327
|
+
CCBrand: "VISA",
|
|
328
|
+
CCExpiry: "202005",
|
|
329
|
+
IPCity: "charlottenburg",
|
|
330
|
+
IPLatitude: "52.5151",
|
|
331
|
+
IPLongitude: "13.3053",
|
|
332
|
+
IPState: "berlin",
|
|
333
|
+
IPZone: "276",
|
|
334
|
+
IPZoneA2: "de"
|
|
335
|
+
},
|
|
336
|
+
key: "computop_creditcard",
|
|
337
|
+
transactionKey: "creditcard-abcde"
|
|
338
|
+
}
|
|
339
|
+
],
|
|
340
|
+
publicKey: "666",
|
|
341
|
+
referenceKey: "InGidcPDmL8fGkv02a3sSAgAr7ySMBfa66iw4MriYgUNI3Boq369rBOZW3stlKLWSqIjB2dXCGNbCxoM5Xww4cI8cULUoGBFJHH0",
|
|
342
|
+
shipping: {
|
|
343
|
+
policy: "least_packages"
|
|
344
|
+
},
|
|
345
|
+
shop: {
|
|
346
|
+
id: 139,
|
|
347
|
+
country: "DEU",
|
|
348
|
+
language: "de"
|
|
349
|
+
},
|
|
350
|
+
status: "invoice_completed",
|
|
351
|
+
vouchers: [
|
|
352
|
+
{
|
|
353
|
+
id: 198234,
|
|
354
|
+
code: "fashion2020",
|
|
355
|
+
type: "absolute",
|
|
356
|
+
value: 1e3
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
createdAt: "2018-01-20T09:30:15+00:00",
|
|
360
|
+
updatedAt: "2018-01-20T09:30:15+00:00"
|
|
361
|
+
})
|
|
362
|
+
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Gender } from '../user';
|
|
2
|
-
import type { CentAmount } from './product';
|
|
2
|
+
import type { AdvancedAttribute, CentAmount } from './product';
|
|
3
3
|
/**
|
|
4
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.
|
|
5
5
|
*/
|
|
@@ -445,3 +445,11 @@ export interface Order<Product = Record<string, unknown>, Variant = Record<strin
|
|
|
445
445
|
createdAt: string;
|
|
446
446
|
updatedAt: string;
|
|
447
447
|
}
|
|
448
|
+
export type OrderAdvancedAttribute = Omit<AdvancedAttribute, 'id' | 'type'>;
|
|
449
|
+
export interface OrderCategory {
|
|
450
|
+
categoryHidden: boolean;
|
|
451
|
+
categoryId: number;
|
|
452
|
+
categoryName: string;
|
|
453
|
+
categorySlug: string;
|
|
454
|
+
categoryUrl: string;
|
|
455
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.33.1",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,32 +49,32 @@
|
|
|
49
49
|
"fishery": "^2.2.3"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@scayle/storefront-api": "18.9.0",
|
|
53
|
-
"@scayle/unstorage-scayle-kv-driver": "1.0.2",
|
|
54
52
|
"crypto-js": "^4.2.0",
|
|
55
53
|
"hookable": "^5.5.3",
|
|
56
54
|
"jose": "^6.0.8",
|
|
57
55
|
"slugify": "^1.6.6",
|
|
58
56
|
"ufo": "^1.5.3",
|
|
59
57
|
"uncrypto": "^0.1.3",
|
|
60
|
-
"utility-types": "^3.11.0"
|
|
58
|
+
"utility-types": "^3.11.0",
|
|
59
|
+
"@scayle/storefront-api": "18.9.0",
|
|
60
|
+
"@scayle/unstorage-scayle-kv-driver": "1.0.2"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@scayle/eslint-config-storefront": "4.5.12",
|
|
64
63
|
"@types/crypto-js": "4.2.2",
|
|
65
|
-
"@types/node": "22.
|
|
64
|
+
"@types/node": "22.16.0",
|
|
66
65
|
"@types/webpack-env": "1.18.8",
|
|
67
66
|
"@vitest/coverage-v8": "3.2.4",
|
|
68
67
|
"dprint": "0.50.1",
|
|
69
68
|
"eslint-formatter-gitlab": "6.0.1",
|
|
70
|
-
"eslint": "9.30.
|
|
69
|
+
"eslint": "9.30.1",
|
|
71
70
|
"fishery": "2.3.1",
|
|
72
71
|
"publint": "0.3.12",
|
|
73
72
|
"rimraf": "6.0.1",
|
|
74
73
|
"typescript": "5.8.3",
|
|
75
74
|
"unbuild": "3.5.0",
|
|
76
75
|
"unstorage": "1.16.0",
|
|
77
|
-
"vitest": "3.2.4"
|
|
76
|
+
"vitest": "3.2.4",
|
|
77
|
+
"@scayle/eslint-config-storefront": "4.5.12"
|
|
78
78
|
},
|
|
79
79
|
"volta": {
|
|
80
80
|
"node": "22.17.0"
|