@purpleschool/gptbot 0.12.71 → 0.12.72-stage-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/controllers/http/blog.ts +4 -0
- package/api/controllers/http/canvas-template.ts +0 -1
- package/api/controllers/http/category.ts +4 -0
- package/api/controllers/http/course.ts +12 -0
- package/api/controllers/http/index.ts +0 -1
- package/api/controllers/http/page.ts +4 -0
- package/api/controllers/http/prompt-category.ts +4 -0
- package/api/controllers/http/prompt-topic.ts +4 -0
- package/api/controllers/http/prompt.ts +4 -0
- package/api/controllers/http/question.ts +4 -0
- package/api/controllers/http/team-account.ts +1 -0
- package/api/routes.ts +68 -5
- package/build/api/controllers/http/blog.js +3 -0
- package/build/api/controllers/http/canvas-template.js +0 -1
- package/build/api/controllers/http/category.js +3 -0
- package/build/api/controllers/http/course.js +9 -0
- package/build/api/controllers/http/index.js +0 -1
- package/build/api/controllers/http/page.js +3 -0
- package/build/api/controllers/http/prompt-category.js +3 -0
- package/build/api/controllers/http/prompt-topic.js +3 -0
- package/build/api/controllers/http/prompt.js +3 -0
- package/build/api/controllers/http/question.js +3 -0
- package/build/api/controllers/http/team-account.js +1 -0
- package/build/api/routes.js +34 -5
- package/build/commands/blog/create-post-translation.command.js +23 -0
- package/build/commands/blog/create-post.command.js +6 -0
- package/build/commands/blog/get-all-post-translations.query.js +14 -0
- package/build/commands/blog/index.js +3 -0
- package/build/commands/blog/update-post-translation.command.js +23 -0
- package/build/commands/blog/update-post.command.js +6 -0
- package/build/commands/cabinet/get-user-statistics-by-month.command.js +6 -13
- package/build/commands/cabinet/get-user-statistics-overview.command.js +5 -1
- package/build/commands/{ai-studio/canvas → canvas}/create-canvas.command.js +1 -1
- package/build/commands/{ai-studio/canvas → canvas}/delete-canvas.command.js +1 -1
- package/build/commands/{ai-studio/canvas → canvas}/find-canvas-by-uuid-with-relations.query.js +1 -1
- package/build/commands/{ai-studio/canvas → canvas}/find-canvas-by-uuid.query.js +1 -1
- package/build/commands/{ai-studio/canvas → canvas}/find-canvases-by-user.query.js +1 -1
- package/build/commands/{ai-studio/canvas → canvas}/run-canvas.command.js +1 -1
- package/build/commands/{ai-studio/canvas → canvas}/save-canvas.command.js +4 -8
- package/build/commands/{ai-studio/canvas → canvas}/update-canvas.command.js +1 -1
- package/build/commands/{ai-studio/canvas-edge → canvas-edge}/create-canvas-edge.command.js +2 -2
- package/build/commands/{ai-studio/canvas-edge → canvas-edge}/find-canvas-edge-by-source-and-target.query.js +1 -1
- package/build/commands/{ai-studio/canvas-edge → canvas-edge}/find-canvas-edges-by-canvas.query.js +1 -1
- package/build/commands/{ai-studio/canvas-node → canvas-node}/create-canvas-node.command.js +4 -8
- package/build/commands/{ai-studio/canvas-node → canvas-node}/delete-canvas-node.command.js +2 -2
- package/build/commands/{ai-studio/canvas-node → canvas-node}/find-canvas-node-by-uuid.query.js +2 -2
- package/build/commands/{ai-studio/canvas-node → canvas-node}/find-canvas-node-definitions-with-configs.query.js +1 -1
- package/build/commands/{ai-studio/canvas-node → canvas-node}/find-canvas-nodes-by-canvas.query.js +1 -1
- package/build/commands/{ai-studio/canvas-node → canvas-node}/update-canvas-node.command.js +5 -13
- package/build/commands/{ai-studio/canvas-template → canvas-template}/create-canvas-from-template.command.js +1 -1
- package/build/commands/{ai-studio/canvas-template → canvas-template}/create-canvas-template.command.js +2 -6
- package/build/commands/{ai-studio/canvas-template → canvas-template}/delete-canvas-template.command.js +2 -3
- package/build/commands/{ai-studio/canvas-template → canvas-template}/find-canvas-template-by-uuid.query.js +1 -1
- package/build/commands/{ai-studio/canvas-template → canvas-template}/find-canvas-templates.query.js +1 -6
- package/build/commands/{ai-studio/canvas-template → canvas-template}/index.js +1 -2
- package/build/commands/{ai-studio/canvas-template → canvas-template}/update-canvas-template.command.js +2 -6
- package/build/commands/category/create-category-translation.command.js +21 -0
- package/build/commands/category/create-category.command.js +4 -0
- package/build/commands/category/get-all-category-translations.query.js +14 -0
- package/build/commands/category/index.js +3 -0
- package/build/commands/category/update-category-translation.command.js +21 -0
- package/build/commands/category/update-category.command.js +4 -0
- package/build/commands/course/create-course-translation.command.js +22 -0
- package/build/commands/course/create-course.command.js +5 -0
- package/build/commands/course/create-lesson-translation.command.js +18 -0
- package/build/commands/course/create-section-translation.command.js +18 -0
- package/build/commands/course/get-all-course-translations.query.js +14 -0
- package/build/commands/course/get-all-lesson-translations.query.js +14 -0
- package/build/commands/course/get-all-section-translations.query.js +14 -0
- package/build/commands/course/index.js +9 -0
- package/build/commands/course/update-course-translation.command.js +22 -0
- package/build/commands/course/update-lesson-translation.command.js +18 -0
- package/build/commands/course/update-section-translation.command.js +18 -0
- package/build/commands/index.js +4 -5
- package/build/commands/page/create-page-translation.command.js +23 -0
- package/build/commands/page/create-page.command.js +6 -0
- package/build/commands/page/find-page.command.js +10 -2
- package/build/commands/page/get-all-page-translations.query.js +14 -0
- package/build/commands/page/index.js +3 -0
- package/build/commands/page/update-page-translation.command.js +23 -0
- package/build/commands/page/update-page.command.js +5 -0
- package/build/commands/prompt/create-prompt-translation.command.js +19 -0
- package/build/commands/prompt/create-prompt.command.js +2 -0
- package/build/commands/prompt/get-all-prompt-translations.query.js +14 -0
- package/build/commands/prompt/index.js +3 -0
- package/build/commands/prompt/update-prompt-translation.command.js +19 -0
- package/build/commands/prompt/update-prompt.command.js +2 -0
- package/build/commands/prompt-category/create-prompt-category-translation.command.js +20 -0
- package/build/commands/prompt-category/create-prompt-category.command.js +3 -0
- package/build/commands/prompt-category/get-all-prompt-category-translations.query.js +14 -0
- package/build/commands/prompt-category/index.js +3 -0
- package/build/commands/prompt-category/update-prompt-category-translation.command.js +20 -0
- package/build/commands/prompt-category/update-prompt-category.command.js +3 -0
- package/build/commands/prompt-topic/create-prompt-topic-translation.command.js +22 -0
- package/build/commands/prompt-topic/create-prompt-topic.command.js +5 -0
- package/build/commands/prompt-topic/get-all-prompt-topic-translations.query.js +14 -0
- package/build/commands/prompt-topic/index.js +3 -0
- package/build/commands/prompt-topic/update-prompt-topic-translation.command.js +22 -0
- package/build/commands/prompt-topic/update-prompt-topic.command.js +5 -0
- package/build/commands/question/create-question-translation.command.js +19 -0
- package/build/commands/question/create-question.command.js +2 -0
- package/build/commands/question/get-all-question-translations.query.js +14 -0
- package/build/commands/question/index.js +3 -0
- package/build/commands/question/update-question-translation.command.js +19 -0
- package/build/commands/question/update-question.command.js +2 -0
- package/build/commands/team-account/get-team-account-statistics-by-month.command.js +6 -13
- package/build/commands/team-account/get-team-account-statistics-overview.command.js +5 -1
- package/build/commands/team-account/index.js +1 -0
- package/build/commands/team-account/update-team-account-invite.command.js +17 -0
- package/build/commands/ui-notification/create-admin-broadcast-ui-notification.command.js +9 -2
- package/build/commands/unregistered-user/patch-locale.command.js +3 -3
- package/build/commands/user/get-me.command.js +2 -1
- package/build/commands/user/patch-locale.command.js +3 -3
- package/build/commands/user/send-telegram-notification.command.js +6 -1
- package/build/constants/cabinet/enums/index.js +1 -0
- package/build/constants/cabinet/enums/statistics-request-type.enum.js +24 -0
- package/build/constants/subscription/enums/index.js +1 -0
- package/build/constants/subscription/enums/subscription-balance-field.enum.js +8 -0
- package/build/constants/tool/enums/index.js +0 -1
- package/build/constants/user/enums/index.js +0 -1
- package/build/models/canvas-node.schema.js +37 -140
- package/build/models/canvas-template.schema.js +5 -21
- package/build/models/category-translation.schema.js +16 -0
- package/build/models/course-translation.schema.js +17 -0
- package/build/models/index.js +10 -0
- package/build/models/lesson-translation.schema.js +13 -0
- package/build/models/page-translation.schema.js +18 -0
- package/build/models/post-translation.schema.js +18 -0
- package/build/models/prompt-category-translation.schema.js +18 -0
- package/build/models/prompt-topic-translation.schema.js +20 -0
- package/build/models/prompt-translation.schema.js +14 -0
- package/build/models/question-translation.schema.js +14 -0
- package/build/models/section-translation.schema.js +13 -0
- package/build/models/ui-notification.schema.js +13 -8
- package/build/models/user.schema.js +2 -2
- package/commands/blog/create-post-translation.command.ts +28 -0
- package/commands/blog/create-post.command.ts +6 -0
- package/commands/blog/get-all-post-translations.query.ts +16 -0
- package/commands/blog/index.ts +3 -0
- package/commands/blog/update-post-translation.command.ts +28 -0
- package/commands/blog/update-post.command.ts +6 -0
- package/commands/cabinet/get-user-statistics-by-month.command.ts +7 -14
- package/commands/cabinet/get-user-statistics-overview.command.ts +6 -2
- package/commands/{ai-studio/canvas → canvas}/create-canvas.command.ts +1 -1
- package/commands/{ai-studio/canvas → canvas}/delete-canvas.command.ts +1 -1
- package/commands/{ai-studio/canvas → canvas}/find-canvas-by-uuid-with-relations.query.ts +1 -1
- package/commands/{ai-studio/canvas → canvas}/find-canvas-by-uuid.query.ts +1 -1
- package/commands/{ai-studio/canvas → canvas}/find-canvases-by-user.query.ts +1 -1
- package/commands/{ai-studio/canvas → canvas}/run-canvas.command.ts +1 -1
- package/commands/{ai-studio/canvas → canvas}/save-canvas.command.ts +9 -13
- package/commands/{ai-studio/canvas → canvas}/update-canvas.command.ts +1 -1
- package/commands/{ai-studio/canvas-edge → canvas-edge}/create-canvas-edge.command.ts +2 -2
- package/commands/{ai-studio/canvas-edge → canvas-edge}/find-canvas-edge-by-source-and-target.query.ts +1 -1
- package/commands/{ai-studio/canvas-edge → canvas-edge}/find-canvas-edges-by-canvas.query.ts +1 -1
- package/commands/canvas-node/create-canvas-node.command.ts +25 -0
- package/commands/{ai-studio/canvas-node → canvas-node}/delete-canvas-node.command.ts +2 -2
- package/commands/{ai-studio/canvas-node → canvas-node}/find-canvas-node-by-uuid.query.ts +2 -2
- package/commands/{ai-studio/canvas-node → canvas-node}/find-canvas-node-definitions-with-configs.query.ts +1 -1
- package/commands/{ai-studio/canvas-node → canvas-node}/find-canvas-nodes-by-canvas.query.ts +1 -1
- package/commands/canvas-node/update-canvas-node.command.ts +26 -0
- package/commands/{ai-studio/canvas-template → canvas-template}/create-canvas-from-template.command.ts +1 -1
- package/commands/{ai-studio/canvas-template → canvas-template}/create-canvas-template.command.ts +2 -7
- package/commands/{ai-studio/canvas-template → canvas-template}/delete-canvas-template.command.ts +2 -3
- package/commands/{ai-studio/canvas-template → canvas-template}/find-canvas-template-by-uuid.query.ts +1 -1
- package/commands/{ai-studio/canvas-template → canvas-template}/find-canvas-templates.query.ts +1 -6
- package/commands/{ai-studio/canvas-template → canvas-template}/index.ts +1 -2
- package/commands/{ai-studio/canvas-template → canvas-template}/update-canvas-template.command.ts +2 -11
- package/commands/category/create-category-translation.command.ts +26 -0
- package/commands/category/create-category.command.ts +4 -0
- package/commands/category/get-all-category-translations.query.ts +16 -0
- package/commands/category/index.ts +3 -0
- package/commands/category/update-category-translation.command.ts +26 -0
- package/commands/category/update-category.command.ts +4 -0
- package/commands/course/create-course-translation.command.ts +27 -0
- package/commands/course/create-course.command.ts +5 -0
- package/commands/course/create-lesson-translation.command.ts +23 -0
- package/commands/course/create-section-translation.command.ts +23 -0
- package/commands/course/get-all-course-translations.query.ts +16 -0
- package/commands/course/get-all-lesson-translations.query.ts +16 -0
- package/commands/course/get-all-section-translations.query.ts +16 -0
- package/commands/course/index.ts +9 -0
- package/commands/course/update-course-translation.command.ts +27 -0
- package/commands/course/update-lesson-translation.command.ts +23 -0
- package/commands/course/update-section-translation.command.ts +23 -0
- package/commands/index.ts +5 -5
- package/commands/page/create-page-translation.command.ts +28 -0
- package/commands/page/create-page.command.ts +6 -0
- package/commands/page/find-page.command.ts +15 -2
- package/commands/page/get-all-page-translations.query.ts +16 -0
- package/commands/page/index.ts +3 -0
- package/commands/page/update-page-translation.command.ts +28 -0
- package/commands/page/update-page.command.ts +5 -0
- package/commands/prompt/create-prompt-translation.command.ts +24 -0
- package/commands/prompt/create-prompt.command.ts +2 -0
- package/commands/prompt/get-all-prompt-translations.query.ts +16 -0
- package/commands/prompt/index.ts +3 -0
- package/commands/prompt/update-prompt-translation.command.ts +24 -0
- package/commands/prompt/update-prompt.command.ts +2 -0
- package/commands/prompt-category/create-prompt-category-translation.command.ts +25 -0
- package/commands/prompt-category/create-prompt-category.command.ts +3 -0
- package/commands/prompt-category/get-all-prompt-category-translations.query.ts +16 -0
- package/commands/prompt-category/index.ts +3 -0
- package/commands/prompt-category/update-prompt-category-translation.command.ts +25 -0
- package/commands/prompt-category/update-prompt-category.command.ts +3 -0
- package/commands/prompt-topic/create-prompt-topic-translation.command.ts +27 -0
- package/commands/prompt-topic/create-prompt-topic.command.ts +5 -0
- package/commands/prompt-topic/get-all-prompt-topic-translations.query.ts +16 -0
- package/commands/prompt-topic/index.ts +3 -0
- package/commands/prompt-topic/update-prompt-topic-translation.command.ts +27 -0
- package/commands/prompt-topic/update-prompt-topic.command.ts +5 -0
- package/commands/question/create-question-translation.command.ts +24 -0
- package/commands/question/create-question.command.ts +2 -0
- package/commands/question/get-all-question-translations.query.ts +16 -0
- package/commands/question/index.ts +3 -0
- package/commands/question/update-question-translation.command.ts +24 -0
- package/commands/question/update-question.command.ts +2 -0
- package/commands/team-account/get-team-account-statistics-by-month.command.ts +7 -14
- package/commands/team-account/get-team-account-statistics-overview.command.ts +6 -2
- package/commands/team-account/index.ts +1 -0
- package/commands/team-account/update-team-account-invite.command.ts +22 -0
- package/commands/ui-notification/create-admin-broadcast-ui-notification.command.ts +9 -2
- package/commands/unregistered-user/patch-locale.command.ts +1 -1
- package/commands/user/get-me.command.ts +2 -1
- package/commands/user/patch-locale.command.ts +1 -1
- package/commands/user/send-telegram-notification.command.ts +8 -1
- package/constants/cabinet/enums/index.ts +1 -0
- package/constants/cabinet/enums/statistics-request-type.enum.ts +20 -0
- package/constants/subscription/enums/index.ts +1 -0
- package/constants/subscription/enums/subscription-balance-field.enum.ts +4 -0
- package/constants/tool/enums/index.ts +0 -1
- package/constants/user/enums/index.ts +0 -1
- package/models/canvas-node.schema.ts +41 -167
- package/models/canvas-template.schema.ts +9 -28
- package/models/category-translation.schema.ts +14 -0
- package/models/course-translation.schema.ts +15 -0
- package/models/index.ts +10 -0
- package/models/lesson-translation.schema.ts +11 -0
- package/models/page-translation.schema.ts +16 -0
- package/models/post-translation.schema.ts +16 -0
- package/models/prompt-category-translation.schema.ts +13 -0
- package/models/prompt-topic-translation.schema.ts +15 -0
- package/models/prompt-translation.schema.ts +12 -0
- package/models/question-translation.schema.ts +12 -0
- package/models/section-translation.schema.ts +11 -0
- package/models/ui-notification.schema.ts +14 -7
- package/models/user.schema.ts +1 -1
- package/package.json +2 -1
- package/api/controllers/http/palette.ts +0 -6
- package/build/api/controllers/http/palette.js +0 -8
- package/build/commands/ai-studio/canvas-template/generate-canvas-template-by-prompt.command.js +0 -14
- package/build/commands/ai-studio/canvas-tool/index.js +0 -17
- package/build/commands/ai-studio/canvas-tool/palette/generate-palette.command.js +0 -20
- package/build/commands/ai-studio/canvas-tool/palette/get-palette-price.command.js +0 -17
- package/build/commands/ai-studio/canvas-tool/palette/index.js +0 -18
- package/build/commands/ai-studio/index.js +0 -21
- package/build/constants/tool/enums/job-request-origin.enum.js +0 -8
- package/build/constants/user/enums/locale.enum.js +0 -8
- package/commands/ai-studio/canvas-node/create-canvas-node.command.ts +0 -33
- package/commands/ai-studio/canvas-node/update-canvas-node.command.ts +0 -40
- package/commands/ai-studio/canvas-template/generate-canvas-template-by-prompt.command.ts +0 -16
- package/commands/ai-studio/canvas-tool/index.ts +0 -1
- package/commands/ai-studio/canvas-tool/palette/generate-palette.command.ts +0 -23
- package/commands/ai-studio/canvas-tool/palette/get-palette-price.command.ts +0 -17
- package/commands/ai-studio/canvas-tool/palette/index.ts +0 -2
- package/commands/ai-studio/index.ts +0 -5
- package/constants/tool/enums/job-request-origin.enum.ts +0 -4
- package/constants/user/enums/locale.enum.ts +0 -4
- /package/build/commands/{ai-studio/canvas → canvas}/index.js +0 -0
- /package/build/commands/{ai-studio/canvas-edge → canvas-edge}/delete-canvas-edge.command.js +0 -0
- /package/build/commands/{ai-studio/canvas-edge → canvas-edge}/index.js +0 -0
- /package/build/commands/{ai-studio/canvas-node → canvas-node}/index.js +0 -0
- /package/commands/{ai-studio/canvas → canvas}/index.ts +0 -0
- /package/commands/{ai-studio/canvas-edge → canvas-edge}/delete-canvas-edge.command.ts +0 -0
- /package/commands/{ai-studio/canvas-edge → canvas-edge}/index.ts +0 -0
- /package/commands/{ai-studio/canvas-node → canvas-node}/index.ts +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageTranslationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
6
|
+
exports.PageTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
pageId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
metaTitle: zod_1.z.string().min(3).max(16384),
|
|
11
|
+
metaDescription: zod_1.z.string().min(3).max(16384),
|
|
12
|
+
title: zod_1.z.string().min(3).max(16384),
|
|
13
|
+
subTitle: zod_1.z.string().min(3).max(16384),
|
|
14
|
+
seoTextMd: zod_1.z.string().min(3).max(16384),
|
|
15
|
+
toolTitle: zod_1.z.string().nullable(),
|
|
16
|
+
createdAt: zod_1.z.date(),
|
|
17
|
+
updatedAt: zod_1.z.date(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostTranslationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
6
|
+
exports.PostTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
postId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
title: zod_1.z.string(),
|
|
11
|
+
content: zod_1.z.string(),
|
|
12
|
+
author: zod_1.z.string(),
|
|
13
|
+
contentPreview: zod_1.z.nullable(zod_1.z.string()),
|
|
14
|
+
metaTitle: zod_1.z.nullable(zod_1.z.string()),
|
|
15
|
+
metaDescription: zod_1.z.nullable(zod_1.z.string()),
|
|
16
|
+
createdAt: zod_1.z.date(),
|
|
17
|
+
updatedAt: zod_1.z.date(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PromptCategoryTranslationSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
9
|
+
exports.PromptCategoryTranslationSchema = zod_1.default.object({
|
|
10
|
+
uuid: zod_1.default.string().uuid(),
|
|
11
|
+
promptCategoryId: zod_1.default.string().uuid(),
|
|
12
|
+
locale: zod_1.default.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
13
|
+
title: zod_1.default.string(),
|
|
14
|
+
metaTitle: zod_1.default.string().nullable(),
|
|
15
|
+
metaDescription: zod_1.default.string().nullable(),
|
|
16
|
+
createdAt: zod_1.default.date(),
|
|
17
|
+
updatedAt: zod_1.default.date(),
|
|
18
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PromptTopicTranslationSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
9
|
+
exports.PromptTopicTranslationSchema = zod_1.default.object({
|
|
10
|
+
uuid: zod_1.default.string().uuid(),
|
|
11
|
+
promptTopicId: zod_1.default.string().uuid(),
|
|
12
|
+
locale: zod_1.default.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
13
|
+
title: zod_1.default.string(),
|
|
14
|
+
content: zod_1.default.string(),
|
|
15
|
+
metaTitle: zod_1.default.string().nullable(),
|
|
16
|
+
metaDescription: zod_1.default.string().nullable(),
|
|
17
|
+
seoText: zod_1.default.string().nullable(),
|
|
18
|
+
createdAt: zod_1.default.date(),
|
|
19
|
+
updatedAt: zod_1.default.date(),
|
|
20
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromptTranslationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
6
|
+
exports.PromptTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
promptId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
title: zod_1.z.string().nullable(),
|
|
11
|
+
content: zod_1.z.string(),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QuestionTranslationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
6
|
+
exports.QuestionTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
questionId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
question: zod_1.z.string().min(3).max(16384),
|
|
11
|
+
answer: zod_1.z.string().min(3).max(16384),
|
|
12
|
+
createdAt: zod_1.z.date(),
|
|
13
|
+
updatedAt: zod_1.z.date(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SectionTranslationSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
6
|
+
exports.SectionTranslationSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
sectionId: zod_1.z.string().uuid(),
|
|
9
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
10
|
+
title: zod_1.z.string(),
|
|
11
|
+
createdAt: zod_1.z.date(),
|
|
12
|
+
updatedAt: zod_1.z.date(),
|
|
13
|
+
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UiNotificationSchema = exports.EmailNotVerifiedUiContentSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.UiNotificationBaseSchema = void 0;
|
|
3
|
+
exports.UiNotificationSchema = exports.EmailNotVerifiedUiContentSchema = exports.GenericUiContentSchema = exports.PromocodeOfferUiContentSchema = exports.FraudDetectedUiContentSchema = exports.SubscriptionPastDueUiContentSchema = exports.ConnectTelegramBonusUiContentSchema = exports.LocalizedUiNotificationTextSchema = exports.UiNotificationBaseSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
6
|
const constants_1 = require("../constants");
|
|
6
7
|
exports.UiNotificationBaseSchema = zod_1.z.object({
|
|
7
8
|
uuid: zod_1.z.string().uuid(),
|
|
@@ -14,6 +15,10 @@ exports.UiNotificationBaseSchema = zod_1.z.object({
|
|
|
14
15
|
endDate: zod_1.z.date().nullable(),
|
|
15
16
|
serverTime: zod_1.z.date().optional(),
|
|
16
17
|
});
|
|
18
|
+
exports.LocalizedUiNotificationTextSchema = zod_1.z.object({
|
|
19
|
+
[rugpt_lib_common_1.LOCALE.RU]: zod_1.z.string(),
|
|
20
|
+
[rugpt_lib_common_1.LOCALE.EN]: zod_1.z.string(),
|
|
21
|
+
});
|
|
17
22
|
exports.ConnectTelegramBonusUiContentSchema = zod_1.z.object({
|
|
18
23
|
promocode: zod_1.z.string(),
|
|
19
24
|
bonusPercent: zod_1.z.number(),
|
|
@@ -24,23 +29,23 @@ exports.SubscriptionPastDueUiContentSchema = zod_1.z.object({
|
|
|
24
29
|
endDate: zod_1.z.string().datetime(),
|
|
25
30
|
});
|
|
26
31
|
exports.FraudDetectedUiContentSchema = zod_1.z.object({
|
|
27
|
-
message:
|
|
32
|
+
message: exports.LocalizedUiNotificationTextSchema,
|
|
28
33
|
endDate: zod_1.z.string().datetime(),
|
|
29
34
|
});
|
|
30
35
|
exports.PromocodeOfferUiContentSchema = zod_1.z.object({
|
|
31
|
-
title:
|
|
32
|
-
message:
|
|
36
|
+
title: exports.LocalizedUiNotificationTextSchema,
|
|
37
|
+
message: exports.LocalizedUiNotificationTextSchema,
|
|
33
38
|
promocode: zod_1.z.string(),
|
|
34
39
|
bonusPercent: zod_1.z.number(),
|
|
35
40
|
validTill: zod_1.z.string().datetime().nullable(),
|
|
36
41
|
});
|
|
37
42
|
exports.GenericUiContentSchema = zod_1.z.object({
|
|
38
|
-
title:
|
|
39
|
-
message:
|
|
43
|
+
title: exports.LocalizedUiNotificationTextSchema,
|
|
44
|
+
message: exports.LocalizedUiNotificationTextSchema,
|
|
40
45
|
});
|
|
41
46
|
exports.EmailNotVerifiedUiContentSchema = zod_1.z.object({
|
|
42
|
-
title:
|
|
43
|
-
message:
|
|
47
|
+
title: exports.LocalizedUiNotificationTextSchema,
|
|
48
|
+
message: exports.LocalizedUiNotificationTextSchema,
|
|
44
49
|
});
|
|
45
50
|
exports.UiNotificationSchema = zod_1.z.discriminatedUnion('type', [
|
|
46
51
|
exports.UiNotificationBaseSchema.extend({
|
|
@@ -4,7 +4,7 @@ exports.UserAggregateSchema = exports.UserSchema = void 0;
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const user_to_subscription_schema_1 = require("./user-to-subscription.schema");
|
|
6
6
|
const user_to_product_schema_1 = require("./user-to-product.schema");
|
|
7
|
-
const
|
|
7
|
+
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
8
8
|
exports.UserSchema = zod_1.z.object({
|
|
9
9
|
uuid: zod_1.z.string().uuid(),
|
|
10
10
|
email: zod_1.z.string().email(),
|
|
@@ -16,7 +16,7 @@ exports.UserSchema = zod_1.z.object({
|
|
|
16
16
|
restoreTokenHash: zod_1.z.string(),
|
|
17
17
|
tokenBonusBalance: zod_1.z.number(),
|
|
18
18
|
role: zod_1.z.string(),
|
|
19
|
-
locale: zod_1.z.nativeEnum(
|
|
19
|
+
locale: zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE),
|
|
20
20
|
createdAt: zod_1.z.date(),
|
|
21
21
|
updatedAt: zod_1.z.date(),
|
|
22
22
|
deletedAt: zod_1.z.date().nullable(),
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PostTranslationSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export namespace CreatePostTranslationCommand {
|
|
5
|
+
export const RequestSchema = PostTranslationSchema.pick({
|
|
6
|
+
title: true,
|
|
7
|
+
content: true,
|
|
8
|
+
author: true,
|
|
9
|
+
contentPreview: true,
|
|
10
|
+
metaTitle: true,
|
|
11
|
+
metaDescription: true,
|
|
12
|
+
locale: true,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const RequestParamSchema = z.object({
|
|
18
|
+
uuid: z.string().uuid(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: PostTranslationSchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -4,7 +4,13 @@ import { z } from 'zod';
|
|
|
4
4
|
export namespace CreatePostCommand {
|
|
5
5
|
export const RequestSchema = PostSchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
title: true,
|
|
8
|
+
author: true,
|
|
7
9
|
views: true,
|
|
10
|
+
content: true,
|
|
11
|
+
contentPreview: true,
|
|
12
|
+
metaTitle: true,
|
|
13
|
+
metaDescription: true,
|
|
8
14
|
createdAt: true,
|
|
9
15
|
updatedAt: true,
|
|
10
16
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PostTranslationSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetAllPostTranslationsQuery {
|
|
5
|
+
export const RequestParamSchema = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = z.object({
|
|
12
|
+
data: z.array(PostTranslationSchema),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
package/commands/blog/index.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
export * from './create-post.command';
|
|
2
|
+
export * from './create-post-translation.command';
|
|
2
3
|
export * from './delete-post.command';
|
|
3
4
|
export * from './find-all-posts.command';
|
|
4
5
|
export * from './find-post-by-alias.command';
|
|
5
6
|
export * from './find-post-by-uuid.command';
|
|
6
7
|
export * from './find-posts.command';
|
|
7
8
|
export * from './get-latest-updates.command';
|
|
9
|
+
export * from './get-all-post-translations.query';
|
|
8
10
|
export * from './get-posts-count.command';
|
|
9
11
|
export * from './update-post.command';
|
|
12
|
+
export * from './update-post-translation.command';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PostTranslationSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export namespace UpdatePostTranslationCommand {
|
|
5
|
+
export const RequestSchema = PostTranslationSchema.pick({
|
|
6
|
+
title: true,
|
|
7
|
+
content: true,
|
|
8
|
+
author: true,
|
|
9
|
+
contentPreview: true,
|
|
10
|
+
metaTitle: true,
|
|
11
|
+
metaDescription: true,
|
|
12
|
+
}).partial();
|
|
13
|
+
|
|
14
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
15
|
+
|
|
16
|
+
export const RequestParamSchema = z.object({
|
|
17
|
+
uuid: z.string().uuid(),
|
|
18
|
+
translationUuid: z.string().uuid(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: PostTranslationSchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -7,6 +7,12 @@ export namespace UpdatePostCommand {
|
|
|
7
7
|
updatedAt: true,
|
|
8
8
|
views: true,
|
|
9
9
|
uuid: true,
|
|
10
|
+
title: true,
|
|
11
|
+
content: true,
|
|
12
|
+
author: true,
|
|
13
|
+
contentPreview: true,
|
|
14
|
+
metaTitle: true,
|
|
15
|
+
metaDescription: true,
|
|
10
16
|
}).partial();
|
|
11
17
|
|
|
12
18
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
import { STATISTICS_METRIC_TYPE, STATISTICS_REQUEST_TYPE } from '../../constants';
|
|
3
4
|
|
|
4
5
|
export namespace GetUserStatisticsByMonthCommand {
|
|
5
6
|
export const RequestSchema = z.object({
|
|
6
|
-
|
|
7
|
+
callOrigin: z
|
|
8
|
+
.nativeEnum(STATISTICS_CALL_ORIGIN)
|
|
9
|
+
.default(STATISTICS_CALL_ORIGIN.WEB)
|
|
10
|
+
.optional(),
|
|
7
11
|
metric: z
|
|
8
12
|
.nativeEnum(STATISTICS_METRIC_TYPE)
|
|
9
13
|
.default(STATISTICS_METRIC_TYPE.REQUESTS)
|
|
@@ -14,18 +18,7 @@ export namespace GetUserStatisticsByMonthCommand {
|
|
|
14
18
|
|
|
15
19
|
export const UserStatisticsByMonthResponseSchema = z.object({
|
|
16
20
|
month: z.string(),
|
|
17
|
-
|
|
18
|
-
total_audios: z.number(),
|
|
19
|
-
total_images: z.number(),
|
|
20
|
-
total_videos: z.number(),
|
|
21
|
-
total_presentations: z.number(),
|
|
22
|
-
total_paraphrases: z.number(),
|
|
23
|
-
writers: z.object({
|
|
24
|
-
total_writers: z.number(),
|
|
25
|
-
total_writer_actions: z.number(),
|
|
26
|
-
}),
|
|
27
|
-
total_video_edits: z.number(),
|
|
28
|
-
total_musics: z.number(),
|
|
21
|
+
statistics: z.record(z.nativeEnum(STATISTICS_REQUEST_TYPE), z.number()),
|
|
29
22
|
});
|
|
30
23
|
|
|
31
24
|
export const ResponseSchema = z.object({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
import { GROUP_BY } from '../../constants';
|
|
3
4
|
|
|
4
5
|
export namespace GetUserStatisticsOverviewCommand {
|
|
5
6
|
export const RequestSchema = z.object({
|
|
@@ -10,7 +11,10 @@ export namespace GetUserStatisticsOverviewCommand {
|
|
|
10
11
|
message: 'to must be a valid date string',
|
|
11
12
|
}),
|
|
12
13
|
groupBy: z.nativeEnum(GROUP_BY).default(GROUP_BY.DAY),
|
|
13
|
-
|
|
14
|
+
callOrigin: z
|
|
15
|
+
.nativeEnum(STATISTICS_CALL_ORIGIN)
|
|
16
|
+
.default(STATISTICS_CALL_ORIGIN.WEB)
|
|
17
|
+
.optional(),
|
|
14
18
|
});
|
|
15
19
|
|
|
16
20
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CanvasEdgeSchema, CanvasNodeSchema, CanvasSchema } from '
|
|
2
|
+
import { CanvasEdgeSchema, CanvasNodeSchema, CanvasSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace FindCanvasByUuidWithRelationsQuery {
|
|
5
5
|
export const RequestSchema = CanvasSchema.pick({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CanvasEdgeSchema, CanvasNodeSchema, CanvasSchema } from '
|
|
2
|
+
import { CanvasEdgeSchema, CanvasNodeSchema, CanvasSchema } from '../../models';
|
|
3
3
|
import { SaveCanvasCommand } from './save-canvas.command';
|
|
4
4
|
|
|
5
5
|
export namespace RunCanvasCommand {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CANVAS_NODE_TYPE, INPUT_OUTPUT_TYPE } from '
|
|
2
|
+
import { CANVAS_NODE_TYPE, INPUT_OUTPUT_TYPE } from '../../constants';
|
|
3
3
|
import {
|
|
4
4
|
CanvasEdgeSchema,
|
|
5
|
+
CanvasNodeParamsSchema,
|
|
5
6
|
CanvasNodePositionSchema,
|
|
6
7
|
CanvasNodeSchema,
|
|
7
8
|
CanvasSchema,
|
|
8
|
-
|
|
9
|
-
} from '../../../models';
|
|
9
|
+
} from '../../models';
|
|
10
10
|
|
|
11
11
|
export namespace SaveCanvasCommand {
|
|
12
12
|
export const RequestParamSchema = CanvasSchema.pick({
|
|
@@ -15,16 +15,12 @@ export namespace SaveCanvasCommand {
|
|
|
15
15
|
|
|
16
16
|
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
17
17
|
|
|
18
|
-
export const CanvasNodePayloadSchema = z
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
.superRefine((node, ctx) => {
|
|
26
|
-
validateCanvasNodeParamsByType(node.nodeDefinitionId, node.params, ctx);
|
|
27
|
-
});
|
|
18
|
+
export const CanvasNodePayloadSchema = z.object({
|
|
19
|
+
uuid: z.string().uuid(),
|
|
20
|
+
nodeDefinitionId: z.nativeEnum(CANVAS_NODE_TYPE),
|
|
21
|
+
position: CanvasNodePositionSchema,
|
|
22
|
+
params: CanvasNodeParamsSchema.nullable().optional(),
|
|
23
|
+
});
|
|
28
24
|
|
|
29
25
|
export const CanvasEdgePayloadSchema = z.object({
|
|
30
26
|
sourceId: z.string().uuid(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { INPUT_OUTPUT_TYPE } from '
|
|
3
|
-
import { CanvasEdgeSchema } from '
|
|
2
|
+
import { INPUT_OUTPUT_TYPE } from '../../constants';
|
|
3
|
+
import { CanvasEdgeSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace CreateCanvasEdgeCommand {
|
|
6
6
|
export const RequestParamSchema = z.object({
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CANVAS_NODE_TYPE } from '../../constants';
|
|
3
|
+
import { CanvasNodeParamsSchema, CanvasNodePositionSchema, CanvasNodeSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace CreateCanvasNodeCommand {
|
|
6
|
+
export const RequestParamSchema = z.object({
|
|
7
|
+
canvasId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
11
|
+
|
|
12
|
+
export const RequestSchema = z.object({
|
|
13
|
+
nodeDefinitionId: z.nativeEnum(CANVAS_NODE_TYPE),
|
|
14
|
+
position: CanvasNodePositionSchema,
|
|
15
|
+
params: CanvasNodeParamsSchema.nullable().optional(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: CanvasNodeSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { CanvasNodeSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace DeleteCanvasNodeCommand {
|
|
5
|
-
export const RequestParamSchema =
|
|
5
|
+
export const RequestParamSchema = CanvasNodeSchema.pick({
|
|
6
6
|
canvasId: true,
|
|
7
7
|
uuid: true,
|
|
8
8
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { CanvasNodeSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace FindCanvasNodeByUuidQuery {
|
|
5
|
-
export const RequestParamSchema =
|
|
5
|
+
export const RequestParamSchema = CanvasNodeSchema.pick({
|
|
6
6
|
canvasId: true,
|
|
7
7
|
uuid: true,
|
|
8
8
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CanvasNodeDefinitionsWithConfigsSchema } from '
|
|
2
|
+
import { CanvasNodeDefinitionsWithConfigsSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace FindCanvasNodeDefinitionsWithConfigsQuery {
|
|
5
5
|
export const ResponseSchema = z.object({
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CANVAS_NODE_TYPE } from '../../constants';
|
|
3
|
+
import { CanvasNodeParamsSchema, CanvasNodePositionSchema, CanvasNodeSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateCanvasNodeCommand {
|
|
6
|
+
export const RequestParamSchema = CanvasNodeSchema.pick({
|
|
7
|
+
canvasId: true,
|
|
8
|
+
uuid: true,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
12
|
+
|
|
13
|
+
export const RequestSchema = z.object({
|
|
14
|
+
nodeDefinitionId: z.nativeEnum(CANVAS_NODE_TYPE).optional(),
|
|
15
|
+
position: CanvasNodePositionSchema.optional(),
|
|
16
|
+
params: CanvasNodeParamsSchema.nullable().optional(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
20
|
+
|
|
21
|
+
export const ResponseSchema = z.object({
|
|
22
|
+
data: CanvasNodeSchema,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CanvasEdgeSchema, CanvasNodeSchema, CanvasSchema } from '
|
|
2
|
+
import { CanvasEdgeSchema, CanvasNodeSchema, CanvasSchema } from '../../models';
|
|
3
3
|
|
|
4
4
|
export namespace CreateCanvasFromTemplateCommand {
|
|
5
5
|
export const RequestParamSchema = z.object({
|
package/commands/{ai-studio/canvas-template → canvas-template}/create-canvas-template.command.ts
RENAMED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { CanvasTemplateSchema, CanvasTemplateGraphSchema } from '../../models';
|
|
4
3
|
|
|
5
4
|
export namespace CreateCanvasTemplateCommand {
|
|
6
5
|
export const RequestSchema = z.object({
|
|
7
6
|
name: z.string().trim().min(1),
|
|
8
7
|
description: z.string().trim().min(1).optional().nullable(),
|
|
9
|
-
isPopular: z.boolean().optional().default(false),
|
|
10
|
-
scope: CanvasTemplateScopeSchema.optional().default('public'),
|
|
11
|
-
ownerUserId: z.string().uuid().optional().nullable(),
|
|
12
|
-
prompt: z.string().trim().min(1).optional().nullable(),
|
|
13
8
|
previewImageUrl: z.string().url().optional().nullable(),
|
|
14
|
-
tags: z.array(
|
|
9
|
+
tags: z.array(z.string().trim().min(1)).default([]),
|
|
15
10
|
graph: CanvasTemplateGraphSchema,
|
|
16
11
|
});
|
|
17
12
|
|
package/commands/{ai-studio/canvas-template → canvas-template}/delete-canvas-template.command.ts
RENAMED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CanvasTemplateSchema } from '../../../models';
|
|
3
2
|
|
|
4
3
|
export namespace DeleteCanvasTemplateCommand {
|
|
5
|
-
export const RequestParamSchema =
|
|
6
|
-
uuid:
|
|
4
|
+
export const RequestParamSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
7
6
|
});
|
|
8
7
|
|
|
9
8
|
export type RequestParam = z.infer<typeof RequestParamSchema>;
|