@purpleschool/gptbot 0.12.4 → 0.12.5-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 (143) hide show
  1. package/api/controllers/http/blog.ts +2 -0
  2. package/api/controllers/http/category.ts +2 -0
  3. package/api/controllers/http/course.ts +8 -0
  4. package/api/controllers/http/page.ts +2 -0
  5. package/api/controllers/http/prompt-category.ts +2 -0
  6. package/api/controllers/http/prompt-topic.ts +2 -0
  7. package/api/controllers/http/prompt.ts +2 -0
  8. package/api/controllers/http/question.ts +2 -0
  9. package/api/controllers/http/team-account.ts +1 -0
  10. package/api/routes.ts +46 -0
  11. package/build/api/controllers/http/blog.js +2 -0
  12. package/build/api/controllers/http/category.js +2 -0
  13. package/build/api/controllers/http/course.js +6 -0
  14. package/build/api/controllers/http/page.js +2 -0
  15. package/build/api/controllers/http/prompt-category.js +2 -0
  16. package/build/api/controllers/http/prompt-topic.js +2 -0
  17. package/build/api/controllers/http/prompt.js +2 -0
  18. package/build/api/controllers/http/question.js +2 -0
  19. package/build/api/controllers/http/team-account.js +1 -0
  20. package/build/api/routes.js +23 -0
  21. package/build/commands/blog/create-post-translation.command.js +25 -0
  22. package/build/commands/blog/create-post.command.js +6 -0
  23. package/build/commands/blog/index.js +2 -0
  24. package/build/commands/blog/update-post-translation.command.js +24 -0
  25. package/build/commands/blog/update-post.command.js +6 -0
  26. package/build/commands/cabinet/get-user-statistics-by-month.command.js +6 -13
  27. package/build/commands/cabinet/get-user-statistics-overview.command.js +5 -1
  28. package/build/commands/category/create-category-translation.command.js +23 -0
  29. package/build/commands/category/create-category.command.js +4 -0
  30. package/build/commands/category/index.js +2 -0
  31. package/build/commands/category/update-category-translation.command.js +22 -0
  32. package/build/commands/category/update-category.command.js +4 -0
  33. package/build/commands/course/create-course-translation.command.js +24 -0
  34. package/build/commands/course/create-course.command.js +5 -0
  35. package/build/commands/course/create-lesson-translation.command.js +20 -0
  36. package/build/commands/course/create-section-translation.command.js +20 -0
  37. package/build/commands/course/index.js +6 -0
  38. package/build/commands/course/update-course-translation.command.js +23 -0
  39. package/build/commands/course/update-lesson-translation.command.js +19 -0
  40. package/build/commands/course/update-section-translation.command.js +19 -0
  41. package/build/commands/page/create-page-translation.command.js +24 -0
  42. package/build/commands/page/create-page.command.js +5 -0
  43. package/build/commands/page/index.js +2 -0
  44. package/build/commands/page/update-page-translation.command.js +23 -0
  45. package/build/commands/page/update-page.command.js +5 -0
  46. package/build/commands/prompt/create-prompt-translation.command.js +21 -0
  47. package/build/commands/prompt/create-prompt.command.js +2 -0
  48. package/build/commands/prompt/index.js +2 -0
  49. package/build/commands/prompt/update-prompt-translation.command.js +20 -0
  50. package/build/commands/prompt/update-prompt.command.js +2 -0
  51. package/build/commands/prompt-category/create-prompt-category-translation.command.js +22 -0
  52. package/build/commands/prompt-category/create-prompt-category.command.js +3 -0
  53. package/build/commands/prompt-category/index.js +2 -0
  54. package/build/commands/prompt-category/update-prompt-category-translation.command.js +21 -0
  55. package/build/commands/prompt-category/update-prompt-category.command.js +3 -0
  56. package/build/commands/prompt-topic/create-prompt-topic-translation.command.js +24 -0
  57. package/build/commands/prompt-topic/create-prompt-topic.command.js +5 -0
  58. package/build/commands/prompt-topic/index.js +2 -0
  59. package/build/commands/prompt-topic/update-prompt-topic-translation.command.js +23 -0
  60. package/build/commands/prompt-topic/update-prompt-topic.command.js +5 -0
  61. package/build/commands/question/create-question-translation.command.js +21 -0
  62. package/build/commands/question/create-question.command.js +2 -0
  63. package/build/commands/question/index.js +2 -0
  64. package/build/commands/question/update-question-translation.command.js +20 -0
  65. package/build/commands/question/update-question.command.js +2 -0
  66. package/build/commands/team-account/get-team-account-statistics-by-month.command.js +6 -13
  67. package/build/commands/team-account/get-team-account-statistics-overview.command.js +5 -1
  68. package/build/commands/team-account/index.js +1 -0
  69. package/build/commands/team-account/update-team-account-invite.command.js +17 -0
  70. package/build/commands/unregistered-user/patch-locale.command.js +3 -3
  71. package/build/commands/user/get-me.command.js +2 -1
  72. package/build/commands/user/patch-locale.command.js +3 -3
  73. package/build/constants/cabinet/enums/index.js +1 -0
  74. package/build/constants/cabinet/enums/statistics-request-type.enum.js +22 -0
  75. package/build/constants/subscription/enums/index.js +1 -0
  76. package/build/constants/subscription/enums/subscription-balance-field.enum.js +8 -0
  77. package/build/constants/tool/enums/index.js +0 -1
  78. package/build/constants/user/enums/index.js +0 -1
  79. package/build/models/user.schema.js +2 -2
  80. package/commands/blog/create-post-translation.command.ts +30 -0
  81. package/commands/blog/create-post.command.ts +6 -0
  82. package/commands/blog/index.ts +2 -0
  83. package/commands/blog/update-post-translation.command.ts +29 -0
  84. package/commands/blog/update-post.command.ts +6 -0
  85. package/commands/cabinet/get-user-statistics-by-month.command.ts +7 -14
  86. package/commands/cabinet/get-user-statistics-overview.command.ts +6 -2
  87. package/commands/category/create-category-translation.command.ts +28 -0
  88. package/commands/category/create-category.command.ts +4 -0
  89. package/commands/category/index.ts +2 -0
  90. package/commands/category/update-category-translation.command.ts +27 -0
  91. package/commands/category/update-category.command.ts +4 -0
  92. package/commands/course/create-course-translation.command.ts +29 -0
  93. package/commands/course/create-course.command.ts +5 -0
  94. package/commands/course/create-lesson-translation.command.ts +25 -0
  95. package/commands/course/create-section-translation.command.ts +25 -0
  96. package/commands/course/index.ts +6 -0
  97. package/commands/course/update-course-translation.command.ts +28 -0
  98. package/commands/course/update-lesson-translation.command.ts +24 -0
  99. package/commands/course/update-section-translation.command.ts +24 -0
  100. package/commands/page/create-page-translation.command.ts +29 -0
  101. package/commands/page/create-page.command.ts +5 -0
  102. package/commands/page/index.ts +2 -0
  103. package/commands/page/update-page-translation.command.ts +28 -0
  104. package/commands/page/update-page.command.ts +5 -0
  105. package/commands/prompt/create-prompt-translation.command.ts +26 -0
  106. package/commands/prompt/create-prompt.command.ts +2 -0
  107. package/commands/prompt/index.ts +2 -0
  108. package/commands/prompt/update-prompt-translation.command.ts +25 -0
  109. package/commands/prompt/update-prompt.command.ts +2 -0
  110. package/commands/prompt-category/create-prompt-category-translation.command.ts +27 -0
  111. package/commands/prompt-category/create-prompt-category.command.ts +3 -0
  112. package/commands/prompt-category/index.ts +2 -0
  113. package/commands/prompt-category/update-prompt-category-translation.command.ts +26 -0
  114. package/commands/prompt-category/update-prompt-category.command.ts +3 -0
  115. package/commands/prompt-topic/create-prompt-topic-translation.command.ts +29 -0
  116. package/commands/prompt-topic/create-prompt-topic.command.ts +5 -0
  117. package/commands/prompt-topic/index.ts +2 -0
  118. package/commands/prompt-topic/update-prompt-topic-translation.command.ts +28 -0
  119. package/commands/prompt-topic/update-prompt-topic.command.ts +5 -0
  120. package/commands/question/create-question-translation.command.ts +26 -0
  121. package/commands/question/create-question.command.ts +2 -0
  122. package/commands/question/index.ts +2 -0
  123. package/commands/question/update-question-translation.command.ts +25 -0
  124. package/commands/question/update-question.command.ts +2 -0
  125. package/commands/team-account/get-team-account-statistics-by-month.command.ts +7 -14
  126. package/commands/team-account/get-team-account-statistics-overview.command.ts +6 -2
  127. package/commands/team-account/index.ts +1 -0
  128. package/commands/team-account/update-team-account-invite.command.ts +22 -0
  129. package/commands/unregistered-user/patch-locale.command.ts +1 -1
  130. package/commands/user/get-me.command.ts +2 -1
  131. package/commands/user/patch-locale.command.ts +1 -1
  132. package/constants/cabinet/enums/index.ts +1 -0
  133. package/constants/cabinet/enums/statistics-request-type.enum.ts +18 -0
  134. package/constants/subscription/enums/index.ts +1 -0
  135. package/constants/subscription/enums/subscription-balance-field.enum.ts +4 -0
  136. package/constants/tool/enums/index.ts +0 -1
  137. package/constants/user/enums/index.ts +0 -1
  138. package/models/user.schema.ts +1 -1
  139. package/package.json +2 -1
  140. package/build/constants/tool/enums/job-request-origin.enum.js +0 -8
  141. package/build/constants/user/enums/locale.enum.js +0 -8
  142. package/constants/tool/enums/job-request-origin.enum.ts +0 -4
  143. package/constants/user/enums/locale.enum.ts +0 -4
