@purpleschool/gptbot 0.12.2-stage-2 → 0.12.3
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/controllers/http/blog.ts +0 -2
- package/api/controllers/http/category.ts +0 -2
- package/api/controllers/http/course.ts +0 -8
- package/api/controllers/http/page.ts +0 -2
- package/api/controllers/http/prompt-category.ts +0 -2
- package/api/controllers/http/prompt-topic.ts +0 -2
- package/api/controllers/http/prompt.ts +0 -2
- package/api/controllers/http/question.ts +0 -2
- package/api/controllers/http/team-account.ts +0 -1
- package/api/controllers/http/writer.ts +6 -0
- package/api/routes.ts +20 -46
- package/build/api/controllers/http/blog.js +0 -2
- package/build/api/controllers/http/category.js +0 -2
- package/build/api/controllers/http/course.js +0 -6
- package/build/api/controllers/http/page.js +0 -2
- package/build/api/controllers/http/prompt-category.js +0 -2
- package/build/api/controllers/http/prompt-topic.js +0 -2
- package/build/api/controllers/http/prompt.js +0 -2
- package/build/api/controllers/http/question.js +0 -2
- package/build/api/controllers/http/team-account.js +0 -1
- package/build/api/controllers/http/writer.js +5 -0
- package/build/api/routes.js +10 -23
- package/build/commands/blog/create-post.command.js +0 -6
- package/build/commands/blog/index.js +0 -2
- package/build/commands/blog/update-post.command.js +0 -6
- package/build/commands/cabinet/get-user-statistics-by-month.command.js +12 -1
- package/build/commands/category/create-category.command.js +0 -4
- package/build/commands/category/index.js +0 -2
- package/build/commands/category/update-category.command.js +0 -4
- package/build/commands/course/create-course.command.js +0 -5
- package/build/commands/course/index.js +0 -6
- package/build/commands/page/create-page.command.js +0 -5
- package/build/commands/page/index.js +0 -2
- package/build/commands/page/update-page.command.js +0 -5
- package/build/commands/prompt/create-prompt.command.js +0 -2
- package/build/commands/prompt/index.js +0 -2
- package/build/commands/prompt/update-prompt.command.js +0 -2
- package/build/commands/prompt-category/create-prompt-category.command.js +0 -3
- package/build/commands/prompt-category/index.js +0 -2
- package/build/commands/prompt-category/update-prompt-category.command.js +0 -3
- package/build/commands/prompt-topic/create-prompt-topic.command.js +0 -5
- package/build/commands/prompt-topic/index.js +0 -2
- package/build/commands/prompt-topic/update-prompt-topic.command.js +0 -5
- package/build/commands/question/create-question.command.js +0 -2
- package/build/commands/question/index.js +0 -2
- package/build/commands/question/update-question.command.js +0 -2
- package/build/commands/team-account/get-team-account-statistics-by-month.command.js +12 -1
- package/build/commands/team-account/index.js +0 -1
- package/build/commands/tools/presentation/create-presentation.command.js +2 -0
- package/build/commands/tools/presentation/generate-presentation-slides.command.js +3 -0
- package/build/commands/tools/presentation/update-presentation.command.js +1 -0
- package/build/commands/tools/writer/collect-writer-document-sources.command.js +15 -0
- package/build/commands/tools/writer/confirm-source-citation-metadata.command.js +19 -0
- package/build/commands/tools/writer/get-writer-document-sources.command.js +14 -0
- package/build/commands/tools/writer/index.js +4 -0
- package/build/commands/tools/writer/upload-writer-source.command.js +17 -0
- package/build/commands/unregistered-user/patch-locale.command.js +3 -3
- package/build/commands/user/get-me.command.js +1 -2
- package/build/commands/user/patch-locale.command.js +3 -3
- package/build/constants/cabinet/enums/index.js +0 -1
- package/build/constants/presentation/enums/index.js +1 -0
- package/build/constants/presentation/enums/presentation-target-audience.enum.js +10 -0
- package/build/constants/user/enums/index.js +1 -0
- package/build/constants/user/enums/locale.enum.js +8 -0
- package/build/constants/writer/enums/index.js +3 -0
- package/build/constants/writer/enums/writer-document-stage.enum.js +6 -0
- package/build/constants/writer/enums/writer-source-origin.enum.js +8 -0
- package/build/constants/writer/enums/writer-source-status.enum.js +9 -0
- package/build/constants/writer/enums/writer-source-type.enum.js +8 -0
- package/build/models/tools/presentation/index.js +1 -0
- package/build/models/tools/presentation/presentation-template.schema.js +2 -0
- package/build/models/tools/presentation/presentation-title-page.schema.js +9 -0
- package/build/models/tools/presentation/presentation.schema.js +3 -0
- package/build/models/tools/presentation/slide-content-edit.schema.js +36 -24
- package/build/models/tools/presentation/slide-content.schema.js +34 -24
- package/build/models/tools/writer/index.js +2 -0
- package/build/models/tools/writer/writer-document-type.schema.js +2 -0
- package/build/models/tools/writer/writer-document.schema.js +3 -0
- package/build/models/tools/writer/writer-source-bibliographic-metadata.schema.js +27 -0
- package/build/models/tools/writer/writer-source.schema.js +20 -0
- package/build/models/user.schema.js +2 -2
- package/commands/blog/create-post.command.ts +0 -6
- package/commands/blog/index.ts +0 -2
- package/commands/blog/update-post.command.ts +0 -6
- package/commands/cabinet/get-user-statistics-by-month.command.ts +13 -6
- package/commands/category/create-category.command.ts +0 -4
- package/commands/category/index.ts +0 -2
- package/commands/category/update-category.command.ts +0 -4
- package/commands/course/create-course.command.ts +0 -5
- package/commands/course/index.ts +0 -6
- package/commands/page/create-page.command.ts +0 -5
- package/commands/page/index.ts +0 -2
- package/commands/page/update-page.command.ts +0 -5
- package/commands/prompt/create-prompt.command.ts +0 -2
- package/commands/prompt/index.ts +0 -2
- package/commands/prompt/update-prompt.command.ts +0 -2
- package/commands/prompt-category/create-prompt-category.command.ts +0 -3
- package/commands/prompt-category/index.ts +0 -2
- package/commands/prompt-category/update-prompt-category.command.ts +0 -3
- package/commands/prompt-topic/create-prompt-topic.command.ts +0 -5
- package/commands/prompt-topic/index.ts +0 -2
- package/commands/prompt-topic/update-prompt-topic.command.ts +0 -5
- package/commands/question/create-question.command.ts +0 -2
- package/commands/question/index.ts +0 -2
- package/commands/question/update-question.command.ts +0 -2
- package/commands/team-account/get-team-account-statistics-by-month.command.ts +13 -6
- package/commands/team-account/index.ts +0 -1
- package/commands/tools/presentation/create-presentation.command.ts +2 -0
- package/commands/tools/presentation/generate-presentation-slides.command.ts +10 -1
- package/commands/tools/presentation/update-presentation.command.ts +1 -0
- package/commands/tools/writer/collect-writer-document-sources.command.ts +17 -0
- package/commands/tools/writer/confirm-source-citation-metadata.command.ts +21 -0
- package/commands/tools/writer/get-writer-document-sources.command.ts +14 -0
- package/commands/tools/writer/index.ts +4 -0
- package/commands/tools/writer/upload-writer-source.command.ts +19 -0
- package/commands/unregistered-user/patch-locale.command.ts +1 -1
- package/commands/user/get-me.command.ts +1 -2
- package/commands/user/patch-locale.command.ts +1 -1
- package/constants/cabinet/enums/index.ts +0 -1
- package/constants/presentation/enums/index.ts +1 -0
- package/constants/presentation/enums/presentation-target-audience.enum.ts +6 -0
- package/constants/user/enums/index.ts +1 -0
- package/constants/user/enums/locale.enum.ts +4 -0
- package/constants/writer/enums/index.ts +3 -0
- package/constants/writer/enums/writer-document-stage.enum.ts +8 -0
- package/constants/writer/enums/writer-source-origin.enum.ts +4 -0
- package/constants/writer/enums/writer-source-status.enum.ts +5 -0
- package/constants/writer/enums/writer-source-type.enum.ts +4 -0
- package/models/tools/presentation/index.ts +1 -0
- package/models/tools/presentation/presentation-template.schema.ts +2 -0
- package/models/tools/presentation/presentation-title-page.schema.ts +9 -0
- package/models/tools/presentation/presentation.schema.ts +8 -1
- package/models/tools/presentation/slide-content-edit.schema.ts +36 -24
- package/models/tools/presentation/slide-content.schema.ts +50 -40
- package/models/tools/writer/index.ts +2 -0
- package/models/tools/writer/writer-document-type.schema.ts +2 -0
- package/models/tools/writer/writer-document.schema.ts +3 -0
- package/models/tools/writer/writer-source-bibliographic-metadata.schema.ts +31 -0
- package/models/tools/writer/writer-source.schema.ts +20 -0
- package/models/user.schema.ts +1 -1
- package/package.json +1 -2
- package/build/commands/blog/create-post-translation.command.js +0 -25
- package/build/commands/blog/update-post-translation.command.js +0 -24
- package/build/commands/category/create-category-translation.command.js +0 -23
- package/build/commands/category/update-category-translation.command.js +0 -22
- package/build/commands/course/create-course-translation.command.js +0 -24
- package/build/commands/course/create-lesson-translation.command.js +0 -20
- package/build/commands/course/create-section-translation.command.js +0 -20
- package/build/commands/course/update-course-translation.command.js +0 -23
- package/build/commands/course/update-lesson-translation.command.js +0 -19
- package/build/commands/course/update-section-translation.command.js +0 -19
- package/build/commands/page/create-page-translation.command.js +0 -24
- package/build/commands/page/update-page-translation.command.js +0 -23
- package/build/commands/prompt/create-prompt-translation.command.js +0 -21
- package/build/commands/prompt/update-prompt-translation.command.js +0 -20
- package/build/commands/prompt-category/create-prompt-category-translation.command.js +0 -22
- package/build/commands/prompt-category/update-prompt-category-translation.command.js +0 -21
- package/build/commands/prompt-topic/create-prompt-topic-translation.command.js +0 -24
- package/build/commands/prompt-topic/update-prompt-topic-translation.command.js +0 -23
- package/build/commands/question/create-question-translation.command.js +0 -21
- package/build/commands/question/update-question-translation.command.js +0 -20
- package/build/commands/team-account/update-team-account-invite.command.js +0 -17
- package/build/constants/cabinet/enums/statistics-request-type.enum.js +0 -22
- package/commands/blog/create-post-translation.command.ts +0 -30
- package/commands/blog/update-post-translation.command.ts +0 -29
- package/commands/category/create-category-translation.command.ts +0 -28
- package/commands/category/update-category-translation.command.ts +0 -27
- package/commands/course/create-course-translation.command.ts +0 -29
- package/commands/course/create-lesson-translation.command.ts +0 -25
- package/commands/course/create-section-translation.command.ts +0 -25
- package/commands/course/update-course-translation.command.ts +0 -28
- package/commands/course/update-lesson-translation.command.ts +0 -24
- package/commands/course/update-section-translation.command.ts +0 -24
- package/commands/page/create-page-translation.command.ts +0 -29
- package/commands/page/update-page-translation.command.ts +0 -28
- package/commands/prompt/create-prompt-translation.command.ts +0 -26
- package/commands/prompt/update-prompt-translation.command.ts +0 -25
- package/commands/prompt-category/create-prompt-category-translation.command.ts +0 -27
- package/commands/prompt-category/update-prompt-category-translation.command.ts +0 -26
- package/commands/prompt-topic/create-prompt-topic-translation.command.ts +0 -29
- package/commands/prompt-topic/update-prompt-topic-translation.command.ts +0 -28
- package/commands/question/create-question-translation.command.ts +0 -26
- package/commands/question/update-question-translation.command.ts +0 -25
- package/commands/team-account/update-team-account-invite.command.ts +0 -22
- package/constants/cabinet/enums/statistics-request-type.enum.ts +0 -18
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WriterSourceSchema } from '../../../models';
|
|
3
|
+
import { WriterSourceBibliographicMetadataSchema } from '../../../models';
|
|
4
|
+
|
|
5
|
+
export namespace ConfirmSourceCitationMetadataCommand {
|
|
6
|
+
export const RequestParamsSchema = z.object({
|
|
7
|
+
docId: z.string().uuid(),
|
|
8
|
+
sourceId: z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
11
|
+
|
|
12
|
+
export const RequestBodySchema = z.object({
|
|
13
|
+
bibliographicMetadata: WriterSourceBibliographicMetadataSchema,
|
|
14
|
+
});
|
|
15
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: WriterSourceSchema,
|
|
19
|
+
});
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WriterSourceSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetWriterDocumentSourcesCommand {
|
|
5
|
+
export const RequestParamsSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.array(WriterSourceSchema),
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -16,3 +16,7 @@ export * from './writer-fix-errors.command';
|
|
|
16
16
|
export * from './writer-generate-text.command';
|
|
17
17
|
export * from './export-writer-document-as-docx.command';
|
|
18
18
|
export * from './set-reaction.writer-document.command';
|
|
19
|
+
export * from './collect-writer-document-sources.command';
|
|
20
|
+
export * from './get-writer-document-sources.command';
|
|
21
|
+
export * from './upload-writer-source.command';
|
|
22
|
+
export * from './confirm-source-citation-metadata.command';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WriterSourceSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UploadWriterSourceCommand {
|
|
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 = z.object({
|
|
11
|
+
fileId: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = z.object({
|
|
16
|
+
data: WriterSourceSchema,
|
|
17
|
+
});
|
|
18
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
19
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
|
|
2
|
+
import { LOCALE, ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
|
|
3
3
|
import { UserProfileResponseSchema } from '../../models';
|
|
4
|
-
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
5
4
|
|
|
6
5
|
export namespace GetMeCommand {
|
|
7
6
|
export const RequestSchema = z.object({});
|
|
@@ -7,3 +7,4 @@ export * from './slide-image-slot-action.enum';
|
|
|
7
7
|
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
|
+
export * from './presentation-target-audience.enum';
|
|
@@ -3,3 +3,6 @@ export * from './writer-document-stage.enum';
|
|
|
3
3
|
export * from './writer-ai-action-pricing-type.enum';
|
|
4
4
|
export * from './writer-ai-action-type.enum';
|
|
5
5
|
export * from './tool-model-status.enum';
|
|
6
|
+
export * from './writer-source-status.enum';
|
|
7
|
+
export * from './writer-source-origin.enum';
|
|
8
|
+
export * from './writer-source-type.enum';
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
export enum WRITER_DOCUMENT_STAGE {
|
|
2
2
|
CREATED = 'CREATED',
|
|
3
3
|
|
|
4
|
+
ANALYZING_TOPIC = 'ANALYZING_TOPIC',
|
|
5
|
+
TOPIC_ANALYZED = 'TOPIC_ANALYZED',
|
|
6
|
+
TOPIC_ANALYSIS_FAILED = 'TOPIC_ANALYSIS_FAILED',
|
|
7
|
+
|
|
4
8
|
GENERATING_OUTLINE = 'GENERATING_OUTLINE',
|
|
5
9
|
OUTLINE_GENERATED = 'OUTLINE_GENERATED',
|
|
6
10
|
OUTLINE_GENERATION_FAILED = 'OUTLINE_GENERATION_FAILED',
|
|
7
11
|
|
|
12
|
+
COLLECTING_SOURCES = 'COLLECTING_SOURCES',
|
|
13
|
+
SOURCES_COLLECTED = 'SOURCES_COLLECTED',
|
|
14
|
+
SOURCES_COLLECTION_FAILED = 'SOURCES_COLLECTION_FAILED',
|
|
15
|
+
|
|
8
16
|
GENERATING_CONTENT = 'GENERATING_CONTENT',
|
|
9
17
|
CONTENT_GENERATED = 'CONTENT_GENERATED',
|
|
10
18
|
CONTENT_GENERATION_FAILED = 'CONTENT_GENERATION_FAILED',
|
|
@@ -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.coerce.date().optional().nullable(),
|
|
6
|
+
email: z.string().email().optional().nullable(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type PresentationTitlePage = z.infer<typeof PresentationTitlePageSchema>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
PRESENTATION_STAGE,
|
|
4
|
+
PRESENTATION_TARGET_AUDIENCE,
|
|
5
|
+
USER_REACTION,
|
|
6
|
+
} from '../../../constants';
|
|
3
7
|
import { SlideOutlineSchema } from './slide-outline.schema';
|
|
4
8
|
import { SlideSchema } from './slide.schema';
|
|
9
|
+
import { PresentationTitlePageSchema } from './presentation-title-page.schema';
|
|
5
10
|
|
|
6
11
|
export const PresentationSchema = z.object({
|
|
7
12
|
uuid: z.string().uuid(),
|
|
@@ -17,6 +22,8 @@ export const PresentationSchema = z.object({
|
|
|
17
22
|
slideCount: z.number(),
|
|
18
23
|
lastContentUpdateAt: z.date().nullable(),
|
|
19
24
|
lastPptxExportedAt: z.date().nullable(),
|
|
25
|
+
titlePage: PresentationTitlePageSchema.nullable(),
|
|
26
|
+
targetAudience: z.nativeEnum(PRESENTATION_TARGET_AUDIENCE),
|
|
20
27
|
createdAt: z.date(),
|
|
21
28
|
updatedAt: z.date(),
|
|
22
29
|
});
|
|
@@ -19,36 +19,48 @@ import { SLIDE_CONTENT_TYPE } from '../../../constants';
|
|
|
19
19
|
export const CoverSlideDataUserEditSchema = z.object({
|
|
20
20
|
contentType: z.literal(SLIDE_CONTENT_TYPE.COVER),
|
|
21
21
|
title: z.string().max(1000),
|
|
22
|
-
author: z
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
author: z
|
|
23
|
+
.object({
|
|
24
|
+
label: z.string().min(1).max(100),
|
|
25
|
+
value: z.string().min(1).max(200),
|
|
26
|
+
})
|
|
27
|
+
.optional(),
|
|
28
|
+
date: z
|
|
29
|
+
.object({
|
|
30
|
+
label: z.string().min(1).max(100),
|
|
31
|
+
value: z.string().min(1).max(200),
|
|
32
|
+
})
|
|
33
|
+
.optional(),
|
|
34
|
+
email: z
|
|
35
|
+
.object({
|
|
36
|
+
label: z.string().min(1).max(100),
|
|
37
|
+
value: z.string().min(1).max(200),
|
|
38
|
+
})
|
|
39
|
+
.optional(),
|
|
34
40
|
version: z.literal(1),
|
|
35
41
|
}) satisfies z.ZodType<ICoverSlideDataStructure>;
|
|
36
42
|
|
|
37
43
|
export const ThankYouSlideDataUserEditSchema = z.object({
|
|
38
44
|
contentType: z.literal(SLIDE_CONTENT_TYPE.THANK_YOU),
|
|
39
45
|
title: z.string().max(1000),
|
|
40
|
-
author: z
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
author: z
|
|
47
|
+
.object({
|
|
48
|
+
label: z.string().min(1).max(100),
|
|
49
|
+
value: z.string().min(1).max(200),
|
|
50
|
+
})
|
|
51
|
+
.optional(),
|
|
52
|
+
date: z
|
|
53
|
+
.object({
|
|
54
|
+
label: z.string().min(1).max(100),
|
|
55
|
+
value: z.string().min(1).max(200),
|
|
56
|
+
})
|
|
57
|
+
.optional(),
|
|
58
|
+
email: z
|
|
59
|
+
.object({
|
|
60
|
+
label: z.string().min(1).max(100),
|
|
61
|
+
value: z.string().min(1).max(200),
|
|
62
|
+
})
|
|
63
|
+
.optional(),
|
|
52
64
|
version: z.literal(1),
|
|
53
65
|
}) satisfies z.ZodType<IThankYouSlideDataStructure>;
|
|
54
66
|
|
|
@@ -26,18 +26,18 @@ export type IconSlot = z.infer<typeof IconSlotSchema>;
|
|
|
26
26
|
export interface ICoverSlideDataStructure {
|
|
27
27
|
contentType: SLIDE_CONTENT_TYPE.COVER;
|
|
28
28
|
title: string;
|
|
29
|
-
author
|
|
30
|
-
date
|
|
31
|
-
email
|
|
29
|
+
author?: { label: string; value: string };
|
|
30
|
+
date?: { label: string; value: string };
|
|
31
|
+
email?: { label: string; value: string };
|
|
32
32
|
version: 1;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface IThankYouSlideDataStructure {
|
|
36
36
|
contentType: SLIDE_CONTENT_TYPE.THANK_YOU;
|
|
37
37
|
title: string;
|
|
38
|
-
author
|
|
39
|
-
date
|
|
40
|
-
email
|
|
38
|
+
author?: { label: string; value: string };
|
|
39
|
+
date?: { label: string; value: string };
|
|
40
|
+
email?: { label: string; value: string };
|
|
41
41
|
version: 1;
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -125,24 +125,28 @@ export interface ITimelineSlideDataStructure {
|
|
|
125
125
|
export const CoverSlideDataSchema = z.object({
|
|
126
126
|
contentType: z.literal(SLIDE_CONTENT_TYPE.COVER),
|
|
127
127
|
title: z.string().describe('Slide title in about 6 words').min(10).max(150),
|
|
128
|
-
author: z
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
.string()
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
date: z
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
128
|
+
author: z
|
|
129
|
+
.object({
|
|
130
|
+
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
131
|
+
value: z.string().describe('Author value from titlePage if provided'),
|
|
132
|
+
})
|
|
133
|
+
.optional(),
|
|
134
|
+
date: z
|
|
135
|
+
.object({
|
|
136
|
+
label: z.string().describe('Literal "Date" in presentation\'s language'),
|
|
137
|
+
value: z
|
|
138
|
+
.string()
|
|
139
|
+
.describe(
|
|
140
|
+
'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
|
|
141
|
+
),
|
|
142
|
+
})
|
|
143
|
+
.optional(),
|
|
144
|
+
email: z
|
|
145
|
+
.object({
|
|
146
|
+
label: z.string().describe('Localized contact/email label'),
|
|
147
|
+
value: z.string().describe('Email value from titlePage if provided'),
|
|
148
|
+
})
|
|
149
|
+
.optional(),
|
|
146
150
|
version: z.literal(1),
|
|
147
151
|
}) satisfies z.ZodType<ICoverSlideDataStructure>;
|
|
148
152
|
export type CoverSlideData = z.infer<typeof CoverSlideDataSchema>;
|
|
@@ -154,22 +158,28 @@ export const ThankYouSlideDataSchema = z.object({
|
|
|
154
158
|
.describe('"Thank you for your attention" in presentation\'s language')
|
|
155
159
|
.min(10)
|
|
156
160
|
.max(150),
|
|
157
|
-
author: z
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
.describe(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
161
|
+
author: z
|
|
162
|
+
.object({
|
|
163
|
+
label: z.string().describe('Literal "Author" in presentation\'s language'),
|
|
164
|
+
value: z.string().describe('Author value from titlePage if provided'),
|
|
165
|
+
})
|
|
166
|
+
.optional(),
|
|
167
|
+
date: z
|
|
168
|
+
.object({
|
|
169
|
+
label: z.string().describe('Literal "Date" in presentation\'s language'),
|
|
170
|
+
value: z
|
|
171
|
+
.string()
|
|
172
|
+
.describe(
|
|
173
|
+
'Date from titlePage in the "dd month yyyy" format in presentation\'s locale',
|
|
174
|
+
),
|
|
175
|
+
})
|
|
176
|
+
.optional(),
|
|
177
|
+
email: z
|
|
178
|
+
.object({
|
|
179
|
+
label: z.string().describe('Localized contact/email label'),
|
|
180
|
+
value: z.string().describe('Email value from titlePage if provided'),
|
|
181
|
+
})
|
|
182
|
+
.optional(),
|
|
173
183
|
version: z.literal(1),
|
|
174
184
|
}) satisfies z.ZodType<IThankYouSlideDataStructure>;
|
|
175
185
|
export type ThankYouSlideData = z.infer<typeof ThankYouSlideDataSchema>;
|
|
@@ -4,3 +4,5 @@ export * from './writer-document-outline.schema';
|
|
|
4
4
|
export * from './writer-document.schema';
|
|
5
5
|
export * from './writer-document-type.schema';
|
|
6
6
|
export * from './writer-document-title-page.schema';
|
|
7
|
+
export * from './writer-source.schema';
|
|
8
|
+
export * from './writer-source-bibliographic-metadata.schema';
|
|
@@ -8,7 +8,9 @@ export const WriterDocumentTypeSchema = z.object({
|
|
|
8
8
|
order: z.number(),
|
|
9
9
|
minPages: z.number(),
|
|
10
10
|
maxPages: z.number(),
|
|
11
|
+
skipSources: z.boolean(),
|
|
11
12
|
pageRange: z.array(z.number()),
|
|
13
|
+
needsTableOfContents: z.boolean(),
|
|
12
14
|
createdAt: z.date(),
|
|
13
15
|
updatedAt: z.date(),
|
|
14
16
|
});
|
|
@@ -18,6 +18,9 @@ export const WriterDocumentSchema = z.object({
|
|
|
18
18
|
unregisteredUserId: z.string().nullable(),
|
|
19
19
|
modelId: z.string().nullable(),
|
|
20
20
|
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
21
|
+
dislikeReason: z.string().nullable(),
|
|
22
|
+
description: z.string().nullable(),
|
|
23
|
+
skipSources: z.boolean(),
|
|
21
24
|
pages: z.number(),
|
|
22
25
|
createdAt: z.date(),
|
|
23
26
|
updatedAt: z.date(),
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WRITER_SOURCE_TYPE } from '../../../constants';
|
|
3
|
+
|
|
4
|
+
export const WriterSourceBibliographicMetadataBookSchema = z.object({
|
|
5
|
+
type: z.literal(WRITER_SOURCE_TYPE.BOOK),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
authors: z.string(),
|
|
8
|
+
year: z.number(),
|
|
9
|
+
publicationCity: z.string(),
|
|
10
|
+
publisher: z.string(),
|
|
11
|
+
pageCount: z.number().nullable(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const WriterSourceBibliographicMetadataJournalArticleSchema = z.object({
|
|
15
|
+
type: z.literal(WRITER_SOURCE_TYPE.JOURNAL_ARTICLE),
|
|
16
|
+
title: z.string(),
|
|
17
|
+
authors: z.string(),
|
|
18
|
+
year: z.number(),
|
|
19
|
+
journalName: z.string(),
|
|
20
|
+
issueNumber: z.string(),
|
|
21
|
+
pageRange: z.string(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const WriterSourceBibliographicMetadataSchema = z.discriminatedUnion('type', [
|
|
25
|
+
WriterSourceBibliographicMetadataBookSchema,
|
|
26
|
+
WriterSourceBibliographicMetadataJournalArticleSchema,
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
export type WriterSourceBibliographicMetadata = z.infer<
|
|
30
|
+
typeof WriterSourceBibliographicMetadataSchema
|
|
31
|
+
>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { WRITER_SOURCE_STATUS, WRITER_SOURCE_ORIGIN } from '../../../constants';
|
|
3
|
+
import { WriterSourceBibliographicMetadataSchema } from './writer-source-bibliographic-metadata.schema';
|
|
4
|
+
|
|
5
|
+
export const WriterSourceSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
query: z.string().nullable(),
|
|
8
|
+
url: z.string(),
|
|
9
|
+
snippet: z.string().nullable(),
|
|
10
|
+
sourceOrigin: z.nativeEnum(WRITER_SOURCE_ORIGIN),
|
|
11
|
+
documentId: z.string().uuid(),
|
|
12
|
+
fileId: z.string().nullable(),
|
|
13
|
+
citation: z.string().nullable(),
|
|
14
|
+
status: z.nativeEnum(WRITER_SOURCE_STATUS),
|
|
15
|
+
bibliographicMetadata: WriterSourceBibliographicMetadataSchema.nullable(),
|
|
16
|
+
createdAt: z.date(),
|
|
17
|
+
updatedAt: z.date(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type WriterSource = z.infer<typeof WriterSourceSchema>;
|
package/models/user.schema.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { UserToSubscriptionSchema } from './user-to-subscription.schema';
|
|
3
3
|
import { UserToProductSchema } from './user-to-product.schema';
|
|
4
|
-
import { LOCALE } from '
|
|
4
|
+
import { LOCALE } from '../constants';
|
|
5
5
|
|
|
6
6
|
export const UserSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleschool/gptbot",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@purpleschool/rugpt-lib-common": "^0.0.18",
|
|
16
15
|
"zod": "^3.25.67"
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreatePostTranslationCommand = void 0;
|
|
4
|
-
const models_1 = require("../../models");
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
7
|
-
var CreatePostTranslationCommand;
|
|
8
|
-
(function (CreatePostTranslationCommand) {
|
|
9
|
-
CreatePostTranslationCommand.RequestSchema = models_1.PostSchema.pick({
|
|
10
|
-
title: true,
|
|
11
|
-
content: true,
|
|
12
|
-
author: true,
|
|
13
|
-
contentPreview: true,
|
|
14
|
-
metaTitle: true,
|
|
15
|
-
metaDescription: true,
|
|
16
|
-
}).extend({
|
|
17
|
-
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
18
|
-
});
|
|
19
|
-
CreatePostTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
20
|
-
uuid: zod_1.z.string().uuid(),
|
|
21
|
-
});
|
|
22
|
-
CreatePostTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
23
|
-
data: models_1.PostSchema,
|
|
24
|
-
});
|
|
25
|
-
})(CreatePostTranslationCommand || (exports.CreatePostTranslationCommand = CreatePostTranslationCommand = {}));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdatePostTranslationCommand = void 0;
|
|
4
|
-
const models_1 = require("../../models");
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
7
|
-
var UpdatePostTranslationCommand;
|
|
8
|
-
(function (UpdatePostTranslationCommand) {
|
|
9
|
-
UpdatePostTranslationCommand.RequestSchema = models_1.PostSchema.pick({
|
|
10
|
-
title: true,
|
|
11
|
-
content: true,
|
|
12
|
-
author: true,
|
|
13
|
-
contentPreview: true,
|
|
14
|
-
metaTitle: true,
|
|
15
|
-
metaDescription: true,
|
|
16
|
-
}).partial();
|
|
17
|
-
UpdatePostTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
18
|
-
uuid: zod_1.z.string().uuid(),
|
|
19
|
-
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
20
|
-
});
|
|
21
|
-
UpdatePostTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
22
|
-
data: models_1.PostSchema,
|
|
23
|
-
});
|
|
24
|
-
})(UpdatePostTranslationCommand || (exports.UpdatePostTranslationCommand = UpdatePostTranslationCommand = {}));
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateCategoryTranslationCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
7
|
-
var CreateCategoryTranslationCommand;
|
|
8
|
-
(function (CreateCategoryTranslationCommand) {
|
|
9
|
-
CreateCategoryTranslationCommand.RequestSchema = models_1.CategorySchema.pick({
|
|
10
|
-
name: true,
|
|
11
|
-
prompt: true,
|
|
12
|
-
placeholder: true,
|
|
13
|
-
seoName: true,
|
|
14
|
-
}).extend({
|
|
15
|
-
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
16
|
-
});
|
|
17
|
-
CreateCategoryTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
18
|
-
uuid: zod_1.z.string().uuid(),
|
|
19
|
-
});
|
|
20
|
-
CreateCategoryTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
21
|
-
data: models_1.CategorySchema,
|
|
22
|
-
});
|
|
23
|
-
})(CreateCategoryTranslationCommand || (exports.CreateCategoryTranslationCommand = CreateCategoryTranslationCommand = {}));
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateCategoryTranslationCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
7
|
-
var UpdateCategoryTranslationCommand;
|
|
8
|
-
(function (UpdateCategoryTranslationCommand) {
|
|
9
|
-
UpdateCategoryTranslationCommand.RequestSchema = models_1.CategorySchema.pick({
|
|
10
|
-
name: true,
|
|
11
|
-
prompt: true,
|
|
12
|
-
placeholder: true,
|
|
13
|
-
seoName: true,
|
|
14
|
-
}).partial();
|
|
15
|
-
UpdateCategoryTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
16
|
-
uuid: zod_1.z.string().uuid(),
|
|
17
|
-
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
18
|
-
});
|
|
19
|
-
UpdateCategoryTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
20
|
-
data: models_1.CategorySchema,
|
|
21
|
-
});
|
|
22
|
-
})(UpdateCategoryTranslationCommand || (exports.UpdateCategoryTranslationCommand = UpdateCategoryTranslationCommand = {}));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateCourseTranslationCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../models");
|
|
6
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
7
|
-
var CreateCourseTranslationCommand;
|
|
8
|
-
(function (CreateCourseTranslationCommand) {
|
|
9
|
-
CreateCourseTranslationCommand.RequestSchema = models_1.CourseSchema.pick({
|
|
10
|
-
title: true,
|
|
11
|
-
subtitle: true,
|
|
12
|
-
prerequisites: true,
|
|
13
|
-
description: true,
|
|
14
|
-
skills: true,
|
|
15
|
-
}).extend({
|
|
16
|
-
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
17
|
-
});
|
|
18
|
-
CreateCourseTranslationCommand.RequestParamSchema = zod_1.z.object({
|
|
19
|
-
uuid: zod_1.z.string().uuid(),
|
|
20
|
-
});
|
|
21
|
-
CreateCourseTranslationCommand.ResponseSchema = zod_1.z.object({
|
|
22
|
-
data: models_1.CourseSchema,
|
|
23
|
-
});
|
|
24
|
-
})(CreateCourseTranslationCommand || (exports.CreateCourseTranslationCommand = CreateCourseTranslationCommand = {}));
|