@jsdev_ninja/core 0.8.2 → 0.8.31

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 (51) hide show
  1. package/index.html +1 -1
  2. package/package.json +1 -1
  3. package/dist/core.cjs.js.map +0 -1
  4. package/dist/core.es.js +0 -3045
  5. package/dist/core.es.js.map +0 -1
  6. package/dist/core.umd.js +0 -2
  7. package/dist/core.umd.js.map +0 -1
  8. package/dist/entities/Address.d.ts +0 -28
  9. package/dist/entities/Address.d.ts.map +0 -1
  10. package/dist/entities/Address.js +0 -10
  11. package/dist/entities/Cart.d.ts +0 -715
  12. package/dist/entities/Cart.d.ts.map +0 -1
  13. package/dist/entities/Cart.js +0 -14
  14. package/dist/entities/Category.d.ts +0 -103
  15. package/dist/entities/Category.d.ts.map +0 -1
  16. package/dist/entities/Category.js +0 -20
  17. package/dist/entities/FavoriteProduct.d.ts +0 -25
  18. package/dist/entities/FavoriteProduct.d.ts.map +0 -1
  19. package/dist/entities/FavoriteProduct.js +0 -9
  20. package/dist/entities/Locale.d.ts +0 -12
  21. package/dist/entities/Locale.d.ts.map +0 -1
  22. package/dist/entities/Locale.js +0 -5
  23. package/dist/entities/Order.d.ts +0 -1078
  24. package/dist/entities/Order.d.ts.map +0 -1
  25. package/dist/entities/Order.js +0 -28
  26. package/dist/entities/Payment.d.ts +0 -30
  27. package/dist/entities/Payment.d.ts.map +0 -1
  28. package/dist/entities/Payment.js +0 -12
  29. package/dist/entities/Product.d.ts +0 -1000
  30. package/dist/entities/Product.d.ts.map +0 -1
  31. package/dist/entities/Product.js +0 -64
  32. package/dist/entities/Profile.d.ts +0 -102
  33. package/dist/entities/Profile.d.ts.map +0 -1
  34. package/dist/entities/Profile.js +0 -45
  35. package/dist/entities/Store.d.ts +0 -44
  36. package/dist/entities/Store.d.ts.map +0 -1
  37. package/dist/entities/Store.js +0 -15
  38. package/dist/entities/index.d.ts +0 -7
  39. package/dist/entities/index.d.ts.map +0 -1
  40. package/dist/entities/index.js +0 -6
  41. package/dist/firebase-api/index.d.ts +0 -2
  42. package/dist/firebase-api/index.d.ts.map +0 -1
  43. package/dist/firebase-api/index.js +0 -12
  44. package/dist/index.d.ts +0 -2
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/index.js +0 -1
  47. package/dist/tsconfig.app.tsbuildinfo +0 -1
  48. package/dist/tsconfig.node.tsbuildinfo +0 -1
  49. package/dist/vite.config.d.ts +0 -3
  50. package/dist/vite.config.d.ts.map +0 -1
  51. package/dist/vite.config.js +0 -25
