@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.
Files changed (185) hide show
  1. package/api/controllers/http/blog.ts +0 -2
  2. package/api/controllers/http/category.ts +0 -2
  3. package/api/controllers/http/course.ts +0 -8
  4. package/api/controllers/http/page.ts +0 -2
  5. package/api/controllers/http/prompt-category.ts +0 -2
  6. package/api/controllers/http/prompt-topic.ts +0 -2
  7. package/api/controllers/http/prompt.ts +0 -2
  8. package/api/controllers/http/question.ts +0 -2
  9. package/api/controllers/http/team-account.ts +0 -1
  10. package/api/controllers/http/writer.ts +6 -0
  11. package/api/routes.ts +20 -46
  12. package/build/api/controllers/http/blog.js +0 -2
  13. package/build/api/controllers/http/category.js +0 -2
  14. package/build/api/controllers/http/course.js +0 -6
  15. package/build/api/controllers/http/page.js +0 -2
  16. package/build/api/controllers/http/prompt-category.js +0 -2
  17. package/build/api/controllers/http/prompt-topic.js +0 -2
  18. package/build/api/controllers/http/prompt.js +0 -2
  19. package/build/api/controllers/http/question.js +0 -2
  20. package/build/api/controllers/http/team-account.js +0 -1
  21. package/build/api/controllers/http/writer.js +5 -0
  22. package/build/api/routes.js +10 -23
  23. package/build/commands/blog/create-post.command.js +0 -6
  24. package/build/commands/blog/index.js +0 -2
  25. package/build/commands/blog/update-post.command.js +0 -6
  26. package/build/commands/cabinet/get-user-statistics-by-month.command.js +12 -1
  27. package/build/commands/category/create-category.command.js +0 -4
  28. package/build/commands/category/index.js +0 -2
  29. package/build/commands/category/update-category.command.js +0 -4
  30. package/build/commands/course/create-course.command.js +0 -5
  31. package/build/commands/course/index.js +0 -6
  32. package/build/commands/page/create-page.command.js +0 -5
  33. package/build/commands/page/index.js +0 -2
  34. package/build/commands/page/update-page.command.js +0 -5
  35. package/build/commands/prompt/create-prompt.command.js +0 -2
  36. package/build/commands/prompt/index.js +0 -2
  37. package/build/commands/prompt/update-prompt.command.js +0 -2
  38. package/build/commands/prompt-category/create-prompt-category.command.js +0 -3
  39. package/build/commands/prompt-category/index.js +0 -2
  40. package/build/commands/prompt-category/update-prompt-category.command.js +0 -3
  41. package/build/commands/prompt-topic/create-prompt-topic.command.js +0 -5
  42. package/build/commands/prompt-topic/index.js +0 -2
  43. package/build/commands/prompt-topic/update-prompt-topic.command.js +0 -5
  44. package/build/commands/question/create-question.command.js +0 -2
  45. package/build/commands/question/index.js +0 -2
  46. package/build/commands/question/update-question.command.js +0 -2
  47. package/build/commands/team-account/get-team-account-statistics-by-month.command.js +12 -1
  48. package/build/commands/team-account/index.js +0 -1
  49. package/build/commands/tools/presentation/create-presentation.command.js +2 -0
  50. package/build/commands/tools/presentation/generate-presentation-slides.command.js +3 -0
  51. package/build/commands/tools/presentation/update-presentation.command.js +1 -0
  52. package/build/commands/tools/writer/collect-writer-document-sources.command.js +15 -0
  53. package/build/commands/tools/writer/confirm-source-citation-metadata.command.js +19 -0
  54. package/build/commands/tools/writer/get-writer-document-sources.command.js +14 -0
  55. package/build/commands/tools/writer/index.js +4 -0
  56. package/build/commands/tools/writer/upload-writer-source.command.js +17 -0
  57. package/build/commands/unregistered-user/patch-locale.command.js +3 -3
  58. package/build/commands/user/get-me.command.js +1 -2
  59. package/build/commands/user/patch-locale.command.js +3 -3
  60. package/build/constants/cabinet/enums/index.js +0 -1
  61. package/build/constants/presentation/enums/index.js +1 -0
  62. package/build/constants/presentation/enums/presentation-target-audience.enum.js +10 -0
  63. package/build/constants/user/enums/index.js +1 -0
  64. package/build/constants/user/enums/locale.enum.js +8 -0
  65. package/build/constants/writer/enums/index.js +3 -0
  66. package/build/constants/writer/enums/writer-document-stage.enum.js +6 -0
  67. package/build/constants/writer/enums/writer-source-origin.enum.js +8 -0
  68. package/build/constants/writer/enums/writer-source-status.enum.js +9 -0
  69. package/build/constants/writer/enums/writer-source-type.enum.js +8 -0
  70. package/build/models/tools/presentation/index.js +1 -0
  71. package/build/models/tools/presentation/presentation-template.schema.js +2 -0
  72. package/build/models/tools/presentation/presentation-title-page.schema.js +9 -0
  73. package/build/models/tools/presentation/presentation.schema.js +3 -0
  74. package/build/models/tools/presentation/slide-content-edit.schema.js +36 -24
  75. package/build/models/tools/presentation/slide-content.schema.js +34 -24
  76. package/build/models/tools/writer/index.js +2 -0
  77. package/build/models/tools/writer/writer-document-type.schema.js +2 -0
  78. package/build/models/tools/writer/writer-document.schema.js +3 -0
  79. package/build/models/tools/writer/writer-source-bibliographic-metadata.schema.js +27 -0
  80. package/build/models/tools/writer/writer-source.schema.js +20 -0
  81. package/build/models/user.schema.js +2 -2
  82. package/commands/blog/create-post.command.ts +0 -6
  83. package/commands/blog/index.ts +0 -2
  84. package/commands/blog/update-post.command.ts +0 -6
  85. package/commands/cabinet/get-user-statistics-by-month.command.ts +13 -6
  86. package/commands/category/create-category.command.ts +0 -4
  87. package/commands/category/index.ts +0 -2
  88. package/commands/category/update-category.command.ts +0 -4
  89. package/commands/course/create-course.command.ts +0 -5
  90. package/commands/course/index.ts +0 -6
  91. package/commands/page/create-page.command.ts +0 -5
  92. package/commands/page/index.ts +0 -2
  93. package/commands/page/update-page.command.ts +0 -5
  94. package/commands/prompt/create-prompt.command.ts +0 -2
  95. package/commands/prompt/index.ts +0 -2
  96. package/commands/prompt/update-prompt.command.ts +0 -2
  97. package/commands/prompt-category/create-prompt-category.command.ts +0 -3
  98. package/commands/prompt-category/index.ts +0 -2
  99. package/commands/prompt-category/update-prompt-category.command.ts +0 -3
  100. package/commands/prompt-topic/create-prompt-topic.command.ts +0 -5
  101. package/commands/prompt-topic/index.ts +0 -2
  102. package/commands/prompt-topic/update-prompt-topic.command.ts +0 -5
  103. package/commands/question/create-question.command.ts +0 -2
  104. package/commands/question/index.ts +0 -2
  105. package/commands/question/update-question.command.ts +0 -2
  106. package/commands/team-account/get-team-account-statistics-by-month.command.ts +13 -6
  107. package/commands/team-account/index.ts +0 -1
  108. package/commands/tools/presentation/create-presentation.command.ts +2 -0
  109. package/commands/tools/presentation/generate-presentation-slides.command.ts +10 -1
  110. package/commands/tools/presentation/update-presentation.command.ts +1 -0
  111. package/commands/tools/writer/collect-writer-document-sources.command.ts +17 -0
  112. package/commands/tools/writer/confirm-source-citation-metadata.command.ts +21 -0
  113. package/commands/tools/writer/get-writer-document-sources.command.ts +14 -0
  114. package/commands/tools/writer/index.ts +4 -0
  115. package/commands/tools/writer/upload-writer-source.command.ts +19 -0
  116. package/commands/unregistered-user/patch-locale.command.ts +1 -1
  117. package/commands/user/get-me.command.ts +1 -2
  118. package/commands/user/patch-locale.command.ts +1 -1
  119. package/constants/cabinet/enums/index.ts +0 -1
  120. package/constants/presentation/enums/index.ts +1 -0
  121. package/constants/presentation/enums/presentation-target-audience.enum.ts +6 -0
  122. package/constants/user/enums/index.ts +1 -0
  123. package/constants/user/enums/locale.enum.ts +4 -0
  124. package/constants/writer/enums/index.ts +3 -0
  125. package/constants/writer/enums/writer-document-stage.enum.ts +8 -0
  126. package/constants/writer/enums/writer-source-origin.enum.ts +4 -0
  127. package/constants/writer/enums/writer-source-status.enum.ts +5 -0
  128. package/constants/writer/enums/writer-source-type.enum.ts +4 -0
  129. package/models/tools/presentation/index.ts +1 -0
  130. package/models/tools/presentation/presentation-template.schema.ts +2 -0
  131. package/models/tools/presentation/presentation-title-page.schema.ts +9 -0
  132. package/models/tools/presentation/presentation.schema.ts +8 -1
  133. package/models/tools/presentation/slide-content-edit.schema.ts +36 -24
  134. package/models/tools/presentation/slide-content.schema.ts +50 -40
  135. package/models/tools/writer/index.ts +2 -0
  136. package/models/tools/writer/writer-document-type.schema.ts +2 -0
  137. package/models/tools/writer/writer-document.schema.ts +3 -0
  138. package/models/tools/writer/writer-source-bibliographic-metadata.schema.ts +31 -0
  139. package/models/tools/writer/writer-source.schema.ts +20 -0
  140. package/models/user.schema.ts +1 -1
  141. package/package.json +1 -2
  142. package/build/commands/blog/create-post-translation.command.js +0 -25
  143. package/build/commands/blog/update-post-translation.command.js +0 -24
  144. package/build/commands/category/create-category-translation.command.js +0 -23
  145. package/build/commands/category/update-category-translation.command.js +0 -22
  146. package/build/commands/course/create-course-translation.command.js +0 -24
  147. package/build/commands/course/create-lesson-translation.command.js +0 -20
  148. package/build/commands/course/create-section-translation.command.js +0 -20
  149. package/build/commands/course/update-course-translation.command.js +0 -23
  150. package/build/commands/course/update-lesson-translation.command.js +0 -19
  151. package/build/commands/course/update-section-translation.command.js +0 -19
  152. package/build/commands/page/create-page-translation.command.js +0 -24
  153. package/build/commands/page/update-page-translation.command.js +0 -23
  154. package/build/commands/prompt/create-prompt-translation.command.js +0 -21
  155. package/build/commands/prompt/update-prompt-translation.command.js +0 -20
  156. package/build/commands/prompt-category/create-prompt-category-translation.command.js +0 -22
  157. package/build/commands/prompt-category/update-prompt-category-translation.command.js +0 -21
  158. package/build/commands/prompt-topic/create-prompt-topic-translation.command.js +0 -24
  159. package/build/commands/prompt-topic/update-prompt-topic-translation.command.js +0 -23
  160. package/build/commands/question/create-question-translation.command.js +0 -21
  161. package/build/commands/question/update-question-translation.command.js +0 -20
  162. package/build/commands/team-account/update-team-account-invite.command.js +0 -17
  163. package/build/constants/cabinet/enums/statistics-request-type.enum.js +0 -22
  164. package/commands/blog/create-post-translation.command.ts +0 -30
  165. package/commands/blog/update-post-translation.command.ts +0 -29
  166. package/commands/category/create-category-translation.command.ts +0 -28
  167. package/commands/category/update-category-translation.command.ts +0 -27
  168. package/commands/course/create-course-translation.command.ts +0 -29
  169. package/commands/course/create-lesson-translation.command.ts +0 -25
  170. package/commands/course/create-section-translation.command.ts +0 -25
  171. package/commands/course/update-course-translation.command.ts +0 -28
  172. package/commands/course/update-lesson-translation.command.ts +0 -24
  173. package/commands/course/update-section-translation.command.ts +0 -24
  174. package/commands/page/create-page-translation.command.ts +0 -29
  175. package/commands/page/update-page-translation.command.ts +0 -28
  176. package/commands/prompt/create-prompt-translation.command.ts +0 -26
  177. package/commands/prompt/update-prompt-translation.command.ts +0 -25
  178. package/commands/prompt-category/create-prompt-category-translation.command.ts +0 -27
  179. package/commands/prompt-category/update-prompt-category-translation.command.ts +0 -26
  180. package/commands/prompt-topic/create-prompt-topic-translation.command.ts +0 -29
  181. package/commands/prompt-topic/update-prompt-topic-translation.command.ts +0 -28
  182. package/commands/question/create-question-translation.command.ts +0 -26
  183. package/commands/question/update-question-translation.command.ts +0 -25
  184. package/commands/team-account/update-team-account-invite.command.ts +0 -22
  185. 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,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
