n8n-nodes-cribops 0.1.24 → 0.2.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.
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HiveClient = void 0;
7
+ const ioredis_1 = __importDefault(require("ioredis"));
8
+ class HiveClient {
9
+ redis;
10
+ connected = false;
11
+ constructor(config) {
12
+ const options = {
13
+ host: config.host,
14
+ port: config.port,
15
+ password: config.password,
16
+ retryStrategy: (times) => {
17
+ if (times > 3)
18
+ return null;
19
+ return Math.min(times * 100, 3000);
20
+ },
21
+ };
22
+ if (config.tls) {
23
+ options.tls = {};
24
+ }
25
+ this.redis = new ioredis_1.default(options);
26
+ }
27
+ async connect() {
28
+ if (this.connected)
29
+ return;
30
+ // ioredis auto-connects, but we can verify with a ping
31
+ await this.redis.ping();
32
+ this.connected = true;
33
+ }
34
+ async disconnect() {
35
+ await this.redis.quit();
36
+ this.connected = false;
37
+ }
38
+ async execute(operation, payload) {
39
+ const jsonPayload = JSON.stringify(payload);
40
+ const result = await this.redis.call('HIVE.EXEC', operation, jsonPayload);
41
+ return JSON.parse(result);
42
+ }
43
+ async ping() {
44
+ return this.execute('ping', {});
45
+ }
46
+ async info() {
47
+ const result = await this.redis.call('HIVE.INFO');
48
+ return JSON.parse(result);
49
+ }
50
+ /**
51
+ * Execute multiple HTTP requests in parallel via Hive's Elixir Task.async_stream
52
+ */
53
+ async parallelHttp(requests, options) {
54
+ return this.execute('parallel_http', {
55
+ requests,
56
+ concurrency: options?.concurrency ?? 10,
57
+ timeout_ms: options?.timeout_ms ?? 30000,
58
+ });
59
+ }
60
+ /**
61
+ * Schedule a dynamic cron job via Oban Pro
62
+ */
63
+ async scheduleCron(config) {
64
+ return this.execute('schedule_cron', {
65
+ name: config.name,
66
+ expression: config.expression,
67
+ webhook_url: config.webhook_url,
68
+ payload: config.payload ?? {},
69
+ timezone: config.timezone ?? 'UTC',
70
+ });
71
+ }
72
+ /**
73
+ * Delete a dynamic cron job
74
+ */
75
+ async deleteCron(name) {
76
+ return this.execute('delete_cron', { name });
77
+ }
78
+ /**
79
+ * List all dynamic cron jobs
80
+ */
81
+ async listCrons() {
82
+ return this.execute('list_crons', {});
83
+ }
84
+ /**
85
+ * Fan-out a payload to multiple webhook endpoints in parallel
86
+ */
87
+ async fanout(endpoints, payload, options) {
88
+ return this.execute('fanout', {
89
+ endpoints,
90
+ payload,
91
+ timeout_ms: options?.timeout_ms ?? 10000,
92
+ });
93
+ }
94
+ /**
95
+ * Check if data is a duplicate (deduplication)
96
+ */
97
+ async dedupCheck(data, options) {
98
+ return this.execute('dedup_check', {
99
+ data,
100
+ ttl_seconds: options?.ttl_seconds ?? 300,
101
+ });
102
+ }
103
+ /**
104
+ * Check circuit breaker status and optionally record success/failure
105
+ */
106
+ async circuitCheck(service, recordResult) {
107
+ return this.execute('circuit_check', {
108
+ service,
109
+ record_result: recordResult,
110
+ });
111
+ }
112
+ }
113
+ exports.HiveClient = HiveClient;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "n8n-nodes-cribops",
3
- "version": "0.1.24",
4
- "description": "n8n community node for Cribops AI platform integration",
3
+ "version": "0.2.1",
4
+ "description": "n8n community node for reliable webhook processing with Cribops",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"
7
7
  ],
@@ -27,7 +27,7 @@
27
27
  "format": "prettier nodes credentials --write",
28
28
  "lint": "eslint nodes/**/*.ts credentials/**/*.ts --ext .ts",
29
29
  "lintfix": "eslint nodes/**/*.ts credentials/**/*.ts --ext .ts --fix",
30
- "prepublishOnly": "npm run build && npm run lint",
30
+ "prepublishOnly": "npm run build",
31
31
  "test": "npm run build && n8n-node-dev test"
32
32
  },
33
33
  "files": [
@@ -36,15 +36,21 @@
36
36
  "n8n": {
37
37
  "n8nNodesApiVersion": 1,
38
38
  "credentials": [
39
- "dist/credentials/CribopsApi.credentials.js"
39
+ "dist/credentials/CribopsApi.credentials.js",
40
+ "dist/credentials/HiveApi.credentials.js"
40
41
  ],
41
42
  "nodes": [
42
43
  "dist/nodes/Cribops/Cribops.node.js",
43
- "dist/nodes/CribopsTrigger/CribopsTrigger.node.js"
44
+ "dist/nodes/CribopsTrigger/CribopsTrigger.node.js",
45
+ "dist/nodes/HiveAccelerator/HiveAccelerator.node.js"
44
46
  ]
45
47
  },
48
+ "dependencies": {
49
+ "ioredis": "^5.4.1"
50
+ },
46
51
  "devDependencies": {
47
52
  "@types/node": "^24.0.12",
53
+ "@types/ioredis": "^4.28.10",
48
54
  "@typescript-eslint/parser": "~8.32.0",
49
55
  "eslint": "^8.57.0",
50
56
  "eslint-plugin-n8n-nodes-base": "^1.16.3",