ugcinc 4.0.2 → 4.1.1
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/accounts.d.ts +146 -1
- package/dist/automations/index.d.ts +174 -0
- package/dist/automations/index.js +194 -0
- package/dist/automations/nodes/account.d.ts +6 -0
- package/dist/automations/nodes/account.js +28 -0
- package/dist/automations/nodes/auto-caption.d.ts +23 -0
- package/dist/automations/nodes/auto-caption.js +49 -0
- package/dist/automations/nodes/auto-post.d.ts +22 -0
- package/dist/automations/nodes/auto-post.js +52 -0
- package/dist/automations/nodes/branch.d.ts +21 -0
- package/dist/automations/nodes/branch.js +46 -0
- package/dist/automations/nodes/collect.d.ts +7 -0
- package/dist/automations/nodes/collect.js +51 -0
- package/dist/automations/nodes/compose-workflow.d.ts +8 -0
- package/dist/automations/nodes/compose-workflow.js +61 -0
- package/dist/automations/nodes/create-dm.d.ts +35 -0
- package/dist/automations/nodes/create-dm.js +86 -0
- package/dist/automations/nodes/custom-model.d.ts +18 -0
- package/dist/automations/nodes/custom-model.js +52 -0
- package/dist/automations/nodes/deduplicate.d.ts +7 -0
- package/dist/automations/nodes/deduplicate.js +36 -0
- package/dist/automations/nodes/destructure.d.ts +25 -0
- package/dist/automations/nodes/destructure.js +65 -0
- package/dist/automations/nodes/for-each.d.ts +22 -0
- package/dist/automations/nodes/for-each.js +84 -0
- package/dist/automations/nodes/generate-image.d.ts +15 -0
- package/dist/automations/nodes/generate-image.js +45 -0
- package/dist/automations/nodes/generate-video.d.ts +15 -0
- package/dist/automations/nodes/generate-video.js +45 -0
- package/dist/automations/nodes/if.d.ts +21 -0
- package/dist/automations/nodes/if.js +44 -0
- package/dist/automations/nodes/image-composer.d.ts +46 -0
- package/dist/automations/nodes/image-composer.js +135 -0
- package/dist/automations/nodes/index.d.ts +312 -0
- package/dist/automations/nodes/index.js +92 -0
- package/dist/automations/nodes/internal.d.ts +8 -0
- package/dist/automations/nodes/internal.js +10 -0
- package/dist/automations/nodes/llm.d.ts +26 -0
- package/dist/automations/nodes/llm.js +85 -0
- package/dist/automations/nodes/manual-trigger.d.ts +14 -0
- package/dist/automations/nodes/manual-trigger.js +32 -0
- package/dist/automations/nodes/media.d.ts +13 -0
- package/dist/automations/nodes/media.js +40 -0
- package/dist/automations/nodes/not.d.ts +5 -0
- package/dist/automations/nodes/not.js +35 -0
- package/dist/automations/nodes/output.d.ts +16 -0
- package/dist/automations/nodes/output.js +32 -0
- package/dist/automations/nodes/random-route.d.ts +24 -0
- package/dist/automations/nodes/random-route.js +53 -0
- package/dist/automations/nodes/random.d.ts +16 -0
- package/dist/automations/nodes/random.js +50 -0
- package/dist/automations/nodes/recurrence.d.ts +29 -0
- package/dist/automations/nodes/recurrence.js +50 -0
- package/dist/automations/nodes/save-to-media.d.ts +15 -0
- package/dist/automations/nodes/save-to-media.js +31 -0
- package/dist/automations/nodes/screenshot-animation.d.ts +6 -0
- package/dist/automations/nodes/screenshot-animation.js +36 -0
- package/dist/automations/nodes/social-audio.d.ts +7 -0
- package/dist/automations/nodes/social-audio.js +30 -0
- package/dist/automations/nodes/text.d.ts +6 -0
- package/dist/automations/nodes/text.js +41 -0
- package/dist/automations/nodes/transcript.d.ts +5 -0
- package/dist/automations/nodes/transcript.js +46 -0
- package/dist/automations/nodes/types.d.ts +202 -0
- package/dist/automations/nodes/types.js +22 -0
- package/dist/automations/nodes/video-composer.d.ts +16 -0
- package/dist/automations/nodes/video-composer.js +117 -0
- package/dist/automations/nodes/video-import.d.ts +9 -0
- package/dist/automations/nodes/video-import.js +23 -0
- package/dist/automations/types.d.ts +431 -0
- package/dist/automations/types.js +29 -0
- package/dist/automations.d.ts +5 -33
- package/dist/automations.js +6 -647
- package/dist/comments.d.ts +26 -1
- package/dist/comments.js +3 -0
- package/dist/graph-controller.d.ts +211 -0
- package/dist/graph-controller.js +656 -0
- package/dist/index.d.ts +22 -9
- package/dist/index.js +47 -24
- package/dist/internal-utils.d.ts +8 -0
- package/dist/internal-utils.js +22 -0
- package/dist/media.d.ts +135 -1
- package/dist/nodes/account.d.ts +7 -0
- package/dist/nodes/account.js +29 -0
- package/dist/nodes/auto-caption.d.ts +17 -0
- package/dist/nodes/auto-caption.js +46 -0
- package/dist/nodes/auto-post.d.ts +21 -0
- package/dist/nodes/auto-post.js +54 -0
- package/dist/nodes/branch.d.ts +12 -0
- package/dist/nodes/branch.js +50 -0
- package/dist/nodes/collect.d.ts +6 -0
- package/dist/nodes/collect.js +56 -0
- package/dist/nodes/compose-workflow.d.ts +21 -0
- package/dist/nodes/compose-workflow.js +42 -0
- package/dist/nodes/create-dm.d.ts +40 -0
- package/dist/nodes/create-dm.js +88 -0
- package/dist/nodes/custom-model.d.ts +19 -0
- package/dist/nodes/custom-model.js +52 -0
- package/dist/nodes/deduplicate.d.ts +8 -0
- package/dist/nodes/deduplicate.js +36 -0
- package/dist/nodes/destructure.d.ts +25 -0
- package/dist/nodes/destructure.js +65 -0
- package/dist/nodes/for-each.d.ts +23 -0
- package/dist/nodes/for-each.js +84 -0
- package/dist/nodes/generate-image.d.ts +16 -0
- package/dist/nodes/generate-image.js +45 -0
- package/dist/nodes/generate-video.d.ts +16 -0
- package/dist/nodes/generate-video.js +45 -0
- package/dist/nodes/if.d.ts +22 -0
- package/dist/nodes/if.js +44 -0
- package/dist/nodes/image-composer.d.ts +14 -0
- package/dist/nodes/image-composer.js +95 -0
- package/dist/nodes/index.d.ts +20 -0
- package/dist/nodes/index.js +93 -0
- package/dist/nodes/llm.d.ts +27 -0
- package/dist/nodes/llm.js +85 -0
- package/dist/nodes/manual-trigger.d.ts +16 -0
- package/dist/nodes/manual-trigger.js +32 -0
- package/dist/nodes/media.d.ts +17 -0
- package/dist/nodes/media.js +40 -0
- package/dist/nodes/not.d.ts +6 -0
- package/dist/nodes/not.js +35 -0
- package/dist/nodes/output.d.ts +9 -0
- package/dist/nodes/output.js +32 -0
- package/dist/nodes/random-route.d.ts +3 -0
- package/dist/nodes/random-route.js +50 -0
- package/dist/nodes/random.d.ts +3 -0
- package/dist/nodes/random.js +48 -0
- package/dist/nodes/recurrence.d.ts +3 -0
- package/dist/nodes/recurrence.js +45 -0
- package/dist/nodes/save-to-media.d.ts +3 -0
- package/dist/nodes/save-to-media.js +26 -0
- package/dist/nodes/screenshot-animation.d.ts +7 -0
- package/dist/nodes/screenshot-animation.js +36 -0
- package/dist/nodes/social-audio.d.ts +3 -0
- package/dist/nodes/social-audio.js +26 -0
- package/dist/nodes/text.d.ts +3 -0
- package/dist/nodes/text.js +38 -0
- package/dist/nodes/transcript.d.ts +3 -0
- package/dist/nodes/transcript.js +42 -0
- package/dist/nodes/types.d.ts +146 -0
- package/dist/nodes/types.js +22 -0
- package/dist/nodes/video-composer.d.ts +3 -0
- package/dist/nodes/video-composer.js +67 -0
- package/dist/nodes/video-import.d.ts +3 -0
- package/dist/nodes/video-import.js +35 -0
- package/dist/org.d.ts +13 -1
- package/dist/ports.js +3 -9
- package/dist/posts.d.ts +88 -1
- package/dist/render/compositions/IMessageDmComposition/types.d.ts +24 -24
- package/dist/render/compositions/ImageEditorComposition.js +2 -8
- package/dist/render/compositions/VideoEditorComposition.js +2 -24
- package/dist/render/types/element.d.ts +0 -33
- package/dist/render/types/index.d.ts +1 -1
- package/dist/render/types/video.d.ts +2 -2
- package/dist/render.d.ts +2 -1
- package/dist/stats.d.ts +128 -1
- package/dist/tasks.d.ts +20 -1
- package/dist/types.d.ts +1 -2216
- package/dist/types.js +2 -124
- package/package.json +1 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
exports.default = (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
|
+
imageInputs: [],
|
|
16
|
+
socialAudioIsVariable: false,
|
|
17
|
+
socialAudioSelectedIds: [],
|
|
18
|
+
schedulingMode: 'scheduled',
|
|
19
|
+
minDistanceHours: 4,
|
|
20
|
+
maxPostsPerDay: 3,
|
|
21
|
+
randomWindowStart: '09:00',
|
|
22
|
+
randomWindowEnd: '21:00',
|
|
23
|
+
timezone: 'America/New_York',
|
|
24
|
+
requireApproval: false,
|
|
25
|
+
outputMode: null,
|
|
26
|
+
selectionMode: null,
|
|
27
|
+
},
|
|
28
|
+
computePorts: ({ config }) => {
|
|
29
|
+
const mode = config?.mode ?? 'video';
|
|
30
|
+
const inputs = [];
|
|
31
|
+
if (mode === 'video') {
|
|
32
|
+
inputs.push({ id: 'video', type: 'video', isArray: false, required: true });
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
const inputType = config?.inputType ?? 'static';
|
|
36
|
+
if (inputType === 'variable') {
|
|
37
|
+
inputs.push({ id: 'images', type: 'object', isArray: false, required: true });
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const imageInputs = config?.imageInputs ?? [{ id: 'image1' }, { id: 'image2' }, { id: 'image3' }];
|
|
41
|
+
for (const input of imageInputs) {
|
|
42
|
+
inputs.push({ id: input.id, type: 'image', isArray: false, required: true });
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
inputs.push({ id: 'account', type: 'account', isArray: false, required: true }, { id: 'caption', type: 'text', isArray: false, required: false });
|
|
47
|
+
if (config?.socialAudioIsVariable) {
|
|
48
|
+
inputs.push({ id: 'social-audio', type: 'audio', isArray: false, required: false });
|
|
49
|
+
}
|
|
50
|
+
return { inputs, outputs: [] };
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type InputType } from './types';
|
|
2
|
+
export interface BranchDefinition {
|
|
3
|
+
key: string;
|
|
4
|
+
}
|
|
5
|
+
interface BranchValueConfig {
|
|
6
|
+
inputType?: InputType;
|
|
7
|
+
}
|
|
8
|
+
export interface PassthroughInput {
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
isArray?: boolean;
|
|
12
|
+
branchValues?: Record<string, BranchValueConfig>;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: import("./types").NodeDefinition<"generator", {
|
|
15
|
+
branches: BranchDefinition[];
|
|
16
|
+
passthroughInputs: PassthroughInput[];
|
|
17
|
+
defaultBranchKey: string;
|
|
18
|
+
outputMode: "per-input";
|
|
19
|
+
selectionMode: null;
|
|
20
|
+
}, false>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
exports.default = (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
|
+
inputs.push({ id: 'key', type: 'text', isArray: false, required: true });
|
|
28
|
+
for (const passthrough of passthroughInputs) {
|
|
29
|
+
const pType = passthrough.type;
|
|
30
|
+
const pIsArray = passthrough.isArray ?? false;
|
|
31
|
+
for (const branch of branches) {
|
|
32
|
+
const branchValue = passthrough.branchValues?.[branch.key];
|
|
33
|
+
if (branchValue?.inputType === 'variable') {
|
|
34
|
+
inputs.push({
|
|
35
|
+
id: `${branch.key}-${passthrough.id}`,
|
|
36
|
+
type: pType,
|
|
37
|
+
isArray: pIsArray,
|
|
38
|
+
required: true,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
outputs.push({ id: passthrough.id, type: pType, isArray: pIsArray, required: true });
|
|
43
|
+
}
|
|
44
|
+
return { inputs, outputs };
|
|
45
|
+
},
|
|
46
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const types_1 = require("./types");
|
|
4
|
+
exports.default = (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
|
+
expectedCount: undefined,
|
|
14
|
+
forEachTemplateId: undefined,
|
|
15
|
+
outputMode: 'single',
|
|
16
|
+
selectionMode: null,
|
|
17
|
+
},
|
|
18
|
+
computePorts: ({ getConnectedOutput }) => {
|
|
19
|
+
const inputTypes = ['image', 'video', 'audio', 'text', 'object', 'boolean', 'number'];
|
|
20
|
+
const defaultOutputTypes = ['image', 'video', 'audio', 'text', 'object'];
|
|
21
|
+
let outputType = defaultOutputTypes;
|
|
22
|
+
let outputIsArray = true;
|
|
23
|
+
if (getConnectedOutput) {
|
|
24
|
+
const connectedOutput = getConnectedOutput('value');
|
|
25
|
+
if (connectedOutput?.type) {
|
|
26
|
+
const connType = connectedOutput.type;
|
|
27
|
+
if (!Array.isArray(connType) && !connectedOutput.isArray) {
|
|
28
|
+
outputType = connType;
|
|
29
|
+
outputIsArray = true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const inputs = [
|
|
34
|
+
{
|
|
35
|
+
id: 'value',
|
|
36
|
+
type: inputTypes,
|
|
37
|
+
isArray: false,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
const outputs = [
|
|
42
|
+
{
|
|
43
|
+
id: 'array',
|
|
44
|
+
type: outputType,
|
|
45
|
+
isArray: outputIsArray,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
return { inputs, outputs };
|
|
50
|
+
},
|
|
51
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResolvedPorts } from '../types';
|
|
2
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
3
|
+
workflowTemplateId: string | undefined;
|
|
4
|
+
resolvedPorts: ResolvedPorts | undefined;
|
|
5
|
+
outputMode: "per-input";
|
|
6
|
+
selectionMode: null;
|
|
7
|
+
}, false>;
|
|
8
|
+
export default definition;
|
|
@@ -0,0 +1,61 @@
|
|
|
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
|
+
resolvedPorts: undefined,
|
|
15
|
+
outputMode: 'per-input',
|
|
16
|
+
selectionMode: null,
|
|
17
|
+
},
|
|
18
|
+
computePorts: async ({ config, client }) => {
|
|
19
|
+
// Use cached resolved ports if available
|
|
20
|
+
if (config?.resolvedPorts) {
|
|
21
|
+
return {
|
|
22
|
+
inputs: config.resolvedPorts.inputs ?? [],
|
|
23
|
+
outputs: config.resolvedPorts.outputs ?? [],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
// If no templateId selected, return empty ports
|
|
27
|
+
const templateId = config?.workflowTemplateId;
|
|
28
|
+
if (!templateId || !client) {
|
|
29
|
+
return { inputs: [], outputs: [] };
|
|
30
|
+
}
|
|
31
|
+
// Fetch the sub-workflow template
|
|
32
|
+
const response = await client.getTemplate({ templateId });
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
return { inputs: [], outputs: [] };
|
|
35
|
+
}
|
|
36
|
+
const template = response.data;
|
|
37
|
+
// Find the manual-trigger node to get input definitions
|
|
38
|
+
const manualTrigger = template.nodes.find(n => n.type === 'manual-trigger');
|
|
39
|
+
const triggerOutputs = manualTrigger?.type === 'manual-trigger'
|
|
40
|
+
? (manualTrigger.config?.outputs ?? [])
|
|
41
|
+
: [];
|
|
42
|
+
// Convert trigger outputs to compose-workflow inputs
|
|
43
|
+
const inputs = triggerOutputs.map(output => ({
|
|
44
|
+
id: output.id,
|
|
45
|
+
type: output.type,
|
|
46
|
+
isArray: output.isArray ?? false,
|
|
47
|
+
required: true,
|
|
48
|
+
...(output.type === 'enum' && output.enumOptions ? { enumOptions: output.enumOptions } : {}),
|
|
49
|
+
}));
|
|
50
|
+
// Use template's output_schema for outputs
|
|
51
|
+
const outputSchema = template.output_schema ?? {};
|
|
52
|
+
const outputs = Object.entries(outputSchema).map(([id, schema]) => ({
|
|
53
|
+
id,
|
|
54
|
+
type: schema.type,
|
|
55
|
+
isArray: false,
|
|
56
|
+
required: true,
|
|
57
|
+
}));
|
|
58
|
+
return { inputs, outputs };
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
exports.default = definition;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type InputType } from './types';
|
|
2
|
+
type DmPlatform = 'imessage' | 'instagram';
|
|
3
|
+
export interface CreateDmMessage {
|
|
4
|
+
sender: 'user' | 'recipient';
|
|
5
|
+
text: string;
|
|
6
|
+
hasImage?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
9
|
+
platform: DmPlatform;
|
|
10
|
+
platformInputType: InputType;
|
|
11
|
+
lightMode: boolean;
|
|
12
|
+
lightModeInputType: InputType;
|
|
13
|
+
username: string;
|
|
14
|
+
usernameInputType: InputType;
|
|
15
|
+
time: string;
|
|
16
|
+
timeInputType: InputType;
|
|
17
|
+
profilePicUrl: string;
|
|
18
|
+
profilePicInputType: InputType;
|
|
19
|
+
messages: CreateDmMessage[];
|
|
20
|
+
messagesInputType: InputType;
|
|
21
|
+
imageAttachmentUrl: string | undefined;
|
|
22
|
+
imageAttachmentInputType: InputType;
|
|
23
|
+
imessageSenderBubbleColor: string | undefined;
|
|
24
|
+
imessageShowReadReceipt: boolean;
|
|
25
|
+
imessageReadReceiptText: string;
|
|
26
|
+
imessageReadReceiptTimeInputType: InputType;
|
|
27
|
+
imessageUnreadBadgeText: string;
|
|
28
|
+
imessageUnreadBadgeInputType: InputType;
|
|
29
|
+
imessageMessageHeaderTimestampText: string;
|
|
30
|
+
imessageMessageHeaderTimeInputType: InputType;
|
|
31
|
+
instagramUserHasStory: boolean;
|
|
32
|
+
outputMode: "per-input";
|
|
33
|
+
selectionMode: null;
|
|
34
|
+
}, false>;
|
|
35
|
+
export default definition;
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
platformInputType: 'static',
|
|
15
|
+
lightMode: true,
|
|
16
|
+
lightModeInputType: 'static',
|
|
17
|
+
username: '',
|
|
18
|
+
usernameInputType: 'static',
|
|
19
|
+
time: '9:41',
|
|
20
|
+
timeInputType: 'static',
|
|
21
|
+
profilePicUrl: 'https://ugcinc.co/logo.png',
|
|
22
|
+
profilePicInputType: 'static',
|
|
23
|
+
messages: [
|
|
24
|
+
{ sender: 'user', text: 'Wow, this dm automation is realistic right 🤯' },
|
|
25
|
+
{ sender: 'recipient', text: "I know, it's like we're really in imessage" },
|
|
26
|
+
{ sender: 'recipient', text: 'Just be thankful we\'re not on android 😭😭😭' },
|
|
27
|
+
],
|
|
28
|
+
messagesInputType: 'static',
|
|
29
|
+
imageAttachmentUrl: undefined,
|
|
30
|
+
imageAttachmentInputType: 'static',
|
|
31
|
+
// iMessage-specific
|
|
32
|
+
imessageSenderBubbleColor: undefined,
|
|
33
|
+
imessageShowReadReceipt: false,
|
|
34
|
+
imessageReadReceiptText: 'Read',
|
|
35
|
+
imessageReadReceiptTimeInputType: 'static',
|
|
36
|
+
imessageUnreadBadgeText: '67',
|
|
37
|
+
imessageUnreadBadgeInputType: 'static',
|
|
38
|
+
imessageMessageHeaderTimestampText: '',
|
|
39
|
+
imessageMessageHeaderTimeInputType: 'static',
|
|
40
|
+
// Instagram-specific
|
|
41
|
+
instagramUserHasStory: false,
|
|
42
|
+
outputMode: 'per-input',
|
|
43
|
+
selectionMode: null,
|
|
44
|
+
},
|
|
45
|
+
computePorts: ({ config }) => {
|
|
46
|
+
const inputs = [];
|
|
47
|
+
if (config?.platformInputType === 'variable') {
|
|
48
|
+
inputs.push({ id: 'platform', type: 'text', isArray: false, required: true });
|
|
49
|
+
}
|
|
50
|
+
if (config?.lightModeInputType === 'variable') {
|
|
51
|
+
inputs.push({ id: 'light-mode', type: 'boolean', isArray: false, required: false });
|
|
52
|
+
}
|
|
53
|
+
if (config?.usernameInputType === 'variable') {
|
|
54
|
+
inputs.push({ id: 'username', type: 'text', isArray: false, required: true });
|
|
55
|
+
}
|
|
56
|
+
if (config?.timeInputType === 'variable') {
|
|
57
|
+
inputs.push({ id: 'time', type: 'text', isArray: false, required: false });
|
|
58
|
+
}
|
|
59
|
+
if (config?.profilePicInputType === 'variable') {
|
|
60
|
+
inputs.push({ id: 'profile-pic', type: 'image', isArray: false, required: false });
|
|
61
|
+
}
|
|
62
|
+
if (config?.messagesInputType === 'variable') {
|
|
63
|
+
inputs.push({ id: 'messages', type: 'object', isArray: true, required: true });
|
|
64
|
+
}
|
|
65
|
+
if (config?.imageAttachmentInputType === 'variable') {
|
|
66
|
+
inputs.push({ id: 'image-attachment', type: 'image', isArray: false, required: false });
|
|
67
|
+
}
|
|
68
|
+
// iMessage-specific
|
|
69
|
+
if (config?.platform === 'imessage') {
|
|
70
|
+
if (config.imessageShowReadReceipt && config.imessageReadReceiptTimeInputType === 'variable') {
|
|
71
|
+
inputs.push({ id: 'read-receipt-time', type: 'text', isArray: false, required: false });
|
|
72
|
+
}
|
|
73
|
+
if (config.imessageUnreadBadgeInputType === 'variable') {
|
|
74
|
+
inputs.push({ id: 'unread-badge', type: 'text', isArray: false, required: false });
|
|
75
|
+
}
|
|
76
|
+
if (config.imessageMessageHeaderTimeInputType === 'variable') {
|
|
77
|
+
inputs.push({ id: 'message-header-time', type: 'text', isArray: false, required: false });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return {
|
|
81
|
+
inputs,
|
|
82
|
+
outputs: [{ id: 'output', type: 'image', isArray: false, required: true }],
|
|
83
|
+
};
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
exports.default = definition;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type CustomModelOutputType = 'image' | 'video' | 'audio';
|
|
2
|
+
export 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
|
+
}, false>;
|
|
18
|
+
export default definition;
|
|
@@ -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,36 @@
|
|
|
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: 'deduplicate',
|
|
6
|
+
label: 'Mass Repost',
|
|
7
|
+
description: 'Make videos unique for safe reposting',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Generation',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
deduplication: 'level3',
|
|
14
|
+
outputMode: 'per-input',
|
|
15
|
+
selectionMode: null,
|
|
16
|
+
},
|
|
17
|
+
computePorts: () => ({
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
id: 'video',
|
|
21
|
+
type: 'video',
|
|
22
|
+
isArray: false,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
26
|
+
outputs: [
|
|
27
|
+
{
|
|
28
|
+
id: 'output',
|
|
29
|
+
type: 'video',
|
|
30
|
+
isArray: false,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}),
|
|
35
|
+
});
|
|
36
|
+
exports.default = definition;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type InputType } from './types';
|
|
2
|
+
type IndexExpression = {
|
|
3
|
+
type: 'single';
|
|
4
|
+
index: number;
|
|
5
|
+
} | {
|
|
6
|
+
type: 'range';
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
} | {
|
|
10
|
+
type: 'list';
|
|
11
|
+
indexes: number[];
|
|
12
|
+
};
|
|
13
|
+
interface DestructureSelection {
|
|
14
|
+
portId: string;
|
|
15
|
+
indexExpr: IndexExpression;
|
|
16
|
+
inputType?: InputType;
|
|
17
|
+
propertyPath?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
20
|
+
selections: DestructureSelection[];
|
|
21
|
+
outputMode: "per-input";
|
|
22
|
+
selectionMode: null;
|
|
23
|
+
}, false>;
|
|
24
|
+
export default definition;
|
|
25
|
+
export type { DestructureSelection, IndexExpression };
|
|
@@ -0,0 +1,65 @@
|
|
|
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: 'destructure',
|
|
6
|
+
label: 'Destructure',
|
|
7
|
+
description: 'Extract specific elements from an array by index or range',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Control Flow',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
selections: [],
|
|
14
|
+
outputMode: 'per-input',
|
|
15
|
+
selectionMode: null,
|
|
16
|
+
},
|
|
17
|
+
computePorts: ({ config, getConnectedOutput }) => {
|
|
18
|
+
const selections = config?.selections ?? [];
|
|
19
|
+
// Input accepts any array type
|
|
20
|
+
const inputTypes = ['image', 'video', 'audio', 'text', 'object'];
|
|
21
|
+
const inputs = [
|
|
22
|
+
{
|
|
23
|
+
id: 'array',
|
|
24
|
+
type: inputTypes,
|
|
25
|
+
isArray: true,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
const outputs = [];
|
|
30
|
+
// Determine base type from connected input
|
|
31
|
+
let baseType = 'object';
|
|
32
|
+
if (getConnectedOutput) {
|
|
33
|
+
const connectedOutput = getConnectedOutput('array');
|
|
34
|
+
if (connectedOutput?.type && connectedOutput.isArray) {
|
|
35
|
+
const connType = connectedOutput.type;
|
|
36
|
+
if (!Array.isArray(connType)) {
|
|
37
|
+
baseType = connType;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
for (const selection of selections) {
|
|
42
|
+
// If variable, add input port for index expression
|
|
43
|
+
if (selection.inputType === 'variable') {
|
|
44
|
+
inputs.push({
|
|
45
|
+
id: `idx-${selection.portId}`,
|
|
46
|
+
type: 'text',
|
|
47
|
+
isArray: false,
|
|
48
|
+
required: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
// Output type depends on index expression:
|
|
52
|
+
// - 'single' -> single item (isArray: false)
|
|
53
|
+
// - 'range' or 'list' -> array of items (isArray: true)
|
|
54
|
+
const outputIsArray = selection.indexExpr.type !== 'single';
|
|
55
|
+
outputs.push({
|
|
56
|
+
id: selection.portId,
|
|
57
|
+
type: baseType,
|
|
58
|
+
isArray: outputIsArray,
|
|
59
|
+
required: true,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return { inputs, outputs };
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
exports.default = definition;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BasePortType } from '../types';
|
|
2
|
+
interface ForEachOutputProperty {
|
|
3
|
+
portId: string;
|
|
4
|
+
propertyPath: string;
|
|
5
|
+
type: BasePortType;
|
|
6
|
+
isArray: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ForEachInputPort {
|
|
9
|
+
id: string;
|
|
10
|
+
type: BasePortType;
|
|
11
|
+
isArray: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const definition: import("./types").NodeDefinition<"generator", {
|
|
14
|
+
outputProperties: ForEachOutputProperty[];
|
|
15
|
+
inputPorts: ForEachInputPort[];
|
|
16
|
+
exposeItem: boolean;
|
|
17
|
+
exposeIndex: boolean;
|
|
18
|
+
outputMode: "per-input";
|
|
19
|
+
selectionMode: null;
|
|
20
|
+
}, false>;
|
|
21
|
+
export default definition;
|
|
22
|
+
export type { ForEachOutputProperty, ForEachInputPort };
|