ugcinc 1.0.6 → 1.0.7
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 +52 -13
- package/dist/accounts.d.ts +2 -2
- package/dist/accounts.js +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,14 +86,18 @@ if (response.ok) {
|
|
|
86
86
|
|
|
87
87
|
#### Get Account Status
|
|
88
88
|
|
|
89
|
-
Get the status of tasks for
|
|
89
|
+
Get the status of tasks for one or more accounts.
|
|
90
90
|
|
|
91
91
|
```typescript
|
|
92
|
+
// Get status for specific accounts
|
|
92
93
|
const response = await client.accounts.getStatus({
|
|
93
|
-
|
|
94
|
+
accountIds: ['account-id-1', 'account-id-2'],
|
|
94
95
|
includeCompleted: false
|
|
95
96
|
});
|
|
96
97
|
|
|
98
|
+
// Get status for all accounts
|
|
99
|
+
const allResponse = await client.accounts.getStatus();
|
|
100
|
+
|
|
97
101
|
if (response.ok) {
|
|
98
102
|
console.log(response.data); // AccountTask[]
|
|
99
103
|
}
|
|
@@ -121,7 +125,10 @@ if (response.ok) {
|
|
|
121
125
|
|
|
122
126
|
Update account social profile information (avatar, nickname, bio).
|
|
123
127
|
|
|
124
|
-
**Important:**
|
|
128
|
+
**Important Restrictions:**
|
|
129
|
+
- **Nickname:** Can only be updated once every **7 days**
|
|
130
|
+
- **Avatar:** Can only be updated once every **24 hours**
|
|
131
|
+
- **Bio:** Can only be updated once every **24 hours**
|
|
125
132
|
|
|
126
133
|
```typescript
|
|
127
134
|
const response = await client.accounts.updateSocial({
|
|
@@ -134,7 +141,7 @@ const response = await client.accounts.updateSocial({
|
|
|
134
141
|
if (response.ok) {
|
|
135
142
|
console.log(response.data.message);
|
|
136
143
|
} else {
|
|
137
|
-
// Error response includes when
|
|
144
|
+
// Error response includes when the field can be updated again
|
|
138
145
|
console.error(response.message);
|
|
139
146
|
}
|
|
140
147
|
```
|
|
@@ -524,9 +531,9 @@ if (response.ok) {
|
|
|
524
531
|
|
|
525
532
|
---
|
|
526
533
|
|
|
527
|
-
#### `client.accounts.getStatus(params)`
|
|
534
|
+
#### `client.accounts.getStatus(params?)`
|
|
528
535
|
|
|
529
|
-
Get account status and pending tasks.
|
|
536
|
+
Get account status and pending tasks for one or more accounts.
|
|
530
537
|
|
|
531
538
|
**Endpoint:** `POST /accounts/status`
|
|
532
539
|
|
|
@@ -534,12 +541,12 @@ Get account status and pending tasks.
|
|
|
534
541
|
|
|
535
542
|
| Parameter | Type | Required | Description |
|
|
536
543
|
|-----------|------|----------|-------------|
|
|
537
|
-
| `
|
|
544
|
+
| `accountIds` | `string[]` | No | Array of account IDs to check status for (omit to get all accounts) |
|
|
538
545
|
| `includeCompleted` | `boolean` | No | Include completed tasks (default: false) |
|
|
539
546
|
|
|
540
547
|
**Returns:** `ApiResponse<AccountTask[]>`
|
|
541
548
|
|
|
542
|
-
Returns an array of AccountTask objects showing pending and (optionally) completed tasks for the specified
|
|
549
|
+
Returns an array of AccountTask objects showing pending and (optionally) completed tasks for the specified accounts. If no `accountIds` are provided, returns tasks for all accounts in your organization. Tasks include profile edits and other account-level operations.
|
|
543
550
|
|
|
544
551
|
**AccountTask Object:**
|
|
545
552
|
|
|
@@ -568,10 +575,20 @@ Returns an array of AccountTask objects showing pending and (optionally) complet
|
|
|
568
575
|
**Example:**
|
|
569
576
|
|
|
570
577
|
```typescript
|
|
578
|
+
// Get status for specific accounts
|
|
571
579
|
const response = await client.accounts.getStatus({
|
|
572
|
-
|
|
580
|
+
accountIds: ['account-1', 'account-2'],
|
|
573
581
|
includeCompleted: true
|
|
574
582
|
});
|
|
583
|
+
|
|
584
|
+
// Get status for all accounts
|
|
585
|
+
const allResponse = await client.accounts.getStatus();
|
|
586
|
+
|
|
587
|
+
if (response.ok) {
|
|
588
|
+
response.data.forEach(task => {
|
|
589
|
+
console.log(`Task ${task.id} for account ${task.account_id}: ${task.status}`);
|
|
590
|
+
});
|
|
591
|
+
}
|
|
575
592
|
```
|
|
576
593
|
|
|
577
594
|
---
|
|
@@ -638,7 +655,14 @@ Update account social profile (avatar, nickname, bio).
|
|
|
638
655
|
| `nickName` | `string` | No | New display name |
|
|
639
656
|
| `bio` | `string` | No | New bio text |
|
|
640
657
|
|
|
641
|
-
**Important
|
|
658
|
+
**Important Update Restrictions:**
|
|
659
|
+
|
|
660
|
+
Each profile field has a cooldown period before it can be updated again:
|
|
661
|
+
- **Nickname:** Can only be updated **once every 7 days**
|
|
662
|
+
- **Avatar:** Can only be updated **once every 24 hours**
|
|
663
|
+
- **Bio:** Can only be updated **once every 24 hours**
|
|
664
|
+
|
|
665
|
+
If you attempt to update a field before its cooldown period has elapsed, the API will return an error with details about when the next update is allowed.
|
|
642
666
|
|
|
643
667
|
**Returns:** `ApiResponse<{ message: string }>`
|
|
644
668
|
|
|
@@ -652,16 +676,31 @@ Returns a success message when the profile update task has been successfully cre
|
|
|
652
676
|
}
|
|
653
677
|
```
|
|
654
678
|
|
|
655
|
-
**Error Response (
|
|
679
|
+
**Error Response (Rate Limit):**
|
|
656
680
|
|
|
657
|
-
If you attempt to update
|
|
681
|
+
If you attempt to update a field too soon, you'll receive an error like:
|
|
658
682
|
|
|
659
683
|
```typescript
|
|
684
|
+
// Nickname restriction (7 days)
|
|
660
685
|
{
|
|
661
686
|
ok: false,
|
|
662
687
|
code: 400,
|
|
663
688
|
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
689
|
}
|
|
690
|
+
|
|
691
|
+
// Avatar restriction (24 hours)
|
|
692
|
+
{
|
|
693
|
+
ok: false,
|
|
694
|
+
code: 400,
|
|
695
|
+
message: "Avatar can only be updated once every 24 hours. Last update was X hours ago. You can update again in Y hour(s) on YYYY-MM-DD"
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
// Bio restriction (24 hours)
|
|
699
|
+
{
|
|
700
|
+
ok: false,
|
|
701
|
+
code: 400,
|
|
702
|
+
message: "Bio can only be updated once every 24 hours. Last update was X hours ago. You can update again in Y hour(s) on YYYY-MM-DD"
|
|
703
|
+
}
|
|
665
704
|
```
|
|
666
705
|
|
|
667
706
|
**Example:**
|
|
@@ -677,7 +716,7 @@ const response = await client.accounts.updateSocial({
|
|
|
677
716
|
if (response.ok) {
|
|
678
717
|
console.log(response.data.message);
|
|
679
718
|
} else {
|
|
680
|
-
// Handle
|
|
719
|
+
// Handle rate limit error
|
|
681
720
|
console.error(response.message);
|
|
682
721
|
}
|
|
683
722
|
```
|
package/dist/accounts.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ export declare class AccountsClient extends BaseClient {
|
|
|
17
17
|
*/
|
|
18
18
|
refreshStats(params?: RefreshAccountStatsParams): Promise<ApiResponse<AccountStat[]>>;
|
|
19
19
|
/**
|
|
20
|
-
* Get account status (tasks)
|
|
20
|
+
* Get account status (tasks) for one or more accounts
|
|
21
21
|
*/
|
|
22
|
-
getStatus(params
|
|
22
|
+
getStatus(params?: GetAccountStatusParams): Promise<ApiResponse<AccountTask[]>>;
|
|
23
23
|
/**
|
|
24
24
|
* Update account metadata (tag, org_group, user_group)
|
|
25
25
|
*/
|
package/dist/accounts.js
CHANGED
|
@@ -25,10 +25,10 @@ class AccountsClient extends base_1.BaseClient {
|
|
|
25
25
|
return this.post('/accounts/stats/refresh', params ?? {});
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
* Get account status (tasks)
|
|
28
|
+
* Get account status (tasks) for one or more accounts
|
|
29
29
|
*/
|
|
30
30
|
async getStatus(params) {
|
|
31
|
-
return this.post('/accounts/status', params);
|
|
31
|
+
return this.post('/accounts/status', params ?? {});
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Update account metadata (tag, org_group, user_group)
|
package/dist/types.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ export interface RefreshAccountStatsParams {
|
|
|
112
112
|
user_group?: string;
|
|
113
113
|
}
|
|
114
114
|
export interface GetAccountStatusParams {
|
|
115
|
-
|
|
115
|
+
accountIds?: string[];
|
|
116
116
|
includeCompleted?: boolean;
|
|
117
117
|
}
|
|
118
118
|
export interface UpdateAccountInfoParams {
|