@hostwebhook/node-types 1.20.0 → 1.22.0
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.
- package/dist/connections.js +4 -3
- package/dist/dispatch.d.ts +6 -0
- package/dist/dispatch.js +46 -38
- package/dist/registry.js +6 -0
- package/dist/types.d.ts +31 -1
- package/dist/ui.js +2 -0
- package/package.json +1 -1
package/dist/connections.js
CHANGED
|
@@ -18,7 +18,7 @@ exports.isNodeType = isNodeType;
|
|
|
18
18
|
const PROCESSING_OUTPUTS = [
|
|
19
19
|
'endpoint', 'router', 'filter', 'transform', 'cache', 'code', 'rateLimiter',
|
|
20
20
|
'aggregator', 'conditional', 'delay', 'schemaValidator', 'split', 'markdown', 'fileTransform',
|
|
21
|
-
'emailAction', 'httpAction', 'mongoAction', 'notificationAction', 'sheetsAction', 'calendarAction', 'docsAction', 'firecrawlAction', 'vectorStore', 'loop',
|
|
21
|
+
'emailAction', 'httpAction', 'mongoAction', 'postgresAction', 'notificationAction', 'sheetsAction', 'calendarAction', 'docsAction', 'firecrawlAction', 'vectorStore', 'loop',
|
|
22
22
|
];
|
|
23
23
|
/** Standard processing input sources */
|
|
24
24
|
const STANDARD_INPUTS = [
|
|
@@ -26,7 +26,7 @@ const STANDARD_INPUTS = [
|
|
|
26
26
|
'cache', 'code', 'rateLimiter', 'aggregator', 'conditional', 'delay', 'schemaValidator', 'split', 'loop', 'markdown', 'fileTransform',
|
|
27
27
|
];
|
|
28
28
|
/** Action nodes that can chain (non-terminal) */
|
|
29
|
-
const CHAINABLE_ACTIONS = ['httpAction', 'mongoAction', 'sheetsAction', 'calendarAction', 'docsAction', 'firecrawlAction', 'vectorStore'];
|
|
29
|
+
const CHAINABLE_ACTIONS = ['httpAction', 'mongoAction', 'postgresAction', 'sheetsAction', 'calendarAction', 'docsAction', 'firecrawlAction', 'vectorStore'];
|
|
30
30
|
/** Full input list for action nodes (standard + chainable actions) */
|
|
31
31
|
const ACTION_INPUTS = [...STANDARD_INPUTS, ...CHAINABLE_ACTIONS];
|
|
32
32
|
exports.NODE_CONNECTIONS = {
|
|
@@ -49,7 +49,7 @@ exports.NODE_CONNECTIONS = {
|
|
|
49
49
|
// ── Flow control nodes ──
|
|
50
50
|
split: { acceptsInputFrom: STANDARD_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
|
|
51
51
|
merge: { acceptsInputFrom: ['endpoint', 'filter', 'transform', 'cache', 'rateLimiter', 'aggregator', 'conditional', 'delay', 'schemaValidator', 'split'], canOutputTo: PROCESSING_OUTPUTS },
|
|
52
|
-
approval: { acceptsInputFrom: ['endpoint', 'filter', 'transform'], canOutputTo: ['endpoint', 'filter', 'transform', 'emailAction', 'httpAction', 'mongoAction', 'notificationAction', 'sheetsAction', 'calendarAction'], special: { hasRejectionOutputNodes: true } },
|
|
52
|
+
approval: { acceptsInputFrom: ['endpoint', 'filter', 'transform'], canOutputTo: ['endpoint', 'filter', 'transform', 'emailAction', 'httpAction', 'mongoAction', 'postgresAction', 'notificationAction', 'sheetsAction', 'calendarAction'], special: { hasRejectionOutputNodes: true } },
|
|
53
53
|
loop: { acceptsInputFrom: STANDARD_INPUTS, canOutputTo: PROCESSING_OUTPUTS, special: { hasLoopBack: true } },
|
|
54
54
|
// ── Routing nodes ──
|
|
55
55
|
router: { acceptsInputFrom: ['endpoint', 'scheduledWebhook', 'filter', 'transform'], canOutputTo: PROCESSING_OUTPUTS.filter(t => t !== 'endpoint') },
|
|
@@ -57,6 +57,7 @@ exports.NODE_CONNECTIONS = {
|
|
|
57
57
|
emailAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: [], special: { isTerminal: true } },
|
|
58
58
|
httpAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
|
|
59
59
|
mongoAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
|
|
60
|
+
postgresAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
|
|
60
61
|
notificationAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: [], special: { isTerminal: true } },
|
|
61
62
|
sheetsAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
|
|
62
63
|
calendarAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
|
package/dist/dispatch.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* API dispatch config — service names, collection names, filter support.
|
|
3
3
|
* Only imported by the API. Broker and Dashboard don't need this.
|
|
4
|
+
*
|
|
5
|
+
* `pipelineDispatch` is required by the type system so a new node type
|
|
6
|
+
* cannot be added without picking a dispatch shape — the api derives
|
|
7
|
+
* its loop directly from this field, so forgetting it would silently
|
|
8
|
+
* orphan the node (the symptom Vector Store / AI / Markdown / Code /
|
|
9
|
+
* File Transform all hit before this refactor).
|
|
4
10
|
*/
|
|
5
11
|
import type { NodeType, NodeDispatchConfig } from './types';
|
|
6
12
|
export declare const NODE_DISPATCH: Record<NodeType, NodeDispatchConfig>;
|
package/dist/dispatch.js
CHANGED
|
@@ -2,50 +2,58 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* API dispatch config — service names, collection names, filter support.
|
|
4
4
|
* Only imported by the API. Broker and Dashboard don't need this.
|
|
5
|
+
*
|
|
6
|
+
* `pipelineDispatch` is required by the type system so a new node type
|
|
7
|
+
* cannot be added without picking a dispatch shape — the api derives
|
|
8
|
+
* its loop directly from this field, so forgetting it would silently
|
|
9
|
+
* orphan the node (the symptom Vector Store / AI / Markdown / Code /
|
|
10
|
+
* File Transform all hit before this refactor).
|
|
5
11
|
*/
|
|
6
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
13
|
exports.NODE_DISPATCH = void 0;
|
|
8
14
|
exports.getAllNodeCollections = getAllNodeCollections;
|
|
9
15
|
exports.getNodeDispatchConfig = getNodeDispatchConfig;
|
|
10
16
|
exports.NODE_DISPATCH = {
|
|
11
|
-
// ── Pipeline processing
|
|
12
|
-
filter: { service: 'filterNodesService', collection: 'filternodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: false },
|
|
13
|
-
transform: { service: 'transformNodesService', collection: 'transformnodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: false },
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
17
|
+
// ── Pipeline processing — generic dispatch off endpoint ──
|
|
18
|
+
filter: { service: 'filterNodesService', collection: 'filternodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: false, pipelineDispatch: 'generic' },
|
|
19
|
+
transform: { service: 'transformNodesService', collection: 'transformnodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: false, pipelineDispatch: 'generic' },
|
|
20
|
+
code: { service: 'codeNodesService', collection: 'codenodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'generic' },
|
|
21
|
+
ai: { service: 'aiNodesService', collection: 'ainodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'generic' },
|
|
22
|
+
markdown: { service: 'markdownNodesService', collection: 'markdownnodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'generic' },
|
|
23
|
+
fileTransform: { service: 'fileTransformNodesService', collection: 'filetransformnodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'generic' },
|
|
24
|
+
vectorStore: { service: 'vectorStoreNodesService', collection: 'vectorstorenodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'generic' },
|
|
25
|
+
// ── Pipeline processing — custom dispatch (dedicated switch case) ──
|
|
26
|
+
schemaValidator: { service: 'schemaValidatorsService', collection: 'schemavalidators', hasFilters: false, outputFields: ['outputNodes', 'invalidOutputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
27
|
+
delay: { service: 'delayNodesService', collection: 'delaynodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
28
|
+
rateLimiter: { service: 'rateLimiterNodesService', collection: 'ratelimiternodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
29
|
+
aggregator: { service: 'aggregatorNodesService', collection: 'aggregatornodes', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
30
|
+
cache: { service: 'cacheNodesService', collection: 'cachenodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
31
|
+
// ── Flow control — custom dispatch (branching / merging / loops) ──
|
|
32
|
+
split: { service: 'splitNodesService', collection: 'splitnodes', hasFilters: false, outputFields: ['outputNodes', 'remainderOutputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
33
|
+
conditional: { service: 'conditionalNodesService', collection: 'conditionalnodes', hasFilters: false, outputFields: ['outputNodes', 'elseOutputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
34
|
+
merge: { service: 'mergeNodesService', collection: 'mergenodes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
35
|
+
approval: { service: 'approvalNodesService', collection: 'approvalnodes', hasFilters: false, outputFields: ['outputNodes', 'rejectionOutputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
36
|
+
loop: { service: 'loopNodesService', collection: 'loopnodes', hasFilters: false, outputFields: ['loopOutputNodes', 'doneOutputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
37
|
+
// ── Routing — custom dispatch ──
|
|
38
|
+
router: { service: 'routersService', collection: 'routers', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'custom' },
|
|
39
|
+
// ── Action nodes — fired in onDeliveryResult, excluded from endpoint dispatch ──
|
|
40
|
+
emailAction: { service: 'emailActionsService', collection: 'emailactions', hasFilters: true, outputFields: [], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
41
|
+
httpAction: { service: 'httpActionsService', collection: 'httpactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
42
|
+
mongoAction: { service: 'mongoActionsService', collection: 'mongoactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
43
|
+
postgresAction: { service: 'postgresActionsService', collection: 'postgresactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
44
|
+
notificationAction: { service: 'notificationActionsService', collection: 'notificationactions', hasFilters: true, outputFields: [], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
45
|
+
sheetsAction: { service: 'sheetsActionsService', collection: 'sheetsactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
46
|
+
calendarAction: { service: 'calendarActionsService', collection: 'calendaractions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
47
|
+
docsAction: { service: 'docsActionsService', collection: 'docsactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
48
|
+
firecrawlAction: { service: 'firecrawlActionsService', collection: 'firecrawlactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
49
|
+
// ── Sources — start the flow themselves, not dispatched ──
|
|
50
|
+
endpoint: { service: 'endpointsService', collection: 'endpoints', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
51
|
+
scheduledWebhook: { service: 'scheduledWebhooksService', collection: 'scheduledwebhooks', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
52
|
+
chatTrigger: { service: 'chatTriggersService', collection: 'chattriggers', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
53
|
+
serviceTrigger: { service: 'serviceTriggersService', collection: 'servicetriggers', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
54
|
+
// ── Monitoring + annotation — never executed in pipeline ──
|
|
55
|
+
alert: { service: 'alertService', collection: 'alerts', hasFilters: false, outputFields: [], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
56
|
+
stickyNote: { service: 'stickyNotesService', collection: 'stickynotes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
49
57
|
};
|
|
50
58
|
/** Get all MongoDB collection names for cascade cleanup */
|
|
51
59
|
function getAllNodeCollections() {
|
package/dist/registry.js
CHANGED
|
@@ -162,6 +162,12 @@ exports.NODE_REGISTRY = {
|
|
|
162
162
|
stateKey: 'mongoActions', allStateKey: 'allMongoActions',
|
|
163
163
|
color: '#34d399', testable: false,
|
|
164
164
|
},
|
|
165
|
+
postgresAction: {
|
|
166
|
+
type: 'postgresAction', prefix: 'pg', label: 'Postgres Action',
|
|
167
|
+
group: 'Actions', detailPath: '/dashboard/postgres-actions', apiPath: '/postgres-actions',
|
|
168
|
+
stateKey: 'postgresActions', allStateKey: 'allPostgresActions',
|
|
169
|
+
color: '#336791', testable: true,
|
|
170
|
+
},
|
|
165
171
|
notificationAction: {
|
|
166
172
|
type: 'notificationAction', prefix: 'na', label: 'Notification',
|
|
167
173
|
group: 'Actions', detailPath: '/dashboard/notification-actions', apiPath: '/notification-actions',
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** All valid node type identifiers */
|
|
2
|
-
export type NodeType = 'endpoint' | 'scheduledWebhook' | 'chatTrigger' | 'serviceTrigger' | 'filter' | 'transform' | 'schemaValidator' | 'conditional' | 'delay' | 'rateLimiter' | 'aggregator' | 'cache' | 'code' | 'ai' | 'merge' | 'approval' | 'split' | 'loop' | 'markdown' | 'fileTransform' | 'router' | 'emailAction' | 'httpAction' | 'mongoAction' | 'notificationAction' | 'sheetsAction' | 'calendarAction' | 'docsAction' | 'firecrawlAction' | 'vectorStore' | 'alert' | 'stickyNote';
|
|
2
|
+
export type NodeType = 'endpoint' | 'scheduledWebhook' | 'chatTrigger' | 'serviceTrigger' | 'filter' | 'transform' | 'schemaValidator' | 'conditional' | 'delay' | 'rateLimiter' | 'aggregator' | 'cache' | 'code' | 'ai' | 'merge' | 'approval' | 'split' | 'loop' | 'markdown' | 'fileTransform' | 'router' | 'emailAction' | 'httpAction' | 'mongoAction' | 'postgresAction' | 'notificationAction' | 'sheetsAction' | 'calendarAction' | 'docsAction' | 'firecrawlAction' | 'vectorStore' | 'alert' | 'stickyNote';
|
|
3
3
|
/** Node role in the pipeline */
|
|
4
4
|
export type NodeRole = 'source' | 'processing' | 'flowControl' | 'routing' | 'action' | 'monitoring';
|
|
5
5
|
/** Handle positions on the canvas node */
|
|
@@ -72,13 +72,43 @@ export interface NodeUIConfig {
|
|
|
72
72
|
loopBackAllowed?: boolean;
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* How the event pipeline routes a payload to this node when an
|
|
77
|
+
* upstream endpoint connects to it directly. Required so adding a
|
|
78
|
+
* new node type at compile time is impossible without picking one.
|
|
79
|
+
*
|
|
80
|
+
* - 'generic': dispatchConnectedNodes loops findActiveByInputEndpoint
|
|
81
|
+
* on the service and dispatches every active match. Use for
|
|
82
|
+
* pipeline-style nodes that ingest endpoint payloads (filter,
|
|
83
|
+
* transform, ai, code, markdown, fileTransform, vectorStore).
|
|
84
|
+
*
|
|
85
|
+
* - 'custom': has a dedicated `case` in the dispatchOutputNodes
|
|
86
|
+
* switch that calls the node's specific service method. Used
|
|
87
|
+
* when the node needs scheduling, branching, gating, or queueing
|
|
88
|
+
* (delay, cache, aggregator, rateLimiter, conditional, split,
|
|
89
|
+
* loop, merge, approval, schemaValidator, router). The generic
|
|
90
|
+
* loop must NOT process these — would dispatch twice.
|
|
91
|
+
*
|
|
92
|
+
* - 'excluded': not dispatched in the endpoint flow at all. Action
|
|
93
|
+
* nodes (email/http/mongo/notification/sheets/calendar/docs/
|
|
94
|
+
* firecrawl) are fired post-delivery in onDeliveryResult with
|
|
95
|
+
* their own loops; ingress nodes (endpoint/scheduledWebhook/
|
|
96
|
+
* chatTrigger/serviceTrigger) start the flow themselves; alerts
|
|
97
|
+
* are observability-only; stickyNote is purely visual.
|
|
98
|
+
*/
|
|
99
|
+
export type PipelineDispatchKind = 'generic' | 'custom' | 'excluded';
|
|
75
100
|
/** API dispatch config — how the event pipeline processes each node */
|
|
76
101
|
export interface NodeDispatchConfig {
|
|
77
102
|
service: string;
|
|
78
103
|
collection: string;
|
|
79
104
|
hasFilters: boolean;
|
|
80
105
|
outputFields: string[];
|
|
106
|
+
/** @deprecated Use `pipelineDispatch` instead. Kept for backwards compat
|
|
107
|
+
* during the migration; will be removed once every consumer reads
|
|
108
|
+
* `pipelineDispatch`. */
|
|
81
109
|
customDispatch: boolean;
|
|
110
|
+
/** Required. See PipelineDispatchKind for the contract per value. */
|
|
111
|
+
pipelineDispatch: PipelineDispatchKind;
|
|
82
112
|
}
|
|
83
113
|
/** Standardized payload metadata — every node output MUST include _meta */
|
|
84
114
|
export interface PayloadMeta {
|
package/dist/ui.js
CHANGED
|
@@ -36,6 +36,7 @@ exports.NODE_UI = {
|
|
|
36
36
|
emailAction: { fromNodes: true, toNodes: false, inputHandles: ['left', 'top'], dotHandles: { input: ['left-in', 'top-in'] }, special: { isTerminal: true, loopBackAllowed: true, routerTargetLabel: 'email' } },
|
|
37
37
|
httpAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
|
|
38
38
|
mongoAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
|
|
39
|
+
postgresAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
|
|
39
40
|
notificationAction: { fromNodes: true, toNodes: false, inputHandles: ['left', 'top'], dotHandles: { input: ['left-in', 'top-in'] }, special: { isTerminal: true, routerTargetLabel: 'notification' } },
|
|
40
41
|
sheetsAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
|
|
41
42
|
calendarAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
|
|
@@ -57,6 +58,7 @@ exports.PREFIX_TO_TYPE = [
|
|
|
57
58
|
{ prefix: 'ea-', type: 'emailAction', canvasType: 'emailAction' },
|
|
58
59
|
{ prefix: 'ha-', type: 'httpAction', canvasType: 'httpAction' },
|
|
59
60
|
{ prefix: 'ma-', type: 'mongoAction', canvasType: 'mongoAction' },
|
|
61
|
+
{ prefix: 'pg-', type: 'postgresAction', canvasType: 'postgresAction' },
|
|
60
62
|
{ prefix: 'na-', type: 'notificationAction', canvasType: 'notificationAction' },
|
|
61
63
|
{ prefix: 'ro-', type: 'router', canvasType: 'router' },
|
|
62
64
|
{ prefix: 'fi-', type: 'filter', canvasType: 'filter' },
|
package/package.json
CHANGED