+ import { LOCALE } from '../../constants';
3
3
 
4
4
  export namespace PatchUnregisteredUserLocaleCommand {
5
5
  export const RequestSchema = z.object({
@@ -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({});
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
+ import { LOCALE } from '../../constants';
3
3
 
4
4
  export namespace PatchUserLocaleCommand {
5
5
  export const RequestSchema = z.object({
@@ -1,3 +1,2 @@
1
1
  export * from './group-by.enum';
2
2
  export * from './statistics-metric-type.enum';
3
- export * from './statistics-request-type.enum';
@@ -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';
@@ -0,0 +1,6 @@
1
+ export enum PRESENTATION_TARGET_AUDIENCE {
2
+ NONE = 'NONE',
3
+ SCHOOL = 'SCHOOL',
4
+ UNIVERSITY = 'UNIVERSITY',
5
+ BUSINESS = 'BUSINESS',
6
+ }
@@ -2,3 +2,4 @@ export * from './singup-method.enum';
2
2
  export * from './user-status';
3
3
  export * from './user-sort-by.enum';
4
4
  export * from './sort-order.enum';
5
+ export * from './locale.enum';
@@ -0,0 +1,4 @@
1
+ export enum LOCALE {
2
+ RU = 'ru',
3
+ EN = 'en',
4
+ }
@@ -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,4 @@
1
+ export enum WRITER_SOURCE_ORIGIN {
2
+ WEB_SEARCH = 'WEB_SEARCH',
3
+ USER_UPLOAD = 'USER_UPLOAD',
4
+ }
@@ -0,0 +1,5 @@
1
+ export enum WRITER_SOURCE_STATUS {
2
+ READY = 'READY',
3
+ REQUIRES_CITATION_METADATA_CONFIRMATION = 'REQUIRES_CITATION_METADATA_CONFIRMATION',
4
+ DISCARDED = 'DISCARDED',
5
+ }
@@ -0,0 +1,4 @@
1
+ export enum WRITER_SOURCE_TYPE {
2
+ JOURNAL_ARTICLE = 'JOURNAL_ARTICLE',
3
+ BOOK = 'BOOK',
4
+ }
@@ -6,3 +6,4 @@ export * from './slide.schema';
6
6
  export * from './slide-content.schema';
7
7
  export * from './presentation-config.schema';
8
8
  export * from './presentation-ai-action.schema';
9
+ export * from './presentation-title-page.schema';
@@ -6,6 +6,8 @@ export const PresentationTemplateSchema = z.object({
6
6
  image: z.string(),
7
7
  order: z.number(),
8
8
  imagePlaceholder: z.string(),
9
+ price: z.number(),
10
+ isPremium: z.boolean(),
9
11
  createdAt: z.date(),
10
12
  updatedAt: z.date(),
11
13
  });
@@ -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 { PRESENTATION_STAGE, USER_REACTION } from '../../../constants';
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.object({
23
- label: z.string().max(200),
24
- value: z.string().max(500),
25
- }),
26
- date: z.object({
27
- label: z.string().max(200),
28
- value: z.string().max(500),
29
- }),
30
- email: z.object({
31
- label: z.string().max(200),
32
- value: z.string().max(500),
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.object({
41
- label: z.string().max(200),
42
- value: z.string().max(500),
43
- }),
44
- date: z.object({
45
- label: z.string().max(200),
46
- value: z.string().max(500),
47
- }),
48
- email: z.object({
49
- label: z.string().max(200),
50
- value: z.string().max(500),
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: { label: string; value: string };
30
- date: { label: string; value: string };
31
- email: { label: string; value: string };
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: { label: string; value: string };
39
- date: { label: string; value: string };
40
- email: { label: string; value: string };
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.object({
129
- label: z.string().describe('Literal "Author" in presentation\'s language'),
130
- value: z
131
- .string()
132
- .describe('Literal "Author of the presentation" in presentation\'s language'),
133
- }),
134
- date: z.object({
135
- label: z.string().describe('Literal "Date" in presentation\'s language'),
136
- value: z
137
- .string()
138
- .describe(
139
- 'Date of the presentation in the "dd month yyyy" format in presentation\'s locale',
140
- ),
141
- }),
142
- email: z.object({
143
- label: z.string().describe('Just default word "Email"'),
144
- value: z.string().describe('Just default "email@example.com"'),
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.object({
158
- label: z.string().describe('"Author" in presentation\'s language'),
159
- value: z.string().describe('"Author of the presentation" in presentation\'s language'),
160
- }),
161
- date: z.object({
162
- label: z.string().describe('"Date" in presentation\'s language'),
163
- value: z
164
- .string()
165
- .describe(
166
- 'Date of the presentation in the "dd month yyyy" format in presentation\'s locale',
167
- ),
168
- }),
169
- email: z.object({
170
- label: z.string().describe('Just default word "Email"'),
171
- value: z.string().describe('Just default "email@example.com"'),
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>;
@@ -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 '@purpleschool/rugpt-lib-common';
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.2-stage-2",
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 = {}));