ugcinc 1.0.5 → 1.0.6
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 +96 -8
- package/dist/accounts.d.ts +10 -2
- package/dist/accounts.js +8 -1
- package/dist/posts.d.ts +2 -1
- package/dist/posts.js +2 -1
- package/dist/types.d.ts +6 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -101,19 +101,41 @@ if (response.ok) {
|
|
|
101
101
|
|
|
102
102
|
#### Update Account Info
|
|
103
103
|
|
|
104
|
-
Update account
|
|
104
|
+
Update account metadata (tag, org_group, user_group).
|
|
105
105
|
|
|
106
106
|
```typescript
|
|
107
107
|
const response = await client.accounts.updateInfo({
|
|
108
|
+
accountId: 'account-id',
|
|
109
|
+
tag: 'influencer',
|
|
110
|
+
org_group: 'group1',
|
|
111
|
+
user_group: 'users1'
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
if (response.ok) {
|
|
115
|
+
console.log(response.data.message);
|
|
116
|
+
console.log(response.data.account); // Updated account
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
#### Update Account Social Profile
|
|
121
|
+
|
|
122
|
+
Update account social profile information (avatar, nickname, bio).
|
|
123
|
+
|
|
124
|
+
**Important:** Nicknames can only be updated once every 7 days.
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
const response = await client.accounts.updateSocial({
|
|
108
128
|
accountId: 'account-id',
|
|
109
129
|
nickName: 'New Name',
|
|
110
130
|
bio: 'New bio text',
|
|
111
|
-
avatarUrl: 'https://example.com/avatar.jpg'
|
|
112
|
-
site: 'https://example.com'
|
|
131
|
+
avatarUrl: 'https://example.com/avatar.jpg'
|
|
113
132
|
});
|
|
114
133
|
|
|
115
134
|
if (response.ok) {
|
|
116
135
|
console.log(response.data.message);
|
|
136
|
+
} else {
|
|
137
|
+
// Error response includes when nickname can be updated again
|
|
138
|
+
console.error(response.message);
|
|
117
139
|
}
|
|
118
140
|
```
|
|
119
141
|
|
|
@@ -556,7 +578,7 @@ const response = await client.accounts.getStatus({
|
|
|
556
578
|
|
|
557
579
|
#### `client.accounts.updateInfo(params)`
|
|
558
580
|
|
|
559
|
-
Update account
|
|
581
|
+
Update account metadata (tag, org_group, user_group).
|
|
560
582
|
|
|
561
583
|
**Endpoint:** `POST /accounts/update-info`
|
|
562
584
|
|
|
@@ -565,15 +587,62 @@ Update account profile information.
|
|
|
565
587
|
| Parameter | Type | Required | Description |
|
|
566
588
|
|-----------|------|----------|-------------|
|
|
567
589
|
| `accountId` | `string` | **Yes** | Account ID to update |
|
|
568
|
-
| `
|
|
590
|
+
| `tag` | `string` | No | New tag value for categorization |
|
|
591
|
+
| `org_group` | `string` | No | New organization group identifier |
|
|
592
|
+
| `user_group` | `string` | No | New user group identifier |
|
|
593
|
+
|
|
594
|
+
**Note:** At least one of `tag`, `org_group`, or `user_group` must be provided.
|
|
595
|
+
|
|
596
|
+
**Returns:** `ApiResponse<{ message: string; account: Account }>`
|
|
597
|
+
|
|
598
|
+
Returns a success message and the updated account object. The update is applied immediately to the database.
|
|
599
|
+
|
|
600
|
+
**Response Object:**
|
|
601
|
+
|
|
602
|
+
```typescript
|
|
603
|
+
{
|
|
604
|
+
message: string; // Success message (e.g., "Account info updated successfully")
|
|
605
|
+
account: Account; // Updated account object with new values
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
**Example:**
|
|
610
|
+
|
|
611
|
+
```typescript
|
|
612
|
+
const response = await client.accounts.updateInfo({
|
|
613
|
+
accountId: 'account-id',
|
|
614
|
+
tag: 'influencer',
|
|
615
|
+
org_group: 'group1',
|
|
616
|
+
user_group: 'users1'
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
if (response.ok) {
|
|
620
|
+
console.log(response.data.account.tag); // 'influencer'
|
|
621
|
+
}
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
---
|
|
625
|
+
|
|
626
|
+
#### `client.accounts.updateSocial(params)`
|
|
627
|
+
|
|
628
|
+
Update account social profile (avatar, nickname, bio).
|
|
629
|
+
|
|
630
|
+
**Endpoint:** `POST /accounts/update-social`
|
|
631
|
+
|
|
632
|
+
**Parameters:**
|
|
633
|
+
|
|
634
|
+
| Parameter | Type | Required | Description |
|
|
635
|
+
|-----------|------|----------|-------------|
|
|
636
|
+
| `accountId` | `string` | **Yes** | Account ID to update |
|
|
569
637
|
| `avatarUrl` | `string` | No | New avatar/profile picture URL |
|
|
570
638
|
| `nickName` | `string` | No | New display name |
|
|
571
639
|
| `bio` | `string` | No | New bio text |
|
|
572
|
-
|
|
640
|
+
|
|
641
|
+
**Important:** Nicknames can only be updated **once every 7 days**. If you attempt to update a nickname before the 7-day period has elapsed, the API will return an error with details about when the next update is allowed.
|
|
573
642
|
|
|
574
643
|
**Returns:** `ApiResponse<{ message: string }>`
|
|
575
644
|
|
|
576
|
-
Returns a success message when the profile update task has been successfully created and queued. The actual profile update will be processed asynchronously.
|
|
645
|
+
Returns a success message when the profile update task has been successfully created and queued. The actual profile update will be processed asynchronously through the GeeLark API.
|
|
577
646
|
|
|
578
647
|
**Response Object:**
|
|
579
648
|
|
|
@@ -583,15 +652,34 @@ Returns a success message when the profile update task has been successfully cre
|
|
|
583
652
|
}
|
|
584
653
|
```
|
|
585
654
|
|
|
655
|
+
**Error Response (Nickname Restriction):**
|
|
656
|
+
|
|
657
|
+
If you attempt to update the nickname too soon:
|
|
658
|
+
|
|
659
|
+
```typescript
|
|
660
|
+
{
|
|
661
|
+
ok: false,
|
|
662
|
+
code: 400,
|
|
663
|
+
message: "Nickname can only be updated once every 7 days. Last update was X days ago. You can update again in Y day(s) on YYYY-MM-DD"
|
|
664
|
+
}
|
|
665
|
+
```
|
|
666
|
+
|
|
586
667
|
**Example:**
|
|
587
668
|
|
|
588
669
|
```typescript
|
|
589
|
-
const response = await client.accounts.
|
|
670
|
+
const response = await client.accounts.updateSocial({
|
|
590
671
|
accountId: 'account-id',
|
|
591
672
|
nickName: 'Cool Creator',
|
|
592
673
|
bio: 'Content creator 🎥',
|
|
593
674
|
avatarUrl: 'https://storage.example.com/avatar.jpg'
|
|
594
675
|
});
|
|
676
|
+
|
|
677
|
+
if (response.ok) {
|
|
678
|
+
console.log(response.data.message);
|
|
679
|
+
} else {
|
|
680
|
+
// Handle nickname restriction error
|
|
681
|
+
console.error(response.message);
|
|
682
|
+
}
|
|
595
683
|
```
|
|
596
684
|
|
|
597
685
|
---
|
package/dist/accounts.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type { Account, AccountStat, AccountTask, GetAccountsParams, GetAccountStatsParams, RefreshAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, ApiResponse } from './types';
|
|
2
|
+
import type { Account, AccountStat, AccountTask, GetAccountsParams, GetAccountStatsParams, RefreshAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, ApiResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for managing accounts
|
|
5
5
|
*/
|
|
@@ -21,9 +21,17 @@ export declare class AccountsClient extends BaseClient {
|
|
|
21
21
|
*/
|
|
22
22
|
getStatus(params: GetAccountStatusParams): Promise<ApiResponse<AccountTask[]>>;
|
|
23
23
|
/**
|
|
24
|
-
* Update account
|
|
24
|
+
* Update account metadata (tag, org_group, user_group)
|
|
25
25
|
*/
|
|
26
26
|
updateInfo(params: UpdateAccountInfoParams): Promise<ApiResponse<{
|
|
27
27
|
message: string;
|
|
28
|
+
account: Account;
|
|
29
|
+
}>>;
|
|
30
|
+
/**
|
|
31
|
+
* Update account social profile (avatar, nickname, bio)
|
|
32
|
+
* Note: Nickname can only be updated once every 7 days
|
|
33
|
+
*/
|
|
34
|
+
updateSocial(params: UpdateAccountSocialParams): Promise<ApiResponse<{
|
|
35
|
+
message: string;
|
|
28
36
|
}>>;
|
|
29
37
|
}
|
package/dist/accounts.js
CHANGED
|
@@ -31,10 +31,17 @@ class AccountsClient extends base_1.BaseClient {
|
|
|
31
31
|
return this.post('/accounts/status', params);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Update account
|
|
34
|
+
* Update account metadata (tag, org_group, user_group)
|
|
35
35
|
*/
|
|
36
36
|
async updateInfo(params) {
|
|
37
37
|
return this.post('/accounts/update-info', params);
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Update account social profile (avatar, nickname, bio)
|
|
41
|
+
* Note: Nickname can only be updated once every 7 days
|
|
42
|
+
*/
|
|
43
|
+
async updateSocial(params) {
|
|
44
|
+
return this.post('/accounts/update-social', params);
|
|
45
|
+
}
|
|
39
46
|
}
|
|
40
47
|
exports.AccountsClient = AccountsClient;
|
package/dist/posts.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export declare class PostsClient extends BaseClient {
|
|
|
17
17
|
*/
|
|
18
18
|
getStats(params?: GetPostStatsParams): Promise<ApiResponse<PostStat[]>>;
|
|
19
19
|
/**
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
* Refresh post statistics from TikTok/Instagram API
|
|
21
22
|
*/
|
|
22
23
|
refreshStats(params?: RefreshPostStatsParams): Promise<ApiResponse<PostStat[]>>;
|
|
23
24
|
/**
|
package/dist/posts.js
CHANGED
|
@@ -25,7 +25,8 @@ class PostsClient extends base_1.BaseClient {
|
|
|
25
25
|
return this.post('/post/stats', params ?? {});
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
* Refresh post statistics from TikTok/Instagram API
|
|
29
30
|
*/
|
|
30
31
|
async refreshStats(params) {
|
|
31
32
|
return this.post('/post/stats/refresh', params ?? {});
|
package/dist/types.d.ts
CHANGED
|
@@ -49,7 +49,6 @@ export interface EditProfileInfo {
|
|
|
49
49
|
avatarUrl?: string;
|
|
50
50
|
nickName?: string;
|
|
51
51
|
bio?: string;
|
|
52
|
-
site?: string;
|
|
53
52
|
}
|
|
54
53
|
/**
|
|
55
54
|
* Task types
|
|
@@ -118,11 +117,15 @@ export interface GetAccountStatusParams {
|
|
|
118
117
|
}
|
|
119
118
|
export interface UpdateAccountInfoParams {
|
|
120
119
|
accountId: string;
|
|
121
|
-
|
|
120
|
+
tag?: string;
|
|
121
|
+
org_group?: string;
|
|
122
|
+
user_group?: string;
|
|
123
|
+
}
|
|
124
|
+
export interface UpdateAccountSocialParams {
|
|
125
|
+
accountId: string;
|
|
122
126
|
avatarUrl?: string;
|
|
123
127
|
nickName?: string;
|
|
124
128
|
bio?: string;
|
|
125
|
-
site?: string;
|
|
126
129
|
}
|
|
127
130
|
export interface GetTasksParams {
|
|
128
131
|
accountIds?: string[];
|