@apiverve/n8n-nodes-apiverve 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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 EvlarSoft LLC and APIVerve
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,390 @@
1
+ # n8n-nodes-apiverve
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@apiverve/n8n-nodes-apiverve.svg)](https://www.npmjs.com/package/@apiverve/n8n-nodes-apiverve)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
5
+ [![n8n Community](https://img.shields.io/badge/n8n-Community%20Node-ff6d5a)](https://n8n.io)
6
+
7
+ This is an [n8n](https://n8n.io) community node that lets you use [APIVerve](https://apiverve.com) in your n8n workflows.
8
+
9
+ [APIVerve](https://apiverve.com) provides 310+ fast, reliable utility APIs for validation, conversion, generation, analysis, and lookup operations. One node, hundreds of APIs.
10
+
11
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
12
+
13
+ ---
14
+
15
+ ## Table of Contents
16
+
17
+ - [Installation](#installation)
18
+ - [n8n Cloud](#n8n-cloud)
19
+ - [n8n Desktop](#n8n-desktop)
20
+ - [Self-hosted n8n (npm)](#self-hosted-n8n-npm)
21
+ - [Self-hosted n8n (Docker)](#self-hosted-n8n-docker)
22
+ - [Credentials](#credentials)
23
+ - [Operations](#operations)
24
+ - [Node Reference](#node-reference)
25
+ - [API Selection](#api-selection)
26
+ - [Parameters](#parameters)
27
+ - [Options](#options)
28
+ - [Usage Examples](#usage-examples)
29
+ - [Response Format](#response-format)
30
+ - [Error Handling](#error-handling)
31
+ - [Development](#development)
32
+ - [Prerequisites](#prerequisites)
33
+ - [Local Setup](#local-setup)
34
+ - [Testing](#testing)
35
+ - [Compatibility](#compatibility)
36
+ - [Troubleshooting](#troubleshooting)
37
+ - [Resources](#resources)
38
+ - [Version History](#version-history)
39
+ - [License](#license)
40
+
41
+ ---
42
+
43
+ ## Installation
44
+
45
+ ### n8n Cloud
46
+
47
+ 1. Log in to your n8n Cloud instance
48
+ 2. Go to **Settings** → **Community Nodes**
49
+ 3. Select **Install a community node**
50
+ 4. Enter: `@apiverve/n8n-nodes-apiverve`
51
+ 5. Agree to the risks and click **Install**
52
+
53
+ The node will appear in the nodes panel under **APIVerve**.
54
+
55
+ ### n8n Desktop
56
+
57
+ 1. Open n8n Desktop
58
+ 2. Go to **Settings** → **Community Nodes**
59
+ 3. Click **Install a community node**
60
+ 4. Enter: `@apiverve/n8n-nodes-apiverve`
61
+ 5. Click **Install**
62
+ 6. Restart n8n Desktop
63
+
64
+ ### Self-hosted n8n (npm)
65
+
66
+ ```bash
67
+ # Navigate to your n8n installation directory
68
+ cd /path/to/n8n
69
+
70
+ # Install the package
71
+ npm install @apiverve/n8n-nodes-apiverve
72
+
73
+ # Restart n8n
74
+ pm2 restart n8n
75
+ # or
76
+ systemctl restart n8n
77
+ ```
78
+
79
+ ### Self-hosted n8n (Docker)
80
+
81
+ Add the package to your `N8N_CUSTOM_EXTENSIONS` environment variable:
82
+
83
+ ```yaml
84
+ # docker-compose.yml
85
+ services:
86
+ n8n:
87
+ image: n8nio/n8n
88
+ environment:
89
+ - N8N_CUSTOM_EXTENSIONS=@apiverve/n8n-nodes-apiverve
90
+ ```
91
+
92
+ Or install in a running container:
93
+
94
+ ```bash
95
+ docker exec -it n8n npm install @apiverve/n8n-nodes-apiverve
96
+ docker restart n8n
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Credentials
102
+
103
+ This node uses OAuth2 authentication to securely connect to your APIVerve account.
104
+
105
+ ### Setting Up OAuth2
106
+
107
+ 1. Sign up at [apiverve.com](https://apiverve.com) (free tier includes 100 requests/day)
108
+ 2. In n8n, go to **Credentials** → **Add Credential**
109
+ 3. Search for **APIVerve OAuth2 API**
110
+ 4. Click **Sign in with APIVerve** to authorize
111
+ 5. Grant access to your APIVerve account
112
+ 6. Click **Save**
113
+
114
+ Your OAuth2 tokens will be automatically managed and refreshed by n8n.
115
+
116
+ ---
117
+
118
+ ## Operations
119
+
120
+ The APIVerve node provides a single, dynamic operation that can execute any of the 310+ available APIs:
121
+
122
+ | Operation | Description |
123
+ |-----------|-------------|
124
+ | **Execute API** | Run any APIVerve API with custom parameters |
125
+
126
+ APIs are organized into 29 categories including:
127
+
128
+ - **Validation** — Email, phone, address, credit card, VAT, domain validation
129
+ - **Conversion** — Currency, units, timezone, file format conversion
130
+ - **Generation** — QR codes, barcodes, passwords, UUIDs, lorem ipsum
131
+ - **Analysis** — Sentiment, language detection, readability, SEO analysis
132
+ - **Lookup** — IP geolocation, DNS, WHOIS, weather, zip codes
133
+
134
+ [Browse all 310+ APIs →](https://apiverve.com/marketplace)
135
+
136
+ ---
137
+
138
+ ## Node Reference
139
+
140
+ ### API Selection
141
+
142
+ | Property | Type | Required | Description |
143
+ |----------|------|----------|-------------|
144
+ | API | Dropdown | Yes | Select an API from the dynamically-loaded list. APIs are grouped by category. |
145
+
146
+ The API list is fetched dynamically when you open the dropdown, ensuring you always have access to the latest APIs.
147
+
148
+ ### Parameters
149
+
150
+ | Property | Type | Required | Description |
151
+ |----------|------|----------|-------------|
152
+ | Parameters (JSON) | JSON | No | API parameters as a JSON object. Leave as `{}` for APIs with no parameters. |
153
+
154
+ Parameters vary by API. Common parameters include:
155
+
156
+ - `email` — Email address for validation APIs
157
+ - `url` — URL for web-related APIs
158
+ - `text` — Text content for analysis APIs
159
+ - `value` — Input value for conversion/generation APIs
160
+
161
+ See the [API documentation](https://docs.apiverve.com) for specific parameter requirements.
162
+
163
+ ---
164
+
165
+ ## Usage Example
166
+
167
+ ### Validate an Email Address
168
+
169
+ **Configuration:**
170
+ - API: `Email Validator`
171
+ - Parameters (JSON): `{"email": "user@example.com"}`
172
+
173
+ **Output:**
174
+ ```json
175
+ {
176
+ "status": "ok",
177
+ "error": null,
178
+ "data": {
179
+ "valid": true,
180
+ "email": "user@example.com",
181
+ "domain": "example.com",
182
+ "disposable": false,
183
+ "mx_found": true
184
+ }
185
+ }
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Response Format
191
+
192
+ All APIVerve APIs return a consistent response structure:
193
+
194
+ ```json
195
+ {
196
+ "status": "ok",
197
+ "error": null,
198
+ "data": {
199
+ // API-specific response data
200
+ }
201
+ }
202
+ ```
203
+
204
+ | Field | Type | Description |
205
+ |-------|------|-------------|
206
+ | `status` | string | `"ok"` for success, `"error"` for failure |
207
+ | `error` | string\|null | Error message if status is error, otherwise null |
208
+ | `data` | object\|null | API response data, null if error |
209
+
210
+ ### Alternative Formats
211
+
212
+ Use the **Response Format** option to receive data in different formats:
213
+
214
+ - **JSON** (default) — `application/json`
215
+ - **XML** — `application/xml`
216
+ - **YAML** — `application/x-yaml`
217
+ - **CSV** — `text/csv` (for tabular data)
218
+
219
+ ---
220
+
221
+ ## Error Handling
222
+
223
+ The node handles errors gracefully and provides detailed error information:
224
+
225
+ | HTTP Status | Error Type | Description |
226
+ |-------------|------------|-------------|
227
+ | 400 | Bad Request | Invalid parameters or missing required fields |
228
+ | 401 | Unauthorized | Invalid or missing API key |
229
+ | 403 | Forbidden | API access not allowed for your plan |
230
+ | 404 | Not Found | API endpoint not found |
231
+ | 429 | Rate Limited | Too many requests, retry after delay |
232
+ | 500 | Server Error | APIVerve server error |
233
+
234
+ ### Error Response Example
235
+
236
+ ```json
237
+ {
238
+ "status": "error",
239
+ "error": "Missing required parameter: email",
240
+ "data": null
241
+ }
242
+ ```
243
+
244
+ ### Continue on Fail
245
+
246
+ Enable **Continue on Fail** in the node settings to prevent workflow execution from stopping on API errors. The error will be captured in the output for handling in subsequent nodes.
247
+
248
+ ---
249
+
250
+ ## Development
251
+
252
+ ### Prerequisites
253
+
254
+ - [Node.js](https://nodejs.org/) v18.10 or higher
255
+ - [pnpm](https://pnpm.io/) (recommended) or npm
256
+ - [n8n](https://n8n.io/) installed locally for testing
257
+
258
+ ### Local Setup
259
+
260
+ 1. Clone the repository:
261
+ ```bash
262
+ git clone https://github.com/apiverve/n8n-nodes-apiverve.git
263
+ cd n8n-nodes-apiverve
264
+ ```
265
+
266
+ 2. Install dependencies:
267
+ ```bash
268
+ npm install
269
+ ```
270
+
271
+ 3. Build the project:
272
+ ```bash
273
+ npm run build
274
+ ```
275
+
276
+ 4. Link to your local n8n installation:
277
+ ```bash
278
+ # Create the custom nodes directory if it doesn't exist
279
+ mkdir -p ~/.n8n/nodes
280
+
281
+ # Create a symlink
282
+ ln -s $(pwd) ~/.n8n/nodes/@apiverve/n8n-nodes-apiverve
283
+ ```
284
+
285
+ 5. Start n8n:
286
+ ```bash
287
+ n8n start
288
+ ```
289
+
290
+ ### Development Mode
291
+
292
+ Run TypeScript in watch mode during development:
293
+
294
+ ```bash
295
+ npm run dev
296
+ ```
297
+
298
+ ### Linting
299
+
300
+ ```bash
301
+ # Check for issues
302
+ npm run lint
303
+
304
+ # Auto-fix issues
305
+ npm run lintfix
306
+ ```
307
+
308
+ ### Building
309
+
310
+ ```bash
311
+ npm run build
312
+ ```
313
+
314
+ This compiles TypeScript and copies icons to the `dist` folder.
315
+
316
+ ---
317
+
318
+ ## Compatibility
319
+
320
+ | Requirement | Version |
321
+ |-------------|---------|
322
+ | n8n | 1.0.0+ |
323
+ | Node.js | 18.10+ |
324
+
325
+ This node has been tested with:
326
+ - n8n Cloud
327
+ - n8n Desktop (Windows, macOS, Linux)
328
+ - Self-hosted n8n (npm, Docker)
329
+
330
+ ---
331
+
332
+ ## Troubleshooting
333
+
334
+ ### "No options available" in API dropdown
335
+
336
+ - Verify your API key is correct in the credentials
337
+ - Check that your APIVerve account is active
338
+ - Ensure you have network access to api.apiverve.com
339
+
340
+ ### "Unauthorized" error
341
+
342
+ - Re-check your API key in the n8n credentials
343
+ - Verify the API key is active in your [APIVerve Dashboard](https://dashboard.apiverve.com)
344
+
345
+ ### "Rate Limited" error
346
+
347
+ - You've exceeded your plan's request limit
348
+ - Wait for the rate limit to reset or upgrade your plan
349
+ - Check rate limit headers in the response for reset time
350
+
351
+ ### Node not appearing after installation
352
+
353
+ - Restart n8n completely
354
+ - Check the n8n logs for installation errors
355
+ - Verify the package is in `node_modules`
356
+
357
+ ### Need help?
358
+
359
+ - [APIVerve Documentation](https://docs.apiverve.com)
360
+ - [GitHub Issues](https://github.com/apiverve/n8n-nodes-apiverve/issues)
361
+ - [n8n Community Forum](https://community.n8n.io/)
362
+
363
+ ---
364
+
365
+ ## Resources
366
+
367
+ | Resource | Link |
368
+ |----------|------|
369
+ | APIVerve Website | [apiverve.com](https://apiverve.com) |
370
+ | API Documentation | [docs.apiverve.com](https://docs.apiverve.com) |
371
+ | API Dashboard | [dashboard.apiverve.com](https://dashboard.apiverve.com) |
372
+ | Browse All APIs | [apiverve.com/marketplace](https://apiverve.com/marketplace) |
373
+ | n8n Documentation | [docs.n8n.io](https://docs.n8n.io) |
374
+ | n8n Community Nodes | [docs.n8n.io/integrations/community-nodes](https://docs.n8n.io/integrations/community-nodes/) |
375
+
376
+ ---
377
+
378
+ ## Version History
379
+
380
+ | Version | Date | Changes |
381
+ |---------|------|---------|
382
+ | 1.0.0 | 2025-12-19 | Initial release with 310+ APIs |
383
+
384
+ ---
385
+
386
+ ## License
387
+
388
+ [MIT](LICENSE)
389
+
390
+ Copyright (c) 2025 [EvlarSoft LLC and APIVerve](https://apiverve.com)
@@ -0,0 +1,16 @@
1
+ import { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ /**
3
+ * APIVerve OAuth2 Credentials
4
+ *
5
+ * Authentication using OAuth2 Authorization Code flow.
6
+ *
7
+ * Sign up at: https://apiverve.com
8
+ * Documentation: https://docs.apiverve.com/authentication
9
+ */
10
+ export declare class APIVerveOAuth2Api implements ICredentialType {
11
+ name: string;
12
+ displayName: string;
13
+ documentationUrl: string;
14
+ extends: string[];
15
+ properties: INodeProperties[];
16
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIVerveOAuth2Api = void 0;
4
+ /**
5
+ * APIVerve OAuth2 Credentials
6
+ *
7
+ * Authentication using OAuth2 Authorization Code flow.
8
+ *
9
+ * Sign up at: https://apiverve.com
10
+ * Documentation: https://docs.apiverve.com/authentication
11
+ */
12
+ class APIVerveOAuth2Api {
13
+ constructor() {
14
+ this.name = 'apiVerveOAuth2Api';
15
+ this.displayName = 'APIVerve OAuth2 API';
16
+ this.documentationUrl = 'https://docs.apiverve.com/authentication';
17
+ this.extends = ['oAuth2Api'];
18
+ this.properties = [
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: 'https://api.apiverve.com/authorize',
30
+ },
31
+ {
32
+ displayName: 'Access Token URL',
33
+ name: 'accessTokenUrl',
34
+ type: 'hidden',
35
+ default: 'https://api.apiverve.com/token',
36
+ },
37
+ {
38
+ displayName: 'Client ID',
39
+ name: 'clientId',
40
+ type: 'hidden',
41
+ default: 'n8n',
42
+ },
43
+ {
44
+ displayName: 'Client Secret',
45
+ name: 'clientSecret',
46
+ type: 'hidden',
47
+ default: 'avs_n8n_k9m3d7g4l1n8s2f6',
48
+ },
49
+ {
50
+ displayName: 'Scope',
51
+ name: 'scope',
52
+ type: 'hidden',
53
+ default: 'apiverve:full',
54
+ },
55
+ {
56
+ displayName: 'Auth URI Query Parameters',
57
+ name: 'authQueryParameters',
58
+ type: 'hidden',
59
+ default: '',
60
+ },
61
+ {
62
+ displayName: 'Authentication',
63
+ name: 'authentication',
64
+ type: 'hidden',
65
+ default: 'header',
66
+ },
67
+ ];
68
+ }
69
+ }
70
+ exports.APIVerveOAuth2Api = APIVerveOAuth2Api;
@@ -0,0 +1,21 @@
1
+ import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
2
+ /**
3
+ * APIVerve Node
4
+ *
5
+ * Resources:
6
+ * - API: Execute any of 300+ utility APIs
7
+ * - JSON Bin: Read/write JSON storage bins
8
+ * - Analytics: View usage statistics
9
+ *
10
+ * @see https://apiverve.com/apis
11
+ * @see https://docs.apiverve.com
12
+ */
13
+ export declare class APIVerve implements INodeType {
14
+ description: INodeTypeDescription;
15
+ methods: {
16
+ loadOptions: {
17
+ getAvailableAPIs(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
18
+ };
19
+ };
20
+ execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
21
+ }
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.APIVerve = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ /**
6
+ * APIVerve Node
7
+ *
8
+ * Resources:
9
+ * - API: Execute any of 300+ utility APIs
10
+ * - JSON Bin: Read/write JSON storage bins
11
+ * - Analytics: View usage statistics
12
+ *
13
+ * @see https://apiverve.com/apis
14
+ * @see https://docs.apiverve.com
15
+ */
16
+ class APIVerve {
17
+ constructor() {
18
+ this.description = {
19
+ displayName: 'APIVerve',
20
+ name: 'apiVerve',
21
+ icon: 'file:apiverve.png',
22
+ group: ['transform'],
23
+ version: 1,
24
+ subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
25
+ description: 'Access 300+ utility APIs, JSON Bins, and Analytics',
26
+ defaults: {
27
+ name: 'APIVerve',
28
+ },
29
+ inputs: ['main'],
30
+ outputs: ['main'],
31
+ credentials: [
32
+ {
33
+ name: 'apiVerveOAuth2Api',
34
+ required: true,
35
+ },
36
+ ],
37
+ properties: [
38
+ // ========== Resource Selector ==========
39
+ {
40
+ displayName: 'Resource',
41
+ name: 'resource',
42
+ type: 'options',
43
+ noDataExpression: true,
44
+ options: [
45
+ { name: 'API', value: 'api', description: 'Execute any of 300+ utility APIs' },
46
+ { name: 'JSON Bin', value: 'jsonbin', description: 'Store and retrieve JSON data' },
47
+ { name: 'Analytics', value: 'analytics', description: 'View usage statistics (Pro+ plans)' },
48
+ ],
49
+ default: 'api',
50
+ },
51
+ // ========== API Resource ==========
52
+ {
53
+ displayName: 'Operation',
54
+ name: 'operation',
55
+ type: 'options',
56
+ noDataExpression: true,
57
+ displayOptions: { show: { resource: ['api'] } },
58
+ options: [
59
+ { name: 'Execute', value: 'execute', description: 'Execute an API', action: 'Execute an API' },
60
+ { name: 'List APIs', value: 'list', description: 'List all available APIs', action: 'List all APIs' },
61
+ ],
62
+ default: 'execute',
63
+ },
64
+ {
65
+ displayName: 'API',
66
+ name: 'apiId',
67
+ type: 'options',
68
+ noDataExpression: true,
69
+ typeOptions: { loadOptionsMethod: 'getAvailableAPIs' },
70
+ displayOptions: { show: { resource: ['api'], operation: ['execute'] } },
71
+ default: '',
72
+ required: true,
73
+ description: 'Select an API to execute. Browse all APIs at <a href="https://apiverve.com/marketplace" target="_blank">apiverve.com/marketplace</a>.',
74
+ },
75
+ {
76
+ displayName: 'Parameters (JSON)',
77
+ name: 'parameters',
78
+ type: 'json',
79
+ default: '{}',
80
+ description: 'API parameters as JSON. Example: {"email": "test@example.com"}. Leave as {} for APIs with no parameters.',
81
+ displayOptions: { show: { resource: ['api'], operation: ['execute'] } },
82
+ },
83
+ // ========== JSON Bin Resource ==========
84
+ {
85
+ displayName: 'Operation',
86
+ name: 'operation',
87
+ type: 'options',
88
+ noDataExpression: true,
89
+ displayOptions: { show: { resource: ['jsonbin'] } },
90
+ options: [
91
+ { name: 'List', value: 'list', description: 'List all JSON Bins', action: 'List JSON Bins' },
92
+ { name: 'Get', value: 'get', description: 'Get a JSON Bin', action: 'Get a JSON Bin' },
93
+ { name: 'Update', value: 'update', description: 'Update a JSON Bin', action: 'Update a JSON Bin' },
94
+ ],
95
+ default: 'list',
96
+ },
97
+ {
98
+ displayName: 'Create and delete Bins in the <a href="https://dashboard.apiverve.com/vervekit/jsonbin" target="_blank">APIVerve Dashboard</a>',
99
+ name: 'binNotice',
100
+ type: 'notice',
101
+ default: '',
102
+ displayOptions: { show: { resource: ['jsonbin'] } },
103
+ },
104
+ {
105
+ displayName: 'Bin ID',
106
+ name: 'binId',
107
+ type: 'string',
108
+ default: '',
109
+ required: true,
110
+ description: 'The JSON Bin ID (from your dashboard)',
111
+ displayOptions: { show: { resource: ['jsonbin'], operation: ['get', 'update'] } },
112
+ },
113
+ {
114
+ displayName: 'Data (JSON)',
115
+ name: 'binData',
116
+ type: 'json',
117
+ default: '{}',
118
+ description: 'JSON data to store in the Bin',
119
+ displayOptions: { show: { resource: ['jsonbin'], operation: ['update'] } },
120
+ },
121
+ // ========== Analytics Resource ==========
122
+ {
123
+ displayName: 'Operation',
124
+ name: 'operation',
125
+ type: 'options',
126
+ noDataExpression: true,
127
+ displayOptions: { show: { resource: ['analytics'] } },
128
+ options: [
129
+ { name: 'Get Current Usage', value: 'getUsage', description: 'Get current usage statistics', action: 'Get current usage statistics' },
130
+ ],
131
+ default: 'getUsage',
132
+ },
133
+ ],
134
+ };
135
+ this.methods = {
136
+ loadOptions: {
137
+ async getAvailableAPIs() {
138
+ try {
139
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'GET', url: 'https://api.apiverve.com/v1/n8n/apis' });
140
+ if (!Array.isArray(response))
141
+ return [];
142
+ return response.map((api) => ({
143
+ name: api.label,
144
+ value: api.id,
145
+ description: api.description,
146
+ }));
147
+ }
148
+ catch (error) {
149
+ return [];
150
+ }
151
+ },
152
+ },
153
+ };
154
+ }
155
+ async execute() {
156
+ const items = this.getInputData();
157
+ const returnData = [];
158
+ const resource = this.getNodeParameter('resource', 0);
159
+ const operation = this.getNodeParameter('operation', 0);
160
+ for (let i = 0; i < items.length; i++) {
161
+ try {
162
+ let response;
163
+ // ========== API Resource ==========
164
+ if (resource === 'api') {
165
+ if (operation === 'execute') {
166
+ const apiId = this.getNodeParameter('apiId', i);
167
+ const parametersJson = this.getNodeParameter('parameters', i);
168
+ let params = {};
169
+ try {
170
+ const parsed = typeof parametersJson === 'string' ? JSON.parse(parametersJson) : parametersJson;
171
+ for (const [key, value] of Object.entries(parsed)) {
172
+ params[key] = String(value);
173
+ }
174
+ }
175
+ catch (e) {
176
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid JSON in parameters');
177
+ }
178
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'GET', url: `https://api.apiverve.com/v1/${apiId}`, qs: params });
179
+ }
180
+ else if (operation === 'list') {
181
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'GET', url: 'https://api.apiverve.com/v1/n8n/apis' });
182
+ }
183
+ }
184
+ // ========== JSON Bin Resource ==========
185
+ else if (resource === 'jsonbin') {
186
+ const baseUrl = 'https://api.apiverve.com/v1/n8n/jsonbin';
187
+ if (operation === 'list') {
188
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'GET', url: `${baseUrl}/list` });
189
+ }
190
+ else if (operation === 'get') {
191
+ const binId = this.getNodeParameter('binId', i);
192
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'GET', url: `${baseUrl}/get/${binId}` });
193
+ }
194
+ else if (operation === 'update') {
195
+ const binId = this.getNodeParameter('binId', i);
196
+ const body = { data: JSON.parse(this.getNodeParameter('binData', i)) };
197
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'PUT', url: `${baseUrl}/update/${binId}`, body });
198
+ }
199
+ }
200
+ // ========== Analytics Resource ==========
201
+ else if (resource === 'analytics') {
202
+ response = await this.helpers.httpRequestWithAuthentication.call(this, 'apiVerveOAuth2Api', { method: 'GET', url: 'https://api.apiverve.com/v1/n8n/analytics' });
203
+ }
204
+ returnData.push({ json: response, pairedItem: { item: i } });
205
+ }
206
+ catch (error) {
207
+ if (this.continueOnFail()) {
208
+ returnData.push({
209
+ json: { status: 'error', error: error.message, data: null },
210
+ pairedItem: { item: i },
211
+ });
212
+ continue;
213
+ }
214
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), error, { itemIndex: i });
215
+ }
216
+ }
217
+ return [returnData];
218
+ }
219
+ }
220
+ exports.APIVerve = APIVerve;
Binary file
package/index.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = {};
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@apiverve/n8n-nodes-apiverve",
3
+ "version": "0.1.0",
4
+ "description": "n8n community node for APIVerve - Access 300+ utility APIs for validation, conversion, generation, and more",
5
+ "keywords": [
6
+ "n8n-community-node-package",
7
+ "n8n-nodes",
8
+ "n8n",
9
+ "apiverve",
10
+ "api",
11
+ "validation",
12
+ "conversion",
13
+ "utilities"
14
+ ],
15
+ "license": "MIT",
16
+ "homepage": "https://github.com/apiverve/n8n-nodes-apiverve",
17
+ "author": {
18
+ "name": "APIVerve"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/apiverve/n8n-nodes-apiverve.git"
23
+ },
24
+ "engines": {
25
+ "node": ">=18.10"
26
+ },
27
+ "main": "index.js",
28
+ "scripts": {
29
+ "build": "tsc && gulp build:icons",
30
+ "dev": "tsc --watch",
31
+ "format": "prettier nodes credentials --write",
32
+ "lint": "eslint nodes credentials package.json",
33
+ "lintfix": "eslint nodes credentials package.json --fix",
34
+ "prepublishOnly": "npm run build"
35
+ },
36
+ "files": [
37
+ "dist"
38
+ ],
39
+ "n8n": {
40
+ "n8nNodesApiVersion": 1,
41
+ "credentials": [
42
+ "dist/credentials/APIVerveOAuth2Api.credentials.js"
43
+ ],
44
+ "nodes": [
45
+ "dist/nodes/APIVerve/APIVerve.node.js"
46
+ ]
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^20.0.0",
50
+ "eslint": "^8.56.0",
51
+ "eslint-plugin-n8n-nodes-base": "^1.16.1",
52
+ "gulp": "^4.0.2",
53
+ "n8n-workflow": "^1.0.0",
54
+ "prettier": "^3.0.0",
55
+ "typescript": "^5.5.0"
56
+ }
57
+ }