ugcinc 4.0.2 → 4.1.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.
Files changed (154) hide show
  1. package/dist/accounts.d.ts +146 -1
  2. package/dist/automations/index.d.ts +174 -0
  3. package/dist/automations/index.js +194 -0
  4. package/dist/automations/nodes/account.d.ts +18 -0
  5. package/dist/automations/nodes/account.js +29 -0
  6. package/dist/automations/nodes/auto-caption.d.ts +64 -0
  7. package/dist/automations/nodes/auto-caption.js +46 -0
  8. package/dist/automations/nodes/auto-post.d.ts +81 -0
  9. package/dist/automations/nodes/auto-post.js +54 -0
  10. package/dist/automations/nodes/branch.d.ts +58 -0
  11. package/dist/automations/nodes/branch.js +50 -0
  12. package/dist/automations/nodes/collect.d.ts +16 -0
  13. package/dist/automations/nodes/collect.js +56 -0
  14. package/dist/automations/nodes/compose-workflow.d.ts +21 -0
  15. package/dist/automations/nodes/compose-workflow.js +42 -0
  16. package/dist/automations/nodes/create-dm.d.ts +96 -0
  17. package/dist/automations/nodes/create-dm.js +88 -0
  18. package/dist/automations/nodes/custom-model.d.ts +19 -0
  19. package/dist/automations/nodes/custom-model.js +52 -0
  20. package/dist/automations/nodes/deduplicate.d.ts +8 -0
  21. package/dist/automations/nodes/deduplicate.js +36 -0
  22. package/dist/automations/nodes/destructure.d.ts +25 -0
  23. package/dist/automations/nodes/destructure.js +65 -0
  24. package/dist/automations/nodes/for-each.d.ts +23 -0
  25. package/dist/automations/nodes/for-each.js +84 -0
  26. package/dist/automations/nodes/generate-image.d.ts +16 -0
  27. package/dist/automations/nodes/generate-image.js +45 -0
  28. package/dist/automations/nodes/generate-video.d.ts +16 -0
  29. package/dist/automations/nodes/generate-video.js +45 -0
  30. package/dist/automations/nodes/if.d.ts +22 -0
  31. package/dist/automations/nodes/if.js +44 -0
  32. package/dist/automations/nodes/image-composer.d.ts +33 -0
  33. package/dist/automations/nodes/image-composer.js +95 -0
  34. package/dist/automations/nodes/index.d.ts +20 -0
  35. package/dist/automations/nodes/index.js +93 -0
  36. package/dist/automations/nodes/llm.d.ts +27 -0
  37. package/dist/automations/nodes/llm.js +85 -0
  38. package/dist/automations/nodes/manual-trigger.d.ts +34 -0
  39. package/dist/automations/nodes/manual-trigger.js +32 -0
  40. package/dist/automations/nodes/media.d.ts +17 -0
  41. package/dist/automations/nodes/media.js +40 -0
  42. package/dist/automations/nodes/not.d.ts +6 -0
  43. package/dist/automations/nodes/not.js +35 -0
  44. package/dist/automations/nodes/output.d.ts +30 -0
  45. package/dist/automations/nodes/output.js +32 -0
  46. package/dist/automations/nodes/random-route.d.ts +52 -0
  47. package/dist/automations/nodes/random-route.js +53 -0
  48. package/dist/automations/nodes/random.d.ts +16 -0
  49. package/dist/automations/nodes/random.js +50 -0
  50. package/dist/automations/nodes/recurrence.d.ts +69 -0
  51. package/dist/automations/nodes/recurrence.js +50 -0
  52. package/dist/automations/nodes/save-to-media.d.ts +32 -0
  53. package/dist/automations/nodes/save-to-media.js +31 -0
  54. package/dist/automations/nodes/screenshot-animation.d.ts +7 -0
  55. package/dist/automations/nodes/screenshot-animation.js +36 -0
  56. package/dist/automations/nodes/social-audio.d.ts +8 -0
  57. package/dist/automations/nodes/social-audio.js +30 -0
  58. package/dist/automations/nodes/text.d.ts +7 -0
  59. package/dist/automations/nodes/text.js +41 -0
  60. package/dist/automations/nodes/transcript.d.ts +6 -0
  61. package/dist/automations/nodes/transcript.js +46 -0
  62. package/dist/automations/nodes/types.d.ts +178 -0
  63. package/dist/automations/nodes/types.js +22 -0
  64. package/dist/automations/nodes/video-composer.d.ts +25 -0
  65. package/dist/automations/nodes/video-composer.js +71 -0
  66. package/dist/automations/nodes/video-import.d.ts +27 -0
  67. package/dist/automations/nodes/video-import.js +37 -0
  68. package/dist/automations/types.d.ts +544 -0
  69. package/dist/automations/types.js +101 -0
  70. package/dist/automations.d.ts +5 -33
  71. package/dist/automations.js +6 -647
  72. package/dist/comments.d.ts +26 -1
  73. package/dist/comments.js +3 -0
  74. package/dist/graph-controller.d.ts +194 -0
  75. package/dist/graph-controller.js +623 -0
  76. package/dist/index.d.ts +38 -9
  77. package/dist/index.js +43 -23
  78. package/dist/internal-utils.d.ts +8 -0
  79. package/dist/internal-utils.js +22 -0
  80. package/dist/media.d.ts +135 -1
  81. package/dist/nodes/account.d.ts +7 -0
  82. package/dist/nodes/account.js +29 -0
  83. package/dist/nodes/auto-caption.d.ts +17 -0
  84. package/dist/nodes/auto-caption.js +46 -0
  85. package/dist/nodes/auto-post.d.ts +21 -0
  86. package/dist/nodes/auto-post.js +54 -0
  87. package/dist/nodes/branch.d.ts +12 -0
  88. package/dist/nodes/branch.js +50 -0
  89. package/dist/nodes/collect.d.ts +6 -0
  90. package/dist/nodes/collect.js +56 -0
  91. package/dist/nodes/compose-workflow.d.ts +21 -0
  92. package/dist/nodes/compose-workflow.js +42 -0
  93. package/dist/nodes/create-dm.d.ts +40 -0
  94. package/dist/nodes/create-dm.js +88 -0
  95. package/dist/nodes/custom-model.d.ts +19 -0
  96. package/dist/nodes/custom-model.js +52 -0
  97. package/dist/nodes/deduplicate.d.ts +8 -0
  98. package/dist/nodes/deduplicate.js +36 -0
  99. package/dist/nodes/destructure.d.ts +25 -0
  100. package/dist/nodes/destructure.js +65 -0
  101. package/dist/nodes/for-each.d.ts +23 -0
  102. package/dist/nodes/for-each.js +84 -0
  103. package/dist/nodes/generate-image.d.ts +16 -0
  104. package/dist/nodes/generate-image.js +45 -0
  105. package/dist/nodes/generate-video.d.ts +16 -0
  106. package/dist/nodes/generate-video.js +45 -0
  107. package/dist/nodes/if.d.ts +22 -0
  108. package/dist/nodes/if.js +44 -0
  109. package/dist/nodes/image-composer.d.ts +14 -0
  110. package/dist/nodes/image-composer.js +95 -0
  111. package/dist/nodes/index.d.ts +20 -0
  112. package/dist/nodes/index.js +93 -0
  113. package/dist/nodes/llm.d.ts +27 -0
  114. package/dist/nodes/llm.js +85 -0
  115. package/dist/nodes/manual-trigger.d.ts +16 -0
  116. package/dist/nodes/manual-trigger.js +32 -0
  117. package/dist/nodes/media.d.ts +17 -0
  118. package/dist/nodes/media.js +40 -0
  119. package/dist/nodes/not.d.ts +6 -0
  120. package/dist/nodes/not.js +35 -0
  121. package/dist/nodes/output.d.ts +9 -0
  122. package/dist/nodes/output.js +32 -0
  123. package/dist/nodes/random-route.d.ts +3 -0
  124. package/dist/nodes/random-route.js +50 -0
  125. package/dist/nodes/random.d.ts +3 -0
  126. package/dist/nodes/random.js +48 -0
  127. package/dist/nodes/recurrence.d.ts +3 -0
  128. package/dist/nodes/recurrence.js +45 -0
  129. package/dist/nodes/save-to-media.d.ts +3 -0
  130. package/dist/nodes/save-to-media.js +26 -0
  131. package/dist/nodes/screenshot-animation.d.ts +7 -0
  132. package/dist/nodes/screenshot-animation.js +36 -0
  133. package/dist/nodes/social-audio.d.ts +3 -0
  134. package/dist/nodes/social-audio.js +26 -0
  135. package/dist/nodes/text.d.ts +3 -0
  136. package/dist/nodes/text.js +38 -0
  137. package/dist/nodes/transcript.d.ts +3 -0
  138. package/dist/nodes/transcript.js +42 -0
  139. package/dist/nodes/types.d.ts +146 -0
  140. package/dist/nodes/types.js +22 -0
  141. package/dist/nodes/video-composer.d.ts +3 -0
  142. package/dist/nodes/video-composer.js +67 -0
  143. package/dist/nodes/video-import.d.ts +3 -0
  144. package/dist/nodes/video-import.js +35 -0
  145. package/dist/org.d.ts +13 -1
  146. package/dist/ports.js +3 -9
  147. package/dist/posts.d.ts +88 -1
  148. package/dist/render/compositions/IMessageDmComposition/types.d.ts +20 -20
  149. package/dist/render/types/video.d.ts +2 -2
  150. package/dist/stats.d.ts +128 -1
  151. package/dist/tasks.d.ts +20 -1
  152. package/dist/types.d.ts +1 -2216
  153. package/dist/types.js +2 -124
  154. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -5,7 +5,10 @@
