@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.
- package/CHANGELOG.md +333 -0
- package/README.md +115 -0
- package/dist/__generated__/schema.d.ts +281 -0
- package/dist/api.cjs.development.js +2226 -0
- package/dist/api.cjs.development.js.map +1 -0
- package/dist/api.cjs.production.min.js +2 -0
- package/dist/api.cjs.production.min.js.map +1 -0
- package/dist/api.esm.js +2217 -0
- package/dist/api.esm.js.map +1 -0
- package/dist/index.d.ts +136 -0
- package/dist/index.js +8 -0
- package/dist/platforms/vtex/clients/commerce/index.d.ts +29 -0
- package/dist/platforms/vtex/clients/commerce/types/Brand.d.ts +8 -0
- package/dist/platforms/vtex/clients/commerce/types/CategoryTree.d.ts +9 -0
- package/dist/platforms/vtex/clients/commerce/types/OrderForm.d.ts +347 -0
- package/dist/platforms/vtex/clients/commerce/types/Simulation.d.ts +154 -0
- package/dist/platforms/vtex/clients/fetch.d.ts +1 -0
- package/dist/platforms/vtex/clients/index.d.ts +32 -0
- package/dist/platforms/vtex/clients/search/index.d.ts +22 -0
- package/dist/platforms/vtex/clients/search/types/AttributeSearchResult.d.ts +56 -0
- package/dist/platforms/vtex/clients/search/types/ProductSearchResult.d.ts +199 -0
- package/dist/platforms/vtex/index.d.ts +144 -0
- package/dist/platforms/vtex/loaders/index.d.ts +7 -0
- package/dist/platforms/vtex/loaders/simulation.d.ts +5 -0
- package/dist/platforms/vtex/loaders/sku.d.ts +6 -0
- package/dist/platforms/vtex/resolvers/aggregateOffer.d.ts +7 -0
- package/dist/platforms/vtex/resolvers/aggregateRating.d.ts +2 -0
- package/dist/platforms/vtex/resolvers/collection.d.ts +8 -0
- package/dist/platforms/vtex/resolvers/facet.d.ts +5 -0
- package/dist/platforms/vtex/resolvers/facetValue.d.ts +5 -0
- package/dist/platforms/vtex/resolvers/mutation.d.ts +58 -0
- package/dist/platforms/vtex/resolvers/offer.d.ts +11 -0
- package/dist/platforms/vtex/resolvers/organization.d.ts +2 -0
- package/dist/platforms/vtex/resolvers/product.d.ts +5 -0
- package/dist/platforms/vtex/resolvers/productGroup.d.ts +3 -0
- package/dist/platforms/vtex/resolvers/query.d.ts +51 -0
- package/dist/platforms/vtex/resolvers/review.d.ts +2 -0
- package/dist/platforms/vtex/resolvers/searchResult.d.ts +5 -0
- package/dist/platforms/vtex/resolvers/seo.d.ts +7 -0
- package/dist/platforms/vtex/resolvers/validateCart.d.ts +71 -0
- package/dist/platforms/vtex/utils/enhanceSku.d.ts +5 -0
- package/dist/platforms/vtex/utils/facets.d.ts +12 -0
- package/dist/platforms/vtex/utils/slugify.d.ts +1 -0
- package/dist/platforms/vtex/utils/sort.d.ts +10 -0
- package/dist/typeDefs/index.d.ts +1 -0
- package/package.json +44 -0
- package/src/__generated__/schema.ts +324 -0
- package/src/index.ts +33 -0
- package/src/platforms/vtex/clients/commerce/index.ts +100 -0
- package/src/platforms/vtex/clients/commerce/types/Brand.ts +8 -0
- package/src/platforms/vtex/clients/commerce/types/CategoryTree.ts +9 -0
- package/src/platforms/vtex/clients/commerce/types/OrderForm.ts +371 -0
- package/src/platforms/vtex/clients/commerce/types/Simulation.ts +170 -0
- package/src/platforms/vtex/clients/fetch.ts +13 -0
- package/src/platforms/vtex/clients/index.ts +15 -0
- package/src/platforms/vtex/clients/search/index.ts +83 -0
- package/src/platforms/vtex/clients/search/types/AttributeSearchResult.ts +61 -0
- package/src/platforms/vtex/clients/search/types/ProductSearchResult.ts +223 -0
- package/src/platforms/vtex/index.ts +62 -0
- package/src/platforms/vtex/loaders/index.ts +16 -0
- package/src/platforms/vtex/loaders/simulation.ts +42 -0
- package/src/platforms/vtex/loaders/sku.ts +61 -0
- package/src/platforms/vtex/resolvers/aggregateOffer.ts +20 -0
- package/src/platforms/vtex/resolvers/aggregateRating.ts +7 -0
- package/src/platforms/vtex/resolvers/collection.ts +43 -0
- package/src/platforms/vtex/resolvers/facet.ts +11 -0
- package/src/platforms/vtex/resolvers/facetValue.ts +11 -0
- package/src/platforms/vtex/resolvers/mutation.ts +5 -0
- package/src/platforms/vtex/resolvers/offer.ts +26 -0
- package/src/platforms/vtex/resolvers/organization.ts +5 -0
- package/src/platforms/vtex/resolvers/product.ts +75 -0
- package/src/platforms/vtex/resolvers/productGroup.ts +9 -0
- package/src/platforms/vtex/resolvers/query.ts +115 -0
- package/src/platforms/vtex/resolvers/review.ts +11 -0
- package/src/platforms/vtex/resolvers/searchResult.ts +46 -0
- package/src/platforms/vtex/resolvers/seo.ts +10 -0
- package/src/platforms/vtex/resolvers/validateCart.ts +166 -0
- package/src/platforms/vtex/utils/enhanceSku.ts +8 -0
- package/src/platforms/vtex/utils/facets.ts +31 -0
- package/src/platforms/vtex/utils/slugify.ts +4 -0
- package/src/platforms/vtex/utils/sort.ts +10 -0
- package/src/typeDefs/aggregateOffer.graphql +10 -0
- package/src/typeDefs/aggregateRating.graphql +4 -0
- package/src/typeDefs/author.graphql +3 -0
- package/src/typeDefs/brand.graphql +3 -0
- package/src/typeDefs/breadcrumb.graphql +10 -0
- package/src/typeDefs/cart.graphql +13 -0
- package/src/typeDefs/collection.graphql +26 -0
- package/src/typeDefs/facet.graphql +14 -0
- package/src/typeDefs/image.graphql +9 -0
- package/src/typeDefs/index.ts +47 -0
- package/src/typeDefs/mutation.graphql +4 -0
- package/src/typeDefs/offer.graphql +21 -0
- package/src/typeDefs/order.graphql +9 -0
- package/src/typeDefs/organization.graphql +7 -0
- package/src/typeDefs/pageInfo.graphql +8 -0
- package/src/typeDefs/product.graphql +25 -0
- package/src/typeDefs/productGroup.graphql +5 -0
- package/src/typeDefs/query.graphql +64 -0
- package/src/typeDefs/review.graphql +9 -0
- package/src/typeDefs/seo.graphql +6 -0
- package/src/typeDefs/status.graphql +5 -0
- package/src/typings/schema.d.ts +7 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
export interface OrderFormInputItem {
|
|
2
|
+
id: string;
|
|
3
|
+
quantity: number;
|
|
4
|
+
seller: string;
|
|
5
|
+
index?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface OrderFormItem {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
detailUrl: string;
|
|
11
|
+
imageUrl: string;
|
|
12
|
+
skuName: string;
|
|
13
|
+
quantity: number;
|
|
14
|
+
uniqueId: string;
|
|
15
|
+
productId: string;
|
|
16
|
+
refId: string;
|
|
17
|
+
ean: string;
|
|
18
|
+
priceValidUntil: string;
|
|
19
|
+
price: number;
|
|
20
|
+
tax: number;
|
|
21
|
+
listPrice: number;
|
|
22
|
+
sellingPrice: number;
|
|
23
|
+
rewardValue: number;
|
|
24
|
+
isGift: boolean;
|
|
25
|
+
parentItemIndex: number | null;
|
|
26
|
+
parentAssemblyBinding: string | null;
|
|
27
|
+
productCategoryIds: string;
|
|
28
|
+
priceTags: string[];
|
|
29
|
+
manualPrice: number;
|
|
30
|
+
measurementUnit: string;
|
|
31
|
+
additionalInfo: {
|
|
32
|
+
brandName: string;
|
|
33
|
+
brandId: string;
|
|
34
|
+
offeringInfo: any | null;
|
|
35
|
+
offeringType: any | null;
|
|
36
|
+
offeringTypeId: any | null;
|
|
37
|
+
};
|
|
38
|
+
productCategories: Record<string, string>;
|
|
39
|
+
productRefId: string;
|
|
40
|
+
seller: string;
|
|
41
|
+
sellerChain: string[];
|
|
42
|
+
availability: string;
|
|
43
|
+
unitMultiplier: number;
|
|
44
|
+
skuSpecifications: SKUSpecification[];
|
|
45
|
+
priceDefinition: {
|
|
46
|
+
calculatedSellingPrice: number;
|
|
47
|
+
sellingPrices: SellingPrice[];
|
|
48
|
+
total: number;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface SKUSpecification {
|
|
52
|
+
fieldName: string;
|
|
53
|
+
fieldValues: string[];
|
|
54
|
+
}
|
|
55
|
+
export interface AdditionalInfo {
|
|
56
|
+
dimension: null;
|
|
57
|
+
brandName: string;
|
|
58
|
+
brandId: string;
|
|
59
|
+
offeringInfo: null;
|
|
60
|
+
offeringType: null;
|
|
61
|
+
offeringTypeId: null;
|
|
62
|
+
}
|
|
63
|
+
export interface PriceDefinition {
|
|
64
|
+
calculatedSellingPrice: number;
|
|
65
|
+
total: number;
|
|
66
|
+
sellingPrices: SellingPrice[];
|
|
67
|
+
}
|
|
68
|
+
export interface SellingPrice {
|
|
69
|
+
value: number;
|
|
70
|
+
quantity: number;
|
|
71
|
+
}
|
|
72
|
+
export interface PriceTag {
|
|
73
|
+
name: string;
|
|
74
|
+
value: number;
|
|
75
|
+
rawValue: number;
|
|
76
|
+
isPercentual: boolean;
|
|
77
|
+
identifier: string;
|
|
78
|
+
}
|
|
79
|
+
export interface OrderForm {
|
|
80
|
+
orderFormId: string;
|
|
81
|
+
salesChannel: string;
|
|
82
|
+
loggedIn: boolean;
|
|
83
|
+
isCheckedIn: boolean;
|
|
84
|
+
storeId: string | null;
|
|
85
|
+
checkedInPickupPointId: string | null;
|
|
86
|
+
allowManualPrice: boolean;
|
|
87
|
+
canEditData: boolean;
|
|
88
|
+
userProfileId: string | null;
|
|
89
|
+
userType: string | null;
|
|
90
|
+
ignoreProfileData: boolean;
|
|
91
|
+
value: number;
|
|
92
|
+
messages: any[];
|
|
93
|
+
items: OrderFormItem[];
|
|
94
|
+
selectableGifts: any[];
|
|
95
|
+
totalizers: Array<{
|
|
96
|
+
id: string;
|
|
97
|
+
name: string;
|
|
98
|
+
value: number;
|
|
99
|
+
}>;
|
|
100
|
+
shippingData: ShippingData | null;
|
|
101
|
+
clientProfileData: ClientProfileData | null;
|
|
102
|
+
paymentData: PaymentData;
|
|
103
|
+
marketingData: OrderFormMarketingData | null;
|
|
104
|
+
sellers: Array<{
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
logo: string;
|
|
108
|
+
}>;
|
|
109
|
+
clientPreferencesData: {
|
|
110
|
+
locale: string;
|
|
111
|
+
optinNewsLetter: any | null;
|
|
112
|
+
};
|
|
113
|
+
commercialConditionData: any | null;
|
|
114
|
+
storePreferencesData: {
|
|
115
|
+
countryCode: string;
|
|
116
|
+
currencyCode: string;
|
|
117
|
+
currencyFormatInfo: {
|
|
118
|
+
currencyDecimalDigits: number;
|
|
119
|
+
currencyDecimalSeparator: string;
|
|
120
|
+
currencyGroupSeparator: string;
|
|
121
|
+
currencyGroupSize: number;
|
|
122
|
+
startsWithCurrencySymbol: boolean;
|
|
123
|
+
};
|
|
124
|
+
currencyLocale: string;
|
|
125
|
+
currencySymbol: string;
|
|
126
|
+
saveUserData: boolean;
|
|
127
|
+
timeZone: string;
|
|
128
|
+
};
|
|
129
|
+
giftRegistryData: any | null;
|
|
130
|
+
openTextField: any | null;
|
|
131
|
+
invoiceData: any | null;
|
|
132
|
+
customData: any | null;
|
|
133
|
+
itemMetadata: {
|
|
134
|
+
items: MetadataItem[];
|
|
135
|
+
};
|
|
136
|
+
hooksData: any | null;
|
|
137
|
+
ratesAndBenefitsData: {
|
|
138
|
+
rateAndBenefitsIdentifiers: any[];
|
|
139
|
+
teaser: any[];
|
|
140
|
+
};
|
|
141
|
+
subscriptionData: SubscriptionData | null;
|
|
142
|
+
itemsOrdination: any | null;
|
|
143
|
+
}
|
|
144
|
+
export interface OrderFormMarketingData {
|
|
145
|
+
utmCampaign?: string;
|
|
146
|
+
utmMedium?: string;
|
|
147
|
+
utmSource?: string;
|
|
148
|
+
utmiCampaign?: string;
|
|
149
|
+
utmiPart?: string;
|
|
150
|
+
utmipage?: string;
|
|
151
|
+
marketingTags?: string;
|
|
152
|
+
coupon?: string;
|
|
153
|
+
}
|
|
154
|
+
export interface PaymentData {
|
|
155
|
+
installmentOptions: Array<{
|
|
156
|
+
paymentSystem: string;
|
|
157
|
+
bin: string | null;
|
|
158
|
+
paymentName: string | null;
|
|
159
|
+
paymentGroupName: string | null;
|
|
160
|
+
value: number;
|
|
161
|
+
installments: Array<{
|
|
162
|
+
count: number;
|
|
163
|
+
hasInterestRate: false;
|
|
164
|
+
interestRate: number;
|
|
165
|
+
value: number;
|
|
166
|
+
total: number;
|
|
167
|
+
sellerMerchantInstallments: Array<{
|
|
168
|
+
count: number;
|
|
169
|
+
hasInterestRate: false;
|
|
170
|
+
interestRate: number;
|
|
171
|
+
value: number;
|
|
172
|
+
total: number;
|
|
173
|
+
}>;
|
|
174
|
+
}>;
|
|
175
|
+
}>;
|
|
176
|
+
paymentSystems: Array<{
|
|
177
|
+
id: string;
|
|
178
|
+
name: string;
|
|
179
|
+
groupName: string;
|
|
180
|
+
validator: {
|
|
181
|
+
regex: string;
|
|
182
|
+
mask: string;
|
|
183
|
+
cardCodeRegex: string;
|
|
184
|
+
cardCodeMask: string;
|
|
185
|
+
weights: number[];
|
|
186
|
+
useCvv: boolean;
|
|
187
|
+
useExpirationDate: boolean;
|
|
188
|
+
useCardHolderName: boolean;
|
|
189
|
+
useBillingAddress: boolean;
|
|
190
|
+
};
|
|
191
|
+
stringId: string;
|
|
192
|
+
template: string;
|
|
193
|
+
requiresDocument: boolean;
|
|
194
|
+
isCustom: boolean;
|
|
195
|
+
description: string | null;
|
|
196
|
+
requiresAuthentication: boolean;
|
|
197
|
+
dueDate: string;
|
|
198
|
+
availablePayments: any | null;
|
|
199
|
+
}>;
|
|
200
|
+
payments: any[];
|
|
201
|
+
giftCards: any[];
|
|
202
|
+
giftCardMessages: any[];
|
|
203
|
+
availableAccounts: any[];
|
|
204
|
+
availableTokens: any[];
|
|
205
|
+
}
|
|
206
|
+
export interface ClientProfileData {
|
|
207
|
+
email: string;
|
|
208
|
+
firstName: string;
|
|
209
|
+
lastName: string;
|
|
210
|
+
document: string;
|
|
211
|
+
documentType: string;
|
|
212
|
+
phone: string;
|
|
213
|
+
corporateName: string;
|
|
214
|
+
tradeName: string;
|
|
215
|
+
corporateDocument: string;
|
|
216
|
+
stateInscription: string;
|
|
217
|
+
corporatePhone: string;
|
|
218
|
+
isCorporate: boolean;
|
|
219
|
+
profileCompleteOnLoading: boolean;
|
|
220
|
+
profileErrorOnLoading: boolean;
|
|
221
|
+
customerClass: string;
|
|
222
|
+
}
|
|
223
|
+
export interface ShippingData {
|
|
224
|
+
address: CheckoutAddress | null;
|
|
225
|
+
logisticsInfo: LogisticsInfo[];
|
|
226
|
+
selectedAddresses: CheckoutAddress[];
|
|
227
|
+
availableAddresses: CheckoutAddress[];
|
|
228
|
+
pickupPoints: PickupPoint[];
|
|
229
|
+
}
|
|
230
|
+
export interface PickupPoint {
|
|
231
|
+
friendlyName: string;
|
|
232
|
+
address: CheckoutAddress;
|
|
233
|
+
additionalInfo: string;
|
|
234
|
+
id: string;
|
|
235
|
+
businessHours: BusinessHour[];
|
|
236
|
+
}
|
|
237
|
+
export interface BusinessHour {
|
|
238
|
+
DayOfWeek: number;
|
|
239
|
+
ClosingTime: string;
|
|
240
|
+
OpeningTime: string;
|
|
241
|
+
}
|
|
242
|
+
export interface LogisticsInfo {
|
|
243
|
+
addressId: string | null;
|
|
244
|
+
deliveryChannels: DeliveryChannel[];
|
|
245
|
+
itemId: string;
|
|
246
|
+
itemIndex: number;
|
|
247
|
+
shipsTo: string[];
|
|
248
|
+
slas: SLA[];
|
|
249
|
+
selectedDeliveryChannel: string | null;
|
|
250
|
+
selectedSla: string | null;
|
|
251
|
+
}
|
|
252
|
+
export interface SLA {
|
|
253
|
+
id: string;
|
|
254
|
+
deliveryChannel: string;
|
|
255
|
+
name: string;
|
|
256
|
+
deliveryIds: DeliveryId[];
|
|
257
|
+
shippingEstimate: string;
|
|
258
|
+
shippingEstimateDate: string | null;
|
|
259
|
+
lockTTL: string | null;
|
|
260
|
+
availableDeliveryWindows: any[];
|
|
261
|
+
deliveryWindow: string | null;
|
|
262
|
+
price: number;
|
|
263
|
+
listPrice: number;
|
|
264
|
+
tax: number;
|
|
265
|
+
pickupStoreInfo: {
|
|
266
|
+
isPickupStore: boolean;
|
|
267
|
+
friendlyName: string | null;
|
|
268
|
+
address: CheckoutAddress | null;
|
|
269
|
+
additionalInfo: any | null;
|
|
270
|
+
dockId: string | null;
|
|
271
|
+
};
|
|
272
|
+
pickupPointId: string | null;
|
|
273
|
+
pickupDistance: number | null;
|
|
274
|
+
polygonName: string | null;
|
|
275
|
+
transitTime: string | null;
|
|
276
|
+
}
|
|
277
|
+
export interface DeliveryId {
|
|
278
|
+
courierId: string;
|
|
279
|
+
warehouseId: string;
|
|
280
|
+
dockId: string;
|
|
281
|
+
courierName: string;
|
|
282
|
+
quantity: number;
|
|
283
|
+
}
|
|
284
|
+
export interface DeliveryChannel {
|
|
285
|
+
id: string;
|
|
286
|
+
}
|
|
287
|
+
export interface CheckoutAddress {
|
|
288
|
+
addressId: string;
|
|
289
|
+
addressType: string;
|
|
290
|
+
city: string | null;
|
|
291
|
+
complement: string | null;
|
|
292
|
+
country: string;
|
|
293
|
+
geoCoordinates: number[];
|
|
294
|
+
neighborhood: string | null;
|
|
295
|
+
number: string | null;
|
|
296
|
+
postalCode: string | null;
|
|
297
|
+
receiverName: string | null;
|
|
298
|
+
reference: string | null;
|
|
299
|
+
state: string | null;
|
|
300
|
+
street: string | null;
|
|
301
|
+
isDisposable: boolean;
|
|
302
|
+
}
|
|
303
|
+
export interface MetadataItem {
|
|
304
|
+
id: string;
|
|
305
|
+
name: string;
|
|
306
|
+
imageUrl: string;
|
|
307
|
+
detailUrl: string;
|
|
308
|
+
seller: string;
|
|
309
|
+
assemblyOptions: AssemblyOption[];
|
|
310
|
+
skuName: string;
|
|
311
|
+
productId: string;
|
|
312
|
+
refId: string;
|
|
313
|
+
ean: string | null;
|
|
314
|
+
}
|
|
315
|
+
export interface AssemblyOption {
|
|
316
|
+
id: string;
|
|
317
|
+
name: string;
|
|
318
|
+
composition: Composition | null;
|
|
319
|
+
}
|
|
320
|
+
export interface SubscriptionDataEntry {
|
|
321
|
+
executionCount: number;
|
|
322
|
+
itemIndex: number;
|
|
323
|
+
plan: {
|
|
324
|
+
frequency: {
|
|
325
|
+
interval: number;
|
|
326
|
+
periodicity: 'YEAR' | 'MONTH' | 'WEEK' | 'DAY';
|
|
327
|
+
};
|
|
328
|
+
type: string;
|
|
329
|
+
validity: unknown;
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
export interface CompositionItem {
|
|
333
|
+
id: string;
|
|
334
|
+
minQuantity: number;
|
|
335
|
+
maxQuantity: number;
|
|
336
|
+
initialQuantity: number;
|
|
337
|
+
priceTable: string;
|
|
338
|
+
seller: string;
|
|
339
|
+
}
|
|
340
|
+
export interface Composition {
|
|
341
|
+
minQuantity: number;
|
|
342
|
+
maxQuantity: number;
|
|
343
|
+
items: CompositionItem[];
|
|
344
|
+
}
|
|
345
|
+
export interface SubscriptionData {
|
|
346
|
+
subscriptions: SubscriptionDataEntry[];
|
|
347
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export interface PayloadItem {
|
|
2
|
+
id: string;
|
|
3
|
+
quantity: number;
|
|
4
|
+
seller: string;
|
|
5
|
+
parentItemIndex?: number | null;
|
|
6
|
+
parentAssemblyBinding?: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ShippingData {
|
|
9
|
+
logisticsInfo?: Array<{
|
|
10
|
+
regionId?: string | null;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export interface SimulationArgs {
|
|
14
|
+
country?: string;
|
|
15
|
+
items: PayloadItem[];
|
|
16
|
+
postalCode?: string;
|
|
17
|
+
isCheckedIn?: boolean;
|
|
18
|
+
priceTables?: string[];
|
|
19
|
+
marketingData?: Record<string, string>;
|
|
20
|
+
shippingData?: ShippingData;
|
|
21
|
+
}
|
|
22
|
+
export interface SimulationOptions {
|
|
23
|
+
salesChannel: string;
|
|
24
|
+
}
|
|
25
|
+
export interface Simulation {
|
|
26
|
+
items: Item[];
|
|
27
|
+
ratesAndBenefitsData: RatesAndBenefitsData;
|
|
28
|
+
paymentData: PaymentData;
|
|
29
|
+
selectableGifts: any[];
|
|
30
|
+
marketingData: MarketingData;
|
|
31
|
+
postalCode: null;
|
|
32
|
+
country: null;
|
|
33
|
+
logisticsInfo: LogisticsInfo[];
|
|
34
|
+
messages: any[];
|
|
35
|
+
purchaseConditions: PurchaseConditions;
|
|
36
|
+
pickupPoints: any[];
|
|
37
|
+
subscriptionData: null;
|
|
38
|
+
totals: Total[];
|
|
39
|
+
itemMetadata: null;
|
|
40
|
+
}
|
|
41
|
+
export interface Item {
|
|
42
|
+
id: string;
|
|
43
|
+
requestIndex: number;
|
|
44
|
+
quantity: number;
|
|
45
|
+
seller: string;
|
|
46
|
+
sellerChain: string[];
|
|
47
|
+
tax: number;
|
|
48
|
+
priceValidUntil: Date;
|
|
49
|
+
price: number;
|
|
50
|
+
listPrice: number;
|
|
51
|
+
rewardValue: number;
|
|
52
|
+
sellingPrice: number;
|
|
53
|
+
offerings: any[];
|
|
54
|
+
priceTags: any[];
|
|
55
|
+
measurementUnit: string;
|
|
56
|
+
unitMultiplier: number;
|
|
57
|
+
parentItemIndex: null;
|
|
58
|
+
parentAssemblyBinding: null;
|
|
59
|
+
availability: string;
|
|
60
|
+
catalogProvider: string;
|
|
61
|
+
priceDefinition: PriceDefinition;
|
|
62
|
+
}
|
|
63
|
+
export interface PriceDefinition {
|
|
64
|
+
calculatedSellingPrice: number;
|
|
65
|
+
total: number;
|
|
66
|
+
sellingPrices: SellingPrice[];
|
|
67
|
+
}
|
|
68
|
+
export interface SellingPrice {
|
|
69
|
+
value: number;
|
|
70
|
+
quantity: number;
|
|
71
|
+
}
|
|
72
|
+
export interface LogisticsInfo {
|
|
73
|
+
itemIndex: number;
|
|
74
|
+
addressId: null;
|
|
75
|
+
selectedSla: null;
|
|
76
|
+
selectedDeliveryChannel: null;
|
|
77
|
+
quantity: number;
|
|
78
|
+
shipsTo: string[];
|
|
79
|
+
slas: any[];
|
|
80
|
+
deliveryChannels: DeliveryChannel[];
|
|
81
|
+
}
|
|
82
|
+
export interface DeliveryChannel {
|
|
83
|
+
id: string;
|
|
84
|
+
}
|
|
85
|
+
export interface MarketingData {
|
|
86
|
+
utmSource: null;
|
|
87
|
+
utmMedium: null;
|
|
88
|
+
utmCampaign: null;
|
|
89
|
+
utmipage: null;
|
|
90
|
+
utmiPart: null;
|
|
91
|
+
utmiCampaign: null;
|
|
92
|
+
coupon: null;
|
|
93
|
+
marketingTags: string[];
|
|
94
|
+
}
|
|
95
|
+
export interface PaymentData {
|
|
96
|
+
installmentOptions: InstallmentOption[];
|
|
97
|
+
paymentSystems: PaymentSystem[];
|
|
98
|
+
payments: any[];
|
|
99
|
+
giftCards: any[];
|
|
100
|
+
giftCardMessages: any[];
|
|
101
|
+
availableAccounts: any[];
|
|
102
|
+
availableTokens: any[];
|
|
103
|
+
}
|
|
104
|
+
export interface InstallmentOption {
|
|
105
|
+
paymentSystem: string;
|
|
106
|
+
bin: null;
|
|
107
|
+
paymentName: string;
|
|
108
|
+
paymentGroupName: string;
|
|
109
|
+
value: number;
|
|
110
|
+
installments: Installment[];
|
|
111
|
+
}
|
|
112
|
+
export interface Installment {
|
|
113
|
+
count: number;
|
|
114
|
+
hasInterestRate: boolean;
|
|
115
|
+
interestRate: number;
|
|
116
|
+
value: number;
|
|
117
|
+
total: number;
|
|
118
|
+
sellerMerchantInstallments?: Installment[];
|
|
119
|
+
id?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface PaymentSystem {
|
|
122
|
+
id: number;
|
|
123
|
+
name: string;
|
|
124
|
+
groupName: string;
|
|
125
|
+
validator: null;
|
|
126
|
+
stringId: string;
|
|
127
|
+
template: string;
|
|
128
|
+
requiresDocument: boolean;
|
|
129
|
+
isCustom: boolean;
|
|
130
|
+
description: null | string;
|
|
131
|
+
requiresAuthentication: boolean;
|
|
132
|
+
dueDate: Date;
|
|
133
|
+
availablePayments: null;
|
|
134
|
+
}
|
|
135
|
+
export interface PurchaseConditions {
|
|
136
|
+
itemPurchaseConditions: ItemPurchaseCondition[];
|
|
137
|
+
}
|
|
138
|
+
export interface ItemPurchaseCondition {
|
|
139
|
+
id: string;
|
|
140
|
+
seller: string;
|
|
141
|
+
sellerChain: string[];
|
|
142
|
+
slas: any[];
|
|
143
|
+
price: number;
|
|
144
|
+
listPrice: number;
|
|
145
|
+
}
|
|
146
|
+
export interface RatesAndBenefitsData {
|
|
147
|
+
rateAndBenefitsIdentifiers: any[];
|
|
148
|
+
teaser: any[];
|
|
149
|
+
}
|
|
150
|
+
export interface Total {
|
|
151
|
+
id: string;
|
|
152
|
+
name: string;
|
|
153
|
+
value: number;
|
|
154
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const fetchAPI: (info: RequestInfo, init?: RequestInit | undefined) => Promise<any>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Options } from '..';
|
|
2
|
+
export declare type Clients = ReturnType<typeof getClients>;
|
|
3
|
+
export declare const getClients: (options: Options) => {
|
|
4
|
+
search: {
|
|
5
|
+
facets: (args: Pick<import("./search").SearchArgs, "query" | "page" | "count" | "sort" | "selectedFacets" | "fuzzy">) => Promise<import("./search/types/AttributeSearchResult").AttributeSearchResult>;
|
|
6
|
+
products: (args: Pick<import("./search").SearchArgs, "query" | "page" | "count" | "sort" | "selectedFacets" | "fuzzy">) => Promise<import("./search/types/ProductSearchResult").ProductSearchResult>;
|
|
7
|
+
};
|
|
8
|
+
commerce: {
|
|
9
|
+
catalog: {
|
|
10
|
+
brand: {
|
|
11
|
+
list: () => Promise<import("./commerce/types/Brand").Brand[]>;
|
|
12
|
+
};
|
|
13
|
+
category: {
|
|
14
|
+
tree: (depth?: number) => Promise<import("./commerce/types/CategoryTree").CategoryTree[]>;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
checkout: {
|
|
18
|
+
simulation: (args: import("./commerce/types/Simulation").SimulationArgs, { salesChannel }?: import("./commerce/types/Simulation").SimulationOptions) => Promise<import("./commerce/types/Simulation").Simulation>;
|
|
19
|
+
orderForm: ({ id, refreshOutdatedData, salesChannel, }: {
|
|
20
|
+
id: string;
|
|
21
|
+
refreshOutdatedData?: boolean | undefined;
|
|
22
|
+
salesChannel?: string | undefined;
|
|
23
|
+
}) => Promise<import("./commerce/types/OrderForm").OrderForm>;
|
|
24
|
+
updateOrderFormItems: ({ id, orderItems, allowOutdatedData, salesChannel, }: {
|
|
25
|
+
id: string;
|
|
26
|
+
orderItems: import("./commerce/types/OrderForm").OrderFormInputItem[];
|
|
27
|
+
allowOutdatedData?: "paymentData" | undefined;
|
|
28
|
+
salesChannel?: string | undefined;
|
|
29
|
+
}) => Promise<import("./commerce/types/OrderForm").OrderForm>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { SelectedFacet } from '../../utils/facets';
|
|
2
|
+
import type { Options } from '../..';
|
|
3
|
+
import type { ProductSearchResult } from './types/ProductSearchResult';
|
|
4
|
+
import type { AttributeSearchResult } from './types/AttributeSearchResult';
|
|
5
|
+
export declare type Sort = 'price:desc' | 'price:asc' | 'orders:desc' | 'name:desc' | 'name:asc' | 'release:desc' | 'discount:desc' | '';
|
|
6
|
+
export interface SearchArgs {
|
|
7
|
+
query?: string;
|
|
8
|
+
page: number;
|
|
9
|
+
count: number;
|
|
10
|
+
type: 'product_search' | 'attribute_search';
|
|
11
|
+
sort?: Sort;
|
|
12
|
+
selectedFacets?: SelectedFacet[];
|
|
13
|
+
fuzzy?: '0' | '1';
|
|
14
|
+
}
|
|
15
|
+
export interface ProductLocator {
|
|
16
|
+
field: 'id' | 'slug';
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const IntelligentSearch: (opts: Options) => {
|
|
20
|
+
facets: (args: Omit<SearchArgs, 'type'>) => Promise<AttributeSearchResult>;
|
|
21
|
+
products: (args: Omit<SearchArgs, 'type'>) => Promise<ProductSearchResult>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface AttributeSearchResult {
|
|
2
|
+
total: number;
|
|
3
|
+
pagination: Pagination;
|
|
4
|
+
sampling: boolean;
|
|
5
|
+
translated: boolean;
|
|
6
|
+
locale: string;
|
|
7
|
+
query: string;
|
|
8
|
+
operator: string;
|
|
9
|
+
fuzzy: string;
|
|
10
|
+
attributes: Attribute[];
|
|
11
|
+
}
|
|
12
|
+
export interface Attribute {
|
|
13
|
+
ids: string[];
|
|
14
|
+
visible: boolean;
|
|
15
|
+
values: Value[];
|
|
16
|
+
active: boolean;
|
|
17
|
+
key: string;
|
|
18
|
+
originalKey: string;
|
|
19
|
+
label: string;
|
|
20
|
+
originalLabel: string;
|
|
21
|
+
type: string;
|
|
22
|
+
minValue?: number;
|
|
23
|
+
maxValue?: number;
|
|
24
|
+
templateURL?: string;
|
|
25
|
+
proxyURL?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface Value {
|
|
28
|
+
count: number;
|
|
29
|
+
active: boolean;
|
|
30
|
+
key?: string;
|
|
31
|
+
label?: string;
|
|
32
|
+
id?: string;
|
|
33
|
+
originalKey?: string;
|
|
34
|
+
originalLabel?: string;
|
|
35
|
+
proxyURL: string;
|
|
36
|
+
from?: string;
|
|
37
|
+
to?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Pagination {
|
|
40
|
+
count: number;
|
|
41
|
+
current: Current;
|
|
42
|
+
before: any[];
|
|
43
|
+
after: any[];
|
|
44
|
+
perPage: number;
|
|
45
|
+
next: First;
|
|
46
|
+
previous: First;
|
|
47
|
+
first: First;
|
|
48
|
+
last: First;
|
|
49
|
+
}
|
|
50
|
+
export interface Current {
|
|
51
|
+
index: number;
|
|
52
|
+
proxyURL: string;
|
|
53
|
+
}
|
|
54
|
+
export interface First {
|
|
55
|
+
index: number;
|
|
56
|
+
}
|