n8n-nodes-kafka-batch-consumer 1.0.7

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/jest.config.js ADDED
@@ -0,0 +1,22 @@
1
+ module.exports = {
2
+ preset: 'ts-jest',
3
+ testEnvironment: 'node',
4
+ roots: ['<rootDir>/src'],
5
+ testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
6
+ collectCoverageFrom: [
7
+ 'src/**/*.ts',
8
+ '!src/**/*.test.ts',
9
+ '!src/**/*.spec.ts',
10
+ '!src/**/index.ts'
11
+ ],
12
+ coverageThreshold: {
13
+ global: {
14
+ branches: 80,
15
+ functions: 80,
16
+ lines: 80,
17
+ statements: 80
18
+ }
19
+ },
20
+ coverageDirectory: 'coverage',
21
+ verbose: true
22
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "n8n-nodes-kafka-batch-consumer",
3
+ "version": "1.0.7",
4
+ "description": "N8N node for consuming Kafka messages in batches",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "test": "jest",
9
+ "test:coverage": "jest --coverage",
10
+ "lint": "eslint . --ext .ts"
11
+ },
12
+ "keywords": [
13
+ "n8n",
14
+ "n8n-node",
15
+ "kafka",
16
+ "batch",
17
+ "consumer"
18
+ ],
19
+ "n8n": {
20
+ "n8nNodesApiVersion": 1,
21
+ "nodes": [
22
+ "dist/nodes/KafkaBatchConsumer/KafkaBatchConsumer.node.js"
23
+ ]
24
+ },
25
+ "author": "",
26
+ "license": "MIT",
27
+ "dependencies": {
28
+ "kafkajs": "^2.2.4",
29
+ "n8n-workflow": "^1.0.0"
30
+ },
31
+ "devDependencies": {
32
+ "@types/jest": "^29.5.11",
33
+ "@types/node": "^20.10.6",
34
+ "@typescript-eslint/eslint-plugin": "^6.17.0",
35
+ "@typescript-eslint/parser": "^6.17.0",
36
+ "eslint": "^8.56.0",
37
+ "jest": "^29.7.0",
38
+ "ts-jest": "^29.1.1",
39
+ "typescript": "^5.3.3"
40
+ }
41
+ }
package/run-tests.sh ADDED
@@ -0,0 +1,39 @@
1
+ #!/bin/bash
2
+
3
+ # N8N Kafka Batch Consumer - Test Runner
4
+ # This script installs dependencies and runs the test suite
5
+
6
+ echo "=========================================="
7
+ echo "N8N Kafka Batch Consumer - Test Suite"
8
+ echo "=========================================="
9
+ echo ""
10
+
11
+ # Install dependencies
12
+ echo "Installing dependencies..."
13
+ npm install
14
+
15
+ if [ $? -ne 0 ]; then
16
+ echo "❌ Failed to install dependencies"
17
+ exit 1
18
+ fi
19
+
20
+ echo ""
21
+ echo "✅ Dependencies installed successfully"
22
+ echo ""
23
+
24
+ # Run tests with coverage
25
+ echo "Running tests with coverage..."
26
+ npm run test:coverage
27
+
28
+ if [ $? -ne 0 ]; then
29
+ echo ""
30
+ echo "❌ Tests failed"
31
+ exit 1
32
+ fi
33
+
34
+ echo ""
35
+ echo "=========================================="
36
+ echo "✅ All tests passed!"
37
+ echo "=========================================="
38
+ echo ""
39
+ echo "Coverage report available in ./coverage directory"
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './nodes/KafkaBatchConsumer/KafkaBatchConsumer.node';