ugcinc 4.13.0 → 4.14.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/README.md CHANGED
@@ -93,6 +93,28 @@ do {
93
93
  } while (cursor);
94
94
  ```
95
95
 
96
+ For interactive tables, `posts.getPostsPage()` keeps filtering and sorting on the server and
97
+ returns page-scoped latest stats plus `totalCount`, organization-wide `postTags`,
98
+ `anyHasTitle`, and `matchingAccountIds`. It supports caption/title/account search; platform,
99
+ post type, status, account, account-tag, post-tag, social-audio, and phone-type filters; and
100
+ sorting by account, status, title, caption, tag, audio presence, scheduled time, or engagement:
101
+
102
+ ```typescript
103
+ const page = await client.posts.getPostsPage({
104
+ search: "launch",
105
+ statuses: ["complete"],
106
+ postTags: ["fall-campaign"],
107
+ sortBy: "views",
108
+ sortDirection: "desc",
109
+ limit: 200,
110
+ });
111
+
112
+ if (page.ok) {
113
+ console.log(page.data.posts, page.data.stats, page.data.totalCount);
114
+ const next = page.data.nextCursor;
115
+ }
116
+ ```
117
+
96
118
  ## Caption Overlays
97
119
 
98
120
  Video posts can carry text overlays to display on the video. Pass `captionOverlays` to
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, AccountStatus, AccountStat, AccountTask, QuarantineAccountParams, ReleaseAccountParams, QuarantineAccountResponse, 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, CaptionOverlay, GetPostsParams, CreateDraftParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, UpdatePostParams, DeletePostsParams, DeletePostsResponse, RetryPostsParams, SetPostStatusParams, SetPostStatusResponse, PreviewScheduleEntry, PreviewScheduleParams, PreviewScheduleResult, } from './posts';
30
+ export type { PostType, PostStatus, Post, PostStat, CaptionOverlay, GetPostsParams, GetPostsPageParams, PostsPage, PostSortField, PostSortDirection, CreateDraftParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, UpdatePostParams, DeletePostsParams, DeletePostsResponse, RetryPostsParams, SetPostStatusParams, SetPostStatusResponse, PreviewScheduleEntry, PreviewScheduleParams, PreviewScheduleResult, } from './posts';
31
31
  export type { RefreshStatsParams, RefreshStatsError, RefreshStatsResponse, RefreshStatsProgressResponse, 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, PfpSearchParams, PfpSearchResponse, PfpCandidate, GetUploadTokenParams, UploadTokenResponse, } from './media';
package/dist/posts.d.ts CHANGED
@@ -64,6 +64,37 @@ export interface GetPostsParams {
64
64
  limit?: number;
65
65
  /** Opaque cursor from a previous response's `nextCursor`, to fetch the next page. */
66
66
  cursor?: string;
67
+ /** Case-insensitive substring search across caption, title, and account username. */
68
+ search?: string;
69
+ platform?: 'tiktok' | 'instagram';
70
+ postType?: PostType;
71
+ statuses?: PostStatus[];
72
+ /** Match any comma-separated tag on the post's account. */
73
+ accountTags?: string[];
74
+ /** Match any comma-separated tag stored on the post. */
75
+ postTags?: string[];
76
+ socialAudioIds?: string[];
77
+ phoneTypes?: Array<'physical_iphone' | 'manual_iphone' | 'physical_android' | 'emulated_android' | 'social_api' | 'custom_provider' | 'tracking' | 'clipper'>;
78
+ sortBy?: PostSortField;
79
+ sortDirection?: PostSortDirection;
80
+ }
81
+ export type PostSortField = 'created' | 'account' | 'status' | 'title' | 'caption' | 'tag' | 'audio' | 'time' | 'views' | 'likes' | 'comments' | 'shares';
82
+ export type PostSortDirection = 'asc' | 'desc';
83
+ export interface GetPostsPageParams extends GetPostsParams {
84
+ /** Page size. Defaults to 200 and is capped at 500. */
85
+ limit?: number;
86
+ }
87
+ export interface PostsPage {
88
+ posts: Post[];
89
+ /** Latest stats only for posts in this page. */
90
+ stats: PostStat[];
91
+ totalCount: number;
92
+ /** Distinct comma-split post tags across the organization. */
93
+ postTags: string[];
94
+ anyHasTitle: boolean;
95
+ /** Accounts with a match when `accountIds` is ignored and all other filters remain active. */
96
+ matchingAccountIds: string[];
97
+ nextCursor: string | null;
67
98
  }
68
99
  export interface CreateSlideshowParams {
69
100
  accountId: string | null;
@@ -179,6 +210,11 @@ export declare class PostsClient extends BaseClient {
179
210
  * passed back as `cursor` to fetch the next page, ordered newest-first.
180
211
  */
181
212
  getPosts(params?: GetPostsParams): Promise<ApiResponse<Post[]>>;
213
+ /**
214
+ * Get one server-filtered/sorted page plus table metadata and page-scoped stats.
215
+ * Unlike getPosts(), this method never falls back to an unbounded response.
216
+ */
217
+ getPostsPage(params?: GetPostsPageParams): Promise<ApiResponse<PostsPage>>;
182
218
  /**
183
219
  * Create a draft post without assigning it to an account
184
220
  *
package/dist/posts.js CHANGED
@@ -15,6 +15,13 @@ class PostsClient extends base_1.BaseClient {
15
15
  async getPosts(params) {
16
16
  return this.post('/post', params ?? {});
17
17
  }
18
+ /**
19
+ * Get one server-filtered/sorted page plus table metadata and page-scoped stats.
20
+ * Unlike getPosts(), this method never falls back to an unbounded response.
21
+ */
22
+ async getPostsPage(params = {}) {
23
+ return this.post('/post', { ...params, includePageMeta: true });
24
+ }
18
25
  /**
19
26
  * Create a draft post without assigning it to an account
20
27
  *
@@ -399,10 +399,10 @@ export declare const iMessageDmPropsSchema: z.ZodObject<{
399
399
  dynamicCrop: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
400
400
  cropVerticalCenter: z.ZodOptional<z.ZodBoolean>;
401
401
  }, "strip", z.ZodTypeAny, {
402
+ time?: string | undefined;
402
403
  backgroundColor?: string | undefined;
403
404
  lightMode?: boolean | undefined;
404
405
  username?: string | undefined;
405
- time?: string | undefined;
406
406
  profilePicUrl?: string | undefined;
407
407
  messages?: {
408
408
  text: string;
@@ -582,10 +582,10 @@ export declare const iMessageDmPropsSchema: z.ZodObject<{
582
582
  readReceiptLeft?: number | undefined;
583
583
  readReceiptRight?: number | undefined;
584
584
  }, {
585
+ time?: string | undefined;
585
586
  backgroundColor?: string | undefined;
586
587
  lightMode?: boolean | undefined;
587
588
  username?: string | undefined;
588
- time?: string | undefined;
589
589
  profilePicUrl?: string | undefined;
590
590
  messages?: {
591
591
  text: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.13.0",
3
+ "version": "4.14.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",