@purpleschool/gptbot-tools 0.2.7-stage-2 → 0.2.9-stage
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/build/common/models/index.js +0 -1
- package/build/html-page-builder/commands/create-html-page-builder-session.command.js +26 -0
- package/build/html-page-builder/commands/get-html-page-builder-price.command.js +15 -0
- package/build/html-page-builder/commands/html-page-builder-execute.command.js +31 -0
- package/build/html-page-builder/commands/index.js +22 -0
- package/build/html-page-builder/commands/soft-delete-all-html-page-builder-sessions.command.js +20 -0
- package/build/html-page-builder/commands/soft-delete-html-page-builder-session-by-uuid.command.js +14 -0
- package/build/html-page-builder/commands/update-html-page-builder-session-title.command.js +16 -0
- package/build/html-page-builder/enums/html-page-builder-session-stage.enum.js +8 -0
- package/build/html-page-builder/enums/index.js +17 -0
- package/build/html-page-builder/index.js +21 -0
- package/build/html-page-builder/models/html-page-builder-config.schema.js +8 -0
- package/build/html-page-builder/models/html-page-builder-job.schema.js +34 -0
- package/build/html-page-builder/models/html-page-builder-model.schema.js +18 -0
- package/build/html-page-builder/models/html-page-builder-session.schema.js +18 -0
- package/build/html-page-builder/models/index.js +20 -0
- package/build/html-page-builder/queries/find-html-page-builder-session-by-id.query.js +24 -0
- package/build/html-page-builder/queries/find-html-page-builder-sessions.query.js +28 -0
- package/build/html-page-builder/queries/get-html-page-builder-config.query.js +11 -0
- package/build/html-page-builder/queries/index.js +19 -0
- package/build/html-page-builder/routes/html-page-builder.amqp.routes.js +14 -0
- package/build/html-page-builder/routes/index.js +17 -0
- package/build/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.js +0 -1
- package/build/image-editor/queries/get-image-editor-config.query.js +2 -3
- package/build/image-generation/commands/execute-image-generation.command.js +2 -2
- package/build/image-generation/commands/image-generation-model/get-image-generation-model-by-uuid.command.js +0 -1
- package/build/image-generation/models/image-generation-job.schema.js +1 -3
- package/build/image-generation/queries/find-image-generation-jobs.query.js +2 -2
- package/build/image-generation/queries/get-image-generation-config.query.js +4 -3
- package/build/index.js +3 -0
- package/build/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.js +0 -1
- package/build/interior-design/queries/get-interior-design-config.query.js +2 -3
- package/build/marketplace-card/queries/get-marketplace-card-config.query.js +2 -1
- package/build/music/commands/music-model/get-music-model-by-uuid.command.js +0 -1
- package/build/music/enums/suno-model-type.enum.js +1 -0
- package/build/music/queries/get-music-config.query.js +2 -3
- package/build/paraphrase/queries/get-paraphrase-tool-config.query.js +2 -3
- package/build/presentation/queries/get-presentation-config.query.js +0 -1
- package/build/solving-edu-task/queries/get-solving-edu-task-config.query.js +2 -1
- package/build/spell-corrector/queries/get-spell-corrector-tool-config.query.js +2 -3
- package/build/stt/queries/get-stt-config.query.js +2 -3
- package/build/tools/enums/index.js +1 -0
- package/build/tools/enums/job-request-origin.enum.js +8 -0
- package/build/tools/enums/tool-content-type.enum.js +1 -0
- package/build/tools/enums/tool-type.enum.js +1 -0
- package/build/tools/events/tool-job-complete.event.js +1 -2
- package/build/tools/models/global-tools-config.schema.js +2 -0
- package/build/tools/models/tools-with-configs.schema.js +5 -0
- package/build/tools/queries/find-all-tools.query.js +0 -1
- package/build/tools/queries/find-grouped-tools.query.js +0 -1
- package/build/tools/queries/get-global-tools-config.query.js +2 -3
- package/build/tools/queries/get-tools-with-configs.query.js +2 -3
- package/build/video/commands/video-model/get-video-model-by-uuid.command.js +0 -1
- package/build/video/queries/get-video-config.query.js +2 -3
- package/build/video-editor/commands/video-editor-model/get-video-editor-model.command.js +0 -1
- package/build/video-editor/queries/get-video-editor-config.query.js +4 -3
- package/build/writer/queries/get-writer-config.query.js +0 -1
- package/common/models/index.ts +0 -1
- package/html-page-builder/commands/create-html-page-builder-session.command.ts +29 -0
- package/html-page-builder/commands/get-html-page-builder-price.command.ts +17 -0
- package/html-page-builder/commands/html-page-builder-execute.command.ts +34 -0
- package/html-page-builder/commands/index.ts +6 -0
- package/html-page-builder/commands/soft-delete-all-html-page-builder-sessions.command.ts +23 -0
- package/html-page-builder/commands/soft-delete-html-page-builder-session-by-uuid.command.ts +14 -0
- package/html-page-builder/commands/update-html-page-builder-session-title.command.ts +16 -0
- package/html-page-builder/enums/html-page-builder-session-stage.enum.ts +4 -0
- package/html-page-builder/enums/index.ts +1 -0
- package/html-page-builder/index.ts +5 -0
- package/html-page-builder/models/html-page-builder-config.schema.ts +8 -0
- package/html-page-builder/models/html-page-builder-job.schema.ts +37 -0
- package/html-page-builder/models/html-page-builder-model.schema.ts +18 -0
- package/html-page-builder/models/html-page-builder-session.schema.ts +18 -0
- package/html-page-builder/models/index.ts +4 -0
- package/html-page-builder/queries/find-html-page-builder-session-by-id.query.ts +25 -0
- package/html-page-builder/queries/find-html-page-builder-sessions.query.ts +33 -0
- package/html-page-builder/queries/get-html-page-builder-config.query.ts +11 -0
- package/html-page-builder/queries/index.ts +3 -0
- package/html-page-builder/routes/html-page-builder.amqp.routes.ts +11 -0
- package/html-page-builder/routes/index.ts +1 -0
- package/image-editor/commands/image-editor-model/get-image-editor-model-by-uuid.command.ts +1 -2
- package/image-editor/queries/get-image-editor-config.query.ts +1 -4
- package/image-generation/commands/execute-image-generation.command.ts +2 -2
- package/image-generation/commands/image-generation-model/get-image-generation-model-by-uuid.command.ts +1 -2
- package/image-generation/models/image-generation-job.schema.ts +2 -4
- package/image-generation/queries/find-image-generation-jobs.query.ts +2 -2
- package/image-generation/queries/get-image-generation-config.query.ts +2 -2
- package/index.ts +3 -0
- package/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.ts +1 -2
- package/interior-design/queries/get-interior-design-config.query.ts +1 -4
- package/marketplace-card/queries/get-marketplace-card-config.query.ts +2 -2
- package/music/commands/music-model/get-music-model-by-uuid.command.ts +1 -2
- package/music/enums/suno-model-type.enum.ts +1 -0
- package/music/queries/get-music-config.query.ts +1 -4
- package/package.json +1 -2
- package/paraphrase/queries/get-paraphrase-tool-config.query.ts +1 -4
- package/presentation/queries/get-presentation-config.query.ts +1 -4
- package/solving-edu-task/queries/get-solving-edu-task-config.query.ts +2 -2
- package/spell-corrector/queries/get-spell-corrector-tool-config.query.ts +1 -4
- package/stt/queries/get-stt-config.query.ts +1 -4
- package/tools/enums/index.ts +1 -0
- package/tools/enums/job-request-origin.enum.ts +4 -0
- package/tools/enums/tool-content-type.enum.ts +1 -0
- package/tools/enums/tool-type.enum.ts +1 -0
- package/tools/events/tool-job-complete.event.ts +2 -3
- package/tools/models/global-tools-config.schema.ts +2 -0
- package/tools/models/tools-with-configs.schema.ts +7 -0
- package/tools/queries/find-all-tools.query.ts +1 -4
- package/tools/queries/find-grouped-tools.query.ts +1 -4
- package/tools/queries/get-global-tools-config.query.ts +1 -4
- package/tools/queries/get-tools-with-configs.query.ts +1 -4
- package/video/commands/video-model/get-video-model-by-uuid.command.ts +1 -2
- package/video/queries/get-video-config.query.ts +1 -4
- package/video-editor/commands/video-editor-model/get-video-editor-model.command.ts +1 -2
- package/video-editor/queries/get-video-editor-config.query.ts +2 -2
- package/writer/queries/get-writer-config.query.ts +1 -4
- package/build/common/models/locale.schema.js +0 -9
- package/common/models/locale.schema.ts +0 -11
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ImageEditorModelSchema } from '../../models';
|
|
3
|
-
import { ICommandResponseSchema
|
|
3
|
+
import { ICommandResponseSchema } from '../../../common';
|
|
4
4
|
|
|
5
5
|
export namespace GetImageEditorModelByUuidCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
locale: LocaleSchema,
|
|
9
8
|
});
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
10
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { ImageEditorConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetImageEditorConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(ImageEditorConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { JOB_REQUEST_ORIGIN } from '../../tools';
|
|
3
4
|
import { ImageGenerationJobSchema, ImageGenerationRequestParamsSchema } from '../models';
|
|
4
|
-
import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
|
|
5
5
|
|
|
6
6
|
export namespace ExecuteImageGenerationCommand {
|
|
7
7
|
export const RequestSchema = z.object({
|
|
@@ -11,7 +11,7 @@ export namespace ExecuteImageGenerationCommand {
|
|
|
11
11
|
modelId: z.string().uuid(),
|
|
12
12
|
params: ImageGenerationRequestParamsSchema,
|
|
13
13
|
presetId: z.string().uuid().nullable().optional(),
|
|
14
|
-
|
|
14
|
+
origin: z.nativeEnum(JOB_REQUEST_ORIGIN).default(JOB_REQUEST_ORIGIN.API),
|
|
15
15
|
userHasActiveSubscriptionOrProduct: z.boolean(),
|
|
16
16
|
tokenReservationId: z.string().uuid(),
|
|
17
17
|
precalculatedPrice: z.number(),
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ImageGenerationModelSchema } from '../../models';
|
|
3
|
-
import { ICommandResponseSchema
|
|
3
|
+
import { ICommandResponseSchema } from '../../../common';
|
|
4
4
|
|
|
5
5
|
export namespace GetImageGenerationModelByUuidCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
locale: LocaleSchema,
|
|
9
8
|
});
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
10
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { JOB_STATUS } from '../../tools';
|
|
2
|
+
import { JOB_REQUEST_ORIGIN, JOB_STATUS } from '../../tools';
|
|
3
3
|
import { AttachedFileSchema, USER_REACTION } from '../../common';
|
|
4
4
|
import { IMAGE_GENERATION_RESOLUTION } from '../enums';
|
|
5
|
-
import { STATISTICS_CALL_ORIGIN } from '@purpleschool/rugpt-lib-common';
|
|
6
5
|
|
|
7
6
|
export const ImageGenerationJobParamsSchema = z.object({
|
|
8
7
|
aspectRatio: z.string(),
|
|
@@ -31,8 +30,7 @@ export const ImageGenerationJobSchema = z.object({
|
|
|
31
30
|
userId: z.string().nullable().optional(),
|
|
32
31
|
unregisteredUserId: z.string().nullable().optional(),
|
|
33
32
|
isPublished: z.boolean(),
|
|
34
|
-
origin: z.
|
|
35
|
-
callOrigin: z.nativeEnum(STATISTICS_CALL_ORIGIN),
|
|
33
|
+
origin: z.nativeEnum(JOB_REQUEST_ORIGIN),
|
|
36
34
|
postId: z.string().nullable(),
|
|
37
35
|
isDeleted: z.boolean(),
|
|
38
36
|
internalError: z.string().nullable(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { ImageGenerationJobSchema } from '../models';
|
|
4
|
-
import {
|
|
4
|
+
import { JOB_REQUEST_ORIGIN } from '../../tools/enums/job-request-origin.enum';
|
|
5
5
|
|
|
6
6
|
export namespace FindImageGenerationJobsQuery {
|
|
7
7
|
export const RequestSchema = z
|
|
@@ -11,7 +11,7 @@ export namespace FindImageGenerationJobsQuery {
|
|
|
11
11
|
title: z.string().optional(),
|
|
12
12
|
limit: z.coerce.number().min(1).optional(),
|
|
13
13
|
offset: z.coerce.number().min(0).default(0).optional(),
|
|
14
|
-
|
|
14
|
+
origin: z.nativeEnum(JOB_REQUEST_ORIGIN).optional(),
|
|
15
15
|
})
|
|
16
16
|
.refine(
|
|
17
17
|
(data) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { ImageGenerationConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetImageGenerationConfigQuery {
|
|
6
|
-
export const RequestSchema =
|
|
6
|
+
export const RequestSchema = z.object({});
|
|
7
7
|
export type Request = z.infer<typeof RequestSchema>;
|
|
8
8
|
|
|
9
9
|
export const ResponseSchema = ICommandResponseSchema(ImageGenerationConfigSchema);
|
package/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './marketplace-card';
|
|
|
18
18
|
export * from './analytics';
|
|
19
19
|
export * from './solving-edu-task';
|
|
20
20
|
export * from './spell-corrector';
|
|
21
|
+
export * from './html-page-builder';
|
|
21
22
|
export * from './tool-workspace';
|
|
22
23
|
|
|
23
24
|
import * as common from './common';
|
|
@@ -39,6 +40,7 @@ import * as marketplaceCard from './marketplace-card';
|
|
|
39
40
|
import * as analytics from './analytics';
|
|
40
41
|
import * as solvingEduTask from './solving-edu-task';
|
|
41
42
|
import * as spellCorrector from './spell-corrector';
|
|
43
|
+
import * as htmlPageBuilder from './html-page-builder';
|
|
42
44
|
import * as accountMerge from './account-merge';
|
|
43
45
|
import * as toolWorkspace from './tool-workspace';
|
|
44
46
|
|
|
@@ -62,6 +64,7 @@ export namespace ToolService {
|
|
|
62
64
|
export import Analytics = analytics;
|
|
63
65
|
export import SolvingEduTask = solvingEduTask;
|
|
64
66
|
export import SpellCorrector = spellCorrector;
|
|
67
|
+
export import HtmlPageBuilder = htmlPageBuilder;
|
|
65
68
|
export import AccountMerge = accountMerge;
|
|
66
69
|
export import ToolWorkspace = toolWorkspace;
|
|
67
70
|
}
|
package/interior-design/commands/interior-design-model/get-interior-design-model-by-uuid.command.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../../common';
|
|
3
3
|
import { InteriorDesignModelSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetInteriorDesignModelByUuidCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
locale: LocaleSchema,
|
|
9
8
|
});
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
10
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { InteriorDesignConfigSchema } from '../models/interior-design-config.schema';
|
|
4
4
|
|
|
5
5
|
export namespace GetInteriorDesignConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(InteriorDesignConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common';
|
|
3
3
|
import { MarketplaceCardConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetMarketplaceCardConfigQuery {
|
|
6
|
-
export const RequestSchema =
|
|
6
|
+
export const RequestSchema = z.object({});
|
|
7
7
|
export type Request = z.infer<typeof RequestSchema>;
|
|
8
8
|
export const ResponseSchema = ICommandResponseSchema(MarketplaceCardConfigSchema);
|
|
9
9
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { MusicModelSchema } from '../../models';
|
|
3
|
-
import { ICommandResponseSchema
|
|
3
|
+
import { ICommandResponseSchema } from '../../../common';
|
|
4
4
|
|
|
5
5
|
export namespace GetMusicModelByUuidCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
locale: LocaleSchema,
|
|
9
8
|
});
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
10
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { MusicConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetMusicConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(MusicConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleschool/gptbot-tools",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9-stage",
|
|
4
4
|
"main": "build/index.js",
|
|
5
5
|
"types": "build/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"license": "ISC",
|
|
13
13
|
"description": "",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@purpleschool/rugpt-lib-common": "^0.0.21",
|
|
16
15
|
"zod": "^3.25.67"
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { ParaphraseToolConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetParaphraseToolConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(ParaphraseToolConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common';
|
|
3
3
|
import { PresentationConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetPresentationConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(PresentationConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common';
|
|
3
3
|
import { SolvingEduTaskConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetSolvingEduTaskConfigQuery {
|
|
6
|
-
export const RequestSchema =
|
|
6
|
+
export const RequestSchema = z.object({});
|
|
7
7
|
export type Request = z.infer<typeof RequestSchema>;
|
|
8
8
|
|
|
9
9
|
export const ResponseSchema = ICommandResponseSchema(SolvingEduTaskConfigSchema);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { SpellCorrectorToolConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetSpellCorrectorToolConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(SpellCorrectorToolConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { STTConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetSTTConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(STTConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
package/tools/enums/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TOOL_TYPE } from '../enums';
|
|
1
|
+
import { JOB_REQUEST_ORIGIN, TOOL_TYPE } from '../enums';
|
|
3
2
|
import { ToolJobSchema } from '../models';
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
|
|
@@ -7,7 +6,7 @@ export namespace ToolJobCompleteEvent {
|
|
|
7
6
|
export const PayloadSchema = z.object({
|
|
8
7
|
job: ToolJobSchema.extend({
|
|
9
8
|
toolType: z.nativeEnum(TOOL_TYPE),
|
|
10
|
-
|
|
9
|
+
origin: z.nativeEnum(JOB_REQUEST_ORIGIN).optional(),
|
|
11
10
|
}),
|
|
12
11
|
});
|
|
13
12
|
|
|
@@ -14,6 +14,7 @@ import { MarketplaceCardConfigSchema } from '../../marketplace-card/models';
|
|
|
14
14
|
import { InteriorDesignConfigSchema } from '../../interior-design';
|
|
15
15
|
import { SolvingEduTaskConfigSchema } from '../../solving-edu-task';
|
|
16
16
|
import { SpellCorrectorToolConfigSchema } from '../../spell-corrector';
|
|
17
|
+
import { HtmlPageBuilderConfigSchema } from '../../html-page-builder/models';
|
|
17
18
|
|
|
18
19
|
export const GlobalToolsConfigSchema = z.object({
|
|
19
20
|
[TOOL_CONTENT_TYPE.VIDEO]: VideoConfigSchema,
|
|
@@ -30,6 +31,7 @@ export const GlobalToolsConfigSchema = z.object({
|
|
|
30
31
|
[TOOL_CONTENT_TYPE.INTERIOR_DESIGN]: InteriorDesignConfigSchema,
|
|
31
32
|
[TOOL_CONTENT_TYPE.SOLVING_EDU_TASK]: SolvingEduTaskConfigSchema,
|
|
32
33
|
[TOOL_CONTENT_TYPE.SPELL_CORRECTOR]: SpellCorrectorToolConfigSchema,
|
|
34
|
+
[TOOL_CONTENT_TYPE.HTML_PAGE_BUILDER]: HtmlPageBuilderConfigSchema,
|
|
33
35
|
});
|
|
34
36
|
|
|
35
37
|
export type GlobalToolsConfig = z.infer<typeof GlobalToolsConfigSchema>;
|
|
@@ -15,6 +15,7 @@ import { ToolSchema } from './tool.schema';
|
|
|
15
15
|
import { InteriorDesignConfigSchema } from '../../interior-design';
|
|
16
16
|
import { SolvingEduTaskConfigSchema } from '../../solving-edu-task';
|
|
17
17
|
import { SpellCorrectorToolConfigSchema } from '../../spell-corrector';
|
|
18
|
+
import { HtmlPageBuilderConfigSchema } from '../../html-page-builder/models';
|
|
18
19
|
|
|
19
20
|
// Discriminated union array: Tools with their configs
|
|
20
21
|
export const ToolWithConfigSchema = z.discriminatedUnion('contentType', [
|
|
@@ -102,6 +103,12 @@ export const ToolWithConfigSchema = z.discriminatedUnion('contentType', [
|
|
|
102
103
|
config: SpellCorrectorToolConfigSchema,
|
|
103
104
|
}),
|
|
104
105
|
),
|
|
106
|
+
ToolSchema.merge(
|
|
107
|
+
z.object({
|
|
108
|
+
contentType: z.literal(TOOL_CONTENT_TYPE.HTML_PAGE_BUILDER),
|
|
109
|
+
config: HtmlPageBuilderConfigSchema,
|
|
110
|
+
}),
|
|
111
|
+
),
|
|
105
112
|
]);
|
|
106
113
|
|
|
107
114
|
export type ToolWithConfig = z.infer<typeof ToolWithConfigSchema>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ToolSchema } from '../models';
|
|
3
|
-
import { ICommandResponseSchema
|
|
3
|
+
import { ICommandResponseSchema } from '../../common';
|
|
4
4
|
|
|
5
5
|
export namespace FindAllToolsQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(z.array(ToolSchema));
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ToolGroupSchema } from '../models';
|
|
3
|
-
import { ICommandResponseSchema
|
|
3
|
+
import { ICommandResponseSchema } from '../../common';
|
|
4
4
|
|
|
5
5
|
export namespace FindGroupedToolsQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(z.array(ToolGroupSchema));
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { GlobalToolsConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetGlobalToolsConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(GlobalToolsConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { ToolsWithConfigsSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetToolsWithConfigsQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(ToolsWithConfigsSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { VideoModelSchema } from '../../models';
|
|
3
|
-
import { ICommandResponseSchema
|
|
3
|
+
import { ICommandResponseSchema } from '../../../common';
|
|
4
4
|
|
|
5
5
|
export namespace GetVideoModelByUuidCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
locale: LocaleSchema,
|
|
9
8
|
});
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
10
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { VideoConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetVideoConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(VideoConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../../common';
|
|
3
3
|
import { VideoEditorModelSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetVideoEditorModelByUuidCommand {
|
|
6
6
|
export const RequestSchema = z.object({
|
|
7
7
|
uuid: z.string().uuid(),
|
|
8
|
-
locale: LocaleSchema,
|
|
9
8
|
});
|
|
10
9
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
3
|
import { VideoEditorConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetVideoEditorConfigQuery {
|
|
6
|
-
export const RequestSchema =
|
|
6
|
+
export const RequestSchema = z.object({});
|
|
7
7
|
export type Request = z.infer<typeof RequestSchema>;
|
|
8
8
|
|
|
9
9
|
export const ResponseSchema = ICommandResponseSchema(VideoEditorConfigSchema);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ICommandResponseSchema
|
|
2
|
+
import { ICommandResponseSchema } from '../../common';
|
|
3
3
|
import { WriterConfigSchema } from '../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetWriterConfigQuery {
|
|
6
|
-
export const RequestSchema = LocaleRequestSchema;
|
|
7
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
-
|
|
9
6
|
export const ResponseSchema = ICommandResponseSchema(WriterConfigSchema);
|
|
10
7
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
8
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LocaleRequestSchema = exports.LocaleSchema = void 0;
|
|
4
|
-
const rugpt_lib_common_1 = require("@purpleschool/rugpt-lib-common");
|
|
5
|
-
const zod_1 = require("zod");
|
|
6
|
-
exports.LocaleSchema = zod_1.z.nativeEnum(rugpt_lib_common_1.LOCALE);
|
|
7
|
-
exports.LocaleRequestSchema = zod_1.z.object({
|
|
8
|
-
locale: exports.LocaleSchema,
|
|
9
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LOCALE } from '@purpleschool/rugpt-lib-common';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export const LocaleSchema = z.nativeEnum(LOCALE);
|
|
5
|
-
|
|
6
|
-
export const LocaleRequestSchema = z.object({
|
|
7
|
-
locale: LocaleSchema,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type Locale = z.infer<typeof LocaleSchema>;
|
|
11
|
-
export type LocaleRequest = z.infer<typeof LocaleRequestSchema>;
|