@purpleschool/gptbot 0.7.34-texteditor → 0.7.35-texteditor
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.
- package/api/controllers/http/writer.ts +1 -0
- package/build/api/controllers/http/writer.js +1 -0
- package/build/commands/tools/writer/export-writer-document-as-docx.command.js +15 -0
- package/build/commands/tools/writer/index.js +1 -0
- package/build/constants/errors/errors.js +5 -0
- package/build/models/tools/writer/writer-document.schema.js +2 -1
- package/commands/tools/writer/export-writer-document-as-docx.command.ts +15 -0
- package/commands/tools/writer/index.ts +1 -0
- package/constants/errors/errors.ts +5 -0
- package/models/tools/writer/writer-document.schema.ts +2 -2
- package/package.json +1 -1
|
@@ -16,4 +16,5 @@ export const WRITER_ROUTES = {
|
|
|
16
16
|
SHORTEN_TEXT: (uuid: string) => `documents/${uuid}/actions/shorten-text`,
|
|
17
17
|
FIX_ERRORS: (uuid: string) => `documents/${uuid}/actions/fix-errors`,
|
|
18
18
|
GENERATE_TEXT: (uuid: string) => `documents/${uuid}/actions/generate-text`,
|
|
19
|
+
EXPORT_AS_DOCX: (uuid: string) => `documents/${uuid}/export/docx`,
|
|
19
20
|
} as const;
|
|
@@ -18,4 +18,5 @@ exports.WRITER_ROUTES = {
|
|
|
18
18
|
SHORTEN_TEXT: (uuid) => `documents/${uuid}/actions/shorten-text`,
|
|
19
19
|
FIX_ERRORS: (uuid) => `documents/${uuid}/actions/fix-errors`,
|
|
20
20
|
GENERATE_TEXT: (uuid) => `documents/${uuid}/actions/generate-text`,
|
|
21
|
+
EXPORT_AS_DOCX: (uuid) => `documents/${uuid}/export/docx`,
|
|
21
22
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExportWriterDocumentAsDocxCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var ExportWriterDocumentAsDocxCommand;
|
|
6
|
+
(function (ExportWriterDocumentAsDocxCommand) {
|
|
7
|
+
ExportWriterDocumentAsDocxCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
ExportWriterDocumentAsDocxCommand.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.object({
|
|
12
|
+
url: zod_1.z.string(),
|
|
13
|
+
}),
|
|
14
|
+
});
|
|
15
|
+
})(ExportWriterDocumentAsDocxCommand || (exports.ExportWriterDocumentAsDocxCommand = ExportWriterDocumentAsDocxCommand = {}));
|
|
@@ -28,3 +28,4 @@ __exportStar(require("./writer-extend-text.command"), exports);
|
|
|
28
28
|
__exportStar(require("./writer-shorten-text.command"), exports);
|
|
29
29
|
__exportStar(require("./writer-fix-errors.command"), exports);
|
|
30
30
|
__exportStar(require("./writer-generate-text.command"), exports);
|
|
31
|
+
__exportStar(require("./export-writer-document-as-docx.command"), exports);
|
|
@@ -1831,4 +1831,9 @@ exports.ERRORS = {
|
|
|
1831
1831
|
message: 'Произошла ошибка при генерации текста',
|
|
1832
1832
|
httpCode: 500,
|
|
1833
1833
|
},
|
|
1834
|
+
WRITER_EXPORT_DOCX_ERROR: {
|
|
1835
|
+
code: 'A387',
|
|
1836
|
+
message: 'Произошла ошибка при экспорте документа в DOCX',
|
|
1837
|
+
httpCode: 500,
|
|
1838
|
+
},
|
|
1834
1839
|
};
|
|
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const writer_document_outline_schema_1 = require("./writer-document-outline.schema");
|
|
6
6
|
const constants_1 = require("../../../constants");
|
|
7
7
|
exports.WriterDocumentSchema = zod_1.z.object({
|
|
8
|
-
uuid: zod_1.z.string(),
|
|
8
|
+
uuid: zod_1.z.string().uuid(),
|
|
9
9
|
prompt: zod_1.z.string(),
|
|
10
10
|
topic: zod_1.z.string(),
|
|
11
11
|
typeId: zod_1.z.string(),
|
|
@@ -15,6 +15,7 @@ exports.WriterDocumentSchema = zod_1.z.object({
|
|
|
15
15
|
finalMd: zod_1.z.string().nullable(),
|
|
16
16
|
userId: zod_1.z.string().nullable(),
|
|
17
17
|
unregisteredUserId: zod_1.z.string().nullable(),
|
|
18
|
+
pages: zod_1.z.number(),
|
|
18
19
|
createdAt: zod_1.z.date(),
|
|
19
20
|
updatedAt: zod_1.z.date(),
|
|
20
21
|
completedAt: zod_1.z.date().nullable(),
|
|
@@ -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
|
+
}
|
|
@@ -1839,4 +1839,9 @@ export const ERRORS = {
|
|
|
1839
1839
|
message: 'Произошла ошибка при генерации текста',
|
|
1840
1840
|
httpCode: 500,
|
|
1841
1841
|
},
|
|
1842
|
+
WRITER_EXPORT_DOCX_ERROR: {
|
|
1843
|
+
code: 'A387',
|
|
1844
|
+
message: 'Произошла ошибка при экспорте документа в DOCX',
|
|
1845
|
+
httpCode: 500,
|
|
1846
|
+
},
|
|
1842
1847
|
};
|
|
@@ -3,7 +3,7 @@ import { WriterDocumentOutlineSchema } from './writer-document-outline.schema';
|
|
|
3
3
|
import { WRITER_DOCUMENT_STAGE } from '../../../constants';
|
|
4
4
|
|
|
5
5
|
export const WriterDocumentSchema = z.object({
|
|
6
|
-
uuid: z.string(),
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
7
|
prompt: z.string(),
|
|
8
8
|
topic: z.string(),
|
|
9
9
|
typeId: z.string(),
|
|
@@ -13,9 +13,9 @@ export const WriterDocumentSchema = z.object({
|
|
|
13
13
|
finalMd: z.string().nullable(),
|
|
14
14
|
userId: z.string().nullable(),
|
|
15
15
|
unregisteredUserId: z.string().nullable(),
|
|
16
|
+
pages: z.number(),
|
|
16
17
|
createdAt: z.date(),
|
|
17
18
|
updatedAt: z.date(),
|
|
18
19
|
completedAt: z.date().nullable(),
|
|
19
20
|
});
|
|
20
|
-
|
|
21
21
|
export type WriterDocument = z.infer<typeof WriterDocumentSchema>;
|