ugcinc 2.72.0 → 2.73.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.
package/dist/base.js CHANGED
@@ -18,21 +18,17 @@ class BaseClient {
18
18
  }
19
19
  async request(endpoint, options = {}) {
20
20
  let url = `${this.baseUrl}${endpoint}`;
21
- // If orgId is provided, treat apiKey as admin key and add orgId as query param
21
+ // If orgId is provided, add it as query param to scope to that org
22
22
  if (this.orgId) {
23
23
  const separator = endpoint.includes('?') ? '&' : '?';
24
24
  url = `${url}${separator}orgId=${encodeURIComponent(this.orgId)}`;
25
25
  }
26
26
  const headers = {
27
27
  'Content-Type': 'application/json',
28
+ // Always use x-api-key header for admin authentication
29
+ // When orgId is provided, scopes to that org; when not provided, accesses all data
30
+ 'x-api-key': this.apiKey,
28
31
  };
29
- // Use admin key header if orgId is provided, otherwise use Bearer token
30
- if (this.orgId) {
31
- headers['x-api-key'] = this.apiKey;
32
- }
33
- else {
34
- headers['Authorization'] = `Bearer ${this.apiKey}`;
35
- }
36
32
  try {
37
33
  const response = await fetch(url, {
38
34
  ...options,
@@ -78,19 +74,16 @@ class BaseClient {
78
74
  }
79
75
  async postFormData(endpoint, formData) {
80
76
  let url = `${this.baseUrl}${endpoint}`;
81
- // If orgId is provided, treat apiKey as admin key and add orgId as query param
77
+ // If orgId is provided, add it as query param to scope to that org
82
78
  if (this.orgId) {
83
79
  const separator = endpoint.includes('?') ? '&' : '?';
84
80
  url = `${url}${separator}orgId=${encodeURIComponent(this.orgId)}`;
85
81
  }
86
- const headers = {};
87
- // Use admin key header if orgId is provided, otherwise use Bearer token
88
- if (this.orgId) {
89
- headers['x-api-key'] = this.apiKey;
90
- }
91
- else {
92
- headers['Authorization'] = `Bearer ${this.apiKey}`;
93
- }
82
+ const headers = {
83
+ // Always use x-api-key header for admin authentication
84
+ // When orgId is provided, scopes to that org; when not provided, accesses all data
85
+ 'x-api-key': this.apiKey,
86
+ };
94
87
  try {
95
88
  const response = await fetch(url, {
96
89
  method: 'POST',
package/dist/index.d.ts CHANGED
@@ -15,4 +15,4 @@ export { MediaClient } from './media';
15
15
  export { CommentsClient } from './comments';
16
16
  export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, RenderVideoEditorConfig, } from './render';
17
17
  export type { ClientConfig, } from './base';
18
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, 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, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, OutputInput, OutputNodeConfig, LLMOutputField, LLMNodeConfig, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, Comment, CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, GetCommentsParams, } from './types';
18
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, 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, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, TemplateNode, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, OutputInput, OutputNodeConfig, LLMOutputField, LLMNodeConfig, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, Comment, CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, GetCommentsParams, } from './types';
package/dist/types.d.ts CHANGED
@@ -836,17 +836,42 @@ export interface WorkflowDefinition {
836
836
  nodes: WorkflowNodeDefinition[];
837
837
  canvasState?: CanvasState;
838
838
  }
839
+ /**
840
+ * Template node as stored in the database
841
+ */
842
+ export interface TemplateNode {
843
+ id: string;
844
+ template_id: string;
845
+ node_id: string;
846
+ type: NodeTypeEnum;
847
+ name: string | null;
848
+ x: number;
849
+ y: number;
850
+ inputs: Record<string, {
851
+ sourceNodeId: string;
852
+ sourceOutputId: string;
853
+ }>;
854
+ config: WorkflowNodeDefinition['config'] | null;
855
+ cached_output: Record<string, unknown> | null;
856
+ cached_at: string | null;
857
+ cached_run_id: string | null;
858
+ cached_variable_inputs: Record<string, string> | null;
859
+ created_at: string;
860
+ updated_at: string;
861
+ }
839
862
  export interface AutomationTemplate {
840
863
  id: string;
841
864
  org_id: string;
842
865
  name: string;
843
866
  description: string | null;
844
- workflow_definition: WorkflowDefinition;
867
+ canvas_state: CanvasState | null;
868
+ nodes: TemplateNode[];
845
869
  preview_output: string | null;
846
870
  output_schema: Record<string, {
847
871
  type: string;
848
872
  }> | null;
849
873
  created_at: string;
874
+ updated_at: string;
850
875
  }
851
876
  export interface AutomationRun {
852
877
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.72.0",
3
+ "version": "2.73.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",