ugcinc 3.70.0 → 3.73.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.
@@ -602,6 +602,29 @@ function getAllNodes() {
602
602
  // - {branch-key}-{passthrough-id} (same type as input)
603
603
  outputs: [],
604
604
  },
605
+ {
606
+ type: "collect",
607
+ label: "Collect",
608
+ description: "Collect outputs from a for-each loop into an array",
609
+ category: "Control Flow",
610
+ nodeCategory: "generator",
611
+ // Input accepts any type from inside the loop
612
+ inputs: [
613
+ {
614
+ id: "value",
615
+ type: ["image", "video", "audio", "text", "object", "boolean", "number"],
616
+ required: true,
617
+ },
618
+ ],
619
+ // Output is an array of the input type
620
+ outputs: [
621
+ {
622
+ id: "array",
623
+ type: ["image[]", "video[]", "audio[]", "text[]", "object[]"],
624
+ required: true,
625
+ },
626
+ ],
627
+ },
605
628
  // === Terminal nodes ===
606
629
  {
607
630
  type: "auto-post",
@@ -682,7 +705,14 @@ function llmTypeToSchemaType(type) {
682
705
  function llmObjectSchemaToPropertySchema(fields) {
683
706
  const result = {};
684
707
  for (const field of fields) {
685
- if (field.type === 'array' && field.items === 'object' && field.objectSchema) {
708
+ if (field.type === 'object' && field.objectSchema) {
709
+ // Top-level object with nested schema
710
+ result[field.name] = {
711
+ type: 'object',
712
+ itemSchema: llmObjectSchemaToPropertySchema(field.objectSchema),
713
+ };
714
+ }
715
+ else if (field.type === 'array' && field.items === 'object' && field.objectSchema) {
686
716
  // Nested array of objects
687
717
  result[field.name] = {
688
718
  type: 'object',
@@ -733,6 +763,11 @@ function getOutputSchema(nodeType, nodeConfig, outputPortId) {
733
763
  const outputFields = llmConfig?.outputFields;
734
764
  if (outputFields) {
735
765
  const field = outputFields.find(f => f.name === outputPortId);
766
+ // Handle top-level object type
767
+ if (field?.type === 'object' && field.objectSchema) {
768
+ return llmObjectSchemaToPropertySchema(field.objectSchema);
769
+ }
770
+ // Handle array of objects
736
771
  if (field?.type === 'array' && field.items === 'object' && field.objectSchema) {
737
772
  return llmObjectSchemaToPropertySchema(field.objectSchema);
738
773
  }
package/dist/index.d.ts CHANGED
@@ -18,4 +18,4 @@ export { MediaClient } from './media';
18
18
  export { CommentsClient } from './comments';
19
19
  export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitInstagramDmRenderJobParams, SubmitIMessageDmRenderJobParams, IgDmMessage, ImDmMessage, RenderVideoEditorConfig, } from './render';
20
20
  export type { ClientConfig, } from './base';
21
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStatus, PostStat, ApiKey, EditorConfig, VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, TimeMode, SegmentTimelinePosition, ImageEditorNodeConfig, ImageEditorElement, ImageEditorNodeInput, ImageEditorNodeOutput, DimensionPresetKey, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, ResolvedPorts, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, TemplateNode, AutomationTemplate, AutomationRun, NodeRun, ExecutorNode, ExecutionEdge, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, NodeOutputValues, OutputInput, OutputNodeConfig, ManualTriggerOutput, ManualTriggerNodeConfig, TriggerIterationMode, IterationExhaustionBehavior, CollectionSelectionMode, TriggerCollectionConfig, DayOfWeek, RecurrenceMediaOutput, RecurrenceMediaConfig, RecurrenceNodeConfig, AccountNodeConfig, MediaNodeEnabledType, RecurrenceMediaEnabledType, MediaNodeOutput, MediaNodeConfig, PostSchedulingMode, PostSchedulingConfig, AutoPostMode, AutoPostInputType, AutoPostInput, AutoPostNodeConfig, SaveToMediaInput, SaveToMediaNodeConfig, DeduplicateNodeConfig, ForEachOutputProperty, ForEachInputPort, ForEachNodeConfig, RandomValueType, RandomInputPort, RandomNodeMode, RandomNodeConfig, IfLogicOperator, IfBooleanInput, IfPassthroughInput, IfNodeConfig, RandomRouteBranch, RandomRoutePassthroughInput, RandomRouteObjectField, RandomRouteNodeConfig, BranchDefinition, BranchValueConfig, BranchPassthroughInput, BranchNodeConfig, VideoImportPlatform, VideoImportQuality, VideoImportNodeConfig, AutoCaptionPreset, AutoCaptionFontWeight, AutoCaptionPosition, AutoCaptionNodeConfig, ScreenshotAnimationNodeConfig, CreateDmMessage, CreateDmNodeConfig, VideoGenerationNodeConfig, ArrayType, PortType, LLMOutputField, LLMNodeConfig, UserMedia, SocialAudio, Media, MediaUse, GetMediaParams, CreateSocialAudioParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, Comment, CommentStatus, CreateCommentParams, CreateCommentResponse, GetCommentsParams, ValidationErrorType, ValidationError, ExportedNode, ExportedConnection, ExportedTemplate, AutomationExport, ExportedExecutor, ExportedEdge, ExportedRun, AutomationRunExport, } from './types';
21
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStatus, PostStat, ApiKey, EditorConfig, VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, TimeMode, SegmentTimelinePosition, ImageEditorNodeConfig, ImageEditorElement, ImageEditorNodeInput, ImageEditorNodeOutput, DimensionPresetKey, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, ResolvedPorts, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, TemplateNode, AutomationTemplate, AutomationRun, NodeRun, ExecutorNode, ExecutionEdge, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, NodeOutputValues, OutputInput, OutputNodeConfig, ObjectSchemaField, ManualTriggerOutput, ManualTriggerNodeConfig, TriggerIterationMode, IterationExhaustionBehavior, CollectionSelectionMode, TriggerCollectionConfig, DayOfWeek, RecurrenceMediaOutput, RecurrenceMediaConfig, RecurrenceNodeConfig, AccountNodeConfig, MediaNodeEnabledType, RecurrenceMediaEnabledType, MediaNodeOutput, MediaNodeConfig, PostSchedulingMode, PostSchedulingConfig, AutoPostMode, AutoPostInputType, AutoPostInput, AutoPostNodeConfig, SaveToMediaInput, SaveToMediaNodeConfig, DeduplicateNodeConfig, ForEachOutputProperty, ForEachInputPort, ForEachNodeConfig, RandomValueType, RandomInputPort, RandomNodeMode, RandomNodeConfig, IfLogicOperator, IfBooleanInput, IfPassthroughInput, IfNodeConfig, RandomRouteBranch, RandomRoutePassthroughInput, RandomRouteObjectField, RandomRouteNodeConfig, BranchDefinition, BranchValueConfig, BranchPassthroughInput, BranchNodeConfig, VideoImportPlatform, VideoImportQuality, VideoImportNodeConfig, AutoCaptionPreset, AutoCaptionFontWeight, AutoCaptionPosition, AutoCaptionNodeConfig, ScreenshotAnimationNodeConfig, CreateDmMessage, CreateDmNodeConfig, VideoGenerationNodeConfig, ArrayType, PortType, LLMOutputField, LLMNodeConfig, UserMedia, SocialAudio, Media, MediaUse, GetMediaParams, CreateSocialAudioParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, Comment, CommentStatus, CreateCommentParams, CreateCommentResponse, GetCommentsParams, ValidationErrorType, ValidationError, ExportedNode, ExportedConnection, ExportedTemplate, AutomationExport, ExportedExecutor, ExportedEdge, ExportedRun, AutomationRunExport, } from './types';
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' | 'branch' | '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' | 'collect';
850
850
  export interface OutputSchemaProperty {
851
851
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
852
852
  items?: 'string' | 'number' | 'boolean';
@@ -860,11 +860,11 @@ export interface LLMOutputField {
860
860
  name: string;
861
861
  /** Optional - guides LLM on expected content */
862
862
  description?: string;
863
- /** Output type */
864
- type: 'string' | 'number' | 'boolean' | 'array';
863
+ /** Output type (includes 'object' for top-level objects) */
864
+ type: 'string' | 'number' | 'boolean' | 'array' | 'object';
865
865
  /** For array types - the item type (including 'object' for arrays of objects) */
866
866
  items?: 'string' | 'number' | 'boolean' | 'object';
867
- /** For array of objects - nested field definitions (max 3 levels of nesting) */
867
+ /** For array of objects or top-level objects - nested field definitions (max 3 levels of nesting) */
868
868
  objectSchema?: LLMOutputField[];
869
869
  /** Exact array length constraint */
870
870
  length?: number;
@@ -970,6 +970,7 @@ export interface WorkflowNodeDefinition {
970
970
  autoCaptionConfig?: AutoCaptionNodeConfig;
971
971
  screenshotAnimationConfig?: ScreenshotAnimationNodeConfig;
972
972
  createDmConfig?: CreateDmNodeConfig;
973
+ collectConfig?: CollectNodeConfig;
973
974
  };
974
975
  }
975
976
  export interface OutputInput {
@@ -982,13 +983,25 @@ export interface OutputInput {
982
983
  export interface OutputNodeConfig {
983
984
  inputs: OutputInput[];
984
985
  }
986
+ /**
987
+ * Object schema field definition for manual trigger object outputs
988
+ * Simplified version without array/length constraints
989
+ */
990
+ export interface ObjectSchemaField {
991
+ name: string;
992
+ type: 'string' | 'number' | 'boolean' | 'object';
993
+ /** For nested objects - nested field definitions (max 3 levels of nesting) */
994
+ objectSchema?: ObjectSchemaField[];
995
+ }
985
996
  /**
986
997
  * Manual Trigger node output definition
987
998
  */
988
999
  export interface ManualTriggerOutput {
989
1000
  id: string;
990
- type: 'image' | 'video' | 'audio' | 'text' | 'social_audio' | 'account' | 'boolean';
1001
+ type: 'image' | 'video' | 'audio' | 'text' | 'social_audio' | 'account' | 'boolean' | 'object';
991
1002
  isArray?: boolean;
1003
+ /** Schema for object types - describes the structure of the object */
1004
+ objectSchema?: ObjectSchemaField[];
992
1005
  }
993
1006
  /**
994
1007
  * Iteration mode for trigger nodes with account iteration
@@ -1542,6 +1555,16 @@ export interface CreateDmNodeConfig {
1542
1555
  userHasStory: boolean;
1543
1556
  };
1544
1557
  }
1558
+ /**
1559
+ * Collect node configuration - collects outputs from for-each loop into an array
1560
+ * Note: Most config is set during expansion, not by user
1561
+ */
1562
+ export interface CollectNodeConfig {
1563
+ /** Expected number of items to collect (set during for-each expansion) */
1564
+ expectedCount?: number;
1565
+ /** Template ID of the for-each loop this collects from (for validation) */
1566
+ forEachTemplateId?: string;
1567
+ }
1545
1568
  /**
1546
1569
  * Video Generation Model IDs
1547
1570
  * Text-to-video models take just a prompt, image-to-video models require an image input
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "3.70.0",
3
+ "version": "3.73.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",