ugcinc 1.0.9 → 1.1.1

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/dist/index.d.ts CHANGED
@@ -9,4 +9,4 @@ export { TasksClient } from './tasks';
9
9
  export { PostsClient } from './posts';
10
10
  export { StatsClient } from './stats';
11
11
  export type { ClientConfig, } from './base';
12
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, } from './types';
12
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, } from './types';
package/dist/stats.d.ts CHANGED
@@ -13,8 +13,9 @@ export declare class StatsClient extends BaseClient {
13
13
  */
14
14
  getPostStats(params?: GetPostStatsParams): Promise<ApiResponse<PostStat[]>>;
15
15
  /**
16
- * Refresh statistics for an account and all its posts
16
+ * Refresh statistics for all accounts in the organization (optionally filtered by org_group)
17
17
  * Fetches live data from TikTok/Instagram API and creates new stat records
18
+ * Note: Can only be called once per hour per organization (or per org_group if specified)
18
19
  */
19
- refresh(params: RefreshStatsParams): Promise<ApiResponse<RefreshStatsResponse>>;
20
+ refresh(params?: RefreshStatsParams): Promise<ApiResponse<RefreshStatsResponse>>;
20
21
  }
package/dist/stats.js CHANGED
@@ -19,11 +19,12 @@ class StatsClient extends base_1.BaseClient {
19
19
  return this.post('/stats/posts', params ?? {});
20
20
  }
21
21
  /**
22
- * Refresh statistics for an account and all its posts
22
+ * Refresh statistics for all accounts in the organization (optionally filtered by org_group)
23
23
  * Fetches live data from TikTok/Instagram API and creates new stat records
24
+ * Note: Can only be called once per hour per organization (or per org_group if specified)
24
25
  */
25
26
  async refresh(params) {
26
- return this.post('/stats/refresh', params);
27
+ return this.post('/stats/refresh', params ?? {});
27
28
  }
28
29
  }
29
30
  exports.StatsClient = StatsClient;
package/dist/types.d.ts CHANGED
@@ -157,10 +157,19 @@ export interface CreateVideoParams {
157
157
  strict?: boolean;
158
158
  }
159
159
  export interface RefreshStatsParams {
160
+ org_group?: string;
161
+ }
162
+ export interface RefreshStatsError {
160
163
  accountId: string;
164
+ username: string;
165
+ error: string;
161
166
  }
162
167
  export interface RefreshStatsResponse {
163
- account_stats: AccountStat;
168
+ accounts_refreshed: number;
169
+ accounts_failed: number;
170
+ total_accounts: number;
171
+ account_stats: AccountStat[];
164
172
  post_stats: PostStat[];
165
173
  post_stats_count: number;
174
+ errors?: RefreshStatsError[];
166
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "1.0.9",
3
+ "version": "1.1.1",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",