@jsdev_ninja/core 0.13.26 → 0.13.27

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 (110) hide show
  1. package/lib/entities/Order.ts +1 -0
  2. package/lib/entities/Store.ts +1 -0
  3. package/package.json +2 -2
  4. package/dist/core.cjs.js +0 -2
  5. package/dist/core.cjs.js.map +0 -1
  6. package/dist/core.es.js +0 -3610
  7. package/dist/core.es.js.map +0 -1
  8. package/dist/core.umd.js +0 -2
  9. package/dist/core.umd.js.map +0 -1
  10. package/dist/lib/entities/Address.d.ts +0 -28
  11. package/dist/lib/entities/Address.d.ts.map +0 -1
  12. package/dist/lib/entities/Address.js +0 -10
  13. package/dist/lib/entities/Atoms.d.ts +0 -16
  14. package/dist/lib/entities/Atoms.d.ts.map +0 -1
  15. package/dist/lib/entities/Atoms.js +0 -7
  16. package/dist/lib/entities/Cart.d.ts +0 -1278
  17. package/dist/lib/entities/Cart.d.ts.map +0 -1
  18. package/dist/lib/entities/Cart.js +0 -18
  19. package/dist/lib/entities/Category.d.ts +0 -103
  20. package/dist/lib/entities/Category.d.ts.map +0 -1
  21. package/dist/lib/entities/Category.js +0 -20
  22. package/dist/lib/entities/Company.d.ts +0 -16
  23. package/dist/lib/entities/Company.d.ts.map +0 -1
  24. package/dist/lib/entities/Company.js +0 -6
  25. package/dist/lib/entities/DeliveryNote.d.ts +0 -248
  26. package/dist/lib/entities/DeliveryNote.d.ts.map +0 -1
  27. package/dist/lib/entities/DeliveryNote.js +0 -61
  28. package/dist/lib/entities/Discount/__tests__/engine.test.d.ts +0 -2
  29. package/dist/lib/entities/Discount/__tests__/engine.test.d.ts.map +0 -1
  30. package/dist/lib/entities/Discount/__tests__/engine.test.js +0 -298
  31. package/dist/lib/entities/Discount/__tests__/factory.test.d.ts +0 -2
  32. package/dist/lib/entities/Discount/__tests__/factory.test.d.ts.map +0 -1
  33. package/dist/lib/entities/Discount/__tests__/factory.test.js +0 -75
  34. package/dist/lib/entities/Discount/__tests__/integration.test.d.ts +0 -2
  35. package/dist/lib/entities/Discount/__tests__/integration.test.d.ts.map +0 -1
  36. package/dist/lib/entities/Discount/__tests__/integration.test.js +0 -115
  37. package/dist/lib/entities/Discount/__tests__/simple.test.d.ts +0 -2
  38. package/dist/lib/entities/Discount/__tests__/simple.test.d.ts.map +0 -1
  39. package/dist/lib/entities/Discount/__tests__/simple.test.js +0 -186
  40. package/dist/lib/entities/Discount/__tests__/utils.test.d.ts +0 -2
  41. package/dist/lib/entities/Discount/__tests__/utils.test.d.ts.map +0 -1
  42. package/dist/lib/entities/Discount/__tests__/utils.test.js +0 -55
  43. package/dist/lib/entities/Discount/engine.d.ts +0 -29
  44. package/dist/lib/entities/Discount/engine.d.ts.map +0 -1
  45. package/dist/lib/entities/Discount/engine.js +0 -85
  46. package/dist/lib/entities/Discount/factory.d.ts +0 -10
  47. package/dist/lib/entities/Discount/factory.d.ts.map +0 -1
  48. package/dist/lib/entities/Discount/factory.js +0 -18
  49. package/dist/lib/entities/Discount/index.d.ts +0 -9
  50. package/dist/lib/entities/Discount/index.d.ts.map +0 -1
  51. package/dist/lib/entities/Discount/index.js +0 -8
  52. package/dist/lib/entities/Discount/strategies/BundleStrategy.d.ts +0 -12
  53. package/dist/lib/entities/Discount/strategies/BundleStrategy.d.ts.map +0 -1
  54. package/dist/lib/entities/Discount/strategies/BundleStrategy.js +0 -78
  55. package/dist/lib/entities/Discount/strategies/__tests__/BundleStrategy.test.d.ts +0 -2
  56. package/dist/lib/entities/Discount/strategies/__tests__/BundleStrategy.test.d.ts.map +0 -1
  57. package/dist/lib/entities/Discount/strategies/__tests__/BundleStrategy.test.js +0 -265
  58. package/dist/lib/entities/Discount/strategy.d.ts +0 -6
  59. package/dist/lib/entities/Discount/strategy.d.ts.map +0 -1
  60. package/dist/lib/entities/Discount/strategy.js +0 -1
  61. package/dist/lib/entities/Discount/types.d.ts +0 -148
  62. package/dist/lib/entities/Discount/types.d.ts.map +0 -1
  63. package/dist/lib/entities/Discount/types.js +0 -29
  64. package/dist/lib/entities/Discount/utils.d.ts +0 -29
  65. package/dist/lib/entities/Discount/utils.d.ts.map +0 -1
  66. package/dist/lib/entities/Discount/utils.js +0 -39
  67. package/dist/lib/entities/FavoriteProduct.d.ts +0 -25
  68. package/dist/lib/entities/FavoriteProduct.d.ts.map +0 -1
  69. package/dist/lib/entities/FavoriteProduct.js +0 -9
  70. package/dist/lib/entities/Invoice.d.ts +0 -210
  71. package/dist/lib/entities/Invoice.d.ts.map +0 -1
  72. package/dist/lib/entities/Invoice.js +0 -49
  73. package/dist/lib/entities/Locale.d.ts +0 -22
  74. package/dist/lib/entities/Locale.d.ts.map +0 -1
  75. package/dist/lib/entities/Locale.js +0 -6
  76. package/dist/lib/entities/Order.d.ts +0 -1803
  77. package/dist/lib/entities/Order.d.ts.map +0 -1
  78. package/dist/lib/entities/Order.js +0 -61
  79. package/dist/lib/entities/Organization.d.ts +0 -100
  80. package/dist/lib/entities/Organization.d.ts.map +0 -1
  81. package/dist/lib/entities/Organization.js +0 -16
  82. package/dist/lib/entities/Product.d.ts +0 -694
  83. package/dist/lib/entities/Product.d.ts.map +0 -1
  84. package/dist/lib/entities/Product.js +0 -61
  85. package/dist/lib/entities/Profile.d.ts +0 -98
  86. package/dist/lib/entities/Profile.d.ts.map +0 -1
  87. package/dist/lib/entities/Profile.js +0 -50
  88. package/dist/lib/entities/Store.d.ts +0 -47
  89. package/dist/lib/entities/Store.d.ts.map +0 -1
  90. package/dist/lib/entities/Store.js +0 -17
  91. package/dist/lib/entities/index.d.ts +0 -15
  92. package/dist/lib/entities/index.d.ts.map +0 -1
  93. package/dist/lib/entities/index.js +0 -14
  94. package/dist/lib/firebase-api/app.d.ts +0 -2
  95. package/dist/lib/firebase-api/app.d.ts.map +0 -1
  96. package/dist/lib/firebase-api/app.js +0 -16
  97. package/dist/lib/firebase-api/index.d.ts +0 -75
  98. package/dist/lib/firebase-api/index.d.ts.map +0 -1
  99. package/dist/lib/firebase-api/index.js +0 -33
  100. package/dist/lib/index.d.ts +0 -4
  101. package/dist/lib/index.d.ts.map +0 -1
  102. package/dist/lib/index.js +0 -3
  103. package/dist/lib/utils/index.d.ts +0 -109
  104. package/dist/lib/utils/index.d.ts.map +0 -1
  105. package/dist/lib/utils/index.js +0 -95
  106. package/dist/tsconfig.app.tsbuildinfo +0 -1
  107. package/dist/tsconfig.node.tsbuildinfo +0 -1
  108. package/dist/vite.config.d.ts +0 -3
  109. package/dist/vite.config.d.ts.map +0 -1
  110. package/dist/vite.config.js +0 -25