5
5
  * Official TypeScript/JavaScript client for the UGC Inc API
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.CommentsClient = exports.MediaClient = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.normalizePortTypes = exports.normalizePortType = exports.toLegacyPortType = exports.fromLegacyPortType = exports.isLegacyPortType = exports.formatPortType = exports.portType = exports.isImageToVideoModel = exports.isEditModel = exports.isAsyncExecutor = exports.NodeTypes = exports.extractTemplateVariables = exports.isInputPortRequired = exports.computeOutputPorts = exports.computeInputPorts = exports.areTypesCompatible = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
8
+ exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.isImageToVideoModel = exports.isEditModel = exports.formatPortType = exports.isAsyncExecutor = exports.NodeTypes = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.checkCrossContextViolation = exports.getForEachContext = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.computePortsForNode = exports.areTypesCompatible = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
9
+ // =============================================================================
10
+ // Client Exports
11
+ // =============================================================================
9
12
  var client_1 = require("./client");
10
13
  Object.defineProperty(exports, "UGCClient", { enumerable: true, get: function () { return client_1.UGCClient; } });
11
14
  var accounts_1 = require("./accounts");
@@ -22,34 +25,51 @@ var render_1 = require("./render");
22
25
  Object.defineProperty(exports, "RenderClient", { enumerable: true, get: function () { return render_1.RenderClient; } });
