@purpleschool/gptbot 0.12.0 → 0.12.2-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/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/index.js +1 -0
- package/build/commands/team-account/update-team-account-invite.command.js +17 -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/user/enums/index.js +0 -1
- 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/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/index.ts +1 -0
- package/commands/team-account/update-team-account-invite.command.ts +22 -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/user/enums/index.ts +0 -1
- package/models/user.schema.ts +1 -1
- package/package.json +2 -1
- package/build/constants/user/enums/locale.enum.js +0 -8
- package/constants/user/enums/locale.enum.ts +0 -4
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PostSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreatePostTranslationCommand {
|
|
6
|
+
export const RequestSchema = PostSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
author: true,
|
|
10
|
+
contentPreview: true,
|
|
11
|
+
metaTitle: true,
|
|
12
|
+
metaDescription: true,
|
|
13
|
+
}).extend({
|
|
14
|
+
locale: z.nativeEnum(LOCALE),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
+
|
|
19
|
+
export const RequestParamSchema = z.object({
|
|
20
|
+
uuid: z.string().uuid(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = z.object({
|
|
26
|
+
data: PostSchema,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
30
|
+
}
|
|
@@ -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
|
});
|
package/commands/blog/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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';
|
|
@@ -7,3 +8,4 @@ export * from './find-posts.command';
|
|
|
7
8
|
export * from './get-latest-updates.command';
|
|
8
9
|
export * from './get-posts-count.command';
|
|
9
10
|
export * from './update-post.command';
|
|
11
|
+
export * from './update-post-translation.command';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PostSchema } from '../../models';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdatePostTranslationCommand {
|
|
6
|
+
export const RequestSchema = PostSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
content: true,
|
|
9
|
+
author: true,
|
|
10
|
+
contentPreview: true,
|
|
11
|
+
metaTitle: true,
|
|
12
|
+
metaDescription: true,
|
|
13
|
+
}).partial();
|
|
14
|
+
|
|
15
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
16
|
+
|
|
17
|
+
export const RequestParamSchema = z.object({
|
|
18
|
+
uuid: z.string().uuid(),
|
|
19
|
+
locale: z.nativeEnum(LOCALE),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
23
|
+
|
|
24
|
+
export const ResponseSchema = z.object({
|
|
25
|
+
data: PostSchema,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
29
|
+
}
|
|
@@ -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>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CategorySchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreateCategoryTranslationCommand {
|
|
6
|
+
export const RequestSchema = CategorySchema.pick({
|
|
7
|
+
name: true,
|
|
8
|
+
prompt: true,
|
|
9
|
+
placeholder: true,
|
|
10
|
+
seoName: true,
|
|
11
|
+
}).extend({
|
|
12
|
+
locale: z.nativeEnum(LOCALE),
|
|
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: CategorySchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -4,6 +4,10 @@ import { CategorySchema } from '../../models';
|
|
|
4
4
|
export namespace CreateCategoryCommand {
|
|
5
5
|
export const RequestSchema = CategorySchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
name: true,
|
|
8
|
+
prompt: true,
|
|
9
|
+
placeholder: true,
|
|
10
|
+
seoName: true,
|
|
7
11
|
createdAt: true,
|
|
8
12
|
updatedAt: true,
|
|
9
13
|
});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export * from './create-category.command';
|
|
2
|
+
export * from './create-category-translation.command';
|
|
2
3
|
export * from './delete-category.command';
|
|
3
4
|
export * from './find-category.command';
|
|
4
5
|
export * from './update-category.command';
|
|
6
|
+
export * from './update-category-translation.command';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CategorySchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateCategoryTranslationCommand {
|
|
6
|
+
export const RequestSchema = CategorySchema.pick({
|
|
7
|
+
name: true,
|
|
8
|
+
prompt: true,
|
|
9
|
+
placeholder: true,
|
|
10
|
+
seoName: true,
|
|
11
|
+
}).partial();
|
|
12
|
+
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const RequestParamSchema = z.object({
|
|
16
|
+
uuid: z.string().uuid(),
|
|
17
|
+
locale: z.nativeEnum(LOCALE),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = z.object({
|
|
23
|
+
data: CategorySchema,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CourseSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreateCourseTranslationCommand {
|
|
6
|
+
export const RequestSchema = CourseSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
subtitle: true,
|
|
9
|
+
prerequisites: true,
|
|
10
|
+
description: true,
|
|
11
|
+
skills: 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: CourseSchema,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
29
|
+
}
|
|
@@ -4,6 +4,11 @@ import { CourseSchema } from '../../models';
|
|
|
4
4
|
export namespace CreateCourseCommand {
|
|
5
5
|
export const RequestSchema = CourseSchema.omit({
|
|
6
6
|
uuid: true,
|
|
7
|
+
title: true,
|
|
8
|
+
subtitle: true,
|
|
9
|
+
prerequisites: true,
|
|
10
|
+
description: true,
|
|
11
|
+
skills: true,
|
|
7
12
|
createdAt: true,
|
|
8
13
|
updatedAt: true,
|
|
9
14
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LessonSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreateLessonTranslationCommand {
|
|
6
|
+
export const RequestSchema = LessonSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
}).extend({
|
|
9
|
+
locale: z.nativeEnum(LOCALE),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const RequestParamSchema = z.object({
|
|
15
|
+
uuid: z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: LessonSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SectionSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace CreateSectionTranslationCommand {
|
|
6
|
+
export const RequestSchema = SectionSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
}).extend({
|
|
9
|
+
locale: z.nativeEnum(LOCALE),
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const RequestParamSchema = z.object({
|
|
15
|
+
uuid: z.string().uuid(),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: SectionSchema,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
package/commands/course/index.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
export * from './create-course.command';
|
|
2
|
+
export * from './create-course-translation.command';
|
|
3
|
+
export * from './create-lesson-translation.command';
|
|
4
|
+
export * from './create-section-translation.command';
|
|
2
5
|
export * from './find-course-by-alias.command';
|
|
3
6
|
export * from './find-course-by-uuid.command';
|
|
7
|
+
export * from './update-course-translation.command';
|
|
8
|
+
export * from './update-lesson-translation.command';
|
|
9
|
+
export * from './update-section-translation.command';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CourseSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateCourseTranslationCommand {
|
|
6
|
+
export const RequestSchema = CourseSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
subtitle: true,
|
|
9
|
+
prerequisites: true,
|
|
10
|
+
description: true,
|
|
11
|
+
skills: 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: CourseSchema,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { LessonSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateLessonTranslationCommand {
|
|
6
|
+
export const RequestSchema = LessonSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
}).partial();
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const RequestParamSchema = z.object({
|
|
13
|
+
uuid: z.string().uuid(),
|
|
14
|
+
locale: z.nativeEnum(LOCALE),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseSchema = z.object({
|
|
20
|
+
data: LessonSchema,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { SectionSchema } from '../../models';
|
|
3
|
+
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateSectionTranslationCommand {
|
|
6
|
+
export const RequestSchema = SectionSchema.pick({
|
|
7
|
+
title: true,
|
|
8
|
+
}).partial();
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const RequestParamSchema = z.object({
|
|
13
|
+
uuid: z.string().uuid(),
|
|
14
|
+
locale: z.nativeEnum(LOCALE),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseSchema = z.object({
|
|
20
|
+
data: SectionSchema,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -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();
|