@artisan-commerce/types 0.14.0-canary.18 → 0.14.0-canary.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -140
- package/build/index.d.ts +26 -0
- package/build/index.js +40 -0
- package/build/index.js.map +1 -0
- package/build/types/account.types.d.ts +17 -0
- package/build/types/account.types.js +4 -0
- package/build/types/account.types.js.map +1 -0
- package/build/types/app.types.d.ts +153 -0
- package/build/types/app.types.js +4 -0
- package/build/types/app.types.js.map +1 -0
- package/build/types/artisnDB.types.d.ts +29 -0
- package/build/types/artisnDB.types.js +4 -0
- package/build/types/artisnDB.types.js.map +1 -0
- package/build/types/banner.types.d.ts +97 -0
- package/build/types/banner.types.js +4 -0
- package/build/types/banner.types.js.map +1 -0
- package/build/types/billingData.types.d.ts +39 -0
- package/build/types/billingData.types.js +4 -0
- package/build/types/billingData.types.js.map +1 -0
- package/build/types/catalogue.types.d.ts +16 -0
- package/build/types/catalogue.types.js +4 -0
- package/build/types/catalogue.types.js.map +1 -0
- package/build/types/category.types.d.ts +33 -0
- package/build/types/category.types.js +4 -0
- package/build/types/category.types.js.map +1 -0
- package/build/types/common.types.d.ts +36 -0
- package/build/types/common.types.js +4 -0
- package/build/types/common.types.js.map +1 -0
- package/build/types/country.types.d.ts +51 -0
- package/build/types/country.types.js +4 -0
- package/build/types/country.types.js.map +1 -0
- package/build/types/coupon.types.d.ts +112 -0
- package/build/types/coupon.types.js +4 -0
- package/build/types/coupon.types.js.map +1 -0
- package/build/types/currency.types.d.ts +7 -0
- package/build/types/currency.types.js +4 -0
- package/build/types/currency.types.js.map +1 -0
- package/build/types/fulfillment.types.d.ts +218 -0
- package/build/types/fulfillment.types.js +4 -0
- package/build/types/fulfillment.types.js.map +1 -0
- package/build/types/http.types.d.ts +64 -0
- package/build/types/http.types.js +4 -0
- package/build/types/http.types.js.map +1 -0
- package/build/types/image.types.d.ts +82 -0
- package/build/types/image.types.js +4 -0
- package/build/types/image.types.js.map +1 -0
- package/build/types/livingPlace.types.d.ts +92 -0
- package/build/types/livingPlace.types.js +4 -0
- package/build/types/livingPlace.types.js.map +1 -0
- package/build/types/notification.types.d.ts +21 -0
- package/build/types/notification.types.js +4 -0
- package/build/types/notification.types.js.map +1 -0
- package/build/types/order.types.d.ts +157 -0
- package/build/types/order.types.js +3 -0
- package/build/types/order.types.js.map +1 -0
- package/build/types/payment.types.d.ts +97 -0
- package/build/types/payment.types.js +4 -0
- package/build/types/payment.types.js.map +1 -0
- package/build/types/product.types.d.ts +299 -0
- package/build/types/product.types.js +4 -0
- package/build/types/product.types.js.map +1 -0
- package/build/types/settings.types.d.ts +23 -0
- package/build/types/settings.types.js +4 -0
- package/build/types/settings.types.js.map +1 -0
- package/build/types/shippingAddress.types.d.ts +73 -0
- package/build/types/shippingAddress.types.js +4 -0
- package/build/types/shippingAddress.types.js.map +1 -0
- package/build/types/shippingCost.types.d.ts +54 -0
- package/build/types/shippingCost.types.js +4 -0
- package/build/types/shippingCost.types.js.map +1 -0
- package/build/types/shoppingCart.types.d.ts +124 -0
- package/build/types/shoppingCart.types.js +4 -0
- package/build/types/shoppingCart.types.js.map +1 -0
- package/build/types/store.types.d.ts +198 -0
- package/build/types/store.types.js +4 -0
- package/build/types/store.types.js.map +1 -0
- package/build/types/user.types.d.ts +114 -0
- package/build/types/user.types.js +4 -0
- package/build/types/user.types.js.map +1 -0
- package/build/types/vendor.types.d.ts +23 -0
- package/build/types/vendor.types.js +3 -0
- package/build/types/vendor.types.js.map +1 -0
- package/build/vendors.d.ts +1 -0
- package/build/vendors.js +4 -0
- package/build/vendors.js.map +1 -0
- package/package.json +10 -19
- package/dist/bundle.d.ts +0 -2776
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":";AAAA,mDAAmD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User preferences.
|
|
3
|
+
*
|
|
4
|
+
* @interface UserSettings
|
|
5
|
+
* @since 0.5.15
|
|
6
|
+
*/
|
|
7
|
+
export interface UserSettings {
|
|
8
|
+
/** Individual settings, see {@link Settings} */
|
|
9
|
+
settings: Settings;
|
|
10
|
+
/** User unique identifier */
|
|
11
|
+
uid: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Individual user settings.
|
|
15
|
+
*
|
|
16
|
+
* @typedef Settings
|
|
17
|
+
* @since 0.5.15
|
|
18
|
+
* @property {boolean} `[key: string]` An object where its key is a string
|
|
19
|
+
* and its value is a boolean
|
|
20
|
+
*/
|
|
21
|
+
export declare type Settings = {
|
|
22
|
+
[key: string]: boolean;
|
|
23
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.types.js","sourceRoot":"","sources":["../../src/types/settings.types.ts"],"names":[],"mappings":";AAAA,4BAA4B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CountrySummary } from "./common.types";
|
|
2
|
+
import { LivingPlace, LivingPlaceToSave } from "./livingPlace.types";
|
|
3
|
+
/**
|
|
4
|
+
* Representation of a basic Shipping Address.
|
|
5
|
+
*
|
|
6
|
+
* @interface BaseShippingAddress
|
|
7
|
+
* @since 0.5.14
|
|
8
|
+
*/
|
|
9
|
+
export interface BaseShippingAddress {
|
|
10
|
+
/** Whether or not the shipping address is default */
|
|
11
|
+
default: boolean;
|
|
12
|
+
/** Shipping address' latitude */
|
|
13
|
+
lat: number;
|
|
14
|
+
/** Shipping address' longitude */
|
|
15
|
+
lng: number;
|
|
16
|
+
/** Shipping address' reference */
|
|
17
|
+
reference: string;
|
|
18
|
+
/** Shipping address' main street */
|
|
19
|
+
mainStreet: string;
|
|
20
|
+
/** Shipping address' living place number */
|
|
21
|
+
number: string;
|
|
22
|
+
/** Shipping address' secondary street */
|
|
23
|
+
secondaryStreet: string;
|
|
24
|
+
/** Shipping address' reference */
|
|
25
|
+
addressReference: string;
|
|
26
|
+
/** It contains country id and country name, see {@link CountrySummary} */
|
|
27
|
+
country: CountrySummary;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Representation of a Commerce Shipping Address.
|
|
31
|
+
*
|
|
32
|
+
* @interface ShippingAddress
|
|
33
|
+
* @since 0.5.14
|
|
34
|
+
* @extends {{@link BaseShippingAddress}
|
|
35
|
+
*/
|
|
36
|
+
export interface ShippingAddress extends BaseShippingAddress {
|
|
37
|
+
/** Shipping address unique identifier */
|
|
38
|
+
id: number;
|
|
39
|
+
/** Object which contains the living place, see {@link LivingPlace} */
|
|
40
|
+
livingPlace: LivingPlace;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* A shipping address object used when it needs to be created.
|
|
44
|
+
*
|
|
45
|
+
* @interface NewShippingAddress
|
|
46
|
+
* @since 0.5.14
|
|
47
|
+
* @extends {{@link BaseShippingAddress}
|
|
48
|
+
*/
|
|
49
|
+
export interface NewShippingAddress extends BaseShippingAddress {
|
|
50
|
+
/** Shipping address unique identifier */
|
|
51
|
+
id?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Object which contains the living place to save,
|
|
54
|
+
* see {@link LivingPlaceToSave}
|
|
55
|
+
*/
|
|
56
|
+
livingPlace: LivingPlaceToSave;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A shipping address object used when it needs to be updated.
|
|
60
|
+
*
|
|
61
|
+
* @interface UpdatedShippingAddress
|
|
62
|
+
* @since 0.5.14
|
|
63
|
+
* @extends {{@link BaseShippingAddress}
|
|
64
|
+
*/
|
|
65
|
+
export interface UpdatedShippingAddress extends BaseShippingAddress {
|
|
66
|
+
/** Shipping address unique identifier */
|
|
67
|
+
id: number;
|
|
68
|
+
/**
|
|
69
|
+
* Object which contains the living place to update,
|
|
70
|
+
* see {@link LivingPlaceToSave}
|
|
71
|
+
*/
|
|
72
|
+
livingPlace: LivingPlaceToSave;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shippingAddress.types.js","sourceRoot":"","sources":["../../src/types/shippingAddress.types.ts"],"names":[],"mappings":";AAAA,wCAAwC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Representation of a Commerce Shipping Cost.
|
|
3
|
+
*
|
|
4
|
+
* @interface ShippingCost
|
|
5
|
+
* @since 0.5.14
|
|
6
|
+
*/
|
|
7
|
+
export interface ShippingCost {
|
|
8
|
+
/** Shipping cost product's id */
|
|
9
|
+
productId: number;
|
|
10
|
+
/** Shipping cost's name */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Shipping cost's amount */
|
|
13
|
+
amount: number;
|
|
14
|
+
/** Currency's symbol */
|
|
15
|
+
symbol: string;
|
|
16
|
+
/** Array of shipping cost's taxes, see {@link ShippingCostTax} */
|
|
17
|
+
taxes: ShippingCostTax[];
|
|
18
|
+
/** Shipping cost's price without taxes */
|
|
19
|
+
grossPrice: number;
|
|
20
|
+
/** Shipping cost's price */
|
|
21
|
+
netPrice: number;
|
|
22
|
+
/** Shipping cost's subtotal without taxes */
|
|
23
|
+
subtotalBeforeTaxes: number;
|
|
24
|
+
/** Shipping cost's tax total */
|
|
25
|
+
taxTotal: number;
|
|
26
|
+
/** Shipping cost's discount */
|
|
27
|
+
discounts: any[];
|
|
28
|
+
/** Shipping cost's discount total amount */
|
|
29
|
+
discountTotal: number;
|
|
30
|
+
/** Shipping cost's total */
|
|
31
|
+
total: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Representation of a shipping cost tax.
|
|
35
|
+
*
|
|
36
|
+
* @interface ShippingCostTax
|
|
37
|
+
* @since 0.5.14
|
|
38
|
+
*/
|
|
39
|
+
export interface ShippingCostTax {
|
|
40
|
+
/** Tax percentage to be applied */
|
|
41
|
+
percentage: number;
|
|
42
|
+
/** Tax name */
|
|
43
|
+
name: string;
|
|
44
|
+
/** Value added tax rate code */
|
|
45
|
+
vatRateCode: number;
|
|
46
|
+
/** Tax code */
|
|
47
|
+
code: number;
|
|
48
|
+
/** Value added tax rate */
|
|
49
|
+
vatRate: string;
|
|
50
|
+
/** Tax base value */
|
|
51
|
+
taxBase: number;
|
|
52
|
+
/** Tax value */
|
|
53
|
+
value: string;
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shippingCost.types.js","sourceRoot":"","sources":["../../src/types/shippingCost.types.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Store } from "./store.types";
|
|
2
|
+
import { Objectify } from "./common.types";
|
|
3
|
+
import { CartProduct } from "./product.types";
|
|
4
|
+
import { PriceCategoryType } from "./product.types";
|
|
5
|
+
import { ShippingCost } from "./shippingCost.types";
|
|
6
|
+
import { ShoppingCartBenefits } from "./coupon.types";
|
|
7
|
+
import { ArtisnDBDocumentData } from "./artisnDB.types";
|
|
8
|
+
import { ArtisnDBCollectionReference } from "./artisnDB.types";
|
|
9
|
+
import { ArtisnDBQueryDocumentSnapshot } from "./artisnDB.types";
|
|
10
|
+
/**
|
|
11
|
+
* Representation of a Commerce Shopping Cart.
|
|
12
|
+
*
|
|
13
|
+
* @interface ShoppingCart
|
|
14
|
+
* @since 0.5.14
|
|
15
|
+
*/
|
|
16
|
+
export interface ShoppingCart {
|
|
17
|
+
/** Shopping cart unique identifier */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Shopping cart name */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Shopping cart latitude */
|
|
22
|
+
latitude: number;
|
|
23
|
+
/** Shopping cart longitude */
|
|
24
|
+
longitude: number;
|
|
25
|
+
/** Shopping cart price category, see {@link PriceCategoryType}*/
|
|
26
|
+
priceCategory?: PriceCategoryType;
|
|
27
|
+
/** Shopping cart creation date */
|
|
28
|
+
createdAt: string;
|
|
29
|
+
/** Shopping cart update date */
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
/** Shopping cart channel unique identifier */
|
|
32
|
+
channelId: number;
|
|
33
|
+
/** Shopping cart stores, see Objectify<{@link CartStore}> */
|
|
34
|
+
stores: Objectify<CartStore>;
|
|
35
|
+
/** Shopping cart shipping cost */
|
|
36
|
+
shippingCost: ShippingCost | null;
|
|
37
|
+
/** Shopping cart additional info */
|
|
38
|
+
additional_info?: Record<string, any>;
|
|
39
|
+
/** Shopping cart bill total */
|
|
40
|
+
billTotal: BillTotal;
|
|
41
|
+
/** Shopping cart applied benefits */
|
|
42
|
+
benefits?: ShoppingCartBenefits;
|
|
43
|
+
/** Shopping cart user wallet id */
|
|
44
|
+
benefitsHash?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Representation of a Alert.
|
|
48
|
+
*
|
|
49
|
+
* @interface Alert
|
|
50
|
+
* @since 0.5.14
|
|
51
|
+
*/
|
|
52
|
+
export interface Alert {
|
|
53
|
+
/** Alert error level */
|
|
54
|
+
errorLevel: number;
|
|
55
|
+
/** Alert message */
|
|
56
|
+
message: string;
|
|
57
|
+
/** Alert type */
|
|
58
|
+
type: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Representation of a Cart Store.
|
|
62
|
+
*
|
|
63
|
+
* @interface CartStore
|
|
64
|
+
* @since 0.5.14
|
|
65
|
+
* @extends {{@link Store}
|
|
66
|
+
*/
|
|
67
|
+
export interface CartStore extends Store {
|
|
68
|
+
/** The products that belong to the store, see {@link CartProduct} */
|
|
69
|
+
products: Objectify<CartProduct>;
|
|
70
|
+
/** Cart store's alerts */
|
|
71
|
+
alerts: [];
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The possible values of a Bill Total.
|
|
75
|
+
*
|
|
76
|
+
* @typedef BillTotal
|
|
77
|
+
* @since 0.5.14
|
|
78
|
+
*/
|
|
79
|
+
export declare type BillTotal = {
|
|
80
|
+
/** Normal bill total category */
|
|
81
|
+
NORMAL?: BillTotalCategory;
|
|
82
|
+
/** Points bill total category */
|
|
83
|
+
POINTS?: BillTotalCategory;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Representation of a Bill Total Category.
|
|
87
|
+
*
|
|
88
|
+
* @interface BillTotalCategory
|
|
89
|
+
* @since 0.5.14
|
|
90
|
+
*/
|
|
91
|
+
export interface BillTotalCategory {
|
|
92
|
+
/** Bill total category subtotal without taxes */
|
|
93
|
+
subtotalBeforeTaxes: number;
|
|
94
|
+
/** Bill total category total taxes */
|
|
95
|
+
taxTotal: number;
|
|
96
|
+
/** Bill total category total */
|
|
97
|
+
total: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Representation of a Cart Totals.
|
|
101
|
+
*
|
|
102
|
+
* @interface CartTotals
|
|
103
|
+
* @since 0.5.14
|
|
104
|
+
*/
|
|
105
|
+
export interface CartTotals {
|
|
106
|
+
/** Cart totals subtotal */
|
|
107
|
+
subtotal: number;
|
|
108
|
+
/** Cart totals shipping cost */
|
|
109
|
+
shippingCost: number;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* A shopping cart DB node from a user.
|
|
113
|
+
*
|
|
114
|
+
* @typedef ShoppingCartNode
|
|
115
|
+
* @since 0.5.14
|
|
116
|
+
*/
|
|
117
|
+
export declare type ShoppingCartNode = ArtisnDBQueryDocumentSnapshot<ArtisnDBDocumentData>;
|
|
118
|
+
/**
|
|
119
|
+
* The complete collection of shopping carts DB nodes from a user.
|
|
120
|
+
*
|
|
121
|
+
* @typedef ShoppingCartNodes
|
|
122
|
+
* @since 0.5.14
|
|
123
|
+
*/
|
|
124
|
+
export declare type ShoppingCartNodes = ArtisnDBCollectionReference<ArtisnDBDocumentData>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shoppingCart.types.js","sourceRoot":"","sources":["../../src/types/shoppingCart.types.ts"],"names":[],"mappings":";AAAA,oCAAoC"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { CDNImage } from "./image.types";
|
|
2
|
+
import { Vendor } from "./vendor.types";
|
|
3
|
+
import { Catalogue } from "./catalogue.types";
|
|
4
|
+
import { BaseWeekDay } from "./common.types";
|
|
5
|
+
/**
|
|
6
|
+
* Representation of a Commerce Store.
|
|
7
|
+
*
|
|
8
|
+
* @interface Store
|
|
9
|
+
* @since 0.5.14
|
|
10
|
+
*/
|
|
11
|
+
export interface Store {
|
|
12
|
+
/** Store unique identifier */
|
|
13
|
+
storeId: number;
|
|
14
|
+
/** Store name */
|
|
15
|
+
storeName: string;
|
|
16
|
+
/** Store address */
|
|
17
|
+
address: string;
|
|
18
|
+
/** The vendor associated with the store, see {@link Vendor} */
|
|
19
|
+
vendor: Vendor;
|
|
20
|
+
/**
|
|
21
|
+
* Additional store information, see
|
|
22
|
+
* {@link AdditionalStoreInformation} for further information
|
|
23
|
+
*/
|
|
24
|
+
additionalInfo: AdditionalStoreInformation;
|
|
25
|
+
/** Whether or not the store is within coverage */
|
|
26
|
+
coverage: boolean;
|
|
27
|
+
/** Store cover url */
|
|
28
|
+
coverUrl: string;
|
|
29
|
+
/** Store delivery detailed information */
|
|
30
|
+
delivery: Delivery;
|
|
31
|
+
/** Store description */
|
|
32
|
+
description: string | null;
|
|
33
|
+
/** Whether or not the store is open */
|
|
34
|
+
isOpen: boolean;
|
|
35
|
+
/** Order maximum amount allowed */
|
|
36
|
+
maxOrderAmount: number;
|
|
37
|
+
/** Order minimum amount allowed */
|
|
38
|
+
minOrderAmount: number;
|
|
39
|
+
/** Order currency's symbol */
|
|
40
|
+
orderSymbol: string;
|
|
41
|
+
/** Store phone */
|
|
42
|
+
phone: string;
|
|
43
|
+
/** Whether or not the store is sponsored */
|
|
44
|
+
sponsored: boolean;
|
|
45
|
+
/** Store latitude */
|
|
46
|
+
latitude: number;
|
|
47
|
+
/** Store longitude */
|
|
48
|
+
longitude: number;
|
|
49
|
+
/** Store schedules, see {@link Schedule} for further information */
|
|
50
|
+
schedules: Schedule[];
|
|
51
|
+
/** Store timezone */
|
|
52
|
+
timezone: string;
|
|
53
|
+
/** Store available services, see {@link Service} */
|
|
54
|
+
services: Service[];
|
|
55
|
+
/** Estimated store cook time */
|
|
56
|
+
cookTime: string;
|
|
57
|
+
/**
|
|
58
|
+
* Generic store location in regards to the city,
|
|
59
|
+
* see {@link GenericStoreLocation}
|
|
60
|
+
*/
|
|
61
|
+
city: GenericStoreLocation;
|
|
62
|
+
/** Whether or not the store is out of service */
|
|
63
|
+
outOfService: boolean;
|
|
64
|
+
/** Whether or not the store is default */
|
|
65
|
+
isDefault: boolean;
|
|
66
|
+
/** Whether or not the store is active */
|
|
67
|
+
active: boolean;
|
|
68
|
+
/** The value of the allowed minimum order */
|
|
69
|
+
minOrder: number;
|
|
70
|
+
/** Minimum order currency's symbol */
|
|
71
|
+
minOrderSymbol: string;
|
|
72
|
+
/**
|
|
73
|
+
* Generic store location in regards to the country,
|
|
74
|
+
* see {@link GenericStoreLocation} for further information
|
|
75
|
+
*/
|
|
76
|
+
country: GenericStoreLocation;
|
|
77
|
+
/** Store location, see {@link StoreLocation} for further information */
|
|
78
|
+
location: StoreLocation;
|
|
79
|
+
/** Array of catalogues, see {@link Catalogue} */
|
|
80
|
+
catalogues: Catalogue[];
|
|
81
|
+
/** Array of store images, see {@link CDNImage}*/
|
|
82
|
+
images: CDNImage[];
|
|
83
|
+
/** The distance between the user and the store, roughly in metres */
|
|
84
|
+
distance: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Store location.
|
|
88
|
+
*
|
|
89
|
+
* @interface StoreLocation
|
|
90
|
+
* @since 0.5.14
|
|
91
|
+
*/
|
|
92
|
+
export interface StoreLocation {
|
|
93
|
+
/** Store location latitude */
|
|
94
|
+
lat: number;
|
|
95
|
+
/** Store location longitude */
|
|
96
|
+
lon: number;
|
|
97
|
+
/** The geo hash associated with the store */
|
|
98
|
+
geohash: string;
|
|
99
|
+
/** Whether or not the store is a fragment */
|
|
100
|
+
fragment: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Store generic location.
|
|
104
|
+
*
|
|
105
|
+
* @interface GenericStoreLocation
|
|
106
|
+
* @since 0.5.14
|
|
107
|
+
*/
|
|
108
|
+
export interface GenericStoreLocation {
|
|
109
|
+
/** Generic store location unique identifier */
|
|
110
|
+
id: string;
|
|
111
|
+
/** Generic store location name */
|
|
112
|
+
name: string;
|
|
113
|
+
/** Whether or not the generic store location is active */
|
|
114
|
+
active: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Additional store information.
|
|
118
|
+
*
|
|
119
|
+
* @interface AdditionalStoreInformation
|
|
120
|
+
* @since 0.5.14
|
|
121
|
+
*/
|
|
122
|
+
export interface AdditionalStoreInformation {
|
|
123
|
+
/** Store external id */
|
|
124
|
+
externalId: string;
|
|
125
|
+
/** Store external code */
|
|
126
|
+
externalCode: string;
|
|
127
|
+
/** Delivery unique identifier */
|
|
128
|
+
idDeliveryKfc: string;
|
|
129
|
+
/** Whether or not the store has a drinks store */
|
|
130
|
+
isDrinksStore: boolean;
|
|
131
|
+
/** Whether or not to show the drinks store */
|
|
132
|
+
showDrinksStore: boolean;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Store delivery modality information.
|
|
136
|
+
*
|
|
137
|
+
* @interface Delivery
|
|
138
|
+
* @since 0.5.14
|
|
139
|
+
*/
|
|
140
|
+
export interface Delivery {
|
|
141
|
+
/** Time unit for delivery, see {@link DeliveryTimeUnit} */
|
|
142
|
+
deliveryTimeUnit: DeliveryTimeUnit;
|
|
143
|
+
/** Time value for delivery as string */
|
|
144
|
+
deliveryTimeValue: string;
|
|
145
|
+
/** Whether or not the store has a express delivery */
|
|
146
|
+
express: boolean;
|
|
147
|
+
/** Whether or not the store has free delivery */
|
|
148
|
+
freeDelivery: boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Store schedules.
|
|
152
|
+
*
|
|
153
|
+
* @interface Schedule
|
|
154
|
+
* @since 0.5.14
|
|
155
|
+
*/
|
|
156
|
+
export interface Schedule {
|
|
157
|
+
/** Week day in uppercase, see {@link Days} */
|
|
158
|
+
day: Days;
|
|
159
|
+
/**
|
|
160
|
+
* `Date` value representing the start time in which
|
|
161
|
+
* the product is available
|
|
162
|
+
*/
|
|
163
|
+
from: number;
|
|
164
|
+
/** `Date` value representing the end time in which
|
|
165
|
+
* the product is available
|
|
166
|
+
*/
|
|
167
|
+
to: number;
|
|
168
|
+
/** Store catalogue unique identifier */
|
|
169
|
+
catalogueId: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The services available on the store.
|
|
173
|
+
*
|
|
174
|
+
* @interface Service
|
|
175
|
+
* @since 0.5.14
|
|
176
|
+
*/
|
|
177
|
+
export interface Service {
|
|
178
|
+
/** Service name */
|
|
179
|
+
name: string;
|
|
180
|
+
/** Whether or not the service is active on the store */
|
|
181
|
+
active: boolean;
|
|
182
|
+
/** Service image url */
|
|
183
|
+
url: string;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Time unit for delivery.
|
|
187
|
+
*
|
|
188
|
+
* @typedef DeliveryTimeUnit
|
|
189
|
+
* @since 0.5.14
|
|
190
|
+
*/
|
|
191
|
+
export declare type DeliveryTimeUnit = "min";
|
|
192
|
+
/**
|
|
193
|
+
* Allowed days for schedules.
|
|
194
|
+
*
|
|
195
|
+
* @typedef Days
|
|
196
|
+
* @since 0.5.14
|
|
197
|
+
*/
|
|
198
|
+
export declare type Days = BaseWeekDay | "SPECIAL";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.types.js","sourceRoot":"","sources":["../../src/types/store.types.ts"],"names":[],"mappings":";AAAA,6BAA6B"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { DocumentType } from "./common.types";
|
|
2
|
+
/**
|
|
3
|
+
* Representation of a Commerce User.
|
|
4
|
+
*
|
|
5
|
+
* @interface BaseUser
|
|
6
|
+
* @since 0.5.14
|
|
7
|
+
*/
|
|
8
|
+
export interface BaseUser {
|
|
9
|
+
/** User's unique identifier */
|
|
10
|
+
uid: string;
|
|
11
|
+
/** User's first name */
|
|
12
|
+
name: string;
|
|
13
|
+
/** User's middle name */
|
|
14
|
+
middleName?: string;
|
|
15
|
+
/** User's last name */
|
|
16
|
+
lastname: string;
|
|
17
|
+
/** User's second surname */
|
|
18
|
+
secondLastname?: string;
|
|
19
|
+
/** User's email */
|
|
20
|
+
email: string;
|
|
21
|
+
/** User's birthdate, e.g: 1991-05-02 */
|
|
22
|
+
birthdate?: string;
|
|
23
|
+
/** The vendor which the user was created */
|
|
24
|
+
vendorId?: number;
|
|
25
|
+
/** The platform where the user was generated */
|
|
26
|
+
origin?: string;
|
|
27
|
+
/** User's document */
|
|
28
|
+
document?: string;
|
|
29
|
+
/**User's document type, see {@link DocumentType} */
|
|
30
|
+
documentType?: DocumentType;
|
|
31
|
+
/** User's gender, see {@link Gender} */
|
|
32
|
+
gender?: Gender;
|
|
33
|
+
/** User's country object, see {@link UserCountry} */
|
|
34
|
+
country: UserCountry;
|
|
35
|
+
/** User's phone detailed information, see {@link Phone} */
|
|
36
|
+
phone?: Phone;
|
|
37
|
+
/** User's type, see {@link UserType} */
|
|
38
|
+
type?: UserType;
|
|
39
|
+
/** User's externalId */
|
|
40
|
+
externalId?: string;
|
|
41
|
+
/** User's marital status, see {@link MaritalStatus} */
|
|
42
|
+
maritalStatus?: MaritalStatus;
|
|
43
|
+
/** Whether or not the user is active */
|
|
44
|
+
active?: boolean;
|
|
45
|
+
/** User's additional info, see {@link AdditionalInfo} */
|
|
46
|
+
additionalInfo?: AdditionalInfo;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Representation of a user saved on a database.
|
|
50
|
+
*
|
|
51
|
+
* @interface User
|
|
52
|
+
* @since 0.5.14
|
|
53
|
+
* @extends {{@link BaseUser}
|
|
54
|
+
*/
|
|
55
|
+
export interface User extends BaseUser {
|
|
56
|
+
/** User's auto generated id */
|
|
57
|
+
idInt: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The possible values for the user's type.
|
|
61
|
+
*
|
|
62
|
+
* @typedef UserType
|
|
63
|
+
* @since 0.5.14
|
|
64
|
+
*/
|
|
65
|
+
export declare type UserType = "NORMAL" | "DEPENDENT";
|
|
66
|
+
/**
|
|
67
|
+
* Representation of a phone.
|
|
68
|
+
*
|
|
69
|
+
* @interface UserCountry
|
|
70
|
+
* @since 0.5.14
|
|
71
|
+
*/
|
|
72
|
+
export interface UserCountry {
|
|
73
|
+
/** User's country id */
|
|
74
|
+
id: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Representation of the user's additional info,
|
|
78
|
+
* commonly used to save user's images urls.
|
|
79
|
+
*
|
|
80
|
+
* @interface AdditionalInfo
|
|
81
|
+
* @since 0.5.14
|
|
82
|
+
* @property {any} `[key: string]` Property with key value pairs
|
|
83
|
+
*/
|
|
84
|
+
export interface AdditionalInfo {
|
|
85
|
+
[key: string]: any;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Representation of a phone.
|
|
89
|
+
*
|
|
90
|
+
* @interface Phone
|
|
91
|
+
* @since 0.5.14
|
|
92
|
+
*/
|
|
93
|
+
export interface Phone {
|
|
94
|
+
/** User's phone number */
|
|
95
|
+
number: string;
|
|
96
|
+
/** User's country calling code, e.g.: +593 */
|
|
97
|
+
countryCode: string;
|
|
98
|
+
/** User's country ISO code, e.g.: EC */
|
|
99
|
+
countryIsoCode: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The possible values for the user's marital status.
|
|
103
|
+
*
|
|
104
|
+
* @typedef MaritalStatus
|
|
105
|
+
* @since 0.5.14
|
|
106
|
+
*/
|
|
107
|
+
export declare type MaritalStatus = "MARRIED" | "DIVORCED" | "SINGLE";
|
|
108
|
+
/**
|
|
109
|
+
* The possible values for the user's gender.
|
|
110
|
+
*
|
|
111
|
+
* @typedef Gender
|
|
112
|
+
* @since 0.5.14
|
|
113
|
+
*/
|
|
114
|
+
export declare type Gender = "MALE" | "FEMALE";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.types.js","sourceRoot":"","sources":["../../src/types/user.types.ts"],"names":[],"mappings":";AAAA,4BAA4B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CDNImage } from "./image.types";
|
|
2
|
+
/**
|
|
3
|
+
* Representation of a Commerce Vendor.
|
|
4
|
+
*
|
|
5
|
+
* @interface Vendor
|
|
6
|
+
* @since 0.5.14
|
|
7
|
+
*/
|
|
8
|
+
export interface Vendor {
|
|
9
|
+
/** Artisn's vendor unique identifier */
|
|
10
|
+
id: number;
|
|
11
|
+
/** Vendor's images, see {@link CDNImage} */
|
|
12
|
+
images: CDNImage[];
|
|
13
|
+
/** Vendor's name */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Vendor's maximum purchase value */
|
|
16
|
+
maxPurchaseValue: number;
|
|
17
|
+
/** Vendor's description */
|
|
18
|
+
description: string;
|
|
19
|
+
/** Whether or not the vendor is sponsored */
|
|
20
|
+
sponsored: boolean;
|
|
21
|
+
/** Whether or not the vendor is active */
|
|
22
|
+
active: boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendor.types.js","sourceRoot":"","sources":["../../src/types/vendor.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|