@purpleschool/gptbot 0.12.82 → 0.12.83
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/canvas.ts +1 -0
- package/build/api/controllers/http/canvas.js +1 -0
- package/build/commands/ai-studio/canvas/get-price.query.js +17 -0
- package/build/commands/ai-studio/canvas/index.js +1 -0
- package/build/constants/canvas-edge/enums/input-output-type.enum.js +2 -0
- package/build/models/canvas-node.schema.js +23 -12
- package/commands/ai-studio/canvas/get-price.query.ts +22 -0
- package/commands/ai-studio/canvas/index.ts +1 -0
- package/constants/canvas-edge/enums/input-output-type.enum.ts +2 -0
- package/models/canvas-node.schema.ts +24 -11
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriceCanvasQuery = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const models_1 = require("../../../models");
|
|
6
|
+
var PriceCanvasQuery;
|
|
7
|
+
(function (PriceCanvasQuery) {
|
|
8
|
+
PriceCanvasQuery.RequestParamSchema = models_1.CanvasSchema.pick({
|
|
9
|
+
uuid: true,
|
|
10
|
+
});
|
|
11
|
+
PriceCanvasQuery.QueryParamsSchema = zod_1.z.object({
|
|
12
|
+
executableNodeId: zod_1.z.string().uuid().optional(),
|
|
13
|
+
});
|
|
14
|
+
PriceCanvasQuery.ResponseSchema = zod_1.z.object({
|
|
15
|
+
price: zod_1.z.number(),
|
|
16
|
+
});
|
|
17
|
+
})(PriceCanvasQuery || (exports.PriceCanvasQuery = PriceCanvasQuery = {}));
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./run-canvas.command"), exports);
|
|
|
23
23
|
__exportStar(require("./save-canvas.command"), exports);
|
|
24
24
|
__exportStar(require("./update-canvas.command"), exports);
|
|
25
25
|
__exportStar(require("./execute-graph-by-node.command"), exports);
|
|
26
|
+
__exportStar(require("./get-price.query"), exports);
|
|
@@ -10,4 +10,6 @@ var INPUT_OUTPUT_TYPE;
|
|
|
10
10
|
INPUT_OUTPUT_TYPE["html"] = "html";
|
|
11
11
|
INPUT_OUTPUT_TYPE["palette"] = "palette";
|
|
12
12
|
INPUT_OUTPUT_TYPE["var"] = "var";
|
|
13
|
+
INPUT_OUTPUT_TYPE["firstFrame"] = "firstFrame";
|
|
14
|
+
INPUT_OUTPUT_TYPE["lastFrame"] = "lastFrame";
|
|
13
15
|
})(INPUT_OUTPUT_TYPE || (exports.INPUT_OUTPUT_TYPE = INPUT_OUTPUT_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.AudioBlockParamsSchema = exports.VarBlockParamsSchema = exports.NoteParamsSchema = exports.FileBlockParamsSchema = exports.VideoBlockParamsSchema = exports.ImageBlockParamsSchema = exports.TextBlockParamsSchema = exports.HtmlGenParamsSchema = exports.VarGenParamsSchema = exports.MotionControlParamsSchema = exports.ColorPaletteParamsSchema = exports.AudioGenParamsSchema = exports.VideoGenParamsSchema = exports.ImageGenParamsSchema = exports.TextGenParamsSchema = exports.CanvasNodePositionSchema = void 0;
|
|
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.CanvasFileRefSchema = exports.AudioBlockParamsSchema = exports.VarBlockParamsSchema = exports.NoteParamsSchema = exports.FileBlockParamsSchema = exports.VideoBlockParamsSchema = exports.ImageBlockParamsSchema = exports.TextBlockParamsSchema = exports.HtmlGenParamsSchema = exports.VarGenParamsSchema = exports.MotionControlParamsSchema = exports.ColorPaletteParamsSchema = exports.AudioGenParamsSchema = exports.VideoGenParamsSchema = exports.ImageGenParamsSchema = exports.TextGenParamsSchema = exports.CanvasNodePositionSchema = 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();
|
|
@@ -34,9 +34,6 @@ exports.VideoGenParamsSchema = strictObject({
|
|
|
34
34
|
duration: zod_1.z.string(),
|
|
35
35
|
aspectRatio: zod_1.z.string().optional(),
|
|
36
36
|
resolution: zod_1.z.string().optional(),
|
|
37
|
-
firstFrameImageId: zod_1.z.string().uuid().optional(),
|
|
38
|
-
lastFrameImageId: zod_1.z.string().uuid().optional(),
|
|
39
|
-
imageIds: zod_1.z.array(zod_1.z.string().uuid()).optional(),
|
|
40
37
|
});
|
|
41
38
|
exports.AudioGenParamsSchema = zod_1.z.discriminatedUnion('mode', [
|
|
42
39
|
strictObject({
|
|
@@ -53,7 +50,6 @@ exports.AudioGenParamsSchema = zod_1.z.discriminatedUnion('mode', [
|
|
|
53
50
|
prompt: zod_1.z.string(),
|
|
54
51
|
modelId: zod_1.z.string(),
|
|
55
52
|
modelName: zod_1.z.string(),
|
|
56
|
-
audioFileId: zod_1.z.string().uuid(),
|
|
57
53
|
}),
|
|
58
54
|
]);
|
|
59
55
|
exports.ColorPaletteParamsSchema = strictObject({
|
|
@@ -105,17 +101,21 @@ exports.AudioBlockParamsSchema = strictObject({
|
|
|
105
101
|
content: zod_1.z.string(),
|
|
106
102
|
});
|
|
107
103
|
// OUTPUT SHEMA
|
|
104
|
+
exports.CanvasFileRefSchema = strictObject({
|
|
105
|
+
fileId: zod_1.z.string().uuid(),
|
|
106
|
+
url: zod_1.z.string().url(),
|
|
107
|
+
});
|
|
108
108
|
exports.TextGenOutputSchema = strictObject({
|
|
109
109
|
result: zod_1.z.string(),
|
|
110
110
|
});
|
|
111
111
|
exports.ImageGenOutputSchema = strictObject({
|
|
112
|
-
|
|
112
|
+
images: zod_1.z.array(exports.CanvasFileRefSchema).min(1),
|
|
113
113
|
});
|
|
114
114
|
exports.VideoGenOutputSchema = strictObject({
|
|
115
|
-
|
|
115
|
+
video: exports.CanvasFileRefSchema,
|
|
116
116
|
});
|
|
117
117
|
exports.AudioGenTTSOutputSchema = strictObject({
|
|
118
|
-
|
|
118
|
+
audio: exports.CanvasFileRefSchema,
|
|
119
119
|
});
|
|
120
120
|
exports.AudioGenSTTOutputSchema = strictObject({
|
|
121
121
|
transcript: zod_1.z.string(),
|
|
@@ -130,15 +130,26 @@ exports.VarGenOutputSchema = strictObject({
|
|
|
130
130
|
variables: zod_1.z.record(zod_1.z.string()),
|
|
131
131
|
});
|
|
132
132
|
exports.HtmlGenOutputSchema = strictObject({
|
|
133
|
+
sessionId: zod_1.z.string(),
|
|
133
134
|
html: zod_1.z.string(),
|
|
134
135
|
});
|
|
135
136
|
exports.TextBlockOutputSchema = exports.TextBlockParamsSchema;
|
|
136
|
-
exports.ImageBlockOutputSchema =
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
exports.ImageBlockOutputSchema = strictObject({
|
|
138
|
+
image: exports.CanvasFileRefSchema,
|
|
139
|
+
});
|
|
140
|
+
exports.VideoBlockOutputSchema = strictObject({
|
|
141
|
+
video: exports.CanvasFileRefSchema,
|
|
142
|
+
});
|
|
143
|
+
exports.FileBlockOutputSchema = strictObject({
|
|
144
|
+
filename: zod_1.z.string(),
|
|
145
|
+
content: zod_1.z.string(),
|
|
146
|
+
file: exports.CanvasFileRefSchema.optional(),
|
|
147
|
+
});
|
|
139
148
|
exports.NoteOutputSchema = exports.NoteParamsSchema;
|
|
140
149
|
exports.VarBlockOutputSchema = exports.VarBlockParamsSchema;
|
|
141
|
-
exports.AudioBlockOutputSchema = exports.AudioBlockParamsSchema
|
|
150
|
+
exports.AudioBlockOutputSchema = exports.AudioBlockParamsSchema.extend({
|
|
151
|
+
audio: exports.CanvasFileRefSchema.optional(),
|
|
152
|
+
});
|
|
142
153
|
exports.CanvasNodeParamsSchemaByType = {
|
|
143
154
|
[constants_1.CANVAS_NODE_TYPE.textGen]: exports.TextGenParamsSchema,
|
|
144
155
|
[constants_1.CANVAS_NODE_TYPE.imageGen]: exports.ImageGenParamsSchema,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CanvasSchema } from '../../../models';
|
|
3
|
+
|
|
4
|
+
export namespace PriceCanvasQuery {
|
|
5
|
+
export const RequestParamSchema = CanvasSchema.pick({
|
|
6
|
+
uuid: true,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export type RequestParam = z.infer<typeof RequestParamSchema>;
|
|
10
|
+
|
|
11
|
+
export const QueryParamsSchema = z.object({
|
|
12
|
+
executableNodeId: z.string().uuid().optional(),
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export type QueryParams = z.infer<typeof QueryParamsSchema>;
|
|
16
|
+
|
|
17
|
+
export const ResponseSchema = z.object({
|
|
18
|
+
price: z.number(),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export type Response = z.infer<typeof ResponseSchema>;
|
|
22
|
+
}
|
|
@@ -40,9 +40,6 @@ export const VideoGenParamsSchema = strictObject({
|
|
|
40
40
|
duration: z.string(),
|
|
41
41
|
aspectRatio: z.string().optional(),
|
|
42
42
|
resolution: z.string().optional(),
|
|
43
|
-
firstFrameImageId: z.string().uuid().optional(),
|
|
44
|
-
lastFrameImageId: z.string().uuid().optional(),
|
|
45
|
-
imageIds: z.array(z.string().uuid()).optional(),
|
|
46
43
|
});
|
|
47
44
|
export type VideoGenParams = z.infer<typeof VideoGenParamsSchema>;
|
|
48
45
|
|
|
@@ -61,7 +58,6 @@ export const AudioGenParamsSchema = z.discriminatedUnion('mode', [
|
|
|
61
58
|
prompt: z.string(),
|
|
62
59
|
modelId: z.string(),
|
|
63
60
|
modelName: z.string(),
|
|
64
|
-
audioFileId: z.string().uuid(),
|
|
65
61
|
}),
|
|
66
62
|
]);
|
|
67
63
|
export type AudioGenParams = z.infer<typeof AudioGenParamsSchema>;
|
|
@@ -139,23 +135,29 @@ export const AudioBlockParamsSchema = strictObject({
|
|
|
139
135
|
export type AudioBlockParams = z.infer<typeof AudioBlockParamsSchema>;
|
|
140
136
|
|
|
141
137
|
// OUTPUT SHEMA
|
|
138
|
+
export const CanvasFileRefSchema = strictObject({
|
|
139
|
+
fileId: z.string().uuid(),
|
|
140
|
+
url: z.string().url(),
|
|
141
|
+
});
|
|
142
|
+
export type CanvasFileRef = z.infer<typeof CanvasFileRefSchema>;
|
|
143
|
+
|
|
142
144
|
export const TextGenOutputSchema = strictObject({
|
|
143
145
|
result: z.string(),
|
|
144
146
|
});
|
|
145
147
|
export type TextGenOutput = z.infer<typeof TextGenOutputSchema>;
|
|
146
148
|
|
|
147
149
|
export const ImageGenOutputSchema = strictObject({
|
|
148
|
-
|
|
150
|
+
images: z.array(CanvasFileRefSchema).min(1),
|
|
149
151
|
});
|
|
150
152
|
export type ImageGenOutput = z.infer<typeof ImageGenOutputSchema>;
|
|
151
153
|
|
|
152
154
|
export const VideoGenOutputSchema = strictObject({
|
|
153
|
-
|
|
155
|
+
video: CanvasFileRefSchema,
|
|
154
156
|
});
|
|
155
157
|
export type VideoGenOutput = z.infer<typeof VideoGenOutputSchema>;
|
|
156
158
|
|
|
157
159
|
export const AudioGenTTSOutputSchema = strictObject({
|
|
158
|
-
|
|
160
|
+
audio: CanvasFileRefSchema,
|
|
159
161
|
});
|
|
160
162
|
export type AudioGenTTSOutput = z.infer<typeof AudioGenTTSOutputSchema>;
|
|
161
163
|
|
|
@@ -180,6 +182,7 @@ export const VarGenOutputSchema = strictObject({
|
|
|
180
182
|
export type VarGenOutput = z.infer<typeof VarGenOutputSchema>;
|
|
181
183
|
|
|
182
184
|
export const HtmlGenOutputSchema = strictObject({
|
|
185
|
+
sessionId: z.string(),
|
|
183
186
|
html: z.string(),
|
|
184
187
|
});
|
|
185
188
|
export type HtmlGenOutput = z.infer<typeof HtmlGenOutputSchema>;
|
|
@@ -187,13 +190,21 @@ export type HtmlGenOutput = z.infer<typeof HtmlGenOutputSchema>;
|
|
|
187
190
|
export const TextBlockOutputSchema = TextBlockParamsSchema;
|
|
188
191
|
export type TextBlockOutput = z.infer<typeof TextBlockOutputSchema>;
|
|
189
192
|
|
|
190
|
-
export const ImageBlockOutputSchema =
|
|
193
|
+
export const ImageBlockOutputSchema = strictObject({
|
|
194
|
+
image: CanvasFileRefSchema,
|
|
195
|
+
});
|
|
191
196
|
export type ImageBlockOutput = z.infer<typeof ImageBlockOutputSchema>;
|
|
192
197
|
|
|
193
|
-
export const VideoBlockOutputSchema =
|
|
198
|
+
export const VideoBlockOutputSchema = strictObject({
|
|
199
|
+
video: CanvasFileRefSchema,
|
|
200
|
+
});
|
|
194
201
|
export type VideoBlockOutput = z.infer<typeof VideoBlockOutputSchema>;
|
|
195
202
|
|
|
196
|
-
export const FileBlockOutputSchema =
|
|
203
|
+
export const FileBlockOutputSchema = strictObject({
|
|
204
|
+
filename: z.string(),
|
|
205
|
+
content: z.string(),
|
|
206
|
+
file: CanvasFileRefSchema.optional(),
|
|
207
|
+
});
|
|
197
208
|
export type FileBlockOutput = z.infer<typeof FileBlockOutputSchema>;
|
|
198
209
|
|
|
199
210
|
export const NoteOutputSchema = NoteParamsSchema;
|
|
@@ -202,7 +213,9 @@ export type NoteOutput = z.infer<typeof NoteOutputSchema>;
|
|
|
202
213
|
export const VarBlockOutputSchema = VarBlockParamsSchema;
|
|
203
214
|
export type VarBlockOutput = z.infer<typeof VarBlockOutputSchema>;
|
|
204
215
|
|
|
205
|
-
export const AudioBlockOutputSchema = AudioBlockParamsSchema
|
|
216
|
+
export const AudioBlockOutputSchema = AudioBlockParamsSchema.extend({
|
|
217
|
+
audio: CanvasFileRefSchema.optional(),
|
|
218
|
+
});
|
|
206
219
|
export type AudioBlockOutput = z.infer<typeof AudioBlockOutputSchema>;
|
|
207
220
|
|
|
208
221
|
export const CanvasNodeParamsSchemaByType = {
|