n8n-nodes-hudu 2.4.0 → 2.4.1
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/nodes/Hudu/HuduAiTools.node.js +2 -2
- package/dist/nodes/Hudu/HuduAiTools.node.js.map +1 -1
- package/dist/nodes/Hudu/ai-tools/description-builders.d.ts +1 -9
- package/dist/nodes/Hudu/ai-tools/description-builders.js +32 -221
- package/dist/nodes/Hudu/ai-tools/description-builders.js.map +1 -1
- package/dist/nodes/Hudu/ai-tools/help-registry.d.ts +3 -0
- package/dist/nodes/Hudu/ai-tools/help-registry.js +62 -0
- package/dist/nodes/Hudu/ai-tools/help-registry.js.map +1 -0
- package/dist/nodes/Hudu/ai-tools/resource-config.d.ts +1 -1
- package/dist/nodes/Hudu/ai-tools/resource-config.js +2 -2
- package/dist/nodes/Hudu/ai-tools/resource-config.js.map +1 -1
- package/dist/nodes/Hudu/ai-tools/schema-generator.d.ts +13 -0
- package/dist/nodes/Hudu/ai-tools/schema-generator.js +27 -0
- package/dist/nodes/Hudu/ai-tools/schema-generator.js.map +1 -1
- package/dist/nodes/Hudu/ai-tools/tool-executor.js +7 -0
- package/dist/nodes/Hudu/ai-tools/tool-executor.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ const OPERATION_LABELS = {
|
|
|
19
19
|
getIdByName: 'Resolve name to ID',
|
|
20
20
|
move: 'Move asset between companies',
|
|
21
21
|
getByLayout: 'List assets by layout (labelled custom fields)',
|
|
22
|
+
help: 'Help / workflow notes',
|
|
22
23
|
};
|
|
23
24
|
const runtimeSchemas = (0, schema_generator_1.getRuntimeSchemaBuilders)(runtime_1.runtimeZod);
|
|
24
25
|
const EXECUTE_METADATA_FIELDS = new Set([
|
|
@@ -143,9 +144,8 @@ class HuduAiTools {
|
|
|
143
144
|
}
|
|
144
145
|
const getAllSchema = runtimeSchemas.buildUnifiedSchema(resource, ['getAll'], config);
|
|
145
146
|
const supportsSearch = 'search' in getAllSchema.shape;
|
|
146
|
-
const referenceUtc = new Date().toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
147
147
|
const unifiedSchema = runtimeSchemas.buildUnifiedSchema(resource, enabledOperations, config);
|
|
148
|
-
const unifiedDescription = (0, description_builders_1.buildUnifiedDescription)(resourceLabel, resource, enabledOperations,
|
|
148
|
+
const unifiedDescription = (0, description_builders_1.buildUnifiedDescription)(resourceLabel, resource, enabledOperations, supportsSearch, config);
|
|
149
149
|
const hasWriteOps = enabledOperations.some((op) => resource_config_1.WRITE_OPERATIONS.includes(op));
|
|
150
150
|
const hasDestructiveOps = enabledOperations.some((op) => op === 'delete');
|
|
151
151
|
const unifiedTool = new runtime_1.RuntimeDynamicStructuredTool({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HuduAiTools.node.js","sourceRoot":"","sources":["../../../nodes/Hudu/HuduAiTools.node.ts"],"names":[],"mappings":";;;AAAA,+CAEsB;AActB,gEAAoF;AAEpF,4DAA6D;AAC7D,0EAA0E;AAC1E,kEAEqC;AACrC,gDAA8E;AAC9E,gEAAoE;AAEpE,MAAM,gBAAgB,GAA2B;IAC7C,GAAG,EAAE,WAAW;IAChB,MAAM,EAAE,yBAAyB;IACjC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,oBAAoB;IACjC,IAAI,EAAE,8BAA8B;IACpC,WAAW,EAAE,gDAAgD;
|
|
1
|
+
{"version":3,"file":"HuduAiTools.node.js","sourceRoot":"","sources":["../../../nodes/Hudu/HuduAiTools.node.ts"],"names":[],"mappings":";;;AAAA,+CAEsB;AActB,gEAAoF;AAEpF,4DAA6D;AAC7D,0EAA0E;AAC1E,kEAEqC;AACrC,gDAA8E;AAC9E,gEAAoE;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EAAE,MAAM,CAAC,KAAK;YAClB,KAAK;YACL,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,WAAW;SAC1C,CAAC,CAAC;IACP,CAAC;IACD,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAChE,CAAC;AAED,KAAK,UAAU,yBAAyB;;IACpC,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,CAAW,CAAC;IACpE,MAAM,oBAAoB,GAAG,CAAC,MAAA,IAAI,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,mCAAI,KAAK,CAAY,CAAC;IAExG,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IAEzB,MAAM,MAAM,GAAG,sCAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvB,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;QAC1B,IAAI,kCAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB;YAAE,SAAS;QACrE,OAAO,CAAC,IAAI,CAAC;YACT,IAAI,EAAE,MAAA,gBAAgB,CAAC,EAAE,CAAC,mCAAI,EAAE;YAChC,KAAK,EAAE,EAAE;YACT,WAAW,EAAE,GAAG,EAAE,kBAAkB,MAAM,CAAC,KAAK,EAAE;SACrD,CAAC,CAAC;IACP,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function getRequiredFields(resource: string): string[];
|
|
3
|
-
export declare function buildGetDescription(label: string, resourceName: string, supportsSearch?: boolean): string;
|
|
4
|
-
export declare function buildGetAllDescription(label: string, referenceUtc?: string, supportsSearch?: boolean, resource?: string): string;
|
|
5
|
-
export declare function buildCreateDescription(label: string, requiredFields: string[], referenceUtc?: string, supportsSearch?: boolean, resource?: string): string;
|
|
6
|
-
export declare function buildUpdateDescription(label: string, resourceName: string, supportsSearch?: boolean): string;
|
|
7
|
-
export declare function buildDeleteDescription(label: string, resourceName: string, supportsSearch?: boolean): string;
|
|
8
|
-
export declare function buildArchiveDescription(label: string, operation: 'archive' | 'unarchive', resourceName?: string, supportsSearch?: boolean): string;
|
|
9
|
-
export declare function buildUnifiedDescription(resourceLabel: string, resource: string, operations: string[], referenceUtc: string, supportsSearch: boolean, config: {
|
|
1
|
+
export declare function buildUnifiedDescription(resourceLabel: string, resource: string, operations: string[], supportsSearch: boolean, config: {
|
|
10
2
|
requiresCompanyEndpoint?: boolean;
|
|
11
3
|
}): string;
|
|
@@ -1,232 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.dateTimeReferenceSnippet = dateTimeReferenceSnippet;
|
|
4
|
-
exports.getRequiredFields = getRequiredFields;
|
|
5
|
-
exports.buildGetDescription = buildGetDescription;
|
|
6
|
-
exports.buildGetAllDescription = buildGetAllDescription;
|
|
7
|
-
exports.buildCreateDescription = buildCreateDescription;
|
|
8
|
-
exports.buildUpdateDescription = buildUpdateDescription;
|
|
9
|
-
exports.buildDeleteDescription = buildDeleteDescription;
|
|
10
|
-
exports.buildArchiveDescription = buildArchiveDescription;
|
|
11
3
|
exports.buildUnifiedDescription = buildUnifiedDescription;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
ip_addresses:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
4
|
+
const RESOURCE_HINTS = {
|
|
5
|
+
articles: "'name' = fuzzy title; 'search' = full-text (both re-rank exact-title to top). include_content/include_photos opt-in. folder_id auto-resolves company_id. operation=help topic=overview for workflow notes.",
|
|
6
|
+
companies: 'Use getIdByName for fuzzy name→id resolution.',
|
|
7
|
+
folders: 'Folders carry company_id (used by hudu_articles folder_id filtering for auto-narrowing).',
|
|
8
|
+
websites: "'name' IS the URL (must include https:// or http://).",
|
|
9
|
+
procedures: "Read responses expose nested tasks under 'tasks' (each with optional 'assignee' block).",
|
|
10
|
+
procedure_tasks: "Task carries 'assignee:{id,name,initials}' only when assigned.",
|
|
11
|
+
relations: 'fromable_/toable_ pairs declare both ends; types from RESOURCE_TYPES.',
|
|
12
|
+
assets: 'Use getIdByName for name→id. move recreates+deletes via /companies/{id}/assets. getByLayout labels custom fields.',
|
|
13
|
+
asset_passwords: 'Use getIdByName for fuzzy name→id resolution.',
|
|
14
|
+
asset_layouts: 'Use getIdByName for EXACT name→id resolution.',
|
|
15
|
+
activity_logs: 'Filter by user, resource_type+resource_id, action_message, or date range.',
|
|
16
|
+
ip_addresses: 'Filter by address, network_id, fqdn, status, or asset_id.',
|
|
17
|
+
networks: 'Use getIdByName for EXACT name→id resolution.',
|
|
18
|
+
vlans: 'Use getIdByName for EXACT name→id resolution.',
|
|
19
|
+
vlan_zones: 'Use getIdByName for EXACT name→id resolution.',
|
|
20
|
+
matchers: 'Filter by integration_id.',
|
|
21
|
+
groups: 'Use getIdByName for fuzzy name→id resolution.',
|
|
22
|
+
users: 'Use getIdByName for fuzzy name→id resolution.',
|
|
23
|
+
expirations: 'Filter by company_id or resource_type.',
|
|
24
|
+
photos: 'Internal photo records (not the embedded public_photos / numeric_id flow).',
|
|
25
|
+
public_photos: 'Slim shape: {numeric_id, url, file_name, size}. operation=help topic=overview for the verification workflow.',
|
|
31
26
|
};
|
|
32
|
-
|
|
27
|
+
const ENVELOPE_PREAMBLE = "Envelope v2 — 'error' key = failure; default-valued fields omitted.";
|
|
28
|
+
function buildUnifiedDescription(resourceLabel, resource, operations, supportsSearch, config) {
|
|
33
29
|
var _a;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
function buildGetDescription(label, resourceName, supportsSearch = true) {
|
|
37
|
-
if (resourceName === 'articles') {
|
|
38
|
-
return ("Fetch a single article record by its numeric ID. " +
|
|
39
|
-
"ONLY call when you already have a numeric ID — if you only have a title, call hudu_articles with operation 'getAll' and 'name' first. " +
|
|
40
|
-
"By default the HTML content field is stripped — set include_content=true only when you need to read or quote the article body; leave false when you need only metadata. " +
|
|
41
|
-
"When reading content (include_content=true): the response includes a 'public_photos' array — objects with 'numeric_id' (integer) for each embedded image. " +
|
|
42
|
-
"Call hudu_public_photos with operation 'get' and each photo's 'numeric_id' BEFORE editing or redacting the article — this verifies each embedded photo still exists so your edits do not accidentally break or remove valid image references. " +
|
|
43
|
-
"Skip this verification step when you are only reading, summarising, or quoting the article (no write-back). " +
|
|
44
|
-
"Do NOT use the slug from '/public_photo/<slug>' HTML links as the id — the API returns 404 for slugs; use 'numeric_id' only.");
|
|
45
|
-
}
|
|
46
|
-
if (resourceName === 'public_photos') {
|
|
47
|
-
return ("Fetch public photo slim METADATA by numeric ID — returns numeric_id, url, file_name, size. " +
|
|
48
|
-
"Returns METADATA ONLY — NEVER returns binary image bytes or image content. n8n's tool architecture forcibly JSON-stringifies every tool result, so binary data in AI tool responses is impossible by design. Do NOT attempt to return, decode, or analyse image content from this call. " +
|
|
49
|
-
"PRIMARY use: before editing or redacting an article (or company record) that contains embedded '/public_photo/<slug>' images, call this with each photo's 'numeric_id' to verify the photo still exists — this prevents your edits from breaking or removing references to photos that were already deleted upstream. " +
|
|
50
|
-
"SECONDARY use: surface the 'url' (a publicly accessible absolute URL, no Hudu auth required) or 'file_name' / 'size' to the user so they can open the image in their browser. " +
|
|
51
|
-
"NOT useful for: visual analysis of image content, describing what a diagram or screenshot shows, or OCR — this tool cannot see images. If the user asks what an image depicts, explain you can only supply the URL for them to view. " +
|
|
52
|
-
"Pass the 'numeric_id' (integer) from a prior article or company response's 'public_photos' array. Do NOT pass the slug string from '/public_photo/<slug>' HTML links — the API only accepts integers and returns 404 for slugs.");
|
|
53
|
-
}
|
|
54
|
-
const lookupHint = supportsSearch
|
|
55
|
-
? `call hudu_${resourceName} with operation 'getAll' and 'search' first, extract the 'id' from results, then call this.`
|
|
56
|
-
: `call hudu_${resourceName} with operation 'getAll' and the available filters to find the record, extract the 'id' from results, then call this.`;
|
|
57
|
-
return (`Fetch a single ${label} record by its numeric ID. ` +
|
|
58
|
-
`ONLY call this when you already have a numeric ID — never pass a name or text. ` +
|
|
59
|
-
`If you only have a name or description, ${lookupHint}`);
|
|
60
|
-
}
|
|
61
|
-
function buildGetAllDescription(label, referenceUtc, supportsSearch, resource) {
|
|
62
|
-
const ref = referenceUtc ? dateTimeReferenceSnippet(referenceUtc) : '';
|
|
63
|
-
if (resource === 'articles') {
|
|
64
|
-
return (ref +
|
|
65
|
-
"Search and list articles in Hudu. " +
|
|
66
|
-
"For title-based lookup (resolving a known title to an ID) use 'name' — fuzzy-matches titles with title-overlap ranking and auto-fetches up to 100 candidates. " +
|
|
67
|
-
"For topic or content-phrase exploration use 'search' — partial text match across title AND body. " +
|
|
68
|
-
"Content is stripped from results by default (set include_content=true to include). " +
|
|
69
|
-
"Narrow with company_id, folder_id, draft, enable_sharing, or updated_at_start/end date range. " +
|
|
70
|
-
"Results contain numeric 'id' on each record — capture for get, update, delete, or archive. " +
|
|
71
|
-
"Article HTML (fetched via 'get' with include_content=true) contains embedded images; the response includes a 'public_photos' array with 'numeric_id' per image — when editing or redacting the article, call hudu_public_photos 'get' with that integer FIRST to verify each embedded photo still exists (prevents breaking image references). Skip this step when just reading or summarising. Use 'numeric_id', NOT the slug from HTML links. " +
|
|
72
|
-
"If results are unexpectedly empty, verify API key permissions.");
|
|
73
|
-
}
|
|
74
|
-
if (resource === 'public_photos') {
|
|
75
|
-
return (ref +
|
|
76
|
-
"List public photo records in Hudu. Public photos are images embedded in article or company HTML content as '/public_photo/<slug>' links. " +
|
|
77
|
-
"WARNING: Hudu has no server-side filters on this endpoint — record_type and record_id are applied client-side after paging the full photo corpus. ALWAYS provide both record_type ('Article' or 'Company') AND record_id to keep the fetch bounded. " +
|
|
78
|
-
"Each result's 'id' is a string slug (display only); 'numeric_id' is the integer required for operation 'get' — do NOT pass the slug string; 'url' is the direct image URL for display or download. " +
|
|
79
|
-
"Increase 'limit' toward 100 only if you expect a record to have many embedded photos. " +
|
|
80
|
-
"If results are empty, verify record_type and record_id match a record that actually has embedded photos.");
|
|
81
|
-
}
|
|
82
|
-
if (supportsSearch) {
|
|
83
|
-
return (ref +
|
|
84
|
-
`Search and list ${label} records in Hudu. ` +
|
|
85
|
-
`ALWAYS use 'search' for any text or name lookup (partial match across multiple fields) — do not use 'name' for text lookups. ` +
|
|
86
|
-
`Results contain a numeric 'id' field on each record — capture this ID for subsequent getById, update, delete, or archive calls. ` +
|
|
87
|
-
`Increase 'limit' (max 100) if you expect many results. ` +
|
|
88
|
-
`If results are unexpectedly empty, verify API key permissions.`);
|
|
89
|
-
}
|
|
90
|
-
return (ref +
|
|
91
|
-
`List ${label} records in Hudu using the available filters. ` +
|
|
92
|
-
`This resource has no partial-text search — to find a record by name use the 'name' filter (EXACT full-name match, case-sensitive). ` +
|
|
93
|
-
`Results contain a numeric 'id' field on each record — capture this ID for subsequent getById, update, delete, or archive calls. ` +
|
|
94
|
-
`Increase 'limit' (max 100) if you expect many results. ` +
|
|
95
|
-
`If results are unexpectedly empty, verify API key permissions.`);
|
|
96
|
-
}
|
|
97
|
-
function buildCreateDescription(label, requiredFields, referenceUtc, supportsSearch = true, resource = '') {
|
|
98
|
-
const ref = referenceUtc ? dateTimeReferenceSnippet(referenceUtc) : '';
|
|
99
|
-
if (resource === 'articles') {
|
|
100
|
-
return (ref +
|
|
101
|
-
'Create a new article in Hudu. ' +
|
|
102
|
-
'SCOPE — provide ONE of: (a) company_id (numeric, use hudu_companies_get_id_by_name if unknown), ' +
|
|
103
|
-
'(b) folder_id (company_id auto-resolved internally — no extra call needed), ' +
|
|
104
|
-
'or (c) global=true for a global article not tied to any company. ' +
|
|
105
|
-
'folder_id is optional when global=true (places article in a global folder). ' +
|
|
106
|
-
'global=true takes precedence over any provided company_id. ' +
|
|
107
|
-
'content accepts HTML or Markdown. ' +
|
|
108
|
-
'Confirm field values with user before executing when acting autonomously. ' +
|
|
109
|
-
'On success returns the created article including its numeric id.');
|
|
110
|
-
}
|
|
111
|
-
const reqList = requiredFields.length > 0 ? `Required fields: ${requiredFields.join(', ')}. ` : '';
|
|
112
|
-
const idFields = requiredFields.filter((f) => f.endsWith('_id') && f !== 'id');
|
|
113
|
-
const foreignKeyHint = idFields.length > 0
|
|
114
|
-
? supportsSearch
|
|
115
|
-
? `For unknown IDs (${idFields.join(', ')}): call the relevant resource's getAll with 'search' to find the numeric ID first. `
|
|
116
|
-
: `For unknown IDs (${idFields.join(', ')}): call the relevant resource's getAll with available filters to find the numeric ID first. `
|
|
117
|
-
: '';
|
|
118
|
-
return (ref +
|
|
119
|
-
`Create a new ${label} record in Hudu. ` +
|
|
120
|
-
reqList +
|
|
121
|
-
foreignKeyHint +
|
|
122
|
-
`Confirm field values with user before executing when acting autonomously. ` +
|
|
123
|
-
`On success returns the created record including its assigned numeric 'id' (use for subsequent operations). ` +
|
|
124
|
-
`If you receive a validation error, check that all required fields are provided with valid values.`);
|
|
125
|
-
}
|
|
126
|
-
function buildUpdateDescription(label, resourceName, supportsSearch = true) {
|
|
127
|
-
const lookupHint = supportsSearch
|
|
128
|
-
? `call hudu_${resourceName} with operation 'getAll' and 'search' first to get the 'id'.`
|
|
129
|
-
: `call hudu_${resourceName} with operation 'getAll' and available filters to find the record and get the 'id'.`;
|
|
130
|
-
return (`Update an existing ${label} record in Hudu by numeric ID. ` +
|
|
131
|
-
`PREREQUISITE: you need the numeric ID. If you only have a name or text, ${lookupHint} ` +
|
|
132
|
-
`Provide only the fields you want to change — unchanged fields can be omitted (PATCH semantics). ` +
|
|
133
|
-
`Confirm field values with user before executing when acting autonomously. ` +
|
|
134
|
-
`Returns the updated record.`);
|
|
135
|
-
}
|
|
136
|
-
function buildDeleteDescription(label, resourceName, supportsSearch = true) {
|
|
137
|
-
const confirmHint = supportsSearch
|
|
138
|
-
? `call hudu_${resourceName} with operation 'getAll' and 'search' if unsure.`
|
|
139
|
-
: `call hudu_${resourceName} with operation 'getAll' and available filters if unsure.`;
|
|
140
|
-
return (`Permanently and irreversibly delete a ${label} record from Hudu by numeric ID. ` +
|
|
141
|
-
`Consider using 'archive' instead — it hides the record while preserving data for later restoration. ` +
|
|
142
|
-
`PREREQUISITE: confirm the correct ID — ${confirmHint} ` +
|
|
143
|
-
`ONLY on explicit user intent. Do not infer from context. Confirm ID is correct before proceeding. ` +
|
|
144
|
-
`Returns deletion confirmation.`);
|
|
145
|
-
}
|
|
146
|
-
function buildArchiveDescription(label, operation, resourceName, supportsSearch = true) {
|
|
147
|
-
if (operation === 'archive') {
|
|
148
|
-
const prereq = resourceName
|
|
149
|
-
? supportsSearch
|
|
150
|
-
? `If unsure of the ID, call hudu_${resourceName} with operation 'getAll' and 'search' first. `
|
|
151
|
-
: `If unsure of the ID, call hudu_${resourceName} with operation 'getAll' and available filters to find the record first. `
|
|
152
|
-
: '';
|
|
153
|
-
return (`Archive a ${label} record in Hudu by numeric ID. ` +
|
|
154
|
-
`Archived records are hidden from active views but NOT deleted — data is preserved and can be restored with 'unarchive'. ` +
|
|
155
|
-
`Prefer this over 'delete' when you want to deactivate rather than permanently remove a record. ` +
|
|
156
|
-
prereq);
|
|
157
|
-
}
|
|
158
|
-
return (`Restore a previously archived ${label} record in Hudu by numeric ID. ` +
|
|
159
|
-
`The record becomes visible in active views again. Returns confirmation.`);
|
|
160
|
-
}
|
|
161
|
-
function buildGetIdByNameDescription(resourceLabel, resource) {
|
|
162
|
-
const exactResources = new Set(['asset_layouts', 'folders', 'networks', 'procedures', 'vlans', 'vlan_zones']);
|
|
163
|
-
const isExact = exactResources.has(resource);
|
|
164
|
-
const matchNote = isExact
|
|
165
|
-
? 'EXACT case-sensitive match required.'
|
|
166
|
-
: 'Partial/fuzzy match — shorter terms return more results.';
|
|
167
|
-
return (`Resolve a ${resourceLabel} name to its numeric Hudu ID. ${matchNote} ` +
|
|
168
|
-
`Returns up to [limit] slim records (id, name, plus a few key reference fields). ` +
|
|
169
|
-
`Use before any operation requiring a numeric ${resourceLabel} ID. ` +
|
|
170
|
-
`Prefer this over operation 'getAll' just to find an ID. Requires field: name. Optional: limit (default 5, max 20).`);
|
|
171
|
-
}
|
|
172
|
-
function buildMoveDescription() {
|
|
173
|
-
return ('Move an asset between companies. Recreates the asset under the target company (preserving standard and custom field values) ' +
|
|
174
|
-
'then deletes the original. There is no native Hudu API endpoint for this operation. ' +
|
|
175
|
-
'IMPORTANT: Relations pointing to the original asset will NOT be automatically updated — ' +
|
|
176
|
-
'use hudu_relations to re-establish them after the move if needed. ' +
|
|
177
|
-
'Set delete_original=false to create a copy without removing the original (verify before committing the move). ' +
|
|
178
|
-
'PREREQUISITE: confirm the correct asset_id and target_company_id before calling — this operation cannot be undone automatically if delete_original=true. ' +
|
|
179
|
-
'Requires fields: asset_id, target_company_id. Optional: delete_original (default true).');
|
|
180
|
-
}
|
|
181
|
-
function buildGetByLayoutDescription() {
|
|
182
|
-
return ('List all assets of a specific type (layout) for a company, with custom field values labelled by field name. ' +
|
|
183
|
-
'Accepts company name or ID, and layout name or ID. Layout name must be an EXACT case-sensitive match — ' +
|
|
184
|
-
'use hudu_asset_layouts with operation getIdByName if unsure of the exact name. ' +
|
|
185
|
-
'Returns assets with a labelled fields object (e.g., {"Hostname": "SRV01", "IP Address": "10.0.0.1"}) ' +
|
|
186
|
-
'instead of raw numeric field IDs. ' +
|
|
187
|
-
"This is the preferred operation for 'show me all [servers/switches/firewalls] for [company]' queries. " +
|
|
188
|
-
'Requires either company_id or company_name, and either layout_id or layout_name. Optional: include_archived (default false).');
|
|
189
|
-
}
|
|
190
|
-
function buildUnifiedDescription(resourceLabel, resource, operations, referenceUtc, supportsSearch, config) {
|
|
30
|
+
void supportsSearch;
|
|
31
|
+
void config;
|
|
191
32
|
const enabledOps = Array.from(new Set(operations));
|
|
192
|
-
const
|
|
193
|
-
const operationLines = enabledOps.map((operation) => {
|
|
194
|
-
switch (operation) {
|
|
195
|
-
case 'get':
|
|
196
|
-
return `- get: ${buildGetDescription(resourceLabel, resource, supportsSearch)}`;
|
|
197
|
-
case 'getAll':
|
|
198
|
-
return `- getAll: ${buildGetAllDescription(resourceLabel, undefined, supportsSearch, resource)}`;
|
|
199
|
-
case 'create':
|
|
200
|
-
return `- create: ${buildCreateDescription(resourceLabel, requiredFields, undefined, supportsSearch, resource)}`;
|
|
201
|
-
case 'update':
|
|
202
|
-
return `- update: ${buildUpdateDescription(resourceLabel, resource, supportsSearch)}`;
|
|
203
|
-
case 'delete':
|
|
204
|
-
return `- delete: ${buildDeleteDescription(resourceLabel, resource, supportsSearch)}`;
|
|
205
|
-
case 'archive':
|
|
206
|
-
case 'unarchive':
|
|
207
|
-
return `- ${operation}: ${buildArchiveDescription(resourceLabel, operation, resource, supportsSearch)}`;
|
|
208
|
-
case 'getIdByName':
|
|
209
|
-
return `- getIdByName: ${buildGetIdByNameDescription(resourceLabel, resource)}`;
|
|
210
|
-
case 'move':
|
|
211
|
-
return `- move: ${buildMoveDescription()}`;
|
|
212
|
-
case 'getByLayout':
|
|
213
|
-
return `- getByLayout: ${buildGetByLayoutDescription()}`;
|
|
214
|
-
default:
|
|
215
|
-
return `- ${operation}: Operation available for this resource.`;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
const companyEndpointHint = config.requiresCompanyEndpoint
|
|
219
|
-
? 'This resource can require company-scoped endpoints for write operations. Provide company_id when required.'
|
|
220
|
-
: '';
|
|
33
|
+
const hint = (_a = RESOURCE_HINTS[resource]) !== null && _a !== void 0 ? _a : '';
|
|
221
34
|
return [
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
'Prefer running getAll first to discover numeric IDs before get, update, delete, archive, or unarchive.',
|
|
227
|
-
companyEndpointHint,
|
|
35
|
+
`Manage Hudu ${resourceLabel} records.`,
|
|
36
|
+
`Operations: ${enabledOps.join(', ')}.`,
|
|
37
|
+
hint,
|
|
38
|
+
ENVELOPE_PREAMBLE,
|
|
228
39
|
]
|
|
229
40
|
.filter(Boolean)
|
|
230
|
-
.join('
|
|
41
|
+
.join(' ');
|
|
231
42
|
}
|
|
232
43
|
//# sourceMappingURL=description-builders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"description-builders.js","sourceRoot":"","sources":["../../../../nodes/Hudu/ai-tools/description-builders.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"description-builders.js","sourceRoot":"","sources":["../../../../nodes/Hudu/ai-tools/description-builders.ts"],"names":[],"mappings":";;AA+CA,0DAqBC;AA/DD,MAAM,cAAc,GAA2B;IAC7C,QAAQ,EACN,4MAA4M;IAC9M,SAAS,EAAE,+CAA+C;IAC1D,OAAO,EACL,0FAA0F;IAC5F,QAAQ,EAAE,uDAAuD;IACjE,UAAU,EACR,yFAAyF;IAC3F,eAAe,EAAE,gEAAgE;IACjF,SAAS,EAAE,uEAAuE;IAClF,MAAM,EACJ,mHAAmH;IACrH,eAAe,EAAE,+CAA+C;IAChE,aAAa,EAAE,+CAA+C;IAC9D,aAAa,EAAE,2EAA2E;IAC1F,YAAY,EAAE,2DAA2D;IACzE,QAAQ,EAAE,+CAA+C;IACzD,KAAK,EAAE,+CAA+C;IACtD,UAAU,EAAE,+CAA+C;IAC3D,QAAQ,EAAE,2BAA2B;IACrC,MAAM,EAAE,+CAA+C;IACvD,KAAK,EAAE,+CAA+C;IACtD,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE,4EAA4E;IACpF,aAAa,EACX,8GAA8G;CACjH,CAAC;AAEF,MAAM,iBAAiB,GACrB,qEAAqE,CAAC;AAYxE,SAAgB,uBAAuB,CACrC,aAAqB,EACrB,QAAgB,EAChB,UAAoB,EACpB,cAAuB,EACvB,MAA6C;;IAI7C,KAAK,cAAc,CAAC;IACpB,KAAK,MAAM,CAAC;IACZ,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,MAAA,cAAc,CAAC,QAAQ,CAAC,mCAAI,EAAE,CAAC;IAC5C,OAAO;QACL,eAAe,aAAa,WAAW;QACvC,eAAe,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;QACvC,IAAI;QACJ,iBAAiB;KAClB;SACE,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HELP_ENABLED_RESOURCES = exports.HELP_TOPICS = void 0;
|
|
4
|
+
exports.runHelp = runHelp;
|
|
5
|
+
const error_formatter_1 = require("./error-formatter");
|
|
6
|
+
exports.HELP_TOPICS = {
|
|
7
|
+
articles: {
|
|
8
|
+
overview: "Hudu KB articles — full workflow.\n" +
|
|
9
|
+
"ID resolution: when you only have a title, call getAll with `name` (fuzzy, two-tier re-rank — full-substring boost +1000, then word-overlap; auto-fetches 100 candidates, returns top `limit`). For topic/content exploration call getAll with `search` (same re-rank but matches across title AND body). Both surface exact-title hits at position 0.\n" +
|
|
10
|
+
"Body content: stripped by default. Set include_content=true on get/getAll to include HTML.\n" +
|
|
11
|
+
"Photos: stripped by default. Set include_photos=true to include the `public_photos` array (slim shape: {numeric_id, url, file_name, size}).\n" +
|
|
12
|
+
"Filters on getAll: company_id, folder_id, slug (12-char short hash only — SEO suffix not queryable), draft, enable_sharing, updated_at_start/end range.\n" +
|
|
13
|
+
"Folder filtering: folder_id is not a native Hudu /articles query param. The executor pre-resolves the folder→owning company_id (one /folders GET) and injects company_id natively, then post-filters by folder_id. Global folders (company_id:null) fall back to a bounded scan (≤20 pages × 100 records).\n" +
|
|
14
|
+
"Truncation signal: result.truncated:true means more matches exist beyond the cap — narrow with company_id or search.\n" +
|
|
15
|
+
"Envelope v2 — 'error' key = failure; default-valued fields omitted from records (treat absent field as default).\n" +
|
|
16
|
+
"See also: topic=photos (verification dance), topic=search (ranking detail), topic=create (scope rules).",
|
|
17
|
+
photos: "Article photo verification workflow.\n" +
|
|
18
|
+
"Article HTML embeds images as `<a href=\"/public_photo/<slug>\">…</a>` links. The article get/getAll response with include_photos=true returns a `public_photos` array of slim metadata: {numeric_id, url, file_name, size}. The slug string is display-only — the Hudu API only accepts the integer numeric_id; it returns 404 for slug strings.\n" +
|
|
19
|
+
"BEFORE editing or redacting an article (with write-back): call hudu_public_photos get with each photo's numeric_id to verify the photo still exists upstream. This prevents your edits from breaking or removing references to photos that were deleted upstream.\n" +
|
|
20
|
+
"SKIP this verification when you are only reading, summarising, or quoting the article (no write-back).\n" +
|
|
21
|
+
"Photo records can NEVER carry binary image bytes through n8n's tool architecture — JSON-stringification at the executor boundary strips any binary payload. Use the `url` field (public, no auth required) to surface the image to a human; never attempt visual analysis from the tool result.",
|
|
22
|
+
search: "Search vs name on hudu_articles getAll.\n" +
|
|
23
|
+
"`name`: send a known full or partial title. The executor translates to upstream search, fetches up to 100 candidates, and re-ranks with the two-tier title scorer (full-substring boost +1000, then per-word overlap). Best when the LLM has a title in hand.\n" +
|
|
24
|
+
"`search`: send a topic phrase or content keyword. Same upstream call, same re-rank — but matches body text too. Use when the LLM is exploring rather than resolving a title to an ID.\n" +
|
|
25
|
+
"Ranking guarantees: exact-title matches surface at position 0 when the full query appears as a substring of the title. Word-overlap is the fallback tier.\n" +
|
|
26
|
+
"If you get unexpected zero results, check API key permissions or relax filters; the re-rank cannot synthesise records that the upstream did not return.",
|
|
27
|
+
create: "Hudu article create — scope rules.\n" +
|
|
28
|
+
"Provide ONE of (a) numeric company_id, (b) folder_id (company_id auto-resolved internally via /folders GET), (c) global=true for a non-company-scoped article.\n" +
|
|
29
|
+
"Precedence: global=true wins over company_id. folder_id is optional when global=true (article lands in a global folder).\n" +
|
|
30
|
+
"content accepts HTML or Markdown.\n" +
|
|
31
|
+
"Confirm field values with the user before executing when acting autonomously.\n" +
|
|
32
|
+
"Returns the created article including its numeric id (use for subsequent get/update/archive/delete).",
|
|
33
|
+
},
|
|
34
|
+
public_photos: {
|
|
35
|
+
overview: "Hudu public_photos — slim metadata only, never binary.\n" +
|
|
36
|
+
"Returns {numeric_id, url, file_name, size}. The slug `id` field returned by Hudu is dropped (display-only, not callable via the API). `record_type` and `record_id` are also dropped (caller already has the parent's context).\n" +
|
|
37
|
+
"n8n's tool architecture forcibly JSON-stringifies every tool result, so binary image bytes can NEVER reach the LLM through this call — by design.\n" +
|
|
38
|
+
"PRIMARY use: before editing or redacting an article (or company record) that contains embedded `/public_photo/<slug>` images, call hudu_public_photos get with each photo's numeric_id to verify the photo still exists upstream. This prevents your edits from breaking or removing references to photos that were already deleted.\n" +
|
|
39
|
+
"SECONDARY use: surface `url` (a publicly accessible absolute URL — no Hudu auth required) and `file_name`/`size` to the user so they can open the image in their browser.\n" +
|
|
40
|
+
"NOT useful for: visual analysis, OCR, image description. The tool cannot see image content. If the user asks what an image depicts, supply the URL and explain you can only link it.\n" +
|
|
41
|
+
"Pass the integer numeric_id from a prior article or company response's `public_photos` array. The API returns 404 for slug strings.",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
exports.HELP_ENABLED_RESOURCES = Object.keys(exports.HELP_TOPICS);
|
|
45
|
+
function runHelp(resource, params) {
|
|
46
|
+
var _a;
|
|
47
|
+
const topics = exports.HELP_TOPICS[resource];
|
|
48
|
+
if (!topics) {
|
|
49
|
+
return JSON.stringify((0, error_formatter_1.wrapError)(resource, 'help', error_formatter_1.ERROR_TYPES.UNKNOWN_RESOURCE, `help is not registered for resource: ${resource}.`, `Resources with help topics: ${exports.HELP_ENABLED_RESOURCES.join(', ')}.`));
|
|
50
|
+
}
|
|
51
|
+
const requestedTopic = (_a = params.topic) !== null && _a !== void 0 ? _a : 'overview';
|
|
52
|
+
const content = topics[requestedTopic];
|
|
53
|
+
if (!content) {
|
|
54
|
+
return JSON.stringify((0, error_formatter_1.wrapError)(resource, 'help', error_formatter_1.ERROR_TYPES.VALIDATION_ERROR, `Unknown help topic '${requestedTopic}' for ${resource}.`, `Available topics: ${Object.keys(topics).join(', ')}.`));
|
|
55
|
+
}
|
|
56
|
+
return JSON.stringify((0, error_formatter_1.wrapSuccess)(resource, 'help', {
|
|
57
|
+
topic: requestedTopic,
|
|
58
|
+
availableTopics: Object.keys(topics),
|
|
59
|
+
content,
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=help-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"help-registry.js","sourceRoot":"","sources":["../../../../nodes/Hudu/ai-tools/help-registry.ts"],"names":[],"mappings":";;;AAsDA,0BAiCC;AAvFD,uDAAwE;AAO3D,QAAA,WAAW,GAA2C;IACjE,QAAQ,EAAE;QACR,QAAQ,EACN,qCAAqC;YACrC,0VAA0V;YAC1V,8FAA8F;YAC9F,+IAA+I;YAC/I,2JAA2J;YAC3J,8SAA8S;YAC9S,wHAAwH;YACxH,oHAAoH;YACpH,yGAAyG;QAC3G,MAAM,EACJ,wCAAwC;YACxC,qVAAqV;YACrV,qQAAqQ;YACrQ,0GAA0G;YAC1G,iSAAiS;QACnS,MAAM,EACJ,2CAA2C;YAC3C,iQAAiQ;YACjQ,yLAAyL;YACzL,6JAA6J;YAC7J,yJAAyJ;QAC3J,MAAM,EACJ,sCAAsC;YACtC,kKAAkK;YAClK,4HAA4H;YAC5H,qCAAqC;YACrC,iFAAiF;YACjF,sGAAsG;KACzG;IACD,aAAa,EAAE;QACb,QAAQ,EACN,0DAA0D;YAC1D,mOA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| 'unarchive' | 'getIdByName' | 'move' | 'getByLayout';
|
|
1
|
+
export type HuduOperation = 'get' | 'getAll' | 'create' | 'update' | 'delete' | 'archive' | 'unarchive' | 'getIdByName' | 'move' | 'getByLayout' | 'help';
|
|
2
2
|
export interface HuduResourceConfig {
|
|
3
3
|
endpoint: string;
|
|
4
4
|
pluralKey: string | null;
|
|
@@ -16,7 +16,7 @@ exports.HUDU_RESOURCE_CONFIG = {
|
|
|
16
16
|
pluralKey: 'articles',
|
|
17
17
|
singularKey: 'article',
|
|
18
18
|
bodyKey: 'article',
|
|
19
|
-
ops: ['get', 'getAll', 'create', 'update', 'delete', 'archive', 'unarchive'],
|
|
19
|
+
ops: ['get', 'getAll', 'create', 'update', 'delete', 'archive', 'unarchive', 'help'],
|
|
20
20
|
supportsPagination: true,
|
|
21
21
|
label: 'Article',
|
|
22
22
|
supportsContentField: true,
|
|
@@ -101,7 +101,7 @@ exports.HUDU_RESOURCE_CONFIG = {
|
|
|
101
101
|
pluralKey: 'public_photos',
|
|
102
102
|
singularKey: null,
|
|
103
103
|
bodyKey: null,
|
|
104
|
-
ops: ['get'],
|
|
104
|
+
ops: ['get', 'help'],
|
|
105
105
|
supportsPagination: true,
|
|
106
106
|
label: 'Public Photo',
|
|
107
107
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-config.js","sourceRoot":"","sources":["../../../../nodes/Hudu/ai-tools/resource-config.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"resource-config.js","sourceRoot":"","sources":["../../../../nodes/Hudu/ai-tools/resource-config.ts"],"names":[],"mappings":";;;AA0Ca,QAAA,oBAAoB,GAAuC;IACtE,SAAS,EAAE;QACT,QAAQ,EAAE,YAAY;QACtB,SAAS,EAAE,WAAW;QACtB,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE,SAAS;QAClB,GAAG,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ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IAAI,CAAC;QACxB,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;QACrB,QAAQ,EAAE,CAAC,KAAK,CAAC;KAClB;IACD,eAAe,EAAE;QACf,SAAS,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC;QACxB,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;QACvB,QAAQ,EAAE,CAAC,IAAI,CAAC;KACjB;CACF,CAAC"}
|
|
@@ -1231,6 +1231,19 @@ export declare function getMoveAssetSchema(): z.ZodObject<{
|
|
|
1231
1231
|
target_company_id: number;
|
|
1232
1232
|
delete_original?: boolean | undefined;
|
|
1233
1233
|
}>;
|
|
1234
|
+
export declare function getHelpSchema(resource: string): z.ZodObject<{
|
|
1235
|
+
topic: z.ZodDefault<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
|
|
1236
|
+
}, "strip", z.ZodTypeAny, {
|
|
1237
|
+
topic: string;
|
|
1238
|
+
}, {
|
|
1239
|
+
topic?: string | undefined;
|
|
1240
|
+
}> | z.ZodObject<{
|
|
1241
|
+
topic: z.ZodOptional<z.ZodString>;
|
|
1242
|
+
}, "strip", z.ZodTypeAny, {
|
|
1243
|
+
topic?: string | undefined;
|
|
1244
|
+
}, {
|
|
1245
|
+
topic?: string | undefined;
|
|
1246
|
+
}>;
|
|
1234
1247
|
export declare function getByLayoutSchema(): z.ZodObject<{
|
|
1235
1248
|
company_id: z.ZodOptional<z.ZodNumber>;
|
|
1236
1249
|
company_name: z.ZodOptional<z.ZodString>;
|
|
@@ -55,6 +55,7 @@ exports.getVlanZonesUpdateSchema = getVlanZonesUpdateSchema;
|
|
|
55
55
|
exports.getMatchersUpdateSchema = getMatchersUpdateSchema;
|
|
56
56
|
exports.getGetIdByNameSchema = getGetIdByNameSchema;
|
|
57
57
|
exports.getMoveAssetSchema = getMoveAssetSchema;
|
|
58
|
+
exports.getHelpSchema = getHelpSchema;
|
|
58
59
|
exports.getByLayoutSchema = getByLayoutSchema;
|
|
59
60
|
exports.buildUnifiedSchema = buildUnifiedSchema;
|
|
60
61
|
exports.getRuntimeSchemaBuilders = getRuntimeSchemaBuilders;
|
|
@@ -925,6 +926,7 @@ const OPERATION_LABELS = {
|
|
|
925
926
|
getIdByName: 'Resolve name to ID',
|
|
926
927
|
move: 'Move asset',
|
|
927
928
|
getByLayout: 'Assets by layout',
|
|
929
|
+
help: 'Help / workflow notes',
|
|
928
930
|
};
|
|
929
931
|
const SUPPORTED_OPERATIONS = new Set([
|
|
930
932
|
'get',
|
|
@@ -937,6 +939,7 @@ const SUPPORTED_OPERATIONS = new Set([
|
|
|
937
939
|
'getIdByName',
|
|
938
940
|
'move',
|
|
939
941
|
'getByLayout',
|
|
942
|
+
'help',
|
|
940
943
|
]);
|
|
941
944
|
const GETIDBYNAME_EXACT_MATCH_RESOURCES = new Set([
|
|
942
945
|
'asset_layouts',
|
|
@@ -983,6 +986,28 @@ function getMoveAssetSchema() {
|
|
|
983
986
|
'Set to false to create a copy without deleting the original — useful for verifying the move before committing.'),
|
|
984
987
|
});
|
|
985
988
|
}
|
|
989
|
+
const HELP_TOPIC_ENUM = {
|
|
990
|
+
articles: ['overview', 'photos', 'search', 'create'],
|
|
991
|
+
public_photos: ['overview'],
|
|
992
|
+
};
|
|
993
|
+
function getHelpSchema(resource) {
|
|
994
|
+
const topics = HELP_TOPIC_ENUM[resource];
|
|
995
|
+
if (topics) {
|
|
996
|
+
return zod_1.z.object({
|
|
997
|
+
topic: zod_1.z
|
|
998
|
+
.enum(topics)
|
|
999
|
+
.optional()
|
|
1000
|
+
.default('overview')
|
|
1001
|
+
.describe(`Help topic. Default 'overview'. Available: ${topics.join(', ')}. Returns long-form workflow prose.`),
|
|
1002
|
+
});
|
|
1003
|
+
}
|
|
1004
|
+
return zod_1.z.object({
|
|
1005
|
+
topic: zod_1.z
|
|
1006
|
+
.string()
|
|
1007
|
+
.optional()
|
|
1008
|
+
.describe("Help topic. Default 'overview' if omitted."),
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
986
1011
|
function getByLayoutSchema() {
|
|
987
1012
|
return zod_1.z.object({
|
|
988
1013
|
company_id: zod_1.z
|
|
@@ -1158,6 +1183,8 @@ function getSchemaForOperation(resource, operation, config) {
|
|
|
1158
1183
|
return getMoveAssetSchema();
|
|
1159
1184
|
case 'getByLayout':
|
|
1160
1185
|
return getByLayoutSchema();
|
|
1186
|
+
case 'help':
|
|
1187
|
+
return getHelpSchema(resource);
|
|
1161
1188
|
}
|
|
1162
1189
|
}
|
|
1163
1190
|
function buildUnifiedSchema(resource, operations, config) {
|