@jsdev_ninja/core 0.12.9 → 0.12.11
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 +8 -8
- 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/Cart.d.ts +90 -90
- package/dist/entities/Order.d.ts +72 -72
- package/dist/entities/Order.d.ts.map +1 -1
- package/dist/entities/Order.js +1 -1
- package/dist/entities/Product.d.ts +42 -42
- package/dist/entities/Product.js +3 -3
- package/dist/entities/Profile.d.ts.map +1 -1
- package/dist/entities/Profile.js +3 -1
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.js +3 -3
- package/lib/entities/Order.ts +1 -2
- package/lib/entities/Product.ts +3 -3
- package/lib/entities/Profile.ts +3 -1
- package/package.json +1 -1
package/lib/entities/Order.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ProfileSchema } from "./Profile";
|
|
3
|
-
import { ProductSchema } from "./Product";
|
|
4
3
|
import { notEmptyTextSchema } from "./Atoms";
|
|
5
4
|
import { CartItemProductSchema } from "./Cart";
|
|
6
5
|
|
|
@@ -39,7 +38,7 @@ export const OrderSchema = z.object({
|
|
|
39
38
|
originalAmount: z.number().positive().optional(), // what client pay
|
|
40
39
|
actualAmount: z.number().positive().optional(), // what store charge
|
|
41
40
|
date: z.number(),
|
|
42
|
-
deliveryDate: z.coerce.number()
|
|
41
|
+
deliveryDate: z.coerce.number(),
|
|
43
42
|
client: ProfileSchema.required({}),
|
|
44
43
|
nameOnInvoice: z.string().optional(),
|
|
45
44
|
clientComment: z.string().optional(),
|
package/lib/entities/Product.ts
CHANGED
|
@@ -47,7 +47,7 @@ export const ProductSchema = z.object({
|
|
|
47
47
|
categoryIds: z.array(z.string().nonempty()),
|
|
48
48
|
|
|
49
49
|
// @deprecated
|
|
50
|
-
categoryList: z.array(CategorySchema),
|
|
50
|
+
categoryList: z.array(CategorySchema).optional(),
|
|
51
51
|
// @deprecated
|
|
52
52
|
categories: z.object({
|
|
53
53
|
lvl0: z.array(z.string()),
|
|
@@ -55,9 +55,9 @@ export const ProductSchema = z.object({
|
|
|
55
55
|
lvl2: z.array(z.string()),
|
|
56
56
|
lvl3: z.array(z.string()),
|
|
57
57
|
lvl4: z.array(z.string()),
|
|
58
|
-
}),
|
|
58
|
+
}).optional(),
|
|
59
59
|
// @deprecated
|
|
60
|
-
categoryNames: z.array(z.string()),
|
|
60
|
+
categoryNames: z.array(z.string()).optional(),
|
|
61
61
|
});
|
|
62
62
|
export type TProduct = z.infer<typeof ProductSchema>;
|
|
63
63
|
|
package/lib/entities/Profile.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { z } from "zod";
|
|
|
2
2
|
import { AddressSchema } from "./Address";
|
|
3
3
|
import { notEmptyTextSchema } from "./Atoms";
|
|
4
4
|
|
|
5
|
-
export const ProfilePaymentTypeSchema = z.enum(["default", "delayed"]
|
|
5
|
+
export const ProfilePaymentTypeSchema = z.enum(["default", "delayed"], {
|
|
6
|
+
description: "delayed is J5 transaction",
|
|
7
|
+
});
|
|
6
8
|
export type TProfilePaymentType = z.infer<typeof ProfilePaymentTypeSchema>;
|
|
7
9
|
|
|
8
10
|
export const ProfileSchema = z.object({
|