23
26
  var automations_1 = require("./automations");
24
27
  Object.defineProperty(exports, "AutomationsClient", { enumerable: true, get: function () { return automations_1.AutomationsClient; } });
25
- Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function () { return automations_1.getAllNodes; } });
26
- Object.defineProperty(exports, "getNodeByType", { enumerable: true, get: function () { return automations_1.getNodeByType; } });
27
- Object.defineProperty(exports, "getOutputSchema", { enumerable: true, get: function () { return automations_1.getOutputSchema; } });
28
- Object.defineProperty(exports, "areTypesCompatible", { enumerable: true, get: function () { return automations_1.areTypesCompatible; } });
29
- var ports_1 = require("./ports");
30
- Object.defineProperty(exports, "computeInputPorts", { enumerable: true, get: function () { return ports_1.computeInputPorts; } });
31
- Object.defineProperty(exports, "computeOutputPorts", { enumerable: true, get: function () { return ports_1.computeOutputPorts; } });
32
- Object.defineProperty(exports, "isInputPortRequired", { enumerable: true, get: function () { return ports_1.isInputPortRequired; } });
33
- Object.defineProperty(exports, "extractTemplateVariables", { enumerable: true, get: function () { return ports_1.extractTemplateVariables; } });
34
- var types_1 = require("./types");
28
+ var media_1 = require("./media");
29
+ Object.defineProperty(exports, "MediaClient", { enumerable: true, get: function () { return media_1.MediaClient; } });
30
+ var comments_1 = require("./comments");
31
+ Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: function () { return comments_1.CommentsClient; } });
32
+ // =============================================================================
33
+ // Graph Controller Exports
34
+ // =============================================================================
35
+ var graph_controller_1 = require("./graph-controller");
36
+ // Type compatibility
37
+ Object.defineProperty(exports, "areTypesCompatible", { enumerable: true, get: function () { return graph_controller_1.areTypesCompatible; } });
38
+ // Port computation
39
+ Object.defineProperty(exports, "computePortsForNode", { enumerable: true, get: function () { return graph_controller_1.computePortsForNode; } });
40
+ Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function () { return graph_controller_1.getAllNodes; } });
41
+ Object.defineProperty(exports, "getNodeByType", { enumerable: true, get: function () { return graph_controller_1.getNodeByType; } });
42
+ // Output schema
43
+ Object.defineProperty(exports, "getOutputSchema", { enumerable: true, get: function () { return graph_controller_1.getOutputSchema; } });
44
+ // Connection management
45
+ Object.defineProperty(exports, "deriveConnections", { enumerable: true, get: function () { return graph_controller_1.deriveConnections; } });
46
+ Object.defineProperty(exports, "addConnection", { enumerable: true, get: function () { return graph_controller_1.addConnection; } });
47
+ Object.defineProperty(exports, "removeConnection", { enumerable: true, get: function () { return graph_controller_1.removeConnection; } });
48
+ Object.defineProperty(exports, "removeNodeConnections", { enumerable: true, get: function () { return graph_controller_1.removeNodeConnections; } });
49
+ Object.defineProperty(exports, "cleanupStaleConnections", { enumerable: true, get: function () { return graph_controller_1.cleanupStaleConnections; } });
50
+ // For-each context validation
51
+ Object.defineProperty(exports, "getForEachContext", { enumerable: true, get: function () { return graph_controller_1.getForEachContext; } });
52
+ Object.defineProperty(exports, "checkCrossContextViolation", { enumerable: true, get: function () { return graph_controller_1.checkCrossContextViolation; } });
53
+ // Workflow validation
54
+ Object.defineProperty(exports, "validateWorkflow", { enumerable: true, get: function () { return graph_controller_1.validateWorkflow; } });
55
+ Object.defineProperty(exports, "getErrorNodeIds", { enumerable: true, get: function () { return graph_controller_1.getErrorNodeIds; } });
56
+ Object.defineProperty(exports, "getPortErrorsForNode", { enumerable: true, get: function () { return graph_controller_1.getPortErrorsForNode; } });
57
+ Object.defineProperty(exports, "hasMissingTriggerError", { enumerable: true, get: function () { return graph_controller_1.hasMissingTriggerError; } });
58
+ Object.defineProperty(exports, "hasMissingTerminalError", { enumerable: true, get: function () { return graph_controller_1.hasMissingTerminalError; } });
59
+ // =============================================================================
60
+ // Utility Exports
61
+ // =============================================================================
62
+ var types_1 = require("./automations/types");
35
63
  Object.defineProperty(exports, "NodeTypes", { enumerable: true, get: function () { return types_1.NodeTypes; } });
