@hostwebhook/node-types 1.13.1 → 1.15.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.
@@ -22,7 +22,7 @@ const PROCESSING_OUTPUTS = [
22
22
  ];
23
23
  /** Standard processing input sources */
24
24
  const STANDARD_INPUTS = [
25
- 'endpoint', 'scheduledWebhook', 'router', 'filter', 'transform',
25
+ 'endpoint', 'scheduledWebhook', 'serviceTrigger', 'router', 'filter', 'transform',
26
26
  'cache', 'code', 'rateLimiter', 'aggregator', 'conditional', 'delay', 'schemaValidator', 'split', 'loop', 'markdown', 'fileTransform',
27
27
  ];
28
28
  /** Action nodes that can chain (non-terminal) */
@@ -34,6 +34,7 @@ exports.NODE_CONNECTIONS = {
34
34
  endpoint: { acceptsInputFrom: [], canOutputTo: PROCESSING_OUTPUTS },
35
35
  scheduledWebhook: { acceptsInputFrom: [], canOutputTo: PROCESSING_OUTPUTS },
36
36
  chatTrigger: { acceptsInputFrom: [], canOutputTo: PROCESSING_OUTPUTS },
37
+ serviceTrigger: { acceptsInputFrom: [], canOutputTo: PROCESSING_OUTPUTS },
37
38
  // ── Pipeline processing nodes ──
38
39
  filter: { acceptsInputFrom: STANDARD_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
39
40
  transform: { acceptsInputFrom: STANDARD_INPUTS, canOutputTo: PROCESSING_OUTPUTS },
package/dist/dispatch.js CHANGED
@@ -42,6 +42,7 @@ exports.NODE_DISPATCH = {
42
42
  endpoint: { service: 'endpointsService', collection: 'endpoints', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true },
43
43
  scheduledWebhook: { service: 'scheduledWebhooksService', collection: 'scheduledwebhooks', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true },
44
44
  chatTrigger: { service: 'chatTriggersService', collection: 'chattriggers', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true },
45
+ serviceTrigger: { service: 'serviceTriggersService', collection: 'servicetriggers', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true },
45
46
  // ── Annotations ──
46
47
  stickyNote: { service: 'stickyNotesService', collection: 'stickynotes', hasFilters: false, outputFields: ['outputNodes'], customDispatch: true },
47
48
  };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Gmail operation enum — single source of truth across the API, Dashboard,
3
+ * and Message Broker. Used by:
4
+ * - emailAction entity / DTO (api): operation field + validation
5
+ * - dashboard EmailActionGmailOperation type
6
+ * - broker hostwebhook types + tool schemas
7
+ * - serviceTrigger / future Gmail-related nodes
8
+ *
9
+ * Adding a new Gmail operation = add it here, bump this package's
10
+ * version, publish to npm, and re-install in the consuming repos.
11
+ * Each consumer still owns its operation-specific config schema (the
12
+ * dashboard owns the UI form schema, the api owns the dispatch logic),
13
+ * but the canonical list of valid operation strings lives here.
14
+ */
15
+ export declare const GMAIL_OPERATIONS: readonly ["send", "createDraft", "replyToThread", "getMessage", "listMessages", "deleteMessage", "markRead", "markUnread", "addLabel", "removeLabel", "listLabels", "createLabel", "getThread", "trashThread", "untrashThread"];
16
+ export type GmailOperation = (typeof GMAIL_OPERATIONS)[number];
17
+ /** Type guard — useful when validating untrusted input (DTOs, tool calls). */
18
+ export declare function isGmailOperation(value: unknown): value is GmailOperation;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GMAIL_OPERATIONS = void 0;
4
+ exports.isGmailOperation = isGmailOperation;
5
+ /**
6
+ * Gmail operation enum — single source of truth across the API, Dashboard,
7
+ * and Message Broker. Used by:
8
+ * - emailAction entity / DTO (api): operation field + validation
9
+ * - dashboard EmailActionGmailOperation type
10
+ * - broker hostwebhook types + tool schemas
11
+ * - serviceTrigger / future Gmail-related nodes
12
+ *
13
+ * Adding a new Gmail operation = add it here, bump this package's
14
+ * version, publish to npm, and re-install in the consuming repos.
15
+ * Each consumer still owns its operation-specific config schema (the
16
+ * dashboard owns the UI form schema, the api owns the dispatch logic),
17
+ * but the canonical list of valid operation strings lives here.
18
+ */
19
+ exports.GMAIL_OPERATIONS = [
20
+ 'send',
21
+ 'createDraft',
22
+ 'replyToThread',
23
+ 'getMessage',
24
+ 'listMessages',
25
+ 'deleteMessage',
26
+ 'markRead',
27
+ 'markUnread',
28
+ 'addLabel',
29
+ 'removeLabel',
30
+ 'listLabels',
31
+ 'createLabel',
32
+ 'getThread',
33
+ 'trashThread',
34
+ 'untrashThread',
35
+ ];
36
+ /** Type guard — useful when validating untrusted input (DTOs, tool calls). */
37
+ function isGmailOperation(value) {
38
+ return typeof value === 'string' && exports.GMAIL_OPERATIONS.includes(value);
39
+ }
package/dist/index.d.ts CHANGED
@@ -5,3 +5,5 @@ export { NODE_UI, PREFIX_TO_TYPE, resolveNodeId, } from './ui';
5
5
  export { NODE_DISPATCH, getAllNodeCollections, getNodeDispatchConfig, } from './dispatch';
6
6
  export type { NodeRegistryEntry, NodeGroup } from './registry';
7
7
  export { NODE_REGISTRY, getNodeRegistryEntry, NODE_DETAIL_PATHS, NODE_COLORS, NODE_STATE_KEYS, PREFIX_TO_NODE_TYPE, NODE_TYPE_TO_PREFIX, } from './registry';
8
+ export { GMAIL_OPERATIONS, isGmailOperation, } from './gmail-operations';
9
+ export type { GmailOperation } from './gmail-operations';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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; } });
@@ -31,3 +31,7 @@ Object.defineProperty(exports, "NODE_COLORS", { enumerable: true, get: function
31
31
  Object.defineProperty(exports, "NODE_STATE_KEYS", { enumerable: true, get: function () { return registry_1.NODE_STATE_KEYS; } });
32
32
  Object.defineProperty(exports, "PREFIX_TO_NODE_TYPE", { enumerable: true, get: function () { return registry_1.PREFIX_TO_NODE_TYPE; } });
33
33
  Object.defineProperty(exports, "NODE_TYPE_TO_PREFIX", { enumerable: true, get: function () { return registry_1.NODE_TYPE_TO_PREFIX; } });
34
+ // ── Per-service operation enums (ALL repos) ──
35
+ var gmail_operations_1 = require("./gmail-operations");
36
+ Object.defineProperty(exports, "GMAIL_OPERATIONS", { enumerable: true, get: function () { return gmail_operations_1.GMAIL_OPERATIONS; } });
37
+ Object.defineProperty(exports, "isGmailOperation", { enumerable: true, get: function () { return gmail_operations_1.isGmailOperation; } });
package/dist/registry.js CHANGED
@@ -29,6 +29,12 @@ exports.NODE_REGISTRY = {
29
29
  stateKey: 'chatTriggers', allStateKey: 'allChatTriggers',
30
30
  color: '#06b6d4', testable: false,
31
31
  },
32
+ serviceTrigger: {
33
+ type: 'serviceTrigger', prefix: 'svc', label: 'Service Trigger',
34
+ group: 'Sources', detailPath: '/dashboard/service-triggers', apiPath: '/service-triggers',
35
+ stateKey: 'serviceTriggers', allStateKey: 'allServiceTriggers',
36
+ color: '#ef4444', testable: false,
37
+ },
32
38
  // ── Flow Control ──
33
39
  filter: {
34
40
  type: 'filter', prefix: 'fi', label: 'Filter',
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** All valid node type identifiers */
2
- export type NodeType = 'endpoint' | 'scheduledWebhook' | 'chatTrigger' | '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' | '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' | 'notificationAction' | 'sheetsAction' | 'calendarAction' | 'docsAction' | 'firecrawlAction' | '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
@@ -11,6 +11,7 @@ exports.NODE_UI = {
11
11
  endpoint: { fromNodes: true, toNodes: true, isSource: true },
12
12
  scheduledWebhook: { fromNodes: false, toNodes: true, isSource: true, outputHandles: ['right', 'bottom'], dotHandles: { output: ['right-out', 'bottom-out'] } },
13
13
  chatTrigger: { fromNodes: false, toNodes: true, isSource: true, outputHandles: ['right'], dotHandles: { output: ['right-out'] } },
14
+ serviceTrigger: { fromNodes: false, toNodes: true, isSource: true, outputHandles: ['right', 'bottom'], dotHandles: { output: ['right-out', 'bottom-out'] } },
14
15
  // ── Pipeline processing nodes ──
15
16
  filter: { fromNodes: true, toNodes: true, special: { loopBackAllowed: true } },
16
17
  transform: { fromNodes: true, toNodes: true, special: { loopBackAllowed: true } },
@@ -50,6 +51,7 @@ exports.PREFIX_TO_TYPE = [
50
51
  { prefix: 'ep-', type: 'endpoint', canvasType: 'endpoint' },
51
52
  { prefix: 'sw-', type: 'scheduledWebhook', canvasType: 'scheduledWebhook' },
52
53
  { prefix: 'chat-', type: 'chatTrigger', canvasType: 'chatTrigger' },
54
+ { prefix: 'svc-', type: 'serviceTrigger', canvasType: 'serviceTrigger' },
53
55
  { prefix: 'al-', type: 'alert', canvasType: 'alert' },
54
56
  { prefix: 'ea-', type: 'emailAction', canvasType: 'emailAction' },
55
57
  { prefix: 'ha-', type: 'httpAction', canvasType: 'httpAction' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostwebhook/node-types",
3
- "version": "1.13.1",
3
+ "version": "1.15.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",