@jsdev_ninja/core 0.8.54 → 0.8.56

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 (66) hide show
  1. package/dist/core.cjs.js +1 -1
  2. package/dist/core.cjs.js.map +1 -1
  3. package/dist/core.es.js +864 -1101
  4. package/dist/core.es.js.map +1 -1
  5. package/dist/core.umd.js +1 -1
  6. package/dist/core.umd.js.map +1 -1
  7. package/dist/entities/Address.d.ts.map +1 -1
  8. package/dist/entities/Address.js +8 -7
  9. package/dist/entities/Atoms.d.ts +0 -1
  10. package/dist/entities/Atoms.d.ts.map +1 -1
  11. package/dist/entities/Atoms.js +1 -3
  12. package/dist/entities/Company.d.ts +0 -32
  13. package/dist/entities/Company.d.ts.map +1 -1
  14. package/dist/entities/Company.js +0 -6
  15. package/dist/entities/Locale.js +1 -1
  16. package/dist/entities/Order.d.ts +30 -48
  17. package/dist/entities/Order.d.ts.map +1 -1
  18. package/dist/entities/Order.js +7 -5
  19. package/dist/entities/Product.d.ts +2 -320
  20. package/dist/entities/Product.d.ts.map +1 -1
  21. package/dist/entities/Product.js +6 -13
  22. package/dist/entities/Profile.d.ts +15 -30
  23. package/dist/entities/Profile.d.ts.map +1 -1
  24. package/dist/entities/Profile.js +9 -11
  25. package/dist/entities/Store.d.ts +0 -36
  26. package/dist/entities/Store.d.ts.map +1 -1
  27. package/dist/entities/Store.js +0 -11
  28. package/dist/entities/index.d.ts +0 -1
  29. package/dist/entities/index.d.ts.map +1 -1
  30. package/dist/entities/index.js +0 -1
  31. package/dist/firebase-api/app.d.ts +2 -0
  32. package/dist/firebase-api/app.d.ts.map +1 -0
  33. package/dist/firebase-api/app.js +16 -0
  34. package/dist/firebase-api/index.d.ts +9 -6
  35. package/dist/firebase-api/index.d.ts.map +1 -1
  36. package/dist/firebase-api/index.js +3 -2
  37. package/dist/index.d.ts +0 -1
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +0 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/lib/entities/Address.ts +8 -7
  42. package/lib/entities/Atoms.ts +1 -4
  43. package/lib/entities/Company.ts +0 -6
  44. package/lib/entities/Locale.ts +1 -1
  45. package/lib/entities/Order.ts +7 -5
  46. package/lib/entities/Product.ts +7 -17
  47. package/lib/entities/Profile.ts +9 -11
  48. package/lib/entities/Store.ts +0 -14
  49. package/lib/entities/index.ts +0 -1
  50. package/lib/firebase-api/app.ts +18 -0
  51. package/lib/firebase-api/index.ts +3 -2
  52. package/lib/index.tsx +0 -1
  53. package/package.json +1 -1
  54. package/src/main.tsx +1 -3
  55. package/dist/entities/Payment.d.ts +0 -368
  56. package/dist/entities/Payment.d.ts.map +0 -1
  57. package/dist/entities/Payment.js +0 -108
  58. package/dist/hypPaymentService/index.d.ts +0 -33
  59. package/dist/hypPaymentService/index.d.ts.map +0 -1
  60. package/dist/hypPaymentService/index.js +0 -100
  61. package/lib/entities/Payment.ts +0 -133
  62. package/lib/hypPaymentService/index.ts +0 -139
  63. package/src/App.css +0 -42
  64. package/src/App.tsx +0 -35
  65. package/src/assets/react.svg +0 -1
  66. package/src/index.css +0 -68
@@ -1,14 +1,14 @@
1
1
  import { z } from "zod";
2
2
  import { LocaleSchema } from "./Locale";
3
3
  import { CategorySchema } from "./Category";
