n8n-nodes-botarmor 0.1.1 → 0.1.2

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.
@@ -6,6 +6,7 @@ class BotArmorApi {
6
6
  constructor() {
7
7
  this.name = 'botArmorApi';
8
8
  this.displayName = 'BotArmor API';
9
+ this.icon = { light: 'file:../icons/botarmor.svg', dark: 'file:../icons/botarmor.dark.svg' };
9
10
  this.documentationUrl = 'https://botarmor-arena.netlify.app';
10
11
  this.properties = [
11
12
  {
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><rect width="64" height="64" rx="14" fill="#0b1120"/><path d="M32 10 14 17v13c0 12 7.7 21.3 18 24 10.3-2.7 18-12 18-24V17L32 10z" fill="#22d3ee"/><text x="32" y="40" text-anchor="middle" font-family="Arial,Helvetica,sans-serif" font-weight="700" font-size="16" fill="#0b1120">BA</text></svg>
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BotArmor = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
4
5
  // Declarative node: every operation is one call to the BotArmor API, no runtime dependency.
5
6
  // Typical workflow: Start Audit -> Wait 10 min -> Get Status (loop while "running") -> IF gate.passed.
6
7
  const LEVELS = [
@@ -23,14 +24,14 @@ class BotArmor {
23
24
  this.description = {
24
25
  displayName: 'BotArmor',
25
26
  name: 'botArmor',
26
- icon: 'file:botarmor.svg',
27
+ icon: { light: 'file:../../icons/botarmor.svg', dark: 'file:../../icons/botarmor.dark.svg' },
27
28
  group: ['transform'],
28
29
  version: 1,
29
30
  subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
30
31
  description: 'Crash-test your chatbot with BotArmor AI and gate a workflow on its grade',
31
32
  defaults: { name: 'BotArmor' },
32
- inputs: ['main'],
33
- outputs: ['main'],
33
+ inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
34
+ outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
34
35
  usableAsTool: true,
35
36
  credentials: [{ name: 'botArmorApi', required: true }],
36
37
  requestDefaults: {
@@ -58,18 +59,13 @@ class BotArmor {
58
59
  displayOptions: { show: { resource: ['audit'] } },
59
60
  options: [
60
61
  {
61
- name: 'Start',
62
- value: 'start',
63
- action: 'Start an audit',
64
- description: 'Start a live audit of a registered agent (takes 10 to 20 minutes)',
65
- routing: { request: { method: 'POST', url: '/api/audits' } },
66
- },
67
- {
68
- name: 'Retest',
69
- value: 'retest',
70
- action: 'Retest after patches',
71
- description: 'Re-run a finished audit with the patched prompt; the report shows before/after',
72
- routing: { request: { method: 'POST', url: '=/api/audits/{{$parameter["auditCode"]}}/retest' } },
62
+ name: 'Get Many',
63
+ value: 'getAll',
64
+ action: 'List audits',
65
+ routing: {
66
+ request: { method: 'GET', url: '/api/audits' },
67
+ output: { postReceive: [{ type: 'rootProperty', properties: { property: 'audits' } }] },
68
+ },
73
69
  },
74
70
  {
75
71
  name: 'Get Status',
@@ -79,13 +75,18 @@ class BotArmor {
79
75
  routing: { request: { method: 'GET', url: '=/api/audits/{{$parameter["auditCode"]}}/status' } },
80
76
  },
81
77
  {
82
- name: 'Get Many',
83
- value: 'getAll',
84
- action: 'List audits',
85
- routing: {
86
- request: { method: 'GET', url: '/api/audits' },
87
- output: { postReceive: [{ type: 'rootProperty', properties: { property: 'audits' } }] },
88
- },
78
+ name: 'Retest',
79
+ value: 'retest',
80
+ action: 'Retest after patches',
81
+ description: 'Re-run a finished audit with the patched prompt; the report shows before/after',
82
+ routing: { request: { method: 'POST', url: '=/api/audits/{{$parameter["auditCode"]}}/retest' } },
83
+ },
84
+ {
85
+ name: 'Start',
86
+ value: 'start',
87
+ action: 'Start an audit',
88
+ description: 'Start a live audit of a registered agent (takes 10 to 20 minutes)',
89
+ routing: { request: { method: 'POST', url: '/api/audits' } },
89
90
  },
90
91
  {
91
92
  name: 'Verify Report',
@@ -155,29 +156,6 @@ class BotArmor {
155
156
  default: {},
156
157
  displayOptions: { show: { resource: ['audit'], operation: ['start'] } },
157
158
  options: [
158
- {
159
- displayName: 'Scenarios',
160
- name: 'levels',
161
- type: 'multiOptions',
162
- options: LEVELS,
163
- default: [],
164
- description: 'Attack scenarios to run (all when empty)',
165
- routing: { send: { type: 'body', property: 'levels' } },
166
- },
167
- {
168
- displayName: 'Report Language',
169
- name: 'lang',
170
- type: 'options',
171
- options: [
172
- { name: 'English', value: 'en' },
173
- { name: 'French', value: 'fr' },
174
- { name: 'German', value: 'de' },
175
- { name: 'Spanish', value: 'es' },
176
- ],
177
- default: 'fr',
178
- description: 'Language of the report, for whoever reads it',
179
- routing: { send: { type: 'body', property: 'lang' } },
180
- },
181
159
  {
182
160
  displayName: 'Bot Language',
183
161
  name: 'botLang',
@@ -196,6 +174,29 @@ class BotArmor {
196
174
  description: 'Language the attacker speaks to your bot. Can differ from the report language.',
197
175
  routing: { send: { type: 'body', property: 'bot_lang' } },
198
176
  },
177
+ {
178
+ displayName: 'Report Language',
179
+ name: 'lang',
180
+ type: 'options',
181
+ options: [
182
+ { name: 'English', value: 'en' },
183
+ { name: 'French', value: 'fr' },
184
+ { name: 'German', value: 'de' },
185
+ { name: 'Spanish', value: 'es' },
186
+ ],
187
+ default: 'fr',
188
+ description: 'Language of the report, for whoever reads it',
189
+ routing: { send: { type: 'body', property: 'lang' } },
190
+ },
191
+ {
192
+ displayName: 'Scenarios',
193
+ name: 'levels',
194
+ type: 'multiOptions',
195
+ options: LEVELS,
196
+ default: [],
197
+ description: 'Attack scenarios to run (all when empty)',
198
+ routing: { send: { type: 'body', property: 'levels' } },
199
+ },
199
200
  {
200
201
  displayName: 'Test Google Sheet ID',
201
202
  name: 'spreadsheetId',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-botarmor",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "n8n node for BotArmor AI: crash-test your chatbot (red-teaming audit), wait for the grade and stop a workflow when it is below your threshold.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",
@@ -20,12 +20,14 @@
20
20
  "url": "https://github.com/sidorenkav-collab/n8n-nodes-botarmor/issues"
21
21
  },
22
22
  "author": {
23
- "name": "BotArmor AI"
23
+ "name": "BotArmor AI",
24
+ "email": "sidorenkav@gmail.com"
24
25
  },
25
26
  "main": "index.js",
26
27
  "scripts": {
27
- "build": "tsc && node -e \"require('fs').cpSync('nodes/BotArmor/botarmor.svg','dist/nodes/BotArmor/botarmor.svg')\"",
28
- "prepublishOnly": "npm run build"
28
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc && node -e \"require('fs').cpSync('icons','dist/icons',{recursive:true})\"",
29
+ "lint": "n8n-node lint",
30
+ "prepublishOnly": "npm run lint && npm run build"
29
31
  },
30
32
  "files": [
31
33
  "dist"
@@ -40,6 +42,7 @@
40
42
  ]
41
43
  },
42
44
  "devDependencies": {
45
+ "@n8n/node-cli": "0.52.5",
43
46
  "n8n-workflow": "2.16.0",
44
47
  "typescript": "5.9.3"
45
48
  },
File without changes