ugcinc 4.1.5 → 4.1.7

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.
@@ -2,8 +2,10 @@ import { type InputType } from './types';
2
2
  export interface BranchDefinition {
3
3
  key: string;
4
4
  }
5
- interface BranchValueConfig {
5
+ export interface BranchValueConfig {
6
6
  inputType?: InputType;
7
+ value?: unknown;
8
+ selectedMediaIds?: string[];
7
9
  }
8
10
  export interface PassthroughInput {
9
11
  id: string;
@@ -250,9 +250,9 @@ export interface FlowControlOutput {
250
250
  }
251
251
  /**
252
252
  * Context passed to executor-based node execution.
253
- * Replaces the complex outputMap/iteration/portOffsets pattern with simple inputs.
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: NodeType;
266
- /** Node config (includes assignedValue for source nodes) */
267
- config: Record<string, unknown>;
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
- * Much simpler than the old NodeControlConfig - just takes context and returns output.
273
+ * Generic on node type - config type is automatically derived.
274
274
  */
275
- export interface NodeExecutor<TOutput = unknown> {
276
- type: NodeType;
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,19 @@ 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
308
  /**
309
309
  * Type guard to check if an executor is async
310
310
  */
311
- export declare function isAsyncExecutor<T>(executor: NodeExecutor<T> | AsyncNodeExecutor<T>): executor is AsyncNodeExecutor<T>;
311
+ export declare function isAsyncExecutor<TType extends UserCreatableNodeType, TOutput>(executor: NodeExecutor<TType, TOutput> | AsyncNodeExecutor<TType, TOutput>): executor is AsyncNodeExecutor<TType, TOutput>;
312
312
  /**
313
313
  * Validation error types for automation workflows
314
314
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.1.5",
3
+ "version": "4.1.7",
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.4",
44
+ "ugcinc": "^4.1.6",
45
45
  "zod": "^3.23.0"
46
46
  },
47
47
  "peerDependencies": {