ugcinc 4.10.0 → 4.12.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 +19 -2
- package/dist/accounts.d.ts +42 -2
- package/dist/accounts.js +26 -0
- package/dist/index.d.ts +2 -2
- package/dist/media.d.ts +33 -0
- package/dist/media.js +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,9 +41,9 @@ if (res.ok) {
|
|
|
41
41
|
|
|
42
42
|
`UGCClient` groups the API into a few top-level namespaces:
|
|
43
43
|
|
|
44
|
-
- `client.accounts`: list, create, update, troubleshoot, and manage account lifecycle
|
|
44
|
+
- `client.accounts`: list, create, update, troubleshoot, quarantine/release, and manage account lifecycle
|
|
45
45
|
- `client.posts`: create video/slideshow posts, update them, retry failures, and preview schedule conflicts
|
|
46
|
-
- `client.media`: upload media, create media records, manage tags/names, and work with social audio
|
|
46
|
+
- `client.media`: upload media, create media records, search profile-picture candidates, manage tags/names, and work with social audio
|
|
47
47
|
- `client.stats`: fetch account/post analytics, daily aggregates, top performers, and refresh stats
|
|
48
48
|
- `client.org`: manage organizations, API keys, and integration keys
|
|
49
49
|
- `client.billing`: inspect subscription state and handle account deactivation, replacements, and refunds
|
|
@@ -109,6 +109,23 @@ await client.posts.createVideo({
|
|
|
109
109
|
});
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
## Pausing an Account
|
|
113
|
+
|
|
114
|
+
When a platform blocks an account — a human-verification prompt, a signed-out
|
|
115
|
+
session, content strikes — quarantine it so its scheduled posts stop failing
|
|
116
|
+
while the block is unresolved. Nothing is deleted: posts stay scheduled and
|
|
117
|
+
become eligible again on release, which restores the account's prior status.
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
await client.accounts.quarantine({
|
|
121
|
+
accountId,
|
|
122
|
+
reason: "Platform is asking the account to verify it is human",
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// once resolved
|
|
126
|
+
await client.accounts.release({ accountId });
|
|
127
|
+
```
|
|
128
|
+
|
|
112
129
|
## Post Tags
|
|
113
130
|
|
|
114
131
|
Posts carry an optional custom `tag` for categorization (independent of account tags). Set it with
|
package/dist/accounts.d.ts
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
2
|
import type { ApiResponse } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Lifecycle status of an account.
|
|
5
|
+
*
|
|
6
|
+
* `quarantined` means the account is paused and will not post — set when the
|
|
7
|
+
* platform has blocked it (human-verification prompt, signed-out session,
|
|
8
|
+
* content strikes) so its scheduled posts stop failing. Nothing is deleted;
|
|
9
|
+
* releasing restores the status the account held before.
|
|
10
|
+
*/
|
|
11
|
+
export type AccountStatus = 'uninitialized' | 'pending' | 'initialized' | 'setup' | 'warming' | 'warmed' | 'needs_replacement' | 'replacing' | 'pending_cancellation' | 'failed' | 'deleted' | 'reclaimed' | 'quarantined';
|
|
12
|
+
export interface QuarantineAccountParams {
|
|
13
|
+
accountId: string;
|
|
14
|
+
/** Why the account is being paused; recorded for whoever resolves it. */
|
|
15
|
+
reason: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ReleaseAccountParams {
|
|
18
|
+
accountId: string;
|
|
19
|
+
}
|
|
20
|
+
export interface QuarantineAccountResponse {
|
|
21
|
+
accountId: string;
|
|
22
|
+
status: AccountStatus;
|
|
23
|
+
reason?: string;
|
|
24
|
+
/** True when the account was already quarantined — the call is idempotent. */
|
|
25
|
+
alreadyQuarantined?: boolean;
|
|
26
|
+
released?: boolean;
|
|
27
|
+
}
|
|
3
28
|
export interface Account {
|
|
4
29
|
id: string;
|
|
5
30
|
org_id: string;
|
|
@@ -21,7 +46,7 @@ export interface Account {
|
|
|
21
46
|
niches: string | null;
|
|
22
47
|
age_range: string | null;
|
|
23
48
|
sex: string | null;
|
|
24
|
-
status:
|
|
49
|
+
status: AccountStatus;
|
|
25
50
|
phone_type: 'physical_iphone' | 'manual_iphone' | 'physical_android' | 'emulated_android' | 'social_api' | 'custom_provider' | 'tracking' | null;
|
|
26
51
|
approved: boolean;
|
|
27
52
|
replacement_count: number;
|
|
@@ -73,7 +98,7 @@ export interface GetAccountsParams {
|
|
|
73
98
|
tag?: string;
|
|
74
99
|
org_group?: string;
|
|
75
100
|
user_group?: string;
|
|
76
|
-
status?:
|
|
101
|
+
status?: AccountStatus;
|
|
77
102
|
/** Max rows to return. Omit to fetch all matching accounts (no pagination). */
|
|
78
103
|
limit?: number;
|
|
79
104
|
/** Opaque cursor from a previous response's `nextCursor`, to fetch the next page. */
|
|
@@ -319,6 +344,21 @@ export declare class AccountsClient extends BaseClient {
|
|
|
319
344
|
* If delete_activity is true, deletes all warmup tasks instead
|
|
320
345
|
*/
|
|
321
346
|
resetWarmup(params: ResetWarmupParams): Promise<ApiResponse<ResetWarmupResponse>>;
|
|
347
|
+
/**
|
|
348
|
+
* Pause an account so it stops posting
|
|
349
|
+
*
|
|
350
|
+
* Use when the platform has blocked the account — a human-verification
|
|
351
|
+
* prompt, a signed-out session, content strikes — so its scheduled posts
|
|
352
|
+
* stop failing until the block is cleared. Nothing is deleted and no post is
|
|
353
|
+
* lost: posts stay scheduled and become eligible again on release.
|
|
354
|
+
* Idempotent — repeating returns `alreadyQuarantined: true`.
|
|
355
|
+
*/
|
|
356
|
+
quarantine(params: QuarantineAccountParams): Promise<ApiResponse<QuarantineAccountResponse>>;
|
|
357
|
+
/**
|
|
358
|
+
* Return a quarantined account to posting rotation
|
|
359
|
+
* Restores the status the account held before it was quarantined
|
|
360
|
+
*/
|
|
361
|
+
release(params: ReleaseAccountParams): Promise<ApiResponse<QuarantineAccountResponse>>;
|
|
322
362
|
/**
|
|
323
363
|
* Create new account seats for your organization
|
|
324
364
|
* Updates your Stripe subscription billing accordingly
|
package/dist/accounts.js
CHANGED
|
@@ -100,6 +100,32 @@ class AccountsClient extends base_1.BaseClient {
|
|
|
100
100
|
async resetWarmup(params) {
|
|
101
101
|
return this.post('/accounts/reset-warmup', params);
|
|
102
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Pause an account so it stops posting
|
|
105
|
+
*
|
|
106
|
+
* Use when the platform has blocked the account — a human-verification
|
|
107
|
+
* prompt, a signed-out session, content strikes — so its scheduled posts
|
|
108
|
+
* stop failing until the block is cleared. Nothing is deleted and no post is
|
|
109
|
+
* lost: posts stay scheduled and become eligible again on release.
|
|
110
|
+
* Idempotent — repeating returns `alreadyQuarantined: true`.
|
|
111
|
+
*/
|
|
112
|
+
async quarantine(params) {
|
|
113
|
+
return this.post('/accounts/quarantine', {
|
|
114
|
+
accountId: params.accountId,
|
|
115
|
+
action: 'quarantine',
|
|
116
|
+
reason: params.reason,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Return a quarantined account to posting rotation
|
|
121
|
+
* Restores the status the account held before it was quarantined
|
|
122
|
+
*/
|
|
123
|
+
async release(params) {
|
|
124
|
+
return this.post('/accounts/quarantine', {
|
|
125
|
+
accountId: params.accountId,
|
|
126
|
+
action: 'release',
|
|
127
|
+
});
|
|
128
|
+
}
|
|
103
129
|
/**
|
|
104
130
|
* Create new account seats for your organization
|
|
105
131
|
* Updates your Stripe subscription billing accordingly
|
package/dist/index.d.ts
CHANGED
|
@@ -25,12 +25,12 @@ export type { PortId } from './port-id';
|
|
|
25
25
|
export { extractTemplateVariables, processTemplate, substituteVariables } from './automations/utils';
|
|
26
26
|
export type { InputType } from './automations/nodes/types';
|
|
27
27
|
export type { ClientConfig } from './base';
|
|
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';
|
|
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
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';
|
|
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
|
-
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';
|
|
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';
|
|
34
34
|
export type { CommentStatus, Comment, CreateCommentParams, CreateCommentResponse, GetCommentsParams, } from './comments';
|
|
35
35
|
export type { BillingInfo, PortalUrlResponse, CancelAccountParams, CancelAccountResponse, ReactivateAccountParams, ReactivateAccountResponse, CancelSubscriptionResponse, RequestReplacementParams, RequestReplacementResponse, RequestRefundParams, RequestRefundResponse, BillingRequestInfo, PortalParams, } from './billing';
|
|
36
36
|
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitAutoCaptionRenderJobParams, SubmitSceneSplitJobParams, SceneSplitDetectorConfig, SubmitInstagramDmRenderJobParams, SubmitIMessageDmRenderJobParams, IgDmMessage, ImDmMessage, RenderVideoEditorConfig, } from './render';
|
package/dist/media.d.ts
CHANGED
|
@@ -131,6 +131,25 @@ export interface FilterMediaResponse {
|
|
|
131
131
|
used_count: number;
|
|
132
132
|
available_count: number;
|
|
133
133
|
}
|
|
134
|
+
export interface PfpSearchParams {
|
|
135
|
+
/** What to search for, e.g. "black girl selfie" or "asian woman aesthetic". */
|
|
136
|
+
search_term: string;
|
|
137
|
+
/** How many pictures to return. Defaults to 12, capped at 40. */
|
|
138
|
+
count?: number;
|
|
139
|
+
}
|
|
140
|
+
export interface PfpCandidate {
|
|
141
|
+
/** Stable id for this picture at the source. */
|
|
142
|
+
source_id: string;
|
|
143
|
+
/** Full-resolution image — the one an account's avatar is set to. */
|
|
144
|
+
url: string;
|
|
145
|
+
/** Smaller variant, for rendering a grid of options. */
|
|
146
|
+
preview_url: string;
|
|
147
|
+
}
|
|
148
|
+
export interface PfpSearchResponse {
|
|
149
|
+
pictures: PfpCandidate[];
|
|
150
|
+
search_term: string;
|
|
151
|
+
count: number;
|
|
152
|
+
}
|
|
134
153
|
export interface GetUploadTokenParams {
|
|
135
154
|
filename: string;
|
|
136
155
|
contentType?: string;
|
|
@@ -212,4 +231,18 @@ export declare class MediaClient extends BaseClient {
|
|
|
212
231
|
* @param params.name - Use case identifier (e.g., "profile_picture")
|
|
213
232
|
*/
|
|
214
233
|
filter(params: FilterMediaParams): Promise<ApiResponse<FilterMediaResponse>>;
|
|
234
|
+
/**
|
|
235
|
+
* Search for profile-picture candidates for a search term.
|
|
236
|
+
*
|
|
237
|
+
* Pictures already in use as a profile picture are removed before the result
|
|
238
|
+
* comes back, so two accounts cannot end up wearing the same face. Sourcing
|
|
239
|
+
* and filtering are one call for that reason — a caller who forgot the second
|
|
240
|
+
* step would get duplicates across their accounts and find out much later.
|
|
241
|
+
*
|
|
242
|
+
* Requires the `media:search` scope on a restricted key.
|
|
243
|
+
*
|
|
244
|
+
* @param params.search_term - What to search for
|
|
245
|
+
* @param params.count - How many to return (default 12, max 40)
|
|
246
|
+
*/
|
|
247
|
+
pfpSearch(params: PfpSearchParams): Promise<ApiResponse<PfpSearchResponse>>;
|
|
215
248
|
}
|
package/dist/media.js
CHANGED
|
@@ -99,5 +99,21 @@ class MediaClient extends base_1.BaseClient {
|
|
|
99
99
|
async filter(params) {
|
|
100
100
|
return this.post('/media/filter', params);
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Search for profile-picture candidates for a search term.
|
|
104
|
+
*
|
|
105
|
+
* Pictures already in use as a profile picture are removed before the result
|
|
106
|
+
* comes back, so two accounts cannot end up wearing the same face. Sourcing
|
|
107
|
+
* and filtering are one call for that reason — a caller who forgot the second
|
|
108
|
+
* step would get duplicates across their accounts and find out much later.
|
|
109
|
+
*
|
|
110
|
+
* Requires the `media:search` scope on a restricted key.
|
|
111
|
+
*
|
|
112
|
+
* @param params.search_term - What to search for
|
|
113
|
+
* @param params.count - How many to return (default 12, max 40)
|
|
114
|
+
*/
|
|
115
|
+
async pfpSearch(params) {
|
|
116
|
+
return this.post('/media/pfp-search', params);
|
|
117
|
+
}
|
|
102
118
|
}
|
|
103
119
|
exports.MediaClient = MediaClient;
|