@purpleschool/gptbot 0.7.31 → 0.7.33

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 (103) hide show
  1. package/api/controllers/http/image-editor.ts +14 -0
  2. package/api/controllers/http/index.ts +2 -0
  3. package/api/controllers/http/writer.ts +18 -0
  4. package/build/api/controllers/http/image-editor.js +16 -0
  5. package/build/api/controllers/http/index.js +2 -0
  6. package/build/api/controllers/http/writer.js +20 -0
  7. package/build/commands/tools/image-editor/delete-all-image-editor-jobs.command.js +8 -0
  8. package/build/commands/tools/image-editor/delete-image-editor-job-by-uuid.command.js +11 -0
  9. package/build/commands/tools/image-editor/find-image-editor-job-by-uuid.command.js +14 -0
  10. package/build/commands/tools/image-editor/find-image-editor-jobs.command.js +18 -0
  11. package/build/commands/tools/image-editor/get-image-editor-tool-config.command.js +11 -0
  12. package/build/commands/tools/image-editor/image-editor.command.js +19 -0
  13. package/build/commands/tools/image-editor/index.js +25 -0
  14. package/build/commands/tools/image-editor/retry-image-editor-job.command.js +14 -0
  15. package/build/commands/tools/image-editor/set-reaction-to-image-editor-job.command.js +18 -0
  16. package/build/commands/tools/image-editor/update-image-editor-job-title.command.js +17 -0
  17. package/build/commands/tools/index.js +2 -0
  18. package/build/commands/tools/writer/create-writer-document.command.js +16 -0
  19. package/build/commands/tools/writer/delete-all-writer-documents.command.js +8 -0
  20. package/build/commands/tools/writer/delete-writer-document-by-uuid.command.js +11 -0
  21. package/build/commands/tools/writer/find-writer-document-by-uuid.command.js +14 -0
  22. package/build/commands/tools/writer/find-writer-documents.command.js +18 -0
  23. package/build/commands/tools/writer/generate-writer-document-contents.command.js +14 -0
  24. package/build/commands/tools/writer/get-writer-tool-config.command.js +11 -0
  25. package/build/commands/tools/writer/index.js +29 -0
  26. package/build/commands/tools/writer/update-writer-document-contents.command.js +18 -0
  27. package/build/commands/tools/writer/update-writer-document-outline.command.js +17 -0
  28. package/build/commands/tools/writer/writer-extend-text.command.js +18 -0
  29. package/build/commands/tools/writer/writer-fix-errors.command.js +18 -0
  30. package/build/commands/tools/writer/writer-paraphrase.command.js +18 -0
  31. package/build/commands/tools/writer/writer-shorten-text.command.js +18 -0
  32. package/build/constants/errors/errors.js +124 -15
  33. package/build/constants/index.js +2 -0
  34. package/build/constants/tool-image-editor/enums/image-editor-model-type.enum.js +7 -0
  35. package/build/constants/tool-image-editor/enums/image-editor-strategy.enum.js +8 -0
  36. package/build/constants/tool-image-editor/enums/index.js +18 -0
  37. package/build/constants/tool-image-editor/index.js +17 -0
  38. package/build/constants/writer/enums/index.js +20 -0
  39. package/build/constants/writer/enums/writer-ai-action-pricing-type.enum.js +8 -0
  40. package/build/constants/writer/enums/writer-ai-action-type.enum.js +11 -0
  41. package/build/constants/writer/enums/writer-document-section-type.enum.js +9 -0
  42. package/build/constants/writer/enums/writer-document-stage.enum.js +14 -0
  43. package/build/constants/writer/index.js +17 -0
  44. package/build/models/tools/image-editor/image-editor-config.schema.js +32 -0
  45. package/build/models/tools/image-editor/image-editor-job.schema.js +17 -0
  46. package/build/models/tools/image-editor/image-editor-model.schema.js +25 -0
  47. package/build/models/tools/image-editor/index.js +19 -0
  48. package/build/models/tools/index.js +2 -0
  49. package/build/models/tools/writer/index.js +21 -0
  50. package/build/models/tools/writer/writer-ai-action.schema.js +26 -0
  51. package/build/models/tools/writer/writer-config.schema.js +13 -0
  52. package/build/models/tools/writer/writer-document-outline.schema.js +21 -0
  53. package/build/models/tools/writer/writer-document-type.schema.js +13 -0
  54. package/build/models/tools/writer/writer-document.schema.js +21 -0
  55. package/commands/tools/image-editor/delete-all-image-editor-jobs.command.ts +6 -0
  56. package/commands/tools/image-editor/delete-image-editor-job-by-uuid.command.ts +11 -0
  57. package/commands/tools/image-editor/find-image-editor-job-by-uuid.command.ts +16 -0
  58. package/commands/tools/image-editor/find-image-editor-jobs.command.ts +18 -0
  59. package/commands/tools/image-editor/get-image-editor-tool-config.command.ts +10 -0
  60. package/commands/tools/image-editor/image-editor.command.ts +20 -0
  61. package/commands/tools/image-editor/index.ts +9 -0
  62. package/commands/tools/image-editor/retry-image-editor-job.command.ts +14 -0
  63. package/commands/tools/image-editor/set-reaction-to-image-editor-job.command.ts +20 -0
  64. package/commands/tools/image-editor/update-image-editor-job-title.command.ts +19 -0
  65. package/commands/tools/index.ts +2 -0
  66. package/commands/tools/writer/create-writer-document.command.ts +16 -0
  67. package/commands/tools/writer/delete-all-writer-documents.command.ts +6 -0
  68. package/commands/tools/writer/delete-writer-document-by-uuid.command.ts +11 -0
  69. package/commands/tools/writer/find-writer-document-by-uuid.command.ts +14 -0
  70. package/commands/tools/writer/find-writer-documents.command.ts +18 -0
  71. package/commands/tools/writer/generate-writer-document-contents.command.ts +14 -0
  72. package/commands/tools/writer/get-writer-tool-config.command.ts +10 -0
  73. package/commands/tools/writer/index.ts +13 -0
  74. package/commands/tools/writer/update-writer-document-contents.command.ts +20 -0
  75. package/commands/tools/writer/update-writer-document-outline.command.ts +19 -0
  76. package/commands/tools/writer/writer-extend-text.command.ts +20 -0
  77. package/commands/tools/writer/writer-fix-errors.command.ts +20 -0
  78. package/commands/tools/writer/writer-paraphrase.command.ts +20 -0
  79. package/commands/tools/writer/writer-shorten-text.command.ts +20 -0
  80. package/constants/errors/errors.ts +125 -15
  81. package/constants/index.ts +2 -0
  82. package/constants/tool-image-editor/enums/image-editor-model-type.enum.ts +3 -0
  83. package/constants/tool-image-editor/enums/image-editor-strategy.enum.ts +4 -0
  84. package/constants/tool-image-editor/enums/index.ts +2 -0
  85. package/constants/tool-image-editor/index.ts +1 -0
  86. package/constants/writer/enums/index.ts +4 -0
  87. package/constants/writer/enums/writer-ai-action-pricing-type.enum.ts +4 -0
  88. package/constants/writer/enums/writer-ai-action-type.enum.ts +7 -0
  89. package/constants/writer/enums/writer-document-section-type.enum.ts +5 -0
  90. package/constants/writer/enums/writer-document-stage.enum.ts +13 -0
  91. package/constants/writer/index.ts +1 -0
  92. package/models/tools/image-editor/image-editor-config.schema.ts +32 -0
  93. package/models/tools/image-editor/image-editor-job.schema.ts +20 -0
  94. package/models/tools/image-editor/image-editor-model.schema.ts +28 -0
  95. package/models/tools/image-editor/index.ts +3 -0
  96. package/models/tools/index.ts +2 -0
  97. package/models/tools/writer/index.ts +5 -0
  98. package/models/tools/writer/writer-ai-action.schema.ts +27 -0
  99. package/models/tools/writer/writer-config.schema.ts +13 -0
  100. package/models/tools/writer/writer-document-outline.schema.ts +28 -0
  101. package/models/tools/writer/writer-document-type.schema.ts +12 -0
  102. package/models/tools/writer/writer-document.schema.ts +21 -0
  103. package/package.json +1 -1
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { ToolJobSchema } from '../../../models';
3
+
4
+ export namespace ImageEditorCommand {
5
+ export const RequestSchema = z.object({
6
+ modelId: z.string().uuid(),
7
+ prompt: z.string(),
8
+ params: z.object({
9
+ imageUrls: z.array(z.string()),
10
+ systemPromptId: z.string().optional(),
11
+ }),
12
+ });
13
+ export type Request = z.infer<typeof RequestSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: ToolJobSchema,
17
+ });
18
+
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,9 @@
1
+ export * from './delete-image-editor-job-by-uuid.command';
2
+ export * from './delete-all-image-editor-jobs.command';
3
+ export * from './retry-image-editor-job.command';
4
+ export * from './set-reaction-to-image-editor-job.command';
5
+ export * from './image-editor.command';
6
+ export * from './update-image-editor-job-title.command';
7
+ export * from './find-image-editor-job-by-uuid.command';
8
+ export * from './find-image-editor-jobs.command';
9
+ export * from './get-image-editor-tool-config.command';
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { ImageEditorJobSchema } from '../../../models';
3
+
4
+ export namespace RetryImageEditorJobCommand {
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: ImageEditorJobSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { ImageEditorJobSchema } from '../../../models';
3
+ import { USER_REACTION } from '../../../constants';
4
+
5
+ export namespace SetReactionToImageEditorJobCommand {
6
+ export const RequestSchema = z.object({
7
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
8
+ });
9
+ export type Request = z.infer<typeof RequestSchema>;
10
+
11
+ export const RequestParamsSchema = z.object({
12
+ uuid: z.string().uuid(),
13
+ });
14
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
15
+
16
+ export const ResponseSchema = z.object({
17
+ data: ImageEditorJobSchema,
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { ImageEditorJobSchema } from '../../../models';
3
+
4
+ export namespace UpdateImageEditorJobTitleCommand {
5
+ export const RequestSchema = z.object({
6
+ title: z.string().min(1).max(40).trim(),
7
+ });
8
+ export type Request = z.infer<typeof RequestSchema>;
9
+
10
+ export const RequestParamsSchema = z.object({
11
+ uuid: z.string().uuid(),
12
+ });
13
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: ImageEditorJobSchema,
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -4,3 +4,5 @@ export * from './stt';
4
4
  export * from './tool';
5
5
  export * from './tts';
6
6
  export * from './video';
7
+ export * from './writer';
8
+ export * from './image-editor';
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ import { WriterDocumentSchema } from '../../../models';
3
+
4
+ export namespace CreateWriterDocumentCommand {
5
+ export const RequestSchema = z.object({
6
+ topic: z.string(),
7
+ numPages: z.number(),
8
+ documentTypeId: z.string(),
9
+ });
10
+ export type Request = z.infer<typeof RequestSchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: WriterDocumentSchema,
14
+ });
15
+ export type Response = z.infer<typeof ResponseSchema>;
16
+ }
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteAllWriterDocumentsCommand {
4
+ export const ResponseSchema = z.void();
5
+ export type Response = z.infer<typeof ResponseSchema>;
6
+ }
@@ -0,0 +1,11 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace DeleteWriterDocumentByUUIDCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const ResponseSchema = z.void();
10
+ export type Response = z.infer<typeof ResponseSchema>;
11
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { WriterDocumentSchema } from '../../../models';
3
+
4
+ export namespace FindWriterDocumentByUUIDCommand {
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: WriterDocumentSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ import { WriterDocumentSchema } from '../../../models';
3
+
4
+ export namespace FindWriterDocumentsCommand {
5
+ export const RequestQuerySchema = z.object({
6
+ limit: z.coerce.number().min(1).optional(),
7
+ offset: z.coerce.number().min(0).default(0).optional(),
8
+ title: z.string().optional(),
9
+ });
10
+ export type RequestQuery = z.infer<typeof RequestQuerySchema>;
11
+
12
+ export const ResponseSchema = z.object({
13
+ data: z.array(WriterDocumentSchema),
14
+ totalPages: z.number(),
15
+ page: z.number(),
16
+ });
17
+ export type Response = z.infer<typeof ResponseSchema>;
18
+ }
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { WriterDocumentSchema } from '../../../models';
3
+
4
+ export namespace GenerateWriterDocumentContentsCommand {
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: WriterDocumentSchema,
12
+ });
13
+ export type Response = z.infer<typeof ResponseSchema>;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { z } from 'zod';
2
+ import { WriterConfigSchema } from '../../../models';
3
+
4
+ export namespace GetWriterToolConfigCommand {
5
+ export const ResponseSchema = z.object({
6
+ data: WriterConfigSchema,
7
+ });
8
+
9
+ export type Response = z.infer<typeof ResponseSchema>;
10
+ }
@@ -0,0 +1,13 @@
1
+ export * from './get-writer-tool-config.command';
2
+ export * from './create-writer-document.command';
3
+ export * from './find-writer-document-by-uuid.command';
4
+ export * from './find-writer-documents.command';
5
+ export * from './generate-writer-document-contents.command';
6
+ export * from './update-writer-document-outline.command';
7
+ export * from './update-writer-document-contents.command';
8
+ export * from './delete-writer-document-by-uuid.command';
9
+ export * from './delete-all-writer-documents.command';
10
+ export * from './writer-paraphrase.command';
11
+ export * from './writer-extend-text.command';
12
+ export * from './writer-shorten-text.command';
13
+ export * from './writer-fix-errors.command';
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace UpdateWriterDocumentContentsCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const RequestBodySchema = z.object({
10
+ contents: z.string(),
11
+ });
12
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.object({
16
+ success: z.boolean(),
17
+ }),
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import { WriterDocumentOutlineSchema, WriterDocumentOutlineSectionSchema } from '../../../models';
3
+
4
+ export namespace UpdateWriterDocumentOutlineCommand {
5
+ export const RequestBodySchema = z.object({
6
+ data: WriterDocumentOutlineSchema,
7
+ });
8
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
9
+
10
+ export const RequestParamsSchema = z.object({
11
+ uuid: z.string().uuid(),
12
+ });
13
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
14
+
15
+ export const ResponseSchema = z.object({
16
+ data: z.array(WriterDocumentOutlineSectionSchema),
17
+ });
18
+ export type Response = z.infer<typeof ResponseSchema>;
19
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace WriterExtendTextCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const RequestBodySchema = z.object({
10
+ selectionText: z.string(),
11
+ });
12
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.object({
16
+ output: z.string(),
17
+ }),
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace WriterFixErrorsCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const RequestBodySchema = z.object({
10
+ selectionText: z.string(),
11
+ });
12
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.object({
16
+ output: z.string(),
17
+ }),
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace WriterParaphraseCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const RequestBodySchema = z.object({
10
+ selectionText: z.string(),
11
+ });
12
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.object({
16
+ output: z.string(),
17
+ }),
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace WriterShortenTextCommand {
4
+ export const RequestParamsSchema = z.object({
5
+ uuid: z.string().uuid(),
6
+ });
7
+ export type RequestParams = z.infer<typeof RequestParamsSchema>;
8
+
9
+ export const RequestBodySchema = z.object({
10
+ selectionText: z.string(),
11
+ });
12
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
13
+
14
+ export const ResponseSchema = z.object({
15
+ data: z.object({
16
+ output: z.string(),
17
+ }),
18
+ });
19
+ export type Response = z.infer<typeof ResponseSchema>;
20
+ }
@@ -1664,64 +1664,174 @@ export const ERRORS = {
1664
1664
  message: 'Произошла ошибка при обновлении презентации',
1665
1665
  httpCode: 500,
1666
1666
  },
1667
- MESSAGE_COUNT_ERROR: {
1667
+ IMAGE_EDITOR_CONFIG_ERROR: {
1668
1668
  code: 'A352',
1669
+ message:
1670
+ 'Произошла ошибка при получении конфигурации инструмента для редактирования картинки',
1671
+ httpCode: 500,
1672
+ },
1673
+ IMAGE_EDITOR_SEND_REQUEST_ERROR: {
1674
+ code: 'A353',
1675
+ message: 'Произошла ошибка при отправке запроса на редактирование картинки',
1676
+ httpCode: 500,
1677
+ },
1678
+ IMAGE_EDITOR_MODEL_NOT_FOUND: {
1679
+ code: 'A354',
1680
+ message: 'Не удалось найти указанную модель для редактирования картинки',
1681
+ httpCode: 400,
1682
+ },
1683
+ IMAGE_EDITOR_MAX_SYMBOLS_EXCEEDED: {
1684
+ code: 'A355',
1685
+ message: 'Превышена максимальная количество символов',
1686
+ },
1687
+ IMAGE_EDITOR_SET_REACTION_ERROR: {
1688
+ code: 'A356',
1689
+ message: 'Произошла ошибка при установке оценке сообщения',
1690
+ httpCode: 500,
1691
+ },
1692
+ IMAGE_EDITOR_UPDATE_TITLE_ERROR: {
1693
+ code: 'A357',
1694
+ message: 'Произошла ошибка при обновлении названия чата',
1695
+ httpCode: 500,
1696
+ },
1697
+ IMAGE_EDITOR_JOB_DELETE_ERROR: {
1698
+ code: 'A358',
1699
+ message: 'Произошла ошибка при удалении сообщения',
1700
+ httpCode: 500,
1701
+ },
1702
+ IMAGE_EDITOR_RETRY_REQUEST_ERROR: {
1703
+ code: 'A359',
1704
+ message: 'Произошла ошибка при повторном запросе на редактирование картинки',
1705
+ httpCode: 500,
1706
+ },
1707
+ IMAGE_EDITOR_MODEL_NOT_AVAILABLE: {
1708
+ code: 'A360',
1709
+ message: 'Данная модель для редактирования картинки недоступна',
1710
+ httpCode: 401,
1711
+ },
1712
+ MESSAGE_COUNT_ERROR: {
1713
+ code: 'A361',
1669
1714
  message: 'Произошла ошибка при подсчёте количества сообщений для юзера',
1670
1715
  httpCode: 500,
1671
1716
  },
1672
1717
  DAILY_REWARD_COLLECT_ERROR: {
1673
- code: 'A353',
1718
+ code: 'A362',
1674
1719
  message: 'Ошибка при получении ежедневной награды',
1675
1720
  httpCode: 500,
1676
1721
  },
1677
1722
  DAILY_STREAK_CREATE_ERROR: {
1678
- code: 'A354',
1723
+ code: 'A363',
1679
1724
  message: 'Ошибка при создании ежедневного стрика',
1680
1725
  httpCode: 500,
1681
1726
  },
1682
1727
  DAILY_STREAK_FIND_ERROR: {
1683
- code: 'A355',
1728
+ code: 'A364',
1684
1729
  message: 'Ошибка при поиске ежедневного стрика',
1685
1730
  httpCode: 500,
1686
1731
  },
1687
1732
  DAILY_STREAK_PROMOCODE_ALREADY_EXISTS_ERROR: {
1688
- code: 'A356',
1733
+ code: 'A365',
1689
1734
  message: 'Промокод для ежедневного стрика уже существует',
1690
1735
  httpCode: 409,
1691
1736
  },
1692
1737
  DAILY_REWARD_NOT_READY_ERROR: {
1693
- code: 'A357',
1738
+ code: 'A366',
1694
1739
  message: 'Запрашиваемая награда ещё недоступна для получения',
1695
1740
  httpCode: 429,
1696
1741
  },
1697
1742
  DAILY_REWARD_ALREADY_COLLECTED_ERROR: {
1698
- code: 'A358',
1743
+ code: 'A367',
1699
1744
  message: 'Запрашиваемая награда уже получена',
1700
1745
  httpCode: 429,
1701
1746
  },
1702
1747
  DAILY_STREAK_UPDATE_ERROR: {
1703
- code: 'A359',
1748
+ code: 'A368',
1704
1749
  message: 'Ошибка при обновлении ежедневного стрика',
1705
1750
  httpCode: 500,
1706
1751
  },
1752
+ WRITER_CONFIG_ERROR: {
1753
+ code: 'A369',
1754
+ message: 'Произошла ошибка при получении конфигурации Writer',
1755
+ httpCode: 500,
1756
+ },
1757
+ WRITER_CREATE_DOCUMENT_ERROR: {
1758
+ code: 'A370',
1759
+ message: 'Произошла ошибка при создании документа',
1760
+ httpCode: 500,
1761
+ },
1762
+ WRITER_DOCUMENT_FIND_ERROR: {
1763
+ code: 'A371',
1764
+ message: 'Произошла ошибка при поиске документа',
1765
+ httpCode: 500,
1766
+ },
1767
+ WRITER_DOCUMENTS_FIND_ERROR: {
1768
+ code: 'A372',
1769
+ message: 'Произошла ошибка при поиске документов',
1770
+ httpCode: 500,
1771
+ },
1772
+ WRITER_DELETE_DOCUMENT_ERROR: {
1773
+ code: 'A373',
1774
+ message: 'Произошла ошибка при удалении документа',
1775
+ httpCode: 500,
1776
+ },
1777
+ WRITER_DELETE_ALL_DOCUMENTS_ERROR: {
1778
+ code: 'A374',
1779
+ message: 'Произошла ошибка при удалении всех документов пользователя',
1780
+ httpCode: 500,
1781
+ },
1782
+ WRITER_UPDATE_DOCUMENT_OUTLINE_ERROR: {
1783
+ code: 'A375',
1784
+ message: 'Произошла ошибка при обновлении структуры документа',
1785
+ httpCode: 500,
1786
+ },
1787
+ WRITER_GENERATE_DOCUMENT_CONTENTS_ERROR: {
1788
+ code: 'A376',
1789
+ message: 'Произошла ошибка при генерации содержимого документа',
1790
+ httpCode: 500,
1791
+ },
1707
1792
  ACCOUNT_DELETE_ERROR: {
1708
- code: 'A360',
1793
+ code: 'A377',
1709
1794
  message: 'Аккаунт не был удалён',
1710
1795
  httpCode: 500,
1711
1796
  },
1712
1797
  ACCOUNT_DELETED: {
1713
- code: 'A361',
1798
+ code: 'A378',
1714
1799
  message: 'Операция невозможна, аккаунт был удалён',
1715
1800
  httpCode: 400,
1716
1801
  },
1802
+ TOOL_NOT_FOUND_ERROR: {
1803
+ code: 'A379',
1804
+ message: 'Инструмент не найден',
1805
+ httpCode: 404,
1806
+ },
1717
1807
  TELEGRAM_PROFILE_DELETE_ERROR: {
1718
- code: 'A362',
1808
+ code: 'A380',
1719
1809
  message: 'Произошла ошибка при удалении Telegram профиля',
1720
1810
  httpCode: 500,
1721
1811
  },
1722
- TOOL_NOT_FOUND_ERROR: {
1723
- code: 'A363',
1724
- message: 'Инструмент не найден',
1725
- httpCode: 404,
1812
+ WRITER_PARAPHRASE_ERROR: {
1813
+ code: 'A381',
1814
+ message: 'Произошла ошибка при перефразировании текста',
1815
+ httpCode: 500,
1816
+ },
1817
+ WRITER_EXTEND_TEXT_ERROR: {
1818
+ code: 'A382',
1819
+ message: 'Произошла ошибка при расширении текста',
1820
+ httpCode: 500,
1821
+ },
1822
+ WRITER_SHORTEN_TEXT_ERROR: {
1823
+ code: 'A383',
1824
+ message: 'Произошла ошибка при сокращении текста',
1825
+ httpCode: 500,
1826
+ },
1827
+ WRITER_FIX_ERRORS_ERROR: {
1828
+ code: 'A384',
1829
+ message: 'Произошла ошибка при исправлении ошибок в тексте',
1830
+ httpCode: 500,
1831
+ },
1832
+ WRITER_UPDATE_DOCUMENT_CONTENTS_ERROR: {
1833
+ code: 'A385',
1834
+ message: 'Произошла ошибка при обновлении содержимого документа',
1835
+ httpCode: 500,
1726
1836
  },
1727
1837
  };
@@ -31,5 +31,7 @@ export * from './promocode';
31
31
  export * from './ui-notification';
32
32
  export * from './review';
33
33
  export * from './tool-video';
34
+ export * from './writer';
35
+ export * from './tool-image-editor';
34
36
  export * from './feedback';
35
37
  export * from './daily-streak';
@@ -0,0 +1,3 @@
1
+ export enum IMAGE_EDITOR_MODEL_TYPE {
2
+ NANO_BANANA_EDIT = 'NANO_BANANA_EDIT',
3
+ }
@@ -0,0 +1,4 @@
1
+ export enum IMAGE_EDIING_STRATEGY {
2
+ NANO_BANANA_POLLING = 'NANO_BANANA_POLLING',
3
+ NANO_BANANA_CALLBACK = 'NANO_BANANA_CALLBACK',
4
+ }
@@ -0,0 +1,2 @@
1
+ export * from './image-editor-model-type.enum';
2
+ export * from './image-editor-strategy.enum';
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -0,0 +1,4 @@
1
+ export * from './writer-document-section-type.enum';
2
+ export * from './writer-document-stage.enum';
3
+ export * from './writer-ai-action-pricing-type.enum';
4
+ export * from './writer-ai-action-type.enum';
@@ -0,0 +1,4 @@
1
+ export enum WRITER_AI_ACTION_PRICING_TYPE {
2
+ PER_CHARACTER = 'PER_CHARACTER',
3
+ FLAT = 'FLAT',
4
+ }
@@ -0,0 +1,7 @@
1
+ export enum WRITER_AI_ACTION_TYPE {
2
+ PARAPHRASE = 'PARAPHRASE',
3
+ EXTEND_TEXT = 'EXTEND_TEXT',
4
+ SHORTEN_TEXT = 'SHORTEN_TEXT',
5
+ GENERATE_TEXT = 'GENERATE_TEXT',
6
+ FIX_ERRORS = 'FIX_ERRORS',
7
+ }
@@ -0,0 +1,5 @@
1
+ export enum WRITER_DOCUMENT_SECTION_TYPE {
2
+ INTRODUCTION = 'introduction',
3
+ CONCLUSION = 'conclusion',
4
+ SECTION = 'section',
5
+ }
@@ -0,0 +1,13 @@
1
+ export enum WRITER_DOCUMENT_STAGE {
2
+ CREATED = 'CREATED',
3
+
4
+ GENERATING_OUTLINE = 'GENERATING_OUTLINE',
5
+ OUTLINE_GENERATED = 'OUTLINE_GENERATED',
6
+ OUTLINE_GENERATION_FAILED = 'OUTLINE_GENERATION_FAILED',
7
+
8
+ GENERATING_CONTENT = 'GENERATING_CONTENT',
9
+ CONTENT_GENERATED = 'CONTENT_GENERATED',
10
+ CONTENT_GENERATION_FAILED = 'CONTENT_GENERATION_FAILED',
11
+
12
+ DELETED = 'DELETED',
13
+ }
@@ -0,0 +1 @@
1
+ export * from './enums';
@@ -0,0 +1,32 @@
1
+ import { z } from 'zod';
2
+ import { ImageEditorModelSchema } from './image-editor-model.schema';
3
+ import { IconVariantsSchema } from '../../icon-variants.schema';
4
+
5
+ export const SystemPromptSchema = z.object({
6
+ uuid: z.string(),
7
+ title: z.string(),
8
+ description: z.string(),
9
+ prompt: z.string(),
10
+ allowUserPrompt: z.boolean(),
11
+ groupId: z.string().uuid(),
12
+ preview: z
13
+ .object({
14
+ before: z.string(),
15
+ after: z.string(),
16
+ })
17
+ .optional()
18
+ .nullable(),
19
+ });
20
+
21
+ export const PromptGroupSchema = z.object({
22
+ uuid: z.string(),
23
+ title: z.string(),
24
+ icons: IconVariantsSchema,
25
+ prompts: z.array(SystemPromptSchema),
26
+ order: z.number(),
27
+ });
28
+
29
+ export const ImageEditorConfigSchema = z.object({
30
+ models: z.array(ImageEditorModelSchema),
31
+ promptGroups: z.array(SystemPromptSchema),
32
+ });
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ import { USER_REACTION } from '../../../constants';
3
+
4
+ export const ImageEditorJobParamsSchema = z.object({
5
+ imageUrls: z.array(z.string()).optional(),
6
+ systemPromptId: z.string().optional(),
7
+ });
8
+
9
+ export type ImageEditorJobParams = z.infer<typeof ImageEditorJobParamsSchema>;
10
+
11
+ export const ImageEditorJobSchema = z.object({
12
+ title: z.string(),
13
+ prompt: z.string(),
14
+ reaction: z.nativeEnum(USER_REACTION).nullable(),
15
+ imageUrls: z.array(z.string()).nullable(),
16
+ params: ImageEditorJobParamsSchema,
17
+ modelId: z.string(),
18
+ });
19
+
20
+ export type ImageEditorJob = z.infer<typeof ImageEditorJobSchema>;