@purpleschool/gptbot 0.12.68 → 0.12.70-stage-2

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 (214) hide show
  1. package/api/controllers/http/blog.ts +4 -0
  2. package/api/controllers/http/canvas-template.ts +10 -0
  3. package/api/controllers/http/category.ts +4 -0
  4. package/api/controllers/http/course.ts +12 -0
  5. package/api/controllers/http/index.ts +2 -0
  6. package/api/controllers/http/page.ts +4 -0
  7. package/api/controllers/http/prompt-category.ts +4 -0
  8. package/api/controllers/http/prompt-topic.ts +4 -0
  9. package/api/controllers/http/prompt.ts +4 -0
  10. package/api/controllers/http/question.ts +4 -0
  11. package/api/controllers/http/team-account.ts +1 -0
  12. package/api/routes.ts +81 -0
  13. package/build/api/controllers/http/blog.js +3 -0
  14. package/build/api/controllers/http/canvas-template.js +12 -0
  15. package/build/api/controllers/http/category.js +3 -0
  16. package/build/api/controllers/http/course.js +9 -0
  17. package/build/api/controllers/http/index.js +1 -0
  18. package/build/api/controllers/http/page.js +3 -0
  19. package/build/api/controllers/http/prompt-category.js +3 -0
  20. package/build/api/controllers/http/prompt-topic.js +3 -0
  21. package/build/api/controllers/http/prompt.js +3 -0
  22. package/build/api/controllers/http/question.js +3 -0
  23. package/build/api/controllers/http/team-account.js +1 -0
  24. package/build/api/routes.js +42 -0
  25. package/build/commands/blog/create-post-translation.command.js +23 -0
  26. package/build/commands/blog/create-post.command.js +6 -0
  27. package/build/commands/blog/get-all-post-translations.query.js +14 -0
  28. package/build/commands/blog/index.js +3 -0
  29. package/build/commands/blog/update-post-translation.command.js +23 -0
  30. package/build/commands/blog/update-post.command.js +6 -0
  31. package/build/commands/cabinet/get-user-statistics-by-month.command.js +6 -13
  32. package/build/commands/cabinet/get-user-statistics-overview.command.js +5 -1
  33. package/build/commands/canvas-template/create-canvas-from-template.command.js +17 -0
  34. package/build/commands/canvas-template/create-canvas-template.command.js +18 -0
  35. package/build/commands/canvas-template/delete-canvas-template.command.js +15 -0
  36. package/build/commands/canvas-template/find-canvas-template-by-uuid.query.js +14 -0
  37. package/build/commands/canvas-template/find-canvas-templates.query.js +18 -0
  38. package/build/commands/canvas-template/index.js +22 -0
  39. package/build/commands/canvas-template/update-canvas-template.command.js +21 -0
  40. package/build/commands/category/create-category-translation.command.js +21 -0
  41. package/build/commands/category/create-category.command.js +4 -0
  42. package/build/commands/category/get-all-category-translations.query.js +14 -0
  43. package/build/commands/category/index.js +3 -0
  44. package/build/commands/category/update-category-translation.command.js +21 -0
  45. package/build/commands/category/update-category.command.js +4 -0
  46. package/build/commands/course/create-course-translation.command.js +22 -0
  47. package/build/commands/course/create-course.command.js +5 -0
  48. package/build/commands/course/create-lesson-translation.command.js +18 -0
  49. package/build/commands/course/create-section-translation.command.js +18 -0
  50. package/build/commands/course/get-all-course-translations.query.js +14 -0
  51. package/build/commands/course/get-all-lesson-translations.query.js +14 -0
  52. package/build/commands/course/get-all-section-translations.query.js +14 -0
  53. package/build/commands/course/index.js +9 -0
  54. package/build/commands/course/update-course-translation.command.js +22 -0
  55. package/build/commands/course/update-lesson-translation.command.js +18 -0
  56. package/build/commands/course/update-section-translation.command.js +18 -0
  57. package/build/commands/index.js +1 -0
  58. package/build/commands/page/create-page-translation.command.js +23 -0
  59. package/build/commands/page/create-page.command.js +6 -0
  60. package/build/commands/page/find-page.command.js +10 -2
  61. package/build/commands/page/get-all-page-translations.query.js +14 -0
  62. package/build/commands/page/index.js +3 -0
  63. package/build/commands/page/update-page-translation.command.js +23 -0
  64. package/build/commands/page/update-page.command.js +5 -0
  65. package/build/commands/prompt/create-prompt-translation.command.js +19 -0
  66. package/build/commands/prompt/create-prompt.command.js +2 -0
  67. package/build/commands/prompt/get-all-prompt-translations.query.js +14 -0
  68. package/build/commands/prompt/index.js +3 -0
  69. package/build/commands/prompt/update-prompt-translation.command.js +19 -0
  70. package/build/commands/prompt/update-prompt.command.js +2 -0
  71. package/build/commands/prompt-category/create-prompt-category-translation.command.js +20 -0
  72. package/build/commands/prompt-category/create-prompt-category.command.js +3 -0
  73. package/build/commands/prompt-category/get-all-prompt-category-translations.query.js +14 -0
  74. package/build/commands/prompt-category/index.js +3 -0
  75. package/build/commands/prompt-category/update-prompt-category-translation.command.js +20 -0
  76. package/build/commands/prompt-category/update-prompt-category.command.js +3 -0
  77. package/build/commands/prompt-topic/create-prompt-topic-translation.command.js +22 -0
  78. package/build/commands/prompt-topic/create-prompt-topic.command.js +5 -0
  79. package/build/commands/prompt-topic/get-all-prompt-topic-translations.query.js +14 -0
  80. package/build/commands/prompt-topic/index.js +3 -0
  81. package/build/commands/prompt-topic/update-prompt-topic-translation.command.js +22 -0
  82. package/build/commands/prompt-topic/update-prompt-topic.command.js +5 -0
  83. package/build/commands/question/create-question-translation.command.js +19 -0
  84. package/build/commands/question/create-question.command.js +2 -0
  85. package/build/commands/question/get-all-question-translations.query.js +14 -0
  86. package/build/commands/question/index.js +3 -0
  87. package/build/commands/question/update-question-translation.command.js +19 -0
  88. package/build/commands/question/update-question.command.js +2 -0
  89. package/build/commands/team-account/get-team-account-statistics-by-month.command.js +6 -13
  90. package/build/commands/team-account/get-team-account-statistics-overview.command.js +5 -1
  91. package/build/commands/team-account/index.js +1 -0
  92. package/build/commands/team-account/update-team-account-invite.command.js +17 -0
  93. package/build/commands/ui-notification/create-admin-broadcast-ui-notification.command.js +9 -2
  94. package/build/commands/unregistered-user/patch-locale.command.js +3 -3
  95. package/build/commands/user/get-me.command.js +2 -1
  96. package/build/commands/user/patch-locale.command.js +3 -3
  97. package/build/constants/cabinet/enums/index.js +1 -0
  98. package/build/constants/cabinet/enums/statistics-request-type.enum.js +24 -0
  99. package/build/constants/subscription/enums/index.js +1 -0
  100. package/build/constants/subscription/enums/subscription-balance-field.enum.js +8 -0
  101. package/build/constants/tool/enums/index.js +0 -1
  102. package/build/constants/user/enums/index.js +0 -1
  103. package/build/models/canvas-template.schema.js +63 -0
  104. package/build/models/category-translation.schema.js +16 -0
  105. package/build/models/course-translation.schema.js +17 -0
  106. package/build/models/index.js +11 -0
  107. package/build/models/lesson-translation.schema.js +13 -0
  108. package/build/models/page-translation.schema.js +18 -0
  109. package/build/models/post-translation.schema.js +18 -0
  110. package/build/models/prompt-category-translation.schema.js +18 -0
  111. package/build/models/prompt-topic-translation.schema.js +20 -0
  112. package/build/models/prompt-translation.schema.js +14 -0
  113. package/build/models/question-translation.schema.js +14 -0
  114. package/build/models/section-translation.schema.js +13 -0
  115. package/build/models/ui-notification.schema.js +13 -8
  116. package/build/models/user.schema.js +2 -2
  117. package/commands/blog/create-post-translation.command.ts +28 -0
  118. package/commands/blog/create-post.command.ts +6 -0
  119. package/commands/blog/get-all-post-translations.query.ts +16 -0
  120. package/commands/blog/index.ts +3 -0
  121. package/commands/blog/update-post-translation.command.ts +28 -0
  122. package/commands/blog/update-post.command.ts +6 -0
  123. package/commands/cabinet/get-user-statistics-by-month.command.ts +7 -14
  124. package/commands/cabinet/get-user-statistics-overview.command.ts +6 -2
  125. package/commands/canvas-template/create-canvas-from-template.command.ts +19 -0
  126. package/commands/canvas-template/create-canvas-template.command.ts +20 -0
  127. package/commands/canvas-template/delete-canvas-template.command.ts +17 -0
  128. package/commands/canvas-template/find-canvas-template-by-uuid.query.ts +16 -0
  129. package/commands/canvas-template/find-canvas-templates.query.ts +20 -0
  130. package/commands/canvas-template/index.ts +6 -0
  131. package/commands/canvas-template/update-canvas-template.command.ts +26 -0
  132. package/commands/category/create-category-translation.command.ts +26 -0
  133. package/commands/category/create-category.command.ts +4 -0
  134. package/commands/category/get-all-category-translations.query.ts +16 -0
  135. package/commands/category/index.ts +3 -0
  136. package/commands/category/update-category-translation.command.ts +26 -0
  137. package/commands/category/update-category.command.ts +4 -0
  138. package/commands/course/create-course-translation.command.ts +27 -0
  139. package/commands/course/create-course.command.ts +5 -0
  140. package/commands/course/create-lesson-translation.command.ts +23 -0
  141. package/commands/course/create-section-translation.command.ts +23 -0
  142. package/commands/course/get-all-course-translations.query.ts +16 -0
  143. package/commands/course/get-all-lesson-translations.query.ts +16 -0
  144. package/commands/course/get-all-section-translations.query.ts +16 -0
  145. package/commands/course/index.ts +9 -0
  146. package/commands/course/update-course-translation.command.ts +27 -0
  147. package/commands/course/update-lesson-translation.command.ts +23 -0
  148. package/commands/course/update-section-translation.command.ts +23 -0
  149. package/commands/index.ts +2 -0
  150. package/commands/page/create-page-translation.command.ts +28 -0
  151. package/commands/page/create-page.command.ts +6 -0
  152. package/commands/page/find-page.command.ts +15 -2
  153. package/commands/page/get-all-page-translations.query.ts +16 -0
  154. package/commands/page/index.ts +3 -0
  155. package/commands/page/update-page-translation.command.ts +28 -0
  156. package/commands/page/update-page.command.ts +5 -0
  157. package/commands/prompt/create-prompt-translation.command.ts +24 -0
  158. package/commands/prompt/create-prompt.command.ts +2 -0
  159. package/commands/prompt/get-all-prompt-translations.query.ts +16 -0
  160. package/commands/prompt/index.ts +3 -0
  161. package/commands/prompt/update-prompt-translation.command.ts +24 -0
  162. package/commands/prompt/update-prompt.command.ts +2 -0
  163. package/commands/prompt-category/create-prompt-category-translation.command.ts +25 -0
  164. package/commands/prompt-category/create-prompt-category.command.ts +3 -0
  165. package/commands/prompt-category/get-all-prompt-category-translations.query.ts +16 -0
  166. package/commands/prompt-category/index.ts +3 -0
  167. package/commands/prompt-category/update-prompt-category-translation.command.ts +25 -0
  168. package/commands/prompt-category/update-prompt-category.command.ts +3 -0
  169. package/commands/prompt-topic/create-prompt-topic-translation.command.ts +27 -0
  170. package/commands/prompt-topic/create-prompt-topic.command.ts +5 -0
  171. package/commands/prompt-topic/get-all-prompt-topic-translations.query.ts +16 -0
  172. package/commands/prompt-topic/index.ts +3 -0
  173. package/commands/prompt-topic/update-prompt-topic-translation.command.ts +27 -0
  174. package/commands/prompt-topic/update-prompt-topic.command.ts +5 -0
  175. package/commands/question/create-question-translation.command.ts +24 -0
  176. package/commands/question/create-question.command.ts +2 -0
  177. package/commands/question/get-all-question-translations.query.ts +16 -0
  178. package/commands/question/index.ts +3 -0
  179. package/commands/question/update-question-translation.command.ts +24 -0
  180. package/commands/question/update-question.command.ts +2 -0
  181. package/commands/team-account/find-team-accounts-by-name.command.ts +1 -1
  182. package/commands/team-account/get-team-account-statistics-by-month.command.ts +7 -14
  183. package/commands/team-account/get-team-account-statistics-overview.command.ts +6 -2
  184. package/commands/team-account/index.ts +1 -0
  185. package/commands/team-account/update-team-account-invite.command.ts +22 -0
  186. package/commands/ui-notification/create-admin-broadcast-ui-notification.command.ts +9 -2
  187. package/commands/unregistered-user/patch-locale.command.ts +1 -1
  188. package/commands/user/get-me.command.ts +2 -1
  189. package/commands/user/patch-locale.command.ts +1 -1
  190. package/constants/cabinet/enums/index.ts +1 -0
  191. package/constants/cabinet/enums/statistics-request-type.enum.ts +20 -0
  192. package/constants/subscription/enums/index.ts +1 -0
  193. package/constants/subscription/enums/subscription-balance-field.enum.ts +4 -0
  194. package/constants/tool/enums/index.ts +0 -1
  195. package/constants/user/enums/index.ts +0 -1
  196. package/models/canvas-template.schema.ts +68 -0
  197. package/models/category-translation.schema.ts +14 -0
  198. package/models/course-translation.schema.ts +15 -0
  199. package/models/index.ts +12 -0
  200. package/models/lesson-translation.schema.ts +11 -0
  201. package/models/page-translation.schema.ts +16 -0
  202. package/models/post-translation.schema.ts +16 -0
  203. package/models/prompt-category-translation.schema.ts +13 -0
  204. package/models/prompt-topic-translation.schema.ts +15 -0
  205. package/models/prompt-translation.schema.ts +12 -0
  206. package/models/question-translation.schema.ts +12 -0
  207. package/models/section-translation.schema.ts +11 -0
  208. package/models/ui-notification.schema.ts +14 -7
  209. package/models/user.schema.ts +1 -1
  210. package/package.json +2 -1
  211. package/build/constants/tool/enums/job-request-origin.enum.js +0 -8
  212. package/build/constants/user/enums/locale.enum.js +0 -8
  213. package/constants/tool/enums/job-request-origin.enum.ts +0 -4
  214. package/constants/user/enums/locale.enum.ts +0 -4
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { PromptCategoryTranslationSchema } from '../../models';
3
+
4
+ export namespace GetAllPromptCategoryTranslationsQuery {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.array(PromptCategoryTranslationSchema),
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -1,6 +1,9 @@
1
1
  export * from './create-prompt-category.command';
2
+ export * from './create-prompt-category-translation.command';
2
3
  export * from './delete-prompt-category.command';
3
4
  export * from './update-prompt-category.command';
5
+ export * from './update-prompt-category-translation.command';
4
6
  export * from './find-all-prompt-categories.command';
7
+ export * from './get-all-prompt-category-translations.query';
5
8
  export * from './find-prompt-category-by-alias.command';
6
9
  export * from './find-prompt-category-by-uuid.command';
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { PromptCategoryTranslationSchema } from '../../models';
3
+
4
+ export namespace UpdatePromptCategoryTranslationCommand {
5
+ export const RequestSchema = PromptCategoryTranslationSchema.pick({
6
+ title: true,
7
+ metaTitle: true,
8
+ metaDescription: true,
9
+ }).partial();
10
+
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const RequestParamSchema = z.object({
14
+ uuid: z.string().uuid(),
15
+ translationUuid: z.string().uuid(),
16
+ });
17
+
18
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: PromptCategoryTranslationSchema,
22
+ });
23
+
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -4,6 +4,9 @@ import { PromptCategorySchema } from '../../models';
4
4
  export namespace UpdatePromptCategoryCommand {
5
5
  export const RequestSchema = PromptCategorySchema.omit({
6
6
  uuid: true,
7
+ title: true,
8
+ metaTitle: true,
9
+ metaDescription: true,
7
10
  createdAt: true,
8
11
  updatedAt: true,
9
12
  }).partial();
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { PromptTopicTranslationSchema } from '../../models';
3
+
4
+ export namespace CreatePromptTopicTranslationCommand {
5
+ export const RequestSchema = PromptTopicTranslationSchema.pick({
6
+ title: true,
7
+ content: true,
8
+ metaTitle: true,
9
+ metaDescription: true,
10
+ seoText: true,
11
+ locale: true,
12
+ });
13
+
14
+ export type Request = z.infer<typeof RequestSchema>;
15
+
16
+ export const RequestParamSchema = z.object({
17
+ uuid: z.string().uuid(),
18
+ });
19
+
20
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
21
+
22
+ export const ResponseSchema = z.object({
23
+ data: PromptTopicTranslationSchema,
24
+ });
25
+
26
+ export type Response = z.infer<typeof ResponseSchema>;
27
+ }
@@ -4,6 +4,11 @@ import { PromptTopicSchema } from '../../models';
4
4
  export namespace CreatePromptTopicCommand {
5
5
  export const RequestSchema = PromptTopicSchema.omit({
6
6
  uuid: true,
7
+ title: true,
8
+ content: true,
9
+ metaTitle: true,
10
+ metaDescription: true,
11
+ seoText: true,
7
12
  createdAt: true,
8
13
  updatedAt: true,
9
14
  });
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { PromptTopicTranslationSchema } from '../../models';
3
+
4
+ export namespace GetAllPromptTopicTranslationsQuery {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.array(PromptTopicTranslationSchema),
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -1,7 +1,10 @@
1
1
  export * from './create-prompt-topic.command';
2
+ export * from './create-prompt-topic-translation.command';
2
3
  export * from './delete-prompt-topic.command';
3
4
  export * from './update-prompt-topic.command';
5
+ export * from './update-prompt-topic-translation.command';
4
6
  export * from './find-prompt-topic-by-category.command';
5
7
  export * from './find-prompt-topic-by-alias.command';
6
8
  export * from './find-all-prompt-topics.command';
9
+ export * from './get-all-prompt-topic-translations.query';
7
10
  export * from './find-prompt-topic-by-uuid.command';
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { PromptTopicTranslationSchema } from '../../models';
3
+
4
+ export namespace UpdatePromptTopicTranslationCommand {
5
+ export const RequestSchema = PromptTopicTranslationSchema.pick({
6
+ title: true,
7
+ content: true,
8
+ metaTitle: true,
9
+ metaDescription: true,
10
+ seoText: true,
11
+ }).partial();
12
+
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const RequestParamSchema = z.object({
16
+ uuid: z.string().uuid(),
17
+ translationUuid: z.string().uuid(),
18
+ });
19
+
20
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
21
+
22
+ export const ResponseSchema = z.object({
23
+ data: PromptTopicTranslationSchema,
24
+ });
25
+
26
+ export type Response = z.infer<typeof ResponseSchema>;
27
+ }
@@ -4,6 +4,11 @@ import { PromptTopicSchema } from '../../models';
4
4
  export namespace UpdatePromptTopicCommand {
5
5
  export const RequestSchema = PromptTopicSchema.omit({
6
6
  uuid: true,
7
+ title: true,
8
+ content: true,
9
+ metaTitle: true,
10
+ metaDescription: true,
11
+ seoText: true,
7
12
  createdAt: true,
8
13
  updatedAt: true,
9
14
  }).partial();
@@ -0,0 +1,24 @@
1
+ import { QuestionTranslationSchema } from '../../models';
2
+ import { z } from 'zod';
3
+
4
+ export namespace CreateQuestionTranslationCommand {
5
+ export const RequestSchema = QuestionTranslationSchema.pick({
6
+ question: true,
7
+ answer: true,
8
+ locale: true,
9
+ });
10
+
11
+ export type Request = z.infer<typeof RequestSchema>;
12
+
13
+ export const RequestParamSchema = z.object({
14
+ uuid: z.string().uuid(),
15
+ });
16
+
17
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: QuestionTranslationSchema,
21
+ });
22
+
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -6,6 +6,8 @@ export namespace CreateQuestionCommand {
6
6
  uuid: true,
7
7
  createdAt: true,
8
8
  updatedAt: true,
9
+ question: true,
10
+ answer: true,
9
11
  });
10
12
 
11
13
  export type Request = z.infer<typeof RequestSchema>;
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { QuestionTranslationSchema } from '../../models';
3
+
4
+ export namespace GetAllQuestionTranslationsQuery {
5
+ export const RequestParamSchema = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
10
+
11
+ export const ResponseSchema = z.object({
12
+ data: z.array(QuestionTranslationSchema),
13
+ });
14
+
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -1,4 +1,7 @@
1
1
  export * from './create-question.command';
2
+ export * from './create-question-translation.command';
2
3
  export * from './delete-question.command';
3
4
  export * from './find-question.command';
5
+ export * from './get-all-question-translations.query';
4
6
  export * from './update-question.command';
7
+ export * from './update-question-translation.command';
@@ -0,0 +1,24 @@
1
+ import { QuestionTranslationSchema } from '../../models';
2
+ import { z } from 'zod';
3
+
4
+ export namespace UpdateQuestionTranslationCommand {
5
+ export const RequestSchema = QuestionTranslationSchema.pick({
6
+ question: true,
7
+ answer: true,
8
+ }).partial();
9
+
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const RequestParamSchema = z.object({
13
+ uuid: z.string().uuid(),
14
+ translationUuid: z.string().uuid(),
15
+ });
16
+
17
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: QuestionTranslationSchema,
21
+ });
22
+
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -6,6 +6,8 @@ export namespace UpdateQuestionCommand {
6
6
  createdAt: true,
7
7
  updatedAt: true,
8
8
  uuid: true,
9
+ question: true,
10
+ answer: true,
9
11
  }).partial();
10
12
 
11
13
  export type Request = z.infer<typeof RequestSchema>;
@@ -25,7 +25,7 @@ export namespace FindTeamAccountsByNameCommand {
25
25
 
26
26
  return z.NEVER;
27
27
  });
