ugcinc 4.5.31 → 4.5.33
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.
|
@@ -271,7 +271,9 @@ export declare const nodeDefinitions: {
|
|
|
271
271
|
textInputType: import("./types").InputType;
|
|
272
272
|
pattern: string;
|
|
273
273
|
patternInputType: import("./types").InputType;
|
|
274
|
-
|
|
274
|
+
aiPrompt: string;
|
|
275
|
+
useAiHelper: boolean;
|
|
276
|
+
inputs: import("./regex").RegexInput[];
|
|
275
277
|
outputMode: import("./types").OutputMode;
|
|
276
278
|
selectionMode: import("./types").SelectionMode | null;
|
|
277
279
|
}, import("./regex").RegexNodeInputs, import("./regex").RegexNodeOutputs, false> & {
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import type { TextValue, BooleanValue } from '../types';
|
|
2
2
|
import { type InputType, type OutputMode, type SelectionMode } from './types';
|
|
3
|
+
/** A named replacement input for the regex node */
|
|
4
|
+
export interface RegexInput {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
inputType: InputType;
|
|
9
|
+
}
|
|
3
10
|
/** Regex node inputs - optional based on inputType settings */
|
|
4
11
|
export interface RegexNodeInputs {
|
|
5
12
|
text?: TextValue;
|
|
6
13
|
pattern?: TextValue;
|
|
14
|
+
[key: string]: TextValue | undefined;
|
|
7
15
|
}
|
|
8
16
|
export interface RegexNodeOutputs {
|
|
17
|
+
result: TextValue;
|
|
9
18
|
match: BooleanValue;
|
|
10
19
|
groups: TextValue[];
|
|
11
20
|
}
|
|
@@ -14,7 +23,9 @@ declare const definition: import("./types").NodeDefinition<"regex", "generator",
|
|
|
14
23
|
textInputType: InputType;
|
|
15
24
|
pattern: string;
|
|
16
25
|
patternInputType: InputType;
|
|
17
|
-
|
|
26
|
+
aiPrompt: string;
|
|
27
|
+
useAiHelper: boolean;
|
|
28
|
+
inputs: RegexInput[];
|
|
18
29
|
outputMode: OutputMode;
|
|
19
30
|
selectionMode: SelectionMode | null;
|
|
20
31
|
}, RegexNodeInputs, RegexNodeOutputs, false>;
|
|
@@ -7,7 +7,7 @@ const types_1 = require("./types");
|
|
|
7
7
|
const definition = (0, types_1.defineNode)({
|
|
8
8
|
nodeId: 'regex',
|
|
9
9
|
label: 'Regex',
|
|
10
|
-
description: 'Match text
|
|
10
|
+
description: 'Match and replace text using regular expressions',
|
|
11
11
|
type: 'generator',
|
|
12
12
|
category: 'Generation',
|
|
13
13
|
outputModes: ['per-input', 'single'],
|
|
@@ -17,7 +17,9 @@ const definition = (0, types_1.defineNode)({
|
|
|
17
17
|
textInputType: 'static',
|
|
18
18
|
pattern: '',
|
|
19
19
|
patternInputType: 'static',
|
|
20
|
-
|
|
20
|
+
aiPrompt: '',
|
|
21
|
+
useAiHelper: false,
|
|
22
|
+
inputs: [],
|
|
21
23
|
outputMode: 'per-input',
|
|
22
24
|
selectionMode: null,
|
|
23
25
|
},
|
|
@@ -29,9 +31,17 @@ const definition = (0, types_1.defineNode)({
|
|
|
29
31
|
if (config?.patternInputType === 'variable') {
|
|
30
32
|
inputs.push({ id: 'pattern', type: 'text', isArray: false, required: true });
|
|
31
33
|
}
|
|
34
|
+
// Dynamic input ports for replacement values
|
|
35
|
+
const regexInputs = (config?.inputs ?? []);
|
|
36
|
+
for (const input of regexInputs) {
|
|
37
|
+
if (input.inputType === 'variable') {
|
|
38
|
+
inputs.push({ id: `input-${input.id}`, type: 'text', isArray: false, required: true });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
32
41
|
return {
|
|
33
42
|
inputs,
|
|
34
43
|
outputs: [
|
|
44
|
+
{ id: 'result', type: 'text', isArray: false, required: true },
|
|
35
45
|
{ id: 'match', type: 'boolean', isArray: false, required: true },
|
|
36
46
|
{ id: 'groups', type: 'text', isArray: true, required: true },
|
|
37
47
|
],
|
|
@@ -39,6 +49,7 @@ const definition = (0, types_1.defineNode)({
|
|
|
39
49
|
},
|
|
40
50
|
generatePreview: (_config, _ctx, cachedOutputs) => {
|
|
41
51
|
return (0, types_1.preview)({
|
|
52
|
+
result: cachedOutputs?.result ?? null,
|
|
42
53
|
match: cachedOutputs?.match ?? null,
|
|
43
54
|
groups: cachedOutputs?.groups ?? null,
|
|
44
55
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export type { ManualTriggerNodeConfig, ManualTriggerNodeOutputs } from './automa
|
|
|
61
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
|
+
export type { RegexNodeConfig, RegexInput } from './automations/nodes/regex';
|
|
64
65
|
export type { OutputNodeConfig, OutputNodeOutputs } from './automations/nodes/output';
|
|
65
66
|
export type { RandomNodeConfig, RandomInputPort, RandomNodeMode, RandomNodeOutputs } from './automations/nodes/random';
|
|
66
67
|
export type { RandomRouteNodeConfig, RandomRouteBranch, RandomRoutePassthroughInput, } from './automations/nodes/random-route';
|