ugcinc 1.0.5 → 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 CHANGED
@@ -86,14 +86,18 @@ if (response.ok) {
86
86
 
87
87
  #### Get Account Status
88
88
 
89
- Get the status of tasks for a specific account.
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
- accountId: 'account-id',
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
  }
@@ -101,19 +105,44 @@ if (response.ok) {
101
105
 
102
106
  #### Update Account Info
103
107
 
104
- Update account profile information.
108
+ Update account metadata (tag, org_group, user_group).
105
109
 
106
110
  ```typescript
107
111
  const response = await client.accounts.updateInfo({
112
+ accountId: 'account-id',
113
+ tag: 'influencer',
114
+ org_group: 'group1',
115
+ user_group: 'users1'
116
+ });
117
+
118
+ if (response.ok) {
119
+ console.log(response.data.message);
120
+ console.log(response.data.account); // Updated account
121
+ }
122
+ ```
123
+
124
+ #### Update Account Social Profile
125
+
126
+ Update account social profile information (avatar, nickname, bio).
127
+
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**
132
+
133
+ ```typescript
134
+ const response = await client.accounts.updateSocial({
108
135
  accountId: 'account-id',
109
136
  nickName: 'New Name',
110
137
  bio: 'New bio text',
111
- avatarUrl: 'https://example.com/avatar.jpg',
112
- site: 'https://example.com'
138
+ avatarUrl: 'https://example.com/avatar.jpg'
113
139
  });
114
140
 
115
141
  if (response.ok) {
116
142
  console.log(response.data.message);
143
+ } else {
144
+ // Error response includes when the field can be updated again
145
+ console.error(response.message);
117
146
  }
118
147
  ```
119
148
 
@@ -502,9 +531,9 @@ if (response.ok) {
502
531
 
503
532
  ---
504
533
 
505
- #### `client.accounts.getStatus(params)`
534
+ #### `client.accounts.getStatus(params?)`
506
535
 
507
- Get account status and pending tasks.
536
+ Get account status and pending tasks for one or more accounts.
508
537
 
509
538
  **Endpoint:** `POST /accounts/status`
510
539
 
@@ -512,12 +541,12 @@ Get account status and pending tasks.
512
541
 
513
542
  | Parameter | Type | Required | Description |
514
543
  |-----------|------|----------|-------------|
515
- | `accountId` | `string` | **Yes** | Account ID to check status for |
544
+ | `accountIds` | `string[]` | No | Array of account IDs to check status for (omit to get all accounts) |
516
545
  | `includeCompleted` | `boolean` | No | Include completed tasks (default: false) |
517
546
 
518
547
  **Returns:** `ApiResponse<AccountTask[]>`
519
548
 
520
- Returns an array of AccountTask objects showing pending and (optionally) completed tasks for the specified account. Tasks include profile edits and other account-level operations.
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.
521
550
 
522
551
  **AccountTask Object:**
523
552
 
@@ -546,17 +575,27 @@ Returns an array of AccountTask objects showing pending and (optionally) complet
546
575
  **Example:**
547
576
 
548
577
  ```typescript
578
+ // Get status for specific accounts
549
579
  const response = await client.accounts.getStatus({
550
- accountId: 'account-id',
580
+ accountIds: ['account-1', 'account-2'],
551
581
  includeCompleted: true
552
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
+ }
553
592
  ```
554
593
 
555
594
  ---
556
595
 
557
596
  #### `client.accounts.updateInfo(params)`
558
597
 
559
- Update account profile information.
598
+ Update account metadata (tag, org_group, user_group).
560
599
 
561
600
  **Endpoint:** `POST /accounts/update-info`
562
601
 
@@ -565,15 +604,69 @@ Update account profile information.
565
604
  | Parameter | Type | Required | Description |
566
605
  |-----------|------|----------|-------------|
567
606
  | `accountId` | `string` | **Yes** | Account ID to update |
568
- | `scheduledTime` | `string` | No | When to schedule the update (ISO 8601 format) |
607
+ | `tag` | `string` | No | New tag value for categorization |
608
+ | `org_group` | `string` | No | New organization group identifier |
609
+ | `user_group` | `string` | No | New user group identifier |
610
+
611
+ **Note:** At least one of `tag`, `org_group`, or `user_group` must be provided.
612
+
613
+ **Returns:** `ApiResponse<{ message: string; account: Account }>`
614
+
615
+ Returns a success message and the updated account object. The update is applied immediately to the database.
616
+
617
+ **Response Object:**
618
+
619
+ ```typescript
620
+ {
621
+ message: string; // Success message (e.g., "Account info updated successfully")
622
+ account: Account; // Updated account object with new values
623
+ }
624
+ ```
625
+
626
+ **Example:**
627
+
628
+ ```typescript
629
+ const response = await client.accounts.updateInfo({
630
+ accountId: 'account-id',
631
+ tag: 'influencer',
632
+ org_group: 'group1',
633
+ user_group: 'users1'
634
+ });
635
+
636
+ if (response.ok) {
637
+ console.log(response.data.account.tag); // 'influencer'
638
+ }
639
+ ```
640
+
641
+ ---
642
+
643
+ #### `client.accounts.updateSocial(params)`
644
+
645
+ Update account social profile (avatar, nickname, bio).
646
+
647
+ **Endpoint:** `POST /accounts/update-social`
648
+
649
+ **Parameters:**
650
+
651
+ | Parameter | Type | Required | Description |
652
+ |-----------|------|----------|-------------|
653
+ | `accountId` | `string` | **Yes** | Account ID to update |
569
654
  | `avatarUrl` | `string` | No | New avatar/profile picture URL |
570
655
  | `nickName` | `string` | No | New display name |
571
656
  | `bio` | `string` | No | New bio text |
572
- | `site` | `string` | No | New website URL |
657
+
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.
573
666
 
574
667
  **Returns:** `ApiResponse<{ message: string }>`
575
668
 
576
- Returns a success message when the profile update task has been successfully created and queued. The actual profile update will be processed asynchronously.
669
+ 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
670
 
578
671
  **Response Object:**
579
672
 
@@ -583,15 +676,49 @@ Returns a success message when the profile update task has been successfully cre
583
676
  }
584
677
  ```
585
678
 
679
+ **Error Response (Rate Limit):**
680
+
681
+ If you attempt to update a field too soon, you'll receive an error like:
682
+
683
+ ```typescript
684
+ // Nickname restriction (7 days)
685
+ {
686
+ ok: false,
687
+ code: 400,
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"
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
+ }
704
+ ```
705
+
586
706
  **Example:**
587
707
 
588
708
  ```typescript
589
- const response = await client.accounts.updateInfo({
709
+ const response = await client.accounts.updateSocial({
590
710
  accountId: 'account-id',
591
711
  nickName: 'Cool Creator',
592
712
  bio: 'Content creator 🎥',
593
713
  avatarUrl: 'https://storage.example.com/avatar.jpg'
594
714
  });
715
+
716
+ if (response.ok) {
717
+ console.log(response.data.message);
718
+ } else {
719
+ // Handle rate limit error
720
+ console.error(response.message);
721
+ }
595
722
  ```
596
723
 
597
724
  ---
@@ -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
  */
@@ -17,13 +17,21 @@ 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: GetAccountStatusParams): Promise<ApiResponse<AccountTask[]>>;
22
+ getStatus(params?: GetAccountStatusParams): Promise<ApiResponse<AccountTask[]>>;
23
23
  /**
24
- * Update account profile information
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
@@ -25,16 +25,23 @@ 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
- * Update account profile information
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
- * Refresh post statistics from TikTok/Instagram API
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
- * Refresh post statistics from TikTok/Instagram API
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
@@ -113,16 +112,20 @@ export interface RefreshAccountStatsParams {
113
112
  user_group?: string;
114
113
  }
115
114
  export interface GetAccountStatusParams {
116
- accountId: string;
115
+ accountIds?: string[];
117
116
  includeCompleted?: boolean;
118
117
  }
119
118
  export interface UpdateAccountInfoParams {
120
119
  accountId: string;
121
- scheduledTime?: string;
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[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",