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.
- 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 +18 -0
- package/dist/automations/nodes/account.js +29 -0
- package/dist/automations/nodes/auto-caption.d.ts +64 -0
- package/dist/automations/nodes/auto-caption.js +46 -0
- package/dist/automations/nodes/auto-post.d.ts +81 -0
- package/dist/automations/nodes/auto-post.js +54 -0
- package/dist/automations/nodes/branch.d.ts +58 -0
- package/dist/automations/nodes/branch.js +50 -0
- package/dist/automations/nodes/collect.d.ts +16 -0
- package/dist/automations/nodes/collect.js +56 -0
- package/dist/automations/nodes/compose-workflow.d.ts +21 -0
- package/dist/automations/nodes/compose-workflow.js +42 -0
- package/dist/automations/nodes/create-dm.d.ts +96 -0
- package/dist/automations/nodes/create-dm.js +88 -0
- package/dist/automations/nodes/custom-model.d.ts +19 -0
- package/dist/automations/nodes/custom-model.js +52 -0
- package/dist/automations/nodes/deduplicate.d.ts +8 -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 +23 -0
- package/dist/automations/nodes/for-each.js +84 -0
- package/dist/automations/nodes/generate-image.d.ts +16 -0
- package/dist/automations/nodes/generate-image.js +45 -0
- package/dist/automations/nodes/generate-video.d.ts +16 -0
- package/dist/automations/nodes/generate-video.js +45 -0
- package/dist/automations/nodes/if.d.ts +22 -0
- package/dist/automations/nodes/if.js +44 -0
- package/dist/automations/nodes/image-composer.d.ts +33 -0
- package/dist/automations/nodes/image-composer.js +95 -0
- package/dist/automations/nodes/index.d.ts +20 -0
- package/dist/automations/nodes/index.js +93 -0
- package/dist/automations/nodes/llm.d.ts +27 -0
- package/dist/automations/nodes/llm.js +85 -0
- package/dist/automations/nodes/manual-trigger.d.ts +34 -0
- package/dist/automations/nodes/manual-trigger.js +32 -0
- package/dist/automations/nodes/media.d.ts +17 -0
- package/dist/automations/nodes/media.js +40 -0
- package/dist/automations/nodes/not.d.ts +6 -0
- package/dist/automations/nodes/not.js +35 -0
- package/dist/automations/nodes/output.d.ts +30 -0
- package/dist/automations/nodes/output.js +32 -0
- package/dist/automations/nodes/random-route.d.ts +52 -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 +69 -0
- package/dist/automations/nodes/recurrence.js +50 -0
- package/dist/automations/nodes/save-to-media.d.ts +32 -0
- package/dist/automations/nodes/save-to-media.js +31 -0
- package/dist/automations/nodes/screenshot-animation.d.ts +7 -0
- package/dist/automations/nodes/screenshot-animation.js +36 -0
- package/dist/automations/nodes/social-audio.d.ts +8 -0
- package/dist/automations/nodes/social-audio.js +30 -0
- package/dist/automations/nodes/text.d.ts +7 -0
- package/dist/automations/nodes/text.js +41 -0
- package/dist/automations/nodes/transcript.d.ts +6 -0
- package/dist/automations/nodes/transcript.js +46 -0
- package/dist/automations/nodes/types.d.ts +178 -0
- package/dist/automations/nodes/types.js +22 -0
- package/dist/automations/nodes/video-composer.d.ts +25 -0
- package/dist/automations/nodes/video-composer.js +71 -0
- package/dist/automations/nodes/video-import.d.ts +27 -0
- package/dist/automations/nodes/video-import.js +37 -0
- package/dist/automations/types.d.ts +544 -0
- package/dist/automations/types.js +101 -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 +194 -0
- package/dist/graph-controller.js +623 -0
- package/dist/index.d.ts +38 -9
- package/dist/index.js +43 -23
- 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 +20 -20
- package/dist/render/types/video.d.ts +2 -2
- 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,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'recurrence',
|
|
5
|
+
label: 'Recurring',
|
|
6
|
+
description: 'Run continuously',
|
|
7
|
+
type: 'trigger',
|
|
8
|
+
category: 'Triggers',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
recurrenceConfig: {
|
|
11
|
+
frequencyType: 'per-day',
|
|
12
|
+
runsPerDay: 1,
|
|
13
|
+
periodDays: 7,
|
|
14
|
+
daysOfWeek: ['monday', 'tuesday', 'wednesday', 'thursday', 'friday'],
|
|
15
|
+
timingType: 'random-window',
|
|
16
|
+
specificTimes: ['09:00'],
|
|
17
|
+
randomWindowStart: '09:00',
|
|
18
|
+
randomWindowEnd: '17:00',
|
|
19
|
+
timezone: 'America/New_York',
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
computePorts: ({ config }) => {
|
|
23
|
+
const recurrenceConfig = config?.recurrenceConfig;
|
|
24
|
+
const outputs = [];
|
|
25
|
+
// Add account output if collection input is enabled
|
|
26
|
+
if (recurrenceConfig?.collectionInput?.enabled) {
|
|
27
|
+
outputs.push({ id: 'account', type: 'account', isArray: false, required: true });
|
|
28
|
+
}
|
|
29
|
+
// Add media outputs
|
|
30
|
+
const mediaOutputs = recurrenceConfig?.mediaInput?.outputs ?? [];
|
|
31
|
+
for (const output of mediaOutputs) {
|
|
32
|
+
outputs.push({
|
|
33
|
+
id: output.id,
|
|
34
|
+
type: output.type,
|
|
35
|
+
isArray: false,
|
|
36
|
+
required: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
inputs: [],
|
|
41
|
+
outputs,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
exports.default = definition;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'save-to-media',
|
|
5
|
+
label: 'Save To Media',
|
|
6
|
+
description: 'Save outputs to media library',
|
|
7
|
+
type: 'terminal',
|
|
8
|
+
category: 'Output',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
saveToMediaConfig: {
|
|
11
|
+
inputs: [{ id: 'input', type: 'image' }],
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
computePorts: ({ config }) => {
|
|
15
|
+
const saveConfig = config?.saveToMediaConfig;
|
|
16
|
+
const configInputs = saveConfig?.inputs ?? [];
|
|
17
|
+
const inputs = configInputs.map(input => ({
|
|
18
|
+
id: input.id,
|
|
19
|
+
type: input.type,
|
|
20
|
+
isArray: false,
|
|
21
|
+
required: true,
|
|
22
|
+
}));
|
|
23
|
+
return { inputs, outputs: [] };
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
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: 'screenshot-animation',
|
|
6
|
+
label: 'Animate Screenshot',
|
|
7
|
+
description: 'Create an iPhone screenshot animation from an image',
|
|
8
|
+
type: 'generator',
|
|
9
|
+
category: 'Generation',
|
|
10
|
+
outputModes: ['per-input', 'single'],
|
|
11
|
+
selectionModes: null,
|
|
12
|
+
defaults: {
|
|
13
|
+
holdDurationMs: 500,
|
|
14
|
+
outputMode: 'per-input',
|
|
15
|
+
selectionMode: null,
|
|
16
|
+
},
|
|
17
|
+
computePorts: () => ({
|
|
18
|
+
inputs: [
|
|
19
|
+
{
|
|
20
|
+
id: 'image',
|
|
21
|
+
type: 'image',
|
|
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,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'social-audio',
|
|
5
|
+
label: 'Social Audio',
|
|
6
|
+
description: 'Select trending audio for posts',
|
|
7
|
+
type: 'source',
|
|
8
|
+
category: 'Sources',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
urls: [],
|
|
11
|
+
selectedMediaIds: [],
|
|
12
|
+
selectionConfig: { mode: 'random' },
|
|
13
|
+
}),
|
|
14
|
+
computePorts: () => ({
|
|
15
|
+
inputs: [],
|
|
16
|
+
outputs: [
|
|
17
|
+
{
|
|
18
|
+
id: 'social-audio',
|
|
19
|
+
type: 'social_audio',
|
|
20
|
+
isArray: false,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
exports.default = definition;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const internal_utils_1 = require("../internal-utils");
|
|
4
|
+
const definition = {
|
|
5
|
+
nodeId: 'text',
|
|
6
|
+
label: 'Text',
|
|
7
|
+
description: 'Use text collections',
|
|
8
|
+
type: 'source',
|
|
9
|
+
category: 'Sources',
|
|
10
|
+
getDefaultConfig: () => ({
|
|
11
|
+
textOptions: [],
|
|
12
|
+
selectionConfig: { mode: 'random' },
|
|
13
|
+
outputMode: 'per-input',
|
|
14
|
+
}),
|
|
15
|
+
computePorts: ({ config }) => {
|
|
16
|
+
const textOptions = (config?.textOptions ?? []);
|
|
17
|
+
const variables = (0, internal_utils_1.extractTemplateVariables)(textOptions);
|
|
18
|
+
// Generate inputs from template variables
|
|
19
|
+
const inputs = variables.map(variable => ({
|
|
20
|
+
id: variable,
|
|
21
|
+
type: 'text',
|
|
22
|
+
isArray: false,
|
|
23
|
+
required: false,
|
|
24
|
+
}));
|
|
25
|
+
return {
|
|
26
|
+
inputs,
|
|
27
|
+
outputs: [
|
|
28
|
+
{
|
|
29
|
+
id: 'text',
|
|
30
|
+
type: 'text',
|
|
31
|
+
isArray: false,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
exports.default = definition;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'transcript',
|
|
5
|
+
label: 'Transcribe',
|
|
6
|
+
description: 'Transcribe video or audio with timestamps',
|
|
7
|
+
type: 'generator',
|
|
8
|
+
category: 'Generation',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
outputMode: 'per-input',
|
|
11
|
+
}),
|
|
12
|
+
computePorts: () => ({
|
|
13
|
+
inputs: [
|
|
14
|
+
{
|
|
15
|
+
id: 'media',
|
|
16
|
+
type: ['video', 'audio'],
|
|
17
|
+
isArray: false,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
outputs: [
|
|
22
|
+
{
|
|
23
|
+
id: 'text',
|
|
24
|
+
type: 'text',
|
|
25
|
+
isArray: false,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'segments',
|
|
30
|
+
type: 'object',
|
|
31
|
+
isArray: false,
|
|
32
|
+
required: true,
|
|
33
|
+
objectSchema: [
|
|
34
|
+
{ name: 'text', type: 'string' },
|
|
35
|
+
{ name: 'start', type: 'number' },
|
|
36
|
+
{ name: 'end', type: 'number' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
41
|
+
};
|
|
42
|
+
exports.default = definition;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Definition Types
|
|
3
|
+
*
|
|
4
|
+
* This file contains shared types for node definitions.
|
|
5
|
+
* Each node file imports from here and defines its behavior.
|
|
6
|
+
*/
|
|
7
|
+
import type { NodePort, BasePortType } from '../types';
|
|
8
|
+
export type NodeCategory = 'trigger' | 'source' | 'generator' | 'terminal';
|
|
9
|
+
export type OutputMode = 'per-input' | 'single';
|
|
10
|
+
export type SelectionMode = 'random' | 'sequential';
|
|
11
|
+
export type ExhaustionBehavior = 'restart' | 'error';
|
|
12
|
+
export type InputType = 'static' | 'variable';
|
|
13
|
+
type PrimitiveType = 'string' | 'number' | 'boolean';
|
|
14
|
+
/**
|
|
15
|
+
* Generic type for object schema fields with compile-time depth enforcement.
|
|
16
|
+
*
|
|
17
|
+
* - Level 1 (default): Can have 'object' or 'array' types, arrays can contain objects
|
|
18
|
+
* - Level 2: Can have 'object' or 'array' types, arrays cannot contain objects
|
|
19
|
+
* - Level 3: Only primitive types allowed
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Level 1 field (top-level)
|
|
23
|
+
* const field: SchemaField = { name: 'users', type: 'array', items: 'object', objectSchema: [...] };
|
|
24
|
+
*
|
|
25
|
+
* // Level 2 field (inside objectSchema)
|
|
26
|
+
* const nested: SchemaField<true, false> = { name: 'tags', type: 'array', items: 'string' };
|
|
27
|
+
*
|
|
28
|
+
* // Level 3 field (deepest level)
|
|
29
|
+
* const leaf: SchemaField<false, false> = { name: 'id', type: 'string' };
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Schema field type with compile-time depth enforcement for array items.
|
|
33
|
+
*
|
|
34
|
+
* - Level 1 (default): Arrays can contain objects (`items: 'object'`)
|
|
35
|
+
* - Level 2+: Arrays can only contain primitives
|
|
36
|
+
*
|
|
37
|
+
* The `objectSchema` property is always `ObjectSchemaField[]` so it can be
|
|
38
|
+
* passed directly to ports without type mismatches.
|
|
39
|
+
*/
|
|
40
|
+
export type SchemaField<CanNestObjects extends boolean = true> = {
|
|
41
|
+
name: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
type: PrimitiveType | 'object' | 'array';
|
|
44
|
+
items?: PrimitiveType | (CanNestObjects extends true ? 'object' : never);
|
|
45
|
+
objectSchema?: ObjectSchemaField[];
|
|
46
|
+
length?: number;
|
|
47
|
+
minLength?: number;
|
|
48
|
+
maxLength?: number;
|
|
49
|
+
required?: boolean;
|
|
50
|
+
};
|
|
51
|
+
/** Top-level schema field - arrays can contain objects */
|
|
52
|
+
export type ObjectSchemaField = SchemaField<true>;
|
|
53
|
+
/** Nested schema field (inside objectSchema) - arrays can only contain primitives */
|
|
54
|
+
export type NestedSchemaField = SchemaField<false>;
|
|
55
|
+
export interface BranchValueConfig {
|
|
56
|
+
inputType?: InputType;
|
|
57
|
+
}
|
|
58
|
+
export interface PassthroughInput {
|
|
59
|
+
id: string;
|
|
60
|
+
type: string;
|
|
61
|
+
isArray?: boolean;
|
|
62
|
+
branchValues?: Record<string, BranchValueConfig>;
|
|
63
|
+
}
|
|
64
|
+
export interface SelectionConfig {
|
|
65
|
+
mode?: SelectionMode;
|
|
66
|
+
enforceUniqueness?: boolean;
|
|
67
|
+
exhaustionBehavior?: ExhaustionBehavior;
|
|
68
|
+
}
|
|
69
|
+
export interface SelectionState {
|
|
70
|
+
usedIndices: number[];
|
|
71
|
+
currentIndex: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Computes the required outputMode/selectionMode types based on node category.
|
|
75
|
+
* - trigger/terminal: both null
|
|
76
|
+
* - generator: outputMode required, selectionMode null
|
|
77
|
+
* - source: both required
|
|
78
|
+
*/
|
|
79
|
+
type DefaultsForCategory<T extends NodeCategory, TCustom extends Record<string, unknown>> = T extends 'source' ? TCustom & {
|
|
80
|
+
outputMode: OutputMode;
|
|
81
|
+
selectionMode: SelectionMode;
|
|
82
|
+
} : T extends 'generator' ? TCustom & {
|
|
83
|
+
outputMode: OutputMode;
|
|
84
|
+
selectionMode: null;
|
|
85
|
+
} : TCustom & {
|
|
86
|
+
outputMode: null;
|
|
87
|
+
selectionMode: null;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* Computes the outputModes array type based on node category.
|
|
91
|
+
*/
|
|
92
|
+
type OutputModesForCategory<T extends NodeCategory> = T extends 'source' | 'generator' ? OutputMode[] : null;
|
|
93
|
+
/**
|
|
94
|
+
* Computes the selectionModes array type based on node category.
|
|
95
|
+
*/
|
|
96
|
+
type SelectionModesForCategory<T extends NodeCategory> = T extends 'source' ? SelectionMode[] : null;
|
|
97
|
+
export interface NodeDefinition<T extends NodeCategory = NodeCategory, TDefaults extends Record<string, unknown> = Record<string, unknown>> {
|
|
98
|
+
nodeId: string;
|
|
99
|
+
label: string;
|
|
100
|
+
description: string;
|
|
101
|
+
type: T;
|
|
102
|
+
category: string;
|
|
103
|
+
outputModes: OutputModesForCategory<T>;
|
|
104
|
+
selectionModes: SelectionModesForCategory<T>;
|
|
105
|
+
defaults: DefaultsForCategory<T, TDefaults>;
|
|
106
|
+
computePorts: (params: {
|
|
107
|
+
config: DefaultsForCategory<T, TDefaults>;
|
|
108
|
+
getConnectedOutput?: (inputId: string) => {
|
|
109
|
+
type: BasePortType | BasePortType[];
|
|
110
|
+
isArray: boolean;
|
|
111
|
+
objectSchema?: ObjectSchemaField[];
|
|
112
|
+
} | null;
|
|
113
|
+
}) => {
|
|
114
|
+
inputs: NodePort[];
|
|
115
|
+
outputs: NodePort[];
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Define a node with full type inference.
|
|
120
|
+
*
|
|
121
|
+
* - outputMode/selectionMode in defaults are typed based on the node's `type`
|
|
122
|
+
* - Custom defaults are merged and available in computePorts
|
|
123
|
+
* - No manual type assertions needed
|
|
124
|
+
*/
|
|
125
|
+
export declare function defineNode<T extends NodeCategory, TCustomDefaults extends Record<string, unknown>>(def: {
|
|
126
|
+
nodeId: string;
|
|
127
|
+
label: string;
|
|
128
|
+
description: string;
|
|
129
|
+
type: T;
|
|
130
|
+
category: string;
|
|
131
|
+
outputModes: OutputModesForCategory<T>;
|
|
132
|
+
selectionModes: SelectionModesForCategory<T>;
|
|
133
|
+
defaults: DefaultsForCategory<T, TCustomDefaults>;
|
|
134
|
+
computePorts: (params: {
|
|
135
|
+
config: DefaultsForCategory<T, TCustomDefaults>;
|
|
136
|
+
getConnectedOutput?: (inputId: string) => {
|
|
137
|
+
type: BasePortType | BasePortType[];
|
|
138
|
+
isArray: boolean;
|
|
139
|
+
objectSchema?: ObjectSchemaField[];
|
|
140
|
+
} | null;
|
|
141
|
+
}) => {
|
|
142
|
+
inputs: NodePort[];
|
|
143
|
+
outputs: NodePort[];
|
|
144
|
+
};
|
|
145
|
+
}): NodeDefinition<T, TCustomDefaults>;
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Node Definition Types
|
|
4
|
+
*
|
|
5
|
+
* This file contains shared types for node definitions.
|
|
6
|
+
* Each node file imports from here and defines its behavior.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.defineNode = defineNode;
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Helper Function
|
|
12
|
+
// =============================================================================
|
|
13
|
+
/**
|
|
14
|
+
* Define a node with full type inference.
|
|
15
|
+
*
|
|
16
|
+
* - outputMode/selectionMode in defaults are typed based on the node's `type`
|
|
17
|
+
* - Custom defaults are merged and available in computePorts
|
|
18
|
+
* - No manual type assertions needed
|
|
19
|
+
*/
|
|
20
|
+
function defineNode(def) {
|
|
21
|
+
return def;
|
|
22
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'video-composer',
|
|
5
|
+
label: 'Video Composer',
|
|
6
|
+
description: 'Create templated videos',
|
|
7
|
+
type: 'generator',
|
|
8
|
+
category: 'Generation',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
videoEditor: {
|
|
11
|
+
width: 1080,
|
|
12
|
+
height: 1920,
|
|
13
|
+
fps: 30,
|
|
14
|
+
dimensionPreset: '9:16',
|
|
15
|
+
channels: [{
|
|
16
|
+
id: 'main-track',
|
|
17
|
+
name: 'Main Track',
|
|
18
|
+
segments: [],
|
|
19
|
+
}],
|
|
20
|
+
},
|
|
21
|
+
outputMode: 'per-input',
|
|
22
|
+
}),
|
|
23
|
+
computePorts: ({ config }) => {
|
|
24
|
+
const editorConfig = config?.videoEditor;
|
|
25
|
+
const inputs = [];
|
|
26
|
+
const addedIds = new Set();
|
|
27
|
+
if (editorConfig) {
|
|
28
|
+
editorConfig.channels.forEach(channel => {
|
|
29
|
+
channel.segments.forEach(segment => {
|
|
30
|
+
if (segment.inputRef && !addedIds.has(segment.inputRef)) {
|
|
31
|
+
addedIds.add(segment.inputRef);
|
|
32
|
+
const inputType = segment.type === 'video' ? 'video'
|
|
33
|
+
: segment.type === 'audio' ? 'audio'
|
|
34
|
+
: 'image';
|
|
35
|
+
inputs.push({
|
|
36
|
+
id: segment.inputRef,
|
|
37
|
+
type: inputType,
|
|
38
|
+
isArray: false,
|
|
39
|
+
required: segment.required ?? true,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (segment.textInputRef && !addedIds.has(segment.textInputRef)) {
|
|
43
|
+
addedIds.add(segment.textInputRef);
|
|
44
|
+
inputs.push({
|
|
45
|
+
id: segment.textInputRef,
|
|
46
|
+
type: 'text',
|
|
47
|
+
isArray: false,
|
|
48
|
+
required: segment.required ?? true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
inputs,
|
|
56
|
+
outputs: [
|
|
57
|
+
{
|
|
58
|
+
id: 'output',
|
|
59
|
+
type: 'video',
|
|
60
|
+
isArray: false,
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
exports.default = definition;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const definition = {
|
|
4
|
+
nodeId: 'video-import',
|
|
5
|
+
label: 'Import Video',
|
|
6
|
+
description: 'Import videos from YouTube, TikTok, Instagram & more',
|
|
7
|
+
type: 'source',
|
|
8
|
+
category: 'Sources',
|
|
9
|
+
getDefaultConfig: () => ({
|
|
10
|
+
videoImportConfig: {
|
|
11
|
+
platform: 'youtube',
|
|
12
|
+
videoQuality: '1080',
|
|
13
|
+
},
|
|
14
|
+
outputMode: 'per-input',
|
|
15
|
+
}),
|
|
16
|
+
computePorts: () => ({
|
|
17
|
+
inputs: [
|
|
18
|
+
{
|
|
19
|
+
id: 'url',
|
|
20
|
+
type: 'text',
|
|
21
|
+
isArray: false,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
outputs: [
|
|
26
|
+
{
|
|
27
|
+
id: 'video',
|
|
28
|
+
type: 'video',
|
|
29
|
+
isArray: false,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
}),
|
|
34
|
+
};
|
|
35
|
+
exports.default = definition;
|
package/dist/org.d.ts
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ApiResponse } from './types';
|
|
3
|
+
export interface ApiKey {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
created_at: string;
|
|
7
|
+
}
|
|
8
|
+
export interface DeleteApiKeyParams {
|
|
9
|
+
apiKeyId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface EditApiKeyParams {
|
|
12
|
+
apiKeyId: string;
|
|
13
|
+
name: string;
|
|
14
|
+
}
|
|
3
15
|
/**
|
|
4
16
|
* Client for managing organization resources
|
|
5
17
|
*/
|
package/dist/ports.js
CHANGED
|
@@ -33,7 +33,7 @@ function extractTemplateVariables(texts) {
|
|
|
33
33
|
*/
|
|
34
34
|
function computeInputPorts({ node }) {
|
|
35
35
|
const nodeConfigs = (0, automations_1.getAllNodes)();
|
|
36
|
-
const nodeConfig = nodeConfigs.find(n => n.
|
|
36
|
+
const nodeConfig = nodeConfigs.find(n => n.nodeId === node.type);
|
|
37
37
|
const baseInputs = nodeConfig?.inputs ?? [];
|
|
38
38
|
// Text nodes: generate inputs from template variables
|
|
39
39
|
if (node.type === 'text') {
|
|
@@ -135,13 +135,7 @@ function computeInputPorts({ node }) {
|
|
|
135
135
|
const variableNodes = node.config?.workflowVariableNodes;
|
|
136
136
|
if (!variableNodes || variableNodes.length === 0)
|
|
137
137
|
return baseInputs;
|
|
138
|
-
|
|
139
|
-
return variableNodes
|
|
140
|
-
.filter(v => {
|
|
141
|
-
const varName = v.name ?? v.id;
|
|
142
|
-
return !passThrough[varName];
|
|
143
|
-
})
|
|
144
|
-
.map(v => {
|
|
138
|
+
return variableNodes.map(v => {
|
|
145
139
|
const varType = v.variableType === 'dropdown' ? 'text' : (v.variableType ?? 'text');
|
|
146
140
|
return {
|
|
147
141
|
id: v.id,
|
|
@@ -320,7 +314,7 @@ function computeOutputPorts({ node }) {
|
|
|
320
314
|
}
|
|
321
315
|
// Fallback: use static outputs from getAllNodes() for nodes without dynamic ports
|
|
322
316
|
const nodeConfigs = (0, automations_1.getAllNodes)();
|
|
323
|
-
const nodeConfig = nodeConfigs.find(n => n.
|
|
317
|
+
const nodeConfig = nodeConfigs.find(n => n.nodeId === node.type);
|
|
324
318
|
return nodeConfig?.outputs ?? [];
|
|
325
319
|
}
|
|
326
320
|
/**
|
package/dist/posts.d.ts
CHANGED
|
@@ -1,5 +1,92 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ApiResponse } from './types';
|
|
3
|
+
export type PostType = 'video' | 'slideshow';
|
|
4
|
+
export type PostStatus = 'scheduled' | 'pending' | 'complete' | 'failed' | 'retrying' | 'deleting' | 'deleted' | 'hidden' | 'require-approval';
|
|
5
|
+
export interface Post {
|
|
6
|
+
id: string;
|
|
7
|
+
account_id: string;
|
|
8
|
+
type: PostType;
|
|
9
|
+
status: PostStatus;
|
|
10
|
+
social_id: string | null;
|
|
11
|
+
caption: string | null;
|
|
12
|
+
title: string | null;
|
|
13
|
+
media_urls: string[] | null;
|
|
14
|
+
music_post_id: string | null;
|
|
15
|
+
social_audio_id: string | null;
|
|
16
|
+
scheduled_at: string | null;
|
|
17
|
+
postUrl?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PostStat {
|
|
20
|
+
id: string;
|
|
21
|
+
post_id: string;
|
|
22
|
+
views: number | null;
|
|
23
|
+
likes: number | null;
|
|
24
|
+
comments: number | null;
|
|
25
|
+
shares: number | null;
|
|
26
|
+
saves: number | null;
|
|
27
|
+
created_at: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GetPostsParams {
|
|
30
|
+
accountIds?: string[];
|
|
31
|
+
postIds?: string[];
|
|
32
|
+
startDate?: string;
|
|
33
|
+
endDate?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface CreateSlideshowParams {
|
|
36
|
+
accountId: string | null;
|
|
37
|
+
caption?: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
socialAudioId?: string;
|
|
40
|
+
postTime?: string;
|
|
41
|
+
imageUrls: string[];
|
|
42
|
+
strict?: boolean;
|
|
43
|
+
tag?: string;
|
|
44
|
+
user_group?: string;
|
|
45
|
+
org_group?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface GetPostStatsParams {
|
|
48
|
+
postIds?: string[];
|
|
49
|
+
startDate?: string;
|
|
50
|
+
endDate?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface GetPostStatusParams {
|
|
53
|
+
postId: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CreateVideoParams {
|
|
56
|
+
accountId: string | null;
|
|
57
|
+
caption?: string;
|
|
58
|
+
socialAudioId?: string;
|
|
59
|
+
postTime?: string;
|
|
60
|
+
videoUrl: string;
|
|
61
|
+
strict?: boolean;
|
|
62
|
+
tag?: string;
|
|
63
|
+
user_group?: string;
|
|
64
|
+
org_group?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface DeletePostsParams {
|
|
67
|
+
postIds: string[];
|
|
68
|
+
}
|
|
69
|
+
export interface DeletePostsResponse {
|
|
70
|
+
deleted: number;
|
|
71
|
+
deleting: number;
|
|
72
|
+
deletedIds: string[];
|
|
73
|
+
deletingIds: string[];
|
|
74
|
+
errors?: Array<{
|
|
75
|
+
postId: string;
|
|
76
|
+
error: string;
|
|
77
|
+
}>;
|
|
78
|
+
}
|
|
79
|
+
export interface RetryPostsParams {
|
|
80
|
+
postIds: string[];
|
|
81
|
+
}
|
|
82
|
+
export interface SetPostStatusParams {
|
|
83
|
+
postIds: string[];
|
|
84
|
+
status: string;
|
|
85
|
+
}
|
|
86
|
+
export interface SetPostStatusResponse {
|
|
87
|
+
updated: number;
|
|
88
|
+
ids: string[];
|
|
89
|
+
}
|
|
3
90
|
/**
|
|
4
91
|
* Client for managing posts
|
|
5
92
|
*/
|