ugcinc 4.12.0 → 4.14.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.
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/accounts.d.ts
CHANGED
|
@@ -96,6 +96,8 @@ export interface EditProfileInfo {
|
|
|
96
96
|
}
|
|
97
97
|
export interface GetAccountsParams {
|
|
98
98
|
tag?: string;
|
|
99
|
+
/** Platform filter: only accounts of this type are returned. */
|
|
100
|
+
type?: 'tiktok' | 'instagram';
|
|
99
101
|
org_group?: string;
|
|
100
102
|
user_group?: string;
|
|
101
103
|
status?: AccountStatus;
|
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/dist/tools/accounts.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.accountTools = [
|
|
|
8
8
|
description: 'List accounts with optional filters. Returns all accounts if no filters provided.',
|
|
9
9
|
schema: zod_1.z.object({
|
|
10
10
|
tag: zod_1.z.string().optional().describe('Filter by tag'),
|
|
11
|
+
type: zod_1.z.enum(['tiktok', 'instagram']).optional().describe('Filter by platform'),
|
|
11
12
|
org_group: zod_1.z.string().optional().describe('Filter by org group'),
|
|
12
13
|
user_group: zod_1.z.string().optional().describe('Filter by user group'),
|
|
13
14
|
status: zod_1.z.enum(['uninitialized', 'pending', 'initialized', 'setup', 'warming', 'warmed', 'needs_replacement', 'replacing', 'failed', 'deleted']).optional().describe('Filter by account status'),
|