ugcinc 4.1.124 → 4.1.125

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.
@@ -324,13 +324,13 @@ export declare const nodeDefinitions: {
324
324
  __TInputs: import("./transcript").TranscriptNodeInputs;
325
325
  __TOutputs: import("./transcript").TranscriptNodeOutputs;
326
326
  };
327
- readonly variable: NodeDefinition<"variable", "source", {
327
+ readonly input: NodeDefinition<"input", "source", {
328
328
  outputs: import("../types").NodePort[];
329
329
  outputMode: import("./types").OutputMode | null;
330
330
  selectionMode: import("./types").SelectionMode | null;
331
- }, import("./variable").VariableNodeInputs, import("./variable").VariableNodeOutputs, false> & {
332
- __TInputs: import("./variable").VariableNodeInputs;
333
- __TOutputs: import("./variable").VariableNodeOutputs;
331
+ }, import("./input").InputNodeInputs, import("./input").InputNodeOutputs, false> & {
332
+ __TInputs: import("./input").InputNodeInputs;
333
+ __TOutputs: import("./input").InputNodeOutputs;
334
334
  };
335
335
  readonly 'video-composer': NodeDefinition<"video-composer", "generator", {
336
336
  videoEditor: {
@@ -39,7 +39,7 @@ const screenshot_animation_1 = __importDefault(require("./screenshot-animation")
39
39
  const social_audio_1 = __importDefault(require("./social-audio"));
40
40
  const text_1 = __importDefault(require("./text"));
41
41
  const transcript_1 = __importDefault(require("./transcript"));
42
- const variable_1 = __importDefault(require("./variable"));
42
+ const input_1 = __importDefault(require("./input"));
43
43
  const video_composer_1 = __importDefault(require("./video-composer"));
44
44
  const video_import_1 = __importDefault(require("./video-import"));
45
45
  // =============================================================================
@@ -78,7 +78,7 @@ exports.nodeDefinitions = {
78
78
  'social-audio': social_audio_1.default,
79
79
  'text': text_1.default,
80
80
  'transcript': transcript_1.default,
81
- 'variable': variable_1.default,
81
+ 'input': input_1.default,
82
82
  'video-composer': video_composer_1.default,
83
83
  'video-import': video_import_1.default,
84
84
  };
@@ -0,0 +1,18 @@
1
+ import type { NodePort, PortValue } from '../types';
2
+ import { type OutputMode, type SelectionMode } from './types';
3
+ /** Input node has no inputs (source node) */
4
+ export interface InputNodeInputs {
5
+ }
6
+ /** Input outputs are dynamic based on config. Output port IDs are user-defined. */
7
+ export type InputNodeOutputs = Record<string, PortValue | PortValue[]>;
8
+ declare const definition: import("./types").NodeDefinition<"input", "source", {
9
+ outputs: NodePort[];
10
+ outputMode: OutputMode | null;
11
+ selectionMode: SelectionMode | null;
12
+ }, InputNodeInputs, InputNodeOutputs, false>;
13
+ declare const _default: typeof definition & {
14
+ __TInputs: InputNodeInputs;
15
+ __TOutputs: InputNodeOutputs;
16
+ };
17
+ export default _default;
18
+ export type InputNodeConfig = typeof definition.defaults;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const types_1 = require("./types");
4
+ // =============================================================================
5
+ // Node Definition
6
+ // =============================================================================
7
+ const definition = (0, types_1.defineNode)({
8
+ nodeId: 'input',
9
+ label: 'Input',
10
+ description: 'Define runtime input variables',
11
+ type: 'source',
12
+ category: 'Sources',
13
+ outputModes: ['single', 'per-input'],
14
+ selectionModes: ['random', 'sequential'],
15
+ defaults: {
16
+ outputs: [],
17
+ outputMode: 'single',
18
+ selectionMode: 'random',
19
+ },
20
+ computePorts: ({ config }) => {
21
+ return {
22
+ inputs: [],
23
+ outputs: config?.outputs ?? [],
24
+ };
25
+ },
26
+ generatePreview: (config, _ctx) => {
27
+ // Input outputs are provided at runtime, no preview available
28
+ const result = {};
29
+ for (const output of config.outputs) {
30
+ result[output.id] = null;
31
+ }
32
+ return (0, types_1.preview)(result);
33
+ },
34
+ validate: (config) => {
35
+ const errors = [];
36
+ const outputs = config.outputs;
37
+ if (!outputs?.length) {
38
+ errors.push('Input node requires at least one output to be configured');
39
+ }
40
+ else {
41
+ const validTypes = ['image', 'video', 'audio', 'text', 'social_audio', 'account', 'boolean', 'object'];
42
+ for (const output of outputs) {
43
+ if (!output.id) {
44
+ errors.push('Input output requires an id');
45
+ }
46
+ const outputType = Array.isArray(output.type) ? output.type.join(' | ') : output.type;
47
+ if (!output.type || !validTypes.includes(outputType)) {
48
+ errors.push(`Invalid Input output type: ${outputType}`);
49
+ }
50
+ }
51
+ }
52
+ return errors;
53
+ },
54
+ });
55
+ exports.default = definition;
package/dist/index.d.ts CHANGED
@@ -58,7 +58,7 @@ export { IfLogicOperators, applyLogicOperator } from './automations/nodes/if';
58
58
  export type { LLMNodeConfig, LLMNodeOutputs, LLMProvider, } from './automations/nodes/llm';
59
59
  export { LLMProviders, outputFieldToZod, outputFieldsToZod } from './automations/nodes/llm';
60
60
  export type { ManualTriggerNodeConfig, ManualTriggerNodeOutputs } from './automations/nodes/manual-trigger';
61
- export type { VariableNodeConfig, VariableNodeOutputs } from './automations/nodes/variable';
61
+ export type { InputNodeConfig, InputNodeOutputs } from './automations/nodes/input';
62
62
  export type { MediaNodeConfig, MediaNodeOutput } from './automations/nodes/media';
63
63
  export type { NotNodeConfig } from './automations/nodes/not';
64
64
  export type { OutputNodeConfig, OutputNodeOutputs } from './automations/nodes/output';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.1.124",
3
+ "version": "4.1.125",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",