@@ -18,6 +18,7 @@ __exportStar(require("./create-team-account.command"), exports);
18
18
  __exportStar(require("./update-team-account.command"), exports);
19
19
  __exportStar(require("./cancel-team-trial-subscription.command"), exports);
20
20
  __exportStar(require("./invite-team-account-member.command"), exports);
21
+ __exportStar(require("./update-team-account-invite.command"), exports);
21
22
  __exportStar(require("./accept-team-account-invite.command"), exports);
22
23
  __exportStar(require("./remove-team-account-member.command"), exports);
23
24
  __exportStar(require("./leave-team-account-member.command"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateTeamAccountInviteCommand = void 0;
4
+ const zod_1 = require("zod");
5
+ const models_1 = require("../../models");
6
+ var UpdateTeamAccountInviteCommand;
7
+ (function (UpdateTeamAccountInviteCommand) {
8
+ UpdateTeamAccountInviteCommand.RequestParam = zod_1.z.object({
9
+ uuid: zod_1.z.string().uuid(),
10
+ });
11
+ UpdateTeamAccountInviteCommand.RequestSchema = zod_1.z.object({
12
+ limit: zod_1.z.number().int().positive().nullable(),
13
+ });
14
+ UpdateTeamAccountInviteCommand.ResponseSchema = zod_1.z.object({
15
+ data: models_1.TeamAccountInviteResponseSchema,
16
+ });
17
+ })(UpdateTeamAccountInviteCommand || (exports.UpdateTeamAccountInviteCommand = UpdateTeamAccountInviteCommand = {}));
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PatchUnregisteredUserLocaleCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../../constants");
5
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
6
6
  var PatchUnregisteredUserLocaleCommand;
7
7
  (function (PatchUnregisteredUserLocaleCommand) {
8
8
  PatchUnregisteredUserLocaleCommand.RequestSchema = zod_1.z.object({
9
- locale: zod_1.z.nativeEnum(constants_1.LOCALE),
9
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
10
10
  });
11
11
  PatchUnregisteredUserLocaleCommand.ResponseSchema = zod_1.z.object({
12
12
  data: zod_1.z.object({
13
- locale: zod_1.z.nativeEnum(constants_1.LOCALE),
13
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
14
14
  }),
15
15
  });
16
16
  })(PatchUnregisteredUserLocaleCommand || (exports.PatchUnregisteredUserLocaleCommand = PatchUnregisteredUserLocaleCommand = {}));
@@ -4,6 +4,7 @@ exports.GetMeCommand = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const constants_1 = require("../../constants");
6
6
  const models_1 = require("../../models");
7
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
7
8
  var GetMeCommand;
8
9
  (function (GetMeCommand) {
9
10
  GetMeCommand.RequestSchema = zod_1.z.object({});
@@ -17,7 +18,7 @@ var GetMeCommand;
17
18
  telegramId: zod_1.z.number().nullable(),
18
19
  telegramUserName: zod_1.z.string().nullable(),
19
20
  webmasterId: zod_1.z.string().uuid().nullable(),
20
- locale: zod_1.z.nativeEnum(constants_1.LOCALE),
21
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
21
22
  profile: models_1.UserProfileResponseSchema,
22
23
  }),
23
24
  });
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PatchUserLocaleCommand = void 0;
4
4
  const zod_1 = require("zod");
