n8n-nodes-kumiho 0.3.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/README.md ADDED
@@ -0,0 +1,89 @@
1
+ # n8n-nodes-kumiho
2
+
3
+ This is an n8n community node for [Kumiho](https://kumiho.io), the graph-native creative asset management system.
4
+
5
+ ## Features
6
+
7
+ This package intentionally ships **three nodes**:
8
+
9
+ - **Kumiho Event Trigger**: Streaming (SSE) event trigger (created/updated/deleted/tagged) with cursor persistence.
10
+ - **Kumiho Action**: One node covering Projects, Spaces, Items, Revisions, Artifacts, Bundles, Graph, and Kref resolve.
11
+ - **Kumiho MCP Client**: Invoke MCP tools.
12
+
13
+ For full operation-by-operation documentation, see the usage guide below.
14
+
15
+ ## Documentation
16
+
17
+ - Detailed usage: [docs/usage.md](docs/usage.md)
18
+ - FastAPI endpoint map: [docs/fastapi-endpoint-map.md](docs/fastapi-endpoint-map.md)
19
+ - Consolidation plan: [docs/node-consolidation-plan.md](docs/node-consolidation-plan.md)
20
+
21
+ ## Installation
22
+
23
+ 1. Go to **Settings > Community Nodes** in your n8n instance.
24
+ 2. Click **Install a new node**.
25
+ 3. Enter `n8n-nodes-kumiho`.
26
+ 4. Click **Install**.
27
+
28
+ ## Node Reference
29
+
30
+ - **Kumiho Event Trigger**: Trigger workflows from Kumiho events via SSE `GET /api/v1/events/stream`.
31
+ - **Kumiho Action**: Create/read/update/delete Kumiho resources via FastAPI routes under `/api/v1/*`.
32
+ - **Kumiho MCP Client**: Invoke tools via `/api/v1/mcp/invoke`.
33
+
34
+ For parameters and examples, see [docs/usage.md](docs/usage.md).
35
+
36
+ ## Testing the Event Trigger
37
+
38
+ To test the **Kumiho Event Trigger** node:
39
+
40
+ 1. Add the **Kumiho Event Trigger** node to your workflow.
41
+ 2. Set:
42
+ - **Trigger Type**: `Revision`
43
+ - **Stream Action**: `Created`
44
+ 3. (Optional) Set **Path Filter (Project/Space)** to limit events (e.g. `my-project/my-space`).
45
+ 4. Set **Reconnect Delay (Seconds)** to `10`.
46
+ 5. Click **Listen for Event** in n8n.
47
+ 6. In another window (or via CLI/SDK), create a new revision in Kumiho.
48
+ 7. The node should emit an event with routing key `revision.created`.
49
+
50
+ ## Troubleshooting
51
+
52
+ If events are not being caught:
53
+ - Ensure your **Base URL** in credentials points to the correct Kumiho API endpoint (e.g., `https://api.kumiho.cloud`).
54
+ - Check that the **Service Token** has permissions for the tenant you are working in.
55
+ - The node uses a **Cursor** to resume after reconnects. The cursor is stored in workflow static data, and can be overridden via **Advanced → Cursor**.
56
+
57
+ ### Error handling (production)
58
+
59
+ - All API calls send `x-correlation-id`.
60
+ - When a request fails, the node includes the correlation id (when available) in the error message to simplify support/debugging.
61
+ - When the upstream API returns a standard error envelope, the node maps it into the thrown error:
62
+ - `error.code` (string)
63
+ - `error.message` (string)
64
+ - `error.retryable` (boolean)
65
+ - `error.retry_after_ms` (number, optional)
66
+ - `correlation_id` (string)
67
+
68
+ Security note: the node redacts the `X-Kumiho-Token` header from thrown errors so secrets don't leak into n8n logs or UI error details.
69
+
70
+ ### Timeouts and retry budget
71
+
72
+ The request helper enforces a per-request timeout and an overall retry budget.
73
+
74
+ - `KUMIHO_N8N_REQUEST_TIMEOUT_MS` (default: 60000)
75
+ - `KUMIHO_N8N_RETRY_BUDGET_MS` (default: 60000)
76
+
77
+ If the retry budget is exceeded, the node throws an error with code `client_retry_budget_exceeded`.
78
+
79
+ ### Idempotency
80
+
81
+ For write operations, the nodes may send `x-idempotency-key`. Some create endpoints intentionally disable idempotency headers for compatibility; where idempotency is not used, retries rely on server-side uniqueness and/or client-side GET fallback.
82
+
83
+ ## Version History
84
+
85
+ - **0.2.0**: Switched Event Trigger to SSE streaming and updated MCP Client to invoke tools.
86
+ - **0.1.3**: Fixed `emit` call format and trigger activation race condition.
87
+ - **0.1.2**: Fixed event polling timeout and client initialization. Added cursor persistence.
88
+ - **0.1.1**: Fixed UI labels for node properties.
89
+ - **0.1.0**: Initial release.
@@ -0,0 +1,9 @@
1
+ import type { ICredentialTestRequest, ICredentialType, INodeProperties, Icon } from 'n8n-workflow';
2
+ export declare class KumihoApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ icon: Icon;
7
+ test: ICredentialTestRequest;
8
+ properties: INodeProperties[];
9
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KumihoApi = void 0;
4
+ class KumihoApi {
5
+ constructor() {
6
+ this.name = 'kumihoApi';
7
+ this.displayName = 'Kumiho API';
8
+ this.documentationUrl = 'https://kumiho.io/resources/n8n';
9
+ this.icon = 'file:kumiho.svg';
10
+ this.test = {
11
+ request: {
12
+ method: 'GET',
13
+ url: '={{$credentials.baseUrl}}/api/v1/tenant/whoami',
14
+ headers: {
15
+ 'X-Kumiho-Token': '={{$credentials.serviceToken}}',
16
+ 'x-tenant-id': '={{$credentials.tenantId}}',
17
+ },
18
+ },
19
+ };
20
+ this.properties = [
21
+ {
22
+ displayName: 'Base URL',
23
+ name: 'baseUrl',
24
+ type: 'string',
25
+ default: 'https://api.kumiho.cloud'
26
+ },
27
+ {
28
+ displayName: 'Service Token',
29
+ name: 'serviceToken',
30
+ type: 'string',
31
+ typeOptions: {
32
+ password: true
33
+ },
34
+ default: ''
35
+ },
36
+ {
37
+ displayName: 'Tenant ID (Optional)',
38
+ name: 'tenantId',
39
+ type: 'string',
40
+ default: '',
41
+ description: 'If your token does not contain a tenant_id claim, set this to your tenant id/slug so requests can be routed correctly.',
42
+ },
43
+ {
44
+ displayName: 'User Token (Optional)',
45
+ name: 'userToken',
46
+ type: 'string',
47
+ typeOptions: {
48
+ password: true,
49
+ },
50
+ default: '',
51
+ description: 'Optional end-user ID token (Authorization: Bearer ...) for user-scoped endpoints. Leave empty for service-token-only usage.',
52
+ }
53
+ ];
54
+ }
55
+ }
56
+ exports.KumihoApi = KumihoApi;
57
+ //# sourceMappingURL=KumihoApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KumihoApi.credentials.js","sourceRoot":"","sources":["../../credentials/KumihoApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAS;IAAtB;QACE,SAAI,GAAG,WAAW,CAAC;QACnB,gBAAW,GAAG,YAAY,CAAC;QAC3B,qBAAgB,GAAG,iCAAiC,CAAC;QACrD,SAAI,GAAS,iBAAiB,CAAC;QAC/B,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,gDAAgD;gBACrD,OAAO,EAAE;oBACP,gBAAgB,EAAE,gCAAgC;oBAClD,aAAa,EAAE,4BAA4B;iBAC5C;aACF;SACF,CAAC;QACF,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,0BAA0B;aACpC;YACD;gBACE,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;aACZ;YACD;gBACE,WAAW,EAAE,sBAAsB;gBACnC,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,wHAAwH;aACtI;YACD;gBACE,WAAW,EAAE,uBAAuB;gBACpC,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,6HAA6H;aAC3I;SACF,CAAC;IACJ,CAAC;CAAA;AAjDD,8BAiDC"}
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Kumiho">
2
+ <circle cx="32" cy="32" r="28" fill="currentColor"/>
3
+ <path d="M22 18h6v12l10-12h8L34 32l12 14h-8L28 34v12h-6V18z" fill="#fff"/>
4
+ </svg>
@@ -0,0 +1,5 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
+ export declare class KumihoAction implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }