@purpleschool/student-works 1.2.2 → 1.3.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.
Files changed (121) hide show
  1. package/api/controller/http/index.ts +1 -0
  2. package/api/controller/http/presentation.ts +37 -0
  3. package/api/routes.ts +90 -0
  4. package/build/api/controller/http/index.js +1 -0
  5. package/build/api/controller/http/presentation.js +33 -0
  6. package/build/api/routes.js +52 -0
  7. package/build/commands/index.js +1 -0
  8. package/build/commands/presentation/build-blank-slide.command.js +16 -0
  9. package/build/commands/presentation/create-presentation.command.js +17 -0
  10. package/build/commands/presentation/delete-all-user-presentations.command.js +9 -0
  11. package/build/commands/presentation/delete-presentation.command.js +11 -0
  12. package/build/commands/presentation/delete-slide-outline.command.js +12 -0
  13. package/build/commands/presentation/export-presentation-as-pptx.command.js +17 -0
  14. package/build/commands/presentation/find-presentation-by-uuid.command.js +14 -0
  15. package/build/commands/presentation/find-presentation-outline.command.js +14 -0
  16. package/build/commands/presentation/find-presentations.command.js +18 -0
  17. package/build/commands/presentation/generate-and-insert-slide.command.js +22 -0
  18. package/build/commands/presentation/generate-presentation-slides.command.js +14 -0
  19. package/build/commands/presentation/get-presentation-config.command.js +11 -0
  20. package/build/commands/presentation/index.js +39 -0
  21. package/build/commands/presentation/presentation-generate-report.command.js +17 -0
  22. package/build/commands/presentation/presentation-paraphrase.command.js +20 -0
  23. package/build/commands/presentation/reposition-slide-outline.command.js +15 -0
  24. package/build/commands/presentation/set-reaction-to-presentation.command.js +28 -0
  25. package/build/commands/presentation/update-presentation-outline.command.js +15 -0
  26. package/build/commands/presentation/update-presentation-slides.command.js +25 -0
  27. package/build/commands/presentation/update-presentation.command.js +18 -0
  28. package/build/commands/presentation/update-slide-image-slot.command.js +34 -0
  29. package/build/commands/presentation/update-slide-outline.command.js +23 -0
  30. package/build/commands/presentation/update-slide.command.js +19 -0
  31. package/build/constants/errors/errors.js +236 -0
  32. package/build/constants/index.js +1 -0
  33. package/build/constants/presentation/enums/index.js +26 -0
  34. package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
  35. package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
  36. package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
  37. package/build/constants/presentation/enums/presentation-stage.enum.js +14 -0
  38. package/build/constants/presentation/enums/slide-content-type.enum.js +16 -0
  39. package/build/constants/presentation/enums/slide-icon-slot-status.enum.js +10 -0
  40. package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
  41. package/build/constants/presentation/enums/slide-image-slot.status.enum.js +10 -0
  42. package/build/constants/presentation/enums/slide-layout.enum.js +8 -0
  43. package/build/constants/presentation/index.js +18 -0
  44. package/build/constants/presentation/maps/index.js +17 -0
  45. package/build/constants/presentation/maps/slide-layout-map.constant.js +17 -0
  46. package/build/helpers/index.js +1 -0
  47. package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
  48. package/build/helpers/presentation/index.js +17 -0
  49. package/build/models/index.js +1 -0
  50. package/build/models/language.schema.js +11 -0
  51. package/build/models/presentation/index.js +24 -0
  52. package/build/models/presentation/pptx-export-payload.schema.js +216 -0
  53. package/build/models/presentation/presentation-ai-action.schema.js +27 -0
  54. package/build/models/presentation/presentation-config.schema.js +21 -0
  55. package/build/models/presentation/presentation-template.schema.js +13 -0
  56. package/build/models/presentation/presentation.schema.js +28 -0
  57. package/build/models/presentation/slide-content-edit.schema.js +146 -0
  58. package/build/models/presentation/slide-content-type.schema.js +14 -0
  59. package/build/models/presentation/slide-content.schema.js +358 -0
  60. package/build/models/presentation/slide-icon-slot.schema.js +15 -0
  61. package/build/models/presentation/slide-image-slot.schema.js +16 -0
  62. package/build/models/presentation/slide-outline.schema.js +50 -0
  63. package/build/models/presentation/slide.schema.js +58 -0
  64. package/commands/index.ts +1 -0
  65. package/commands/presentation/build-blank-slide.command.ts +18 -0
  66. package/commands/presentation/create-presentation.command.ts +19 -0
  67. package/commands/presentation/delete-all-user-presentations.command.ts +9 -0
  68. package/commands/presentation/delete-presentation.command.ts +13 -0
  69. package/commands/presentation/delete-slide-outline.command.ts +12 -0
  70. package/commands/presentation/export-presentation-as-pptx.command.ts +20 -0
  71. package/commands/presentation/find-presentation-by-uuid.command.ts +16 -0
  72. package/commands/presentation/find-presentation-outline.command.ts +16 -0
  73. package/commands/presentation/find-presentations.command.ts +18 -0
  74. package/commands/presentation/generate-and-insert-slide.command.ts +27 -0
  75. package/commands/presentation/generate-presentation-slides.command.ts +16 -0
  76. package/commands/presentation/get-presentation-config.command.ts +10 -0
  77. package/commands/presentation/index.ts +23 -0
  78. package/commands/presentation/presentation-generate-report.command.ts +21 -0
  79. package/commands/presentation/presentation-paraphrase.command.ts +26 -0
  80. package/commands/presentation/reposition-slide-outline.command.ts +17 -0
  81. package/commands/presentation/set-reaction-to-presentation.command.ts +33 -0
  82. package/commands/presentation/update-presentation-outline.command.ts +18 -0
  83. package/commands/presentation/update-presentation-slides.command.ts +32 -0
  84. package/commands/presentation/update-presentation.command.ts +21 -0
  85. package/commands/presentation/update-slide-image-slot.command.ts +40 -0
  86. package/commands/presentation/update-slide-outline.command.ts +26 -0
  87. package/commands/presentation/update-slide.command.ts +25 -0
  88. package/constants/errors/errors.ts +236 -0
  89. package/constants/index.ts +1 -0
  90. package/constants/presentation/enums/index.ts +10 -0
  91. package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
  92. package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
  93. package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
  94. package/constants/presentation/enums/presentation-stage.enum.ts +13 -0
  95. package/constants/presentation/enums/slide-content-type.enum.ts +12 -0
  96. package/constants/presentation/enums/slide-icon-slot-status.enum.ts +6 -0
  97. package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
  98. package/constants/presentation/enums/slide-image-slot.status.enum.ts +6 -0
  99. package/constants/presentation/enums/slide-layout.enum.ts +4 -0
  100. package/constants/presentation/index.ts +2 -0
  101. package/constants/presentation/maps/index.ts +1 -0
  102. package/constants/presentation/maps/slide-layout-map.constant.ts +15 -0
  103. package/helpers/index.ts +1 -0
  104. package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
  105. package/helpers/presentation/index.ts +1 -0
  106. package/models/index.ts +1 -0
  107. package/models/language.schema.ts +9 -0
  108. package/models/presentation/index.ts +8 -0
  109. package/models/presentation/pptx-export-payload.schema.ts +246 -0
  110. package/models/presentation/presentation-ai-action.schema.ts +30 -0
  111. package/models/presentation/presentation-config.schema.ts +20 -0
  112. package/models/presentation/presentation-template.schema.ts +11 -0
  113. package/models/presentation/presentation.schema.ts +29 -0
  114. package/models/presentation/slide-content-edit.schema.ts +175 -0
  115. package/models/presentation/slide-content-type.schema.ts +13 -0
  116. package/models/presentation/slide-content.schema.ts +571 -0
  117. package/models/presentation/slide-icon-slot.schema.ts +13 -0
  118. package/models/presentation/slide-image-slot.schema.ts +14 -0
  119. package/models/presentation/slide-outline.schema.ts +58 -0
  120. package/models/presentation/slide.schema.ts +66 -0
  121. package/package.json +2 -2
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { SlideSchema } from '../../models/presentation';
3
+ import { SLIDE_CONTENT_TYPE, SLIDE_LAYOUT } from '../../constants';
4
+
5
+ export namespace GenerateAndInsertSlideCommand {
6
+ export const RequestSchema = z.object({
7
+ contentTypeId: z.nativeEnum(SLIDE_CONTENT_TYPE),
8
+ prompt: z.string().max(10000).optional(),
9
+ title: z.string().min(1).max(80),
10
+ position: z.number().min(0),
11
+ layoutId: z.nativeEnum(SLIDE_LAYOUT).optional(),
12
+ });
13
+
14
+ export type Request = z.infer<typeof RequestSchema>;
15
+
16
+ export const RequestParamsSchema = z.object({
17
+ uuid: z.string().uuid(),
18
+ });
19
+
20
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
21
+
22
+ export const ResponseSchema = z.object({
23
+ data: z.array(SlideSchema),
24
+ });
25
+
26
+ export type Response = z.infer<typeof ResponseSchema>;
27
+ }
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { PresentationSchema } from '../../models/presentation';
3
+
4
+ export namespace GeneratePresentationSlidesCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: PresentationSchema,
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { PresentationConfigSchema } from '../../models/presentation';
3
+
4
+ export namespace GetPresentationConfigCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: PresentationConfigSchema,
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,23 @@
1
+ export * from './build-blank-slide.command';
2
+ export * from './create-presentation.command';
3
+ export * from './delete-all-user-presentations.command';
4
+ export * from './delete-slide-outline.command';
5
+ export * from './delete-presentation.command';
6
+ export * from './export-presentation-as-pptx.command';
7
+ export * from './find-presentation-by-uuid.command';
8
+ export * from './find-presentation-outline.command';
9
+ export * from './find-presentations.command';
10
+ export * from './generate-presentation-slides.command';
11
+ export * from './generate-and-insert-slide.command';
12
+ export * from './get-presentation-config.command';
13
+ export * from './reposition-slide-outline.command';
14
+ export * from './update-slide-outline.command';
15
+ export * from './update-presentation-outline.command';
16
+ export * from './update-presentation.command';
17
+ export * from './update-presentation-slides.command';
18
+ export * from './update-slide-image-slot.command';
19
+ export * from './update-slide-outline.command';
20
+ export * from './presentation-paraphrase.command';
21
+ export * from './presentation-generate-report.command';
22
+ export * from './update-slide.command';
23
+ export * from './set-reaction-to-presentation.command';
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace PresentationGenerateReportCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ presentationId: z.string(),
6
+ });
7
+
8
+ export const RequestSchema = RequestParamsSchema;
9
+
10
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const ResponseSchema = z.object({
14
+ data: z.object({
15
+ output: z.string(),
16
+ docxUrl: z.string(),
17
+ }),
18
+ });
19
+
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace PresentationParaphraseCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ presentationId: z.string(),
6
+ slideId: z.string(),
7
+ });
8
+
9
+ export const RequestBodySchema = z.object({
10
+ selectionText: z.string().max(10000),
11
+ });
12
+
13
+ export const RequestSchema = RequestParamsSchema.merge(RequestBodySchema);
14
+
15
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
16
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
17
+ export type Request = z.infer<typeof RequestSchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: z.object({
21
+ output: z.string(),
22
+ }),
23
+ });
24
+
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace RepositionSlideOutlineCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ presentationId: z.string().uuid(),
6
+ slideOutlineId: 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
+ }
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import { USER_REACTION } from '../../constants';
3
+ import { PresentationSchema } from '../../models/presentation';
4
+
5
+ export namespace SetReactionToPresentationCommand {
6
+ export const RequestSchema = z.object({
7
+ uuid: z.string().uuid(),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const RequestBodySchema = z
12
+ .object({
13
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
14
+ dislikeReason: z.string().nullable().default(null),
15
+ })
16
+ .refine(
17
+ (data) => {
18
+ if (data.reaction !== USER_REACTION.DISLIKED && data.dislikeReason) {
19
+ return false;
20
+ }
21
+ return true;
22
+ },
23
+ {
24
+ message: 'Dislike reason is not allowed when reaction is not DISLIKED',
25
+ },
26
+ );
27
+ export type RequestParams = z.infer<typeof RequestBodySchema>;
28
+
29
+ export const ResponseSchema = z.object({
30
+ data: PresentationSchema,
31
+ });
32
+ export type Response = z.infer<typeof ResponseSchema>;
33
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { SlideOutlineBulkUpdateSchema, SlideOutlineSchema } from '../../models/presentation';
3
+
4
+ export namespace UpdatePresentationOutlineCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export const RequestBodySchema = SlideOutlineBulkUpdateSchema;
10
+
11
+ export type Request = z.infer<typeof RequestBodySchema>;
12
+
13
+ export const ResponseSchema = z.object({
14
+ data: SlideOutlineSchema.array(),
15
+ });
16
+
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { SlideBulkUpdateSchema } from '../../models/presentation';
3
+
4
+ export namespace UpdatePresentationSlidesCommand {
5
+ export const RequestSchema = z.object({
6
+ data: SlideBulkUpdateSchema,
7
+ });
8
+
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const RequestParamsSchema = z.object({
12
+ uuid: z.string().uuid(),
13
+ });
14
+
15
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
16
+
17
+ export const ResponseSchema = z.object({
18
+ data: z.array(
19
+ z.object({
20
+ uuid: z.string().uuid(),
21
+ order: z.number(),
22
+ contentTypeId: z.string(),
23
+ layoutId: z.string(),
24
+ content: z.record(z.any()),
25
+ createdAt: z.date(),
26
+ updatedAt: z.date(),
27
+ }),
28
+ ),
29
+ });
30
+
31
+ export type Response = z.infer<typeof ResponseSchema>;
32
+ }
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ import { PresentationSchema } from '../../models/presentation';
3
+
4
+ export namespace UpdatePresentationCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
9
+
10
+ export const RequestBodySchema = PresentationSchema.pick({
11
+ title: true,
12
+ templateId: true,
13
+ }).partial();
14
+ export type Request = z.infer<typeof RequestBodySchema>;
15
+
16
+ export const ResponseSchema = z.object({
17
+ data: PresentationSchema,
18
+ });
19
+
20
+ export type Response = z.infer<typeof ResponseSchema>;
21
+ }
@@ -0,0 +1,40 @@
1
+ import { z } from 'zod';
2
+ import { SLIDE_IMAGE_SLOT_ACTION } from '../../constants';
3
+ import { SlideImageSlotSchema } from '../../models/presentation/slide-image-slot.schema';
4
+
5
+ export namespace UpdateSlideImageSlotCommand {
6
+ const ReplacePayload = z.object({
7
+ action: z.literal(SLIDE_IMAGE_SLOT_ACTION.REPLACE),
8
+ fileId: z.string().uuid(),
9
+ });
10
+
11
+ const GeneratePayload = z.object({
12
+ action: z.literal(SLIDE_IMAGE_SLOT_ACTION.GENERATE),
13
+ prompt: z.string().min(1).max(1000).optional(),
14
+ });
15
+
16
+ const UpdateImageSlotPayloadSchema = z.discriminatedUnion('action', [
17
+ ReplacePayload,
18
+ GeneratePayload,
19
+ ]);
20
+ export type UpdateImageSlotPayload = z.infer<typeof UpdateImageSlotPayloadSchema>;
21
+
22
+ export const RequestSchema = z.object({
23
+ payload: UpdateImageSlotPayloadSchema,
24
+ });
25
+ export type Request = z.infer<typeof RequestSchema>;
26
+
27
+ export const RequestParamsSchema = z.object({
28
+ presentationId: z.string().uuid(),
29
+ slideId: z.string().uuid(),
30
+ slotId: z.string().uuid().optional(),
31
+ });
32
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
33
+
34
+ export const ResponseSchema = z.object({
35
+ data: z.object({
36
+ imageSlot: SlideImageSlotSchema,
37
+ }),
38
+ });
39
+ export type Response = z.infer<typeof ResponseSchema>;
40
+ }
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { SlideOutlineSchema } from '../../models/presentation';
3
+ import { SLIDE_CONTENT_TYPE } from '../../constants';
4
+
5
+ export namespace UpdateSlideOutlineCommand {
6
+ export const RequestParamsSchema = z.object({
7
+ presentationId: z.string().uuid(),
8
+ slideOutlineId: z.string().uuid(),
9
+ });
10
+
11
+ export const RequestBodySchema = z
12
+ .object({
13
+ title: z.string(),
14
+ body: z.string(),
15
+ contentTypeId: z.nativeEnum(SLIDE_CONTENT_TYPE),
16
+ })
17
+ .partial();
18
+
19
+ export type Request = z.infer<typeof RequestBodySchema>;
20
+
21
+ export const ResponseSchema = z.object({
22
+ data: SlideOutlineSchema,
23
+ });
24
+
25
+ export type Response = z.infer<typeof ResponseSchema>;
26
+ }
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { SlideSchema, SlideUpdateSchema } from '../../models/presentation';
3
+
4
+ export namespace UpdateSlideCommand {
5
+ export const RequestParamsSchema = z.object({
6
+ presentationId: z.string(),
7
+ slideId: z.string(),
8
+ });
9
+
10
+ export const RequestBodySchema = z.object({
11
+ data: SlideUpdateSchema,
12
+ });
13
+
14
+ export const RequestSchema = RequestParamsSchema.merge(RequestBodySchema);
15
+
16
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
17
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
18
+ export type Request = z.infer<typeof RequestSchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: SlideSchema,
22
+ });
23
+
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -1192,4 +1192,240 @@ export const ERRORS = {
1192
1192
  code: 'TOOLS_001',
1193
1193
  httpCode: 500,
1194
1194
  },
1195
+ // PRESENTATION
1196
+ PRESENTATION_SAVE_ERROR: {
1197
+ message: 'Ошибка при сохранении презентации',
1198
+ code: 'PRESENTATION_001',
1199
+ httpCode: 500,
1200
+ },
1201
+ PRESENTATION_NOT_FOUND: {
1202
+ message: 'Презентация не найдена',
1203
+ code: 'PRESENTATION_002',
1204
+ httpCode: 404,
1205
+ },
1206
+ PRESENTATION_OWNERSHIP_ERROR: {
1207
+ message: 'Пользователь не является владельцем презентации',
1208
+ code: 'PRESENTATION_003',
1209
+ httpCode: 403,
1210
+ },
1211
+ PRESENTATION_STAGE_OUTLINE_GENERATED_REQUIRED: {
1212
+ message: 'Требуется стадия генерации плана презентации',
1213
+ code: 'PRESENTATION_004',
1214
+ httpCode: 400,
1215
+ },
1216
+ PRESENTATION_TOO_MANY_SLIDES: {
1217
+ message: 'Слишком много слайдов в презентации',
1218
+ code: 'PRESENTATION_005',
1219
+ httpCode: 400,
1220
+ },
1221
+ PRESENTATION_TOO_FEW_SLIDES: {
1222
+ message: 'Слишком мало слайдов в презентации',
1223
+ code: 'PRESENTATION_006',
1224
+ httpCode: 400,
1225
+ },
1226
+ PRESENTATION_CREATE_BLANK_SLIDE_ERROR: {
1227
+ message: 'Ошибка при создании пустого слайда',
1228
+ code: 'PRESENTATION_007',
1229
+ httpCode: 500,
1230
+ },
1231
+ PRESENTATION_SLIDE_NOT_FOUND: {
1232
+ message: 'Слайд не найден',
1233
+ code: 'PRESENTATION_008',
1234
+ httpCode: 404,
1235
+ },
1236
+ PRESENTATION_INVALID_CONTENT_TYPE_CHANGE: {
1237
+ message: 'Недопустимое изменение типа содержимого',
1238
+ code: 'PRESENTATION_009',
1239
+ httpCode: 400,
1240
+ },
1241
+ PRESENTATION_SLIDE_IMAGE_SLOT_NOT_FOUND: {
1242
+ message: 'Слот изображения слайда не найден',
1243
+ code: 'PRESENTATION_010',
1244
+ httpCode: 404,
1245
+ },
1246
+ PRESENTATION_SLIDE_IMAGE_UPDATE_ERROR: {
1247
+ message: 'Ошибка при обновлении изображения слайда',
1248
+ code: 'PRESENTATION_011',
1249
+ httpCode: 500,
1250
+ },
1251
+ PRESENTATION_IMAGE_GENERATION_ERROR: {
1252
+ message: 'Ошибка при генерации изображения',
1253
+ code: 'PRESENTATION_012',
1254
+ httpCode: 500,
1255
+ },
1256
+ PRESENTATION_INVALID_SLIDE_POSITION: {
1257
+ message: 'Недопустимая позиция слайда',
1258
+ code: 'PRESENTATION_013',
1259
+ httpCode: 400,
1260
+ },
1261
+ PRESENTATION_OUTLINE_UPDATE_ERROR: {
1262
+ message: 'Ошибка при обновлении плана презентации',
1263
+ code: 'PRESENTATION_014',
1264
+ httpCode: 500,
1265
+ },
1266
+ PRESENTATION_SAVE_SLIDES_ERROR: {
1267
+ message: 'Ошибка при сохранении слайдов',
1268
+ code: 'PRESENTATION_015',
1269
+ httpCode: 500,
1270
+ },
1271
+ PRESENTATION_GENERATE_OUTLINE_ERROR: {
1272
+ message: 'Ошибка при генерации плана презентации',
1273
+ code: 'PRESENTATION_016',
1274
+ httpCode: 500,
1275
+ },
1276
+ PRESENTATION_FIND_ERROR: {
1277
+ message: 'Ошибка при поиске презентации',
1278
+ code: 'PRESENTATION_017',
1279
+ httpCode: 500,
1280
+ },
1281
+ PRESENTATION_GENERATE_SLIDES_ERROR: {
1282
+ message: 'Ошибка при генерации слайдов',
1283
+ code: 'PRESENTATION_018',
1284
+ httpCode: 500,
1285
+ },
1286
+ PRESENTATION_DELETE_ERROR: {
1287
+ message: 'Ошибка при удалении презентации',
1288
+ code: 'PRESENTATION_019',
1289
+ httpCode: 500,
1290
+ },
1291
+ PRESENTATION_STAGE_CREATED_REQUIRED: {
1292
+ message: 'Требуется стадия создания презентации',
1293
+ code: 'PRESENTATION_020',
1294
+ httpCode: 400,
1295
+ },
1296
+ PRESENTATION_STAGE_SLIDES_GENERATED_REQUIRED: {
1297
+ message: 'Требуется стадия генерации слайдов',
1298
+ code: 'PRESENTATION_021',
1299
+ httpCode: 400,
1300
+ },
1301
+ // SLIDE_OUTLINE
1302
+ SLIDE_OUTLINE_INVALID_POSITION: {
1303
+ message: 'Недопустимая позиция слайда в плане',
1304
+ code: 'SLIDE_OUTLINE_001',
1305
+ httpCode: 400,
1306
+ },
1307
+ SLIDE_OUTLINE_NOT_FOUND: {
1308
+ message: 'Слайд в плане не найден',
1309
+ code: 'SLIDE_OUTLINE_002',
1310
+ httpCode: 404,
1311
+ },
1312
+ SLIDE_OUTLINE_FIND_ERROR: {
1313
+ message: 'Ошибка при поиске слайдов в плане',
1314
+ code: 'SLIDE_OUTLINE_003',
1315
+ httpCode: 500,
1316
+ },
1317
+ SLIDE_OUTLINE_UPDATE_ERROR: {
1318
+ message: 'Ошибка при обновлении слайда в плане',
1319
+ code: 'SLIDE_OUTLINE_004',
1320
+ httpCode: 500,
1321
+ },
1322
+ SLIDE_OUTLINE_REPOSITION_ERROR: {
1323
+ message: 'Ошибка при изменении позиции слайда в плане',
1324
+ code: 'SLIDE_OUTLINE_005',
1325
+ httpCode: 500,
1326
+ },
1327
+ SLIDE_OUTLINE_DELETE_ERROR: {
1328
+ message: 'Ошибка при удалении слайда из плана',
1329
+ code: 'SLIDE_OUTLINE_006',
1330
+ httpCode: 500,
1331
+ },
1332
+ SLIDE_OUTLINE_SAVE_ERROR: {
1333
+ message: 'Ошибка при сохранении слайдов в плане',
1334
+ code: 'SLIDE_OUTLINE_007',
1335
+ httpCode: 500,
1336
+ },
1337
+ // PPTX_GENERATION
1338
+ PPTX_GENERATION_INTERNAL_ERROR: {
1339
+ message: 'Ошибка при генерации PPTX файла',
1340
+ code: 'PPTX_GENERATION_001',
1341
+ httpCode: 500,
1342
+ },
1343
+ // PRESENTATION_AI_ACTION
1344
+ PRESENTATION_AI_ACTION_PROMPT_TOO_LONG: {
1345
+ message: 'Промпт для действия AI слишком длинный',
1346
+ code: 'PRESENTATION_AI_ACTION_001',
1347
+ httpCode: 400,
1348
+ },
1349
+ PRESENTATION_AI_ACTION_NOT_FOUND: {
1350
+ message: 'Действие AI не найдено',
1351
+ code: 'PRESENTATION_AI_ACTION_002',
1352
+ httpCode: 404,
1353
+ },
1354
+ PRESENTATION_AI_ACTION_FIND_ERROR: {
1355
+ message: 'Ошибка при поиске действия AI',
1356
+ code: 'PRESENTATION_AI_ACTION_003',
1357
+ httpCode: 500,
1358
+ },
1359
+ // AI
1360
+ AI_ERROR: {
1361
+ message: 'Ошибка при работе с AI',
1362
+ code: 'AI_001',
1363
+ httpCode: 500,
1364
+ },
1365
+ // SLIDE_LAYOUT
1366
+ SLIDE_LAYOUT_FIND_ERROR: {
1367
+ message: 'Ошибка при поиске макета слайда',
1368
+ code: 'SLIDE_LAYOUT_001',
1369
+ httpCode: 500,
1370
+ },
1371
+ SLIDE_LAYOUT_NOT_FOUND: {
1372
+ message: 'Макет слайда не найден',
1373
+ code: 'SLIDE_LAYOUT_002',
1374
+ httpCode: 404,
1375
+ },
1376
+ SLIDE_LAYOUT_SAVE_ERROR: {
1377
+ message: 'Ошибка при сохранении макета слайда',
1378
+ code: 'SLIDE_LAYOUT_003',
1379
+ httpCode: 500,
1380
+ },
1381
+ // SLIDE_IMAGE_SLOT
1382
+ SLIDE_IMAGE_SLOT_SAVE_ERROR: {
1383
+ message: 'Ошибка при сохранении слота изображения слайда',
1384
+ code: 'SLIDE_IMAGE_SLOT_001',
1385
+ httpCode: 500,
1386
+ },
1387
+ // SLIDE_CONTENT_TYPE
1388
+ SLIDE_CONTENT_TYPE_FIND_ERROR: {
1389
+ message: 'Ошибка при поиске типа содержимого слайда',
1390
+ code: 'SLIDE_CONTENT_TYPE_001',
1391
+ httpCode: 500,
1392
+ },
1393
+ // PRESENTATION_TEMPLATE
1394
+ PRESENTATION_TEMPLATE_NOT_FOUND: {
1395
+ message: 'Шаблон презентации не найден',
1396
+ code: 'PRESENTATION_TEMPLATE_001',
1397
+ httpCode: 404,
1398
+ },
1399
+ PRESENTATION_TEMPLATE_FIND_ERROR: {
1400
+ message: 'Ошибка при поиске шаблона презентации',
1401
+ code: 'PRESENTATION_TEMPLATE_002',
1402
+ httpCode: 500,
1403
+ },
1404
+ // PRESENTATION_AI_ACTION_CALL
1405
+ PRESENTATION_AI_ACTION_CALL_NOT_FOUND: {
1406
+ message: 'Вызов действия AI не найден',
1407
+ code: 'PRESENTATION_AI_ACTION_CALL_001',
1408
+ httpCode: 404,
1409
+ },
1410
+ PRESENTATION_AI_ACTION_CALL_FIND_ERROR: {
1411
+ message: 'Ошибка при поиске вызова действия AI',
1412
+ code: 'PRESENTATION_AI_ACTION_CALL_002',
1413
+ httpCode: 500,
1414
+ },
1415
+ PRESENTATION_AI_ACTION_CALL_SAVE_ERROR: {
1416
+ message: 'Ошибка при сохранении вызова действия AI',
1417
+ code: 'PRESENTATION_AI_ACTION_CALL_003',
1418
+ httpCode: 500,
1419
+ },
1420
+ // LANGUAGE
1421
+ LANGUAGE_NOT_FOUND: {
1422
+ message: 'Язык не найден',
1423
+ code: 'LANGUAGE_001',
1424
+ httpCode: 404,
1425
+ },
1426
+ LANGUAGE_FIND_ERROR: {
1427
+ message: 'Ошибка при поиске языка',
1428
+ code: 'LANGUAGE_002',
1429
+ httpCode: 500,
1430
+ },
1195
1431
  };
