n8n-nodes-okrunit 0.1.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.
Files changed (30) hide show
  1. package/README.md +71 -0
  2. package/credentials/GatekeeperApi.credentials.ts +44 -0
  3. package/credentials/GatekeeperOAuth2Api.credentials.ts +56 -0
  4. package/dist/credentials/GatekeeperApi.credentials.d.ts +25 -0
  5. package/dist/credentials/GatekeeperApi.credentials.d.ts.map +1 -0
  6. package/dist/credentials/GatekeeperApi.credentials.js +46 -0
  7. package/dist/credentials/GatekeeperApi.credentials.js.map +1 -0
  8. package/dist/credentials/GatekeeperOAuth2Api.credentials.d.ts +9 -0
  9. package/dist/credentials/GatekeeperOAuth2Api.credentials.d.ts.map +1 -0
  10. package/dist/credentials/GatekeeperOAuth2Api.credentials.js +59 -0
  11. package/dist/credentials/GatekeeperOAuth2Api.credentials.js.map +1 -0
  12. package/dist/index.d.ts +5 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +12 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/nodes/Gatekeeper/Gatekeeper.node.d.ts +6 -0
  17. package/dist/nodes/Gatekeeper/Gatekeeper.node.d.ts.map +1 -0
  18. package/dist/nodes/Gatekeeper/Gatekeeper.node.js +366 -0
  19. package/dist/nodes/Gatekeeper/Gatekeeper.node.js.map +1 -0
  20. package/dist/nodes/Gatekeeper/GatekeeperTrigger.node.d.ts +6 -0
  21. package/dist/nodes/Gatekeeper/GatekeeperTrigger.node.d.ts.map +1 -0
  22. package/dist/nodes/Gatekeeper/GatekeeperTrigger.node.js +169 -0
  23. package/dist/nodes/Gatekeeper/GatekeeperTrigger.node.js.map +1 -0
  24. package/index.ts +4 -0
  25. package/nodes/Gatekeeper/Gatekeeper.node.json +17 -0
  26. package/nodes/Gatekeeper/Gatekeeper.node.ts +415 -0
  27. package/nodes/Gatekeeper/GatekeeperTrigger.node.ts +206 -0
  28. package/nodes/Gatekeeper/gatekeeper.svg +16 -0
  29. package/package.json +38 -0
  30. package/tsconfig.json +26 -0
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # n8n-nodes-okrunit
2
+
3
+ n8n community node for [OKRunit](https://github.com/your-org/okrunit) — a human-in-the-loop approval gateway for AI agents and automation platforms.
4
+
5
+ ## Installation
6
+
7
+ ### Community Node (recommended)
8
+
9
+ 1. In n8n, go to **Settings > Community Nodes**
10
+ 2. Enter `n8n-nodes-okrunit`
11
+ 3. Click **Install**
12
+
13
+ ### Manual Installation
14
+
15
+ ```bash
16
+ cd ~/.n8n
17
+ npm install n8n-nodes-okrunit
18
+ ```
19
+
20
+ ## Credentials
21
+
22
+ 1. In OKRunit, go to **Connections** and create a new API connection
23
+ 2. Copy the API key (shown only once)
24
+ 3. In n8n, create a new **OKRunit API** credential with:
25
+ - **API Key**: Your `gk_...` key
26
+ - **Base URL**: Your OKRunit instance URL
27
+
28
+ ## Operations
29
+
30
+ ### Approval
31
+
32
+ | Operation | Description |
33
+ |-----------|-------------|
34
+ | **Create** | Submit a new approval request for human review |
35
+ | **Get** | Fetch an approval request by ID |
36
+ | **List** | List/search approval requests with filters |
37
+
38
+ ### Comment
39
+
40
+ | Operation | Description |
41
+ |-----------|-------------|
42
+ | **Add** | Add a comment to an approval request |
43
+ | **List** | List all comments on an approval request |
44
+
45
+ ### Trigger
46
+
47
+ | Trigger | Description |
48
+ |---------|-------------|
49
+ | **Approval Decided** | Fires when an approval is approved or rejected (polling) |
50
+
51
+ ## Development
52
+
53
+ ```bash
54
+ cd integrations/n8n
55
+ npm install
56
+ npm run build
57
+
58
+ # Link to local n8n for testing
59
+ npm link
60
+ cd ~/.n8n
61
+ npm link n8n-nodes-okrunit
62
+ # Restart n8n
63
+ ```
64
+
65
+ ## Publishing
66
+
67
+ ```bash
68
+ npm publish
69
+ ```
70
+
71
+ Then submit for verification at the [n8n Creator Portal](https://creators.n8n.io).
@@ -0,0 +1,44 @@
1
+ import type { ICredentialType, INodeProperties } from "n8n-workflow";
2
+
3
+ export class GatekeeperApi implements ICredentialType {
4
+ name = "gatekeeperApi";
5
+ displayName = "OKRunit API";
6
+ documentationUrl = "https://github.com/your-org/okrunit/tree/main/integrations/n8n";
7
+
8
+ properties: INodeProperties[] = [
9
+ {
10
+ displayName: "API Key",
11
+ name: "apiKey",
12
+ type: "string",
13
+ typeOptions: { password: true },
14
+ default: "",
15
+ placeholder: "gk_...",
16
+ description: "Your OKRunit API key (starts with gk_)",
17
+ },
18
+ {
19
+ displayName: "Base URL",
20
+ name: "baseUrl",
21
+ type: "string",
22
+ default: "https://okrunit.example.com",
23
+ placeholder: "https://okrunit.example.com",
24
+ description: "The base URL of your OKRunit instance",
25
+ },
26
+ ];
27
+
28
+ authenticate = {
29
+ type: "generic" as const,
30
+ properties: {
31
+ headers: {
32
+ Authorization: "=Bearer {{$credentials.apiKey}}",
33
+ },
34
+ },
35
+ };
36
+
37
+ test = {
38
+ request: {
39
+ baseURL: "={{$credentials.baseUrl}}",
40
+ url: "/api/v1/approvals",
41
+ qs: { page_size: "1" },
42
+ },
43
+ };
44
+ }
@@ -0,0 +1,56 @@
1
+ import type { ICredentialType, INodeProperties } from "n8n-workflow";
2
+
3
+ export class GatekeeperOAuth2Api implements ICredentialType {
4
+ name = "gatekeeperOAuth2Api";
5
+ displayName = "OKRunit OAuth2 API";
6
+ extends = ["oAuth2Api"];
7
+ documentationUrl =
8
+ "https://github.com/your-org/okrunit/tree/main/integrations/n8n";
9
+
10
+ properties: INodeProperties[] = [
11
+ {
12
+ displayName: "Base URL",
13
+ name: "baseUrl",
14
+ type: "string",
15
+ default: "https://okrunit.example.com",
16
+ placeholder: "https://okrunit.example.com",
17
+ description: "The base URL of your OKRunit instance",
18
+ },
19
+ {
20
+ displayName: "Grant Type",
21
+ name: "grantType",
22
+ type: "hidden",
23
+ default: "authorizationCode",
24
+ },
25
+ {
26
+ displayName: "Authorization URL",
27
+ name: "authUrl",
28
+ type: "hidden",
29
+ default: "={{$self.baseUrl}}/oauth/authorize",
30
+ },
31
+ {
32
+ displayName: "Access Token URL",
33
+ name: "accessTokenUrl",
34
+ type: "hidden",
35
+ default: "={{$self.baseUrl}}/api/v1/oauth/token",
36
+ },
37
+ {
38
+ displayName: "Scope",
39
+ name: "scope",
40
+ type: "hidden",
41
+ default: "approvals:read approvals:write comments:write",
42
+ },
43
+ {
44
+ displayName: "Auth URI Query Parameters",
45
+ name: "authQueryParameters",
46
+ type: "hidden",
47
+ default: "",
48
+ },
49
+ {
50
+ displayName: "Authentication",
51
+ name: "authentication",
52
+ type: "hidden",
53
+ default: "body",
54
+ },
55
+ ];
56
+ }
@@ -0,0 +1,25 @@
1
+ import type { ICredentialType, INodeProperties } from "n8n-workflow";
2
+ export declare class GatekeeperApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: {
8
+ type: "generic";
9
+ properties: {
10
+ headers: {
11
+ Authorization: string;
12
+ };
13
+ };
14
+ };
15
+ test: {
16
+ request: {
17
+ baseURL: string;
18
+ url: string;
19
+ qs: {
20
+ page_size: string;
21
+ };
22
+ };
23
+ };
24
+ }
25
+ //# sourceMappingURL=GatekeeperApi.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatekeeperApi.credentials.d.ts","sourceRoot":"","sources":["../../credentials/GatekeeperApi.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAErE,qBAAa,aAAc,YAAW,eAAe;IACnD,IAAI,SAAmB;IACvB,WAAW,SAAiB;IAC5B,gBAAgB,SAAoE;IAEpF,UAAU,EAAE,eAAe,EAAE,CAkB3B;IAEF,YAAY;;;;;;;MAOV;IAEF,IAAI;;;;;;;;MAMF;CACH"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GatekeeperApi = void 0;
4
+ class GatekeeperApi {
5
+ constructor() {
6
+ this.name = "gatekeeperApi";
7
+ this.displayName = "OKRunit API";
8
+ this.documentationUrl = "https://github.com/your-org/okrunit/tree/main/integrations/n8n";
9
+ this.properties = [
10
+ {
11
+ displayName: "API Key",
12
+ name: "apiKey",
13
+ type: "string",
14
+ typeOptions: { password: true },
15
+ default: "",
16
+ placeholder: "gk_...",
17
+ description: "Your OKRunit API key (starts with gk_)",
18
+ },
19
+ {
20
+ displayName: "Base URL",
21
+ name: "baseUrl",
22
+ type: "string",
23
+ default: "https://okrunit.example.com",
24
+ placeholder: "https://okrunit.example.com",
25
+ description: "The base URL of your OKRunit instance",
26
+ },
27
+ ];
28
+ this.authenticate = {
29
+ type: "generic",
30
+ properties: {
31
+ headers: {
32
+ Authorization: "=Bearer {{$credentials.apiKey}}",
33
+ },
34
+ },
35
+ };
36
+ this.test = {
37
+ request: {
38
+ baseURL: "={{$credentials.baseUrl}}",
39
+ url: "/api/v1/approvals",
40
+ qs: { page_size: "1" },
41
+ },
42
+ };
43
+ }
44
+ }
45
+ exports.GatekeeperApi = GatekeeperApi;
46
+ //# sourceMappingURL=GatekeeperApi.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatekeeperApi.credentials.js","sourceRoot":"","sources":["../../credentials/GatekeeperApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,aAAa;IAA1B;QACE,SAAI,GAAG,eAAe,CAAC;QACvB,gBAAW,GAAG,aAAa,CAAC;QAC5B,qBAAgB,GAAG,gEAAgE,CAAC;QAEpF,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/B,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,QAAQ;gBACrB,WAAW,EAAE,wCAAwC;aACtD;YACD;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6BAA6B;gBACtC,WAAW,EAAE,6BAA6B;gBAC1C,WAAW,EAAE,uCAAuC;aACrD;SACF,CAAC;QAEF,iBAAY,GAAG;YACb,IAAI,EAAE,SAAkB;YACxB,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,aAAa,EAAE,iCAAiC;iBACjD;aACF;SACF,CAAC;QAEF,SAAI,GAAG;YACL,OAAO,EAAE;gBACP,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,mBAAmB;gBACxB,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE;aACvB;SACF,CAAC;IACJ,CAAC;CAAA;AAzCD,sCAyCC"}
@@ -0,0 +1,9 @@
1
+ import type { ICredentialType, INodeProperties } from "n8n-workflow";
2
+ export declare class GatekeeperOAuth2Api implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ extends: string[];
6
+ documentationUrl: string;
7
+ properties: INodeProperties[];
8
+ }
9
+ //# sourceMappingURL=GatekeeperOAuth2Api.credentials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatekeeperOAuth2Api.credentials.d.ts","sourceRoot":"","sources":["../../credentials/GatekeeperOAuth2Api.credentials.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAErE,qBAAa,mBAAoB,YAAW,eAAe;IACzD,IAAI,SAAyB;IAC7B,WAAW,SAAwB;IACnC,OAAO,WAAiB;IACxB,gBAAgB,SACmD;IAEnE,UAAU,EAAE,eAAe,EAAE,CA6C3B;CACH"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GatekeeperOAuth2Api = void 0;
4
+ class GatekeeperOAuth2Api {
5
+ constructor() {
6
+ this.name = "gatekeeperOAuth2Api";
7
+ this.displayName = "OKRunit OAuth2 API";
8
+ this.extends = ["oAuth2Api"];
9
+ this.documentationUrl = "https://github.com/your-org/okrunit/tree/main/integrations/n8n";
10
+ this.properties = [
11
+ {
12
+ displayName: "Base URL",
13
+ name: "baseUrl",
14
+ type: "string",
15
+ default: "https://okrunit.example.com",
16
+ placeholder: "https://okrunit.example.com",
17
+ description: "The base URL of your OKRunit instance",
18
+ },
19
+ {
20
+ displayName: "Grant Type",
21
+ name: "grantType",
22
+ type: "hidden",
23
+ default: "authorizationCode",
24
+ },
25
+ {
26
+ displayName: "Authorization URL",
27
+ name: "authUrl",
28
+ type: "hidden",
29
+ default: "={{$self.baseUrl}}/oauth/authorize",
30
+ },
31
+ {
32
+ displayName: "Access Token URL",
33
+ name: "accessTokenUrl",
34
+ type: "hidden",
35
+ default: "={{$self.baseUrl}}/api/v1/oauth/token",
36
+ },
37
+ {
38
+ displayName: "Scope",
39
+ name: "scope",
40
+ type: "hidden",
41
+ default: "approvals:read approvals:write comments:write",
42
+ },
43
+ {
44
+ displayName: "Auth URI Query Parameters",
45
+ name: "authQueryParameters",
46
+ type: "hidden",
47
+ default: "",
48
+ },
49
+ {
50
+ displayName: "Authentication",
51
+ name: "authentication",
52
+ type: "hidden",
53
+ default: "body",
54
+ },
55
+ ];
56
+ }
57
+ }
58
+ exports.GatekeeperOAuth2Api = GatekeeperOAuth2Api;
59
+ //# sourceMappingURL=GatekeeperOAuth2Api.credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GatekeeperOAuth2Api.credentials.js","sourceRoot":"","sources":["../../credentials/GatekeeperOAuth2Api.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAAhC;QACE,SAAI,GAAG,qBAAqB,CAAC;QAC7B,gBAAW,GAAG,oBAAoB,CAAC;QACnC,YAAO,GAAG,CAAC,WAAW,CAAC,CAAC;QACxB,qBAAgB,GACd,gEAAgE,CAAC;QAEnE,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,6BAA6B;gBACtC,WAAW,EAAE,6BAA6B;gBAC1C,WAAW,EAAE,uCAAuC;aACrD;YACD;gBACE,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,WAAW;gBACjB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,mBAAmB;aAC7B;YACD;gBACE,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,oCAAoC;aAC9C;YACD;gBACE,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,uCAAuC;aACjD;YACD;gBACE,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,+CAA+C;aACzD;YACD;gBACE,WAAW,EAAE,2BAA2B;gBACxC,IAAI,EAAE,qBAAqB;gBAC3B,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACZ;YACD;gBACE,WAAW,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,gBAAgB;gBACtB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,MAAM;aAChB;SACF,CAAC;IACJ,CAAC;CAAA;AArDD,kDAqDC"}
@@ -0,0 +1,5 @@
1
+ export { GatekeeperApi } from "./credentials/GatekeeperApi.credentials";
2
+ export { GatekeeperOAuth2Api } from "./credentials/GatekeeperOAuth2Api.credentials";
3
+ export { Gatekeeper } from "./nodes/Gatekeeper/Gatekeeper.node";
4
+ export { GatekeeperTrigger } from "./nodes/Gatekeeper/GatekeeperTrigger.node";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GatekeeperTrigger = exports.Gatekeeper = exports.GatekeeperOAuth2Api = exports.GatekeeperApi = void 0;
4
+ var GatekeeperApi_credentials_1 = require("./credentials/GatekeeperApi.credentials");
5
+ Object.defineProperty(exports, "GatekeeperApi", { enumerable: true, get: function () { return GatekeeperApi_credentials_1.GatekeeperApi; } });
6
+ var GatekeeperOAuth2Api_credentials_1 = require("./credentials/GatekeeperOAuth2Api.credentials");
7
+ Object.defineProperty(exports, "GatekeeperOAuth2Api", { enumerable: true, get: function () { return GatekeeperOAuth2Api_credentials_1.GatekeeperOAuth2Api; } });
8
+ var Gatekeeper_node_1 = require("./nodes/Gatekeeper/Gatekeeper.node");
9
+ Object.defineProperty(exports, "Gatekeeper", { enumerable: true, get: function () { return Gatekeeper_node_1.Gatekeeper; } });
10
+ var GatekeeperTrigger_node_1 = require("./nodes/Gatekeeper/GatekeeperTrigger.node");
11
+ Object.defineProperty(exports, "GatekeeperTrigger", { enumerable: true, get: function () { return GatekeeperTrigger_node_1.GatekeeperTrigger; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;AAAA,qFAAwE;AAA/D,0HAAA,aAAa,OAAA;AACtB,iGAAoF;AAA3E,sIAAA,mBAAmB,OAAA;AAC5B,sEAAgE;AAAvD,6GAAA,UAAU,OAAA;AACnB,oFAA8E;AAArE,2HAAA,iBAAiB,OAAA"}
@@ -0,0 +1,6 @@
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
2
+ export declare class Gatekeeper implements INodeType {
3
+ description: INodeTypeDescription;
4
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
+ }
6
+ //# sourceMappingURL=Gatekeeper.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Gatekeeper.node.d.ts","sourceRoot":"","sources":["../../../nodes/Gatekeeper/Gatekeeper.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,iBAAiB,EACjB,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAEtB,qBAAa,UAAW,YAAW,SAAS;IAC1C,WAAW,EAAE,oBAAoB,CA0Q/B;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAyIxE"}