@@ -1,61 +0,0 @@
1
- import { z } from "zod";
2
- import { LocaleSchema } from "./Locale";
3
- import { CategorySchema } from "./Category";
4
- const text = z.string().min(1);
5
- export const ProductSchema = z.object({
6
- type: z.literal("Product"),
7
- storeId: text,
8
- companyId: text,
9
- id: text,
10
- objectID: text,
11
- sku: text,
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
- isDiscountable: z.boolean({ description: "included in store discounts" }).optional(),
29
- weight: z.object({
30
- value: z.number(),
31
- unit: z.enum(["kg", "gram", "none"]),
32
- }),
33
- volume: z.object({
34
- value: z.number(),
35
- unit: z.enum(["liter", "ml", "none"]),
36
- }),
37
- images: z.array(z.object({ url: z.string().url(), id: z.string() })),
38
- manufacturer: z.string(),
39
- brand: z.string(),
40
- importer: z.string(),
41
- supplier: z.string(),
42
- ingredients: z.array(LocaleSchema),
43
- created_at: z.number(),
44
- updated_at: z.number(),
45
- categoryIds: z.array(z.string().nonempty()),
46
- // @deprecated
47
- categoryList: z.array(CategorySchema).optional(),
48
- // @deprecated
49
- categories: z.object({
50
- lvl0: z.array(z.string()),
51
- lvl1: z.array(z.string()),
52
- lvl2: z.array(z.string()),
53
- lvl3: z.array(z.string()),
54
- lvl4: z.array(z.string()),
55
- }).optional(),
56
- // @deprecated
57
- categoryNames: z.array(z.string()).optional(),
58
- });
59
- export const NewProductSchema = ProductSchema.extend({
60
- image: z.instanceof(File).optional(),
61
- });
@@ -1,98 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ProfilePaymentTypeSchema: z.ZodEnum<["default", "delayed"]>;
3
- export type TProfilePaymentType = z.infer<typeof ProfilePaymentTypeSchema>;
4
- export declare const ProfileSchema: z.ZodObject<{
5
- type: z.ZodLiteral<"Profile">;
6
- id: z.ZodString;
7
- companyId: z.ZodString;
8
- storeId: z.ZodString;
9
- tenantId: z.ZodString;
10
- clientType: z.ZodEnum<["user", "company"]>;
11
- companyName: z.ZodOptional<z.ZodString>;
12
- displayName: z.ZodString;
13
- email: z.ZodString;
14
- phoneNumber: z.ZodOptional<z.ZodString>;
15
- address: z.ZodOptional<z.ZodObject<{
16
- country: z.ZodOptional<z.ZodString>;
17
- city: z.ZodOptional<z.ZodString>;
18
- street: z.ZodOptional<z.ZodString>;
19
- streetNumber: z.ZodOptional<z.ZodString>;
20
- floor: z.ZodOptional<z.ZodString>;
21
- apartmentEnterNumber: z.ZodOptional<z.ZodString>;
22
- apartmentNumber: z.ZodOptional<z.ZodString>;
23
- }, "strip", z.ZodTypeAny, {
24
- country?: string | undefined;
25
- city?: string | undefined;
26
- street?: string | undefined;
27
- streetNumber?: string | undefined;
28
- floor?: string | undefined;
29
- apartmentEnterNumber?: string | undefined;
30
- apartmentNumber?: string | undefined;
31
- }, {
32
- country?: string | undefined;
33
- city?: string | undefined;
34
- street?: string | undefined;
35
- streetNumber?: string | undefined;
36
- floor?: string | undefined;
37
- apartmentEnterNumber?: string | undefined;
38
- apartmentNumber?: string | undefined;
39
- }>>;
40
- isAnonymous: z.ZodBoolean;
41
- createdDate: z.ZodNumber;
42
- lastActivityDate: z.ZodNumber;
43
- paymentType: z.ZodEnum<["default", "delayed"]>;
44
- organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
- }, "strip", z.ZodTypeAny, {
46
- type: "Profile";
47
- id: string;
48
- companyId: string;
49
- storeId: string;
50
- tenantId: string;
51
- clientType: "user" | "company";
52
- displayName: string;
53
- email: string;
54
- isAnonymous: boolean;
55
- createdDate: number;
56
- lastActivityDate: number;
57
- paymentType: "default" | "delayed";
58
- companyName?: string | undefined;
59
- phoneNumber?: string | undefined;
60
- address?: {
61
- country?: string | undefined;
62
- city?: string | undefined;
63
- street?: string | undefined;
64
- streetNumber?: string | undefined;
65
- floor?: string | undefined;
66
- apartmentEnterNumber?: string | undefined;
67
- apartmentNumber?: string | undefined;
68
- } | undefined;
69
- organizationId?: string | null | undefined;
70
- }, {
71
- type: "Profile";
72
- id: string;
73
- companyId: string;
74
- storeId: string;
75
- tenantId: string;
76
- clientType: "user" | "company";
77
- displayName: string;
78
- email: string;
79
- isAnonymous: boolean;
80
- createdDate: number;
81
- lastActivityDate: number;
82
- paymentType: "default" | "delayed";
83
- companyName?: string | undefined;
84
- phoneNumber?: string | undefined;
85
- address?: {
86
- country?: string | undefined;
87
- city?: string | undefined;
88
- street?: string | undefined;
89
- streetNumber?: string | undefined;
90
- floor?: string | undefined;
91
- apartmentEnterNumber?: string | undefined;
92
- apartmentNumber?: string | undefined;
93
- } | undefined;
94
- organizationId?: string | null | undefined;
95
- }>;
96
- export type TProfile = z.infer<typeof ProfileSchema>;
97
- export declare function createEmptyProfile(): TProfile;
98
- //# 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;AAIxB,eAAO,MAAM,wBAAwB,mCAEnC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE3E,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAErD,wBAAgB,kBAAkB,IAAI,QAAQ,CAyB7C"}
@@ -1,50 +0,0 @@
1
- import { z } from "zod";
2
- import { AddressSchema } from "./Address";
3
- import { notEmptyTextSchema } from "./Atoms";
4
- export const ProfilePaymentTypeSchema = z.enum(["default", "delayed"], {
5
- description: "delayed is J5 transaction",
6
- });
7
- export const ProfileSchema = z.object({
8
- type: z.literal("Profile"),
9
- id: notEmptyTextSchema,
10
- companyId: notEmptyTextSchema,
11
- storeId: notEmptyTextSchema,
12
- tenantId: notEmptyTextSchema,
13
- clientType: z.enum(["user", "company"]),
14
- companyName: z.string().optional(),
15
- displayName: notEmptyTextSchema,
16
- email: z.string().email(),
17
- phoneNumber: z.string().optional(),
18
- address: AddressSchema.optional(),
19
- isAnonymous: z.boolean(),
20
- createdDate: z.number(),
21
- lastActivityDate: z.number(),
22
- paymentType: ProfilePaymentTypeSchema,
23
- organizationId: z.string().optional().nullable(),
24
- });
25
- export function createEmptyProfile() {
26
- return {
27
- type: "Profile",
28
- id: "",
29
- companyId: "",
30
- storeId: "",
31
- tenantId: "",
32
- clientType: "user",
33
- displayName: "",
34
- email: "",
35
- phoneNumber: "",
36
- address: {
37
- country: "",
38
- city: "",
39
- street: "",
40
- streetNumber: "",
41
- floor: "",
42
- apartmentEnterNumber: "",
43
- apartmentNumber: "",
44
- },
45
- createdDate: 0,
46
- lastActivityDate: 0,
47
- isAnonymous: true,
48
- paymentType: ProfilePaymentTypeSchema.Values.default,
49
- };
50
- }
@@ -1,47 +0,0 @@
1
- import { z } from "zod";
2
- export declare const clientTypesSchema: z.ZodEnum<["individual", "company"]>;
3
- export declare const StoreSchema: z.ZodObject<{
4
- id: z.ZodString;
5
- companyId: z.ZodString;
6
- name: z.ZodString;
7
- urls: z.ZodArray<z.ZodString, "many">;
8
- logoUrl: z.ZodString;
9
- tenantId: z.ZodString;
10
- paymentType: z.ZodEnum<["external", "j5"]>;
11
- allowAnonymousClients: z.ZodBoolean;
12
- isVatIncludedInPrice: z.ZodBoolean;
13
- clientTypes: z.ZodArray<z.ZodEnum<["individual", "company"]>, "many">;
14
- minimumOrder: z.ZodOptional<z.ZodNumber>;
15
- freeDeliveryPrice: z.ZodOptional<z.ZodNumber>;
16
- deliveryPrice: z.ZodOptional<z.ZodNumber>;
17
- }, "strip", z.ZodTypeAny, {
18
- id: string;
19
- companyId: string;
20
- name: string;
21
- tenantId: string;
22
- paymentType: "external" | "j5";
23
- isVatIncludedInPrice: boolean;
24
- urls: string[];
25
- logoUrl: string;
26
- allowAnonymousClients: boolean;
27
- clientTypes: ("company" | "individual")[];
28
- deliveryPrice?: number | undefined;
29
- freeDeliveryPrice?: number | undefined;
30
- minimumOrder?: number | undefined;
31
- }, {
32
- id: string;
33
- companyId: string;
34
- name: string;
35
- tenantId: string;
36
- paymentType: "external" | "j5";
37
- isVatIncludedInPrice: boolean;
38
- urls: string[];
39
- logoUrl: string;
40
- allowAnonymousClients: boolean;
41
- clientTypes: ("company" | "individual")[];
42
- deliveryPrice?: number | undefined;
43
- freeDeliveryPrice?: number | undefined;
44
- minimumOrder?: number | undefined;
45
- }>;
46
- export type TStore = z.infer<typeof StoreSchema>;
47
- //# 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,eAAO,MAAM,iBAAiB,sCAAoC,CAAC;AAEnE,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EActB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- import { z } from "zod";
2
- export const clientTypesSchema = z.enum(["individual", "company"]);
3
- export const StoreSchema = z.object({
4
- id: z.string(),
5
- companyId: z.string(),
6
- name: z.string(),
7
- urls: z.array(z.string()),
8
- logoUrl: z.string(),
9
- tenantId: z.string(), // firebase auth tenantId
10
- paymentType: z.enum(["external", "j5"]),
11
- allowAnonymousClients: z.boolean(),
12
- isVatIncludedInPrice: z.boolean(),
13
- clientTypes: z.array(clientTypesSchema),
14
- minimumOrder: z.number().optional(),
15
- freeDeliveryPrice: z.number().optional(),
16
- deliveryPrice: z.number().optional(),
17
- });
@@ -1,15 +0,0 @@
1
- export * from "./Address";
2
- export * from "./Atoms";
3
- export * from "./Cart";
4
- export * from "./Category";
5
- export * from "./Company";
6
- export * from "./FavoriteProduct";
7
- export * from "./Locale";
8
- export * from "./Order";
9
- export * from "./Product";
10
- export * from "./Profile";
11
- export * from "./Store";
12
- export * from "./Discount";
13
- export * from "./Organization";
14
- export * from "./DeliveryNote";
15
- //# 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,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;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
@@ -1,14 +0,0 @@
1
- export * from "./Address";
2
- export * from "./Atoms";
3
- export * from "./Cart";
4
- export * from "./Category";
5
- export * from "./Company";
6
- export * from "./FavoriteProduct";
7
- export * from "./Locale";
8
- export * from "./Order";
9
- export * from "./Product";
10
- export * from "./Profile";
11
- export * from "./Store";
12
- export * from "./Discount";
13
- export * from "./Organization";
14
- export * from "./DeliveryNote";
@@ -1,2 +0,0 @@
1
- export declare const app: import("@firebase/app").FirebaseApp;
2
- //# sourceMappingURL=app.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../lib/firebase-api/app.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,GAAG,qCAAgC,CAAC"}
@@ -1,16 +0,0 @@
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,75 +0,0 @@
1
- export declare const systemCollections: {
2
- readonly stores: "STORES";
3
- readonly companies: "COMPANIES";
4
- };
5
- export declare const storeCollections: {
6
- readonly products: "products";
7
- readonly profiles: "profiles";
8
- readonly cart: "cart";
9
- readonly clients: "clients";
10
- readonly orders: "orders";
11
- readonly categories: "categories";
12
- readonly favorites: "favorites";
13
- readonly payments: "payments";
14
- readonly settings: "settings";
15
- readonly discounts: "discounts";
16
- readonly organizations: "organizations";
17
- readonly invoices: "invoices";
18
- };
19
- export declare const FirestoreApi: {
20
- systemCollections: {
21
- readonly stores: "STORES";
22
- readonly companies: "COMPANIES";
23
- };
24
- storeCollections: {
25
- readonly products: "products";
26
- readonly profiles: "profiles";
27
- readonly cart: "cart";
28
- readonly clients: "clients";
29
- readonly orders: "orders";
30
- readonly categories: "categories";
31
- readonly favorites: "favorites";
32
- readonly payments: "payments";
33
- readonly settings: "settings";
34
- readonly discounts: "discounts";
35
- readonly organizations: "organizations";
36
- readonly invoices: "invoices";
37
- };
38
- getPath: ({ companyId, storeId, collectionName, id, }: {
39
- companyId: string;
40
- storeId: string;
41
- collectionName: keyof typeof storeCollections;
42
- id?: string;
43
- }) => string;
44
- getDocPath: (collectionName: keyof typeof storeCollections) => string;
45
- };
46
- export declare const FirebaseAPI: {
47
- firestore: {
48
- systemCollections: {
49
- readonly stores: "STORES";
50
- readonly companies: "COMPANIES";
51
- };
52
- storeCollections: {
53
- readonly products: "products";
54
- readonly profiles: "profiles";
55
- readonly cart: "cart";
56
- readonly clients: "clients";
57
- readonly orders: "orders";
58
- readonly categories: "categories";
59
- readonly favorites: "favorites";
60
- readonly payments: "payments";
61
- readonly settings: "settings";
62
- readonly discounts: "discounts";
63
- readonly organizations: "organizations";
64
- readonly invoices: "invoices";
65
- };
66
- getPath: ({ companyId, storeId, collectionName, id, }: {
67
- companyId: string;
68
- storeId: string;
69
- collectionName: keyof typeof storeCollections;
70
- id?: string;
71
- }) => string;
72
- getDocPath: (collectionName: keyof typeof storeCollections) => string;
73
- };
74
- };
75
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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;;;;;;;;;;;;;CAanB,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,33 +0,0 @@
1
- export const systemCollections = {
2
- stores: "STORES",
3
- companies: "COMPANIES",
4
- };
5
- export const storeCollections = {
6
- products: "products",
7
- profiles: "profiles",
8
- cart: "cart",
9
- clients: "clients",
10
- orders: "orders",
11
- categories: "categories",
12
- favorites: "favorites",
13
- payments: "payments",
14
- settings: "settings",
15
- discounts: "discounts",
16
- organizations: "organizations",
17
- invoices: "invoices",
18
- };
19
- export const FirestoreApi = {
20
- systemCollections,
21
- storeCollections,
22
- // for client and server
23
- getPath: ({ companyId, storeId, collectionName, id, }) => {
24
- return `${companyId}/${storeId}/${collectionName}${id ? `/${id}` : ""}`;
25
- },
26
- // for firestore events
27
- getDocPath: (collectionName) => {
28
- return `{companyId}/{storeId}/${collectionName}/{id}`;
29
- },
30
- };
31
- export const FirebaseAPI = {
32
- firestore: FirestoreApi,
33
- };
@@ -1,4 +0,0 @@
1
- export * from "./entities";
2
- export * from "./utils";
3
- export { FirebaseAPI } from "./firebase-api";
4
- //# 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;AAC3B,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/lib/index.js DELETED
@@ -1,3 +0,0 @@
1
- export * from "./entities";
2
- export * from "./utils";
3
- export { FirebaseAPI } from "./firebase-api";
@@ -1,109 +0,0 @@
1
- import { TCart, TDiscount } from "../entities";
2
- export declare function getCartCost({ cart, discounts, deliveryPrice, freeDeliveryPrice, isVatIncludedInPrice, }: {
3
- cart: TCart["items"];
4
- discounts: TDiscount[];
5
- deliveryPrice?: number;
6
- freeDeliveryPrice?: number;
7
- isVatIncludedInPrice?: boolean;
8
- }): {
9
- discount: number;
10
- cost: number;
11
- finalCost: number;
12
- vat: number;
13
- productsCost: number;
14
- deliveryPrice: number;
15
- items: {
16
- amount: number;
17
- product: {
18
- type: "Product";
19
- id: string;
20
- companyId: string;
21
- storeId: string;
22
- objectID: string;
23
- sku: string;
24
- name: {
25
- value: string;
26
- lang: "he";
27
- }[];
28
- description: {
29
- value: string;
30
- lang: "he";
31
- }[];
32
- isPublished: boolean;
33
- vat: boolean;
34
- priceType: {
35
- value: number;
36
- type: "unit" | "kg" | "gram" | "liter" | "ml";
37
- };
38
- price: number;
39
- currency: "ILS";
40
- discount: {
41
- value: number;
42
- type: "number" | "percent" | "none";
43
- };
44
- weight: {
45
- value: number;
46
- unit: "kg" | "gram" | "none";
47
- };
48
- volume: {
49
- value: number;
50
- unit: "liter" | "ml" | "none";
51
- };
52
- images: {
53
- url: string;
54
- id: string;
55
- }[];
56
- manufacturer: string;
57
- brand: string;
58
- importer: string;
59
- supplier: string;
60
- ingredients: {
61
- value: string;
62
- lang: "he";
63
- }[];
64
- created_at: number;
65
- updated_at: number;
66
- categoryIds: string[];
67
- purchasePrice?: number | undefined;
68
- profitPercentage?: number | undefined;
69
- isDiscountable?: boolean | undefined;
70
- categoryList?: ({
71
- id: string;
72
- companyId: string;
73
- storeId: string;
74
- locales: {
75
- value: string;
76
- lang: "he";
77
- }[];
78
- depth: number;
79
- parentId?: string | null | undefined;
80
- tag?: string | undefined;
81
- } & {
82
- children: ({
83
- id: string;
84
- companyId: string;
85
- storeId: string;
86
- locales: {
87
- value: string;
88
- lang: "he";
89
- }[];
90
- depth: number;
91
- parentId?: string | null | undefined;
92
- tag?: string | undefined;
93
- } & /*elided*/ any)[];
94
- })[] | undefined;
95
- categories?: {
96
- lvl0: string[];
97
- lvl1: string[];
98
- lvl2: string[];
99
- lvl3: string[];
100
- lvl4: string[];
101
- } | undefined;
102
- categoryNames?: string[] | undefined;
103
- };
104
- originalPrice: number;
105
- finalPrice: number;
106
- finalDiscount: number;
107
- }[];
108
- };
109
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAoB,MAAM,aAAa,CAAC;AA8BjE,wBAAgB,WAAW,CAAC,EAC3B,IAAI,EACJ,SAAS,EACT,aAAiB,EACjB,iBAAqB,EACrB,oBAA4B,GAC5B,EAAE;IACF,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACrB,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoFA"}