@drax/ai-back 3.44.0 → 3.46.0
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/dist/controllers/TTSVoiceController.js +18 -0
- package/dist/factory/services/TTSVoiceServiceFactory.js +28 -0
- package/dist/index.js +13 -4
- package/dist/interfaces/ITTSVoice.js +1 -0
- package/dist/interfaces/ITTSVoiceRepository.js +1 -0
- package/dist/models/TTSVoiceModel.js +25 -0
- package/dist/permissions/TTSVoicePermissions.js +10 -0
- package/dist/repository/mongo/TTSVoiceMongoRepository.js +13 -0
- package/dist/repository/sqlite/TTSVoiceSqliteRepository.js +27 -0
- package/dist/routes/TTSVoiceRoutes.js +21 -0
- package/dist/schemas/TTSVoiceSchema.js +19 -0
- package/dist/services/TTSVoiceService.js +9 -0
- package/package.json +4 -4
- package/src/controllers/TTSVoiceController.ts +27 -0
- package/src/factory/services/TTSVoiceServiceFactory.ts +36 -0
- package/src/index.ts +22 -0
- package/src/interfaces/ITTSVoice.ts +20 -0
- package/src/interfaces/ITTSVoiceRepository.ts +8 -0
- package/src/models/TTSVoiceModel.ts +37 -0
- package/src/permissions/TTSVoicePermissions.ts +12 -0
- package/src/repository/mongo/TTSVoiceMongoRepository.ts +19 -0
- package/src/repository/sqlite/TTSVoiceSqliteRepository.ts +33 -0
- package/src/routes/TTSVoiceRoutes.ts +26 -0
- package/src/schemas/TTSVoiceSchema.ts +23 -0
- package/src/services/TTSVoiceService.ts +16 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/types/controllers/TTSVoiceController.d.ts +8 -0
- package/types/controllers/TTSVoiceController.d.ts.map +1 -0
- package/types/factory/services/TTSVoiceServiceFactory.d.ts +8 -0
- package/types/factory/services/TTSVoiceServiceFactory.d.ts.map +1 -0
- package/types/index.d.ts +12 -2
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/ITTSVoice.d.ts +16 -0
- package/types/interfaces/ITTSVoice.d.ts.map +1 -0
- package/types/interfaces/ITTSVoiceRepository.d.ts +6 -0
- package/types/interfaces/ITTSVoiceRepository.d.ts.map +1 -0
- package/types/models/TTSVoiceModel.d.ts +15 -0
- package/types/models/TTSVoiceModel.d.ts.map +1 -0
- package/types/permissions/TTSVoicePermissions.d.ts +10 -0
- package/types/permissions/TTSVoicePermissions.d.ts.map +1 -0
- package/types/repository/mongo/TTSVoiceMongoRepository.d.ts +9 -0
- package/types/repository/mongo/TTSVoiceMongoRepository.d.ts.map +1 -0
- package/types/repository/sqlite/TTSVoiceSqliteRepository.d.ts +23 -0
- package/types/repository/sqlite/TTSVoiceSqliteRepository.d.ts.map +1 -0
- package/types/routes/TTSVoiceRoutes.d.ts +4 -0
- package/types/routes/TTSVoiceRoutes.d.ts.map +1 -0
- package/types/schemas/TTSVoiceSchema.d.ts +36 -0
- package/types/schemas/TTSVoiceSchema.d.ts.map +1 -0
- package/types/services/TTSVoiceService.d.ts +10 -0
- package/types/services/TTSVoiceService.d.ts.map +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {z} from 'zod';
|
|
2
|
+
|
|
3
|
+
const TTSVoiceProviderSchema = z.enum(['ElevenLabs']);
|
|
4
|
+
|
|
5
|
+
const TTSVoiceBaseSchema = z.object({
|
|
6
|
+
name: z.string().min(1, 'validation.required'),
|
|
7
|
+
ttsProvider: TTSVoiceProviderSchema,
|
|
8
|
+
voiceId: z.string().min(1, 'validation.required'),
|
|
9
|
+
model: z.string().optional().nullable(),
|
|
10
|
+
languageCode: z.string().optional().nullable(),
|
|
11
|
+
tenant: z.coerce.string().optional().nullable(),
|
|
12
|
+
user: z.coerce.string().optional().nullable()
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const TTSVoiceSchema = TTSVoiceBaseSchema
|
|
16
|
+
.extend({
|
|
17
|
+
_id: z.coerce.string(),
|
|
18
|
+
tenant: z.object({_id: z.coerce.string(), name: z.string().optional()}).nullable().optional(),
|
|
19
|
+
user: z.object({_id: z.coerce.string(), username: z.string().optional()}).nullable().optional()
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export default TTSVoiceSchema;
|
|
23
|
+
export {TTSVoiceSchema, TTSVoiceBaseSchema, TTSVoiceProviderSchema}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type {ITTSVoiceRepository} from "../interfaces/ITTSVoiceRepository";
|
|
2
|
+
import type {ITTSVoiceBase, ITTSVoice} from "../interfaces/ITTSVoice";
|
|
3
|
+
import {AbstractService} from "@drax/crud-back";
|
|
4
|
+
import type {ZodObject, ZodRawShape} from "zod";
|
|
5
|
+
|
|
6
|
+
class TTSVoiceService extends AbstractService<ITTSVoice, ITTSVoiceBase, ITTSVoiceBase> {
|
|
7
|
+
|
|
8
|
+
constructor(TTSVoiceRepository: ITTSVoiceRepository, baseSchema?: ZodObject<ZodRawShape>, fullSchema?: ZodObject<ZodRawShape>) {
|
|
9
|
+
super(TTSVoiceRepository, baseSchema, fullSchema);
|
|
10
|
+
this._validateOutput = true
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default TTSVoiceService
|
|
16
|
+
export {TTSVoiceService}
|