@purpleschool/gptbot-tools 0.0.15 → 0.0.17
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/enums/index.js +1 -0
- package/build/common/enums/user-reaction.enum.js +8 -0
- package/build/common/errors/errors.js +139 -0
- package/build/common/models/icon-variants.schema.js +14 -0
- package/build/common/models/index.js +1 -0
- package/build/index.js +6 -0
- package/build/paraphrase/routes/paraphrase.amqp.routes.js +2 -2
- package/build/stt/commands/delete-all-stt-jobs.command.js +13 -0
- package/build/stt/commands/delete-stt-job-by-uuid.command.js +14 -0
- package/build/stt/commands/index.js +20 -0
- package/build/stt/commands/set-reaction-to-stt-job.command.js +17 -0
- package/build/stt/commands/stt.command.js +19 -0
- package/build/stt/enums/index.js +17 -0
- package/build/stt/enums/stt-strategy.enum.js +7 -0
- package/build/stt/index.js +21 -0
- package/build/stt/models/index.js +20 -0
- package/build/stt/models/stt-config.schema.js +8 -0
- package/build/stt/models/stt-job.schema.js +24 -0
- package/build/stt/models/stt-model.schema.js +19 -0
- package/build/stt/models/stt-response.schema.js +8 -0
- package/build/stt/queries/find-stt-job-by-uuid.query.js +10 -0
- package/build/stt/queries/find-stt-jobs.query.js +28 -0
- package/build/stt/queries/get-stt-config.query.js +9 -0
- package/build/stt/queries/index.js +19 -0
- package/build/stt/routes/index.js +17 -0
- package/build/stt/routes/stt.amqp.routes.js +12 -0
- package/build/tools/enums/job-status.enum.js +1 -1
- package/build/tools/routes/tools.aqmp.routes.js +2 -2
- package/build/tts/commands/delete-all-tts-jobs.command.js +13 -0
- package/build/tts/commands/delete-tts-job-by-uuid.command.js +14 -0
- package/build/tts/commands/index.js +21 -0
- package/build/tts/commands/set-reaction-to-tts-job.command.js +17 -0
- package/build/tts/commands/tts.command.js +26 -0
- package/build/tts/commands/update-tts-job-title.command.js +19 -0
- package/build/tts/enums/index.js +18 -0
- package/build/tts/enums/tts-model-type.enum.js +8 -0
- package/build/tts/enums/tts-strategy.enum.js +7 -0
- package/build/tts/index.js +21 -0
- package/build/tts/models/index.js +19 -0
- package/build/tts/models/tts-config.schema.js +8 -0
- package/build/tts/models/tts-job.schema.js +31 -0
- package/build/tts/models/tts-model.schema.js +54 -0
- package/build/tts/queries/find-tts-job-by-id.query.js +10 -0
- package/build/tts/queries/find-tts-jobs.query.js +28 -0
- package/build/tts/queries/get-tts-config.query.js +9 -0
- package/build/tts/queries/index.js +19 -0
- package/build/tts/routes/index.js +17 -0
- package/build/tts/routes/tts.amqp.routes.js +13 -0
- package/common/enums/index.ts +1 -0
- package/common/enums/user-reaction.enum.ts +4 -0
- package/common/errors/errors.ts +139 -0
- package/common/models/icon-variants.schema.ts +12 -0
- package/common/models/index.ts +1 -0
- package/index.ts +6 -0
- package/package.json +1 -1
- package/paraphrase/routes/paraphrase.amqp.routes.ts +1 -1
- package/stt/commands/delete-all-stt-jobs.command.ts +13 -0
- package/stt/commands/delete-stt-job-by-uuid.command.ts +14 -0
- package/stt/commands/index.ts +4 -0
- package/stt/commands/set-reaction-to-stt-job.command.ts +17 -0
- package/stt/commands/stt.command.ts +19 -0
- package/stt/enums/index.ts +1 -0
- package/stt/enums/stt-strategy.enum.ts +3 -0
- package/stt/index.ts +5 -0
- package/stt/models/index.ts +4 -0
- package/stt/models/stt-config.schema.ts +8 -0
- package/stt/models/stt-job.schema.ts +24 -0
- package/stt/models/stt-model.schema.ts +19 -0
- package/stt/models/stt-response.schema.ts +8 -0
- package/stt/queries/find-stt-job-by-uuid.query.ts +11 -0
- package/stt/queries/find-stt-jobs.query.ts +33 -0
- package/stt/queries/get-stt-config.query.ts +8 -0
- package/stt/queries/index.ts +3 -0
- package/stt/routes/index.ts +1 -0
- package/stt/routes/stt.amqp.routes.ts +9 -0
- package/tools/enums/job-status.enum.ts +1 -1
- package/tools/models/tool-job.schema.ts +2 -0
- package/tools/models/tool.schema.ts +2 -0
- package/tools/routes/tools.aqmp.routes.ts +1 -1
- package/tts/commands/delete-all-tts-jobs.command.ts +13 -0
- package/tts/commands/delete-tts-job-by-uuid.command.ts +14 -0
- package/tts/commands/index.ts +5 -0
- package/tts/commands/set-reaction-to-tts-job.command.ts +17 -0
- package/tts/commands/tts.command.ts +26 -0
- package/tts/commands/update-tts-job-title.command.ts +21 -0
- package/tts/enums/index.ts +2 -0
- package/tts/enums/tts-model-type.enum.ts +4 -0
- package/tts/enums/tts-strategy.enum.ts +3 -0
- package/tts/index.ts +5 -0
- package/tts/models/index.ts +3 -0
- package/tts/models/tts-config.schema.ts +8 -0
- package/tts/models/tts-job.schema.ts +33 -0
- package/tts/models/tts-model.schema.ts +62 -0
- package/tts/queries/find-tts-job-by-id.query.ts +11 -0
- package/tts/queries/find-tts-jobs.query.ts +33 -0
- package/tts/queries/get-tts-config.query.ts +8 -0
- package/tts/queries/index.ts +3 -0
- package/tts/routes/index.ts +1 -0
- package/tts/routes/tts.amqp.routes.ts +10 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { JOB_STATUS } from '../../tools';
|
|
3
|
+
import { STTResponseSchema } from './stt-response.schema';
|
|
4
|
+
import { USER_REACTION } from '../../common';
|
|
5
|
+
|
|
6
|
+
export const STTJobSchema = z.object({
|
|
7
|
+
uuid: z.string(),
|
|
8
|
+
modelId: z.string(),
|
|
9
|
+
title: z.string(),
|
|
10
|
+
fileUrl: z.string(),
|
|
11
|
+
aiResponse: STTResponseSchema.nullable(),
|
|
12
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
13
|
+
status: z.nativeEnum(JOB_STATUS),
|
|
14
|
+
error: z.string().nullable(),
|
|
15
|
+
userId: z.string().nullable(),
|
|
16
|
+
unregisteredUserId: z.string().nullable(),
|
|
17
|
+
price: z.number(),
|
|
18
|
+
isDeleted: z.boolean(),
|
|
19
|
+
createdAt: z.date(),
|
|
20
|
+
completedAt: z.date().nullable(),
|
|
21
|
+
updatedAt: z.date(),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type STTJob = z.infer<typeof STTJobSchema>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { IconVariantsSchema } from '../../common';
|
|
3
|
+
|
|
4
|
+
export const STTModelSchema = z.object({
|
|
5
|
+
uuid: z.string(),
|
|
6
|
+
title: z.string(),
|
|
7
|
+
description: z.string(),
|
|
8
|
+
aiModel: z.string(),
|
|
9
|
+
pricePerMin: z.number(),
|
|
10
|
+
order: z.number(),
|
|
11
|
+
icons: IconVariantsSchema,
|
|
12
|
+
strategy: z.string().optional(),
|
|
13
|
+
maxDurationSeconds: z.number(),
|
|
14
|
+
maxSizeMB: z.number(),
|
|
15
|
+
createdAt: z.date(),
|
|
16
|
+
updatedAt: z.date(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type STTModel = z.infer<typeof STTModelSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { STTJobSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace FindSTTJobByUuidQuery {
|
|
6
|
+
export const RequestSchema = STTJobSchema.pick({ uuid: true });
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ICommandResponseSchema(STTJobSchema);
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { STTJobSchema } from '../models/stt-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace FindSTTJobsQuery {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
userId: z.string().uuid().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().optional(),
|
|
10
|
+
title: z.string().optional(),
|
|
11
|
+
limit: z.coerce.number().min(1).optional(),
|
|
12
|
+
offset: z.coerce.number().min(0).optional(),
|
|
13
|
+
})
|
|
14
|
+
.refine(
|
|
15
|
+
(data) => {
|
|
16
|
+
return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'At least userId or unregisteredUserId must be present',
|
|
20
|
+
path: ['userId', 'unregisteredUserId'],
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = ICommandResponseSchema(
|
|
26
|
+
z.object({
|
|
27
|
+
data: z.array(STTJobSchema),
|
|
28
|
+
page: z.number(),
|
|
29
|
+
totalPages: z.number(),
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { STTConfigSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetSTTConfigQuery {
|
|
6
|
+
export const ResponseSchema = ICommandResponseSchema(STTConfigSchema);
|
|
7
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './stt.amqp.routes';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const STT_AMQP_ROUTES = {
|
|
2
|
+
EXECUTE: 'tools.stt.execute.rpc',
|
|
3
|
+
CONFIG: 'tools.stt.config.rpc',
|
|
4
|
+
GET_JOB: 'tools.stt.jobs.get.rpc',
|
|
5
|
+
LIST_JOBS: 'tools.stt.jobs.list.rpc',
|
|
6
|
+
SET_REACTION: 'tools.stt.jobs.set_reaction.rpc',
|
|
7
|
+
SOFT_DELETE: 'tools.stt.jobs.soft-delete.rpc',
|
|
8
|
+
SOFT_DELETE_ALL: 'tools.stt.jobs.soft-delete-all.rpc',
|
|
9
|
+
} as const;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace DeleteAllTTSJobsCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
userId: z.string().uuid().nullable().optional(),
|
|
7
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
8
|
+
});
|
|
9
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
10
|
+
|
|
11
|
+
export const ResponseSchema = ICommandResponseSchema(z.boolean());
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
|
|
4
|
+
export namespace DeleteTTSJobByUuidCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
userId: z.string().uuid().nullable().optional(),
|
|
7
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
8
|
+
uuid: z.string(),
|
|
9
|
+
});
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = ICommandResponseSchema(z.boolean());
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSJobSchema } from '../models/tts-job.schema';
|
|
4
|
+
import { USER_REACTION } from '../../common';
|
|
5
|
+
|
|
6
|
+
export namespace SetReactionToTTSJobCommand {
|
|
7
|
+
export const RequestSchema = z.object({
|
|
8
|
+
userId: z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
uuid: z.string(),
|
|
11
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
12
|
+
});
|
|
13
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
14
|
+
|
|
15
|
+
export const ResponseSchema = ICommandResponseSchema(TTSJobSchema);
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSJobSchema } from '../models/tts-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace TTSCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
userId: z.string().uuid().nullable().optional(),
|
|
8
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
9
|
+
userBalance: z.number(),
|
|
10
|
+
modelId: z.string(),
|
|
11
|
+
voiceId: z.string(),
|
|
12
|
+
userInput: z.string(),
|
|
13
|
+
params: z
|
|
14
|
+
.object({
|
|
15
|
+
speed: z.number().optional(),
|
|
16
|
+
similarity: z.number().optional(),
|
|
17
|
+
stability: z.number().optional(),
|
|
18
|
+
style: z.number().optional(),
|
|
19
|
+
})
|
|
20
|
+
.optional(),
|
|
21
|
+
});
|
|
22
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
23
|
+
|
|
24
|
+
export const ResponseSchema = ICommandResponseSchema(TTSJobSchema);
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSJobSchema } from '../models/tts-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace UpdateTTSJobTitleCommand {
|
|
6
|
+
export const RequestSchema = z.object({
|
|
7
|
+
uuid: z.string().uuid(),
|
|
8
|
+
userId: z.string().uuid().nullable().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().nullable().optional(),
|
|
10
|
+
title: z.string().min(1).max(40),
|
|
11
|
+
});
|
|
12
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
13
|
+
|
|
14
|
+
export const RequestParamsSchema = z.object({
|
|
15
|
+
uuid: z.string(),
|
|
16
|
+
});
|
|
17
|
+
export type RequestParams = z.infer<typeof RequestParamsSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseSchema = ICommandResponseSchema(TTSJobSchema);
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
package/tts/index.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { JOB_STATUS } from '../../tools';
|
|
3
|
+
import { USER_REACTION } from '../../common';
|
|
4
|
+
|
|
5
|
+
export const TTSJobParamsSchema = z.object({
|
|
6
|
+
speed: z.number().optional(),
|
|
7
|
+
similarity: z.number().optional(),
|
|
8
|
+
stability: z.number().optional(),
|
|
9
|
+
style: z.number().optional(),
|
|
10
|
+
});
|
|
11
|
+
export type TTSJobParams = z.infer<typeof TTSJobParamsSchema>;
|
|
12
|
+
|
|
13
|
+
export const TTSJobSchema = z.object({
|
|
14
|
+
uuid: z.string(),
|
|
15
|
+
userInput: z.string(),
|
|
16
|
+
aiResponse: z.string().nullable(),
|
|
17
|
+
reaction: z.nativeEnum(USER_REACTION).nullable(),
|
|
18
|
+
title: z.string(),
|
|
19
|
+
status: z.nativeEnum(JOB_STATUS),
|
|
20
|
+
error: z.string().nullable(),
|
|
21
|
+
modelId: z.string(),
|
|
22
|
+
voiceId: z.string(),
|
|
23
|
+
price: z.number(),
|
|
24
|
+
userId: z.string().nullable(),
|
|
25
|
+
unregisteredUserId: z.string().nullable(),
|
|
26
|
+
isDeleted: z.boolean(),
|
|
27
|
+
params: TTSJobParamsSchema,
|
|
28
|
+
createdAt: z.date(),
|
|
29
|
+
updatedAt: z.date(),
|
|
30
|
+
completedAt: z.date().nullable(),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export type TTSJob = z.infer<typeof TTSJobSchema>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { IconVariantsSchema } from '../../common';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
export const TTSVoiceSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
externalId: z.string(),
|
|
7
|
+
icon: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
previewUrl: z.string(),
|
|
10
|
+
description: z.string(),
|
|
11
|
+
languages: z.array(
|
|
12
|
+
z.object({
|
|
13
|
+
code: z.string(),
|
|
14
|
+
title: z.string(),
|
|
15
|
+
icon: z.string(),
|
|
16
|
+
order: z.number(),
|
|
17
|
+
}),
|
|
18
|
+
),
|
|
19
|
+
order: z.number(),
|
|
20
|
+
});
|
|
21
|
+
export type TTSVoice = z.infer<typeof TTSVoiceSchema>;
|
|
22
|
+
|
|
23
|
+
export const TTSSliderSchema = z.object({
|
|
24
|
+
title: z.string(),
|
|
25
|
+
description: z.string(),
|
|
26
|
+
icons: IconVariantsSchema,
|
|
27
|
+
min: z.number(),
|
|
28
|
+
minLabel: z.string(),
|
|
29
|
+
max: z.number(),
|
|
30
|
+
maxLabel: z.string(),
|
|
31
|
+
step: z.number(),
|
|
32
|
+
default: z.number(),
|
|
33
|
+
});
|
|
34
|
+
export type TTSSlider = z.infer<typeof TTSSliderSchema>;
|
|
35
|
+
|
|
36
|
+
export const TTSModelParams = z
|
|
37
|
+
.object({
|
|
38
|
+
speed: TTSSliderSchema,
|
|
39
|
+
stability: TTSSliderSchema,
|
|
40
|
+
similarity: TTSSliderSchema,
|
|
41
|
+
style: TTSSliderSchema,
|
|
42
|
+
})
|
|
43
|
+
.partial();
|
|
44
|
+
export type TTSModelParams = z.infer<typeof TTSModelParams>;
|
|
45
|
+
|
|
46
|
+
export const TTSModelSchema = z.object({
|
|
47
|
+
uuid: z.string(),
|
|
48
|
+
title: z.string(),
|
|
49
|
+
description: z.string(),
|
|
50
|
+
aiModel: z.string(),
|
|
51
|
+
pricePerThousandSymbols: z.number(),
|
|
52
|
+
order: z.number(),
|
|
53
|
+
icons: IconVariantsSchema,
|
|
54
|
+
strategy: z.string().optional(),
|
|
55
|
+
maxInputLength: z.number(),
|
|
56
|
+
voices: z.array(TTSVoiceSchema),
|
|
57
|
+
params: TTSModelParams,
|
|
58
|
+
createdAt: z.date(),
|
|
59
|
+
updatedAt: z.date(),
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export type TTSModel = z.infer<typeof TTSModelSchema>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSJobSchema } from '../models/tts-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace FindTTSJobByIdQuery {
|
|
6
|
+
export const RequestSchema = TTSJobSchema.pick({ uuid: true });
|
|
7
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = ICommandResponseSchema(TTSJobSchema);
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSJobSchema } from '../models/tts-job.schema';
|
|
4
|
+
|
|
5
|
+
export namespace FindTTSJobsQuery {
|
|
6
|
+
export const RequestSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
userId: z.string().uuid().optional(),
|
|
9
|
+
unregisteredUserId: z.string().uuid().optional(),
|
|
10
|
+
title: z.string().optional(),
|
|
11
|
+
limit: z.coerce.number().min(1).optional(),
|
|
12
|
+
offset: z.coerce.number().min(0).default(0).optional(),
|
|
13
|
+
})
|
|
14
|
+
.refine(
|
|
15
|
+
(data) => {
|
|
16
|
+
return Boolean(data.userId) !== Boolean(data.unregisteredUserId);
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
message: 'At least userId or unregisteredUserId must be present',
|
|
20
|
+
path: ['userId', 'unregisteredUserId'],
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
24
|
+
|
|
25
|
+
export const ResponseSchema = ICommandResponseSchema(
|
|
26
|
+
z.object({
|
|
27
|
+
data: z.array(TTSJobSchema),
|
|
28
|
+
page: z.number(),
|
|
29
|
+
totalPages: z.number(),
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ICommandResponseSchema } from '../../common/models/command-response.schema';
|
|
3
|
+
import { TTSConfigSchema } from '../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetTTSConfigQuery {
|
|
6
|
+
export const ResponseSchema = ICommandResponseSchema(TTSConfigSchema);
|
|
7
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tts.amqp.routes';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const TTS_AMQP_ROUTES = {
|
|
2
|
+
EXECUTE: 'tools.tts.execute.rpc',
|
|
3
|
+
CONFIG: 'tools.tts.config.rpc',
|
|
4
|
+
GET_JOB: 'tools.tts.jobs.get.rpc',
|
|
5
|
+
LIST_JOBS: 'tools.tts.jobs.list.rpc',
|
|
6
|
+
SET_REACTION: 'tools.tts.jobs.set-reaction.rpc',
|
|
7
|
+
UPDATE_TITLE: 'tools.tts.jobs.update-title.rpc',
|
|
8
|
+
SOFT_DELETE: 'tools.tts.jobs.soft-delete.rpc',
|
|
9
|
+
SOFT_DELETE_ALL: 'tools.tts.jobs.soft-delete-all.rpc',
|
|
10
|
+
} as const;
|