5
- const constants_1 = require("../../constants");
5
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
6
6
  var PatchUserLocaleCommand;
7
7
  (function (PatchUserLocaleCommand) {
8
8
  PatchUserLocaleCommand.RequestSchema = zod_1.z.object({
9
- locale: zod_1.z.nativeEnum(constants_1.LOCALE),
9
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
10
10
  });
11
11
  PatchUserLocaleCommand.ResponseSchema = zod_1.z.object({
12
12
  data: zod_1.z.object({
13
- locale: zod_1.z.nativeEnum(constants_1.LOCALE),
13
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
14
14
  }),
15
15
  });
16
16
  })(PatchUserLocaleCommand || (exports.PatchUserLocaleCommand = PatchUserLocaleCommand = {}));
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./group-by.enum"), exports);
18
18
  __exportStar(require("./statistics-metric-type.enum"), exports);
19
+ __exportStar(require("./statistics-request-type.enum"), exports);
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STATISTICS_REQUEST_TYPE = void 0;
4
+ var STATISTICS_REQUEST_TYPE;
5
+ (function (STATISTICS_REQUEST_TYPE) {
6
+ STATISTICS_REQUEST_TYPE["IMAGE"] = "IMAGE";
7
+ STATISTICS_REQUEST_TYPE["VIDEO"] = "VIDEO";
8
+ STATISTICS_REQUEST_TYPE["PRESENTATION"] = "PRESENTATION";
9
+ STATISTICS_REQUEST_TYPE["TEXT"] = "TEXT";
10
+ STATISTICS_REQUEST_TYPE["AUDIO"] = "AUDIO";
11
+ STATISTICS_REQUEST_TYPE["PARAPHRASE"] = "PARAPHRASE";
12
+ STATISTICS_REQUEST_TYPE["WRITER"] = "WRITER";
13
+ STATISTICS_REQUEST_TYPE["PRESENTATION_AI_ACTION"] = "PRESENTATION_AI_ACTION";
14
+ STATISTICS_REQUEST_TYPE["WRITER_ACTION"] = "WRITER_ACTION";
15
+ STATISTICS_REQUEST_TYPE["VIDEO_EDITOR"] = "VIDEO_EDITOR";
16
+ STATISTICS_REQUEST_TYPE["MUSIC"] = "MUSIC";
17
+ STATISTICS_REQUEST_TYPE["MUSIC_ACTION"] = "MUSIC_ACTION";
18
+ STATISTICS_REQUEST_TYPE["INTERIOR_DESIGN"] = "INTERIOR_DESIGN";
19
+ STATISTICS_REQUEST_TYPE["MARKETPLACE_CARD"] = "MARKETPLACE_CARD";
20
+ STATISTICS_REQUEST_TYPE["SOLVING_EDU_TASK"] = "SOLVING_EDU_TASK";
21
+ STATISTICS_REQUEST_TYPE["SPELL_CORRECTOR"] = "SPELL_CORRECTOR";
22
+ })(STATISTICS_REQUEST_TYPE || (exports.STATISTICS_REQUEST_TYPE = STATISTICS_REQUEST_TYPE = {}));
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./subscription-action.enum"), exports);
18
+ __exportStar(require("./subscription-balance-field.enum"), exports);
18
19
  __exportStar(require("./subscription-feature-type.enum"), exports);
