@purpleschool/gptbot 0.13.17 → 0.13.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/index.ts +1 -0
- package/api/controllers/http/photo-studio.ts +21 -0
- package/build/api/controllers/http/index.js +1 -0
- package/build/api/controllers/http/photo-studio.js +21 -0
- package/build/commands/index.js +1 -0
- package/build/commands/photo-studio/add-photo-studio-checkpoint.command.js +17 -0
- package/build/commands/photo-studio/clear-photo-studio-checkpoints.command.js +12 -0
- package/build/commands/photo-studio/create-photo-studio-canvas.command.js +15 -0
- package/build/commands/photo-studio/delete-photo-studio-canvas.command.js +11 -0
- package/build/commands/photo-studio/delete-photo-studio-checkpoint.command.js +14 -0
- package/build/commands/photo-studio/execute-photo-studio-action.command.js +47 -0
- package/build/commands/photo-studio/find-photo-studio-canvas-by-uuid.query.js +12 -0
- package/build/commands/photo-studio/find-photo-studio-canvases.query.js +18 -0
- package/build/commands/photo-studio/find-photo-studio-checkpoints.query.js +12 -0
- package/build/commands/photo-studio/find-photo-studio-job-by-id.query.js +32 -0
- package/build/commands/photo-studio/find-photo-studio-jobs.query.js +18 -0
- package/build/commands/photo-studio/get-photo-studio-actions.query.js +11 -0
- package/build/commands/photo-studio/index.js +31 -0
- package/build/commands/photo-studio/save-photo-studio-canvas.command.js +18 -0
- package/build/commands/photo-studio/update-photo-studio-canvas.command.js +15 -0
- package/build/commands/photo-studio/update-photo-studio-checkpoint.command.js +19 -0
- package/build/constants/index.js +1 -0
- package/build/constants/photo-studio/enums/index.js +17 -0
- package/build/constants/photo-studio/enums/photo-studio-checkpoint-action-type.enum.js +11 -0
- package/build/constants/photo-studio/index.js +17 -0
- package/build/models/file.schema.js +7 -1
- package/build/models/index.js +1 -0
- package/build/models/photo-studio/index.js +20 -0
- package/build/models/photo-studio/photo-studio-action.schema.js +17 -0
- package/build/models/photo-studio/photo-studio-checkpoint.schema.js +21 -0
- package/build/models/photo-studio/photo-studio-image-node.schema.js +19 -0
- package/build/models/photo-studio/photo-studio.schema.js +15 -0
- package/build/models/tools/image-generation/image-generation-job.schema.js +3 -0
- package/commands/index.ts +1 -0
- package/commands/photo-studio/add-photo-studio-checkpoint.command.ts +23 -0
- package/commands/photo-studio/clear-photo-studio-checkpoints.command.ts +12 -0
- package/commands/photo-studio/create-photo-studio-canvas.command.ts +16 -0
- package/commands/photo-studio/delete-photo-studio-canvas.command.ts +11 -0
- package/commands/photo-studio/delete-photo-studio-checkpoint.command.ts +14 -0
- package/commands/photo-studio/execute-photo-studio-action.command.ts +49 -0
- package/commands/photo-studio/find-photo-studio-canvas-by-uuid.query.ts +12 -0
- package/commands/photo-studio/find-photo-studio-canvases.query.ts +20 -0
- package/commands/photo-studio/find-photo-studio-checkpoints.query.ts +12 -0
- package/commands/photo-studio/find-photo-studio-job-by-id.query.ts +36 -0
- package/commands/photo-studio/find-photo-studio-jobs.query.ts +20 -0
- package/commands/photo-studio/get-photo-studio-actions.query.ts +10 -0
- package/commands/photo-studio/index.ts +15 -0
- package/commands/photo-studio/save-photo-studio-canvas.command.ts +24 -0
- package/commands/photo-studio/update-photo-studio-canvas.command.ts +17 -0
- package/commands/photo-studio/update-photo-studio-checkpoint.command.ts +25 -0
- package/constants/index.ts +1 -0
- package/constants/photo-studio/enums/index.ts +1 -0
- package/constants/photo-studio/enums/photo-studio-checkpoint-action-type.enum.ts +7 -0
- package/constants/photo-studio/index.ts +1 -0
- package/models/file.schema.ts +8 -0
- package/models/index.ts +1 -0
- package/models/photo-studio/index.ts +4 -0
- package/models/photo-studio/photo-studio-action.schema.ts +18 -0
- package/models/photo-studio/photo-studio-checkpoint.schema.ts +22 -0
- package/models/photo-studio/photo-studio-image-node.schema.ts +22 -0
- package/models/photo-studio/photo-studio.schema.ts +16 -0
- package/models/tools/image-generation/image-generation-job.schema.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export const PHOTO_STUDIO_PRIVATE_CONTROLLER = 'private/photo-studio' as const;
|
|
2
|
+
|
|
3
|
+
export const PHOTO_STUDIO_ROUTES = {
|
|
4
|
+
ACTIONS: 'actions',
|
|
5
|
+
EXECUTE: (canvasId: string) => `canvases/${canvasId}/execute`,
|
|
6
|
+
CREATE_CANVAS: 'canvases',
|
|
7
|
+
GET_CANVASES: 'canvases',
|
|
8
|
+
GET_CANVAS: (uuid: string) => `canvases/${uuid}`,
|
|
9
|
+
GET_JOBS: (canvasId: string) => `canvases/${canvasId}/jobs`,
|
|
10
|
+
GET_JOB: (canvasId: string, jobId: string) => `canvases/${canvasId}/jobs/${jobId}`,
|
|
11
|
+
SAVE_CANVAS: (uuid: string) => `canvases/${uuid}/save`,
|
|
12
|
+
UPDATE_CANVAS: (uuid: string) => `canvases/${uuid}`,
|
|
13
|
+
DELETE_CANVAS: (uuid: string) => `canvases/${uuid}`,
|
|
14
|
+
GET_CHECKPOINTS: (canvasId: string) => `canvases/${canvasId}/checkpoints`,
|
|
15
|
+
ADD_CHECKPOINT: (canvasId: string) => `canvases/${canvasId}/checkpoints`,
|
|
16
|
+
UPDATE_CHECKPOINT: (canvasId: string, checkpointId: string) =>
|
|
17
|
+
`canvases/${canvasId}/checkpoints/${checkpointId}`,
|
|
18
|
+
DELETE_CHECKPOINT: (canvasId: string, checkpointId: string) =>
|
|
19
|
+
`canvases/${canvasId}/checkpoints/${checkpointId}`,
|
|
20
|
+
CLEAR_CHECKPOINTS: (canvasId: string) => `canvases/${canvasId}/checkpoints`,
|
|
21
|
+
} as const;
|
|
@@ -92,4 +92,5 @@ __exportStar(require("./tool-workspace"), exports);
|
|
|
92
92
|
__exportStar(require("./html-page-builder"), exports);
|
|
93
93
|
__exportStar(require("./palette"), exports);
|
|
94
94
|
__exportStar(require("./canvas-var-generation"), exports);
|
|
95
|
+
__exportStar(require("./photo-studio"), exports);
|
|
95
96
|
__exportStar(require("./canvas-template"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PHOTO_STUDIO_ROUTES = exports.PHOTO_STUDIO_PRIVATE_CONTROLLER = void 0;
|
|
4
|
+
exports.PHOTO_STUDIO_PRIVATE_CONTROLLER = 'private/photo-studio';
|
|
5
|
+
exports.PHOTO_STUDIO_ROUTES = {
|
|
6
|
+
ACTIONS: 'actions',
|
|
7
|
+
EXECUTE: (canvasId) => `canvases/${canvasId}/execute`,
|
|
8
|
+
CREATE_CANVAS: 'canvases',
|
|
9
|
+
GET_CANVASES: 'canvases',
|
|
10
|
+
GET_CANVAS: (uuid) => `canvases/${uuid}`,
|
|
11
|
+
GET_JOBS: (canvasId) => `canvases/${canvasId}/jobs`,
|
|
12
|
+
GET_JOB: (canvasId, jobId) => `canvases/${canvasId}/jobs/${jobId}`,
|
|
13
|
+
SAVE_CANVAS: (uuid) => `canvases/${uuid}/save`,
|
|
14
|
+
UPDATE_CANVAS: (uuid) => `canvases/${uuid}`,
|
|
15
|
+
DELETE_CANVAS: (uuid) => `canvases/${uuid}`,
|
|
16
|
+
GET_CHECKPOINTS: (canvasId) => `canvases/${canvasId}/checkpoints`,
|
|
17
|
+
ADD_CHECKPOINT: (canvasId) => `canvases/${canvasId}/checkpoints`,
|
|
18
|
+
UPDATE_CHECKPOINT: (canvasId, checkpointId) => `canvases/${canvasId}/checkpoints/${checkpointId}`,
|
|
19
|
+
DELETE_CHECKPOINT: (canvasId, checkpointId) => `canvases/${canvasId}/checkpoints/${checkpointId}`,
|
|
20
|
+
CLEAR_CHECKPOINTS: (canvasId) => `canvases/${canvasId}/checkpoints`,
|
|
21
|
+
};
|
package/build/commands/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __exportStar(require("./midjourney"), exports);
|
|
|
37
37
|
__exportStar(require("./page"), exports);
|
|
38
38
|
__exportStar(require("./order"), exports);
|
|
39
39
|
__exportStar(require("./payment"), exports);
|
|
40
|
+
__exportStar(require("./photo-studio"), exports);
|
|
40
41
|
__exportStar(require("./product"), exports);
|
|
41
42
|
__exportStar(require("./question"), exports);
|
|
42
43
|
__exportStar(require("./referral"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddPhotoStudioCheckpointCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var AddPhotoStudioCheckpointCommand;
|
|
7
|
+
(function (AddPhotoStudioCheckpointCommand) {
|
|
8
|
+
AddPhotoStudioCheckpointCommand.RequestParamSchema = zod_1.z.object({ canvasId: zod_1.z.string().uuid() });
|
|
9
|
+
AddPhotoStudioCheckpointCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
action: models_1.PhotoStudioCheckpointActionSchema,
|
|
11
|
+
images: zod_1.z.array(models_1.PhotoStudioImageInputSchema).optional(),
|
|
12
|
+
baseCheckpointSequence: zod_1.z.number().int().positive().optional(),
|
|
13
|
+
});
|
|
14
|
+
AddPhotoStudioCheckpointCommand.ResponseSchema = zod_1.z.object({
|
|
15
|
+
data: models_1.PhotoStudioCheckpointSchema,
|
|
16
|
+
});
|
|
17
|
+
})(AddPhotoStudioCheckpointCommand || (exports.AddPhotoStudioCheckpointCommand = AddPhotoStudioCheckpointCommand = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClearPhotoStudioCheckpointsCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var ClearPhotoStudioCheckpointsCommand;
|
|
7
|
+
(function (ClearPhotoStudioCheckpointsCommand) {
|
|
8
|
+
ClearPhotoStudioCheckpointsCommand.RequestParamSchema = zod_1.z.object({ canvasId: zod_1.z.string().uuid() });
|
|
9
|
+
ClearPhotoStudioCheckpointsCommand.ResponseSchema = zod_1.z.object({
|
|
10
|
+
data: zod_1.z.array(models_1.PhotoStudioCheckpointSchema),
|
|
11
|
+
});
|
|
12
|
+
})(ClearPhotoStudioCheckpointsCommand || (exports.ClearPhotoStudioCheckpointsCommand = ClearPhotoStudioCheckpointsCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreatePhotoStudioCanvasCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var CreatePhotoStudioCanvasCommand;
|
|
7
|
+
(function (CreatePhotoStudioCanvasCommand) {
|
|
8
|
+
CreatePhotoStudioCanvasCommand.RequestSchema = zod_1.z.object({
|
|
9
|
+
name: zod_1.z.string().trim().min(1).optional(),
|
|
10
|
+
images: zod_1.z.array(models_1.PhotoStudioImageInputSchema).default([]).optional(),
|
|
11
|
+
});
|
|
12
|
+
CreatePhotoStudioCanvasCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: models_1.PhotoStudioCanvasWithImagesSchema,
|
|
14
|
+
});
|
|
15
|
+
})(CreatePhotoStudioCanvasCommand || (exports.CreatePhotoStudioCanvasCommand = CreatePhotoStudioCanvasCommand = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeletePhotoStudioCanvasCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeletePhotoStudioCanvasCommand;
|
|
6
|
+
(function (DeletePhotoStudioCanvasCommand) {
|
|
7
|
+
DeletePhotoStudioCanvasCommand.RequestParamSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid() });
|
|
8
|
+
DeletePhotoStudioCanvasCommand.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.object({ isDeleted: zod_1.z.boolean() }),
|
|
10
|
+
});
|
|
11
|
+
})(DeletePhotoStudioCanvasCommand || (exports.DeletePhotoStudioCanvasCommand = DeletePhotoStudioCanvasCommand = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeletePhotoStudioCheckpointCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
var DeletePhotoStudioCheckpointCommand;
|
|
6
|
+
(function (DeletePhotoStudioCheckpointCommand) {
|
|
7
|
+
DeletePhotoStudioCheckpointCommand.RequestParamSchema = zod_1.z.object({
|
|
8
|
+
canvasId: zod_1.z.string().uuid(),
|
|
9
|
+
checkpointId: zod_1.z.string().uuid(),
|
|
10
|
+
});
|
|
11
|
+
DeletePhotoStudioCheckpointCommand.ResponseSchema = zod_1.z.object({
|
|
12
|
+
data: zod_1.z.object({ isDeleted: zod_1.z.boolean() }),
|
|
13
|
+
});
|
|
14
|
+
})(DeletePhotoStudioCheckpointCommand || (exports.DeletePhotoStudioCheckpointCommand = DeletePhotoStudioCheckpointCommand = {}));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutePhotoStudioActionCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const image_generation_resolution_enum_1 = require("../../constants/tool-image-generation/enums/image-generation-resolution.enum");
|
|
7
|
+
const models_1 = require("../../models");
|
|
8
|
+
var ExecutePhotoStudioActionCommand;
|
|
9
|
+
(function (ExecutePhotoStudioActionCommand) {
|
|
10
|
+
ExecutePhotoStudioActionCommand.RequestSchema = zod_1.z.object({
|
|
11
|
+
actionAlias: zod_1.z.string().min(1),
|
|
12
|
+
modelId: zod_1.z.string().uuid(),
|
|
13
|
+
prompt: zod_1.z.string().optional(),
|
|
14
|
+
params: zod_1.z
|
|
15
|
+
.object({
|
|
16
|
+
imageUrls: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
17
|
+
enhancePrompt: zod_1.z.boolean().optional(),
|
|
18
|
+
resolution: zod_1.z.nativeEnum(image_generation_resolution_enum_1.IMAGE_GENERATION_RESOLUTION).optional(),
|
|
19
|
+
aspectRatio: zod_1.z.string().optional(),
|
|
20
|
+
effect: zod_1.z.string().optional(),
|
|
21
|
+
size: zod_1.z.enum(['2x', '4x', '8x']).optional(),
|
|
22
|
+
variationsCount: zod_1.z.union([zod_1.z.literal(2), zod_1.z.literal(3), zod_1.z.literal(4)]).optional(),
|
|
23
|
+
variationStrength: zod_1.z.enum(['light', 'medium', 'high']).optional(),
|
|
24
|
+
fontStyle: zod_1.z
|
|
25
|
+
.enum([
|
|
26
|
+
'calligraphy',
|
|
27
|
+
'handwritten',
|
|
28
|
+
'elegant',
|
|
29
|
+
'decorative',
|
|
30
|
+
'poster',
|
|
31
|
+
'engraving',
|
|
32
|
+
])
|
|
33
|
+
.optional(),
|
|
34
|
+
placement: zod_1.z.enum(['top', 'center', 'bottom']).optional(),
|
|
35
|
+
color: zod_1.z.string().optional(),
|
|
36
|
+
})
|
|
37
|
+
.default({}),
|
|
38
|
+
position: models_1.CanvasNodePositionSchema,
|
|
39
|
+
baseCheckpointSequence: zod_1.z.number().int().positive().optional(),
|
|
40
|
+
});
|
|
41
|
+
ExecutePhotoStudioActionCommand.PhotoStudioExecuteJobSchema = models_1.ToolJobSchema.extend({
|
|
42
|
+
toolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE),
|
|
43
|
+
});
|
|
44
|
+
ExecutePhotoStudioActionCommand.ResponseSchema = zod_1.z.object({
|
|
45
|
+
data: zod_1.z.array(ExecutePhotoStudioActionCommand.PhotoStudioExecuteJobSchema),
|
|
46
|
+
});
|
|
47
|
+
})(ExecutePhotoStudioActionCommand || (exports.ExecutePhotoStudioActionCommand = ExecutePhotoStudioActionCommand = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPhotoStudioCanvasByUuidQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindPhotoStudioCanvasByUuidQuery;
|
|
7
|
+
(function (FindPhotoStudioCanvasByUuidQuery) {
|
|
8
|
+
FindPhotoStudioCanvasByUuidQuery.RequestParamSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid() });
|
|
9
|
+
FindPhotoStudioCanvasByUuidQuery.ResponseSchema = zod_1.z.object({
|
|
10
|
+
data: models_1.PhotoStudioCanvasWithImagesSchema,
|
|
11
|
+
});
|
|
12
|
+
})(FindPhotoStudioCanvasByUuidQuery || (exports.FindPhotoStudioCanvasByUuidQuery = FindPhotoStudioCanvasByUuidQuery = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPhotoStudioCanvasesQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindPhotoStudioCanvasesQuery;
|
|
7
|
+
(function (FindPhotoStudioCanvasesQuery) {
|
|
8
|
+
FindPhotoStudioCanvasesQuery.RequestSchema = zod_1.z.object({
|
|
9
|
+
limit: zod_1.z.coerce.number().int().min(1).default(20).optional(),
|
|
10
|
+
offset: zod_1.z.coerce.number().int().min(0).default(0).optional(),
|
|
11
|
+
name: zod_1.z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
FindPhotoStudioCanvasesQuery.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: zod_1.z.array(models_1.PhotoStudioCanvasSchema.extend({ countOfImages: zod_1.z.number() })),
|
|
15
|
+
page: zod_1.z.number(),
|
|
16
|
+
totalPages: zod_1.z.number(),
|
|
17
|
+
});
|
|
18
|
+
})(FindPhotoStudioCanvasesQuery || (exports.FindPhotoStudioCanvasesQuery = FindPhotoStudioCanvasesQuery = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPhotoStudioCheckpointsQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var FindPhotoStudioCheckpointsQuery;
|
|
7
|
+
(function (FindPhotoStudioCheckpointsQuery) {
|
|
8
|
+
FindPhotoStudioCheckpointsQuery.RequestParamSchema = zod_1.z.object({ canvasId: zod_1.z.string().uuid() });
|
|
9
|
+
FindPhotoStudioCheckpointsQuery.ResponseSchema = zod_1.z.object({
|
|
10
|
+
data: zod_1.z.array(models_1.PhotoStudioCheckpointSchema),
|
|
11
|
+
});
|
|
12
|
+
})(FindPhotoStudioCheckpointsQuery || (exports.FindPhotoStudioCheckpointsQuery = FindPhotoStudioCheckpointsQuery = {}));
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPhotoStudioJobByIdQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
var FindPhotoStudioJobByIdQuery;
|
|
8
|
+
(function (FindPhotoStudioJobByIdQuery) {
|
|
9
|
+
FindPhotoStudioJobByIdQuery.RequestParamSchema = zod_1.z.object({
|
|
10
|
+
canvasId: zod_1.z.string().uuid(),
|
|
11
|
+
jobId: zod_1.z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
FindPhotoStudioJobByIdQuery.PhotoStudioJobImageSchema = zod_1.z.object({
|
|
14
|
+
fileId: zod_1.z.string().uuid(),
|
|
15
|
+
url: zod_1.z.string(),
|
|
16
|
+
originalName: zod_1.z.string().nullable().optional(),
|
|
17
|
+
resolution: models_1.FileResolutionSchema.nullable().optional(),
|
|
18
|
+
});
|
|
19
|
+
FindPhotoStudioJobByIdQuery.PhotoStudioJobSchema = zod_1.z.object({
|
|
20
|
+
jobId: zod_1.z.string().uuid(),
|
|
21
|
+
toolType: zod_1.z.nativeEnum(constants_1.TOOL_CONTENT_TYPE),
|
|
22
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS),
|
|
23
|
+
position: models_1.CanvasNodePositionSchema,
|
|
24
|
+
images: zod_1.z.array(FindPhotoStudioJobByIdQuery.PhotoStudioJobImageSchema),
|
|
25
|
+
error: zod_1.z.string().nullable(),
|
|
26
|
+
createdAt: zod_1.z.date(),
|
|
27
|
+
updatedAt: zod_1.z.date(),
|
|
28
|
+
});
|
|
29
|
+
FindPhotoStudioJobByIdQuery.ResponseSchema = zod_1.z.object({
|
|
30
|
+
data: FindPhotoStudioJobByIdQuery.PhotoStudioJobSchema,
|
|
31
|
+
});
|
|
32
|
+
})(FindPhotoStudioJobByIdQuery || (exports.FindPhotoStudioJobByIdQuery = FindPhotoStudioJobByIdQuery = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindPhotoStudioJobsQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const find_photo_studio_job_by_id_query_1 = require("./find-photo-studio-job-by-id.query");
|
|
7
|
+
var FindPhotoStudioJobsQuery;
|
|
8
|
+
(function (FindPhotoStudioJobsQuery) {
|
|
9
|
+
FindPhotoStudioJobsQuery.RequestParamSchema = zod_1.z.object({
|
|
10
|
+
canvasId: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
FindPhotoStudioJobsQuery.RequestQuerySchema = zod_1.z.object({
|
|
13
|
+
status: zod_1.z.nativeEnum(constants_1.TOOL_JOB_STATUS).optional(),
|
|
14
|
+
});
|
|
15
|
+
FindPhotoStudioJobsQuery.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: zod_1.z.array(find_photo_studio_job_by_id_query_1.FindPhotoStudioJobByIdQuery.PhotoStudioJobSchema),
|
|
17
|
+
});
|
|
18
|
+
})(FindPhotoStudioJobsQuery || (exports.FindPhotoStudioJobsQuery = FindPhotoStudioJobsQuery = {}));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPhotoStudioActionsQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var GetPhotoStudioActionsQuery;
|
|
7
|
+
(function (GetPhotoStudioActionsQuery) {
|
|
8
|
+
GetPhotoStudioActionsQuery.ResponseSchema = zod_1.z.object({
|
|
9
|
+
data: zod_1.z.array(models_1.PhotoStudioActionSchema),
|
|
10
|
+
});
|
|
11
|
+
})(GetPhotoStudioActionsQuery || (exports.GetPhotoStudioActionsQuery = GetPhotoStudioActionsQuery = {}));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./add-photo-studio-checkpoint.command"), exports);
|
|
18
|
+
__exportStar(require("./clear-photo-studio-checkpoints.command"), exports);
|
|
19
|
+
__exportStar(require("./create-photo-studio-canvas.command"), exports);
|
|
20
|
+
__exportStar(require("./delete-photo-studio-canvas.command"), exports);
|
|
21
|
+
__exportStar(require("./delete-photo-studio-checkpoint.command"), exports);
|
|
22
|
+
__exportStar(require("./execute-photo-studio-action.command"), exports);
|
|
23
|
+
__exportStar(require("./find-photo-studio-canvas-by-uuid.query"), exports);
|
|
24
|
+
__exportStar(require("./find-photo-studio-canvases.query"), exports);
|
|
25
|
+
__exportStar(require("./find-photo-studio-checkpoints.query"), exports);
|
|
26
|
+
__exportStar(require("./find-photo-studio-job-by-id.query"), exports);
|
|
27
|
+
__exportStar(require("./find-photo-studio-jobs.query"), exports);
|
|
28
|
+
__exportStar(require("./get-photo-studio-actions.query"), exports);
|
|
29
|
+
__exportStar(require("./save-photo-studio-canvas.command"), exports);
|
|
30
|
+
__exportStar(require("./update-photo-studio-canvas.command"), exports);
|
|
31
|
+
__exportStar(require("./update-photo-studio-checkpoint.command"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SavePhotoStudioCanvasCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var SavePhotoStudioCanvasCommand;
|
|
7
|
+
(function (SavePhotoStudioCanvasCommand) {
|
|
8
|
+
SavePhotoStudioCanvasCommand.RequestParamSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid() });
|
|
9
|
+
SavePhotoStudioCanvasCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
updatedAt: zod_1.z.coerce.date().optional(),
|
|
11
|
+
images: zod_1.z.array(models_1.PhotoStudioImageInputSchema),
|
|
12
|
+
action: models_1.PhotoStudioCheckpointActionSchema.optional(),
|
|
13
|
+
baseCheckpointSequence: zod_1.z.number().int().positive().optional(),
|
|
14
|
+
});
|
|
15
|
+
SavePhotoStudioCanvasCommand.ResponseSchema = zod_1.z.object({
|
|
16
|
+
data: models_1.PhotoStudioCanvasWithImagesSchema,
|
|
17
|
+
});
|
|
18
|
+
})(SavePhotoStudioCanvasCommand || (exports.SavePhotoStudioCanvasCommand = SavePhotoStudioCanvasCommand = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePhotoStudioCanvasCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpdatePhotoStudioCanvasCommand;
|
|
7
|
+
(function (UpdatePhotoStudioCanvasCommand) {
|
|
8
|
+
UpdatePhotoStudioCanvasCommand.RequestParamSchema = zod_1.z.object({ uuid: zod_1.z.string().uuid() });
|
|
9
|
+
UpdatePhotoStudioCanvasCommand.RequestSchema = zod_1.z.object({
|
|
10
|
+
name: zod_1.z.string().trim().min(1),
|
|
11
|
+
});
|
|
12
|
+
UpdatePhotoStudioCanvasCommand.ResponseSchema = zod_1.z.object({
|
|
13
|
+
data: models_1.PhotoStudioCanvasWithImagesSchema,
|
|
14
|
+
});
|
|
15
|
+
})(UpdatePhotoStudioCanvasCommand || (exports.UpdatePhotoStudioCanvasCommand = UpdatePhotoStudioCanvasCommand = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdatePhotoStudioCheckpointCommand = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../models");
|
|
6
|
+
var UpdatePhotoStudioCheckpointCommand;
|
|
7
|
+
(function (UpdatePhotoStudioCheckpointCommand) {
|
|
8
|
+
UpdatePhotoStudioCheckpointCommand.RequestParamSchema = zod_1.z.object({
|
|
9
|
+
canvasId: zod_1.z.string().uuid(),
|
|
10
|
+
checkpointId: zod_1.z.string().uuid(),
|
|
11
|
+
});
|
|
12
|
+
UpdatePhotoStudioCheckpointCommand.RequestSchema = zod_1.z.object({
|
|
13
|
+
action: models_1.PhotoStudioCheckpointActionSchema.optional(),
|
|
14
|
+
images: zod_1.z.array(models_1.PhotoStudioImageInputSchema).optional(),
|
|
15
|
+
});
|
|
16
|
+
UpdatePhotoStudioCheckpointCommand.ResponseSchema = zod_1.z.object({
|
|
17
|
+
data: models_1.PhotoStudioCheckpointSchema,
|
|
18
|
+
});
|
|
19
|
+
})(UpdatePhotoStudioCheckpointCommand || (exports.UpdatePhotoStudioCheckpointCommand = UpdatePhotoStudioCheckpointCommand = {}));
|
package/build/constants/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./order"), exports);
|
|
|
34
34
|
__exportStar(require("./page"), exports);
|
|
35
35
|
__exportStar(require("./payment"), exports);
|
|
36
36
|
__exportStar(require("./presentation"), exports);
|
|
37
|
+
__exportStar(require("./photo-studio"), exports);
|
|
37
38
|
__exportStar(require("./product"), exports);
|
|
38
39
|
__exportStar(require("./referral"), exports);
|
|
39
40
|
__exportStar(require("./roles"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./photo-studio-checkpoint-action-type.enum"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE = void 0;
|
|
4
|
+
var PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE;
|
|
5
|
+
(function (PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE) {
|
|
6
|
+
PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE["ACTION"] = "action";
|
|
7
|
+
PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE["IMAGE_GENERATED"] = "image_generated";
|
|
8
|
+
PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE["IMAGE_ADDED"] = "image_added";
|
|
9
|
+
PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE["IMAGE_DELETED"] = "image_deleted";
|
|
10
|
+
PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE["CANVAS_SAVED"] = "canvas_saved";
|
|
11
|
+
})(PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE || (exports.PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE = PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./enums"), exports);
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FileSchema = void 0;
|
|
3
|
+
exports.FileSchema = exports.FileResolutionSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
+
exports.FileResolutionSchema = zod_1.z.object({
|
|
7
|
+
width: zod_1.z.number().int().positive(),
|
|
8
|
+
height: zod_1.z.number().int().positive(),
|
|
9
|
+
});
|
|
6
10
|
exports.FileSchema = zod_1.z.object({
|
|
7
11
|
uuid: zod_1.z.string().uuid(),
|
|
8
12
|
name: zod_1.z.string(),
|
|
9
13
|
size: zod_1.z.number(),
|
|
14
|
+
originalName: zod_1.z.string().nullable().optional(),
|
|
15
|
+
resolution: exports.FileResolutionSchema.nullable().optional(),
|
|
10
16
|
mimeType: zod_1.z.string(),
|
|
11
17
|
url: zod_1.z.string(),
|
|
12
18
|
key: zod_1.z.string(),
|
package/build/models/index.js
CHANGED
|
@@ -38,6 +38,7 @@ __exportStar(require("./file.schema"), exports);
|
|
|
38
38
|
__exportStar(require("./key-value.schema"), exports);
|
|
39
39
|
__exportStar(require("./form-submission.schema"), exports);
|
|
40
40
|
__exportStar(require("./icon-variants.schema"), exports);
|
|
41
|
+
__exportStar(require("./photo-studio"), exports);
|
|
41
42
|
__exportStar(require("./lesson.schema"), exports);
|
|
42
43
|
__exportStar(require("./lesson-translation.schema"), exports);
|
|
43
44
|
__exportStar(require("./message.schema"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./photo-studio-action.schema"), exports);
|
|
18
|
+
__exportStar(require("./photo-studio-checkpoint.schema"), exports);
|
|
19
|
+
__exportStar(require("./photo-studio-image-node.schema"), exports);
|
|
20
|
+
__exportStar(require("./photo-studio.schema"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhotoStudioActionSchema = exports.PhotoStudioImageSettingsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.PhotoStudioImageSettingsSchema = zod_1.z.object({
|
|
6
|
+
minImages: zod_1.z.number().int().min(0),
|
|
7
|
+
maxImages: zod_1.z.number().int().min(1),
|
|
8
|
+
});
|
|
9
|
+
exports.PhotoStudioActionSchema = zod_1.z.object({
|
|
10
|
+
alias: zod_1.z.string().min(1),
|
|
11
|
+
title: zod_1.z.string().min(1),
|
|
12
|
+
icon: zod_1.z.string().min(1),
|
|
13
|
+
allowUserPrompt: zod_1.z.boolean(),
|
|
14
|
+
systemPrompt: zod_1.z.string().nullable(),
|
|
15
|
+
imageSettings: exports.PhotoStudioImageSettingsSchema,
|
|
16
|
+
params: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).default({}),
|
|
17
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhotoStudioCheckpointSchema = exports.PhotoStudioCheckpointActionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const photo_studio_image_node_schema_1 = require("./photo-studio-image-node.schema");
|
|
7
|
+
exports.PhotoStudioCheckpointActionSchema = zod_1.z.object({
|
|
8
|
+
type: zod_1.z.nativeEnum(constants_1.PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE),
|
|
9
|
+
actionAlias: zod_1.z.string().nullable().optional(),
|
|
10
|
+
title: zod_1.z.string().nullable().optional(),
|
|
11
|
+
params: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).nullable().optional(),
|
|
12
|
+
});
|
|
13
|
+
exports.PhotoStudioCheckpointSchema = zod_1.z.object({
|
|
14
|
+
uuid: zod_1.z.string().uuid(),
|
|
15
|
+
canvasId: zod_1.z.string().uuid(),
|
|
16
|
+
sequence: zod_1.z.number().int().positive(),
|
|
17
|
+
action: exports.PhotoStudioCheckpointActionSchema,
|
|
18
|
+
images: zod_1.z.array(photo_studio_image_node_schema_1.PhotoStudioImageNodeSchema),
|
|
19
|
+
createdAt: zod_1.z.date(),
|
|
20
|
+
updatedAt: zod_1.z.date(),
|
|
21
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhotoStudioImageInputSchema = exports.PhotoStudioImageNodeSchema = exports.PhotoStudioImageResolutionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const canvas_node_schema_1 = require("../canvas-node.schema");
|
|
6
|
+
const file_schema_1 = require("../file.schema");
|
|
7
|
+
exports.PhotoStudioImageResolutionSchema = file_schema_1.FileResolutionSchema;
|
|
8
|
+
exports.PhotoStudioImageNodeSchema = zod_1.z.object({
|
|
9
|
+
uuid: zod_1.z.string().uuid(),
|
|
10
|
+
fileId: zod_1.z.string().uuid(),
|
|
11
|
+
url: zod_1.z.string().url(),
|
|
12
|
+
originalName: zod_1.z.string().nullable().optional(),
|
|
13
|
+
resolution: exports.PhotoStudioImageResolutionSchema.nullable().optional(),
|
|
14
|
+
position: canvas_node_schema_1.CanvasNodePositionSchema,
|
|
15
|
+
});
|
|
16
|
+
exports.PhotoStudioImageInputSchema = zod_1.z.object({
|
|
17
|
+
fileId: zod_1.z.string().uuid(),
|
|
18
|
+
position: canvas_node_schema_1.CanvasNodePositionSchema,
|
|
19
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PhotoStudioCanvasWithImagesSchema = exports.PhotoStudioCanvasSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const photo_studio_image_node_schema_1 = require("./photo-studio-image-node.schema");
|
|
6
|
+
exports.PhotoStudioCanvasSchema = zod_1.z.object({
|
|
7
|
+
uuid: zod_1.z.string().uuid(),
|
|
8
|
+
name: zod_1.z.string(),
|
|
9
|
+
userId: zod_1.z.string().uuid(),
|
|
10
|
+
createdAt: zod_1.z.date(),
|
|
11
|
+
updatedAt: zod_1.z.date(),
|
|
12
|
+
});
|
|
13
|
+
exports.PhotoStudioCanvasWithImagesSchema = exports.PhotoStudioCanvasSchema.extend({
|
|
14
|
+
images: zod_1.z.array(photo_studio_image_node_schema_1.PhotoStudioImageNodeSchema),
|
|
15
|
+
});
|
|
@@ -4,6 +4,7 @@ exports.ImageGenerationJobSchema = exports.ImageGenerationJobParamsSchema = expo
|
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const tool_job_schema_1 = require("../../tool-job.schema");
|
|
6
6
|
const constants_1 = require("../../../constants");
|
|
7
|
+
const file_schema_1 = require("../../file.schema");
|
|
7
8
|
exports.ImageGenerationFileAttachmentSchema = zod_1.z.object({
|
|
8
9
|
uuid: zod_1.z.string(),
|
|
9
10
|
url: zod_1.z.string(),
|
|
@@ -28,6 +29,8 @@ exports.ImageGenerationJobSchema = tool_job_schema_1.ToolJobSchema.extend({
|
|
|
28
29
|
.array(zod_1.z.object({
|
|
29
30
|
uuid: zod_1.z.string(),
|
|
30
31
|
url: zod_1.z.string(),
|
|
32
|
+
originalName: zod_1.z.string().nullable().optional(),
|
|
33
|
+
resolution: file_schema_1.FileResolutionSchema.nullable().optional(),
|
|
31
34
|
}))
|
|
32
35
|
.nullable(),
|
|
33
36
|
params: exports.ImageGenerationJobParamsSchema.optional(),
|
package/commands/index.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
PhotoStudioCheckpointActionSchema,
|
|
4
|
+
PhotoStudioCheckpointSchema,
|
|
5
|
+
PhotoStudioImageInputSchema,
|
|
6
|
+
} from '../../models';
|
|
7
|
+
|
|
8
|
+
export namespace AddPhotoStudioCheckpointCommand {
|
|
9
|
+
export const RequestParamSchema = z.object({ canvasId: z.string().uuid() });
|
|
10
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
11
|
+
|
|
12
|
+
export const RequestSchema = z.object({
|
|
13
|
+
action: PhotoStudioCheckpointActionSchema,
|
|
14
|
+
images: z.array(PhotoStudioImageInputSchema).optional(),
|
|
15
|
+
baseCheckpointSequence: z.number().int().positive().optional(),
|
|
16
|
+
});
|
|
17
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
18
|
+
|
|
19
|
+
export const ResponseSchema = z.object({
|
|
20
|
+
data: PhotoStudioCheckpointSchema,
|
|
21
|
+
});
|
|
22
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioCheckpointSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace ClearPhotoStudioCheckpointsCommand {
|
|
5
|
+
export const RequestParamSchema = z.object({ canvasId: z.string().uuid() });
|
|
6
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = z.object({
|
|
9
|
+
data: z.array(PhotoStudioCheckpointSchema),
|
|
10
|
+
});
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioCanvasWithImagesSchema, PhotoStudioImageInputSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace CreatePhotoStudioCanvasCommand {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
name: z.string().trim().min(1).optional(),
|
|
7
|
+
images: z.array(PhotoStudioImageInputSchema).default([]).optional(),
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
11
|
+
|
|
12
|
+
export const ResponseSchema = z.object({
|
|
13
|
+
data: PhotoStudioCanvasWithImagesSchema,
|
|
14
|
+
});
|
|
15
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeletePhotoStudioCanvasCommand {
|
|
4
|
+
export const RequestParamSchema = z.object({ uuid: z.string().uuid() });
|
|
5
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
6
|
+
|
|
7
|
+
export const ResponseSchema = z.object({
|
|
8
|
+
data: z.object({ isDeleted: z.boolean() }),
|
|
9
|
+
});
|
|
10
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export namespace DeletePhotoStudioCheckpointCommand {
|
|
4
|
+
export const RequestParamSchema = z.object({
|
|
5
|
+
canvasId: z.string().uuid(),
|
|
6
|
+
checkpointId: z.string().uuid(),
|
|
7
|
+
});
|
|
8
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
9
|
+
|
|
10
|
+
export const ResponseSchema = z.object({
|
|
11
|
+
data: z.object({ isDeleted: z.boolean() }),
|
|
12
|
+
});
|
|
13
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_CONTENT_TYPE } from '../../constants';
|
|
3
|
+
import { IMAGE_GENERATION_RESOLUTION } from '../../constants/tool-image-generation/enums/image-generation-resolution.enum';
|
|
4
|
+
import { CanvasNodePositionSchema, ToolJobSchema } from '../../models';
|
|
5
|
+
|
|
6
|
+
export namespace ExecutePhotoStudioActionCommand {
|
|
7
|
+
export const RequestSchema = z.object({
|
|
8
|
+
actionAlias: z.string().min(1),
|
|
9
|
+
modelId: z.string().uuid(),
|
|
10
|
+
prompt: z.string().optional(),
|
|
11
|
+
params: z
|
|
12
|
+
.object({
|
|
13
|
+
imageUrls: z.array(z.string().uuid()).optional(),
|
|
14
|
+
enhancePrompt: z.boolean().optional(),
|
|
15
|
+
resolution: z.nativeEnum(IMAGE_GENERATION_RESOLUTION).optional(),
|
|
16
|
+
aspectRatio: z.string().optional(),
|
|
17
|
+
effect: z.string().optional(),
|
|
18
|
+
size: z.enum(['2x', '4x', '8x']).optional(),
|
|
19
|
+
variationsCount: z.union([z.literal(2), z.literal(3), z.literal(4)]).optional(),
|
|
20
|
+
variationStrength: z.enum(['light', 'medium', 'high']).optional(),
|
|
21
|
+
fontStyle: z
|
|
22
|
+
.enum([
|
|
23
|
+
'calligraphy',
|
|
24
|
+
'handwritten',
|
|
25
|
+
'elegant',
|
|
26
|
+
'decorative',
|
|
27
|
+
'poster',
|
|
28
|
+
'engraving',
|
|
29
|
+
])
|
|
30
|
+
.optional(),
|
|
31
|
+
placement: z.enum(['top', 'center', 'bottom']).optional(),
|
|
32
|
+
color: z.string().optional(),
|
|
33
|
+
})
|
|
34
|
+
.default({}),
|
|
35
|
+
position: CanvasNodePositionSchema,
|
|
36
|
+
baseCheckpointSequence: z.number().int().positive().optional(),
|
|
37
|
+
});
|
|
38
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
39
|
+
|
|
40
|
+
export const PhotoStudioExecuteJobSchema = ToolJobSchema.extend({
|
|
41
|
+
toolType: z.nativeEnum(TOOL_CONTENT_TYPE),
|
|
42
|
+
});
|
|
43
|
+
export type PhotoStudioExecuteJob = z.infer<typeof PhotoStudioExecuteJobSchema>;
|
|
44
|
+
|
|
45
|
+
export const ResponseSchema = z.object({
|
|
46
|
+
data: z.array(PhotoStudioExecuteJobSchema),
|
|
47
|
+
});
|
|
48
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioCanvasWithImagesSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindPhotoStudioCanvasByUuidQuery {
|
|
5
|
+
export const RequestParamSchema = z.object({ uuid: z.string().uuid() });
|
|
6
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = z.object({
|
|
9
|
+
data: PhotoStudioCanvasWithImagesSchema,
|
|
10
|
+
});
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioCanvasSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindPhotoStudioCanvasesQuery {
|
|
5
|
+
export const RequestSchema = z.object({
|
|
6
|
+
limit: z.coerce.number().int().min(1).default(20).optional(),
|
|
7
|
+
offset: z.coerce.number().int().min(0).default(0).optional(),
|
|
8
|
+
name: z.string().optional(),
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.object({
|
|
14
|
+
data: z.array(PhotoStudioCanvasSchema.extend({ countOfImages: z.number() })),
|
|
15
|
+
page: z.number(),
|
|
16
|
+
totalPages: z.number(),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioCheckpointSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace FindPhotoStudioCheckpointsQuery {
|
|
5
|
+
export const RequestParamSchema = z.object({ canvasId: z.string().uuid() });
|
|
6
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
|
|
8
|
+
export const ResponseSchema = z.object({
|
|
9
|
+
data: z.array(PhotoStudioCheckpointSchema),
|
|
10
|
+
});
|
|
11
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_CONTENT_TYPE, TOOL_JOB_STATUS } from '../../constants';
|
|
3
|
+
import { CanvasNodePositionSchema, FileResolutionSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace FindPhotoStudioJobByIdQuery {
|
|
6
|
+
export const RequestParamSchema = z.object({
|
|
7
|
+
canvasId: z.string().uuid(),
|
|
8
|
+
jobId: z.string().uuid(),
|
|
9
|
+
});
|
|
10
|
+
export type RequestParams = z.infer<typeof RequestParamSchema>;
|
|
11
|
+
|
|
12
|
+
export const PhotoStudioJobImageSchema = z.object({
|
|
13
|
+
fileId: z.string().uuid(),
|
|
14
|
+
url: z.string(),
|
|
15
|
+
originalName: z.string().nullable().optional(),
|
|
16
|
+
resolution: FileResolutionSchema.nullable().optional(),
|
|
17
|
+
});
|
|
18
|
+
export type PhotoStudioJobImage = z.infer<typeof PhotoStudioJobImageSchema>;
|
|
19
|
+
|
|
20
|
+
export const PhotoStudioJobSchema = z.object({
|
|
21
|
+
jobId: z.string().uuid(),
|
|
22
|
+
toolType: z.nativeEnum(TOOL_CONTENT_TYPE),
|
|
23
|
+
status: z.nativeEnum(TOOL_JOB_STATUS),
|
|
24
|
+
position: CanvasNodePositionSchema,
|
|
25
|
+
images: z.array(PhotoStudioJobImageSchema),
|
|
26
|
+
error: z.string().nullable(),
|
|
27
|
+
createdAt: z.date(),
|
|
28
|
+
updatedAt: z.date(),
|
|
29
|
+
});
|
|
30
|
+
export type PhotoStudioJob = z.infer<typeof PhotoStudioJobSchema>;
|
|
31
|
+
|
|
32
|
+
export const ResponseSchema = z.object({
|
|
33
|
+
data: PhotoStudioJobSchema,
|
|
34
|
+
});
|
|
35
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_JOB_STATUS } from '../../constants';
|
|
3
|
+
import { FindPhotoStudioJobByIdQuery } from './find-photo-studio-job-by-id.query';
|
|
4
|
+
|
|
5
|
+
export namespace FindPhotoStudioJobsQuery {
|
|
6
|
+
export const RequestParamSchema = z.object({
|
|
7
|
+
canvasId: z.string().uuid(),
|
|
8
|
+
});
|
|
9
|
+
export type RequestParams = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const RequestQuerySchema = z.object({
|
|
12
|
+
status: z.nativeEnum(TOOL_JOB_STATUS).optional(),
|
|
13
|
+
});
|
|
14
|
+
export type RequestQuery = z.infer<typeof RequestQuerySchema>;
|
|
15
|
+
|
|
16
|
+
export const ResponseSchema = z.object({
|
|
17
|
+
data: z.array(FindPhotoStudioJobByIdQuery.PhotoStudioJobSchema),
|
|
18
|
+
});
|
|
19
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioActionSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace GetPhotoStudioActionsQuery {
|
|
5
|
+
export const ResponseSchema = z.object({
|
|
6
|
+
data: z.array(PhotoStudioActionSchema),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './add-photo-studio-checkpoint.command';
|
|
2
|
+
export * from './clear-photo-studio-checkpoints.command';
|
|
3
|
+
export * from './create-photo-studio-canvas.command';
|
|
4
|
+
export * from './delete-photo-studio-canvas.command';
|
|
5
|
+
export * from './delete-photo-studio-checkpoint.command';
|
|
6
|
+
export * from './execute-photo-studio-action.command';
|
|
7
|
+
export * from './find-photo-studio-canvas-by-uuid.query';
|
|
8
|
+
export * from './find-photo-studio-canvases.query';
|
|
9
|
+
export * from './find-photo-studio-checkpoints.query';
|
|
10
|
+
export * from './find-photo-studio-job-by-id.query';
|
|
11
|
+
export * from './find-photo-studio-jobs.query';
|
|
12
|
+
export * from './get-photo-studio-actions.query';
|
|
13
|
+
export * from './save-photo-studio-canvas.command';
|
|
14
|
+
export * from './update-photo-studio-canvas.command';
|
|
15
|
+
export * from './update-photo-studio-checkpoint.command';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
PhotoStudioCanvasWithImagesSchema,
|
|
4
|
+
PhotoStudioCheckpointActionSchema,
|
|
5
|
+
PhotoStudioImageInputSchema,
|
|
6
|
+
} from '../../models';
|
|
7
|
+
|
|
8
|
+
export namespace SavePhotoStudioCanvasCommand {
|
|
9
|
+
export const RequestParamSchema = z.object({ uuid: z.string().uuid() });
|
|
10
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
11
|
+
|
|
12
|
+
export const RequestSchema = z.object({
|
|
13
|
+
updatedAt: z.coerce.date().optional(),
|
|
14
|
+
images: z.array(PhotoStudioImageInputSchema),
|
|
15
|
+
action: PhotoStudioCheckpointActionSchema.optional(),
|
|
16
|
+
baseCheckpointSequence: z.number().int().positive().optional(),
|
|
17
|
+
});
|
|
18
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
19
|
+
|
|
20
|
+
export const ResponseSchema = z.object({
|
|
21
|
+
data: PhotoStudioCanvasWithImagesSchema,
|
|
22
|
+
});
|
|
23
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioCanvasWithImagesSchema } from '../../models';
|
|
3
|
+
|
|
4
|
+
export namespace UpdatePhotoStudioCanvasCommand {
|
|
5
|
+
export const RequestParamSchema = z.object({ uuid: z.string().uuid() });
|
|
6
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
7
|
+
|
|
8
|
+
export const RequestSchema = z.object({
|
|
9
|
+
name: z.string().trim().min(1),
|
|
10
|
+
});
|
|
11
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.object({
|
|
14
|
+
data: PhotoStudioCanvasWithImagesSchema,
|
|
15
|
+
});
|
|
16
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import {
|
|
3
|
+
PhotoStudioCheckpointActionSchema,
|
|
4
|
+
PhotoStudioCheckpointSchema,
|
|
5
|
+
PhotoStudioImageInputSchema,
|
|
6
|
+
} from '../../models';
|
|
7
|
+
|
|
8
|
+
export namespace UpdatePhotoStudioCheckpointCommand {
|
|
9
|
+
export const RequestParamSchema = z.object({
|
|
10
|
+
canvasId: z.string().uuid(),
|
|
11
|
+
checkpointId: z.string().uuid(),
|
|
12
|
+
});
|
|
13
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
14
|
+
|
|
15
|
+
export const RequestSchema = z.object({
|
|
16
|
+
action: PhotoStudioCheckpointActionSchema.optional(),
|
|
17
|
+
images: z.array(PhotoStudioImageInputSchema).optional(),
|
|
18
|
+
});
|
|
19
|
+
export type Request = z.infer<typeof RequestSchema>;
|
|
20
|
+
|
|
21
|
+
export const ResponseSchema = z.object({
|
|
22
|
+
data: PhotoStudioCheckpointSchema,
|
|
23
|
+
});
|
|
24
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
25
|
+
}
|
package/constants/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './photo-studio-checkpoint-action-type.enum';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './enums';
|
package/models/file.schema.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { FILE_TYPE } from '../constants';
|
|
3
3
|
|
|
4
|
+
export const FileResolutionSchema = z.object({
|
|
5
|
+
width: z.number().int().positive(),
|
|
6
|
+
height: z.number().int().positive(),
|
|
7
|
+
});
|
|
8
|
+
export type FileResolution = z.infer<typeof FileResolutionSchema>;
|
|
9
|
+
|
|
4
10
|
export const FileSchema = z.object({
|
|
5
11
|
uuid: z.string().uuid(),
|
|
6
12
|
name: z.string(),
|
|
7
13
|
size: z.number(),
|
|
14
|
+
originalName: z.string().nullable().optional(),
|
|
15
|
+
resolution: FileResolutionSchema.nullable().optional(),
|
|
8
16
|
mimeType: z.string(),
|
|
9
17
|
url: z.string(),
|
|
10
18
|
key: z.string(),
|
package/models/index.ts
CHANGED
|
@@ -22,6 +22,7 @@ export * from './file.schema';
|
|
|
22
22
|
export * from './key-value.schema';
|
|
23
23
|
export * from './form-submission.schema';
|
|
24
24
|
export * from './icon-variants.schema';
|
|
25
|
+
export * from './photo-studio';
|
|
25
26
|
export * from './lesson.schema';
|
|
26
27
|
export * from './lesson-translation.schema';
|
|
27
28
|
export * from './message.schema';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export const PhotoStudioImageSettingsSchema = z.object({
|
|
4
|
+
minImages: z.number().int().min(0),
|
|
5
|
+
maxImages: z.number().int().min(1),
|
|
6
|
+
});
|
|
7
|
+
export type PhotoStudioImageSettings = z.infer<typeof PhotoStudioImageSettingsSchema>;
|
|
8
|
+
|
|
9
|
+
export const PhotoStudioActionSchema = z.object({
|
|
10
|
+
alias: z.string().min(1),
|
|
11
|
+
title: z.string().min(1),
|
|
12
|
+
icon: z.string().min(1),
|
|
13
|
+
allowUserPrompt: z.boolean(),
|
|
14
|
+
systemPrompt: z.string().nullable(),
|
|
15
|
+
imageSettings: PhotoStudioImageSettingsSchema,
|
|
16
|
+
params: z.record(z.string(), z.unknown()).default({}),
|
|
17
|
+
});
|
|
18
|
+
export type PhotoStudioAction = z.infer<typeof PhotoStudioActionSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE } from '../../constants';
|
|
3
|
+
import { PhotoStudioImageNodeSchema } from './photo-studio-image-node.schema';
|
|
4
|
+
|
|
5
|
+
export const PhotoStudioCheckpointActionSchema = z.object({
|
|
6
|
+
type: z.nativeEnum(PHOTO_STUDIO_CHECKPOINT_ACTION_TYPE),
|
|
7
|
+
actionAlias: z.string().nullable().optional(),
|
|
8
|
+
title: z.string().nullable().optional(),
|
|
9
|
+
params: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
10
|
+
});
|
|
11
|
+
export type PhotoStudioCheckpointAction = z.infer<typeof PhotoStudioCheckpointActionSchema>;
|
|
12
|
+
|
|
13
|
+
export const PhotoStudioCheckpointSchema = z.object({
|
|
14
|
+
uuid: z.string().uuid(),
|
|
15
|
+
canvasId: z.string().uuid(),
|
|
16
|
+
sequence: z.number().int().positive(),
|
|
17
|
+
action: PhotoStudioCheckpointActionSchema,
|
|
18
|
+
images: z.array(PhotoStudioImageNodeSchema),
|
|
19
|
+
createdAt: z.date(),
|
|
20
|
+
updatedAt: z.date(),
|
|
21
|
+
});
|
|
22
|
+
export type PhotoStudioCheckpoint = z.infer<typeof PhotoStudioCheckpointSchema>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CanvasNodePositionSchema } from '../canvas-node.schema';
|
|
3
|
+
import { FileResolutionSchema } from '../file.schema';
|
|
4
|
+
|
|
5
|
+
export const PhotoStudioImageResolutionSchema = FileResolutionSchema;
|
|
6
|
+
export type PhotoStudioImageResolution = z.infer<typeof PhotoStudioImageResolutionSchema>;
|
|
7
|
+
|
|
8
|
+
export const PhotoStudioImageNodeSchema = z.object({
|
|
9
|
+
uuid: z.string().uuid(),
|
|
10
|
+
fileId: z.string().uuid(),
|
|
11
|
+
url: z.string().url(),
|
|
12
|
+
originalName: z.string().nullable().optional(),
|
|
13
|
+
resolution: PhotoStudioImageResolutionSchema.nullable().optional(),
|
|
14
|
+
position: CanvasNodePositionSchema,
|
|
15
|
+
});
|
|
16
|
+
export type PhotoStudioImageNode = z.infer<typeof PhotoStudioImageNodeSchema>;
|
|
17
|
+
|
|
18
|
+
export const PhotoStudioImageInputSchema = z.object({
|
|
19
|
+
fileId: z.string().uuid(),
|
|
20
|
+
position: CanvasNodePositionSchema,
|
|
21
|
+
});
|
|
22
|
+
export type PhotoStudioImageInput = z.infer<typeof PhotoStudioImageInputSchema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { PhotoStudioImageNodeSchema } from './photo-studio-image-node.schema';
|
|
3
|
+
|
|
4
|
+
export const PhotoStudioCanvasSchema = z.object({
|
|
5
|
+
uuid: z.string().uuid(),
|
|
6
|
+
name: z.string(),
|
|
7
|
+
userId: z.string().uuid(),
|
|
8
|
+
createdAt: z.date(),
|
|
9
|
+
updatedAt: z.date(),
|
|
10
|
+
});
|
|
11
|
+
export type PhotoStudioCanvas = z.infer<typeof PhotoStudioCanvasSchema>;
|
|
12
|
+
|
|
13
|
+
export const PhotoStudioCanvasWithImagesSchema = PhotoStudioCanvasSchema.extend({
|
|
14
|
+
images: z.array(PhotoStudioImageNodeSchema),
|
|
15
|
+
});
|
|
16
|
+
export type PhotoStudioCanvasWithImages = z.infer<typeof PhotoStudioCanvasWithImagesSchema>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ToolJobSchema } from '../../tool-job.schema';
|
|
3
3
|
import { IMAGE_GENERATION_RESOLUTION, USER_REACTION } from '../../../constants';
|
|
4
|
+
import { FileResolutionSchema } from '../../file.schema';
|
|
4
5
|
|
|
5
6
|
export const ImageGenerationFileAttachmentSchema = z.object({
|
|
6
7
|
uuid: z.string(),
|
|
@@ -32,6 +33,8 @@ export const ImageGenerationJobSchema = ToolJobSchema.extend({
|
|
|
32
33
|
z.object({
|
|
33
34
|
uuid: z.string(),
|
|
34
35
|
url: z.string(),
|
|
36
|
+
originalName: z.string().nullable().optional(),
|
|
37
|
+
resolution: FileResolutionSchema.nullable().optional(),
|
|
35
38
|
}),
|
|
36
39
|
)
|
|
37
40
|
.nullable(),
|