ugcinc 2.30.0 → 2.31.0
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 +1 -1
- package/dist/stats.d.ts +24 -1
- package/dist/stats.js +25 -0
- package/dist/types.d.ts +38 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export { RenderClient } from './render';
|
|
|
13
13
|
export { AutomationsClient, getAllNodes, getNodeByType } from './automations';
|
|
14
14
|
export { MediaClient } from './media';
|
|
15
15
|
export type { ClientConfig, } from './base';
|
|
16
|
-
export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, RenderJobSubmit, RenderVideoRequest, RenderImageRequest, RenderJobResponse, RenderJobStatus, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, MediaType, NodePort, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, } from './types';
|
|
16
|
+
export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, RenderJobSubmit, RenderVideoRequest, RenderImageRequest, RenderJobResponse, RenderJobStatus, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, } from './types';
|
package/dist/stats.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type { AccountStat, PostStat, GetAccountStatsParams, GetPostStatsParams, RefreshStatsParams, RefreshStatsResponse, DailyAggregatedStat, GetDailyAggregatedStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, ApiResponse } from './types';
|
|
2
|
+
import type { AccountStat, PostStat, GetAccountStatsParams, GetPostStatsParams, RefreshStatsParams, RefreshStatsResponse, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, ApiResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for managing statistics
|
|
5
5
|
*/
|
|
@@ -74,6 +74,29 @@ export declare class StatsClient extends BaseClient {
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
getDailyAggregated(params: GetDailyAggregatedStatsParams): Promise<ApiResponse<DailyAggregatedStat[]>>;
|
|
77
|
+
/**
|
|
78
|
+
* Get daily post statistics for chart tooltips
|
|
79
|
+
*
|
|
80
|
+
* Returns per-video daily stats with both cumulative values and daily changes.
|
|
81
|
+
* Perfect for showing per-video performance in chart tooltips.
|
|
82
|
+
*
|
|
83
|
+
* @param params - Date range and filter parameters (startDate and endDate required)
|
|
84
|
+
* @returns Array of daily post statistics with changes
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const dailyPostStats = await client.stats.getDailyPostStats({
|
|
89
|
+
* startDate: '2024-01-01',
|
|
90
|
+
* endDate: '2024-01-31'
|
|
91
|
+
* });
|
|
92
|
+
*
|
|
93
|
+
* // Use for tooltips - group by date
|
|
94
|
+
* dailyPostStats.data.forEach(stat => {
|
|
95
|
+
* console.log(`${stat.date}: ${stat.post_id} gained +${stat.views_change} views`);
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
getDailyPostStats(params: GetDailyPostStatsParams): Promise<ApiResponse<DailyPostStat[]>>;
|
|
77
100
|
/**
|
|
78
101
|
* Get top N accounts by a specific metric
|
|
79
102
|
*
|
package/dist/stats.js
CHANGED
|
@@ -82,6 +82,31 @@ class StatsClient extends base_1.BaseClient {
|
|
|
82
82
|
async getDailyAggregated(params) {
|
|
83
83
|
return this.post('/stats/aggregated/daily', params);
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Get daily post statistics for chart tooltips
|
|
87
|
+
*
|
|
88
|
+
* Returns per-video daily stats with both cumulative values and daily changes.
|
|
89
|
+
* Perfect for showing per-video performance in chart tooltips.
|
|
90
|
+
*
|
|
91
|
+
* @param params - Date range and filter parameters (startDate and endDate required)
|
|
92
|
+
* @returns Array of daily post statistics with changes
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const dailyPostStats = await client.stats.getDailyPostStats({
|
|
97
|
+
* startDate: '2024-01-01',
|
|
98
|
+
* endDate: '2024-01-31'
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* // Use for tooltips - group by date
|
|
102
|
+
* dailyPostStats.data.forEach(stat => {
|
|
103
|
+
* console.log(`${stat.date}: ${stat.post_id} gained +${stat.views_change} views`);
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
async getDailyPostStats(params) {
|
|
108
|
+
return this.post('/stats/aggregated/daily-posts', params);
|
|
109
|
+
}
|
|
85
110
|
/**
|
|
86
111
|
* Get top N accounts by a specific metric
|
|
87
112
|
*
|
package/dist/types.d.ts
CHANGED
|
@@ -252,6 +252,34 @@ export interface GetDailyAggregatedStatsParams {
|
|
|
252
252
|
org_group?: string;
|
|
253
253
|
user_group?: string;
|
|
254
254
|
}
|
|
255
|
+
export interface DailyPostStat {
|
|
256
|
+
date: Date | string;
|
|
257
|
+
post_id: string;
|
|
258
|
+
account_id: string;
|
|
259
|
+
caption: string | null;
|
|
260
|
+
media_urls: string[] | null;
|
|
261
|
+
social_id: string | null;
|
|
262
|
+
account_username: string | null;
|
|
263
|
+
account_type: string;
|
|
264
|
+
views: number;
|
|
265
|
+
likes: number;
|
|
266
|
+
comments: number;
|
|
267
|
+
shares: number;
|
|
268
|
+
saves: number;
|
|
269
|
+
views_change: number;
|
|
270
|
+
likes_change: number;
|
|
271
|
+
comments_change: number;
|
|
272
|
+
shares_change: number;
|
|
273
|
+
saves_change: number;
|
|
274
|
+
}
|
|
275
|
+
export interface GetDailyPostStatsParams {
|
|
276
|
+
startDate: string;
|
|
277
|
+
endDate: string;
|
|
278
|
+
accountIds?: string[];
|
|
279
|
+
tag?: string;
|
|
280
|
+
org_group?: string;
|
|
281
|
+
user_group?: string;
|
|
282
|
+
}
|
|
255
283
|
export interface TopAccount {
|
|
256
284
|
account_id: string;
|
|
257
285
|
username: string | null;
|
|
@@ -381,6 +409,12 @@ export interface BaseSegmentProps {
|
|
|
381
409
|
relativeStart?: number;
|
|
382
410
|
/** End time as fraction of parent duration (0-1, default: 1). Only used when parentId is set. */
|
|
383
411
|
relativeEnd?: number;
|
|
412
|
+
/**
|
|
413
|
+
* Fade-in effect - applies a black overlay that smoothly fades out over the specified duration.
|
|
414
|
+
* The segment and all its overlays will appear to fade in from black.
|
|
415
|
+
*/
|
|
416
|
+
/** Duration in milliseconds for the fade-in effect (0 or undefined = no fade) */
|
|
417
|
+
fadeIn?: number;
|
|
384
418
|
}
|
|
385
419
|
/**
|
|
386
420
|
* Visual segment properties (video, image, text, editor)
|
|
@@ -415,10 +449,8 @@ export interface VideoSegment extends VisualSegmentProps {
|
|
|
415
449
|
speed?: number;
|
|
416
450
|
/** Audio volume percentage 0-100 (0 = muted, 100 = full) (default: 100) */
|
|
417
451
|
volume?: number;
|
|
418
|
-
/**
|
|
419
|
-
|
|
420
|
-
/** Fade-in duration in milliseconds (default: 500) */
|
|
421
|
-
fadeInDuration?: number;
|
|
452
|
+
/** Corner radius in pixels for rounded corners (default: 0, no rounding) */
|
|
453
|
+
borderRadius?: number;
|
|
422
454
|
}
|
|
423
455
|
/**
|
|
424
456
|
* Audio segment - background audio or music
|
|
@@ -439,10 +471,8 @@ export interface ImageSegment extends VisualSegmentProps {
|
|
|
439
471
|
fit?: 'cover' | 'contain' | 'fill';
|
|
440
472
|
/** Loop animated GIFs (default: false) */
|
|
441
473
|
loop?: boolean;
|
|
442
|
-
/**
|
|
443
|
-
|
|
444
|
-
/** Fade-in duration in milliseconds (default: 500) */
|
|
445
|
-
fadeInDuration?: number;
|
|
474
|
+
/** Corner radius in pixels for rounded corners (default: 0, no rounding) */
|
|
475
|
+
borderRadius?: number;
|
|
446
476
|
}
|
|
447
477
|
/**
|
|
448
478
|
* Text segment - rich text overlays with full typography control
|