@faststore/api 1.2.23

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 (103) hide show
  1. package/CHANGELOG.md +333 -0
  2. package/README.md +115 -0
  3. package/dist/__generated__/schema.d.ts +281 -0
  4. package/dist/api.cjs.development.js +2226 -0
  5. package/dist/api.cjs.development.js.map +1 -0
  6. package/dist/api.cjs.production.min.js +2 -0
  7. package/dist/api.cjs.production.min.js.map +1 -0
  8. package/dist/api.esm.js +2217 -0
  9. package/dist/api.esm.js.map +1 -0
  10. package/dist/index.d.ts +136 -0
  11. package/dist/index.js +8 -0
  12. package/dist/platforms/vtex/clients/commerce/index.d.ts +29 -0
  13. package/dist/platforms/vtex/clients/commerce/types/Brand.d.ts +8 -0
  14. package/dist/platforms/vtex/clients/commerce/types/CategoryTree.d.ts +9 -0
  15. package/dist/platforms/vtex/clients/commerce/types/OrderForm.d.ts +347 -0
  16. package/dist/platforms/vtex/clients/commerce/types/Simulation.d.ts +154 -0
  17. package/dist/platforms/vtex/clients/fetch.d.ts +1 -0
  18. package/dist/platforms/vtex/clients/index.d.ts +32 -0
  19. package/dist/platforms/vtex/clients/search/index.d.ts +22 -0
  20. package/dist/platforms/vtex/clients/search/types/AttributeSearchResult.d.ts +56 -0
  21. package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +199 -0
  22. package/dist/platforms/vtex/index.d.ts +144 -0
  23. package/dist/platforms/vtex/loaders/index.d.ts +7 -0
  24. package/dist/platforms/vtex/loaders/simulation.d.ts +5 -0
  25. package/dist/platforms/vtex/loaders/sku.d.ts +6 -0
  26. package/dist/platforms/vtex/resolvers/aggregateOffer.d.ts +7 -0
  27. package/dist/platforms/vtex/resolvers/aggregateRating.d.ts +2 -0
  28. package/dist/platforms/vtex/resolvers/collection.d.ts +8 -0
  29. package/dist/platforms/vtex/resolvers/facet.d.ts +5 -0
  30. package/dist/platforms/vtex/resolvers/facetValue.d.ts +5 -0
  31. package/dist/platforms/vtex/resolvers/mutation.d.ts +58 -0
  32. package/dist/platforms/vtex/resolvers/offer.d.ts +11 -0
  33. package/dist/platforms/vtex/resolvers/organization.d.ts +2 -0
  34. package/dist/platforms/vtex/resolvers/product.d.ts +5 -0
  35. package/dist/platforms/vtex/resolvers/productGroup.d.ts +3 -0
  36. package/dist/platforms/vtex/resolvers/query.d.ts +51 -0
  37. package/dist/platforms/vtex/resolvers/review.d.ts +2 -0
  38. package/dist/platforms/vtex/resolvers/searchResult.d.ts +5 -0
  39. package/dist/platforms/vtex/resolvers/seo.d.ts +7 -0
  40. package/dist/platforms/vtex/resolvers/validateCart.d.ts +71 -0
  41. package/dist/platforms/vtex/utils/enhanceSku.d.ts +5 -0
  42. package/dist/platforms/vtex/utils/facets.d.ts +12 -0
  43. package/dist/platforms/vtex/utils/slugify.d.ts +1 -0
  44. package/dist/platforms/vtex/utils/sort.d.ts +10 -0
  45. package/dist/typeDefs/index.d.ts +1 -0
  46. package/package.json +44 -0
  47. package/src/__generated__/schema.ts +324 -0
  48. package/src/index.ts +33 -0
  49. package/src/platforms/vtex/clients/commerce/index.ts +100 -0
  50. package/src/platforms/vtex/clients/commerce/types/Brand.ts +8 -0
  51. package/src/platforms/vtex/clients/commerce/types/CategoryTree.ts +9 -0
  52. package/src/platforms/vtex/clients/commerce/types/OrderForm.ts +371 -0
  53. package/src/platforms/vtex/clients/commerce/types/Simulation.ts +170 -0
  54. package/src/platforms/vtex/clients/fetch.ts +13 -0
  55. package/src/platforms/vtex/clients/index.ts +15 -0
  56. package/src/platforms/vtex/clients/search/index.ts +83 -0
  57. package/src/platforms/vtex/clients/search/types/AttributeSearchResult.ts +61 -0
  58. package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +223 -0
  59. package/src/platforms/vtex/index.ts +62 -0
  60. package/src/platforms/vtex/loaders/index.ts +16 -0
  61. package/src/platforms/vtex/loaders/simulation.ts +42 -0
  62. package/src/platforms/vtex/loaders/sku.ts +61 -0
  63. package/src/platforms/vtex/resolvers/aggregateOffer.ts +20 -0
  64. package/src/platforms/vtex/resolvers/aggregateRating.ts +7 -0
  65. package/src/platforms/vtex/resolvers/collection.ts +43 -0
  66. package/src/platforms/vtex/resolvers/facet.ts +11 -0
  67. package/src/platforms/vtex/resolvers/facetValue.ts +11 -0
  68. package/src/platforms/vtex/resolvers/mutation.ts +5 -0
  69. package/src/platforms/vtex/resolvers/offer.ts +26 -0
  70. package/src/platforms/vtex/resolvers/organization.ts +5 -0
  71. package/src/platforms/vtex/resolvers/product.ts +75 -0
  72. package/src/platforms/vtex/resolvers/productGroup.ts +9 -0
  73. package/src/platforms/vtex/resolvers/query.ts +115 -0
  74. package/src/platforms/vtex/resolvers/review.ts +11 -0
  75. package/src/platforms/vtex/resolvers/searchResult.ts +46 -0
  76. package/src/platforms/vtex/resolvers/seo.ts +10 -0
  77. package/src/platforms/vtex/resolvers/validateCart.ts +166 -0
  78. package/src/platforms/vtex/utils/enhanceSku.ts +8 -0
  79. package/src/platforms/vtex/utils/facets.ts +31 -0
  80. package/src/platforms/vtex/utils/slugify.ts +4 -0
  81. package/src/platforms/vtex/utils/sort.ts +10 -0
  82. package/src/typeDefs/aggregateOffer.graphql +10 -0
  83. package/src/typeDefs/aggregateRating.graphql +4 -0
  84. package/src/typeDefs/author.graphql +3 -0
  85. package/src/typeDefs/brand.graphql +3 -0
  86. package/src/typeDefs/breadcrumb.graphql +10 -0
  87. package/src/typeDefs/cart.graphql +13 -0
  88. package/src/typeDefs/collection.graphql +26 -0
  89. package/src/typeDefs/facet.graphql +14 -0
  90. package/src/typeDefs/image.graphql +9 -0
  91. package/src/typeDefs/index.ts +47 -0
  92. package/src/typeDefs/mutation.graphql +4 -0
  93. package/src/typeDefs/offer.graphql +21 -0
  94. package/src/typeDefs/order.graphql +9 -0
  95. package/src/typeDefs/organization.graphql +7 -0
  96. package/src/typeDefs/pageInfo.graphql +8 -0
  97. package/src/typeDefs/product.graphql +25 -0
  98. package/src/typeDefs/productGroup.graphql +5 -0
  99. package/src/typeDefs/query.graphql +64 -0
  100. package/src/typeDefs/review.graphql +9 -0
  101. package/src/typeDefs/seo.graphql +6 -0
  102. package/src/typeDefs/status.graphql +5 -0
  103. package/src/typings/schema.d.ts +7 -0
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@faststore/api",
3
+ "version": "1.2.23",
4
+ "license": "MIT",
5
+ "main": "dist/index.js",
6
+ "typings": "dist/index.d.ts",
7
+ "module": "dist/api.esm.js",
8
+ "files": [
9
+ "dist",
10
+ "src"
11
+ ],
12
+ "engines": {
13
+ "node": ">=10"
14
+ },
15
+ "scripts": {
16
+ "develop": "concurrently \"yarn generate -w\" \"tsdx watch\"",
17
+ "build": "graphql-codegen --config codegen.yml && tsdx build",
18
+ "test": "tsdx test",
19
+ "lint": "tsdx lint",
20
+ "generate": "graphql-codegen --config codegen.yml"
21
+ },
22
+ "dependencies": {
23
+ "@graphql-tools/schema": "^8.2.0",
24
+ "dataloader": "^2.0.0",
25
+ "fast-deep-equal": "^3.1.3",
26
+ "isomorphic-unfetch": "^3.1.0",
27
+ "rollup-plugin-graphql": "^0.1.0",
28
+ "slugify": "^1.6.0"
29
+ },
30
+ "devDependencies": {
31
+ "@graphql-codegen/cli": "2.2.0",
32
+ "@graphql-codegen/typescript": "2.2.2",
33
+ "babel-jest": "^27.1.1",
34
+ "concurrently": "^6.2.1",
35
+ "jest-transform-graphql": "^2.1.0",
36
+ "ts-jest": "25.5.1",
37
+ "tsdx": "^0.14.1",
38
+ "tslib": "^2.3.1",
39
+ "typescript": "^4.4.2"
40
+ },
41
+ "peerDependencies": {
42
+ "graphql": "^15.6.0"
43
+ }
44
+ }
@@ -0,0 +1,324 @@
1
+ export type Maybe<T> = T | null;
2
+ export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
3
+ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
4
+ export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
5
+ /** All built-in and custom scalars, mapped to their actual values */
6
+ export type Scalars = {
7
+ ID: string;
8
+ String: string;
9
+ Boolean: boolean;
10
+ Int: number;
11
+ Float: number;
12
+ };
13
+
14
+ export type IStoreCart = {
15
+ order: IStoreOrder;
16
+ };
17
+
18
+ export type IStoreImage = {
19
+ alternateName: Scalars['String'];
20
+ url: Scalars['String'];
21
+ };
22
+
23
+ export type IStoreOffer = {
24
+ itemOffered: IStoreProduct;
25
+ listPrice: Scalars['Float'];
26
+ price: Scalars['Float'];
27
+ quantity: Scalars['Int'];
28
+ seller: IStoreOrganization;
29
+ };
30
+
31
+ export type IStoreOrder = {
32
+ acceptedOffer: Array<IStoreOffer>;
33
+ orderNumber: Scalars['String'];
34
+ };
35
+
36
+ export type IStoreOrganization = {
37
+ identifier: Scalars['String'];
38
+ };
39
+
40
+ export type IStoreProduct = {
41
+ image: Array<IStoreImage>;
42
+ name: Scalars['String'];
43
+ sku: Scalars['String'];
44
+ };
45
+
46
+ export type IStoreSelectedFacet = {
47
+ key: Scalars['String'];
48
+ value: Scalars['String'];
49
+ };
50
+
51
+ export type Mutation = {
52
+ __typename?: 'Mutation';
53
+ validateCart?: Maybe<StoreCart>;
54
+ };
55
+
56
+
57
+ export type MutationValidateCartArgs = {
58
+ cart: IStoreCart;
59
+ };
60
+
61
+ export type Query = {
62
+ __typename?: 'Query';
63
+ allCollections: StoreCollectionConnection;
64
+ allProducts: StoreProductConnection;
65
+ product: StoreProduct;
66
+ search: StoreSearchResult;
67
+ };
68
+
69
+
70
+ export type QueryAllCollectionsArgs = {
71
+ after?: Maybe<Scalars['String']>;
72
+ first: Scalars['Int'];
73
+ };
74
+
75
+
76
+ export type QueryAllProductsArgs = {
77
+ after?: Maybe<Scalars['String']>;
78
+ first: Scalars['Int'];
79
+ };
80
+
81
+
82
+ export type QueryProductArgs = {
83
+ locator: Array<IStoreSelectedFacet>;
84
+ };
85
+
86
+
87
+ export type QuerySearchArgs = {
88
+ after?: Maybe<Scalars['String']>;
89
+ first: Scalars['Int'];
90
+ selectedFacets?: Maybe<Array<IStoreSelectedFacet>>;
91
+ sort?: Maybe<StoreSort>;
92
+ term?: Maybe<Scalars['String']>;
93
+ };
94
+
95
+ export type StoreAggregateOffer = {
96
+ __typename?: 'StoreAggregateOffer';
97
+ highPrice: Scalars['Float'];
98
+ lowPrice: Scalars['Float'];
99
+ offerCount: Scalars['Int'];
100
+ offers: Array<StoreOffer>;
101
+ priceCurrency: Scalars['String'];
102
+ };
103
+
104
+ export type StoreAggregateRating = {
105
+ __typename?: 'StoreAggregateRating';
106
+ ratingValue: Scalars['Float'];
107
+ reviewCount: Scalars['Int'];
108
+ };
109
+
110
+ export type StoreAuthor = {
111
+ __typename?: 'StoreAuthor';
112
+ name: Scalars['String'];
113
+ };
114
+
115
+ export type StoreBrand = {
116
+ __typename?: 'StoreBrand';
117
+ name: Scalars['String'];
118
+ };
119
+
120
+ export type StoreBreadcrumbList = {
121
+ __typename?: 'StoreBreadcrumbList';
122
+ itemListElement: Array<StoreListItem>;
123
+ numberOfItems: Scalars['Int'];
124
+ };
125
+
126
+ export type StoreCart = {
127
+ __typename?: 'StoreCart';
128
+ messages: Array<StoreCartMessage>;
129
+ order: StoreOrder;
130
+ };
131
+
132
+ export type StoreCartMessage = {
133
+ __typename?: 'StoreCartMessage';
134
+ status: StoreStatus;
135
+ text: Scalars['String'];
136
+ };
137
+
138
+ export type StoreCollection = {
139
+ __typename?: 'StoreCollection';
140
+ breadcrumbList: StoreBreadcrumbList;
141
+ id: Scalars['ID'];
142
+ meta: StoreCollectionMeta;
143
+ seo: StoreSeo;
144
+ slug: Scalars['String'];
145
+ type: StoreCollectionType;
146
+ };
147
+
148
+ export type StoreCollectionConnection = {
149
+ __typename?: 'StoreCollectionConnection';
150
+ edges: Array<StoreCollectionEdge>;
151
+ pageInfo: StorePageInfo;
152
+ };
153
+
154
+ export type StoreCollectionEdge = {
155
+ __typename?: 'StoreCollectionEdge';
156
+ cursor: Scalars['String'];
157
+ node: StoreCollection;
158
+ };
159
+
160
+ export type StoreCollectionFacet = {
161
+ __typename?: 'StoreCollectionFacet';
162
+ key: Scalars['String'];
163
+ value: Scalars['String'];
164
+ };
165
+
166
+ export type StoreCollectionMeta = {
167
+ __typename?: 'StoreCollectionMeta';
168
+ selectedFacets: Array<StoreCollectionFacet>;
169
+ };
170
+
171
+ export const enum StoreCollectionType {
172
+ Brand = 'Brand',
173
+ Category = 'Category',
174
+ Cluster = 'Cluster',
175
+ Department = 'Department'
176
+ };
177
+
178
+ export type StoreFacet = {
179
+ __typename?: 'StoreFacet';
180
+ key: Scalars['String'];
181
+ label: Scalars['String'];
182
+ type: StoreFacetType;
183
+ values: Array<StoreFacetValue>;
184
+ };
185
+
186
+ export const enum StoreFacetType {
187
+ Boolean = 'BOOLEAN',
188
+ Range = 'RANGE'
189
+ };
190
+
191
+ export type StoreFacetValue = {
192
+ __typename?: 'StoreFacetValue';
193
+ label: Scalars['String'];
194
+ quantity: Scalars['Int'];
195
+ selected: Scalars['Boolean'];
196
+ value: Scalars['String'];
197
+ };
198
+
199
+ export type StoreImage = {
200
+ __typename?: 'StoreImage';
201
+ alternateName: Scalars['String'];
202
+ url: Scalars['String'];
203
+ };
204
+
205
+ export type StoreListItem = {
206
+ __typename?: 'StoreListItem';
207
+ item: Scalars['String'];
208
+ name: Scalars['String'];
209
+ position: Scalars['Int'];
210
+ };
211
+
212
+ export type StoreOffer = {
213
+ __typename?: 'StoreOffer';
214
+ availability: Scalars['String'];
215
+ itemCondition: Scalars['String'];
216
+ itemOffered: StoreProduct;
217
+ listPrice: Scalars['Float'];
218
+ price: Scalars['Float'];
219
+ priceCurrency: Scalars['String'];
220
+ priceValidUntil: Scalars['String'];
221
+ quantity: Scalars['Int'];
222
+ seller: StoreOrganization;
223
+ sellingPrice: Scalars['Float'];
224
+ };
225
+
226
+ export type StoreOrder = {
227
+ __typename?: 'StoreOrder';
228
+ acceptedOffer: Array<StoreOffer>;
229
+ orderNumber: Scalars['String'];
230
+ };
231
+
232
+ export type StoreOrganization = {
233
+ __typename?: 'StoreOrganization';
234
+ identifier: Scalars['String'];
235
+ };
236
+
237
+ export type StorePageInfo = {
238
+ __typename?: 'StorePageInfo';
239
+ endCursor: Scalars['String'];
240
+ hasNextPage: Scalars['Boolean'];
241
+ hasPreviousPage: Scalars['Boolean'];
242
+ startCursor: Scalars['String'];
243
+ totalCount: Scalars['Int'];
244
+ };
245
+
246
+ export type StoreProduct = {
247
+ __typename?: 'StoreProduct';
248
+ aggregateRating: StoreAggregateRating;
249
+ brand: StoreBrand;
250
+ breadcrumbList: StoreBreadcrumbList;
251
+ description: Scalars['String'];
252
+ gtin: Scalars['String'];
253
+ image: Array<StoreImage>;
254
+ isVariantOf: StoreProductGroup;
255
+ name: Scalars['String'];
256
+ offers: StoreAggregateOffer;
257
+ productID: Scalars['String'];
258
+ review: Array<StoreReview>;
259
+ seo: StoreSeo;
260
+ sku: Scalars['String'];
261
+ slug: Scalars['String'];
262
+ };
263
+
264
+ export type StoreProductConnection = {
265
+ __typename?: 'StoreProductConnection';
266
+ edges: Array<StoreProductEdge>;
267
+ pageInfo: StorePageInfo;
268
+ };
269
+
270
+ export type StoreProductEdge = {
271
+ __typename?: 'StoreProductEdge';
272
+ cursor: Scalars['String'];
273
+ node: StoreProduct;
274
+ };
275
+
276
+ export type StoreProductGroup = {
277
+ __typename?: 'StoreProductGroup';
278
+ hasVariant: Array<StoreProduct>;
279
+ name: Scalars['String'];
280
+ productGroupID: Scalars['String'];
281
+ };
282
+
283
+ export type StoreReview = {
284
+ __typename?: 'StoreReview';
285
+ author: StoreAuthor;
286
+ reviewRating: StoreReviewRating;
287
+ };
288
+
289
+ export type StoreReviewRating = {
290
+ __typename?: 'StoreReviewRating';
291
+ bestRating: Scalars['Float'];
292
+ ratingValue: Scalars['Float'];
293
+ };
294
+
295
+ export type StoreSearchResult = {
296
+ __typename?: 'StoreSearchResult';
297
+ facets: Array<StoreFacet>;
298
+ products: StoreProductConnection;
299
+ };
300
+
301
+ export type StoreSeo = {
302
+ __typename?: 'StoreSeo';
303
+ canonical: Scalars['String'];
304
+ description: Scalars['String'];
305
+ title: Scalars['String'];
306
+ titleTemplate: Scalars['String'];
307
+ };
308
+
309
+ export const enum StoreSort {
310
+ DiscountDesc = 'discount_desc',
311
+ NameAsc = 'name_asc',
312
+ NameDesc = 'name_desc',
313
+ OrdersDesc = 'orders_desc',
314
+ PriceAsc = 'price_asc',
315
+ PriceDesc = 'price_desc',
316
+ ReleaseDesc = 'release_desc',
317
+ ScoreDesc = 'score_desc'
318
+ };
319
+
320
+ export const enum StoreStatus {
321
+ Error = 'ERROR',
322
+ Info = 'INFO',
323
+ Warning = 'WARNING'
324
+ };
package/src/index.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { makeExecutableSchema } from '@graphql-tools/schema'
2
+
3
+ import {
4
+ getContextFactory as getContextFactoryVTEX,
5
+ getResolvers as getResolversVTEX,
6
+ } from './platforms/vtex'
7
+ import { typeDefs } from './typeDefs'
8
+ import type { Options as OptionsVTEX } from './platforms/vtex'
9
+
10
+ export * from './__generated__/schema'
11
+
12
+ export type Options = OptionsVTEX
13
+
14
+ const platforms = {
15
+ vtex: {
16
+ getResolvers: getResolversVTEX,
17
+ getContextFactory: getContextFactoryVTEX,
18
+ },
19
+ }
20
+
21
+ export const getTypeDefs = () => typeDefs
22
+
23
+ export const getResolvers = (options: Options) =>
24
+ platforms[options.platform].getResolvers(options)
25
+
26
+ export const getContextFactory = (options: Options) =>
27
+ platforms[options.platform].getContextFactory(options)
28
+
29
+ export const getSchema = async (options: Options) =>
30
+ makeExecutableSchema({
31
+ resolvers: getResolvers(options),
32
+ typeDefs: getTypeDefs(),
33
+ })
@@ -0,0 +1,100 @@
1
+ import { fetchAPI } from '../fetch'
2
+ import type {
3
+ Simulation,
4
+ SimulationArgs,
5
+ SimulationOptions,
6
+ } from './types/Simulation'
7
+ import type { CategoryTree } from './types/CategoryTree'
8
+ import type { Options } from '../..'
9
+ import type { Brand } from './types/Brand'
10
+ import type { OrderForm, OrderFormInputItem } from './types/OrderForm'
11
+
12
+ const BASE_INIT = {
13
+ method: 'POST',
14
+ headers: {
15
+ 'content-type': 'application/json',
16
+ },
17
+ }
18
+
19
+ const getBase = ({ account, environment }: Options) =>
20
+ `http://${account}.${environment}.com.br`
21
+
22
+ export const VtexCommerce = (options: Options) => {
23
+ const { channel } = options
24
+ const base = getBase(options)
25
+
26
+ return {
27
+ catalog: {
28
+ brand: {
29
+ list: (): Promise<Brand[]> =>
30
+ fetchAPI(`${base}/api/catalog_system/pub/brand/list`),
31
+ },
32
+ category: {
33
+ tree: (depth = 3): Promise<CategoryTree[]> =>
34
+ fetchAPI(`${base}/api/catalog_system/pub/category/tree/${depth}`),
35
+ },
36
+ },
37
+ checkout: {
38
+ simulation: (
39
+ args: SimulationArgs,
40
+ { salesChannel }: SimulationOptions = { salesChannel: channel }
41
+ ): Promise<Simulation> => {
42
+ const params = new URLSearchParams({
43
+ sc: salesChannel,
44
+ })
45
+
46
+ return fetchAPI(
47
+ `${base}/api/checkout/pub/orderForms/simulation?${params.toString()}`,
48
+ {
49
+ ...BASE_INIT,
50
+ body: JSON.stringify(args),
51
+ }
52
+ )
53
+ },
54
+ orderForm: ({
55
+ id,
56
+ refreshOutdatedData = true,
57
+ salesChannel = channel,
58
+ }: {
59
+ id: string
60
+ refreshOutdatedData?: boolean
61
+ salesChannel?: string
62
+ }): Promise<OrderForm> => {
63
+ const params = new URLSearchParams({
64
+ refreshOutdatedData: refreshOutdatedData.toString(),
65
+ sc: salesChannel,
66
+ })
67
+
68
+ return fetchAPI(
69
+ `${base}/api/checkout/pub/orderForm/${id}?${params.toString()}`,
70
+ BASE_INIT
71
+ )
72
+ },
73
+ updateOrderFormItems: ({
74
+ id,
75
+ orderItems,
76
+ allowOutdatedData = 'paymentData',
77
+ salesChannel = channel,
78
+ }: {
79
+ id: string
80
+ orderItems: OrderFormInputItem[]
81
+ allowOutdatedData?: 'paymentData'
82
+ salesChannel?: string
83
+ }): Promise<OrderForm> => {
84
+ const params = new URLSearchParams({
85
+ allowOutdatedData,
86
+ sc: salesChannel,
87
+ })
88
+
89
+ return fetchAPI(
90
+ `${base}/api/checkout/pub/orderForm/${id}/items?${params}`,
91
+ {
92
+ ...BASE_INIT,
93
+ body: JSON.stringify({ orderItems }),
94
+ method: 'PATCH',
95
+ }
96
+ )
97
+ },
98
+ },
99
+ }
100
+ }
@@ -0,0 +1,8 @@
1
+ export interface Brand {
2
+ id: number
3
+ name: string
4
+ isActive: boolean
5
+ title: string
6
+ metaTagDescription: string
7
+ imageURL: null | string
8
+ }
@@ -0,0 +1,9 @@
1
+ export interface CategoryTree {
2
+ id: number
3
+ name: string
4
+ hasChildren: boolean
5
+ url: string
6
+ children: CategoryTree[]
7
+ Title: string
8
+ MetaTagDescription: string
9
+ }