ugcinc 4.5.75 → 4.5.77

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/index.d.ts CHANGED
@@ -27,7 +27,7 @@ export type { InputType } from './automations/nodes/types';
27
27
  export type { ClientConfig } from './base';
28
28
  export type { Account, AccountStat, AccountTask, EditProfileInfo, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, AccountInfoUpdate, UpdateAccountInfoParams, AccountInfoUpdateResult, UpdateAccountInfoResponse, AccountSocialUpdate, UpdateAccountSocialParams, AccountSocialUpdateResult, UpdateAccountSocialResponse, DeleteAccountPostsParams, DeleteAccountPostsResponse, ResetWarmupParams, ResetWarmupResponse, NicheSwitchUpdate, NicheSwitchParams, NicheSwitchResult, NicheSwitchResponse, CreateAccountInput, CreateAccountsParams, CreateAccountResult, CreateAccountsResponse, TroubleshootFailReason, TroubleshootAccount, TroubleshootParams, } from './accounts';
29
29
  export type { TaskType, Task, GetTasksParams } from './tasks';
30
- export type { PostType, PostStatus, Post, PostStat, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, UpdatePostParams, DeletePostsParams, DeletePostsResponse, RetryPostsParams, SetPostStatusParams, SetPostStatusResponse, PreviewScheduleEntry, PreviewScheduleParams, PreviewScheduleResult, } from './posts';
30
+ export type { PostType, PostStatus, Post, PostStat, GetPostsParams, CreateDraftParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, UpdatePostParams, DeletePostsParams, DeletePostsResponse, RetryPostsParams, SetPostStatusParams, SetPostStatusResponse, PreviewScheduleEntry, PreviewScheduleParams, PreviewScheduleResult, } from './posts';
31
31
  export type { RefreshStatsParams, RefreshStatsError, RefreshStatsResponse, RefreshStartEvent, RefreshProgressEvent, RefreshDoneEvent, RefreshStreamEvent, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyAccountStat, GetDailyAccountStatsParams, DailyPostStat, GetDailyPostStatsParams, DashboardDailyStat, GetDashboardDailyStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, } from './stats';
32
32
  export type { Org, ApiKey, DeleteApiKeyParams, EditApiKeyParams, IntegrationKey, IntegrationProvider, UpsertIntegrationKeyParams, DeleteIntegrationKeyParams } from './org';
33
33
  export type { UserMedia, MediaUse, SocialAudio, Media, GetMediaParams, GetSocialAudioParams, UploadMediaParams, UploadMediaResponse, MediaTagUpdate, UpdateMediaTagsParams, MediaTagUpdateResult, UpdateMediaTagsResponse, UpdateMediaTagParams, UpdateMediaNameParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, ImportTextParams, ImportTextResponse, CreateMediaFromUrlParams, GetMediaUseParams, GetMediaUseResponse, FilterMediaParams, FilterMediaResponse, GetUploadTokenParams, UploadTokenResponse, } from './media';
package/dist/posts.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { BaseClient } from './base';
2
2
  import type { ApiResponse } from './types';
3
3
  export type PostType = 'video' | 'slideshow';
