@artisan-commerce/types 0.8.0 → 0.8.5
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/types/{App.types.d.ts → app.types.d.ts} +17 -1
- package/build/types/{App.types.js → app.types.js} +0 -0
- package/build/types/{App.types.js.map → app.types.js.map} +0 -0
- package/build/types/category.types.d.ts +1 -0
- package/build/types/coupons.types.d.ts +40 -0
- package/build/types/coupons.types.js +3 -0
- package/build/types/coupons.types.js.map +1 -0
- package/build/types/product.types.d.ts +6 -1
- package/build/types/product.types.js +1 -1
- package/build/types/product.types.js.map +1 -1
- package/build/types/shoppingCart.types.d.ts +2 -9
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./types/account.types";
|
|
|
3
3
|
export * from "./types/category.types";
|
|
4
4
|
export * from "./types/channel.types";
|
|
5
5
|
export * from "./types/common.types";
|
|
6
|
+
export * from "./types/coupons.types";
|
|
6
7
|
export * from "./types/image.types";
|
|
7
8
|
export * from "./types/product.types";
|
|
8
9
|
export * from "./types/shippingCost.types";
|
package/build/index.js
CHANGED
|
@@ -16,6 +16,7 @@ __exportStar(require("./types/account.types"), exports);
|
|
|
16
16
|
__exportStar(require("./types/category.types"), exports);
|
|
17
17
|
__exportStar(require("./types/channel.types"), exports);
|
|
18
18
|
__exportStar(require("./types/common.types"), exports);
|
|
19
|
+
__exportStar(require("./types/coupons.types"), exports);
|
|
19
20
|
__exportStar(require("./types/image.types"), exports);
|
|
20
21
|
__exportStar(require("./types/product.types"), exports);
|
|
21
22
|
__exportStar(require("./types/shippingCost.types"), exports);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO;AACP,oDAAkC;AAClC,wDAAsC;AACtC,yDAAuC;AACvC,wDAAsC;AACtC,uDAAqC;AACrC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO;AACP,oDAAkC;AAClC,wDAAsC;AACtC,yDAAuC;AACvC,wDAAsC;AACtC,uDAAqC;AACrC,wDAAsC;AACtC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC"}
|
|
@@ -3,9 +3,17 @@ export interface ArtisanApp {
|
|
|
3
3
|
apiURL: string;
|
|
4
4
|
__internals__: firebase.app.App;
|
|
5
5
|
__instance__: typeof firebase;
|
|
6
|
-
settings:
|
|
6
|
+
settings: ArtisanSettings;
|
|
7
7
|
name: firebase.app.App["name"];
|
|
8
8
|
}
|
|
9
|
+
export interface ArtisanSettings {
|
|
10
|
+
projectId: string;
|
|
11
|
+
apiKey: string;
|
|
12
|
+
authDomain: string;
|
|
13
|
+
appId?: string;
|
|
14
|
+
platform?: ArtisanPlatform;
|
|
15
|
+
accountId?: number;
|
|
16
|
+
}
|
|
9
17
|
export declare type AritsanInstanceAuth = typeof firebase.auth;
|
|
10
18
|
export interface ArtisanAuth extends firebase.auth.Auth {
|
|
11
19
|
}
|
|
@@ -19,3 +27,11 @@ export interface ArtisanHints {
|
|
|
19
27
|
categoryId?: string | number;
|
|
20
28
|
productId?: string | number;
|
|
21
29
|
}
|
|
30
|
+
export declare type ArtisanPlatform = "web" | "ios" | "android";
|
|
31
|
+
export interface ArtisanHeaders {
|
|
32
|
+
Platform: ArtisanPlatform;
|
|
33
|
+
account: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ArtisanRestrictedHeaders extends ArtisanHeaders {
|
|
36
|
+
Authorization: string;
|
|
37
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import firebase from "firebase";
|
|
2
|
+
import { Image } from "./image.types";
|
|
3
|
+
export interface Wallet {
|
|
4
|
+
benefits: Benefit[];
|
|
5
|
+
usedBenefits: Benefit[];
|
|
6
|
+
unusedBenefits: Benefit[];
|
|
7
|
+
}
|
|
8
|
+
export interface Benefit {
|
|
9
|
+
hash: string;
|
|
10
|
+
award: Award[];
|
|
11
|
+
benefitId: number;
|
|
12
|
+
benefitWalletId: number;
|
|
13
|
+
code: null;
|
|
14
|
+
combined: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
description: string;
|
|
17
|
+
discountPercentage: number;
|
|
18
|
+
expirationDate: string;
|
|
19
|
+
externalId: null;
|
|
20
|
+
image: Image[];
|
|
21
|
+
limitAward: null;
|
|
22
|
+
limitBenefit: number;
|
|
23
|
+
logicOperator: string;
|
|
24
|
+
quantity: number;
|
|
25
|
+
rules: any[];
|
|
26
|
+
title: string;
|
|
27
|
+
type: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export interface Award {
|
|
31
|
+
id: number;
|
|
32
|
+
benefitId: number;
|
|
33
|
+
discountPercentage: number;
|
|
34
|
+
discountValue: null;
|
|
35
|
+
}
|
|
36
|
+
export interface ShoppingCartBenefits {
|
|
37
|
+
[key: string]: Benefit;
|
|
38
|
+
}
|
|
39
|
+
export declare type BenefitsByUserNode = firebase.firestore.QueryDocumentSnapshot<firebase.firestore.DocumentData>;
|
|
40
|
+
export declare type BenefitsByUserNodes = firebase.firestore.CollectionReference<firebase.firestore.DocumentData>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupons.types.js","sourceRoot":"","sources":["../../src/types/coupons.types.ts"],"names":[],"mappings":""}
|
|
@@ -11,6 +11,7 @@ export interface BaseProduct {
|
|
|
11
11
|
NORMAL: PriceCategory;
|
|
12
12
|
POINTS: PriceCategory;
|
|
13
13
|
};
|
|
14
|
+
hasModifiers: boolean;
|
|
14
15
|
outOfService: boolean;
|
|
15
16
|
outOfStock: boolean;
|
|
16
17
|
stock: number;
|
|
@@ -79,12 +80,13 @@ export interface ProductQuestion {
|
|
|
79
80
|
max: number;
|
|
80
81
|
type: QuestionTypes | null;
|
|
81
82
|
answers: ProductAnswer[];
|
|
83
|
+
images: Image[] | undefined;
|
|
82
84
|
}
|
|
83
85
|
export declare enum QuestionTypes {
|
|
84
86
|
BOOLEAN = "BOOLEAN",
|
|
85
87
|
RADIO = "RADIO",
|
|
86
88
|
CHECKBOX = "CHECKBOX",
|
|
87
|
-
|
|
89
|
+
COUNTER = "COUNTER"
|
|
88
90
|
}
|
|
89
91
|
declare type CommonProductAndAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images";
|
|
90
92
|
export interface ProductDetails extends BaseProduct {
|
|
@@ -95,6 +97,7 @@ export interface ProductDetails extends BaseProduct {
|
|
|
95
97
|
questions: ProductQuestion[];
|
|
96
98
|
}
|
|
97
99
|
export interface ProductAnswer extends Pick<Product, CommonProductAndAnswersProps> {
|
|
100
|
+
questions: ProductDetails["questions"];
|
|
98
101
|
}
|
|
99
102
|
export interface CartProductQuestion extends ProductQuestion {
|
|
100
103
|
answers: CartProductAnswer[];
|
|
@@ -103,6 +106,8 @@ export interface CartProductAnswer extends ProductAnswer {
|
|
|
103
106
|
questionId: string;
|
|
104
107
|
amount: number;
|
|
105
108
|
priceCategory: PriceCategoryType;
|
|
109
|
+
comment: string;
|
|
110
|
+
questionsAndAnswers: CartProductQuestion[];
|
|
106
111
|
}
|
|
107
112
|
export interface CartProduct extends ProductDetails {
|
|
108
113
|
amount: number;
|
|
@@ -30,6 +30,6 @@ var QuestionTypes;
|
|
|
30
30
|
QuestionTypes["BOOLEAN"] = "BOOLEAN";
|
|
31
31
|
QuestionTypes["RADIO"] = "RADIO";
|
|
32
32
|
QuestionTypes["CHECKBOX"] = "CHECKBOX";
|
|
33
|
-
QuestionTypes["
|
|
33
|
+
QuestionTypes["COUNTER"] = "COUNTER";
|
|
34
34
|
})(QuestionTypes = exports.QuestionTypes || (exports.QuestionTypes = {}));
|
|
35
35
|
//# sourceMappingURL=product.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"product.types.js","sourceRoot":"","sources":["../../src/types/product.types.ts"],"names":[],"mappings":";;;AAwDA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AACD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,sCAAiB,CAAA;AACnB,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AACD,IAAY,OAEX;AAFD,WAAY,OAAO;IACjB,sBAAW,CAAA;AACb,CAAC,EAFW,OAAO,GAAP,eAAO,KAAP,eAAO,QAElB;AAQD,IAAY,aAQX;AARD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;IACjB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACnB,CAAC,EARW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAQxB;AAaD,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACrB,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB"}
|
|
@@ -4,6 +4,7 @@ import { PriceCategoryType } from "./product.types";
|
|
|
4
4
|
import { Objectify } from "./common.types";
|
|
5
5
|
import { Store } from "./store.types";
|
|
6
6
|
import { ShippingCost } from "./shippingCost.types";
|
|
7
|
+
import { ShoppingCartBenefits } from "./coupons.types";
|
|
7
8
|
export interface ShoppingCart {
|
|
8
9
|
id: string;
|
|
9
10
|
name: string;
|
|
@@ -17,7 +18,7 @@ export interface ShoppingCart {
|
|
|
17
18
|
shippingCost?: ShippingCost;
|
|
18
19
|
additional_info?: Record<string, any>;
|
|
19
20
|
billTotal: BillTotal;
|
|
20
|
-
benefits?:
|
|
21
|
+
benefits?: ShoppingCartBenefits;
|
|
21
22
|
benefitHash?: string;
|
|
22
23
|
}
|
|
23
24
|
export interface Alert {
|
|
@@ -42,13 +43,5 @@ export interface CartTotals {
|
|
|
42
43
|
subtotal: number;
|
|
43
44
|
shippingCost: number;
|
|
44
45
|
}
|
|
45
|
-
export interface ShoppingCartTotals {
|
|
46
|
-
subtotal: number;
|
|
47
|
-
totalDiscounts: number;
|
|
48
|
-
totalTaxes: number;
|
|
49
|
-
shippingCost?: number;
|
|
50
|
-
totalPoints: number;
|
|
51
|
-
total: number;
|
|
52
|
-
}
|
|
53
46
|
export declare type ShoppingCartNode = firebase.firestore.QueryDocumentSnapshot<firebase.firestore.DocumentData>;
|
|
54
47
|
export declare type ShoppingCartNodes = firebase.firestore.CollectionReference<firebase.firestore.DocumentData>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artisan-commerce/types",
|
|
3
3
|
"description": "Artisan's types and interfaces library",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.5",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"typescript": "^3.9.7",
|
|
46
46
|
"webpack-bundle-analyzer": "^3.9.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "456809f724dd424f6e707d896359f279fc6f4b06",
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"jest-extended": "^0.11.5"
|
|
51
51
|
}
|