ugcinc 4.1.6 → 4.1.8
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/dist/automations/types.d.ts +25 -13
- package/package.json +2 -2
|
@@ -250,9 +250,9 @@ export interface FlowControlOutput {
|
|
|
250
250
|
}
|
|
251
251
|
/**
|
|
252
252
|
* Context passed to executor-based node execution.
|
|
253
|
-
*
|
|
253
|
+
* Generic on node type - config is automatically derived from the node type.
|
|
254
254
|
*/
|
|
255
|
-
export interface ExecutorContext {
|
|
255
|
+
export interface ExecutorContext<TType extends UserCreatableNodeType = UserCreatableNodeType> {
|
|
256
256
|
/** Database ID of this executor */
|
|
257
257
|
executorId: string;
|
|
258
258
|
/** Run ID this executor belongs to */
|
|
@@ -262,23 +262,23 @@ export interface ExecutorContext {
|
|
|
262
262
|
/** Index of this executor (0, 1, 2...) for the same template node */
|
|
263
263
|
executorIndex: number;
|
|
264
264
|
/** Node type */
|
|
265
|
-
type:
|
|
266
|
-
/** Node config
|
|
267
|
-
config:
|
|
265
|
+
type: TType;
|
|
266
|
+
/** Node config - type is derived from the node type */
|
|
267
|
+
config: WorkflowConfig[TType];
|
|
268
268
|
/** Input values read from incoming edges (portId -> value) */
|
|
269
269
|
inputs: Record<string, unknown>;
|
|
270
270
|
}
|
|
271
271
|
/**
|
|
272
272
|
* Executor for synchronous nodes.
|
|
273
|
-
*
|
|
273
|
+
* Generic on node type - config type is automatically derived.
|
|
274
274
|
*/
|
|
275
|
-
export interface NodeExecutor<TOutput = unknown> {
|
|
276
|
-
type:
|
|
275
|
+
export interface NodeExecutor<TType extends UserCreatableNodeType, TOutput = unknown> {
|
|
276
|
+
type: TType;
|
|
277
277
|
/**
|
|
278
278
|
* Execute the node and return a single output value.
|
|
279
279
|
* For multi-output nodes (like LLM), return an object with output fields.
|
|
280
280
|
*/
|
|
281
|
-
execute: (ctx: ExecutorContext) => Promise<TOutput>;
|
|
281
|
+
execute: (ctx: ExecutorContext<TType>) => Promise<TOutput>;
|
|
282
282
|
}
|
|
283
283
|
/**
|
|
284
284
|
* Async job status for executor-based async nodes
|
|
@@ -296,19 +296,31 @@ export type ExecutorAsyncJobStatus<TOutput = unknown> = {
|
|
|
296
296
|
* Executor for asynchronous nodes (video-editor, generate-image, workflow).
|
|
297
297
|
* Uses submit/poll pattern for durable workflows.
|
|
298
298
|
*/
|
|
299
|
-
export interface AsyncNodeExecutor<TOutput = unknown> extends Omit<NodeExecutor<TOutput>, 'execute'> {
|
|
299
|
+
export interface AsyncNodeExecutor<TType extends UserCreatableNodeType, TOutput = unknown> extends Omit<NodeExecutor<TType, TOutput>, 'execute'> {
|
|
300
300
|
isAsync: true;
|
|
301
301
|
/** Submit job - returns job ID for polling */
|
|
302
|
-
submitJob: (ctx: ExecutorContext) => Promise<{
|
|
302
|
+
submitJob: (ctx: ExecutorContext<TType>) => Promise<{
|
|
303
303
|
jobId: string;
|
|
304
304
|
}>;
|
|
305
305
|
/** Check job status - called by orchestrator with workflow sleep between calls */
|
|
306
|
-
checkStatus: (jobId: string, ctx: ExecutorContext) => Promise<ExecutorAsyncJobStatus<TOutput>>;
|
|
306
|
+
checkStatus: (jobId: string, ctx: ExecutorContext<TType>) => Promise<ExecutorAsyncJobStatus<TOutput>>;
|
|
307
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Any node executor - used for registries that hold executors of different types
|
|
310
|
+
*/
|
|
311
|
+
export type AnyNodeExecutor = {
|
|
312
|
+
[K in UserCreatableNodeType]: NodeExecutor<K, unknown>;
|
|
313
|
+
}[UserCreatableNodeType];
|
|
314
|
+
/**
|
|
315
|
+
* Any async node executor - used for registries that hold executors of different types
|
|
316
|
+
*/
|
|
317
|
+
export type AnyAsyncNodeExecutor = {
|
|
318
|
+
[K in UserCreatableNodeType]: AsyncNodeExecutor<K, unknown>;
|
|
319
|
+
}[UserCreatableNodeType];
|
|
308
320
|
/**
|
|
309
321
|
* Type guard to check if an executor is async
|
|
310
322
|
*/
|
|
311
|
-
export declare function isAsyncExecutor
|
|
323
|
+
export declare function isAsyncExecutor(executor: AnyNodeExecutor | AnyAsyncNodeExecutor): executor is AnyAsyncNodeExecutor;
|
|
312
324
|
/**
|
|
313
325
|
* Validation error types for automation workflows
|
|
314
326
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugcinc",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.8",
|
|
4
4
|
"description": "TypeScript/JavaScript client for the UGC Inc API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"license": "MIT",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@remotion/player": "^4.0.0",
|
|
44
|
-
"ugcinc": "^4.1.
|
|
44
|
+
"ugcinc": "^4.1.6",
|
|
45
45
|
"zod": "^3.23.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|