ugcinc 4.9.0 → 4.11.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 +18 -1
- package/dist/accounts.d.ts +42 -2
- package/dist/accounts.js +26 -0
- package/dist/index.d.ts +1 -1
- package/dist/posts.d.ts +15 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,7 +41,7 @@ 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
46
|
- `client.media`: upload media, create media records, manage tags/names, and work with social audio
|
|
47
47
|
- `client.stats`: fetch account/post analytics, daily aggregates, top performers, and refresh stats
|
|
@@ -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,7 +25,7 @@ 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';
|
package/dist/posts.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
2
|
import type { ApiResponse } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Why a post failed, as a stable, client-safe category.
|
|
5
|
+
*
|
|
6
|
+
* - `device_error` — the posting device was unavailable or did not respond
|
|
7
|
+
* - `network_error` — the connection dropped while posting
|
|
8
|
+
* - `upload_interrupted` — the upload started but could not be confirmed finished
|
|
9
|
+
* - `account_issue` — the social account was not in a usable state
|
|
10
|
+
* - `capacity_deferred` — no posting capacity was available; the post will be retried
|
|
11
|
+
* - `platform_change` — the social app's interface changed and the post could not complete
|
|
12
|
+
* - `unconfirmed` — posting finished but publication could not be confirmed
|
|
13
|
+
* - `unknown` — the post failed for an unrecognized reason
|
|
14
|
+
*/
|
|
15
|
+
export type PostFailCategory = 'device_error' | 'network_error' | 'upload_interrupted' | 'account_issue' | 'capacity_deferred' | 'platform_change' | 'unconfirmed' | 'unknown';
|
|
3
16
|
export type PostType = 'video' | 'slideshow';
|
|
4
17
|
export type PostStatus = 'draft' | 'scheduled' | 'pending' | 'complete' | 'failed' | 'retrying' | 'deleting' | 'deleted' | 'hidden' | 'require-approval';
|
|
5
18
|
/**
|
|
@@ -184,6 +197,8 @@ export declare class PostsClient extends BaseClient {
|
|
|
184
197
|
post_id: string;
|
|
185
198
|
status: string;
|
|
186
199
|
postUrl?: string;
|
|
200
|
+
/** Set when status is "failed"; null otherwise. */
|
|
201
|
+
fail_category: PostFailCategory | null;
|
|
187
202
|
}>>;
|
|
188
203
|
/**
|
|
189
204
|
* Create a video post
|