4
- export type PostStatus = 'scheduled' | 'pending' | 'complete' | 'failed' | 'retrying' | 'deleting' | 'deleted' | 'hidden' | 'require-approval';
4
+ export type PostStatus = 'draft' | 'scheduled' | 'pending' | 'complete' | 'failed' | 'retrying' | 'deleting' | 'deleted' | 'hidden' | 'require-approval';
5
5
  export interface Post {
6
6
  id: string;
7
- account_id: string;
7
+ account_id: string | null;
8
8
  type: PostType;
9
9
  status: PostStatus;
10
10
  social_id: string | null;
@@ -102,6 +102,13 @@ export interface PreviewScheduleEntry {
102
102
  postTime: string;
103
103
  postId?: string;
104
104
  }
105
+ export interface CreateDraftParams {
106
+ type: 'video' | 'slideshow';
107
+ mediaUrls: string[];
108
+ caption?: string;
109
+ title?: string;
110
+ socialAudioId?: string;
111
+ }
105
112
  export interface PreviewScheduleParams {
106
113
  entries: PreviewScheduleEntry[];
107
114
  excludePostIds?: string[];
@@ -122,6 +129,13 @@ export declare class PostsClient extends BaseClient {
122
129
  * Get posts with optional filters
123
130
  */
124
131
  getPosts(params?: GetPostsParams): Promise<ApiResponse<Post[]>>;
132
+ /**
133
+ * Create a draft post without assigning it to an account
134
+ *
135
+ * Draft posts have no account or schedule. Use updatePost() to assign
136
+ * an account and schedule time, which transitions the draft to "scheduled" status.
137
+ */
138
+ createDraft(params: CreateDraftParams): Promise<ApiResponse<Post>>;
125
139
  /**
126
140
  * Create a slideshow post
127
141
  */
@@ -152,8 +166,9 @@ export declare class PostsClient extends BaseClient {
152
166
  /**
153
167
  * Update a post in place
154
168
  *
155
- * Only posts with status "scheduled" or "failed" can be updated.
169
+ * Only posts with status "draft", "scheduled", or "failed" can be updated.
156
170
  * If updating a failed post, it will be reset to "scheduled" status.
171
+ * If updating a draft post with both accountId and postTime, it transitions to "scheduled".
157
172
  * The post type (video/slideshow) cannot be changed.
158
173
  */
159
174
  updatePost(params: UpdatePostParams): Promise<ApiResponse<Post>>;
package/dist/posts.js CHANGED
@@ -12,6 +12,15 @@ class PostsClient extends base_1.BaseClient {
12
12
  async getPosts(params) {
13
13
  return this.post('/post', params ?? {});
14
14
  }
15
+ /**
16
+ * Create a draft post without assigning it to an account
17
+ *
18
+ * Draft posts have no account or schedule. Use updatePost() to assign
19
+ * an account and schedule time, which transitions the draft to "scheduled" status.
20
+ */
21
+ async createDraft(params) {
22
+ return this.post('/post/draft', params);
23
+ }
15
24
  /**
16
25
  * Create a slideshow post
17
26
  */
@@ -46,8 +55,9 @@ class PostsClient extends base_1.BaseClient {
46
55
  /**
47
56
  * Update a post in place
48
57
  *
49
- * Only posts with status "scheduled" or "failed" can be updated.
58
+ * Only posts with status "draft", "scheduled", or "failed" can be updated.
50
59
  * If updating a failed post, it will be reset to "scheduled" status.
60
+ * If updating a draft post with both accountId and postTime, it transitions to "scheduled".
51
61
  * The post type (video/slideshow) cannot be changed.
52
62
  */
53
63
  async updatePost(params) {
package/dist/render.js CHANGED
@@ -234,9 +234,9 @@ async function getRenderJobStatus(jobId) {
234
234
  if (data.status === 'error' || !response.ok) {
235
235
  return { ok: false, code: response.status, message: data.error ?? data.message ?? 'Failed to get job status' };
236
236
  }
237
- // Fallback to download endpoint if Modal didn't provide a URL
237
+ // If completed but no download_url, something went wrong — don't silently construct a broken fallback URL
238
238
  if (data.status === 'completed' && !data.download_url) {
239
- data.download_url = `${RENDER_BASE_URL}/download?job_id=${jobId}`;
239
+ return { ok: false, code: 500, message: `CRITICAL: Render job ${jobId} completed but has no download_url. This means the Vercel Blob upload failed silently.` };
240
240
  }
241
241
  return { ok: true, code: 200, message: "Job status retrieved", data };
242
242
  }
@@ -53,6 +53,20 @@ exports.postTools = [
53
53
  return client.posts.createSlideshow(params);
54
54
  },
55
55
  },
56
+ {
57
+ name: 'create_draft_post',
58
+ description: 'Create a draft post without assigning it to an account. Use update_post to assign an account and schedule time later.',
59
+ schema: zod_1.z.object({
60
+ type: zod_1.z.enum(['video', 'slideshow']).describe('Post type'),
61
+ mediaUrls: zod_1.z.array(zod_1.z.string()).describe('Array of media URLs'),
62
+ caption: zod_1.z.string().optional().describe('Post caption'),
63
+ title: zod_1.z.string().optional().describe('Slideshow title'),
64
+ socialAudioId: zod_1.z.string().optional().describe('Social audio ID'),
65
+ }),
66
+ execute: async (client, params) => {
67
+ return client.posts.createDraft(params);
68
+ },
69
+ },
56
70
  {
57
71
  name: 'get_post_status',
58
72
  description: 'Get the status of a specific post. Returns the post URL when complete.',
@@ -65,7 +79,7 @@ exports.postTools = [
65
79
  },
66
80
  {
67
81
  name: 'update_post',
68
- description: 'Update a scheduled or failed post. Only posts with status "scheduled" or "failed" can be updated. Failed posts are reset to "scheduled".',
82
+ description: 'Update a draft, scheduled, or failed post. Draft posts transition to "scheduled" when given both accountId and postTime. Failed posts are reset to "scheduled".',
69
83
  schema: zod_1.z.object({
70
84
  postId: zod_1.z.string().describe('Post ID to update'),
71
85
  caption: zod_1.z.string().optional().describe('New caption'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.5.75",
3
+ "version": "4.5.77",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",