@hostwebhook/node-types 1.21.0 → 1.23.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/credentials.d.ts +57 -0
- package/dist/credentials.js +45 -0
- package/dist/dispatch.js +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/registry.js +6 -0
- package/dist/types.d.ts +1 -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 },
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical credential-type registry. Single source of truth for the
|
|
3
|
+
* list of credential types HostWebhook supports — used by:
|
|
4
|
+
*
|
|
5
|
+
* - api Mongoose schema enum (`credential.entity.ts`)
|
|
6
|
+
* - api class-validator DTO (`create-credential.dto.ts`)
|
|
7
|
+
* - dashboard display + form metadata (`lib/credentials/display.ts`)
|
|
8
|
+
* - any future consumer that needs to enumerate types
|
|
9
|
+
*
|
|
10
|
+
* Adding a new credential type happens HERE first; both repos pick it
|
|
11
|
+
* up on the next `@hostwebhook/node-types` bump. The bug we kept
|
|
12
|
+
* hitting (entity accepting "postgres" but the DTO rejecting it)
|
|
13
|
+
* stops being possible — both sides import from this list.
|
|
14
|
+
*
|
|
15
|
+
* Each entry is **deliberately minimal**: just the `type` string +
|
|
16
|
+
* a couple of cross-repo flags that affect runtime behavior.
|
|
17
|
+
* UI-specific metadata (icons, labels, replace-form copy) lives in
|
|
18
|
+
* the dashboard's `display.ts`, where it can evolve without
|
|
19
|
+
* forcing an api-side npm bump.
|
|
20
|
+
*/
|
|
21
|
+
export interface CredentialTypeRegistration {
|
|
22
|
+
/** Stable id stored in `credentials.type`. Never rename — it's the
|
|
23
|
+
* primary key for joins from nodes that reference credentials. */
|
|
24
|
+
type: string;
|
|
25
|
+
/** When true, the URI inside `data` is validated against the SSRF
|
|
26
|
+
* guard before storage. Tunneled credentials skip the guard since
|
|
27
|
+
* the agent reaches the customer's own private network on their
|
|
28
|
+
* behalf. Currently honored by `mongodb` and `postgres`. */
|
|
29
|
+
ssrfValidated?: boolean;
|
|
30
|
+
/** When true, the underlying connection can be routed via a reverse
|
|
31
|
+
* TCP tunnel. The credential carries `metadata.tunnelId` and the
|
|
32
|
+
* runtime/test paths register a forwarder via `TcpTunnelPool`. */
|
|
33
|
+
tunnelable?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Registry — order matters for fallthrough behavior in pickers (most
|
|
37
|
+
* common types first), but not for correctness.
|
|
38
|
+
*/
|
|
39
|
+
export declare const CREDENTIAL_TYPES: readonly CredentialTypeRegistration[];
|
|
40
|
+
/**
|
|
41
|
+
* Plain string array — what the Mongoose `enum` field and the
|
|
42
|
+
* class-validator `@IsIn(...)` decorator both consume. Keep it as a
|
|
43
|
+
* readonly array so misuse (push/pop) breaks at compile time.
|
|
44
|
+
*/
|
|
45
|
+
export declare const CREDENTIAL_TYPE_VALUES: readonly string[];
|
|
46
|
+
/** Mutable copy for APIs that take `string[]` (Mongoose `enum`,
|
|
47
|
+
* class-validator). The array itself is freshly built each access
|
|
48
|
+
* so callers can't mutate the canonical list. */
|
|
49
|
+
export declare const credentialTypeValues: () => string[];
|
|
50
|
+
/**
|
|
51
|
+
* Discriminated union of every supported type. Use as the field type
|
|
52
|
+
* on entities + DTOs so a typo at the call site fails at compile
|
|
53
|
+
* time, not at runtime via a Mongoose validation error.
|
|
54
|
+
*/
|
|
55
|
+
export type CredentialType = typeof CREDENTIAL_TYPES[number]['type'];
|
|
56
|
+
export declare function getCredentialType(type: string): CredentialTypeRegistration | undefined;
|
|
57
|
+
export declare function isCredentialType(type: string): type is CredentialType;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = void 0;
|
|
4
|
+
exports.getCredentialType = getCredentialType;
|
|
5
|
+
exports.isCredentialType = isCredentialType;
|
|
6
|
+
/**
|
|
7
|
+
* Registry — order matters for fallthrough behavior in pickers (most
|
|
8
|
+
* common types first), but not for correctness.
|
|
9
|
+
*/
|
|
10
|
+
exports.CREDENTIAL_TYPES = [
|
|
11
|
+
{ type: 'google_service_account' },
|
|
12
|
+
{ type: 'oauth2_google' },
|
|
13
|
+
{ type: 'oauth2_atlassian' },
|
|
14
|
+
{ type: 'mongodb', ssrfValidated: true, tunnelable: true },
|
|
15
|
+
{ type: 'postgres', ssrfValidated: true, tunnelable: true },
|
|
16
|
+
{ type: 'slack_webhook' },
|
|
17
|
+
{ type: 'discord_webhook' },
|
|
18
|
+
{ type: 'llm_anthropic' },
|
|
19
|
+
{ type: 'llm_openai' },
|
|
20
|
+
{ type: 'llm_google' },
|
|
21
|
+
{ type: 'llm_ollama' },
|
|
22
|
+
{ type: 'firecrawl' },
|
|
23
|
+
{ type: 'http_auth' },
|
|
24
|
+
{ type: 'aws_s3' },
|
|
25
|
+
{ type: 'memory_contextwindow' },
|
|
26
|
+
{ type: 'memory_mongodb', ssrfValidated: true, tunnelable: true },
|
|
27
|
+
{ type: 'mcp_server' },
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* Plain string array — what the Mongoose `enum` field and the
|
|
31
|
+
* class-validator `@IsIn(...)` decorator both consume. Keep it as a
|
|
32
|
+
* readonly array so misuse (push/pop) breaks at compile time.
|
|
33
|
+
*/
|
|
34
|
+
exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES.map((c) => c.type);
|
|
35
|
+
/** Mutable copy for APIs that take `string[]` (Mongoose `enum`,
|
|
36
|
+
* class-validator). The array itself is freshly built each access
|
|
37
|
+
* so callers can't mutate the canonical list. */
|
|
38
|
+
const credentialTypeValues = () => [...exports.CREDENTIAL_TYPE_VALUES];
|
|
39
|
+
exports.credentialTypeValues = credentialTypeValues;
|
|
40
|
+
function getCredentialType(type) {
|
|
41
|
+
return exports.CREDENTIAL_TYPES.find((c) => c.type === type);
|
|
42
|
+
}
|
|
43
|
+
function isCredentialType(type) {
|
|
44
|
+
return exports.CREDENTIAL_TYPE_VALUES.includes(type);
|
|
45
|
+
}
|
package/dist/dispatch.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.NODE_DISPATCH = {
|
|
|
40
40
|
emailAction: { service: 'emailActionsService', collection: 'emailactions', hasFilters: true, outputFields: [], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
41
41
|
httpAction: { service: 'httpActionsService', collection: 'httpactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
42
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' },
|
|
43
44
|
notificationAction: { service: 'notificationActionsService', collection: 'notificationactions', hasFilters: true, outputFields: [], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
44
45
|
sheetsAction: { service: 'sheetsActionsService', collection: 'sheetsactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
|
45
46
|
calendarAction: { service: 'calendarActionsService', collection: 'calendaractions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
|
package/dist/index.d.ts
CHANGED
|
@@ -9,3 +9,5 @@ export { GMAIL_OPERATIONS, isGmailOperation, } from './gmail-operations';
|
|
|
9
9
|
export type { GmailOperation } from './gmail-operations';
|
|
10
10
|
export { GOOGLE_CALENDAR_OPERATIONS, isGoogleCalendarOperation, } from './calendar-operations';
|
|
11
11
|
export type { GoogleCalendarOperation } from './calendar-operations';
|
|
12
|
+
export type { CredentialTypeRegistration, CredentialType } from './credentials';
|
|
13
|
+
export { CREDENTIAL_TYPES, CREDENTIAL_TYPE_VALUES, credentialTypeValues, getCredentialType, isCredentialType, } from './credentials';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.GMAIL_OPERATIONS = exports.NODE_TYPE_TO_PREFIX = exports.PREFIX_TO_NODE_TYPE = exports.NODE_STATE_KEYS = exports.NODE_COLORS = exports.NODE_DETAIL_PATHS = exports.getNodeRegistryEntry = exports.NODE_REGISTRY = exports.getNodeDispatchConfig = exports.getAllNodeCollections = exports.NODE_DISPATCH = exports.resolveNodeId = exports.PREFIX_TO_TYPE = exports.NODE_UI = exports.ALL_NODE_TYPES = exports.isNodeType = exports.isTerminal = exports.canSendToNodes = exports.canReceiveFromNodes = exports.canReceiveFrom = exports.NODE_CONNECTIONS = exports.iterableMeta = exports.singleMeta = void 0;
|
|
3
|
+
exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.GMAIL_OPERATIONS = exports.NODE_TYPE_TO_PREFIX = exports.PREFIX_TO_NODE_TYPE = exports.NODE_STATE_KEYS = exports.NODE_COLORS = exports.NODE_DETAIL_PATHS = exports.getNodeRegistryEntry = exports.NODE_REGISTRY = exports.getNodeDispatchConfig = exports.getAllNodeCollections = exports.NODE_DISPATCH = exports.resolveNodeId = exports.PREFIX_TO_TYPE = exports.NODE_UI = exports.ALL_NODE_TYPES = exports.isNodeType = exports.isTerminal = exports.canSendToNodes = exports.canReceiveFromNodes = exports.canReceiveFrom = exports.NODE_CONNECTIONS = exports.iterableMeta = exports.singleMeta = void 0;
|
|
4
4
|
var types_1 = require("./types");
|
|
5
5
|
Object.defineProperty(exports, "singleMeta", { enumerable: true, get: function () { return types_1.singleMeta; } });
|
|
6
6
|
Object.defineProperty(exports, "iterableMeta", { enumerable: true, get: function () { return types_1.iterableMeta; } });
|
|
@@ -38,3 +38,9 @@ Object.defineProperty(exports, "isGmailOperation", { enumerable: true, get: func
|
|
|
38
38
|
var calendar_operations_1 = require("./calendar-operations");
|
|
39
39
|
Object.defineProperty(exports, "GOOGLE_CALENDAR_OPERATIONS", { enumerable: true, get: function () { return calendar_operations_1.GOOGLE_CALENDAR_OPERATIONS; } });
|
|
40
40
|
Object.defineProperty(exports, "isGoogleCalendarOperation", { enumerable: true, get: function () { return calendar_operations_1.isGoogleCalendarOperation; } });
|
|
41
|
+
var credentials_1 = require("./credentials");
|
|
42
|
+
Object.defineProperty(exports, "CREDENTIAL_TYPES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPES; } });
|
|
43
|
+
Object.defineProperty(exports, "CREDENTIAL_TYPE_VALUES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPE_VALUES; } });
|
|
44
|
+
Object.defineProperty(exports, "credentialTypeValues", { enumerable: true, get: function () { return credentials_1.credentialTypeValues; } });
|
|
45
|
+
Object.defineProperty(exports, "getCredentialType", { enumerable: true, get: function () { return credentials_1.getCredentialType; } });
|
|
46
|
+
Object.defineProperty(exports, "isCredentialType", { enumerable: true, get: function () { return credentials_1.isCredentialType; } });
|
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 */
|
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