19
20
  __exportStar(require("./subscription-plan.enum"), exports);
20
21
  __exportStar(require("./subscription-status.enum"), exports);
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SUBSCRIPTION_BALANCE_FIELD = void 0;
4
+ var SUBSCRIPTION_BALANCE_FIELD;
5
+ (function (SUBSCRIPTION_BALANCE_FIELD) {
6
+ SUBSCRIPTION_BALANCE_FIELD["TOKEN_BALANCE"] = "tokenBalance";
7
+ SUBSCRIPTION_BALANCE_FIELD["CARRIED_OVER_TOKEN_BALANCE"] = "carriedOverTokenBalance";
8
+ })(SUBSCRIPTION_BALANCE_FIELD || (exports.SUBSCRIPTION_BALANCE_FIELD = SUBSCRIPTION_BALANCE_FIELD = {}));
@@ -16,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./tool-content-type.enum"), exports);
18
18
  __exportStar(require("./tool-job-status.enum"), exports);
19
- __exportStar(require("./job-request-origin.enum"), exports);
@@ -18,4 +18,3 @@ __exportStar(require("./singup-method.enum"), exports);
18
18
  __exportStar(require("./user-status"), exports);
19
19
  __exportStar(require("./user-sort-by.enum"), exports);
20
20
  __exportStar(require("./sort-order.enum"), exports);
