cloudcommerce 0.0.2 → 0.0.3

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 (46) hide show
  1. package/{.eslintrc.js → .eslintrc.cjs} +4 -4
  2. package/.github/renovate.json +2 -1
  3. package/CHANGELOG.md +13 -0
  4. package/README.md +2 -2
  5. package/package.json +7 -6
  6. package/packages/api/dist/index.d.ts +65 -0
  7. package/packages/api/dist/index.js +42 -24
  8. package/packages/api/dist/index.js.map +1 -1
  9. package/packages/api/dist/types/applications.d.ts +208 -0
  10. package/packages/api/dist/types/authentications.d.ts +97 -0
  11. package/packages/api/dist/types/brands.d.ts +148 -0
  12. package/packages/api/dist/types/carts.d.ts +292 -0
  13. package/packages/api/dist/types/categories.d.ts +190 -0
  14. package/packages/api/dist/types/collections.d.ts +151 -0
  15. package/packages/api/dist/types/customers.d.ts +495 -0
  16. package/packages/api/dist/types/grids.d.ts +149 -0
  17. package/packages/api/dist/types/orders.d.ts +1588 -0
  18. package/packages/api/dist/types/procedures.d.ts +139 -0
  19. package/packages/api/dist/types/products.d.ts +1284 -0
  20. package/packages/api/dist/types/stores.d.ts +120 -0
  21. package/packages/api/dist/types/triggers.d.ts +79 -0
  22. package/packages/api/dist/types.d.ts +65 -0
  23. package/packages/api/dist/types.js +2 -0
  24. package/packages/api/dist/types.js.map +1 -0
  25. package/packages/api/package.json +4 -2
  26. package/packages/api/scripts/build.mjs +5 -0
  27. package/packages/api/src/index.ts +46 -55
  28. package/packages/api/src/types/applications.d.ts +208 -0
  29. package/packages/api/src/types/authentications.d.ts +97 -0
  30. package/packages/api/src/types/brands.d.ts +148 -0
  31. package/packages/api/src/types/carts.d.ts +292 -0
  32. package/packages/api/src/types/categories.d.ts +190 -0
  33. package/packages/api/src/types/collections.d.ts +151 -0
  34. package/packages/api/src/types/customers.d.ts +495 -0
  35. package/packages/api/src/types/grids.d.ts +149 -0
  36. package/packages/api/src/types/orders.d.ts +1588 -0
  37. package/packages/api/src/types/procedures.d.ts +139 -0
  38. package/packages/api/src/types/products.d.ts +1284 -0
  39. package/packages/api/src/types/stores.d.ts +120 -0
  40. package/packages/api/src/types/triggers.d.ts +79 -0
  41. package/packages/api/src/types.ts +74 -0
  42. package/packages/api/tests/types.test.ts +13 -0
  43. package/packages/apps/discounts/package.json +1 -1
  44. package/packages/storefront/package.json +1 -1
  45. package/{packages/api/tsconfig.json → tsconfig.json} +8 -3
  46. package/turbo.json +3 -0
