erpnext-queue-client 2.3.1 → 2.3.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.
|
@@ -66,7 +66,25 @@ type OmitArrayFields<T extends AnyZodObject> = ZodObject<{
|
|
|
66
66
|
}>;
|
|
67
67
|
export type DocModelListEntryType<T extends AnyZodObject> = OmitArrayFields<DocModelType<T>>;
|
|
68
68
|
export declare const DocModelListEntry: <T extends ZodRawShape>(BaseModel: ZodObject<T>) => DocModelListEntryType<ZodObject<T>>;
|
|
69
|
-
export declare const DocTypeList: <T extends AnyZodObject
|
|
69
|
+
export declare const DocTypeList: <T extends AnyZodObject, F extends KeysOfModel<T>>(BaseModel: T, fields?: F[]) => z.ZodArray<z.ZodObject<Pick<{
|
|
70
|
+
[x: string]: z.ZodTypeAny;
|
|
71
|
+
name: z.ZodString;
|
|
72
|
+
owner: z.ZodString;
|
|
73
|
+
creation: z.ZodString;
|
|
74
|
+
modified: z.ZodString;
|
|
75
|
+
modified_by: z.ZodString;
|
|
76
|
+
idx: z.ZodNumber;
|
|
77
|
+
docstatus: z.ZodDefault<z.ZodNumber> & {
|
|
78
|
+
__optionalForInput: true;
|
|
79
|
+
};
|
|
80
|
+
_user_tags: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
81
|
+
}, string | number>, z.UnknownKeysParam, z.ZodTypeAny, {
|
|
82
|
+
[x: string]: any;
|
|
83
|
+
[x: number]: any;
|
|
84
|
+
}, {
|
|
85
|
+
[x: string]: any;
|
|
86
|
+
[x: number]: any;
|
|
87
|
+
}>, "many">;
|
|
70
88
|
/**
|
|
71
89
|
* Augments all array fields in a Zod object schema that contain object schemas
|
|
72
90
|
* with DocTypeChildTableEntry metadata fields (name, owner, creation, etc.)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreateChildTableEntrySchema = exports.AugmentChildTableArrays = exports.DocTypeList = exports.DocModelListEntry = exports.DocModel = exports.LoadDocumentWrapper = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const zodUtils_1 = require("../../utils/zodUtils");
|
|
5
6
|
const ERPNextDocTypeMeta_1 = require("./ERPNextDocTypeMeta");
|
|
6
7
|
const LoadDocumentWrapper = (BaseModel) => BaseModel.extend({ __onload: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()) }).describe(BaseModel.description + " with __onload");
|
|
7
8
|
exports.LoadDocumentWrapper = LoadDocumentWrapper;
|
|
@@ -51,10 +52,14 @@ const DocModelListEntry = (BaseModel) => {
|
|
|
51
52
|
.describe(`${BaseModel.description || "DocType"} List Item`);
|
|
52
53
|
};
|
|
53
54
|
exports.DocModelListEntry = DocModelListEntry;
|
|
54
|
-
const DocTypeList = (BaseModel) => {
|
|
55
|
+
const DocTypeList = (BaseModel, fields) => {
|
|
56
|
+
const listEntry = (0, exports.DocModelListEntry)(BaseModel);
|
|
57
|
+
const selectedFields = (fields !== null && fields !== void 0 ? fields : [
|
|
58
|
+
"name",
|
|
59
|
+
]);
|
|
55
60
|
return zod_1.z
|
|
56
|
-
.array(
|
|
57
|
-
.describe(`${BaseModel.description || "DocType
|
|
61
|
+
.array((0, zodUtils_1.pickFromSchema)(listEntry, selectedFields))
|
|
62
|
+
.describe(`${BaseModel.description || "DocType"} List`);
|
|
58
63
|
};
|
|
59
64
|
exports.DocTypeList = DocTypeList;
|
|
60
65
|
/**
|