@artisan-commerce/types 0.14.0-canary.34 → 0.14.0-canary.36

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 (3) hide show
  1. package/dist/bundle.d.ts +410 -370
  2. package/package.json +16 -2
  3. package/CHANGELOG.md +0 -604
package/dist/bundle.d.ts CHANGED
@@ -3,11 +3,185 @@ import { ReactNativeFirebase } from '@react-native-firebase/app';
3
3
  import authRN, { FirebaseAuthTypes } from '@react-native-firebase/auth';
4
4
  import { FirebaseFirestoreTypes } from '@react-native-firebase/firestore';
5
5
 
6
+ /**
7
+ * Representation of a Commerce Country.
8
+ *
9
+ * @interface Country
10
+ * @since 0.1.0
11
+ */
12
+ interface Country<T extends AdditionalInfo = AdditionalInfo> {
13
+ /** Country's identifier */
14
+ id: number;
15
+ /** Country's name */
16
+ name: string;
17
+ /** Country ISO code, see {@link CountryCode} */
18
+ code: CountryCode;
19
+ /**
20
+ * Object which contains information about country's currency,
21
+ * see {@link CountryCurrency}
22
+ */
23
+ currency: CountryCurrency;
24
+ /** Country additional info */
25
+ additionalInfo?: T;
26
+ }
27
+ /**
28
+ * Representation of a country's currency.
29
+ *
30
+ * @interface CountryCurrency
31
+ * @since 0.1.0
32
+ */
33
+ interface CountryCurrency {
34
+ /** Currency's identifier */
35
+ id: number;
36
+ /** Currency's name */
37
+ name: string;
38
+ /** Currency's symbol */
39
+ sign: string;
40
+ /** Currency's external identifier */
41
+ external_id: string;
42
+ }
43
+ /**
44
+ * List of country codes currently supported.
45
+ *
46
+ * @typedef CountryCode
47
+ * @since 0.1.0
48
+ * @see https://www.nationsonline.org/oneworld/country_code_list.htm for reference
49
+ */
50
+ declare type CountryCode = "AR" | "BO" | "BR" | "CL" | "CO" | "EC" | "PY" | "PE" | "UY" | "VE" | "US";
51
+ /**
52
+ * Default documents for all countries.
53
+ *
54
+ * @typedef CommonDocumentType
55
+ * @since 0.1.0
56
+ */
57
+ declare type CommonDocumentType = "PASSPORT";
58
+ /**
59
+ * Argentina supported document types.
60
+ *
61
+ * @typedef ARDocumentType
62
+ * @since 0.1.0
63
+ */
64
+ declare type ARDocumentType = CommonDocumentType;
65
+ /**
66
+ * Bolivia supported document types.
67
+ *
68
+ * @typedef BODocumentType
69
+ * @since 0.1.0
70
+ */
71
+ declare type BODocumentType = CommonDocumentType;
72
+ /**
73
+ * Brasil supported document types.
74
+ *
75
+ * @typedef BRDocumentType
76
+ * @since 0.1.0
77
+ */
78
+ declare type BRDocumentType = CommonDocumentType;
79
+ /**
80
+ * Chile supported document types.
81
+ *
82
+ * @typedef CLDocumentType
83
+ * @since 0.1.0
84
+ */
85
+ declare type CLDocumentType = CommonDocumentType;
86
+ /**
87
+ * Colombia supported document types.
88
+ *
89
+ * @typedef CODocumentType
90
+ * @since 0.1.0
91
+ */
92
+ declare type CODocumentType = CommonDocumentType | "RUT" | "NIT" | "CE" | "CC";
93
+ /**
94
+ * Ecuador supported document types.
95
+ *
96
+ * @typedef ECDocumentType
97
+ * @since 0.1.0
98
+ */
99
+ declare type ECDocumentType = CommonDocumentType | "CI" | "RUC";
100
+ /**
101
+ * Paraguay supported document types.
102
+ *
103
+ * @typedef PYDocumentType
104
+ * @since 0.1.0
105
+ */
106
+ declare type PYDocumentType = CommonDocumentType;
107
+ /**
108
+ * Perú supported document types.
109
+ *
110
+ * @typedef PEDocumentType
111
+ * @since 0.1.0
112
+ */
113
+ declare type PEDocumentType = CommonDocumentType;
114
+ /**
115
+ * Uruguay supported document types.
116
+ *
117
+ * @typedef UYDocumentType
118
+ * @since 0.1.0
119
+ */
120
+ declare type UYDocumentType = CommonDocumentType;
121
+ /**
122
+ * Venezuela supported document types.
123
+ *
124
+ * @typedef VEDocumentType
125
+ * @since 0.1.0
126
+ */
127
+ declare type VEDocumentType = CommonDocumentType;
128
+ /**
129
+ * United States supported document types.
130
+ *
131
+ * @typedef USDocumentType
132
+ * @since 0.1.0
133
+ */
134
+ declare type USDocumentType = CommonDocumentType;
135
+
136
+ /**
137
+ * Representation of a generic object.
138
+ *
139
+ * @interface Objectify&lt;T>
140
+ * @since 0.1.0
141
+ * @property {T} [key: string] object key
142
+ */
143
+ interface Objectify<T> {
144
+ [key: string]: T;
145
+ }
146
+ /**
147
+ * The possible values of a document type.
148
+ *
149
+ * @typedef DocumentType
150
+ * @since 0.1.0
151
+ */
152
+ declare type DocumentType = ARDocumentType | BODocumentType | BRDocumentType | CLDocumentType | CODocumentType | ECDocumentType | PYDocumentType | PEDocumentType | UYDocumentType | VEDocumentType | USDocumentType;
153
+ /**
154
+ * Representation of the country's summary.
155
+ *
156
+ * @interface CountrySummary
157
+ * @since 0.1.0
158
+ */
159
+ interface CountrySummary {
160
+ /** Country's id */
161
+ id: number;
162
+ /** Country's name */
163
+ name: string;
164
+ }
165
+ /**
166
+ * The possible values of a week day.
167
+ *
168
+ * @typedef BaseWeekDay
169
+ * @since 0.1.0
170
+ */
171
+ declare type BaseWeekDay = "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
172
+ /**
173
+ * Common additional information.
174
+ *
175
+ * @typedef AdditionalInfo
176
+ * @since 0.1.0
177
+ */
178
+ declare type AdditionalInfo = Record<string, any>;
179
+
6
180
  /**
7
181
  * Representation of a image allocated in a CDN.
8
182
  *
9
183
  * @interface CDNImage
10
- * @since 0.5.14
184
+ * @since 0.1.0
11
185
  */
