@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
|
@@ -59,7 +59,6 @@ export type AudioGenParams = z.infer<typeof AudioGenParamsSchema>;
|
|
|
59
59
|
|
|
60
60
|
export const ColorPaletteParamsSchema = strictObject({
|
|
61
61
|
prompt: z.string(),
|
|
62
|
-
colors: z.array(z.string().regex(/^#[0-9A-Fa-f]{6}$/)).optional(),
|
|
63
62
|
});
|
|
64
63
|
export type ColorPaletteParams = z.infer<typeof ColorPaletteParamsSchema>;
|
|
65
64
|
|
|
@@ -148,7 +147,14 @@ export const AudioGenSTTOutputSchema = strictObject({
|
|
|
148
147
|
export type AudioGenSTTOutput = z.infer<typeof AudioGenSTTOutputSchema>;
|
|
149
148
|
|
|
150
149
|
export const ColorPaletteOutputSchema = strictObject({
|
|
151
|
-
|
|
150
|
+
paletteName: z.string(),
|
|
151
|
+
colors: z.array(
|
|
152
|
+
strictObject({
|
|
153
|
+
hex: z.string(),
|
|
154
|
+
name: z.string(),
|
|
155
|
+
usage: z.string(),
|
|
156
|
+
}),
|
|
157
|
+
),
|
|
152
158
|
});
|
|
153
159
|
export type ColorPaletteOutput = z.infer<typeof ColorPaletteOutputSchema>;
|
|
154
160
|
|
|
@@ -167,6 +173,24 @@ export const HtmlGenOutputSchema = strictObject({
|
|
|
167
173
|
});
|
|
168
174
|
export type HtmlGenOutput = z.infer<typeof HtmlGenOutputSchema>;
|
|
169
175
|
|
|
176
|
+
export const CanvasNodeParamsSchema = z.union([
|
|
177
|
+
TextGenParamsSchema,
|
|
178
|
+
ImageGenParamsSchema,
|
|
179
|
+
VideoGenParamsSchema,
|
|
180
|
+
AudioGenParamsSchema,
|
|
181
|
+
ColorPaletteParamsSchema,
|
|
182
|
+
MotionControlParamsSchema,
|
|
183
|
+
VarGenParamsSchema,
|
|
184
|
+
HtmlGenParamsSchema,
|
|
185
|
+
TextBlockParamsSchema,
|
|
186
|
+
ImageBlockParamsSchema,
|
|
187
|
+
VideoBlockParamsSchema,
|
|
188
|
+
FileBlockParamsSchema,
|
|
189
|
+
NoteParamsSchema,
|
|
190
|
+
VarBlockParamsSchema,
|
|
191
|
+
]);
|
|
192
|
+
export type CanvasNodeParams = z.infer<typeof CanvasNodeParamsSchema>;
|
|
193
|
+
|
|
170
194
|
export const CanvasNodeParamsSchemaByType = {
|
|
171
195
|
[CANVAS_NODE_TYPE.textGen]: TextGenParamsSchema,
|
|
172
196
|
[CANVAS_NODE_TYPE.imageGen]: ImageGenParamsSchema,
|
|
@@ -187,25 +211,18 @@ export const CanvasNodeParamsSchemaByType = {
|
|
|
187
211
|
[CANVAS_NODE_TYPE.htmlGen]: HtmlGenParamsSchema,
|
|
188
212
|
} as const;
|
|
189
213
|
|
|
190
|
-
export const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
[CANVAS_NODE_TYPE.note]: NoteParamsSchema,
|
|
203
|
-
[CANVAS_NODE_TYPE.colorPalette]: ColorPaletteOutputSchema,
|
|
204
|
-
[CANVAS_NODE_TYPE.motionControl]: MotionControlOutputSchema,
|
|
205
|
-
[CANVAS_NODE_TYPE.varGen]: VarGenOutputSchema,
|
|
206
|
-
[CANVAS_NODE_TYPE.varBlock]: VarBlockParamsSchema,
|
|
207
|
-
[CANVAS_NODE_TYPE.htmlGen]: HtmlGenOutputSchema,
|
|
208
|
-
} as const;
|
|
214
|
+
export const CanvasNodeOutputSchema = z.union([
|
|
215
|
+
TextGenOutputSchema,
|
|
216
|
+
ImageGenOutputSchema,
|
|
217
|
+
VideoGenOutputSchema,
|
|
218
|
+
AudioGenTTSOutputSchema,
|
|
219
|
+
AudioGenSTTOutputSchema,
|
|
220
|
+
ColorPaletteOutputSchema,
|
|
221
|
+
MotionControlOutputSchema,
|
|
222
|
+
VarGenOutputSchema,
|
|
223
|
+
HtmlGenOutputSchema,
|
|
224
|
+
]);
|
|
225
|
+
export type CanvasNodeOutput = z.infer<typeof CanvasNodeOutputSchema>;
|
|
209
226
|
|
|
210
227
|
export const CanvasNodeErrorSchema = z.object({
|
|
211
228
|
code: z.string(),
|
|
@@ -234,7 +251,6 @@ export type CanvasNodeParamsByType = {
|
|
|
234
251
|
[CANVAS_NODE_TYPE.varBlock]: VarBlockParams;
|
|
235
252
|
[CANVAS_NODE_TYPE.htmlGen]: HtmlGenParams;
|
|
236
253
|
};
|
|
237
|
-
export type CanvasNodeParams = CanvasNodeParamsByType[keyof CanvasNodeParamsByType];
|
|
238
254
|
|
|
239
255
|
export type CanvasNodeOutputByType = {
|
|
240
256
|
[CANVAS_NODE_TYPE.textGen]: TextGenOutput;
|
|
@@ -244,164 +260,22 @@ export type CanvasNodeOutputByType = {
|
|
|
244
260
|
[CANVAS_NODE_TYPE.videoEdit]: VideoGenOutput;
|
|
245
261
|
[CANVAS_NODE_TYPE.ttsGen]: AudioGenTTSOutput;
|
|
246
262
|
[CANVAS_NODE_TYPE.sttGen]: AudioGenSTTOutput;
|
|
247
|
-
[CANVAS_NODE_TYPE.textBlock]: TextBlockParams;
|
|
248
|
-
[CANVAS_NODE_TYPE.imageBlock]: ImageBlockParams;
|
|
249
|
-
[CANVAS_NODE_TYPE.videoBlock]: VideoBlockParams;
|
|
250
|
-
[CANVAS_NODE_TYPE.fileBlock]: FileBlockParams;
|
|
251
|
-
[CANVAS_NODE_TYPE.note]: NoteParams;
|
|
252
263
|
[CANVAS_NODE_TYPE.colorPalette]: ColorPaletteOutput;
|
|
253
264
|
[CANVAS_NODE_TYPE.motionControl]: MotionControlOutput;
|
|
254
265
|
[CANVAS_NODE_TYPE.varGen]: VarGenOutput;
|
|
255
|
-
[CANVAS_NODE_TYPE.varBlock]: VarBlockParams;
|
|
256
266
|
[CANVAS_NODE_TYPE.htmlGen]: HtmlGenOutput;
|
|
257
267
|
};
|
|
258
|
-
export type CanvasNodeOutput = CanvasNodeOutputByType[keyof CanvasNodeOutputByType];
|
|
259
|
-
|
|
260
|
-
export const validateCanvasNodeParamsByType = (
|
|
261
|
-
nodeDefinitionId: CANVAS_NODE_TYPE,
|
|
262
|
-
params: unknown,
|
|
263
|
-
ctx: z.RefinementCtx,
|
|
264
|
-
): void => {
|
|
265
|
-
if (params === null || params === undefined) {
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const schema = CanvasNodeParamsSchemaByType[nodeDefinitionId];
|
|
270
|
-
const result = schema.safeParse(params);
|
|
271
|
-
if (result.success) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
for (const issue of result.error.issues) {
|
|
276
|
-
ctx.addIssue({
|
|
277
|
-
...issue,
|
|
278
|
-
path: ['params', ...issue.path],
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
268
|
|
|
283
|
-
export const
|
|
284
|
-
nodeDefinitionId: CANVAS_NODE_TYPE,
|
|
285
|
-
output: unknown,
|
|
286
|
-
ctx: z.RefinementCtx,
|
|
287
|
-
): void => {
|
|
288
|
-
if (output === null || output === undefined) {
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
const schema = CanvasNodeOutputSchemaByType[nodeDefinitionId];
|
|
293
|
-
const result = schema.safeParse(output);
|
|
294
|
-
if (result.success) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
for (const issue of result.error.issues) {
|
|
299
|
-
ctx.addIssue({
|
|
300
|
-
...issue,
|
|
301
|
-
path: ['output', ...issue.path],
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
export const CanvasNodeBaseSchema = z.object({
|
|
269
|
+
export const CanvasNodeSchema = z.object({
|
|
307
270
|
uuid: z.string().uuid(),
|
|
308
271
|
canvasId: z.string().uuid(),
|
|
309
272
|
nodeDefinitionId: z.nativeEnum(CANVAS_NODE_TYPE),
|
|
310
273
|
position: CanvasNodePositionSchema,
|
|
311
274
|
status: z.nativeEnum(NODE_RUN_STATUS),
|
|
312
275
|
toolJobId: z.string().uuid().nullable(),
|
|
313
|
-
params:
|
|
314
|
-
output:
|
|
276
|
+
params: CanvasNodeParamsSchema.nullable(),
|
|
277
|
+
output: CanvasNodeOutputSchema.nullable(),
|
|
315
278
|
error: CanvasNodeErrorSchema.nullable(),
|
|
316
279
|
createdAt: z.date(),
|
|
317
280
|
updatedAt: z.date(),
|
|
318
281
|
});
|
|
319
|
-
|
|
320
|
-
export const CanvasNodeSchema = z.discriminatedUnion('nodeDefinitionId', [
|
|
321
|
-
CanvasNodeBaseSchema.extend({
|
|
322
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.textGen),
|
|
323
|
-
params: TextGenParamsSchema.nullable(),
|
|
324
|
-
output: TextGenOutputSchema.nullable(),
|
|
325
|
-
}),
|
|
326
|
-
CanvasNodeBaseSchema.extend({
|
|
327
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.imageGen),
|
|
328
|
-
params: ImageGenParamsSchema.nullable(),
|
|
329
|
-
output: ImageGenOutputSchema.nullable(),
|
|
330
|
-
}),
|
|
331
|
-
CanvasNodeBaseSchema.extend({
|
|
332
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.imageEdit),
|
|
333
|
-
params: ImageGenParamsSchema.nullable(),
|
|
334
|
-
output: ImageGenOutputSchema.nullable(),
|
|
335
|
-
}),
|
|
336
|
-
CanvasNodeBaseSchema.extend({
|
|
337
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.videoGen),
|
|
338
|
-
params: VideoGenParamsSchema.nullable(),
|
|
339
|
-
output: VideoGenOutputSchema.nullable(),
|
|
340
|
-
}),
|
|
341
|
-
CanvasNodeBaseSchema.extend({
|
|
342
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.videoEdit),
|
|
343
|
-
params: VideoGenParamsSchema.nullable(),
|
|
344
|
-
output: VideoGenOutputSchema.nullable(),
|
|
345
|
-
}),
|
|
346
|
-
CanvasNodeBaseSchema.extend({
|
|
347
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.ttsGen),
|
|
348
|
-
params: AudioGenParamsSchema.nullable(),
|
|
349
|
-
output: AudioGenTTSOutputSchema.nullable(),
|
|
350
|
-
}),
|
|
351
|
-
CanvasNodeBaseSchema.extend({
|
|
352
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.sttGen),
|
|
353
|
-
params: AudioGenParamsSchema.nullable(),
|
|
354
|
-
output: AudioGenSTTOutputSchema.nullable(),
|
|
355
|
-
}),
|
|
356
|
-
CanvasNodeBaseSchema.extend({
|
|
357
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.textBlock),
|
|
358
|
-
params: TextBlockParamsSchema.nullable(),
|
|
359
|
-
output: TextBlockParamsSchema.nullable(),
|
|
360
|
-
}),
|
|
361
|
-
CanvasNodeBaseSchema.extend({
|
|
362
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.imageBlock),
|
|
363
|
-
params: ImageBlockParamsSchema.nullable(),
|
|
364
|
-
output: ImageBlockParamsSchema.nullable(),
|
|
365
|
-
}),
|
|
366
|
-
CanvasNodeBaseSchema.extend({
|
|
367
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.videoBlock),
|
|
368
|
-
params: VideoBlockParamsSchema.nullable(),
|
|
369
|
-
output: VideoBlockParamsSchema.nullable(),
|
|
370
|
-
}),
|
|
371
|
-
CanvasNodeBaseSchema.extend({
|
|
372
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.fileBlock),
|
|
373
|
-
params: FileBlockParamsSchema.nullable(),
|
|
374
|
-
output: FileBlockParamsSchema.nullable(),
|
|
375
|
-
}),
|
|
376
|
-
CanvasNodeBaseSchema.extend({
|
|
377
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.note),
|
|
378
|
-
params: NoteParamsSchema.nullable(),
|
|
379
|
-
output: NoteParamsSchema.nullable(),
|
|
380
|
-
}),
|
|
381
|
-
CanvasNodeBaseSchema.extend({
|
|
382
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.colorPalette),
|
|
383
|
-
params: ColorPaletteParamsSchema.nullable(),
|
|
384
|
-
output: ColorPaletteOutputSchema.nullable(),
|
|
385
|
-
}),
|
|
386
|
-
CanvasNodeBaseSchema.extend({
|
|
387
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.motionControl),
|
|
388
|
-
params: MotionControlParamsSchema.nullable(),
|
|
389
|
-
output: MotionControlOutputSchema.nullable(),
|
|
390
|
-
}),
|
|
391
|
-
CanvasNodeBaseSchema.extend({
|
|
392
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.varGen),
|
|
393
|
-
params: VarGenParamsSchema.nullable(),
|
|
394
|
-
output: VarGenOutputSchema.nullable(),
|
|
395
|
-
}),
|
|
396
|
-
CanvasNodeBaseSchema.extend({
|
|
397
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.varBlock),
|
|
398
|
-
params: VarBlockParamsSchema.nullable(),
|
|
399
|
-
output: VarBlockParamsSchema.nullable(),
|
|
400
|
-
}),
|
|
401
|
-
CanvasNodeBaseSchema.extend({
|
|
402
|
-
nodeDefinitionId: z.literal(CANVAS_NODE_TYPE.htmlGen),
|
|
403
|
-
params: HtmlGenParamsSchema.nullable(),
|
|
404
|
-
output: HtmlGenOutputSchema.nullable(),
|
|
405
|
-
}),
|
|
406
|
-
]);
|
|
407
|
-
export type CanvasNode = z.infer<typeof CanvasNodeSchema>;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { INPUT_OUTPUT_TYPE, CANVAS_NODE_TYPE } from '../constants';
|
|
3
|
-
import {
|
|
3
|
+
import { CanvasNodeParamsSchema, CanvasNodePositionSchema } from './canvas-node.schema';
|
|
4
4
|
|
|
5
|
-
const CanvasTemplateGraphNodeSchema = z
|
|
6
|
-
.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
})
|
|
12
|
-
.superRefine((node, ctx) => {
|
|
13
|
-
validateCanvasNodeParamsByType(node.nodeDefinitionId, node.params, ctx);
|
|
14
|
-
});
|
|
5
|
+
const CanvasTemplateGraphNodeSchema = z.object({
|
|
6
|
+
uuid: z.string().trim().min(1),
|
|
7
|
+
nodeDefinitionId: z.nativeEnum(CANVAS_NODE_TYPE),
|
|
8
|
+
position: CanvasNodePositionSchema,
|
|
9
|
+
params: CanvasNodeParamsSchema.nullable().optional(),
|
|
10
|
+
});
|
|
15
11
|
|
|
16
12
|
const CanvasTemplateGraphEdgeSchema = z.object({
|
|
17
13
|
sourceId: z.string().trim().min(1),
|
|
@@ -58,29 +54,14 @@ export const CanvasTemplateGraphSchema = z
|
|
|
58
54
|
});
|
|
59
55
|
|
|
60
56
|
export type CanvasTemplateGraph = z.infer<typeof CanvasTemplateGraphSchema>;
|
|
61
|
-
export const CanvasTemplateScopeSchema = z.enum(['public', 'private']);
|
|
62
|
-
export type CanvasTemplateScope = z.infer<typeof CanvasTemplateScopeSchema>;
|
|
63
|
-
|
|
64
|
-
export const CanvasTemplateTagSchema = z.object({
|
|
65
|
-
icons: z.object({
|
|
66
|
-
svg: z.string(),
|
|
67
|
-
png: z.string(),
|
|
68
|
-
}),
|
|
69
|
-
alias: z.string().trim().min(1),
|
|
70
|
-
title: z.string().trim().min(1),
|
|
71
|
-
});
|
|
72
|
-
export type CanvasTemplateTag = z.infer<typeof CanvasTemplateTagSchema>;
|
|
73
57
|
|
|
74
58
|
export const CanvasTemplateSchema = z.object({
|
|
75
59
|
uuid: z.string().uuid(),
|
|
76
60
|
name: z.string(),
|
|
77
61
|
description: z.string().nullable(),
|
|
78
|
-
|
|
79
|
-
scope: CanvasTemplateScopeSchema,
|
|
80
|
-
ownerUserId: z.string().uuid().nullable(),
|
|
81
|
-
prompt: z.string().nullable(),
|
|
62
|
+
userId: z.string().uuid().nullable(),
|
|
82
63
|
previewImageUrl: z.string().url().nullable(),
|
|
83
|
-
tags: z.array(
|
|
64
|
+
tags: z.array(z.string()),
|
|
84
65
|
graph: CanvasTemplateGraphSchema,
|
|
85
66
|
createdAt: z.date(),
|
|
86
67
|
updatedAt: z.date(),
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const CategoryTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
categoryId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
name: z.string().min(3).max(16384),
|
|
9
|
+
prompt: z.nullable(z.string().min(3).max(16384)),
|
|
10
|
+
placeholder: z.nullable(z.string()),
|
|
11
|
+
seoName: z.string().min(3).max(16384),
|
|
12
|
+
createdAt: z.date(),
|
|
13
|
+
updatedAt: z.date(),
|
|
14
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const CourseTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
courseId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
subtitle: z.string(),
|
|
10
|
+
prerequisites: z.string(),
|
|
11
|
+
description: z.string(),
|
|
12
|
+
skills: z.array(z.string()),
|
|
13
|
+
createdAt: z.date(),
|
|
14
|
+
updatedAt: z.date(),
|
|
15
|
+
});
|
package/models/index.ts
CHANGED
|
@@ -8,11 +8,13 @@ export * from './canvas-node-definition.schema';
|
|
|
8
8
|
export * from './canvas-node.schema';
|
|
9
9
|
export * from './canvas-edge.schema';
|
|
10
10
|
export * from './category.schema';
|
|
11
|
+
export * from './category-translation.schema';
|
|
11
12
|
export * from './chat-with-messages.schema';
|
|
12
13
|
export * from './chat.schema';
|
|
13
14
|
export * from './cloud-payments-receipt.schema';
|
|
14
15
|
export * from './course-author.schema';
|
|
15
16
|
export * from './course.schema';
|
|
17
|
+
export * from './course-translation.schema';
|
|
16
18
|
export * from './date.schema';
|
|
17
19
|
export * from './feedback.schema';
|
|
18
20
|
export * from './file.schema';
|
|
@@ -20,19 +22,24 @@ export * from './key-value.schema';
|
|
|
20
22
|
export * from './form-submission.schema';
|
|
21
23
|
export * from './icon-variants.schema';
|
|
22
24
|
export * from './lesson.schema';
|
|
25
|
+
export * from './lesson-translation.schema';
|
|
23
26
|
export * from './message.schema';
|
|
24
27
|
export * from './midjourney-job.schema';
|
|
25
28
|
export * from './order.schema';
|
|
26
29
|
export * from './page.schema';
|
|
30
|
+
export * from './page-translation.schema';
|
|
27
31
|
export * from './payment-history-item.schema';
|
|
28
32
|
export * from './payment.schema';
|
|
29
33
|
export * from './invoice-for-payment.schema';
|
|
30
34
|
export * from './post.schema';
|
|
35
|
+
export * from './post-translation.schema';
|
|
31
36
|
export * from './product.schema';
|
|
32
37
|
export * from './promocode.schema';
|
|
33
38
|
export * from './question.schema';
|
|
39
|
+
export * from './question-translation.schema';
|
|
34
40
|
export * from './referral-bonus.schema';
|
|
35
41
|
export * from './section.schema';
|
|
42
|
+
export * from './section-translation.schema';
|
|
36
43
|
export * from './subscription-feature.schema';
|
|
37
44
|
export * from './team-subscription-feature.schema';
|
|
38
45
|
export * from './subscription-upgrade-schema';
|
|
@@ -51,8 +58,11 @@ export * from './utm.schema';
|
|
|
51
58
|
export * from './ui-notification.schema';
|
|
52
59
|
export * from './review.schema';
|
|
53
60
|
export * from './prompt-category.schema';
|
|
61
|
+
export * from './prompt-category-translation.schema';
|
|
54
62
|
export * from './prompt-topic.schema';
|
|
63
|
+
export * from './prompt-topic-translation.schema';
|
|
55
64
|
export * from './prompt.schema';
|
|
65
|
+
export * from './prompt-translation.schema';
|
|
56
66
|
export * from './folder.schema';
|
|
57
67
|
export * from './filters.schema';
|
|
58
68
|
export * from './users-filter-notification.schema';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const LessonTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
lessonId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
createdAt: z.date(),
|
|
10
|
+
updatedAt: z.date(),
|
|
11
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const PageTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
pageId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
metaTitle: z.string().min(3).max(16384),
|
|
9
|
+
metaDescription: z.string().min(3).max(16384),
|
|
10
|
+
title: z.string().min(3).max(16384),
|
|
11
|
+
subTitle: z.string().min(3).max(16384),
|
|
12
|
+
seoTextMd: z.string().min(3).max(16384),
|
|
13
|
+
toolTitle: z.string().nullable(),
|
|
14
|
+
createdAt: z.date(),
|
|
15
|
+
updatedAt: z.date(),
|
|
16
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const PostTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
postId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
content: z.string(),
|
|
10
|
+
author: z.string(),
|
|
11
|
+
contentPreview: z.nullable(z.string()),
|
|
12
|
+
metaTitle: z.nullable(z.string()),
|
|
13
|
+
metaDescription: z.nullable(z.string()),
|
|
14
|
+
createdAt: z.date(),
|
|
15
|
+
updatedAt: z.date(),
|
|
16
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const PromptCategoryTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
promptCategoryId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
metaTitle: z.string().nullable(),
|
|
10
|
+
metaDescription: z.string().nullable(),
|
|
11
|
+
createdAt: z.date(),
|
|
12
|
+
updatedAt: z.date(),
|
|
13
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const PromptTopicTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
promptTopicId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
content: z.string(),
|
|
10
|
+
metaTitle: z.string().nullable(),
|
|
11
|
+
metaDescription: z.string().nullable(),
|
|
12
|
+
seoText: z.string().nullable(),
|
|
13
|
+
createdAt: z.date(),
|
|
14
|
+
updatedAt: z.date(),
|
|
15
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const PromptTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
promptId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string().nullable(),
|
|
9
|
+
content: z.string(),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const QuestionTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
questionId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
question: z.string().min(3).max(16384),
|
|
9
|
+
answer: z.string().min(3).max(16384),
|
|
10
|
+
createdAt: z.date(),
|
|
11
|
+
updatedAt: z.date(),
|
|
12
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
3
|
+
|
|
4
|
+
export const SectionTranslationSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
sectionId: z.string().uuid(),
|
|
7
|
+
locale: z.nativeEnum(LOCALE),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
createdAt: z.date(),
|
|
10
|
+
updatedAt: z.date(),
|
|
11
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
2
3
|
import {
|
|
3
4
|
UI_NOTIFICATION_CONDITION_OF_EXECUTION,
|
|
4
5
|
UI_NOTIFICATION_STATUS,
|
|
@@ -18,6 +19,12 @@ export const UiNotificationBaseSchema = z.object({
|
|
|
18
19
|
});
|
|
19
20
|
export type UiNotificationBase = z.infer<typeof UiNotificationBaseSchema>;
|
|
20
21
|
|
|
22
|
+
export const LocalizedUiNotificationTextSchema = z.object({
|
|
23
|
+
[LOCALE.RU]: z.string(),
|
|
24
|
+
[LOCALE.EN]: z.string(),
|
|
25
|
+
});
|
|
26
|
+
export type LocalizedUiNotificationText = z.infer<typeof LocalizedUiNotificationTextSchema>;
|
|
27
|
+
|
|
21
28
|
export const ConnectTelegramBonusUiContentSchema = z.object({
|
|
22
29
|
promocode: z.string(),
|
|
23
30
|
bonusPercent: z.number(),
|
|
@@ -32,14 +39,14 @@ export const SubscriptionPastDueUiContentSchema = z.object({
|
|
|
32
39
|
export type SubscriptionPastDueUiContent = z.infer<typeof SubscriptionPastDueUiContentSchema>;
|
|
33
40
|
|
|
34
41
|
export const FraudDetectedUiContentSchema = z.object({
|
|
35
|
-
message:
|
|
42
|
+
message: LocalizedUiNotificationTextSchema,
|
|
36
43
|
endDate: z.string().datetime(),
|
|
37
44
|
});
|
|
38
45
|
export type FraudDetectedUiContent = z.infer<typeof FraudDetectedUiContentSchema>;
|
|
39
46
|
|
|
40
47
|
export const PromocodeOfferUiContentSchema = z.object({
|
|
41
|
-
title:
|
|
42
|
-
message:
|
|
48
|
+
title: LocalizedUiNotificationTextSchema,
|
|
49
|
+
message: LocalizedUiNotificationTextSchema,
|
|
43
50
|
promocode: z.string(),
|
|
44
51
|
bonusPercent: z.number(),
|
|
45
52
|
validTill: z.string().datetime().nullable(),
|
|
@@ -47,14 +54,14 @@ export const PromocodeOfferUiContentSchema = z.object({
|
|
|
47
54
|
export type PromocodeOfferUiContent = z.infer<typeof PromocodeOfferUiContentSchema>;
|
|
48
55
|
|
|
49
56
|
export const GenericUiContentSchema = z.object({
|
|
50
|
-
title:
|
|
51
|
-
message:
|
|
57
|
+
title: LocalizedUiNotificationTextSchema,
|
|
58
|
+
message: LocalizedUiNotificationTextSchema,
|
|
52
59
|
});
|
|
53
60
|
export type GenericUiContentType = z.infer<typeof GenericUiContentSchema>;
|
|
54
61
|
|
|
55
62
|
export const EmailNotVerifiedUiContentSchema = z.object({
|
|
56
|
-
title:
|
|
57
|
-
message:
|
|
63
|
+
title: LocalizedUiNotificationTextSchema,
|
|
64
|
+
message: LocalizedUiNotificationTextSchema,
|
|
58
65
|
});
|
|
59
66
|
export type EmailNotVerifiedUiContent = z.infer<typeof EmailNotVerifiedUiContentSchema>;
|
|
60
67
|
|
package/models/user.schema.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { UserToSubscriptionSchema } from './user-to-subscription.schema';
|
|
3
3
|
import { UserToProductSchema } from './user-to-product.schema';
|
|
4
|
-
import { LOCALE } from '
|
|
4
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
5
5
|
|
|
6
6
|
export const UserSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleschool/gptbot",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.72-stage-2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
+
"@purpleschool/rugpt-lib-common": "^0.0.21",
|
|
15
16
|
"zod": "^3.25.67"
|
|
16
17
|
}
|
|
17
18
|
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PALETTE_ROUTES = exports.PALETTE_CONTROLLER_PRIVATE = void 0;
|
|
4
|
-
exports.PALETTE_CONTROLLER_PRIVATE = 'private/ai-canvas/tools/palette';
|
|
5
|
-
exports.PALETTE_ROUTES = {
|
|
6
|
-
PRICE: 'price',
|
|
7
|
-
GENERATE: 'generate',
|
|
8
|
-
};
|
package/build/commands/ai-studio/canvas-template/generate-canvas-template-by-prompt.command.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GenerateCanvasTemplateByPromptCommand = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const models_1 = require("../../../models");
|
|
6
|
-
var GenerateCanvasTemplateByPromptCommand;
|
|
7
|
-
(function (GenerateCanvasTemplateByPromptCommand) {
|
|
8
|
-
GenerateCanvasTemplateByPromptCommand.RequestSchema = zod_1.z.object({
|
|
9
|
-
prompt: zod_1.z.string().trim().min(1),
|
|
10
|
-
});
|
|
11
|
-
GenerateCanvasTemplateByPromptCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
data: models_1.CanvasTemplateSchema,
|
|
13
|
-
});
|
|
14
|
-
})(GenerateCanvasTemplateByPromptCommand || (exports.GenerateCanvasTemplateByPromptCommand = GenerateCanvasTemplateByPromptCommand = {}));
|
|
@@ -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("./palette"), exports);
|