@artisan-commerce/types 0.13.0 → 0.14.0-canary.0

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 CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [0.14.0-canary.0](https://bitbucket.org/tradesystem/artisan_sdk/compare/@artisan-commerce/types@0.13.0...@artisan-commerce/types@0.14.0-canary.0) (2021-08-04)
7
+
8
+
9
+ ### Features
10
+
11
+ * **global:** add and export missing builders and types ([67ad6ac](https://bitbucket.org/tradesystem/artisan_sdk/commit/67ad6ac8e563aa53c2c62dac86b65f3435a0b16a))
12
+
13
+
14
+
6
15
  ## [0.13.0](https://bitbucket.org/tradesystem/artisan_sdk/compare/@artisan-commerce/types@0.13.0-canary.10...@artisan-commerce/types@0.13.0) (2021-07-30)
7
16
 
8
17
 
package/build/index.d.ts CHANGED
@@ -1,19 +1,23 @@
1
- export * from "./types/app.types";
2
1
  export * from "./types/account.types";
2
+ export * from "./types/app.types";
3
3
  export * from "./types/artisanDB.types";
4
4
  export * from "./types/banner.types";
5
5
  export * from "./types/billingData.types";
6
- export * from "./types/category.types";
7
6
  export * from "./types/catalogue.types";
7
+ export * from "./types/category.types";
8
8
  export * from "./types/common.types";
9
- export * from "./types/coupon.types";
10
9
  export * from "./types/country.types";
10
+ export * from "./types/coupon.types";
11
11
  export * from "./types/currency.types";
12
+ export * from "./types/fulfillment.types";
12
13
  export * from "./types/http.types";
13
14
  export * from "./types/image.types";
14
15
  export * from "./types/livingPlace.types";
16
+ export * from "./types/notification.types";
17
+ export * from "./types/order.types";
15
18
  export * from "./types/payment.types";
16
19
  export * from "./types/product.types";
20
+ export * from "./types/settings.types";
17
21
  export * from "./types/shippingAddress.types";
18
22
  export * from "./types/shippingCost.types";
19
23
  export * from "./types/shoppingCart.types";
package/build/index.js CHANGED
@@ -11,22 +11,26 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  // Main
14
- __exportStar(require("./types/app.types"), exports);
15
14
  __exportStar(require("./types/account.types"), exports);
15
+ __exportStar(require("./types/app.types"), exports);
16
16
  __exportStar(require("./types/artisanDB.types"), exports);
17
17
  __exportStar(require("./types/banner.types"), exports);
18
18
  __exportStar(require("./types/billingData.types"), exports);
19
- __exportStar(require("./types/category.types"), exports);
20
19
  __exportStar(require("./types/catalogue.types"), exports);
20
+ __exportStar(require("./types/category.types"), exports);
21
21
  __exportStar(require("./types/common.types"), exports);
22
- __exportStar(require("./types/coupon.types"), exports);
23
22
  __exportStar(require("./types/country.types"), exports);
23
+ __exportStar(require("./types/coupon.types"), exports);
24
24
  __exportStar(require("./types/currency.types"), exports);
25
+ __exportStar(require("./types/fulfillment.types"), exports);
25
26
  __exportStar(require("./types/http.types"), exports);
26
27
  __exportStar(require("./types/image.types"), exports);
27
28
  __exportStar(require("./types/livingPlace.types"), exports);
29
+ __exportStar(require("./types/notification.types"), exports);
30
+ __exportStar(require("./types/order.types"), exports);
28
31
  __exportStar(require("./types/payment.types"), exports);
29
32
  __exportStar(require("./types/product.types"), exports);
33
+ __exportStar(require("./types/settings.types"), exports);
30
34
  __exportStar(require("./types/shippingAddress.types"), exports);
31
35
  __exportStar(require("./types/shippingCost.types"), exports);
32
36
  __exportStar(require("./types/shoppingCart.types"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO;AACP,oDAAkC;AAClC,wDAAsC;AACtC,0DAAwC;AACxC,uDAAqC;AACrC,4DAA0C;AAC1C,yDAAuC;AACvC,0DAAwC;AACxC,uDAAqC;AACrC,uDAAqC;AACrC,wDAAsC;AACtC,yDAAuC;AACvC,qDAAmC;AACnC,sDAAoC;AACpC,4DAA0C;AAC1C,wDAAsC;AACtC,wDAAsC;AACtC,gEAA8C;AAC9C,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,wDAAsC;AACtC,oDAAkC;AAClC,0DAAwC;AACxC,uDAAqC;AACrC,4DAA0C;AAC1C,0DAAwC;AACxC,yDAAuC;AACvC,uDAAqC;AACrC,wDAAsC;AACtC,uDAAqC;AACrC,yDAAuC;AACvC,4DAA0C;AAC1C,qDAAmC;AACnC,sDAAoC;AACpC,4DAA0C;AAC1C,6DAA2C;AAC3C,sDAAoC;AACpC,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,gEAA8C;AAC9C,6DAA2C;AAC3C,6DAA2C;AAC3C,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC"}
@@ -0,0 +1,218 @@
1
+ /**
2
+ * Fulfillment workflow.
3
+ *
4
+ * @interface Workflow
5
+ * @since 0.5.15
6
+ */
7
+ export interface Workflow {
8
+ /** Workflow description */
9
+ description: string;
10
+ /** Workflow unique identifier */
11
+ id: number;
12
+ /** Workflow name */
13
+ name: string;
14
+ /** An array of workflow steps, see {@link StepWorkflow} */
15
+ steps: StepWorkflow[];
16
+ /** An array of webhook workflows, see {@link WebhookWorkflow} */
17
+ webhooks: WebhookWorkflow[];
18
+ }
19
+ /**
20
+ * The possible values of the step category.
21
+ *
22
+ * @typedef StepCategory
23
+ * @since 0.5.15
24
+ */
25
+ export declare type StepCategory = "TO_DO" | "PAYMENT_IN_PROGRESS" | "IN_PROGRESS" | "DONE";
26
+ /**
27
+ * The possible values of the step code.
28
+ *
29
+ * @typedef StepCode
30
+ * @since 0.5.15
31
+ */
32
+ export declare type StepCode = "START" | "IN_PROGRESS" | "ORDERED" | "RECEIVED" | "TO_ASSIGN" | "ASSIGNED" | "ON_ROUTE" | "DISPATCHED" | "CANCELED" | "ERROR";
33
+ /**
34
+ * The notification associated with the step.
35
+ *
36
+ * @interface StepNotification
37
+ * @since 0.5.15
38
+ */
39
+ export interface StepNotification {
40
+ /** Whether or not to send mail when reaching this step */
41
+ send_mail: boolean;
42
+ /** Whether or not to send push when reaching this step */
43
+ send_push: boolean;
44
+ }
45
+ /**
46
+ * The step where the workflow is located.
47
+ *
48
+ * @interface StepWorkflow
49
+ * @since 0.5.15
50
+ */
51
+ export interface StepWorkflow {
52
+ /** Step workflow additional info, see {@link StepWorkflowAdditionalInfo} */
53
+ additional_info: StepWorkflowAdditionalInfo;
54
+ /** Step workflow category, , see {@link StepCategory} */
55
+ category: StepCategory;
56
+ /** Step workflow code, , see {@link StepCode} */
57
+ code: StepCode;
58
+ /** Step workflow color */
59
+ color: string;
60
+ /** Step workflow description */
61
+ description: string;
62
+ /** Step workflow description to use on front end */
63
+ description_frontend: string | null;
64
+ /** Step workflow id */
65
+ id: number;
66
+ /** Step workflow name */
67
+ name: string;
68
+ /** Step workflow subtitle to use on front end */
69
+ subtitle_frontend: string | null;
70
+ /** Step workflow title to use on front end */
71
+ title_frontend: string | null;
72
+ /** Step workflow transitions, see {@link TransitionWorkflow} */
73
+ transitions: TransitionWorkflow[];
74
+ /** Step notification, see {@link StepNotification} */
75
+ notification: StepNotification;
76
+ }
77
+ /**
78
+ * Step workflow additional info.
79
+ *
80
+ * @interface StepWorkflowAdditionalInfo
81
+ * @since 0.5.15
82
+ */
83
+ export interface StepWorkflowAdditionalInfo {
84
+ /** Whether or not to use the step workflow client on front end */
85
+ client_frontend: boolean;
86
+ /** Step workflow group, see {@link StepWorkflowGroup} */
87
+ group: StepWorkflowGroup;
88
+ /** Whether or not to use the step workflow operators to use on front end */
89
+ operators_frontend: boolean;
90
+ }
91
+ /**
92
+ * Step workflow group.
93
+ *
94
+ * @interface StepWorkflowGroup
95
+ * @since 0.5.15
96
+ */
97
+ export interface StepWorkflowGroup {
98
+ /** Group code, see {@link StepCode} */
99
+ code: StepCode;
100
+ /** Group description */
101
+ description: string;
102
+ /** Group type */
103
+ type: "default";
104
+ /** Group weight */
105
+ weight: string;
106
+ }
107
+ /**
108
+ * The possible transitions of the workflow.
109
+ *
110
+ * @interface TransitionWorkflow
111
+ * @since 0.5.15
112
+ */
113
+ export interface TransitionWorkflow {
114
+ /** Channel unique identifier */
115
+ channel_id: number;
116
+ /** Transition workflow conditions */
117
+ conditions: any[];
118
+ /** Transition workflow description */
119
+ description: string;
120
+ /** The step id where the transition comes from */
121
+ from_step_id: number;
122
+ /** Transition workflow unique identifier */
123
+ id: number;
124
+ /** Transition workflow name */
125
+ name: string;
126
+ /** The step id where the transition can go */
127
+ to_step_id: number;
128
+ /** Vendor unique identifier */
129
+ vendor_id: number;
130
+ }
131
+ /**
132
+ * Workflow webhook.
133
+ *
134
+ * @interface WebhookWorkflow
135
+ * @since 0.5.15
136
+ */
137
+ export interface WebhookWorkflow {
138
+ /** Webhook workflow unique identifier */
139
+ id: number;
140
+ /** Webhook workflow method type */
141
+ method: string;
142
+ /** Webhook workflow url */
143
+ url: string;
144
+ }
145
+ /**
146
+ * Representation of a Issue object.
147
+ *
148
+ * @interface Issue
149
+ * @since 0.5.15
150
+ */
151
+ export interface IssueAdditionalInfo {
152
+ /** User unique identifier */
153
+ uid: string;
154
+ /** Array of stores id */
155
+ stores: number[];
156
+ }
157
+ /**
158
+ * Representation of a Issue history.
159
+ *
160
+ * @interface Issue
161
+ * @since 0.5.15
162
+ */
163
+ export interface IssueHistory {
164
+ /** History unique identifier */
165
+ id: number;
166
+ /** Transition unique identifier */
167
+ transition_id: number;
168
+ /** Step unique identifier */
169
+ step_id: number;
170
+ /** Step name */
171
+ step_name: string;
172
+ /** History additional info, see {@link IssueAdditionalInfo} */
173
+ additional_info: IssueAdditionalInfo;
174
+ /** History conditions */
175
+ conditions: any[];
176
+ /** History creation Date */
177
+ created_at: string;
178
+ /** History finished Date */
179
+ finished_at: string;
180
+ }
181
+ /**
182
+ * Representation of a Issue object.
183
+ *
184
+ * @interface Issue
185
+ * @since 0.5.15
186
+ */
187
+ export interface Issue {
188
+ /** Issue unique identifier */
189
+ id: number;
190
+ /** Client issue unique identifier */
191
+ client_issue_id: string;
192
+ /** Workflow unique identifier */
193
+ workflow_id: number;
194
+ /** Parent issue unique identifier */
195
+ parent_issue_id: null;
196
+ /** Related issue unique identifier */
197
+ related_issue_id: null;
198
+ /** Step unique identifier */
199
+ step_id: number;
200
+ /** The step where the issue is located */
201
+ step: StepWorkflow;
202
+ /** Account unique identifier */
203
+ account_id: number;
204
+ /** Vendor unique identifier */
205
+ vendor_id: number;
206
+ /** Children issues */
207
+ children: any[];
208
+ /** Related issues */
209
+ related: any[];
210
+ /** Issue conditions */
211
+ conditions: any[];
212
+ /** Issue additional info, see {@link IssueAdditionalInfo} */
213
+ additional_info: IssueAdditionalInfo;
214
+ /** Issue history, see {@link IssueHistory} */
215
+ history: IssueHistory[];
216
+ /** Transaction unique identifier */
217
+ transaction_id: number | null;
218
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Fulfillment types and interfaces
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=fulfillment.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fulfillment.types.js","sourceRoot":"","sources":["../../src/types/fulfillment.types.ts"],"names":[],"mappings":";AAAA,mCAAmC"}
@@ -66,3 +66,17 @@ export declare type ImageFit = "fill" | "cover" | "contain" | "inside" | "outsid
66
66
  * @since 0.5.14
67
67
  */
68
68
  export declare type ImageToFormat = "jpg" | "jpeg" | "png" | "svg";
69
+ /**
70
+ * Random image configuration.
71
+ *
72
+ * @since 0.5.15
73
+ * @interface RandomImageConfig
74
+ */
75
+ export interface RandomImageConfig {
76
+ /** A word which will be used to generate the random image */
77
+ query?: string | undefined;
78
+ /** The width to be used to generate the random image */
79
+ width?: number;
80
+ /** The height to be used to generate the random image */
81
+ height?: number;
82
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Notification object.
3
+ *
4
+ * @interface Notification
5
+ * @since 0.5.15
6
+ */
7
+ export interface Notification {
8
+ /** Notification unique identifier */
9
+ id: number;
10
+ /** Notification title */
11
+ title: string;
12
+ /** Notification description */
13
+ description: string;
14
+ /**
15
+ * Whether or not the notification was read. Purposefully
16
+ * has a string type.
17
+ */
18
+ read: string;
19
+ /** Notification creation date */
20
+ creationDate: string;
21
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // Notifications types interfaces
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=notification.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification.types.js","sourceRoot":"","sources":["../../src/types/notification.types.ts"],"names":[],"mappings":";AAAA,iCAAiC"}
@@ -0,0 +1,175 @@
1
+ import { BillTotalCategory } from "./shoppingCart.types";
2
+ import { ShippingAddress } from "./shippingAddress.types";
3
+ import { BillingData } from "./billingData.types";
4
+ /**
5
+ * Representation of common properties of the order.
6
+ *
7
+ * @interface BaseOrder
8
+ * @since 0.5.15
9
+ */
10
+ export interface BaseOrder {
11
+ /** Order unique identifier */
12
+ id: number;
13
+ /** Order additional info */
14
+ additionalInfo: any[];
15
+ /** Order additional messages */
16
+ additionalMessage: string | null;
17
+ /** Order allocation */
18
+ allocation: string;
19
+ /** Channel unique identifier */
20
+ channelId: number;
21
+ /** Order date, e.g.: `02 Aug 2021` */
22
+ orderDate: string;
23
+ /** Order time, e.g.: `17:00 am` */
24
+ orderTime: string;
25
+ /** Pick up date, e.g.: `01 Aug 2021` */
26
+ pickupDate: string | null;
27
+ /** Pick up time, e.g.: `09:00 am` */
28
+ pickupTime: string | null;
29
+ /** Order sequence id */
30
+ seq_id: string;
31
+ /** Shopping cart associated with the order, see {@link OrderShoppingCart} */
32
+ shoppingCart: OrderShoppingCart;
33
+ /** Order step, see {@link OrderStep} */
34
+ step: OrderStep;
35
+ /** Step category */
36
+ stepCategory: string;
37
+ /** Step code */
38
+ stepCode: string;
39
+ /** Step unique identifier */
40
+ stepId: number;
41
+ /** Step name */
42
+ stepName: string;
43
+ /** Order transaction unique identifier */
44
+ transactionId: number | null;
45
+ /** Vendor unique identifier */
46
+ vendorId: number;
47
+ }
48
+ /**
49
+ * The shopping cart associated with the order.
50
+ *
51
+ * @interface OrderShoppingCart
52
+ * @since 0.5.15
53
+ */
54
+ export interface OrderShoppingCart {
55
+ /** Order bill total category, see {@link BillTotalCategory} */
56
+ billTotal: BillTotalCategory;
57
+ /**
58
+ * An array of the order paid payment methods,
59
+ * see {@link OrderPaidPaymentMethod}
60
+ */
61
+ paidPaymentMethods: OrderPaidPaymentMethod[];
62
+ /** An array of order stores, see {@link OrderStore} */
63
+ stores: OrderStore[];
64
+ }
65
+ /**
66
+ * Store associated with the order.
67
+ *
68
+ * @interface OrderStore
69
+ * @since 0.5.15
70
+ */
71
+ export interface OrderStore {
72
+ /**
73
+ * An array of products associated with the order,
74
+ * see {@link OrderProduct}
75
+ */
76
+ products: OrderProduct[];
77
+ /** Store name */
78
+ storeName: string;
79
+ }
80
+ /**
81
+ * Product associated with the order.
82
+ *
83
+ * @interface OrderProduct
84
+ * @since 0.5.15
85
+ */
86
+ export interface OrderProduct {
87
+ /** Product unique identifier */
88
+ productId: number;
89
+ /** Product name */
90
+ productName: string;
91
+ }
92
+ /**
93
+ * Paid payment methods associated with the order.
94
+ *
95
+ * @interface OrderPaidPaymentMethod
96
+ * @since 0.5.15
97
+ */
98
+ export interface OrderPaidPaymentMethod {
99
+ /** Order paid payment methods */
100
+ payment_method_name: string;
101
+ /** Order last retry, see {@link OrderLastRetry} */
102
+ lastRetry: OrderLastRetry;
103
+ }
104
+ /**
105
+ * The last retry of the order.
106
+ *
107
+ * @interface OrderLastRetry
108
+ * @since 0.5.15
109
+ */
110
+ export interface OrderLastRetry {
111
+ /** Order last retry step */
112
+ step: OrderStep;
113
+ }
114
+ /**
115
+ * The step where the order is located.
116
+ *
117
+ * @interface OrderStep
118
+ * @since 0.5.15
119
+ */
120
+ export interface OrderStep {
121
+ /** Step title to use on front end */
122
+ title_frontend: string;
123
+ /** Step description to use on front end */
124
+ description_frontend: string;
125
+ }
126
+ /**
127
+ * The details of the order.
128
+ *
129
+ * @interface OrderDetails
130
+ * @since 0.5.15
131
+ * @extends {{@link BaseOrder}
132
+ */
133
+ export interface OrderDetails extends BaseOrder {
134
+ /** Order details' shipping address */
135
+ shippingAddress: ShippingAddress;
136
+ /** Order details' shipping cost, see {@link OrderDetailShippingCost} */
137
+ shippingCost: OrderDetailShippingCost;
138
+ /** Order details' billing data */
139
+ billingData: BillingData;
140
+ }
141
+ /**
142
+ * The shipping cost associated with the order.
143
+ *
144
+ * @interface OrderDetailShippingCost
145
+ * @since 0.5.15
146
+ */
147
+ export interface OrderDetailShippingCost {
148
+ /** Shipping cost net price */
149
+ net_price: number;
150
+ }
151
+ /**
152
+ * Representation of a Commerce Order.
153
+ *
154
+ * @typedef Order
155
+ * @since 0.5.15
156
+ */
157
+ export declare type Order = BaseOrder | OrderDetails;
158
+ /**
159
+ * Order payload that will be created.
160
+ *
161
+ * @interface PostOrderDetailsPayload
162
+ * @since 0.5.15
163
+ */
164
+ export interface PostOrderDetailsPayload {
165
+ /** Order unique identifier */
166
+ orderId: number;
167
+ /** Order payment method unique identifier */
168
+ paymentMethodId: number;
169
+ /** Order payment amount */
170
+ paymentAmount: string;
171
+ /** Order customer cash amount */
172
+ customerCashAmount: string;
173
+ /** Order comment */
174
+ comment: string;
175
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=order.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.types.js","sourceRoot":"","sources":["../../src/types/order.types.ts"],"names":[],"mappings":""}
@@ -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,4 @@
1
+ "use strict";
2
+ // Settings types interfaces
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=settings.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.types.js","sourceRoot":"","sources":["../../src/types/settings.types.ts"],"names":[],"mappings":";AAAA,4BAA4B"}
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.13.0",
4
+ "version": "0.14.0-canary.0",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
7
7
  "files": [
@@ -42,5 +42,5 @@
42
42
  "prettier": "^2.1.2",
43
43
  "webpack-bundle-analyzer": "^3.9.0"
44
44
  },
45
- "gitHead": "67d5892dc7a40d6ba5f1c7bbbdf6423d97899ac3"
45
+ "gitHead": "67a0e97fc13da2a0ea8fc7bc40440b4f4e6e115a"
46
46
  }