@purpleschool/student-works 1.2.2 → 1.4.0
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/index.ts +1 -0
- package/api/controller/http/presentation.ts +39 -0
- package/api/routes.ts +94 -0
- package/build/api/controller/http/index.js +1 -0
- package/build/api/controller/http/presentation.js +34 -0
- package/build/api/routes.js +54 -0
- package/build/commands/index.js +1 -0
- package/build/commands/presentation/build-blank-slide.command.js +16 -0
- package/build/commands/presentation/create-presentation.command.js +19 -0
- package/build/commands/presentation/delete-all-user-presentations.command.js +9 -0
- package/build/commands/presentation/delete-presentation.command.js +11 -0
- package/build/commands/presentation/delete-slide-outline.command.js +12 -0
- package/build/commands/presentation/export-presentation-as-pptx.command.js +17 -0
- package/build/commands/presentation/find-presentation-by-uuid.command.js +14 -0
- package/build/commands/presentation/find-presentation-outline.command.js +14 -0
- package/build/commands/presentation/find-presentations.command.js +18 -0
- package/build/commands/presentation/generate-and-insert-slide.command.js +22 -0
- package/build/commands/presentation/generate-presentation-slides.command.js +17 -0
- package/build/commands/presentation/get-presentation-config.command.js +11 -0
- package/build/commands/presentation/index.js +40 -0
- package/build/commands/presentation/presentation-generate-report.command.js +17 -0
- package/build/commands/presentation/presentation-paraphrase.command.js +20 -0
- package/build/commands/presentation/reposition-slide-outline.command.js +15 -0
- package/build/commands/presentation/reposition-slide.command.js +15 -0
- package/build/commands/presentation/set-reaction-to-presentation.command.js +28 -0
- package/build/commands/presentation/update-presentation-outline.command.js +15 -0
- package/build/commands/presentation/update-presentation-slides.command.js +25 -0
- package/build/commands/presentation/update-presentation.command.js +15 -0
- package/build/commands/presentation/update-slide-image-slot.command.js +34 -0
- package/build/commands/presentation/update-slide-outline.command.js +23 -0
- package/build/commands/presentation/update-slide.command.js +19 -0
- package/build/constants/errors/errors.js +261 -0
- package/build/constants/index.js +1 -0
- package/build/constants/presentation/enums/index.js +27 -0
- package/build/constants/presentation/enums/presentation-ai-action-call-status.enum.js +9 -0
- package/build/constants/presentation/enums/presentation-ai-action-pricing-type.enum.js +8 -0
- package/build/constants/presentation/enums/presentation-ai-action-type.enum.js +8 -0
- package/build/constants/presentation/enums/presentation-stage.enum.js +14 -0
- package/build/constants/presentation/enums/presentation-target-audience.enum.js +10 -0
- package/build/constants/presentation/enums/slide-content-type.enum.js +16 -0
- package/build/constants/presentation/enums/slide-icon-slot-status.enum.js +10 -0
- package/build/constants/presentation/enums/slide-image-slot-action.enum.js +8 -0
- package/build/constants/presentation/enums/slide-image-slot.status.enum.js +10 -0
- package/build/constants/presentation/enums/slide-layout.enum.js +8 -0
- package/build/constants/presentation/index.js +18 -0
- package/build/constants/presentation/maps/index.js +17 -0
- package/build/constants/presentation/maps/slide-layout-map.constant.js +17 -0
- package/build/helpers/index.js +1 -0
- package/build/helpers/presentation/calculate-presentation-ai-action-price.util.js +16 -0
- package/build/helpers/presentation/index.js +17 -0
- package/build/models/index.js +1 -0
- package/build/models/language.schema.js +11 -0
- package/build/models/presentation/index.js +25 -0
- package/build/models/presentation/pptx-export-payload.schema.js +216 -0
- package/build/models/presentation/presentation-ai-action.schema.js +27 -0
- package/build/models/presentation/presentation-config.schema.js +21 -0
- package/build/models/presentation/presentation-template.schema.js +13 -0
- package/build/models/presentation/presentation-title-page.schema.js +9 -0
- package/build/models/presentation/presentation.schema.js +35 -0
- package/build/models/presentation/slide-content-edit.schema.js +146 -0
- package/build/models/presentation/slide-content-type.schema.js +14 -0
- package/build/models/presentation/slide-content.schema.js +368 -0
- package/build/models/presentation/slide-icon-slot.schema.js +15 -0
- package/build/models/presentation/slide-image-slot.schema.js +16 -0
- package/build/models/presentation/slide-outline.schema.js +50 -0
- package/build/models/presentation/slide.schema.js +58 -0
- package/commands/index.ts +1 -0
- package/commands/presentation/build-blank-slide.command.ts +18 -0
- package/commands/presentation/create-presentation.command.ts +21 -0
- package/commands/presentation/delete-all-user-presentations.command.ts +9 -0
- package/commands/presentation/delete-presentation.command.ts +13 -0
- package/commands/presentation/delete-slide-outline.command.ts +12 -0
- package/commands/presentation/export-presentation-as-pptx.command.ts +20 -0
- package/commands/presentation/find-presentation-by-uuid.command.ts +16 -0
- package/commands/presentation/find-presentation-outline.command.ts +16 -0
- package/commands/presentation/find-presentations.command.ts +18 -0
- package/commands/presentation/generate-and-insert-slide.command.ts +27 -0
- package/commands/presentation/generate-presentation-slides.command.ts +21 -0
- package/commands/presentation/get-presentation-config.command.ts +10 -0
- package/commands/presentation/index.ts +24 -0
- package/commands/presentation/presentation-generate-report.command.ts +21 -0
- package/commands/presentation/presentation-paraphrase.command.ts +26 -0
- package/commands/presentation/reposition-slide-outline.command.ts +17 -0
- package/commands/presentation/reposition-slide.command.ts +17 -0
- package/commands/presentation/set-reaction-to-presentation.command.ts +33 -0
- package/commands/presentation/update-presentation-outline.command.ts +18 -0
- package/commands/presentation/update-presentation-slides.command.ts +32 -0
- package/commands/presentation/update-presentation.command.ts +18 -0
- package/commands/presentation/update-slide-image-slot.command.ts +40 -0
- package/commands/presentation/update-slide-outline.command.ts +26 -0
- package/commands/presentation/update-slide.command.ts +25 -0
- package/constants/errors/errors.ts +261 -0
- package/constants/index.ts +1 -0
- package/constants/presentation/enums/index.ts +11 -0
- package/constants/presentation/enums/presentation-ai-action-call-status.enum.ts +5 -0
- package/constants/presentation/enums/presentation-ai-action-pricing-type.enum.ts +4 -0
- package/constants/presentation/enums/presentation-ai-action-type.enum.ts +4 -0
- package/constants/presentation/enums/presentation-stage.enum.ts +13 -0
- package/constants/presentation/enums/presentation-target-audience.enum.ts +6 -0
- package/constants/presentation/enums/slide-content-type.enum.ts +12 -0
- package/constants/presentation/enums/slide-icon-slot-status.enum.ts +6 -0
- package/constants/presentation/enums/slide-image-slot-action.enum.ts +4 -0
- package/constants/presentation/enums/slide-image-slot.status.enum.ts +6 -0
- package/constants/presentation/enums/slide-layout.enum.ts +4 -0
- package/constants/presentation/index.ts +2 -0
- package/constants/presentation/maps/index.ts +1 -0
- package/constants/presentation/maps/slide-layout-map.constant.ts +15 -0
- package/helpers/index.ts +1 -0
- package/helpers/presentation/calculate-presentation-ai-action-price.util.ts +20 -0
- package/helpers/presentation/index.ts +1 -0
- package/models/index.ts +1 -0
- package/models/language.schema.ts +9 -0
- package/models/presentation/index.ts +9 -0
- package/models/presentation/pptx-export-payload.schema.ts +246 -0
- package/models/presentation/presentation-ai-action.schema.ts +30 -0
- package/models/presentation/presentation-config.schema.ts +20 -0
- package/models/presentation/presentation-template.schema.ts +11 -0
- package/models/presentation/presentation-title-page.schema.ts +9 -0
- package/models/presentation/presentation.schema.ts +38 -0
- package/models/presentation/slide-content-edit.schema.ts +175 -0
- package/models/presentation/slide-content-type.schema.ts +13 -0
- package/models/presentation/slide-content.schema.ts +581 -0
- package/models/presentation/slide-icon-slot.schema.ts +13 -0
- package/models/presentation/slide-image-slot.schema.ts +14 -0
- package/models/presentation/slide-outline.schema.ts +58 -0
- package/models/presentation/slide.schema.ts +66 -0
- 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,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PresentationSchema, PresentationTitlePageSchema } 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 RequestBodySchema = z.object({
|
|
12
|
+
titlePage: PresentationTitlePageSchema.optional().nullable(),
|
|
13
|
+
});
|
|
14
|
+
export type RequestBody = 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,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,24 @@
|
|
|
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 './reposition-slide.command';
|
|
15
|
+
export * from './update-slide-outline.command';
|
|
16
|
+
export * from './update-presentation-outline.command';
|
|
17
|
+
export * from './update-presentation.command';
|
|
18
|
+
export * from './update-presentation-slides.command';
|
|
19
|
+
export * from './update-slide-image-slot.command';
|
|
20
|
+
export * from './update-slide-outline.command';
|
|
21
|
+
export * from './presentation-paraphrase.command';
|
|
22
|
+
export * from './presentation-generate-report.command';
|
|
23
|
+
export * from './update-slide.command';
|
|
24
|
+
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,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
|
+
}
|
|
@@ -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,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PresentationSchema, PresentationUpdateSchema } 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 = PresentationUpdateSchema;
|
|
11
|
+
export type Request = z.infer<typeof RequestBodySchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.object({
|
|
14
|
+
data: PresentationSchema,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
'Достигнуто максимальное количество документов для неавторизованного пользователя. Пожалуйста, авторизуйтесь.',
|
|
@@ -1192,4 +1212,245 @@ export const ERRORS = {
|
|
|
1192
1212
|
code: 'TOOLS_001',
|
|
1193
1213
|
httpCode: 500,
|
|
1194
1214
|
},
|
|
1215
|
+
// PRESENTATION
|
|
1216
|
+
PRESENTATION_SAVE_ERROR: {
|
|
1217
|
+
message: 'Ошибка при сохранении презентации',
|
|
1218
|
+
code: 'PRESENTATION_001',
|
|
1219
|
+
httpCode: 500,
|
|
1220
|
+
},
|
|
1221
|
+
PRESENTATION_NOT_FOUND: {
|
|
1222
|
+
message: 'Презентация не найдена',
|
|
1223
|
+
code: 'PRESENTATION_002',
|
|
1224
|
+
httpCode: 404,
|
|
1225
|
+
},
|
|
1226
|
+
PRESENTATION_OWNERSHIP_ERROR: {
|
|
1227
|
+
message: 'Пользователь не является владельцем презентации',
|
|
1228
|
+
code: 'PRESENTATION_003',
|
|
1229
|
+
httpCode: 403,
|
|
1230
|
+
},
|
|
1231
|
+
PRESENTATION_STAGE_OUTLINE_GENERATED_REQUIRED: {
|
|
1232
|
+
message: 'Требуется стадия генерации плана презентации',
|
|
1233
|
+
code: 'PRESENTATION_004',
|
|
1234
|
+
httpCode: 400,
|
|
1235
|
+
},
|
|
1236
|
+
PRESENTATION_TOO_MANY_SLIDES: {
|
|
1237
|
+
message: 'Слишком много слайдов в презентации',
|
|
1238
|
+
code: 'PRESENTATION_005',
|
|
1239
|
+
httpCode: 400,
|
|
1240
|
+
},
|
|
1241
|
+
PRESENTATION_TOO_FEW_SLIDES: {
|
|
1242
|
+
message: 'Слишком мало слайдов в презентации',
|
|
1243
|
+
code: 'PRESENTATION_006',
|
|
1244
|
+
httpCode: 400,
|
|
1245
|
+
},
|
|
1246
|
+
PRESENTATION_CREATE_BLANK_SLIDE_ERROR: {
|
|
1247
|
+
message: 'Ошибка при создании пустого слайда',
|
|
1248
|
+
code: 'PRESENTATION_007',
|
|
1249
|
+
httpCode: 500,
|
|
1250
|
+
},
|
|
1251
|
+
PRESENTATION_SLIDE_NOT_FOUND: {
|
|
1252
|
+
message: 'Слайд не найден',
|
|
1253
|
+
code: 'PRESENTATION_008',
|
|
1254
|
+
httpCode: 404,
|
|
1255
|
+
},
|
|
1256
|
+
PRESENTATION_INVALID_CONTENT_TYPE_CHANGE: {
|
|
1257
|
+
message: 'Недопустимое изменение типа содержимого',
|
|
1258
|
+
code: 'PRESENTATION_009',
|
|
1259
|
+
httpCode: 400,
|
|
1260
|
+
},
|
|
1261
|
+
PRESENTATION_SLIDE_IMAGE_SLOT_NOT_FOUND: {
|
|
1262
|
+
message: 'Слот изображения слайда не найден',
|
|
1263
|
+
code: 'PRESENTATION_010',
|
|
1264
|
+
httpCode: 404,
|
|
1265
|
+
},
|
|
1266
|
+
PRESENTATION_SLIDE_IMAGE_UPDATE_ERROR: {
|
|
1267
|
+
message: 'Ошибка при обновлении изображения слайда',
|
|
1268
|
+
code: 'PRESENTATION_011',
|
|
1269
|
+
httpCode: 500,
|
|
1270
|
+
},
|
|
1271
|
+
PRESENTATION_IMAGE_GENERATION_ERROR: {
|
|
1272
|
+
message: 'Ошибка при генерации изображения',
|
|
1273
|
+
code: 'PRESENTATION_012',
|
|
1274
|
+
httpCode: 500,
|
|
1275
|
+
},
|
|
1276
|
+
PRESENTATION_INVALID_SLIDE_POSITION: {
|
|
1277
|
+
message: 'Недопустимая позиция слайда',
|
|
1278
|
+
code: 'PRESENTATION_013',
|
|
1279
|
+
httpCode: 400,
|
|
1280
|
+
},
|
|
1281
|
+
PRESENTATION_OUTLINE_UPDATE_ERROR: {
|
|
1282
|
+
message: 'Ошибка при обновлении плана презентации',
|
|
1283
|
+
code: 'PRESENTATION_014',
|
|
1284
|
+
httpCode: 500,
|
|
1285
|
+
},
|
|
1286
|
+
PRESENTATION_SAVE_SLIDES_ERROR: {
|
|
1287
|
+
message: 'Ошибка при сохранении слайдов',
|
|
1288
|
+
code: 'PRESENTATION_015',
|
|
1289
|
+
httpCode: 500,
|
|
1290
|
+
},
|
|
1291
|
+
PRESENTATION_GENERATE_OUTLINE_ERROR: {
|
|
1292
|
+
message: 'Ошибка при генерации плана презентации',
|
|
1293
|
+
code: 'PRESENTATION_016',
|
|
1294
|
+
httpCode: 500,
|
|
1295
|
+
},
|
|
1296
|
+
PRESENTATION_FIND_ERROR: {
|
|
1297
|
+
message: 'Ошибка при поиске презентации',
|
|
1298
|
+
code: 'PRESENTATION_017',
|
|
1299
|
+
httpCode: 500,
|
|
1300
|
+
},
|
|
1301
|
+
PRESENTATION_GENERATE_SLIDES_ERROR: {
|
|
1302
|
+
message: 'Ошибка при генерации слайдов',
|
|
1303
|
+
code: 'PRESENTATION_018',
|
|
1304
|
+
httpCode: 500,
|
|
1305
|
+
},
|
|
1306
|
+
PRESENTATION_DELETE_ERROR: {
|
|
1307
|
+
message: 'Ошибка при удалении презентации',
|
|
1308
|
+
code: 'PRESENTATION_019',
|
|
1309
|
+
httpCode: 500,
|
|
1310
|
+
},
|
|
1311
|
+
PRESENTATION_STAGE_CREATED_REQUIRED: {
|
|
1312
|
+
message: 'Требуется стадия создания презентации',
|
|
1313
|
+
code: 'PRESENTATION_020',
|
|
1314
|
+
httpCode: 400,
|
|
1315
|
+
},
|
|
1316
|
+
PRESENTATION_STAGE_SLIDES_GENERATED_REQUIRED: {
|
|
1317
|
+
message: 'Требуется стадия генерации слайдов',
|
|
1318
|
+
code: 'PRESENTATION_021',
|
|
1319
|
+
httpCode: 400,
|
|
1320
|
+
},
|
|
1321
|
+
PRESENTATION_REPOSITION_SLIDE_ERROR: {
|
|
1322
|
+
message: 'Ошибка при изменении позиции слайда',
|
|
1323
|
+
code: 'PRESENTATION_022',
|
|
1324
|
+
httpCode: 500,
|
|
1325
|
+
},
|
|
1326
|
+
// SLIDE_OUTLINE
|
|
1327
|
+
SLIDE_OUTLINE_INVALID_POSITION: {
|
|
1328
|
+
message: 'Недопустимая позиция слайда в плане',
|
|
1329
|
+
code: 'SLIDE_OUTLINE_001',
|
|
1330
|
+
httpCode: 400,
|
|
1331
|
+
},
|
|
1332
|
+
SLIDE_OUTLINE_NOT_FOUND: {
|
|
1333
|
+
message: 'Слайд в плане не найден',
|
|
1334
|
+
code: 'SLIDE_OUTLINE_002',
|
|
1335
|
+
httpCode: 404,
|
|
1336
|
+
},
|
|
1337
|
+
SLIDE_OUTLINE_FIND_ERROR: {
|
|
1338
|
+
message: 'Ошибка при поиске слайдов в плане',
|
|
1339
|
+
code: 'SLIDE_OUTLINE_003',
|
|
1340
|
+
httpCode: 500,
|
|
1341
|
+
},
|
|
1342
|
+
SLIDE_OUTLINE_UPDATE_ERROR: {
|
|
1343
|
+
message: 'Ошибка при обновлении слайда в плане',
|
|
1344
|
+
code: 'SLIDE_OUTLINE_004',
|
|
1345
|
+
httpCode: 500,
|
|
1346
|
+
},
|
|
1347
|
+
SLIDE_OUTLINE_REPOSITION_ERROR: {
|
|
1348
|
+
message: 'Ошибка при изменении позиции слайда в плане',
|
|
1349
|
+
code: 'SLIDE_OUTLINE_005',
|
|
1350
|
+
httpCode: 500,
|
|
1351
|
+
},
|
|
1352
|
+
SLIDE_OUTLINE_DELETE_ERROR: {
|
|
1353
|
+
message: 'Ошибка при удалении слайда из плана',
|
|
1354
|
+
code: 'SLIDE_OUTLINE_006',
|
|
1355
|
+
httpCode: 500,
|
|
1356
|
+
},
|
|
1357
|
+
SLIDE_OUTLINE_SAVE_ERROR: {
|
|
1358
|
+
message: 'Ошибка при сохранении слайдов в плане',
|
|
1359
|
+
code: 'SLIDE_OUTLINE_007',
|
|
1360
|
+
httpCode: 500,
|
|
1361
|
+
},
|
|
1362
|
+
// PPTX_GENERATION
|
|
1363
|
+
PPTX_GENERATION_INTERNAL_ERROR: {
|
|
1364
|
+
message: 'Ошибка при генерации PPTX файла',
|
|
1365
|
+
code: 'PPTX_GENERATION_001',
|
|
1366
|
+
httpCode: 500,
|
|
1367
|
+
},
|
|
1368
|
+
// PRESENTATION_AI_ACTION
|
|
1369
|
+
PRESENTATION_AI_ACTION_PROMPT_TOO_LONG: {
|
|
1370
|
+
message: 'Промпт для действия AI слишком длинный',
|
|
1371
|
+
code: 'PRESENTATION_AI_ACTION_001',
|
|
1372
|
+
httpCode: 400,
|
|
1373
|
+
},
|
|
1374
|
+
PRESENTATION_AI_ACTION_NOT_FOUND: {
|
|
1375
|
+
message: 'Действие AI не найдено',
|
|
1376
|
+
code: 'PRESENTATION_AI_ACTION_002',
|
|
1377
|
+
httpCode: 404,
|
|
1378
|
+
},
|
|
1379
|
+
PRESENTATION_AI_ACTION_FIND_ERROR: {
|
|
1380
|
+
message: 'Ошибка при поиске действия AI',
|
|
1381
|
+
code: 'PRESENTATION_AI_ACTION_003',
|
|
1382
|
+
httpCode: 500,
|
|
1383
|
+
},
|
|
1384
|
+
// AI
|
|
1385
|
+
AI_ERROR: {
|
|
1386
|
+
message: 'Ошибка при работе с AI',
|
|
1387
|
+
code: 'AI_001',
|
|
1388
|
+
httpCode: 500,
|
|
1389
|
+
},
|
|
1390
|
+
// SLIDE_LAYOUT
|
|
1391
|
+
SLIDE_LAYOUT_FIND_ERROR: {
|
|
1392
|
+
message: 'Ошибка при поиске макета слайда',
|
|
1393
|
+
code: 'SLIDE_LAYOUT_001',
|
|
1394
|
+
httpCode: 500,
|
|
1395
|
+
},
|
|
1396
|
+
SLIDE_LAYOUT_NOT_FOUND: {
|
|
1397
|
+
message: 'Макет слайда не найден',
|
|
1398
|
+
code: 'SLIDE_LAYOUT_002',
|
|
1399
|
+
httpCode: 404,
|
|
1400
|
+
},
|
|
1401
|
+
SLIDE_LAYOUT_SAVE_ERROR: {
|
|
1402
|
+
message: 'Ошибка при сохранении макета слайда',
|
|
1403
|
+
code: 'SLIDE_LAYOUT_003',
|
|
1404
|
+
httpCode: 500,
|
|
1405
|
+
},
|
|
1406
|
+
// SLIDE_IMAGE_SLOT
|
|
1407
|
+
SLIDE_IMAGE_SLOT_SAVE_ERROR: {
|
|
1408
|
+
message: 'Ошибка при сохранении слота изображения слайда',
|
|
1409
|
+
code: 'SLIDE_IMAGE_SLOT_001',
|
|
1410
|
+
httpCode: 500,
|
|
1411
|
+
},
|
|
1412
|
+
// SLIDE_CONTENT_TYPE
|
|
1413
|
+
SLIDE_CONTENT_TYPE_FIND_ERROR: {
|
|
1414
|
+
message: 'Ошибка при поиске типа содержимого слайда',
|
|
1415
|
+
code: 'SLIDE_CONTENT_TYPE_001',
|
|
1416
|
+
httpCode: 500,
|
|
1417
|
+
},
|
|
1418
|
+
// PRESENTATION_TEMPLATE
|
|
1419
|
+
PRESENTATION_TEMPLATE_NOT_FOUND: {
|
|
1420
|
+
message: 'Шаблон презентации не найден',
|
|
1421
|
+
code: 'PRESENTATION_TEMPLATE_001',
|
|
1422
|
+
httpCode: 404,
|
|
1423
|
+
},
|
|
1424
|
+
PRESENTATION_TEMPLATE_FIND_ERROR: {
|
|
1425
|
+
message: 'Ошибка при поиске шаблона презентации',
|
|
1426
|
+
code: 'PRESENTATION_TEMPLATE_002',
|
|
1427
|
+
httpCode: 500,
|
|
1428
|
+
},
|
|
1429
|
+
// PRESENTATION_AI_ACTION_CALL
|
|
1430
|
+
PRESENTATION_AI_ACTION_CALL_NOT_FOUND: {
|
|
1431
|
+
message: 'Вызов действия AI не найден',
|
|
1432
|
+
code: 'PRESENTATION_AI_ACTION_CALL_001',
|
|
1433
|
+
httpCode: 404,
|
|
1434
|
+
},
|
|
1435
|
+
PRESENTATION_AI_ACTION_CALL_FIND_ERROR: {
|
|
1436
|
+
message: 'Ошибка при поиске вызова действия AI',
|
|
1437
|
+
code: 'PRESENTATION_AI_ACTION_CALL_002',
|
|
1438
|
+
httpCode: 500,
|
|
1439
|
+
},
|
|
1440
|
+
PRESENTATION_AI_ACTION_CALL_SAVE_ERROR: {
|
|
1441
|
+
message: 'Ошибка при сохранении вызова действия AI',
|
|
1442
|
+
code: 'PRESENTATION_AI_ACTION_CALL_003',
|
|
1443
|
+
httpCode: 500,
|
|
1444
|
+
},
|
|
1445
|
+
// LANGUAGE
|
|
1446
|
+
LANGUAGE_NOT_FOUND: {
|
|
1447
|
+
message: 'Язык не найден',
|
|
1448
|
+
code: 'LANGUAGE_001',
|
|
1449
|
+
httpCode: 404,
|
|
1450
|
+
},
|
|
1451
|
+
LANGUAGE_FIND_ERROR: {
|
|
1452
|
+
message: 'Ошибка при поиске языка',
|
|
1453
|
+
code: 'LANGUAGE_002',
|
|
1454
|
+
httpCode: 500,
|
|
1455
|
+
},
|
|
1195
1456
|
};
|
package/constants/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
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';
|
|
11
|
+
export * from './presentation-target-audience.enum';
|