ugcinc 4.0.1 → 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 +31 -37
  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 -2213
  153. package/dist/types.js +2 -124
  154. package/package.json +1 -1
@@ -0,0 +1,81 @@
1
+ import type { InputType } from './types';
2
+ /**
3
+ * Scheduling mode for post nodes
4
+ * - 'scheduled': Post immediately when automation runs
5
+ * - 'queue': Automatically schedule based on queue constraints
6
+ */
7
+ export type PostSchedulingMode = 'scheduled' | 'queue';
8
+ /**
9
+ * Post scheduling configuration for post nodes
10
+ */
11
+ export interface PostSchedulingConfig {
12
+ /** Main scheduling mode ('scheduled' = post now, 'queue' = auto-schedule) */
13
+ mode: PostSchedulingMode;
14
+ /** Minimum hours between posts for this account (min 1) */
15
+ minDistanceHours?: number;
16
+ /** Maximum posts per day for this account (min 1) */
17
+ maxPostsPerDay?: number;
18
+ /** Minimum time of day for posting (HH:mm format, e.g., '09:00') */
19
+ randomWindowStart?: string;
20
+ /** Maximum time of day for posting (HH:mm format, e.g., '21:00') */
21
+ randomWindowEnd?: string;
22
+ /** Timezone for time window (IANA timezone, e.g., 'America/New_York') */
23
+ timezone?: string;
24
+ /** If true, post will be created with 'require-approval' status instead of being posted */
25
+ requireApproval?: boolean;
26
+ }
27
+ /**
28
+ * Auto Post mode - video or slideshow
29
+ */
30
+ export type AutoPostMode = 'video' | 'slideshow';
31
+ /**
32
+ * Auto Post input type for slideshow mode
33
+ * - 'static': Individual image input ports (image1, image2, etc.)
34
+ * - 'variable': Single 'images' port accepting an array
35
+ */
36
+ export type AutoPostInputType = 'static' | 'variable';
37
+ /**
38
+ * Auto Post input definition (for slideshow static mode)
39
+ */
40
+ export interface AutoPostInput {
41
+ id: string;
42
+ }
43
+ /**
44
+ * Auto Post node configuration - posts a video or slideshow to social media
45
+ */
46
+ export interface AutoPostNodeConfig {
47
+ /** Post mode - video or slideshow */
48
+ mode: AutoPostMode;
49
+ /** Input type for slideshow mode (defaults to 'static') */
50
+ inputType?: AutoPostInputType;
51
+ /** Dynamic image inputs (only used in slideshow mode with inputType='static') */
52
+ inputs?: AutoPostInput[];
53
+ /** Scheduling configuration */
54
+ scheduling?: PostSchedulingConfig;
55
+ /** Social audio configuration */
56
+ socialAudio?: {
57
+ /** If true, read from input port; if false, use selectedIds */
58
+ isVariable: boolean;
59
+ /** Selected social audio IDs (when isVariable is false) - one is randomly chosen when posting */
60
+ selectedIds?: string[];
61
+ };
62
+ }
63
+ declare const definition: import("./types").NodeDefinition<"terminal", {
64
+ mode: AutoPostMode;
65
+ inputType: InputType;
66
+ inputs: Array<{
67
+ id: string;
68
+ }>;
69
+ socialAudioIsVariable: boolean;
70
+ schedulingMode: string;
71
+ minDistanceHours: number;
72
+ maxPostsPerDay: number;
73
+ randomWindowStart: string;
74
+ randomWindowEnd: string;
75
+ timezone: string;
76
+ requireApproval: boolean;
77
+ outputMode: null;
78
+ selectionMode: null;
79
+ }>;
80
+ export default definition;
81
+ 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,58 @@
1
+ import type { OutputMode } from '../types';
2
+ import type { PassthroughInput } from './types';
3
+ import type { RandomRouteObjectField } from './random-route';
4
+ /**
5
+ * Branch node branch definition
6
+ */
7
+ export interface BranchDefinition {
8
+ /** The key to match against (e.g., "happy", "sad", "neutral") */
9
+ key: string;
10
+ }
11
+ /**
12
+ * Per-branch value configuration - each branch can independently be variable or static
13
+ */
14
+ export type BranchValueConfig = {
15
+ isVariable: true;
16
+ } | {
17
+ isVariable: false;
18
+ value: unknown;
19
+ };
20
+ /**
21
+ * Branch node passthrough input definition
22
+ */
23
+ export interface BranchPassthroughInput {
24
+ /** The input port ID (lowercase, hyphens/underscores only) */
25
+ id: string;
26
+ /** The value type */
27
+ type: 'image' | 'video' | 'audio' | 'text' | 'number' | 'boolean' | 'account' | 'object';
28
+ /** Whether this is an array type */
29
+ isArray?: boolean;
30
+ /** Per-branch value configuration. Key is branch key. Each branch can be variable (input port) or static (value). */
31
+ branchValues?: Record<string, BranchValueConfig>;
32
+ /** Object schema for object type (when type is 'object') */
33
+ objectSchema?: RandomRouteObjectField[];
34
+ }
35
+ /**
36
+ * Branch node configuration - routes inputs to a branch based on key match
37
+ */
38
+ export interface BranchNodeConfig {
39
+ /** Output branches with keys to match against */
40
+ branches: BranchDefinition[];
41
+ /** Passthrough inputs that get routed to the matched branch's outputs */
42
+ passthroughInputs: BranchPassthroughInput[];
43
+ /** Optional default branch key if no match is found */
44
+ defaultBranchKey?: string;
45
+ /** Output mode - 'single' broadcasts one output to all consumers, 'per-input' creates one per consumer */
46
+ outputMode?: OutputMode;
47
+ }
48
+ declare const definition: import("./types").NodeDefinition<"generator", {
49
+ branches: {
50
+ key: string;
51
+ }[];
52
+ passthroughInputs: PassthroughInput[];
53
+ defaultBranchKey: string;
54
+ outputMode: "per-input";
55
+ selectionMode: null;
56
+ }>;
57
+ export default definition;
58
+ 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,16 @@
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;
7
+ /**
8
+ * Collect node configuration - collects outputs from for-each loop into an array
9
+ * Note: Most config is set during expansion, not by user
10
+ */
11
+ export interface CollectNodeConfig {
12
+ /** Expected number of items to collect (set during for-each expansion) */
13
+ expectedCount?: number;
14
+ /** Template ID of the for-each loop this collects from (for validation) */
15
+ forEachTemplateId?: string;
16
+ }
@@ -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;
@@ -0,0 +1,96 @@
1
+ type DmPlatform = 'imessage' | 'instagram';
2
+ /**
3
+ * Message in a Create DM conversation
4
+ */
5
+ export interface CreateDmMessage {
6
+ /** Who sent this message */
7
+ sender: 'user' | 'recipient';
8
+ /** Message text content */
9
+ text: string;
10
+ /** Whether this message has an associated image (story reply for IG, sender image for iMessage) */
11
+ hasImage?: boolean;
12
+ }
13
+ /**
14
+ * Create DM node configuration - renders fake DM conversations for iMessage or Instagram
15
+ */
16
+ export interface CreateDmNodeConfig {
17
+ /** Platform to render */
18
+ platform: 'imessage' | 'instagram';
19
+ /** Whether platform comes from input port */
20
+ platformIsVariable?: boolean;
21
+ /** Light or dark mode */
22
+ lightMode: boolean;
23
+ /** Whether light mode comes from input port */
24
+ lightModeIsVariable?: boolean;
25
+ /** Username displayed in header */
26
+ username: string;
27
+ /** Whether username comes from input port */
28
+ usernameIsVariable?: boolean;
29
+ /** Status bar time */
30
+ time: string;
31
+ /** Whether status bar time comes from input port */
32
+ timeIsVariable?: boolean;
33
+ /** Profile picture URL (fallback if profilePic input not connected) */
34
+ profilePicUrl?: string;
35
+ /** Whether profile pic comes from input port */
36
+ profilePicIsVariable?: boolean;
37
+ /** Whether messages come from input port */
38
+ messagesIsVariable?: boolean;
39
+ /** Static messages (used when messagesIsVariable is false) */
40
+ messages?: CreateDmMessage[];
41
+ /** Image attachment URL (story reply for IG, sender image for iMessage) */
42
+ imageAttachmentUrl?: string;
43
+ /** Whether image attachment comes from input port */
44
+ imageAttachmentIsVariable?: boolean;
45
+ /** iMessage-specific settings */
46
+ imessage?: {
47
+ senderBubbleColor?: string;
48
+ showReadReceipt: boolean;
49
+ readReceiptText: string;
50
+ /** Whether read receipt time comes from input port */
51
+ readReceiptTimeIsVariable?: boolean;
52
+ unreadBadgeText: string;
53
+ /** Whether unread badge comes from input port */
54
+ unreadBadgeIsVariable?: boolean;
55
+ messageHeaderTimestampText: string;
56
+ /** Whether message header time comes from input port */
57
+ messageHeaderTimeIsVariable?: boolean;
58
+ };
59
+ /** Instagram-specific settings */
60
+ instagram?: {
61
+ userHasStory: boolean;
62
+ };
63
+ }
64
+ declare const definition: import("./types").NodeDefinition<"generator", {
65
+ platform: DmPlatform;
66
+ platformIsVariable: boolean;
67
+ lightMode: boolean;
68
+ lightModeIsVariable: boolean;
69
+ username: string;
70
+ usernameIsVariable: boolean;
71
+ time: string;
72
+ timeIsVariable: boolean;
73
+ profilePicUrl: string;
74
+ profilePicIsVariable: boolean;
75
+ messagesIsVariable: boolean;
76
+ messages: CreateDmMessage[];
77
+ imageAttachmentUrl: string | undefined;
78
+ imageAttachmentIsVariable: boolean;
79
+ imessage: {
80
+ senderBubbleColor: string | undefined;
81
+ showReadReceipt: boolean;
82
+ readReceiptText: string;
83
+ readReceiptTimeIsVariable: boolean;
84
+ unreadBadgeText: string;
85
+ unreadBadgeIsVariable: boolean;
86
+ messageHeaderTimestampText: string;
87
+ messageHeaderTimeIsVariable: boolean;
88
+ };
89
+ instagram: {
90
+ userHasStory: boolean;
91
+ };
92
+ outputMode: "per-input";
93
+ selectionMode: null;
94
+ }>;
95
+ export default definition;
96
+ export type CreateDmConfig = typeof definition.defaults;
@@ -0,0 +1,88 @@
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: 'create-dm',
6
+ label: 'Create DM',
7
+ description: 'Create fake DM screenshots for iMessage or Instagram',
8
+ type: 'generator',
9
+ category: 'Generation',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ platform: 'instagram',
14
+ platformIsVariable: false,
15
+ lightMode: true,
16
+ lightModeIsVariable: false,
17
+ username: '',
18
+ usernameIsVariable: false,
19
+ time: '9:41',
20
+ timeIsVariable: false,
21
+ profilePicUrl: 'https://ugcinc.co/logo.png',
22
+ profilePicIsVariable: false,
23
+ messagesIsVariable: false,
24
+ messages: [
25
+ { sender: 'user', text: 'Wow, this dm automation is realistic right 🤯' },
26
+ { sender: 'recipient', text: "I know, it's like we're really in imessage" },
27
+ { sender: 'recipient', text: 'Just be thankful we\'re not on android 😭😭😭' },
28
+ ],
29
+ imageAttachmentUrl: undefined,
30
+ imageAttachmentIsVariable: false,
31
+ imessage: {
32
+ senderBubbleColor: undefined,
33
+ showReadReceipt: false,
34
+ readReceiptText: 'Read',
35
+ readReceiptTimeIsVariable: false,
36
+ unreadBadgeText: '67',
37
+ unreadBadgeIsVariable: false,
38
+ messageHeaderTimestampText: '',
39
+ messageHeaderTimeIsVariable: false,
40
+ },
41
+ instagram: {
42
+ userHasStory: false,
43
+ },
44
+ outputMode: 'per-input',
45
+ selectionMode: null,
46
+ },
47
+ computePorts: ({ config }) => {
48
+ const inputs = [];
49
+ if (config?.platformIsVariable) {
50
+ inputs.push({ id: 'platform', type: 'text', isArray: false, required: true });
51
+ }
52
+ if (config?.lightModeIsVariable) {
53
+ inputs.push({ id: 'light-mode', type: 'boolean', isArray: false, required: false });
54
+ }
55
+ if (config?.usernameIsVariable) {
56
+ inputs.push({ id: 'username', type: 'text', isArray: false, required: true });
57
+ }
58
+ if (config?.timeIsVariable) {
59
+ inputs.push({ id: 'time', type: 'text', isArray: false, required: false });
60
+ }
61
+ if (config?.profilePicIsVariable) {
62
+ inputs.push({ id: 'profile-pic', type: 'image', isArray: false, required: false });
63
+ }
64
+ if (config?.messagesIsVariable) {
65
+ inputs.push({ id: 'messages', type: 'object', isArray: true, required: true });
66
+ }
67
+ if (config?.imageAttachmentIsVariable) {
68
+ inputs.push({ id: 'image-attachment', type: 'image', isArray: false, required: false });
69
+ }
70
+ // iMessage-specific
71
+ if (config?.platform === 'imessage') {
72
+ if (config.imessage?.showReadReceipt && config.imessage?.readReceiptTimeIsVariable) {
73
+ inputs.push({ id: 'read-receipt-time', type: 'text', isArray: false, required: false });
74
+ }
75
+ if (config.imessage?.unreadBadgeIsVariable) {
76
+ inputs.push({ id: 'unread-badge', type: 'text', isArray: false, required: false });
77
+ }
78
+ if (config.imessage?.messageHeaderTimeIsVariable) {
79
+ inputs.push({ id: 'message-header-time', type: 'text', isArray: false, required: false });
80
+ }
81
+ }
82
+ return {
83
+ inputs,
84
+ outputs: [{ id: 'output', type: 'image', isArray: false, required: true }],
85
+ };
86
+ },
87
+ });
88
+ exports.default = definition;
@@ -0,0 +1,19 @@
1
+ type CustomModelOutputType = 'image' | 'video' | 'audio';
2
+ interface CustomModelInputParam {
3
+ name: string;
4
+ type: string;
5
+ required: boolean;
6
+ description?: string;
7
+ default?: unknown;
8
+ }
9
+ declare const definition: import("./types").NodeDefinition<"generator", {
10
+ modelId: string;
11
+ modelName: string;
12
+ outputType: CustomModelOutputType;
13
+ inputParams: CustomModelInputParam[];
14
+ apiKey: string | undefined;
15
+ outputMode: "per-input";
16
+ selectionMode: null;
17
+ }>;
18
+ export default definition;
19
+ export type CustomModelConfig = typeof definition.defaults;
@@ -0,0 +1,52 @@
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: 'custom-model',
6
+ label: 'Custom Model',
7
+ description: 'Call any fal.ai model',
8
+ type: 'generator',
9
+ category: 'AI Generation',
10
+ outputModes: ['per-input', 'single'],
11
+ selectionModes: null,
12
+ defaults: {
13
+ modelId: '',
14
+ modelName: '',
15
+ outputType: 'image',
16
+ inputParams: [],
17
+ apiKey: undefined,
18
+ outputMode: 'per-input',
19
+ selectionMode: null,
20
+ },
21
+ computePorts: ({ config }) => {
22
+ const inputParams = config?.inputParams ?? [];
23
+ const outputType = config?.outputType ?? 'image';
24
+ // Generate input ports from inputParams
25
+ // Only params with name 'prompt' or type image/video/audio become input ports
26
+ const inputs = inputParams
27
+ .filter(param => param.name === 'prompt' ||
28
+ param.type === 'image' ||
29
+ param.type === 'video' ||
30
+ param.type === 'audio')
31
+ .map(param => ({
32
+ id: param.name,
33
+ type: (param.type === 'image' || param.type === 'video' || param.type === 'audio')
34
+ ? param.type
35
+ : 'text',
36
+ isArray: false,
37
+ required: param.required,
38
+ }));
39
+ return {
40
+ inputs,
41
+ outputs: [
42
+ {
43
+ id: 'output',
44
+ type: outputType,
45
+ isArray: false,
46
+ required: true,
47
+ },
48
+ ],
49
+ };
50
+ },
51
+ });
52
+ exports.default = definition;
@@ -0,0 +1,8 @@
1
+ import type { DeduplicationLevel } from '../../render/types';
2
+ declare const definition: import("./types").NodeDefinition<"generator", {
3
+ deduplication: DeduplicationLevel;
4
+ outputMode: "per-input";
5
+ selectionMode: null;
6
+ }>;
7
+ export default definition;
8
+ export type DeduplicateConfig = typeof definition.defaults;