36
64
  Object.defineProperty(exports, "isAsyncExecutor", { enumerable: true, get: function () { return types_1.isAsyncExecutor; } });
37
- Object.defineProperty(exports, "isEditModel", { enumerable: true, get: function () { return types_1.isEditModel; } });
38
- Object.defineProperty(exports, "isImageToVideoModel", { enumerable: true, get: function () { return types_1.isImageToVideoModel; } });
39
- Object.defineProperty(exports, "portType", { enumerable: true, get: function () { return types_1.portType; } });
40
65
  Object.defineProperty(exports, "formatPortType", { enumerable: true, get: function () { return types_1.formatPortType; } });
41
- Object.defineProperty(exports, "isLegacyPortType", { enumerable: true, get: function () { return types_1.isLegacyPortType; } });
42
- Object.defineProperty(exports, "fromLegacyPortType", { enumerable: true, get: function () { return types_1.fromLegacyPortType; } });
43
- Object.defineProperty(exports, "toLegacyPortType", { enumerable: true, get: function () { return types_1.toLegacyPortType; } });
44
- Object.defineProperty(exports, "normalizePortType", { enumerable: true, get: function () { return types_1.normalizePortType; } });
45
- Object.defineProperty(exports, "normalizePortTypes", { enumerable: true, get: function () { return types_1.normalizePortTypes; } });
66
+ var generate_image_1 = require("./automations/nodes/generate-image");
67
+ Object.defineProperty(exports, "isEditModel", { enumerable: true, get: function () { return generate_image_1.isEditModel; } });
68
+ var generate_video_1 = require("./automations/nodes/generate-video");
69
+ Object.defineProperty(exports, "isImageToVideoModel", { enumerable: true, get: function () { return generate_video_1.isImageToVideoModel; } });
46
70
  var port_id_1 = require("./port-id");
47
71
  Object.defineProperty(exports, "portId", { enumerable: true, get: function () { return port_id_1.portId; } });
48
72
  Object.defineProperty(exports, "isValidPortId", { enumerable: true, get: function () { return port_id_1.isValidPortId; } });
49
73
  Object.defineProperty(exports, "portIdToTitle", { enumerable: true, get: function () { return port_id_1.portIdToTitle; } });
50
74
  Object.defineProperty(exports, "normalizeToPortId", { enumerable: true, get: function () { return port_id_1.normalizeToPortId; } });
51
75
  Object.defineProperty(exports, "PortIdSchema", { enumerable: true, get: function () { return port_id_1.PortIdSchema; } });
