n8n-nodes-8kit 1.0.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 +146 -0
- package/dist/credentials/EightKitApi.credentials.js +52 -0
- package/dist/credentials/EightKitApi.credentials.js.map +1 -0
- package/dist/nodes/EightKit/8kit.svg +1 -0
- package/dist/nodes/EightKit/EightKit.node.js +885 -0
- package/dist/nodes/EightKit/EightKit.node.js.map +1 -0
- package/dist/nodes/EightKit/index.js +6 -0
- package/dist/nodes/EightKit/index.js.map +1 -0
- package/dist/nodes/EightKit/operations/acquireLock.js +23 -0
- package/dist/nodes/EightKit/operations/acquireLock.js.map +1 -0
- package/dist/nodes/EightKit/operations/addToLookup.js +73 -0
- package/dist/nodes/EightKit/operations/addToLookup.js.map +1 -0
- package/dist/nodes/EightKit/operations/addToSet.js +66 -0
- package/dist/nodes/EightKit/operations/addToSet.js.map +1 -0
- package/dist/nodes/EightKit/operations/checkLock.js +16 -0
- package/dist/nodes/EightKit/operations/checkLock.js.map +1 -0
- package/dist/nodes/EightKit/operations/checkSetValues.js +90 -0
- package/dist/nodes/EightKit/operations/checkSetValues.js.map +1 -0
- package/dist/nodes/EightKit/operations/createLastUpdated.js +27 -0
- package/dist/nodes/EightKit/operations/createLastUpdated.js.map +1 -0
- package/dist/nodes/EightKit/operations/createLookup.js +35 -0
- package/dist/nodes/EightKit/operations/createLookup.js.map +1 -0
- package/dist/nodes/EightKit/operations/createSet.js +35 -0
- package/dist/nodes/EightKit/operations/createSet.js.map +1 -0
- package/dist/nodes/EightKit/operations/getAppHealth.js +15 -0
- package/dist/nodes/EightKit/operations/getAppHealth.js.map +1 -0
- package/dist/nodes/EightKit/operations/getAppInfo.js +15 -0
- package/dist/nodes/EightKit/operations/getAppInfo.js.map +1 -0
- package/dist/nodes/EightKit/operations/getLastUpdated.js +16 -0
- package/dist/nodes/EightKit/operations/getLastUpdated.js.map +1 -0
- package/dist/nodes/EightKit/operations/getLookupValues.js +44 -0
- package/dist/nodes/EightKit/operations/getLookupValues.js.map +1 -0
- package/dist/nodes/EightKit/operations/getSetInfo.js +30 -0
- package/dist/nodes/EightKit/operations/getSetInfo.js.map +1 -0
- package/dist/nodes/EightKit/operations/getSetValues.js +44 -0
- package/dist/nodes/EightKit/operations/getSetValues.js.map +1 -0
- package/dist/nodes/EightKit/operations/index.js +42 -0
- package/dist/nodes/EightKit/operations/index.js.map +1 -0
- package/dist/nodes/EightKit/operations/listLookups.js +41 -0
- package/dist/nodes/EightKit/operations/listLookups.js.map +1 -0
- package/dist/nodes/EightKit/operations/listSets.js +41 -0
- package/dist/nodes/EightKit/operations/listSets.js.map +1 -0
- package/dist/nodes/EightKit/operations/releaseLock.js +16 -0
- package/dist/nodes/EightKit/operations/releaseLock.js.map +1 -0
- package/dist/nodes/EightKit/operations/removeFromLookup.js +52 -0
- package/dist/nodes/EightKit/operations/removeFromLookup.js.map +1 -0
- package/dist/nodes/EightKit/operations/removeFromSet.js +52 -0
- package/dist/nodes/EightKit/operations/removeFromSet.js.map +1 -0
- package/dist/nodes/EightKit/utils/common.js +74 -0
- package/dist/nodes/EightKit/utils/common.js.map +1 -0
- package/dist/nodes/EightKit/utils/httpClient.js +177 -0
- package/dist/nodes/EightKit/utils/httpClient.js.map +1 -0
- package/package.json +67 -0
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
## 8kit n8n Nodes
|
|
2
|
+
|
|
3
|
+
Community nodes for integrating n8n with the 8kit Open Source API. Use these to build reliable, idempotent workflows: prevent duplicates with Sets, map cross-system IDs with Lookups, read app info/health, and coordinate concurrency with Locks.
|
|
4
|
+
|
|
5
|
+
For detailed, per-operation docs, see the local docs folder: `./docs`.
|
|
6
|
+
|
|
7
|
+
### Highlights
|
|
8
|
+
- Set tracking to avoid re-processing
|
|
9
|
+
- Lookup mapping for cross-system IDs
|
|
10
|
+
- Lightweight locks for safe concurrency
|
|
11
|
+
- App info and health endpoints
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Operations
|
|
16
|
+
|
|
17
|
+
All operations live under `nodes/EightKit/operations` and are available from the EightKit node in the n8n UI.
|
|
18
|
+
|
|
19
|
+
- App
|
|
20
|
+
- `getAppInfo`
|
|
21
|
+
- `getAppHealth`
|
|
22
|
+
- Locks
|
|
23
|
+
- `acquireLock`
|
|
24
|
+
- `checkLock`
|
|
25
|
+
- `releaseLock`
|
|
26
|
+
- Sets
|
|
27
|
+
- `createSet`
|
|
28
|
+
- `listSets`
|
|
29
|
+
- `getSetInfo`
|
|
30
|
+
- `getSetValues`
|
|
31
|
+
- `addToSet`
|
|
32
|
+
- `removeFromSet`
|
|
33
|
+
- `checkSetValues`
|
|
34
|
+
- Lookups
|
|
35
|
+
- `createLookup`
|
|
36
|
+
- `listLookups`
|
|
37
|
+
- `getLookupValues`
|
|
38
|
+
- `addToLookup`
|
|
39
|
+
- `removeFromLookup`
|
|
40
|
+
|
|
41
|
+
Each operation’s usage, parameters, and examples are documented in `./docs` (for example: `./docs/add-to-set.md`, `./docs/check-set-values.md`).
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Credentials
|
|
46
|
+
|
|
47
|
+
Use `EightKitApi` credentials:
|
|
48
|
+
- Host: Base URL of your 8kit API (e.g., `http://localhost:3000`)
|
|
49
|
+
- API Key: From your 8kit app (`X-API-Key` header)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Installation
|
|
54
|
+
|
|
55
|
+
Option A: Docker (recommended)
|
|
56
|
+
1) Build the nodes
|
|
57
|
+
```bash
|
|
58
|
+
pnpm i && pnpm build
|
|
59
|
+
```
|
|
60
|
+
2) Start n8n with the included compose file
|
|
61
|
+
```bash
|
|
62
|
+
./start-n8n.sh
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Option B: Local n8n custom nodes
|
|
66
|
+
1) Build
|
|
67
|
+
```bash
|
|
68
|
+
pnpm i && pnpm build
|
|
69
|
+
```
|
|
70
|
+
2) Copy the dist to your n8n custom nodes directory
|
|
71
|
+
```bash
|
|
72
|
+
cp -r dist ~/.n8n/custom/
|
|
73
|
+
```
|
|
74
|
+
3) Restart n8n
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Project Structure
|
|
79
|
+
```
|
|
80
|
+
n8n-node/
|
|
81
|
+
├─ nodes/
|
|
82
|
+
│ └─ EightKit/
|
|
83
|
+
│ ├─ EightKit.node.ts
|
|
84
|
+
│ ├─ operations/
|
|
85
|
+
│ │ ├─ acquireLock.ts
|
|
86
|
+
│ │ ├─ releaseLock.ts
|
|
87
|
+
│ │ ├─ checkLock.ts
|
|
88
|
+
│ │ ├─ getAppInfo.ts
|
|
89
|
+
│ │ ├─ getAppHealth.ts
|
|
90
|
+
│ │ ├─ createSet.ts
|
|
91
|
+
│ │ ├─ listSets.ts
|
|
92
|
+
│ │ ├─ getSetInfo.ts
|
|
93
|
+
│ │ ├─ getSetValues.ts
|
|
94
|
+
│ │ ├─ addToSet.ts
|
|
95
|
+
│ │ ├─ removeFromSet.ts
|
|
96
|
+
│ │ ├─ checkSetValues.ts
|
|
97
|
+
│ │ ├─ createLookup.ts
|
|
98
|
+
│ │ ├─ listLookups.ts
|
|
99
|
+
│ │ ├─ getLookupValues.ts
|
|
100
|
+
│ │ ├─ addToLookup.ts
|
|
101
|
+
│ │ └─ removeFromLookup.ts
|
|
102
|
+
│ └─ utils/
|
|
103
|
+
│ ├─ httpClient.ts
|
|
104
|
+
│ └─ common.ts
|
|
105
|
+
├─ credentials/
|
|
106
|
+
│ └─ EightKitApi.credentials.ts
|
|
107
|
+
├─ docs/
|
|
108
|
+
├─ __tests__/
|
|
109
|
+
└─ package.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Development
|
|
115
|
+
|
|
116
|
+
Scripts (use bun or pnpm):
|
|
117
|
+
- `pnpm build` – build the nodes
|
|
118
|
+
- `pnpm dev` – watch mode
|
|
119
|
+
- `pnpm test` – run unit tests
|
|
120
|
+
- `pnpm lint` – lint
|
|
121
|
+
|
|
122
|
+
Testing focuses on operation executors under `__tests__/operations/*`. See the examples there for mocking `IExecuteFunctions` and HTTP calls.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Examples
|
|
127
|
+
|
|
128
|
+
Common use cases:
|
|
129
|
+
- Prevent duplicate order processing
|
|
130
|
+
- Maintain ERP ↔ Shopify ID mappings
|
|
131
|
+
- Serialize concurrent jobs with locks
|
|
132
|
+
|
|
133
|
+
See `./docs` for step-by-step guides and input/output examples for each operation.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT. See `LICENSE`.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Support
|
|
144
|
+
|
|
145
|
+
- Issues: open an issue in this repo
|
|
146
|
+
- Docs: local `./docs` directory contains per-operation guides
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EightKitApi = void 0;
|
|
4
|
+
class EightKitApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'eightKitApi';
|
|
7
|
+
this.displayName = '8kit API';
|
|
8
|
+
this.documentationUrl = 'https://github.com/stratagems-com/stratagems-tools-open-source';
|
|
9
|
+
this.iconUrl = 'file:8kit.svg';
|
|
10
|
+
this.properties = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Host URL',
|
|
13
|
+
name: 'hostUrl',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: 'https://api.yourdomain.com',
|
|
16
|
+
placeholder: 'https://api.yourdomain.com',
|
|
17
|
+
description: 'Base URL of your 8kit API instance',
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
displayName: 'API Key',
|
|
22
|
+
name: 'apiKey',
|
|
23
|
+
type: 'string',
|
|
24
|
+
typeOptions: {
|
|
25
|
+
password: true,
|
|
26
|
+
},
|
|
27
|
+
default: '',
|
|
28
|
+
placeholder: 'st_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
|
|
29
|
+
description: 'Your application API key (starts with st_)',
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
this.authenticate = {
|
|
34
|
+
type: 'generic',
|
|
35
|
+
properties: {
|
|
36
|
+
headers: {
|
|
37
|
+
'X-Api-Key': '={{$credentials.apiKey}}',
|
|
38
|
+
'Content-Type': 'application/json',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
this.test = {
|
|
43
|
+
request: {
|
|
44
|
+
baseURL: '={{$credentials.hostUrl}}',
|
|
45
|
+
url: '/api/v1/apps/health',
|
|
46
|
+
method: 'GET',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.EightKitApi = EightKitApi;
|
|
52
|
+
//# sourceMappingURL=EightKitApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EightKitApi.credentials.js","sourceRoot":"","sources":["../../credentials/EightKitApi.credentials.ts"],"names":[],"mappings":";;;AAOA,MAAa,WAAW;IAAxB;QACE,SAAI,GAAG,aAAa,CAAC;QACrB,gBAAW,GAAG,UAAU,CAAC;QACzB,qBAAgB,GAAG,gEAAgE,CAAC;QACpF,YAAO,GAAG,eAAe,CAAC;QAC1B,eAAU,GAAsB;YAC9B;gBACE,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,4BAA4B;gBACrC,WAAW,EAAE,4BAA4B;gBACzC,WAAW,EAAE,oCAAoC;gBACjD,QAAQ,EAAE,IAAI;aACf;YACD;gBACE,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACX,QAAQ,EAAE,IAAI;iBACf;gBACD,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,qCAAqC;gBAClD,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;QAEF,iBAAY,GAAyB;YACnC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,WAAW,EAAE,0BAA0B;oBACvC,cAAc,EAAE,kBAAkB;iBACnC;aACF;SACF,CAAC;QAEF,SAAI,GAA2B;YAC7B,OAAO,EAAE;gBACP,OAAO,EAAE,2BAA2B;gBACpC,GAAG,EAAE,qBAAqB;gBAC1B,MAAM,EAAE,KAAK;aACd;SACF,CAAC;IACJ,CAAC;CAAA;AA9CD,kCA8CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 408.07 192.41"><defs><linearGradient id="a" x1="55.79" y1="103.24" x2="56.33" y2="103.24" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#da3c47"/><stop offset="1" stop-color="#f28336"/></linearGradient><linearGradient id="c" x1="0" y1="96.2" x2="116.77" y2="96.2" xlink:href="#a"/><linearGradient id="b" x1="195.43" y1="189.44" x2="195.43" y2="13.42" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#f09b9e"/><stop offset="1" stop-color="#f5ebe4"/></linearGradient><linearGradient id="d" x1="290.57" x2="290.57" y2="2.74" xlink:href="#b"/><linearGradient id="e" x1="368.71" y1="190.06" x2="368.71" y2="25.08" xlink:href="#b"/><linearGradient id="f" x1="55.79" xlink:href="#a"/></defs><g data-name="Layer 1"><path d="M55.85 103.25c-.17.14.01.1.48-.09-.21-.03-.37 0-.48.09Z" style="fill:url(#a)"/><path d="M72.95.64C19.82-7.42-10.1 62.22 36.14 92.53c-51.55 13.96-46.36 89.62 5.44 98.83 53.42 10.32 85.2-58.53 40.51-91.13C132.92 80.92 126.18 9.31 72.95.64Zm-3.5 117.24c32.58 27.15-6.09 70.55-37.55 46.02-17.73-14.13-13.01-44.09 9.33-50.39 1.15-.48 14.4-5.78 15.15-5.94m-5.45-2.67c.11-.09.28-.12.49-.09-.48.2-.67.24-.49.09Zm44.61-49.16c-1.9 18.04-19.94 23.75-34.73 28.28-12.87-8.2-27.9-17.89-26.12-35.33 5.29-39.83 64.79-32.94 60.85 7.05Z" style="fill:url(#c)"/><path d="m212.79 189.44-44.72-56.13v56.13h-33.3V13.42h33.3v100.14l44.24-55.9h43.29l-58.04 66.12 58.51 65.65h-43.29Z" style="fill:url(#b)"/><path d="M275.94 36.37C257.12 16.79 286.37-8.94 305.2 8.54c18.82 19.59-10.44 45.31-29.26 27.83Zm31.04 21.29v131.77h-33.3V57.66h33.3Z" style="fill:url(#d)"/><path d="M378.58 85.02c1.34 6.98-3.38 69.5 3.21 73.38 4.13 4.58 20.09 2.55 26.29 2.97v28.07c-84.38 7.04-59.04-46.76-63.03-104.42h-15.7V57.67h15.7V25.08h33.54v32.59h29.49v27.35h-29.49Z" style="fill:url(#e)"/><path d="M56.33 103.16c-.47.19-.65.23-.48.09.11-.09.27-.12.48-.09Z" style="fill:url(#f)"/></g></svg>
|