ugcinc 3.56.0 → 3.58.0

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.
@@ -583,6 +583,25 @@ function getAllNodes() {
583
583
  // - {branch-id}-{passthrough-id} (same type as input)
584
584
  outputs: [],
585
585
  },
586
+ {
587
+ type: "branch",
588
+ label: "Branch",
589
+ description: "Route inputs based on a key match",
590
+ category: "Control Flow",
591
+ nodeCategory: "generator",
592
+ // Static input: key (text) to match against branch keys
593
+ // Dynamic inputs based on branchConfig.passthroughInputs where isVariable is true
594
+ inputs: [
595
+ {
596
+ id: "key",
597
+ type: "text",
598
+ required: true,
599
+ },
600
+ ],
601
+ // Dynamic outputs: for each passthrough input and branch, creates:
602
+ // - {branch-key}-{passthrough-id} (same type as input)
603
+ outputs: [],
604
+ },
586
605
  // === Terminal nodes ===
587
606
  {
588
607
  type: "auto-post",
package/dist/types.d.ts CHANGED
@@ -846,7 +846,7 @@ export interface NodeControlConfig {
846
846
  */
847
847
  isInitializer?: boolean;
848
848
  }
849
- export type NodeTypeEnum = 'social-audio' | 'text' | 'media' | 'video-import' | 'image-composer' | 'video-composer' | 'generate-image' | 'generate-video' | 'custom-model' | 'llm' | 'output' | 'manual-trigger' | 'recurrence' | 'compose-workflow' | 'account' | 'auto-post' | 'save-to-media' | 'deduplicate' | 'for-each' | 'random' | 'random-route' | 'if' | 'not' | 'transcript' | 'auto-caption' | 'screenshot-animation' | 'create-dm';
849
+ export type NodeTypeEnum = 'social-audio' | 'text' | 'media' | 'video-import' | 'image-composer' | 'video-composer' | 'generate-image' | 'generate-video' | 'custom-model' | 'llm' | 'output' | 'manual-trigger' | 'recurrence' | 'compose-workflow' | 'account' | 'auto-post' | 'save-to-media' | 'deduplicate' | 'for-each' | 'random' | 'random-route' | 'branch' | 'if' | 'not' | 'transcript' | 'auto-caption' | 'screenshot-animation' | 'create-dm';
850
850
  export interface OutputSchemaProperty {
851
851
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
852
852
  items?: 'string' | 'number' | 'boolean';
@@ -872,6 +872,8 @@ export interface LLMOutputField {
872
872
  minLength?: number;
873
873
  /** Maximum array length constraint */
874
874
  maxLength?: number;
875
+ /** Whether this output is optional (can be omitted by the LLM) */
876
+ optional?: boolean;
875
877
  }
876
878
  /**
877
879
  * API Keys configuration for LLM providers (user can bring their own)
@@ -964,6 +966,7 @@ export interface WorkflowNodeDefinition {
964
966
  randomConfig?: RandomNodeConfig;
965
967
  ifConfig?: IfNodeConfig;
966
968
  randomRouteConfig?: RandomRouteNodeConfig;
969
+ branchConfig?: BranchNodeConfig;
967
970
  autoCaptionConfig?: AutoCaptionNodeConfig;
968
971
  screenshotAnimationConfig?: ScreenshotAnimationNodeConfig;
969
972
  createDmConfig?: CreateDmNodeConfig;
@@ -1360,6 +1363,41 @@ export interface RandomRouteNodeConfig {
1360
1363
  /** Passthrough inputs that get routed to one branch's outputs */
1361
1364
  passthroughInputs: RandomRoutePassthroughInput[];
1362
1365
  }
1366
+ /**
1367
+ * Branch node branch definition
1368
+ */
1369
+ export interface BranchDefinition {
1370
+ /** The key to match against (e.g., "happy", "sad", "neutral") */
1371
+ key: string;
1372
+ }
1373
+ /**
1374
+ * Branch node passthrough input definition
1375
+ */
1376
+ export interface BranchPassthroughInput {
1377
+ /** The input port ID (lowercase, hyphens/underscores only) */
1378
+ id: string;
1379
+ /** The value type */
1380
+ type: 'image' | 'video' | 'audio' | 'text' | 'number' | 'boolean' | 'account' | 'object';
1381
+ /** Whether this is an array type */
1382
+ isArray?: boolean;
1383
+ /** Whether this input comes from a variable (input port) vs static branch values. Defaults to false. */
1384
+ isVariable?: boolean;
1385
+ /** Static values per branch when isVariable is false. Key is branch key, value is the static value. */
1386
+ branchValues?: Record<string, unknown>;
1387
+ /** Object schema for object type (when type is 'object') */
1388
+ objectSchema?: RandomRouteObjectField[];
1389
+ }
1390
+ /**
1391
+ * Branch node configuration - routes inputs to a branch based on key match
1392
+ */
1393
+ export interface BranchNodeConfig {
1394
+ /** Output branches with keys to match against */
1395
+ branches: BranchDefinition[];
1396
+ /** Passthrough inputs that get routed to the matched branch's outputs */
1397
+ passthroughInputs: BranchPassthroughInput[];
1398
+ /** Optional default branch key if no match is found */
1399
+ defaultBranchKey?: string;
1400
+ }
1363
1401
  /**
1364
1402
  * Supported platforms for video import
1365
1403
  * Note: YouTube is not yet implemented
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "3.56.0",
3
+ "version": "3.58.0",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",