ugcinc 2.49.0 → 2.50.1

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.
@@ -75,6 +75,14 @@ export declare class AutomationsClient extends BaseClient {
75
75
  valid: boolean;
76
76
  errors: string[];
77
77
  }>>;
78
+ /**
79
+ * Submit a client-rendered image for a node awaiting client render
80
+ * This is called by the webapp when the browser finishes rendering an image editor node
81
+ */
82
+ submitClientRender(params: {
83
+ nodeRunId: string;
84
+ imageUrl: string;
85
+ }): Promise<ApiResponse<null>>;
78
86
  }
79
87
  /**
80
88
  * Get all available automation nodes
@@ -82,6 +82,16 @@ class AutomationsClient extends base_1.BaseClient {
82
82
  body: JSON.stringify(params),
83
83
  });
84
84
  }
85
+ /**
86
+ * Submit a client-rendered image for a node awaiting client render
87
+ * This is called by the webapp when the browser finishes rendering an image editor node
88
+ */
89
+ async submitClientRender(params) {
90
+ return this.request('/automations/submit-client-render', {
91
+ method: 'POST',
92
+ body: JSON.stringify(params),
93
+ });
94
+ }
85
95
  }
86
96
  exports.AutomationsClient = AutomationsClient;
87
97
  /**
package/dist/index.d.ts CHANGED
@@ -13,4 +13,4 @@ export { RenderClient } from './render';
13
13
  export { AutomationsClient, getAllNodes, getNodeByType } from './automations';
14
14
  export { MediaClient } from './media';
15
15
  export type { ClientConfig, } from './base';
16
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, RenderJobSubmit, RenderVideoRequest, RenderImageRequest, RenderJobResponse, RenderJobStatus, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, OutputInput, OutputNodeConfig, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, } from './types';
16
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, RenderJobSubmit, RenderVideoRequest, RenderImageRequest, RenderJobResponse, RenderJobStatus, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, OutputInput, OutputNodeConfig, ClientRenderElement, ClientRenderInputs, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, } from './types';
package/dist/types.d.ts CHANGED
@@ -373,6 +373,8 @@ export interface ImageEditorConfig extends BaseEditorConfig {
373
373
  segments: StaticSegment[];
374
374
  }>;
375
375
  dynamicCrop?: DynamicCropConfig;
376
+ /** When true, rendering is done client-side in the browser for exact WYSIWYG match */
377
+ clientSideRender?: boolean;
376
378
  }
377
379
  export interface EditorConfig extends BaseEditorConfig {
378
380
  channels: Array<{
@@ -837,12 +839,60 @@ export interface NodeRun {
837
839
  automation_run_id: string;
838
840
  template_node_id: string;
839
841
  type: NodeTypeEnum;
840
- status: 'pending' | 'running' | 'completed' | 'failed';
842
+ status: 'pending' | 'running' | 'completed' | 'failed' | 'awaiting_client_render';
841
843
  input_data: Record<string, unknown> | null;
842
844
  output_data: Record<string, unknown> | null;
843
845
  created_at: string;
844
846
  completed_at: string | null;
845
847
  }
848
+ /**
849
+ * Client-side render element for image editor
850
+ * Contains all resolved properties needed for browser-based rendering
851
+ */
852
+ export interface ClientRenderElement {
853
+ id: string;
854
+ type: 'text' | 'image';
855
+ x: number;
856
+ y: number;
857
+ width: number;
858
+ height: number;
859
+ zIndex: number;
860
+ rotation?: number;
861
+ text?: string;
862
+ color?: string;
863
+ font?: 'tiktok' | 'apple' | 'arial';
864
+ fontSize?: number;
865
+ fontWeight?: 'normal' | 'bold';
866
+ lineHeight?: number;
867
+ letterSpacing?: number;
868
+ textAlign?: 'left' | 'center' | 'right';
869
+ verticalAlign?: 'top' | 'middle' | 'bottom';
870
+ outlineWidth?: number;
871
+ strokeColor?: string;
872
+ backgroundColor?: string;
873
+ backgroundOpacity?: number;
874
+ backgroundBorderRadius?: BorderRadiusConfig;
875
+ paddingTop?: number;
876
+ paddingRight?: number;
877
+ paddingBottom?: number;
878
+ paddingLeft?: number;
879
+ autoWidth?: boolean;
880
+ boxAlign?: 'left' | 'center' | 'right';
881
+ imageUrl?: string;
882
+ fit?: 'cover' | 'contain' | 'fill';
883
+ opacity?: number;
884
+ borderRadius?: number | BorderRadiusConfig;
885
+ }
886
+ /**
887
+ * Client-side render inputs - stored in node_run.output_data when awaiting_client_render
888
+ */
889
+ export interface ClientRenderInputs {
890
+ width: number;
891
+ height: number;
892
+ backgroundUrl?: string;
893
+ backgroundFit?: 'cover' | 'contain' | 'fill';
894
+ elements: ClientRenderElement[];
895
+ }
846
896
  /**
847
897
  * Media types
848
898
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.49.0",
3
+ "version": "2.50.1",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",