52
- var media_1 = require("./media");
53
- Object.defineProperty(exports, "MediaClient", { enumerable: true, get: function () { return media_1.MediaClient; } });
54
- var comments_1 = require("./comments");
55
- Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: function () { return comments_1.CommentsClient; } });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Internal utility functions shared between node definitions.
3
+ * These are NOT exported from the package.
4
+ */
5
+ /**
6
+ * Extract template variables from text (e.g., "Hello {{name}}" -> ["name"])
7
+ */
8
+ export declare function extractTemplateVariables(texts: string[]): string[];
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * Internal utility functions shared between node definitions.
4
+ * These are NOT exported from the package.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.extractTemplateVariables = extractTemplateVariables;
8
+ /**
9
+ * Extract template variables from text (e.g., "Hello {{name}}" -> ["name"])
10
+ */
11
+ function extractTemplateVariables(texts) {
12
+ const variables = new Set();
13
+ const regex = /\{\{(\w+)\}\}/g;
14
+ for (const text of texts) {
15
+ let match;
16
+ while ((match = regex.exec(text)) !== null) {
17
+ if (match[1])
18
+ variables.add(match[1]);
19
+ }
20
+ }
21
+ return Array.from(variables);
22
+ }
package/dist/media.d.ts CHANGED
@@ -1,5 +1,139 @@
1
1
  import { BaseClient } from './base';
2
- import type { Media, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, UpdateMediaTagsParams, UpdateMediaTagsResponse, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, CreateSocialAudioParams, GetUploadTokenParams, UploadTokenResponse, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, FilterMediaParams, FilterMediaResponse, ApiResponse } from './types';
2
+ import type { ApiResponse } from './types';
3
+ export interface UserMedia {
4
+ id: string;
5
+ org_id: string;
6
+ name: string | null;
7
+ tag: string | null;
8
+ type: 'video' | 'image' | 'audio' | 'text' | null;
9
+ url: string | null;
10
+ preview_url: string | null;
11
+ content: string | null;
12
+ source_id: string | null;
13
+ created_at: string;
14
+ media_type: 'user_media';
15
+ }
16
+ export interface MediaUse {
17
+ id: string;
18
+ user_media_id: string;
19
+ name: string;
20
+ source_id: string | null;
21
+ created_at: string;
22
+ }
23
+ export interface SocialAudio {
24
+ id: string;
25
+ org_id: string;
26
+ name: string | null;
27
+ tag: string | null;
28
+ social_post_link: string | null;
29
+ social_audio_link: string | null;
30
+ platform_type: 'tiktok' | null;
31
+ preview_url: string | null;
32
+ audio_url: string | null;
33
+ created_at: string;
34
+ media_type: 'social_audio';
35
+ type: 'social_audio';
36
+ }
37
+ export type Media = UserMedia | SocialAudio;
38
+ export interface GetMediaParams {
39
+ ids?: string[];
40
+ tag?: string;
41
+ }
42
+ export interface GetSocialAudioParams {
43
+ ids?: string[];
44
+ tag?: string;
45
+ }
46
+ export interface UploadMediaParams {
47
+ files: File[];
48
+ tag?: string;
49
+ }
50
+ export interface UploadMediaResponse {
51
+ data: UserMedia[];
52
+ failed?: Array<{
53
+ name: string;
54
+ error: string;
55
+ }>;
56
+ message: string;
57
+ }
58
+ export interface MediaTagUpdate {
59
+ id: string;
60
+ tag: string;
61
+ }
62
+ export interface UpdateMediaTagsParams {
63
+ updates: MediaTagUpdate[];
64
+ }
65
+ export interface MediaTagUpdateResult {
66
+ id: string;
67
+ success: boolean;
68
+ media?: Media;
69
+ error?: string;
70
+ }
71
+ export interface UpdateMediaTagsResponse {
72
+ results: MediaTagUpdateResult[];
73
+ }
74
+ /** @deprecated Use UpdateMediaTagsParams instead for bulk operations */
75
+ export interface UpdateMediaTagParams {
76
+ id: string;
77
+ tag: string;
78
+ }
79
+ export interface DeleteMediaParams {
80
+ ids: string[];
81
+ }
82
+ export interface DeleteMediaResponse {
83
+ deleted: string[];
84
+ failed?: Array<{
85
+ id: string;
86
+ message: string;
87
+ }>;
88
+ message: string;
89
+ }
90
+ export interface CreateSocialAudioParams {
91
+ url: string;
92
+ tag?: string;
93
+ }
94
+ export interface ImportTextParams {
95
+ texts: Array<{
96
+ content: string;
97
+ name?: string;
98
+ tag?: string;
99
+ }>;
100
+ }
101
+ export interface ImportTextResponse {
102
+ data: UserMedia[];
103
+ message: string;
104
+ }
105
+ export interface CreateMediaFromUrlParams {
106
+ urls: string[];
107
+ names?: string[];
108
+ previewUrls?: (string | undefined)[];
109
+ tag?: string;
110
+ sourceIds?: string[];
111
+ useName?: string;
112
+ }
113
+ export interface GetMediaUseParams {
114
+ name: string;
115
+ }
116
+ export interface GetMediaUseResponse {
117
+ sourceIds: string[];
118
+ entries: MediaUse[];
119
+ }
120
+ export interface FilterMediaParams {
121
+ source_ids: string[];
122
+ name: string;
123
+ }
124
+ export interface FilterMediaResponse {
125
+ available: string[];
126
+ used_count: number;
127
+ available_count: number;
128
+ }
129
+ export interface GetUploadTokenParams {
130
+ filename: string;
131
+ contentType?: string;
132
+ }
133
+ export interface UploadTokenResponse {
134
+ clientToken: string;
135
+ pathname: string;
136
+ }
3
137
  /**
4
138
  * Client for managing media files
5
139
  */
