@artisan-commerce/types 0.14.0-canary.2 → 0.14.0-canary.21

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 (87) hide show
  1. package/CHANGELOG.md +167 -0
  2. package/dist/bundle.d.ts +2945 -0
  3. package/package.json +18 -12
  4. package/build/index.d.ts +0 -26
  5. package/build/index.js +0 -40
  6. package/build/index.js.map +0 -1
  7. package/build/types/account.types.d.ts +0 -17
  8. package/build/types/account.types.js +0 -4
  9. package/build/types/account.types.js.map +0 -1
  10. package/build/types/app.types.d.ts +0 -153
  11. package/build/types/app.types.js +0 -4
  12. package/build/types/app.types.js.map +0 -1
  13. package/build/types/artisnDB.types.d.ts +0 -29
  14. package/build/types/artisnDB.types.js +0 -4
  15. package/build/types/artisnDB.types.js.map +0 -1
  16. package/build/types/banner.types.d.ts +0 -97
  17. package/build/types/banner.types.js +0 -4
  18. package/build/types/banner.types.js.map +0 -1
  19. package/build/types/billingData.types.d.ts +0 -39
  20. package/build/types/billingData.types.js +0 -4
  21. package/build/types/billingData.types.js.map +0 -1
  22. package/build/types/catalogue.types.d.ts +0 -16
  23. package/build/types/catalogue.types.js +0 -4
  24. package/build/types/catalogue.types.js.map +0 -1
  25. package/build/types/category.types.d.ts +0 -33
  26. package/build/types/category.types.js +0 -4
  27. package/build/types/category.types.js.map +0 -1
  28. package/build/types/common.types.d.ts +0 -36
  29. package/build/types/common.types.js +0 -4
  30. package/build/types/common.types.js.map +0 -1
  31. package/build/types/country.types.d.ts +0 -51
  32. package/build/types/country.types.js +0 -4
  33. package/build/types/country.types.js.map +0 -1
  34. package/build/types/coupon.types.d.ts +0 -112
  35. package/build/types/coupon.types.js +0 -4
  36. package/build/types/coupon.types.js.map +0 -1
  37. package/build/types/currency.types.d.ts +0 -7
  38. package/build/types/currency.types.js +0 -4
  39. package/build/types/currency.types.js.map +0 -1
  40. package/build/types/fulfillment.types.d.ts +0 -218
  41. package/build/types/fulfillment.types.js +0 -4
  42. package/build/types/fulfillment.types.js.map +0 -1
  43. package/build/types/http.types.d.ts +0 -64
  44. package/build/types/http.types.js +0 -4
  45. package/build/types/http.types.js.map +0 -1
  46. package/build/types/image.types.d.ts +0 -82
  47. package/build/types/image.types.js +0 -4
  48. package/build/types/image.types.js.map +0 -1
  49. package/build/types/livingPlace.types.d.ts +0 -92
  50. package/build/types/livingPlace.types.js +0 -4
  51. package/build/types/livingPlace.types.js.map +0 -1
  52. package/build/types/notification.types.d.ts +0 -21
  53. package/build/types/notification.types.js +0 -4
  54. package/build/types/notification.types.js.map +0 -1
  55. package/build/types/order.types.d.ts +0 -157
  56. package/build/types/order.types.js +0 -3
  57. package/build/types/order.types.js.map +0 -1
  58. package/build/types/payment.types.d.ts +0 -97
  59. package/build/types/payment.types.js +0 -4
  60. package/build/types/payment.types.js.map +0 -1
  61. package/build/types/product.types.d.ts +0 -299
  62. package/build/types/product.types.js +0 -4
  63. package/build/types/product.types.js.map +0 -1
  64. package/build/types/settings.types.d.ts +0 -23
  65. package/build/types/settings.types.js +0 -4
  66. package/build/types/settings.types.js.map +0 -1
  67. package/build/types/shippingAddress.types.d.ts +0 -73
  68. package/build/types/shippingAddress.types.js +0 -4
  69. package/build/types/shippingAddress.types.js.map +0 -1
  70. package/build/types/shippingCost.types.d.ts +0 -54
  71. package/build/types/shippingCost.types.js +0 -4
  72. package/build/types/shippingCost.types.js.map +0 -1
  73. package/build/types/shoppingCart.types.d.ts +0 -124
  74. package/build/types/shoppingCart.types.js +0 -4
  75. package/build/types/shoppingCart.types.js.map +0 -1
  76. package/build/types/store.types.d.ts +0 -198
  77. package/build/types/store.types.js +0 -4
  78. package/build/types/store.types.js.map +0 -1
  79. package/build/types/user.types.d.ts +0 -114
  80. package/build/types/user.types.js +0 -4
  81. package/build/types/user.types.js.map +0 -1
  82. package/build/types/vendor.types.d.ts +0 -23
  83. package/build/types/vendor.types.js +0 -3
  84. package/build/types/vendor.types.js.map +0 -1
  85. package/build/vendors.d.ts +0 -1
  86. package/build/vendors.js +0 -4
  87. package/build/vendors.js.map +0 -1
