@jsdev_ninja/core 0.10.9 → 0.11.1

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.
@@ -1,4 +1,538 @@
1
1
  import { z } from "zod";
2
+ declare const CartItemProductSchema: z.ZodObject<{
3
+ product: z.ZodObject<{
4
+ type: z.ZodLiteral<"Product">;
5
+ storeId: z.ZodString;
6
+ companyId: z.ZodString;
7
+ id: z.ZodString;
8
+ objectID: z.ZodString;
9
+ sku: z.ZodString;
10
+ name: z.ZodArray<z.ZodObject<{
11
+ lang: z.ZodEnum<["he"]>;
12
+ value: z.ZodString;
13
+ }, "strip", z.ZodTypeAny, {
14
+ value: string;
15
+ lang: "he";
16
+ }, {
17
+ value: string;
18
+ lang: "he";
19
+ }>, "many">;
20
+ description: z.ZodArray<z.ZodObject<{
21
+ lang: z.ZodEnum<["he"]>;
22
+ value: z.ZodString;
23
+ }, "strip", z.ZodTypeAny, {
24
+ value: string;
25
+ lang: "he";
26
+ }, {
27
+ value: string;
28
+ lang: "he";
29
+ }>, "many">;
30
+ isPublished: z.ZodBoolean;
31
+ vat: z.ZodBoolean;
32
+ priceType: z.ZodObject<{
33
+ type: z.ZodEnum<["unit", "kg", "gram", "liter", "ml"]>;
34
+ value: z.ZodNumber;
35
+ }, "strip", z.ZodTypeAny, {
36
+ value: number;
37
+ type: "unit" | "kg" | "gram" | "liter" | "ml";
38
+ }, {
39
+ value: number;
40
+ type: "unit" | "kg" | "gram" | "liter" | "ml";
41
+ }>;
42
+ price: z.ZodNumber;
43
+ purchasePrice: z.ZodOptional<z.ZodNumber>;
44
+ profitPercentage: z.ZodOptional<z.ZodNumber>;
45
+ currency: z.ZodLiteral<"ILS">;
46
+ discount: z.ZodObject<{
47
+ type: z.ZodEnum<["number", "percent", "none"]>;
48
+ value: z.ZodNumber;
49
+ }, "strip", z.ZodTypeAny, {
50
+ value: number;
51
+ type: "number" | "percent" | "none";
52
+ }, {
53
+ value: number;
54
+ type: "number" | "percent" | "none";
55
+ }>;
56
+ isDiscountable: z.ZodOptional<z.ZodBoolean>;
57
+ weight: z.ZodObject<{
58
+ value: z.ZodNumber;
59
+ unit: z.ZodEnum<["kg", "gram", "none"]>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ value: number;
62
+ unit: "kg" | "gram" | "none";
63
+ }, {
64
+ value: number;
65
+ unit: "kg" | "gram" | "none";
66
+ }>;
67
+ volume: z.ZodObject<{
68
+ value: z.ZodNumber;
69
+ unit: z.ZodEnum<["liter", "ml", "none"]>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ value: number;
72
+ unit: "liter" | "ml" | "none";
73
+ }, {
74
+ value: number;
75
+ unit: "liter" | "ml" | "none";
76
+ }>;
77
+ images: z.ZodArray<z.ZodObject<{
78
+ url: z.ZodString;
79
+ id: z.ZodString;
80
+ }, "strip", z.ZodTypeAny, {
81
+ id: string;
82
+ url: string;
83
+ }, {
84
+ id: string;
85
+ url: string;
86
+ }>, "many">;
87
+ manufacturer: z.ZodString;
88
+ brand: z.ZodString;
89
+ importer: z.ZodString;
90
+ supplier: z.ZodString;
91
+ ingredients: z.ZodArray<z.ZodObject<{
92
+ lang: z.ZodEnum<["he"]>;
93
+ value: z.ZodString;
94
+ }, "strip", z.ZodTypeAny, {
95
+ value: string;
96
+ lang: "he";
97
+ }, {
98
+ value: string;
99
+ lang: "he";
100
+ }>, "many">;
101
+ created_at: z.ZodNumber;
102
+ updated_at: z.ZodNumber;
103
+ categoryIds: z.ZodArray<z.ZodString, "many">;
104
+ categoryList: z.ZodArray<z.ZodType<{
105
+ id: string;
106
+ companyId: string;
107
+ storeId: string;
108
+ locales: {
109
+ value: string;
110
+ lang: "he";
111
+ }[];
112
+ depth: number;
113
+ parentId?: string | null | undefined;
114
+ tag?: string | undefined;
115
+ } & {
116
+ children: ({
117
+ id: string;
118
+ companyId: string;
119
+ storeId: string;
120
+ locales: {
121
+ value: string;
122
+ lang: "he";
123
+ }[];
124
+ depth: number;
125
+ parentId?: string | null | undefined;
126
+ tag?: string | undefined;
127
+ } & /*elided*/ any)[];
128
+ }, z.ZodTypeDef, {
129
+ id: string;
130
+ companyId: string;
131
+ storeId: string;
132
+ locales: {
133
+ value: string;
134
+ lang: "he";
135
+ }[];
136
+ depth: number;
137
+ parentId?: string | null | undefined;
138
+ tag?: string | undefined;
139
+ } & {
140
+ children: ({
141
+ id: string;
142
+ companyId: string;
143
+ storeId: string;
144
+ locales: {
145
+ value: string;
146
+ lang: "he";
147
+ }[];
148
+ depth: number;
149
+ parentId?: string | null | undefined;
150
+ tag?: string | undefined;
151
+ } & /*elided*/ any)[];
152
+ }>, "many">;
153
+ categories: z.ZodObject<{
154
+ lvl0: z.ZodArray<z.ZodString, "many">;
155
+ lvl1: z.ZodArray<z.ZodString, "many">;
156
+ lvl2: z.ZodArray<z.ZodString, "many">;
157
+ lvl3: z.ZodArray<z.ZodString, "many">;
158
+ lvl4: z.ZodArray<z.ZodString, "many">;
159
+ }, "strip", z.ZodTypeAny, {
160
+ lvl0: string[];
161
+ lvl1: string[];
162
+ lvl2: string[];
163
+ lvl3: string[];
164
+ lvl4: string[];
165
+ }, {
166
+ lvl0: string[];
167
+ lvl1: string[];
168
+ lvl2: string[];
169
+ lvl3: string[];
170
+ lvl4: string[];
171
+ }>;
172
+ categoryNames: z.ZodArray<z.ZodString, "many">;
173
+ }, "strip", z.ZodTypeAny, {
174
+ type: "Product";
175
+ id: string;
176
+ companyId: string;
177
+ storeId: string;
178
+ objectID: string;
179
+ sku: string;
180
+ name: {
181
+ value: string;
182
+ lang: "he";
183
+ }[];
184
+ description: {
185
+ value: string;
186
+ lang: "he";
187
+ }[];
188
+ isPublished: boolean;
189
+ vat: boolean;
190
+ priceType: {
191
+ value: number;
192
+ type: "unit" | "kg" | "gram" | "liter" | "ml";
193
+ };
194
+ price: number;
195
+ currency: "ILS";
196
+ discount: {
197
+ value: number;
198
+ type: "number" | "percent" | "none";
199
+ };
200
+ weight: {
201
+ value: number;
202
+ unit: "kg" | "gram" | "none";
203
+ };
204
+ volume: {
205
+ value: number;
206
+ unit: "liter" | "ml" | "none";
207
+ };
208
+ images: {
209
+ id: string;
210
+ url: string;
211
+ }[];
212
+ manufacturer: string;
213
+ brand: string;
214
+ importer: string;
215
+ supplier: string;
216
+ ingredients: {
217
+ value: string;
218
+ lang: "he";
219
+ }[];
220
+ created_at: number;
221
+ updated_at: number;
222
+ categoryIds: string[];
223
+ categoryList: ({
224
+ id: string;
225
+ companyId: string;
226
+ storeId: string;
227
+ locales: {
228
+ value: string;
229
+ lang: "he";
230
+ }[];
231
+ depth: number;
232
+ parentId?: string | null | undefined;
233
+ tag?: string | undefined;
234
+ } & {
235
+ children: ({
236
+ id: string;
237
+ companyId: string;
238
+ storeId: string;
239
+ locales: {
240
+ value: string;
241
+ lang: "he";
242
+ }[];
243
+ depth: number;
244
+ parentId?: string | null | undefined;
245
+ tag?: string | undefined;
246
+ } & /*elided*/ any)[];
247
+ })[];
248
+ categories: {
249
+ lvl0: string[];
250
+ lvl1: string[];
251
+ lvl2: string[];
252
+ lvl3: string[];
253
+ lvl4: string[];
254
+ };
255
+ categoryNames: string[];
256
+ purchasePrice?: number | undefined;
257
+ profitPercentage?: number | undefined;
258
+ isDiscountable?: boolean | undefined;
259
+ }, {
260
+ type: "Product";
261
+ id: string;
262
+ companyId: string;
263
+ storeId: string;
264
+ objectID: string;
265
+ sku: string;
266
+ name: {
267
+ value: string;
268
+ lang: "he";
269
+ }[];
270
+ description: {
271
+ value: string;
272
+ lang: "he";
273
+ }[];
274
+ isPublished: boolean;
275
+ vat: boolean;
276
+ priceType: {
277
+ value: number;
278
+ type: "unit" | "kg" | "gram" | "liter" | "ml";
279
+ };
280
+ price: number;
281
+ currency: "ILS";
282
+ discount: {
283
+ value: number;
284
+ type: "number" | "percent" | "none";
285
+ };
286
+ weight: {
287
+ value: number;
288
+ unit: "kg" | "gram" | "none";
289
+ };
290
+ volume: {
291
+ value: number;
292
+ unit: "liter" | "ml" | "none";
293
+ };
294
+ images: {
295
+ id: string;
296
+ url: string;
297
+ }[];
298
+ manufacturer: string;
299
+ brand: string;
300
+ importer: string;
301
+ supplier: string;
302
+ ingredients: {
303
+ value: string;
304
+ lang: "he";
305
+ }[];
306
+ created_at: number;
307
+ updated_at: number;
308
+ categoryIds: string[];
309
+ categoryList: ({
310
+ id: string;
311
+ companyId: string;
312
+ storeId: string;
313
+ locales: {
314
+ value: string;
315
+ lang: "he";
316
+ }[];
317
+ depth: number;
318
+ parentId?: string | null | undefined;
319
+ tag?: string | undefined;
320
+ } & {
321
+ children: ({
322
+ id: string;
323
+ companyId: string;
324
+ storeId: string;
325
+ locales: {
326
+ value: string;
327
+ lang: "he";
328
+ }[];
329
+ depth: number;
330
+ parentId?: string | null | undefined;
331
+ tag?: string | undefined;
332
+ } & /*elided*/ any)[];
333
+ })[];
334
+ categories: {
335
+ lvl0: string[];
336
+ lvl1: string[];
337
+ lvl2: string[];
338
+ lvl3: string[];
339
+ lvl4: string[];
340
+ };
341
+ categoryNames: string[];
342
+ purchasePrice?: number | undefined;
343
+ profitPercentage?: number | undefined;
344
+ isDiscountable?: boolean | undefined;
345
+ }>;
346
+ originalPrice: z.ZodOptional<z.ZodNumber>;
347
+ finalPrice: z.ZodOptional<z.ZodNumber>;
348
+ finalDiscount: z.ZodOptional<z.ZodNumber>;
349
+ amount: z.ZodNumber;
350
+ }, "strip", z.ZodTypeAny, {
351
+ product: {
352
+ type: "Product";
353
+ id: string;
354
+ companyId: string;
355
+ storeId: string;
356
+ objectID: string;
357
+ sku: string;
358
+ name: {
359
+ value: string;
360
+ lang: "he";
361
+ }[];
362
+ description: {
363
+ value: string;
364
+ lang: "he";
365
+ }[];
366
+ isPublished: boolean;
367
+ vat: boolean;
368
+ priceType: {
369
+ value: number;
370
+ type: "unit" | "kg" | "gram" | "liter" | "ml";
371
+ };
372
+ price: number;
373
+ currency: "ILS";
374
+ discount: {
375
+ value: number;
376
+ type: "number" | "percent" | "none";
377
+ };
378
+ weight: {
379
+ value: number;
380
+ unit: "kg" | "gram" | "none";
381
+ };
382
+ volume: {
383
+ value: number;
384
+ unit: "liter" | "ml" | "none";
385
+ };
386
+ images: {
387
+ id: string;
388
+ url: string;
389
+ }[];
390
+ manufacturer: string;
391
+ brand: string;
392
+ importer: string;
393
+ supplier: string;
394
+ ingredients: {
395
+ value: string;
396
+ lang: "he";
397
+ }[];
398
+ created_at: number;
399
+ updated_at: number;
400
+ categoryIds: string[];
401
+ categoryList: ({
402
+ id: string;
403
+ companyId: string;
404
+ storeId: string;
405
+ locales: {
406
+ value: string;
407
+ lang: "he";
408
+ }[];
409
+ depth: number;
410
+ parentId?: string | null | undefined;
411
+ tag?: string | undefined;
412
+ } & {
413
+ children: ({
414
+ id: string;
415
+ companyId: string;
416
+ storeId: string;
417
+ locales: {
418
+ value: string;
419
+ lang: "he";
420
+ }[];
421
+ depth: number;
422
+ parentId?: string | null | undefined;
423
+ tag?: string | undefined;
424
+ } & /*elided*/ any)[];
425
+ })[];
426
+ categories: {
427
+ lvl0: string[];
428
+ lvl1: string[];
429
+ lvl2: string[];
430
+ lvl3: string[];
431
+ lvl4: string[];
432
+ };
433
+ categoryNames: string[];
434
+ purchasePrice?: number | undefined;
435
+ profitPercentage?: number | undefined;
436
+ isDiscountable?: boolean | undefined;
437
+ };
438
+ amount: number;
439
+ originalPrice?: number | undefined;
440
+ finalPrice?: number | undefined;
441
+ finalDiscount?: number | undefined;
442
+ }, {
443
+ product: {
444
+ type: "Product";
445
+ id: string;
446
+ companyId: string;
447
+ storeId: string;
448
+ objectID: string;
449
+ sku: string;
450
+ name: {
451
+ value: string;
452
+ lang: "he";
453
+ }[];
454
+ description: {
455
+ value: string;
456
+ lang: "he";
457
+ }[];
458
+ isPublished: boolean;
459
+ vat: boolean;
460
+ priceType: {
461
+ value: number;
462
+ type: "unit" | "kg" | "gram" | "liter" | "ml";
463
+ };
464
+ price: number;
465
+ currency: "ILS";
466
+ discount: {
467
+ value: number;
468
+ type: "number" | "percent" | "none";
469
+ };
470
+ weight: {
471
+ value: number;
472
+ unit: "kg" | "gram" | "none";
473
+ };
474
+ volume: {
475
+ value: number;
476
+ unit: "liter" | "ml" | "none";
477
+ };
478
+ images: {
479
+ id: string;
480
+ url: string;
481
+ }[];
482
+ manufacturer: string;
483
+ brand: string;
484
+ importer: string;
485
+ supplier: string;
486
+ ingredients: {
487
+ value: string;
488
+ lang: "he";
489
+ }[];
490
+ created_at: number;
491
+ updated_at: number;
492
+ categoryIds: string[];
493
+ categoryList: ({
494
+ id: string;
495
+ companyId: string;
496
+ storeId: string;
497
+ locales: {
498
+ value: string;
499
+ lang: "he";
500
+ }[];
501
+ depth: number;
502
+ parentId?: string | null | undefined;
503
+ tag?: string | undefined;
504
+ } & {
505
+ children: ({
506
+ id: string;
507
+ companyId: string;
508
+ storeId: string;
509
+ locales: {
510
+ value: string;
511
+ lang: "he";
512
+ }[];
513
+ depth: number;
514
+ parentId?: string | null | undefined;
515
+ tag?: string | undefined;
516
+ } & /*elided*/ any)[];
517
+ })[];
518
+ categories: {
519
+ lvl0: string[];
520
+ lvl1: string[];
521
+ lvl2: string[];
522
+ lvl3: string[];
523
+ lvl4: string[];
524
+ };
525
+ categoryNames: string[];
526
+ purchasePrice?: number | undefined;
527
+ profitPercentage?: number | undefined;
528
+ isDiscountable?: boolean | undefined;
529
+ };
530
+ amount: number;
531
+ originalPrice?: number | undefined;
532
+ finalPrice?: number | undefined;
533
+ finalDiscount?: number | undefined;
534
+ }>;
535
+ export type TCartItemProduct = z.infer<typeof CartItemProductSchema>;
2
536
  export declare const CartSchema: z.ZodObject<{
3
537
  type: z.ZodLiteral<"Cart">;
4
538
  id: z.ZodString;
@@ -350,6 +884,9 @@ export declare const CartSchema: z.ZodObject<{
350
884
  profitPercentage?: number | undefined;
351
885
  isDiscountable?: boolean | undefined;
352
886
  }>;
887
+ originalPrice: z.ZodOptional<z.ZodNumber>;
888
+ finalPrice: z.ZodOptional<z.ZodNumber>;
889
+ finalDiscount: z.ZodOptional<z.ZodNumber>;
353
890
  amount: z.ZodNumber;
354
891
  }, "strip", z.ZodTypeAny, {
355
892
  product: {
@@ -440,6 +977,9 @@ export declare const CartSchema: z.ZodObject<{
440
977
  isDiscountable?: boolean | undefined;
441
978
  };
442
979
  amount: number;
980
+ originalPrice?: number | undefined;
981
+ finalPrice?: number | undefined;
982
+ finalDiscount?: number | undefined;
443
983
  }, {
444
984
  product: {
445
985
  type: "Product";
@@ -529,6 +1069,9 @@ export declare const CartSchema: z.ZodObject<{
529
1069
  isDiscountable?: boolean | undefined;
530
1070
  };
531
1071
  amount: number;
1072
+ originalPrice?: number | undefined;
1073
+ finalPrice?: number | undefined;
1074
+ finalDiscount?: number | undefined;
532
1075
  }>, "many">;
533
1076
  }, "strip", z.ZodTypeAny, {
534
1077
  type: "Cart";
@@ -626,6 +1169,9 @@ export declare const CartSchema: z.ZodObject<{
626
1169
  isDiscountable?: boolean | undefined;
627
1170
  };
628
1171
  amount: number;
1172
+ originalPrice?: number | undefined;
1173
+ finalPrice?: number | undefined;
1174
+ finalDiscount?: number | undefined;
629
1175
  }[];
630
1176
  }, {
631
1177
  type: "Cart";
@@ -723,7 +1269,11 @@ export declare const CartSchema: z.ZodObject<{
723
1269
  isDiscountable?: boolean | undefined;
724
1270
  };
725
1271
  amount: number;
1272
+ originalPrice?: number | undefined;
1273
+ finalPrice?: number | undefined;
1274
+ finalDiscount?: number | undefined;
726
1275
  }[];
