@purpleschool/gptbot 0.12.3 → 0.12.4-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 +2 -0
- package/api/controllers/http/category.ts +2 -0
- package/api/controllers/http/course.ts +8 -0
- package/api/controllers/http/page.ts +2 -0
- package/api/controllers/http/prompt-category.ts +2 -0
- package/api/controllers/http/prompt-topic.ts +2 -0
- package/api/controllers/http/prompt.ts +2 -0
- package/api/controllers/http/question.ts +2 -0
- package/api/controllers/http/team-account.ts +1 -0
- package/api/routes.ts +46 -0
- package/build/api/controllers/http/blog.js +2 -0
- package/build/api/controllers/http/category.js +2 -0
- package/build/api/controllers/http/course.js +6 -0
- package/build/api/controllers/http/page.js +2 -0
- package/build/api/controllers/http/prompt-category.js +2 -0
- package/build/api/controllers/http/prompt-topic.js +2 -0
- package/build/api/controllers/http/prompt.js +2 -0
- package/build/api/controllers/http/question.js +2 -0
- package/build/api/controllers/http/team-account.js +1 -0
- package/build/api/routes.js +23 -0
- package/build/commands/blog/create-post-translation.command.js +25 -0
- package/build/commands/blog/create-post.command.js +6 -0
- package/build/commands/blog/index.js +2 -0
- package/build/commands/blog/update-post-translation.command.js +24 -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/category/create-category-translation.command.js +23 -0
- package/build/commands/category/create-category.command.js +4 -0
- package/build/commands/category/index.js +2 -0
- package/build/commands/category/update-category-translation.command.js +22 -0
- package/build/commands/category/update-category.command.js +4 -0
- package/build/commands/course/create-course-translation.command.js +24 -0
- package/build/commands/course/create-course.command.js +5 -0
- package/build/commands/course/create-lesson-translation.command.js +20 -0
- package/build/commands/course/create-section-translation.command.js +20 -0
- package/build/commands/course/index.js +6 -0
- package/build/commands/course/update-course-translation.command.js +23 -0
- package/build/commands/course/update-lesson-translation.command.js +19 -0
- package/build/commands/course/update-section-translation.command.js +19 -0
- package/build/commands/page/create-page-translation.command.js +24 -0
- package/build/commands/page/create-page.command.js +5 -0
- package/build/commands/page/index.js +2 -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 +21 -0
- package/build/commands/prompt/create-prompt.command.js +2 -0
- package/build/commands/prompt/index.js +2 -0
- package/build/commands/prompt/update-prompt-translation.command.js +20 -0
- package/build/commands/prompt/update-prompt.command.js +2 -0
- package/build/commands/prompt-category/create-prompt-category-translation.command.js +22 -0
- package/build/commands/prompt-category/create-prompt-category.command.js +3 -0
- package/build/commands/prompt-category/index.js +2 -0
- package/build/commands/prompt-category/update-prompt-category-translation.command.js +21 -0
- package/build/commands/prompt-category/update-prompt-category.command.js +3 -0
- package/build/commands/prompt-topic/create-prompt-topic-translation.command.js +24 -0
- package/build/commands/prompt-topic/create-prompt-topic.command.js +5 -0
- package/build/commands/prompt-topic/index.js +2 -0
- package/build/commands/prompt-topic/update-prompt-topic-translation.command.js +23 -0
- package/build/commands/prompt-topic/update-prompt-topic.command.js +5 -0
- package/build/commands/question/create-question-translation.command.js +21 -0
- package/build/commands/question/create-question.command.js +2 -0
- package/build/commands/question/index.js +2 -0
- package/build/commands/question/update-question-translation.command.js +20 -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/tools/writer/discard-writer-source.command.js +16 -0
- package/build/commands/tools/writer/index.js +1 -0
- package/build/commands/tools/writer/update-writer-document-outline.command.js +1 -0
- 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/constants/cabinet/enums/index.js +1 -0
- package/build/constants/cabinet/enums/statistics-request-type.enum.js +22 -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/tools/writer/writer-source.schema.js +1 -0
- package/build/models/user.schema.js +2 -2
- package/commands/blog/create-post-translation.command.ts +30 -0
- package/commands/blog/create-post.command.ts +6 -0
- package/commands/blog/index.ts +2 -0
- package/commands/blog/update-post-translation.command.ts +29 -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/category/create-category-translation.command.ts +28 -0
- package/commands/category/create-category.command.ts +4 -0
- package/commands/category/index.ts +2 -0
- package/commands/category/update-category-translation.command.ts +27 -0
- package/commands/category/update-category.command.ts +4 -0
- package/commands/course/create-course-translation.command.ts +29 -0
- package/commands/course/create-course.command.ts +5 -0
- package/commands/course/create-lesson-translation.command.ts +25 -0
- package/commands/course/create-section-translation.command.ts +25 -0
- package/commands/course/index.ts +6 -0
- package/commands/course/update-course-translation.command.ts +28 -0
- package/commands/course/update-lesson-translation.command.ts +24 -0
- package/commands/course/update-section-translation.command.ts +24 -0
- package/commands/page/create-page-translation.command.ts +29 -0
- package/commands/page/create-page.command.ts +5 -0
- package/commands/page/index.ts +2 -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 +26 -0
- package/commands/prompt/create-prompt.command.ts +2 -0
- package/commands/prompt/index.ts +2 -0
- package/commands/prompt/update-prompt-translation.command.ts +25 -0
- package/commands/prompt/update-prompt.command.ts +2 -0
- package/commands/prompt-category/create-prompt-category-translation.command.ts +27 -0
- package/commands/prompt-category/create-prompt-category.command.ts +3 -0
- package/commands/prompt-category/index.ts +2 -0
- package/commands/prompt-category/update-prompt-category-translation.command.ts +26 -0
- package/commands/prompt-category/update-prompt-category.command.ts +3 -0
- package/commands/prompt-topic/create-prompt-topic-translation.command.ts +29 -0
- package/commands/prompt-topic/create-prompt-topic.command.ts +5 -0
- package/commands/prompt-topic/index.ts +2 -0
- package/commands/prompt-topic/update-prompt-topic-translation.command.ts +28 -0
- package/commands/prompt-topic/update-prompt-topic.command.ts +5 -0
- package/commands/question/create-question-translation.command.ts +26 -0
- package/commands/question/create-question.command.ts +2 -0
- package/commands/question/index.ts +2 -0
- package/commands/question/update-question-translation.command.ts +25 -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/tools/writer/discard-writer-source.command.ts +18 -0
- package/commands/tools/writer/index.ts +1 -0
- package/commands/tools/writer/update-writer-document-outline.command.ts +1 -0
- 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/constants/cabinet/enums/index.ts +1 -0
- package/constants/cabinet/enums/statistics-request-type.enum.ts +18 -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/tools/writer/writer-source.schema.ts +1 -0
- package/models/user.schema.ts +1 -1
- package/package.json +2 -1
- package/build/constants/tool/enums/job-request-origin.enum.js +0 -8
- package/build/constants/user/enums/locale.enum.js +0 -8
- package/constants/tool/enums/job-request-origin.enum.ts +0 -4
- package/constants/user/enums/locale.enum.ts +0 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PageSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreatePageTranslationCommand {
|
|
6
|
+
export const RequestSchema = PageSchema.pick({
|
|
7
|
+
metaTitle: true,
|
|
8
|
+
metaDescription: true,
|
|
9
|
+
title: true,
|
|
10
|
+
subTitle: true,
|
|
11
|
+
seoTextMd: true,
|
|
12
|
+
}).extend({
|
|
13
|
+
locale: z.nativeEnum(LOCALE),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const RequestParamSchema = z.object({
|
|
19
|
+
uuid: z.string().uuid(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
23
|
+
|
|
24
|
+
export const ResponseSchema = z.object({
|
|
25
|
+
data: PageSchema,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
29
|
+
}
|
package/commands/page/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './create-page.command';
|
|
2
|
+
export * from './create-page-translation.command';
|
|
2
3
|
export * from './delete-page.command';
|
|
3
4
|
export * from './find-page-by-alias.command';
|
|
4
5
|
export * from './find-pages-by-criteria.command';
|
|
5
6
|
export * from './find-page.command';
|
|
6
7
|
export * from './update-page.command';
|
|
8
|
+
export * from './update-page-translation.command';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PageSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdatePageTranslationCommand {
|
|
6
|
+
export const RequestSchema = PageSchema.pick({
|
|
7
|
+
metaTitle: true,
|
|
8
|
+
metaDescription: true,
|
|
9
|
+
title: true,
|
|
10
|
+
subTitle: true,
|
|
11
|
+
seoTextMd: 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
|
+
locale: z.nativeEnum(LOCALE),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: PageSchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -6,6 +6,11 @@ export namespace UpdatePageCommand {
|
|
|
6
6
|
createdAt: true,
|
|
7
7
|
updatedAt: true,
|
|
8
8
|
uuid: true,
|
|
9
|
+
metaTitle: true,
|
|
10
|
+
metaDescription: true,
|
|
11
|
+
title: true,
|
|
12
|
+
subTitle: true,
|
|
13
|
+
seoTextMd: true,
|
|
9
14
|
}).partial();
|
|
10
15
|
|
|
11
16
|
export type Request = z.infer<typeof RequestSchema>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreatePromptTranslationCommand {
|
|
6
|
+
export const RequestSchema = PromptSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
}).extend({
|
|
10
|
+
locale: z.nativeEnum(LOCALE),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const RequestParamSchema = z.object({
|
|
16
|
+
uuid: z.string().uuid(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
20
|
+
|
|
21
|
+
export const ResponseSchema = z.object({
|
|
22
|
+
data: PromptSchema,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
package/commands/prompt/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './create-prompt.command';
|
|
2
|
+
export * from './create-prompt-translation.command';
|
|
2
3
|
export * from './delete-prompt.command';
|
|
3
4
|
export * from './update-prompt.command';
|
|
5
|
+
export * from './update-prompt-translation.command';
|
|
4
6
|
export * from './find-prompt-by-uuid.command';
|
|
5
7
|
export * from './find-all-prompts.command';
|
|
6
8
|
export * from './find-prompts-by-topic.command';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdatePromptTranslationCommand {
|
|
6
|
+
export const RequestSchema = PromptSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
}).partial();
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const RequestParamSchema = z.object({
|
|
14
|
+
uuid: z.string().uuid(),
|
|
15
|
+
locale: z.nativeEnum(LOCALE),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: PromptSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptCategorySchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreatePromptCategoryTranslationCommand {
|
|
6
|
+
export const RequestSchema = PromptCategorySchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
metaTitle: true,
|
|
9
|
+
metaDescription: true,
|
|
10
|
+
}).extend({
|
|
11
|
+
locale: z.nativeEnum(LOCALE),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
15
|
+
|
|
16
|
+
export const RequestParamSchema = z.object({
|
|
17
|
+
uuid: z.string().uuid(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = z.object({
|
|
23
|
+
data: PromptCategorySchema,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
|
@@ -4,6 +4,9 @@ import { PromptCategorySchema } from '../../models';
|
|
|
4
4
|
export namespace CreatePromptCategoryCommand {
|
|
5
5
|
export const RequestSchema = PromptCategorySchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
title: true,
|
|
8
|
+
metaTitle: true,
|
|
9
|
+
metaDescription: true,
|
|
7
10
|
createdAt: true,
|
|
8
11
|
updatedAt: true,
|
|
9
12
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './create-prompt-category.command';
|
|
2
|
+
export * from './create-prompt-category-translation.command';
|
|
2
3
|
export * from './delete-prompt-category.command';
|
|
3
4
|
export * from './update-prompt-category.command';
|
|
5
|
+
export * from './update-prompt-category-translation.command';
|
|
4
6
|
export * from './find-all-prompt-categories.command';
|
|
5
7
|
export * from './find-prompt-category-by-alias.command';
|
|
6
8
|
export * from './find-prompt-category-by-uuid.command';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptCategorySchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdatePromptCategoryTranslationCommand {
|
|
6
|
+
export const RequestSchema = PromptCategorySchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
metaTitle: true,
|
|
9
|
+
metaDescription: true,
|
|
10
|
+
}).partial();
|
|
11
|
+
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const RequestParamSchema = z.object({
|
|
15
|
+
uuid: z.string().uuid(),
|
|
16
|
+
locale: z.nativeEnum(LOCALE),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
20
|
+
|
|
21
|
+
export const ResponseSchema = z.object({
|
|
22
|
+
data: PromptCategorySchema,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -4,6 +4,9 @@ import { PromptCategorySchema } from '../../models';
|
|
|
4
4
|
export namespace UpdatePromptCategoryCommand {
|
|
5
5
|
export const RequestSchema = PromptCategorySchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
title: true,
|
|
8
|
+
metaTitle: true,
|
|
9
|
+
metaDescription: true,
|
|
7
10
|
createdAt: true,
|
|
8
11
|
updatedAt: true,
|
|
9
12
|
}).partial();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptTopicSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreatePromptTopicTranslationCommand {
|
|
6
|
+
export const RequestSchema = PromptTopicSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
metaTitle: true,
|
|
10
|
+
metaDescription: true,
|
|
11
|
+
seoText: true,
|
|
12
|
+
}).extend({
|
|
13
|
+
locale: z.nativeEnum(LOCALE),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
17
|
+
|
|
18
|
+
export const RequestParamSchema = z.object({
|
|
19
|
+
uuid: z.string().uuid(),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
23
|
+
|
|
24
|
+
export const ResponseSchema = z.object({
|
|
25
|
+
data: PromptTopicSchema,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
29
|
+
}
|
|
@@ -4,6 +4,11 @@ import { PromptTopicSchema } from '../../models';
|
|
|
4
4
|
export namespace CreatePromptTopicCommand {
|
|
5
5
|
export const RequestSchema = PromptTopicSchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
metaTitle: true,
|
|
10
|
+
metaDescription: true,
|
|
11
|
+
seoText: true,
|
|
7
12
|
createdAt: true,
|
|
8
13
|
updatedAt: true,
|
|
9
14
|
});
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './create-prompt-topic.command';
|
|
2
|
+
export * from './create-prompt-topic-translation.command';
|
|
2
3
|
export * from './delete-prompt-topic.command';
|
|
3
4
|
export * from './update-prompt-topic.command';
|
|
5
|
+
export * from './update-prompt-topic-translation.command';
|
|
4
6
|
export * from './find-prompt-topic-by-category.command';
|
|
5
7
|
export * from './find-prompt-topic-by-alias.command';
|
|
6
8
|
export * from './find-all-prompt-topics.command';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PromptTopicSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdatePromptTopicTranslationCommand {
|
|
6
|
+
export const RequestSchema = PromptTopicSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
metaTitle: true,
|
|
10
|
+
metaDescription: true,
|
|
11
|
+
seoText: 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
|
+
locale: z.nativeEnum(LOCALE),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
22
|
+
|
|
23
|
+
export const ResponseSchema = z.object({
|
|
24
|
+
data: PromptTopicSchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -4,6 +4,11 @@ import { PromptTopicSchema } from '../../models';
|
|
|
4
4
|
export namespace UpdatePromptTopicCommand {
|
|
5
5
|
export const RequestSchema = PromptTopicSchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
metaTitle: true,
|
|
10
|
+
metaDescription: true,
|
|
11
|
+
seoText: true,
|
|
7
12
|
createdAt: true,
|
|
8
13
|
updatedAt: true,
|
|
9
14
|
}).partial();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { QuestionSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreateQuestionTranslationCommand {
|
|
6
|
+
export const RequestSchema = QuestionSchema.pick({
|
|
7
|
+
question: true,
|
|
8
|
+
answer: true,
|
|
9
|
+
}).extend({
|
|
10
|
+
locale: z.nativeEnum(LOCALE),
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const RequestParamSchema = z.object({
|
|
16
|
+
uuid: z.string().uuid(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
20
|
+
|
|
21
|
+
export const ResponseSchema = z.object({
|
|
22
|
+
data: QuestionSchema,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './create-question.command';
|
|
2
|
+
export * from './create-question-translation.command';
|
|
2
3
|
export * from './delete-question.command';
|
|
3
4
|
export * from './find-question.command';
|
|
4
5
|
export * from './update-question.command';
|
|
6
|
+
export * from './update-question-translation.command';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { QuestionSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateQuestionTranslationCommand {
|
|
6
|
+
export const RequestSchema = QuestionSchema.pick({
|
|
7
|
+
question: true,
|
|
8
|
+
answer: true,
|
|
9
|
+
}).partial();
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const RequestParamSchema = z.object({
|
|
14
|
+
uuid: z.string().uuid(),
|
|
15
|
+
locale: z.nativeEnum(LOCALE),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: QuestionSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -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 GetTeamAccountStatisticsByMonthCommand {
|
|
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)
|
|
@@ -15,18 +19,7 @@ export namespace GetTeamAccountStatisticsByMonthCommand {
|
|
|
15
19
|
|
|
16
20
|
export const TeamAccountStatisticsByMonthItemSchema = z.object({
|
|
17
21
|
month: z.string(),
|
|
18
|
-
|
|
19
|
-
total_audios: z.number(),
|
|
20
|
-
total_images: z.number(),
|
|
21
|
-
total_videos: z.number(),
|
|
22
|
-
total_presentations: z.number(),
|
|
23
|
-
total_paraphrases: z.number(),
|
|
24
|
-
writers: z.object({
|
|
25
|
-
total_writers: z.number(),
|
|
26
|
-
total_writer_actions: z.number(),
|
|
27
|
-
}),
|
|
28
|
-
total_video_edits: z.number(),
|
|
29
|
-
total_musics: z.number(),
|
|
22
|
+
statistics: z.record(z.nativeEnum(STATISTICS_REQUEST_TYPE), z.number()),
|
|
30
23
|
});
|
|
31
24
|
|
|
32
25
|
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 GetTeamAccountStatisticsOverviewCommand {
|
|
5
6
|
export const RequestSchema = z.object({
|
|
@@ -10,7 +11,10 @@ export namespace GetTeamAccountStatisticsOverviewCommand {
|
|
|
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
|
memberUserId: z.string().uuid().optional(),
|
|
15
19
|
});
|
|
16
20
|
|
|
@@ -2,6 +2,7 @@ export * from './create-team-account.command';
|
|
|
2
2
|
export * from './update-team-account.command';
|
|
3
3
|
export * from './cancel-team-trial-subscription.command';
|
|
4
4
|
export * from './invite-team-account-member.command';
|
|
5
|
+
export * from './update-team-account-invite.command';
|
|
5
6
|
export * from './accept-team-account-invite.command';
|
|
6
7
|
export * from './remove-team-account-member.command';
|
|
7
8
|
export * from './leave-team-account-member.command';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TeamAccountInviteResponseSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdateTeamAccountInviteCommand {
|
|
5
|
+
export const RequestParam = z.object({
|
|
6
|
+
uuid: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParam>;
|
|
10
|
+
|
|
11
|
+
export const RequestSchema = z.object({
|
|
12
|
+
limit: z.number().int().positive().nullable(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
data: TeamAccountInviteResponseSchema,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DiscardWriterSourceCommand {
|
|
4
|
+
export const RequestParamsSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
});
|
|
7
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const RequestBodySchema = z.object({});
|
|
10
|
+
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z.object({
|
|
14
|
+
isDiscarded: z.boolean(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -20,3 +20,4 @@ export * from './collect-writer-document-sources.command';
|
|
|
20
20
|
export * from './get-writer-document-sources.command';
|
|
21
21
|
export * from './upload-writer-source.command';
|
|
22
22
|
export * from './confirm-source-citation-metadata.command';
|
|
23
|
+
export * from './discard-writer-source.command';
|
|
@@ -4,6 +4,7 @@ import { WriterDocumentOutlineSchema, WriterDocumentOutlineSectionSchema } from
|
|
|
4
4
|
export namespace UpdateWriterDocumentOutlineCommand {
|
|
5
5
|
export const RequestBodySchema = z.object({
|
|
6
6
|
data: WriterDocumentOutlineSchema,
|
|
7
|
+
modelId: z.string().optional(),
|
|
7
8
|
});
|
|
8
9
|
export type RequestBody = z.infer<typeof RequestBodySchema>;
|
|
9
10
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { ROLE, SIGNUP_METHOD, USER_STATUS } from '../../constants';
|
|
3
3
|
import { UserProfileResponseSchema } from '../../models';
|
|
4
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
5
|
|
|
5
6
|
export namespace GetMeCommand {
|
|
6
7
|
export const RequestSchema = z.object({});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export enum STATISTICS_REQUEST_TYPE {
|
|
2
|
+
IMAGE = 'IMAGE',
|
|
3
|
+
VIDEO = 'VIDEO',
|
|
4
|
+
PRESENTATION = 'PRESENTATION',
|
|
5
|
+
TEXT = 'TEXT',
|
|
6
|
+
AUDIO = 'AUDIO',
|
|
7
|
+
PARAPHRASE = 'PARAPHRASE',
|
|
8
|
+
WRITER = 'WRITER',
|
|
9
|
+
PRESENTATION_AI_ACTION = 'PRESENTATION_AI_ACTION',
|
|
10
|
+
WRITER_ACTION = 'WRITER_ACTION',
|
|
11
|
+
VIDEO_EDITOR = 'VIDEO_EDITOR',
|
|
12
|
+
MUSIC = 'MUSIC',
|
|
13
|
+
MUSIC_ACTION = 'MUSIC_ACTION',
|
|
14
|
+
INTERIOR_DESIGN = 'INTERIOR_DESIGN',
|
|
15
|
+
MARKETPLACE_CARD = 'MARKETPLACE_CARD',
|
|
16
|
+
SOLVING_EDU_TASK = 'SOLVING_EDU_TASK',
|
|
17
|
+
SPELL_CORRECTOR = 'SPELL_CORRECTOR',
|
|
18
|
+
}
|
|
@@ -6,6 +6,7 @@ export const WriterSourceSchema = z.object({
|
|
|
6
6
|
uuid: z.string().uuid(),
|
|
7
7
|
query: z.string().nullable(),
|
|
8
8
|
url: z.string(),
|
|
9
|
+
title: z.string().nullable(),
|
|
9
10
|
snippet: z.string().nullable(),
|
|
10
11
|
sourceOrigin: z.nativeEnum(WRITER_SOURCE_ORIGIN),
|
|
11
12
|
documentId: z.string().uuid(),
|