@purpleschool/gptbot 0.14.16 → 0.14.18
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/avatar-studio.ts +4 -1
- package/api/controllers/http/update-post.ts +1 -0
- package/api/routes.ts +7 -2
- package/build/api/controllers/http/avatar-studio.js +4 -1
- package/build/api/controllers/http/update-post.js +1 -0
- package/build/api/routes.js +5 -1
- package/build/commands/avatar-studio/media/find-avatar-studio-media.query.js +2 -1
- package/build/commands/avatar-studio/scriptwriter/calculate-avatar-studio-scriptwriter-price.command.js +19 -0
- package/build/commands/avatar-studio/scriptwriter/create-avatar-studio-scriptwriter-message.command.js +13 -21
- package/build/commands/avatar-studio/scriptwriter/find-avatar-studio-scriptwriter-messages.query.js +13 -0
- package/build/commands/avatar-studio/scriptwriter/index.js +2 -0
- package/build/commands/avatar-studio/shared/get-avatar-studio-config.query.js +189 -0
- package/build/commands/avatar-studio/shared/index.js +1 -0
- package/build/commands/update-post/delete-update-post.command.js +25 -0
- package/build/commands/update-post/index.js +1 -0
- package/build/models/avatar-studio/avatar-studio.schema.js +0 -2
- package/commands/avatar-studio/media/find-avatar-studio-media.query.ts +2 -2
- package/commands/avatar-studio/scriptwriter/calculate-avatar-studio-scriptwriter-price.command.ts +21 -0
- package/commands/avatar-studio/scriptwriter/create-avatar-studio-scriptwriter-message.command.ts +18 -26
- package/commands/avatar-studio/scriptwriter/find-avatar-studio-scriptwriter-messages.query.ts +13 -0
- package/commands/avatar-studio/scriptwriter/index.ts +2 -0
- package/commands/avatar-studio/shared/get-avatar-studio-config.query.ts +221 -0
- package/commands/avatar-studio/shared/index.ts +1 -0
- package/commands/update-post/delete-update-post.command.ts +26 -0
- package/commands/update-post/index.ts +1 -0
- package/models/avatar-studio/avatar-studio.schema.ts +0 -2
- package/package.json +1 -1
|
@@ -10,8 +10,9 @@ export const AVATAR_STUDIO_ROUTES = {
|
|
|
10
10
|
UPDATE_SCENE: (clipId: string, sceneId: string) => `clips/${clipId}/scenes/${sceneId}`,
|
|
11
11
|
DELETE_SCENE: (clipId: string, sceneId: string) => `clips/${clipId}/scenes/${sceneId}`,
|
|
12
12
|
REORDER_SCENES: (clipId: string) => `clips/${clipId}/scenes/reorder`,
|
|
13
|
+
GET_CONFIG: 'config',
|
|
13
14
|
CREATE_MEDIA_FROM_FILE: (clipId: string) => `clips/${clipId}/media/from-file`,
|
|
14
|
-
GET_MEDIA:
|
|
15
|
+
GET_MEDIA: 'media',
|
|
15
16
|
UPDATE_MEDIA: (clipId: string, mediaId: string) => `clips/${clipId}/media/${mediaId}`,
|
|
16
17
|
DELETE_MEDIA: (clipId: string, mediaId: string) => `clips/${clipId}/media/${mediaId}`,
|
|
17
18
|
GENERATE_FRAME: (clipId: string, sceneId: string) =>
|
|
@@ -29,6 +30,8 @@ export const AVATAR_STUDIO_ROUTES = {
|
|
|
29
30
|
GET_VOICES: 'voices',
|
|
30
31
|
GET_CLIP_VOICES: (clipId: string) => `clips/${clipId}/voices`,
|
|
31
32
|
UPDATE_CLIP_VOICE: (clipId: string) => `clips/${clipId}/voice`,
|
|
33
|
+
CALCULATE_SCRIPTWRITER_PRICE: (clipId: string) => `clips/${clipId}/scriptwriter/price`,
|
|
34
|
+
GET_SCRIPTWRITER_MESSAGES: (clipId: string) => `clips/${clipId}/scriptwriter/messages`,
|
|
32
35
|
CREATE_SCRIPTWRITER_MESSAGE: (clipId: string) => `clips/${clipId}/scriptwriter/messages`,
|
|
33
36
|
APPLY_SCRIPTWRITER_MESSAGE: (clipId: string, messageId: string) =>
|
|
34
37
|
`clips/${clipId}/scriptwriter/messages/${messageId}/apply`,
|
|
@@ -3,6 +3,7 @@ export const UPDATE_POST_ADMIN_CONTROLLER = 'update-post/admin' as const;
|
|
|
3
3
|
|
|
4
4
|
export const UPDATE_POST_ROUTES = {
|
|
5
5
|
CREATE: 'create',
|
|
6
|
+
DELETE: 'delete',
|
|
6
7
|
UPDATE: (uuid: string) => `${uuid}`,
|
|
7
8
|
FIND_BY_UUID: (uuid: string) => `by/uuid/${uuid}`,
|
|
8
9
|
FIND_BY_SLUG: (slug: string) => `by/slug/${slug}`,
|
package/api/routes.ts
CHANGED
|
@@ -487,6 +487,7 @@ export const REST_API = {
|
|
|
487
487
|
CREATE: `${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.CREATE}`,
|
|
488
488
|
PATCH: (uuid: string) =>
|
|
489
489
|
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.UPDATE(uuid)}`,
|
|
490
|
+
DELETE: `${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.DELETE}`,
|
|
490
491
|
GET_BY_UUID: (uuid: string) =>
|
|
491
492
|
`${ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
492
493
|
GET_BY_SLUG: (slug: string) =>
|
|
@@ -1673,10 +1674,10 @@ export const REST_API = {
|
|
|
1673
1674
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.DELETE_SCENE(clipId, sceneId)}`,
|
|
1674
1675
|
REORDER_SCENES: (clipId: string) =>
|
|
1675
1676
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.REORDER_SCENES(clipId)}`,
|
|
1677
|
+
GET_CONFIG: `${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_CONFIG}`,
|
|
1676
1678
|
CREATE_MEDIA_FROM_FILE: (clipId: string) =>
|
|
1677
1679
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.CREATE_MEDIA_FROM_FILE(clipId)}`,
|
|
1678
|
-
GET_MEDIA:
|
|
1679
|
-
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_MEDIA(clipId)}`,
|
|
1680
|
+
GET_MEDIA: `${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_MEDIA}`,
|
|
1680
1681
|
UPDATE_MEDIA: (clipId: string, mediaId: string) =>
|
|
1681
1682
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.UPDATE_MEDIA(clipId, mediaId)}`,
|
|
1682
1683
|
DELETE_MEDIA: (clipId: string, mediaId: string) =>
|
|
@@ -1700,6 +1701,10 @@ export const REST_API = {
|
|
|
1700
1701
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_CLIP_VOICES(clipId)}`,
|
|
1701
1702
|
UPDATE_CLIP_VOICE: (clipId: string) =>
|
|
1702
1703
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.UPDATE_CLIP_VOICE(clipId)}`,
|
|
1704
|
+
CALCULATE_SCRIPTWRITER_PRICE: (clipId: string) =>
|
|
1705
|
+
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.CALCULATE_SCRIPTWRITER_PRICE(clipId)}`,
|
|
1706
|
+
GET_SCRIPTWRITER_MESSAGES: (clipId: string) =>
|
|
1707
|
+
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_SCRIPTWRITER_MESSAGES(clipId)}`,
|
|
1703
1708
|
CREATE_SCRIPTWRITER_MESSAGE: (clipId: string) =>
|
|
1704
1709
|
`${ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.CREATE_SCRIPTWRITER_MESSAGE(clipId)}`,
|
|
1705
1710
|
APPLY_SCRIPTWRITER_MESSAGE: (clipId: string, messageId: string) =>
|
|
@@ -12,8 +12,9 @@ exports.AVATAR_STUDIO_ROUTES = {
|
|
|
12
12
|
UPDATE_SCENE: (clipId, sceneId) => `clips/${clipId}/scenes/${sceneId}`,
|
|
13
13
|
DELETE_SCENE: (clipId, sceneId) => `clips/${clipId}/scenes/${sceneId}`,
|
|
14
14
|
REORDER_SCENES: (clipId) => `clips/${clipId}/scenes/reorder`,
|
|
15
|
+
GET_CONFIG: 'config',
|
|
15
16
|
CREATE_MEDIA_FROM_FILE: (clipId) => `clips/${clipId}/media/from-file`,
|
|
16
|
-
GET_MEDIA:
|
|
17
|
+
GET_MEDIA: 'media',
|
|
17
18
|
UPDATE_MEDIA: (clipId, mediaId) => `clips/${clipId}/media/${mediaId}`,
|
|
18
19
|
DELETE_MEDIA: (clipId, mediaId) => `clips/${clipId}/media/${mediaId}`,
|
|
19
20
|
GENERATE_FRAME: (clipId, sceneId) => `clips/${clipId}/scenes/${sceneId}/frame/generate`,
|
|
@@ -26,6 +27,8 @@ exports.AVATAR_STUDIO_ROUTES = {
|
|
|
26
27
|
GET_VOICES: 'voices',
|
|
27
28
|
GET_CLIP_VOICES: (clipId) => `clips/${clipId}/voices`,
|
|
28
29
|
UPDATE_CLIP_VOICE: (clipId) => `clips/${clipId}/voice`,
|
|
30
|
+
CALCULATE_SCRIPTWRITER_PRICE: (clipId) => `clips/${clipId}/scriptwriter/price`,
|
|
31
|
+
GET_SCRIPTWRITER_MESSAGES: (clipId) => `clips/${clipId}/scriptwriter/messages`,
|
|
29
32
|
CREATE_SCRIPTWRITER_MESSAGE: (clipId) => `clips/${clipId}/scriptwriter/messages`,
|
|
30
33
|
APPLY_SCRIPTWRITER_MESSAGE: (clipId, messageId) => `clips/${clipId}/scriptwriter/messages/${messageId}/apply`,
|
|
31
34
|
GET_GENERATION_JOB: (jobId) => `generation-jobs/${jobId}`,
|
|
@@ -5,6 +5,7 @@ exports.UPDATE_POST_CONTROLLER = 'update-post';
|
|
|
5
5
|
exports.UPDATE_POST_ADMIN_CONTROLLER = 'update-post/admin';
|
|
6
6
|
exports.UPDATE_POST_ROUTES = {
|
|
7
7
|
CREATE: 'create',
|
|
8
|
+
DELETE: 'delete',
|
|
8
9
|
UPDATE: (uuid) => `${uuid}`,
|
|
9
10
|
FIND_BY_UUID: (uuid) => `by/uuid/${uuid}`,
|
|
10
11
|
FIND_BY_SLUG: (slug) => `by/slug/${slug}`,
|
package/build/api/routes.js
CHANGED
|
@@ -387,6 +387,7 @@ exports.REST_API = {
|
|
|
387
387
|
UPDATE_POSTS: {
|
|
388
388
|
CREATE: `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.CREATE}`,
|
|
389
389
|
PATCH: (uuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.UPDATE(uuid)}`,
|
|
390
|
+
DELETE: `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.DELETE}`,
|
|
390
391
|
GET_BY_UUID: (uuid) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_UUID(uuid)}`,
|
|
391
392
|
GET_BY_SLUG: (slug) => `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_ADMIN_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_BY_SLUG(slug)}`,
|
|
392
393
|
GET_ALL: `${exports.ROOT}/${CONTROLLERS.UPDATE_POST_CONTROLLER}/${CONTROLLERS.UPDATE_POST_ROUTES.FIND_ALL}`,
|
|
@@ -1206,8 +1207,9 @@ exports.REST_API = {
|
|
|
1206
1207
|
UPDATE_SCENE: (clipId, sceneId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.UPDATE_SCENE(clipId, sceneId)}`,
|
|
1207
1208
|
DELETE_SCENE: (clipId, sceneId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.DELETE_SCENE(clipId, sceneId)}`,
|
|
1208
1209
|
REORDER_SCENES: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.REORDER_SCENES(clipId)}`,
|
|
1210
|
+
GET_CONFIG: `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_CONFIG}`,
|
|
1209
1211
|
CREATE_MEDIA_FROM_FILE: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.CREATE_MEDIA_FROM_FILE(clipId)}`,
|
|
1210
|
-
GET_MEDIA:
|
|
1212
|
+
GET_MEDIA: `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_MEDIA}`,
|
|
1211
1213
|
UPDATE_MEDIA: (clipId, mediaId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.UPDATE_MEDIA(clipId, mediaId)}`,
|
|
1212
1214
|
DELETE_MEDIA: (clipId, mediaId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.DELETE_MEDIA(clipId, mediaId)}`,
|
|
1213
1215
|
GENERATE_FRAME: (clipId, sceneId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GENERATE_FRAME(clipId, sceneId)}`,
|
|
@@ -1220,6 +1222,8 @@ exports.REST_API = {
|
|
|
1220
1222
|
GET_VOICES: `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_VOICES}`,
|
|
1221
1223
|
GET_CLIP_VOICES: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_CLIP_VOICES(clipId)}`,
|
|
1222
1224
|
UPDATE_CLIP_VOICE: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.UPDATE_CLIP_VOICE(clipId)}`,
|
|
1225
|
+
CALCULATE_SCRIPTWRITER_PRICE: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.CALCULATE_SCRIPTWRITER_PRICE(clipId)}`,
|
|
1226
|
+
GET_SCRIPTWRITER_MESSAGES: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_SCRIPTWRITER_MESSAGES(clipId)}`,
|
|
1223
1227
|
CREATE_SCRIPTWRITER_MESSAGE: (clipId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.CREATE_SCRIPTWRITER_MESSAGE(clipId)}`,
|
|
1224
1228
|
APPLY_SCRIPTWRITER_MESSAGE: (clipId, messageId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.APPLY_SCRIPTWRITER_MESSAGE(clipId, messageId)}`,
|
|
1225
1229
|
GET_GENERATION_JOB: (jobId) => `${exports.ROOT}/${CONTROLLERS.AVATAR_STUDIO_CONTROLLER_PRIVATE}/${CONTROLLERS.AVATAR_STUDIO_ROUTES.GET_GENERATION_JOB(jobId)}`,
|
|
@@ -7,8 +7,9 @@ const models_1 = require("../../../models");
|
|
|
7
7
|
const avatar_studio_common_schema_1 = require("../shared/avatar-studio-common.schema");
|
|
8
8
|
var FindAvatarStudioMediaQuery;
|
|
9
9
|
(function (FindAvatarStudioMediaQuery) {
|
|
10
|
-
FindAvatarStudioMediaQuery.ParamsSchema =
|
|
10
|
+
FindAvatarStudioMediaQuery.ParamsSchema = zod_1.z.object({}).strict();
|
|
11
11
|
FindAvatarStudioMediaQuery.QuerySchema = avatar_studio_common_schema_1.AvatarStudioPaginationQuerySchema.extend({
|
|
12
|
+
clipId: zod_1.z.string().uuid().optional(),
|
|
12
13
|
sceneId: zod_1.z.string().uuid().optional(),
|
|
13
14
|
kind: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_MEDIA_KIND).optional(),
|
|
14
15
|
role: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_MEDIA_ROLE).optional(),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CalculateAvatarStudioScriptwriterPriceCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const avatar_studio_common_schema_1 = require("../shared/avatar-studio-common.schema");
|
|
6
|
+
const create_avatar_studio_scriptwriter_message_command_1 = require("./create-avatar-studio-scriptwriter-message.command");
|
|
7
|
+
var CalculateAvatarStudioScriptwriterPriceCommand;
|
|
8
|
+
(function (CalculateAvatarStudioScriptwriterPriceCommand) {
|
|
9
|
+
CalculateAvatarStudioScriptwriterPriceCommand.ParamsSchema = avatar_studio_common_schema_1.AvatarStudioClipIdParamsSchema;
|
|
10
|
+
CalculateAvatarStudioScriptwriterPriceCommand.RequestSchema = create_avatar_studio_scriptwriter_message_command_1.CreateAvatarStudioScriptwriterMessageCommand.RequestSchema;
|
|
11
|
+
CalculateAvatarStudioScriptwriterPriceCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z
|
|
13
|
+
.object({
|
|
14
|
+
price: zod_1.z.number().nonnegative(),
|
|
15
|
+
inputChars: zod_1.z.number().int().nonnegative(),
|
|
16
|
+
})
|
|
17
|
+
.strict(),
|
|
18
|
+
});
|
|
19
|
+
})(CalculateAvatarStudioScriptwriterPriceCommand || (exports.CalculateAvatarStudioScriptwriterPriceCommand = CalculateAvatarStudioScriptwriterPriceCommand = {}));
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CreateAvatarStudioScriptwriterMessageCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
|
+
const constants_1 = require("../../../constants");
|
|
6
7
|
const avatar_studio_common_schema_1 = require("../shared/avatar-studio-common.schema");
|
|
7
8
|
var CreateAvatarStudioScriptwriterMessageCommand;
|
|
8
9
|
(function (CreateAvatarStudioScriptwriterMessageCommand) {
|
|
@@ -15,32 +16,23 @@ var CreateAvatarStudioScriptwriterMessageCommand;
|
|
|
15
16
|
})
|
|
16
17
|
.strict();
|
|
17
18
|
CreateAvatarStudioScriptwriterMessageCommand.ResponseSchema = zod_1.z.object({
|
|
18
|
-
data:
|
|
19
|
-
userMessage: models_1.AvatarStudioScriptwriterMessageSchema,
|
|
20
|
-
assistantMessage: models_1.AvatarStudioScriptwriterMessageSchema,
|
|
21
|
-
}),
|
|
19
|
+
data: models_1.AvatarStudioScriptwriterMessageSchema,
|
|
22
20
|
});
|
|
23
21
|
CreateAvatarStudioScriptwriterMessageCommand.ScenePlanSchema = zod_1.z
|
|
24
22
|
.object({
|
|
25
|
-
voiceConfig:
|
|
26
|
-
text:
|
|
23
|
+
voiceConfig: zod_1.z.object({
|
|
24
|
+
text: zod_1.z.string().trim().min(1),
|
|
27
25
|
}),
|
|
28
|
-
imageConfig:
|
|
29
|
-
prompt:
|
|
30
|
-
style:
|
|
31
|
-
}).partial({
|
|
32
|
-
style: true,
|
|
26
|
+
imageConfig: zod_1.z.object({
|
|
27
|
+
prompt: zod_1.z.string().trim().min(1),
|
|
28
|
+
style: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_IMAGE_STYLE),
|
|
33
29
|
}),
|
|
34
|
-
videoConfig:
|
|
35
|
-
prompt:
|
|
36
|
-
durationSeconds:
|
|
37
|
-
videoMode:
|
|
38
|
-
quality:
|
|
39
|
-
sound:
|
|
40
|
-
}).partial({
|
|
41
|
-
videoMode: true,
|
|
42
|
-
quality: true,
|
|
43
|
-
sound: true,
|
|
30
|
+
videoConfig: zod_1.z.object({
|
|
31
|
+
prompt: zod_1.z.string().trim().min(1),
|
|
32
|
+
durationSeconds: zod_1.z.number().positive(),
|
|
33
|
+
videoMode: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_MODE),
|
|
34
|
+
quality: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_QUALITY),
|
|
35
|
+
sound: zod_1.z.boolean(),
|
|
44
36
|
}),
|
|
45
37
|
})
|
|
46
38
|
.strict();
|
package/build/commands/avatar-studio/scriptwriter/find-avatar-studio-scriptwriter-messages.query.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindAvatarStudioScriptwriterMessagesQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
const avatar_studio_common_schema_1 = require("../shared/avatar-studio-common.schema");
|
|
7
|
+
var FindAvatarStudioScriptwriterMessagesQuery;
|
|
8
|
+
(function (FindAvatarStudioScriptwriterMessagesQuery) {
|
|
9
|
+
FindAvatarStudioScriptwriterMessagesQuery.ParamsSchema = avatar_studio_common_schema_1.AvatarStudioClipIdParamsSchema;
|
|
10
|
+
FindAvatarStudioScriptwriterMessagesQuery.ResponseSchema = zod_1.z.object({
|
|
11
|
+
data: zod_1.z.array(models_1.AvatarStudioScriptwriterMessageSchema),
|
|
12
|
+
});
|
|
13
|
+
})(FindAvatarStudioScriptwriterMessagesQuery || (exports.FindAvatarStudioScriptwriterMessagesQuery = FindAvatarStudioScriptwriterMessagesQuery = {}));
|
|
@@ -15,4 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./apply-avatar-studio-scriptwriter-message.command"), exports);
|
|
18
|
+
__exportStar(require("./calculate-avatar-studio-scriptwriter-price.command"), exports);
|
|
18
19
|
__exportStar(require("./create-avatar-studio-scriptwriter-message.command"), exports);
|
|
20
|
+
__exportStar(require("./find-avatar-studio-scriptwriter-messages.query"), exports);
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetAvatarStudioConfigQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../../constants");
|
|
6
|
+
const models_1 = require("../../../models");
|
|
7
|
+
const AvatarStudioGenerationPriceSchema = zod_1.z
|
|
8
|
+
.object({
|
|
9
|
+
price: zod_1.z.number().nonnegative().optional(),
|
|
10
|
+
pricePerSecond: zod_1.z.number().nonnegative().optional(),
|
|
11
|
+
pricePerSymbol: zod_1.z.number().nonnegative().optional(),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
const AvatarStudioConfigSectionBaseSchema = zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
available: zod_1.z.boolean(),
|
|
17
|
+
unavailableReason: zod_1.z.string().optional(),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
const AvatarStudioTextFieldSchema = zod_1.z
|
|
21
|
+
.object({
|
|
22
|
+
kind: zod_1.z.literal('text'),
|
|
23
|
+
required: zod_1.z.boolean(),
|
|
24
|
+
maxLength: zod_1.z.number().int().positive().nullable().optional(),
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
const AvatarStudioSelectFieldSchema = (optionSchema) => zod_1.z
|
|
28
|
+
.object({
|
|
29
|
+
kind: zod_1.z.literal('select'),
|
|
30
|
+
required: zod_1.z.boolean(),
|
|
31
|
+
options: zod_1.z.array(optionSchema),
|
|
32
|
+
})
|
|
33
|
+
.strict();
|
|
34
|
+
const AvatarStudioMediaFieldSchema = zod_1.z
|
|
35
|
+
.object({
|
|
36
|
+
kind: zod_1.z.literal('media'),
|
|
37
|
+
required: zod_1.z.boolean(),
|
|
38
|
+
mediaKind: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_MEDIA_KIND),
|
|
39
|
+
mediaRole: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_MEDIA_ROLE),
|
|
40
|
+
})
|
|
41
|
+
.strict();
|
|
42
|
+
const AvatarStudioMediaArrayFieldSchema = zod_1.z
|
|
43
|
+
.object({
|
|
44
|
+
kind: zod_1.z.literal('media-array'),
|
|
45
|
+
required: zod_1.z.boolean(),
|
|
46
|
+
supported: zod_1.z.boolean(),
|
|
47
|
+
})
|
|
48
|
+
.strict();
|
|
49
|
+
const AvatarStudioFixedFieldSchema = (valueSchema) => zod_1.z
|
|
50
|
+
.object({
|
|
51
|
+
kind: zod_1.z.literal('fixed'),
|
|
52
|
+
value: valueSchema,
|
|
53
|
+
})
|
|
54
|
+
.strict();
|
|
55
|
+
const AvatarStudioNumberFieldSchema = zod_1.z
|
|
56
|
+
.object({
|
|
57
|
+
kind: zod_1.z.literal('number'),
|
|
58
|
+
required: zod_1.z.boolean(),
|
|
59
|
+
options: zod_1.z.array(zod_1.z.number().positive()),
|
|
60
|
+
default: zod_1.z.number().positive(),
|
|
61
|
+
})
|
|
62
|
+
.strict();
|
|
63
|
+
const AvatarStudioBooleanFieldSchema = zod_1.z
|
|
64
|
+
.object({
|
|
65
|
+
kind: zod_1.z.literal('boolean'),
|
|
66
|
+
required: zod_1.z.boolean(),
|
|
67
|
+
default: zod_1.z.boolean(),
|
|
68
|
+
})
|
|
69
|
+
.strict();
|
|
70
|
+
const AvatarStudioAudioConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
71
|
+
fields: zod_1.z
|
|
72
|
+
.object({
|
|
73
|
+
text: AvatarStudioTextFieldSchema.extend({
|
|
74
|
+
required: zod_1.z.boolean(),
|
|
75
|
+
maxLength: zod_1.z.number().int().positive().nullable(),
|
|
76
|
+
}),
|
|
77
|
+
mediaId: AvatarStudioMediaFieldSchema.extend({
|
|
78
|
+
required: zod_1.z.boolean(),
|
|
79
|
+
mediaKind: zod_1.z.literal(constants_1.AVATAR_STUDIO_MEDIA_KIND.AUDIO),
|
|
80
|
+
mediaRole: zod_1.z.literal(constants_1.AVATAR_STUDIO_MEDIA_ROLE.VOICE_SAMPLE),
|
|
81
|
+
}),
|
|
82
|
+
})
|
|
83
|
+
.strict(),
|
|
84
|
+
defaults: models_1.AvatarStudioSceneVoiceConfigSchema,
|
|
85
|
+
pricing: zod_1.z
|
|
86
|
+
.object({
|
|
87
|
+
tts: AvatarStudioGenerationPriceSchema.nullable(),
|
|
88
|
+
voiceTimings: AvatarStudioGenerationPriceSchema.nullable(),
|
|
89
|
+
})
|
|
90
|
+
.strict(),
|
|
91
|
+
});
|
|
92
|
+
const AvatarStudioFrameConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
93
|
+
fields: zod_1.z
|
|
94
|
+
.object({
|
|
95
|
+
prompt: AvatarStudioTextFieldSchema.extend({ required: zod_1.z.boolean() }),
|
|
96
|
+
style: AvatarStudioSelectFieldSchema(zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_IMAGE_STYLE)).extend({
|
|
97
|
+
required: zod_1.z.boolean(),
|
|
98
|
+
}),
|
|
99
|
+
referenceMediaIds: AvatarStudioMediaArrayFieldSchema.extend({
|
|
100
|
+
required: zod_1.z.boolean(),
|
|
101
|
+
}),
|
|
102
|
+
aspectRatio: AvatarStudioFixedFieldSchema(zod_1.z.literal('9:16')),
|
|
103
|
+
})
|
|
104
|
+
.strict(),
|
|
105
|
+
defaults: models_1.AvatarStudioSceneImageConfigSchema.extend({
|
|
106
|
+
aspectRatio: zod_1.z.literal('9:16'),
|
|
107
|
+
}),
|
|
108
|
+
pricing: zod_1.z
|
|
109
|
+
.object({
|
|
110
|
+
withoutReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
111
|
+
withReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
112
|
+
})
|
|
113
|
+
.strict(),
|
|
114
|
+
});
|
|
115
|
+
const AvatarStudioVideoConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
116
|
+
fields: zod_1.z
|
|
117
|
+
.object({
|
|
118
|
+
prompt: AvatarStudioTextFieldSchema.extend({ required: zod_1.z.boolean() }),
|
|
119
|
+
durationSeconds: AvatarStudioNumberFieldSchema.extend({
|
|
120
|
+
required: zod_1.z.boolean(),
|
|
121
|
+
}),
|
|
122
|
+
videoMode: AvatarStudioSelectFieldSchema(zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_MODE)).extend({
|
|
123
|
+
required: zod_1.z.boolean(),
|
|
124
|
+
}),
|
|
125
|
+
quality: AvatarStudioSelectFieldSchema(zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_QUALITY)).extend({
|
|
126
|
+
required: zod_1.z.boolean(),
|
|
127
|
+
}),
|
|
128
|
+
sound: AvatarStudioBooleanFieldSchema.extend({ required: zod_1.z.boolean() }),
|
|
129
|
+
aspectRatio: AvatarStudioFixedFieldSchema(zod_1.z.literal('9:16')),
|
|
130
|
+
})
|
|
131
|
+
.strict(),
|
|
132
|
+
defaults: models_1.AvatarStudioSceneVideoConfigSchema.extend({
|
|
133
|
+
aspectRatio: zod_1.z.literal('9:16'),
|
|
134
|
+
}),
|
|
135
|
+
pricing: zod_1.z
|
|
136
|
+
.object({
|
|
137
|
+
bRoll: zod_1.z
|
|
138
|
+
.object({
|
|
139
|
+
[constants_1.AVATAR_STUDIO_VIDEO_QUALITY.P720]: AvatarStudioGenerationPriceSchema.nullable(),
|
|
140
|
+
[constants_1.AVATAR_STUDIO_VIDEO_QUALITY.P1080]: AvatarStudioGenerationPriceSchema.nullable(),
|
|
141
|
+
})
|
|
142
|
+
.strict(),
|
|
143
|
+
avatar: zod_1.z
|
|
144
|
+
.object({
|
|
145
|
+
[constants_1.AVATAR_STUDIO_VIDEO_QUALITY.P720]: AvatarStudioGenerationPriceSchema.nullable(),
|
|
146
|
+
[constants_1.AVATAR_STUDIO_VIDEO_QUALITY.P1080]: AvatarStudioGenerationPriceSchema.nullable(),
|
|
147
|
+
})
|
|
148
|
+
.strict(),
|
|
149
|
+
})
|
|
150
|
+
.strict(),
|
|
151
|
+
});
|
|
152
|
+
const AvatarStudioLibraryImageConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
153
|
+
fields: zod_1.z
|
|
154
|
+
.object({
|
|
155
|
+
prompt: AvatarStudioTextFieldSchema.extend({ required: zod_1.z.boolean() }),
|
|
156
|
+
referenceMediaIds: AvatarStudioMediaArrayFieldSchema.extend({
|
|
157
|
+
required: zod_1.z.boolean(),
|
|
158
|
+
}),
|
|
159
|
+
aspectRatio: AvatarStudioSelectFieldSchema(models_1.AvatarStudioAspectRatioSchema).extend({
|
|
160
|
+
required: zod_1.z.boolean(),
|
|
161
|
+
}),
|
|
162
|
+
})
|
|
163
|
+
.strict(),
|
|
164
|
+
defaults: zod_1.z
|
|
165
|
+
.object({
|
|
166
|
+
prompt: zod_1.z.string().nullable(),
|
|
167
|
+
aspectRatio: models_1.AvatarStudioAspectRatioSchema,
|
|
168
|
+
})
|
|
169
|
+
.strict(),
|
|
170
|
+
pricing: zod_1.z
|
|
171
|
+
.object({
|
|
172
|
+
withoutReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
173
|
+
withReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
174
|
+
})
|
|
175
|
+
.strict(),
|
|
176
|
+
});
|
|
177
|
+
var GetAvatarStudioConfigQuery;
|
|
178
|
+
(function (GetAvatarStudioConfigQuery) {
|
|
179
|
+
GetAvatarStudioConfigQuery.ResponseSchema = zod_1.z.object({
|
|
180
|
+
data: zod_1.z
|
|
181
|
+
.object({
|
|
182
|
+
audio: AvatarStudioAudioConfigSectionSchema,
|
|
183
|
+
frame: AvatarStudioFrameConfigSectionSchema,
|
|
184
|
+
video: AvatarStudioVideoConfigSectionSchema,
|
|
185
|
+
libraryImage: AvatarStudioLibraryImageConfigSectionSchema,
|
|
186
|
+
})
|
|
187
|
+
.strict(),
|
|
188
|
+
});
|
|
189
|
+
})(GetAvatarStudioConfigQuery || (exports.GetAvatarStudioConfigQuery = GetAvatarStudioConfigQuery = {}));
|
|
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./avatar-studio-common.schema"), exports);
|
|
18
|
+
__exportStar(require("./get-avatar-studio-config.query"), exports);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteUpdatePostCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var DeleteUpdatePostCommand;
|
|
7
|
+
(function (DeleteUpdatePostCommand) {
|
|
8
|
+
DeleteUpdatePostCommand.RequestSchema = models_1.UpdatePostSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
slug: true,
|
|
11
|
+
})
|
|
12
|
+
.partial()
|
|
13
|
+
.strict()
|
|
14
|
+
.superRefine((value, context) => {
|
|
15
|
+
if (Boolean(value.uuid) === Boolean(value.slug)) {
|
|
16
|
+
context.addIssue({
|
|
17
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
18
|
+
message: 'Pass either uuid or slug',
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
DeleteUpdatePostCommand.ResponseSchema = zod_1.z.object({
|
|
23
|
+
isDeleted: zod_1.z.boolean(),
|
|
24
|
+
});
|
|
25
|
+
})(DeleteUpdatePostCommand || (exports.DeleteUpdatePostCommand = DeleteUpdatePostCommand = {}));
|
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./create-update-post.command"), exports);
|
|
18
18
|
__exportStar(require("./create-update-post-translation.command"), exports);
|
|
19
|
+
__exportStar(require("./delete-update-post.command"), exports);
|
|
19
20
|
__exportStar(require("./find-all-update-posts.command"), exports);
|
|
20
21
|
__exportStar(require("./find-update-post.command"), exports);
|
|
21
22
|
__exportStar(require("./get-all-update-post-translations.query"), exports);
|
|
@@ -152,8 +152,6 @@ exports.AvatarStudioScriptwriterMessageSchema = zod_1.z.object({
|
|
|
152
152
|
sceneId: zod_1.z.string().uuid().nullable(),
|
|
153
153
|
role: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_SCRIPTWRITER_ROLE),
|
|
154
154
|
content: zod_1.z.string(),
|
|
155
|
-
tokenReservationUuid: zod_1.z.string().uuid().nullable(),
|
|
156
|
-
price: zod_1.z.number().nullable(),
|
|
157
155
|
metadata: json_value_schema_1.JsonObjectSchema.nullable(),
|
|
158
156
|
createdAt: zod_1.z.date(),
|
|
159
157
|
});
|
|
@@ -2,16 +2,16 @@ import { z } from 'zod';
|
|
|
2
2
|
import { AVATAR_STUDIO_MEDIA_KIND, AVATAR_STUDIO_MEDIA_ROLE } from '../../../constants';
|
|
3
3
|
import { AvatarStudioMediaSchema } from '../../../models';
|
|
4
4
|
import {
|
|
5
|
-
AvatarStudioClipIdParamsSchema,
|
|
6
5
|
AvatarStudioPagedResponseSchema,
|
|
7
6
|
AvatarStudioPaginationQuerySchema,
|
|
8
7
|
} from '../shared/avatar-studio-common.schema';
|
|
9
8
|
|
|
10
9
|
export namespace FindAvatarStudioMediaQuery {
|
|
11
|
-
export const ParamsSchema =
|
|
10
|
+
export const ParamsSchema = z.object({}).strict();
|
|
12
11
|
export type Params = z.infer<typeof ParamsSchema>;
|
|
13
12
|
|
|
14
13
|
export const QuerySchema = AvatarStudioPaginationQuerySchema.extend({
|
|
14
|
+
clipId: z.string().uuid().optional(),
|
|
15
15
|
sceneId: z.string().uuid().optional(),
|
|
16
16
|
kind: z.nativeEnum(AVATAR_STUDIO_MEDIA_KIND).optional(),
|
|
17
17
|
role: z.nativeEnum(AVATAR_STUDIO_MEDIA_ROLE).optional(),
|
package/commands/avatar-studio/scriptwriter/calculate-avatar-studio-scriptwriter-price.command.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AvatarStudioClipIdParamsSchema } from '../shared/avatar-studio-common.schema';
|
|
3
|
+
import { CreateAvatarStudioScriptwriterMessageCommand } from './create-avatar-studio-scriptwriter-message.command';
|
|
4
|
+
|
|
5
|
+
export namespace CalculateAvatarStudioScriptwriterPriceCommand {
|
|
6
|
+
export const ParamsSchema = AvatarStudioClipIdParamsSchema;
|
|
7
|
+
export type Params = z.infer<typeof ParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const RequestSchema = CreateAvatarStudioScriptwriterMessageCommand.RequestSchema;
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: z
|
|
14
|
+
.object({
|
|
15
|
+
price: z.number().nonnegative(),
|
|
16
|
+
inputChars: z.number().int().nonnegative(),
|
|
17
|
+
})
|
|
18
|
+
.strict(),
|
|
19
|
+
});
|
|
20
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
|
+
}
|
package/commands/avatar-studio/scriptwriter/create-avatar-studio-scriptwriter-message.command.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { AvatarStudioScriptwriterMessageSchema } from '../../../models';
|
|
2
3
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from '../../../models';
|
|
4
|
+
AVATAR_STUDIO_IMAGE_STYLE,
|
|
5
|
+
AVATAR_STUDIO_VIDEO_MODE,
|
|
6
|
+
AVATAR_STUDIO_VIDEO_QUALITY,
|
|
7
|
+
} from '../../../constants';
|
|
8
8
|
import { AvatarStudioClipIdParamsSchema } from '../shared/avatar-studio-common.schema';
|
|
9
9
|
|
|
10
10
|
export namespace CreateAvatarStudioScriptwriterMessageCommand {
|
|
@@ -21,37 +21,29 @@ export namespace CreateAvatarStudioScriptwriterMessageCommand {
|
|
|
21
21
|
export type Request = z.infer<typeof RequestSchema>;
|
|
22
22
|
|
|
23
23
|
export const ResponseSchema = z.object({
|
|
24
|
-
data:
|
|
25
|
-
userMessage: AvatarStudioScriptwriterMessageSchema,
|
|
26
|
-
assistantMessage: AvatarStudioScriptwriterMessageSchema,
|
|
27
|
-
}),
|
|
24
|
+
data: AvatarStudioScriptwriterMessageSchema,
|
|
28
25
|
});
|
|
29
26
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
30
27
|
|
|
31
28
|
export const ScenePlanSchema = z
|
|
32
29
|
.object({
|
|
33
|
-
voiceConfig:
|
|
34
|
-
text:
|
|
30
|
+
voiceConfig: z.object({
|
|
31
|
+
text: z.string().trim().min(1),
|
|
35
32
|
}),
|
|
36
|
-
imageConfig:
|
|
37
|
-
prompt:
|
|
38
|
-
style:
|
|
39
|
-
}).partial({
|
|
40
|
-
style: true,
|
|
33
|
+
imageConfig: z.object({
|
|
34
|
+
prompt: z.string().trim().min(1),
|
|
35
|
+
style: z.nativeEnum(AVATAR_STUDIO_IMAGE_STYLE),
|
|
41
36
|
}),
|
|
42
|
-
videoConfig:
|
|
43
|
-
prompt:
|
|
44
|
-
durationSeconds:
|
|
45
|
-
videoMode:
|
|
46
|
-
quality:
|
|
47
|
-
sound:
|
|
48
|
-
}).partial({
|
|
49
|
-
videoMode: true,
|
|
50
|
-
quality: true,
|
|
51
|
-
sound: true,
|
|
37
|
+
videoConfig: z.object({
|
|
38
|
+
prompt: z.string().trim().min(1),
|
|
39
|
+
durationSeconds: z.number().positive(),
|
|
40
|
+
videoMode: z.nativeEnum(AVATAR_STUDIO_VIDEO_MODE),
|
|
41
|
+
quality: z.nativeEnum(AVATAR_STUDIO_VIDEO_QUALITY),
|
|
42
|
+
sound: z.boolean(),
|
|
52
43
|
}),
|
|
53
44
|
})
|
|
54
45
|
.strict();
|
|
46
|
+
|
|
55
47
|
export type ScenePlan = z.infer<typeof ScenePlanSchema>;
|
|
56
48
|
|
|
57
49
|
export const ModelOutputSchema = z
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AvatarStudioScriptwriterMessageSchema } from '../../../models';
|
|
3
|
+
import { AvatarStudioClipIdParamsSchema } from '../shared/avatar-studio-common.schema';
|
|
4
|
+
|
|
5
|
+
export namespace FindAvatarStudioScriptwriterMessagesQuery {
|
|
6
|
+
export const ParamsSchema = AvatarStudioClipIdParamsSchema;
|
|
7
|
+
export type Params = z.infer<typeof ParamsSchema>;
|
|
8
|
+
|
|
9
|
+
export const ResponseSchema = z.object({
|
|
10
|
+
data: z.array(AvatarStudioScriptwriterMessageSchema),
|
|
11
|
+
});
|
|
12
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
13
|
+
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export * from './apply-avatar-studio-scriptwriter-message.command';
|
|
2
|
+
export * from './calculate-avatar-studio-scriptwriter-price.command';
|
|
2
3
|
export * from './create-avatar-studio-scriptwriter-message.command';
|
|
4
|
+
export * from './find-avatar-studio-scriptwriter-messages.query';
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
AVATAR_STUDIO_IMAGE_STYLE,
|
|
4
|
+
AVATAR_STUDIO_MEDIA_KIND,
|
|
5
|
+
AVATAR_STUDIO_MEDIA_ROLE,
|
|
6
|
+
AVATAR_STUDIO_VIDEO_MODE,
|
|
7
|
+
AVATAR_STUDIO_VIDEO_QUALITY,
|
|
8
|
+
} from '../../../constants';
|
|
9
|
+
import {
|
|
10
|
+
AvatarStudioAspectRatioSchema,
|
|
11
|
+
AvatarStudioSceneImageConfigSchema,
|
|
12
|
+
AvatarStudioSceneVideoConfigSchema,
|
|
13
|
+
AvatarStudioSceneVoiceConfigSchema,
|
|
14
|
+
} from '../../../models';
|
|
15
|
+
|
|
16
|
+
const AvatarStudioGenerationPriceSchema = z
|
|
17
|
+
.object({
|
|
18
|
+
price: z.number().nonnegative().optional(),
|
|
19
|
+
pricePerSecond: z.number().nonnegative().optional(),
|
|
20
|
+
pricePerSymbol: z.number().nonnegative().optional(),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
|
|
24
|
+
const AvatarStudioConfigSectionBaseSchema = z
|
|
25
|
+
.object({
|
|
26
|
+
available: z.boolean(),
|
|
27
|
+
unavailableReason: z.string().optional(),
|
|
28
|
+
})
|
|
29
|
+
.strict();
|
|
30
|
+
|
|
31
|
+
const AvatarStudioTextFieldSchema = z
|
|
32
|
+
.object({
|
|
33
|
+
kind: z.literal('text'),
|
|
34
|
+
required: z.boolean(),
|
|
35
|
+
maxLength: z.number().int().positive().nullable().optional(),
|
|
36
|
+
})
|
|
37
|
+
.strict();
|
|
38
|
+
|
|
39
|
+
const AvatarStudioSelectFieldSchema = <T extends z.ZodTypeAny>(optionSchema: T) =>
|
|
40
|
+
z
|
|
41
|
+
.object({
|
|
42
|
+
kind: z.literal('select'),
|
|
43
|
+
required: z.boolean(),
|
|
44
|
+
options: z.array(optionSchema),
|
|
45
|
+
})
|
|
46
|
+
.strict();
|
|
47
|
+
|
|
48
|
+
const AvatarStudioMediaFieldSchema = z
|
|
49
|
+
.object({
|
|
50
|
+
kind: z.literal('media'),
|
|
51
|
+
required: z.boolean(),
|
|
52
|
+
mediaKind: z.nativeEnum(AVATAR_STUDIO_MEDIA_KIND),
|
|
53
|
+
mediaRole: z.nativeEnum(AVATAR_STUDIO_MEDIA_ROLE),
|
|
54
|
+
})
|
|
55
|
+
.strict();
|
|
56
|
+
|
|
57
|
+
const AvatarStudioMediaArrayFieldSchema = z
|
|
58
|
+
.object({
|
|
59
|
+
kind: z.literal('media-array'),
|
|
60
|
+
required: z.boolean(),
|
|
61
|
+
supported: z.boolean(),
|
|
62
|
+
})
|
|
63
|
+
.strict();
|
|
64
|
+
|
|
65
|
+
const AvatarStudioFixedFieldSchema = <T extends z.ZodTypeAny>(valueSchema: T) =>
|
|
66
|
+
z
|
|
67
|
+
.object({
|
|
68
|
+
kind: z.literal('fixed'),
|
|
69
|
+
value: valueSchema,
|
|
70
|
+
})
|
|
71
|
+
.strict();
|
|
72
|
+
|
|
73
|
+
const AvatarStudioNumberFieldSchema = z
|
|
74
|
+
.object({
|
|
75
|
+
kind: z.literal('number'),
|
|
76
|
+
required: z.boolean(),
|
|
77
|
+
options: z.array(z.number().positive()),
|
|
78
|
+
default: z.number().positive(),
|
|
79
|
+
})
|
|
80
|
+
.strict();
|
|
81
|
+
|
|
82
|
+
const AvatarStudioBooleanFieldSchema = z
|
|
83
|
+
.object({
|
|
84
|
+
kind: z.literal('boolean'),
|
|
85
|
+
required: z.boolean(),
|
|
86
|
+
default: z.boolean(),
|
|
87
|
+
})
|
|
88
|
+
.strict();
|
|
89
|
+
|
|
90
|
+
const AvatarStudioAudioConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
91
|
+
fields: z
|
|
92
|
+
.object({
|
|
93
|
+
text: AvatarStudioTextFieldSchema.extend({
|
|
94
|
+
required: z.boolean(),
|
|
95
|
+
maxLength: z.number().int().positive().nullable(),
|
|
96
|
+
}),
|
|
97
|
+
mediaId: AvatarStudioMediaFieldSchema.extend({
|
|
98
|
+
required: z.boolean(),
|
|
99
|
+
mediaKind: z.literal(AVATAR_STUDIO_MEDIA_KIND.AUDIO),
|
|
100
|
+
mediaRole: z.literal(AVATAR_STUDIO_MEDIA_ROLE.VOICE_SAMPLE),
|
|
101
|
+
}),
|
|
102
|
+
})
|
|
103
|
+
.strict(),
|
|
104
|
+
defaults: AvatarStudioSceneVoiceConfigSchema,
|
|
105
|
+
pricing: z
|
|
106
|
+
.object({
|
|
107
|
+
tts: AvatarStudioGenerationPriceSchema.nullable(),
|
|
108
|
+
voiceTimings: AvatarStudioGenerationPriceSchema.nullable(),
|
|
109
|
+
})
|
|
110
|
+
.strict(),
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const AvatarStudioFrameConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
114
|
+
fields: z
|
|
115
|
+
.object({
|
|
116
|
+
prompt: AvatarStudioTextFieldSchema.extend({ required: z.boolean() }),
|
|
117
|
+
style: AvatarStudioSelectFieldSchema(z.nativeEnum(AVATAR_STUDIO_IMAGE_STYLE)).extend({
|
|
118
|
+
required: z.boolean(),
|
|
119
|
+
}),
|
|
120
|
+
referenceMediaIds: AvatarStudioMediaArrayFieldSchema.extend({
|
|
121
|
+
required: z.boolean(),
|
|
122
|
+
}),
|
|
123
|
+
aspectRatio: AvatarStudioFixedFieldSchema(z.literal('9:16')),
|
|
124
|
+
})
|
|
125
|
+
.strict(),
|
|
126
|
+
defaults: AvatarStudioSceneImageConfigSchema.extend({
|
|
127
|
+
aspectRatio: z.literal('9:16'),
|
|
128
|
+
}),
|
|
129
|
+
pricing: z
|
|
130
|
+
.object({
|
|
131
|
+
withoutReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
132
|
+
withReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
133
|
+
})
|
|
134
|
+
.strict(),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const AvatarStudioVideoConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
138
|
+
fields: z
|
|
139
|
+
.object({
|
|
140
|
+
prompt: AvatarStudioTextFieldSchema.extend({ required: z.boolean() }),
|
|
141
|
+
durationSeconds: AvatarStudioNumberFieldSchema.extend({
|
|
142
|
+
required: z.boolean(),
|
|
143
|
+
}),
|
|
144
|
+
videoMode: AvatarStudioSelectFieldSchema(z.nativeEnum(AVATAR_STUDIO_VIDEO_MODE)).extend(
|
|
145
|
+
{
|
|
146
|
+
required: z.boolean(),
|
|
147
|
+
},
|
|
148
|
+
),
|
|
149
|
+
quality: AvatarStudioSelectFieldSchema(
|
|
150
|
+
z.nativeEnum(AVATAR_STUDIO_VIDEO_QUALITY),
|
|
151
|
+
).extend({
|
|
152
|
+
required: z.boolean(),
|
|
153
|
+
}),
|
|
154
|
+
sound: AvatarStudioBooleanFieldSchema.extend({ required: z.boolean() }),
|
|
155
|
+
aspectRatio: AvatarStudioFixedFieldSchema(z.literal('9:16')),
|
|
156
|
+
})
|
|
157
|
+
.strict(),
|
|
158
|
+
defaults: AvatarStudioSceneVideoConfigSchema.extend({
|
|
159
|
+
aspectRatio: z.literal('9:16'),
|
|
160
|
+
}),
|
|
161
|
+
pricing: z
|
|
162
|
+
.object({
|
|
163
|
+
bRoll: z
|
|
164
|
+
.object({
|
|
165
|
+
[AVATAR_STUDIO_VIDEO_QUALITY.P720]:
|
|
166
|
+
AvatarStudioGenerationPriceSchema.nullable(),
|
|
167
|
+
[AVATAR_STUDIO_VIDEO_QUALITY.P1080]:
|
|
168
|
+
AvatarStudioGenerationPriceSchema.nullable(),
|
|
169
|
+
})
|
|
170
|
+
.strict(),
|
|
171
|
+
avatar: z
|
|
172
|
+
.object({
|
|
173
|
+
[AVATAR_STUDIO_VIDEO_QUALITY.P720]:
|
|
174
|
+
AvatarStudioGenerationPriceSchema.nullable(),
|
|
175
|
+
[AVATAR_STUDIO_VIDEO_QUALITY.P1080]:
|
|
176
|
+
AvatarStudioGenerationPriceSchema.nullable(),
|
|
177
|
+
})
|
|
178
|
+
.strict(),
|
|
179
|
+
})
|
|
180
|
+
.strict(),
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const AvatarStudioLibraryImageConfigSectionSchema = AvatarStudioConfigSectionBaseSchema.extend({
|
|
184
|
+
fields: z
|
|
185
|
+
.object({
|
|
186
|
+
prompt: AvatarStudioTextFieldSchema.extend({ required: z.boolean() }),
|
|
187
|
+
referenceMediaIds: AvatarStudioMediaArrayFieldSchema.extend({
|
|
188
|
+
required: z.boolean(),
|
|
189
|
+
}),
|
|
190
|
+
aspectRatio: AvatarStudioSelectFieldSchema(AvatarStudioAspectRatioSchema).extend({
|
|
191
|
+
required: z.boolean(),
|
|
192
|
+
}),
|
|
193
|
+
})
|
|
194
|
+
.strict(),
|
|
195
|
+
defaults: z
|
|
196
|
+
.object({
|
|
197
|
+
prompt: z.string().nullable(),
|
|
198
|
+
aspectRatio: AvatarStudioAspectRatioSchema,
|
|
199
|
+
})
|
|
200
|
+
.strict(),
|
|
201
|
+
pricing: z
|
|
202
|
+
.object({
|
|
203
|
+
withoutReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
204
|
+
withReference: AvatarStudioGenerationPriceSchema.nullable(),
|
|
205
|
+
})
|
|
206
|
+
.strict(),
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export namespace GetAvatarStudioConfigQuery {
|
|
210
|
+
export const ResponseSchema = z.object({
|
|
211
|
+
data: z
|
|
212
|
+
.object({
|
|
213
|
+
audio: AvatarStudioAudioConfigSectionSchema,
|
|
214
|
+
frame: AvatarStudioFrameConfigSectionSchema,
|
|
215
|
+
video: AvatarStudioVideoConfigSectionSchema,
|
|
216
|
+
libraryImage: AvatarStudioLibraryImageConfigSectionSchema,
|
|
217
|
+
})
|
|
218
|
+
.strict(),
|
|
219
|
+
});
|
|
220
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
221
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { UpdatePostSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace DeleteUpdatePostCommand {
|
|
5
|
+
export const RequestSchema = UpdatePostSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
slug: true,
|
|
8
|
+
})
|
|
9
|
+
.partial()
|
|
10
|
+
.strict()
|
|
11
|
+
.superRefine((value, context) => {
|
|
12
|
+
if (Boolean(value.uuid) === Boolean(value.slug)) {
|
|
13
|
+
context.addIssue({
|
|
14
|
+
code: z.ZodIssueCode.custom,
|
|
15
|
+
message: 'Pass either uuid or slug',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type Request = { uuid: string } | { slug: string };
|
|
21
|
+
|
|
22
|
+
export const ResponseSchema = z.object({
|
|
23
|
+
isDeleted: z.boolean(),
|
|
24
|
+
});
|
|
25
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
26
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './create-update-post.command';
|
|
2
2
|
export * from './create-update-post-translation.command';
|
|
3
|
+
export * from './delete-update-post.command';
|
|
3
4
|
export * from './find-all-update-posts.command';
|
|
4
5
|
export * from './find-update-post.command';
|
|
5
6
|
export * from './get-all-update-post-translations.query';
|
|
@@ -192,8 +192,6 @@ export const AvatarStudioScriptwriterMessageSchema = z.object({
|
|
|
192
192
|
sceneId: z.string().uuid().nullable(),
|
|
193
193
|
role: z.nativeEnum(AVATAR_STUDIO_SCRIPTWRITER_ROLE),
|
|
194
194
|
content: z.string(),
|
|
195
|
-
tokenReservationUuid: z.string().uuid().nullable(),
|
|
196
|
-
price: z.number().nullable(),
|
|
197
195
|
metadata: JsonObjectSchema.nullable(),
|
|
198
196
|
createdAt: z.date(),
|
|
199
197
|
});
|