ugcinc 4.1.15 → 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,13 +13,14 @@ 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';
20
20
  export { selectFromPool } from './automations/selection';
21
21
  export { portId, isValidPortId, portIdToTitle, normalizeToPortId, PortIdSchema } from './port-id';
22
22
  export type { PortId } from './port-id';
23
+ export { extractTemplateVariables } from './internal-utils';
23
24
  export type { ClientConfig } from './base';
24
25
  export type { Account, AccountStat, AccountTask, EditProfileInfo, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, AccountInfoUpdate, UpdateAccountInfoParams, AccountInfoUpdateResult, UpdateAccountInfoResponse, AccountSocialUpdate, UpdateAccountSocialParams, AccountSocialUpdateResult, UpdateAccountSocialResponse, DeleteAccountPostsParams, DeleteAccountPostsResponse, ResetWarmupParams, ResetWarmupResponse, } from './accounts';
25
26
  export type { TaskType, Task, GetTasksParams } from './tasks';
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.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; } });
@@ -80,6 +82,8 @@ Object.defineProperty(exports, "isValidPortId", { enumerable: true, get: functio
80
82
  Object.defineProperty(exports, "portIdToTitle", { enumerable: true, get: function () { return port_id_1.portIdToTitle; } });
81
83
  Object.defineProperty(exports, "normalizeToPortId", { enumerable: true, get: function () { return port_id_1.normalizeToPortId; } });
82
84
  Object.defineProperty(exports, "PortIdSchema", { enumerable: true, get: function () { return port_id_1.PortIdSchema; } });
85
+ var internal_utils_1 = require("./internal-utils");
86
+ Object.defineProperty(exports, "extractTemplateVariables", { enumerable: true, get: function () { return internal_utils_1.extractTemplateVariables; } });
83
87
  var image_composer_1 = require("./automations/nodes/image-composer");
84
88
  Object.defineProperty(exports, "prepareImageComposerInput", { enumerable: true, get: function () { return image_composer_1.prepareImageComposerInput; } });
85
89
  var destructure_1 = require("./automations/nodes/destructure");
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Internal utility functions shared between node definitions.
3
- * These are NOT exported from the package.
4
3
  */
5
4
  /**
6
5
  * Extract template variables from text (e.g., "Hello {{name}}" -> ["name"])
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  /**
3
3
  * Internal utility functions shared between node definitions.
4
- * These are NOT exported from the package.
5
4
  */
6
5
  Object.defineProperty(exports, "__esModule", { value: true });
7
6
  exports.extractTemplateVariables = extractTemplateVariables;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.1.15",
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",