28
-
28
+
29
29
  export const RequestSchema = z.object({
30
30
  name: z.string().trim().min(1).optional(),
31
31
  creatorEmail: z.string().trim().min(1).optional(),
@@ -1,9 +1,13 @@
1
1
  import { z } from 'zod';
2
- import { JOB_REQUEST_ORIGIN, STATISTICS_METRIC_TYPE } from '../../constants';
2
+ import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
3
+ import { STATISTICS_METRIC_TYPE, STATISTICS_REQUEST_TYPE } from '../../constants';
3
4
 
4
5
  export namespace GetTeamAccountStatisticsByMonthCommand {
5
6
  export const RequestSchema = z.object({
6
- origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API).optional(),
7
+ callOrigin: z
8
+ .nativeEnum(STATISTICS_CALL_ORIGIN)
9
+ .default(STATISTICS_CALL_ORIGIN.WEB)
10
+ .optional(),
7
11
  metric: z
8
12
  .nativeEnum(STATISTICS_METRIC_TYPE)
9
13
  .default(STATISTICS_METRIC_TYPE.REQUESTS)
@@ -15,18 +19,7 @@ export namespace GetTeamAccountStatisticsByMonthCommand {
15
19
 
16
20
  export const TeamAccountStatisticsByMonthItemSchema = z.object({
17
21
  month: z.string(),
18
- total_texts: z.number(),
19
- total_audios: z.number(),
20
- total_images: z.number(),
21
- total_videos: z.number(),
22
- total_presentations: z.number(),
23
- total_paraphrases: z.number(),
24
- writers: z.object({
25
- total_writers: z.number(),
26
- total_writer_actions: z.number(),
27
- }),
28
- total_video_edits: z.number(),
29
- total_musics: z.number(),
22
+ statistics: z.record(z.nativeEnum(STATISTICS_REQUEST_TYPE), z.number()),
30
23
  });
31
24
 
32
25
  export const ResponseSchema = z.object({
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { GROUP_BY, JOB_REQUEST_ORIGIN } from '../../constants';
2
+ import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
3
+ import { GROUP_BY } from '../../constants';
3
4
 
4
5
  export namespace GetTeamAccountStatisticsOverviewCommand {
5
6
  export const RequestSchema = z.object({
@@ -10,7 +11,10 @@ export namespace GetTeamAccountStatisticsOverviewCommand {
10
11
  message: 'to must be a valid date string',
11
12
  }),
12
13
  groupBy: z.nativeEnum(GROUP_BY).default(GROUP_BY.DAY),
13
- origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API).optional(),
14
+ callOrigin: z
15
+ .nativeEnum(STATISTICS_CALL_ORIGIN)
16
+ .default(STATISTICS_CALL_ORIGIN.WEB)
17
+ .optional(),
14
18
  memberUserId: z.string().uuid().optional(),
15
19
  });
16
20
 
@@ -2,6 +2,7 @@ export * from './create-team-account.command';
2
2
  export * from './update-team-account.command';
3
3
  export * from './cancel-team-trial-subscription.command';
4
4
  export * from './invite-team-account-member.command';
5
+ export * from './update-team-account-invite.command';
5
6
  export * from './accept-team-account-invite.command';
6
7
  export * from './remove-team-account-member.command';
7
8
  export * from './leave-team-account-member.command';
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ import { TeamAccountInviteResponseSchema } from '../../models';
3
+
4
+ export namespace UpdateTeamAccountInviteCommand {
5
+ export const RequestParam = z.object({
6
+ uuid: z.string().uuid(),
7
+ });
8
+
9
+ export type RequestParam = z.infer<typeof RequestParam>;
10
+
11
+ export const RequestSchema = z.object({
12
+ limit: z.number().int().positive().nullable(),
13
+ });
14
+
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const ResponseSchema = z.object({
18
+ data: TeamAccountInviteResponseSchema,
19
+ });
20
+
21
+ export type Response = z.infer<typeof ResponseSchema>;
22
+ }
@@ -1,9 +1,16 @@
1
1
  import { z } from 'zod';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
2
3
 
3
4
  export namespace CreateAdminBroadcastUiNotificationCommand {
4
5
  export const RequestBodySchema = z.object({
5
- title: z.string().trim().min(1),
6
- message: z.string().trim().min(1),
6
+ title: z.object({
7
+ [LOCALE.RU]: z.string().trim().min(1),
8
+ [LOCALE.EN]: z.string().trim().min(1),
9
+ }),
10
+ message: z.object({
11
+ [LOCALE.RU]: z.string().trim().min(1),
12
+ [LOCALE.EN]: z.string().trim().min(1),
13
+ }),
7
14
  onlyRegistered: z.boolean().optional(),
8
15
  });
9
16
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { LOCALE } from '../../constants';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
3
3
 
4
4
  export namespace PatchUnregisteredUserLocaleCommand {
5
5
  export const RequestSchema = z.object({
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { LOCALE, ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
2
+ import { ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
3
3
  import { UserProfileResponseSchema } from '../../models';
4
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
5
 
5
6
  export namespace GetMeCommand {
6
7
  export const RequestSchema = z.object({});
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { LOCALE } from '../../constants';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
3
3
 
4
4
  export namespace PatchUserLocaleCommand {
5
5
  export const RequestSchema = z.object({
@@ -1,2 +1,3 @@
1
1
  export * from './group-by.enum';
2
2
  export * from './statistics-metric-type.enum';
3
+ export * from './statistics-request-type.enum';
@@ -0,0 +1,20 @@
1
+ export enum STATISTICS_REQUEST_TYPE {
2
+ IMAGE = 'IMAGE',
3
+ VIDEO = 'VIDEO',
4
+ PRESENTATION = 'PRESENTATION',
5
+ TEXT = 'TEXT',
6
+ AUDIO = 'AUDIO',
7
+ PARAPHRASE = 'PARAPHRASE',
8
+ WRITER = 'WRITER',
9
+ PRESENTATION_AI_ACTION = 'PRESENTATION_AI_ACTION',
10
+ WRITER_ACTION = 'WRITER_ACTION',
11
+ VIDEO_EDITOR = 'VIDEO_EDITOR',
12
+ MUSIC = 'MUSIC',
13
+ MUSIC_ACTION = 'MUSIC_ACTION',
14
+ INTERIOR_DESIGN = 'INTERIOR_DESIGN',
15
+ MARKETPLACE_CARD = 'MARKETPLACE_CARD',
16
+ SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
17
+ SPELL_CORRECTOR = 'SPELL_CORRECTOR',
18
+ DIAGRAMS = 'DIAGRAMS',
19
+ HTML_PAGE_BUILDER = 'HTML_PAGE_BUILDER',
20
+ }
@@ -1,4 +1,5 @@
1
1
  export * from './subscription-action.enum';
2
+ export * from './subscription-balance-field.enum';
2
3
  export * from './subscription-feature-type.enum';
3
4
  export * from './subscription-plan.enum';
4
5
  export * from './subscription-status.enum';
@@ -0,0 +1,4 @@
1
+ export enum SUBSCRIPTION_BALANCE_FIELD {
2
+ TOKEN_BALANCE = 'tokenBalance',
3
+ CARRIED_OVER_TOKEN_BALANCE = 'carriedOverTokenBalance',
4
+ }
@@ -1,7 +1,6 @@
1
1
  export * from './tool-content-type.enum';
2
2
  export * from './tool-group.enum';
3
3
  export * from './tool-job-status.enum';
4
- export * from './job-request-origin.enum';
5
4
  export * from './tool-type.enum';
6
5
  export * from './tool-workspace-item-slot.enum';
7
6
  export * from './tool-workspace-status.enum';
@@ -2,4 +2,3 @@ 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,68 @@
1
+ import { z } from 'zod';
2
+ import { INPUT_OUTPUT_TYPE, CANVAS_NODE_TYPE } from '../constants';
3
+ import { CanvasNodeParamsSchema, CanvasNodePositionSchema } from './canvas-node.schema';
4
+
5
+ const CanvasTemplateGraphNodeSchema = z.object({
6
+ uuid: z.string().trim().min(1),
7
+ nodeDefinitionId: z.nativeEnum(CANVAS_NODE_TYPE),
8
+ position: CanvasNodePositionSchema,
9
+ params: CanvasNodeParamsSchema.nullable().optional(),
10
+ });
11
+
12
+ const CanvasTemplateGraphEdgeSchema = z.object({
13
+ sourceId: z.string().trim().min(1),
14
+ targetId: z.string().trim().min(1),
15
+ handle: z.nativeEnum(INPUT_OUTPUT_TYPE),
16
+ });
17
+
18
+ export const CanvasTemplateGraphSchema = z
19
+ .object({
20
+ nodes: z.array(CanvasTemplateGraphNodeSchema),
21
+ edges: z.array(CanvasTemplateGraphEdgeSchema),
22
+ })
23
+ .superRefine((graph, ctx) => {
24
+ const nodeIds = new Set<string>();
25
+ for (const [index, node] of graph.nodes.entries()) {
26
+ if (nodeIds.has(node.uuid)) {
27
+ ctx.addIssue({
28
+ code: z.ZodIssueCode.custom,
29
+ path: ['nodes', index, 'uuid'],
30
+ message: `Duplicate node id: ${node.uuid}`,
31
+ });
32
+ continue;
33
+ }
34
+ nodeIds.add(node.uuid);
35
+ }
36
+
37
+ for (const [index, edge] of graph.edges.entries()) {
38
+ if (!nodeIds.has(edge.sourceId)) {
39
+ ctx.addIssue({
40
+ code: z.ZodIssueCode.custom,
41
+ path: ['edges', index, 'sourceId'],
42
+ message: `Source node not found: ${edge.sourceId}`,
43
+ });
44
+ }
45
+
46
+ if (!nodeIds.has(edge.targetId)) {
47
+ ctx.addIssue({
48
+ code: z.ZodIssueCode.custom,
49
+ path: ['edges', index, 'targetId'],
50
+ message: `Target node not found: ${edge.targetId}`,
51
+ });
52
+ }
53
+ }
54
+ });
55
+
56
+ export type CanvasTemplateGraph = z.infer<typeof CanvasTemplateGraphSchema>;
57
+
58
+ export const CanvasTemplateSchema = z.object({
59
+ uuid: z.string().uuid(),
60
+ name: z.string(),
61
+ description: z.string().nullable(),
62
+ userId: z.string().uuid().nullable(),
63
+ previewImageUrl: z.string().url().nullable(),
64
+ tags: z.array(z.string()),
65
+ graph: CanvasTemplateGraphSchema,
66
+ createdAt: z.date(),
67
+ updatedAt: z.date(),
68
+ });
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
3
+
4
+ export const CategoryTranslationSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ categoryId: z.string().uuid(),
7
+ locale: z.nativeEnum(LOCALE),
8
+ name: z.string().min(3).max(16384),
9
+ prompt: z.nullable(z.string().min(3).max(16384)),
10
+ placeholder: z.nullable(z.string()),
11
+ seoName: z.string().min(3).max(16384),
12
+ createdAt: z.date(),
13
+ updatedAt: z.date(),
14
+ });
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
3
+
4
+ export const CourseTranslationSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ courseId: z.string().uuid(),
7
+ locale: z.nativeEnum(LOCALE),
8
+ title: z.string(),
9
+ subtitle: z.string(),
10
+ prerequisites: z.string(),
11
+ description: z.string(),
12
+ skills: z.array(z.string()),
13
+ createdAt: z.date(),
14
+ updatedAt: z.date(),
15
+ });
package/models/index.ts CHANGED
@@ -8,11 +8,13 @@ export * from './canvas-node-definition.schema';
8
8
  export * from './canvas-node.schema';
9
9
  export * from './canvas-edge.schema';
10
10
  export * from './category.schema';
11
+ export * from './category-translation.schema';
11
12
  export * from './chat-with-messages.schema';
12
13
  export * from './chat.schema';
13
14
  export * from './cloud-payments-receipt.schema';
14
15
  export * from './course-author.schema';
15
16
  export * from './course.schema';
17
+ export * from './course-translation.schema';
16
18
  export * from './date.schema';
17
19
  export * from './feedback.schema';
18
20
  export * from './file.schema';
@@ -20,19 +22,24 @@ export * from './key-value.schema';
20
22
  export * from './form-submission.schema';
21
23
  export * from './icon-variants.schema';
22
24
  export * from './lesson.schema';
25
+ export * from './lesson-translation.schema';
23
26
  export * from './message.schema';
24
27
  export * from './midjourney-job.schema';
25
28
  export * from './order.schema';
26
29
  export * from './page.schema';
30
+ export * from './page-translation.schema';
27
31
  export * from './payment-history-item.schema';
28
32
  export * from './payment.schema';
29
33
  export * from './invoice-for-payment.schema';
30
34
  export * from './post.schema';
35
+ export * from './post-translation.schema';
31
36
  export * from './product.schema';
32
37
  export * from './promocode.schema';
33
38
  export * from './question.schema';
39
+ export * from './question-translation.schema';
34
40
  export * from './referral-bonus.schema';
35
41
  export * from './section.schema';
42
+ export * from './section-translation.schema';
36
43
  export * from './subscription-feature.schema';
37
44
  export * from './team-subscription-feature.schema';
38
45
  export * from './subscription-upgrade-schema';
@@ -51,8 +58,11 @@ export * from './utm.schema';
51
58
  export * from './ui-notification.schema';
52
59
  export * from './review.schema';
53
60
  export * from './prompt-category.schema';
61
+ export * from './prompt-category-translation.schema';
54
62
  export * from './prompt-topic.schema';
63
+ export * from './prompt-topic-translation.schema';
55
64
  export * from './prompt.schema';
65
+ export * from './prompt-translation.schema';
56
66
  export * from './folder.schema';
57
67
  export * from './filters.schema';
58
68
  export * from './users-filter-notification.schema';
@@ -67,3 +77,5 @@ export * from './user-profile.schema';
67
77
  export * from './b2b';
68
78
  export * from './json-value.schema';
69
79
  export * from './team-account';
80
+
81
+ export * from './canvas-template.schema';
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
3
+
4
+ export const LessonTranslationSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ lessonId: z.string().uuid(),
7
+ locale: z.nativeEnum(LOCALE),
8
+ title: z.string(),
9
+ createdAt: z.date(),
10
+ updatedAt: z.date(),
11
+ });