@lyxa.ai/core 1.0.241 → 1.0.242
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/libraries/mongo/models/user.model.d.ts +1 -1
- package/dist/types/README.md +1 -1
- package/dist/types/package.json +1 -1
- package/dist/types/utilities/validation/common-validation.d.ts +2 -78
- package/dist/types/utilities/validation/global-validation.d.ts +14 -38
- package/dist/utilities/currency.d.ts +2 -0
- package/dist/utilities/currency.js +18 -3
- package/dist/utilities/currency.js.map +1 -1
- package/dist/utilities/validation/common-validation.d.ts +2 -78
- package/dist/utilities/validation/global-validation.d.ts +14 -38
- package/package.json +1 -1
|
@@ -31,7 +31,7 @@ export declare class User extends TimeStamps {
|
|
|
31
31
|
isPhoneVerified?: boolean;
|
|
32
32
|
onlineStatus?: OnlineStatus;
|
|
33
33
|
fcmTokens?: string[];
|
|
34
|
-
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject> & Omit<User & {
|
|
34
|
+
static updateWallet(this: ReturnModelType<typeof User>, userId: string, amount: number): Promise<(import("mongoose").Document<unknown, import("@typegoose/typegoose/lib/types").BeAnObject, User, import("@typegoose/typegoose/lib/types").BeAnyObject, {}> & Omit<User & {
|
|
35
35
|
_id: import("mongoose").Types.ObjectId;
|
|
36
36
|
} & {
|
|
37
37
|
__v: number;
|
package/dist/types/README.md
CHANGED
package/dist/types/package.json
CHANGED
|
@@ -504,7 +504,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
504
504
|
totalPages: number;
|
|
505
505
|
} | undefined;
|
|
506
506
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
507
|
-
}>, any> extends infer T_1 ? { [k in keyof T_1]: z.
|
|
507
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
508
508
|
success: z.ZodBoolean;
|
|
509
509
|
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
510
510
|
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -542,83 +542,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
542
542
|
totalPages: number;
|
|
543
543
|
} | undefined;
|
|
544
544
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
545
|
-
}
|
|
546
|
-
success: z.ZodBoolean;
|
|
547
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
548
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
549
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
550
|
-
page: z.ZodNumber;
|
|
551
|
-
size: z.ZodNumber;
|
|
552
|
-
totalElements: z.ZodNumber;
|
|
553
|
-
totalPages: z.ZodNumber;
|
|
554
|
-
}, "strip", z.ZodTypeAny, {
|
|
555
|
-
size: number;
|
|
556
|
-
page: number;
|
|
557
|
-
totalElements: number;
|
|
558
|
-
totalPages: number;
|
|
559
|
-
}, {
|
|
560
|
-
size: number;
|
|
561
|
-
page: number;
|
|
562
|
-
totalElements: number;
|
|
563
|
-
totalPages: number;
|
|
564
|
-
}>>;
|
|
565
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
566
|
-
}, "strip", z.ZodTypeAny, {
|
|
567
|
-
documents: T[];
|
|
568
|
-
metadata?: {
|
|
569
|
-
size: number;
|
|
570
|
-
page: number;
|
|
571
|
-
totalElements: number;
|
|
572
|
-
totalPages: number;
|
|
573
|
-
} | undefined;
|
|
574
|
-
}, {
|
|
575
|
-
documents: T[];
|
|
576
|
-
metadata?: {
|
|
577
|
-
size: number;
|
|
578
|
-
page: number;
|
|
579
|
-
totalElements: number;
|
|
580
|
-
totalPages: number;
|
|
581
|
-
} | undefined;
|
|
582
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
583
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
584
|
-
success: z.ZodBoolean;
|
|
585
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
586
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
587
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
588
|
-
page: z.ZodNumber;
|
|
589
|
-
size: z.ZodNumber;
|
|
590
|
-
totalElements: z.ZodNumber;
|
|
591
|
-
totalPages: z.ZodNumber;
|
|
592
|
-
}, "strip", z.ZodTypeAny, {
|
|
593
|
-
size: number;
|
|
594
|
-
page: number;
|
|
595
|
-
totalElements: number;
|
|
596
|
-
totalPages: number;
|
|
597
|
-
}, {
|
|
598
|
-
size: number;
|
|
599
|
-
page: number;
|
|
600
|
-
totalElements: number;
|
|
601
|
-
totalPages: number;
|
|
602
|
-
}>>;
|
|
603
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
604
|
-
}, "strip", z.ZodTypeAny, {
|
|
605
|
-
documents: T[];
|
|
606
|
-
metadata?: {
|
|
607
|
-
size: number;
|
|
608
|
-
page: number;
|
|
609
|
-
totalElements: number;
|
|
610
|
-
totalPages: number;
|
|
611
|
-
} | undefined;
|
|
612
|
-
}, {
|
|
613
|
-
documents: T[];
|
|
614
|
-
metadata?: {
|
|
615
|
-
size: number;
|
|
616
|
-
page: number;
|
|
617
|
-
totalElements: number;
|
|
618
|
-
totalPages: number;
|
|
619
|
-
} | undefined;
|
|
620
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
621
|
-
}>[k_1]; } : never>;
|
|
545
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
622
546
|
export declare const TokenSchema: z.ZodObject<{
|
|
623
547
|
accessToken: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
624
548
|
refreshToken: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -60,34 +60,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
60
60
|
private baseSchema;
|
|
61
61
|
constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
|
|
62
62
|
private createBaseSchema;
|
|
63
|
-
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
63
|
+
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
64
64
|
getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
65
65
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
66
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
66
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
67
67
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
68
|
-
}>[k]>; } : never,
|
|
68
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
69
69
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
70
|
-
}> extends infer
|
|
71
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
72
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
73
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
74
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
75
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
76
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
70
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
77
71
|
getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
78
72
|
getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
79
73
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
80
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
81
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
82
|
-
}>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
83
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
84
|
-
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
85
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
86
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
74
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
87
75
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
88
|
-
}> extends infer
|
|
76
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
89
77
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
90
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
78
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
91
79
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
92
80
|
}, "strict", z.ZodTypeAny, {
|
|
93
81
|
[x: string]: any;
|
|
@@ -110,34 +98,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
110
98
|
[x: string]: any;
|
|
111
99
|
}>;
|
|
112
100
|
getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
|
|
113
|
-
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
101
|
+
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
114
102
|
EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
115
103
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
116
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
104
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
117
105
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
118
|
-
}>[k_2]>; } : never,
|
|
106
|
+
}> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
119
107
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
120
|
-
}> extends infer
|
|
121
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
122
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
123
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
124
|
-
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
125
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
126
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
108
|
+
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
127
109
|
IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
128
110
|
UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
129
111
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
130
|
-
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
131
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
132
|
-
}>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
133
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
134
|
-
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
135
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
136
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
112
|
+
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
137
113
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
138
|
-
}> extends infer
|
|
114
|
+
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
139
115
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
140
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
116
|
+
}> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
141
117
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
142
118
|
}, "strict", z.ZodTypeAny, {
|
|
143
119
|
[x: string]: any;
|
|
@@ -2,4 +2,6 @@ import { PaidCurrency } from './enum';
|
|
|
2
2
|
export declare const getRoundingFactor: (currency: PaidCurrency) => Promise<number>;
|
|
3
3
|
export declare const getExchangeRate: () => Promise<number>;
|
|
4
4
|
export declare const roundCurrency: (amount: number, currency: PaidCurrency, roundingFactor?: number) => Promise<number>;
|
|
5
|
+
export declare const roundCurrencySync: (amount: number, roundingFactor: number) => number;
|
|
5
6
|
export declare const convertToSecondary: (amount: number, exchangeRate?: number, roundTo?: number) => Promise<number>;
|
|
7
|
+
export declare const convertToSecondarySync: (price: number, exchangeRate: number, roundTo: number) => number | null;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertToSecondary = exports.roundCurrency = exports.getExchangeRate = exports.getRoundingFactor = void 0;
|
|
3
|
+
exports.convertToSecondarySync = exports.convertToSecondary = exports.roundCurrencySync = exports.roundCurrency = exports.getExchangeRate = exports.getRoundingFactor = void 0;
|
|
4
4
|
const __1 = require("..");
|
|
5
5
|
const enum_1 = require("./enum");
|
|
6
|
-
const DEFAULT_ROUNDING_FACTOR = 0.
|
|
6
|
+
const DEFAULT_ROUNDING_FACTOR = 0.1;
|
|
7
7
|
const DEFAULT_EXCHANGE_RATE = 1;
|
|
8
8
|
const getRoundingFactor = async (currency) => {
|
|
9
9
|
const setting = (await (0, __1.getLibraries)().getCachedSettingsService().getSettings());
|
|
@@ -33,12 +33,27 @@ const getExchangeRate = async () => {
|
|
|
33
33
|
exports.getExchangeRate = getExchangeRate;
|
|
34
34
|
const roundCurrency = async (amount, currency, roundingFactor) => {
|
|
35
35
|
roundingFactor = roundingFactor ?? (await (0, exports.getRoundingFactor)(currency));
|
|
36
|
-
return
|
|
36
|
+
return (0, exports.roundCurrencySync)(amount, roundingFactor);
|
|
37
37
|
};
|
|
38
38
|
exports.roundCurrency = roundCurrency;
|
|
39
|
+
const roundCurrencySync = (amount, roundingFactor) => {
|
|
40
|
+
const rounded = Math.ceil(amount / roundingFactor) * roundingFactor;
|
|
41
|
+
const decimals = (roundingFactor.toString().split('.')[1] || '').length;
|
|
42
|
+
return Number(rounded.toFixed(decimals));
|
|
43
|
+
};
|
|
44
|
+
exports.roundCurrencySync = roundCurrencySync;
|
|
39
45
|
const convertToSecondary = async (amount, exchangeRate, roundTo) => {
|
|
40
46
|
exchangeRate = exchangeRate ?? (await (0, exports.getExchangeRate)());
|
|
41
47
|
return (0, exports.roundCurrency)(amount * exchangeRate, enum_1.PaidCurrency.SECONDARY, roundTo);
|
|
42
48
|
};
|
|
43
49
|
exports.convertToSecondary = convertToSecondary;
|
|
50
|
+
const convertToSecondarySync = (price, exchangeRate, roundTo) => {
|
|
51
|
+
if (price == null)
|
|
52
|
+
return null;
|
|
53
|
+
const amount = price * exchangeRate;
|
|
54
|
+
if (!roundTo)
|
|
55
|
+
return amount;
|
|
56
|
+
return (0, exports.roundCurrencySync)(amount, roundTo);
|
|
57
|
+
};
|
|
58
|
+
exports.convertToSecondarySync = convertToSecondarySync;
|
|
44
59
|
//# sourceMappingURL=currency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currency.js","sourceRoot":"/","sources":["utilities/currency.ts"],"names":[],"mappings":";;;AAAA,0BAAkC;AAGlC,iCAAsC;AAEtC,MAAM,uBAAuB,GAAG,
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"/","sources":["utilities/currency.ts"],"names":[],"mappings":"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","sourcesContent":["import { getLibraries } from '..';\n\nimport { Setting } from '../libraries/mongo/models';\nimport { PaidCurrency } from './enum';\n\nconst DEFAULT_ROUNDING_FACTOR = 0.1;\nconst DEFAULT_EXCHANGE_RATE = 1;\n\nexport const getRoundingFactor = async (currency: PaidCurrency): Promise<number> => {\n\tconst setting = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\tconst currencySetting = setting.currencySetting;\n\tlet roundingFactor: number | undefined;\n\tif (currencySetting) {\n\t\tswitch (currency) {\n\t\t\tcase PaidCurrency.BASE:\n\t\t\t\troundingFactor = currencySetting.baseCurrency?.roundTo;\n\t\t\t\tbreak;\n\t\t\tcase PaidCurrency.SECONDARY:\n\t\t\t\troundingFactor = currencySetting.secondaryCurrency?.roundTo;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\troundingFactor = DEFAULT_ROUNDING_FACTOR;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn roundingFactor || DEFAULT_ROUNDING_FACTOR;\n};\n\nexport const getExchangeRate = async (): Promise<number> => {\n\tconst settings = (await getLibraries().getCachedSettingsService().getSettings()) as Setting;\n\tconst currencySetting = settings.currencySetting;\n\treturn currencySetting?.exchangeRate || DEFAULT_EXCHANGE_RATE;\n};\n\nexport const roundCurrency = async (\n\tamount: number,\n\tcurrency: PaidCurrency,\n\troundingFactor?: number\n): Promise<number> => {\n\troundingFactor = roundingFactor ?? (await getRoundingFactor(currency));\n\treturn roundCurrencySync(amount, roundingFactor);\n};\n\nexport const roundCurrencySync = (\n\tamount: number,\n\troundingFactor: number\n): number => {\n\tconst rounded = Math.ceil(amount / roundingFactor) * roundingFactor;\n\tconst decimals = (roundingFactor.toString().split('.')[1] || '').length;\n\treturn Number(rounded.toFixed(decimals));\n};\n\nexport const convertToSecondary = async (\n\tamount: number,\n\texchangeRate?: number,\n\troundTo?: number\n): Promise<number> => {\n\texchangeRate = exchangeRate ?? (await getExchangeRate());\n\treturn roundCurrency(amount * exchangeRate, PaidCurrency.SECONDARY, roundTo);\n};\n\nexport const convertToSecondarySync = (price: number, exchangeRate: number, roundTo: number) => {\n\tif (price == null) return null;\n\tconst amount = price * exchangeRate;\n\tif (!roundTo) return amount;\n\treturn roundCurrencySync(amount, roundTo);\n};\n"]}
|
|
@@ -504,7 +504,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
504
504
|
totalPages: number;
|
|
505
505
|
} | undefined;
|
|
506
506
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
507
|
-
}>, any> extends infer T_1 ? { [k in keyof T_1]: z.
|
|
507
|
+
}>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<{
|
|
508
508
|
success: z.ZodBoolean;
|
|
509
509
|
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
510
510
|
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
@@ -542,83 +542,7 @@ export declare const createResponseSchema: <T>(schema: z.ZodSchema<T>) => z.ZodO
|
|
|
542
542
|
totalPages: number;
|
|
543
543
|
} | undefined;
|
|
544
544
|
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
545
|
-
}
|
|
546
|
-
success: z.ZodBoolean;
|
|
547
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
548
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
549
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
550
|
-
page: z.ZodNumber;
|
|
551
|
-
size: z.ZodNumber;
|
|
552
|
-
totalElements: z.ZodNumber;
|
|
553
|
-
totalPages: z.ZodNumber;
|
|
554
|
-
}, "strip", z.ZodTypeAny, {
|
|
555
|
-
page: number;
|
|
556
|
-
size: number;
|
|
557
|
-
totalElements: number;
|
|
558
|
-
totalPages: number;
|
|
559
|
-
}, {
|
|
560
|
-
page: number;
|
|
561
|
-
size: number;
|
|
562
|
-
totalElements: number;
|
|
563
|
-
totalPages: number;
|
|
564
|
-
}>>;
|
|
565
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
566
|
-
}, "strip", z.ZodTypeAny, {
|
|
567
|
-
documents: T[];
|
|
568
|
-
metadata?: {
|
|
569
|
-
page: number;
|
|
570
|
-
size: number;
|
|
571
|
-
totalElements: number;
|
|
572
|
-
totalPages: number;
|
|
573
|
-
} | undefined;
|
|
574
|
-
}, {
|
|
575
|
-
documents: T[];
|
|
576
|
-
metadata?: {
|
|
577
|
-
page: number;
|
|
578
|
-
size: number;
|
|
579
|
-
totalElements: number;
|
|
580
|
-
totalPages: number;
|
|
581
|
-
} | undefined;
|
|
582
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
583
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
584
|
-
success: z.ZodBoolean;
|
|
585
|
-
message: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
586
|
-
data: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
587
|
-
metadata: z.ZodOptional<z.ZodObject<{
|
|
588
|
-
page: z.ZodNumber;
|
|
589
|
-
size: z.ZodNumber;
|
|
590
|
-
totalElements: z.ZodNumber;
|
|
591
|
-
totalPages: z.ZodNumber;
|
|
592
|
-
}, "strip", z.ZodTypeAny, {
|
|
593
|
-
page: number;
|
|
594
|
-
size: number;
|
|
595
|
-
totalElements: number;
|
|
596
|
-
totalPages: number;
|
|
597
|
-
}, {
|
|
598
|
-
page: number;
|
|
599
|
-
size: number;
|
|
600
|
-
totalElements: number;
|
|
601
|
-
totalPages: number;
|
|
602
|
-
}>>;
|
|
603
|
-
documents: z.ZodArray<z.ZodType<T, z.ZodTypeDef, T>, "many">;
|
|
604
|
-
}, "strip", z.ZodTypeAny, {
|
|
605
|
-
documents: T[];
|
|
606
|
-
metadata?: {
|
|
607
|
-
page: number;
|
|
608
|
-
size: number;
|
|
609
|
-
totalElements: number;
|
|
610
|
-
totalPages: number;
|
|
611
|
-
} | undefined;
|
|
612
|
-
}, {
|
|
613
|
-
documents: T[];
|
|
614
|
-
metadata?: {
|
|
615
|
-
page: number;
|
|
616
|
-
size: number;
|
|
617
|
-
totalElements: number;
|
|
618
|
-
totalPages: number;
|
|
619
|
-
} | undefined;
|
|
620
|
-
}>, z.ZodType<T, z.ZodTypeDef, T>]>>;
|
|
621
|
-
}>[k_1]; } : never>;
|
|
545
|
+
}> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
622
546
|
export declare const TokenSchema: z.ZodObject<{
|
|
623
547
|
accessToken: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
624
548
|
refreshToken: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
@@ -60,34 +60,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
60
60
|
private baseSchema;
|
|
61
61
|
constructor(baseFields: T, includeTimestamps?: boolean, includeTracking?: boolean);
|
|
62
62
|
private createBaseSchema;
|
|
63
|
-
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
63
|
+
getBaseSchema(): z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
64
64
|
getEntitySchema(): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
65
65
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
66
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
66
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
67
67
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
68
|
-
}>[k]>; } : never,
|
|
68
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
69
69
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
70
|
-
}> extends infer
|
|
71
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
72
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
73
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
74
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
75
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
76
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
70
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
77
71
|
getIdSchema(): z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
78
72
|
getUpdateSchema(excludeFields?: ExcludeFromUpdate): z.ZodObject<z.objectUtil.extendShape<T, {
|
|
79
73
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
80
|
-
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
81
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
82
|
-
}>[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
83
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
84
|
-
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
85
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
86
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
74
|
+
}> extends infer T_1 extends z.ZodRawShape ? { [k in keyof T_1]: z.ZodOptional<T_1[k]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
87
75
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
88
|
-
}> extends infer
|
|
76
|
+
}> extends infer T_2 extends z.ZodRawShape ? { [k in keyof T_2]: z.ZodOptional<T_2[k]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
89
77
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
90
|
-
}>[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
78
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k in keyof T_3]: z.ZodOptional<T_3[k]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
91
79
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
92
80
|
}, "strict", z.ZodTypeAny, {
|
|
93
81
|
[x: string]: any;
|
|
@@ -110,34 +98,22 @@ export declare class SchemaBuilder<T extends z.ZodRawShape> {
|
|
|
110
98
|
[x: string]: any;
|
|
111
99
|
}>;
|
|
112
100
|
getAllSchemas(excludeFromUpdate?: ExcludeFromUpdate): {
|
|
113
|
-
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]:
|
|
101
|
+
BaseSchema: z.ZodObject<T, "strict", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<T>, any> extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.baseObjectInputType<T> extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never>;
|
|
114
102
|
EntitySchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
115
103
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
116
|
-
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
104
|
+
}> extends infer T_3 extends z.ZodRawShape ? { [k_2 in keyof T_3]: z.ZodOptional<T_3[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
117
105
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
118
|
-
}>[k_2]>; } : never,
|
|
106
|
+
}> extends infer T_4 extends z.ZodRawShape ? { [k_2 in keyof T_4]: z.ZodOptional<T_4[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
119
107
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
120
|
-
}> extends infer
|
|
121
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
122
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
123
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
124
|
-
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
125
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
126
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
108
|
+
}> extends infer T_5 extends z.ZodRawShape ? { [k_2 in keyof T_5]: z.ZodOptional<T_5[k_2]>; } : never, z.ZodTypeAny, "passthrough">>;
|
|
127
109
|
IdSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
128
110
|
UpdateSchema: z.ZodObject<z.objectUtil.extendShape<T, {
|
|
129
111
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
130
|
-
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
131
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
132
|
-
}>[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
133
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
134
|
-
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<z.objectUtil.extendShape<T, {
|
|
135
|
-
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
136
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
112
|
+
}> extends infer T_6 extends z.ZodRawShape ? { [k_2 in keyof T_6]: z.ZodOptional<T_6[k_2]>; } : never, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<T, {
|
|
137
113
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
138
|
-
}> extends infer
|
|
114
|
+
}> extends infer T_7 extends z.ZodRawShape ? { [k_2 in keyof T_7]: z.ZodOptional<T_7[k_2]>; } : never, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<T, {
|
|
139
115
|
_id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, mongoose.Types.ObjectId, string>, z.ZodType<mongoose.Types.ObjectId, z.ZodTypeDef, mongoose.Types.ObjectId>]>;
|
|
140
|
-
}>[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
116
|
+
}> extends infer T_8 extends z.ZodRawShape ? { [k_2 in keyof T_8]: z.ZodOptional<T_8[k_2]>; } : never, z.ZodTypeAny, "passthrough">> | z.ZodObject<{
|
|
141
117
|
[x: string]: z.ZodOptional<z.ZodTypeAny>;
|
|
142
118
|
}, "strict", z.ZodTypeAny, {
|
|
143
119
|
[x: string]: any;
|