@artisan-commerce/types 0.9.1 → 0.10.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/build/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./types/app.types";
2
2
  export * from "./types/account.types";
3
+ export * from "./types/artisanDB.types";
3
4
  export * from "./types/category.types";
4
5
  export * from "./types/channel.types";
5
6
  export * from "./types/common.types";
package/build/index.js CHANGED
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
13
13
  // Main
14
14
  __exportStar(require("./types/app.types"), exports);
15
15
  __exportStar(require("./types/account.types"), exports);
16
+ __exportStar(require("./types/artisanDB.types"), exports);
16
17
  __exportStar(require("./types/category.types"), exports);
17
18
  __exportStar(require("./types/channel.types"), exports);
18
19
  __exportStar(require("./types/common.types"), exports);
@@ -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,wDAAsC;AACtC,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,0DAAwC;AACxC,yDAAuC;AACvC,wDAAsC;AACtC,uDAAqC;AACrC,wDAAsC;AACtC,sDAAoC;AACpC,wDAAsC;AACtC,6DAA2C;AAC3C,6DAA2C;AAC3C,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC"}
@@ -3,14 +3,20 @@ export interface ArtisanApp {
3
3
  apiURL: string;
4
4
  __internals__: firebase.app.App;
5
5
  __instance__: typeof firebase;
6
- settings: firebase.app.App["options"];
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
  }
12
- export interface ArtisanDB extends firebase.firestore.Firestore {
13
- }
14
20
  export interface ArtisanHints {
15
21
  accountId: string | number;
16
22
  vendorId?: string | number;
@@ -19,3 +25,11 @@ export interface ArtisanHints {
19
25
  categoryId?: string | number;
20
26
  productId?: string | number;
21
27
  }
28
+ export declare type ArtisanPlatform = "web" | "ios" | "android" | "windows" | "macos" | "call center";
29
+ export interface ArtisanHeaders {
30
+ Platform: ArtisanPlatform;
31
+ account: string;
32
+ }
33
+ export interface ArtisanRestrictedHeaders extends ArtisanHeaders {
34
+ Authorization: string;
35
+ }
@@ -0,0 +1,5 @@
1
+ import firebase from "firebase";
2
+ export declare type ArtisanDB = firebase.firestore.Firestore;
3
+ export declare type ArtisanDBDocumentData = firebase.firestore.DocumentData;
4
+ export declare type ArtisanDBQueryDocumentSnapshot<T = ArtisanDBDocumentData> = firebase.firestore.QueryDocumentSnapshot<T>;
5
+ export declare type ArtisanDBCollectionReference<T = ArtisanDBDocumentData> = firebase.firestore.CollectionReference<T>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=artisanDB.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artisanDB.types.js","sourceRoot":"","sources":["../../src/types/artisanDB.types.ts"],"names":[],"mappings":""}
@@ -1,3 +1,6 @@
1
+ import { ArtisanDBCollectionReference } from "./artisanDB.types";
2
+ import { ArtisanDBQueryDocumentSnapshot } from "./artisanDB.types";
3
+ import { ArtisanDBDocumentData } from "./artisanDB.types";
1
4
  import { Image } from "./image.types";
2
5
  export interface Wallet {
3
6
  benefits: Benefit[];
@@ -16,7 +19,6 @@ export interface Benefit {
16
19
  discountPercentage: number;
17
20
  expirationDate: string;
18
21
  externalId: null;
19
- id: number;
20
22
  image: Image[];
21
23
  limitAward: null;
22
24
  limitBenefit: number;
@@ -36,3 +38,5 @@ export interface Award {
36
38
  export interface ShoppingCartBenefits {
37
39
  [key: string]: Benefit;
38
40
  }
41
+ export declare type BenefitsByUserNode = ArtisanDBQueryDocumentSnapshot<ArtisanDBDocumentData>;
42
+ export declare type BenefitsByUserNodes = ArtisanDBCollectionReference<ArtisanDBDocumentData>;
@@ -80,12 +80,13 @@ export interface ProductQuestion {
80
80
  max: number;
81
81
  type: QuestionTypes | null;
82
82
  answers: ProductAnswer[];
83
+ images: Image[] | undefined;
83
84
  }
84
85
  export declare enum QuestionTypes {
85
86
  BOOLEAN = "BOOLEAN",
86
87
  RADIO = "RADIO",
87
88
  CHECKBOX = "CHECKBOX",
88
- QUANTITY = "QUANTITY"
89
+ COUNTER = "COUNTER"
89
90
  }
90
91
  declare type CommonProductAndAnswersProps = "name" | "prices" | "attributes" | "productId" | "type" | "images";
91
92
  export interface ProductDetails extends BaseProduct {
@@ -96,6 +97,7 @@ export interface ProductDetails extends BaseProduct {
96
97
  questions: ProductQuestion[];
97
98
  }
98
99
  export interface ProductAnswer extends Pick<Product, CommonProductAndAnswersProps> {
100
+ questions: ProductDetails["questions"];
99
101
  }
100
102
  export interface CartProductQuestion extends ProductQuestion {
101
103
  answers: CartProductAnswer[];
@@ -104,6 +106,8 @@ export interface CartProductAnswer extends ProductAnswer {
104
106
  questionId: string;
105
107
  amount: number;
106
108
  priceCategory: PriceCategoryType;
109
+ comment: string;
110
+ questionsAndAnswers: CartProductQuestion[];
107
111
  }
108
112
  export interface CartProduct extends ProductDetails {
109
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["QUANTITY"] = "QUANTITY";
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":";;;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;AAYD,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACvB,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB"}
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"}
@@ -1,10 +1,12 @@
1
- import firebase from "firebase";
2
1
  import { CartProduct } from "./product.types";
3
2
  import { PriceCategoryType } from "./product.types";
4
3
  import { Objectify } from "./common.types";
5
4
  import { Store } from "./store.types";
6
5
  import { ShippingCost } from "./shippingCost.types";
7
6
  import { ShoppingCartBenefits } from "./coupons.types";
7
+ import { ArtisanDBCollectionReference } from "./artisanDB.types";
8
+ import { ArtisanDBQueryDocumentSnapshot } from "./artisanDB.types";
9
+ import { ArtisanDBDocumentData } from "./artisanDB.types";
8
10
  export interface ShoppingCart {
9
11
  id: string;
10
12
  name: string;
@@ -43,13 +45,5 @@ export interface CartTotals {
43
45
  subtotal: number;
44
46
  shippingCost: number;
45
47
  }
46
- export interface ShoppingCartTotals {
47
- subtotal: number;
48
- totalDiscounts: number;
49
- totalTaxes: number;
50
- shippingCost?: number;
51
- totalPoints: number;
52
- total: number;
53
- }
54
- export declare type ShoppingCartNode = firebase.firestore.QueryDocumentSnapshot<firebase.firestore.DocumentData>;
55
- export declare type ShoppingCartNodes = firebase.firestore.CollectionReference<firebase.firestore.DocumentData>;
48
+ export declare type ShoppingCartNode = ArtisanDBQueryDocumentSnapshot<ArtisanDBDocumentData>;
49
+ export declare type ShoppingCartNodes = ArtisanDBCollectionReference<ArtisanDBDocumentData>;
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.9.1",
4
+ "version": "0.10.2",
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": "14c4dc2fab7a68a2332f6802f6273f9eb519ddab",
48
+ "gitHead": "d0f0f06e0f9ff1815d0ea432e0f64afd9963e987",
49
49
  "dependencies": {
50
50
  "jest-extended": "^0.11.5"
51
51
  }