21
- __exportStar(require("./locale.enum"), exports);
@@ -4,7 +4,7 @@ exports.UserAggregateSchema = exports.UserSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const user_to_subscription_schema_1 = require("./user-to-subscription.schema");
6
6
  const user_to_product_schema_1 = require("./user-to-product.schema");
7
- const constants_1 = require("../constants");
7
+ const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
8
8
  exports.UserSchema = zod_1.z.object({
9
9
  uuid: zod_1.z.string().uuid(),
10
10
  email: zod_1.z.string().email(),
@@ -16,7 +16,7 @@ exports.UserSchema = zod_1.z.object({
16
16
  restoreTokenHash: zod_1.z.string(),
17
17
  tokenBonusBalance: zod_1.z.number(),
18
18
  role: zod_1.z.string(),
19
- locale: zod_1.z.nativeEnum(constants_1.LOCALE),
19
+ locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
20
20
  createdAt: zod_1.z.date(),
21
21
  updatedAt: zod_1.z.date(),
22
22
  deletedAt: zod_1.z.date().nullable(),
@@ -0,0 +1,30 @@
1
+ import { PostSchema } from '../../models';
2
+ import { z } from 'zod';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace CreatePostTranslationCommand {
6
+ export const RequestSchema = PostSchema.pick({
7
+ title: true,
8
+ content: true,
9
+ author: true,
10
+ contentPreview: true,
11
+ metaTitle: true,
12
+ metaDescription: true,
13
+ }).extend({
14
+ locale: z.nativeEnum(LOCALE),
15
+ });
16
+
17
+ export type Request = z.infer<typeof RequestSchema>;
18
+
19
+ export const RequestParamSchema = z.object({
20
+ uuid: z.string().uuid(),
21
+ });
22
+
23
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
24
+
25
+ export const ResponseSchema = z.object({
26
+ data: PostSchema,
27
+ });
28
+
29
+ export type Response = z.infer<typeof ResponseSchema>;
30
+ }
@@ -4,7 +4,13 @@ import { z } from 'zod';
4
4
  export namespace CreatePostCommand {
5
5
  export const RequestSchema = PostSchema.omit({
6
6
  uuid: true,
7
+ title: true,
8
+ author: true,
7
9
  views: true,
10
+ content: true,
11
+ contentPreview: true,
12
+ metaTitle: true,
13
+ metaDescription: true,
8
14
  createdAt: true,
9
15
  updatedAt: true,
10
16
  });
@@ -1,4 +1,5 @@
1
1
  export * from './create-post.command';
2
+ export * from './create-post-translation.command';
2
3
  export * from './delete-post.command';
3
4
  export * from './find-all-posts.command';
4
5
  export * from './find-post-by-alias.command';
@@ -7,3 +8,4 @@ export * from './find-posts.command';
7
8
  export * from './get-latest-updates.command';
8
9
  export * from './get-posts-count.command';
9
10
  export * from './update-post.command';
11
+ export * from './update-post-translation.command';
@@ -0,0 +1,29 @@
1
+ import { PostSchema } from '../../models';
2
+ import { z } from 'zod';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace UpdatePostTranslationCommand {
6
+ export const RequestSchema = PostSchema.pick({
7
+ title: true,
8
+ content: true,
9
+ author: true,
10
+ contentPreview: true,
11
+ metaTitle: true,
12
+ metaDescription: true,
13
+ }).partial();
14
+
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const RequestParamSchema = z.object({
18
+ uuid: z.string().uuid(),
19
+ locale: z.nativeEnum(LOCALE),
20
+ });
21
+
22
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
23
+
24
+ export const ResponseSchema = z.object({
25
+ data: PostSchema,
26
+ });
27
+
28
+ export type Response = z.infer<typeof ResponseSchema>;
29
+ }
@@ -7,6 +7,12 @@ export namespace UpdatePostCommand {
7
7
  updatedAt: true,
8
8
  views: true,
9
9
  uuid: true,
10
+ title: true,
11
+ content: true,
12
+ author: true,
13
+ contentPreview: true,
14
+ metaTitle: true,
15
+ metaDescription: true,
10
16
  }).partial();
11
17
 
12
18
  export type Request = z.infer<typeof RequestSchema>;
@@ -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 GetUserStatisticsByMonthCommand {
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)
@@ -14,18 +18,7 @@ export namespace GetUserStatisticsByMonthCommand {
14
18
 
15
19
  export const UserStatisticsByMonthResponseSchema = z.object({
16
20
  month: z.string(),
17
- total_texts: z.number(),
18
- total_audios: z.number(),
19
- total_images: z.number(),
20
- total_videos: z.number(),
21
- total_presentations: z.number(),
22
- total_paraphrases: z.number(),
23
- writers: z.object({
24
- total_writers: z.number(),
25
- total_writer_actions: z.number(),
26
- }),
27
- total_video_edits: z.number(),
28
- total_musics: z.number(),
21
+ statistics: z.record(z.nativeEnum(STATISTICS_REQUEST_TYPE), z.number()),
29
22
  });
30
23
 
31
24
  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 GetUserStatisticsOverviewCommand {
5
6
  export const RequestSchema = z.object({
@@ -10,7 +11,10 @@ export namespace GetUserStatisticsOverviewCommand {
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
  });
15
19
 
16
20
  export type Request = z.infer<typeof RequestSchema>;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { CategorySchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace CreateCategoryTranslationCommand {
6
+ export const RequestSchema = CategorySchema.pick({
7
+ name: true,
8
+ prompt: true,
9
+ placeholder: true,
10
+ seoName: true,
11
+ }).extend({
12
+ locale: z.nativeEnum(LOCALE),
13
+ });
14
+
15
+ export type Request = z.infer<typeof RequestSchema>;
16
+
17
+ export const RequestParamSchema = z.object({
18
+ uuid: z.string().uuid(),
19
+ });
20
+
21
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
22
+
23
+ export const ResponseSchema = z.object({
24
+ data: CategorySchema,
25
+ });
26
+
27
+ export type Response = z.infer<typeof ResponseSchema>;
28
+ }
@@ -4,6 +4,10 @@ import { CategorySchema } from '../../models';
4
4
  export namespace CreateCategoryCommand {
5
5
  export const RequestSchema = CategorySchema.omit({
6
6
  uuid: true,
7
+ name: true,
8
+ prompt: true,
9
+ placeholder: true,
10
+ seoName: true,
7
11
  createdAt: true,
8
12
  updatedAt: true,
9
13
  });
@@ -1,4 +1,6 @@
1
1
  export * from './create-category.command';
2
+ export * from './create-category-translation.command';
2
3
  export * from './delete-category.command';
3
4
  export * from './find-category.command';
4
5
  export * from './update-category.command';
6
+ export * from './update-category-translation.command';
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import { CategorySchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace UpdateCategoryTranslationCommand {
6
+ export const RequestSchema = CategorySchema.pick({
7
+ name: true,
8
+ prompt: true,
9
+ placeholder: true,
10
+ seoName: 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
+ locale: z.nativeEnum(LOCALE),
18
+ });
19
+
20
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
21
+
22
+ export const ResponseSchema = z.object({
23
+ data: CategorySchema,
24
+ });
25
+
26
+ export type Response = z.infer<typeof ResponseSchema>;
27
+ }
@@ -6,6 +6,10 @@ export namespace UpdateCategoryCommand {
6
6
  createdAt: true,
7
7
  updatedAt: true,
8
8
  uuid: true,
9
+ name: true,
10
+ prompt: true,
11
+ placeholder: true,
12
+ seoName: true,
9
13
  }).partial();
10
14
 
11
15
  export type Request = z.infer<typeof RequestSchema>;
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { CourseSchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace CreateCourseTranslationCommand {
6
+ export const RequestSchema = CourseSchema.pick({
7
+ title: true,
8
+ subtitle: true,
9
+ prerequisites: true,
10
+ description: true,
11
+ skills: true,
12
+ }).extend({
13
+ locale: z.nativeEnum(LOCALE),
14
+ });
15
+
16
+ export type Request = z.infer<typeof RequestSchema>;
17
+
18
+ export const RequestParamSchema = z.object({
19
+ uuid: z.string().uuid(),
20
+ });
21
+
22
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
23
+
24
+ export const ResponseSchema = z.object({
25
+ data: CourseSchema,
26
+ });
27
+
28
+ export type Response = z.infer<typeof ResponseSchema>;
29
+ }
@@ -4,6 +4,11 @@ import { CourseSchema } from '../../models';
4
4
  export namespace CreateCourseCommand {
5
5
  export const RequestSchema = CourseSchema.omit({
6
6
  uuid: true,
7
+ title: true,
8
+ subtitle: true,
9
+ prerequisites: true,
10
+ description: true,
11
+ skills: true,
7
12
  createdAt: true,
8
13
  updatedAt: true,
9
14
  });
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { LessonSchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace CreateLessonTranslationCommand {
6
+ export const RequestSchema = LessonSchema.pick({
7
+ title: true,
8
+ }).extend({
9
+ locale: z.nativeEnum(LOCALE),
10
+ });
11
+
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const RequestParamSchema = z.object({
15
+ uuid: z.string().uuid(),
16
+ });
17
+
18
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: LessonSchema,
22
+ });
23
+
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { SectionSchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace CreateSectionTranslationCommand {
6
+ export const RequestSchema = SectionSchema.pick({
7
+ title: true,
8
+ }).extend({
9
+ locale: z.nativeEnum(LOCALE),
10
+ });
11
+
12
+ export type Request = z.infer<typeof RequestSchema>;
13
+
14
+ export const RequestParamSchema = z.object({
15
+ uuid: z.string().uuid(),
16
+ });
17
+
18
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
19
+
20
+ export const ResponseSchema = z.object({
21
+ data: SectionSchema,
22
+ });
23
+
24
+ export type Response = z.infer<typeof ResponseSchema>;
25
+ }
@@ -1,3 +1,9 @@
1
1
  export * from './create-course.command';
2
+ export * from './create-course-translation.command';
3
+ export * from './create-lesson-translation.command';
4
+ export * from './create-section-translation.command';
2
5
  export * from './find-course-by-alias.command';
3
6
  export * from './find-course-by-uuid.command';
7
+ export * from './update-course-translation.command';
8
+ export * from './update-lesson-translation.command';
9
+ export * from './update-section-translation.command';
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { CourseSchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace UpdateCourseTranslationCommand {
6
+ export const RequestSchema = CourseSchema.pick({
7
+ title: true,
8
+ subtitle: true,
9
+ prerequisites: true,
10
+ description: true,
11
+ skills: true,
12
+ }).partial();
13
+
14
+ export type Request = z.infer<typeof RequestSchema>;
15
+
16
+ export const RequestParamSchema = z.object({
17
+ uuid: z.string().uuid(),
18
+ locale: z.nativeEnum(LOCALE),
19
+ });
20
+
21
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
22
+
23
+ export const ResponseSchema = z.object({
24
+ data: CourseSchema,
25
+ });
26
+
27
+ export type Response = z.infer<typeof ResponseSchema>;
28
+ }
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { LessonSchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace UpdateLessonTranslationCommand {
6
+ export const RequestSchema = LessonSchema.pick({
7
+ title: 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
+ locale: z.nativeEnum(LOCALE),
15
+ });
16
+
17
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: LessonSchema,
21
+ });
22
+
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { SectionSchema } from '../../models';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace UpdateSectionTranslationCommand {
6
+ export const RequestSchema = SectionSchema.pick({
7
+ title: 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
+ locale: z.nativeEnum(LOCALE),
15
+ });
16
+
17
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
18
+
19
+ export const ResponseSchema = z.object({
20
+ data: SectionSchema,
21
+ });
22
+
23
+ export type Response = z.infer<typeof ResponseSchema>;
24
+ }
@@ -0,0 +1,29 @@
1
+ import { PageSchema } from '../../models';
2
+ import { z } from 'zod';
3
+ import { LOCALE } from '@purpleschool/rugpt-lib-common';
4
+
5
+ export namespace CreatePageTranslationCommand {
6
+ export const RequestSchema = PageSchema.pick({
7
+ metaTitle: true,
8
+ metaDescription: true,
9
+ title: true,
10
+ subTitle: true,
11
+ seoTextMd: true,
12
+ }).extend({
13
+ locale: z.nativeEnum(LOCALE),
14
+ });
15
+
16
+ export type Request = z.infer<typeof RequestSchema>;
17
+
18
+ export const RequestParamSchema = z.object({
19
+ uuid: z.string().uuid(),
20
+ });
21
+
22
+ export type RequestParam = z.infer<typeof RequestParamSchema>;
23
+
24
+ export const ResponseSchema = z.object({
25
+ data: PageSchema,
26
+ });
27
+
28
+ export type Response = z.infer<typeof ResponseSchema>;
29
+ }
@@ -7,6 +7,11 @@ export namespace CreatePageCommand {
7
7
  uuid: true,
8
8
  createdAt: true,
9
9
  updatedAt: true,
10
+ metaTitle: true,
11
+ metaDescription: true,
12
+ title: true,
13
+ subTitle: true,
14
+ seoTextMd: true,
10
15
  })
11
16
  .refine(
12
17
  (data) => {
@@ -1,6 +1,8 @@
1
1
  export * from './create-page.command';
2
+ export * from './create-page-translation.command';
2
3
  export * from './delete-page.command';
3
4
  export * from './find-page-by-alias.command';
4
5
  export * from './find-pages-by-criteria.command';
5
6
  export * from './find-page.command';
6
7
  export * from './update-page.command';
8
+ export * from './update-page-translation.command';