@@ -0,0 +1,2945 @@
1
+ import firebase from 'firebase';
2
+ import { ReactNativeFirebase } from '@react-native-firebase/app';
3
+ import authRN, { FirebaseAuthTypes } from '@react-native-firebase/auth';
4
+ import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore';
5
+
6
+ /**
7
+ * Representation of a image allocated in a CDN.
8
+ *
9
+ * @interface CDNImage
10
+ * @since 0.5.14
11
+ */
12
+ interface CDNImage {
13
+ /** The bucket where the image is located */
14
+ bucket: string | null;
15
+ /** The cloud where the image is saved */
16
+ cloudFrontUrl?: string;
17
+ /** The directory where the image is saved */
18
+ key: string | null;
19
+ /** Image's name */
20
+ name: string;
21
+ /** The url where the image is saved */
22
+ url: string;
23
+ /** The base 64 image value */
24
+ base64: string | null;
25
+ }
26
+ /**
27
+ * A image url.
28
+ *
29
+ * @typedef URLImage
30
+ * @since 0.5.14
31
+ */
32
+ declare type URLImage = string;
33
+ /**
34
+ * Configuration on how to setup the cloudfront image manipulation.
35
+ *
36
+ * @since 0.5.14
37
+ * @interface ImageManipulationConfig
38
+ */
39
+ interface ImageManipulationConfig {
40
+ /** Image's width */
41
+ width?: number;
42
+ /** Image's height */
43
+ height?: number;
44
+ /** Determines how to resize the image, see {@link ImageFit} */
45
+ fit?: ImageFit;
46
+ /**
47
+ * Determines in which format the resulting image must be,
48
+ * see {@link ImageToFormat}
49
+ */
50
+ toFormat?: ImageToFormat;
51
+ }
52
+ /**
53
+ * Representation of a Commerce Image which could be a
54
+ * {@link CDNImage} or a {@link URLImage}.
55
+ *
56
+ * @typedef Image
57
+ * @since 0.5.14
58
+ */
59
+ declare type Image = CDNImage | URLImage;
60
+ /**
61
+ * Contains different properties on how to resize the image.
62
+ *
63
+ * @typedef ImageFit
64
+ * @since 0.5.14
65
+ */
66
+ declare type ImageFit = "fill" | "cover" | "contain" | "inside" | "outside";
67
+ /**
68
+ * Contains different image formats.
69
+ *
70
+ * @typedef ImageToFormat
71
+ * @since 0.5.14
72
+ */
73
+ declare type ImageToFormat = "jpg" | "jpeg" | "png" | "svg";
74
+ /**
75
+ * Random image configuration.
76
+ *
77
+ * @since 0.5.15
78
+ * @interface RandomImageConfig
79
+ */
80
+ interface RandomImageConfig {
81
+ /** A word which will be used to generate the random image */
82
+ query?: string | undefined;
83
+ /** The width to be used to generate the random image */
84
+ width?: number;
85
+ /** The height to be used to generate the random image */
86
+ height?: number;
87
+ }
88
+
89
+ /**
90
+ * Representation of a Commerce Account.
91
+ *
92
+ * @interface Account
93
+ * @since 0.5.14
94
+ */
95
+ interface Account {
96
+ /** Artisn's account unique identifier */
97
+ accountId: number;
98
+ /** Account's name */
99
+ name: string;
100
+ /** Account's description */
101
+ description?: string;
102
+ /** Account's images, see {@link CDNImage} for further information */
103
+ images: CDNImage[];
104
+ }
105
+
106
+ /**
107
+ * The ArtisnApp controls the app connection with the DBs and its settings.
108
+ *
109
+ * @typedef ArtisnApp
110
+ * @since 0.1.0
111
+ */
112
+ declare type ArtisnApp = ArtisnWebApp | ArtisnRNApp;
113
+ /**
114
+ * The ArtisnWebApp orchestrate the connections of the app with the DB, server
115
+ * and its settings.
116
+ *
117
+ * @interface ArtisnWebApp
118
+ * @since 0.1.0
119
+ */
120
+ interface ArtisnWebApp {
121
+ /** App's name */
122
+ name: firebase.app.App["name"];
123
+ /** Artisn's account API URL */
124
+ apiURL: string;
125
+ /** Artisn app settings configuration, see {@link ArtisnWebSettings} */
126
+ settings: ArtisnWebSettings;
127
+ /** Internal configuration of App and databases */
128
+ __internals__: firebase.app.App;
129
+ /** ArtisnApp object internal instance */
130
+ __instance__: typeof firebase;
131
+ }
132
+ /**
133
+ * The ArtisnRNApp orchestrate the connections of the app with the DB, server
134
+ * and its settings.
135
+ *
136
+ * @interface ArtisnRNApp
137
+ * @since 0.1.0
138
+ */
139
+ interface ArtisnRNApp {
140
+ /** App's name */
141
+ name: ReactNativeFirebase.FirebaseApp["name"];
142
+ /** Artisn's account API URL */
143
+ apiURL: string;
144
+ /** Artisn app settings configuration, see {@link ArtisnRNSettings} */
145
+ settings: ArtisnRNSettings;
146
+ /** Internal configuration of App and databases */
147
+ __internals__: ReactNativeFirebase.FirebaseApp;
148
+ /** ArtisnApp object internal instance */
149
+ __instance__: ReactNativeFirebase.Module;
150
+ }
151
+ /**
152
+ * Settings to configure the Artisn app.
153
+ *
154
+ * @interface ArtisnWebSettings
155
+ * @since 0.1.0
156
+ */
157
+ interface ArtisnWebSettings {
158
+ /** Artisn's account unique identifier */
159
+ accountId?: number;
160
+ /** Platform where the app is running, see {@link ArtisnPlatform} */
161
+ platform?: ArtisnPlatform;
162
+ /** App's project id */
163
+ projectId: string;
164
+ /** App's API key */
165
+ apiKey: string;
166
+ /** App's external app id */
167
+ appId?: string;
168
+ /** App's auth domain url */
169
+ authDomain: string;
170
+ }
171
+ /**
172
+ * Settings to configure the Artisn app react-native.
173
+ *
174
+ * @interface ArtisnRNSettings
175
+ * @since 0.1.0
176
+ */
177
+ interface ArtisnRNSettings {
178
+ /** Platform where the app is running, see {@link ArtisnPlatform} */
179
+ platform: ArtisnPlatform;
180
+ /** Artisn's account unique identifier */
181
+ accountId?: number;
182
+ }
183
+ /**
184
+ * Artisn app's allowed platforms to run on.
185
+ *
186
+ * @typedef ArtisnPlatform
187
+ * @since 0.1.0
188
+ */
189
+ declare type ArtisnPlatform = "web" | "ios" | "android" | "windows" | "macos" | "call center";
190
+ /**
191
+ * Artisn's auth instance is the instance of the internal auth object.
192
+ *
193
+ * @typedef ArtisnWebAuthInstance
194
+ * @since 0.1.0
195
+ */
196
+ declare type ArtisnWebAuthInstance = typeof firebase.auth;
197
+ /**
198
+ * Artisn's auth instance is the instance of the internal auth object for react
199
+ * native.
200
+ *
201
+ * @typedef ArtisnRNAuthInstance
202
+ * @since 0.1.0
203
+ */
204
+ declare type ArtisnRNAuthInstance = typeof authRN;
205
+ /**
206
+ * Artisn's auth object to handle providers authentication.
207
+ *
208
+ * @interface ArtisnWebAuth
209
+ * @since 0.1.0
210
+ * @extends {{@link firebase.auth.Auth}
211
+ */
212
+ interface ArtisnWebAuth extends firebase.auth.Auth {
213
+ }
214
+ /**
215
+ * Artisn's auth object to handle providers authentication for react native.
216
+ *
217
+ * @interface ArtisnRNAuth
218
+ * @since 0.1.0
219
+ * @extends {{@link FirebaseAuthTypes.Module}
220
+ */
221
+ interface ArtisnRNAuth extends FirebaseAuthTypes.Module {
222
+ }
223
+ /**
224
+ * Main artisn commerce filters.
225
+ *
226
+ * @interface ArtisnHints
227
+ * @since 0.1.0
228
+ */
229
+ interface ArtisnHints {
230
+ /** Artisn's account unique identifier */
231
+ accountId: string | number;
232
+ /** Artisn's vendor unique identifier */
233
+ vendorId?: string | number;
234
+ /** Artisn's catalogue unique identifier */
235
+ catalogueId?: string | number;
236
+ /** Artisn's store unique identifier */
237
+ storeId?: number;
238
+ /** Artisn's category unique identifier */
239
+ categoryId?: string | number;
240
+ /** Artisn's productId unique identifier */
241
+ productId?: string | number;
242
+ }
243
+ /**
244
+ * Unrestricted allowed Artisn SDK rest api headers.
245
+ *
246
+ * @interface ArtisnHeaders
247
+ * @since 0.1.0
248
+ */
249
+ interface ArtisnHeaders {
250
+ /** Platform where the app is running, see {@link ArtisnPlatform} */
251
+ Platform: ArtisnPlatform;
252
+ /** Artisn's account unique identifier */
253
+ account: string;
254
+ }
255
+ /**
256
+ * Restricted allowed Artisn SDK rest api headers.
257
+ *
258
+ * @interface ArtisnRestrictedHeaders
259
+ * @since 0.1.0
260
+ * @extends {{@link ArtisnHeaders}
261
+ */
262
+ interface ArtisnRestrictedHeaders extends ArtisnHeaders {
263
+ /** Authorization app's authentication token */
264
+ Authorization: string;
265
+ }
266
+
267
+ /**
268
+ * Artisn database object.
269
+ *
270
+ * @typedef ArtisnDB
271
+ * @since 0.1.0
272
+ */
273
+ declare type ArtisnDB = firebase.firestore.Firestore | FirebaseFirestoreTypes.Module;
274
+ /**
275
+ * Artisn database document data object.
276
+ *
277
+ * @typedef ArtisnDBDocumentData
278
+ * @since 0.1.0
279
+ */
280
+ declare type ArtisnDBDocumentData = firebase.firestore.DocumentData | FirebaseFirestoreTypes.DocumentData;
281
+ /**
282
+ * The current state of a node from the Artisn DB.
283
+ *
284
+ * @typedef ArtisnDBQueryDocumentSnapshot
285
+ * @since 0.1.0
286
+ */
287
+ declare type ArtisnDBQueryDocumentSnapshot<T = ArtisnDBDocumentData> = firebase.firestore.QueryDocumentSnapshot<T> | FirebaseFirestoreTypes.QueryDocumentSnapshot<T>;
288
+ /**
289
+ * An Artisn DB collection of nodes.
290
+ *
291
+ * @typedef ArtisnDBCollectionReference
292
+ * @since 0.1.0
293
+ */
294
+ declare type ArtisnDBCollectionReference<T = ArtisnDBDocumentData> = firebase.firestore.CollectionReference<T> | FirebaseFirestoreTypes.CollectionReference<T>;
295
+
296
+ /**
297
+ * Representation of a Commerce Banner.
298
+ *
299
+ * @interface Banner
300
+ * @since 0.5.14
301
+ */
302
+ interface Banner {
303
+ /** Banner category id */
304
+ banner_category_id: number;
305
+ /** Banner description */
306
+ banner_description: string;
307
+ /** Banner qr code */
308
+ banner_qr_code: string;
309
+ /** Banner title */
310
+ banner_title: string;
311
+ /** Banner type, see {@link BannerType} */
312
+ banner_type: BannerType;
313
+ /** Banner image url */
314
+ banner_url: string | null;
315
+ /** Banner's benefits */
316
+ benefits: null;
317
+ /** Banner category id */
318
+ category_id: number;
319
+ /** Banner category name */
320
+ category_name: string;
321
+ /** Banner channel's id */
322
+ channel_id: number;
323
+ /** Banner coupon's code */
324
+ coupon: null;
325
+ /** Banner coupon's id */
326
+ coupon_id: string | null;
327
+ /** The base 64 image value, see {@link CDNImage} */
328
+ image_base64: CDNImage["base64"];
329
+ /** The bucket where the image is saved */
330
+ image_bucket: string | null;
331
+ /** he cloud where the banner is saved, see {@link CDNImage} */
332
+ image_cloud_front_url: CDNImage["cloudFrontUrl"];
333
+ /** Banner image's filename */
334
+ image_file_name: string;
335
+ /** The directory where the banner image is saved */
336
+ image_key: string;
337
+ /** The url where the banner image is saved */
338
+ image_url: string;
339
+ /** An array of banner images, see {@link BannerImage} */
340
+ images: BannerImage[];
341
+ /** Banner product's id */
342
+ product_id: null;
343
+ /** Banner product's name */
344
+ product_name: null;
345
+ /** Banner's section */
346
+ section: null;
347
+ /** Banner's scope, see {@link BannerScope} */
348
+ scope: BannerScope;
349
+ /** Banner stores array */
350
+ stores: unknown[];
351
+ /** Banner vendor's id */
352
+ vendor_id: number;
353
+ /** Banner vendor's name */
354
+ vendor_name: string;
355
+ }
356
+ /**
357
+ * The possible values of the banner's type.
358
+ *
359
+ * @typedef BannerType
360
+ * @since 0.5.14
361
+ */
362
+ declare type BannerType = "INFO" | "URL" | "PRODUCT" | "COUPON";
363
+ /**
364
+ * The possible values of the banner's scope.
365
+ *
366
+ * @typedef BannerScope
367
+ * @since 0.5.14
368
+ */
369
+ declare type BannerScope = "WEB" | "GLOBAL" | "APP";
370
+ /**
371
+ * Representation of a Banner image.
372
+ *
373
+ * @interface BannerImage
374
+ * @since 0.5.14
375
+ */
376
+ interface BannerImage {
377
+ /** Banner's id */
378
+ id: number;
379
+ /** Banner image's filename */
380
+ file_name: string;
381
+ /** Banner image's filename */
382
+ image_file_name: string;
383
+ /** Banner image's directory */
384
+ image_key: string;
385
+ /** The url where the banner image is saved */
386
+ image_url: string;
387
+ /** Banner's position inside the banner images array */
388
+ position: number;
389
+ /** The url where the banner image is saved */
390
+ url: string;
391
+ }
392
+
393
+ /**
394
+ * Representation of a Commerce Country.
395
+ *
396
+ * @interface Country
397
+ * @since 0.5.14
398
+ */
399
+ interface Country {
400
+ /** Country's identifier */
401
+ id: number;
402
+ /** Country's name */
403
+ name: string;
404
+ /** Country ISO code, see {@link CountryCode} */
405
+ code: CountryCode;
406
+ /**
407
+ * Object which contains information about country's currency,
408
+ * see {@link CountryCurrency}
409
+ */
410
+ currency: CountryCurrency;
411
+ }
412
+ /**
413
+ * Representation of a country's currency.
414
+ *
415
+ * @interface CountryCurrency
416
+ * @since 0.5.14
417
+ */
418
+ interface CountryCurrency {
419
+ /** Currency's identifier */
420
+ id: number;
421
+ /** Currency's name */
422
+ name: string;
423
+ /** Currency's symbol */
424
+ sign: string;
425
+ /** Currency's external identifier */
426
+ external_id: string;
427
+ }
428
+ /**
429
+ * List of country codes currently supported.
430
+ *
431
+ * @typedef CountryCode
432
+ * @since 0.1.0
433
+ * @see https://www.nationsonline.org/oneworld/country_code_list.htm for reference
434
+ */
435
+ declare type CountryCode = "AR" | "BO" | "BR" | "CL" | "CO" | "EC" | "PY" | "PE" | "UY" | "VE" | "US";
436
+ /**
437
+ * Default documents for all countries.
438
+ *
439
+ * @typedef CommonDocumentType
440
+ * @since 0.1.0
441
+ */
442
+ declare type CommonDocumentType = "PASSPORT";
443
+ /**
444
+ * Argentina supported document types.
445
+ *
446
+ * @typedef ARDocumentType
447
+ * @since 0.1.0
448
+ */
449
+ declare type ARDocumentType = CommonDocumentType;
450
+ /**
451
+ * Bolivia supported document types.
452
+ *
453
+ * @typedef BODocumentType
454
+ * @since 0.1.0
455
+ */
456
+ declare type BODocumentType = CommonDocumentType;
457
+ /**
458
+ * Brasil supported document types.
459
+ *
460
+ * @typedef BRDocumentType
461
+ * @since 0.1.0
462
+ */
463
+ declare type BRDocumentType = CommonDocumentType;
464
+ /**
465
+ * Chile supported document types.
466
+ *
467
+ * @typedef CLDocumentType
468
+ * @since 0.1.0
469
+ */
470
+ declare type CLDocumentType = CommonDocumentType;
471
+ /**
472
+ * Colombia supported document types.
473
+ *
474
+ * @typedef CODocumentType
475
+ * @since 0.1.0
476
+ */
477
+ declare type CODocumentType = CommonDocumentType | "RUT" | "NIT" | "CE" | "CC";
478
+ /**
479
+ * Ecuador supported document types.
480
+ *
481
+ * @typedef ECDocumentType
482
+ * @since 0.1.0
483
+ */
484
+ declare type ECDocumentType = CommonDocumentType | "CI" | "RUC";
485
+ /**
486
+ * Paraguay supported document types.
487
+ *
488
+ * @typedef PYDocumentType
489
+ * @since 0.1.0
490
+ */
491
+ declare type PYDocumentType = CommonDocumentType;
492
+ /**
493
+ * Perú supported document types.
494
+ *
495
+ * @typedef PEDocumentType
496
+ * @since 0.1.0
497
+ */
498
+ declare type PEDocumentType = CommonDocumentType;
499
+ /**
500
+ * Uruguay supported document types.
501
+ *
502
+ * @typedef UYDocumentType
503
+ * @since 0.1.0
504
+ */
505
+ declare type UYDocumentType = CommonDocumentType;
506
+ /**
507
+ * Venezuela supported document types.
508
+ *
509
+ * @typedef VEDocumentType
510
+ * @since 0.1.0
511
+ */
512
+ declare type VEDocumentType = CommonDocumentType;
513
+ /**
514
+ * United States supported document types.
515
+ *
516
+ * @typedef USDocumentType
517
+ * @since 0.1.0
518
+ */
519
+ declare type USDocumentType = CommonDocumentType;
520
+
521
+ /**
522
+ * Representation of a generic object.
523
+ *
524
+ * @interface Objectify&lt;T>
525
+ * @since 0.5.14
526
+ * @property {T} [key: string] object key
527
+ */
528
+ interface Objectify<T> {
529
+ [key: string]: T;
530
+ }
531
+ /**
532
+ * The possible values of a document type.
533
+ *
534
+ * @typedef DocumentType
535
+ * @since 0.1.0
536
+ */
537
+ declare type DocumentType = ARDocumentType | BODocumentType | BRDocumentType | CLDocumentType | CODocumentType | ECDocumentType | PYDocumentType | PEDocumentType | UYDocumentType | VEDocumentType | USDocumentType;
538
+ /**
539
+ * Representation of the country's summary.
540
+ *
541
+ * @interface CountrySummary
542
+ * @since 0.5.14
543
+ */
544
+ interface CountrySummary {
545
+ /** Country's id */
546
+ id: number;
547
+ /** Country's name */
548
+ name: string;
549
+ }
550
+ /**
551
+ * The possible values of a week day.
552
+ *
553
+ * @typedef BaseWeekDay
554
+ * @since 0.5.14
555
+ */
556
+ declare type BaseWeekDay = "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
557
+
558
+ /**
559
+ * Representation of a Commerce Billing Data.
560
+ *
561
+ * @interface BillingData
562
+ * @since 0.5.14
563
+ */
564
+ interface BaseBillingData {
565
+ /** Billing's nickname */
566
+ nickname: string;
567
+ /** Billing's associated user complete name */
568
+ name: string;
569
+ /** Billing's associated document type, see {@link DocumentType} */
570
+ documentType: DocumentType;
571
+ /** Billing's associated document */
572
+ document: string;
573
+ /** Billing's associated user address */
574
+ address: string;
575
+ /** Billing's associated user phone without country calling code */
576
+ phone: string;
577
+ /** Billing's associated user email */
578
+ email: string;
579
+ /** Whether or not the billing is default */
580
+ default: boolean;
581
+ /** It contains country id and country name, see {@link CountrySummary} */
582
+ country: CountrySummary;
583
+ }
584
+ /**
585
+ * Representation of a billing data saved on a database.
586
+ *
587
+ * @interface BillingData
588
+ * @since 0.5.14
589
+ * @extends {{@link BaseBillingData}
590
+ */
591
+ interface BillingData extends BaseBillingData {
592
+ /** Billing's auto generated id */
593
+ id: number;
594
+ }
595
+
596
+ /**
597
+ * Representation of a Commerce Catalogue.
598
+ *
599
+ * @interface Catalogue
600
+ * @since 0.5.14
601
+ */
602
+ interface Catalogue {
603
+ /** Catalogue's id */
604
+ catalogueId: string;
605
+ /** Catalogue's name */
606
+ name: string;
607
+ /** Whether or not the catalogue is active */
608
+ active: boolean;
609
+ /** Catalogue's friendly name to use on front end */
610
+ friendlyName?: string;
611
+ }
612
+
613
+ /**
614
+ * Representation of a Commerce Vendor.
615
+ *
616
+ * @interface Vendor
617
+ * @since 0.5.14
618
+ */
619
+ interface Vendor {
620
+ /** Artisn's vendor unique identifier */
621
+ id: number;
622
+ /** Vendor's images, see {@link CDNImage} */
623
+ images: CDNImage[];
624
+ /** Vendor's name */
625
+ name: string;
626
+ /** Vendor's maximum purchase value */
627
+ maxPurchaseValue: number;
628
+ /** Vendor's description */
629
+ description: string;
630
+ /** Whether or not the vendor is sponsored */
631
+ sponsored: boolean;
632
+ /** Whether or not the vendor is active */
633
+ active: boolean;
634
+ }
635
+
636
+ /**
637
+ * Representation of a Commerce Store.
638
+ *
639
+ * @interface Store
640
+ * @since 0.1.0
641
+ */
642
+ interface Store {
643
+ /** Store unique identifier */
644
+ storeId: number;
645
+ /** Store name */
646
+ storeName: string;
647
+ /** Store address */
648
+ address: string;
649
+ /** The vendor associated with the store, see {@link Vendor} */
650
+ vendor: Vendor;
651
+ /**
652
+ * Additional store information, see
653
+ * {@link AdditionalStoreInformation} for further information
654
+ */
655
+ additionalInfo: AdditionalStoreInformation;
656
+ /** Whether or not the store is within coverage */
657
+ coverage: boolean;
658
+ /** Store cover url */
659
+ coverUrl: string;
660
+ /** Store delivery detailed information */
661
+ delivery: Delivery;
662
+ /** Store description */
663
+ description: string | null;
664
+ /** Whether or not the store is open */
665
+ isOpen: boolean;
666
+ /** Order maximum amount allowed */
667
+ maxOrderAmount: number;
668
+ /** Order minimum amount allowed */
669
+ minOrderAmount: number;
670
+ /** Order currency's symbol */
671
+ orderSymbol: string;
672
+ /** Store phone */
673
+ phone: string;
674
+ /** Whether or not the store is sponsored */
675
+ sponsored: boolean;
676
+ /** Store latitude */
677
+ latitude: number;
678
+ /** Store longitude */
679
+ longitude: number;
680
+ /** Store schedules, see {@link Schedule} for further information */
681
+ schedules: Schedule[];
682
+ /** Store timezone */
683
+ timezone: string;
684
+ /** Store available services, see {@link Service} */
685
+ services: Service[];
686
+ /** Estimated store cook time */
687
+ cookTime: string;
688
+ /**
689
+ * Generic store location in regards to the city,
690
+ * see {@link GenericStoreLocation}
691
+ */
692
+ city: GenericStoreLocation;
693
+ /** Whether or not the store is out of service */
694
+ outOfService: boolean;
695
+ /** Whether or not the store is default */
696
+ isDefault: boolean;
697
+ /** Whether or not the store is active */
698
+ active: boolean;
699
+ /** The value of the allowed minimum order */
700
+ minOrder: number;
701
+ /** Minimum order currency's symbol */
702
+ minOrderSymbol: string;
703
+ /**
704
+ * Generic store location in regards to the country,
705
+ * see {@link GenericStoreLocation} for further information
706
+ */
707
+ country: GenericStoreLocation;
708
+ /** Store location, see {@link StoreLocation} for further information */
709
+ location: StoreLocation;
710
+ /** Array of catalogues, see {@link Catalogue} */
711
+ catalogues: Catalogue[];
712
+ /** Array of store images, see {@link CDNImage} */
713
+ images: CDNImage[];
714
+ /** The distance between the user and the store, roughly in metres */
715
+ distance: number;
716
+ /**
717
+ * A list of coordinates that encapsules the coverage area of a given store
718
+ */
719
+ polygons: StorePolygons | null;
720
+ }
721
+ /**
722
+ * Store location.
723
+ *
724
+ * @interface StoreLocation
725
+ * @since 0.1.0
726
+ */
727
+ interface StoreLocation {
728
+ /** Store location latitude */
729
+ lat: number;
730
+ /** Store location longitude */
731
+ lon: number;
732
+ /** The geo hash associated with the store */
733
+ geohash: string;
734
+ /** Whether or not the store is a fragment */
735
+ fragment: boolean;
736
+ }
737
+ /**
738
+ * Store generic location.
739
+ *
740
+ * @interface GenericStoreLocation
741
+ * @since 0.1.0
742
+ */
743
+ interface GenericStoreLocation {
744
+ /** Generic store location unique identifier */
745
+ id: string;
746
+ /** Generic store location name */
747
+ name: string;
748
+ /** Whether or not the generic store location is active */
749
+ active: boolean;
750
+ }
751
+ /**
752
+ * Additional store information.
753
+ *
754
+ * @interface AdditionalStoreInformation
755
+ * @since 0.1.0
756
+ */
757
+ interface AdditionalStoreInformation {
758
+ /** Store external id */
759
+ externalId: string;
760
+ /** Store external code */
761
+ externalCode: string;
762
+ /** Delivery unique identifier */
763
+ idDeliveryKfc: string;
764
+ /** Whether or not the store has a drinks store */
765
+ isDrinksStore: boolean;
766
+ /** Whether or not to show the drinks store */
767
+ showDrinksStore: boolean;
768
+ }
769
+ /**
770
+ * Store delivery modality information.
771
+ *
772
+ * @interface Delivery
773
+ * @since 0.1.0
774
+ */
775
+ interface Delivery {
776
+ /** Time unit for delivery, see {@link DeliveryTimeUnit} */
777
+ deliveryTimeUnit: DeliveryTimeUnit;
778
+ /** Time value for delivery as string */
779
+ deliveryTimeValue: string;
780
+ /** Whether or not the store has a express delivery */
781
+ express: boolean;
782
+ /** Whether or not the store has free delivery */
783
+ freeDelivery: boolean;
784
+ }
785
+ /**
786
+ * Store schedules.
787
+ *
788
+ * @interface Schedule
789
+ * @since 0.1.0
790
+ */
791
+ interface Schedule {
792
+ /** Week day in uppercase, see {@link Days} */
793
+ day: Days;
794
+ /**
795
+ * `Date` value representing the start time in which
796
+ * the product is available
797
+ */
798
+ from: number;
799
+ /** `Date` value representing the end time in which
800
+ * the product is available
801
+ */
802
+ to: number;
803
+ /** Store catalogue unique identifier */
804
+ catalogueId: string;
805
+ }
806
+ /**
807
+ * The services available on the store.
808
+ *
809
+ * @interface Service
810
+ * @since 0.1.0
811
+ */
812
+ interface Service {
813
+ /** Service name */
814
+ name: string;
815
+ /** Whether or not the service is active on the store */
816
+ active: boolean;
817
+ /** Service image url */
818
+ url: string;
819
+ }
820
+ /**
821
+ * Time unit for delivery.
822
+ *
823
+ * @typedef DeliveryTimeUnit
824
+ * @since 0.1.0
825
+ */
826
+ declare type DeliveryTimeUnit = "min";
827
+ /**
828
+ * Allowed days for schedules.
829
+ *
830
+ * @typedef Days
831
+ * @since 0.1.0
832
+ */
833
+ declare type Days = BaseWeekDay | "SPECIAL";
834
+ /**
835
+ * A list of coordinates that encapsules the coverage area of a given store.
836
+ *
837
+ * @interface StorePolygons
838
+ * @since 0.1.0
839
+ */
840
+ interface StorePolygons {
841
+ /** Type of coordinates */
842
+ type: string;
843
+ /** The coordinates that creates the store polygon coverage area */
844
+ coordinates: number[][][][];
845
+ }
846
+
847
+ /**
848
+ * Representation of a Commerce Shipping Cost.
849
+ *
850
+ * @interface ShippingCost
851
+ * @since 0.5.14
852
+ */
853
+ interface ShippingCost {
854
+ /** Shipping cost product's id */
855
+ productId: number;
856
+ /** Shipping cost's name */
857
+ name: string;
858
+ /** Shipping cost's amount */
859
+ amount: number;
860
+ /** Currency's symbol */
861
+ symbol: string;
862
+ /** Array of shipping cost's taxes, see {@link ShippingCostTax} */
863
+ taxes: ShippingCostTax[];
864
+ /** Shipping cost's price without taxes */
865
+ grossPrice: number;
866
+ /** Shipping cost's price */
867
+ netPrice: number;
868
+ /** Shipping cost's subtotal without taxes */
869
+ subtotalBeforeTaxes: number;
870
+ /** Shipping cost's tax total */
871
+ taxTotal: number;
872
+ /** Shipping cost's discount */
873
+ discounts: any[];
874
+ /** Shipping cost's discount total amount */
875
+ discountTotal: number;
876
+ /** Shipping cost's total */
877
+ total: number;
878
+ }
879
+ /**
880
+ * Representation of a shipping cost tax.
881
+ *
882
+ * @interface ShippingCostTax
883
+ * @since 0.5.14
884
+ */
885
+ interface ShippingCostTax {
886
+ /** Tax percentage to be applied */
887
+ percentage: number;
888
+ /** Tax name */
889
+ name: string;
890
+ /** Value added tax rate code */
891
+ vatRateCode: number;
892
+ /** Tax code */
893
+ code: number;
894
+ /** Value added tax rate */
895
+ vatRate: string;
896
+ /** Tax base value */
897
+ taxBase: number;
898
+ /** Tax value */
899
+ value: string;
900
+ }
901
+
902
+ /**
903
+ * Wallet user information.
904
+ *
905
+ * @interface Wallet
906
+ * @since 0.5.14
907
+ */
908
+ interface Wallet {
909
+ /** {@link Benefit}'s array from firestore user wallet */
910
+ benefits: Benefit[];
911
+ }
912
+ /**
913
+ * Benefit information.
914
+ *
915
+ * @interface Benefit
916
+ * @since 0.1.0
917
+ */
918
+ interface Benefit {
919
+ /** The account id of the benefit */
920
+ accountId: number;
921
+ /**
922
+ * An array of benefit awards if the benefit is of `PRODUCT` type, and an
923
+ * object if the benefit is of `ALTER_DELIVERY` or `DISCOUNT` type.
924
+ * see {@link Award}
925
+ * */
926
+ award: Award | Award[];
927
+ /** Benefit id */
928
+ benefitId: number;
929
+ /** Benefit wallet id */
930
+ benefitWalletId: number;
931
+ /** The channel id of the benefit */
932
+ channelId: number;
933
+ /** Benefit code in back-end */
934
+ code: null;
935
+ /** Combined */
936
+ combined: string;
937
+ /** Benefit creation date */
938
+ createdAt: string;
939
+ /** Benefit description */
940
+ description: string;
941
+ /** Benefit discount percentage */
942
+ discountPercentage: number;
943
+ /** Benefit expiration date */
944
+ expirationDate: string;
945
+ /** External benefit id */
946
+ externalId: null;
947
+ /** The user wallet id */
948
+ hash: string;
949
+ /** Benefit images, see {@link CDNImage} */
950
+ image: CDNImage[];
951
+ /** The award limit */
952
+ limitAward: null;
953
+ /** The benefit limit */
954
+ limitBenefit: number;
955
+ /** The logic operator of the benefit */
956
+ logicOperator: string;
957
+ /** Benefit stock */
958
+ quantity: number;
959
+ /** The rules of the benefit */
960
+ rules: any[];
961
+ /** The benefit title */
962
+ title: string;
963
+ /** Benefit type, see {@link BenefitTypes} */
964
+ type: BenefitTypes;
965
+ /** Benefit update date */
966
+ updatedAt: string;
967
+ /** The vendor id of the benefit */
968
+ vendorId: number;
969
+ }
970
+ /**
971
+ * Award information.
972
+ *
973
+ * @interface Award
974
+ * @since 0.5.14
975
+ */
976
+ interface Award {
977
+ /** The id of the award */
978
+ id: number;
979
+ /** The id of the benefit */
980
+ benefitId: number;
981
+ /** Benefit discount percentage */
982
+ discountPercentage: number;
983
+ /** Benefit discount value */
984
+ discountValue: null;
985
+ /** Quantity of allowed products */
986
+ amount: number;
987
+ /** Product description associated with the benefit award */
988
+ productDescription: string;
989
+ /** Product unique identifier associated with the benefit award */
990
+ productId: number;
991
+ /** The vendor id of the award */
992
+ vendorId: number;
993
+ }
994
+ /**
995
+ * Applied benefit array in shopping cart.
996
+ *
997
+ * @typedef ShoppingCartBenefits
998
+ * @since 0.5.14
999
+ */
1000
+ declare type ShoppingCartBenefits = Benefit[];
1001
+ /**
1002
+ * A benefit DB node from a user.
1003
+ *
1004
+ * @typedef BenefitsByUserNode
1005
+ * @since 0.5.14
1006
+ */
1007
+ declare type BenefitsByUserNode = ArtisnDBQueryDocumentSnapshot<ArtisnDBDocumentData>;
1008
+ /**
1009
+ * The complete collection of benefits DB nodes from a user.
1010
+ *
1011
+ * @typedef BenefitsByUserNodes
1012
+ * @since 0.5.14
1013
+ */
1014
+ declare type BenefitsByUserNodes = ArtisnDBCollectionReference<ArtisnDBDocumentData>;
1015
+ /**
1016
+ * The possible values of the benefit type.
1017
+ *
1018
+ * @typedef BenefitTypes
1019
+ * @since 0.5.14
1020
+ */
1021
+ declare type BenefitTypes = "ALTER_DELIVERY" | "PRODUCT" | "DISCOUNT";
1022
+
1023
+ /**
1024
+ * Representation of a Commerce Shopping Cart.
1025
+ *
1026
+ * @interface ShoppingCart
1027
+ * @since 0.5.14
1028
+ */
1029
+ interface ShoppingCart {
1030
+ /** Shopping cart unique identifier */
1031
+ id: string;
1032
+ /** Shopping cart name */
1033
+ name: string;
1034
+ /** Shopping cart latitude */
1035
+ latitude: number;
1036
+ /** Shopping cart longitude */
1037
+ longitude: number;
1038
+ /** Shopping cart price category, see {@link PriceCategoryType}*/
1039
+ priceCategory?: PriceCategoryType;
1040
+ /** Shopping cart creation date */
1041
+ createdAt: string;
1042
+ /** Shopping cart update date */
1043
+ updatedAt: string;
1044
+ /** Shopping cart channel unique identifier */
1045
+ channelId: number;
1046
+ /** Shopping cart stores, see Objectify<{@link CartStore}> */
1047
+ stores: Objectify<CartStore>;
1048
+ /** Shopping cart shipping cost */
1049
+ shippingCost: ShippingCost | null;
1050
+ /** Shopping cart additional info */
1051
+ additional_info?: Record<string, any>;
1052
+ /** Shopping cart bill total */
1053
+ billTotal: BillTotal;
1054
+ /** Shopping cart applied benefits */
1055
+ benefits?: ShoppingCartBenefits;
1056
+ /** Shopping cart user wallet id */
1057
+ benefitsHash?: string;
1058
+ }
1059
+ /**
1060
+ * Representation of a Alert.
1061
+ *
1062
+ * @interface Alert
1063
+ * @since 0.5.14
1064
+ */
1065
+ interface Alert {
1066
+ /** Alert error level */
1067
+ errorLevel: number;
1068
+ /** Alert message */
1069
+ message: string;
1070
+ /** Alert type */
1071
+ type: string;
1072
+ }
1073
+ /**
1074
+ * Representation of a Cart Store.
1075
+ *
1076
+ * @interface CartStore
1077
+ * @since 0.5.14
1078
+ * @extends {{@link Store}
1079
+ */
1080
+ interface CartStore extends Store {
1081
+ /** The products that belong to the store, see {@link CartProduct} */
1082
+ products: Objectify<CartProduct>;
1083
+ /** Cart store's alerts, see {@link Alert} */
1084
+ alerts: Alert[];
1085
+ }
1086
+ /**
1087
+ * The possible values of a Bill Total.
1088
+ *
1089
+ * @typedef BillTotal
1090
+ * @since 0.5.14
1091
+ */
1092
+ declare type BillTotal = {
1093
+ /** Normal bill total category */
1094
+ NORMAL?: BillTotalCategory;
1095
+ /** Points bill total category */
1096
+ POINTS?: BillTotalCategory;
1097
+ };
1098
+ /**
1099
+ * Representation of a Bill Total Category.
1100
+ *
1101
+ * @interface BillTotalCategory
1102
+ * @since 0.5.14
1103
+ */
1104
+ interface BillTotalCategory {
1105
+ /** Bill total category subtotal without taxes */
1106
+ subtotalBeforeTaxes: number;
1107
+ /** Bill total category total taxes */
1108
+ taxTotal: number;
1109
+ /** Bill total category total */
1110
+ total: number;
1111
+ }
1112
+ /**
1113
+ * Representation of a Cart Totals.
1114
+ *
1115
+ * @interface CartTotals
1116
+ * @since 0.5.14
1117
+ */
1118
+ interface CartTotals {
1119
+ /** Cart totals subtotal */
1120
+ subtotal: number;
1121
+ /** Cart totals shipping cost */
1122
+ shippingCost: number;
1123
+ }
1124
+ /**
1125
+ * A shopping cart DB node from a user.
1126
+ *
1127
+ * @typedef ShoppingCartNode
1128
+ * @since 0.5.14
1129
+ */
1130
+ declare type ShoppingCartNode = ArtisnDBQueryDocumentSnapshot<ArtisnDBDocumentData>;
1131
+ /**
1132
+ * The complete collection of shopping carts DB nodes from a user.
1133
+ *
1134
+ * @typedef ShoppingCartNodes
1135
+ * @since 0.5.14
1136
+ */
1137
+ declare type ShoppingCartNodes = ArtisnDBCollectionReference<ArtisnDBDocumentData>;
1138
+
1139
+ /**
1140
+ * Representation of a Commerce Product.
1141
+ *
1142
+ * @typedef Product
1143
+ * @since 0.5.14
1144
+ */
1145
+ declare type Product = BaseProduct | ProductDetails | CartProduct;
1146
+ /**
1147
+ * Base product attributes.
1148
+ *
1149
+ * @interface BaseProduct
1150
+ * @since 0.5.14
1151
+ */
1152
+ interface BaseProduct {
1153
+ /** Product unique identifier */
1154
+ productId: string;
1155
+ /** The name of the product */
1156
+ name: string;
1157
+ /** The description of the product */
1158
+ description: string;
1159
+ /** The type of the product, see {@link ProductType} */
1160
+ type: ProductType;
1161
+ /** The cover url of the product */
1162
+ coverUrl: string;
1163
+ /** Product prices, see {@link ProductPrices} */
1164
+ prices: ProductPrices;
1165
+ /** Indicates if a product can be added directly to cart */
1166
+ addDirectlyToCart: boolean;
1167
+ /** Indicates if a product is out of service */
1168
+ outOfService: boolean;
1169
+ /** Indicates if a product is out of stock */
1170
+ outOfStock: boolean;
1171
+ /** The stock of the product */
1172
+ stock: number;
1173
+ /** The measure of the product */
1174
+ measure: string;
1175
+ /** Product attributes, see {@link ProductAttributes} */
1176
+ attributes: ProductAttributes;
1177
+ /** The suggested price of the product */
1178
+ suggestedPrice: string;
1179
+ /** Indicates if a product is available */
1180
+ available: boolean;
1181
+ /** Array of product images, see {@link CDNImage} */
1182
+ images: CDNImage[];
1183
+ /** The standard time of the product */
1184
+ standardTime: string;
1185
+ /** Indicates if a product is sponsored */
1186
+ sponsored: boolean;
1187
+ /** The status of the product, see {@link ProductStatus} */
1188
+ status: ProductStatus;
1189
+ }
1190
+ /**
1191
+ * Product prices attributes.
1192
+ *
1193
+ * @interface ProductPrices
1194
+ * @since 0.5.14
1195
+ */
1196
+ interface ProductPrices {
1197
+ /** Normal price category, see {@link PriceCategory} */
1198
+ NORMAL: PriceCategory;
1199
+ /** Points price category, see {@link PriceCategory} */
1200
+ POINTS: PriceCategory;
1201
+ }
1202
+ /**
1203
+ * Price category attributes.
1204
+ *
1205
+ * @interface PriceCategory
1206
+ * @since 0.5.14
1207
+ */
1208
+ interface PriceCategory {
1209
+ /** Price category type, see {@link PriceCategoryType} */
1210
+ category: PriceCategoryType;
1211
+ /** Price category without taxes */
1212
+ grossPrice: number;
1213
+ /** Price category with taxes */
1214
+ netPrice: number;
1215
+ /** Currency' symbol */
1216
+ symbol: string;
1217
+ /** Array of price category' taxes, see {@link PriceCategoryTax} */
1218
+ taxes: PriceCategoryTax[];
1219
+ /** Array of discounts applied to the price category */
1220
+ discounts: any[];
1221
+ /** Total discounts without taxes */
1222
+ discountGrossPrice: number;
1223
+ /** Total discounts with taxes */
1224
+ discountNetPrice: number;
1225
+ /** Total discounts applied to the price category */
1226
+ discount: number;
1227
+ }
1228
+ /**
1229
+ * Price category tax attributes.
1230
+ *
1231
+ * @interface PriceCategoryTax
1232
+ * @since 0.5.14
1233
+ */
1234
+ interface PriceCategoryTax {
1235
+ /** Price category' tax percentage */
1236
+ percentage: number;
1237
+ /** Price category' tax name, see {@link TaxType} */
1238
+ name: TaxType;
1239
+ /** Price category' value added tax rate */
1240
+ vatRateCode: number;
1241
+ /** Price category' tax code */
1242
+ code: number;
1243
+ /** Price category' value added tax */
1244
+ vatRate: string;
1245
+ }
1246
+ /**
1247
+ * Additional product attributes.
1248
+ *
1249
+ * @interface ProductAttributes
1250
+ * @since 0.5.14
1251
+ */
1252
+ interface ProductAttributes {
1253
+ /** Product's quantity, the attribute is not in camel case purposefully */
1254
+ Cantidad: string;
1255
+ /** Product external id */
1256
+ externalId: string;
1257
+ /** Whether or not to show product in menu */
1258
+ showInMenu: boolean;
1259
+ }
1260
+ /**
1261
+ * The product status.
1262
+ *
1263
+ * @typedef ProductStatus
1264
+ * @since 0.5.14
1265
+ **/
1266
+ declare type ProductStatus = "ACTIVE" | "INACTIVE";
1267
+ /**
1268
+ * Product type's possible values.
1269
+ *
1270
+ * @typedef ProductType
1271
+ * @since 0.5.14
1272
+ **/
1273
+ declare type ProductType = "PRODUCT" | "MODIFIER";
1274
+ /**
1275
+ * Price category's possible values.
1276
+ *
1277
+ * @typedef PriceCategoryType
1278
+ * @since 0.5.14
1279
+ **/
1280
+ declare type PriceCategoryType = "NORMAL" | "POINTS";
1281
+ /**
1282
+ * Tax's possible values.
1283
+ *
1284
+ * @typedef TaxType
1285
+ * @since 0.5.14
1286
+ **/
1287
+ declare type TaxType = "IVA";
1288
+ /**
1289
+ * Weekday product's schedule.
1290
+ *
1291
+ * @interface DayOfWeek
1292
+ * @since 0.5.14
1293
+ */
1294
+ interface DayOfWeek {
1295
+ /** Week day in uppercase, see {@link BaseWeekDay} */
1296
+ day: BaseWeekDay;
1297
+ /**
1298
+ * `Date` value representing the start time in which
1299
+ * the product is available */
1300
+ from: number;
1301
+ /**
1302
+ * `Date` value representing the end time in which
1303
+ * the product is available */
1304
+ to: number;
1305
+ }
1306
+ /**
1307
+ * The representation of a product question.
1308
+ *
1309
+ * @interface ProductQuestion
1310
+ * @since 0.5.14
1311
+ */
1312
+ interface ProductQuestion {
1313
+ /** Product question id */
1314
+ questionId: string;
1315
+ /** Product question name */
1316
+ name: string;
1317
+ /** Product question description */
1318
+ description: string | null;
1319
+ /** Product question minimum number of allowed answers */
1320
+ min: number;
1321
+ /** Product question maximum number of allowed answers */
1322
+ max: number;
1323
+ /** Product question type */
1324
+ type: string | null;
1325
+ /**
1326
+ * Array of possible answers to a product question,
1327
+ * see {@link ProductAnswer}
1328
+ */
1329
+ answers: ProductAnswer[];
1330
+ /** Array of product question images to display, see {@link CDNImage} */
1331
+ images: CDNImage[] | undefined;
1332
+ }
1333
+ /**
1334
+ * Common props for products and answers.
1335
+ *
1336
+ * @typedef CommonProductAndAnswersProps
1337
+ * @since 0.5.14
1338
+ */
1339
+ declare type CommonProductAndAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images";
1340
+ /**
1341
+ * Product details attributes.
1342
+ *
1343
+ * @interface ProductDetails
1344
+ * @since 0.5.14
1345
+ * @extends {{@link BaseProduct}
1346
+ */
1347
+ interface ProductDetails extends BaseProduct {
1348
+ /** Indicates if a product has a price vip */
1349
+ isPriceVip: boolean;
1350
+ /** Manufacturer The manufacturer of the product */
1351
+ manufacturer: string[];
1352
+ /** The max amount for sale of the product */
1353
+ maxAmountForSale: number;
1354
+ /** Array of product schedules, see {@link DayOfWeek} */
1355
+ schedule: DayOfWeek[];
1356
+ /** Array of product questions, see {@link ProductQuestion} */
1357
+ questions: ProductQuestion[];
1358
+ /** The benefit id of the product */
1359
+ benefitId: number | null;
1360
+ categories: Category[] | null;
1361
+ }
1362
+ /**
1363
+ * Representation of a Commerce Product Answer.
1364
+ *
1365
+ * @interface ProductAnswer
1366
+ * @since 0.5.14
1367
+ * @extends Pick<Product,CommonProductAndAnswersProps>, see
1368
+ * {@link Product} and {@link CommonProductAndAnswersProps}
1369
+ * for further information
1370
+ */
1371
+ interface ProductAnswer extends Pick<Product, CommonProductAndAnswersProps> {
1372
+ /**
1373
+ * Array of questions associated with the answer,
1374
+ * see {@link ProductDetails}
1375
+ */
1376
+ questions: ProductDetails["questions"];
1377
+ /** Type of question to render */
1378
+ renderType: string | null;
1379
+ }
1380
+ /**
1381
+ * Representation of a Commerce Cart Product Question.
1382
+ *
1383
+ * @interface CartProductQuestion
1384
+ * @since 0.5.14
1385
+ * @extends {{@link ProductQuestion}
1386
+ */
1387
+ interface CartProductQuestion extends ProductQuestion {
1388
+ /** Array of possible answers to the question */
1389
+ answers: CartProductAnswer[];
1390
+ }
1391
+ /**
1392
+ * Representation of a Commerce Cart Product Answer.
1393
+ *
1394
+ * @interface CartProductAnswer
1395
+ * @since 0.5.14
1396
+ * @extends {{@link ProductAnswer}
1397
+ */
1398
+ interface CartProductAnswer extends ProductAnswer {
1399
+ /** Question unique identifier */
1400
+ questionId: string;
1401
+ /** Quantity of allowed cart product answers */
1402
+ amount: number;
1403
+ /** Price category value of a product answer */
1404
+ priceCategory: PriceCategoryType;
1405
+ /** Comment associated with the product answer */
1406
+ comment: string;
1407
+ /** Array of possible questions and answers */
1408
+ questionsAndAnswers: CartProductQuestion[];
1409
+ }
1410
+ /**
1411
+ * Representation of a Commerce Cart Product.
1412
+ *
1413
+ * @interface CartProduct
1414
+ * @since 0.5.14
1415
+ * @extends {{@link ProductDetails}
1416
+ */
1417
+ interface CartProduct extends ProductDetails {
1418
+ /** Quantity of allowed cart products */
1419
+ amount: number;
1420
+ /** Cart product price category */
1421
+ priceCategory: PriceCategoryType;
1422
+ /** Comment associated with the cart product */
1423
+ comment: string;
1424
+ /** Array of possible questions and answers associated with the product*/
1425
+ questionsAndAnswers: CartProductQuestion[];
1426
+ /** Cart product unique identifier */
1427
+ hash: string;
1428
+ /** Cart product creation date */
1429
+ createdAt: string;
1430
+ /** Cart product updating date */
1431
+ updatedAt: string;
1432
+ /** Array of alerts associated with the cart product */
1433
+ alerts: Alert[];
1434
+ }
1435
+
1436
+ /**
1437
+ * Representation of a Commerce Category.
1438
+ *
1439
+ * @interface Category
1440
+ * @since 0.5.14
1441
+ */
1442
+ interface Category {
1443
+ /** Category's id */
1444
+ categoryId: number;
1445
+ /** Category's name */
1446
+ name: string;
1447
+ /** Category image's array, see {@link CDNImage} */
1448
+ images: CDNImage[];
1449
+ /** Whether or not to display the category */
1450
+ displayInMenu: boolean;
1451
+ /** Whether or not the category should be reloaded */
1452
+ reload: boolean;
1453
+ /** Whether or not the category has subcategories */
1454
+ subcategories: boolean;
1455
+ }
1456
+ /**
1457
+ * Representation of a category which contains several base products.
1458
+ *
1459
+ * @interface CategoryWithProducts
1460
+ * @since 0.5.14
1461
+ * @extends {{@link Category}
1462
+ */
1463
+ interface CategoryWithProducts extends Category {
1464
+ /** Array of base products associated with a category, see {@link BaseProduct} */
1465
+ products: BaseProduct[];
1466
+ }
1467
+
1468
+ /**
1469
+ * Artisn's supported currency codes.
1470
+ *
1471
+ * @typedef CurrencyCodes
1472
+ * @since 0.5.14
1473
+ */
1474
+ declare type CurrencyCodes = "USD" | "ARS" | "COP" | "CLP" | "VES";
1475
+
1476
+ /**
1477
+ * Fulfillment workflow.
1478
+ *
1479
+ * @interface Workflow
1480
+ * @since 0.5.15
1481
+ */
1482
+ interface Workflow {
1483
+ /** Workflow description */
1484
+ description: string;
1485
+ /** Workflow unique identifier */
1486
+ id: number;
1487
+ /** Workflow name */
1488
+ name: string;
1489
+ /** An array of workflow steps, see {@link StepWorkflow} */
1490
+ steps: StepWorkflow[];
1491
+ /** An array of webhook workflows, see {@link WebhookWorkflow} */
1492
+ webhooks: WebhookWorkflow[];
1493
+ }
1494
+ /**
1495
+ * The possible values of the step category.
1496
+ *
1497
+ * @typedef StepCategory
1498
+ * @since 0.5.15
1499
+ */
1500
+ declare type StepCategory = "TO_DO" | "PAYMENT_IN_PROGRESS" | "IN_PROGRESS" | "DONE";
1501
+ /**
1502
+ * The possible values of the step code.
1503
+ *
1504
+ * @typedef StepCode
1505
+ * @since 0.5.15
1506
+ */
1507
+ declare type StepCode = "START" | "IN_PROGRESS" | "ORDERED" | "RECEIVED" | "TO_ASSIGN" | "ASSIGNED" | "ON_ROUTE" | "DISPATCHED" | "CANCELED" | "ERROR";
1508
+ /**
1509
+ * The notification associated with the step.
1510
+ *
1511
+ * @interface StepNotification
1512
+ * @since 0.5.15
1513
+ */
1514
+ interface StepNotification {
1515
+ /** Whether or not to send mail when reaching this step */
1516
+ send_mail: boolean;
1517
+ /** Whether or not to send push when reaching this step */
1518
+ send_push: boolean;
1519
+ }
1520
+ /**
1521
+ * The step where the workflow is located.
1522
+ *
1523
+ * @interface StepWorkflow
1524
+ * @since 0.5.15
1525
+ */
1526
+ interface StepWorkflow {
1527
+ /** Step workflow additional info, see {@link StepWorkflowAdditionalInfo} */
1528
+ additional_info: StepWorkflowAdditionalInfo;
1529
+ /** Step workflow category, , see {@link StepCategory} */
1530
+ category: StepCategory;
1531
+ /** Step workflow code, , see {@link StepCode} */
1532
+ code: StepCode;
1533
+ /** Step workflow color */
1534
+ color: string;
1535
+ /** Step workflow description */
1536
+ description: string;
1537
+ /** Step workflow description to use on front end */
1538
+ description_frontend: string | null;
1539
+ /** Step workflow id */
1540
+ id: number;
1541
+ /** Step workflow name */
1542
+ name: string;
1543
+ /** Step workflow subtitle to use on front end */
1544
+ subtitle_frontend: string | null;
1545
+ /** Step workflow title to use on front end */
1546
+ title_frontend: string | null;
1547
+ /** Step workflow transitions, see {@link TransitionWorkflow} */
1548
+ transitions: TransitionWorkflow[];
1549
+ /** Step notification, see {@link StepNotification} */
1550
+ notification: StepNotification;
1551
+ }
1552
+ /**
1553
+ * Step workflow additional info.
1554
+ *
1555
+ * @interface StepWorkflowAdditionalInfo
1556
+ * @since 0.5.15
1557
+ */
1558
+ interface StepWorkflowAdditionalInfo {
1559
+ /** Whether or not to use the step workflow client on front end */
1560
+ client_frontend: boolean;
1561
+ /** Step workflow group, see {@link StepWorkflowGroup} */
1562
+ group: StepWorkflowGroup;
1563
+ /** Whether or not to use the step workflow operators to use on front end */
1564
+ operators_frontend: boolean;
1565
+ }
1566
+ /**
1567
+ * Step workflow group.
1568
+ *
1569
+ * @interface StepWorkflowGroup
1570
+ * @since 0.5.15
1571
+ */
1572
+ interface StepWorkflowGroup {
1573
+ /** Group code, see {@link StepCode} */
1574
+ code: StepCode;
1575
+ /** Group description */
1576
+ description: string;
1577
+ /** Group type */
1578
+ type: "default";
1579
+ /** Group weight */
1580
+ weight: string;
1581
+ }
1582
+ /**
1583
+ * The possible transitions of the workflow.
1584
+ *
1585
+ * @interface TransitionWorkflow
1586
+ * @since 0.5.15
1587
+ */
1588
+ interface TransitionWorkflow {
1589
+ /** Channel unique identifier */
1590
+ channel_id: number;
1591
+ /** Transition workflow conditions */
1592
+ conditions: any[];
1593
+ /** Transition workflow description */
1594
+ description: string;
1595
+ /** The step id where the transition comes from */
1596
+ from_step_id: number;
1597
+ /** Transition workflow unique identifier */
1598
+ id: number;
1599
+ /** Transition workflow name */
1600
+ name: string;
1601
+ /** The step id where the transition can go */
1602
+ to_step_id: number;
1603
+ /** Vendor unique identifier */
1604
+ vendor_id: number;
1605
+ }
1606
+ /**
1607
+ * Workflow webhook.
1608
+ *
1609
+ * @interface WebhookWorkflow
1610
+ * @since 0.5.15
1611
+ */
1612
+ interface WebhookWorkflow {
1613
+ /** Webhook workflow unique identifier */
1614
+ id: number;
1615
+ /** Webhook workflow method type */
1616
+ method: string;
1617
+ /** Webhook workflow url */
1618
+ url: string;
1619
+ }
1620
+ /**
1621
+ * Representation of a Issue object.
1622
+ *
1623
+ * @interface Issue
1624
+ * @since 0.5.15
1625
+ */
1626
+ interface IssueAdditionalInfo {
1627
+ /** User unique identifier */
1628
+ uid: string;
1629
+ /** Array of stores id */
1630
+ stores: number[];
1631
+ }
1632
+ /**
1633
+ * Representation of a Issue history.
1634
+ *
1635
+ * @interface Issue
1636
+ * @since 0.5.15
1637
+ */
1638
+ interface IssueHistory {
1639
+ /** History unique identifier */
1640
+ id: number;
1641
+ /** Transition unique identifier */
1642
+ transition_id: number;
1643
+ /** Step unique identifier */
1644
+ step_id: number;
1645
+ /** Step name */
1646
+ step_name: string;
1647
+ /** History additional info, see {@link IssueAdditionalInfo} */
1648
+ additional_info: IssueAdditionalInfo;
1649
+ /** History conditions */
1650
+ conditions: any[];
1651
+ /** History creation Date */
1652
+ created_at: string;
1653
+ /** History finished Date */
1654
+ finished_at: string;
1655
+ }
1656
+ /**
1657
+ * Representation of a Issue object.
1658
+ *
1659
+ * @interface Issue
1660
+ * @since 0.5.15
1661
+ */
1662
+ interface Issue {
1663
+ /** Issue unique identifier */
1664
+ id: number;
1665
+ /** Client issue unique identifier */
1666
+ client_issue_id: string;
1667
+ /** Workflow unique identifier */
1668
+ workflow_id: number;
1669
+ /** Parent issue unique identifier */
1670
+ parent_issue_id: null;
1671
+ /** Related issue unique identifier */
1672
+ related_issue_id: null;
1673
+ /** Step unique identifier */
1674
+ step_id: number;
1675
+ /** The step where the issue is located */
1676
+ step: StepWorkflow;
1677
+ /** Account unique identifier */
1678
+ account_id: number;
1679
+ /** Vendor unique identifier */
1680
+ vendor_id: number;
1681
+ /** Children issues */
1682
+ children: any[];
1683
+ /** Related issues */
1684
+ related: any[];
1685
+ /** Issue conditions */
1686
+ conditions: any[];
1687
+ /** Issue additional info, see {@link IssueAdditionalInfo} */
1688
+ additional_info: IssueAdditionalInfo;
1689
+ /** Issue history, see {@link IssueHistory} */
1690
+ history: IssueHistory[];
1691
+ /** Transaction unique identifier */
1692
+ transaction_id: number | null;
1693
+ }
1694
+
1695
+ /**
1696
+ * Representation of a Artisn request.
1697
+ *
1698
+ * @interface ArtisnRequest
1699
+ * @since 0.5.14
1700
+ */
1701
+ interface ArtisnRequest {
1702
+ /** Request's url */
1703
+ url: string;
1704
+ /** Request's headers, see {@link ArtisnRequestHeaders} */
1705
+ headers: ArtisnRequestHeaders;
1706
+ /** Request's body, see {@link ArtisnRequestBody} */
1707
+ body: ArtisnRequestBody;
1708
+ /** Request's query, see {@link ArtisnQuery} */
1709
+ query: ArtisnQuery;
1710
+ /** Request's params, see {@link ArtisnParams} */
1711
+ params: ArtisnParams;
1712
+ /** Request's method, see {@link ArtisnRequestMethod} */
1713
+ method?: ArtisnRequestMethod;
1714
+ }
1715
+ /**
1716
+ * Artisn request headers based on the fetch API.
1717
+ *
1718
+ * @typedef ArtisnRequestHeaders
1719
+ * @since 0.5.14
1720
+ */
1721
+ declare type ArtisnRequestHeaders = Headers;
1722
+ /**
1723
+ * Allowed methods for requests.
1724
+ *
1725
+ * @typedef ArtisnRequestMethod
1726
+ * @since 0.5.14
1727
+ */
1728
+ declare type ArtisnRequestMethod = "POST" | "GET" | "PUT" | "DELETE" | "PATCH";
1729
+ /**
1730
+ * Artisn request's body.
1731
+ *
1732
+ * @interface ArtisnRequestBody
1733
+ * @since 0.5.14
1734
+ * @property {any} [key:string] Object with key-value pairs
1735
+ */
1736
+ interface ArtisnRequestBody {
1737
+ [key: string]: any;
1738
+ }
1739
+ /**
1740
+ * Artisn request's body.
1741
+ *
1742
+ * @interface ArtisnQuery
1743
+ * @since 0.5.14
1744
+ * @property {string | number | boolean} [key:string] Object with key-value pairs
1745
+ */
1746
+ interface ArtisnQuery {
1747
+ [key: string]: string | number | boolean;
1748
+ }
1749
+ /**
1750
+ * Artisn request's params.
1751
+ *
1752
+ * @interface ArtisnParams
1753
+ * @since 0.5.14
1754
+ * @property {string | number} [key:string] Object with key-value pairs
1755
+ */
1756
+ interface ArtisnParams {
1757
+ [key: string]: string | number;
1758
+ }
1759
+
1760
+ /**
1761
+ * Representation of a living place base object.
1762
+ *
1763
+ * @interface BaseLivingPlace
1764
+ * @since 0.5.14
1765
+ */
1766
+ interface BaseLivingPlace {
1767
+ /** Living place's id */
1768
+ id: number;
1769
+ }
1770
+ /**
1771
+ * Representation of a living place.
1772
+ *
1773
+ * @interface LivingPlace
1774
+ * @since 0.5.14
1775
+ * @extends {{@link BaseLivingPlace}
1776
+ */
1777
+ interface LivingPlace extends BaseLivingPlace {
1778
+ /** Living place's name */
1779
+ name: string;
1780
+ /** Whether or not the living place is active */
1781
+ active: number;
1782
+ /** Country unique identifier */
1783
+ countryId: number;
1784
+ /** Array of fields required to save a living place, see {@link Field} */
1785
+ fields: Field[];
1786
+ }
1787
+ /**
1788
+ * Representation of a living place which will be saved.
1789
+ *
1790
+ * @interface LivingPlaceToSave
1791
+ * @since 0.5.14
1792
+ * @extends {{@link BaseLivingPlace}
1793
+ */
1794
+ interface LivingPlaceToSave extends BaseLivingPlace {
1795
+ /** Array of fields to be saved, see {@link FieldRecord} */
1796
+ fields: FieldRecord[];
1797
+ }
1798
+ /**
1799
+ * Representation of a field object.
1800
+ *
1801
+ * @interface Field
1802
+ * @since 0.5.14
1803
+ */
1804
+ interface Field {
1805
+ /** Field's id */
1806
+ id: string;
1807
+ /** Field's label */
1808
+ label: string;
1809
+ /** Field's rules, see {@link Rules} */
1810
+ rules: Rule;
1811
+ /** Field's messages based on rules, see {@link Messages} */
1812
+ messages: Message;
1813
+ /** Field's value */
1814
+ value?: string;
1815
+ }
1816
+ /**
1817
+ * Representation of a field record.
1818
+ *
1819
+ * @interface FieldRecord
1820
+ * @since 0.5.14
1821
+ */
1822
+ interface FieldRecord {
1823
+ /** Field record's id */
1824
+ id: string;
1825
+ /** Field record's value */
1826
+ value: string;
1827
+ }
1828
+ /**
1829
+ * Messages for living places.
1830
+ *
1831
+ * @interface Message
1832
+ * @since 0.5.14
1833
+ */
1834
+ interface Message {
1835
+ /** The maximum number's message of allowed living places */
1836
+ max: string;
1837
+ /** The minimum number's message of allowed living places */
1838
+ min: string;
1839
+ }
1840
+ /**
1841
+ * Rules for living places.
1842
+ *
1843
+ * @interface Rule
1844
+ * @since 0.5.14
1845
+ */
1846
+ interface Rule {
1847
+ /** The maximum number of allowed living places */
1848
+ max: number;
1849
+ /** The minimum number of allowed living places */
1850
+ min: number;
1851
+ }
1852
+
1853
+ /**
1854
+ * Notification object.
1855
+ *
1856
+ * @interface Notification
1857
+ * @since 0.5.15
1858
+ */
1859
+ interface Notification {
1860
+ /** Notification unique identifier */
1861
+ id: number;
1862
+ /** Notification title */
1863
+ title: string;
1864
+ /** Notification description */
1865
+ description: string;
1866
+ /**
1867
+ * Whether or not the notification was read. Purposefully
1868
+ * has a string type.
1869
+ */
1870
+ read: string;
1871
+ /** Notification creation date */
1872
+ creationDate: string;
1873
+ }
1874
+
1875
+ /**
1876
+ * Representation of a basic Shipping Address.
1877
+ *
1878
+ * @interface BaseShippingAddress
1879
+ * @since 0.5.14
1880
+ */
1881
+ interface BaseShippingAddress {
1882
+ /** Whether or not the shipping address is default */
1883
+ default: boolean;
1884
+ /** Shipping address' latitude */
1885
+ lat: number;
1886
+ /** Shipping address' longitude */
1887
+ lng: number;
1888
+ /** Shipping address' reference */
1889
+ reference: string;
1890
+ /** Shipping address' main street */
1891
+ mainStreet: string;
1892
+ /** Shipping address' living place number */
1893
+ number: string;
1894
+ /** Shipping address' secondary street */
1895
+ secondaryStreet: string;
1896
+ /** It contains country id and country name, see {@link CountrySummary} */
1897
+ country: CountrySummary;
1898
+ /** Shipping address' update date */
1899
+ updatedAt?: string;
1900
+ /** Shipping address' creation date */
1901
+ createdAt: string;
1902
+ /** Shipping address' nickname */
1903
+ nickname: string;
1904
+ /** Shipping address' number contact address */
1905
+ numberContactAddress: string;
1906
+ }
1907
+ /**
1908
+ * Representation of a Commerce Shipping Address.
1909
+ *
1910
+ * @interface ShippingAddress
1911
+ * @since 0.5.14
1912
+ * @extends {{@link BaseShippingAddress}
1913
+ */
1914
+ interface ShippingAddress extends BaseShippingAddress {
1915
+ /** Shipping address unique identifier */
1916
+ id: number;
1917
+ /** Object which contains the living place, see {@link LivingPlace} */
1918
+ livingPlace: LivingPlace;
1919
+ }
1920
+ /**
1921
+ * A shipping address object used when it needs to be created.
1922
+ *
1923
+ * @interface NewShippingAddress
1924
+ * @since 0.5.14
1925
+ * @extends {{@link BaseShippingAddress}
1926
+ */
1927
+ interface NewShippingAddress extends BaseShippingAddress {
1928
+ /** Shipping address unique identifier */
1929
+ id?: number;
1930
+ /**
1931
+ * Object which contains the living place to save,
1932
+ * see {@link LivingPlaceToSave}
1933
+ */
1934
+ livingPlace: LivingPlaceToSave;
1935
+ }
1936
+ /**
1937
+ * A shipping address object used when it needs to be updated.
1938
+ *
1939
+ * @interface UpdatedShippingAddress
1940
+ * @since 0.5.14
1941
+ * @extends {{@link BaseShippingAddress}
1942
+ */
1943
+ interface UpdatedShippingAddress extends BaseShippingAddress {
1944
+ /** Shipping address unique identifier */
1945
+ id: number;
1946
+ /**
1947
+ * Object which contains the living place to update,
1948
+ * see {@link LivingPlaceToSave}
1949
+ */
1950
+ livingPlace: LivingPlaceToSave;
1951
+ }
1952
+
1953
+ /**
1954
+ * Representation of a Commerce User.
1955
+ *
1956
+ * @interface BaseUser
1957
+ * @since 0.5.14
1958
+ */
1959
+ interface BaseUser {
1960
+ /** User's unique identifier */
1961
+ uid: string;
1962
+ /** User's first name */
1963
+ name: string;
1964
+ /** User's middle name */
1965
+ middleName?: string;
1966
+ /** User's last name */
1967
+ lastname: string;
1968
+ /** User's second surname */
1969
+ secondLastname?: string;
1970
+ /** User's email */
1971
+ email: string;
1972
+ /** User's birthdate, e.g: 1991-05-02 */
1973
+ birthdate?: string;
1974
+ /** The vendor which the user was created */
1975
+ vendorId?: number;
1976
+ /** The platform where the user was generated */
1977
+ origin?: string;
1978
+ /** User's document */
1979
+ document?: string;
1980
+ /**User's document type, see {@link DocumentType} */
1981
+ documentType?: DocumentType;
1982
+ /** User's gender, see {@link Gender} */
1983
+ gender?: Gender;
1984
+ /** User's country object, see {@link UserCountry} */
1985
+ country: UserCountry;
1986
+ /** User's phone detailed information, see {@link Phone} */
1987
+ phone?: Phone;
1988
+ /** User's type, see {@link UserType} */
1989
+ type?: UserType;
1990
+ /** User's externalId */
1991
+ externalId?: string;
1992
+ /** User's marital status, see {@link MaritalStatus} */
1993
+ maritalStatus?: MaritalStatus;
1994
+ /** Whether or not the user is active */
1995
+ active?: boolean;
1996
+ /** User's additional info, see {@link AdditionalInfo} */
1997
+ additionalInfo?: AdditionalInfo;
1998
+ }
1999
+ /**
2000
+ * Representation of a user saved on a database.
2001
+ *
2002
+ * @interface User
2003
+ * @since 0.5.14
2004
+ * @extends {{@link BaseUser}
2005
+ */
2006
+ interface User extends BaseUser {
2007
+ /** User's auto generated id */
2008
+ idInt: number;
2009
+ }
2010
+ /**
2011
+ * The possible values for the user's type.
2012
+ *
2013
+ * @typedef UserType
2014
+ * @since 0.5.14
2015
+ */
2016
+ declare type UserType = "NORMAL" | "DEPENDENT";
2017
+ /**
2018
+ * Representation of a phone.
2019
+ *
2020
+ * @interface UserCountry
2021
+ * @since 0.5.14
2022
+ */
2023
+ interface UserCountry {
2024
+ /** User's country id */
2025
+ id: number;
2026
+ }
2027
+ /**
2028
+ * Representation of the user's additional info,
2029
+ * commonly used to save user's images urls.
2030
+ *
2031
+ * @interface AdditionalInfo
2032
+ * @since 0.5.14
2033
+ * @property {any} `[key: string]` Property with key value pairs
2034
+ */
2035
+ interface AdditionalInfo {
2036
+ [key: string]: any;
2037
+ }
2038
+ /**
2039
+ * Representation of a phone.
2040
+ *
2041
+ * @interface Phone
2042
+ * @since 0.5.14
2043
+ */
2044
+ interface Phone {
2045
+ /** User's phone number */
2046
+ number: string;
2047
+ /** User's country calling code, e.g.: +593 */
2048
+ countryCode: string;
2049
+ /** User's country ISO code, e.g.: EC */
2050
+ countryIsoCode: CountryCode;
2051
+ }
2052
+ /**
2053
+ * The possible values for the user's marital status.
2054
+ *
2055
+ * @typedef MaritalStatus
2056
+ * @since 0.5.14
2057
+ */
2058
+ declare type MaritalStatus = "MARRIED" | "DIVORCED" | "SINGLE";
2059
+ /**
2060
+ * The possible values for the user's gender.
2061
+ *
2062
+ * @typedef Gender
2063
+ * @since 0.5.14
2064
+ */
2065
+ declare type Gender = "MALE" | "FEMALE";
2066
+
2067
+ /**
2068
+ * User preferences.
2069
+ *
2070
+ * @interface UserSettings
2071
+ * @since 0.5.15
2072
+ */
2073
+ interface UserSettings {
2074
+ /** Individual settings, see {@link Settings} */
2075
+ settings: Settings;
2076
+ /** User unique identifier */
2077
+ uid: string;
2078
+ }
2079
+ /**
2080
+ * Individual user settings.
2081
+ *
2082
+ * @interface Settings
2083
+ * @since 0.1.0
2084
+ */
2085
+ interface Settings {
2086
+ /** Whether or not the user has email notifications enabled */
2087
+ emailNotifications: boolean;
2088
+ /** Whether or not the user has push notifications enabled */
2089
+ pushNotifications: boolean;
2090
+ }
2091
+
2092
+ /**
2093
+ * Representation of common properties of the order.
2094
+ *
2095
+ * @interface BaseOrder
2096
+ * @since 0.1.0
2097
+ */
2098
+ interface BaseOrder {
2099
+ /** Order unique identifier */
2100
+ id: number;
2101
+ /** Account unique identifier */
2102
+ accountId: number;
2103
+ /** Order additional info, see {@link OrderAdditionalInfo} */
2104
+ additionalInfo: OrderAdditionalInfo;
2105
+ /** User's order billing data' unique identifier */
2106
+ billingDataByUserId: string;
2107
+ /** Order additional messages */
2108
+ additionalMessage: string | null;
2109
+ /** Order allocation, see {@link Allocation} */
2110
+ allocation: Allocation;
2111
+ /** Channel unique identifier */
2112
+ channelId: number;
2113
+ /** Order channel name */
2114
+ channelName: string;
2115
+ /** Order comment */
2116
+ comment: string;
2117
+ /** Order hash */
2118
+ hash: string;
2119
+ /** Order issue unique identifier */
2120
+ issueId: string;
2121
+ /** Order pickup cook time */
2122
+ pickupCooktime: string | null;
2123
+ /** User's order shipping address' unique identifier */
2124
+ shippingAddressByUserId: string;
2125
+ /** Order date, e.g.: `02 Aug 2021` */
2126
+ orderDate: string;
2127
+ /** Order time, e.g.: `17:00 am` */
2128
+ orderTime: string;
2129
+ /** Pick up date, e.g.: `01 Aug 2021` */
2130
+ pickupDate: string | null;
2131
+ /** Pick up time, e.g.: `09:00 am` */
2132
+ pickupTime: string | null;
2133
+ /** Order sequence id */
2134
+ seq_id: string;
2135
+ /** Shopping cart associated with the order, see {@link OrderShoppingCart} */
2136
+ shoppingCart: OrderShoppingCart;
2137
+ /** Order step, see {@link OrderStep} */
2138
+ step: OrderStep;
2139
+ /** Step category, see {@link StepCategory} */
2140
+ stepCategory: StepCategory;
2141
+ /** Step code, see {@link StepCode} */
2142
+ stepCode: StepCode;
2143
+ /** Step unique identifier */
2144
+ stepId: number;
2145
+ /** Step name */
2146
+ stepName: string;
2147
+ /** User unique identifier */
2148
+ uid: string;
2149
+ /** Order user, see {@link OrderUser} */
2150
+ user: OrderUser;
2151
+ /** Order transaction unique identifier */
2152
+ transactionId: number | null;
2153
+ /** Vendor unique identifier */
2154
+ vendorId: number;
2155
+ /** Vendor name */
2156
+ vendorName: string;
2157
+ /** Order operator information, see {@link OperatorInformation} */
2158
+ createdByOperator: OperatorInformation;
2159
+ }
2160
+ /**
2161
+ * The shopping cart associated with the order.
2162
+ *
2163
+ * @interface OrderShoppingCart
2164
+ * @since 0.1.0
2165
+ * @extends {{@link ShoppingCart}
2166
+ */
2167
+ interface OrderShoppingCart extends Omit<ShoppingCart, "stores"> {
2168
+ /** Order shopping cart comment */
2169
+ comment: string | null;
2170
+ /** Order instructions */
2171
+ instructions: string | null;
2172
+ /** Order status unique identifier */
2173
+ statusId: number;
2174
+ /** Order issue unique identifier */
2175
+ issueId: string | null;
2176
+ /** Order invoice number */
2177
+ invoiceNumber: string | null;
2178
+ /** Order status name */
2179
+ statusName: string;
2180
+ /** Status code, see {@link StepCode} */
2181
+ statusCode: StepCode;
2182
+ /** Order payment status, see {@link OrderStatus} */
2183
+ paymentStatus: OrderStatus;
2184
+ /**
2185
+ * An array of the order paid payment methods,
2186
+ * see {@link OrderPaymentMethod}
2187
+ */
2188
+ paidPaymentMethods: OrderPaymentMethod[] | null;
2189
+ /** An array of order retries, see {@link OrderRetry} */
2190
+ allRetries: OrderRetry[];
2191
+ /**
2192
+ * An array of the order rejected payment methods,
2193
+ * see {@link OrderPaymentMethod}
2194
+ */
2195
+ rejectedPaymentMethods: OrderPaymentMethod[] | null;
2196
+ /** An array of OrderStore, see {@link OrderStore} */
2197
+ stores: OrderStore[];
2198
+ }
2199
+ /**
2200
+ * Order common fields.
2201
+ *
2202
+ * @interface OrderCommonFields
2203
+ * @since 0.1.0
2204
+ */
2205
+ interface OrderCommonFields {
2206
+ /** Order amount **/
2207
+ amount: string;
2208
+ /** Order status **/
2209
+ status: string;
2210
+ /** Order created date **/
2211
+ created_at: string;
2212
+ /** Order update date **/
2213
+ updated_at: string;
2214
+ }
2215
+ /**
2216
+ * The stores associated with the order.
2217
+ *
2218
+ * @interface OrderStore
2219
+ * @since 0.1.0
2220
+ * @extends {{@link Store}
2221
+ */
2222
+ interface OrderStore extends Store {
2223
+ /** Order store id */
2224
+ id: number;
2225
+ /** Order unique identifier */
2226
+ orderId: number;
2227
+ /** Order digital command sent */
2228
+ digitalCommandSent: string;
2229
+ /** Order store status unique identifier */
2230
+ statusId: number;
2231
+ /** Order store status name */
2232
+ statusName: string;
2233
+ /** Order store status code, see {@link StepCode} */
2234
+ statusCode: StepCode;
2235
+ /** Order store bill total, see {@link OrderBillTotal} */
2236
+ billStoreTotal: OrderBillTotal;
2237
+ /** An array of OrderProducts, see {@link OrderProduct} */
2238
+ products: OrderProduct[];
2239
+ }
2240
+ /**
2241
+ * The product associated with the order.
2242
+ *
2243
+ * @interface OrderProduct
2244
+ * @since 0.1.0
2245
+ */
2246
+ interface OrderProduct {
2247
+ /** Order product id */
2248
+ id: number;
2249
+ /** Order product additional info, see {@link OrderProductAdditionalInfo } */
2250
+ additionalInfo: OrderProductAdditionalInfo;
2251
+ /** Order product unique identifier */
2252
+ productId: number;
2253
+ /** Order product name */
2254
+ productName: string;
2255
+ /** Order product comment */
2256
+ comment: string;
2257
+ /** Order bill product, see {@link OrderBillProduct} */
2258
+ billProduct: OrderBillProduct;
2259
+ /** Order bill product and answers, see {@link OrderBillTotal} */
2260
+ billProductAndAnswers: OrderBillTotal;
2261
+ /** Order product questions and answers, see {@link CartProductQuestion} */
2262
+ questionsAndAnswers: CartProductQuestion[];
2263
+ }
2264
+ /**
2265
+ * The order product additional info.
2266
+ *
2267
+ * @interface OrderProductAdditionalInfo
2268
+ * @since 0.1.0
2269
+ */
2270
+ interface OrderProductAdditionalInfo {
2271
+ /** Order product attributes, see {@link OrderProductAttributes} */
2272
+ attributes: OrderProductAttributes;
2273
+ /** Indicates if a product is available */
2274
+ available: boolean;
2275
+ /** Order bill product, see {@link OrderBillProduct} */
2276
+ bill_product: OrderBillProductAdditionalInfo;
2277
+ /** Order bill product and answers, see {@link OrderBillProduct} */
2278
+ bill_product_and_answers: OrderBillProductAdditionalInfo;
2279
+ /** The description of the product */
2280
+ description: string;
2281
+ /** Array of product images, see {@link OrderProductImage} */
2282
+ images: OrderProductImage[];
2283
+ /** Indicates if a product has a price vip */
2284
+ is_price_vip: boolean;
2285
+ /** The max amount for sale of the product */
2286
+ max_amount_for_sale: number;
2287
+ /** The measure of the product */
2288
+ measure: string;
2289
+ /** The store associated with the product */
2290
+ new_store: number;
2291
+ /** Indicates if a product is out of service */
2292
+ out_of_service: boolean;
2293
+ /** Indicates if a product is out of stock */
2294
+ out_of_stock: boolean;
2295
+ /** Price category type, see {@link PriceCategoryType} */
2296
+ price_category: PriceCategoryType;
2297
+ /** Order bill product prices, see {@link OrderBillProduct} */
2298
+ prices: OrderBillProductAdditionalInfo;
2299
+ /** Indicates if a product is sponsored */
2300
+ sponsored: boolean;
2301
+ /** The status of the product, see {@link ProductStatus} */
2302
+ status: ProductStatus;
2303
+ /** The stock of the product */
2304
+ stock: number;
2305
+ /** The suggested price of the product */
2306
+ suggested_price: string;
2307
+ /** The type of the product, see {@link ProductType} */
2308
+ type: ProductType;
2309
+ }
2310
+ /**
2311
+ * Order product attributes.
2312
+ *
2313
+ * @interface OrderProductAttributes
2314
+ * @since 0.1.0
2315
+ */
2316
+ interface OrderProductAttributes {
2317
+ /** Whether or not to show product in menu */
2318
+ show_in_menu: boolean;
2319
+ /** Product's quantity, the attribute is not in camel case purposefully */
2320
+ cantidad: string;
2321
+ /** Product external id */
2322
+ external_id: string | null;
2323
+ }
2324
+ /**
2325
+ * Order product image.
2326
+ *
2327
+ * @interface OrderProductImage
2328
+ * @since 0.1.0
2329
+ */
2330
+ interface OrderProductImage {
2331
+ /** The directory where the image is saved */
2332
+ key: string;
2333
+ /** Image's name */
2334
+ name: string;
2335
+ /** The bucket where the image is located */
2336
+ bucket: string;
2337
+ /** The url where the image is saved */
2338
+ url: string;
2339
+ /** The cloud where the image is saved */
2340
+ cloud_front_url: string;
2341
+ }
2342
+ /**
2343
+ * Order bill product additional information.
2344
+ *
2345
+ * @interface OrderBillProductAdditionalInfo
2346
+ * @since 0.1.0
2347
+ */
2348
+ interface OrderBillProductAdditionalInfo {
2349
+ /** Normal price category, see {@link OrderProductPriceCategory} */
2350
+ normal: OrderProductPriceCategory;
2351
+ /** Points price category, see {@link OrderProductPriceCategory} */
2352
+ points: OrderProductPriceCategory;
2353
+ }
2354
+ /**
2355
+ * Order bill product tax calculations.
2356
+ *
2357
+ * @typedef TaxCalculations
2358
+ * @since 0.1.0
2359
+ */
2360
+ declare type TaxCalculations = Record<string, TaxCalculation>;
2361
+ /**
2362
+ * Order bill product tax calculation
2363
+ *
2364
+ * @interface TaxCalculation
2365
+ * @since 0.1.0
2366
+ */
2367
+ interface TaxCalculation {
2368
+ /** Tax calculation code */
2369
+ code: number;
2370
+ /** Tax calculation name, see {@link TaxType} */
2371
+ name: TaxType;
2372
+ /** Tax calculation value added tax rate */
2373
+ vat_rate_code: number;
2374
+ /** Tax calculation value added tax */
2375
+ vat_rate: string;
2376
+ /** Tax calculation percentage */
2377
+ percentage: number;
2378
+ /** Tax calculation base */
2379
+ tax_base: number;
2380
+ /** Tax calculation value */
2381
+ value: number;
2382
+ }
2383
+ /**
2384
+ * The total bill associated with a product of order.
2385
+ *
2386
+ * @interface OrderBillTotal
2387
+ * @since 0.1.0
2388
+ * @extends {{@link BillTotalCategory}
2389
+ */
2390
+ interface OrderBillTotal extends BillTotalCategory {
2391
+ /** Order bill discount total */
2392
+ discountTotal: number;
2393
+ }
2394
+ /**
2395
+ * The bill associated with a product of order.
2396
+ *
2397
+ * @interface OrderBillProduct
2398
+ * @since 0.1.0
2399
+ * @extends {{@link OrderBillTotal}
2400
+ */
2401
+ interface OrderBillProduct extends OrderBillTotal {
2402
+ /** Order bill product amount */
2403
+ amount: number;
2404
+ }
2405
+ /**
2406
+ * The bill associated with a product of order.
2407
+ *
2408
+ * @interface OrderProductPriceCategory
2409
+ * @since 0.1.0
2410
+ */
2411
+ interface OrderProductPriceCategory {
2412
+ /** Order product price category amount */
2413
+ amount: number;
2414
+ /** Array of tax calculation, see {@link TaxCalculation} */
2415
+ taxes: TaxCalculation[];
2416
+ /** Order product price category with taxes */
2417
+ net_price: number;
2418
+ /** Order product price currency symbol */
2419
+ symbol: string;
2420
+ /** Order product price category without taxes */
2421
+ gross_price: number;
2422
+ /** Array of discounts applied to the price category */
2423
+ discounts: any[];
2424
+ /** Order product price discount */
2425
+ discount: number;
2426
+ /** Order product price total discounts with taxes */
2427
+ discount_net_price: number;
2428
+ /** Order product price total discounts without taxes */
2429
+ discount_gross_price: number;
2430
+ /** Order product price category type, see {@link PriceCategoryType} */
2431
+ category: PriceCategoryType;
2432
+ /** Order product price product id */
2433
+ product_id?: number;
2434
+ /** Order product price product name */
2435
+ name?: string;
2436
+ /** Order product price subtotal without taxes */
2437
+ subtotal_before_taxes: number;
2438
+ /** Order product price tax total */
2439
+ tax_total: number;
2440
+ /** Order product price discount total */
2441
+ discount_total: number;
2442
+ /** Order product price total */
2443
+ total: number;
2444
+ /** Order product price subtotal without taxes and discounts */
2445
+ subtotal_before_taxes_before_discounts: number;
2446
+ /** Order product price subtotal */
2447
+ subtotal_zero?: number;
2448
+ /** Order product price subtotal without taxes */
2449
+ subtotal_without_taxes?: number;
2450
+ /** An object of tax calculations, see {@link TaxCalculations} */
2451
+ tax_calcs?: TaxCalculations;
2452
+ }
2453
+ /**
2454
+ * The retry of the order.
2455
+ *
2456
+ * @interface OrderRetry
2457
+ * @since 0.1.0
2458
+ * @extends {{@link Status}, {@link OrderCommonFields}
2459
+ */
2460
+ interface OrderRetry extends Status, OrderCommonFields {
2461
+ /** Order retry unique identifier */
2462
+ id: number;
2463
+ /** Order payment method id **/
2464
+ payment_method_by_order_id: number;
2465
+ /** Order retry reference **/
2466
+ reference: string;
2467
+ /** Order retry platform **/
2468
+ platform: string;
2469
+ /** Order retry user agent **/
2470
+ user_agent: string;
2471
+ /** Order retry ip address **/
2472
+ ip_address: string;
2473
+ /** Order retry request id **/
2474
+ request_id: string;
2475
+ /** Order retry process url **/
2476
+ process_url: string;
2477
+ /** Order payment method, see {@link PaymentMethodByOrder} **/
2478
+ payment_method_by_order: PaymentMethodByOrder;
2479
+ /** Order step, see {@link OrderStep} */
2480
+ step: OrderStep;
2481
+ }
2482
+ /**
2483
+ * The retry of the order.
2484
+ *
2485
+ * @interface PaymentMethodByOrder
2486
+ * @since 0.1.0
2487
+ * @extends {{@link Status}, {@link OrderCommonFields}
2488
+ */
2489
+ interface PaymentMethodByOrder extends Status, OrderCommonFields {
2490
+ /** Payment method by order unique identifier **/
2491
+ id: number;
2492
+ /** Order unique identifier **/
2493
+ order_id: number;
2494
+ /** Payment method id **/
2495
+ payment_method_id: number;
2496
+ /** Internal revenue service payment method id **/
2497
+ sri_payment_method_id: number;
2498
+ /** Order payment method, see {@link OrderRetryPaymentMethod} */
2499
+ order: OrderRetryPaymentMethod;
2500
+ }
2501
+ /**
2502
+ * Order retry payment method.
2503
+ *
2504
+ * @interface OrderRetryPaymentMethod
2505
+ * @since 0.1.0
2506
+ */
2507
+ interface OrderRetryPaymentMethod extends Status {
2508
+ /** Order retry payment method unique identifier **/
2509
+ id: number;
2510
+ /** User unique identifier associated with the order retry **/
2511
+ uid: string;
2512
+ /** Order retry billing data by user id **/
2513
+ billing_data_by_user_id: string;
2514
+ /** Order retry shopping cart id **/
2515
+ shopping_cart_id: string;
2516
+ /** Order retry latitude **/
2517
+ latitude: string;
2518
+ /** Order retry longitude **/
2519
+ longitude: string;
2520
+ /** Order payment status, {@link OrderStatus} **/
2521
+ payment_status: OrderStatus;
2522
+ /** Order retry step **/
2523
+ step: number;
2524
+ /** In soft order process */
2525
+ insoft_order_process: string;
2526
+ /** Order retry sent fulfillment **/
2527
+ sent_fulfillment: string;
2528
+ /** Order retry account id **/
2529
+ account_id: number;
2530
+ /** Order retry sequence value **/
2531
+ seq_val: string;
2532
+ /** Order retry vendor id **/
2533
+ vendor_id: number;
2534
+ /** Order retry channel id **/
2535
+ channel_id: number;
2536
+ /** Order retry created date **/
2537
+ created_at: string;
2538
+ /** Order retry update date **/
2539
+ updated_at: string;
2540
+ /** Order retry allocation, see {@link Allocation} **/
2541
+ allocation: Allocation;
2542
+ /** Order retry suborder, see {@link Suborder} **/
2543
+ suborders: Suborder[];
2544
+ }
2545
+ /**
2546
+ * Representation of a order status.
2547
+ *
2548
+ * @interface Status
2549
+ * @since 0.1.0
2550
+ */
2551
+ interface Status {
2552
+ /** Status unique identifier **/
2553
+ status_id: number;
2554
+ /** Status name **/
2555
+ status_name: string;
2556
+ /** Status code **/
2557
+ status_code: string;
2558
+ /** Status category **/
2559
+ status_category: string;
2560
+ }
2561
+ /**
2562
+ * Representation of a suborder object.
2563
+ *
2564
+ * @interface Suborder
2565
+ * @since 0.1.0
2566
+ * @extends {{@link Status}
2567
+ */
2568
+ interface Suborder extends Status {
2569
+ /** Suborder unique identifier **/
2570
+ id: number;
2571
+ /** Suborder store unique identifier **/
2572
+ store_id: number;
2573
+ /** Suborder store unique identifier **/
2574
+ store_name: string;
2575
+ /** Suborder order id **/
2576
+ order_id: number;
2577
+ /** Suborder digital command sent **/
2578
+ digital_command_sent: string;
2579
+ /** Suborder vendor **/
2580
+ vendor: string;
2581
+ /** Suborder additional information **/
2582
+ additional_info: string;
2583
+ /** Suborder creation date**/
2584
+ created_at: string;
2585
+ /** Suborder update date **/
2586
+ updated_at: string;
2587
+ }
2588
+ /**
2589
+ * The step where the order is located.
2590
+ *
2591
+ * @interface OrderStep
2592
+ * @since 0.1.0
2593
+ */
2594
+ interface OrderStep {
2595
+ /** Order step title to use on front end */
2596
+ title_frontend: string;
2597
+ /** Order step description to use on front end */
2598
+ description_frontend: string;
2599
+ /** Order step unique identifier */
2600
+ id: number;
2601
+ /** Order step name */
2602
+ name: string;
2603
+ /** Order step code */
2604
+ code: string;
2605
+ /** Order step description */
2606
+ description: string;
2607
+ /** Order step category */
2608
+ category: string;
2609
+ /** Order step subtitle to use on front end */
2610
+ subtitle_frontend: string;
2611
+ /** Order step color */
2612
+ color: string;
2613
+ /** Order step additional information, see {@link OrderStepAdditionalInfo} */
2614
+ additional_info: OrderStepAdditionalInfo;
2615
+ }
2616
+ /**
2617
+ * Order step additional information.
2618
+ *
2619
+ * @interface OrderStepAdditionalInfo
2620
+ * @since 0.1.0
2621
+ */
2622
+ interface OrderStepAdditionalInfo {
2623
+ /** Whether or not to use the client on front end */
2624
+ client_frontend: boolean;
2625
+ /** Whether or not to use the operators on front end */
2626
+ operators_frontend: boolean;
2627
+ /** Whether or not to use the client has an error on front end */
2628
+ client_frontend_error: boolean;
2629
+ /** Order additional information group, see {@link OrderStepAdditionalInfoGroup} */
2630
+ group: OrderStepAdditionalInfoGroup;
2631
+ }
2632
+ /**
2633
+ * Order step additional information group.
2634
+ *
2635
+ * @interface OrderStepAdditionalInfoGroup
2636
+ * @since 0.1.0
2637
+ */
2638
+ interface OrderStepAdditionalInfoGroup {
2639
+ /** Order additional information group code */
2640
+ code: string;
2641
+ /** Order additional information group description */
2642
+ description: string;
2643
+ /** Order additional information group weight */
2644
+ weight: string;
2645
+ /** Order additional information group type */
2646
+ type: string;
2647
+ }
2648
+ /**
2649
+ * The details of the order.
2650
+ *
2651
+ * @interface OrderDetails
2652
+ * @since 0.5.15
2653
+ * @extends {{@link BaseOrder}
2654
+ */
2655
+ interface OrderDetails extends BaseOrder {
2656
+ /** Order details' shipping address */
2657
+ shippingAddress: ShippingAddress;
2658
+ /** Order details' shipping cost, see {@link OrderDetailShippingCost} */
2659
+ shippingCost: OrderDetailShippingCost;
2660
+ /** Order details' billing data */
2661
+ billingData: BillingData;
2662
+ }
2663
+ /**
2664
+ * The shipping cost associated with the order.
2665
+ *
2666
+ * @interface OrderDetailShippingCost
2667
+ * @since 0.5.15
2668
+ */
2669
+ interface OrderDetailShippingCost {
2670
+ /** Shipping cost net price */
2671
+ net_price: number;
2672
+ }
2673
+ /**
2674
+ * Representation of a Commerce Order.
2675
+ *
2676
+ * @typedef Order
2677
+ * @since 0.5.15
2678
+ */
2679
+ declare type Order = BaseOrder | OrderDetails;
2680
+ /**
2681
+ * Order shipping metadata base field.
2682
+ *
2683
+ * @interface BaseField
2684
+ * @since 0.1.0
2685
+ */
2686
+ interface BaseField {
2687
+ /** Base field unique identifier */
2688
+ id: number;
2689
+ /** Base field name */
2690
+ name: string;
2691
+ }
2692
+ /**
2693
+ * Order shipping metadata zip code base field.
2694
+ *
2695
+ * @interface ZipCodeField
2696
+ * @since 0.1.0
2697
+ * @extends {{@link BaseField}
2698
+ */
2699
+ interface ZipCodeField extends BaseField {
2700
+ /** Base field zip code */
2701
+ zipCode: string;
2702
+ }
2703
+ /**
2704
+ * Order injection field.
2705
+ *
2706
+ * @interface Injection
2707
+ * @since 0.1.0
2708
+ * @property {InjectionDetail} [key: string] object with key as string
2709
+ * and value as InjectionDetail
2710
+ */
2711
+ interface Injection {
2712
+ [key: string]: InjectionDetail;
2713
+ }
2714
+ /**
2715
+ * Order injection detail field.
2716
+ *
2717
+ * @interface InjectionDetail
2718
+ * @since 0.1.0
2719
+ */
2720
+ interface InjectionDetail {
2721
+ /**
2722
+ * Order injection detail cause,
2723
+ * property is purposefully named in spanish
2724
+ */
2725
+ causa: string;
2726
+ /**
2727
+ * Order injection detail code
2728
+ * property is purposefully named in spanish
2729
+ */
2730
+ codigo: number;
2731
+ /**
2732
+ * Order injection detail message
2733
+ * property is purposefully named in spanish
2734
+ * */
2735
+ mensaje: string;
2736
+ }
2737
+ /**
2738
+ * Order integration message.
2739
+ *
2740
+ * @interface IntegrationMessage
2741
+ * @since 0.1.0
2742
+ */
2743
+ interface IntegrationMessage {
2744
+ /** Order injection, see {@link Injection} */
2745
+ kfcInjection: Injection;
2746
+ }
2747
+ /**
2748
+ * Order shipping metadata.
2749
+ *
2750
+ * @interface MetadataShipping
2751
+ * @since 0.1.0
2752
+ */
2753
+ interface MetadataShipping {
2754
+ /** Order shipping area, see {@link BaseField} */
2755
+ area: BaseField;
2756
+ /** Order shipping city, see {@link BaseField} */
2757
+ city: BaseField;
2758
+ /** Order shipping zone, see {@link ZipCodeField} */
2759
+ zone: ZipCodeField;
2760
+ /** Order shipping store, see {@link BaseField} */
2761
+ store: BaseField;
2762
+ /** Order shipping country, see {@link BaseField} */
2763
+ country: BaseField;
2764
+ }
2765
+ /**
2766
+ * Order additional info.
2767
+ *
2768
+ * @interface OrderAdditionalInfo
2769
+ * @since 0.1.0
2770
+ */
2771
+ interface OrderAdditionalInfo {
2772
+ /** Order auth provider */
2773
+ providerAuth: string | null;
2774
+ /** Order metadata shipping, see {@link MetadataShipping} */
2775
+ metadataShipping: MetadataShipping;
2776
+ /** Order integration messages, see {@link IntegrationMessage} */
2777
+ integrationMessages: IntegrationMessage;
2778
+ /** Order parent shipping cart */
2779
+ parentShoppingCart: boolean;
2780
+ }
2781
+ /**
2782
+ * Order allocation options.
2783
+ *
2784
+ * @typedef Allocation
2785
+ * @since 0.1.0
2786
+ */
2787
+ declare type Allocation = "PICKUP_TO_GO" | "PICKUP_IN_PLACE" | "DELIVERY";
2788
+ /**
2789
+ * Order user.
2790
+ *
2791
+ * @interface OrderUser
2792
+ * @since 0.1.0
2793
+ * @extends {{@link BaseUser}
2794
+ */
2795
+ interface OrderUser extends BaseUser {
2796
+ /** Order user settings, see {@link Settings} */
2797
+ settings: Settings;
2798
+ }
2799
+ /**
2800
+ * Order operator information.
2801
+ *
2802
+ * @interface OperatorInformation
2803
+ * @since 0.1.0
2804
+ */
2805
+ interface OperatorInformation {
2806
+ /** Operator unique identifier */
2807
+ id: string;
2808
+ /** Operator name */
2809
+ name: string;
2810
+ /** Operator email */
2811
+ email: string;
2812
+ /** Operator skill */
2813
+ skill: string;
2814
+ /** Operator document */
2815
+ document: string;
2816
+ }
2817
+ /**
2818
+ * Order payment method.
2819
+ *
2820
+ * @interface OrderPaymentMethod
2821
+ * @since 0.1.0
2822
+ */
2823
+ interface OrderPaymentMethod {
2824
+ /** Order payment method id */
2825
+ payment_method_id: number;
2826
+ /** Order payment method name */
2827
+ payment_method_name: string;
2828
+ /** Order total by payment method */
2829
+ total: string;
2830
+ /** Order status, see {@link OrderStatus} */
2831
+ status: OrderStatus;
2832
+ /** Order payment method last retry, see {@link OrderRetry} */
2833
+ lastRetry: OrderRetry;
2834
+ /** Order step, see {@link OrderStep} */
2835
+ step: OrderStep;
2836
+ }
2837
+ /**
2838
+ * Order status.
2839
+ *
2840
+ * @typedef OrderStatus
2841
+ * @since 0.1.0
2842
+ */
2843
+ declare type OrderStatus = "APPROVED" | "REJECTED" | "PENDING";
2844
+
2845
+ /**
2846
+ * Basic payment method object.
2847
+ *
2848
+ * @interface BasePaymentMethod
2849
+ * @since 0.5.14
2850
+ */
2851
+ interface BasePaymentMethod {
2852
+ /** Payment method's id */
2853
+ id: number;
2854
+ /** Payment method's created date */
2855
+ created_at: string | null;
2856
+ /** Payment method's updated date */
2857
+ updated_at: string | null;
2858
+ /** Payment method's deleted date */
2859
+ deleted_at: string | null;
2860
+ }
2861
+ /**
2862
+ * Representation of a Commerce Payment method.
2863
+ *
2864
+ * @interface PaymentMethod
2865
+ * @since 0.5.14
2866
+ * @extends {{@link BasePaymentMethod}
2867
+ */
2868
+ interface PaymentMethod extends BasePaymentMethod {
2869
+ /** Payment method's name, see {@link PaymentMethodName} */
2870
+ name: PaymentMethodName;
2871
+ /** Payment method image's url, commonly used to save image cards */
2872
+ image_url: string;
2873
+ /** Whether or not the payment method is default */
2874
+ default: boolean;
2875
+ /** Payment method's external id */
2876
+ external_id: string | null;
2877
+ /** Payment method's external code */
2878
+ external_code: number;
2879
+ /** Payment method's parent id */
2880
+ parent_id: string | null;
2881
+ /** Payment method cards' allowed brands, see {@link ProvidersBrand} */
2882
+ methods: PaymentProvider[];
2883
+ }
2884
+ /**
2885
+ * Representation of a credit card brand.
2886
+ *
2887
+ * @interface PaymentProvider
2888
+ * @since 0.5.14
2889
+ * @extends {{@link PaymentMethod}
2890
+ */
2891
+ interface PaymentProvider extends Omit<PaymentMethod, "name"> {
2892
+ /** Payment method cards' allowed brands, see {@link CreditCardMappings}*/
2893
+ cc_brands: CreditCardMapping[];
2894
+ /** The name of the payment provider */
2895
+ name: string;
2896
+ }
2897
+ /**
2898
+ * Representation of a credit card brand.
2899
+ *
2900
+ * @interface CreditCardMapping
2901
+ * @since 0.5.14
2902
+ * @extends {{@link BasePaymentMethod}
2903
+ */
2904
+ interface CreditCardMapping extends BasePaymentMethod {
2905
+ /** Credit card mapping unique identifier */
2906
+ id: number;
2907
+ /** Credit card mapping name, see {@link CardName} */
2908
+ name: CardName;
2909
+ /** Payment method image's url, commonly used to save image cards */
2910
+ image_url: string;
2911
+ /** Mapping of credit cards */
2912
+ cc_brands_mapping: unknown[];
2913
+ }
2914
+ /**
2915
+ * Payment method common names.
2916
+ *
2917
+ * @typedef PaymentMethodName
2918
+ * @since 0.5.14
2919
+ */
2920
+ declare type PaymentMethodName = "CREDIT_CARD" | "CASH" | "DATAPHONE";
2921
+ /**
2922
+ * Cards common names.
2923
+ *
2924
+ * @typedef CardName
2925
+ * @since 0.5.14
2926
+ */
2927
+ declare type CardName = "Diners" | "Discover" | "American Express" | "Visa" | "MasterCard";
2928
+ /**
2929
+ * Representation of a card inscription.
2930
+ *
2931
+ * @interface CardInscription
2932
+ * @since 0.5.15
2933
+ */
2934
+ interface CardInscription {
2935
+ id: number;
2936
+ uid: string;
2937
+ number: string;
2938
+ type: string;
2939
+ authCode?: string;
2940
+ bin: string;
2941
+ paymentToken: string;
2942
+ createdAt?: string;
2943
+ }
2944
+
2945
+ export { ARDocumentType, Account, AdditionalInfo, AdditionalStoreInformation, Alert, Allocation, ArtisnApp, ArtisnDB, ArtisnDBCollectionReference, ArtisnDBDocumentData, ArtisnDBQueryDocumentSnapshot, ArtisnHeaders, ArtisnHints, ArtisnParams, ArtisnPlatform, ArtisnQuery, ArtisnRNApp, ArtisnRNAuth, ArtisnRNAuthInstance, ArtisnRNSettings, ArtisnRequest, ArtisnRequestBody, ArtisnRequestHeaders, ArtisnRequestMethod, ArtisnRestrictedHeaders, ArtisnWebApp, ArtisnWebAuth, ArtisnWebAuthInstance, ArtisnWebSettings, Award, BODocumentType, BRDocumentType, Banner, BannerImage, BannerScope, BannerType, BaseBillingData, BaseField, BaseLivingPlace, BaseOrder, BasePaymentMethod, BaseProduct, BaseShippingAddress, BaseUser, BaseWeekDay, Benefit, BenefitTypes, BenefitsByUserNode, BenefitsByUserNodes, BillTotal, BillTotalCategory, BillingData, CDNImage, CLDocumentType, CODocumentType, CardInscription, CardName, CartProduct, CartProductAnswer, CartProductQuestion, CartStore, CartTotals, Catalogue, Category, CategoryWithProducts, CommonDocumentType, Country, CountryCode, CountryCurrency, CountrySummary, CreditCardMapping, CurrencyCodes, DayOfWeek, Days, Delivery, DeliveryTimeUnit, DocumentType, ECDocumentType, Field, FieldRecord, Gender, GenericStoreLocation, Image, ImageFit, ImageManipulationConfig, ImageToFormat, Injection, InjectionDetail, IntegrationMessage, Issue, IssueAdditionalInfo, IssueHistory, LivingPlace, LivingPlaceToSave, MaritalStatus, Message, MetadataShipping, NewShippingAddress, Notification, Objectify, OperatorInformation, Order, OrderAdditionalInfo, OrderBillProduct, OrderBillProductAdditionalInfo, OrderBillTotal, OrderCommonFields, OrderDetailShippingCost, OrderDetails, OrderPaymentMethod, OrderProduct, OrderProductAdditionalInfo, OrderProductAttributes, OrderProductImage, OrderProductPriceCategory, OrderRetry, OrderRetryPaymentMethod, OrderShoppingCart, OrderStatus, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderStore, OrderUser, PEDocumentType, PYDocumentType, PaymentMethod, PaymentMethodByOrder, PaymentMethodName, PaymentProvider, Phone, PriceCategory, PriceCategoryTax, PriceCategoryType, Product, ProductAnswer, ProductAttributes, ProductDetails, ProductPrices, ProductQuestion, ProductStatus, ProductType, RandomImageConfig, Rule, Schedule, Service, Settings, ShippingAddress, ShippingCost, ShippingCostTax, ShoppingCart, ShoppingCartBenefits, ShoppingCartNode, ShoppingCartNodes, Status, StepCategory, StepCode, StepNotification, StepWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, Store, StoreLocation, StorePolygons, Suborder, TaxCalculation, TaxCalculations, TaxType, TransitionWorkflow, URLImage, USDocumentType, UYDocumentType, UpdatedShippingAddress, User, UserCountry, UserSettings, UserType, VEDocumentType, Vendor, Wallet, WebhookWorkflow, Workflow, ZipCodeField };