@hostwebhook/node-types 1.32.0 → 1.33.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.
@@ -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', 'postgresAction', 'notificationAction', 'sheetsAction', 'calendarAction', 'docsAction', 'driveAction', 'firecrawlAction', 'telegramAction', 'vectorStore', 'loop',
21
+ 'emailAction', 'httpAction', 'mongoAction', 'postgresAction', 'notificationAction', 'sheetsAction', 'calendarAction', 'docsAction', 'driveAction', 'firecrawlAction', 'telegramAction', 'whatsappAction', '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', 'postgresAction', 'sheetsAction', 'calendarAction', 'docsAction', 'driveAction', 'firecrawlAction', 'telegramAction', 'vectorStore'];
29
+ const CHAINABLE_ACTIONS = ['httpAction', 'mongoAction', 'postgresAction', 'sheetsAction', 'calendarAction', 'docsAction', 'driveAction', 'firecrawlAction', 'telegramAction', 'whatsappAction', '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 = {
@@ -57,7 +57,7 @@ exports.NODE_CONNECTIONS = {
57
57
  // approval is the generic "human-in-the-loop gate" — it should be
58
58
  // able to gate ANY action, not the hand-picked subset that existed
59
59
  // when this entry was last touched. Same staleness pattern as merge.
60
- approval: { acceptsInputFrom: ['endpoint', 'filter', 'transform'], canOutputTo: ['endpoint', 'filter', 'transform', 'emailAction', 'httpAction', 'mongoAction', 'postgresAction', 'notificationAction', 'sheetsAction', 'calendarAction', 'docsAction', 'driveAction', 'firecrawlAction', 'telegramAction', 'vectorStore'], special: { hasRejectionOutputNodes: true } },
60
+ approval: { acceptsInputFrom: ['endpoint', 'filter', 'transform'], canOutputTo: ['endpoint', 'filter', 'transform', 'emailAction', 'httpAction', 'mongoAction', 'postgresAction', 'notificationAction', 'sheetsAction', 'calendarAction', 'docsAction', 'driveAction', 'firecrawlAction', 'telegramAction', 'whatsappAction', 'vectorStore'], special: { hasRejectionOutputNodes: true } },
61
61
  loop: { acceptsInputFrom: STANDARD_INPUTS, canOutputTo: PROCESSING_OUTPUTS, special: { hasLoopBack: true } },
62
62
  // ── Routing nodes ──
63
63
  router: { acceptsInputFrom: ['endpoint', 'scheduledWebhook', 'filter', 'transform'], canOutputTo: PROCESSING_OUTPUTS.filter(t => t !== 'endpoint') },
@@ -73,6 +73,7 @@ exports.NODE_CONNECTIONS = {
73
73
  driveAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
74
74
  firecrawlAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
75
75
  telegramAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
76
+ whatsappAction: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
76
77
  vectorStore: { acceptsInputFrom: ACTION_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
77
78
  // ── Processing (transform-like) ──
78
79
  markdown: { acceptsInputFrom: STANDARD_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
@@ -27,6 +27,7 @@ exports.CREDENTIAL_TYPES = [
27
27
  { type: 'mcp_server' },
28
28
  { type: 'voice_agent' },
29
29
  { type: 'telegram_bot' },
30
+ { type: 'whatsapp_business' },
30
31
  ];
31
32
  /**
32
33
  * Plain string array — what the Mongoose `enum` field and the
package/dist/dispatch.js CHANGED
@@ -48,6 +48,7 @@ exports.NODE_DISPATCH = {
48
48
  driveAction: { service: 'driveActionsService', collection: 'driveactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
49
49
  firecrawlAction: { service: 'firecrawlActionsService', collection: 'firecrawlactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
50
50
  telegramAction: { service: 'telegramActionsService', collection: 'telegramactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
51
+ whatsappAction: { service: 'whatsappActionsService', collection: 'whatsappactions', hasFilters: true, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
51
52
  // ── Sources — start the flow themselves, not dispatched ──
52
53
  endpoint: { service: 'endpointsService', collection: 'endpoints', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
53
54
  scheduledWebhook: { service: 'scheduledWebhooksService', collection: 'scheduledwebhooks', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true, pipelineDispatch: 'excluded' },
package/dist/index.d.ts CHANGED
@@ -13,5 +13,7 @@ export { DRIVE_OPERATIONS, isDriveOperation, } from './drive-operations';
13
13
  export type { DriveOperation } from './drive-operations';
14
14
  export { TELEGRAM_OPERATIONS, isTelegramOperation, } from './telegram-operations';
15
15
  export type { TelegramOperation } from './telegram-operations';
16
+ export { WHATSAPP_OPERATIONS, isWhatsAppOperation, } from './whatsapp-operations';
17
+ export type { WhatsAppOperation } from './whatsapp-operations';
16
18
  export type { CredentialTypeRegistration, CredentialType } from './credentials';
17
19
  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.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isTelegramOperation = exports.TELEGRAM_OPERATIONS = exports.isDriveOperation = exports.DRIVE_OPERATIONS = 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.isWhatsAppOperation = exports.WHATSAPP_OPERATIONS = exports.isTelegramOperation = exports.TELEGRAM_OPERATIONS = exports.isDriveOperation = exports.DRIVE_OPERATIONS = 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; } });
@@ -44,6 +44,9 @@ Object.defineProperty(exports, "isDriveOperation", { enumerable: true, get: func
44
44
  var telegram_operations_1 = require("./telegram-operations");
45
45
  Object.defineProperty(exports, "TELEGRAM_OPERATIONS", { enumerable: true, get: function () { return telegram_operations_1.TELEGRAM_OPERATIONS; } });
46
46
  Object.defineProperty(exports, "isTelegramOperation", { enumerable: true, get: function () { return telegram_operations_1.isTelegramOperation; } });
47
+ var whatsapp_operations_1 = require("./whatsapp-operations");
48
+ Object.defineProperty(exports, "WHATSAPP_OPERATIONS", { enumerable: true, get: function () { return whatsapp_operations_1.WHATSAPP_OPERATIONS; } });
49
+ Object.defineProperty(exports, "isWhatsAppOperation", { enumerable: true, get: function () { return whatsapp_operations_1.isWhatsAppOperation; } });
47
50
  var credentials_1 = require("./credentials");
48
51
  Object.defineProperty(exports, "CREDENTIAL_TYPES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPES; } });
49
52
  Object.defineProperty(exports, "CREDENTIAL_TYPE_VALUES", { enumerable: true, get: function () { return credentials_1.CREDENTIAL_TYPE_VALUES; } });
package/dist/registry.js CHANGED
@@ -228,6 +228,19 @@ exports.NODE_REGISTRY = {
228
228
  // empty fields.
229
229
  isToolOnly: (e) => e.aiEnabled === true,
230
230
  },
231
+ whatsappAction: {
232
+ type: 'whatsappAction', prefix: 'wa', label: 'WhatsApp Action',
233
+ group: 'Actions', detailPath: '/dashboard/whatsapp-actions', apiPath: '/whatsapp-actions',
234
+ stateKey: 'whatsappActions', allStateKey: 'allWhatsappActions',
235
+ // WhatsApp brand green (#25d366) — instantly recognisable on the canvas.
236
+ color: '#25d366', testable: true,
237
+ // Same toolkit pattern as telegramAction — when aiEnabled the
238
+ // entity stops being a manually-wired single-op action and becomes
239
+ // a multi-op tool surface for an upstream AI Node. Hide canvas
240
+ // handles to prevent accidental wiring that would fire with empty
241
+ // fields the LLM is supposed to populate.
242
+ isToolOnly: (e) => e.aiEnabled === true,
243
+ },
231
244
  vectorStore: {
232
245
  type: 'vectorStore', prefix: 'vs', label: 'Vector Store',
233
246
  group: 'Actions', detailPath: '/dashboard/vector-store-nodes', apiPath: '/vector-store-nodes',
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' | 'voiceAgent' | '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' | 'driveAction' | 'firecrawlAction' | 'telegramAction' | 'vectorStore' | 'stickyNote';
2
+ export type NodeType = 'endpoint' | 'scheduledWebhook' | 'chatTrigger' | 'serviceTrigger' | 'voiceAgent' | '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' | 'driveAction' | 'firecrawlAction' | 'telegramAction' | 'whatsappAction' | 'vectorStore' | '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
@@ -50,6 +50,7 @@ exports.NODE_UI = {
50
50
  driveAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
51
51
  firecrawlAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
52
52
  telegramAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true, routerTargetLabel: 'telegram' } },
53
+ whatsappAction: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true, routerTargetLabel: 'whatsapp' } },
53
54
  vectorStore: { fromNodes: true, toNodes: true, inputHandles: ['left'], dotHandles: { input: ['left-in'], output: ['right-out'] }, special: { loopBackAllowed: true } },
54
55
  // ── Annotations ──
55
56
  stickyNote: { fromNodes: false, toNodes: false },
@@ -63,6 +64,7 @@ exports.PREFIX_TO_TYPE = [
63
64
  { prefix: 'va-', type: 'voiceAgent', canvasType: 'voiceAgent' },
64
65
  { prefix: 'ea-', type: 'emailAction', canvasType: 'emailAction' },
65
66
  { prefix: 'tg-', type: 'telegramAction', canvasType: 'telegramAction' },
67
+ { prefix: 'wa-', type: 'whatsappAction', canvasType: 'whatsappAction' },
66
68
  { prefix: 'ha-', type: 'httpAction', canvasType: 'httpAction' },
67
69
  { prefix: 'ma-', type: 'mongoAction', canvasType: 'mongoAction' },
68
70
  { prefix: 'pg-', type: 'postgresAction', canvasType: 'postgresAction' },
@@ -0,0 +1,23 @@
1
+ /**
2
+ * WhatsApp Business Cloud API operation enum — single source of truth
3
+ * across the API, Dashboard, and any future consumers (Message Broker,
4
+ * MCP server). Used by:
5
+ * - whatsappAction entity / DTO (api): operation field + validation
6
+ * - dashboard WhatsAppAction operation picker
7
+ * - MCP toolkit-specs expansion (one aiEnabled whatsappAction → N tools)
8
+ *
9
+ * Targets Meta Cloud API v21+ (the only supported variant after the
10
+ * On-Premises sunset on 2025-10-23). Each op maps to a single POST to
11
+ * `https://graph.facebook.com/v21.0/<phone_number_id>/messages` with
12
+ * a different `type` discriminator in the body.
13
+ *
14
+ * Phase 1 covers the ten ops that handle ~95% of business messaging.
15
+ * Phase 2 candidates (sendInteractiveButtons, sendInteractiveList,
16
+ * sendSticker, sendContacts) extend this list — bump the package and
17
+ * re-install in consumers, same pattern as Gmail / Calendar / Drive
18
+ * / Telegram.
19
+ */
20
+ export declare const WHATSAPP_OPERATIONS: readonly ["sendText", "sendImage", "sendAudio", "sendVideo", "sendDocument", "sendLocation", "sendTemplate", "replyToMessage", "markAsRead", "sendReaction"];
21
+ export type WhatsAppOperation = (typeof WHATSAPP_OPERATIONS)[number];
22
+ /** Type guard — useful when validating untrusted input (DTOs, tool calls). */
23
+ export declare function isWhatsAppOperation(value: unknown): value is WhatsAppOperation;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WHATSAPP_OPERATIONS = void 0;
4
+ exports.isWhatsAppOperation = isWhatsAppOperation;
5
+ /**
6
+ * WhatsApp Business Cloud API operation enum — single source of truth
7
+ * across the API, Dashboard, and any future consumers (Message Broker,
8
+ * MCP server). Used by:
9
+ * - whatsappAction entity / DTO (api): operation field + validation
10
+ * - dashboard WhatsAppAction operation picker
11
+ * - MCP toolkit-specs expansion (one aiEnabled whatsappAction → N tools)
12
+ *
13
+ * Targets Meta Cloud API v21+ (the only supported variant after the
14
+ * On-Premises sunset on 2025-10-23). Each op maps to a single POST to
15
+ * `https://graph.facebook.com/v21.0/<phone_number_id>/messages` with
16
+ * a different `type` discriminator in the body.
17
+ *
18
+ * Phase 1 covers the ten ops that handle ~95% of business messaging.
19
+ * Phase 2 candidates (sendInteractiveButtons, sendInteractiveList,
20
+ * sendSticker, sendContacts) extend this list — bump the package and
21
+ * re-install in consumers, same pattern as Gmail / Calendar / Drive
22
+ * / Telegram.
23
+ */
24
+ exports.WHATSAPP_OPERATIONS = [
25
+ 'sendText',
26
+ 'sendImage',
27
+ 'sendAudio',
28
+ 'sendVideo',
29
+ 'sendDocument',
30
+ 'sendLocation',
31
+ 'sendTemplate',
32
+ 'replyToMessage',
33
+ 'markAsRead',
34
+ 'sendReaction',
35
+ ];
36
+ /** Type guard — useful when validating untrusted input (DTOs, tool calls). */
37
+ function isWhatsAppOperation(value) {
38
+ return (typeof value === 'string' &&
39
+ exports.WHATSAPP_OPERATIONS.includes(value));
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostwebhook/node-types",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "Shared node type definitions, connection rules, and dispatch config for HostWebhook",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",