@hostwebhook/node-types 1.16.0 → 1.18.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/calendar-operations.d.ts +18 -0
- package/dist/calendar-operations.js +30 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -1
- package/dist/registry.d.ts +13 -0
- package/dist/registry.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Calendar operation enum — single source of truth across the API,
|
|
3
|
+
* Dashboard, and Message Broker. Used by:
|
|
4
|
+
* - calendarAction entity / DTO (api): operation field + validation
|
|
5
|
+
* - dashboard CalendarActionGoogleOperation type
|
|
6
|
+
* - broker hostwebhook types + tool schemas
|
|
7
|
+
* - any future calendar-related node
|
|
8
|
+
*
|
|
9
|
+
* Adding a new Calendar 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 GOOGLE_CALENDAR_OPERATIONS: readonly ["createEvent", "updateEvent", "deleteEvent", "listEvents", "getEvent"];
|
|
16
|
+
export type GoogleCalendarOperation = (typeof GOOGLE_CALENDAR_OPERATIONS)[number];
|
|
17
|
+
/** Type guard — useful when validating untrusted input (DTOs, tool calls). */
|
|
18
|
+
export declare function isGoogleCalendarOperation(value: unknown): value is GoogleCalendarOperation;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GOOGLE_CALENDAR_OPERATIONS = void 0;
|
|
4
|
+
exports.isGoogleCalendarOperation = isGoogleCalendarOperation;
|
|
5
|
+
/**
|
|
6
|
+
* Google Calendar operation enum — single source of truth across the API,
|
|
7
|
+
* Dashboard, and Message Broker. Used by:
|
|
8
|
+
* - calendarAction entity / DTO (api): operation field + validation
|
|
9
|
+
* - dashboard CalendarActionGoogleOperation type
|
|
10
|
+
* - broker hostwebhook types + tool schemas
|
|
11
|
+
* - any future calendar-related node
|
|
12
|
+
*
|
|
13
|
+
* Adding a new Calendar 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.GOOGLE_CALENDAR_OPERATIONS = [
|
|
20
|
+
'createEvent',
|
|
21
|
+
'updateEvent',
|
|
22
|
+
'deleteEvent',
|
|
23
|
+
'listEvents',
|
|
24
|
+
'getEvent',
|
|
25
|
+
];
|
|
26
|
+
/** Type guard — useful when validating untrusted input (DTOs, tool calls). */
|
|
27
|
+
function isGoogleCalendarOperation(value) {
|
|
28
|
+
return (typeof value === 'string' &&
|
|
29
|
+
exports.GOOGLE_CALENDAR_OPERATIONS.includes(value));
|
|
30
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -7,3 +7,5 @@ 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
8
|
export { GMAIL_OPERATIONS, isGmailOperation, } from './gmail-operations';
|
|
9
9
|
export type { GmailOperation } from './gmail-operations';
|
|
10
|
+
export { GOOGLE_CALENDAR_OPERATIONS, isGoogleCalendarOperation, } from './calendar-operations';
|
|
11
|
+
export type { GoogleCalendarOperation } from './calendar-operations';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
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;
|
|
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; } });
|
|
@@ -35,3 +35,6 @@ Object.defineProperty(exports, "NODE_TYPE_TO_PREFIX", { enumerable: true, get: f
|
|
|
35
35
|
var gmail_operations_1 = require("./gmail-operations");
|
|
36
36
|
Object.defineProperty(exports, "GMAIL_OPERATIONS", { enumerable: true, get: function () { return gmail_operations_1.GMAIL_OPERATIONS; } });
|
|
37
37
|
Object.defineProperty(exports, "isGmailOperation", { enumerable: true, get: function () { return gmail_operations_1.isGmailOperation; } });
|
|
38
|
+
var calendar_operations_1 = require("./calendar-operations");
|
|
39
|
+
Object.defineProperty(exports, "GOOGLE_CALENDAR_OPERATIONS", { enumerable: true, get: function () { return calendar_operations_1.GOOGLE_CALENDAR_OPERATIONS; } });
|
|
40
|
+
Object.defineProperty(exports, "isGoogleCalendarOperation", { enumerable: true, get: function () { return calendar_operations_1.isGoogleCalendarOperation; } });
|
package/dist/registry.d.ts
CHANGED
|
@@ -28,6 +28,19 @@ export interface NodeRegistryEntry {
|
|
|
28
28
|
color: string;
|
|
29
29
|
/** Whether this node supports test execution */
|
|
30
30
|
testable: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Optional per-instance predicate marking a node as "tool-only".
|
|
33
|
+
* When this returns true, the canvas should hide every connectable
|
|
34
|
+
* handle so the user cannot draw pipeline edges to/from this node —
|
|
35
|
+
* it lives instead inside an upstream AI Node's tools[] list.
|
|
36
|
+
*
|
|
37
|
+
* Lets new toolkit-style nodes opt-in without per-component hardcoding
|
|
38
|
+
* in the dashboard. Currently only emailAction(aiEnabled=true) uses
|
|
39
|
+
* this; serviceTrigger or future Slack/Discord toolkits could too.
|
|
40
|
+
*
|
|
41
|
+
* Predicate must be pure (no side effects) — called on every render.
|
|
42
|
+
*/
|
|
43
|
+
isToolOnly?: (entity: Record<string, unknown>) => boolean;
|
|
31
44
|
}
|
|
32
45
|
export declare const NODE_REGISTRY: Record<NodeType, NodeRegistryEntry>;
|
|
33
46
|
/** Get registry entry by canonical type */
|
package/dist/registry.js
CHANGED
|
@@ -145,6 +145,10 @@ exports.NODE_REGISTRY = {
|
|
|
145
145
|
group: 'Actions', detailPath: '/dashboard/email-actions', apiPath: '/email-actions',
|
|
146
146
|
stateKey: 'emailActions', allStateKey: 'allEmailActions',
|
|
147
147
|
color: '#f472b6', testable: true,
|
|
148
|
+
// AI Toolkit mode wires the node through the upstream AI Node's
|
|
149
|
+
// tools[] list, not via canvas edges — hide handles to prevent
|
|
150
|
+
// accidental misrouting that would silently fire with empty fields.
|
|
151
|
+
isToolOnly: (e) => e.aiEnabled === true,
|
|
148
152
|
},
|
|
149
153
|
httpAction: {
|
|
150
154
|
type: 'httpAction', prefix: 'ha', label: 'HTTP Action',
|
|
@@ -175,6 +179,9 @@ exports.NODE_REGISTRY = {
|
|
|
175
179
|
group: 'Actions', detailPath: '/dashboard/calendar-actions', apiPath: '/calendar-actions',
|
|
176
180
|
stateKey: 'calendarActions', allStateKey: 'allCalendarActions',
|
|
177
181
|
color: '#60a5fa', testable: true,
|
|
182
|
+
// AI Toolkit mode wires the node through the upstream AI Node's
|
|
183
|
+
// tools[] list, not via canvas edges — same pattern as emailAction.
|
|
184
|
+
isToolOnly: (e) => e.aiEnabled === true,
|
|
178
185
|
},
|
|
179
186
|
docsAction: {
|
|
180
187
|
type: 'docsAction', prefix: 'doc', label: 'Google Docs',
|
package/package.json
CHANGED