@@ -0,0 +1,97 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Authentications {
9
+ _id: string;
10
+ created_at: string;
11
+ updated_at: string;
12
+ store_ids: number[];
13
+ /**
14
+ * Simple username for identification, only numbers and lowercase letters
15
+ */
16
+ username: string;
17
+ /**
18
+ * User language two letter code, sometimes with region, eg.: pt_br, fr, en_us
19
+ */
20
+ locale?: string;
21
+ /**
22
+ * User email address
23
+ */
24
+ email?: string;
25
+ /**
26
+ * User full name
27
+ */
28
+ name?: string;
29
+ /**
30
+ * User phone number
31
+ */
32
+ phone?: string;
33
+ /**
34
+ * MD5 hash generated with the user's password
35
+ */
36
+ pass_md5_hash?: string;
37
+ /**
38
+ * API key as a random 128 bytes hexadecimal number
39
+ */
40
+ api_key?: string;
41
+ /**
42
+ * Collection of resources allowed to user, each resource uri as object property
43
+ */
44
+ permissions?: {
45
+ /**
46
+ * Resource/Subresources/Third-level/ID
47
+ *
48
+ * This interface was referenced by `undefined`'s JSON-Schema definition
49
+ * via the `patternProperty` "^(([^/_][a-z0-9/_@:$+]{1,60}[^/])|[*])$".
50
+ */
51
+ [k: string]: ('all' | 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE')[];
52
+ };
53
+ /**
54
+ * List of dashboard cards chosen by user
55
+ */
56
+ panel_cards?: {
57
+ /**
58
+ * Unique identifier, card name using only lowercase, numbers and underscore
59
+ */
60
+ card_id: string;
61
+ /**
62
+ * Card title
63
+ */
64
+ title?: string;
65
+ /**
66
+ * Card text, usually a brief description
67
+ */
68
+ paragraph?: string;
69
+ /**
70
+ * Custom card calling MongoDB aggregate
71
+ */
72
+ custom_aggregation?: {
73
+ /**
74
+ * API resource
75
+ */
76
+ resource: 'products' | 'categories' | 'brands' | 'collections' | 'grids' | 'customers' | 'carts' | 'orders';
77
+ /**
78
+ * Aggregation pipeline
79
+ */
80
+ pipeline: {
81
+ [k: string]: unknown;
82
+ }[];
83
+ };
84
+ }[];
85
+ /**
86
+ * Whether the user is able to use builder and file manager to edit storefront
87
+ */
88
+ edit_storefront?: boolean;
89
+ /**
90
+ * Flags to associate additional info
91
+ */
92
+ flags?: string[];
93
+ /**
94
+ * Optional notes with additional info about this user
95
+ */
96
+ notes?: string;
97
+ }
@@ -0,0 +1,148 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Brands {
9
+ _id: string;
10
+ created_at: string;
11
+ updated_at: string;
12
+ store_id: number;
13
+ channel_ids?: string[];
14
+ /**
15
+ * Brand full name
16
+ */
17
+ name: string;
18
+ /**
19
+ * Slug to complete page URL, starting with number or lowercase letter
20
+ */
21
+ slug?: string;
22
+ /**
23
+ * Short brand description in plain text
24
+ */
25
+ short_description?: string;
26
+ /**
27
+ * Full brand description, may use HTML tags
28
+ */
29
+ body_html?: string;
30
+ /**
31
+ * Full brand description, plain text only
32
+ */
33
+ body_text?: string;
34
+ /**
35
+ * Title tag for page SEO
36
+ */
37
+ meta_title?: string;
38
+ /**
39
+ * Meta description tag for page SEO
40
+ */
41
+ meta_description?: string;
42
+ /**
43
+ * Text translations for internationalization
44
+ */
45
+ i18n?: {
46
+ /**
47
+ * Language specific text fields
48
+ *
49
+ * This interface was referenced by `undefined`'s JSON-Schema definition
50
+ * via the `patternProperty` "^[a-z]{2}(_[a-z]{2})?$".
51
+ */
52
+ [k: string]: {
53
+ /**
54
+ * Brand full name
55
+ */
56
+ name?: string;
57
+ /**
58
+ * Short brand description in plain text
59
+ */
60
+ short_description?: string;
61
+ /**
62
+ * Full brand description, may use HTML tags
63
+ */
64
+ body_html?: string;
65
+ /**
66
+ * Full brand description, plain text only
67
+ */
68
+ body_text?: string;
69
+ /**
70
+ * Title tag for page SEO
71
+ */
72
+ meta_title?: string;
73
+ /**
74
+ * Meta description tag for page SEO
75
+ */
76
+ meta_description?: string;
77
+ };
78
+ };
79
+ /**
80
+ * Brand logo
81
+ */
82
+ logo?: {
83
+ /**
84
+ * Image link
85
+ */
86
+ url: string;
87
+ /**
88
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
89
+ */
90
+ size?: string;
91
+ /**
92
+ * Alternative text, HTML alt tag (important for SEO)
93
+ */
94
+ alt?: string;
95
+ };
96
+ /**
97
+ * List of brand images
98
+ */
99
+ pictures?: {
100
+ /**
101
+ * Picture ID (ObjectID) [auto]
102
+ */
103
+ _id?: string;
104
+ /**
105
+ * Tag to identify object, use only lowercase letters, digits and underscore
106
+ */
107
+ tag?: string;
108
+ /**
109
+ * Image link
110
+ */
111
+ url: string;
112
+ /**
113
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
114
+ */
115
+ size?: string;
116
+ /**
117
+ * Alternative text, HTML alt tag (important for SEO)
118
+ */
119
+ alt?: string;
120
+ }[];
121
+ /**
122
+ * List of custom attributes
123
+ */
124
+ metafields?: {
125
+ /**
126
+ * String to help distinguish who (or which app) created and can use the metafield
127
+ */
128
+ namespace?: string;
129
+ /**
130
+ * Field name
131
+ */
132
+ field?: string;
133
+ /**
134
+ * Custom property value
135
+ */
136
+ value: {
137
+ [k: string]: unknown;
138
+ };
139
+ }[];
140
+ /**
141
+ * Flags to associate additional info
142
+ */
143
+ flags?: string[];
144
+ /**
145
+ * Optional notes with additional info about this brand
146
+ */
147
+ notes?: string;
148
+ }
@@ -0,0 +1,292 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ /**
9
+ * Shopping cart object model
10
+ */
11
+ export interface Carts {
12
+ _id: string;
13
+ created_at: string;
14
+ updated_at: string;
15
+ store_id: number;
16
+ /**
17
+ * Whether cart was created by staff and is trusted
18
+ */
19
+ staff_signature?: boolean;
20
+ /**
21
+ * Whether cart still available to complete checkout
22
+ */
23
+ available?: boolean;
24
+ /**
25
+ * If the cart has been completed, generating an order
26
+ */
27
+ completed?: boolean;
28
+ /**
29
+ * URL to this cart's page
30
+ */
31
+ permalink?: string;
32
+ /**
33
+ * Status defined by seller
34
+ */
35
+ status?: string;
36
+ /**
37
+ * UTM campaign HTTP parameters
38
+ */
39
+ utm?: {
40
+ /**
41
+ * Parameter 'utm_source', the referrer: (e.g. 'google', 'newsletter')
42
+ */
43
+ source?: string;
44
+ /**
45
+ * Parameter 'utm_medium', the marketing medium: (e.g. 'cpc', 'banner', 'email')
46
+ */
47
+ medium?: string;
48
+ /**
49
+ * Parameter 'utm_campaign', the product, promo code, or slogan (e.g. 'spring_sale')
50
+ */
51
+ campaign?: string;
52
+ /**
53
+ * Parameter 'utm_term', identifies the paid keywords
54
+ */
55
+ term?: string;
56
+ /**
57
+ * Parameter 'utm_content', used to differentiate ads
58
+ */
59
+ content?: string;
60
+ };
61
+ /**
62
+ * The website that the customer clicked on to come to the shop
63
+ */
64
+ referring_site?: string;
65
+ /**
66
+ * Code to identify the affiliate that referred the customer
67
+ */
68
+ affiliate_code?: string;
69
+ /**
70
+ * List of customers associated with this cart
71
+ */
72
+ customers?: string[];
73
+ /**
74
+ * Whether cart is available for other customers too (anyone)
75
+ */
76
+ other_customers?: boolean;
77
+ /**
78
+ * Products composing the cart
79
+ */
80
+ items: {
81
+ /**
82
+ * Cart item ID (ObjectID) [auto]
83
+ */
84
+ _id?: string;
85
+ /**
86
+ * Product ID
87
+ */
88
+ product_id: string;
89
+ /**
90
+ * ID to specify the variation added to cart, if product has variations
91
+ */
92
+ variation_id?: string;
93
+ /**
94
+ * Product or variation SKU (reference code)
95
+ */
96
+ sku?: string;
97
+ /**
98
+ * Product or variation full name, or other label for this cart item
99
+ */
100
+ name?: string;
101
+ /**
102
+ * Product or variation picture for this cart item
103
+ */
104
+ picture?: {
105
+ /**
106
+ * Image size variation
107
+ *
108
+ * This interface was referenced by `undefined`'s JSON-Schema definition
109
+ * via the `patternProperty` "^small|normal|big|zoom|custom$".
110
+ */
111
+ [k: string]: {
112
+ /**
113
+ * Image link
114
+ */
115
+ url: string;
116
+ /**
117
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
118
+ */
119
+ size?: string;
120
+ /**
121
+ * Alternative text, HTML alt tag (important for SEO)
122
+ */
123
+ alt?: string;
124
+ };
125
+ };
126
+ /**
127
+ * Item customization fields
128
+ */
129
+ customizations?: {
130
+ /**
131
+ * Title for this customization field, can be the grid title
132
+ */
133
+ label?: string;
134
+ /**
135
+ * Option chosen or created by customer
136
+ */
137
+ option: {
138
+ /**
139
+ * Option ID (ObjectID) if it was predefined (not custom value created by customer)
140
+ */
141
+ _id?: string;
142
+ /**
143
+ * Option text value displayed for the client
144
+ */
145
+ text: string;
146
+ };
147
+ /**
148
+ * URL of file attached by customer to this field
149
+ */
150
+ attachment?: string;
151
+ /**
152
+ * Price alteration due to this customization
153
+ */
154
+ add_to_price?: {
155
+ /**
156
+ * Type of price addition
157
+ */
158
+ type?: 'percentage' | 'fixed';
159
+ /**
160
+ * Additional value, could be negative
161
+ */
162
+ addition: number;
163
+ };
164
+ }[];
165
+ /**
166
+ * Parent kit product for this item
167
+ */
168
+ kit_product?: {
169
+ /**
170
+ * Kit product ID (ObjectID)
171
+ */
172
+ _id: string;
173
+ /**
174
+ * Kit product full name
175
+ */
176
+ name?: string;
177
+ /**
178
+ * Total quantity of items to close a kit unit
179
+ */
180
+ pack_quantity?: number;
181
+ /**
182
+ * Kit total pack price
183
+ */
184
+ price?: number;
185
+ /**
186
+ * Current kit composition
187
+ */
188
+ composition?: {
189
+ /**
190
+ * Product ID (ObjectID)
191
+ */
192
+ _id: string;
193
+ /**
194
+ * Selected variation ID (ObjectID) if any
195
+ */
196
+ variation_id?: string;
197
+ /**
198
+ * Kit item quantity
199
+ */
200
+ quantity?: number;
201
+ }[];
202
+ };
203
+ /**
204
+ * Item quantity in cart
205
+ */
206
+ quantity: number;
207
+ /**
208
+ * Minimum item quantity for this cart
209
+ */
210
+ min_quantity?: number;
211
+ /**
212
+ * Maximum item quantity for this cart
213
+ */
214
+ max_quantity?: number;
215
+ /**
216
+ * Deadline for production or handling of pre-ordered item
217
+ */
218
+ production_time?: {
219
+ /**
220
+ * Number of days to post the product after purchase, deadline for production or handling
221
+ */
222
+ days: number;
223
+ /**
224
+ * If the deadline is calculated in working days
225
+ */
226
+ working_days?: boolean;
227
+ /**
228
+ * If the production time is cumulative per item unit
229
+ */
230
+ cumulative?: boolean;
231
+ /**
232
+ * When cumulative, increase the term proportionally up to this maximum (in days)
233
+ */
234
+ max_time?: number;
235
+ };
236
+ /**
237
+ * Designator of currency according to ISO 4217 (3 uppercase letters)
238
+ */
239
+ currency_id?: string;
240
+ /**
241
+ * Graphic symbol used as a shorthand for currency's name
242
+ */
243
+ currency_symbol?: string;
244
+ /**
245
+ * Product sale price specifically for this cart
246
+ */
247
+ price: number;
248
+ /**
249
+ * Final item price including additions due to customizations (auto-calculated)
250
+ */
251
+ final_price?: number;
252
+ /**
253
+ * Flags to associate additional info
254
+ */
255
+ flags?: string[];
256
+ }[];
257
+ /**
258
+ * The sum of all items prices (auto-calculated)
259
+ */
260
+ subtotal?: number;
261
+ /**
262
+ * List of orders completed with this cart
263
+ */
264
+ orders?: string[];
265
+ /**
266
+ * List of custom attributes
267
+ */
268
+ metafields?: {
269
+ /**
270
+ * String to help distinguish who (or which app) created and can use the metafield
271
+ */
272
+ namespace?: string;
273
+ /**
274
+ * Field name
275
+ */
276
+ field?: string;
277
+ /**
278
+ * Custom property value
279
+ */
280
+ value: {
281
+ [k: string]: unknown;
282
+ };
283
+ }[];
284
+ /**
285
+ * Flags to associate additional info
286
+ */
287
+ flags?: string[];
288
+ /**
289
+ * Optional notes with additional info about this brand
290
+ */
291
+ notes?: string;
292
+ }
@@ -0,0 +1,190 @@
1
+ /* tslint:disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export interface Categories {
9
+ _id: string;
10
+ created_at: string;
11
+ updated_at: string;
12
+ store_id: number;
13
+ channel_ids?: string[];
14
+ /**
15
+ * Category full name
16
+ */
17
+ name: string;
18
+ /**
19
+ * Slug to complete page URL, starting with number or lowercase letter
20
+ */
21
+ slug?: string;
22
+ /**
23
+ * Short category description in plain text
24
+ */
25
+ short_description?: string;
26
+ /**
27
+ * Full category description, may use HTML tags
28
+ */
29
+ body_html?: string;
30
+ /**
31
+ * Full category description, plain text only
32
+ */
33
+ body_text?: string;
34
+ /**
35
+ * Title tag for page SEO
36
+ */
37
+ meta_title?: string;
38
+ /**
39
+ * Meta description tag for page SEO
40
+ */
41
+ meta_description?: string;
42
+ /**
43
+ * Text translations for internationalization
44
+ */
45
+ i18n?: {
46
+ /**
47
+ * Language specific text fields
48
+ *
49
+ * This interface was referenced by `undefined`'s JSON-Schema definition
50
+ * via the `patternProperty` "^[a-z]{2}(_[a-z]{2})?$".
51
+ */
52
+ [k: string]: {
53
+ /**
54
+ * Category full name
55
+ */
56
+ name?: string;
57
+ /**
58
+ * Short category description in plain text
59
+ */
60
+ short_description?: string;
61
+ /**
62
+ * Full category description, may use HTML tags
63
+ */
64
+ body_html?: string;
65
+ /**
66
+ * Full category description, plain text only
67
+ */
68
+ body_text?: string;
69
+ /**
70
+ * Title tag for page SEO
71
+ */
72
+ meta_title?: string;
73
+ /**
74
+ * Meta description tag for page SEO
75
+ */
76
+ meta_description?: string;
77
+ };
78
+ };
79
+ /**
80
+ * Parent category (above) of current category
81
+ */
82
+ parent?: {
83
+ /**
84
+ * Parent category ID (ObjectID)
85
+ */
86
+ _id?: string;
87
+ /**
88
+ * Parent category name
89
+ */
90
+ name: string;
91
+ /**
92
+ * Text translations for internationalization
93
+ */
94
+ i18n?: {
95
+ /**
96
+ * Language specific text fields
97
+ *
98
+ * This interface was referenced by `undefined`'s JSON-Schema definition
99
+ * via the `patternProperty` "^[a-z]{2}(_[a-z]{2})?$".
100
+ */
101
+ [k: string]: {
102
+ /**
103
+ * Parent category name
104
+ */
105
+ name?: string;
106
+ };
107
+ };
108
+ /**
109
+ * Parent category page slug
110
+ */
111
+ slug?: string;
112
+ };
113
+ /**
114
+ * Category icon image
115
+ */
116
+ icon?: {
117
+ /**
118
+ * Image link
119
+ */
120
+ url: string;
121
+ /**
122
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
123
+ */
124
+ size?: string;
125
+ /**
126
+ * Alternative text, HTML alt tag (important for SEO)
127
+ */
128
+ alt?: string;
129
+ };
130
+ /**
131
+ * List of category images
132
+ */
133
+ pictures?: {
134
+ /**
135
+ * Picture ID (ObjectID) [auto]
136
+ */
137
+ _id?: string;
138
+ /**
139
+ * Tag to identify object, use only lowercase letters, digits and underscore
140
+ */
141
+ tag?: string;
142
+ /**
143
+ * Image link
144
+ */
145
+ url: string;
146
+ /**
147
+ * Image size (width x height) in px, such as 100x50 (100px width, 50px height)
148
+ */
149
+ size?: string;
150
+ /**
151
+ * Alternative text, HTML alt tag (important for SEO)
152
+ */
153
+ alt?: string;
154
+ }[];
155
+ /**
156
+ * Mercado Libre Taxonomy: https://api.mercadolibre.com/sites/MLB/categories
157
+ */
158
+ ml_category_id?: string;
159
+ /**
160
+ * Google Taxonomy: https://www.google.com/basepages/producttype/taxonomy-with-ids.pt-BR.txt
161
+ */
162
+ google_product_category_id?: number;
163
+ /**
164
+ * List of custom attributes
165
+ */
166
+ metafields?: {
167
+ /**
168
+ * String to help distinguish who (or which app) created and can use the metafield
169
+ */
170
+ namespace?: string;
171
+ /**
172
+ * Field name
173
+ */
174
+ field?: string;
175
+ /**
176
+ * Custom property value
177
+ */
178
+ value: {
179
+ [k: string]: unknown;
180
+ };
181
+ }[];
182
+ /**
183
+ * Flags to associate additional info
184
+ */
185
+ flags?: string[];
186
+ /**
187
+ * Optional notes with additional info about this category
188
+ */
189
+ notes?: string;
190
+ }