@@ -1 +0,0 @@
1
- {"version":3,"file":"Product.d.ts","sourceRoot":"","sources":["../../lib/entities/Product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkDxB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM3B,CAAC;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE7D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,64 +0,0 @@
1
- import { z } from "zod";
2
- import { LocaleSchema } from "./Locale";
3
- import { CategorySchema } from "./Category";
4
- const text = z.string();
5
- export const ProductSchema = z.object({
6
- type: z.literal("Product"),
7
- storeId: text,
8
- companyId: text,
9
- id: z.string(),
10
- objectID: z.string(),
11
- sku: z.string().min(1),
12
- name: z.array(LocaleSchema),
13
- description: z.array(LocaleSchema),
14
- isPublished: z.boolean(),
15
- vat: z.boolean(),
16
- priceType: z.object({
17
- type: z.enum(["unit", "kg", "gram", "liter", "ml"]),
18
- value: z.number(),
19
- }),
20
- price: z.number().positive(),
21
- purchasePrice: z.number().optional(),
22
- profitPercentage: z.number().optional(),
23
- currency: z.literal("ILS"),
24
- discount: z.object({
25
- type: z.enum(["number", "percent", "none"]),
26
- value: z.number(),
27
- }),
28
- weight: z.object({
29
- value: z.number(),
30
- unit: z.enum(["kg", "gram", "none"]),
31
- }),
32
- volume: z.object({
33
- value: z.number(),
34
- unit: z.enum(["liter", "ml", "none"]),
35
- }),
36
- images: z.array(z.object({ url: z.string().url(), id: z.string() })),
37
- manufacturer: text,
38
- brand: z.string(),
39
- importer: z.string(),
40
- supplier: z.string(),
41
- ingredients: z.array(LocaleSchema),
42
- created_at: z.number(),
43
- updated_at: z.number(),
44
- categoryList: z.array(CategorySchema),
45
- // generated
46
- categories: z.object({
47
- lvl0: z.array(z.string()),
48
- lvl1: z.array(z.string()),
49
- lvl2: z.array(z.string()),
50
- lvl3: z.array(z.string()),
51
- lvl4: z.array(z.string()),
52
- }),
53
- categoryNames: z.array(z.string()),
54
- });
55
- export const NewProductSchema = ProductSchema.omit({
56
- id: true,
57
- categories: true,
58
- images: true,
59
- }).extend({
60
- image: z.instanceof(File).optional(),
61
- });
62
- export const EditProductSchema = ProductSchema.extend({
63
- image: z.instanceof(File).optional(),
64
- });
@@ -1,102 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ProfileSchema: z.ZodObject<{
3
- type: z.ZodLiteral<"Profile">;
4
- id: z.ZodString;
5
- companyId: z.ZodString;
6
- storeId: z.ZodString;
7
- tenantId: z.ZodString;
8
- clientType: z.ZodEnum<["user", "company"]>;
9
- displayName: z.ZodString;
10
- email: z.ZodString;
11
- phoneNumber: z.ZodObject<{
12
- code: z.ZodString;
13
- number: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- number: string;
16
- code: string;
17
- }, {
18
- number: string;
19
- code: string;
20
- }>;
21
- address: z.ZodObject<{
22
- country: z.ZodString;
23
- city: z.ZodString;
24
- street: z.ZodString;
25
- streetNumber: z.ZodString;
26
- floor: z.ZodString;
27
- apartmentEnterNumber: z.ZodString;
28
- apartmentNumber: z.ZodString;
29
- }, "strip", z.ZodTypeAny, {
30
- country: string;
31
- city: string;
32
- street: string;
33
- streetNumber: string;
34
- floor: string;
35
- apartmentEnterNumber: string;
36
- apartmentNumber: string;
37
- }, {
38
- country: string;
39
- city: string;
40
- street: string;
41
- streetNumber: string;
42
- floor: string;
43
- apartmentEnterNumber: string;
44
- apartmentNumber: string;
45
- }>;
46
- isAnonymous: z.ZodBoolean;
47
- createdDate: z.ZodNumber;
48
- lastActivityDate: z.ZodNumber;
49
- }, "strip", z.ZodTypeAny, {
50
- type: "Profile";
51
- id: string;
52
- companyId: string;
53
- storeId: string;
54
- tenantId: string;
55
- clientType: "user" | "company";
56
- displayName: string;
57
- email: string;
58
- phoneNumber: {
59
- number: string;
60
- code: string;
61
- };
62
- address: {
63
- country: string;
64
- city: string;
65
- street: string;
66
- streetNumber: string;
67
- floor: string;
68
- apartmentEnterNumber: string;
69
- apartmentNumber: string;
70
- };
71
- isAnonymous: boolean;
72
- createdDate: number;
73
- lastActivityDate: number;
74
- }, {
75
- type: "Profile";
76
- id: string;
77
- companyId: string;
78
- storeId: string;
79
- tenantId: string;
80
- clientType: "user" | "company";
81
- displayName: string;
82
- email: string;
83
- phoneNumber: {
84
- number: string;
85
- code: string;
86
- };
87
- address: {
88
- country: string;
89
- city: string;
90
- street: string;
91
- streetNumber: string;
92
- floor: string;
93
- apartmentEnterNumber: string;
94
- apartmentNumber: string;
95
- };
96
- isAnonymous: boolean;
97
- createdDate: number;
98
- lastActivityDate: number;
99
- }>;
100
- export type TProfile = z.infer<typeof ProfileSchema>;
101
- export declare function createEmptyProfile(): TProfile;
102
- //# sourceMappingURL=Profile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../../lib/entities/Profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,wBAAgB,kBAAkB,IAAI,QAAQ,CAwB7C"}
@@ -1,45 +0,0 @@
1
- import { z } from "zod";
2
- import { AddressSchema } from "./Address";
3
- export const ProfileSchema = z.object({
4
- type: z.literal("Profile"),
5
- id: z.string(),
6
- companyId: z.string(),
7
- storeId: z.string(),
8
- tenantId: z.string(),
9
- clientType: z.enum(["user", "company"]),
10
- displayName: z.string().min(1),
11
- email: z.string().email(),
12
- phoneNumber: z.object({
13
- code: z.string(),
14
- number: z.string(),
15
- }),
16
- address: AddressSchema,
17
- isAnonymous: z.boolean(),
18
- createdDate: z.number(),
19
- lastActivityDate: z.number(),
20
- });
21
- export function createEmptyProfile() {
22
- return {
23
- type: "Profile",
24
- id: "",
25
- companyId: "",
26
- storeId: "",
27
- tenantId: "",
28
- clientType: "user",
29
- displayName: "",
30
- email: "",
31
- phoneNumber: { code: "+972", number: "" },
32
- address: {
33
- country: "",
34
- city: "",
35
- street: "",
36
- streetNumber: "",
37
- floor: "",
38
- apartmentEnterNumber: "",
39
- apartmentNumber: "",
40
- },
41
- createdDate: 0,
42
- lastActivityDate: 0,
43
- isAnonymous: true,
44
- };
45
- }
@@ -1,44 +0,0 @@
1
- import { z } from "zod";
2
- declare const StoreSchema: z.ZodObject<{
3
- id: z.ZodString;
4
- companyId: z.ZodString;
5
- name: z.ZodString;
6
- urls: z.ZodArray<z.ZodString, "many">;
7
- logoUrl: z.ZodString;
8
- tenantId: z.ZodString;
9
- paymentMethods: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
- clientType: z.ZodEnum<["user", "company"]>;
11
- method: z.ZodEnum<["internal", "external"]>;
12
- }, "strip", z.ZodTypeAny, {
13
- clientType: "user" | "company";
14
- method: "internal" | "external";
15
- }, {
16
- clientType: "user" | "company";
17
- method: "internal" | "external";
18
- }>, "many">>;
19
- }, "strip", z.ZodTypeAny, {
20
- id: string;
21
- companyId: string;
22
- tenantId: string;
23
- name: string;
24
- urls: string[];
25
- logoUrl: string;
26
- paymentMethods?: {
27
- clientType: "user" | "company";
28
- method: "internal" | "external";
29
- }[] | undefined;
30
- }, {
31
- id: string;
32
- companyId: string;
33
- tenantId: string;
34
- name: string;
35
- urls: string[];
36
- logoUrl: string;
37
- paymentMethods?: {
38
- clientType: "user" | "company";
39
- method: "internal" | "external";
40
- }[] | undefined;
41
- }>;
42
- export type TStore = z.infer<typeof StoreSchema>;
43
- export {};
44
- //# sourceMappingURL=Store.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../lib/entities/Store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAef,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { z } from "zod";
2
- const StoreSchema = z.object({
3
- id: z.string(),
4
- companyId: z.string(),
5
- name: z.string(),
6
- urls: z.array(z.string()),
7
- logoUrl: z.string(),
8
- tenantId: z.string(), // firebase auth tenantId
9
- paymentMethods: z
10
- .array(z.object({
11
- clientType: z.enum(["user", "company"]),
12
- method: z.enum(["internal", "external"]),
13
- }))
14
- .optional(),
15
- });
@@ -1,7 +0,0 @@
1
- export * from "./Profile";
2
- export * from "./Category";
3
- export * from "./Order";
4
- export * from "./Product";
5
- export * from "./FavoriteProduct";
6
- export * from "./Cart";
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from "./Profile";
2
- export * from "./Category";
3
- export * from "./Order";
4
- export * from "./Product";
5
- export * from "./FavoriteProduct";
6
- export * from "./Cart";
@@ -1,2 +0,0 @@
1
- export declare const FirebaseAPI: {};
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,IAAK,CAAC"}
@@ -1,12 +0,0 @@
1
- const collectionPaths = {
2
- products: () => `/[companyId]/[storeId]/products/[productId]`,
3
- cart: "",
4
- orders: "",
5
- categories: "",
6
- profiles: "",
7
- favorites: "",
8
- stores: "",
9
- companies: "",
10
- payments: "",
11
- };
12
- export const FirebaseAPI = {};
package/dist/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from "./entities";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- export * from "./entities";
@@ -1 +0,0 @@
1
- {"root":["../lib/index.tsx","../lib/entities/address.ts","../lib/entities/cart.ts","../lib/entities/category.ts","../lib/entities/favoriteproduct.ts","../lib/entities/locale.ts","../lib/entities/order.ts","../lib/entities/payment.ts","../lib/entities/product.ts","../lib/entities/profile.ts","../lib/entities/store.ts","../lib/entities/index.ts","../lib/firebase-api/index.ts"],"version":"5.7.2"}
@@ -1 +0,0 @@
1
- {"root":["../vite.config.ts"],"version":"5.7.2"}
@@ -1,3 +0,0 @@
1
- declare const _default: import("vite").UserConfig;
2
- export default _default;
3
- //# sourceMappingURL=vite.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["../vite.config.ts"],"names":[],"mappings":";AAIA,wBAsBG"}
@@ -1,25 +0,0 @@
1
- import { defineConfig } from "vite";
2
- import react from "@vitejs/plugin-react-swc";
3
- import { resolve } from "path";
4
- export default defineConfig({
5
- plugins: [react()],
6
- build: {
7
- lib: {
8
- entry: resolve(__dirname, "lib/index.tsx"),
9
- name: "core",
10
- formats: ["es", "cjs", "umd"],
11
- fileName: (format) => `core.${format}.js`,
12
- },
13
- rollupOptions: {
14
- external: ["react", "react-dom"], // Exclude dependencies from the bundle
15
- output: {
16
- globals: {
17
- react: "React",
18
- "react-dom": "ReactDOM",
19
- },
20
- },
21
- },
22
- sourcemap: true,
23
- minify: "esbuild",
24
- },
25
- });