ugcinc 4.1.44 → 4.1.45

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.
@@ -10,9 +10,9 @@
10
10
  *
11
11
  * All functions work with WorkflowNodeDefinition[] (embedded connection format).
12
12
  */
13
- import type { WorkflowNodeDefinition, ComputedNode, NodePort, NodePortWithPreview, BasePortType, ValidationError, UserCreatableNodeType, PortValue, PortValueFor, AccountData } from './automations/types';
14
- import type { ObjectSchemaField, ResolvedPreview } from './automations/nodes/types';
15
- import type { Media } from './media';
13
+ import type { WorkflowNodeDefinition, ComputedNode, NodePort, NodePortWithPreview, BasePortType, ValidationError, UserCreatableNodeType, PortValue, PortValueFor, AccountData } from './types';
14
+ import type { ObjectSchemaField, ResolvedPreview } from './nodes/types';
15
+ import type { Media } from '../media';
16
16
  /**
17
17
  * Connection extracted from embedded inputs format.
18
18
  * Used for canvas rendering and graph operations.
@@ -45,8 +45,8 @@ exports.removePreviewForConnection = removePreviewForConnection;
45
45
  exports.computePreviewMap = computePreviewMap;
46
46
  exports.updatePreviewMapForConnection = updatePreviewMapForConnection;
47
47
  exports.shuffleNodePreview = shuffleNodePreview;
48
- const types_1 = require("./automations/types");
49
- const nodes_1 = require("./automations/nodes");
48
+ const types_1 = require("./types");
49
+ const nodes_1 = require("./nodes");
50
50
  // ===========================================================================
51
51
  // Internal Helpers (not exported)
52
52
  // ===========================================================================
@@ -1,5 +1,6 @@
1
1
  import type { VideoValue } from '../types';
2
2
  import { type OutputMode } from './types';
3
+ import type { CaptionStyle } from '../../render/types/caption';
3
4
  export interface AutoCaptionNodeInputs {
4
5
  video: VideoValue;
5
6
  }
@@ -34,3 +35,8 @@ declare const _default: typeof definition & {
34
35
  };
35
36
  export default _default;
36
37
  export type AutoCaptionNodeConfig = typeof definition.defaults;
38
+ /**
39
+ * Convert AutoCaptionNodeConfig to Partial<CaptionStyle> for use with resolveCaptionStyle.
40
+ * This handles the mapping from node config field names to CaptionStyle field names.
41
+ */
42
+ export declare function nodeConfigToCaptionStyle(config: AutoCaptionNodeConfig | undefined): Partial<CaptionStyle>;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nodeConfigToCaptionStyle = nodeConfigToCaptionStyle;
3
4
  const types_1 = require("./types");
5
+ const captionPresets_1 = require("../../render/utils/captionPresets");
4
6
  // =============================================================================
5
7
  // Node Definition
6
8
  // =============================================================================
@@ -55,3 +57,32 @@ const definition = (0, types_1.defineNode)({
55
57
  },
56
58
  });
57
59
  exports.default = definition;
