ugcinc 4.1.16 → 4.1.17

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.
@@ -87,6 +87,16 @@ export declare function getOutputSchema({ nodeType, nodeConfig, outputPortId, cl
87
87
  outputPortId: string;
88
88
  client?: AutomationsClient;
89
89
  }): Promise<ObjectSchemaField[] | null>;
90
+ /**
91
+ * Create a new node with default config from the node definition.
92
+ */
93
+ export declare function createNode({ type, id, name, x, y, }: {
94
+ type: UserCreatableNodeType;
95
+ id?: string;
96
+ name?: string;
97
+ x?: number;
98
+ y?: number;
99
+ }): WorkflowNodeDefinition;
90
100
  /**
91
101
  * Derive Connection[] array from nodes for canvas rendering
92
102
  *
@@ -17,6 +17,7 @@ exports.computePortsForNode = computePortsForNode;
17
17
  exports.getAllNodes = getAllNodes;
18
18
  exports.getNodeByType = getNodeByType;
19
19
  exports.getOutputSchema = getOutputSchema;
20
+ exports.createNode = createNode;
20
21
  exports.deriveConnections = deriveConnections;
21
22
  exports.addConnection = addConnection;
22
23
  exports.removeConnection = removeConnection;
@@ -325,6 +326,24 @@ async function getOutputSchema({ nodeType, nodeConfig, outputPortId, client, })
325
326
  return null;
326
327
  }
327
328
  // ===========================================================================
329
+ // Node Creation
330
+ // ===========================================================================
331
+ /**
332
+ * Create a new node with default config from the node definition.
333
+ */
334
+ function createNode({ type, id, name, x, y, }) {
335
+ const definition = nodes_1.nodeDefinitions[type];
336
+ return {
337
+ id: id ?? `${type}-${Date.now()}`,
338
+ type,
339
+ name,
340
+ config: structuredClone(definition.defaults),
341
+ inputs: {},
342
+ x,
343
+ y,
344
+ };
345
+ }
346
+ // ===========================================================================
328
347
  // Connection Management
329
348
  // ===========================================================================
330
349
  /**
package/dist/index.d.ts CHANGED
@@ -13,7 +13,7 @@ export { RenderClient } from './render';
13
13
  export { AutomationsClient } from './automations';
14
14
  export { MediaClient } from './media';
15
15
  export { CommentsClient } from './comments';
16
- export { areTypesCompatible, computePortsForNode, getAllNodes, getNodeByType, getOutputSchema, deriveConnections, addConnection, removeConnection, removeNodeConnections, cleanupStaleConnections, getForEachContext, checkCrossContextViolation, validateWorkflow, getErrorNodeIds, getPortErrorsForNode, hasMissingTriggerError, hasMissingTerminalError, getWorkflowOutputSchema, type WorkflowOutputSchemaEntry, resolveNodePreview, } from './graph-controller';
16
+ export { areTypesCompatible, computePortsForNode, getAllNodes, getNodeByType, getOutputSchema, createNode, deriveConnections, addConnection, removeConnection, removeNodeConnections, cleanupStaleConnections, getForEachContext, checkCrossContextViolation, validateWorkflow, getErrorNodeIds, getPortErrorsForNode, hasMissingTriggerError, hasMissingTerminalError, getWorkflowOutputSchema, type WorkflowOutputSchemaEntry, resolveNodePreview, } from './graph-controller';
17
17
  export { nodeDefinitions, internalNodeTypes, isAsyncExecutor, formatPortType } from './automations/types';
18
18
  export { isEditModel } from './automations/nodes/generate-image';
19
19
  export { isImageToVideoModel } from './automations/nodes/generate-video';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Official TypeScript/JavaScript client for the UGC Inc API
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.prepareVideoComposerInput = exports.LLMProviders = exports.IfLogicOperators = exports.indexExpressionToIndexes = exports.prepareImageComposerInput = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.isImageToVideoModel = exports.isEditModel = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.checkCrossContextViolation = exports.getForEachContext = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.computePortsForNode = exports.areTypesCompatible = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
8
+ exports.prepareVideoComposerInput = exports.LLMProviders = exports.IfLogicOperators = exports.indexExpressionToIndexes = exports.prepareImageComposerInput = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.isImageToVideoModel = exports.isEditModel = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.checkCrossContextViolation = exports.getForEachContext = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.computePortsForNode = exports.areTypesCompatible = exports.CommentsClient = exports.MediaClient = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
9
9
  // =============================================================================
10
10
  // Client Exports
11
11
  // =============================================================================
@@ -41,6 +41,8 @@ Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function
41
41
  Object.defineProperty(exports, "getNodeByType", { enumerable: true, get: function () { return graph_controller_1.getNodeByType; } });
42
42
  // Output schema
43
43
  Object.defineProperty(exports, "getOutputSchema", { enumerable: true, get: function () { return graph_controller_1.getOutputSchema; } });
44
+ // Node creation
45
+ Object.defineProperty(exports, "createNode", { enumerable: true, get: function () { return graph_controller_1.createNode; } });
44
46
  // Connection management
45
47
  Object.defineProperty(exports, "deriveConnections", { enumerable: true, get: function () { return graph_controller_1.deriveConnections; } });
46
48
  Object.defineProperty(exports, "addConnection", { enumerable: true, get: function () { return graph_controller_1.addConnection; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.1.16",
3
+ "version": "4.1.17",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",