ugcinc 2.48.0 → 2.50.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.
@@ -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/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<{
@@ -779,8 +781,12 @@ export interface WorkflowNodeDefinition {
779
781
  selectionConfig?: SelectionConfig;
780
782
  selectionState?: SelectionState;
781
783
  outputMode?: OutputMode;
782
- variableType?: 'image' | 'video' | 'audio' | 'text';
784
+ variableType?: 'image' | 'video' | 'audio' | 'text' | 'dropdown';
783
785
  defaultValue?: string;
786
+ dropdownOptions?: Array<{
787
+ label: string;
788
+ value: string;
789
+ }>;
784
790
  workflowTemplateId?: string;
785
791
  workflowVariableNameToIdMap?: Record<string, string>;
786
792
  workflowPassThrough?: Record<string, boolean>;
@@ -833,12 +839,60 @@ export interface NodeRun {
833
839
  automation_run_id: string;
834
840
  template_node_id: string;
835
841
  type: NodeTypeEnum;
836
- status: 'pending' | 'running' | 'completed' | 'failed';
842
+ status: 'pending' | 'running' | 'completed' | 'failed' | 'awaiting_client_render';
837
843
  input_data: Record<string, unknown> | null;
838
844
  output_data: Record<string, unknown> | null;
839
845
  created_at: string;
840
846
  completed_at: string | null;
841
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
+ }
842
896
  /**
843
897
  * Media types
844
898
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.48.0",
3
+ "version": "2.50.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",