@jsdev_ninja/core 0.8.0 → 0.8.2

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.
@@ -6,6 +6,7 @@ export declare const OrderSchema: z.ZodObject<{
6
6
  storeId: z.ZodString;
7
7
  userId: z.ZodString;
8
8
  status: z.ZodEnum<["pending", "processing", "delivered", "canceled", "completed", "refunded"]>;
9
+ paymentStatus: z.ZodEnum<["pending", "completed", "failed", "refunded"]>;
9
10
  cart: z.ZodObject<{
10
11
  id: z.ZodString;
11
12
  items: z.ZodArray<z.ZodObject<{
@@ -812,31 +813,6 @@ export declare const OrderSchema: z.ZodObject<{
812
813
  createdDate: number;
813
814
  lastActivityDate: number;
814
815
  }>;
815
- address: z.ZodObject<{
816
- country: z.ZodString;
817
- city: z.ZodString;
818
- street: z.ZodString;
819
- streetNumber: z.ZodString;
820
- floor: z.ZodString;
821
- apartmentEnterNumber: z.ZodString;
822
- apartmentNumber: z.ZodString;
823
- }, "strip", z.ZodTypeAny, {
824
- country: string;
825
- city: string;
826
- street: string;
827
- streetNumber: string;
828
- floor: string;
829
- apartmentEnterNumber: string;
830
- apartmentNumber: string;
831
- }, {
832
- country: string;
833
- city: string;
834
- street: string;
835
- streetNumber: string;
836
- floor: string;
837
- apartmentEnterNumber: string;
838
- apartmentNumber: string;
839
- }>;
840
816
  }, "strip", z.ZodTypeAny, {
841
817
  type: "Order";
842
818
  status: "pending" | "processing" | "delivered" | "canceled" | "completed" | "refunded";
@@ -844,16 +820,8 @@ export declare const OrderSchema: z.ZodObject<{
844
820
  id: string;
845
821
  companyId: string;
846
822
  storeId: string;
847
- address: {
848
- country: string;
849
- city: string;
850
- street: string;
851
- streetNumber: string;
852
- floor: string;
853
- apartmentEnterNumber: string;
854
- apartmentNumber: string;
855
- };
856
823
  userId: string;
824
+ paymentStatus: "pending" | "completed" | "refunded" | "failed";
857
825
  cart: {
858
826
  id: string;
859
827
  items: {
@@ -982,16 +950,8 @@ export declare const OrderSchema: z.ZodObject<{
982
950
  id: string;
983
951
  companyId: string;
984
952
  storeId: string;
985
- address: {
986
- country: string;
987
- city: string;
988
- street: string;
989
- streetNumber: string;
990
- floor: string;
991
- apartmentEnterNumber: string;
992
- apartmentNumber: string;
993
- };
994
953
  userId: string;
954
+ paymentStatus: "pending" | "completed" | "refunded" | "failed";
995
955
  cart: {
996
956
  id: string;
997
957
  items: {
@@ -1 +1 @@
1
- {"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../lib/entities/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { AddressSchema } from "./Address";
3
2
  import { ProfileSchema } from "./Profile";
4
3
  import { ProductSchema } from "./Product";
5
4
  // pending - order created / by user
@@ -7,7 +6,6 @@ import { ProductSchema } from "./Product";
7
6
  // delivered - order delivered by admin
8
7
  // canceled - order canceled by user/admin
9
8
  // completed - order paid by admin
10
- // type PaymentStatus = "pending" | "completed" | "failed" | "refunded" | "partially_refunded";
11
9
  // type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
12
10
  export const OrderSchema = z.object({
13
11
  type: z.literal("Order"),
@@ -16,6 +14,7 @@ export const OrderSchema = z.object({
16
14
  storeId: z.string(),
17
15
  userId: z.string(),
18
16
  status: z.enum(["pending", "processing", "delivered", "canceled", "completed", "refunded"]),
17
+ paymentStatus: z.enum(["pending", "completed", "failed", "refunded"]),
19
18
  cart: z.object({
20
19
  id: z.string(),
21
20
  items: z.array(z.object({ product: ProductSchema, amount: z.number() })),
@@ -26,5 +25,4 @@ export const OrderSchema = z.object({
26
25
  date: z.number(),
27
26
  deliveryDate: z.number().optional(),
28
27
  client: ProfileSchema,
29
- address: AddressSchema,
30
28
  });
@@ -0,0 +1,44 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,15 @@
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
+ });
@@ -0,0 +1,2 @@
1
+ export declare const FirebaseAPI: {};
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,IAAK,CAAC"}
@@ -0,0 +1,12 @@
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 = {};
@@ -1 +1 @@
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/index.ts"],"version":"5.7.2"}
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,5 +1,4 @@
1
1
  import { z } from "zod";
2
- import { AddressSchema } from "./Address";
3
2
  import { ProfileSchema } from "./Profile";
4
3
  import { ProductSchema } from "./Product";
5
4
 
@@ -9,8 +8,6 @@ import { ProductSchema } from "./Product";
9
8
  // canceled - order canceled by user/admin
10
9
  // completed - order paid by admin
11
10
 
12
- // type PaymentStatus = "pending" | "completed" | "failed" | "refunded" | "partially_refunded";
13
-
14
11
  // type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
15
12
 
16
13
  export const OrderSchema = z.object({
@@ -20,6 +17,7 @@ export const OrderSchema = z.object({
20
17
  storeId: z.string(),
21
18
  userId: z.string(),
22
19
  status: z.enum(["pending", "processing", "delivered", "canceled", "completed", "refunded"]),
20
+ paymentStatus: z.enum(["pending", "completed", "failed", "refunded"]),
23
21
  cart: z.object({
24
22
  id: z.string(),
25
23
  items: z.array(z.object({ product: ProductSchema, amount: z.number() })),
@@ -30,7 +28,6 @@ export const OrderSchema = z.object({
30
28
  date: z.number(),
31
29
  deliveryDate: z.number().optional(),
32
30
  client: ProfileSchema,
33
- address: AddressSchema,
34
31
  });
35
32
 
36
33
  export type TOrder = z.infer<typeof OrderSchema>;
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+
3
+ 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
+ paymentMethods: z
11
+ .array(
12
+ z.object({
13
+ clientType: z.enum(["user", "company"]),
14
+ method: z.enum(["internal", "external"]),
15
+ })
16
+ )
17
+ .optional(),
18
+ });
19
+
20
+ export type TStore = z.infer<typeof StoreSchema>;
@@ -0,0 +1,13 @@
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
+
13
+ export const FirebaseAPI = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsdev_ninja/core",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "main": "dist/core.cjs.js",
5
5
  "module": "dist/core.es.js",
6
6
  "types": "dist/index.d.ts",