60
+ /**
61
+ * Convert AutoCaptionNodeConfig to Partial<CaptionStyle> for use with resolveCaptionStyle.
62
+ * This handles the mapping from node config field names to CaptionStyle field names.
63
+ */
64
+ function nodeConfigToCaptionStyle(config) {
65
+ if (!config)
66
+ return {};
67
+ return {
68
+ preset: config.preset,
69
+ fontName: config.fontName,
70
+ fontSize: config.fontSize,
71
+ fontWeight: config.fontWeight,
72
+ fontColor: config.fontColor ? (0, captionPresets_1.colorNameToHex)(config.fontColor) : undefined,
73
+ highlightColor: config.highlightColor ? (0, captionPresets_1.colorNameToHex)(config.highlightColor) : undefined,
74
+ strokeColor: config.strokeColor ? (0, captionPresets_1.colorNameToHex)(config.strokeColor) : undefined,
75
+ strokeWidth: config.strokeWidth,
76
+ backgroundColor: config.backgroundColor && config.backgroundColor !== 'none' && config.backgroundColor !== 'transparent'
77
+ ? (0, captionPresets_1.colorNameToHex)(config.backgroundColor)
78
+ : undefined,
79
+ backgroundOpacity: config.backgroundColor && config.backgroundColor !== 'none' && config.backgroundColor !== 'transparent'
80
+ ? 0.7
81
+ : undefined,
82
+ position: config.position,
83
+ yOffset: config.yOffset,
84
+ maxWidth: config.maxWidth,
85
+ enableAnimation: config.enableAnimation,
86
+ wordsPerPage: config.wordsPerSubtitle,
87
+ };
88
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LLMProviders = void 0;
4
- const utils_1 = require("../../utils");
4
+ const utils_1 = require("../utils");
5
5
  const types_1 = require("./types");
6
6
  // =============================================================================
7
7
  // Config Types
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const types_1 = require("./types");
4
- const utils_1 = require("../../utils");
4
+ const utils_1 = require("../utils");
5
5
  const selection_1 = require("../selection");
6
6
  // =============================================================================
7
7
  // Node Definition
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, computePortsWithPreviews, computeAllNodePorts, computeAllNodePortsWithPreviews, getInputPreviewValue, getAllNodes, getNodeByType, getOutputSchema, createNode, deriveConnections, addConnection, removeConnection, removeNodeConnections, cleanupStaleConnections, getConnectedSource, getForEachContext, checkCrossContextViolation, validateWorkflow, getErrorNodeIds, getPortErrorsForNode, hasMissingTriggerError, hasMissingTerminalError, getWorkflowOutputSchema, resolveNodePreview, computeAllNodePreviews, computePreviewMap, updatePreviewMapForConnection, removePreviewForConnection, getPreviewValue, shuffleNodePreview, type PreviewMap, type NodePreviewOutputs, type Connection, generateNodeName, extractWorkflowConfig, type WorkflowTemplateData, } from './graph-controller';
16
+ export { areTypesCompatible, computePortsForNode, computePortsWithPreviews, computeAllNodePorts, computeAllNodePortsWithPreviews, getInputPreviewValue, getAllNodes, getNodeByType, getOutputSchema, createNode, deriveConnections, addConnection, removeConnection, removeNodeConnections, cleanupStaleConnections, getConnectedSource, getForEachContext, checkCrossContextViolation, validateWorkflow, getErrorNodeIds, getPortErrorsForNode, hasMissingTriggerError, hasMissingTerminalError, getWorkflowOutputSchema, resolveNodePreview, computeAllNodePreviews, computePreviewMap, updatePreviewMapForConnection, removePreviewForConnection, getPreviewValue, shuffleNodePreview, type PreviewMap, type NodePreviewOutputs, type Connection, generateNodeName, extractWorkflowConfig, type WorkflowTemplateData, } from './automations/graph-controller';
17
17
  export { nodeDefinitions, internalNodeTypes, isAsyncExecutor, formatPortType, isPortType } from './automations/types';
18
18
  export { getNodeDefinition } from './automations/nodes';
19
19
  export { isEditModel, ALL_IMAGE_MODELS, IMAGE_ASPECT_RATIOS } from './automations/nodes/generate-image';