@@ -14,3 +14,4 @@ export * from './page';
14
14
  export * from './writer';
15
15
  export * from './files';
16
16
  export * from './common';
17
+ export * from './presentation';
@@ -0,0 +1,10 @@
1
+ export * from './presentation-stage.enum';
2
+ export * from './slide-content-type.enum';
3
+ export * from './slide-icon-slot-status.enum';
4
+ export * from './slide-image-slot.status.enum';
5
+ export * from './slide-layout.enum';
6
+ export * from './slide-image-slot-action.enum';
7
+ export * from './presentation-ai-action-type.enum';
8
+ export * from './presentation-ai-action-pricing-type.enum';
9
+ export * from './presentation-ai-action-call-status.enum';
10
+ export * from './slide-icon-slot-status.enum';
@@ -0,0 +1,5 @@
1
+ export enum PRESENTATION_AI_ACTION_CALL_STATUS {
2
+ PROCESSING = 'processing',
3
+ COMPLETED = 'completed',
4
+ FAILED = 'failed',
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum PRESENTATION_AI_ACTION_PRICING_TYPE {
2
+ PER_CHARACTER = 'PER_CHARACTER',
3
+ FLAT = 'FLAT',
4
+ }
@@ -0,0 +1,4 @@
1
+ export enum PRESENTATION_AI_ACTION_TYPE {
2
+ PARAPHRASE = 'PARAPHRASE',
3
+ GENERATE_REPORT = 'GENERATE_REPORT',
4
+ }
@@ -0,0 +1,13 @@
1
+ export enum PRESENTATION_STAGE {
2
+ CREATED = 'CREATED',
3
+
4
+ GENERATING_OUTLINE = 'GENERATING_OUTLINE',
5
+ OUTLINE_GENERATED = 'OUTLINE_GENERATED',
6
+ OUTLINE_GENERATION_FAILED = 'OUTLINE_GENERATION_FAILED',
7
+
8
+ GENERATING_SLIDES = 'GENERATING_SLIDES',
9
+ SLIDES_GENERATED = 'SLIDES_GENERATED',
10
+ SLIDES_GENERATION_FAILED = 'SLIDES_GENERATION_FAILED',
11
+
12
+ DELETED = 'DELETED',
13
+ }
@@ -0,0 +1,12 @@
1
+ export enum SLIDE_CONTENT_TYPE {
2
+ COVER = 'COVER',
3
+ TEXT = 'TEXT',
4
+ TEXT_WITH_IMAGE = 'TEXT_WITH_IMAGE',
5
+ SECTION_BREAK = 'SECTION_BREAK',
6
+ STRUCTURED_LIST = 'STRUCTURED_LIST',
7
+ CONTENTS = 'CONTENTS',
8
+ THANK_YOU = 'THANK_YOU',
9
+ TABLE = 'TABLE',
10
+ CHART = 'CHART',
11
+ TIMELINE = 'TIMELINE',
12
+ }
@@ -0,0 +1,6 @@
1
+ export enum SLIDE_ICON_SLOT_STATUS {
2
+ PENDING = 'PENDING',
3
+ IN_PROGRESS = 'IN_PROGRESS',
4
+ READY = 'READY',
5
+ ERROR = 'ERROR',
6
+ }
@@ -0,0 +1,4 @@
1
+ export enum SLIDE_IMAGE_SLOT_ACTION {
2
+ REPLACE = 'REPLACE',
3
+ GENERATE = 'GENERATE',
4
+ }