@purpleschool/student-works 1.3.1 → 1.4.1
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/api/controller/http/presentation.ts +2 -0
- package/api/routes.ts +4 -0
- package/build/api/controller/http/presentation.js +1 -0
- package/build/api/routes.js +2 -0
- package/build/commands/presentation/create-presentation.command.js +2 -0
- package/build/commands/presentation/generate-presentation-slides.command.js +3 -0
- package/build/commands/presentation/index.js +1 -0
- package/build/commands/presentation/reposition-slide.command.js +15 -0
- package/build/commands/presentation/update-presentation.command.js +1 -4
- package/build/common/enums/tool-type.enum.js +1 -0
- package/build/constants/errors/errors.js +25 -0
- package/build/constants/presentation/enums/index.js +1 -0
- package/build/constants/presentation/enums/presentation-target-audience.enum.js +10 -0
- package/build/models/presentation/index.js +1 -0
- package/build/models/presentation/presentation-title-page.schema.js +9 -0
- package/build/models/presentation/presentation.schema.js +8 -1
- package/build/models/presentation/slide-content.schema.js +34 -24
- package/commands/presentation/create-presentation.command.ts +2 -0
- package/commands/presentation/generate-presentation-slides.command.ts +6 -1
- package/commands/presentation/index.ts +1 -0
- package/commands/presentation/reposition-slide.command.ts +17 -0
- package/commands/presentation/update-presentation.command.ts +2 -5
- package/common/enums/tool-type.enum.ts +1 -0
- package/constants/errors/errors.ts +25 -0
- package/constants/presentation/enums/index.ts +1 -0
- package/constants/presentation/enums/presentation-target-audience.enum.ts +6 -0
- package/models/presentation/index.ts +1 -0
- package/models/presentation/presentation-title-page.schema.ts +9 -0
- package/models/presentation/presentation.schema.ts +9 -0
- package/models/presentation/slide-content.schema.ts +50 -40
- package/package.json +1 -1
|
@@ -28,6 +28,8 @@ export const PRESENTATION_ROUTES = {
|
|
|
28
28
|
GENERATE_REPORT: (presentationId: string) => `${presentationId}/generate-report`,
|
|
29
29
|
REPOSITION_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
30
30
|
`${presentationId}/outline/${slideOutlineId}/move`,
|
|
31
|
+
REPOSITION_SLIDE: (presentationId: string, slideId: string) =>
|
|
32
|
+
`${presentationId}/slides/${slideId}/move`,
|
|
31
33
|
DELETE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
32
34
|
`${presentationId}/outline/${slideOutlineId}`,
|
|
33
35
|
CREATE_SLIDE_OUTLINE: (presentationId: string) => `${presentationId}/outline`,
|
package/api/routes.ts
CHANGED
|
@@ -284,6 +284,8 @@ export const REST_API = {
|
|
|
284
284
|
`${ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.GENERATE_REPORT(presentationId)}`,
|
|
285
285
|
REPOSITION_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
286
286
|
`${ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
287
|
+
REPOSITION_SLIDE: (presentationId: string, slideId: string) =>
|
|
288
|
+
`${ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE(presentationId, slideId)}`,
|
|
287
289
|
DELETE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
288
290
|
`${ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.DELETE_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
289
291
|
CREATE_SLIDE_OUTLINE: (presentationId: string) =>
|
|
@@ -329,6 +331,8 @@ export const REST_API = {
|
|
|
329
331
|
`${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.GENERATE_REPORT(presentationId)}`,
|
|
330
332
|
REPOSITION_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
331
333
|
`${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
334
|
+
REPOSITION_SLIDE: (presentationId: string, slideId: string) =>
|
|
335
|
+
`${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE(presentationId, slideId)}`,
|
|
332
336
|
DELETE_SLIDE_OUTLINE: (presentationId: string, slideOutlineId: string) =>
|
|
333
337
|
`${ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.DELETE_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
334
338
|
CREATE_SLIDE_OUTLINE: (presentationId: string) =>
|
|
@@ -25,6 +25,7 @@ exports.PRESENTATION_ROUTES = {
|
|
|
25
25
|
PARAPHRASE: (presentationId, slideId) => `${presentationId}/slides/${slideId}/paraphrase`,
|
|
26
26
|
GENERATE_REPORT: (presentationId) => `${presentationId}/generate-report`,
|
|
27
27
|
REPOSITION_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}/move`,
|
|
28
|
+
REPOSITION_SLIDE: (presentationId, slideId) => `${presentationId}/slides/${slideId}/move`,
|
|
28
29
|
DELETE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${presentationId}/outline/${slideOutlineId}`,
|
|
29
30
|
CREATE_SLIDE_OUTLINE: (presentationId) => `${presentationId}/outline`,
|
|
30
31
|
EXPORT_AS_PPTX: (uuid) => `${uuid}/export-as-pptx`,
|
package/build/api/routes.js
CHANGED
|
@@ -231,6 +231,7 @@ exports.REST_API = {
|
|
|
231
231
|
PARAPHRASE: (presentationId, slideId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.PARAPHRASE(presentationId, slideId)}`,
|
|
232
232
|
GENERATE_REPORT: (presentationId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.GENERATE_REPORT(presentationId)}`,
|
|
233
233
|
REPOSITION_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
234
|
+
REPOSITION_SLIDE: (presentationId, slideId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE(presentationId, slideId)}`,
|
|
234
235
|
DELETE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.DELETE_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
235
236
|
CREATE_SLIDE_OUTLINE: (presentationId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CREATE_SLIDE_OUTLINE(presentationId)}`,
|
|
236
237
|
EXPORT_AS_PPTX: (uuid) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PRIVATE_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.EXPORT_AS_PPTX(uuid)}`,
|
|
@@ -257,6 +258,7 @@ exports.REST_API = {
|
|
|
257
258
|
PARAPHRASE: (presentationId, slideId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.PARAPHRASE(presentationId, slideId)}`,
|
|
258
259
|
GENERATE_REPORT: (presentationId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.GENERATE_REPORT(presentationId)}`,
|
|
259
260
|
REPOSITION_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
261
|
+
REPOSITION_SLIDE: (presentationId, slideId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.REPOSITION_SLIDE(presentationId, slideId)}`,
|
|
260
262
|
DELETE_SLIDE_OUTLINE: (presentationId, slideOutlineId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.DELETE_SLIDE_OUTLINE(presentationId, slideOutlineId)}`,
|
|
261
263
|
CREATE_SLIDE_OUTLINE: (presentationId) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.CREATE_SLIDE_OUTLINE(presentationId)}`,
|
|
262
264
|
EXPORT_AS_PPTX: (uuid) => `${exports.ROOT}/${CONTROLLERS.PRESENTATION_PUBLIC_CONTROLLER}/${CONTROLLERS.PRESENTATION_ROUTES.EXPORT_AS_PPTX(uuid)}`,
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CreatePresentationCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const presentation_1 = require("../../models/presentation");
|
|
6
|
+
const presentation_2 = require("../../constants/presentation");
|
|
6
7
|
var CreatePresentationCommand;
|
|
7
8
|
(function (CreatePresentationCommand) {
|
|
8
9
|
CreatePresentationCommand.RequestSchema = zod_1.z.object({
|
|
@@ -10,6 +11,7 @@ var CreatePresentationCommand;
|
|
|
10
11
|
slideCount: zod_1.z.number().min(1).max(20),
|
|
11
12
|
templateId: zod_1.z.string().uuid(),
|
|
12
13
|
languageId: zod_1.z.string().uuid(),
|
|
14
|
+
targetAudience: zod_1.z.nativeEnum(presentation_2.PRESENTATION_TARGET_AUDIENCE).optional(),
|
|
13
15
|
});
|
|
14
16
|
CreatePresentationCommand.ResponseSchema = zod_1.z.object({
|
|
15
17
|
data: presentation_1.PresentationSchema,
|
|
@@ -8,6 +8,9 @@ var GeneratePresentationSlidesCommand;
|
|
|
8
8
|
GeneratePresentationSlidesCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
});
|
|
11
|
+
GeneratePresentationSlidesCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
titlePage: presentation_1.PresentationTitlePageSchema.optional().nullable(),
|
|
13
|
+
});
|
|
11
14
|
GeneratePresentationSlidesCommand.ResponseSchema = zod_1.z.object({
|
|
12
15
|
data: presentation_1.PresentationSchema,
|
|
13
16
|
});
|
|
@@ -27,6 +27,7 @@ __exportStar(require("./generate-presentation-slides.command"), exports);
|
|
|
27
27
|
__exportStar(require("./generate-and-insert-slide.command"), exports);
|
|
28
28
|
__exportStar(require("./get-presentation-config.command"), exports);
|
|
29
29
|
__exportStar(require("./reposition-slide-outline.command"), exports);
|
|
30
|
+
__exportStar(require("./reposition-slide.command"), exports);
|
|
30
31
|
__exportStar(require("./update-slide-outline.command"), exports);
|
|
31
32
|
__exportStar(require("./update-presentation-outline.command"), exports);
|
|
32
33
|
__exportStar(require("./update-presentation.command"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RepositionSlideCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var RepositionSlideCommand;
|
|
6
|
+
(function (RepositionSlideCommand) {
|
|
7
|
+
RepositionSlideCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
presentationId: zod_1.z.string().uuid(),
|
|
9
|
+
slideId: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
RepositionSlideCommand.RequestBodySchema = zod_1.z.object({
|
|
12
|
+
newPosition: zod_1.z.number().min(0),
|
|
13
|
+
});
|
|
14
|
+
RepositionSlideCommand.ResponseSchema = zod_1.z.void();
|
|
15
|
+
})(RepositionSlideCommand || (exports.RepositionSlideCommand = RepositionSlideCommand = {}));
|
|
@@ -8,10 +8,7 @@ var UpdatePresentationCommand;
|
|
|
8
8
|
UpdatePresentationCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
});
|
|
11
|
-
UpdatePresentationCommand.RequestBodySchema = presentation_1.
|
|
12
|
-
title: true,
|
|
13
|
-
templateId: true,
|
|
14
|
-
}).partial();
|
|
11
|
+
UpdatePresentationCommand.RequestBodySchema = presentation_1.PresentationUpdateSchema;
|
|
15
12
|
UpdatePresentationCommand.ResponseSchema = zod_1.z.object({
|
|
16
13
|
data: presentation_1.PresentationSchema,
|
|
17
14
|
});
|
|
@@ -891,6 +891,26 @@ exports.ERRORS = {
|
|
|
891
891
|
code: 'WRITER_SOURCE_007',
|
|
892
892
|
httpCode: 500,
|
|
893
893
|
},
|
|
894
|
+
WRITER_SOURCE_SEARCH_SIMILAR_CHUNKS_ERROR: {
|
|
895
|
+
message: 'Ошибка при поиске похожих фрагментов источников',
|
|
896
|
+
code: 'WRITER_SOURCE_008',
|
|
897
|
+
httpCode: 500,
|
|
898
|
+
},
|
|
899
|
+
WRITER_SOURCE_VECTORIZATION_ERROR: {
|
|
900
|
+
message: 'Ошибка при векторизации источников',
|
|
901
|
+
code: 'WRITER_SOURCE_009',
|
|
902
|
+
httpCode: 500,
|
|
903
|
+
},
|
|
904
|
+
WRITER_SOURCE_TEXT_CHUNKING_ERROR: {
|
|
905
|
+
message: 'Ошибка при разбиении текста источников на фрагменты',
|
|
906
|
+
code: 'WRITER_SOURCE_010',
|
|
907
|
+
httpCode: 500,
|
|
908
|
+
},
|
|
909
|
+
WRITER_SOURCE_CHECK_CHUNKS_ERROR: {
|
|
910
|
+
message: 'Ошибка при проверке векторизации источника',
|
|
911
|
+
code: 'WRITER_SOURCE_011',
|
|
912
|
+
httpCode: 500,
|
|
913
|
+
},
|
|
894
914
|
WRITER_DOCUMENT_TOO_MANY_UNREG_DOCUMENTS: {
|
|
895
915
|
message: 'Достигнуто максимальное количество документов для неавторизованного пользователя. Пожалуйста, авторизуйтесь.',
|
|
896
916
|
code: 'WRITER_DOCUMENT_022',
|
|
@@ -1294,6 +1314,11 @@ exports.ERRORS = {
|
|
|
1294
1314
|
code: 'PRESENTATION_021',
|
|
1295
1315
|
httpCode: 400,
|
|
1296
1316
|
},
|
|
1317
|
+
PRESENTATION_REPOSITION_SLIDE_ERROR: {
|
|
1318
|
+
message: 'Ошибка при изменении позиции слайда',
|
|
1319
|
+
code: 'PRESENTATION_022',
|
|
1320
|
+
httpCode: 500,
|
|
1321
|
+
},
|
|
1297
1322
|
// SLIDE_OUTLINE
|
|
1298
1323
|
SLIDE_OUTLINE_INVALID_POSITION: {
|
|
1299
1324
|
message: 'Недопустимая позиция слайда в плане',
|
|
@@ -24,3 +24,4 @@ __exportStar(require("./presentation-ai-action-type.enum"), exports);
|
|
|
24
24
|
__exportStar(require("./presentation-ai-action-pricing-type.enum"), exports);
|
|
25
25
|
__exportStar(require("./presentation-ai-action-call-status.enum"), exports);
|
|
26
26
|
__exportStar(require("./slide-icon-slot-status.enum"), exports);
|
|
27
|
+
__exportStar(require("./presentation-target-audience.enum"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PRESENTATION_TARGET_AUDIENCE = void 0;
|
|
4
|
+
var PRESENTATION_TARGET_AUDIENCE;
|
|
5
|
+
(function (PRESENTATION_TARGET_AUDIENCE) {
|
|
6
|
+
PRESENTATION_TARGET_AUDIENCE["NONE"] = "NONE";
|
|
7
|
+
PRESENTATION_TARGET_AUDIENCE["SCHOOL"] = "SCHOOL";
|
|
8
|
+
PRESENTATION_TARGET_AUDIENCE["UNIVERSITY"] = "UNIVERSITY";
|
|
9
|
+
PRESENTATION_TARGET_AUDIENCE["BUSINESS"] = "BUSINESS";
|
|
10
|
+
})(PRESENTATION_TARGET_AUDIENCE || (exports.PRESENTATION_TARGET_AUDIENCE = PRESENTATION_TARGET_AUDIENCE = {}));
|
|
@@ -22,3 +22,4 @@ __exportStar(require("./slide.schema"), exports);
|
|
|
22
22
|
__exportStar(require("./slide-content.schema"), exports);
|
|
23
23
|
__exportStar(require("./presentation-config.schema"), exports);
|
|
24
24
|
__exportStar(require("./presentation-ai-action.schema"), exports);
|
|
25
|
+
__exportStar(require("./presentation-title-page.schema"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresentationTitlePageSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.PresentationTitlePageSchema = zod_1.z.object({
|
|
6
|
+
author: zod_1.z.string().optional().nullable(),
|
|
7
|
+
createdAt: zod_1.z.date().optional().nullable(),
|
|
8
|
+
email: zod_1.z.string().email().optional().nullable(),
|
|
9
|
+
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PresentationWithSlidesSchema = exports.PresentationSchema = void 0;
|
|
3
|
+
exports.PresentationUpdateSchema = exports.PresentationWithSlidesSchema = exports.PresentationSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const slide_outline_schema_1 = require("./slide-outline.schema");
|
|
6
6
|
const slide_schema_1 = require("./slide.schema");
|
|
7
7
|
const constants_1 = require("../../constants");
|
|
8
|
+
const presentation_title_page_schema_1 = require("./presentation-title-page.schema");
|
|
8
9
|
exports.PresentationSchema = zod_1.z.object({
|
|
9
10
|
uuid: zod_1.z.string().uuid(),
|
|
10
11
|
prompt: zod_1.z.string(),
|
|
@@ -19,6 +20,7 @@ exports.PresentationSchema = zod_1.z.object({
|
|
|
19
20
|
slideCount: zod_1.z.number(),
|
|
20
21
|
lastContentUpdateAt: zod_1.z.date().nullable(),
|
|
21
22
|
lastPptxExportedAt: zod_1.z.date().nullable(),
|
|
23
|
+
titlePage: presentation_title_page_schema_1.PresentationTitlePageSchema.nullable(),
|
|
22
24
|
createdAt: zod_1.z.date(),
|
|
23
25
|
updatedAt: zod_1.z.date(),
|
|
24
26
|
});
|
|
@@ -26,3 +28,8 @@ exports.PresentationWithSlidesSchema = exports.PresentationSchema.extend({
|
|
|
26
28
|
outline: zod_1.z.array(slide_outline_schema_1.SlideOutlineSchema),
|
|
27
29
|
slides: zod_1.z.array(slide_schema_1.SlideSchema),
|
|
28
30
|
});
|
|
31
|
+
exports.PresentationUpdateSchema = exports.PresentationSchema.pick({
|
|
32
|
+
title: true,
|
|
33
|
+
templateId: true,
|
|
34
|
+
titlePage: true,
|
|
35
|
+
}).partial();
|
|
@@ -34,22 +34,26 @@ exports.IconSlotSchema = zod_1.z.object({
|
|
|
34
34
|
exports.CoverSlideDataSchema = zod_1.z.object({
|
|
35
35
|
contentType: zod_1.z.literal(constants_1.SLIDE_CONTENT_TYPE.COVER),
|
|
36
36
|
title: zod_1.z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
37
|
-
author: zod_1.z
|
|
37
|
+
author: zod_1.z
|
|
38
|
+
.object({
|
|
38
39
|
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
39
|
-
value: zod_1.z
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
value: zod_1.z.string().describe('Author value from titlePage if provided'),
|
|
41
|
+
})
|
|
42
|
+
.optional(),
|
|
43
|
+
date: zod_1.z
|
|
44
|
+
.object({
|
|
44
45
|
label: zod_1.z.string().describe('Literal "Date" in presentation\'s language'),
|
|
45
46
|
value: zod_1.z
|
|
46
47
|
.string()
|
|
47
|
-
.describe('Date
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
.describe('Date from titlePage in the "dd month yyyy" format in presentation\'s locale'),
|
|
49
|
+
})
|
|
50
|
+
.optional(),
|
|
51
|
+
email: zod_1.z
|
|
52
|
+
.object({
|
|
53
|
+
label: zod_1.z.string().describe('Localized contact/email label'),
|
|
54
|
+
value: zod_1.z.string().describe('Email value from titlePage if provided'),
|
|
55
|
+
})
|
|
56
|
+
.optional(),
|
|
53
57
|
version: zod_1.z.literal(1),
|
|
54
58
|
});
|
|
55
59
|
exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
@@ -59,20 +63,26 @@ exports.ThankYouSlideDataSchema = zod_1.z.object({
|
|
|
59
63
|
.describe('"Thank you for your attention" in presentation\'s language')
|
|
60
64
|
.min(10)
|
|
61
65
|
.max(150),
|
|
62
|
-
author: zod_1.z
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
author: zod_1.z
|
|
67
|
+
.object({
|
|
68
|
+
label: zod_1.z.string().describe('Literal "Author" in presentation\'s language'),
|
|
69
|
+
value: zod_1.z.string().describe('Author value from titlePage if provided'),
|
|
70
|
+
})
|
|
71
|
+
.optional(),
|
|
72
|
+
date: zod_1.z
|
|
73
|
+
.object({
|
|
74
|
+
label: zod_1.z.string().describe('Literal "Date" in presentation\'s language'),
|
|
68
75
|
value: zod_1.z
|
|
69
76
|
.string()
|
|
70
|
-
.describe('Date
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
.describe('Date from titlePage in the "dd month yyyy" format in presentation\'s locale'),
|
|
78
|
+
})
|
|
79
|
+
.optional(),
|
|
80
|
+
email: zod_1.z
|
|
81
|
+
.object({
|
|
82
|
+
label: zod_1.z.string().describe('Localized contact/email label'),
|
|
83
|
+
value: zod_1.z.string().describe('Email value from titlePage if provided'),
|
|
84
|
+
})
|
|
85
|
+
.optional(),
|
|
76
86
|
version: zod_1.z.literal(1),
|
|
77
87
|
});
|
|
78
88
|
exports.StructuredListSlideDataSchema = zod_1.z.object({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { PresentationSchema } from '../../models/presentation';
|
|
3
|
+
import { PRESENTATION_TARGET_AUDIENCE } from '../../constants/presentation';
|
|
3
4
|
|
|
4
5
|
export namespace CreatePresentationCommand {
|
|
5
6
|
export const RequestSchema = z.object({
|
|
@@ -7,6 +8,7 @@ export namespace CreatePresentationCommand {
|
|
|
7
8
|
slideCount: z.number().min(1).max(20),
|
|
8
9
|
templateId: z.string().uuid(),
|
|
9
10
|
languageId: z.string().uuid(),
|
|
11
|
+
targetAudience: z.nativeEnum(PRESENTATION_TARGET_AUDIENCE).optional(),
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { PresentationSchema } from '../../models/presentation';
|
|
2
|
+
import { PresentationSchema, PresentationTitlePageSchema } from '../../models/presentation';
|
|
3
3
|
|
|
4
4
|
export namespace GeneratePresentationSlidesCommand {
|
|
5
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -8,6 +8,11 @@ export namespace GeneratePresentationSlidesCommand {
|
|
|
8
8
|
|
|
9
9
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
10
10
|
|
|
11
|
+
export const RequestBodySchema = z.object({
|
|
12
|
+
titlePage: PresentationTitlePageSchema.optional().nullable(),
|
|
13
|
+
});
|
|
14
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
15
|
+
|
|
11
16
|
export const ResponseSchema = z.object({
|
|
12
17
|
data: PresentationSchema,
|
|
13
18
|
});
|
|
@@ -11,6 +11,7 @@ export * from './generate-presentation-slides.command';
|
|
|
11
11
|
export * from './generate-and-insert-slide.command';
|
|
12
12
|
export * from './get-presentation-config.command';
|
|
13
13
|
export * from './reposition-slide-outline.command';
|
|
14
|
+
export * from './reposition-slide.command';
|
|
14
15
|
export * from './update-slide-outline.command';
|
|
15
16
|
export * from './update-presentation-outline.command';
|
|
16
17
|
export * from './update-presentation.command';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace RepositionSlideCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
presentationId: z.string().uuid(),
|
|
6
|
+
slideId: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type Params = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const RequestBodySchema = z.object({
|
|
11
|
+
newPosition: z.number().min(0),
|
|
12
|
+
});
|
|
13
|
+
export type Request = z.infer<typeof RequestBodySchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.void();
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { PresentationSchema } from '../../models/presentation';
|
|
2
|
+
import { PresentationSchema, PresentationUpdateSchema } from '../../models/presentation';
|
|
3
3
|
|
|
4
4
|
export namespace UpdatePresentationCommand {
|
|
5
5
|
export const RequestParamsSchema = z.object({
|
|
@@ -7,10 +7,7 @@ export namespace UpdatePresentationCommand {
|
|
|
7
7
|
});
|
|
8
8
|
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
9
|
|
|
10
|
-
export const RequestBodySchema =
|
|
11
|
-
title: true,
|
|
12
|
-
templateId: true,
|
|
13
|
-
}).partial();
|
|
10
|
+
export const RequestBodySchema = PresentationUpdateSchema;
|
|
14
11
|
export type Request = z.infer<typeof RequestBodySchema>;
|
|
15
12
|
|
|
16
13
|
export const ResponseSchema = z.object({
|
|
@@ -889,6 +889,26 @@ export const ERRORS = {
|
|
|
889
889
|
code: 'WRITER_SOURCE_007',
|
|
890
890
|
httpCode: 500,
|
|
891
891
|
},
|
|
892
|
+
WRITER_SOURCE_SEARCH_SIMILAR_CHUNKS_ERROR: {
|
|
893
|
+
message: 'Ошибка при поиске похожих фрагментов источников',
|
|
894
|
+
code: 'WRITER_SOURCE_008',
|
|
895
|
+
httpCode: 500,
|
|
896
|
+
},
|
|
897
|
+
WRITER_SOURCE_VECTORIZATION_ERROR: {
|
|
898
|
+
message: 'Ошибка при векторизации источников',
|
|
899
|
+
code: 'WRITER_SOURCE_009',
|
|
900
|
+
httpCode: 500,
|
|
901
|
+
},
|
|
902
|
+
WRITER_SOURCE_TEXT_CHUNKING_ERROR: {
|
|
903
|
+
message: 'Ошибка при разбиении текста источников на фрагменты',
|
|
904
|
+
code: 'WRITER_SOURCE_010',
|
|
905
|
+
httpCode: 500,
|
|
906
|
+
},
|
|
907
|
+
WRITER_SOURCE_CHECK_CHUNKS_ERROR: {
|
|
908
|
+
message: 'Ошибка при проверке векторизации источника',
|
|
909
|
+
code: 'WRITER_SOURCE_011',
|
|
910
|
+
httpCode: 500,
|
|
911
|
+
},
|
|
892
912
|
WRITER_DOCUMENT_TOO_MANY_UNREG_DOCUMENTS: {
|
|
893
913
|
message:
|
|
894
914
|
'Достигнуто максимальное количество документов для неавторизованного пользователя. Пожалуйста, авторизуйтесь.',
|
|
@@ -1298,6 +1318,11 @@ export const ERRORS = {
|
|
|
1298
1318
|
code: 'PRESENTATION_021',
|
|
1299
1319
|
httpCode: 400,
|
|
1300
1320
|
},
|
|
1321
|
+
PRESENTATION_REPOSITION_SLIDE_ERROR: {
|
|
1322
|
+
message: 'Ошибка при изменении позиции слайда',
|
|
1323
|
+
code: 'PRESENTATION_022',
|
|
1324
|
+
httpCode: 500,
|
|
1325
|
+
},
|
|
1301
1326
|
// SLIDE_OUTLINE
|
|
1302
1327
|
SLIDE_OUTLINE_INVALID_POSITION: {
|
|
1303
1328
|
message: 'Недопустимая позиция слайда в плане',
|
|
@@ -8,3 +8,4 @@ export * from './presentation-ai-action-type.enum';
|
|
|
8
8
|
export * from './presentation-ai-action-pricing-type.enum';
|
|
9
9
|
export * from './presentation-ai-action-call-status.enum';
|
|
10
10
|
export * from './slide-icon-slot-status.enum';
|
|
11
|
+
export * from './presentation-target-audience.enum';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const PresentationTitlePageSchema = z.object({
|
|
4
|
+
author: z.string().optional().nullable(),
|
|
5
|
+
createdAt: z.date().optional().nullable(),
|
|
6
|
+
email: z.string().email().optional().nullable(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type PresentationTitlePage = z.infer<typeof PresentationTitlePageSchema>;
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { SlideOutlineSchema } from './slide-outline.schema';
|
|
3
3
|
import { SlideSchema } from './slide.schema';
|
|
4
4
|
import { PRESENTATION_STAGE, USER_REACTION } from '../../constants';
|
|
5
|
+
import { PresentationTitlePageSchema } from './presentation-title-page.schema';
|
|
5
6
|
|
|
6
7
|
export const PresentationSchema = z.object({
|
|
7
8
|
uuid: z.string().uuid(),
|
|
@@ -17,6 +18,7 @@ export const PresentationSchema = z.object({
|
|
|
17
18
|
slideCount: z.number(),
|
|
18
19
|
lastContentUpdateAt: z.date().nullable(),
|
|
19
20
|
lastPptxExportedAt: z.date().nullable(),
|
|
21
|
+
titlePage: PresentationTitlePageSchema.nullable(),
|
|
20
22
|
createdAt: z.date(),
|
|
21
23
|
updatedAt: z.date(),
|
|
22
24
|
});
|
|
@@ -27,3 +29,10 @@ export const PresentationWithSlidesSchema = PresentationSchema.extend({
|
|
|
27
29
|
slides: z.array(SlideSchema),
|
|
28
30
|
});
|
|
29
31
|
export type PresentationWithSlides = z.infer<typeof PresentationWithSlidesSchema>;
|
|
32
|
+
|
|
33
|
+
export const PresentationUpdateSchema = PresentationSchema.pick({
|
|
34
|
+
title: true,
|
|
35
|
+
templateId: true,
|
|
36
|
+
titlePage: true,
|
|
37
|
+
}).partial();
|
|
38
|
+
export type PresentationUpdate = z.infer<typeof PresentationUpdateSchema>;
|
|
@@ -37,18 +37,18 @@ export type IconSlot = z.infer<typeof IconSlotSchema>;
|
|
|
37
37
|
export interface ICoverSlideDataStructure {
|
|
38
38
|
contentType: SLIDE_CONTENT_TYPE.COVER;
|
|
39
39
|
title: string;
|
|
40
|
-
author
|
|
41
|
-
date
|
|
42
|
-
email
|
|
40
|
+
author?: { label: string; value: string };
|
|
41
|
+
date?: { label: string; value: string };
|
|
42
|
+
email?: { label: string; value: string };
|
|
43
43
|
version: 1;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
export interface IThankYouSlideDataStructure {
|
|
47
47
|
contentType: SLIDE_CONTENT_TYPE.THANK_YOU;
|
|
48
48
|
title: string;
|
|
49
|
-
author
|
|
50
|
-
date
|
|
51
|
-
email
|
|
49
|
+
author?: { label: string; value: string };
|
|
50
|
+
date?: { label: string; value: string };
|
|
51
|
+
email?: { label: string; value: string };
|
|
52
52
|
version: 1;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -136,24 +136,28 @@ export interface ITimelineSlideDataStructure {
|
|
|
136
136
|
export const CoverSlideDataSchema = z.object({
|
|
137
137
|
contentType: z.literal(SLIDE_CONTENT_TYPE.COVER),
|
|
138
138
|
title: z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
139
|
-
author: z
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
.string()
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
date: z
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
139
|
+
author: z
|
|
140
|
+
.object({
|
|
141
|
+
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
142
|
+
value: z.string().describe('Author value from titlePage if provided'),
|
|
143
|
+
})
|
|
144
|
+
.optional(),
|
|
145
|
+
date: z
|
|
146
|
+
.object({
|
|
147
|
+
label: z.string().describe('Literal "Date" in presentation\'s language'),
|
|
148
|
+
value: z
|
|
149
|
+
.string()
|
|
150
|
+
.describe(
|
|
151
|
+
'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
|
|
152
|
+
),
|
|
153
|
+
})
|
|
154
|
+
.optional(),
|
|
155
|
+
email: z
|
|
156
|
+
.object({
|
|
157
|
+
label: z.string().describe('Localized contact/email label'),
|
|
158
|
+
value: z.string().describe('Email value from titlePage if provided'),
|
|
159
|
+
})
|
|
160
|
+
.optional(),
|
|
157
161
|
version: z.literal(1),
|
|
158
162
|
}) satisfies z.ZodType<ICoverSlideDataStructure>;
|
|
159
163
|
export type CoverSlideData = z.infer<typeof CoverSlideDataSchema>;
|
|
@@ -165,22 +169,28 @@ export const ThankYouSlideDataSchema = z.object({
|
|
|
165
169
|
.describe('"Thank you for your attention" in presentation\'s language')
|
|
166
170
|
.min(10)
|
|
167
171
|
.max(150),
|
|
168
|
-
author: z
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
.describe(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
172
|
+
author: z
|
|
173
|
+
.object({
|
|
174
|
+
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
175
|
+
value: z.string().describe('Author value from titlePage if provided'),
|
|
176
|
+
})
|
|
177
|
+
.optional(),
|
|
178
|
+
date: z
|
|
179
|
+
.object({
|
|
180
|
+
label: z.string().describe('Literal "Date" in presentation\'s language'),
|
|
181
|
+
value: z
|
|
182
|
+
.string()
|
|
183
|
+
.describe(
|
|
184
|
+
'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
|
|
185
|
+
),
|
|
186
|
+
})
|
|
187
|
+
.optional(),
|
|
188
|
+
email: z
|
|
189
|
+
.object({
|
|
190
|
+
label: z.string().describe('Localized contact/email label'),
|
|
191
|
+
value: z.string().describe('Email value from titlePage if provided'),
|
|
192
|
+
})
|
|
193
|
+
.optional(),
|
|
184
194
|
version: z.literal(1),
|
|
185
195
|
}) satisfies z.ZodType<IThankYouSlideDataStructure>;
|
|
186
196
|
export type ThankYouSlideData = z.infer<typeof ThankYouSlideDataSchema>;
|