@@ -21,7 +21,7 @@ export { isImageToVideoModel, ALL_VIDEO_MODELS, getModelAspectRatios, getModelDu
21
21
  export { selectFromPool } from './automations/selection';
22
22
  export { portId, isValidPortId, portIdToTitle, normalizeToPortId, PortIdSchema } from './port-id';
23
23
  export type { PortId } from './port-id';
24
- export { extractTemplateVariables, processTemplate } from './utils';
24
+ export { extractTemplateVariables, processTemplate } from './automations/utils';
25
25
  export type { InputType } from './automations/nodes/types';
26
26
  export type { ClientConfig } from './base';
27
27
  export type { Account, AccountStat, AccountTask, EditProfileInfo, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, AccountInfoUpdate, UpdateAccountInfoParams, AccountInfoUpdateResult, UpdateAccountInfoResponse, AccountSocialUpdate, UpdateAccountSocialParams, AccountSocialUpdateResult, UpdateAccountSocialResponse, DeleteAccountPostsParams, DeleteAccountPostsResponse, ResetWarmupParams, ResetWarmupResponse, } from './accounts';
@@ -37,6 +37,7 @@ export type { ImageEditorNodeConfig, ImageComposerNodeConfig, ImageComposerRende
37
37
  export { prepareImageComposerInput } from './automations/nodes/image-composer';
38
38
  export type { AccountNodeConfig } from './automations/nodes/account';
39
39
  export type { AutoCaptionNodeConfig, AutoCaptionPreset, AutoCaptionFontWeight, AutoCaptionPosition, } from './automations/nodes/auto-caption';
40
+ export { nodeConfigToCaptionStyle } from './automations/nodes/auto-caption';
40
41
  export type { AutoPostNodeConfig, AutoPostMode, PostSchedulingMode, } from './automations/nodes/auto-post';
41
42
  export type { BranchNodeConfig, BranchDefinition, BranchPassthroughInput, BranchValueConfig, } from './automations/nodes/branch';
42
43
  export type { CollectNodeConfig, CollectedValues } from './automations/nodes/collect';
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.isEditModel = exports.getNodeDefinition = exports.isPortType = exports.formatPortType = exports.isAsyncExecutor = exports.internalNodeTypes = exports.nodeDefinitions = exports.extractWorkflowConfig = exports.generateNodeName = exports.shuffleNodePreview = exports.getPreviewValue = exports.removePreviewForConnection = exports.updatePreviewMapForConnection = exports.computePreviewMap = exports.computeAllNodePreviews = exports.resolveNodePreview = exports.getWorkflowOutputSchema = exports.hasMissingTerminalError = exports.hasMissingTriggerError = exports.getPortErrorsForNode = exports.getErrorNodeIds = exports.validateWorkflow = exports.checkCrossContextViolation = exports.getForEachContext = exports.getConnectedSource = exports.cleanupStaleConnections = exports.removeNodeConnections = exports.removeConnection = exports.addConnection = exports.deriveConnections = exports.createNode = exports.getOutputSchema = exports.getNodeByType = exports.getAllNodes = exports.getInputPreviewValue = exports.computeAllNodePortsWithPreviews = exports.computeAllNodePorts = exports.computePortsWithPreviews = 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
- exports.prepareVideoComposerInput = exports.LLMProviders = exports.IfLogicOperators = exports.indexExpressionToIndexes = exports.prepareImageComposerInput = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = void 0;
9
+ exports.prepareVideoComposerInput = exports.LLMProviders = exports.IfLogicOperators = exports.indexExpressionToIndexes = exports.nodeConfigToCaptionStyle = exports.prepareImageComposerInput = exports.processTemplate = exports.extractTemplateVariables = exports.PortIdSchema = exports.normalizeToPortId = exports.portIdToTitle = exports.isValidPortId = exports.portId = exports.selectFromPool = exports.getModelDurations = exports.getModelAspectRatios = exports.ALL_VIDEO_MODELS = exports.isImageToVideoModel = exports.IMAGE_ASPECT_RATIOS = exports.ALL_IMAGE_MODELS = void 0;
10
10
  // =============================================================================
11
11
  // Client Exports
12
12
  // =============================================================================
@@ -33,7 +33,7 @@ Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: functi
33
33
  // =============================================================================
34
34
  // Graph Controller Exports
35
35
  // =============================================================================
36
- var graph_controller_1 = require("./graph-controller");
36
+ var graph_controller_1 = require("./automations/graph-controller");
37
37
  // Type compatibility
38
38
  Object.defineProperty(exports, "areTypesCompatible", { enumerable: true, get: function () { return graph_controller_1.areTypesCompatible; } });
39
39
  // Port computation (single node)
@@ -109,11 +109,13 @@ Object.defineProperty(exports, "isValidPortId", { enumerable: true, get: functio
109
109
  Object.defineProperty(exports, "portIdToTitle", { enumerable: true, get: function () { return port_id_1.portIdToTitle; } });
110
110
  Object.defineProperty(exports, "normalizeToPortId", { enumerable: true, get: function () { return port_id_1.normalizeToPortId; } });
111
111
  Object.defineProperty(exports, "PortIdSchema", { enumerable: true, get: function () { return port_id_1.PortIdSchema; } });
112
- var utils_1 = require("./utils");
112
+ var utils_1 = require("./automations/utils");
113
113
  Object.defineProperty(exports, "extractTemplateVariables", { enumerable: true, get: function () { return utils_1.extractTemplateVariables; } });
114
114
  Object.defineProperty(exports, "processTemplate", { enumerable: true, get: function () { return utils_1.processTemplate; } });
115
115
  var image_composer_1 = require("./automations/nodes/image-composer");
116
116
  Object.defineProperty(exports, "prepareImageComposerInput", { enumerable: true, get: function () { return image_composer_1.prepareImageComposerInput; } });
117
+ var auto_caption_1 = require("./automations/nodes/auto-caption");
118
+ Object.defineProperty(exports, "nodeConfigToCaptionStyle", { enumerable: true, get: function () { return auto_caption_1.nodeConfigToCaptionStyle; } });
117
119
  var destructure_1 = require("./automations/nodes/destructure");
118
120
  Object.defineProperty(exports, "indexExpressionToIndexes", { enumerable: true, get: function () { return destructure_1.indexExpressionToIndexes; } });
119
121
  var if_1 = require("./automations/nodes/if");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "4.1.44",
3
+ "version": "4.1.45",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
File without changes
File without changes