12
186
  interface CDNImage {
13
187
  /** The bucket where the image is located */
@@ -25,13 +199,13 @@ interface CDNImage {
25
199
  * A image url.
26
200
  *
27
201
  * @typedef URLImage
28
- * @since 0.5.14
202
+ * @since 0.1.0
29
203
  */
30
204
  declare type URLImage = string;
31
205
  /**
32
206
  * Configuration on how to setup the cloudfront image manipulation.
33
207
  *
34
- * @since 0.5.14
208
+ * @since 0.1.0
35
209
  * @interface ImageManipulationConfig
36
210
  */
37
211
  interface ImageManipulationConfig {
@@ -52,21 +226,21 @@ interface ImageManipulationConfig {
52
226
  * {@link CDNImage} or a {@link URLImage}.
53
227
  *
54
228
  * @typedef Image
55
- * @since 0.5.14
229
+ * @since 0.1.0
56
230
  */
57
231
  declare type Image = CDNImage | URLImage;
58
232
  /**
59
233
  * Contains different properties on how to resize the image.
60
234
  *
61
235
  * @typedef ImageFit
62
- * @since 0.5.14
236
+ * @since 0.1.0
63
237
  */
64
238
  declare type ImageFit = "fill" | "cover" | "contain" | "inside" | "outside";
65
239
  /**
66
240
  * Contains different image formats.
67
241
  *
68
242
  * @typedef ImageToFormat
69
- * @since 0.5.14
243
+ * @since 0.1.0
70
244
  */
71
245
  declare type ImageToFormat = "jpg" | "jpeg" | "png" | "svg";
72
246
  /**
@@ -88,9 +262,9 @@ interface RandomImageConfig {
88
262
  * Representation of a Commerce Account.
89
263
  *
90
264
  * @interface Account
91
- * @since 0.5.14
265
+ * @since 0.1.0
92
266
  */
93
- interface Account {
267
+ interface Account<T extends AdditionalInfo = AdditionalInfo> {
94
268
  /** Artisn's account unique identifier */
95
269
  accountId: number;
96
270
  /** Account's name */
@@ -99,6 +273,8 @@ interface Account {
99
273
  description?: string;
100
274
  /** Account's images, see {@link CDNImage} for further information */
101
275
  images: CDNImage[];
276
+ /** Account additional info */
277
+ additionalInfo?: T;
102
278
  }
103
279
 
104
280
  /**
@@ -295,9 +471,9 @@ declare type ArtisnDBCollectionReference<T = ArtisnDBDocumentData> = firebase.fi
295
471
  * Representation of a Commerce Category.
296
472
  *
297
473
  * @interface Category
298
- * @since 0.5.14
474
+ * @since 0.1.0
299
475
  */
300
- interface Category {
476
+ interface Category<T extends AdditionalInfo = AdditionalInfo> {
301
477
  /** Category's id */
302
478
  categoryId: number;
303
479
  /** Category's name */
@@ -310,12 +486,14 @@ interface Category {
310
486
  reload: boolean;
311
487
  /** Whether or not the category has subcategories */
312
488
  subcategories: boolean;
489
+ /** Category additional info */
490
+ additionalInfo?: T;
313
491
  }
314
492
  /**
315
493
  * Representation of a category which contains several base products.
316
494
  *
317
495
  * @interface CategoryWithProducts
318
- * @since 0.5.14
496
+ * @since 0.1.0
319
497
  * @extends {{@link Category}
320
498
  */
321
499
  interface CategoryWithProducts extends Category {
@@ -323,187 +501,15 @@ interface CategoryWithProducts extends Category {
323
501
  products: BaseProduct[];
324
502
  }
325
503
 
326
- /**
327
- * Representation of a Commerce Country.
328
- *
329
- * @interface Country
330
- * @since 0.5.14
331
- */
332
- interface Country {
333
- /** Country's identifier */
334
- id: number;
335
- /** Country's name */
336
- name: string;
337
- /** Country ISO code, see {@link CountryCode} */
338
- code: CountryCode;
339
- /**
340
- * Object which contains information about country's currency,
341
- * see {@link CountryCurrency}
342
- */
343
- currency: CountryCurrency;
344
- }
345
- /**
346
- * Representation of a country's currency.
347
- *
348
- * @interface CountryCurrency
349
- * @since 0.5.14
350
- */
351
- interface CountryCurrency {
352
- /** Currency's identifier */
353
- id: number;
354
- /** Currency's name */
355
- name: string;
356
- /** Currency's symbol */
357
- sign: string;
358
- /** Currency's external identifier */
359
- external_id: string;
360
- }
361
- /**
362
- * List of country codes currently supported.
363
- *
364
- * @typedef CountryCode
365
- * @since 0.1.0
366
- * @see https://www.nationsonline.org/oneworld/country_code_list.htm for reference
367
- */
368
- declare type CountryCode = "AR" | "BO" | "BR" | "CL" | "CO" | "EC" | "PY" | "PE" | "UY" | "VE" | "US";
369
- /**
370
- * Default documents for all countries.
371
- *
372
- * @typedef CommonDocumentType
373
- * @since 0.1.0
374
- */
375
- declare type CommonDocumentType = "PASSPORT";
376
- /**
377
- * Argentina supported document types.
378
- *
379
- * @typedef ARDocumentType
380
- * @since 0.1.0
381
- */
382
- declare type ARDocumentType = CommonDocumentType;
383
- /**
384
- * Bolivia supported document types.
385
- *
386
- * @typedef BODocumentType
387
- * @since 0.1.0
388
- */
389
- declare type BODocumentType = CommonDocumentType;
390
- /**
391
- * Brasil supported document types.
392
- *
393
- * @typedef BRDocumentType
394
- * @since 0.1.0
395
- */
396
- declare type BRDocumentType = CommonDocumentType;
397
- /**
398
- * Chile supported document types.
399
- *
400
- * @typedef CLDocumentType
401
- * @since 0.1.0
402
- */
403
- declare type CLDocumentType = CommonDocumentType;
404
- /**
405
- * Colombia supported document types.
406
- *
407
- * @typedef CODocumentType
408
- * @since 0.1.0
409
- */
410
- declare type CODocumentType = CommonDocumentType | "RUT" | "NIT" | "CE" | "CC";
411
- /**
412
- * Ecuador supported document types.
413
- *
414
- * @typedef ECDocumentType
415
- * @since 0.1.0
416
- */
417
- declare type ECDocumentType = CommonDocumentType | "CI" | "RUC";
418
- /**
419
- * Paraguay supported document types.
420
- *
421
- * @typedef PYDocumentType
422
- * @since 0.1.0
423
- */
424
- declare type PYDocumentType = CommonDocumentType;
425
- /**
426
- * Perú supported document types.
427
- *
428
- * @typedef PEDocumentType
429
- * @since 0.1.0
430
- */
431
- declare type PEDocumentType = CommonDocumentType;
432
- /**
433
- * Uruguay supported document types.
434
- *
435
- * @typedef UYDocumentType
436
- * @since 0.1.0
437
- */
438
- declare type UYDocumentType = CommonDocumentType;
439
- /**
440
- * Venezuela supported document types.
441
- *
442
- * @typedef VEDocumentType
443
- * @since 0.1.0
444
- */
445
- declare type VEDocumentType = CommonDocumentType;
446
- /**
447
- * United States supported document types.
448
- *
449
- * @typedef USDocumentType
450
- * @since 0.1.0
451
- */
452
- declare type USDocumentType = CommonDocumentType;
453
-
454
- /**
455
- * Representation of a generic object.
456
- *
457
- * @interface Objectify&lt;T>
458
- * @since 0.5.14
459
- * @property {T} [key: string] object key
460
- */
461
- interface Objectify<T> {
462
- [key: string]: T;
463
- }
464
- /**
465
- * The possible values of a document type.
466
- *
467
- * @typedef DocumentType
468
- * @since 0.1.0
469
- */
470
- declare type DocumentType = ARDocumentType | BODocumentType | BRDocumentType | CLDocumentType | CODocumentType | ECDocumentType | PYDocumentType | PEDocumentType | UYDocumentType | VEDocumentType | USDocumentType;
471
- /**
472
- * Representation of the country's summary.
473
- *
474
- * @interface CountrySummary
475
- * @since 0.5.14
476
- */
477
- interface CountrySummary {
478
- /** Country's id */
479
- id: number;
480
- /** Country's name */
481
- name: string;
482
- }
483
- /**
484
- * The possible values of a week day.
485
- *
486
- * @typedef BaseWeekDay
487
- * @since 0.5.14
488
- */
489
- declare type BaseWeekDay = "MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" | "SATURDAY" | "SUNDAY";
490
- /**
491
- * Common additional information.
492
- *
493
- * @typedef AdditionalInfo
494
- * @since 0.1.0
495
- */
496
- declare type AdditionalInfo = Record<string, any>;
497
-
498
504
  /**
499
505
  * Representation of a Commerce Vendor.
500
506
  *
501
507
  * @interface Vendor
502
- * @since 0.5.14
508
+ * @since 0.1.0
503
509
  */
504
- interface Vendor {
510
+ interface Vendor<T extends AdditionalInfo = AdditionalInfo> {
505
511
  /** Artisn's vendor unique identifier */
506
- id: number;
512
+ id: string;
507
513
  /** Vendor's images, see {@link CDNImage} */
508
514
  images: CDNImage[];
509
515
  /** Vendor's name */
@@ -516,15 +522,17 @@ interface Vendor {
516
522
  sponsored: boolean;
517
523
  /** Whether or not the vendor is active */
518
524
  active: boolean;
525
+ /** Vendor additional info */
526
+ additionalInfo?: T;
519
527
  }
520
528
 
521
529
  /**
522
530
  * Representation of a Commerce Catalogue.
523
531
  *
524
532
  * @interface Catalogue
525
- * @since 0.5.14
533
+ * @since 0.1.0
526
534
  */
527
- interface Catalogue {
535
+ interface Catalogue<T extends AdditionalInfo = AdditionalInfo> {
528
536
  /** Catalogue's id */
529
537
  catalogueId: string;
530
538
  /** Catalogue's name */
@@ -533,28 +541,30 @@ interface Catalogue {
533
541
  active: boolean;
534
542
  /** Catalogue's friendly name to use on front end */
535
543
  friendlyName?: string;
544
+ /** Catalogue additional info */
545
+ additionalInfo?: T;
536
546
  }
537
547
 
538
548
  /**
539
549
  * Representation of a Commerce Store.
540
550
  *
541
551
  * @interface Store
552
+ * @template T Store additional info
553
+ * @template U Vendor additional info
554
+ * @template V Catalogues additional info
542
555
  * @since 0.1.0
543
556
  */
544
- interface Store {
557
+ interface Store<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo> {
545
558
  /** Store unique identifier */
546
559
  storeId: number;
547
560
  /** Store name */
548
561
  storeName: string;
549
562
  /** Store address */
550
563
  address: string;
551
- /** The vendor associated with the store, see {@link Vendor} */
552
- vendor: Vendor;
553
- /**
554
- * Additional store information, see
555
- * {@link AdditionalStoreInformation} for further information
556
- */
557
- additionalInfo: AdditionalStoreInformation;
564
+ /** The vendor associated with the store, see {@link Vendor} */
565
+ vendor: Vendor<U>;
566
+ /** Additional store information */
567
+ additionalInfo?: T;
558
568
  /** Whether or not the store is within coverage */
559
569
  coverage: boolean;
560
570
  /** Store cover url */
@@ -610,7 +620,7 @@ interface Store {
610
620
  /** Store location, see {@link StoreLocation} for further information */
611
621
  location: StoreLocation;
612
622
  /** Array of catalogues, see {@link Catalogue} */
613
- catalogues: Catalogue[];
623
+ catalogues: Catalogue<V>[];
614
624
  /** Array of store images, see {@link CDNImage} */
615
625
  images: CDNImage[];
616
626
  /** The distance between the user and the store, roughly in metres */
@@ -650,24 +660,6 @@ interface GenericStoreLocation {
650
660
  /** Whether or not the generic store location is active */
651
661
  active: boolean;
652
662
  }
653
- /**
654
- * Additional store information.
655
- *
656
- * @interface AdditionalStoreInformation
657
- * @since 0.1.0
658
- */
659
- interface AdditionalStoreInformation {
660
- /** Store external id */
661
- externalId: string;
662
- /** Store external code */
663
- externalCode: string;
664
- /** Delivery unique identifier */
665
- idDeliveryKfc: string;
666
- /** Whether or not the store has a drinks store */
667
- isDrinksStore: boolean;
668
- /** Whether or not to show the drinks store */
669
- showDrinksStore: boolean;
670
- }
671
663
  /**
672
664
  * Store delivery modality information.
673
665
  *
@@ -750,9 +742,9 @@ interface StorePolygons {
750
742
  * Representation of a Commerce Shipping Cost.
751
743
  *
752
744
  * @interface ShippingCost
753
- * @since 0.5.14
745
+ * @since 0.1.0
754
746
  */
755
- interface ShippingCost {
747
+ interface ShippingCost<T extends AdditionalInfo = AdditionalInfo> {
756
748
  /** Shipping cost product's id */
757
749
  productId: number;
758
750
  /** Shipping cost's name */
@@ -777,12 +769,14 @@ interface ShippingCost {
777
769
  discountTotal: number;
778
770
  /** Shipping cost's total */
779
771
  total: number;
772
+ /** Shipping cost additional info */
773
+ additionalInfo?: T;
780
774
  }
781
775
  /**
782
776
  * Representation of a shipping cost tax.
783
777
  *
784
778
  * @interface ShippingCostTax
785
- * @since 0.5.14
779
+ * @since 0.1.0
786
780
  */
787
781
  interface ShippingCostTax {
788
782
  /** Tax percentage to be applied */
@@ -805,9 +799,16 @@ interface ShippingCostTax {
805
799
  * Representation of a Commerce Shopping Cart.
806
800
  *
807
801
  * @interface ShoppingCart
802
+ * @template T Shopping cart additional info
803
+ * @template U Product additional info
804
+ * @template V Categories additional info
805
+ * @template W Store additional info
806
+ * @template X Vendor additional info
807
+ * @template Y Catalogues additional info
808
+ * @template Z Shipping cost additional info
808
809
  * @since 0.1.0
809
810
  */
810
- interface ShoppingCart<T extends AdditionalInfo = AdditionalInfo> {
811
+ interface ShoppingCart<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo, W extends AdditionalInfo = AdditionalInfo, X extends AdditionalInfo = AdditionalInfo, Y extends AdditionalInfo = AdditionalInfo, Z extends AdditionalInfo = AdditionalInfo> {
811
812
  /** Shopping cart unique identifier */
812
813
  id: string;
813
814
  /** Shopping cart name */
@@ -825,9 +826,9 @@ interface ShoppingCart<T extends AdditionalInfo = AdditionalInfo> {
825
826
  /** Shopping cart channel unique identifier */
826
827
  channelId: number;
827
828
  /** Shopping cart stores, see Objectify<{@link CartStore}> */
828
- stores: Objectify<CartStore>;
829
+ stores: Objectify<CartStore<W, U, V, X, Y>>;
829
830
  /** Shopping cart shipping cost */
830
- shippingCost: ShippingCost | null;
831
+ shippingCost: ShippingCost<Z> | null;
831
832
  /** Shopping cart additional info */
832
833
  additional_info?: T;
833
834
  /** Shopping cart bill total */
@@ -846,7 +847,7 @@ interface ShoppingCart<T extends AdditionalInfo = AdditionalInfo> {
846
847
  * Representation of a Alert.
847
848
  *
848
849
  * @interface Alert
849
- * @since 0.5.14
850
+ * @since 0.1.0
850
851
  */
851
852
  interface Alert {
852
853
  /** Alert error level */
@@ -860,12 +861,17 @@ interface Alert {
860
861
  * Representation of a Cart Store.
861
862
  *
862
863
  * @interface CartStore
863
- * @since 0.5.14
864
+ * @template T Store additional info
865
+ * @template U Product additional info
866
+ * @template V Categories additional info
867
+ * @template W Vendor additional info
868
+ * @template X Catalogues additional info
869
+ * @since 0.1.0
864
870
  * @extends {{@link Store}
865
871
  */
866
- interface CartStore extends Store {
872
+ interface CartStore<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo, W extends AdditionalInfo = AdditionalInfo, X extends AdditionalInfo = AdditionalInfo> extends Store<T, W, X> {
867
873
  /** The products that belong to the store, see {@link CartProduct} */
868
- products: Objectify<CartProduct>;
874
+ products: Objectify<CartProduct<U, V>>;
869
875
  /** Cart store's alerts, see {@link Alert} */
870
876
  alerts: Alert[];
871
877
  }
@@ -873,7 +879,7 @@ interface CartStore extends Store {
873
879
  * The possible values of a Bill Total.
874
880
  *
875
881
  * @typedef BillTotal
876
- * @since 0.5.14
882
+ * @since 0.1.0
877
883
  */
878
884
  declare type BillTotal = {
879
885
  /** Normal bill total category */
@@ -885,7 +891,7 @@ declare type BillTotal = {
885
891
  * Representation of a Bill Total Category.
886
892
  *
887
893
  * @interface BillTotalCategory
888
- * @since 0.5.14
894
+ * @since 0.1.0
889
895
  */
890
896
  interface BillTotalCategory {
891
897
  /** Bill total category subtotal without taxes */
@@ -928,7 +934,7 @@ interface Discount {
928
934
  * Representation of a Cart Totals.
929
935
  *
930
936
  * @interface CartTotals
931
- * @since 0.5.14
937
+ * @since 0.1.0
932
938
  */
933
939
  interface CartTotals {
934
940
  /** Cart totals subtotal */
@@ -940,14 +946,14 @@ interface CartTotals {
940
946
  * A shopping cart DB node from a user.
941
947
  *
942
948
  * @typedef ShoppingCartNode
943
- * @since 0.5.14
949
+ * @since 0.1.0
944
950
  */
945
951
  declare type ShoppingCartNode = ArtisnDBQueryDocumentSnapshot<ArtisnDBDocumentData>;
946
952
  /**
947
953
  * The complete collection of shopping carts DB nodes from a user.
948
954
  *
949
955
  * @typedef ShoppingCartNodes
950
- * @since 0.5.14
956
+ * @since 0.1.0
951
957
  */
952
958
  declare type ShoppingCartNodes = ArtisnDBCollectionReference<ArtisnDBDocumentData>;
953
959
 
@@ -955,16 +961,18 @@ declare type ShoppingCartNodes = ArtisnDBCollectionReference<ArtisnDBDocumentDat
955
961
  * Representation of a Commerce Product.
956
962
  *
957
963
  * @typedef Product
958
- * @since 0.5.14
964
+ * @template T Product additional info
965
+ * @template U Categories additional info
966
+ * @since 0.1.0
959
967
  */
960
- declare type Product = BaseProduct | ProductDetails | CartProduct;
968
+ declare type Product<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo> = BaseProduct<T> | ProductDetails<T, U> | CartProduct<T, U>;
961
969
  /**
962
970
  * Base product attributes.
963
971
  *
964
972
  * @interface BaseProduct
965
- * @since 0.5.14
973
+ * @since 0.1.0
966
974
  */
967
- interface BaseProduct {
975
+ interface BaseProduct<T extends AdditionalInfo = AdditionalInfo> {
968
976
  /** Product unique identifier */
969
977
  productId: string;
970
978
  /** The name of the product */
@@ -1001,12 +1009,14 @@ interface BaseProduct {
1001
1009
  sponsored: boolean;
1002
1010
  /** The status of the product, see {@link ProductStatus} */
1003
1011
  status: ProductStatus;
1012
+ /** Product additional info */
1013
+ additionalInfo?: T;
1004
1014
  }
1005
1015
  /**
1006
1016
  * Product prices attributes.
1007
1017
  *
1008
1018
  * @interface ProductPrices
1009
- * @since 0.5.14
1019
+ * @since 0.1.0
1010
1020
  */
1011
1021
  interface ProductPrices {
1012
1022
  /** Normal price category, see {@link PriceCategory} */
@@ -1018,7 +1028,7 @@ interface ProductPrices {
1018
1028
  * Price category attributes.
1019
1029
  *
1020
1030
  * @interface PriceCategory
1021
- * @since 0.5.14
1031
+ * @since 0.1.0
1022
1032
  */
1023
1033
  interface PriceCategory {
1024
1034
  /** Price category type, see {@link PriceCategoryType} */
@@ -1044,7 +1054,7 @@ interface PriceCategory {
1044
1054
  * Price category tax attributes.
1045
1055
  *
1046
1056
  * @interface PriceCategoryTax
1047
- * @since 0.5.14
1057
+ * @since 0.1.0
1048
1058
  */
1049
1059
  interface PriceCategoryTax {
1050
1060
  /** Price category' tax percentage */
@@ -1062,7 +1072,7 @@ interface PriceCategoryTax {
1062
1072
  * Additional product attributes.
1063
1073
  *
1064
1074
  * @interface ProductAttributes
1065
- * @since 0.5.14
1075
+ * @since 0.1.0
1066
1076
  */
1067
1077
  interface ProductAttributes {
1068
1078
  /** Product's quantity, the attribute is not in camel case purposefully */
@@ -1076,35 +1086,35 @@ interface ProductAttributes {
1076
1086
  * The product status.
1077
1087
  *
1078
1088
  * @typedef ProductStatus
1079
- * @since 0.5.14
1089
+ * @since 0.1.0
1080
1090
  **/
1081
1091
  declare type ProductStatus = "ACTIVE" | "INACTIVE";
1082
1092
  /**
1083
1093
  * Product type's possible values.
1084
1094
  *
1085
1095
  * @typedef ProductType
1086
- * @since 0.5.14
1096
+ * @since 0.1.0
1087
1097
  **/
1088
1098
  declare type ProductType = "PRODUCT" | "MODIFIER";
1089
1099
  /**
1090
1100
  * Price category's possible values.
1091
1101
  *
1092
1102
  * @typedef PriceCategoryType
1093
- * @since 0.5.14
1103
+ * @since 0.1.0
1094
1104
  **/
1095
1105
  declare type PriceCategoryType = "NORMAL" | "POINTS";
1096
1106
  /**
1097
1107
  * Tax's possible values.
1098
1108
  *
1099
1109
  * @typedef TaxType
1100
- * @since 0.5.14
1110
+ * @since 0.1.0
1101
1111
  **/
1102
1112
  declare type TaxType = "IVA";
1103
1113
  /**
1104
1114
  * Weekday product's schedule.
1105
1115
  *
1106
1116
  * @interface DayOfWeek
1107
- * @since 0.5.14
1117
+ * @since 0.1.0
1108
1118
  */
1109
1119
  interface DayOfWeek {
1110
1120
  /** Week day in uppercase, see {@link BaseWeekDay} */
@@ -1122,9 +1132,10 @@ interface DayOfWeek {
1122
1132
  * The representation of a product question.
1123
1133
  *
1124
1134
  * @interface ProductQuestion
1125
- * @since 0.5.14
1135
+ * @template T Product answers additional info
1136
+ * @since 0.1.0
1126
1137
  */
1127
- interface ProductQuestion {
1138
+ interface ProductQuestion<T extends AdditionalInfo = AdditionalInfo> {
1128
1139
  /** Product question id */
1129
1140
  questionId: string;
1130
1141
  /** Product question name */
@@ -1141,25 +1152,20 @@ interface ProductQuestion {
1141
1152
  * Array of possible answers to a product question,
1142
1153
  * see {@link ProductAnswer}
1143
1154
  */
1144
- answers: ProductAnswer[];
1155
+ answers: ProductAnswer<T>[];
1145
1156
  /** Array of product question images to display, see {@link CDNImage} */
1146
1157
  images: CDNImage[] | undefined;
1147
1158
  }
1148
- /**
1149
- * Common props for products and answers.
1150
- *
1151
- * @typedef CommonProductAndAnswersProps
1152
- * @since 0.5.14
1153
- */
1154
- declare type CommonProductAndAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images";
1155
1159
  /**
1156
1160
  * Product details attributes.
1157
1161
  *
1158
1162
  * @interface ProductDetails
1159
- * @since 0.5.14
1163
+ * @template T Product additional info
1164
+ * @template U Categories additional info
1165
+ * @since 0.1.0
1160
1166
  * @extends {{@link BaseProduct}
1161
1167
  */
1162
- interface ProductDetails extends BaseProduct {
1168
+ interface ProductDetails<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo> extends BaseProduct<T> {
1163
1169
  /** Indicates if a product has a price vip */
1164
1170
  isPriceVip: boolean;
1165
1171
  /** Manufacturer The manufacturer of the product */
@@ -1169,68 +1175,85 @@ interface ProductDetails extends BaseProduct {
1169
1175
  /** Array of product schedules, see {@link DayOfWeek} */
1170
1176
  schedule: DayOfWeek[];
1171
1177
  /** Array of product questions, see {@link ProductQuestion} */
1172
- questions: ProductQuestion[];
1178
+ questions: ProductQuestion<T>[];
1173
1179
  /** The benefit id of the product */
1174
1180
  benefitId: number | null;
1175
1181
  /** An array of categories which the product belongs to, see {@link Category} */
1176
- categories: Category[] | null;
1182
+ categories: Category<U>[] | null;
1177
1183
  }
1178
1184
  /**
1179
- * Representation of a Commerce Product Answer.
1185
+ * Common props for products and answers.
1180
1186
  *
1181
- * @interface ProductAnswer
1182
- * @since 0.5.14
1183
- * @extends Pick<Product,CommonProductAndAnswersProps>, see
1184
- * {@link Product} and {@link CommonProductAndAnswersProps}
1187
+ * @typedef BaseAnswersProps
1188
+ * @since 0.1.0
1189
+ */
1190
+ declare type BaseAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images" | "questions" | "additionalInfo";
1191
+ /**
1192
+ * The shared fields of any Answer.
1193
+ *
1194
+ * @interface BaseAnswer
1195
+ * @since 0.1.0
1196
+ * @extends Pick<ProductDetails,BaseAnswersProps>, see
1197
+ * {@link ProductDetails} and {@link BaseAnswersProps}
1185
1198
  * for further information
1186
1199
  */
1187
- interface ProductAnswer extends Pick<Product, CommonProductAndAnswersProps> {
1188
- /**
1189
- * Array of questions associated with the answer,
1190
- * see {@link ProductDetails}
1191
- */
1192
- questions: ProductDetails["questions"];
1200
+ declare type BaseAnswer<T extends ProductDetails, U extends keyof T = BaseAnswersProps> = Pick<T, U> & {
1193
1201
  /** Type of question to render */
1194
1202
  renderType: string | null;
1195
- }
1203
+ };
1196
1204
  /**
1197
- * Representation of a Commerce Cart Product Question.
1205
+ * A product modifier answer.
1198
1206
  *
1199
- * @interface CartProductQuestion
1200
- * @since 0.5.14
1201
- * @extends {{@link ProductQuestion}
1207
+ * @interface ProductAnswer
1208
+ * @template T Product additional info
1209
+ * @since 0.1.0
1210
+ * @extends BaseAnswer<ProductDetails>, see
1211
+ * {@link ProductDetails} and {@link BaseAnswer}
1212
+ * for further information
1202
1213
  */
1203
- interface CartProductQuestion extends ProductQuestion {
1204
- /** Array of possible answers to the question */
1205
- answers: CartProductAnswer[];
1214
+ interface ProductAnswer<T extends AdditionalInfo = AdditionalInfo> extends BaseAnswer<ProductDetails<T>> {
1206
1215
  }
1216
+ /**
1217
+ * Common props for cart products and answers.
1218
+ *
1219
+ * @typedef CartAnswersProps
1220
+ * @since 0.1.0
1221
+ */
1222
+ declare type CartAnswersProps = BaseAnswersProps | "amount" | "priceCategory" | "comment" | "questionsAndAnswers";
1207
1223
  /**
1208
1224
  * Representation of a Commerce Cart Product Answer.
1209
1225
  *
1210
1226
  * @interface CartProductAnswer
1211
- * @since 0.5.14
1212
- * @extends {{@link ProductAnswer}
1227
+ * @template T Product additional info
1228
+ * @since 0.1.0
1229
+ * @extends {{@link BaseAnswer}
1213
1230
  */
1214
- interface CartProductAnswer extends ProductAnswer {
1231
+ interface CartProductAnswer<T extends AdditionalInfo = AdditionalInfo> extends BaseAnswer<CartProduct<T>, CartAnswersProps> {
1215
1232
  /** Question unique identifier */
1216
1233
  questionId: string;
1217
- /** Quantity of allowed cart product answers */
1218
- amount: number;
1219
- /** Price category value of a product answer */
1220
- priceCategory: PriceCategoryType;
1221
- /** Comment associated with the product answer */
1222
- comment: string;
1223
- /** Array of possible questions and answers */
1224
- questionsAndAnswers: CartProductQuestion[];
1234
+ }
1235
+ /**
1236
+ * Representation of a Commerce Cart Product Question.
1237
+ *
1238
+ * @interface CartProductQuestion
1239
+ * @template T Product additional info
1240
+ * @since 0.1.0
1241
+ * @extends {{@link ProductQuestion}
1242
+ */
1243
+ interface CartProductQuestion<T extends AdditionalInfo = AdditionalInfo> extends ProductQuestion {
1244
+ /** Array of possible answers to the question */
1245
+ answers: CartProductAnswer<T>[];
1225
1246
  }
1226
1247
  /**
1227
1248
  * Representation of a Commerce Cart Product.
1228
1249
  *
1229
1250
  * @interface CartProduct
1230
- * @since 0.5.14
1251
+ * @template T Product additional info
1252
+ * @template U Categories additional info
1253
+ * @since 0.1.0
1231
1254
  * @extends {{@link ProductDetails}
1232
1255
  */
1233
- interface CartProduct extends ProductDetails {
1256
+ interface CartProduct<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo> extends ProductDetails<T, U> {
1234
1257
  /** Quantity of allowed cart products */
1235
1258
  amount: number;
1236
1259
  /** Cart product price category */
@@ -1253,7 +1276,7 @@ interface CartProduct extends ProductDetails {
1253
1276
  * Wallet user information.
1254
1277
  *
1255
1278
  * @interface Wallet
1256
- * @since 0.5.14
1279
+ * @since 0.1.0
1257
1280
  */
1258
1281
  interface Wallet {
1259
1282
  /** {@link Benefit}'s array from firestore user wallet */
@@ -1323,7 +1346,7 @@ interface Benefit {
1323
1346
  * Award information.
1324
1347
  *
1325
1348
  * @interface Award
1326
- * @since 0.5.14
1349
+ * @since 0.1.0
1327
1350
  */
1328
1351
  interface Award {
1329
1352
  /** The id of the award */
@@ -1347,21 +1370,21 @@ interface Award {
1347
1370
  * Applied benefit array in shopping cart.
1348
1371
  *
1349
1372
  * @typedef ShoppingCartBenefits
1350
- * @since 0.5.14
1373
+ * @since 0.1.0
1351
1374
  */
1352
1375
  declare type ShoppingCartBenefits = Benefit[];
1353
1376
  /**
1354
1377
  * A benefit DB node from a user.
1355
1378
  *
1356
1379
  * @typedef BenefitsByUserNode
1357
- * @since 0.5.14
1380
+ * @since 0.1.0
1358
1381
  */
1359
1382
  declare type BenefitsByUserNode = ArtisnDBQueryDocumentSnapshot<ArtisnDBDocumentData>;
1360
1383
  /**
1361
1384
  * The complete collection of benefits DB nodes from a user.
1362
1385
  *
1363
1386
  * @typedef BenefitsByUserNodes
1364
- * @since 0.5.14
1387
+ * @since 0.1.0
1365
1388
  */
1366
1389
  declare type BenefitsByUserNodes = ArtisnDBCollectionReference<ArtisnDBDocumentData>;
1367
1390
  /**
@@ -1601,9 +1624,9 @@ interface StoreCouponDetail extends Omit<Coupon, "category"> {
1601
1624
  * Representation of a Commerce Banner.
1602
1625
  *
1603
1626
  * @interface Banner
1604
- * @since 1.0
1627
+ * @since 0.1.0
1605
1628
  */
1606
- interface Banner {
1629
+ interface Banner<T extends AdditionalInfo = AdditionalInfo> {
1607
1630
  /** Banner category id */
1608
1631
  banner_category_id: number;
1609
1632
  /** Banner description */
@@ -1654,26 +1677,28 @@ interface Banner {
1654
1677
  vendor_id: number;
1655
1678
  /** Banner vendor's name */
1656
1679
  vendor_name: string;
1680
+ /** Banner additional info */
1681
+ additionalInfo?: T;
1657
1682
  }
1658
1683
  /**
1659
1684
  * The possible values of the banner's type.
1660
1685
  *
1661
1686
  * @typedef BannerType
1662
- * @since 1.0
1687
+ * @since 0.1.0
1663
1688
  */
1664
1689
  declare type BannerType = "INFO" | "URL" | "PRODUCT" | "COUPON" | "COUPON_QR" | "CATEGORY" | "SECTION";
1665
1690
  /**
1666
1691
  * The possible values of the banner's scope.
1667
1692
  *
1668
1693
  * @typedef BannerScope
1669
- * @since 0.5.14
1694
+ * @since 0.1.0
1670
1695
  */
1671
1696
  declare type BannerScope = "WEB" | "GLOBAL" | "APP";
1672
1697
  /**
1673
1698
  * Representation of a Banner image.
1674
1699
  *
1675
1700
  * @interface BannerImage
1676
- * @since 0.5.14
1701
+ * @since 0.1.0
1677
1702
  */
1678
1703
  interface BannerImage {
1679
1704
  /** Banner's id */
@@ -1695,7 +1720,7 @@ interface BannerImage {
1695
1720
  * Representation of a Banner benefits.
1696
1721
  *
1697
1722
  * @interface BannerBenefits
1698
- * @since 1.0
1723
+ * @since 0.1.0
1699
1724
  */
1700
1725
  interface BannerBenefits {
1701
1726
  id: number;
@@ -1705,7 +1730,7 @@ interface BannerBenefits {
1705
1730
  * Representation of a Banner coupon.
1706
1731
  *
1707
1732
  * @interface BannerCoupon
1708
- * @since 1.0
1733
+ * @since 0.1.0
1709
1734
  */
1710
1735
  interface BannerCoupon {
1711
1736
  name: string;
@@ -1745,7 +1770,7 @@ interface BaseBillingData<T extends AdditionalInfo = AdditionalInfo> {
1745
1770
  * Representation of a billing data saved on a database.
1746
1771
  *
1747
1772
  * @interface BillingData
1748
- * @since 0.5.14
1773
+ * @since 0.1.0
1749
1774
  * @extends {{@link BaseBillingData}
1750
1775
  */
1751
1776
  interface BillingData<T extends AdditionalInfo = AdditionalInfo> extends BaseBillingData<T> {
@@ -1757,7 +1782,7 @@ interface BillingData<T extends AdditionalInfo = AdditionalInfo> extends BaseBil
1757
1782
  * Artisn's supported currency codes.
1758
1783
  *
1759
1784
  * @typedef CurrencyCodes
1760
- * @since 0.5.14
1785
+ * @since 0.1.0
1761
1786
  */
1762
1787
  declare type CurrencyCodes = "USD" | "ARS" | "COP" | "CLP" | "VES";
1763
1788
 
@@ -1767,7 +1792,7 @@ declare type CurrencyCodes = "USD" | "ARS" | "COP" | "CLP" | "VES";
1767
1792
  * @interface Workflow
1768
1793
  * @since 0.5.15
1769
1794
  */
1770
- interface Workflow {
1795
+ interface Workflow<T extends AdditionalInfo = AdditionalInfo> {
1771
1796
  /** Workflow description */
1772
1797
  description: string;
1773
1798
  /** Workflow unique identifier */
@@ -1778,6 +1803,8 @@ interface Workflow {
1778
1803
  steps: StepWorkflow[];
1779
1804
  /** An array of webhook workflows, see {@link WebhookWorkflow} */
1780
1805
  webhooks: WebhookWorkflow[];
1806
+ /** Workflow additional info */
1807
+ additionalInfo?: T;
1781
1808
  }
1782
1809
  /**
1783
1810
  * The possible values of the step category.
@@ -1984,7 +2011,7 @@ interface Issue {
1984
2011
  * Representation of a Artisn request.
1985
2012
  *
1986
2013
  * @interface ArtisnRequest
1987
- * @since 0.5.14
2014
+ * @since 0.1.0
1988
2015
  */
1989
2016
  interface ArtisnRequest {
1990
2017
  /** Request's url */
@@ -2004,21 +2031,21 @@ interface ArtisnRequest {
2004
2031
  * Artisn request headers based on the fetch API.
2005
2032
  *
2006
2033
  * @typedef ArtisnRequestHeaders
2007
- * @since 0.5.14
2034
+ * @since 0.1.0
2008
2035
  */
2009
2036
  declare type ArtisnRequestHeaders = Headers;
2010
2037
  /**
2011
2038
  * Allowed methods for requests.
2012
2039
  *
2013
2040
  * @typedef ArtisnRequestMethod
2014
- * @since 0.5.14
2041
+ * @since 0.1.0
2015
2042
  */
2016
2043
  declare type ArtisnRequestMethod = "POST" | "GET" | "PUT" | "DELETE" | "PATCH";
2017
2044
  /**
2018
2045
  * Artisn request's body.
2019
2046
  *
2020
2047
  * @interface ArtisnRequestBody
2021
- * @since 0.5.14
2048
+ * @since 0.1.0
2022
2049
  * @property {any} [key:string] Object with key-value pairs
2023
2050
  */
2024
2051
  interface ArtisnRequestBody {
@@ -2028,7 +2055,7 @@ interface ArtisnRequestBody {
2028
2055
  * Artisn request's body.
2029
2056
  *
2030
2057
  * @interface ArtisnQuery
2031
- * @since 0.5.14
2058
+ * @since 0.1.0
2032
2059
  * @property {string | number | boolean} [key:string] Object with key-value pairs
2033
2060
  */
2034
2061
  interface ArtisnQuery {
@@ -2038,7 +2065,7 @@ interface ArtisnQuery {
2038
2065
  * Artisn request's params.
2039
2066
  *
2040
2067
  * @interface ArtisnParams
2041
- * @since 0.5.14
2068
+ * @since 0.1.0
2042
2069
  * @property {string | number} [key:string] Object with key-value pairs
2043
2070
  */
2044
2071
  interface ArtisnParams {
@@ -2049,7 +2076,7 @@ interface ArtisnParams {
2049
2076
  * Representation of a living place base object.
2050
2077
  *
2051
2078
  * @interface BaseLivingPlace
2052
- * @since 0.5.14
2079
+ * @since 0.1.0
2053
2080
  */
2054
2081
  interface BaseLivingPlace {
2055
2082
  /** Living place's id */
@@ -2059,7 +2086,7 @@ interface BaseLivingPlace {
2059
2086
  * Representation of a living place.
2060
2087
  *
2061
2088
  * @interface LivingPlace
2062
- * @since 0.5.14
2089
+ * @since 0.1.0
2063
2090
  * @extends {{@link BaseLivingPlace}
2064
2091
  */
2065
2092
  interface LivingPlace extends BaseLivingPlace {
@@ -2076,7 +2103,7 @@ interface LivingPlace extends BaseLivingPlace {
2076
2103
  * Representation of a living place which will be saved.
2077
2104
  *
2078
2105
  * @interface LivingPlaceToSave
2079
- * @since 0.5.14
2106
+ * @since 0.1.0
2080
2107
  * @extends {{@link BaseLivingPlace}
2081
2108
  */
2082
2109
  interface LivingPlaceToSave extends BaseLivingPlace {
@@ -2087,7 +2114,7 @@ interface LivingPlaceToSave extends BaseLivingPlace {
2087
2114
  * Representation of a field object.
2088
2115
  *
2089
2116
  * @interface Field
2090
- * @since 0.5.14
2117
+ * @since 0.1.0
2091
2118
  */
2092
2119
  interface Field {
2093
2120
  /** Field's id */
@@ -2105,7 +2132,7 @@ interface Field {
2105
2132
  * Representation of a field record.
2106
2133
  *
2107
2134
  * @interface FieldRecord
2108
- * @since 0.5.14
2135
+ * @since 0.1.0
2109
2136
  */
2110
2137
  interface FieldRecord {
2111
2138
  /** Field record's id */
@@ -2117,7 +2144,7 @@ interface FieldRecord {
2117
2144
  * Messages for living places.
2118
2145
  *
2119
2146
  * @interface Message
2120
- * @since 0.5.14
2147
+ * @since 0.1.0
2121
2148
  */
2122
2149
  interface Message {
2123
2150
  /** The maximum number's message of allowed living places */
@@ -2129,7 +2156,7 @@ interface Message {
2129
2156
  * Rules for living places.
2130
2157
  *
2131
2158
  * @interface Rule
2132
- * @since 0.5.14
2159
+ * @since 0.1.0
2133
2160
  */
2134
2161
  interface Rule {
2135
2162
  /** The maximum number of allowed living places */
@@ -2142,9 +2169,9 @@ interface Rule {
2142
2169
  * Representation of a basic Shipping Address.
2143
2170
  *
2144
2171
  * @interface BaseShippingAddress
2145
- * @since 0.5.14
2172
+ * @since 0.1.0
2146
2173
  */
2147
- interface BaseShippingAddress {
2174
+ interface BaseShippingAddress<T extends AdditionalInfo = AdditionalInfo> {
2148
2175
  /** Whether or not the shipping address is default */
2149
2176
  default: boolean;
2150
2177
  /** Shipping address' latitude */
@@ -2169,15 +2196,18 @@ interface BaseShippingAddress {
2169
2196
  nickname: string;
2170
2197
  /** Shipping address' number contact address */
2171
2198
  numberContactAddress: string;
2199
+ /** Shipping address additional info */
2200
+ additionalInfo?: T;
2172
2201
  }
2173
2202
  /**
2174
2203
  * Representation of a Commerce Shipping Address.
2175
2204
  *
2205
+ * @template T Shipping address additional info
2176
2206
  * @interface ShippingAddress
2177
- * @since 0.5.14
2207
+ * @since 0.1.0
2178
2208
  * @extends {{@link BaseShippingAddress}
2179
2209
  */
2180
- interface ShippingAddress extends BaseShippingAddress {
2210
+ interface ShippingAddress<T extends AdditionalInfo = AdditionalInfo> extends BaseShippingAddress<T> {
2181
2211
  /** Shipping address unique identifier */
2182
2212
  id: number;
2183
2213
  /** Object which contains the living place, see {@link LivingPlace} */
@@ -2186,11 +2216,12 @@ interface ShippingAddress extends BaseShippingAddress {
2186
2216
  /**
2187
2217
  * A shipping address object used when it needs to be created.
2188
2218
  *
2219
+ * @template T Shipping address additional info
2189
2220
  * @interface NewShippingAddress
2190
- * @since 0.5.14
2221
+ * @since 0.1.0
2191
2222
  * @extends {{@link BaseShippingAddress}
2192
2223
  */
2193
- interface NewShippingAddress extends BaseShippingAddress {
2224
+ interface NewShippingAddress<T extends AdditionalInfo = AdditionalInfo> extends BaseShippingAddress<T> {
2194
2225
  /** Shipping address unique identifier */
2195
2226
  id?: number;
2196
2227
  /**
@@ -2202,11 +2233,12 @@ interface NewShippingAddress extends BaseShippingAddress {
2202
2233
  /**
2203
2234
  * A shipping address object used when it needs to be updated.
2204
2235
  *
2236
+ * @template T Shipping address additional info
2205
2237
  * @interface UpdatedShippingAddress
2206
- * @since 0.5.14
2238
+ * @since 0.1.0
2207
2239
  * @extends {{@link BaseShippingAddress}
2208
2240
  */
2209
- interface UpdatedShippingAddress extends BaseShippingAddress {
2241
+ interface UpdatedShippingAddress<T extends AdditionalInfo = AdditionalInfo> extends BaseShippingAddress<T> {
2210
2242
  /** Shipping address unique identifier */
2211
2243
  id: number;
2212
2244
  /**
@@ -2220,9 +2252,10 @@ interface UpdatedShippingAddress extends BaseShippingAddress {
2220
2252
  * Representation of a Commerce User.
2221
2253
  *
2222
2254
  * @interface BaseUser
2223
- * @since 0.5.14
2255
+ * @template T User additional info
2256
+ * @since 0.1.0
2224
2257
  */
2225
- interface BaseUser {
2258
+ interface BaseUser<T extends AdditionalInfo = AdditionalInfo> {
2226
2259
  /** User's unique identifier */
2227
2260
  uid: string;
2228
2261
  /** User's first name */
@@ -2259,17 +2292,18 @@ interface BaseUser {
2259
2292
  maritalStatus?: MaritalStatus;
2260
2293
  /** Whether or not the user is active */
2261
2294
  active?: boolean;
2262
- /** User's additional info, see {@link AdditionalInfo} */
2263
- additionalInfo?: AdditionalInfo;
2295
+ /** User's additional info */
2296
+ additionalInfo?: T;
2264
2297
  }
2265
2298
  /**
2266
2299
  * Representation of a user saved on a database.
2267
2300
  *
2268
2301
  * @interface User
2269
- * @since 0.5.14
2302
+ * @template T User additional info
2303
+ * @since 0.1.0
2270
2304
  * @extends {{@link BaseUser}
2271
2305
  */
2272
- interface User extends BaseUser {
2306
+ interface User<T extends AdditionalInfo = AdditionalInfo> extends BaseUser<T> {
2273
2307
  /** User's auto generated id */
2274
2308
  idInt: number;
2275
2309
  }
@@ -2277,14 +2311,14 @@ interface User extends BaseUser {
2277
2311
  * The possible values for the user's type.
2278
2312
  *
2279
2313
  * @typedef UserType
2280
- * @since 0.5.14
2314
+ * @since 0.1.0
2281
2315
  */
2282
2316
  declare type UserType = "NORMAL" | "DEPENDENT";
2283
2317
  /**
2284
2318
  * Representation of a phone.
2285
2319
  *
2286
2320
  * @interface UserCountry
2287
- * @since 0.5.14
2321
+ * @since 0.1.0
2288
2322
  */
2289
2323
  interface UserCountry {
2290
2324
  /** User's country id */
@@ -2294,7 +2328,7 @@ interface UserCountry {
2294
2328
  * Representation of a phone.
2295
2329
  *
2296
2330
  * @interface Phone
2297
- * @since 0.5.14
2331
+ * @since 0.1.0
2298
2332
  */
2299
2333
  interface Phone {
2300
2334
  /** User's phone number */
@@ -2308,14 +2342,14 @@ interface Phone {
2308
2342
  * The possible values for the user's marital status.
2309
2343
  *
2310
2344
  * @typedef MaritalStatus
2311
- * @since 0.5.14
2345
+ * @since 0.1.0
2312
2346
  */
2313
2347
  declare type MaritalStatus = "MARRIED" | "DIVORCED" | "SINGLE";
2314
2348
  /**
2315
2349
  * The possible values for the user's gender.
2316
2350
  *
2317
2351
  * @typedef Gender
2318
- * @since 0.5.14
2352
+ * @since 0.1.0
2319
2353
  */
2320
2354
  declare type Gender = "MALE" | "FEMALE";
2321
2355
 
@@ -2348,15 +2382,18 @@ interface Settings {
2348
2382
  * Representation of common properties of the order.
2349
2383
  *
2350
2384
  * @interface BaseOrder
2385
+ * @template T Order additional info
2386
+ * @template U Shopping cart additional info
2387
+ * @template V User additional info
2351
2388
  * @since 0.1.0
2352
2389
  */
2353
- interface BaseOrder {
2390
+ interface BaseOrder<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo> {
2354
2391
  /** Order unique identifier */
2355
2392
  id: number;
2356
2393
  /** Account unique identifier */
2357
2394
  accountId: number;
2358
- /** Order additional info, see {@link OrderAdditionalInfo} */
2359
- additionalInfo: OrderAdditionalInfo;
2395
+ /** Order additional info*/
2396
+ additionalInfo?: T;
2360
2397
  /** User's order billing data' unique identifier */
2361
2398
  billingDataByUserId: string;
2362
2399
  /** Order additional messages */
@@ -2388,7 +2425,7 @@ interface BaseOrder {
2388
2425
  /** Order sequence id */
2389
2426
  seq_id: string;
2390
2427
  /** Shopping cart associated with the order, see {@link OrderShoppingCart} */
2391
- shoppingCart: OrderShoppingCart;
2428
+ shoppingCart: OrderShoppingCart<U>;
2392
2429
  /** Order step, see {@link OrderStep} */
2393
2430
  step: OrderStep;
2394
2431
  /** Step category, see {@link StepCategory} */
@@ -2402,7 +2439,7 @@ interface BaseOrder {
2402
2439
  /** User unique identifier */
2403
2440
  uid: string;
2404
2441
  /** Order user, see {@link OrderUser} */
2405
- user: OrderUser;
2442
+ user: OrderUser<V>;
2406
2443
  /** Order transaction unique identifier */
2407
2444
  transactionId: number | null;
2408
2445
  /** Vendor unique identifier */
@@ -2412,14 +2449,22 @@ interface BaseOrder {
2412
2449
  /** Order operator information, see {@link OperatorInformation} */
2413
2450
  createdByOperator: OperatorInformation;
2414
2451
  }
2452
+ /**
2453
+ * Shopping cart payment status.
2454
+ *
2455
+ * @typedef OrderStatus
2456
+ * @since 0.1.0
2457
+ */
2458
+ declare type PaymentStatus = "PENDING" | "CANCELED" | "PAID" | "REFUNDED";
2415
2459
  /**
2416
2460
  * The shopping cart associated with the order.
2417
2461
  *
2418
2462
  * @interface OrderShoppingCart
2463
+ * @template T Shopping cart additional info
2419
2464
  * @since 0.1.0
2420
2465
  * @extends {{@link ShoppingCart}
2421
2466
  */
2422
- interface OrderShoppingCart extends Omit<ShoppingCart, "stores" | "billTotal"> {
2467
+ interface OrderShoppingCart<T extends AdditionalInfo = AdditionalInfo> extends Omit<ShoppingCart<T>, "stores" | "billTotal"> {
2423
2468
  /** Order shopping cart comment */
2424
2469
  comment: string | null;
2425
2470
  /** Order instructions */
@@ -2434,8 +2479,8 @@ interface OrderShoppingCart extends Omit<ShoppingCart, "stores" | "billTotal"> {
2434
2479
  statusName: string;
2435
2480
  /** Status code, see {@link StepCode} */
2436
2481
  statusCode: StepCode;
2437
- /** Order payment status, see {@link OrderStatus} */
2438
- paymentStatus: OrderStatus;
2482
+ /** Order payment status, see {@link PaymentStatus} */
2483
+ paymentStatus: PaymentStatus;
2439
2484
  /**
2440
2485
  * An array of the order paid payment methods,
2441
2486
  * see {@link OrderPaymentMethod}
@@ -2811,6 +2856,8 @@ interface OrderRetry extends Status, OrderCommonFields {
2811
2856
  request_id: string;
2812
2857
  /** Order retry process url **/
2813
2858
  process_url: string;
2859
+ /** Order retry Payment methods, see {@link OrderPaymentMethod} */
2860
+ payment_method: OrderPaymentMethod | null;
2814
2861
  /** Order payment method, see {@link PaymentMethodByOrder} **/
2815
2862
  payment_method_by_order: PaymentMethodByOrder;
2816
2863
  /** Order step, see {@link OrderStep} */
@@ -2986,10 +3033,13 @@ interface OrderStepAdditionalInfoGroup {
2986
3033
  * The details of the order.
2987
3034
  *
2988
3035
  * @interface OrderDetails
3036
+ * @template T Order additional info
3037
+ * @template U Shopping cart additional info
3038
+ * @template V User additional info
2989
3039
  * @since 0.5.15
2990
3040
  * @extends {{@link BaseOrder}
2991
3041
  */
2992
- interface OrderDetails extends BaseOrder {
3042
+ interface OrderDetails<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo> extends BaseOrder<T, U, V> {
2993
3043
  /** Order details' shipping address */
2994
3044
  shippingAddress: ShippingAddress;
2995
3045
  /** Order details' shipping cost, see {@link OrderDetailShippingCost} */
@@ -3011,9 +3061,12 @@ interface OrderDetailShippingCost {
3011
3061
  * Representation of a Commerce Order.
3012
3062
  *
3013
3063
  * @typedef Order
3064
+ * @template T Order additional info
3065
+ * @template U Shopping cart additional info
3066
+ * @template V User additional info
3014
3067
  * @since 0.5.15
3015
3068
  */
3016
- declare type Order = BaseOrder | OrderDetails;
3069
+ declare type Order<T extends AdditionalInfo = AdditionalInfo, U extends AdditionalInfo = AdditionalInfo, V extends AdditionalInfo = AdditionalInfo> = BaseOrder<T, U, V> | OrderDetails<T, U, V>;
3017
3070
  /**
3018
3071
  * Order shipping metadata base field.
3019
3072
  *
@@ -3099,22 +3152,6 @@ interface MetadataShipping {
3099
3152
  /** Order shipping country, see {@link BaseField} */
3100
3153
  country: BaseField;
3101
3154
  }
3102
- /**
3103
- * Order additional info.
3104
- *
3105
- * @interface OrderAdditionalInfo
3106
- * @since 0.1.0
3107
- */
3108
- interface OrderAdditionalInfo {
3109
- /** Order auth provider */
3110
- providerAuth: string | null;
3111
- /** Order metadata shipping, see {@link MetadataShipping} */
3112
- metadataShipping: MetadataShipping;
3113
- /** Order integration messages, see {@link IntegrationMessage} */
3114
- integrationMessages: IntegrationMessage;
3115
- /** Order parent shipping cart */
3116
- parentShoppingCart: boolean;
3117
- }
3118
3155
  /**
3119
3156
  * Order allocation options.
3120
3157
  *
@@ -3126,10 +3163,11 @@ declare type Allocation = "PICKUP_TO_GO" | "PICKUP_IN_PLACE" | "DELIVERY";
3126
3163
  * Order user.
3127
3164
  *
3128
3165
  * @interface OrderUser
3166
+ * @template T User additional info
3129
3167
  * @since 0.1.0
3130
3168
  * @extends {{@link BaseUser}
3131
3169
  */
3132
- interface OrderUser extends BaseUser {
3170
+ interface OrderUser<T extends AdditionalInfo = AdditionalInfo> extends BaseUser<T> {
3133
3171
  /** Order user settings, see {@link Settings} */
3134
3172
  settings: Settings;
3135
3173
  }
@@ -3158,6 +3196,8 @@ interface OperatorInformation {
3158
3196
  * @since 0.1.0
3159
3197
  */
3160
3198
  interface OrderPaymentMethod {
3199
+ /** Order payment method id */
3200
+ id: number;
3161
3201
  /** Order payment method id */
3162
3202
  payment_method_id: number;
3163
3203
  /** Order payment method name */
@@ -3338,7 +3378,7 @@ interface NotificationListItem {
3338
3378
  * Basic payment method object.
3339
3379
  *
3340
3380
  * @interface BasePaymentMethod
3341
- * @since 0.5.14
3381
+ * @since 0.1.0
3342
3382
  */
3343
3383
  interface BasePaymentMethod {
3344
3384
  /** Payment method's id */
@@ -3354,7 +3394,7 @@ interface BasePaymentMethod {
3354
3394
  * Representation of a Commerce Payment method.
3355
3395
  *
3356
3396
  * @interface PaymentMethod
3357
- * @since 0.5.14
3397
+ * @since 0.1.0
3358
3398
  * @extends {{@link BasePaymentMethod}
3359
3399
  */
3360
3400
  interface PaymentMethod extends BasePaymentMethod {
@@ -3377,7 +3417,7 @@ interface PaymentMethod extends BasePaymentMethod {
3377
3417
  * Representation of a credit card brand.
3378
3418
  *
3379
3419
  * @interface PaymentProvider
3380
- * @since 0.5.14
3420
+ * @since 0.1.0
3381
3421
  * @extends {{@link PaymentMethod}
3382
3422
  */
3383
3423
  interface PaymentProvider extends Omit<PaymentMethod, "name"> {
@@ -3390,7 +3430,7 @@ interface PaymentProvider extends Omit<PaymentMethod, "name"> {
3390
3430
  * Representation of a credit card brand.
3391
3431
  *
3392
3432
  * @interface CreditCardMapping
3393
- * @since 0.5.14
3433
+ * @since 0.1.0
3394
3434
  * @extends {{@link BasePaymentMethod}
3395
3435
  */
3396
3436
  interface CreditCardMapping extends BasePaymentMethod {
@@ -3407,14 +3447,14 @@ interface CreditCardMapping extends BasePaymentMethod {
3407
3447
  * Payment method common names.
3408
3448
  *
3409
3449
  * @typedef PaymentMethodName
3410
- * @since 0.5.14
3450
+ * @since 0.1.0
3411
3451
  */
3412
3452
  declare type PaymentMethodName = "CREDIT_CARD" | "CASH" | "DATAPHONE";
3413
3453
  /**
3414
3454
  * Cards common names.
3415
3455
  *
3416
3456
  * @typedef CardName
3417
- * @since 0.5.14
3457
+ * @since 0.1.0
3418
3458
  */
3419
3459
  declare type CardName = "Diners" | "Discover" | "American Express" | "Visa" | "MasterCard";
3420
3460
  /**
@@ -3434,4 +3474,4 @@ interface CardInscription {
3434
3474
  createdAt?: string;
3435
3475
  }
3436
3476
 
3437
- 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, BannerBenefits, BannerCoupon, BannerImage, BannerScope, BannerType, BaseBillingData, BaseField, BaseLivingPlace, BaseOrder, BasePaymentMethod, BaseProduct, BaseShippingAddress, BaseUser, BaseWeekDay, Benefit, BenefitData, BenefitTypes, BenefitsByUserNode, BenefitsByUserNodes, BillTotal, BillTotalCategory, BillingData, CDNImage, CLDocumentType, CODocumentType, CardInscription, CardName, CartProduct, CartProductAnswer, CartProductQuestion, CartStore, CartTotals, Catalogue, Category, CategoryWithProducts, Code, CommonDocumentType, Country, CountryCode, CountryCurrency, CountrySummary, Coupon, CouponCategory, CouponType, CreditCardMapping, CurrencyCodes, DayOfWeek, Days, Delivery, DeliveryTimeUnit, Discount, DocumentType, ECDocumentType, Field, FieldRecord, Gender, GenericStoreLocation, Image, ImageFit, ImageManipulationConfig, ImageToFormat, Injection, InjectionDetail, IntegrationMessage, Issue, IssueAdditionalInfo, IssueHistory, LivingPlace, LivingPlaceToSave, MaritalStatus, Message, MetadataShipping, NewShippingAddress, Notification, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, NotificationPriority, NotificationStep, NotificationStore, NotificationUser, NotificationVendor, Objectify, OperatorInformation, Order, OrderAdditionalInfo, OrderBillProduct, OrderBillProductAdditionalInfo, OrderBillTotal, OrderCommonFields, OrderDetailShippingCost, OrderDetails, OrderPaymentMethod, OrderProduct, OrderProductAdditionalInfo, OrderProductAttributes, OrderProductBillTotal, OrderProductImage, OrderProductPriceCategory, OrderRetry, OrderRetryPaymentMethod, OrderShoppingCart, OrderStatus, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderStore, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderUser, PEDocumentType, PYDocumentType, PaymentMethod, PaymentMethodByOrder, PaymentMethodName, PaymentProvider, Phone, PriceCategory, PriceCategoryTax, PriceCategoryType, Product, ProductAnswer, ProductAttributes, ProductCoupon, ProductDetails, ProductPrices, ProductQuestion, ProductStatus, ProductType, RandomImageConfig, ReadValue, Rule, Schedule, Service, Settings, ShippingAddress, ShippingCost, ShippingCostTax, ShoppingCart, ShoppingCartBenefits, ShoppingCartNode, ShoppingCartNodes, Status, StepCategory, StepCode, StepNotification, StepWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, Store, StoreCoupon, StoreCouponDetail, StoreLocation, StorePolygons, Suborder, TaxCalculation, TaxCalculations, TaxType, Token, TransitionWorkflow, URLImage, USDocumentType, UYDocumentType, UpdatedShippingAddress, User, UserCountry, UserSettings, UserType, VEDocumentType, Vendor, Wallet, WebhookWorkflow, Workflow, ZipCodeField };
3477
+ export { ARDocumentType, Account, AdditionalInfo, 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, BannerBenefits, BannerCoupon, BannerImage, BannerScope, BannerType, BaseBillingData, BaseField, BaseLivingPlace, BaseOrder, BasePaymentMethod, BaseProduct, BaseShippingAddress, BaseUser, BaseWeekDay, Benefit, BenefitData, BenefitTypes, BenefitsByUserNode, BenefitsByUserNodes, BillTotal, BillTotalCategory, BillingData, CDNImage, CLDocumentType, CODocumentType, CardInscription, CardName, CartProduct, CartProductAnswer, CartProductQuestion, CartStore, CartTotals, Catalogue, Category, CategoryWithProducts, Code, CommonDocumentType, Country, CountryCode, CountryCurrency, CountrySummary, Coupon, CouponCategory, CouponType, CreditCardMapping, CurrencyCodes, DayOfWeek, Days, Delivery, DeliveryTimeUnit, Discount, DocumentType, ECDocumentType, Field, FieldRecord, Gender, GenericStoreLocation, Image, ImageFit, ImageManipulationConfig, ImageToFormat, Injection, InjectionDetail, IntegrationMessage, Issue, IssueAdditionalInfo, IssueHistory, LivingPlace, LivingPlaceToSave, MaritalStatus, Message, MetadataShipping, NewShippingAddress, Notification, NotificationAdditionalInfo, NotificationExtraData, NotificationListItem, NotificationPriority, NotificationStep, NotificationStore, NotificationUser, NotificationVendor, Objectify, OperatorInformation, Order, OrderBillProduct, OrderBillProductAdditionalInfo, OrderBillTotal, OrderCommonFields, OrderDetailShippingCost, OrderDetails, OrderPaymentMethod, OrderProduct, OrderProductAdditionalInfo, OrderProductAttributes, OrderProductBillTotal, OrderProductImage, OrderProductPriceCategory, OrderRetry, OrderRetryPaymentMethod, OrderShoppingCart, OrderStatus, OrderStep, OrderStepAdditionalInfo, OrderStepAdditionalInfoGroup, OrderStore, OrderStoreAdditionalInfo, OrderStoreDelivery, OrderUser, PEDocumentType, PYDocumentType, PaymentMethod, PaymentMethodByOrder, PaymentMethodName, PaymentProvider, PaymentStatus, Phone, PriceCategory, PriceCategoryTax, PriceCategoryType, Product, ProductAnswer, ProductAttributes, ProductCoupon, ProductDetails, ProductPrices, ProductQuestion, ProductStatus, ProductType, RandomImageConfig, ReadValue, Rule, Schedule, Service, Settings, ShippingAddress, ShippingCost, ShippingCostTax, ShoppingCart, ShoppingCartBenefits, ShoppingCartNode, ShoppingCartNodes, Status, StepCategory, StepCode, StepNotification, StepWorkflow, StepWorkflowAdditionalInfo, StepWorkflowGroup, Store, StoreCoupon, StoreCouponDetail, StoreLocation, StorePolygons, Suborder, TaxCalculation, TaxCalculations, TaxType, Token, TransitionWorkflow, URLImage, USDocumentType, UYDocumentType, UpdatedShippingAddress, User, UserCountry, UserSettings, UserType, VEDocumentType, Vendor, Wallet, WebhookWorkflow, Workflow, ZipCodeField };