ugcinc 2.4.4 → 2.5.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 CHANGED
@@ -11,4 +11,4 @@ export { StatsClient } from './stats';
11
11
  export { OrganizationClient } from './org';
12
12
  export { RenderClient } from './render';
13
13
  export type { ClientConfig, } from './base';
14
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, 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, } from './types';
14
+ 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, } from './types';
package/dist/types.d.ts CHANGED
@@ -265,65 +265,158 @@ export interface EditorChannel {
265
265
  id: string;
266
266
  segments: EditorSegment[];
267
267
  }
268
- interface BaseSegmentProps {
268
+ /**
269
+ * Time value - can be absolute (milliseconds) or relative (0-1 percentage)
270
+ *
271
+ * @example
272
+ * // Absolute: 500 milliseconds
273
+ * { type: 'absolute', value: 500 }
274
+ *
275
+ * @example
276
+ * // Relative: 50% of total duration
277
+ * { type: 'relative', value: 0.5 }
278
+ */
279
+ export interface TimeValue {
280
+ type: 'absolute' | 'relative';
281
+ value: number;
282
+ }
283
+ /**
284
+ * Base properties for all segments
285
+ */
286
+ export interface BaseSegmentProps {
287
+ /** Unique segment identifier */
269
288
  id: string;
289
+ /** Public URL to media file */
270
290
  source: string;
291
+ /** Sequence order within channel (0-based) */
271
292
  order: number;
272
- offset: {
273
- type: 'absolute' | 'relative';
274
- value: number;
275
- };
293
+ /** Time offset after previous segment starts */
294
+ offset: TimeValue;
295
+ /** Trim from start in milliseconds (default: 0) */
276
296
  startTrim?: number;
297
+ /** Trim from end in milliseconds (default: 0) */
277
298
  endTrim?: number;
278
- duration?: {
279
- type: 'absolute' | 'relative';
280
- value: number;
281
- };
282
- xOffset?: number;
283
- yOffset?: number;
284
- width?: number;
285
- height?: number;
299
+ /** Override segment duration (auto-calculated if omitted) */
300
+ duration?: TimeValue;
301
+ }
302
+ /**
303
+ * Visual segment properties (video, image, text, editor)
304
+ */
305
+ export interface VisualSegmentProps extends BaseSegmentProps {
306
+ /** Horizontal position from left edge in pixels */
307
+ xOffset: number;
308
+ /** Vertical position from top edge in pixels */
309
+ yOffset: number;
310
+ /** Width in pixels */
311
+ width: number;
312
+ /** Height in pixels */
313
+ height: number;
314
+ /** Layer order - higher values appear on top (default: 0) */
286
315
  zIndex?: number;
316
+ /** Scale multiplier (1.0 = 100%, 2.0 = 200%) (default: 1) */
287
317
  scale?: number;
318
+ /** Rotation in degrees clockwise (default: 0) */
288
319
  rotation?: number;
320
+ /** Opacity percentage 0-100 (default: 100) */
289
321
  opacity?: number;
290
322
  }
291
- export interface VideoSegment extends BaseSegmentProps {
323
+ /**
324
+ * Video segment - displays video content with optional audio
325
+ * Only available for video output type
326
+ */
327
+ export interface VideoSegment extends VisualSegmentProps {
292
328
  type: 'video';
329
+ /** How video fits in bounds: cover (fill+crop), contain (fit+letterbox), fill (stretch) (default: 'cover') */
293
330
  fit?: 'cover' | 'contain' | 'fill';
331
+ /** Playback speed multiplier (0.5 = half speed, 2.0 = double speed) (default: 1) */
294
332
  speed?: number;
333
+ /** Audio volume percentage 0-100 (0 = muted, 100 = full) (default: 100) */
295
334
  volume?: number;
296
335
  }
297
- export interface AudioSegment extends Omit<BaseSegmentProps, 'xOffset' | 'yOffset' | 'width' | 'height' | 'zIndex' | 'scale' | 'rotation' | 'opacity'> {
336
+ /**
337
+ * Audio segment - background audio or music
338
+ * Only available for video output type
339
+ */
340
+ export interface AudioSegment extends BaseSegmentProps {
298
341
  type: 'audio';
342
+ /** Audio volume percentage 0-100 (default: 100) */
299
343
  volume?: number;
300
344
  }
301
- export interface ImageSegment extends BaseSegmentProps {
345
+ /**
346
+ * Image segment - static images or animated GIFs
347
+ * Available for both video and image output types
348
+ */
349
+ export interface ImageSegment extends VisualSegmentProps {
302
350
  type: 'image';
351
+ /** How image fits in bounds (default: 'contain') */
303
352
  fit?: 'cover' | 'contain' | 'fill';
353
+ /** Loop animated GIFs (default: false) */
304
354
  loop?: boolean;
305
355
  }
306
- export interface TextSegment extends Omit<BaseSegmentProps, 'source'> {
356
+ /**
357
+ * Text segment - rich text overlays with full typography control
358
+ * Available for both video and image output types
359
+ */
360
+ export interface TextSegment extends VisualSegmentProps {
307
361
  type: 'text';
308
362
  source: '';
309
- text?: string;
310
- alignment?: 'left' | 'center' | 'right';
363
+ /** The text content (supports emojis) */
364
+ text: string;
365
+ /** Horizontal alignment (default: 'left') */
366
+ alignment?: 'left' | 'center' | 'right' | 'justify';
367
+ /** Vertical alignment within bounds (default: 'top') */
311
368
  verticalAlign?: 'top' | 'middle' | 'bottom';
369
+ /** Text direction (default: 'ltr') */
312
370
  direction?: 'ltr' | 'rtl';
371
+ /** Inner padding in pixels (default: 0) */
313
372
  padding?: number;
314
- fontType?: string;
373
+ /** Font family (default: 'tiktok') */
374
+ fontType?: 'tiktok' | 'apple' | 'arial';
375
+ /** Font size in pixels (default: 40) */
315
376
  fontSize?: number;
316
- fontWeight?: string;
377
+ /** Font weight (default: 'normal') */
378
+ fontWeight?: 'normal' | 'bold';
379
+ /** Line height multiplier (default: 1.2) */
317
380
  lineHeight?: number;
381
+ /** Letter spacing in pixels (default: 0) */
318
382
  letterSpacing?: number;
319
- textWrap?: string;
320
- wordBreak?: string;
383
+ /** How text wraps to new lines (default: 'word') */
384
+ textWrap?: 'word' | 'char' | 'none';
385
+ /** How words break across lines (default: 'normal') */
386
+ wordBreak?: 'normal' | 'break-all' | 'break-word';
387
+ /** Automatic hyphenation (default: 'none') */
388
+ hyphenation?: 'none' | 'auto';
389
+ /** Maximum lines (0 = unlimited) (default: 0) */
390
+ maxLines?: number;
391
+ /** How overflow is handled (default: 'clip') */
392
+ textOverflow?: 'clip' | 'ellipsis';
393
+ /** Ellipsis string for overflow (default: '...') */
394
+ ellipsis?: string;
395
+ /** Text color (default: '#FFFFFF') */
321
396
  color?: string;
397
+ /** Background color with optional alpha (default: transparent) */
322
398
  backgroundColor?: string;
399
+ /** Text outline color (default: none) */
323
400
  strokeColor?: string;
401
+ /** Outline width in pixels (default: 0) */
324
402
  strokeWidth?: number;
325
403
  }
326
- export type EditorSegment = VideoSegment | AudioSegment | ImageSegment | TextSegment;
404
+ /**
405
+ * Editor segment - nested composition (editor within editor)
406
+ * Only available for video output type
407
+ */
408
+ export interface EditorSegment_Nested extends VisualSegmentProps {
409
+ type: 'editor';
410
+ /** Nested editor configuration */
411
+ editor: EditorConfig;
412
+ /** How rendered video fits in bounds (default: 'contain') */
413
+ fit?: 'cover' | 'contain' | 'fill';
414
+ /** Playback speed of nested composition (default: 1) */
415
+ speed?: number;
416
+ /** Audio volume of nested composition 0-100 (default: 100) */
417
+ volume?: number;
418
+ }
419
+ export type EditorSegment = VideoSegment | AudioSegment | ImageSegment | TextSegment | EditorSegment_Nested;
327
420
  export type StaticSegment = ImageSegment | TextSegment;
328
421
  export interface RenderVideoRequest {
329
422
  editor?: VideoEditorConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.4.4",
3
+ "version": "2.5.0",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",