@purpleschool/gptbot 0.14.12-avatar-studio → 0.14.14-avatar-studio
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/photo-studio.ts +1 -0
- package/api/routes.ts +1 -0
- package/build/api/controllers/http/photo-studio.js +1 -0
- package/build/api/routes.js +1 -0
- package/build/commands/photo-studio/get-photo-studio-config.query.js +16 -0
- package/build/commands/photo-studio/index.js +1 -0
- package/build/constants/canvas-node/enums/canvas-node-error-kind.enum.js +8 -0
- package/build/constants/canvas-node/enums/index.js +1 -0
- package/build/constants/tool/enums/tool-type.enum.js +1 -0
- package/build/models/canvas-node.schema.js +8 -2
- package/commands/photo-studio/get-photo-studio-config.query.ts +18 -0
- package/commands/photo-studio/index.ts +1 -0
- package/constants/canvas-node/enums/canvas-node-error-kind.enum.ts +4 -0
- package/constants/canvas-node/enums/index.ts +1 -0
- package/constants/tool/enums/tool-type.enum.ts +1 -0
- package/models/canvas-node.schema.ts +9 -2
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ export const PHOTO_STUDIO_PRIVATE_CONTROLLER = 'private/photo-studio' as const;
|
|
|
2
2
|
|
|
3
3
|
export const PHOTO_STUDIO_ROUTES = {
|
|
4
4
|
ACTIONS: 'actions',
|
|
5
|
+
CONFIG: 'config',
|
|
5
6
|
EXECUTE: (canvasId: string) => `canvases/${canvasId}/execute`,
|
|
6
7
|
CREATE_CANVAS: 'canvases',
|
|
7
8
|
GET_CANVASES: 'canvases',
|
package/api/routes.ts
CHANGED
|
@@ -1717,6 +1717,7 @@ export const REST_API = {
|
|
|
1717
1717
|
},
|
|
1718
1718
|
PHOTO_STUDIO_PRIVATE: {
|
|
1719
1719
|
ACTIONS: `${ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.ACTIONS}`,
|
|
1720
|
+
CONFIG: `${ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.CONFIG}`,
|
|
1720
1721
|
CREATE_CANVAS: `${ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.CREATE_CANVAS}`,
|
|
1721
1722
|
GET_CANVASES: `${ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.GET_CANVASES}`,
|
|
1722
1723
|
GET_CANVAS: (canvasId: string) =>
|
|
@@ -4,6 +4,7 @@ exports.PHOTO_STUDIO_ROUTES = exports.PHOTO_STUDIO_PRIVATE_CONTROLLER = void 0;
|
|
|
4
4
|
exports.PHOTO_STUDIO_PRIVATE_CONTROLLER = 'private/photo-studio';
|
|
5
5
|
exports.PHOTO_STUDIO_ROUTES = {
|
|
6
6
|
ACTIONS: 'actions',
|
|
7
|
+
CONFIG: 'config',
|
|
7
8
|
EXECUTE: (canvasId) => `canvases/${canvasId}/execute`,
|
|
8
9
|
CREATE_CANVAS: 'canvases',
|
|
9
10
|
GET_CANVASES: 'canvases',
|
package/build/api/routes.js
CHANGED
|
@@ -1230,6 +1230,7 @@ exports.REST_API = {
|
|
|
1230
1230
|
},
|
|
1231
1231
|
PHOTO_STUDIO_PRIVATE: {
|
|
1232
1232
|
ACTIONS: `${exports.ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.ACTIONS}`,
|
|
1233
|
+
CONFIG: `${exports.ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.CONFIG}`,
|
|
1233
1234
|
CREATE_CANVAS: `${exports.ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.CREATE_CANVAS}`,
|
|
1234
1235
|
GET_CANVASES: `${exports.ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.GET_CANVASES}`,
|
|
1235
1236
|
GET_CANVAS: (canvasId) => `${exports.ROOT}/${CONTROLLERS.PHOTO_STUDIO_PRIVATE_CONTROLLER}/${CONTROLLERS.PHOTO_STUDIO_ROUTES.GET_CANVAS(canvasId)}`,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetPhotoStudioConfigQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const models_1 = require("../../models");
|
|
7
|
+
var GetPhotoStudioConfigQuery;
|
|
8
|
+
(function (GetPhotoStudioConfigQuery) {
|
|
9
|
+
GetPhotoStudioConfigQuery.ConfigSchema = zod_1.z.object({
|
|
10
|
+
[constants_1.TOOL_TYPE.IMAGE_GENERATION]: models_1.ImageGenerationConfigSchema,
|
|
11
|
+
[constants_1.TOOL_TYPE.IMAGE]: models_1.ImageEditorConfigSchema,
|
|
12
|
+
});
|
|
13
|
+
GetPhotoStudioConfigQuery.ResponseSchema = zod_1.z.object({
|
|
14
|
+
data: GetPhotoStudioConfigQuery.ConfigSchema,
|
|
15
|
+
});
|
|
16
|
+
})(GetPhotoStudioConfigQuery || (exports.GetPhotoStudioConfigQuery = GetPhotoStudioConfigQuery = {}));
|
|
@@ -26,6 +26,7 @@ __exportStar(require("./find-photo-studio-checkpoints.query"), exports);
|
|
|
26
26
|
__exportStar(require("./find-photo-studio-job-by-id.query"), exports);
|
|
27
27
|
__exportStar(require("./find-photo-studio-jobs.query"), exports);
|
|
28
28
|
__exportStar(require("./get-photo-studio-actions.query"), exports);
|
|
29
|
+
__exportStar(require("./get-photo-studio-config.query"), exports);
|
|
29
30
|
__exportStar(require("./save-photo-studio-canvas.command"), exports);
|
|
30
31
|
__exportStar(require("./update-photo-studio-canvas.command"), exports);
|
|
31
32
|
__exportStar(require("./update-photo-studio-checkpoint.command"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CANVAS_NODE_ERROR_KIND = void 0;
|
|
4
|
+
var CANVAS_NODE_ERROR_KIND;
|
|
5
|
+
(function (CANVAS_NODE_ERROR_KIND) {
|
|
6
|
+
CANVAS_NODE_ERROR_KIND["RUNTIME_VALIDATION"] = "RUNTIME_VALIDATION";
|
|
7
|
+
CANVAS_NODE_ERROR_KIND["EXECUTION_ERROR"] = "EXECUTION_ERROR";
|
|
8
|
+
})(CANVAS_NODE_ERROR_KIND || (exports.CANVAS_NODE_ERROR_KIND = CANVAS_NODE_ERROR_KIND = {}));
|
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./canvas-node-error-kind.enum"), exports);
|
|
17
18
|
__exportStar(require("./canvas-node-type.enum"), exports);
|
|
18
19
|
__exportStar(require("./node-run-status.enum"), exports);
|
|
@@ -21,4 +21,5 @@ var TOOL_TYPE;
|
|
|
21
21
|
TOOL_TYPE["SPELL_CORRECTOR"] = "SPELL_CORRECTOR";
|
|
22
22
|
TOOL_TYPE["SOLVING_EDU_TASK"] = "SOLVING_EDU_TASK";
|
|
23
23
|
TOOL_TYPE["HTML_PAGE_BUILDER"] = "HTML_PAGE_BUILDER";
|
|
24
|
+
TOOL_TYPE["DIAGRAMS"] = "DIAGRAMS";
|
|
24
25
|
})(TOOL_TYPE || (exports.TOOL_TYPE = TOOL_TYPE = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CanvasNodeSchema = exports.CanvasNodeBaseSchema = exports.validateCanvasNodeOutputByType = exports.validateCanvasNodeParamsByType = exports.CanvasNodeErrorSchema = exports.CanvasNodeOutputSchemaByType = exports.CanvasNodeParamsSchemaByType = exports.AudioBlockOutputSchema = exports.VarBlockOutputSchema = exports.NoteOutputSchema = exports.FileBlockOutputSchema = exports.VideoBlockOutputSchema = exports.ImageBlockOutputSchema = exports.TextBlockOutputSchema = exports.HtmlGenOutputSchema = exports.VarGenOutputSchema = exports.MotionControlOutputSchema = exports.ColorPaletteOutputSchema = exports.AudioGenSTTOutputSchema = exports.AudioGenTTSOutputSchema = exports.VideoGenOutputSchema = exports.ImageGenOutputSchema = exports.TextGenOutputSchema = exports.NoParamsSchema = exports.HtmlGenParamsSchema = exports.VarGenParamsSchema = exports.MotionControlParamsSchema = exports.ColorPaletteParamsSchema = exports.AudioGenParamsSchema = exports.VideoGenParamsSchema = exports.ImageGenParamsSchema = exports.TextGenParamsSchema = exports.CanvasNodePositionSchema = exports.CanvasFileRefSchema = void 0;
|
|
3
|
+
exports.CanvasNodeSchema = exports.CanvasNodeBaseSchema = exports.validateCanvasNodeOutputByType = exports.validateCanvasNodeParamsByType = exports.CanvasNodeErrorSchema = exports.CanvasNodeErrorDetailsSchema = exports.CanvasNodeOutputSchemaByType = exports.CanvasNodeParamsSchemaByType = exports.AudioBlockOutputSchema = exports.VarBlockOutputSchema = exports.NoteOutputSchema = exports.FileBlockOutputSchema = exports.VideoBlockOutputSchema = exports.ImageBlockOutputSchema = exports.TextBlockOutputSchema = exports.HtmlGenOutputSchema = exports.VarGenOutputSchema = exports.MotionControlOutputSchema = exports.ColorPaletteOutputSchema = exports.AudioGenSTTOutputSchema = exports.AudioGenTTSOutputSchema = exports.VideoGenOutputSchema = exports.ImageGenOutputSchema = exports.TextGenOutputSchema = exports.NoParamsSchema = exports.HtmlGenParamsSchema = exports.VarGenParamsSchema = exports.MotionControlParamsSchema = exports.ColorPaletteParamsSchema = exports.AudioGenParamsSchema = exports.VideoGenParamsSchema = exports.ImageGenParamsSchema = exports.TextGenParamsSchema = exports.CanvasNodePositionSchema = exports.CanvasFileRefSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const strictObject = (shape) => zod_1.z.object(shape).strict();
|
|
@@ -170,10 +170,16 @@ exports.CanvasNodeOutputSchemaByType = {
|
|
|
170
170
|
[constants_1.CANVAS_NODE_TYPE.htmlGen]: exports.HtmlGenOutputSchema,
|
|
171
171
|
[constants_1.CANVAS_NODE_TYPE.audioBlock]: exports.AudioBlockOutputSchema,
|
|
172
172
|
};
|
|
173
|
+
exports.CanvasNodeErrorDetailsSchema = zod_1.z
|
|
174
|
+
.object({
|
|
175
|
+
nodeId: zod_1.z.string().uuid().optional(),
|
|
176
|
+
errorKind: zod_1.z.nativeEnum(constants_1.CANVAS_NODE_ERROR_KIND).optional(),
|
|
177
|
+
})
|
|
178
|
+
.catchall(zod_1.z.unknown());
|
|
173
179
|
exports.CanvasNodeErrorSchema = zod_1.z.object({
|
|
174
180
|
code: zod_1.z.string(),
|
|
175
181
|
message: zod_1.z.string(),
|
|
176
|
-
details:
|
|
182
|
+
details: exports.CanvasNodeErrorDetailsSchema.optional(),
|
|
177
183
|
retryable: zod_1.z.boolean().optional(),
|
|
178
184
|
});
|
|
179
185
|
const validateCanvasNodeParamsByType = (nodeDefinitionId, params, ctx) => {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TOOL_TYPE } from '../../constants';
|
|
3
|
+
import { ImageEditorConfigSchema, ImageGenerationConfigSchema } from '../../models';
|
|
4
|
+
|
|
5
|
+
export namespace GetPhotoStudioConfigQuery {
|
|
6
|
+
export const ConfigSchema = z.object({
|
|
7
|
+
[TOOL_TYPE.IMAGE_GENERATION]: ImageGenerationConfigSchema,
|
|
8
|
+
[TOOL_TYPE.IMAGE]: ImageEditorConfigSchema,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export type Config = z.infer<typeof ConfigSchema>;
|
|
12
|
+
|
|
13
|
+
export const ResponseSchema = z.object({
|
|
14
|
+
data: ConfigSchema,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
18
|
+
}
|
|
@@ -10,6 +10,7 @@ export * from './find-photo-studio-checkpoints.query';
|
|
|
10
10
|
export * from './find-photo-studio-job-by-id.query';
|
|
11
11
|
export * from './find-photo-studio-jobs.query';
|
|
12
12
|
export * from './get-photo-studio-actions.query';
|
|
13
|
+
export * from './get-photo-studio-config.query';
|
|
13
14
|
export * from './save-photo-studio-canvas.command';
|
|
14
15
|
export * from './update-photo-studio-canvas.command';
|
|
15
16
|
export * from './update-photo-studio-checkpoint.command';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CANVAS_NODE_TYPE, NODE_RUN_STATUS } from '../constants';
|
|
2
|
+
import { CANVAS_NODE_ERROR_KIND, CANVAS_NODE_TYPE, NODE_RUN_STATUS } from '../constants';
|
|
3
3
|
|
|
4
4
|
const strictObject = <T extends z.ZodRawShape>(shape: T): z.ZodObject<T, 'strict'> =>
|
|
5
5
|
z.object(shape).strict();
|
|
@@ -226,10 +226,17 @@ export const CanvasNodeOutputSchemaByType = {
|
|
|
226
226
|
[CANVAS_NODE_TYPE.audioBlock]: AudioBlockOutputSchema,
|
|
227
227
|
} as const;
|
|
228
228
|
|
|
229
|
+
export const CanvasNodeErrorDetailsSchema = z
|
|
230
|
+
.object({
|
|
231
|
+
nodeId: z.string().uuid().optional(),
|
|
232
|
+
errorKind: z.nativeEnum(CANVAS_NODE_ERROR_KIND).optional(),
|
|
233
|
+
})
|
|
234
|
+
.catchall(z.unknown());
|
|
235
|
+
|
|
229
236
|
export const CanvasNodeErrorSchema = z.object({
|
|
230
237
|
code: z.string(),
|
|
231
238
|
message: z.string(),
|
|
232
|
-
details:
|
|
239
|
+
details: CanvasNodeErrorDetailsSchema.optional(),
|
|
233
240
|
retryable: z.boolean().optional(),
|
|
234
241
|
});
|
|
235
242
|
export type CanvasNodeError = z.infer<typeof CanvasNodeErrorSchema>;
|