ugcinc 1.4.3 → 1.5.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 +26 -2
- package/dist/posts.d.ts +9 -1
- package/dist/posts.js +7 -0
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,8 +44,8 @@ For complete API documentation, including all endpoints, parameters, and example
|
|
|
44
44
|
## API Features
|
|
45
45
|
|
|
46
46
|
### Accounts
|
|
47
|
-
- Get accounts with filters
|
|
48
|
-
- Get account status
|
|
47
|
+
- Get accounts with filters (tag, org_group, user_group, status)
|
|
48
|
+
- Get account status (tasks)
|
|
49
49
|
- Update account info (tags, groups)
|
|
50
50
|
- Update social profile (avatar, nickname, bio)
|
|
51
51
|
|
|
@@ -72,6 +72,30 @@ For complete API documentation, including all endpoints, parameters, and example
|
|
|
72
72
|
|
|
73
73
|
### Examples
|
|
74
74
|
|
|
75
|
+
**Get accounts with filters:**
|
|
76
|
+
```typescript
|
|
77
|
+
// Get all accounts
|
|
78
|
+
const response = await client.accounts.getAccounts();
|
|
79
|
+
|
|
80
|
+
// Get accounts by status
|
|
81
|
+
const response = await client.accounts.getAccounts({
|
|
82
|
+
status: 'pending' // 'pending' | 'initialized' | 'setup' | 'error'
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Get accounts with multiple filters
|
|
86
|
+
const response = await client.accounts.getAccounts({
|
|
87
|
+
tag: 'production',
|
|
88
|
+
org_group: 'group1',
|
|
89
|
+
status: 'setup'
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
if (response.ok) {
|
|
93
|
+
response.data.forEach(account => {
|
|
94
|
+
console.log(`Account ${account.id}: ${account.username} (${account.status})`);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
75
99
|
**Get your organization's API keys:**
|
|
76
100
|
```typescript
|
|
77
101
|
const response = await client.org.getApiKeys(); // POST /org/api-key
|
package/dist/posts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type { Post, GetPostsParams, CreateSlideshowParams, GetPostStatusParams, CreateVideoParams, DeletePostsParams, ApiResponse } from './types';
|
|
2
|
+
import type { Post, GetPostsParams, CreateSlideshowParams, GetPostStatusParams, CreateVideoParams, DeletePostsParams, RetryPostsParams, ApiResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for managing posts
|
|
5
5
|
*/
|
|
@@ -32,4 +32,12 @@ export declare class PostsClient extends BaseClient {
|
|
|
32
32
|
deleted: number;
|
|
33
33
|
ids: string[];
|
|
34
34
|
}>>;
|
|
35
|
+
/**
|
|
36
|
+
* Retry failed posts
|
|
37
|
+
* Note: Only posts with status "failed" can be retried
|
|
38
|
+
*/
|
|
39
|
+
retryPosts(params: RetryPostsParams): Promise<ApiResponse<{
|
|
40
|
+
retried: number;
|
|
41
|
+
ids: string[];
|
|
42
|
+
}>>;
|
|
35
43
|
}
|
package/dist/posts.js
CHANGED
|
@@ -37,5 +37,12 @@ class PostsClient extends base_1.BaseClient {
|
|
|
37
37
|
async deletePosts(params) {
|
|
38
38
|
return this.post('/post/delete', params);
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Retry failed posts
|
|
42
|
+
* Note: Only posts with status "failed" can be retried
|
|
43
|
+
*/
|
|
44
|
+
async retryPosts(params) {
|
|
45
|
+
return this.post('/post/retry', params);
|
|
46
|
+
}
|
|
40
47
|
}
|
|
41
48
|
exports.PostsClient = PostsClient;
|
package/dist/types.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export interface Account {
|
|
|
29
29
|
warmup_enabled: boolean | null;
|
|
30
30
|
keywords: string | null;
|
|
31
31
|
profiles: string | null;
|
|
32
|
+
status: 'pending' | 'initialized' | 'setup' | 'error';
|
|
32
33
|
}
|
|
33
34
|
export interface AccountStat {
|
|
34
35
|
id: string;
|
|
@@ -101,6 +102,7 @@ export interface GetAccountsParams {
|
|
|
101
102
|
tag?: string;
|
|
102
103
|
org_group?: string;
|
|
103
104
|
user_group?: string;
|
|
105
|
+
status?: 'pending' | 'initialized' | 'setup' | 'error';
|
|
104
106
|
}
|
|
105
107
|
export interface GetAccountStatsParams {
|
|
106
108
|
accountIds?: string[];
|
|
@@ -165,6 +167,9 @@ export interface CreateVideoParams {
|
|
|
165
167
|
export interface DeletePostsParams {
|
|
166
168
|
postIds: string[];
|
|
167
169
|
}
|
|
170
|
+
export interface RetryPostsParams {
|
|
171
|
+
postIds: string[];
|
|
172
|
+
}
|
|
168
173
|
export interface RefreshStatsParams {
|
|
169
174
|
org_group?: string;
|
|
170
175
|
}
|