@faststore/api 1.12.20 → 1.12.29

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 (32) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/__generated__/schema.d.ts +199 -0
  3. package/dist/api.cjs.development.js +156 -54
  4. package/dist/api.cjs.development.js.map +1 -1
  5. package/dist/api.cjs.production.min.js +1 -1
  6. package/dist/api.cjs.production.min.js.map +1 -1
  7. package/dist/api.esm.js +156 -54
  8. package/dist/api.esm.js.map +1 -1
  9. package/dist/index.d.ts +23 -0
  10. package/dist/platforms/vtex/clients/commerce/index.d.ts +2 -0
  11. package/dist/platforms/vtex/clients/commerce/types/Address.d.ts +16 -0
  12. package/dist/platforms/vtex/clients/commerce/types/Simulation.d.ts +2 -2
  13. package/dist/platforms/vtex/clients/index.d.ts +1 -0
  14. package/dist/platforms/vtex/index.d.ts +23 -0
  15. package/dist/platforms/vtex/loaders/index.d.ts +1 -1
  16. package/dist/platforms/vtex/loaders/simulation.d.ts +2 -2
  17. package/dist/platforms/vtex/resolvers/query.d.ts +18 -1
  18. package/dist/platforms/vtex/resolvers/shippingSLA.d.ts +14 -0
  19. package/package.json +2 -2
  20. package/src/__generated__/schema.ts +212 -0
  21. package/src/platforms/vtex/clients/commerce/index.ts +9 -0
  22. package/src/platforms/vtex/clients/commerce/types/Address.ts +17 -0
  23. package/src/platforms/vtex/clients/commerce/types/Simulation.ts +2 -2
  24. package/src/platforms/vtex/index.ts +2 -0
  25. package/src/platforms/vtex/loaders/simulation.ts +13 -6
  26. package/src/platforms/vtex/resolvers/query.ts +21 -0
  27. package/src/platforms/vtex/resolvers/shippingSLA.ts +64 -0
  28. package/src/platforms/vtex/resolvers/validateSession.ts +3 -2
  29. package/src/typeDefs/address.graphql +45 -0
  30. package/src/typeDefs/index.ts +10 -6
  31. package/src/typeDefs/query.graphql +19 -0
  32. package/src/typeDefs/shipping.graphql +304 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.12.29](https://github.com/vtex/faststore/compare/v1.12.28...v1.12.29) (2022-11-14)
7
+
8
+
9
+ ### Features
10
+
11
+ * Shipping Simulation Integration ([#1440](https://github.com/vtex/faststore/issues/1440)) ([8eacba4](https://github.com/vtex/faststore/commit/8eacba46a40f53be7fdca72dc04ff838dbf449c7))
12
+
13
+
14
+
15
+ ## [1.12.21](https://github.com/vtex/faststore/compare/v1.12.20...v1.12.21) (2022-10-31)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Takes sales channel in consideration when getting region ([#1499](https://github.com/vtex/faststore/issues/1499)) ([6827c39](https://github.com/vtex/faststore/commit/6827c396a43e025e5bafb726471fdd212baba330))
21
+
22
+
23
+
6
24
  ## 1.12.20 (2022-10-26)
7
25
 
8
26
 
@@ -81,6 +81,43 @@ export declare type Scalars = {
81
81
  */
82
82
  VariantsByName: any;
83
83
  };
84
+ /** Address information. */
85
+ export declare type Address = {
86
+ __typename?: 'Address';
87
+ /** Address city */
88
+ city?: Maybe<Scalars['String']>;
89
+ /** Address complement */
90
+ complement?: Maybe<Scalars['String']>;
91
+ /** Address country */
92
+ country?: Maybe<Scalars['String']>;
93
+ /** Address geoCoordinates */
94
+ geoCoordinates?: Maybe<Array<Maybe<Scalars['Float']>>>;
95
+ /** Address neighborhood */
96
+ neighborhood?: Maybe<Scalars['String']>;
97
+ /** Address number */
98
+ number?: Maybe<Scalars['String']>;
99
+ /** Address postal code */
100
+ postalCode?: Maybe<Scalars['String']>;
101
+ /** Address reference */
102
+ reference?: Maybe<Scalars['String']>;
103
+ /** Address state */
104
+ state?: Maybe<Scalars['String']>;
105
+ /** Address street */
106
+ street?: Maybe<Scalars['String']>;
107
+ };
108
+ export declare type DeliveryIds = {
109
+ __typename?: 'DeliveryIds';
110
+ /** DeliveryIds courier id */
111
+ courierId?: Maybe<Scalars['String']>;
112
+ /** DeliveryIds courier name */
113
+ courierName?: Maybe<Scalars['String']>;
114
+ /** DeliveryIds dock id */
115
+ dockId?: Maybe<Scalars['String']>;
116
+ /** DeliveryIds quantity */
117
+ quantity?: Maybe<Scalars['Int']>;
118
+ /** DeliveryIds warehouse id */
119
+ warehouseId?: Maybe<Scalars['String']>;
120
+ };
84
121
  /** Person data input to the newsletter. */
85
122
  export declare type IPersonNewsletter = {
86
123
  /** Person's email. */
@@ -88,6 +125,15 @@ export declare type IPersonNewsletter = {
88
125
  /** Person's name. */
89
126
  name: Scalars['String'];
90
127
  };
128
+ /** Shipping Simulation item input. */
129
+ export declare type IShippingItem = {
130
+ /** ShippingItem ID / Sku. */
131
+ id: Scalars['String'];
132
+ /** Number of items. */
133
+ quantity: Scalars['Int'];
134
+ /** Seller responsible for the ShippingItem. */
135
+ seller: Scalars['String'];
136
+ };
91
137
  /** Shopping cart input. */
92
138
  export declare type IStoreCart = {
93
139
  /** Order information, including `orderNumber` and `acceptedOffer`. */
@@ -185,6 +231,66 @@ export declare type IStoreSession = {
185
231
  /** Session input postal code. */
186
232
  postalCode?: Maybe<Scalars['String']>;
187
233
  };
234
+ export declare type LogisticsInfo = {
235
+ __typename?: 'LogisticsInfo';
236
+ /** LogisticsInfo itemIndex. */
237
+ itemIndex?: Maybe<Scalars['String']>;
238
+ /** LogisticsInfo selectedSla. */
239
+ selectedSla?: Maybe<Scalars['String']>;
240
+ /** List of LogisticsInfo ShippingSLA. */
241
+ slas?: Maybe<Array<Maybe<ShippingSla>>>;
242
+ };
243
+ /** Shipping Simulation Logistic Item. */
244
+ export declare type LogisticsItem = {
245
+ __typename?: 'LogisticsItem';
246
+ /** LogisticsItem availability. */
247
+ availability?: Maybe<Scalars['String']>;
248
+ /** LogisticsItem ID / Sku. */
249
+ id?: Maybe<Scalars['String']>;
250
+ /** LogisticsItem listPrice. */
251
+ listPrice?: Maybe<Scalars['Int']>;
252
+ /** LogisticsItem measurementUnit. */
253
+ measurementUnit?: Maybe<Scalars['String']>;
254
+ /** LogisticsItem price. */
255
+ price?: Maybe<Scalars['Int']>;
256
+ /** Next date in which price is scheduled to change. If there is no scheduled change, this will be set a year in the future from current time. */
257
+ priceValidUntil?: Maybe<Scalars['String']>;
258
+ /** Number of items. */
259
+ quantity?: Maybe<Scalars['Int']>;
260
+ requestIndex?: Maybe<Scalars['Int']>;
261
+ /** LogisticsItem rewardValue. */
262
+ rewardValue?: Maybe<Scalars['Int']>;
263
+ /** Seller responsible for the ShippingItem. */
264
+ seller?: Maybe<Scalars['String']>;
265
+ /** List of Sellers. */
266
+ sellerChain?: Maybe<Array<Maybe<Scalars['String']>>>;
267
+ /** LogisticsItem sellingPrice. */
268
+ sellingPrice?: Maybe<Scalars['Int']>;
269
+ /** LogisticsItem tax. */
270
+ tax?: Maybe<Scalars['Int']>;
271
+ /** LogisticsItem unitMultiplier. */
272
+ unitMultiplier?: Maybe<Scalars['Int']>;
273
+ };
274
+ export declare type MessageFields = {
275
+ __typename?: 'MessageFields';
276
+ /** MessageFields ean. */
277
+ ean?: Maybe<Scalars['String']>;
278
+ /** MessageFields item index. */
279
+ itemIndex?: Maybe<Scalars['String']>;
280
+ /** MessageFields sku name. */
281
+ skuName?: Maybe<Scalars['String']>;
282
+ };
283
+ export declare type MessageInfo = {
284
+ __typename?: 'MessageInfo';
285
+ /** MessageInfo code. */
286
+ code?: Maybe<Scalars['String']>;
287
+ /** MessageInfo fields. */
288
+ fields?: Maybe<MessageFields>;
289
+ /** MessageInfo status. */
290
+ status?: Maybe<Scalars['String']>;
291
+ /** MessageInfo text. */
292
+ text?: Maybe<Scalars['String']>;
293
+ };
188
294
  export declare type Mutation = {
189
295
  __typename?: 'Mutation';
190
296
  /** Subscribes a new person to the newsletter list. */
@@ -211,6 +317,48 @@ export declare type PersonNewsletter = {
211
317
  /** Person's ID in the newsletter list. */
212
318
  id: Scalars['String'];
213
319
  };
320
+ export declare type PickupAddress = {
321
+ __typename?: 'PickupAddress';
322
+ /** PickupAddress address id. */
323
+ addressId?: Maybe<Scalars['String']>;
324
+ /** PickupAddress address type. */
325
+ addressType?: Maybe<Scalars['String']>;
326
+ /** PickupAddress city. */
327
+ city?: Maybe<Scalars['String']>;
328
+ /** PickupAddress complement. */
329
+ complement?: Maybe<Scalars['String']>;
330
+ /** PickupAddress country. */
331
+ country?: Maybe<Scalars['String']>;
332
+ /** PickupAddress geo coordinates. */
333
+ geoCoordinates?: Maybe<Array<Maybe<Scalars['Float']>>>;
334
+ /** PickupAddress neighborhood. */
335
+ neighborhood?: Maybe<Scalars['String']>;
336
+ /** PickupAddress number. */
337
+ number?: Maybe<Scalars['String']>;
338
+ /** PickupAddress postal code. */
339
+ postalCode?: Maybe<Scalars['String']>;
340
+ /** PickupAddress receiver name. */
341
+ receiverName?: Maybe<Scalars['String']>;
342
+ /** PickupAddress reference. */
343
+ reference?: Maybe<Scalars['String']>;
344
+ /** PickupAddress state. */
345
+ state?: Maybe<Scalars['String']>;
346
+ /** PickupAddress street. */
347
+ street?: Maybe<Scalars['String']>;
348
+ };
349
+ export declare type PickupStoreInfo = {
350
+ __typename?: 'PickupStoreInfo';
351
+ /** PickupStoreInfo additional information. */
352
+ additionalInfo?: Maybe<Scalars['String']>;
353
+ /** PickupStoreInfo address. */
354
+ address?: Maybe<PickupAddress>;
355
+ /** PickupStoreInfo dock id. */
356
+ dockId?: Maybe<Scalars['String']>;
357
+ /** PickupStoreInfo friendly name. */
358
+ friendlyName?: Maybe<Scalars['String']>;
359
+ /** Information if the store has pickup enable. */
360
+ isPickupStore?: Maybe<Scalars['Boolean']>;
361
+ };
214
362
  export declare type Query = {
215
363
  __typename?: 'Query';
216
364
  /** Returns information about all collections. */
@@ -223,6 +371,8 @@ export declare type Query = {
223
371
  product: StoreProduct;
224
372
  /** Returns the result of a product, facet, or suggestion search. */
225
373
  search: StoreSearchResult;
374
+ /** Returns information about shipping simulation. */
375
+ shipping?: Maybe<ShippingData>;
226
376
  };
227
377
  export declare type QueryAllCollectionsArgs = {
228
378
  after?: Maybe<Scalars['String']>;
@@ -245,6 +395,55 @@ export declare type QuerySearchArgs = {
245
395
  sort?: Maybe<StoreSort>;
246
396
  term?: Maybe<Scalars['String']>;
247
397
  };
398
+ export declare type QueryShippingArgs = {
399
+ country: Scalars['String'];
400
+ items: Array<IShippingItem>;
401
+ postalCode: Scalars['String'];
402
+ };
403
+ /** Shipping Simulation information. */
404
+ export declare type ShippingData = {
405
+ __typename?: 'ShippingData';
406
+ /** Address information. */
407
+ address?: Maybe<Address>;
408
+ /** List of LogisticsItem. */
409
+ items?: Maybe<Array<Maybe<LogisticsItem>>>;
410
+ /** List of LogisticsInfo. */
411
+ logisticsInfo?: Maybe<Array<Maybe<LogisticsInfo>>>;
412
+ /** List of MessageInfo. */
413
+ messages?: Maybe<Array<Maybe<MessageInfo>>>;
414
+ };
415
+ export declare type ShippingSla = {
416
+ __typename?: 'ShippingSLA';
417
+ /** ShippingSLA carrier. */
418
+ carrier?: Maybe<Scalars['String']>;
419
+ /** ShippingSLA delivery channel. */
420
+ deliveryChannel?: Maybe<Scalars['String']>;
421
+ /** List of ShippingSLA delivery ids. */
422
+ deliveryIds?: Maybe<Array<Maybe<DeliveryIds>>>;
423
+ /** ShippingSLA friendly name. */
424
+ friendlyName?: Maybe<Scalars['String']>;
425
+ /** ShippingSLA id. */
426
+ id?: Maybe<Scalars['String']>;
427
+ /**
428
+ * ShippingSLA localized shipping estimate.
429
+ * Note: this will always return a localized string for locale `en-US`.
430
+ */
431
+ localizedEstimates?: Maybe<Scalars['String']>;
432
+ /** ShippingSLA name. */
433
+ name?: Maybe<Scalars['String']>;
434
+ /** ShippingSLA pickup distance. */
435
+ pickupDistance?: Maybe<Scalars['Float']>;
436
+ /** ShippingSLA pickup point id. */
437
+ pickupPointId?: Maybe<Scalars['String']>;
438
+ /** ShippingSLA pickup store info. */
439
+ pickupStoreInfo?: Maybe<PickupStoreInfo>;
440
+ /** ShippingSLA price. */
441
+ price?: Maybe<Scalars['Float']>;
442
+ /** ShippingSLA shipping estimate. */
443
+ shippingEstimate?: Maybe<Scalars['String']>;
444
+ /** ShippingSLA shipping estimate date. */
445
+ shippingEstimateDate?: Maybe<Scalars['String']>;
446
+ };
248
447
  export declare type SkuVariants = {
249
448
  __typename?: 'SkuVariants';
250
449
  /** SKU property values for the current SKU. */