@purpleschool/gptbot 0.14.21 → 0.14.23
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/scriptwriter/calculate-avatar-studio-scriptwriter-price.command.js +8 -8
- package/build/commands/photo-studio/execute-photo-studio-action.command.js +11 -0
- package/build/commands/photo-studio/find-photo-studio-job-by-id.query.js +8 -0
- package/build/commands/photo-studio/get-photo-studio-config.query.js +1 -0
- package/build/models/avatar-studio/avatar-studio.schema.js +13 -1
- package/commands/avatar-studio/scriptwriter/calculate-avatar-studio-scriptwriter-price.command.ts +8 -8
- package/commands/photo-studio/execute-photo-studio-action.command.ts +11 -0
- package/commands/photo-studio/find-photo-studio-job-by-id.query.ts +9 -0
- package/commands/photo-studio/get-photo-studio-config.query.ts +5 -1
- package/models/avatar-studio/avatar-studio.schema.ts +14 -0
- package/package.json +1 -1
|
@@ -3,17 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CalculateAvatarStudioScriptwriterPriceCommand = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
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
6
|
var CalculateAvatarStudioScriptwriterPriceCommand;
|
|
8
7
|
(function (CalculateAvatarStudioScriptwriterPriceCommand) {
|
|
9
8
|
CalculateAvatarStudioScriptwriterPriceCommand.ParamsSchema = avatar_studio_common_schema_1.AvatarStudioClipIdParamsSchema;
|
|
10
|
-
CalculateAvatarStudioScriptwriterPriceCommand.RequestSchema =
|
|
9
|
+
CalculateAvatarStudioScriptwriterPriceCommand.RequestSchema = zod_1.z
|
|
10
|
+
.object({
|
|
11
|
+
inputLength: zod_1.z.number().int().nonnegative(),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
11
14
|
CalculateAvatarStudioScriptwriterPriceCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
inputChars: zod_1.z.number().int().nonnegative(),
|
|
16
|
-
})
|
|
17
|
-
.strict(),
|
|
15
|
+
price: zod_1.z.number(),
|
|
16
|
+
charsUntilNextPriceIncrease: zod_1.z.number().int().nonnegative().nullable(),
|
|
17
|
+
charsUntilNextPriceDecrease: zod_1.z.number().int().nonnegative().nullable(),
|
|
18
18
|
});
|
|
19
19
|
})(CalculateAvatarStudioScriptwriterPriceCommand || (exports.CalculateAvatarStudioScriptwriterPriceCommand = CalculateAvatarStudioScriptwriterPriceCommand = {}));
|
|
@@ -16,6 +16,7 @@ var ExecutePhotoStudioActionCommand;
|
|
|
16
16
|
.object({
|
|
17
17
|
enhancePrompt: zod_1.z.boolean().optional(),
|
|
18
18
|
imageUrls: zod_1.z.array(zod_1.z.string().uuid()).length(1),
|
|
19
|
+
aspectRatio: zod_1.z.string(),
|
|
19
20
|
})
|
|
20
21
|
.strict();
|
|
21
22
|
const EditParamsSchema = OneImageParamsSchema;
|
|
@@ -36,6 +37,13 @@ var ExecutePhotoStudioActionCommand;
|
|
|
36
37
|
variationsCount: zod_1.z.union([zod_1.z.literal(2), zod_1.z.literal(3), zod_1.z.literal(4)]),
|
|
37
38
|
variationStrength: zod_1.z.nativeEnum(constants_1.PHOTO_STUDIO_VARIATION_STRENGTH_ALIAS).optional(),
|
|
38
39
|
enhancePrompt: zod_1.z.boolean().optional(),
|
|
40
|
+
positions: zod_1.z.array(models_1.CanvasNodePositionSchema).min(2).max(4).optional(),
|
|
41
|
+
})
|
|
42
|
+
.strict();
|
|
43
|
+
const PhotoStudioJobParamsSchema = zod_1.z
|
|
44
|
+
.object({
|
|
45
|
+
aspectRatio: zod_1.z.string().optional(),
|
|
46
|
+
resolution: zod_1.z.string().optional(),
|
|
39
47
|
})
|
|
40
48
|
.strict();
|
|
41
49
|
const TextParamsSchema = zod_1.z
|
|
@@ -155,6 +163,9 @@ var ExecutePhotoStudioActionCommand;
|
|
|
155
163
|
]);
|
|
156
164
|
ExecutePhotoStudioActionCommand.PhotoStudioExecuteJobSchema = models_1.ToolJobSchema.extend({
|
|
157
165
|
actionType: zod_1.z.nativeEnum(constants_1.PHOTO_STUDIO_ACTION_ALIAS),
|
|
166
|
+
checkpointSequence: zod_1.z.number().int().positive(),
|
|
167
|
+
position: models_1.CanvasNodePositionSchema,
|
|
168
|
+
params: PhotoStudioJobParamsSchema,
|
|
158
169
|
});
|
|
159
170
|
ExecutePhotoStudioActionCommand.ResponseSchema = zod_1.z.object({
|
|
160
171
|
data: zod_1.z.array(ExecutePhotoStudioActionCommand.PhotoStudioExecuteJobSchema),
|
|
@@ -16,11 +16,19 @@ var FindPhotoStudioJobByIdQuery;
|
|
|
16
16
|
originalName: zod_1.z.string().nullable().optional(),
|
|
17
17
|
resolution: models_1.FileResolutionSchema.nullable().optional(),
|
|
18
18
|
});
|
|
19
|
+
FindPhotoStudioJobByIdQuery.PhotoStudioJobParamsSchema = zod_1.z
|
|
20
|
+
.object({
|
|
21
|
+
aspectRatio: zod_1.z.string().optional(),
|
|
22
|
+
resolution: zod_1.z.string().optional(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
19
25
|
FindPhotoStudioJobByIdQuery.PhotoStudioJobSchema = zod_1.z.object({
|
|
20
26
|
jobId: zod_1.z.string().uuid(),
|
|
21
27
|
actionType: zod_1.z.nativeEnum(constants_1.PHOTO_STUDIO_ACTION_ALIAS),
|
|
22
28
|
status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS),
|
|
29
|
+
checkpointSequence: zod_1.z.number().int().positive(),
|
|
23
30
|
position: models_1.CanvasNodePositionSchema,
|
|
31
|
+
params: FindPhotoStudioJobByIdQuery.PhotoStudioJobParamsSchema,
|
|
24
32
|
images: zod_1.z.array(FindPhotoStudioJobByIdQuery.PhotoStudioJobImageSchema),
|
|
25
33
|
error: zod_1.z.string().nullable(),
|
|
26
34
|
createdAt: zod_1.z.date(),
|
|
@@ -9,6 +9,7 @@ var GetPhotoStudioConfigQuery;
|
|
|
9
9
|
GetPhotoStudioConfigQuery.ConfigSchema = zod_1.z.object({
|
|
10
10
|
[constants_1.TOOL_TYPE.IMAGE_GENERATION]: models_1.ImageGenerationConfigSchema,
|
|
11
11
|
[constants_1.TOOL_TYPE.IMAGE]: models_1.ImageEditorConfigSchema,
|
|
12
|
+
actionPrices: zod_1.z.record(zod_1.z.nativeEnum(constants_1.PHOTO_STUDIO_ACTION_ALIAS), zod_1.z.number().nonnegative().nullable()),
|
|
12
13
|
});
|
|
13
14
|
GetPhotoStudioConfigQuery.ResponseSchema = zod_1.z.object({
|
|
14
15
|
data: GetPhotoStudioConfigQuery.ConfigSchema,
|
|
@@ -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.AvatarStudioVoiceSchema = exports.AvatarStudioSceneSchema = exports.AvatarStudioSceneVideoConfigSchema = exports.AvatarStudioSceneImageConfigSchema = exports.AvatarStudioSceneVoiceConfigSchema = exports.AvatarStudioSceneReferenceMediaSchema = exports.AvatarStudioMediaSchema = exports.AvatarStudioWordTimingSchema = exports.AvatarStudioSubtitleSettingsSchema = exports.AvatarStudioAspectRatioSchema = void 0;
|
|
3
|
+
exports.AvatarStudioClipSchema = exports.AvatarStudioScriptwriterMessageSchema = exports.AvatarStudioExportJobSchema = exports.AvatarStudioGenerationJobSchema = exports.AvatarStudioGenerationJobBaseSchema = exports.AvatarStudioVoiceSchema = exports.AvatarStudioSceneSchema = exports.AvatarStudioSceneGenerationJobSchema = exports.AvatarStudioSceneVideoConfigSchema = exports.AvatarStudioSceneImageConfigSchema = exports.AvatarStudioSceneVoiceConfigSchema = exports.AvatarStudioSceneReferenceMediaSchema = 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");
|
|
@@ -62,6 +62,17 @@ exports.AvatarStudioSceneVideoConfigSchema = zod_1.z.object({
|
|
|
62
62
|
quality: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_VIDEO_QUALITY).default(constants_1.AVATAR_STUDIO_VIDEO_QUALITY.P720),
|
|
63
63
|
sound: zod_1.z.boolean().default(false),
|
|
64
64
|
});
|
|
65
|
+
exports.AvatarStudioSceneGenerationJobSchema = zod_1.z.object({
|
|
66
|
+
jobId: zod_1.z.string().uuid(),
|
|
67
|
+
type: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_JOB_TYPE),
|
|
68
|
+
phase: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_JOB_PHASE).nullable(),
|
|
69
|
+
targetSlot: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_SLOT),
|
|
70
|
+
status: zod_1.z.nativeEnum(constants_1.AVATAR_STUDIO_JOB_STATUS),
|
|
71
|
+
resultMediaId: zod_1.z.string().uuid().nullable(),
|
|
72
|
+
error: zod_1.z.string().nullable(),
|
|
73
|
+
createdAt: zod_1.z.date(),
|
|
74
|
+
updatedAt: zod_1.z.date(),
|
|
75
|
+
});
|
|
65
76
|
exports.AvatarStudioSceneSchema = zod_1.z.object({
|
|
66
77
|
uuid: zod_1.z.string().uuid(),
|
|
67
78
|
clipId: zod_1.z.string().uuid(),
|
|
@@ -89,6 +100,7 @@ exports.AvatarStudioSceneSchema = zod_1.z.object({
|
|
|
89
100
|
voiceMedia: exports.AvatarStudioMediaSchema.nullable().optional(),
|
|
90
101
|
avatarVideoMedia: exports.AvatarStudioMediaSchema.nullable().optional(),
|
|
91
102
|
referenceMedia: zod_1.z.array(exports.AvatarStudioSceneReferenceMediaSchema).optional(),
|
|
103
|
+
generationJobs: zod_1.z.array(exports.AvatarStudioSceneGenerationJobSchema).optional(),
|
|
92
104
|
createdAt: zod_1.z.date(),
|
|
93
105
|
updatedAt: zod_1.z.date(),
|
|
94
106
|
});
|
package/commands/avatar-studio/scriptwriter/calculate-avatar-studio-scriptwriter-price.command.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { AvatarStudioClipIdParamsSchema } from '../shared/avatar-studio-common.schema';
|
|
3
|
-
import { CreateAvatarStudioScriptwriterMessageCommand } from './create-avatar-studio-scriptwriter-message.command';
|
|
4
3
|
|
|
5
4
|
export namespace CalculateAvatarStudioScriptwriterPriceCommand {
|
|
6
5
|
export const ParamsSchema = AvatarStudioClipIdParamsSchema;
|
|
7
6
|
export type Params = z.infer<typeof ParamsSchema>;
|
|
8
7
|
|
|
9
|
-
export const RequestSchema =
|
|
8
|
+
export const RequestSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
inputLength: z.number().int().nonnegative(),
|
|
11
|
+
})
|
|
12
|
+
.strict();
|
|
10
13
|
export type Request = z.infer<typeof RequestSchema>;
|
|
11
14
|
|
|
12
15
|
export const ResponseSchema = z.object({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
inputChars: z.number().int().nonnegative(),
|
|
17
|
-
})
|
|
18
|
-
.strict(),
|
|
16
|
+
price: z.number(),
|
|
17
|
+
charsUntilNextPriceIncrease: z.number().int().nonnegative().nullable(),
|
|
18
|
+
charsUntilNextPriceDecrease: z.number().int().nonnegative().nullable(),
|
|
19
19
|
});
|
|
20
20
|
export type Response = z.infer<typeof ResponseSchema>;
|
|
21
21
|
}
|
|
@@ -20,6 +20,7 @@ export namespace ExecutePhotoStudioActionCommand {
|
|
|
20
20
|
.object({
|
|
21
21
|
enhancePrompt: z.boolean().optional(),
|
|
22
22
|
imageUrls: z.array(z.string().uuid()).length(1),
|
|
23
|
+
aspectRatio: z.string(),
|
|
23
24
|
})
|
|
24
25
|
.strict();
|
|
25
26
|
const EditParamsSchema = OneImageParamsSchema;
|
|
@@ -40,6 +41,13 @@ export namespace ExecutePhotoStudioActionCommand {
|
|
|
40
41
|
variationsCount: z.union([z.literal(2), z.literal(3), z.literal(4)]),
|
|
41
42
|
variationStrength: z.nativeEnum(PHOTO_STUDIO_VARIATION_STRENGTH_ALIAS).optional(),
|
|
42
43
|
enhancePrompt: z.boolean().optional(),
|
|
44
|
+
positions: z.array(CanvasNodePositionSchema).min(2).max(4).optional(),
|
|
45
|
+
})
|
|
46
|
+
.strict();
|
|
47
|
+
const PhotoStudioJobParamsSchema = z
|
|
48
|
+
.object({
|
|
49
|
+
aspectRatio: z.string().optional(),
|
|
50
|
+
resolution: z.string().optional(),
|
|
43
51
|
})
|
|
44
52
|
.strict();
|
|
45
53
|
const TextParamsSchema = z
|
|
@@ -175,6 +183,9 @@ export namespace ExecutePhotoStudioActionCommand {
|
|
|
175
183
|
|
|
176
184
|
export const PhotoStudioExecuteJobSchema = ToolJobSchema.extend({
|
|
177
185
|
actionType: z.nativeEnum(PHOTO_STUDIO_ACTION_ALIAS),
|
|
186
|
+
checkpointSequence: z.number().int().positive(),
|
|
187
|
+
position: CanvasNodePositionSchema,
|
|
188
|
+
params: PhotoStudioJobParamsSchema,
|
|
178
189
|
});
|
|
179
190
|
export type PhotoStudioExecuteJob = z.infer<typeof PhotoStudioExecuteJobSchema>;
|
|
180
191
|
|
|
@@ -16,12 +16,21 @@ export namespace FindPhotoStudioJobByIdQuery {
|
|
|
16
16
|
resolution: FileResolutionSchema.nullable().optional(),
|
|
17
17
|
});
|
|
18
18
|
export type PhotoStudioJobImage = z.infer<typeof PhotoStudioJobImageSchema>;
|
|
19
|
+
export const PhotoStudioJobParamsSchema = z
|
|
20
|
+
.object({
|
|
21
|
+
aspectRatio: z.string().optional(),
|
|
22
|
+
resolution: z.string().optional(),
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
25
|
+
export type PhotoStudioJobParams = z.infer<typeof PhotoStudioJobParamsSchema>;
|
|
19
26
|
|
|
20
27
|
export const PhotoStudioJobSchema = z.object({
|
|
21
28
|
jobId: z.string().uuid(),
|
|
22
29
|
actionType: z.nativeEnum(PHOTO_STUDIO_ACTION_ALIAS),
|
|
23
30
|
status: z.nativeEnum(TOOL_JOB_STATUS),
|
|
31
|
+
checkpointSequence: z.number().int().positive(),
|
|
24
32
|
position: CanvasNodePositionSchema,
|
|
33
|
+
params: PhotoStudioJobParamsSchema,
|
|
25
34
|
images: z.array(PhotoStudioJobImageSchema),
|
|
26
35
|
error: z.string().nullable(),
|
|
27
36
|
createdAt: z.date(),
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { TOOL_TYPE } from '../../constants';
|
|
2
|
+
import { PHOTO_STUDIO_ACTION_ALIAS, TOOL_TYPE } from '../../constants';
|
|
3
3
|
import { ImageEditorConfigSchema, ImageGenerationConfigSchema } from '../../models';
|
|
4
4
|
|
|
5
5
|
export namespace GetPhotoStudioConfigQuery {
|
|
6
6
|
export const ConfigSchema = z.object({
|
|
7
7
|
[TOOL_TYPE.IMAGE_GENERATION]: ImageGenerationConfigSchema,
|
|
8
8
|
[TOOL_TYPE.IMAGE]: ImageEditorConfigSchema,
|
|
9
|
+
actionPrices: z.record(
|
|
10
|
+
z.nativeEnum(PHOTO_STUDIO_ACTION_ALIAS),
|
|
11
|
+
z.number().nonnegative().nullable(),
|
|
12
|
+
),
|
|
9
13
|
});
|
|
10
14
|
|
|
11
15
|
export type Config = z.infer<typeof ConfigSchema>;
|
|
@@ -93,6 +93,19 @@ export const AvatarStudioSceneVideoConfigSchema = z.object({
|
|
|
93
93
|
});
|
|
94
94
|
export type AvatarStudioSceneVideoConfig = z.infer<typeof AvatarStudioSceneVideoConfigSchema>;
|
|
95
95
|
|
|
96
|
+
export const AvatarStudioSceneGenerationJobSchema = z.object({
|
|
97
|
+
jobId: z.string().uuid(),
|
|
98
|
+
type: z.nativeEnum(AVATAR_STUDIO_JOB_TYPE),
|
|
99
|
+
phase: z.nativeEnum(AVATAR_STUDIO_JOB_PHASE).nullable(),
|
|
100
|
+
targetSlot: z.nativeEnum(AVATAR_STUDIO_SLOT),
|
|
101
|
+
status: z.nativeEnum(AVATAR_STUDIO_JOB_STATUS),
|
|
102
|
+
resultMediaId: z.string().uuid().nullable(),
|
|
103
|
+
error: z.string().nullable(),
|
|
104
|
+
createdAt: z.date(),
|
|
105
|
+
updatedAt: z.date(),
|
|
106
|
+
});
|
|
107
|
+
export type AvatarStudioSceneGenerationJob = z.infer<typeof AvatarStudioSceneGenerationJobSchema>;
|
|
108
|
+
|
|
96
109
|
export const AvatarStudioSceneSchema = z.object({
|
|
97
110
|
uuid: z.string().uuid(),
|
|
98
111
|
clipId: z.string().uuid(),
|
|
@@ -120,6 +133,7 @@ export const AvatarStudioSceneSchema = z.object({
|
|
|
120
133
|
voiceMedia: AvatarStudioMediaSchema.nullable().optional(),
|
|
121
134
|
avatarVideoMedia: AvatarStudioMediaSchema.nullable().optional(),
|
|
122
135
|
referenceMedia: z.array(AvatarStudioSceneReferenceMediaSchema).optional(),
|
|
136
|
+
generationJobs: z.array(AvatarStudioSceneGenerationJobSchema).optional(),
|
|
123
137
|
createdAt: z.date(),
|
|
124
138
|
updatedAt: z.date(),
|
|
125
139
|
});
|