@@ -0,0 +1,7 @@
1
+ declare const definition: import("./types").NodeDefinition<"source", {
2
+ accountIds: never[];
3
+ outputMode: "per-input";
4
+ selectionMode: "random";
5
+ }>;
6
+ export default definition;
7
+ export type AccountConfig = typeof definition.defaults;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'account',
6
+ label: 'Account',
7
+ description: 'Select accounts to post from',
8
+ type: 'source',
9
+ category: 'Sources',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: ['random', 'sequential'],
12
+ defaults: {
13
+ accountIds: [],
14
+ outputMode: 'per-input',
15
+ selectionMode: 'random',
16
+ },
17
+ computePorts: () => ({
18
+ inputs: [],
19
+ outputs: [
20
+ {
21
+ id: 'account',
22
+ type: 'account',
23
+ isArray: false,
24
+ required: true,
25
+ },
26
+ ],
27
+ }),
28
+ });
29
+ exports.default = definition;
@@ -0,0 +1,17 @@
1
+ declare const definition: import("./types").NodeDefinition<"generator", {
2
+ fontName: string;
3
+ fontSize: number;
4
+ fontWeight: string;
5
+ fontColor: string;
6
+ highlightColor: string;
7
+ strokeColor: string;
8
+ strokeWidth: number;
9
+ position: string;
10
+ wordsPerSubtitle: number;
11
+ enableAnimation: boolean;
12
+ language: string;
13
+ outputMode: "per-input";
14
+ selectionMode: null;
15
+ }>;
16
+ export default definition;
17
+ export type AutoCaptionConfig = typeof definition.defaults;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'auto-caption',
6
+ label: 'Auto Caption',
7
+ description: 'Add TikTok-style captions to videos',
8
+ type: 'generator',
9
+ category: 'Generation',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ fontName: 'Montserrat',
14
+ fontSize: 80,
15
+ fontWeight: 'bold',
16
+ fontColor: 'white',
17
+ highlightColor: 'yellow',
18
+ strokeColor: 'black',
19
+ strokeWidth: 3,
20
+ position: 'bottom',
21
+ wordsPerSubtitle: 3,
22
+ enableAnimation: true,
23
+ language: 'en',
24
+ outputMode: 'per-input',
25
+ selectionMode: null,
26
+ },
27
+ computePorts: () => ({
28
+ inputs: [
29
+ {
30
+ id: 'video',
31
+ type: 'video',
32
+ isArray: false,
33
+ required: true,
34
+ },
35
+ ],
36
+ outputs: [
37
+ {
38
+ id: 'output',
39
+ type: 'video',
40
+ isArray: false,
41
+ required: true,
42
+ },
43
+ ],
44
+ }),
45
+ });
46
+ exports.default = definition;
@@ -0,0 +1,21 @@
1
+ import type { InputType } from './types';
2
+ type AutoPostMode = 'video' | 'slideshow';
3
+ declare const definition: import("./types").NodeDefinition<"terminal", {
4
+ mode: AutoPostMode;
5
+ inputType: InputType;
6
+ inputs: Array<{
7
+ id: string;
8
+ }>;
9
+ socialAudioIsVariable: boolean;
10
+ schedulingMode: string;
11
+ minDistanceHours: number;
12
+ maxPostsPerDay: number;
13
+ randomWindowStart: string;
14
+ randomWindowEnd: string;
15
+ timezone: string;
16
+ requireApproval: boolean;
17
+ outputMode: null;
18
+ selectionMode: null;
19
+ }>;
20
+ export default definition;
21
+ export type AutoPostConfig = typeof definition.defaults;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'auto-post',
6
+ label: 'Auto Post',
7
+ description: 'Publish a video or slideshow',
8
+ type: 'terminal',
9
+ category: 'Output',
10
+ outputModes: null,
11
+ selectionModes: null,
12
+ defaults: {
13
+ mode: 'video',
14
+ inputType: 'static',
15
+ inputs: [],
16
+ socialAudioIsVariable: false,
17
+ schedulingMode: 'scheduled',
18
+ minDistanceHours: 4,
19
+ maxPostsPerDay: 3,
20
+ randomWindowStart: '09:00',
21
+ randomWindowEnd: '21:00',
22
+ timezone: 'America/New_York',
23
+ requireApproval: false,
24
+ outputMode: null,
25
+ selectionMode: null,
26
+ },
27
+ computePorts: ({ config }) => {
28
+ const mode = config?.mode ?? 'video';
29
+ const inputs = [];
30
+ if (mode === 'video') {
31
+ inputs.push({ id: 'video', type: 'video', isArray: false, required: true });
32
+ }
33
+ else {
34
+ const inputType = config?.inputType ?? 'static';
35
+ if (inputType === 'variable') {
36
+ inputs.push({ id: 'images', type: 'object', isArray: false, required: true });
37
+ }
38
+ else {
39
+ const imageInputs = config?.inputs ?? [{ id: 'image1' }, { id: 'image2' }, { id: 'image3' }];
40
+ for (const input of imageInputs) {
41
+ inputs.push({ id: input.id, type: 'image', isArray: false, required: true });
42
+ }
43
+ }
44
+ }
45
+ // Static inputs for both modes
46
+ inputs.push({ id: 'account', type: 'account', isArray: false, required: true }, { id: 'caption', type: 'text', isArray: false, required: false });
47
+ // Social audio variable input
48
+ if (config?.socialAudioIsVariable) {
49
+ inputs.push({ id: 'social-audio', type: 'audio', isArray: false, required: false });
50
+ }
51
+ return { inputs, outputs: [] };
52
+ },
53
+ });
54
+ exports.default = definition;
@@ -0,0 +1,12 @@
1
+ import type { PassthroughInput } from './types';
2
+ declare const definition: import("./types").NodeDefinition<"generator", {
3
+ branches: {
4
+ key: string;
5
+ }[];
6
+ passthroughInputs: PassthroughInput[];
7
+ defaultBranchKey: string;
8
+ outputMode: "per-input";
9
+ selectionMode: null;
10
+ }>;
11
+ export default definition;
12
+ export type BranchConfig = typeof definition.defaults;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'branch',
6
+ label: 'Branch',
7
+ description: 'Route inputs based on a key match',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ branches: [
14
+ { key: 'option-a' },
15
+ { key: 'option-b' },
16
+ ],
17
+ passthroughInputs: [{ id: 'input', type: 'image', isArray: false }],
18
+ defaultBranchKey: 'option-a',
19
+ outputMode: 'per-input',
20
+ selectionMode: null,
21
+ },
22
+ computePorts: ({ config }) => {
23
+ const branches = config?.branches ?? [];
24
+ const passthroughInputs = config?.passthroughInputs ?? [];
25
+ const inputs = [];
26
+ const outputs = [];
27
+ // Always add key input for branch selection
28
+ inputs.push({ id: 'key', type: 'text', isArray: false, required: true });
29
+ // Add input ports for each branch × passthrough where isVariable is true
30
+ for (const passthrough of passthroughInputs) {
31
+ const pType = passthrough.type;
32
+ const pIsArray = passthrough.isArray ?? false;
33
+ for (const branch of branches) {
34
+ const branchValue = passthrough.branchValues?.[branch.key];
35
+ if (branchValue?.inputType === 'variable') {
36
+ inputs.push({
37
+ id: `${branch.key}-${passthrough.id}`,
38
+ type: pType,
39
+ isArray: pIsArray,
40
+ required: true,
41
+ });
42
+ }
43
+ }
44
+ // One output per passthrough
45
+ outputs.push({ id: passthrough.id, type: pType, isArray: pIsArray, required: true });
46
+ }
47
+ return { inputs, outputs };
48
+ },
49
+ });
50
+ exports.default = definition;
@@ -0,0 +1,6 @@
1
+ declare const definition: import("./types").NodeDefinition<"generator", {
2
+ outputMode: "single";
3
+ selectionMode: null;
4
+ }>;
5
+ export default definition;
6
+ export type CollectConfig = typeof definition.defaults;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'collect',
6
+ label: 'Collect',
7
+ description: 'Collect outputs from a for-each loop into an array',
8
+ type: 'generator',
9
+ category: 'Control Flow',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ outputMode: 'single', // Collect produces a single output after all loop iterations complete
14
+ selectionMode: null,
15
+ },
16
+ computePorts: ({ getConnectedOutput }) => {
17
+ // Input: accepts any non-array type (union)
18
+ const inputTypes = ['image', 'video', 'audio', 'text', 'object', 'boolean', 'number'];
19
+ // Default output: union of all types (will be array)
20
+ const defaultOutputTypes = ['image', 'video', 'audio', 'text', 'object'];
21
+ // Determine output type from connected input (inverse of for-each pattern)
22
+ let outputType = defaultOutputTypes;
23
+ let outputIsArray = true;
24
+ if (getConnectedOutput) {
25
+ const connectedOutput = getConnectedOutput('value');
26
+ if (connectedOutput?.type) {
27
+ const connType = connectedOutput.type;
28
+ // Handle single type (not a union)
29
+ if (!Array.isArray(connType) && !connectedOutput.isArray) {
30
+ // If connected to a non-array type, output is an array of that type
31
+ outputType = connType;
32
+ outputIsArray = true;
33
+ }
34
+ // If connected to a union type, can't narrow - keep default union
35
+ }
36
+ }
37
+ const inputs = [
38
+ {
39
+ id: 'value',
40
+ type: inputTypes,
41
+ isArray: false,
42
+ required: true,
43
+ },
44
+ ];
45
+ const outputs = [
46
+ {
47
+ id: 'array',
48
+ type: outputType,
49
+ isArray: outputIsArray,
50
+ required: true,
51
+ },
52
+ ];
53
+ return { inputs, outputs };
54
+ },
55
+ });
56
+ exports.default = definition;
@@ -0,0 +1,21 @@
1
+ import type { ResolvedPorts, EnumOption } from '../types';
2
+ import { type ObjectSchemaField } from './types';
3
+ declare const definition: import("./types").NodeDefinition<"generator", {
4
+ workflowTemplateId: string | undefined;
5
+ workflowVariableNodes: Array<{
6
+ id: string;
7
+ name?: string;
8
+ variableType?: "image" | "video" | "audio" | "text" | "enum";
9
+ enumOptions?: EnumOption[];
10
+ }>;
11
+ workflowOutputSchema: Record<string, {
12
+ type: string;
13
+ isArray?: boolean;
14
+ objectSchema?: ObjectSchemaField[];
15
+ }>;
16
+ resolvedPorts: ResolvedPorts | undefined;
17
+ outputMode: "per-input";
18
+ selectionMode: null;
19
+ }>;
20
+ export default definition;
21
+ export type ComposeWorkflowConfig = typeof definition.defaults;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ const definition = (0, types_1.defineNode)({
5
+ nodeId: 'compose-workflow',
6
+ label: 'Compose Workflow',
7
+ description: 'Embed other workflows',
8
+ type: 'generator',
9
+ category: 'Generation',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ workflowTemplateId: undefined,
14
+ workflowVariableNodes: [],
15
+ workflowOutputSchema: {},
16
+ resolvedPorts: undefined,
17
+ outputMode: 'per-input',
18
+ selectionMode: null,
19
+ },
20
+ computePorts: ({ config }) => {
21
+ const variableNodes = config?.workflowVariableNodes ?? [];
22
+ const outputSchema = config?.workflowOutputSchema ?? {};
23
+ // Inputs from workflow variable nodes
24
+ const inputs = variableNodes.map(v => ({
25
+ id: v.id,
26
+ type: (v.variableType ?? 'text'),
27
+ isArray: false,
28
+ required: true,
29
+ ...(v.variableType === 'enum' && v.enumOptions ? { enumOptions: v.enumOptions } : {}),
30
+ }));
31
+ // Outputs from workflow output schema
32
+ const outputs = Object.entries(outputSchema).map(([id, schema]) => ({
33
+ id,
34
+ type: schema.type,
35
+ isArray: schema.isArray ?? false,
36
+ required: true,
37
+ ...(schema.objectSchema && { objectSchema: schema.objectSchema }),
38
+ }));
39
+ return { inputs, outputs };
40
+ },
41
+ });
42
+ exports.default = definition;