@purpleschool/gptbot 0.14.29 → 0.14.30
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/commands/avatar-studio/export-job/start-avatar-studio-export.command.js +0 -8
- package/build/commands/avatar-studio/generation-job/generate-avatar-studio-talking-avatar.command.js +1 -6
- package/build/commands/avatar-studio/media/find-avatar-studio-media.query.js +1 -0
- package/build/commands/avatar-studio/shared/get-avatar-studio-config.query.js +1 -1
- package/build/constants/avatar-studio/enums/avatar-studio-media-kind.enum.js +1 -0
- package/build/models/avatar-studio/avatar-studio.schema.js +22 -3
- package/commands/avatar-studio/export-job/start-avatar-studio-export.command.ts +0 -10
- package/commands/avatar-studio/generation-job/generate-avatar-studio-talking-avatar.command.ts +3 -8
- package/commands/avatar-studio/media/find-avatar-studio-media.query.ts +1 -0
- package/commands/avatar-studio/shared/get-avatar-studio-config.query.ts +1 -1
- package/constants/avatar-studio/enums/avatar-studio-media-kind.enum.ts +1 -0
- package/models/avatar-studio/avatar-studio.schema.ts +29 -2
- package/package.json +2 -2
|
@@ -3,18 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StartAvatarStudioExportCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const models_1 = require("../../../models");
|
|
6
|
-
const json_value_schema_1 = require("../../../models/json-value.schema");
|
|
7
6
|
const avatar_studio_common_schema_1 = require("../shared/avatar-studio-common.schema");
|
|
8
7
|
var StartAvatarStudioExportCommand;
|
|
9
8
|
(function (StartAvatarStudioExportCommand) {
|
|
10
9
|
StartAvatarStudioExportCommand.ParamsSchema = avatar_studio_common_schema_1.AvatarStudioClipIdParamsSchema;
|
|
11
|
-
StartAvatarStudioExportCommand.RequestSchema = zod_1.z
|
|
12
|
-
.object({
|
|
13
|
-
resolution: zod_1.z.string().optional(),
|
|
14
|
-
includeSubtitles: zod_1.z.boolean().default(true).optional(),
|
|
15
|
-
metadata: json_value_schema_1.JsonObjectSchema.optional(),
|
|
16
|
-
})
|
|
17
|
-
.strict();
|
|
18
10
|
StartAvatarStudioExportCommand.ResponseSchema = zod_1.z.object({
|
|
19
11
|
data: models_1.AvatarStudioExportJobSchema,
|
|
20
12
|
});
|
package/build/commands/avatar-studio/generation-job/generate-avatar-studio-talking-avatar.command.js
CHANGED
|
@@ -7,12 +7,7 @@ const avatar_studio_common_schema_1 = require("../shared/avatar-studio-common.sc
|
|
|
7
7
|
var GenerateAvatarStudioTalkingAvatarCommand;
|
|
8
8
|
(function (GenerateAvatarStudioTalkingAvatarCommand) {
|
|
9
9
|
GenerateAvatarStudioTalkingAvatarCommand.ParamsSchema = avatar_studio_common_schema_1.AvatarStudioSceneIdParamsSchema;
|
|
10
|
-
GenerateAvatarStudioTalkingAvatarCommand.RequestSchema = avatar_studio_common_schema_1.
|
|
11
|
-
imageMediaId: zod_1.z.string().uuid().optional(),
|
|
12
|
-
audioMediaId: zod_1.z.string().uuid().optional(),
|
|
13
|
-
})
|
|
14
|
-
.strict()
|
|
15
|
-
.superRefine(models_1.validateAvatarStudioTrim);
|
|
10
|
+
GenerateAvatarStudioTalkingAvatarCommand.RequestSchema = avatar_studio_common_schema_1.AvatarStudioVideoGenerationRequestSchema;
|
|
16
11
|
GenerateAvatarStudioTalkingAvatarCommand.ResponseSchema = zod_1.z.object({
|
|
17
12
|
data: models_1.AvatarStudioGenerationJobSchema,
|
|
18
13
|
});
|
|
@@ -15,6 +15,7 @@ var FindAvatarStudioMediaQuery;
|
|
|
15
15
|
FindAvatarStudioMediaQuery.QuerySchema = avatar_studio_common_schema_1.AvatarStudioPaginationQuerySchema.extend({
|
|
16
16
|
owner: exports.AvatarStudioMediaOwnerSchema,
|
|
17
17
|
kind: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_MEDIA_KIND).optional(),
|
|
18
|
+
clipId: zod_1.z.string().uuid().optional(),
|
|
18
19
|
});
|
|
19
20
|
FindAvatarStudioMediaQuery.ResponseSchema = (0, avatar_studio_common_schema_1.AvatarStudioPagedResponseSchema)(models_1.AvatarStudioMediaSchema);
|
|
20
21
|
})(FindAvatarStudioMediaQuery || (exports.FindAvatarStudioMediaQuery = FindAvatarStudioMediaQuery = {}));
|
|
@@ -95,7 +95,7 @@ const AvatarStudioAudioConfigSectionSchema = AvatarStudioConfigSectionBaseSchema
|
|
|
95
95
|
// в voiceConfig и ставится через PATCH .../scenes/:sceneId.
|
|
96
96
|
voiceSampleMediaId: AvatarStudioMediaFieldSchema.extend({
|
|
97
97
|
required: zod_1.z.boolean(),
|
|
98
|
-
mediaKind: zod_1.z.literal(constants_1.AVATAR_STUDIO_MEDIA_KIND.
|
|
98
|
+
mediaKind: zod_1.z.literal(constants_1.AVATAR_STUDIO_MEDIA_KIND.VOICE_SAMPLE),
|
|
99
99
|
}),
|
|
100
100
|
})
|
|
101
101
|
.strict(),
|
|
@@ -6,4 +6,5 @@ var AVATAR_STUDIO_MEDIA_KIND;
|
|
|
6
6
|
AVATAR_STUDIO_MEDIA_KIND["IMAGE"] = "image";
|
|
7
7
|
AVATAR_STUDIO_MEDIA_KIND["VIDEO"] = "video";
|
|
8
8
|
AVATAR_STUDIO_MEDIA_KIND["AUDIO"] = "audio";
|
|
9
|
+
AVATAR_STUDIO_MEDIA_KIND["VOICE_SAMPLE"] = "voice_sample";
|
|
9
10
|
})(AVATAR_STUDIO_MEDIA_KIND || (exports.AVATAR_STUDIO_MEDIA_KIND = AVATAR_STUDIO_MEDIA_KIND = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AvatarStudioClipSchema = exports.AvatarStudioScriptwriterMessageSchema = exports.AvatarStudioExportJobSchema = exports.AvatarStudioGenerationJobSchema = exports.AvatarStudioGenerationJobBaseSchema = exports.AvatarStudioSceneSchema = exports.AvatarStudioSceneGenerationJobSchema = exports.AvatarStudioSceneVideoConfigSchema = exports.AvatarStudioSceneVideoConfigBaseSchema = exports.AvatarStudioSceneImageConfigSchema = exports.AvatarStudioSceneVoiceConfigSchema = exports.AvatarStudioSceneVoiceConfigBaseSchema = exports.validateAvatarStudioTrim = exports.AvatarStudioTrimConfigFields = exports.AvatarStudioMediaSchema = exports.AvatarStudioWordTimingSchema = exports.AvatarStudioSubtitleSettingsSchema = exports.AvatarStudioAspectRatioSchema = void 0;
|
|
3
|
+
exports.AvatarStudioClipSchema = exports.AvatarStudioScriptwriterMessageSchema = exports.AvatarStudioExportJobSchema = exports.AvatarStudioGenerationJobSchema = exports.AvatarStudioGenerationJobBaseSchema = exports.AvatarStudioSceneSchema = exports.AvatarStudioSceneGenerationJobSchema = exports.AvatarStudioSceneVideoConfigSchema = exports.AvatarStudioSceneVideoConfigBaseSchema = exports.AvatarStudioSceneImageConfigResponseSchema = exports.AvatarStudioSceneImageReferenceSchema = exports.AvatarStudioSceneImageConfigSchema = exports.AvatarStudioSceneVoiceConfigSchema = exports.AvatarStudioSceneVoiceConfigBaseSchema = exports.validateAvatarStudioTrim = exports.AvatarStudioTrimConfigFields = exports.AvatarStudioMediaSchema = exports.AvatarStudioWordTimingSchema = exports.AvatarStudioSubtitleSettingsSchema = exports.AvatarStudioAspectRatioSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../../constants");
|
|
6
6
|
const file_schema_1 = require("../file.schema");
|
|
@@ -79,6 +79,13 @@ exports.AvatarStudioSceneImageConfigSchema = zod_1.z.object({
|
|
|
79
79
|
style: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_IMAGE_STYLE).default(constants_1.AVATAR_STUDIO_IMAGE_STYLE.UGC),
|
|
80
80
|
references: zod_1.z.array(zod_1.z.string().uuid()).default([]),
|
|
81
81
|
});
|
|
82
|
+
exports.AvatarStudioSceneImageReferenceSchema = zod_1.z.object({
|
|
83
|
+
uuid: zod_1.z.string().uuid(),
|
|
84
|
+
url: zod_1.z.string().nullable(),
|
|
85
|
+
});
|
|
86
|
+
exports.AvatarStudioSceneImageConfigResponseSchema = exports.AvatarStudioSceneImageConfigSchema.extend({
|
|
87
|
+
references: zod_1.z.array(exports.AvatarStudioSceneImageReferenceSchema).default([]),
|
|
88
|
+
});
|
|
82
89
|
exports.AvatarStudioSceneVideoConfigBaseSchema = zod_1.z.object(Object.assign({ prompt: zod_1.z.string().nullable().default(null), durationSeconds: zod_1.z.number().positive().default(5), videoMode: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_MODE).default(constants_1.AVATAR_STUDIO_VIDEO_MODE.B_ROLL), quality: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_QUALITY).default(constants_1.AVATAR_STUDIO_VIDEO_QUALITY.P720), sound: zod_1.z.boolean().default(false) }, exports.AvatarStudioTrimConfigFields));
|
|
83
90
|
exports.AvatarStudioSceneVideoConfigSchema = exports.AvatarStudioSceneVideoConfigBaseSchema.superRefine(exports.validateAvatarStudioTrim);
|
|
84
91
|
exports.AvatarStudioSceneGenerationJobSchema = zod_1.z.object({
|
|
@@ -97,7 +104,8 @@ exports.AvatarStudioSceneSchema = zod_1.z.object({
|
|
|
97
104
|
clipId: zod_1.z.string().uuid(),
|
|
98
105
|
position: zod_1.z.number().int().min(0),
|
|
99
106
|
voiceConfig: exports.AvatarStudioSceneVoiceConfigSchema,
|
|
100
|
-
|
|
107
|
+
// Ответ отдаёт референсы с url; PATCH и генерация кадра по-прежнему принимают uuid[].
|
|
108
|
+
imageConfig: exports.AvatarStudioSceneImageConfigResponseSchema,
|
|
101
109
|
videoConfig: exports.AvatarStudioSceneVideoConfigSchema,
|
|
102
110
|
// Что лежит в слотах сцены прямо сейчас.
|
|
103
111
|
voiceMediaId: zod_1.z.string().uuid().nullable(),
|
|
@@ -106,6 +114,14 @@ exports.AvatarStudioSceneSchema = zod_1.z.object({
|
|
|
106
114
|
voiceMedia: exports.AvatarStudioMediaSchema.nullable().optional(),
|
|
107
115
|
frameMedia: exports.AvatarStudioMediaSchema.nullable().optional(),
|
|
108
116
|
videoMedia: exports.AvatarStudioMediaSchema.nullable().optional(),
|
|
117
|
+
/**
|
|
118
|
+
* Устарело ли видео сцены: менялись ли озвучка и кадр с момента последней завершённой
|
|
119
|
+
* генерации видео. Считаются на лету — сравнением слотов сцены с тем, из чего собрал
|
|
120
|
+
* видео свежайший completed-job слота video. Колонок в БД нет, дефолт — false:
|
|
121
|
+
* нет такого job'а (или он старше этой фичи) — считаем, что не менялись.
|
|
122
|
+
*/
|
|
123
|
+
voiceChangedSinceVideo: zod_1.z.boolean().default(false),
|
|
124
|
+
frameChangedSinceVideo: zod_1.z.boolean().default(false),
|
|
109
125
|
/**
|
|
110
126
|
* Ход генерации слотов. Статус слота — это статус свежайшего job'а с нужным targetSlot;
|
|
111
127
|
* сцена его не дублирует, чтобы не хранить одно и то же в двух местах.
|
|
@@ -145,9 +161,12 @@ exports.AvatarStudioExportJobSchema = zod_1.z.object({
|
|
|
145
161
|
unregisteredUserId: zod_1.z.string().uuid().nullable(),
|
|
146
162
|
clipId: zod_1.z.string().uuid(),
|
|
147
163
|
status: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_EXPORT_STATUS),
|
|
164
|
+
/** Ход сборки в процентах: экспорт долгий, одного статуса фронту мало. */
|
|
165
|
+
progress: zod_1.z.number().int().min(0).max(100),
|
|
166
|
+
/** Подпись текущего шага («Сцена 2 из 5», «Финальная сборка»). NULL — сборка ещё не началась. */
|
|
167
|
+
step: zod_1.z.string().nullable(),
|
|
148
168
|
resultMediaId: zod_1.z.string().uuid().nullable(),
|
|
149
169
|
error: zod_1.z.string().nullable(),
|
|
150
|
-
request: json_value_schema_1.JsonObjectSchema.nullable(),
|
|
151
170
|
resultMedia: exports.AvatarStudioMediaSchema.nullable().optional(),
|
|
152
171
|
startedAt: zod_1.z.date().nullable(),
|
|
153
172
|
completedAt: zod_1.z.date().nullable(),
|
|
@@ -1,21 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AvatarStudioExportJobSchema } from '../../../models';
|
|
3
|
-
import { JsonObjectSchema } from '../../../models/json-value.schema';
|
|
4
3
|
import { AvatarStudioClipIdParamsSchema } from '../shared/avatar-studio-common.schema';
|
|
5
4
|
|
|
6
5
|
export namespace StartAvatarStudioExportCommand {
|
|
7
6
|
export const ParamsSchema = AvatarStudioClipIdParamsSchema;
|
|
8
7
|
export type Params = z.infer<typeof ParamsSchema>;
|
|
9
8
|
|
|
10
|
-
export const RequestSchema = z
|
|
11
|
-
.object({
|
|
12
|
-
resolution: z.string().optional(),
|
|
13
|
-
includeSubtitles: z.boolean().default(true).optional(),
|
|
14
|
-
metadata: JsonObjectSchema.optional(),
|
|
15
|
-
})
|
|
16
|
-
.strict();
|
|
17
|
-
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
-
|
|
19
9
|
export const ResponseSchema = z.object({
|
|
20
10
|
data: AvatarStudioExportJobSchema,
|
|
21
11
|
});
|
package/commands/avatar-studio/generation-job/generate-avatar-studio-talking-avatar.command.ts
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AvatarStudioGenerationJobSchema
|
|
2
|
+
import { AvatarStudioGenerationJobSchema } from '../../../models';
|
|
3
3
|
import {
|
|
4
4
|
AvatarStudioSceneIdParamsSchema,
|
|
5
|
-
|
|
5
|
+
AvatarStudioVideoGenerationRequestSchema,
|
|
6
6
|
} from '../shared/avatar-studio-common.schema';
|
|
7
7
|
|
|
8
8
|
export namespace GenerateAvatarStudioTalkingAvatarCommand {
|
|
9
9
|
export const ParamsSchema = AvatarStudioSceneIdParamsSchema;
|
|
10
10
|
export type Params = z.infer<typeof ParamsSchema>;
|
|
11
11
|
|
|
12
|
-
export const RequestSchema =
|
|
13
|
-
imageMediaId: z.string().uuid().optional(),
|
|
14
|
-
audioMediaId: z.string().uuid().optional(),
|
|
15
|
-
})
|
|
16
|
-
.strict()
|
|
17
|
-
.superRefine(validateAvatarStudioTrim);
|
|
12
|
+
export const RequestSchema = AvatarStudioVideoGenerationRequestSchema;
|
|
18
13
|
export type Request = z.infer<typeof RequestSchema>;
|
|
19
14
|
|
|
20
15
|
export const ResponseSchema = z.object({
|
|
@@ -17,6 +17,7 @@ export namespace FindAvatarStudioMediaQuery {
|
|
|
17
17
|
export const QuerySchema = AvatarStudioPaginationQuerySchema.extend({
|
|
18
18
|
owner: AvatarStudioMediaOwnerSchema,
|
|
19
19
|
kind: z.nativeEnum(AVATAR_STUDIO_MEDIA_KIND).optional(),
|
|
20
|
+
clipId: z.string().uuid().optional(),
|
|
20
21
|
});
|
|
21
22
|
export type Query = z.infer<typeof QuerySchema>;
|
|
22
23
|
|
|
@@ -117,7 +117,7 @@ const AvatarStudioAudioConfigSectionSchema = AvatarStudioConfigSectionBaseSchema
|
|
|
117
117
|
// в voiceConfig и ставится через PATCH .../scenes/:sceneId.
|
|
118
118
|
voiceSampleMediaId: AvatarStudioMediaFieldSchema.extend({
|
|
119
119
|
required: z.boolean(),
|
|
120
|
-
mediaKind: z.literal(AVATAR_STUDIO_MEDIA_KIND.
|
|
120
|
+
mediaKind: z.literal(AVATAR_STUDIO_MEDIA_KIND.VOICE_SAMPLE),
|
|
121
121
|
}),
|
|
122
122
|
})
|
|
123
123
|
.strict(),
|
|
@@ -112,6 +112,21 @@ export const AvatarStudioSceneImageConfigSchema = z.object({
|
|
|
112
112
|
});
|
|
113
113
|
export type AvatarStudioSceneImageConfig = z.infer<typeof AvatarStudioSceneImageConfigSchema>;
|
|
114
114
|
|
|
115
|
+
export const AvatarStudioSceneImageReferenceSchema = z.object({
|
|
116
|
+
uuid: z.string().uuid(),
|
|
117
|
+
url: z.string().nullable(),
|
|
118
|
+
});
|
|
119
|
+
export type AvatarStudioSceneImageReference = z.infer<typeof AvatarStudioSceneImageReferenceSchema>;
|
|
120
|
+
|
|
121
|
+
export const AvatarStudioSceneImageConfigResponseSchema = AvatarStudioSceneImageConfigSchema.extend(
|
|
122
|
+
{
|
|
123
|
+
references: z.array(AvatarStudioSceneImageReferenceSchema).default([]),
|
|
124
|
+
},
|
|
125
|
+
);
|
|
126
|
+
export type AvatarStudioSceneImageConfigResponse = z.infer<
|
|
127
|
+
typeof AvatarStudioSceneImageConfigResponseSchema
|
|
128
|
+
>;
|
|
129
|
+
|
|
115
130
|
export const AvatarStudioSceneVideoConfigBaseSchema = z.object({
|
|
116
131
|
prompt: z.string().nullable().default(null),
|
|
117
132
|
durationSeconds: z.number().positive().default(5),
|
|
@@ -143,7 +158,8 @@ export const AvatarStudioSceneSchema = z.object({
|
|
|
143
158
|
clipId: z.string().uuid(),
|
|
144
159
|
position: z.number().int().min(0),
|
|
145
160
|
voiceConfig: AvatarStudioSceneVoiceConfigSchema,
|
|
146
|
-
|
|
161
|
+
// Ответ отдаёт референсы с url; PATCH и генерация кадра по-прежнему принимают uuid[].
|
|
162
|
+
imageConfig: AvatarStudioSceneImageConfigResponseSchema,
|
|
147
163
|
videoConfig: AvatarStudioSceneVideoConfigSchema,
|
|
148
164
|
// Что лежит в слотах сцены прямо сейчас.
|
|
149
165
|
voiceMediaId: z.string().uuid().nullable(),
|
|
@@ -152,6 +168,14 @@ export const AvatarStudioSceneSchema = z.object({
|
|
|
152
168
|
voiceMedia: AvatarStudioMediaSchema.nullable().optional(),
|
|
153
169
|
frameMedia: AvatarStudioMediaSchema.nullable().optional(),
|
|
154
170
|
videoMedia: AvatarStudioMediaSchema.nullable().optional(),
|
|
171
|
+
/**
|
|
172
|
+
* Устарело ли видео сцены: менялись ли озвучка и кадр с момента последней завершённой
|
|
173
|
+
* генерации видео. Считаются на лету — сравнением слотов сцены с тем, из чего собрал
|
|
174
|
+
* видео свежайший completed-job слота video. Колонок в БД нет, дефолт — false:
|
|
175
|
+
* нет такого job'а (или он старше этой фичи) — считаем, что не менялись.
|
|
176
|
+
*/
|
|
177
|
+
voiceChangedSinceVideo: z.boolean().default(false),
|
|
178
|
+
frameChangedSinceVideo: z.boolean().default(false),
|
|
155
179
|
/**
|
|
156
180
|
* Ход генерации слотов. Статус слота — это статус свежайшего job'а с нужным targetSlot;
|
|
157
181
|
* сцена его не дублирует, чтобы не хранить одно и то же в двух местах.
|
|
@@ -196,9 +220,12 @@ export const AvatarStudioExportJobSchema = z.object({
|
|
|
196
220
|
unregisteredUserId: z.string().uuid().nullable(),
|
|
197
221
|
clipId: z.string().uuid(),
|
|
198
222
|
status: z.nativeEnum(AVATAR_STUDIO_EXPORT_STATUS),
|
|
223
|
+
/** Ход сборки в процентах: экспорт долгий, одного статуса фронту мало. */
|
|
224
|
+
progress: z.number().int().min(0).max(100),
|
|
225
|
+
/** Подпись текущего шага («Сцена 2 из 5», «Финальная сборка»). NULL — сборка ещё не началась. */
|
|
226
|
+
step: z.string().nullable(),
|
|
199
227
|
resultMediaId: z.string().uuid().nullable(),
|
|
200
228
|
error: z.string().nullable(),
|
|
201
|
-
request: JsonObjectSchema.nullable(),
|
|
202
229
|
resultMedia: AvatarStudioMediaSchema.nullable().optional(),
|
|
203
230
|
startedAt: z.date().nullable(),
|
|
204
231
|
completedAt: z.date().nullable(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpleschool/gptbot",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.30",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"author": "",
|
|
13
13
|
"license": "ISC",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@purpleschool/rugpt-lib-common": "^0.0.
|
|
15
|
+
"@purpleschool/rugpt-lib-common": "^0.0.72-es-add-test",
|
|
16
16
|
"zod": "^3.25.67"
|
|
17
17
|
}
|
|
18
18
|
}
|