ugcinc 1.0.4 → 1.0.5

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
@@ -68,7 +68,7 @@ if (response.ok) {
68
68
 
69
69
  #### Refresh Account Statistics
70
70
 
71
- Fetch live statistics from TikTok API and create new stat records.
71
+ Fetch live statistics from TikTok/Instagram API and create new stat records.
72
72
 
73
73
  ```typescript
74
74
  const response = await client.accounts.refreshStats({
@@ -220,7 +220,7 @@ if (response.ok) {
220
220
 
221
221
  #### Refresh Post Statistics
222
222
 
223
- Fetch live statistics from TikTok API and create new stat records.
223
+ Fetch live statistics from TikTok/Instagram API and create new stat records.
224
224
 
225
225
  ```typescript
226
226
  const response = await client.posts.refreshStats({
@@ -461,7 +461,7 @@ const response = await client.accounts.getStats({
461
461
 
462
462
  #### `client.accounts.refreshStats(params?)`
463
463
 
464
- Refresh account statistics by fetching live data from TikTok API.
464
+ Refresh account statistics by fetching live data from TikTok/Instagram API.
465
465
 
466
466
  **Endpoint:** `POST /accounts/stats/refresh`
467
467
 
@@ -476,10 +476,10 @@ Refresh account statistics by fetching live data from TikTok API.
476
476
 
477
477
  **Returns:** `ApiResponse<AccountStat[]>`
478
478
 
479
- Returns an array of newly created AccountStat objects with live data from TikTok. This endpoint fetches fresh statistics directly from the TikTok API and creates new stat records in the database. Use this when you need up-to-date metrics instead of historical data.
479
+ Returns an array of newly created AccountStat objects with live data from TikTok or Instagram. This endpoint fetches fresh statistics directly from the platform APIs and creates new stat records in the database. Use this when you need up-to-date metrics instead of historical data. The API automatically determines which platform to query based on the account type.
480
480
 
481
481
  **Key Differences from `getStats()`:**
482
- - `refreshStats()` fetches **live data** from TikTok API and creates new records
482
+ - `refreshStats()` fetches **live data** from TikTok/Instagram API and creates new records
483
483
  - `getStats()` retrieves **historical data** from your database
484
484
 
485
485
  **Example:**
@@ -687,7 +687,7 @@ Returns an array of Post objects (videos and slideshows) for the specified accou
687
687
  account_id: string; // Account that posted this
688
688
  type: 'video' | 'slideshow'; // Post type
689
689
  status: string; // Current post status
690
- post_url: string | null; // URL to the live post
690
+ social_id: string | null; // Platform post ID (TikTok video ID or Instagram reel code)
691
691
  caption: string | null; // Post caption/description
692
692
  media_urls: string[] | null; // URLs to media files
693
693
  music_post_id: string | null; // Associated music/audio ID
@@ -700,7 +700,7 @@ Returns an array of Post objects (videos and slideshows) for the specified accou
700
700
  | `account_id` | `string` | ID of the account that created this post |
701
701
  | `type` | `'video' \| 'slideshow'` | Type of post content |
702
702
  | `status` | `string` | Current status: `'scheduled'`, `'pending'`, `'complete'`, or `'failed'` |
703
- | `post_url` | `string \| null` | URL to the live post on the platform (available after posting) |
703
+ | `social_id` | `string \| null` | Platform-specific post ID (TikTok video ID or Instagram reel code, available after posting) |
704
704
  | `caption` | `string \| null` | Post caption/description text (max 500 characters) |
705
705
  | `media_urls` | `string[] \| null` | Array of URLs to video/image files used in the post |
706
706
  | `music_post_id` | `string \| null` | ID of the music/audio track used in the post |
@@ -855,7 +855,7 @@ if (response.ok) {
855
855
 
856
856
  #### `client.posts.refreshStats(params?)`
857
857
 
858
- Refresh post statistics by fetching live data from TikTok API.
858
+ Refresh post statistics by fetching live data from TikTok/Instagram API.
859
859
 
860
860
  **Endpoint:** `POST /post/stats/refresh`
861
861
 
@@ -867,13 +867,13 @@ Refresh post statistics by fetching live data from TikTok API.
867
867
 
868
868
  **Returns:** `ApiResponse<PostStat[]>`
869
869
 
870
- Returns an array of newly created PostStat objects with live data from TikTok. This endpoint fetches fresh statistics directly from the TikTok API and creates new stat records in the database. Use this when you need up-to-date engagement metrics instead of historical data.
870
+ Returns an array of newly created PostStat objects with live data from TikTok or Instagram. This endpoint fetches fresh statistics directly from the platform APIs and creates new stat records in the database. Use this when you need up-to-date engagement metrics instead of historical data. The API automatically determines which platform to query based on the account type.
871
871
 
872
872
  **Key Differences from `getStats()`:**
873
- - `refreshStats()` fetches **live data** from TikTok API and creates new records
873
+ - `refreshStats()` fetches **live data** from TikTok/Instagram API and creates new records
874
874
  - `getStats()` retrieves **historical data** from your database
875
875
 
876
- **Important:** Posts must have a valid `post_url` to refresh statistics. The endpoint extracts the TikTok post ID from the URL to fetch live metrics.
876
+ **Important:** Posts must have a valid `social_id` (TikTok video ID or Instagram reel code) to refresh statistics. The endpoint uses this ID to fetch live metrics from the platform.
877
877
 
878
878
  **Example:**
879
879
 
@@ -13,7 +13,7 @@ export declare class AccountsClient extends BaseClient {
13
13
  */
14
14
  getStats(params?: GetAccountStatsParams): Promise<ApiResponse<AccountStat[]>>;
15
15
  /**
16
- * Refresh account statistics from TikTok API
16
+ * Refresh account statistics from TikTok/Instagram API
17
17
  */
18
18
  refreshStats(params?: RefreshAccountStatsParams): Promise<ApiResponse<AccountStat[]>>;
19
19
  /**
package/dist/accounts.js CHANGED
@@ -19,7 +19,7 @@ class AccountsClient extends base_1.BaseClient {
19
19
  return this.post('/accounts/stats', params ?? {});
20
20
  }
21
21
  /**
22
- * Refresh account statistics from TikTok API
22
+ * Refresh account statistics from TikTok/Instagram API
23
23
  */
24
24
  async refreshStats(params) {
25
25
  return this.post('/accounts/stats/refresh', params ?? {});
package/dist/posts.d.ts CHANGED
@@ -17,7 +17,7 @@ export declare class PostsClient extends BaseClient {
17
17
  */
18
18
  getStats(params?: GetPostStatsParams): Promise<ApiResponse<PostStat[]>>;
19
19
  /**
20
- * Refresh post statistics from TikTok API
20
+ * Refresh post statistics from TikTok/Instagram API
21
21
  */
22
22
  refreshStats(params?: RefreshPostStatsParams): Promise<ApiResponse<PostStat[]>>;
23
23
  /**
package/dist/posts.js CHANGED
@@ -25,7 +25,7 @@ class PostsClient extends base_1.BaseClient {
25
25
  return this.post('/post/stats', params ?? {});
26
26
  }
27
27
  /**
28
- * Refresh post statistics from TikTok API
28
+ * Refresh post statistics from TikTok/Instagram API
29
29
  */
30
30
  async refreshStats(params) {
31
31
  return this.post('/post/stats/refresh', params ?? {});
package/dist/types.d.ts CHANGED
@@ -75,7 +75,7 @@ export interface Post {
75
75
  account_id: string;
76
76
  type: PostType;
77
77
  status: string;
78
- post_url: string | null;
78
+ social_id: string | null;
79
79
  caption: string | null;
80
80
  media_urls: string[] | null;
81
81
  music_post_id: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",