727
1276
  }>;
728
1277
  export type TCart = z.infer<typeof CartSchema>;
1278
+ export {};
729
1279
  //# sourceMappingURL=Cart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cart.d.ts","sourceRoot":"","sources":["../../lib/entities/Cart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQrB,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC"}
@@ -1,5 +1,12 @@
1
1
  import { z } from "zod";
2
2
  import { ProductSchema } from "./Product";
3
+ const CartItemProductSchema = z.object({
4
+ product: ProductSchema,
5
+ originalPrice: z.number().optional(),
6
+ finalPrice: z.number().optional(),
7
+ finalDiscount: z.number().optional(),
8
+ amount: z.number().int().positive({ message: "Quantity must be a positive integer." }),
9
+ });
3
10
  export const CartSchema = z.object({
4
11
  type: z.literal("Cart"),
5
12
  id: z.string().uuid(),
@@ -7,8 +14,5 @@ export const CartSchema = z.object({
7
14
  storeId: z.string().uuid(),
8
15
  userId: z.string().uuid(),
9
16
  status: z.enum(["active", "draft", "completed"]),
10
- items: z.array(z.object({
11
- product: ProductSchema,
12
- amount: z.number().int().positive({ message: "Quantity must be a positive integer." }),
13
- })),
17
+ items: z.array(CartItemProductSchema),
14
18
  });
@@ -1 +1 @@
1
- {"root":["../lib/index.tsx","../lib/entities/address.ts","../lib/entities/atoms.ts","../lib/entities/cart.ts","../lib/entities/category.ts","../lib/entities/company.ts","../lib/entities/discount.ts","../lib/entities/favoriteproduct.ts","../lib/entities/locale.ts","../lib/entities/order.ts","../lib/entities/product.ts","../lib/entities/profile.ts","../lib/entities/store.ts","../lib/entities/index.ts","../lib/firebase-api/app.ts","../lib/firebase-api/index.ts"],"version":"5.7.3"}
1
+ {"root":["../lib/index.tsx","../lib/entities/address.ts","../lib/entities/atoms.ts","../lib/entities/cart.ts","../lib/entities/category.ts","../lib/entities/company.ts","../lib/entities/discount.ts","../lib/entities/favoriteproduct.ts","../lib/entities/locale.ts","../lib/entities/order.ts","../lib/entities/product.ts","../lib/entities/profile.ts","../lib/entities/store.ts","../lib/entities/index.ts","../lib/firebase-api/app.ts","../lib/firebase-api/index.ts","../lib/utils/index.ts"],"version":"5.7.3"}