ugcinc 3.29.0 → 3.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.
@@ -376,8 +376,8 @@ function getAllNodes() {
376
376
  category: "Output",
377
377
  nodeCategory: "terminal",
378
378
  // Dynamic inputs based on autoPostConfig.mode:
379
- // - video mode: video (required), account, caption
380
- // - slideshow mode: dynamic image inputs from config, account, caption
379
+ // - video mode: video (required), account, caption, social-audio
380
+ // - slideshow mode: dynamic image inputs from config, account, caption, social-audio
381
381
  inputs: [
382
382
  {
383
383
  id: "account",
@@ -389,6 +389,11 @@ function getAllNodes() {
389
389
  type: "text",
390
390
  required: false,
391
391
  },
392
+ {
393
+ id: "social-audio",
394
+ type: "social_audio",
395
+ required: false,
396
+ },
392
397
  ],
393
398
  outputs: [],
394
399
  },
package/dist/media.d.ts CHANGED
@@ -1,14 +1,20 @@
1
1
  import { BaseClient } from './base';
2
- import type { Media, GetMediaParams, UploadMediaResponse, UpdateMediaTagParams, UpdateMediaTagsParams, UpdateMediaTagsResponse, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, GetUploadTokenParams, UploadTokenResponse, ImportTextParams, ImportTextResponse, ApiResponse } from './types';
2
+ import type { Media, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, UpdateMediaTagsParams, UpdateMediaTagsResponse, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, CreateSocialAudioParams, GetUploadTokenParams, UploadTokenResponse, ImportTextParams, ImportTextResponse, ApiResponse } from './types';
3
3
  /**
4
4
  * Client for managing media files
5
5
  */
6
6
  export declare class MediaClient extends BaseClient {
7
7
  /**
8
8
  * Get media for the organization
9
+ * Returns both user_media and social_audio combined
9
10
  * Can filter by ids or tag
10
11
  */
11
12
  getMedia(params?: GetMediaParams): Promise<ApiResponse<Media[]>>;
13
+ /**
14
+ * Get social audio for the organization
15
+ * Can filter by ids or tag
16
+ */
17
+ getSocialAudio(params?: GetSocialAudioParams): Promise<ApiResponse<SocialAudio[]>>;
12
18
  /**
13
19
  * Create media from URL(s)
14
20
  * Creates media records from files already uploaded to blob storage
@@ -22,12 +28,14 @@ export declare class MediaClient extends BaseClient {
22
28
  getUploadToken(params: GetUploadTokenParams): Promise<ApiResponse<UploadTokenResponse>>;
23
29
  /**
24
30
  * Update tags on multiple media items in a single request
31
+ * Works for both user_media and social_audio
25
32
  * @param params.updates - Array of {id, tag} pairs to update
26
33
  */
27
34
  updateTags(params: UpdateMediaTagsParams): Promise<ApiResponse<UpdateMediaTagsResponse>>;
28
35
  /**
29
36
  * @deprecated Use updateTags() instead for bulk operations
30
37
  * Update the tag on a single media item
38
+ * Works for both user_media and social_audio
31
39
  */
32
40
  updateTag(params: UpdateMediaTagParams): Promise<ApiResponse<UpdateMediaTagsResponse>>;
33
41
  /**
@@ -35,6 +43,11 @@ export declare class MediaClient extends BaseClient {
35
43
  * Also deletes the files from blob storage
36
44
  */
37
45
  delete(params: DeleteMediaParams): Promise<ApiResponse<DeleteMediaResponse>>;
46
+ /**
47
+ * Create a social audio from a TikTok URL
48
+ * Extracts audio and cover image from TikTok video or music URL
49
+ */
50
+ createSocialAudio(params: CreateSocialAudioParams): Promise<ApiResponse<SocialAudio>>;
38
51
  /**
39
52
  * Import text content as media
40
53
  * Creates text media entries from raw text content
package/dist/media.js CHANGED
@@ -8,11 +8,19 @@ const base_1 = require("./base");
8
8
  class MediaClient extends base_1.BaseClient {
9
9
  /**
10
10
  * Get media for the organization
11
+ * Returns both user_media and social_audio combined
11
12
  * Can filter by ids or tag
12
13
  */
13
14
  async getMedia(params) {
14
15
  return this.post('/media', params ?? {});
15
16
  }
17
+ /**
18
+ * Get social audio for the organization
19
+ * Can filter by ids or tag
20
+ */
21
+ async getSocialAudio(params) {
22
+ return this.post('/media/social-audio', params ?? {});
23
+ }
16
24
  /**
17
25
  * Create media from URL(s)
18
26
  * Creates media records from files already uploaded to blob storage
@@ -30,6 +38,7 @@ class MediaClient extends base_1.BaseClient {
30
38
  }
31
39
  /**
32
40
  * Update tags on multiple media items in a single request
41
+ * Works for both user_media and social_audio
33
42
  * @param params.updates - Array of {id, tag} pairs to update
34
43
  */
35
44
  async updateTags(params) {
@@ -38,6 +47,7 @@ class MediaClient extends base_1.BaseClient {
38
47
  /**
39
48
  * @deprecated Use updateTags() instead for bulk operations
40
49
  * Update the tag on a single media item
50
+ * Works for both user_media and social_audio
41
51
  */
42
52
  async updateTag(params) {
43
53
  return this.post('/media/update-tag', { updates: [params] });
@@ -49,6 +59,13 @@ class MediaClient extends base_1.BaseClient {
49
59
  async delete(params) {
50
60
  return this.post('/media/delete', params);
51
61
  }
62
+ /**
63
+ * Create a social audio from a TikTok URL
64
+ * Extracts audio and cover image from TikTok video or music URL
65
+ */
66
+ async createSocialAudio(params) {
67
+ return this.post('/media/social-audio/upload', params);
68
+ }
52
69
  /**
53
70
  * Import text content as media
54
71
  * Creates text media entries from raw text content
package/dist/types.d.ts CHANGED
@@ -249,6 +249,7 @@ export interface CreateSlideshowParams {
249
249
  accountId: string | null;
250
250
  caption?: string;
251
251
  title?: string;
252
+ socialAudioId?: string;
252
253
  postTime?: string;
253
254
  imageUrls: string[];
254
255
  strict?: boolean;
@@ -267,6 +268,7 @@ export interface GetPostStatusParams {
267
268
  export interface CreateVideoParams {
268
269
  accountId: string | null;
269
270
  caption?: string;
271
+ socialAudioId?: string;
270
272
  postTime?: string;
271
273
  videoUrl: string;
272
274
  strict?: boolean;
@@ -749,7 +751,7 @@ export type StaticSegment = ImageSegment | TextSegment;
749
751
  /**
750
752
  * Automation types
751
753
  */
752
- export type MediaType = 'video' | 'image' | 'audio' | 'text' | 'account' | 'date';
754
+ export type MediaType = 'video' | 'image' | 'audio' | 'text' | 'account' | 'date' | 'social_audio';
753
755
  /**
754
756
  * Extended port types (includes non-media types for special nodes)
755
757
  */
@@ -803,7 +805,7 @@ export interface NodePort {
803
805
  /**
804
806
  * Functional category for automation nodes
805
807
  * - trigger: Nodes that start an automation (manual-trigger, recurrence)
806
- * - source: Nodes that provide input data (image, video, audio, text, account)
808
+ * - source: Nodes that provide input data (image, video, audio, social-audio, text, account)
807
809
  * - generator: Nodes that transform or generate content (image-template, video-template, image-generation, text-generation, sub-agent)
808
810
  * - terminal: Nodes that end an automation (output, auto-post, save-to-media)
809
811
  */
@@ -831,7 +833,7 @@ export interface NodeControlConfig {
831
833
  */
832
834
  isInitializer?: boolean;
833
835
  }
834
- export type NodeTypeEnum = 'text' | 'media' | 'video-import' | 'image-template' | 'video-template' | 'image-generation' | 'video-generation' | 'custom-model' | 'text-generation' | 'output' | 'manual-trigger' | 'recurrence' | 'sub-agent' | 'account' | 'auto-post' | 'save-to-media' | 'deduplicate' | 'for-each' | 'transcript' | 'auto-caption';
836
+ export type NodeTypeEnum = 'social-audio' | 'text' | 'media' | 'video-import' | 'image-template' | 'video-template' | 'image-generation' | 'video-generation' | 'custom-model' | 'text-generation' | 'output' | 'manual-trigger' | 'recurrence' | 'sub-agent' | 'account' | 'auto-post' | 'save-to-media' | 'deduplicate' | 'for-each' | 'transcript' | 'auto-caption';
835
837
  export interface OutputSchemaProperty {
836
838
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
837
839
  items?: 'string' | 'number' | 'boolean';
@@ -950,7 +952,7 @@ export interface WorkflowNodeDefinition {
950
952
  export interface OutputInput {
951
953
  id: string;
952
954
  title: string;
953
- type: 'image' | 'video' | 'audio' | 'text';
955
+ type: 'image' | 'video' | 'audio' | 'social_audio' | 'text';
954
956
  }
955
957
  export interface OutputNodeConfig {
956
958
  inputs: OutputInput[];
@@ -960,7 +962,7 @@ export interface OutputNodeConfig {
960
962
  */
961
963
  export interface ManualTriggerOutput {
962
964
  id: string;
963
- type: 'image' | 'video' | 'audio' | 'text' | 'account';
965
+ type: 'image' | 'video' | 'audio' | 'text' | 'social_audio' | 'account';
964
966
  }
965
967
  /**
966
968
  * Iteration mode for trigger nodes with account iteration
@@ -1012,7 +1014,7 @@ export interface RecurrenceMediaOutput {
1012
1014
  /** Unique ID for this output port (e.g., "background-image", "overlay") */
1013
1015
  id: string;
1014
1016
  /** Media type for this port */
1015
- type: 'image' | 'video' | 'audio' | 'text';
1017
+ type: 'image' | 'video' | 'audio' | 'text' | 'social_audio';
1016
1018
  /** Selection mode for this output's media source */
1017
1019
  selectionMode: 'specific' | 'by-tag';
1018
1020
  /** Media IDs for this output (used when selectionMode is 'specific') */
@@ -1068,7 +1070,7 @@ export type MediaNodeEnabledType = 'image' | 'video' | 'audio';
1068
1070
  * Recurrence media enabled type
1069
1071
  * Includes all media types that can be output from recurrence nodes
1070
1072
  */
1071
- export type RecurrenceMediaEnabledType = 'image' | 'video' | 'audio' | 'text';
1073
+ export type RecurrenceMediaEnabledType = 'image' | 'video' | 'audio' | 'text' | 'social_audio';
1072
1074
  /**
1073
1075
  * Media node configuration - consolidated source node for image, video, and audio
1074
1076
  */
@@ -1143,6 +1145,13 @@ export interface AutoPostNodeConfig {
1143
1145
  inputs?: AutoPostInput[];
1144
1146
  /** Scheduling configuration */
1145
1147
  scheduling?: PostSchedulingConfig;
1148
+ /** Social audio configuration */
1149
+ socialAudio?: {
1150
+ /** If true, read from input port; if false, use selectedIds */
1151
+ isVariable: boolean;
1152
+ /** Selected social audio IDs (when isVariable is false) - one is randomly chosen when posting */
1153
+ selectedIds?: string[];
1154
+ };
1146
1155
  }
1147
1156
  /**
1148
1157
  * Save To Media node input definition
@@ -1452,11 +1461,29 @@ export interface UserMedia {
1452
1461
  created_at: string;
1453
1462
  media_type: 'user_media';
1454
1463
  }
1455
- export type Media = UserMedia;
1464
+ export interface SocialAudio {
1465
+ id: string;
1466
+ org_id: string;
1467
+ name: string | null;
1468
+ tag: string | null;
1469
+ social_post_link: string | null;
1470
+ social_audio_link: string | null;
1471
+ platform_type: 'tiktok' | null;
1472
+ preview_url: string | null;
1473
+ audio_url: string | null;
1474
+ created_at: string;
1475
+ media_type: 'social_audio';
1476
+ type: 'social_audio';
1477
+ }
1478
+ export type Media = UserMedia | SocialAudio;
1456
1479
  export interface GetMediaParams {
1457
1480
  ids?: string[];
1458
1481
  tag?: string;
1459
1482
  }
1483
+ export interface GetSocialAudioParams {
1484
+ ids?: string[];
1485
+ tag?: string;
1486
+ }
1460
1487
  export interface UploadMediaParams {
1461
1488
  files: File[];
1462
1489
  tag?: string;
@@ -1503,6 +1530,10 @@ export interface DeleteMediaResponse {
1503
1530
  }>;
1504
1531
  message: string;
1505
1532
  }
1533
+ export interface CreateSocialAudioParams {
1534
+ url: string;
1535
+ tag?: string;
1536
+ }
1506
1537
  export interface ImportTextParams {
1507
1538
  texts: Array<{
1508
1539
  content: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "3.29.0",
3
+ "version": "3.31.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",