@jsdev_ninja/core 0.10.4 → 0.10.5
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 +486 -469
- 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/Discount.d.ts +68 -0
- package/dist/entities/Discount.d.ts.map +1 -0
- package/dist/entities/Discount.js +19 -0
- package/dist/entities/index.d.ts +1 -0
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +1 -0
- package/dist/firebase-api/index.d.ts +3 -0
- package/dist/firebase-api/index.d.ts.map +1 -1
- package/dist/firebase-api/index.js +1 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/lib/entities/Discount.ts +22 -0
- package/lib/entities/index.ts +1 -0
- package/lib/firebase-api/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DiscountSchema: z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"Discount">;
|
|
4
|
+
storeId: z.ZodString;
|
|
5
|
+
companyId: z.ZodString;
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
name: z.ZodArray<z.ZodObject<{
|
|
8
|
+
lang: z.ZodEnum<["he"]>;
|
|
9
|
+
value: z.ZodString;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
value: string;
|
|
12
|
+
lang: "he";
|
|
13
|
+
}, {
|
|
14
|
+
value: string;
|
|
15
|
+
lang: "he";
|
|
16
|
+
}>, "many">;
|
|
17
|
+
active: z.ZodBoolean;
|
|
18
|
+
variant: z.ZodDiscriminatedUnion<"variantType", [z.ZodObject<{
|
|
19
|
+
variantType: z.ZodLiteral<"bundle">;
|
|
20
|
+
productsId: z.ZodArray<z.ZodString, "many">;
|
|
21
|
+
requiredQuantity: z.ZodNumber;
|
|
22
|
+
discountPrice: z.ZodNumber;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
variantType: "bundle";
|
|
25
|
+
productsId: string[];
|
|
26
|
+
requiredQuantity: number;
|
|
27
|
+
discountPrice: number;
|
|
28
|
+
}, {
|
|
29
|
+
variantType: "bundle";
|
|
30
|
+
productsId: string[];
|
|
31
|
+
requiredQuantity: number;
|
|
32
|
+
discountPrice: number;
|
|
33
|
+
}>]>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
type: "Discount";
|
|
36
|
+
id: string;
|
|
37
|
+
companyId: string;
|
|
38
|
+
storeId: string;
|
|
39
|
+
name: {
|
|
40
|
+
value: string;
|
|
41
|
+
lang: "he";
|
|
42
|
+
}[];
|
|
43
|
+
active: boolean;
|
|
44
|
+
variant: {
|
|
45
|
+
variantType: "bundle";
|
|
46
|
+
productsId: string[];
|
|
47
|
+
requiredQuantity: number;
|
|
48
|
+
discountPrice: number;
|
|
49
|
+
};
|
|
50
|
+
}, {
|
|
51
|
+
type: "Discount";
|
|
52
|
+
id: string;
|
|
53
|
+
companyId: string;
|
|
54
|
+
storeId: string;
|
|
55
|
+
name: {
|
|
56
|
+
value: string;
|
|
57
|
+
lang: "he";
|
|
58
|
+
}[];
|
|
59
|
+
active: boolean;
|
|
60
|
+
variant: {
|
|
61
|
+
variantType: "bundle";
|
|
62
|
+
productsId: string[];
|
|
63
|
+
requiredQuantity: number;
|
|
64
|
+
discountPrice: number;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
export type TDiscount = z.infer<typeof DiscountSchema>;
|
|
68
|
+
//# sourceMappingURL=Discount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Discount.d.ts","sourceRoot":"","sources":["../../lib/entities/Discount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAezB,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { LocaleSchema } from "./Locale";
|
|
3
|
+
const text = z.string().min(1);
|
|
4
|
+
export const DiscountSchema = z.object({
|
|
5
|
+
type: z.literal("Discount"),
|
|
6
|
+
storeId: text,
|
|
7
|
+
companyId: text,
|
|
8
|
+
id: text,
|
|
9
|
+
name: z.array(LocaleSchema),
|
|
10
|
+
active: z.boolean(),
|
|
11
|
+
variant: z.discriminatedUnion("variantType", [
|
|
12
|
+
z.object({
|
|
13
|
+
variantType: z.literal("bundle"),
|
|
14
|
+
productsId: z.array(z.string()),
|
|
15
|
+
requiredQuantity: z.number().positive(),
|
|
16
|
+
discountPrice: z.number().positive(),
|
|
17
|
+
}),
|
|
18
|
+
]),
|
|
19
|
+
});
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -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,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;AACxB,cAAc,YAAY,CAAC"}
|
package/dist/entities/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export declare const storeCollections: {
|
|
|
12
12
|
readonly favorites: "favorites";
|
|
13
13
|
readonly payments: "payments";
|
|
14
14
|
readonly settings: "settings";
|
|
15
|
+
readonly discounts: "discounts";
|
|
15
16
|
};
|
|
16
17
|
export declare const FirestoreApi: {
|
|
17
18
|
systemCollections: {
|
|
@@ -28,6 +29,7 @@ export declare const FirestoreApi: {
|
|
|
28
29
|
readonly favorites: "favorites";
|
|
29
30
|
readonly payments: "payments";
|
|
30
31
|
readonly settings: "settings";
|
|
32
|
+
readonly discounts: "discounts";
|
|
31
33
|
};
|
|
32
34
|
getPath: ({ companyId, storeId, collectionName, id, }: {
|
|
33
35
|
companyId: string;
|
|
@@ -53,6 +55,7 @@ export declare const FirebaseAPI: {
|
|
|
53
55
|
readonly favorites: "favorites";
|
|
54
56
|
readonly payments: "payments";
|
|
55
57
|
readonly settings: "settings";
|
|
58
|
+
readonly discounts: "discounts";
|
|
56
59
|
};
|
|
57
60
|
getPath: ({ companyId, storeId, collectionName, id, }: {
|
|
58
61
|
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
|
|
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;;;;;;;;;;;CAWnB,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 +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/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
|
+
{"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/discount.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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { LocaleSchema } from "./Locale";
|
|
3
|
+
|
|
4
|
+
const text = z.string().min(1);
|
|
5
|
+
|
|
6
|
+
export const DiscountSchema = z.object({
|
|
7
|
+
type: z.literal("Discount"),
|
|
8
|
+
storeId: text,
|
|
9
|
+
companyId: text,
|
|
10
|
+
id: text,
|
|
11
|
+
name: z.array(LocaleSchema),
|
|
12
|
+
active: z.boolean(),
|
|
13
|
+
variant: z.discriminatedUnion("variantType", [
|
|
14
|
+
z.object({
|
|
15
|
+
variantType: z.literal("bundle"),
|
|
16
|
+
productsId: z.array(z.string()).min(1),
|
|
17
|
+
requiredQuantity: z.number().positive(),
|
|
18
|
+
discountPrice: z.number().positive(),
|
|
19
|
+
}),
|
|
20
|
+
]),
|
|
21
|
+
});
|
|
22
|
+
export type TDiscount = z.infer<typeof DiscountSchema>;
|
package/lib/entities/index.ts
CHANGED