@pksep/zod-shared 0.0.560 → 0.0.561
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/ai-mcp/index.d.ts +2 -0
- package/dist/{library → ai-mcp}/index.js +2 -5
- package/dist/ai-mcp/interfaces/ai-mcp.interface.d.ts +358 -0
- package/dist/ai-mcp/schemas/ai-mcp-entity-editor.schema.d.ts +130 -0
- package/dist/ai-mcp/schemas/ai-mcp-entity-editor.schema.js +118 -0
- package/dist/ai-mcp/schemas/ai-mcp-specification.schema.d.ts +123 -0
- package/dist/ai-mcp/schemas/ai-mcp-specification.schema.js +110 -0
- package/dist/ai-mcp/schemas/ai-mcp.schema.d.ts +384 -0
- package/dist/ai-mcp/schemas/ai-mcp.schema.js +210 -0
- package/dist/assemble/dto/get-assemble-operation-count.dto.d.ts +28 -0
- package/dist/assemble/dto/set-date-shipment.dto.d.ts +2 -2
- package/dist/assemble/interfaces/interfaces.d.ts +8 -0
- package/dist/assemble/schemas/assemble-coming.schema.d.ts +20 -0
- package/dist/assemble/schemas/assemble.schema.d.ts +20 -0
- package/dist/cbed/dto/up-create-cbed.dto.d.ts +3 -0
- package/dist/cbed/dto/up-create-cbed.dto.js +1 -0
- package/dist/deliveries/dto/create-deliveries.dto.d.ts +6 -6
- package/dist/detal/dto/archive-detal.dto.d.ts +17 -0
- package/dist/detal/dto/archive-detal.dto.js +10 -0
- package/dist/detal/dto/update-detal.dto.d.ts +342 -17
- package/dist/detal/dto/update-detal.dto.js +88 -27
- package/dist/detal/index.d.ts +1 -0
- package/dist/detal/index.js +1 -0
- package/dist/document/dto/entity-document-command.dto.d.ts +184 -0
- package/dist/document/dto/entity-document-command.dto.js +59 -0
- package/dist/document/index.d.ts +2 -0
- package/dist/document/index.js +2 -0
- package/dist/document/interfaces/entity-document.interface.d.ts +30 -0
- package/dist/excel-export/excel-export.dto.d.ts +1666 -0
- package/dist/excel-export/excel-export.dto.js +237 -0
- package/dist/excel-export/index.d.ts +1 -0
- package/dist/{issue → excel-export}/index.js +1 -5
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/marks/type/type.d.ts +4 -4
- package/dist/material/dto/create-material.dto.d.ts +3 -0
- package/dist/material/dto/create-material.dto.js +2 -1
- package/dist/product/dto/up-create-product.dto.d.ts +3 -0
- package/dist/product/dto/up-create-product.dto.js +1 -0
- package/dist/production-tasks/dto/change-due-date.dto.d.ts +2 -2
- package/dist/production-tasks/dto/get-production-task-display-numbers.dto.d.ts +20 -0
- package/dist/production-tasks/dto/get-production-task-display-numbers.dto.js +11 -0
- package/dist/production-tasks/dto/plan-production-task.dto.d.ts +34 -0
- package/dist/production-tasks/dto/plan-production-task.dto.js +21 -2
- package/dist/production-tasks/dto/split-production-task.dto.d.ts +203 -0
- package/dist/production-tasks/dto/split-production-task.dto.js +71 -0
- package/dist/production-tasks/dto/update.dto.d.ts +2 -2
- package/dist/production-tasks/dto/workload-by-entity.dto.d.ts +2 -2
- package/dist/production-tasks/enums/production-tasks.d.ts +10 -0
- package/dist/production-tasks/enums/production-tasks.js +12 -1
- package/dist/production-tasks/index.d.ts +3 -0
- package/dist/production-tasks/index.js +3 -0
- package/dist/production-tasks/interfaces/production-tasks.d.ts +4 -0
- package/dist/production-tasks/methods/methods.d.ts +9 -0
- package/dist/production-tasks/methods/methods.js +16 -1
- package/dist/production-tasks/schemas/orders-summary-by-entity.schema.d.ts +55 -8
- package/dist/production-tasks/schemas/orders-summary-by-entity.schema.js +9 -0
- package/dist/production-tasks/schemas/production-task-subtask.schema.d.ts +81 -0
- package/dist/production-tasks/schemas/production-task.schema.d.ts +14 -0
- package/dist/production-tasks/schemas/production-task.schema.js +4 -0
- package/dist/specification/dto/mutate-specification.dto.d.ts +58 -0
- package/dist/specification/dto/mutate-specification.dto.js +65 -0
- package/dist/specification/index.d.ts +1 -0
- package/dist/specification/index.js +1 -0
- package/dist/specification/interface/interface.d.ts +17 -0
- package/dist/utils/methods/sequelize.d.ts +2 -0
- package/dist/utils/methods/sequelize.js +4 -1
- package/dist/utils/methods.js +30 -10
- package/dist/utils/tables-config/enum.d.ts +5 -0
- package/dist/utils/tables-config/enum.js +10 -0
- package/dist/utils/types/types.d.ts +10 -1
- package/dist/utils/validation/transform.d.ts +2 -0
- package/dist/utils/validation/transform.js +25 -1
- package/package.json +38 -38
- package/dist/issue/dto/up-create-issue.dto.d.ts +0 -49
- package/dist/issue/dto/up-create-issue.dto.js +0 -21
- package/dist/issue/index.d.ts +0 -5
- package/dist/issue/interfaces/interface.d.ts +0 -4
- package/dist/issue/schemas/issue-user-controller.schema.d.ts +0 -15
- package/dist/issue/schemas/issue-user-controller.schema.js +0 -9
- package/dist/issue/schemas/issue-user.schema.d.ts +0 -15
- package/dist/issue/schemas/issue-user.schema.js +0 -9
- package/dist/issue/schemas/issue.schema.d.ts +0 -51
- package/dist/issue/schemas/issue.schema.js +0 -21
- package/dist/library/dto/create-chapter.dto.d.ts +0 -12
- package/dist/library/dto/create-chapter.dto.js +0 -8
- package/dist/library/dto/create-link.dto.d.ts +0 -30
- package/dist/library/dto/create-link.dto.js +0 -14
- package/dist/library/index.d.ts +0 -5
- package/dist/library/interfaces/interface.d.ts +0 -3
- package/dist/library/schemas/links-user.schema.d.ts +0 -15
- package/dist/library/schemas/links-user.schema.js +0 -9
- package/dist/library/schemas/links.schema.d.ts +0 -30
- package/dist/library/schemas/links.schema.js +0 -14
- package/dist/production-tasks/dto/update-marks.dto.d.ts +0 -13
- package/dist/production-tasks/dto/update-marks.dto.js +0 -8
- package/dist/production-tasks/dto/update-responsible.dto.d.ts +0 -12
- package/dist/production-tasks/dto/update-responsible.dto.js +0 -8
- package/dist/production-tasks/dto/update-status.dto.d.ts +0 -13
- package/dist/production-tasks/dto/update-status.dto.js +0 -9
- package/dist/shipments/dto/change-date-urgency.dto.d.ts +0 -12
- package/dist/shipments/dto/change-date-urgency.dto.js +0 -8
- package/dist/tech-process/schemas/tech-process-with-options.schema.d.ts +0 -306
- package/dist/tech-process/schemas/tech-process-with-options.schema.js +0 -8
- package/dist/utils/interface/mat.interface.d.ts +0 -10
- /package/dist/{issue/interfaces/interface.js → ai-mcp/interfaces/ai-mcp.interface.js} +0 -0
- /package/dist/{library/interfaces/interface.js → document/interfaces/entity-document.interface.js} +0 -0
- /package/dist/{utils/interface/mat.interface.js → production-tasks/schemas/production-task-subtask.schema.js} +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ModuleIncludeForDocumentEnum } from '../../utils';
|
|
3
|
+
export declare const ENTITY_DOCUMENT_TYPES: readonly [ModuleIncludeForDocumentEnum.product, ModuleIncludeForDocumentEnum.cbed, ModuleIncludeForDocumentEnum.detal];
|
|
4
|
+
export declare const EntityDocumentTypeZod: z.ZodEnum<[ModuleIncludeForDocumentEnum.product, ModuleIncludeForDocumentEnum.cbed, ModuleIncludeForDocumentEnum.detal]>;
|
|
5
|
+
export declare enum EntityDocumentCommandOperationEnum {
|
|
6
|
+
attach = "attach",
|
|
7
|
+
detach = "detach",
|
|
8
|
+
setMain = "set-main",
|
|
9
|
+
update = "update",
|
|
10
|
+
archive = "archive",
|
|
11
|
+
restore = "restore"
|
|
12
|
+
}
|
|
13
|
+
export declare const EntityDocumentUpdatePatchZod: z.ZodEffects<z.ZodObject<{
|
|
14
|
+
name: z.ZodOptional<z.ZodString>;
|
|
15
|
+
type: z.ZodOptional<z.ZodString>;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
18
|
+
responsibleUserId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
type?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
version?: number | null | undefined;
|
|
24
|
+
responsibleUserId?: number | null | undefined;
|
|
25
|
+
}, {
|
|
26
|
+
type?: string | undefined;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
version?: number | null | undefined;
|
|
30
|
+
responsibleUserId?: number | null | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
type?: string | undefined;
|
|
33
|
+
description?: string | undefined;
|
|
34
|
+
name?: string | undefined;
|
|
35
|
+
version?: number | null | undefined;
|
|
36
|
+
responsibleUserId?: number | null | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
type?: string | undefined;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
name?: string | undefined;
|
|
41
|
+
version?: number | null | undefined;
|
|
42
|
+
responsibleUserId?: number | null | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
export declare const EntityDocumentCommandDtoZod: z.ZodDiscriminatedUnion<"operation", [z.ZodObject<{
|
|
45
|
+
makeMain: z.ZodDefault<z.ZodBoolean>;
|
|
46
|
+
entityType: z.ZodEnum<[ModuleIncludeForDocumentEnum.product, ModuleIncludeForDocumentEnum.cbed, ModuleIncludeForDocumentEnum.detal]>;
|
|
47
|
+
entityId: z.ZodNumber;
|
|
48
|
+
documentId: z.ZodNumber;
|
|
49
|
+
operation: z.ZodLiteral<EntityDocumentCommandOperationEnum.attach>;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
operation: EntityDocumentCommandOperationEnum.attach;
|
|
52
|
+
entityId: number;
|
|
53
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
54
|
+
makeMain: boolean;
|
|
55
|
+
documentId: number;
|
|
56
|
+
}, {
|
|
57
|
+
operation: EntityDocumentCommandOperationEnum.attach;
|
|
58
|
+
entityId: number;
|
|
59
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
60
|
+
documentId: number;
|
|
61
|
+
makeMain?: boolean | undefined;
|
|
62
|
+
}>, z.ZodObject<{
|
|
63
|
+
entityType: z.ZodEnum<[ModuleIncludeForDocumentEnum.product, ModuleIncludeForDocumentEnum.cbed, ModuleIncludeForDocumentEnum.detal]>;
|
|
64
|
+
entityId: z.ZodNumber;
|
|
65
|
+
documentId: z.ZodNumber;
|
|
66
|
+
operation: z.ZodLiteral<EntityDocumentCommandOperationEnum.detach>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
operation: EntityDocumentCommandOperationEnum.detach;
|
|
69
|
+
entityId: number;
|
|
70
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
71
|
+
documentId: number;
|
|
72
|
+
}, {
|
|
73
|
+
operation: EntityDocumentCommandOperationEnum.detach;
|
|
74
|
+
entityId: number;
|
|
75
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
76
|
+
documentId: number;
|
|
77
|
+
}>, z.ZodObject<{
|
|
78
|
+
main: z.ZodBoolean;
|
|
79
|
+
entityType: z.ZodEnum<[ModuleIncludeForDocumentEnum.product, ModuleIncludeForDocumentEnum.cbed, ModuleIncludeForDocumentEnum.detal]>;
|
|
80
|
+
entityId: z.ZodNumber;
|
|
81
|
+
documentId: z.ZodNumber;
|
|
82
|
+
operation: z.ZodLiteral<EntityDocumentCommandOperationEnum.setMain>;
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
operation: EntityDocumentCommandOperationEnum.setMain;
|
|
85
|
+
entityId: number;
|
|
86
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
87
|
+
documentId: number;
|
|
88
|
+
main: boolean;
|
|
89
|
+
}, {
|
|
90
|
+
operation: EntityDocumentCommandOperationEnum.setMain;
|
|
91
|
+
entityId: number;
|
|
92
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
93
|
+
documentId: number;
|
|
94
|
+
main: boolean;
|
|
95
|
+
}>, z.ZodObject<{
|
|
96
|
+
operation: z.ZodLiteral<EntityDocumentCommandOperationEnum.update>;
|
|
97
|
+
documentId: z.ZodNumber;
|
|
98
|
+
changes: z.ZodEffects<z.ZodObject<{
|
|
99
|
+
name: z.ZodOptional<z.ZodString>;
|
|
100
|
+
type: z.ZodOptional<z.ZodString>;
|
|
101
|
+
description: z.ZodOptional<z.ZodString>;
|
|
102
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
103
|
+
responsibleUserId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
type?: string | undefined;
|
|
106
|
+
description?: string | undefined;
|
|
107
|
+
name?: string | undefined;
|
|
108
|
+
version?: number | null | undefined;
|
|
109
|
+
responsibleUserId?: number | null | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
type?: string | undefined;
|
|
112
|
+
description?: string | undefined;
|
|
113
|
+
name?: string | undefined;
|
|
114
|
+
version?: number | null | undefined;
|
|
115
|
+
responsibleUserId?: number | null | undefined;
|
|
116
|
+
}>, {
|
|
117
|
+
type?: string | undefined;
|
|
118
|
+
description?: string | undefined;
|
|
119
|
+
name?: string | undefined;
|
|
120
|
+
version?: number | null | undefined;
|
|
121
|
+
responsibleUserId?: number | null | undefined;
|
|
122
|
+
}, {
|
|
123
|
+
type?: string | undefined;
|
|
124
|
+
description?: string | undefined;
|
|
125
|
+
name?: string | undefined;
|
|
126
|
+
version?: number | null | undefined;
|
|
127
|
+
responsibleUserId?: number | null | undefined;
|
|
128
|
+
}>;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
operation: EntityDocumentCommandOperationEnum.update;
|
|
131
|
+
documentId: number;
|
|
132
|
+
changes: {
|
|
133
|
+
type?: string | undefined;
|
|
134
|
+
description?: string | undefined;
|
|
135
|
+
name?: string | undefined;
|
|
136
|
+
version?: number | null | undefined;
|
|
137
|
+
responsibleUserId?: number | null | undefined;
|
|
138
|
+
};
|
|
139
|
+
}, {
|
|
140
|
+
operation: EntityDocumentCommandOperationEnum.update;
|
|
141
|
+
documentId: number;
|
|
142
|
+
changes: {
|
|
143
|
+
type?: string | undefined;
|
|
144
|
+
description?: string | undefined;
|
|
145
|
+
name?: string | undefined;
|
|
146
|
+
version?: number | null | undefined;
|
|
147
|
+
responsibleUserId?: number | null | undefined;
|
|
148
|
+
};
|
|
149
|
+
}>, z.ZodObject<{
|
|
150
|
+
operation: z.ZodLiteral<EntityDocumentCommandOperationEnum.archive>;
|
|
151
|
+
documentId: z.ZodNumber;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
operation: EntityDocumentCommandOperationEnum.archive;
|
|
154
|
+
documentId: number;
|
|
155
|
+
}, {
|
|
156
|
+
operation: EntityDocumentCommandOperationEnum.archive;
|
|
157
|
+
documentId: number;
|
|
158
|
+
}>, z.ZodObject<{
|
|
159
|
+
operation: z.ZodLiteral<EntityDocumentCommandOperationEnum.restore>;
|
|
160
|
+
documentId: z.ZodNumber;
|
|
161
|
+
}, "strip", z.ZodTypeAny, {
|
|
162
|
+
operation: EntityDocumentCommandOperationEnum.restore;
|
|
163
|
+
documentId: number;
|
|
164
|
+
}, {
|
|
165
|
+
operation: EntityDocumentCommandOperationEnum.restore;
|
|
166
|
+
documentId: number;
|
|
167
|
+
}>]>;
|
|
168
|
+
export declare const EntityDocumentsQueryDtoZod: z.ZodObject<{
|
|
169
|
+
entityType: z.ZodEnum<[ModuleIncludeForDocumentEnum.product, ModuleIncludeForDocumentEnum.cbed, ModuleIncludeForDocumentEnum.detal]>;
|
|
170
|
+
entityId: z.ZodNumber;
|
|
171
|
+
includeArchived: z.ZodDefault<z.ZodBoolean>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
entityId: number;
|
|
174
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
175
|
+
includeArchived: boolean;
|
|
176
|
+
}, {
|
|
177
|
+
entityId: number;
|
|
178
|
+
entityType: ModuleIncludeForDocumentEnum.cbed | ModuleIncludeForDocumentEnum.detal | ModuleIncludeForDocumentEnum.product;
|
|
179
|
+
includeArchived?: boolean | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
export type TEntityDocumentType = z.infer<typeof EntityDocumentTypeZod>;
|
|
182
|
+
export type TEntityDocumentUpdatePatch = z.infer<typeof EntityDocumentUpdatePatchZod>;
|
|
183
|
+
export type TEntityDocumentCommand = z.infer<typeof EntityDocumentCommandDtoZod>;
|
|
184
|
+
export type TEntityDocumentsQuery = z.infer<typeof EntityDocumentsQueryDtoZod>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityDocumentsQueryDtoZod = exports.EntityDocumentCommandDtoZod = exports.EntityDocumentUpdatePatchZod = exports.EntityDocumentCommandOperationEnum = exports.EntityDocumentTypeZod = exports.ENTITY_DOCUMENT_TYPES = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const utils_1 = require("../../utils");
|
|
6
|
+
exports.ENTITY_DOCUMENT_TYPES = [
|
|
7
|
+
utils_1.ModuleIncludeForDocumentEnum.product,
|
|
8
|
+
utils_1.ModuleIncludeForDocumentEnum.cbed,
|
|
9
|
+
utils_1.ModuleIncludeForDocumentEnum.detal
|
|
10
|
+
];
|
|
11
|
+
exports.EntityDocumentTypeZod = zod_1.z.enum(exports.ENTITY_DOCUMENT_TYPES);
|
|
12
|
+
var EntityDocumentCommandOperationEnum;
|
|
13
|
+
(function (EntityDocumentCommandOperationEnum) {
|
|
14
|
+
EntityDocumentCommandOperationEnum["attach"] = "attach";
|
|
15
|
+
EntityDocumentCommandOperationEnum["detach"] = "detach";
|
|
16
|
+
EntityDocumentCommandOperationEnum["setMain"] = "set-main";
|
|
17
|
+
EntityDocumentCommandOperationEnum["update"] = "update";
|
|
18
|
+
EntityDocumentCommandOperationEnum["archive"] = "archive";
|
|
19
|
+
EntityDocumentCommandOperationEnum["restore"] = "restore";
|
|
20
|
+
})(EntityDocumentCommandOperationEnum || (exports.EntityDocumentCommandOperationEnum = EntityDocumentCommandOperationEnum = {}));
|
|
21
|
+
const entityTargetShape = {
|
|
22
|
+
entityType: exports.EntityDocumentTypeZod,
|
|
23
|
+
entityId: zod_1.z.number().int().positive(),
|
|
24
|
+
documentId: zod_1.z.number().int().positive()
|
|
25
|
+
};
|
|
26
|
+
exports.EntityDocumentUpdatePatchZod = zod_1.z
|
|
27
|
+
.object({
|
|
28
|
+
name: zod_1.z.string().trim().min(1).max(255).optional(),
|
|
29
|
+
type: zod_1.z.string().trim().max(255).optional(),
|
|
30
|
+
description: zod_1.z.string().trim().max(4000).optional(),
|
|
31
|
+
version: zod_1.z.number().int().positive().max(1000000).nullable().optional(),
|
|
32
|
+
responsibleUserId: zod_1.z.number().int().positive().nullable().optional()
|
|
33
|
+
})
|
|
34
|
+
.refine(value => Object.values(value).some(field => field !== undefined), {
|
|
35
|
+
message: 'Укажите хотя бы одно изменение документа'
|
|
36
|
+
});
|
|
37
|
+
exports.EntityDocumentCommandDtoZod = zod_1.z.discriminatedUnion('operation', [
|
|
38
|
+
zod_1.z.object(Object.assign(Object.assign({ operation: zod_1.z.literal(EntityDocumentCommandOperationEnum.attach) }, entityTargetShape), { makeMain: zod_1.z.boolean().default(false) })),
|
|
39
|
+
zod_1.z.object(Object.assign({ operation: zod_1.z.literal(EntityDocumentCommandOperationEnum.detach) }, entityTargetShape)),
|
|
40
|
+
zod_1.z.object(Object.assign(Object.assign({ operation: zod_1.z.literal(EntityDocumentCommandOperationEnum.setMain) }, entityTargetShape), { main: zod_1.z.boolean() })),
|
|
41
|
+
zod_1.z.object({
|
|
42
|
+
operation: zod_1.z.literal(EntityDocumentCommandOperationEnum.update),
|
|
43
|
+
documentId: zod_1.z.number().int().positive(),
|
|
44
|
+
changes: exports.EntityDocumentUpdatePatchZod
|
|
45
|
+
}),
|
|
46
|
+
zod_1.z.object({
|
|
47
|
+
operation: zod_1.z.literal(EntityDocumentCommandOperationEnum.archive),
|
|
48
|
+
documentId: zod_1.z.number().int().positive()
|
|
49
|
+
}),
|
|
50
|
+
zod_1.z.object({
|
|
51
|
+
operation: zod_1.z.literal(EntityDocumentCommandOperationEnum.restore),
|
|
52
|
+
documentId: zod_1.z.number().int().positive()
|
|
53
|
+
})
|
|
54
|
+
]);
|
|
55
|
+
exports.EntityDocumentsQueryDtoZod = zod_1.z.object({
|
|
56
|
+
entityType: exports.EntityDocumentTypeZod,
|
|
57
|
+
entityId: zod_1.z.number().int().positive(),
|
|
58
|
+
includeArchived: zod_1.z.boolean().default(false)
|
|
59
|
+
});
|
package/dist/document/index.d.ts
CHANGED
|
@@ -8,3 +8,5 @@ export * from './dto/create-documents.dto';
|
|
|
8
8
|
export * from './dto/query-pagination.dto';
|
|
9
9
|
export * from './dto/update-document.dto';
|
|
10
10
|
export * from './dto/attach-document-to-entity.dto';
|
|
11
|
+
export * from './dto/entity-document-command.dto';
|
|
12
|
+
export * from './interfaces/entity-document.interface';
|
package/dist/document/index.js
CHANGED
|
@@ -24,3 +24,5 @@ __exportStar(require("./dto/create-documents.dto"), exports);
|
|
|
24
24
|
__exportStar(require("./dto/query-pagination.dto"), exports);
|
|
25
25
|
__exportStar(require("./dto/update-document.dto"), exports);
|
|
26
26
|
__exportStar(require("./dto/attach-document-to-entity.dto"), exports);
|
|
27
|
+
__exportStar(require("./dto/entity-document-command.dto"), exports);
|
|
28
|
+
__exportStar(require("./interfaces/entity-document.interface"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { EntityDocumentCommandOperationEnum, TEntityDocumentType } from '../dto/entity-document-command.dto';
|
|
2
|
+
export interface IEntityDocumentEntitySummary {
|
|
3
|
+
id: number;
|
|
4
|
+
type: TEntityDocumentType;
|
|
5
|
+
name: string;
|
|
6
|
+
designation: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface IEntityDocumentSummary {
|
|
9
|
+
id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
type: string | null;
|
|
12
|
+
description: string | null;
|
|
13
|
+
version: number;
|
|
14
|
+
archived: boolean;
|
|
15
|
+
main: boolean;
|
|
16
|
+
path: string;
|
|
17
|
+
responsibleUserId: number | null;
|
|
18
|
+
}
|
|
19
|
+
export interface IEntityDocumentsResult {
|
|
20
|
+
entity: IEntityDocumentEntitySummary;
|
|
21
|
+
count: number;
|
|
22
|
+
items: IEntityDocumentSummary[];
|
|
23
|
+
}
|
|
24
|
+
export interface IEntityDocumentCommandResult {
|
|
25
|
+
operation: EntityDocumentCommandOperationEnum;
|
|
26
|
+
changed: boolean;
|
|
27
|
+
entity?: IEntityDocumentEntitySummary;
|
|
28
|
+
document: IEntityDocumentSummary;
|
|
29
|
+
message: string;
|
|
30
|
+
}
|