@purpleschool/gptbot 0.7.47 → 0.7.49

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 (97) hide show
  1. package/api/controllers/http/index.ts +1 -0
  2. package/api/controllers/http/writer.ts +20 -0
  3. package/build/api/controllers/http/index.js +1 -0
  4. package/build/api/controllers/http/writer.js +22 -0
  5. package/build/commands/chat/check-limit.command.js +4 -0
  6. package/build/commands/chat/create-chat.command.js +1 -3
  7. package/build/commands/chat/find-chat-by-uuid.command.js +1 -1
  8. package/build/commands/chat/find-chats.command.js +1 -3
  9. package/build/commands/chat/get-last-active-chat-command.js +1 -1
  10. package/build/commands/folder/find-folder-by-uuid-with-chats.command.js +1 -3
  11. package/build/commands/tools/index.js +1 -0
  12. package/build/commands/tools/writer/create-writer-document.command.js +16 -0
  13. package/build/commands/tools/writer/delete-all-writer-documents.command.js +8 -0
  14. package/build/commands/tools/writer/delete-writer-document-by-uuid.command.js +11 -0
  15. package/build/commands/tools/writer/export-writer-document-as-docx.command.js +15 -0
  16. package/build/commands/tools/writer/find-writer-document-by-uuid.command.js +14 -0
  17. package/build/commands/tools/writer/find-writer-documents.command.js +18 -0
  18. package/build/commands/tools/writer/generate-writer-document-contents.command.js +14 -0
  19. package/build/commands/tools/writer/get-writer-tool-config.command.js +11 -0
  20. package/build/commands/tools/writer/index.js +31 -0
  21. package/build/commands/tools/writer/update-writer-document-contents.command.js +18 -0
  22. package/build/commands/tools/writer/update-writer-document-outline.command.js +17 -0
  23. package/build/commands/tools/writer/writer-extend-text.command.js +18 -0
  24. package/build/commands/tools/writer/writer-fix-errors.command.js +18 -0
  25. package/build/commands/tools/writer/writer-generate-text.command.js +21 -0
  26. package/build/commands/tools/writer/writer-paraphrase.command.js +18 -0
  27. package/build/commands/tools/writer/writer-shorten-text.command.js +18 -0
  28. package/build/constants/errors/errors.js +115 -30
  29. package/build/constants/index.js +1 -0
  30. package/build/constants/writer/enums/index.js +20 -0
  31. package/build/constants/writer/enums/writer-ai-action-pricing-type.enum.js +8 -0
  32. package/build/constants/writer/enums/writer-ai-action-type.enum.js +11 -0
  33. package/build/constants/writer/enums/writer-document-section-type.enum.js +9 -0
  34. package/build/constants/writer/enums/writer-document-stage.enum.js +14 -0
  35. package/build/constants/writer/index.js +17 -0
  36. package/build/helpers/index.js +1 -0
  37. package/build/helpers/writer/calculate-page-count.util.js +37 -0
  38. package/build/helpers/writer/calculate-writer-ai-action-price.util.js +16 -0
  39. package/build/helpers/writer/calculate-writer-content-generation-price.util.js +6 -0
  40. package/build/helpers/writer/index.js +19 -0
  41. package/build/models/chat-with-messages.schema.js +9 -0
  42. package/build/models/chat.schema.js +0 -2
  43. package/build/models/index.js +1 -0
  44. package/build/models/tools/index.js +1 -0
  45. package/build/models/tools/writer/index.js +21 -0
  46. package/build/models/tools/writer/writer-ai-action.schema.js +26 -0
  47. package/build/models/tools/writer/writer-config.schema.js +11 -0
  48. package/build/models/tools/writer/writer-document-outline.schema.js +21 -0
  49. package/build/models/tools/writer/writer-document-type.schema.js +16 -0
  50. package/build/models/tools/writer/writer-document.schema.js +22 -0
  51. package/commands/chat/check-limit.command.ts +4 -0
  52. package/commands/chat/create-chat.command.ts +2 -4
  53. package/commands/chat/find-chat-by-uuid.command.ts +2 -2
  54. package/commands/chat/find-chats.command.ts +2 -6
  55. package/commands/chat/get-last-active-chat-command.ts +2 -2
  56. package/commands/folder/find-folder-by-uuid-with-chats.command.ts +2 -6
  57. package/commands/tools/index.ts +1 -0
  58. package/commands/tools/writer/create-writer-document.command.ts +16 -0
  59. package/commands/tools/writer/delete-all-writer-documents.command.ts +6 -0
  60. package/commands/tools/writer/delete-writer-document-by-uuid.command.ts +11 -0
  61. package/commands/tools/writer/export-writer-document-as-docx.command.ts +15 -0
  62. package/commands/tools/writer/find-writer-document-by-uuid.command.ts +14 -0
  63. package/commands/tools/writer/find-writer-documents.command.ts +18 -0
  64. package/commands/tools/writer/generate-writer-document-contents.command.ts +14 -0
  65. package/commands/tools/writer/get-writer-tool-config.command.ts +10 -0
  66. package/commands/tools/writer/index.ts +15 -0
  67. package/commands/tools/writer/update-writer-document-contents.command.ts +20 -0
  68. package/commands/tools/writer/update-writer-document-outline.command.ts +19 -0
  69. package/commands/tools/writer/writer-extend-text.command.ts +20 -0
  70. package/commands/tools/writer/writer-fix-errors.command.ts +20 -0
  71. package/commands/tools/writer/writer-generate-text.command.ts +23 -0
  72. package/commands/tools/writer/writer-paraphrase.command.ts +20 -0
  73. package/commands/tools/writer/writer-shorten-text.command.ts +20 -0
  74. package/constants/errors/errors.ts +115 -30
  75. package/constants/index.ts +1 -0
  76. package/constants/writer/enums/index.ts +4 -0
  77. package/constants/writer/enums/writer-ai-action-pricing-type.enum.ts +4 -0
  78. package/constants/writer/enums/writer-ai-action-type.enum.ts +7 -0
  79. package/constants/writer/enums/writer-document-section-type.enum.ts +5 -0
  80. package/constants/writer/enums/writer-document-stage.enum.ts +13 -0
  81. package/constants/writer/index.ts +1 -0
  82. package/helpers/index.ts +1 -0
  83. package/helpers/writer/calculate-page-count.util.ts +46 -0
  84. package/helpers/writer/calculate-writer-ai-action-price.util.ts +20 -0
  85. package/helpers/writer/calculate-writer-content-generation-price.util.ts +3 -0
  86. package/helpers/writer/index.ts +3 -0
  87. package/models/chat-with-messages.schema.ts +7 -0
  88. package/models/chat.schema.ts +0 -2
  89. package/models/index.ts +1 -0
  90. package/models/tools/index.ts +1 -0
  91. package/models/tools/writer/index.ts +5 -0
  92. package/models/tools/writer/writer-ai-action.schema.ts +27 -0
  93. package/models/tools/writer/writer-config.schema.ts +10 -0
  94. package/models/tools/writer/writer-document-outline.schema.ts +28 -0
  95. package/models/tools/writer/writer-document-type.schema.ts +15 -0
  96. package/models/tools/writer/writer-document.schema.ts +21 -0
  97. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { ChatSchema, MessageSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace CreateChatCommand {
@@ -12,9 +12,7 @@ export namespace CreateChatCommand {
12
12
  export type RequestSchema = z.infer<typeof RequestSchema>;
13
13
 
14
14
  export const ResponseSchema = z.object({
15
- data: ChatSchema.extend({
16
- messages: z.array(MessageSchema),
17
- }),
15
+ data: ChatWithMessagesSchema,
18
16
  });
19
17
 
20
18
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { ChatSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatByUUIDCommand {
@@ -9,7 +9,7 @@ export namespace FindChatByUUIDCommand {
9
9
  export type Request = z.infer<typeof RequestParamsSchema>;
10
10
 
11
11
  export const ResponseSchema = z.object({
12
- data: ChatSchema,
12
+ data: ChatWithMessagesSchema,
13
13
  });
14
14
 
15
15
  export type Response = z.infer<typeof ResponseSchema>;
@@ -1,4 +1,4 @@
1
- import { AiModelSchema, ChatSchema, MessageSchema } from '../../models';
1
+ import { AiModelSchema, ChatSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace FindChatsCommand {
@@ -18,11 +18,7 @@ export namespace FindChatsCommand {
18
18
  export type RequestQuery = z.infer<typeof RequestQuerySchema>;
19
19
 
20
20
  export const ResponseSchema = z.object({
21
- data: z.array(
22
- ChatSchema.extend({
23
- messages: z.array(MessageSchema),
24
- }),
25
- ),
21
+ data: z.array(ChatSchema),
26
22
  page: z.number(),
27
23
  totalPages: z.number(),
28
24
  });
@@ -1,4 +1,4 @@
1
- import { ChatSchema } from '../../models';
1
+ import { ChatSchema, ChatWithMessagesSchema } from '../../models';
2
2
  import { z } from 'zod';
3
3
 
4
4
  export namespace GetLastActiveChatCommand {
@@ -8,7 +8,7 @@ export namespace GetLastActiveChatCommand {
8
8
  });
9
9
 
10
10
  export const Response = z.object({
11
- data: ChatSchema,
11
+ data: ChatWithMessagesSchema,
12
12
  });
13
13
 
14
14
  export type Response = z.infer<typeof Response>;
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- import { ChatSchema, FolderSchema, MessageSchema } from '../../models';
2
+ import { ChatSchema, FolderSchema } from '../../models';
3
3
 
4
4
  export namespace FindFolderByUuidWithChatsCommand {
5
5
  export const RequestParamSchema = FolderSchema.pick({
@@ -17,11 +17,7 @@ export namespace FindFolderByUuidWithChatsCommand {
17
17
 
18
18
  export const ResponseSchema = z.object({
19
19
  data: FolderSchema.extend({
20
- chats: z.array(
21
- ChatSchema.extend({
22
- messages: z.array(MessageSchema),
23
- }),
24
- ),
20
+ chats: z.array(ChatSchema),
25
21
  }),
26
22
  page: z.number(),
27
23
  totalPages: z.number(),
@@ -4,4 +4,5 @@ export * from './stt';
4
4
  export * from './tool';
5
5
  export * from './tts';
6
6
  export * from './video';
7
+ export * from './writer';
7
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
+ prompt: 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,15 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace ExportWriterDocumentAsDocxCommand {
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.object({
10
+ data: z.object({
11
+ url: z.string(),
12
+ }),
13
+ });
14
+ export type Response = z.infer<typeof ResponseSchema>;
15
+ }
@@ -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,15 @@
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';
14
+ export * from './writer-generate-text.command';
15
+ export * from './export-writer-document-as-docx.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,23 @@
1
+ import { z } from 'zod';
2
+
3
+ export namespace WriterGenerateTextCommand {
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
+ prompt: z.string(),
11
+ selectionText: z.string(),
12
+ contextBefore: z.string().max(2000).optional(),
13
+ contextAfter: z.string().max(2000).optional(),
14
+ });
15
+ export type RequestBody = z.infer<typeof RequestBodySchema>;
16
+
17
+ export const ResponseSchema = z.object({
18
+ data: z.object({
19
+ output: z.string(),
20
+ }),
21
+ });
22
+ export type Response = z.infer<typeof ResponseSchema>;
23
+ }
@@ -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
+ }
@@ -1747,79 +1747,119 @@ export const ERRORS = {
1747
1747
  message: 'Ошибка при обновлении ежедневного стрика',
1748
1748
  httpCode: 500,
1749
1749
  },
1750
- ACCOUNT_DELETE_ERROR: {
1750
+ WRITER_CONFIG_ERROR: {
1751
1751
  code: 'A362',
1752
+ message: 'Произошла ошибка при получении конфигурации Writer',
1753
+ httpCode: 500,
1754
+ },
1755
+ WRITER_CREATE_DOCUMENT_ERROR: {
1756
+ code: 'A363',
1757
+ message: 'Произошла ошибка при создании документа',
1758
+ httpCode: 500,
1759
+ },
1760
+ WRITER_DOCUMENT_FIND_ERROR: {
1761
+ code: 'A364',
1762
+ message: 'Произошла ошибка при поиске документа',
1763
+ httpCode: 500,
1764
+ },
1765
+ WRITER_DOCUMENTS_FIND_ERROR: {
1766
+ code: 'A365',
1767
+ message: 'Произошла ошибка при поиске документов',
1768
+ httpCode: 500,
1769
+ },
1770
+ WRITER_DELETE_DOCUMENT_ERROR: {
1771
+ code: 'A366',
1772
+ message: 'Произошла ошибка при удалении документа',
1773
+ httpCode: 500,
1774
+ },
1775
+ WRITER_DELETE_ALL_DOCUMENTS_ERROR: {
1776
+ code: 'A367',
1777
+ message: 'Произошла ошибка при удалении всех документов пользователя',
1778
+ httpCode: 500,
1779
+ },
1780
+ WRITER_UPDATE_DOCUMENT_OUTLINE_ERROR: {
1781
+ code: 'A368',
1782
+ message: 'Произошла ошибка при обновлении структуры документа',
1783
+ httpCode: 500,
1784
+ },
1785
+ WRITER_GENERATE_DOCUMENT_CONTENTS_ERROR: {
1786
+ code: 'A369',
1787
+ message: 'Произошла ошибка при генерации содержимого документа',
1788
+ httpCode: 500,
1789
+ },
1790
+ ACCOUNT_DELETE_ERROR: {
1791
+ code: 'A370',
1752
1792
  message: 'Аккаунт не был удалён',
1753
1793
  httpCode: 500,
1754
1794
  },
1755
1795
  ACCOUNT_DELETED: {
1756
- code: 'A363',
1796
+ code: 'A371',
1757
1797
  message: 'Операция невозможна, аккаунт был удалён',
1758
1798
  httpCode: 400,
1759
1799
  },
1760
1800
  TELEGRAM_PROFILE_DELETE_ERROR: {
1761
- code: 'A364',
1801
+ code: 'A372',
1762
1802
  message: 'Произошла ошибка при удалении Telegram профиля',
1763
1803
  httpCode: 500,
1764
1804
  },
1765
1805
  TOOL_NOT_FOUND_ERROR: {
1766
- code: 'A365',
1806
+ code: 'A373',
1767
1807
  message: 'Инструмент не найден',
1768
1808
  httpCode: 404,
1769
1809
  },
1770
1810
  ORDER_CHECK_FIRST_PURCHASE_ERROR: {
1771
- code: 'A366',
1811
+ code: 'A374',
1772
1812
  message: 'Произошла ошибка при проверке первой покупки',
1773
1813
  httpCode: 500,
1774
1814
  },
1775
1815
  ORDER_CURRENT_ORDER_NOT_FOUND_ERROR: {
1776
- code: 'A367',
1816
+ code: 'A375',
1777
1817
  message: 'Текущий заказ не найден',
1778
1818
  httpCode: 404,
1779
1819
  },
1780
1820
  ORDER_GET_USER_ORDERS_ERROR: {
1781
- code: 'A368',
1821
+ code: 'A376',
1782
1822
  message: 'Произошла ошибка при получении заказов пользователя',
1783
1823
  httpCode: 500,
1784
1824
  },
1785
1825
  ORDER_NO_SUBSCRIPTION_ID_OR_PRODUCT_ID_PROVIDED_ERROR: {
1786
- code: 'A369',
1826
+ code: 'A377',
1787
1827
  message: 'Не указан subscriptionId или productId',
1788
1828
  httpCode: 400,
1789
1829
  },
1790
1830
  FILE_TO_MD_FORMAT_ERROR: {
1791
- code: 'A370',
1831
+ code: 'A378',
1792
1832
  message: 'Неверный формат файла, варианты: .xlsx, .docx, .pdf',
1793
1833
  httpCode: 400,
1794
1834
  },
1795
1835
  FILE_TO_MD_ERROR: {
1796
- code: 'A371',
1836
+ code: 'A379',
1797
1837
  message: 'Произошла ошибка при конвертации файла в markdown',
1798
1838
  httpCode: 500,
1799
1839
  },
1800
1840
  FILE_TO_MD_CONVERT_ERROR: {
1801
- code: 'A372',
1841
+ code: 'A380',
1802
1842
  message:
1803
1843
  'Не получилось конвертировать файл в markdown, возможно файл пуст, поврежден или невалиден',
1804
1844
  httpCode: 400,
1805
1845
  },
1806
1846
  IMAGE_EDITOR_MODEL_INACTIVE: {
1807
- code: 'A373',
1847
+ code: 'A381',
1808
1848
  message: 'Модель редактирования картинок архивирована и недоступна для пользования',
1809
1849
  httpCode: 403,
1810
1850
  },
1811
1851
  TTS_MODEL_INACTIVE: {
1812
- code: 'A374',
1852
+ code: 'A382',
1813
1853
  message: 'Модель генерации текста в голос архивирована и недоступна для пользования',
1814
1854
  httpCode: 403,
1815
1855
  },
1816
1856
  STT_MODEL_INACTIVE: {
1817
- code: 'A375',
1857
+ code: 'A383',
1818
1858
  message: 'Модель генерации голоса в текст архивирована и недоступна для пользования',
1819
1859
  httpCode: 403,
1820
1860
  },
1821
1861
  VIDEO_MODEL_INACTIVE: {
1822
- code: 'A376',
1862
+ code: 'A384',
1823
1863
  message: 'Модель генерации видео архивирована и недоступна для пользования',
1824
1864
  httpCode: 403,
1825
1865
  },
@@ -1829,17 +1869,17 @@ export const ERRORS = {
1829
1869
  httpCode: 500,
1830
1870
  },
1831
1871
  VK_GET_ACCESS_TOKEN_ERROR: {
1832
- code: 'A377',
1872
+ code: 'A385',
1833
1873
  message: 'Ошибка при получении кода доступа от ВК',
1834
1874
  httpCode: 500,
1835
1875
  },
1836
1876
  VK_GET_USER_INFO_ERROR: {
1837
- code: 'A378',
1877
+ code: 'A386',
1838
1878
  message: 'Ошибка при получении данных об юзере из ВК',
1839
1879
  httpCode: 500,
1840
1880
  },
1841
1881
  USER_NOT_VK_ID: {
1842
- code: 'A379',
1882
+ code: 'A387',
1843
1883
  message: 'Произошла ошибка при поиске пользователя по vkId',
1844
1884
  httpCode: 500,
1845
1885
  },
@@ -1849,12 +1889,12 @@ export const ERRORS = {
1849
1889
  httpCode: 409,
1850
1890
  },
1851
1891
  YANDEX_GET_USER_INFO_ERROR: {
1852
- code: 'A380',
1892
+ code: 'A388',
1853
1893
  message: 'Ошибка при получении данных об юзере из Яндекса',
1854
1894
  httpCode: 500,
1855
1895
  },
1856
1896
  USER_NOT_YANDEX_ID: {
1857
- code: 'A381',
1897
+ code: 'A389',
1858
1898
  message: 'Произошла ошибка при поиске пользователя по yandexId',
1859
1899
  httpCode: 500,
1860
1900
  },
@@ -1864,53 +1904,98 @@ export const ERRORS = {
1864
1904
  httpCode: 409,
1865
1905
  },
1866
1906
  PDF_TO_MD_CONVERT_ERROR: {
1867
- code: 'A382',
1907
+ code: 'A390',
1868
1908
  message:
1869
1909
  'Не получилось конвертировать pdf в markdown, возможно вы прикрепили скан или картинку, не имеющую текста',
1870
1910
  httpCode: 400,
1871
1911
  },
1872
1912
  SUBSCRIPTION_DOWNGRADE_INVALID: {
1873
- code: 'A383',
1913
+ code: 'A391',
1874
1914
  message: 'Невозможно понизить подписку до указанного уровня',
1875
1915
  httpCode: 400,
1876
1916
  },
1877
1917
  SUBSCRIPTION_DOWNGRADE_ERROR: {
1878
- code: 'A384',
1918
+ code: 'A392',
1879
1919
  message: 'Не удалось понизить подписку',
1880
1920
  httpCode: 500,
1881
1921
  },
1882
1922
  SUBSCRIPTIONS_GET_DOWNGRADE_ERROR: {
1883
- code: 'A385',
1923
+ code: 'A393',
1884
1924
  message: 'Не удалось получить список возможных понижений для подписок',
1885
1925
  httpCode: 500,
1886
1926
  },
1927
+ WRITER_PARAPHRASE_ERROR: {
1928
+ code: 'A394',
1929
+ message: 'Произошла ошибка при перефразировании текста',
1930
+ httpCode: 500,
1931
+ },
1932
+ WRITER_EXTEND_TEXT_ERROR: {
1933
+ code: 'A395',
1934
+ message: 'Произошла ошибка при расширении текста',
1935
+ httpCode: 500,
1936
+ },
1937
+ WRITER_SHORTEN_TEXT_ERROR: {
1938
+ code: 'A396',
1939
+ message: 'Произошла ошибка при сокращении текста',
1940
+ httpCode: 500,
1941
+ },
1942
+ WRITER_FIX_ERRORS_ERROR: {
1943
+ code: 'A397',
1944
+ message: 'Произошла ошибка при исправлении ошибок в тексте',
1945
+ httpCode: 500,
1946
+ },
1947
+ WRITER_UPDATE_DOCUMENT_CONTENTS_ERROR: {
1948
+ code: 'A398',
1949
+ message: 'Произошла ошибка при обновлении содержимого документа',
1950
+ httpCode: 500,
1951
+ },
1952
+ WRITER_GENERATE_TEXT_ERROR: {
1953
+ code: 'A399',
1954
+ message: 'Произошла ошибка при генерации текста',
1955
+ httpCode: 500,
1956
+ },
1957
+ WRITER_EXPORT_DOCX_ERROR: {
1958
+ code: 'A400',
1959
+ message: 'Произошла ошибка при экспорте документа в DOCX',
1960
+ httpCode: 500,
1961
+ },
1962
+ AI_MODEL_SUGGESTIONS_INVALID_PROMPT_LENGTH: {
1963
+ code: 'A401',
1964
+ message: 'Промпт не подходит для генерации предложений',
1965
+ httpCode: 400,
1966
+ },
1967
+ AI_MODEL_SUGGESTIONS_GENERATION_ERROR: {
1968
+ code: 'A402',
1969
+ message: 'Ошибка генерации предложения',
1970
+ httpCode: 500,
1971
+ },
1887
1972
  VK_STATE_ERROR: {
1888
- code: 'A388',
1973
+ code: 'A403',
1889
1974
  message: 'Получен неверный state в ответе от API ВК',
1890
1975
  httpCode: 400,
1891
1976
  },
1892
1977
  YANDEX_GET_ACCESS_TOKEN_ERROR: {
1893
- code: 'A389',
1978
+ code: 'A404',
1894
1979
  message: 'Ошибка при получении кода доступа от Яндекса',
1895
1980
  httpCode: 500,
1896
1981
  },
1897
1982
  KIE_MIDJOURNEY_TASK_ERROR: {
1898
- code: 'A390',
1983
+ code: 'A405',
1899
1984
  message: 'Произошла ошибка при получении задачи Midjourney',
1900
1985
  httpCode: 500,
1901
1986
  },
1902
1987
  KIE_MIDJOURNEY_GENERATION_ERROR: {
1903
- code: 'A391',
1988
+ code: 'A406',
1904
1989
  message: 'Произошла ошибка при генерации видео от Midjourney',
1905
1990
  httpCode: 500,
1906
1991
  },
1907
1992
  KIE_MIDJOURNEY_NO_RESPONSE: {
1908
- code: 'A392',
1993
+ code: 'A407',
1909
1994
  message: 'Нет ответа от Midjourney, попробуйте позже',
1910
1995
  httpCode: 503,
1911
1996
  },
1912
1997
  KIE_CONTENT_POLICY_VIOLATION: {
1913
- code: 'A393',
1998
+ code: 'A408',
1914
1999
  message: 'Запрос был отклонен, т.к. может не соответствовать политике безопасности сервиса',
1915
2000
  httpCode: 400,
1916
2001
  },