@artisan-commerce/products 0.9.0-canary.38 → 0.9.0-canary.4

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 (70) hide show
  1. package/CHANGELOG.md +0 -278
  2. package/build/config/constants.d.ts +12 -0
  3. package/build/errors/api.errors.d.ts +7 -0
  4. package/build/index.d.ts +17 -0
  5. package/build/lib/getCategories/getCategories.d.ts +1 -0
  6. package/build/lib/getCategories/getCategories.test.d.ts +1 -0
  7. package/build/lib/getProductDetails/getProductDetails.d.ts +10 -0
  8. package/build/lib/getProductDetails/getProductDetails.test.d.ts +1 -0
  9. package/build/lib/getProductDetails/getProductDetails.types.d.ts +7 -0
  10. package/build/lib/getProducts/getProducts.d.ts +11 -0
  11. package/build/lib/getProducts/getProducts.test.d.ts +1 -0
  12. package/build/lib/getProducts/getProducts.types.d.ts +3 -0
  13. package/build/lib/getRecommendedProducts/getRecommendedProducts.d.ts +1 -0
  14. package/build/lib/getRecommendedProducts/getRecommendedProducts.test.d.ts +1 -0
  15. package/build/lib/getRelatedProducts/getRelatedProducts.d.ts +1 -0
  16. package/build/lib/getRelatedProducts/getRelatedProducts.test.d.ts +1 -0
  17. package/build/lib/getStoreDetails/getStoreDetails.d.ts +16 -0
  18. package/build/lib/getStoreDetails/getStoreDetails.test.d.ts +1 -0
  19. package/build/lib/getStoreDetails/getStoreDetails.types.d.ts +7 -0
  20. package/build/lib/initProducts/initProducts.d.ts +14 -0
  21. package/build/lib/registerModifiersForm/registerModifiersForm.d.ts +21 -0
  22. package/build/lib/registerModifiersForm/registerModifiersForm.test.d.ts +1 -0
  23. package/build/lib/registerModifiersForm/registerModifiersForm.types.d.ts +34 -0
  24. package/build/lib/validateProduct/validateProduct.d.ts +7 -0
  25. package/build/lib/validateProduct/validateProduct.test.d.ts +1 -0
  26. package/build/lib/validateProduct/validateProduct.types.d.ts +2 -0
  27. package/build/main.bundle.js +19 -0
  28. package/build/report.json +1 -0
  29. package/build/services/fetchProductDetails/fetchProductDetails.service.d.ts +3 -0
  30. package/build/services/fetchProductDetails/fetchProductDetails.service.mock.d.ts +2 -0
  31. package/build/services/fetchProductDetails/fetchProductDetails.service.types.d.ts +9 -0
  32. package/build/services/fetchProducts/fetchPRoducts.service.mock.d.ts +2 -0
  33. package/build/services/fetchProducts/fetchProducts.service.d.ts +2 -0
  34. package/build/services/fetchProducts/fetchProducts.service.types.d.ts +1 -0
  35. package/build/services/fetchStoreDetails/fetchStoreDetails.service.d.ts +2 -0
  36. package/build/services/fetchStoreDetails/fetchStoreDetails.service.types.d.ts +1 -0
  37. package/build/tests/exports.test.d.ts +1 -0
  38. package/build/types/common.types.d.ts +23 -0
  39. package/build/types/http.types.d.ts +96 -0
  40. package/build/types/modifiers.types.d.ts +62 -0
  41. package/build/utils/assertions/assertions.utils.d.ts +8 -0
  42. package/build/utils/calculations/calculations.utils.d.ts +20 -0
  43. package/build/utils/calculations/calculations.utils.test.d.ts +1 -0
  44. package/build/utils/calculations/calculations.utils.types.d.ts +11 -0
  45. package/build/utils/common.utils.d.ts +3 -0
  46. package/build/utils/http/http.utils.d.ts +5 -0
  47. package/build/utils/http/purge.utils.d.ts +38 -0
  48. package/build/utils/http/request.utils.d.ts +12 -0
  49. package/build/utils/modifiers/common.utils.d.ts +17 -0
  50. package/build/utils/modifiers/form.utils.d.ts +17 -0
  51. package/build/utils/modifiers/handleChange.utils.d.ts +1 -0
  52. package/build/utils/modifiers/renderer.utils.d.ts +11 -0
  53. package/build/utils/modifiers/rendererTraversal.utils.d.ts +4 -0
  54. package/build/utils/modifiers/updateRenderer.utils.d.ts +5 -0
  55. package/build/utils/questionsAndAnswers/questionsAndAnswers.utils.d.ts +5 -0
  56. package/build/utils/questionsAndAnswers/questionsAndAnswers.utils.test.d.ts +1 -0
  57. package/build/utils/services.utils.d.ts +6 -0
  58. package/build/utils/state/state.utils.d.ts +2 -0
  59. package/build/utils/transformers/api.transformer.d.ts +12 -0
  60. package/build/utils/transformers/transformers.utils.d.ts +10 -0
  61. package/build/vendors.bundle.js +1 -0
  62. package/build/vendors.d.ts +1 -0
  63. package/package.json +58 -23
  64. package/dist/bundle.cjs.js +0 -1127
  65. package/dist/bundle.cjs.js.map +0 -1
  66. package/dist/bundle.d.ts +0 -164
  67. package/dist/bundle.esm.js +0 -1118
  68. package/dist/bundle.esm.js.map +0 -1
  69. package/dist/bundle.umd.js +0 -1133
  70. package/dist/bundle.umd.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -3,284 +3,6 @@
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.9.0-canary.38](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.37...@artisan-commerce/products@0.9.0-canary.38) (2021-12-28)
7
-
8
- **Note:** Version bump only for package @artisan-commerce/products
9
-
10
-
11
-
12
-
13
-
14
- ## [0.9.0-canary.37](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.36...@artisan-commerce/products@0.9.0-canary.37) (2021-12-16)
15
-
16
-
17
- ### Bug Fixes
18
-
19
- * **artisn:** fix ShoppingCartTotals ([412b147](https://bitbucket.org/tradesystem/artisn_sdk/commit/412b147e7e402aef26eb24c4ca7d987e7be9473b))
20
-
21
-
22
-
23
- ## [0.9.0-canary.36](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.35...@artisan-commerce/products@0.9.0-canary.36) (2021-12-15)
24
-
25
- **Note:** Version bump only for package @artisan-commerce/products
26
-
27
-
28
-
29
-
30
-
31
- ## [0.9.0-canary.35](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.34...@artisan-commerce/products@0.9.0-canary.35) (2021-12-13)
32
-
33
- **Note:** Version bump only for package @artisan-commerce/products
34
-
35
-
36
-
37
-
38
-
39
- ## [0.9.0-canary.34](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.33...@artisan-commerce/products@0.9.0-canary.34) (2021-12-01)
40
-
41
- **Note:** Version bump only for package @artisan-commerce/products
42
-
43
-
44
-
45
-
46
-
47
- ## [0.9.0-canary.33](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.32...@artisan-commerce/products@0.9.0-canary.33) (2021-11-09)
48
-
49
- **Note:** Version bump only for package @artisan-commerce/products
50
-
51
-
52
-
53
-
54
-
55
- ## [0.9.0-canary.32](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.31...@artisan-commerce/products@0.9.0-canary.32) (2021-11-05)
56
-
57
- **Note:** Version bump only for package @artisan-commerce/products
58
-
59
-
60
-
61
-
62
-
63
- ## [0.9.0-canary.31](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.30...@artisan-commerce/products@0.9.0-canary.31) (2021-10-27)
64
-
65
- **Note:** Version bump only for package @artisan-commerce/products
66
-
67
-
68
-
69
-
70
-
71
- ## [0.9.0-canary.30](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.29...@artisan-commerce/products@0.9.0-canary.30) (2021-10-22)
72
-
73
- **Note:** Version bump only for package @artisan-commerce/products
74
-
75
-
76
-
77
-
78
-
79
- ## [0.9.0-canary.29](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.28...@artisan-commerce/products@0.9.0-canary.29) (2021-10-22)
80
-
81
- **Note:** Version bump only for package @artisan-commerce/products
82
-
83
-
84
-
85
-
86
-
87
- ## [0.9.0-canary.28](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.27...@artisan-commerce/products@0.9.0-canary.28) (2021-10-21)
88
-
89
- **Note:** Version bump only for package @artisan-commerce/products
90
-
91
-
92
-
93
-
94
-
95
- ## [0.9.0-canary.27](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.26...@artisan-commerce/products@0.9.0-canary.27) (2021-10-21)
96
-
97
- **Note:** Version bump only for package @artisan-commerce/products
98
-
99
-
100
-
101
-
102
-
103
- ## [0.9.0-canary.26](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.25...@artisan-commerce/products@0.9.0-canary.26) (2021-10-20)
104
-
105
- **Note:** Version bump only for package @artisan-commerce/products
106
-
107
-
108
-
109
-
110
-
111
- ## [0.9.0-canary.25](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.24...@artisan-commerce/products@0.9.0-canary.25) (2021-10-19)
112
-
113
- **Note:** Version bump only for package @artisan-commerce/products
114
-
115
-
116
-
117
-
118
-
119
- ## [0.9.0-canary.24](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.23...@artisan-commerce/products@0.9.0-canary.24) (2021-10-18)
120
-
121
- **Note:** Version bump only for package @artisan-commerce/products
122
-
123
-
124
-
125
-
126
-
127
- ## [0.9.0-canary.23](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.22...@artisan-commerce/products@0.9.0-canary.23) (2021-10-14)
128
-
129
-
130
- ### Bug Fixes
131
-
132
- * **global:** make export not module by default ([4e701b1](https://bitbucket.org/tradesystem/artisn_sdk/commit/4e701b1b59df89cf8358cf500984b1c2c4f42c60))
133
-
134
-
135
-
136
- ## [0.9.0-canary.22](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.21...@artisan-commerce/products@0.9.0-canary.22) (2021-10-14)
137
-
138
-
139
- ### Bug Fixes
140
-
141
- * **global:** fix some payment types ([8000970](https://bitbucket.org/tradesystem/artisn_sdk/commit/80009700cd8664828b1236e8ad7cc90ce2fcb3e7))
142
-
143
-
144
-
145
- ## [0.9.0-canary.21](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.20...@artisan-commerce/products@0.9.0-canary.21) (2021-10-14)
146
-
147
- **Note:** Version bump only for package @artisan-commerce/products
148
-
149
-
150
-
151
-
152
-
153
- ## [0.9.0-canary.20](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.19...@artisan-commerce/products@0.9.0-canary.20) (2021-10-13)
154
-
155
- **Note:** Version bump only for package @artisan-commerce/products
156
-
157
-
158
-
159
-
160
-
161
- ## [0.9.0-canary.19](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.18...@artisan-commerce/products@0.9.0-canary.19) (2021-10-05)
162
-
163
-
164
- ### Bug Fixes
165
-
166
- * **global:** fix ProductDetail builder and update its types ([cdc6cf9](https://bitbucket.org/tradesystem/artisn_sdk/commit/cdc6cf9ed2e7ff1a340bc691b0dc1156bc682d38))
167
-
168
-
169
-
170
- ## [0.9.0-canary.18](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.17...@artisan-commerce/products@0.9.0-canary.18) (2021-10-04)
171
-
172
-
173
- ### Features
174
-
175
- * **global:** update registerModifiersForm function, control state error ([c3534cf](https://bitbucket.org/tradesystem/artisn_sdk/commit/c3534cf2eac5f7d90176888ad5b6dd575998e2f1))
176
-
177
-
178
-
179
- ## [0.9.0-canary.17](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.16...@artisan-commerce/products@0.9.0-canary.17) (2021-10-01)
180
-
181
-
182
- ### Bug Fixes
183
-
184
- * **global:** fix firebase related types ([efa5081](https://bitbucket.org/tradesystem/artisn_sdk/commit/efa5081a844be033ac9135ac65bf8f56184b71b0))
185
-
186
-
187
-
188
- ## [0.9.0-canary.16](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.15...@artisan-commerce/products@0.9.0-canary.16) (2021-09-30)
189
-
190
- **Note:** Version bump only for package @artisan-commerce/products
191
-
192
-
193
-
194
-
195
-
196
- ## [0.9.0-canary.15](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.14...@artisan-commerce/products@0.9.0-canary.15) (2021-09-30)
197
-
198
- **Note:** Version bump only for package @artisan-commerce/products
199
-
200
-
201
-
202
-
203
-
204
- ## [0.9.0-canary.14](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.13...@artisan-commerce/products@0.9.0-canary.14) (2021-09-23)
205
-
206
- **Note:** Version bump only for package @artisan-commerce/products
207
-
208
-
209
-
210
-
211
-
212
- ## [0.9.0-canary.13](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.12...@artisan-commerce/products@0.9.0-canary.13) (2021-09-21)
213
-
214
- **Note:** Version bump only for package @artisan-commerce/products
215
-
216
-
217
-
218
-
219
-
220
- ## [0.9.0-canary.12](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.11...@artisan-commerce/products@0.9.0-canary.12) (2021-09-17)
221
-
222
- **Note:** Version bump only for package @artisan-commerce/products
223
-
224
-
225
-
226
-
227
-
228
- ## [0.9.0-canary.11](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.10...@artisan-commerce/products@0.9.0-canary.11) (2021-08-25)
229
-
230
- **Note:** Version bump only for package @artisan-commerce/products
231
-
232
-
233
-
234
-
235
-
236
- ## [0.9.0-canary.10](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.9...@artisan-commerce/products@0.9.0-canary.10) (2021-08-25)
237
-
238
- **Note:** Version bump only for package @artisan-commerce/products
239
-
240
-
241
-
242
-
243
-
244
- ## [0.9.0-canary.9](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.8...@artisan-commerce/products@0.9.0-canary.9) (2021-08-24)
245
-
246
- **Note:** Version bump only for package @artisan-commerce/products
247
-
248
-
249
-
250
-
251
-
252
- ## [0.9.0-canary.8](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.7...@artisan-commerce/products@0.9.0-canary.8) (2021-08-23)
253
-
254
- **Note:** Version bump only for package @artisan-commerce/products
255
-
256
-
257
-
258
-
259
-
260
- ## [0.9.0-canary.7](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.6...@artisan-commerce/products@0.9.0-canary.7) (2021-08-23)
261
-
262
- **Note:** Version bump only for package @artisan-commerce/products
263
-
264
-
265
-
266
-
267
-
268
- ## [0.9.0-canary.6](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.5...@artisan-commerce/products@0.9.0-canary.6) (2021-08-12)
269
-
270
- **Note:** Version bump only for package @artisan-commerce/products
271
-
272
-
273
-
274
-
275
-
276
- ## [0.9.0-canary.5](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.4...@artisan-commerce/products@0.9.0-canary.5) (2021-08-12)
277
-
278
- **Note:** Version bump only for package @artisan-commerce/products
279
-
280
-
281
-
282
-
283
-
284
6
  ## [0.9.0-canary.4](https://bitbucket.org/tradesystem/artisn_sdk/compare/@artisan-commerce/products@0.9.0-canary.3...@artisan-commerce/products@0.9.0-canary.4) (2021-08-12)
285
7
 
286
8
  **Note:** Version bump only for package @artisan-commerce/products
@@ -0,0 +1,12 @@
1
+ import { Filters } from "../types/http.types";
2
+ declare const CONSTANTS: {
3
+ HEADERS: string[];
4
+ FILTERS: (keyof Filters)[];
5
+ GROUPS: "category"[];
6
+ ORDER_FIELDS: string[];
7
+ ORDER_TYPES: (import("../types/http.types").ORDER_TYPES | undefined)[];
8
+ ORDER_METHODS: ("asc" | "desc" | undefined)[];
9
+ PAGINATION: string[];
10
+ ADDITIONAL_FILTERS: string[];
11
+ };
12
+ export default CONSTANTS;
@@ -0,0 +1,7 @@
1
+ import { ProductHints } from "../types/common.types";
2
+ import { ID, ProductsHTTPConfig, RequestData } from "../types/http.types";
3
+ export declare const checkAccountId: (accountId: ProductHints["accountId"] | undefined, message?: string) => void;
4
+ export declare const checkVendorId: (vendorId: ID | undefined, message?: string) => void;
5
+ export declare const checkStoreId: (storeId: ID | undefined, message?: string) => void;
6
+ export declare const checkCatalogueId: (catalogueId: ID | undefined, message?: string) => void;
7
+ export declare const checkHTTPMinimumConfig: (config: ProductsHTTPConfig, data: RequestData, message?: string) => void;
@@ -0,0 +1,17 @@
1
+ import * as transformers from "./utils/transformers/transformers.utils";
2
+ import * as assertions from "./utils/assertions/assertions.utils";
3
+ import * as modifierUtils from "./utils/questionsAndAnswers/questionsAndAnswers.utils";
4
+ export { getCategories } from "./lib/getCategories/getCategories";
5
+ export { getProductDetails } from "./lib/getProductDetails/getProductDetails";
6
+ export { getProducts } from "./lib/getProducts/getProducts";
7
+ export { getRecommendedProducts } from "./lib/getRecommendedProducts/getRecommendedProducts";
8
+ export { getRelatedProducts } from "./lib/getRelatedProducts/getRelatedProducts";
9
+ export { getStoreDetails } from "./lib/getStoreDetails/getStoreDetails";
10
+ export { registerModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm";
11
+ export { validateProduct } from "./lib/validateProduct/validateProduct";
12
+ export { initProducts, closeProducts } from "./lib/initProducts/initProducts";
13
+ export { getProductTotals } from "./utils/calculations/calculations.utils";
14
+ export { transformers, assertions, modifierUtils };
15
+ export type { ModifierGroupRenderer } from "./types/modifiers.types";
16
+ export type { ModifierRenderer } from "./types/modifiers.types";
17
+ export type { ModifiersForm } from "./lib/registerModifiersForm/registerModifiersForm.types";
@@ -0,0 +1 @@
1
+ export declare const getCategories: () => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FetchProductDetailsConfig } from "./getProductDetails.types";
2
+ export declare const getProductDetails: (productId: number | string, config: FetchProductDetailsConfig) => Promise<{
3
+ pagination: import("../../types/http.types").PaginationResponse;
4
+ data: unknown;
5
+ error: string | import("@artisan-commerce/cache/build/types/http.types").ResponseError | undefined;
6
+ hints: {
7
+ [key: string]: string | number | undefined;
8
+ };
9
+ config: import("@artisan-commerce/types").ArtisnRequest;
10
+ }>;
@@ -0,0 +1,7 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ export interface FetchProductDetailsConfig extends ProductsHTTPConfig {
3
+ groupBy?: undefined;
4
+ orderBy?: undefined;
5
+ pagination?: undefined;
6
+ additionalFilters?: undefined;
7
+ }
@@ -0,0 +1,11 @@
1
+ import { FetchProductsConfig } from "./getProducts.types";
2
+ import { BaseProduct, CategoryWithProducts } from "@artisan-commerce/types";
3
+ export declare const getProducts: <R extends BaseProduct[] | CategoryWithProducts[] = BaseProduct[]>(config: FetchProductsConfig) => Promise<{
4
+ pagination: import("../../types/http.types").PaginationResponse;
5
+ data: unknown;
6
+ error: string | import("@artisan-commerce/cache/build/types/http.types").ResponseError | undefined;
7
+ hints: {
8
+ [key: string]: string | number | undefined;
9
+ };
10
+ config: import("@artisan-commerce/types").ArtisnRequest;
11
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ export interface FetchProductsConfig extends ProductsHTTPConfig {
3
+ }
@@ -0,0 +1 @@
1
+ export declare const getRecommendedProducts: () => void;
@@ -0,0 +1 @@
1
+ export declare const getRelatedProducts: () => void;
@@ -0,0 +1,16 @@
1
+ import { FetchStoreDetailsConfig } from "./getStoreDetails.types";
2
+ /**
3
+ * Fetches all categories and products from the given store
4
+ *
5
+ * @param config config to fetch the store details
6
+ * @deprecated
7
+ */
8
+ export declare const getStoreDetails: (config: FetchStoreDetailsConfig) => Promise<{
9
+ pagination: import("../../types/http.types").PaginationResponse;
10
+ data: unknown;
11
+ error: string | import("@artisan-commerce/cache/build/types/http.types").ResponseError | undefined;
12
+ hints: {
13
+ [key: string]: string | number | undefined;
14
+ };
15
+ config: import("@artisan-commerce/types").ArtisnRequest;
16
+ }>;
@@ -0,0 +1,7 @@
1
+ import { ProductsHTTPConfig } from "../../types/http.types";
2
+ export interface FetchStoreDetailsConfig extends ProductsHTTPConfig {
3
+ groupBy?: undefined;
4
+ orderBy?: undefined;
5
+ pagination?: undefined;
6
+ additionalFilters?: undefined;
7
+ }
@@ -0,0 +1,14 @@
1
+ import { ArtisnApp } from "@artisan-commerce/types";
2
+ import { InitProductsConfig } from "../../types/common.types";
3
+ /**
4
+ * Initialize products metadata, stores initial global state for future needs.
5
+ * @since 1.0
6
+ * @param artisnApp: An artisn initialized app.
7
+ * @param config: Global products state that can be configure at the function call level
8
+ */
9
+ export declare const initProducts: (artisnApp: ArtisnApp, config?: InitProductsConfig) => void;
10
+ /**
11
+ * Closes all conections and resets the library to its default state
12
+ * @since 1.0
13
+ */
14
+ export declare const closeProducts: () => void;
@@ -0,0 +1,21 @@
1
+ import { Product } from "@artisan-commerce/types";
2
+ import { ModifiersFormCallback } from "./registerModifiersForm.types";
3
+ import { ModifiersFormUnsuscriber } from "./registerModifiersForm.types";
4
+ /**
5
+ * Creates a product modifiers form listener that handles the input change
6
+ * events automatically.
7
+ *
8
+ * @param {Product} product The product that will be listened
9
+ * @param {ModifiersFormCallback} callback Returns a snapshot of the current
10
+ * state of the form
11
+ * @returns {ModifiersFormUnsuscriber} Returns a function that when called it
12
+ * stops listening to the form
13
+ */
14
+ export declare const registerModifiersForm: (product: Product, callback: ModifiersFormCallback) => ModifiersFormUnsuscriber;
15
+ /**
16
+ * Function that when called it stops listening to the form.
17
+ *
18
+ * @param {string} productId The id of the product that will be deleted from the
19
+ * form
20
+ */
21
+ export declare const unsuscriber: (productId: Product["productId"]) => void;
@@ -0,0 +1,34 @@
1
+ import { CartProduct } from "@artisan-commerce/types";
2
+ import { ValidateRenderer } from "../validateProduct/validateProduct.types";
3
+ import { ModifierTypes, RendererStatus } from "../../types/modifiers.types";
4
+ import { ModifierGroupRenderer } from "../../types/modifiers.types";
5
+ export interface ModifiersForm {
6
+ renderer: ModifierGroupRenderer[];
7
+ product: CartProduct;
8
+ validate: ValidateRenderer;
9
+ status: RendererStatus;
10
+ }
11
+ export interface ModifiersFormInternal extends ModifiersForm {
12
+ callback: ModifiersFormCallback;
13
+ }
14
+ export declare type ModifiersFormCallback = (form: ModifiersForm) => void;
15
+ export declare type ModifiersFormUnsuscriber = () => void;
16
+ export declare type HandleChangeFunction = (amount: number) => void;
17
+ export interface BuildModifierRendererConfig {
18
+ rootId: string;
19
+ min: number;
20
+ max: number;
21
+ type: ModifierTypes;
22
+ modifiersCount: number;
23
+ amount: number;
24
+ path: string[];
25
+ }
26
+ export interface BuildModifierGroupConfig {
27
+ amount: number;
28
+ rootId: string;
29
+ path: string[];
30
+ }
31
+ export interface BuildRendererConfig {
32
+ rootId: string;
33
+ path: string[];
34
+ }
@@ -0,0 +1,7 @@
1
+ import { Product } from "@artisan-commerce/types";
2
+ import { RendererStatus } from "../../types/modifiers.types";
3
+ import { ModifierGroupRenderer } from "../../types/modifiers.types";
4
+ import { ModifierRenderer } from "../../types/modifiers.types";
5
+ export declare const validateProduct: (productId: Product["productId"]) => RendererStatus;
6
+ export declare const validateChildModifiers: (group: ModifierGroupRenderer, renderer: ModifierGroupRenderer[], productId: Product["productId"], path: string[]) => ModifierGroupRenderer[];
7
+ export declare const validateChildGroups: (modifier: ModifierRenderer, renderer: ModifierGroupRenderer[], productId: Product["productId"], path: string[]) => ModifierGroupRenderer[];
@@ -0,0 +1,2 @@
1
+ import { RendererStatus } from "../../types/modifiers.types";
2
+ export declare type ValidateRenderer = () => RendererStatus;