@purpleschool/gptbot 0.7.29 → 0.7.31
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/index.ts +0 -1
- package/api/controllers/http/user.ts +1 -0
- package/api/routes.ts +1 -0
- package/build/api/controllers/http/index.js +0 -1
- package/build/api/controllers/http/user.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/page/create-page.command.js +8 -0
- package/build/commands/page/find-page-by-alias.command.js +2 -0
- package/build/commands/page/find-page.command.js +1 -0
- package/build/commands/tools/index.js +0 -1
- package/build/commands/user/delete-account.command.js +12 -0
- package/build/commands/user/find-users-by-criteria.command.js +1 -0
- package/build/commands/user/index.js +1 -0
- package/build/constants/errors/errors.js +10 -30
- package/build/constants/index.js +0 -1
- package/build/constants/page/enums/page-type.enum.js +1 -0
- package/build/constants/user/enums/user-status.js +1 -0
- package/build/models/page.schema.js +1 -0
- package/build/models/tools/index.js +0 -1
- package/build/models/user.schema.js +1 -0
- package/commands/page/create-page.command.ts +11 -0
- package/commands/page/find-page-by-alias.command.ts +9 -1
- package/commands/page/find-page.command.ts +8 -1
- package/commands/tools/index.ts +0 -1
- package/commands/user/delete-account.command.ts +13 -0
- package/commands/user/find-users-by-criteria.command.ts +1 -0
- package/commands/user/index.ts +1 -0
- package/constants/errors/errors.ts +10 -30
- package/constants/index.ts +0 -1
- package/constants/page/enums/page-type.enum.ts +1 -0
- package/constants/user/enums/user-status.ts +1 -0
- package/models/page.schema.ts +1 -0
- package/models/tools/index.ts +0 -1
- package/models/user.schema.ts +1 -0
- package/package.json +1 -1
- package/api/controllers/http/writer.ts +0 -13
- package/build/api/controllers/http/writer.js +0 -15
- package/build/commands/tools/writer/create-writer-document.command.js +0 -16
- package/build/commands/tools/writer/delete-all-writer-documents.command.js +0 -8
- package/build/commands/tools/writer/delete-writer-document-by-uuid.command.js +0 -11
- package/build/commands/tools/writer/find-writer-document-by-uuid.command.js +0 -14
- package/build/commands/tools/writer/find-writer-documents.command.js +0 -18
- package/build/commands/tools/writer/generate-writer-document-contents.command.js +0 -14
- package/build/commands/tools/writer/get-writer-tool-config.command.js +0 -11
- package/build/commands/tools/writer/index.js +0 -24
- package/build/commands/tools/writer/update-writer-document-outline.command.js +0 -17
- package/build/constants/writer/enums/index.js +0 -20
- package/build/constants/writer/enums/writer-ai-operation-pricing-type.enum.js +0 -8
- package/build/constants/writer/enums/writer-ai-operation-type.enum.js +0 -9
- package/build/constants/writer/enums/writer-document-section-type.enum.js +0 -9
- package/build/constants/writer/enums/writer-document-stage.enum.js +0 -14
- package/build/constants/writer/index.js +0 -17
- package/build/models/tools/writer/index.js +0 -21
- package/build/models/tools/writer/writer-ai-operation.schema.js +0 -26
- package/build/models/tools/writer/writer-config.schema.js +0 -13
- package/build/models/tools/writer/writer-document-outline.schema.js +0 -21
- package/build/models/tools/writer/writer-document-type.schema.js +0 -13
- package/build/models/tools/writer/writer-document.schema.js +0 -21
- package/commands/tools/writer/create-writer-document.command.ts +0 -16
- package/commands/tools/writer/delete-all-writer-documents.command.ts +0 -6
- package/commands/tools/writer/delete-writer-document-by-uuid.command.ts +0 -11
- package/commands/tools/writer/find-writer-document-by-uuid.command.ts +0 -14
- package/commands/tools/writer/find-writer-documents.command.ts +0 -18
- package/commands/tools/writer/generate-writer-document-contents.command.ts +0 -14
- package/commands/tools/writer/get-writer-tool-config.command.ts +0 -10
- package/commands/tools/writer/index.ts +0 -8
- package/commands/tools/writer/update-writer-document-outline.command.ts +0 -19
- package/constants/writer/enums/index.ts +0 -4
- package/constants/writer/enums/writer-ai-operation-pricing-type.enum.ts +0 -4
- package/constants/writer/enums/writer-ai-operation-type.enum.ts +0 -5
- package/constants/writer/enums/writer-document-section-type.enum.ts +0 -5
- package/constants/writer/enums/writer-document-stage.enum.ts +0 -13
- package/constants/writer/index.ts +0 -1
- package/models/tools/writer/index.ts +0 -5
- package/models/tools/writer/writer-ai-operation.schema.ts +0 -27
- package/models/tools/writer/writer-config.schema.ts +0 -13
- package/models/tools/writer/writer-document-outline.schema.ts +0 -28
- package/models/tools/writer/writer-document-type.schema.ts +0 -12
- package/models/tools/writer/writer-document.schema.ts +0 -21
package/api/routes.ts
CHANGED
|
@@ -29,6 +29,7 @@ export const REST_API = {
|
|
|
29
29
|
`${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
30
30
|
GET_COUNT: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
31
31
|
SEND_NOTIFICATION: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.SEND_NOTIFICATION}`,
|
|
32
|
+
DELETE_ACCOUNT: `${ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.DELETE_ACCOUNT}`,
|
|
32
33
|
},
|
|
33
34
|
PAGE: {
|
|
34
35
|
GET: `${ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
|
|
@@ -60,5 +60,4 @@ __exportStar(require("./folder"), exports);
|
|
|
60
60
|
__exportStar(require("./user-to-product"), exports);
|
|
61
61
|
__exportStar(require("./user-to-subscription"), exports);
|
|
62
62
|
__exportStar(require("./video"), exports);
|
|
63
|
-
__exportStar(require("./writer"), exports);
|
|
64
63
|
__exportStar(require("./daily-streak"), exports);
|
package/build/api/routes.js
CHANGED
|
@@ -58,6 +58,7 @@ exports.REST_API = {
|
|
|
58
58
|
GET_PRODUCTS: (uuid) => `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_PRODUCTS(uuid)}`,
|
|
59
59
|
GET_COUNT: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.GET_COUNT_NOTIFICATION}`,
|
|
60
60
|
SEND_NOTIFICATION: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.SEND_NOTIFICATION}`,
|
|
61
|
+
DELETE_ACCOUNT: `${exports.ROOT}/${CONTROLLERS.USER_CONTROLLER}/${CONTROLLERS.USER_ROUTES.DELETE_ACCOUNT}`,
|
|
61
62
|
},
|
|
62
63
|
PAGE: {
|
|
63
64
|
GET: `${exports.ROOT}/${CONTROLLERS.PAGE_CONTROLLER}/${CONTROLLERS.PAGE_ROUTES.GET_ALL}`,
|
|
@@ -27,6 +27,14 @@ var CreatePageCommand;
|
|
|
27
27
|
return true;
|
|
28
28
|
}, {
|
|
29
29
|
message: 'categoryId is required when type is CATEGORY',
|
|
30
|
+
})
|
|
31
|
+
.refine((data) => {
|
|
32
|
+
if (data.type === constants_1.PageType.TOOL) {
|
|
33
|
+
return !!data.toolId;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}, {
|
|
37
|
+
message: 'toolId is required when type is TOOL',
|
|
30
38
|
});
|
|
31
39
|
CreatePageCommand.ResponseSchema = zod_1.z.object({
|
|
32
40
|
data: models_1.PageSchema,
|
|
@@ -15,6 +15,7 @@ var FindPageByAliasCommand;
|
|
|
15
15
|
data: models_1.PageSchema.extend({
|
|
16
16
|
category: zod_1.z.union([models_1.CategorySchema, zod_1.z.null()]),
|
|
17
17
|
aIModel: zod_1.z.union([models_1.AiModelSchema, zod_1.z.null()]),
|
|
18
|
+
tool: models_1.ToolSchema.nullable(),
|
|
18
19
|
questions: zod_1.z.array(models_1.QuestionSchema),
|
|
19
20
|
}),
|
|
20
21
|
});
|
|
@@ -22,6 +23,7 @@ var FindPageByAliasCommand;
|
|
|
22
23
|
data: zod_1.z.array(models_1.PageSchema.extend({
|
|
23
24
|
category: zod_1.z.union([models_1.CategorySchema, zod_1.z.null()]),
|
|
24
25
|
aIModel: zod_1.z.union([models_1.AiModelSchema, zod_1.z.null()]),
|
|
26
|
+
tool: models_1.ToolSchema.nullable(),
|
|
25
27
|
questions: zod_1.z.array(models_1.QuestionSchema),
|
|
26
28
|
})),
|
|
27
29
|
});
|
|
@@ -15,6 +15,7 @@ var FindPageCommand;
|
|
|
15
15
|
data: models_1.PageSchema.extend({
|
|
16
16
|
category: zod_1.z.union([models_1.CategorySchema, zod_1.z.null()]),
|
|
17
17
|
aIModel: zod_1.z.union([models_1.AiModelSchema, zod_1.z.null()]),
|
|
18
|
+
tool: models_1.ToolSchema.nullable(),
|
|
18
19
|
questions: zod_1.z.array(models_1.QuestionSchema),
|
|
19
20
|
}),
|
|
20
21
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteAccountCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeleteAccountCommand;
|
|
6
|
+
(function (DeleteAccountCommand) {
|
|
7
|
+
DeleteAccountCommand.ResponseSchema = zod_1.z.object({
|
|
8
|
+
data: zod_1.z.object({
|
|
9
|
+
isDeleted: zod_1.z.boolean(),
|
|
10
|
+
}),
|
|
11
|
+
});
|
|
12
|
+
})(DeleteAccountCommand || (exports.DeleteAccountCommand = DeleteAccountCommand = {}));
|
|
@@ -41,6 +41,7 @@ var FindUsersByCriteriaCommand;
|
|
|
41
41
|
telegramId: zod_1.default.coerce.number().optional(),
|
|
42
42
|
createdAt: models_1.DateFilter.optional(),
|
|
43
43
|
updatedAt: models_1.DateFilter.optional(),
|
|
44
|
+
deletedAt: models_1.DateFilter.optional(),
|
|
44
45
|
tokenBonusBalance: models_1.NumberFilter.optional(),
|
|
45
46
|
sortBy: zod_1.default.nativeEnum(constants_1.USER_SORT_BY).optional(),
|
|
46
47
|
sortOrder: zod_1.default.nativeEnum(constants_1.SORT_ORDER).default(constants_1.SORT_ORDER.DESC).optional(),
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./get-user-balance.command"), exports);
|
|
|
23
23
|
__exportStar(require("./get-user-orders.command"), exports);
|
|
24
24
|
__exportStar(require("./get-user-subscriptions.command"), exports);
|
|
25
25
|
__exportStar(require("./get-user-products.command"), exports);
|
|
26
|
+
__exportStar(require("./delete-account.command"), exports);
|
|
@@ -1697,44 +1697,24 @@ exports.ERRORS = {
|
|
|
1697
1697
|
message: 'Ошибка при обновлении ежедневного стрика',
|
|
1698
1698
|
httpCode: 500,
|
|
1699
1699
|
},
|
|
1700
|
-
|
|
1700
|
+
ACCOUNT_DELETE_ERROR: {
|
|
1701
1701
|
code: 'A360',
|
|
1702
|
-
message: '
|
|
1702
|
+
message: 'Аккаунт не был удалён',
|
|
1703
1703
|
httpCode: 500,
|
|
1704
1704
|
},
|
|
1705
|
-
|
|
1705
|
+
ACCOUNT_DELETED: {
|
|
1706
1706
|
code: 'A361',
|
|
1707
|
-
message: '
|
|
1708
|
-
httpCode:
|
|
1707
|
+
message: 'Операция невозможна, аккаунт был удалён',
|
|
1708
|
+
httpCode: 400,
|
|
1709
1709
|
},
|
|
1710
|
-
|
|
1710
|
+
TELEGRAM_PROFILE_DELETE_ERROR: {
|
|
1711
1711
|
code: 'A362',
|
|
1712
|
-
message: 'Произошла ошибка при
|
|
1712
|
+
message: 'Произошла ошибка при удалении Telegram профиля',
|
|
1713
1713
|
httpCode: 500,
|
|
1714
1714
|
},
|
|
1715
|
-
|
|
1715
|
+
TOOL_NOT_FOUND_ERROR: {
|
|
1716
1716
|
code: 'A363',
|
|
1717
|
-
message: '
|
|
1718
|
-
httpCode:
|
|
1719
|
-
},
|
|
1720
|
-
WRITER_DELETE_DOCUMENT_ERROR: {
|
|
1721
|
-
code: 'A364',
|
|
1722
|
-
message: 'Произошла ошибка при удалении документа',
|
|
1723
|
-
httpCode: 500,
|
|
1724
|
-
},
|
|
1725
|
-
WRITER_DELETE_ALL_DOCUMENTS_ERROR: {
|
|
1726
|
-
code: 'A365',
|
|
1727
|
-
message: 'Произошла ошибка при удалении всех документов пользователя',
|
|
1728
|
-
httpCode: 500,
|
|
1729
|
-
},
|
|
1730
|
-
WRITER_UPDATE_DOCUMENT_OUTLINE_ERROR: {
|
|
1731
|
-
code: 'A366',
|
|
1732
|
-
message: 'Произошла ошибка при обновлении структуры документа',
|
|
1733
|
-
httpCode: 500,
|
|
1734
|
-
},
|
|
1735
|
-
WRITER_GENERATE_DOCUMENT_CONTENTS_ERROR: {
|
|
1736
|
-
code: 'A367',
|
|
1737
|
-
message: 'Произошла ошибка при генерации содержимого документа',
|
|
1738
|
-
httpCode: 500,
|
|
1717
|
+
message: 'Инструмент не найден',
|
|
1718
|
+
httpCode: 404,
|
|
1739
1719
|
},
|
|
1740
1720
|
};
|
package/build/constants/index.js
CHANGED
|
@@ -47,6 +47,5 @@ __exportStar(require("./promocode"), exports);
|
|
|
47
47
|
__exportStar(require("./ui-notification"), exports);
|
|
48
48
|
__exportStar(require("./review"), exports);
|
|
49
49
|
__exportStar(require("./tool-video"), exports);
|
|
50
|
-
__exportStar(require("./writer"), exports);
|
|
51
50
|
__exportStar(require("./feedback"), exports);
|
|
52
51
|
__exportStar(require("./daily-streak"), exports);
|
|
@@ -13,6 +13,7 @@ exports.PageSchema = zod_1.z.object({
|
|
|
13
13
|
alias: zod_1.z.string().min(3).max(16384),
|
|
14
14
|
categoryId: zod_1.z.string().uuid().nullable().optional(),
|
|
15
15
|
aIModelId: zod_1.z.string().uuid().nullable().optional(),
|
|
16
|
+
toolId: zod_1.z.string().uuid().nullable().optional(),
|
|
16
17
|
type: zod_1.z.nativeEnum(constants_1.PageType),
|
|
17
18
|
createdAt: zod_1.z.date(),
|
|
18
19
|
updatedAt: zod_1.z.date(),
|
|
@@ -30,6 +30,17 @@ export namespace CreatePageCommand {
|
|
|
30
30
|
{
|
|
31
31
|
message: 'categoryId is required when type is CATEGORY',
|
|
32
32
|
},
|
|
33
|
+
)
|
|
34
|
+
.refine(
|
|
35
|
+
(data) => {
|
|
36
|
+
if (data.type === PageType.TOOL) {
|
|
37
|
+
return !!data.toolId;
|
|
38
|
+
}
|
|
39
|
+
return true;
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
message: 'toolId is required when type is TOOL',
|
|
43
|
+
},
|
|
33
44
|
);
|
|
34
45
|
|
|
35
46
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AiModelSchema,
|
|
3
|
+
CategorySchema,
|
|
4
|
+
PageSchema,
|
|
5
|
+
QuestionSchema,
|
|
6
|
+
ToolSchema,
|
|
7
|
+
} from '../../models';
|
|
2
8
|
import { z } from 'zod';
|
|
3
9
|
|
|
4
10
|
export namespace FindPageByAliasCommand {
|
|
@@ -18,6 +24,7 @@ export namespace FindPageByAliasCommand {
|
|
|
18
24
|
data: PageSchema.extend({
|
|
19
25
|
category: z.union([CategorySchema, z.null()]),
|
|
20
26
|
aIModel: z.union([AiModelSchema, z.null()]),
|
|
27
|
+
tool: ToolSchema.nullable(),
|
|
21
28
|
questions: z.array(QuestionSchema),
|
|
22
29
|
}),
|
|
23
30
|
});
|
|
@@ -27,6 +34,7 @@ export namespace FindPageByAliasCommand {
|
|
|
27
34
|
PageSchema.extend({
|
|
28
35
|
category: z.union([CategorySchema, z.null()]),
|
|
29
36
|
aIModel: z.union([AiModelSchema, z.null()]),
|
|
37
|
+
tool: ToolSchema.nullable(),
|
|
30
38
|
questions: z.array(QuestionSchema),
|
|
31
39
|
}),
|
|
32
40
|
),
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AiModelSchema,
|
|
3
|
+
CategorySchema,
|
|
4
|
+
PageSchema,
|
|
5
|
+
QuestionSchema,
|
|
6
|
+
ToolSchema,
|
|
7
|
+
} from '../../models';
|
|
2
8
|
import { z } from 'zod';
|
|
3
9
|
|
|
4
10
|
export namespace FindPageCommand {
|
|
@@ -18,6 +24,7 @@ export namespace FindPageCommand {
|
|
|
18
24
|
data: PageSchema.extend({
|
|
19
25
|
category: z.union([CategorySchema, z.null()]),
|
|
20
26
|
aIModel: z.union([AiModelSchema, z.null()]),
|
|
27
|
+
tool: ToolSchema.nullable(),
|
|
21
28
|
questions: z.array(QuestionSchema),
|
|
22
29
|
}),
|
|
23
30
|
});
|
package/commands/tools/index.ts
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeleteAccountCommand {
|
|
4
|
+
export type Request = void;
|
|
5
|
+
|
|
6
|
+
export const ResponseSchema = z.object({
|
|
7
|
+
data: z.object({
|
|
8
|
+
isDeleted: z.boolean(),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
package/commands/user/index.ts
CHANGED
|
@@ -1704,44 +1704,24 @@ export const ERRORS = {
|
|
|
1704
1704
|
message: 'Ошибка при обновлении ежедневного стрика',
|
|
1705
1705
|
httpCode: 500,
|
|
1706
1706
|
},
|
|
1707
|
-
|
|
1707
|
+
ACCOUNT_DELETE_ERROR: {
|
|
1708
1708
|
code: 'A360',
|
|
1709
|
-
message: '
|
|
1709
|
+
message: 'Аккаунт не был удалён',
|
|
1710
1710
|
httpCode: 500,
|
|
1711
1711
|
},
|
|
1712
|
-
|
|
1712
|
+
ACCOUNT_DELETED: {
|
|
1713
1713
|
code: 'A361',
|
|
1714
|
-
message: '
|
|
1715
|
-
httpCode:
|
|
1714
|
+
message: 'Операция невозможна, аккаунт был удалён',
|
|
1715
|
+
httpCode: 400,
|
|
1716
1716
|
},
|
|
1717
|
-
|
|
1717
|
+
TELEGRAM_PROFILE_DELETE_ERROR: {
|
|
1718
1718
|
code: 'A362',
|
|
1719
|
-
message: 'Произошла ошибка при
|
|
1719
|
+
message: 'Произошла ошибка при удалении Telegram профиля',
|
|
1720
1720
|
httpCode: 500,
|
|
1721
1721
|
},
|
|
1722
|
-
|
|
1722
|
+
TOOL_NOT_FOUND_ERROR: {
|
|
1723
1723
|
code: 'A363',
|
|
1724
|
-
message: '
|
|
1725
|
-
httpCode:
|
|
1726
|
-
},
|
|
1727
|
-
WRITER_DELETE_DOCUMENT_ERROR: {
|
|
1728
|
-
code: 'A364',
|
|
1729
|
-
message: 'Произошла ошибка при удалении документа',
|
|
1730
|
-
httpCode: 500,
|
|
1731
|
-
},
|
|
1732
|
-
WRITER_DELETE_ALL_DOCUMENTS_ERROR: {
|
|
1733
|
-
code: 'A365',
|
|
1734
|
-
message: 'Произошла ошибка при удалении всех документов пользователя',
|
|
1735
|
-
httpCode: 500,
|
|
1736
|
-
},
|
|
1737
|
-
WRITER_UPDATE_DOCUMENT_OUTLINE_ERROR: {
|
|
1738
|
-
code: 'A366',
|
|
1739
|
-
message: 'Произошла ошибка при обновлении структуры документа',
|
|
1740
|
-
httpCode: 500,
|
|
1741
|
-
},
|
|
1742
|
-
WRITER_GENERATE_DOCUMENT_CONTENTS_ERROR: {
|
|
1743
|
-
code: 'A367',
|
|
1744
|
-
message: 'Произошла ошибка при генерации содержимого документа',
|
|
1745
|
-
httpCode: 500,
|
|
1724
|
+
message: 'Инструмент не найден',
|
|
1725
|
+
httpCode: 404,
|
|
1746
1726
|
},
|
|
1747
1727
|
};
|
package/constants/index.ts
CHANGED
package/models/page.schema.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const PageSchema = z.object({
|
|
|
11
11
|
alias: z.string().min(3).max(16384),
|
|
12
12
|
categoryId: z.string().uuid().nullable().optional(),
|
|
13
13
|
aIModelId: z.string().uuid().nullable().optional(),
|
|
14
|
+
toolId: z.string().uuid().nullable().optional(),
|
|
14
15
|
type: z.nativeEnum(PageType),
|
|
15
16
|
|
|
16
17
|
createdAt: z.date(),
|
package/models/tools/index.ts
CHANGED
package/models/user.schema.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const WRITER_CONTROLLER_PRIVATE = 'private/tools/writer' as const;
|
|
2
|
-
export const WRITER_CONTROLLER_PUBLIC = 'public/tools/writer' as const;
|
|
3
|
-
|
|
4
|
-
export const WRITER_ROUTES = {
|
|
5
|
-
CONFIG: 'config',
|
|
6
|
-
CREATE: 'documents',
|
|
7
|
-
GET_DOCUMENTS: 'documents',
|
|
8
|
-
GET_DOCUMENT: (uuid: string) => `documents/${uuid}`,
|
|
9
|
-
GENERATE_CONTENTS: (uuid: string) => `documents/${uuid}/generate`,
|
|
10
|
-
UPDATE_OUTLINE: (uuid: string) => `documents/${uuid}/outline`,
|
|
11
|
-
DELETE_DOCUMENT: (uuid: string) => `documents/${uuid}`,
|
|
12
|
-
DELETE_ALL_DOCUMENTS: 'documents',
|
|
13
|
-
} as const;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WRITER_ROUTES = exports.WRITER_CONTROLLER_PUBLIC = exports.WRITER_CONTROLLER_PRIVATE = void 0;
|
|
4
|
-
exports.WRITER_CONTROLLER_PRIVATE = 'private/tools/writer';
|
|
5
|
-
exports.WRITER_CONTROLLER_PUBLIC = 'public/tools/writer';
|
|
6
|
-
exports.WRITER_ROUTES = {
|
|
7
|
-
CONFIG: 'config',
|
|
8
|
-
CREATE: 'documents',
|
|
9
|
-
GET_DOCUMENTS: 'documents',
|
|
10
|
-
GET_DOCUMENT: (uuid) => `documents/${uuid}`,
|
|
11
|
-
GENERATE_CONTENTS: (uuid) => `documents/${uuid}/generate`,
|
|
12
|
-
UPDATE_OUTLINE: (uuid) => `documents/${uuid}/outline`,
|
|
13
|
-
DELETE_DOCUMENT: (uuid) => `documents/${uuid}`,
|
|
14
|
-
DELETE_ALL_DOCUMENTS: 'documents',
|
|
15
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateWriterDocumentCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var CreateWriterDocumentCommand;
|
|
7
|
-
(function (CreateWriterDocumentCommand) {
|
|
8
|
-
CreateWriterDocumentCommand.RequestSchema = zod_1.z.object({
|
|
9
|
-
topic: zod_1.z.string(),
|
|
10
|
-
numPages: zod_1.z.number(),
|
|
11
|
-
documentTypeId: zod_1.z.string(),
|
|
12
|
-
});
|
|
13
|
-
CreateWriterDocumentCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
-
data: models_1.WriterDocumentSchema,
|
|
15
|
-
});
|
|
16
|
-
})(CreateWriterDocumentCommand || (exports.CreateWriterDocumentCommand = CreateWriterDocumentCommand = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeleteAllWriterDocumentsCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
var DeleteAllWriterDocumentsCommand;
|
|
6
|
-
(function (DeleteAllWriterDocumentsCommand) {
|
|
7
|
-
DeleteAllWriterDocumentsCommand.ResponseSchema = zod_1.z.void();
|
|
8
|
-
})(DeleteAllWriterDocumentsCommand || (exports.DeleteAllWriterDocumentsCommand = DeleteAllWriterDocumentsCommand = {}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeleteWriterDocumentByUUIDCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
var DeleteWriterDocumentByUUIDCommand;
|
|
6
|
-
(function (DeleteWriterDocumentByUUIDCommand) {
|
|
7
|
-
DeleteWriterDocumentByUUIDCommand.RequestParamsSchema = zod_1.z.object({
|
|
8
|
-
uuid: zod_1.z.string().uuid(),
|
|
9
|
-
});
|
|
10
|
-
DeleteWriterDocumentByUUIDCommand.ResponseSchema = zod_1.z.void();
|
|
11
|
-
})(DeleteWriterDocumentByUUIDCommand || (exports.DeleteWriterDocumentByUUIDCommand = DeleteWriterDocumentByUUIDCommand = {}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FindWriterDocumentByUUIDCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var FindWriterDocumentByUUIDCommand;
|
|
7
|
-
(function (FindWriterDocumentByUUIDCommand) {
|
|
8
|
-
FindWriterDocumentByUUIDCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
-
uuid: zod_1.z.string().uuid(),
|
|
10
|
-
});
|
|
11
|
-
FindWriterDocumentByUUIDCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
data: models_1.WriterDocumentSchema,
|
|
13
|
-
});
|
|
14
|
-
})(FindWriterDocumentByUUIDCommand || (exports.FindWriterDocumentByUUIDCommand = FindWriterDocumentByUUIDCommand = {}));
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FindWriterDocumentsCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var FindWriterDocumentsCommand;
|
|
7
|
-
(function (FindWriterDocumentsCommand) {
|
|
8
|
-
FindWriterDocumentsCommand.RequestQuerySchema = zod_1.z.object({
|
|
9
|
-
limit: zod_1.z.coerce.number().min(1).optional(),
|
|
10
|
-
offset: zod_1.z.coerce.number().min(0).default(0).optional(),
|
|
11
|
-
title: zod_1.z.string().optional(),
|
|
12
|
-
});
|
|
13
|
-
FindWriterDocumentsCommand.ResponseSchema = zod_1.z.object({
|
|
14
|
-
data: zod_1.z.array(models_1.WriterDocumentSchema),
|
|
15
|
-
totalPages: zod_1.z.number(),
|
|
16
|
-
page: zod_1.z.number(),
|
|
17
|
-
});
|
|
18
|
-
})(FindWriterDocumentsCommand || (exports.FindWriterDocumentsCommand = FindWriterDocumentsCommand = {}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GenerateWriterDocumentContentsCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var GenerateWriterDocumentContentsCommand;
|
|
7
|
-
(function (GenerateWriterDocumentContentsCommand) {
|
|
8
|
-
GenerateWriterDocumentContentsCommand.RequestParamsSchema = zod_1.z.object({
|
|
9
|
-
uuid: zod_1.z.string().uuid(),
|
|
10
|
-
});
|
|
11
|
-
GenerateWriterDocumentContentsCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
data: models_1.WriterDocumentSchema,
|
|
13
|
-
});
|
|
14
|
-
})(GenerateWriterDocumentContentsCommand || (exports.GenerateWriterDocumentContentsCommand = GenerateWriterDocumentContentsCommand = {}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GetWriterToolConfigCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var GetWriterToolConfigCommand;
|
|
7
|
-
(function (GetWriterToolConfigCommand) {
|
|
8
|
-
GetWriterToolConfigCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
-
data: models_1.WriterConfigSchema,
|
|
10
|
-
});
|
|
11
|
-
})(GetWriterToolConfigCommand || (exports.GetWriterToolConfigCommand = GetWriterToolConfigCommand = {}));
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-writer-tool-config.command"), exports);
|
|
18
|
-
__exportStar(require("./create-writer-document.command"), exports);
|
|
19
|
-
__exportStar(require("./find-writer-document-by-uuid.command"), exports);
|
|
20
|
-
__exportStar(require("./find-writer-documents.command"), exports);
|
|
21
|
-
__exportStar(require("./generate-writer-document-contents.command"), exports);
|
|
22
|
-
__exportStar(require("./update-writer-document-outline.command"), exports);
|
|
23
|
-
__exportStar(require("./delete-writer-document-by-uuid.command"), exports);
|
|
24
|
-
__exportStar(require("./delete-all-writer-documents.command"), exports);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateWriterDocumentOutlineCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var UpdateWriterDocumentOutlineCommand;
|
|
7
|
-
(function (UpdateWriterDocumentOutlineCommand) {
|
|
8
|
-
UpdateWriterDocumentOutlineCommand.RequestBodySchema = zod_1.z.object({
|
|
9
|
-
data: models_1.WriterDocumentOutlineSchema,
|
|
10
|
-
});
|
|
11
|
-
UpdateWriterDocumentOutlineCommand.RequestParamsSchema = zod_1.z.object({
|
|
12
|
-
uuid: zod_1.z.string().uuid(),
|
|
13
|
-
});
|
|
14
|
-
UpdateWriterDocumentOutlineCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
-
data: zod_1.z.array(models_1.WriterDocumentOutlineSectionSchema),
|
|
16
|
-
});
|
|
17
|
-
})(UpdateWriterDocumentOutlineCommand || (exports.UpdateWriterDocumentOutlineCommand = UpdateWriterDocumentOutlineCommand = {}));
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./writer-document-section-type.enum"), exports);
|
|
18
|
-
__exportStar(require("./writer-document-stage.enum"), exports);
|
|
19
|
-
__exportStar(require("./writer-ai-operation-pricing-type.enum"), exports);
|
|
20
|
-
__exportStar(require("./writer-ai-operation-type.enum"), exports);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WRITER_AI_OPERATION_PRICING_TYPE = void 0;
|
|
4
|
-
var WRITER_AI_OPERATION_PRICING_TYPE;
|
|
5
|
-
(function (WRITER_AI_OPERATION_PRICING_TYPE) {
|
|
6
|
-
WRITER_AI_OPERATION_PRICING_TYPE["PER_CHARACTER"] = "PER_CHARACTER";
|
|
7
|
-
WRITER_AI_OPERATION_PRICING_TYPE["FLAT"] = "FLAT";
|
|
8
|
-
})(WRITER_AI_OPERATION_PRICING_TYPE || (exports.WRITER_AI_OPERATION_PRICING_TYPE = WRITER_AI_OPERATION_PRICING_TYPE = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WRITER_AI_OPERATION_TYPE = void 0;
|
|
4
|
-
var WRITER_AI_OPERATION_TYPE;
|
|
5
|
-
(function (WRITER_AI_OPERATION_TYPE) {
|
|
6
|
-
WRITER_AI_OPERATION_TYPE["PARAPHRASE"] = "PARAPHRASE";
|
|
7
|
-
WRITER_AI_OPERATION_TYPE["EXTEND_TEXT"] = "EXTEND_TEXT";
|
|
8
|
-
WRITER_AI_OPERATION_TYPE["GENERATE_TEXT"] = "GENERATE_TEXT";
|
|
9
|
-
})(WRITER_AI_OPERATION_TYPE || (exports.WRITER_AI_OPERATION_TYPE = WRITER_AI_OPERATION_TYPE = {}));
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WRITER_DOCUMENT_SECTION_TYPE = void 0;
|
|
4
|
-
var WRITER_DOCUMENT_SECTION_TYPE;
|
|
5
|
-
(function (WRITER_DOCUMENT_SECTION_TYPE) {
|
|
6
|
-
WRITER_DOCUMENT_SECTION_TYPE["INTRODUCTION"] = "introduction";
|
|
7
|
-
WRITER_DOCUMENT_SECTION_TYPE["CONCLUSION"] = "conclusion";
|
|
8
|
-
WRITER_DOCUMENT_SECTION_TYPE["SECTION"] = "section";
|
|
9
|
-
})(WRITER_DOCUMENT_SECTION_TYPE || (exports.WRITER_DOCUMENT_SECTION_TYPE = WRITER_DOCUMENT_SECTION_TYPE = {}));
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WRITER_DOCUMENT_STAGE = void 0;
|
|
4
|
-
var WRITER_DOCUMENT_STAGE;
|
|
5
|
-
(function (WRITER_DOCUMENT_STAGE) {
|
|
6
|
-
WRITER_DOCUMENT_STAGE["CREATED"] = "CREATED";
|
|
7
|
-
WRITER_DOCUMENT_STAGE["GENERATING_OUTLINE"] = "GENERATING_OUTLINE";
|
|
8
|
-
WRITER_DOCUMENT_STAGE["OUTLINE_GENERATED"] = "OUTLINE_GENERATED";
|
|
9
|
-
WRITER_DOCUMENT_STAGE["OUTLINE_GENERATION_FAILED"] = "OUTLINE_GENERATION_FAILED";
|
|
10
|
-
WRITER_DOCUMENT_STAGE["GENERATING_CONTENT"] = "GENERATING_CONTENT";
|
|
11
|
-
WRITER_DOCUMENT_STAGE["CONTENT_GENERATED"] = "CONTENT_GENERATED";
|
|
12
|
-
WRITER_DOCUMENT_STAGE["CONTENT_GENERATION_FAILED"] = "CONTENT_GENERATION_FAILED";
|
|
13
|
-
WRITER_DOCUMENT_STAGE["DELETED"] = "DELETED";
|
|
14
|
-
})(WRITER_DOCUMENT_STAGE || (exports.WRITER_DOCUMENT_STAGE = WRITER_DOCUMENT_STAGE = {}));
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./enums"), exports);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./writer-config.schema"), exports);
|
|
18
|
-
__exportStar(require("./writer-ai-operation.schema"), exports);
|
|
19
|
-
__exportStar(require("./writer-document-outline.schema"), exports);
|
|
20
|
-
__exportStar(require("./writer-document.schema"), exports);
|
|
21
|
-
__exportStar(require("./writer-document-type.schema"), exports);
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriterAiOperationSchema = exports.WriterAiOperationPricingRulesSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../../../constants");
|
|
6
|
-
exports.WriterAiOperationPricingRulesSchema = zod_1.z.discriminatedUnion('type', [
|
|
7
|
-
zod_1.z.object({
|
|
8
|
-
type: zod_1.z.literal(constants_1.WRITER_AI_OPERATION_PRICING_TYPE.PER_CHARACTER),
|
|
9
|
-
price: zod_1.z.number(),
|
|
10
|
-
}),
|
|
11
|
-
zod_1.z.object({
|
|
12
|
-
type: zod_1.z.literal(constants_1.WRITER_AI_OPERATION_PRICING_TYPE.FLAT),
|
|
13
|
-
price: zod_1.z.number(),
|
|
14
|
-
}),
|
|
15
|
-
]);
|
|
16
|
-
exports.WriterAiOperationSchema = zod_1.z.object({
|
|
17
|
-
uuid: zod_1.z.string(),
|
|
18
|
-
type: zod_1.z.nativeEnum(constants_1.WRITER_AI_OPERATION_TYPE),
|
|
19
|
-
pricingRules: exports.WriterAiOperationPricingRulesSchema,
|
|
20
|
-
maxPromptLength: zod_1.z.number(),
|
|
21
|
-
title: zod_1.z.string(),
|
|
22
|
-
icon: zod_1.z.string(),
|
|
23
|
-
order: zod_1.z.number(),
|
|
24
|
-
createdAt: zod_1.z.date(),
|
|
25
|
-
updatedAt: zod_1.z.date(),
|
|
26
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriterConfigSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const writer_document_type_schema_1 = require("./writer-document-type.schema");
|
|
6
|
-
const writer_ai_operation_schema_1 = require("./writer-ai-operation.schema");
|
|
7
|
-
exports.WriterConfigSchema = zod_1.z.object({
|
|
8
|
-
minPages: zod_1.z.number(),
|
|
9
|
-
maxPages: zod_1.z.number(),
|
|
10
|
-
maxTopicLength: zod_1.z.number(),
|
|
11
|
-
documentTypes: zod_1.z.array(writer_document_type_schema_1.WriterDocumentTypeSchema),
|
|
12
|
-
aiOperations: zod_1.z.array(writer_ai_operation_schema_1.WriterAiOperationSchema),
|
|
13
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriterDocumentOutlineSchema = exports.WriterDocumentOutlineSectionSchema = exports.WriterDocumentOutlineSubsectionSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const constants_1 = require("../../../constants");
|
|
6
|
-
exports.WriterDocumentOutlineSubsectionSchema = zod_1.z.object({
|
|
7
|
-
title: zod_1.z
|
|
8
|
-
.string()
|
|
9
|
-
.min(3)
|
|
10
|
-
.max(120)
|
|
11
|
-
.describe(`Concise title of the subsection. Meant to elaborate on its parent section's title.`),
|
|
12
|
-
});
|
|
13
|
-
exports.WriterDocumentOutlineSectionSchema = zod_1.z.object({
|
|
14
|
-
title: zod_1.z.string().min(3).max(120).describe(`Concise title of the paper section.`),
|
|
15
|
-
type: zod_1.z.nativeEnum(constants_1.WRITER_DOCUMENT_SECTION_TYPE),
|
|
16
|
-
subsections: zod_1.z
|
|
17
|
-
.array(exports.WriterDocumentOutlineSubsectionSchema)
|
|
18
|
-
.optional()
|
|
19
|
-
.describe(`Subsections of the paper section. Each subsection is a single idea that is a part of the parent section.`),
|
|
20
|
-
});
|
|
21
|
-
exports.WriterDocumentOutlineSchema = zod_1.z.array(exports.WriterDocumentOutlineSectionSchema);
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriterDocumentTypeSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
exports.WriterDocumentTypeSchema = zod_1.z.object({
|
|
6
|
-
uuid: zod_1.z.string().uuid(),
|
|
7
|
-
title: zod_1.z.string(),
|
|
8
|
-
icon: zod_1.z.string(),
|
|
9
|
-
order: zod_1.z.number(),
|
|
10
|
-
promptInstructions: zod_1.z.string().nullable(),
|
|
11
|
-
createdAt: zod_1.z.date(),
|
|
12
|
-
updatedAt: zod_1.z.date(),
|
|
13
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WriterDocumentSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const writer_document_outline_schema_1 = require("./writer-document-outline.schema");
|
|
6
|
-
const constants_1 = require("../../../constants");
|
|
7
|
-
exports.WriterDocumentSchema = zod_1.z.object({
|
|
8
|
-
uuid: zod_1.z.string(),
|
|
9
|
-
prompt: zod_1.z.string(),
|
|
10
|
-
topic: zod_1.z.string(),
|
|
11
|
-
typeId: zod_1.z.string(),
|
|
12
|
-
stage: zod_1.z.nativeEnum(constants_1.WRITER_DOCUMENT_STAGE),
|
|
13
|
-
outline: writer_document_outline_schema_1.WriterDocumentOutlineSchema,
|
|
14
|
-
sourceMd: zod_1.z.string().nullable(),
|
|
15
|
-
finalMd: zod_1.z.string().nullable(),
|
|
16
|
-
userId: zod_1.z.string().nullable(),
|
|
17
|
-
unregisteredUserId: zod_1.z.string().nullable(),
|
|
18
|
-
createdAt: zod_1.z.date(),
|
|
19
|
-
updatedAt: zod_1.z.date(),
|
|
20
|
-
completedAt: zod_1.z.date().nullable(),
|
|
21
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
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 './delete-writer-document-by-uuid.command';
|
|
8
|
-
export * from './delete-all-writer-documents.command';
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './enums';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { WRITER_AI_OPERATION_PRICING_TYPE, WRITER_AI_OPERATION_TYPE } from '../../../constants';
|
|
3
|
-
|
|
4
|
-
export const WriterAiOperationPricingRulesSchema = z.discriminatedUnion('type', [
|
|
5
|
-
z.object({
|
|
6
|
-
type: z.literal(WRITER_AI_OPERATION_PRICING_TYPE.PER_CHARACTER),
|
|
7
|
-
price: z.number(),
|
|
8
|
-
}),
|
|
9
|
-
z.object({
|
|
10
|
-
type: z.literal(WRITER_AI_OPERATION_PRICING_TYPE.FLAT),
|
|
11
|
-
price: z.number(),
|
|
12
|
-
}),
|
|
13
|
-
]);
|
|
14
|
-
|
|
15
|
-
export const WriterAiOperationSchema = z.object({
|
|
16
|
-
uuid: z.string(),
|
|
17
|
-
type: z.nativeEnum(WRITER_AI_OPERATION_TYPE),
|
|
18
|
-
pricingRules: WriterAiOperationPricingRulesSchema,
|
|
19
|
-
maxPromptLength: z.number(),
|
|
20
|
-
title: z.string(),
|
|
21
|
-
icon: z.string(),
|
|
22
|
-
order: z.number(),
|
|
23
|
-
createdAt: z.date(),
|
|
24
|
-
updatedAt: z.date(),
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export type WriterAIOperation = z.infer<typeof WriterAiOperationSchema>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { WriterDocumentTypeSchema } from './writer-document-type.schema';
|
|
3
|
-
import { WriterAiOperationSchema } from './writer-ai-operation.schema';
|
|
4
|
-
|
|
5
|
-
export const WriterConfigSchema = z.object({
|
|
6
|
-
minPages: z.number(),
|
|
7
|
-
maxPages: z.number(),
|
|
8
|
-
maxTopicLength: z.number(),
|
|
9
|
-
documentTypes: z.array(WriterDocumentTypeSchema),
|
|
10
|
-
aiOperations: z.array(WriterAiOperationSchema),
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export type WriterConfig = z.infer<typeof WriterConfigSchema>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { WRITER_DOCUMENT_SECTION_TYPE } from '../../../constants';
|
|
3
|
-
|
|
4
|
-
export const WriterDocumentOutlineSubsectionSchema = z.object({
|
|
5
|
-
title: z
|
|
6
|
-
.string()
|
|
7
|
-
.min(3)
|
|
8
|
-
.max(120)
|
|
9
|
-
.describe(
|
|
10
|
-
`Concise title of the subsection. Meant to elaborate on its parent section's title.`,
|
|
11
|
-
),
|
|
12
|
-
});
|
|
13
|
-
export type WriterDocumentOutlineSubsection = z.infer<typeof WriterDocumentOutlineSubsectionSchema>;
|
|
14
|
-
|
|
15
|
-
export const WriterDocumentOutlineSectionSchema = z.object({
|
|
16
|
-
title: z.string().min(3).max(120).describe(`Concise title of the paper section.`),
|
|
17
|
-
type: z.nativeEnum(WRITER_DOCUMENT_SECTION_TYPE),
|
|
18
|
-
subsections: z
|
|
19
|
-
.array(WriterDocumentOutlineSubsectionSchema)
|
|
20
|
-
.optional()
|
|
21
|
-
.describe(
|
|
22
|
-
`Subsections of the paper section. Each subsection is a single idea that is a part of the parent section.`,
|
|
23
|
-
),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export const WriterDocumentOutlineSchema = z.array(WriterDocumentOutlineSectionSchema);
|
|
27
|
-
|
|
28
|
-
export type WriterDocumentOutline = z.infer<typeof WriterDocumentOutlineSchema>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const WriterDocumentTypeSchema = z.object({
|
|
4
|
-
uuid: z.string().uuid(),
|
|
5
|
-
title: z.string(),
|
|
6
|
-
icon: z.string(),
|
|
7
|
-
order: z.number(),
|
|
8
|
-
promptInstructions: z.string().nullable(),
|
|
9
|
-
createdAt: z.date(),
|
|
10
|
-
updatedAt: z.date(),
|
|
11
|
-
});
|
|
12
|
-
export type WriterDocumentType = z.infer<typeof WriterDocumentTypeSchema>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { WriterDocumentOutlineSchema } from './writer-document-outline.schema';
|
|
3
|
-
import { WRITER_DOCUMENT_STAGE } from '../../../constants';
|
|
4
|
-
|
|
5
|
-
export const WriterDocumentSchema = z.object({
|
|
6
|
-
uuid: z.string(),
|
|
7
|
-
prompt: z.string(),
|
|
8
|
-
topic: z.string(),
|
|
9
|
-
typeId: z.string(),
|
|
10
|
-
stage: z.nativeEnum(WRITER_DOCUMENT_STAGE),
|
|
11
|
-
outline: WriterDocumentOutlineSchema,
|
|
12
|
-
sourceMd: z.string().nullable(),
|
|
13
|
-
finalMd: z.string().nullable(),
|
|
14
|
-
userId: z.string().nullable(),
|
|
15
|
-
unregisteredUserId: z.string().nullable(),
|
|
16
|
-
createdAt: z.date(),
|
|
17
|
-
updatedAt: z.date(),
|
|
18
|
-
completedAt: z.date().nullable(),
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
export type WriterDocument = z.infer<typeof WriterDocumentSchema>;
|