4
- const text = z.string();
4
+ const text = z.string().min(1);
5
5
  export const ProductSchema = z.object({
6
6
  type: z.literal("Product"),
7
7
  storeId: text,
8
8
  companyId: text,
9
- id: z.string(),
10
- objectID: z.string(),
11
- sku: z.string().min(1),
9
+ id: text,
10
+ objectID: text,
11
+ sku: text,
12
12
  name: z.array(LocaleSchema),
13
13
  description: z.array(LocaleSchema),
14
14
  isPublished: z.boolean(),
@@ -34,7 +34,7 @@ export const ProductSchema = z.object({
34
34
  unit: z.enum(["liter", "ml", "none"]),
35
35
  }),
36
36
  images: z.array(z.object({ url: z.string().url(), id: z.string() })),
37
- manufacturer: text,
37
+ manufacturer: z.string(),
38
38
  brand: z.string(),
39
39
  importer: z.string(),
40
40
  supplier: z.string(),
@@ -52,13 +52,6 @@ export const ProductSchema = z.object({
52
52
  }),
53
53
  categoryNames: z.array(z.string()),
54
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({
55
+ export const NewProductSchema = ProductSchema.extend({
63
56
  image: z.instanceof(File).optional(),
64
57
  });
@@ -8,17 +8,8 @@ export declare const ProfileSchema: z.ZodObject<{
8
8
  clientType: z.ZodEnum<["user", "company"]>;
9
9
  displayName: z.ZodString;
10
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<{
11
+ phoneNumber: z.ZodOptional<z.ZodString>;
12
+ address: z.ZodOptional<z.ZodObject<{
22
13
  country: z.ZodString;
23
14
  city: z.ZodString;
24
15
  street: z.ZodString;
@@ -42,7 +33,7 @@ export declare const ProfileSchema: z.ZodObject<{
42
33
  floor: string;
43
34
  apartmentEnterNumber: string;
44
35
  apartmentNumber: string;
45
- }>;
36
+ }>>;
46
37
  isAnonymous: z.ZodBoolean;
47
38
  createdDate: z.ZodNumber;
48
39
  lastActivityDate: z.ZodNumber;
@@ -55,11 +46,11 @@ export declare const ProfileSchema: z.ZodObject<{
55
46
  clientType: "user" | "company";
56
47
  displayName: string;
57
48
  email: string;
58
- phoneNumber: {
59
- number: string;
60
- code: string;
61
- };
62
- address: {
49
+ isAnonymous: boolean;
50
+ createdDate: number;
51
+ lastActivityDate: number;
52
+ phoneNumber?: string | undefined;
53
+ address?: {
63
54
  country: string;
64
55
  city: string;
65
56
  street: string;
@@ -67,10 +58,7 @@ export declare const ProfileSchema: z.ZodObject<{
67
58
  floor: string;
68
59
  apartmentEnterNumber: string;
69
60
  apartmentNumber: string;
70
- };
71
- isAnonymous: boolean;
72
- createdDate: number;
73
- lastActivityDate: number;
61
+ } | undefined;
74
62
  }, {
75
63
  type: "Profile";
76
64
  id: string;
@@ -80,11 +68,11 @@ export declare const ProfileSchema: z.ZodObject<{
80
68
  clientType: "user" | "company";
81
69
  displayName: string;
82
70
  email: string;
83
- phoneNumber: {
84
- number: string;
85
- code: string;
86
- };
87
- address: {
71
+ isAnonymous: boolean;
72
+ createdDate: number;
73
+ lastActivityDate: number;
74
+ phoneNumber?: string | undefined;
75
+ address?: {
88
76
  country: string;
89
77
  city: string;
90
78
  street: string;
@@ -92,10 +80,7 @@ export declare const ProfileSchema: z.ZodObject<{
92
80
  floor: string;
93
81
  apartmentEnterNumber: string;
94
82
  apartmentNumber: string;
95
- };
96
- isAnonymous: boolean;
97
- createdDate: number;
98
- lastActivityDate: number;
83
+ } | undefined;
99
84
  }>;
100
85
  export type TProfile = z.infer<typeof ProfileSchema>;
101
86
  export declare function createEmptyProfile(): TProfile;
@@ -1 +1 @@
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
+ {"version":3,"file":"Profile.d.ts","sourceRoot":"","sources":["../../lib/entities/Profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,wBAAgB,kBAAkB,IAAI,QAAQ,CAwB7C"}
@@ -1,19 +1,17 @@
1
1
  import { z } from "zod";
2
2
  import { AddressSchema } from "./Address";
3
+ import { notEmptyTextSchema } from "./Atoms";
3
4
  export const ProfileSchema = z.object({
4
5
  type: z.literal("Profile"),
5
- id: z.string(),
6
- companyId: z.string(),
7
- storeId: z.string(),
8
- tenantId: z.string(),
6
+ id: notEmptyTextSchema,
7
+ companyId: notEmptyTextSchema,
8
+ storeId: notEmptyTextSchema,
9
+ tenantId: notEmptyTextSchema,
9
10
  clientType: z.enum(["user", "company"]),
10
- displayName: z.string().min(1),
11
+ displayName: notEmptyTextSchema,
11
12
  email: z.string().email(),
12
- phoneNumber: z.object({
13
- code: z.string(),
14
- number: z.string(),
15
- }),
16
- address: AddressSchema,
13
+ phoneNumber: notEmptyTextSchema.optional(),
14
+ address: AddressSchema.optional(),
17
15
  isAnonymous: z.boolean(),
18
16
  createdDate: z.number(),
19
17
  lastActivityDate: z.number(),
@@ -28,7 +26,7 @@ export function createEmptyProfile() {
28
26
  clientType: "user",
29
27
  displayName: "",
30
28
  email: "",
31
- phoneNumber: { code: "+972", number: "" },
29
+ phoneNumber: "",
32
30
  address: {
33
31
  country: "",
34
32
  city: "",
@@ -6,22 +6,6 @@ declare const StoreSchema: z.ZodObject<{
6
6
  urls: z.ZodArray<z.ZodString, "many">;
7
7
  logoUrl: z.ZodString;
8
8
  tenantId: z.ZodString;
9
- hypData: z.ZodObject<{
10
- masof: z.ZodString;
11
- password: z.ZodString;
12
- isJ5: z.ZodEnum<["True", "False"]>;
13
- KEY: z.ZodString;
14
- }, "strip", z.ZodTypeAny, {
15
- KEY: string;
16
- masof: string;
17
- password: string;
18
- isJ5: "True" | "False";
19
- }, {
20
- KEY: string;
21
- masof: string;
22
- password: string;
23
- isJ5: "True" | "False";
24
- }>;
25
9
  }, "strip", z.ZodTypeAny, {
26
10
  id: string;
27
11
  companyId: string;
@@ -29,12 +13,6 @@ declare const StoreSchema: z.ZodObject<{
29
13
  tenantId: string;
30
14
  urls: string[];
31
15
  logoUrl: string;
32
- hypData: {
33
- KEY: string;
34
- masof: string;
35
- password: string;
36
- isJ5: "True" | "False";
37
- };
38
16
  }, {
39
17
  id: string;
40
18
  companyId: string;
@@ -42,21 +20,7 @@ declare const StoreSchema: z.ZodObject<{
42
20
  tenantId: string;
43
21
  urls: string[];
44
22
  logoUrl: string;
45
- hypData: {
46
- KEY: string;
47
- masof: string;
48
- password: string;
49
- isJ5: "True" | "False";
50
- };
51
- }>;
52
- export declare const StorePrivateSchema: z.ZodObject<{
53
- storeEmail: z.ZodString;
54
- }, "strip", z.ZodTypeAny, {
55
- storeEmail: string;
56
- }, {
57
- storeEmail: string;
58
23
  }>;
59
24
  export type TStore = z.infer<typeof StoreSchema>;
60
- export type TStorePrivate = z.infer<typeof StorePrivateSchema>;
61
25
  export {};
62
26
  //# sourceMappingURL=Store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../lib/entities/Store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaf,CAAC;AAGH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACjD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;EAOf,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { hypBooleanSchema } from "./Atoms";
3
2
  const StoreSchema = z.object({
4
3
  id: z.string(),
5
4
  companyId: z.string(),
@@ -7,14 +6,4 @@ const StoreSchema = z.object({
7
6
  urls: z.array(z.string()),
8
7
  logoUrl: z.string(),
9
8
  tenantId: z.string(), // firebase auth tenantId
10
- hypData: z.object({
11
- masof: z.string().min(1),
12
- password: z.string().min(1),
13
- isJ5: hypBooleanSchema,
14
- KEY: z.string().min(1), // api key
15
- }),
16
- });
17
- // private sub collection
18
- export const StorePrivateSchema = z.object({
19
- storeEmail: z.string().email(),
20
9
  });
@@ -6,7 +6,6 @@ export * from "./Company";
6
6
  export * from "./FavoriteProduct";
7
7
  export * from "./Locale";
8
8
  export * from "./Order";
9
- export * from "./Payment";
10
9
  export * from "./Product";
11
10
  export * from "./Profile";
12
11
  export * from "./Store";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -6,7 +6,6 @@ export * from "./Company";
6
6
  export * from "./FavoriteProduct";
7
7
  export * from "./Locale";
8
8
  export * from "./Order";
9
- export * from "./Payment";
10
9
  export * from "./Product";
11
10
  export * from "./Profile";
12
11
  export * from "./Store";
@@ -0,0 +1,2 @@
1
+ export declare const app: import("@firebase/app").FirebaseApp;
2
+ //# sourceMappingURL=app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/app.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,GAAG,qCAAgC,CAAC"}
@@ -0,0 +1,16 @@
1
+ // Import the functions you need from the SDKs you need
2
+ import { initializeApp } from "firebase/app";
3
+ // Your web app's Firebase configuration
4
+ // For Firebase JS SDK v7.20.0 and later, measurementId is optional
5
+ const firebaseConfig = {
6
+ apiKey: "AIzaSyAXtA4pdBs7GLX45lK3jYZRiUwo7M06-_s",
7
+ authDomain: "jsdev-stores-prod.firebaseapp.com",
8
+ projectId: "jsdev-stores-prod",
9
+ storageBucket: "jsdev-stores-prod.appspot.com",
10
+ messagingSenderId: "333321054844",
11
+ appId: "1:333321054844:web:7d3c15617daa54107537f9",
12
+ measurementId: "G-CJ44QNETK8",
13
+ };
14
+ // Initialize Firebase
15
+ export const app = initializeApp(firebaseConfig);
16
+ // TESTER
@@ -1,6 +1,6 @@
1
1
  export declare const systemCollections: {
2
- readonly stores: "stores";
3
- readonly companies: "companies";
2
+ readonly stores: "STORES";
3
+ readonly companies: "COMPANIES";
4
4
  };
5
5
  export declare const storeCollections: {
6
6
  readonly products: "products";
@@ -11,11 +11,12 @@ export declare const storeCollections: {
11
11
  readonly categories: "categories";
12
12
  readonly favorites: "favorites";
13
13
  readonly payments: "payments";
14
+ readonly settings: "settings";
14
15
  };
15
16
  export declare const FirestoreApi: {
16
17
  systemCollections: {
17
- readonly stores: "stores";
18
- readonly companies: "companies";
18
+ readonly stores: "STORES";
19
+ readonly companies: "COMPANIES";
19
20
  };
20
21
  storeCollections: {
21
22
  readonly products: "products";
@@ -26,6 +27,7 @@ export declare const FirestoreApi: {
26
27
  readonly categories: "categories";
27
28
  readonly favorites: "favorites";
28
29
  readonly payments: "payments";
30
+ readonly settings: "settings";
29
31
  };
30
32
  getPath: ({ companyId, storeId, collectionName, id, }: {
31
33
  companyId: string;
@@ -38,8 +40,8 @@ export declare const FirestoreApi: {
38
40
  export declare const FirebaseAPI: {
39
41
  firestore: {
40
42
  systemCollections: {
41
- readonly stores: "stores";
42
- readonly companies: "companies";
43
+ readonly stores: "STORES";
44
+ readonly companies: "COMPANIES";
43
45
  };
44
46
  storeCollections: {
45
47
  readonly products: "products";
@@ -50,6 +52,7 @@ export declare const FirebaseAPI: {
50
52
  readonly categories: "categories";
51
53
  readonly favorites: "favorites";
52
54
  readonly payments: "payments";
55
+ readonly settings: "settings";
53
56
  };
54
57
  getPath: ({ companyId, storeId, collectionName, id, }: {
55
58
  companyId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;2DASrB;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;QAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;KACZ;iCAI4B,MAAM,OAAO,gBAAgB;CAG1D,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;+DAdpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;YAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;SACZ;qCAI4B,MAAM,OAAO,gBAAgB;;CAO1D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB;;;CAGpB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;CAUnB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;2DASrB;QACF,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;QAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;KACZ;iCAI4B,MAAM,OAAO,gBAAgB;CAG1D,CAAC;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;+DAdpB;YACF,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,MAAM,CAAC;YAChB,cAAc,EAAE,MAAM,OAAO,gBAAgB,CAAC;YAC9C,EAAE,CAAC,EAAE,MAAM,CAAC;SACZ;qCAI4B,MAAM,OAAO,gBAAgB;;CAO1D,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export const systemCollections = {
2
- stores: "stores",
3
- companies: "companies",
2
+ stores: "STORES",
3
+ companies: "COMPANIES",
4
4
  };
5
5
  export const storeCollections = {
6
6
  products: "products",
@@ -11,6 +11,7 @@ export const storeCollections = {
11
11
  categories: "categories",
12
12
  favorites: "favorites",
13
13
  payments: "payments",
14
+ settings: "settings",
14
15
  };
15
16
  export const FirestoreApi = {
16
17
  systemCollections,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./entities";
2
- export * from "./hypPaymentService";
3
2
  export { FirebaseAPI } from "./firebase-api";
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.tsx"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from "./entities";
2
- export * from "./hypPaymentService";
3
2
  export { FirebaseAPI } from "./firebase-api";
@@ -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/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","../lib/hyppaymentservice/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/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,13 +1,14 @@
1
1
  import { z } from "zod";
2
+ import { notEmptyTextSchema } from "./Atoms";
2
3
 
3
4
  export const AddressSchema = z.object({
4
- country: z.string(),
5
- city: z.string(),
6
- street: z.string(),
7
- streetNumber: z.string(),
8
- floor: z.string(),
9
- apartmentEnterNumber: z.string(),
10
- apartmentNumber: z.string(),
5
+ country: notEmptyTextSchema,
6
+ city: notEmptyTextSchema,
7
+ street: notEmptyTextSchema,
8
+ streetNumber: notEmptyTextSchema,
9
+ floor: notEmptyTextSchema,
10
+ apartmentEnterNumber: notEmptyTextSchema,
11
+ apartmentNumber: notEmptyTextSchema,
11
12
  });
12
13
 
13
14
  export type TAddress = z.infer<typeof AddressSchema>;
@@ -1,7 +1,4 @@
1
1
  import { z } from "zod";
2
2
 
3
- // 600 - Checking a card number700 - Approved without charge800 - Postpone transaction - success handle ass error
4
-
5
- export const hypBooleanSchema = z.enum(["True", "False"]);
6
- export const notEmptyTextSchema = z.string().min(1);
3
+ export const notEmptyTextSchema = z.string().min(1, { message: "שדה חובה" });
7
4
  export const numericTextSchema = z.string().regex(/^\d+$/, "Must be a numeric string");
@@ -4,12 +4,6 @@ export const CompanySchema = z.object({
4
4
  id: z.string(),
5
5
  name: z.string(),
6
6
  websiteDomains: z.array(z.string()),
7
- owner: z.object({
8
- name: z.string(),
9
- emails: z.object({
10
- mainEmail: z.string(),
11
- }),
12
- }),
13
7
  });
14
8
 
15
9
  export type TCompany = z.infer<typeof CompanySchema>;
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
 
3
3
  export const LocaleSchema = z.object({
4
4
  lang: z.enum(["he"]),
5
- value: z.string().min(1),
5
+ value: z.string(),
6
6
  });
7
7
 
8
8
  export const LocaleValueSchema = z.array(LocaleSchema);
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { ProfileSchema } from "./Profile";
3
3
  import { ProductSchema } from "./Product";
4
+ import { notEmptyTextSchema } from "./Atoms";
4
5
 
5
6
  // pending - order created / by user
6
7
  // processing order accepted by store by admin
@@ -12,10 +13,10 @@ import { ProductSchema } from "./Product";
12
13
 
13
14
  export const OrderSchema = z.object({
14
15
  type: z.literal("Order"),
15
- id: z.string(),
16
- companyId: z.string(),
17
- storeId: z.string(),
18
- userId: z.string(),
16
+ id: notEmptyTextSchema,
17
+ companyId: notEmptyTextSchema,
18
+ storeId: notEmptyTextSchema,
19
+ userId: notEmptyTextSchema,
19
20
  status: z.enum([
20
21
  "pending",
21
22
  "processing",
@@ -37,7 +38,8 @@ export const OrderSchema = z.object({
37
38
  actualAmount: z.number().positive().optional(), // what store charge
38
39
  date: z.number(),
39
40
  deliveryDate: z.number().optional(),
40
- client: ProfileSchema,
41
+ createdAt: z.number().optional(),
42
+ client: ProfileSchema.required({}),
41
43
  });
42
44
 
43
45
  export type TOrder = z.infer<typeof OrderSchema>;
@@ -2,15 +2,15 @@ import { z } from "zod";
2
2
  import { LocaleSchema } from "./Locale";
3
3
  import { CategorySchema } from "./Category";
4
4
 
5
- const text = z.string();
5
+ const text = z.string().min(1);
6
6
 
7
7
  export const ProductSchema = z.object({
8
8
  type: z.literal("Product"),
9
9
  storeId: text,
10
10
  companyId: text,
11
- id: z.string(),
12
- objectID: z.string(),
13
- sku: z.string().min(1),
11
+ id: text,
12
+ objectID: text,
13
+ sku: text,
14
14
  name: z.array(LocaleSchema),
15
15
  description: z.array(LocaleSchema),
16
16
  isPublished: z.boolean(),
@@ -36,7 +36,7 @@ export const ProductSchema = z.object({
36
36
  unit: z.enum(["liter", "ml", "none"]),
37
37
  }),
38
38
  images: z.array(z.object({ url: z.string().url(), id: z.string() })),
39
- manufacturer: text,
39
+ manufacturer: z.string(),
40
40
  brand: z.string(),
41
41
  importer: z.string(),
42
42
  supplier: z.string(),
@@ -55,20 +55,10 @@ export const ProductSchema = z.object({
55
55
  }),
56
56
  categoryNames: z.array(z.string()),
57
57
  });
58
+ export type TProduct = z.infer<typeof ProductSchema>;
58
59
 
59
- export const NewProductSchema = ProductSchema.omit({
60
- id: true,
61
- categories: true,
62
- images: true,
63
- }).extend({
64
- image: z.instanceof(File).optional(),
65
- });
66
- export const EditProductSchema = ProductSchema.extend({
60
+ export const NewProductSchema = ProductSchema.extend({
67
61
  image: z.instanceof(File).optional(),
68
62
  });
69
63
 
70
64
  export type TNewProduct = z.infer<typeof NewProductSchema>;
71
-
72
- export type TEditProduct = z.infer<typeof EditProductSchema>;
73
-
74
- export type TProduct = z.infer<typeof ProductSchema>;
@@ -1,20 +1,18 @@
1
1
  import { z } from "zod";
2
2
  import { AddressSchema } from "./Address";
3
+ import { notEmptyTextSchema } from "./Atoms";
3
4
 
4
5
  export const ProfileSchema = z.object({
5
6
  type: z.literal("Profile"),
6
- id: z.string(),
7
- companyId: z.string(),
8
- storeId: z.string(),
9
- tenantId: z.string(),
7
+ id: notEmptyTextSchema,
8
+ companyId: notEmptyTextSchema,
9
+ storeId: notEmptyTextSchema,
10
+ tenantId: notEmptyTextSchema,
10
11
  clientType: z.enum(["user", "company"]),
11
- displayName: z.string().min(1),
12
+ displayName: notEmptyTextSchema,
12
13
  email: z.string().email(),
13
- phoneNumber: z.object({
14
- code: z.string(),
15
- number: z.string(),
16
- }),
17
- address: AddressSchema,
14
+ phoneNumber: notEmptyTextSchema.optional(),
15
+ address: AddressSchema.optional(),
18
16
  isAnonymous: z.boolean(),
19
17
  createdDate: z.number(),
20
18
  lastActivityDate: z.number(),
@@ -32,7 +30,7 @@ export function createEmptyProfile(): TProfile {
32
30
  clientType: "user",
33
31
  displayName: "",
34
32
  email: "",
35
- phoneNumber: { code: "+972", number: "" },
33
+ phoneNumber: "",
36
34
  address: {
37
35
  country: "",
38
36
  city: "",
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { hypBooleanSchema } from "./Atoms";
3
2
 
4
3
  const StoreSchema = z.object({
5
4
  id: z.string(),
@@ -8,18 +7,5 @@ const StoreSchema = z.object({
8
7
  urls: z.array(z.string()),
9
8
  logoUrl: z.string(),
10
9
  tenantId: z.string(), // firebase auth tenantId
11
- hypData: z.object({
12
- masof: z.string().min(1),
13
- password: z.string().min(1),
14
- isJ5: hypBooleanSchema,
15
- KEY: z.string().min(1), // api key
16
- }),
17
10
  });
18
-
19
- // private sub collection
20
- export const StorePrivateSchema = z.object({
21
- storeEmail: z.string().email(),
22
- });
23
-
24
11
  export type TStore = z.infer<typeof StoreSchema>;
25
- export type TStorePrivate = z.infer<typeof StorePrivateSchema>;
@@ -6,7 +6,6 @@ export * from "./Company";
6
6
  export * from "./FavoriteProduct";
7
7
  export * from "./Locale";
8
8
  export * from "./Order";
9
- export * from "./Payment";
10
9
  export * from "./Product";
11
10
  export * from "./Profile";
12
11
  export * from "./Store";
@@ -0,0 +1,18 @@
1
+ // Import the functions you need from the SDKs you need
2
+ import { initializeApp } from "firebase/app";
3
+ // Your web app's Firebase configuration
4
+ // For Firebase JS SDK v7.20.0 and later, measurementId is optional
5
+ const firebaseConfig = {
6
+ apiKey: "AIzaSyAXtA4pdBs7GLX45lK3jYZRiUwo7M06-_s",
7
+ authDomain: "jsdev-stores-prod.firebaseapp.com",
8
+ projectId: "jsdev-stores-prod",
9
+ storageBucket: "jsdev-stores-prod.appspot.com",
10
+ messagingSenderId: "333321054844",
11
+ appId: "1:333321054844:web:7d3c15617daa54107537f9",
12
+ measurementId: "G-CJ44QNETK8",
13
+ };
14
+
15
+ // Initialize Firebase
16
+ export const app = initializeApp(firebaseConfig);
17
+
18
+ // TESTER
@@ -1,6 +1,6 @@
1
1
  export const systemCollections = {
2
- stores: "stores",
3
- companies: "companies",
2
+ stores: "STORES",
3
+ companies: "COMPANIES",
4
4
  } as const;
5
5
 
6
6
  export const storeCollections = {
@@ -12,6 +12,7 @@ export const storeCollections = {
12
12
  categories: "categories",
13
13
  favorites: "favorites",
14
14
  payments: "payments",
15
+ settings: "settings",
15
16
  } as const;
16
17
 
17
18
  export const FirestoreApi = {
package/lib/index.tsx CHANGED
@@ -1,3 +1,2 @@
1
1
  export * from "./entities";
2
- export * from "./hypPaymentService";
3
2
  export { FirebaseAPI } from "./firebase-api";