@jsdev_ninja/core 0.8.0 → 0.8.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.
- package/dist/core.cjs.js +1 -1
- package/dist/core.cjs.js.map +1 -1
- package/dist/core.es.js +1 -0
- package/dist/core.es.js.map +1 -1
- package/dist/core.umd.js +1 -1
- package/dist/core.umd.js.map +1 -1
- package/dist/entities/Order.d.ts +3 -0
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Order.js +1 -1
- package/dist/entities/Store.d.ts +44 -0
- package/dist/entities/Store.d.ts.map +1 -0
- package/dist/entities/Store.js +15 -0
- package/dist/firebase-api/index.d.ts +2 -0
- package/dist/firebase-api/index.d.ts.map +1 -0
- package/dist/firebase-api/index.js +12 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/lib/entities/Order.ts +1 -2
- package/lib/entities/Store.ts +20 -0
- package/lib/firebase-api/index.ts +13 -0
- package/package.json +1 -1
package/dist/entities/Order.d.ts
CHANGED
|
@@ -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<{
|
|
@@ -854,6 +855,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
854
855
|
apartmentNumber: string;
|
|
855
856
|
};
|
|
856
857
|
userId: string;
|
|
858
|
+
paymentStatus: "pending" | "completed" | "refunded" | "failed";
|
|
857
859
|
cart: {
|
|
858
860
|
id: string;
|
|
859
861
|
items: {
|
|
@@ -992,6 +994,7 @@ export declare const OrderSchema: z.ZodObject<{
|
|
|
992
994
|
apartmentNumber: string;
|
|
993
995
|
};
|
|
994
996
|
userId: string;
|
|
997
|
+
paymentStatus: "pending" | "completed" | "refunded" | "failed";
|
|
995
998
|
cart: {
|
|
996
999
|
id: string;
|
|
997
1000
|
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;
|
|
1
|
+
{"version":3,"file":"Order.d.ts","sourceRoot":"","sources":["../../lib/entities/Order.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBtB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/entities/Order.js
CHANGED
|
@@ -7,7 +7,6 @@ import { ProductSchema } from "./Product";
|
|
|
7
7
|
// delivered - order delivered by admin
|
|
8
8
|
// canceled - order canceled by user/admin
|
|
9
9
|
// completed - order paid by admin
|
|
10
|
-
// type PaymentStatus = "pending" | "completed" | "failed" | "refunded" | "partially_refunded";
|
|
11
10
|
// type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
|
|
12
11
|
export const OrderSchema = z.object({
|
|
13
12
|
type: z.literal("Order"),
|
|
@@ -16,6 +15,7 @@ export const OrderSchema = z.object({
|
|
|
16
15
|
storeId: z.string(),
|
|
17
16
|
userId: z.string(),
|
|
18
17
|
status: z.enum(["pending", "processing", "delivered", "canceled", "completed", "refunded"]),
|
|
18
|
+
paymentStatus: z.enum(["pending", "completed", "failed", "refunded"]),
|
|
19
19
|
cart: z.object({
|
|
20
20
|
id: z.string(),
|
|
21
21
|
items: z.array(z.object({ product: ProductSchema, amount: z.number() })),
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/firebase-api/index.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,IAAK,CAAC"}
|
|
@@ -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"}
|
package/lib/entities/Order.ts
CHANGED
|
@@ -9,8 +9,6 @@ import { ProductSchema } from "./Product";
|
|
|
9
9
|
// canceled - order canceled by user/admin
|
|
10
10
|
// completed - order paid by admin
|
|
11
11
|
|
|
12
|
-
// type PaymentStatus = "pending" | "completed" | "failed" | "refunded" | "partially_refunded";
|
|
13
|
-
|
|
14
12
|
// type PaymentMethod = "credit_card" | "paypal" | "bank_transfer" | "cash_on_delivery";
|
|
15
13
|
|
|
16
14
|
export const OrderSchema = z.object({
|
|
@@ -20,6 +18,7 @@ export const OrderSchema = z.object({
|
|
|
20
18
|
storeId: z.string(),
|
|
21
19
|
userId: z.string(),
|
|
22
20
|
status: z.enum(["pending", "processing", "delivered", "canceled", "completed", "refunded"]),
|
|
21
|
+
paymentStatus: z.enum(["pending", "completed", "failed", "refunded"]),
|
|
23
22
|
cart: z.object({
|
|
24
23
|
id: z.string(),
|
|
25
24
|
items: z.array(z.object({ product: ProductSchema, amount: z.number() })),
|
|
@@ -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 = {};
|