n8n-nodes-test-node 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 +30 -0
- package/dist/BookshelfAPIApi.credentials.d.ts +9 -0
- package/dist/BookshelfAPIApi.credentials.js +44 -0
- package/dist/BookshelfAPINode.node.d.ts +4 -0
- package/dist/BookshelfAPINode.node.js +265 -0
- package/dist/icon.png +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/package.json +32 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# n8n-nodes-test-node
|
|
2
|
+
|
|
3
|
+
Auto-generated n8n community node for the **Bookshelf API** API (spec version 1.2.0), built from its OpenAPI document.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
In n8n: **Settings → Community Nodes → Install**, and enter `n8n-nodes-test-node`.
|
|
8
|
+
|
|
9
|
+
Or manually:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install n8n-nodes-test-node
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## What was generated
|
|
16
|
+
|
|
17
|
+
- 2 resource(s), 5 operation(s).
|
|
18
|
+
- Credential type **bookshelfAPIApi**, with an editable **Base URL** field plus API Key / Bearer token field(s) per the spec's security scheme.
|
|
19
|
+
- Default Base URL: `https://api.example.com/v1` (override it in the credential's "Base URL" field to point at a different environment)
|
|
20
|
+
|
|
21
|
+
## Limitations
|
|
22
|
+
|
|
23
|
+
- Only OpenAPI 3.x is supported.
|
|
24
|
+
- Only **API Key** (header or query) and **HTTP Bearer** authentication are supported. OAuth2, Basic Auth, and mutual TLS are not.
|
|
25
|
+
- Request bodies with nested objects, arrays, or `oneOf`/`anyOf`/`allOf` schemas are exposed as a single raw "Body (JSON)" field rather than individual fields.
|
|
26
|
+
- If the spec declared more than one supported auth scheme, they were combined into a single credential covering all of them, rather than offering a choice.
|
|
27
|
+
|
|
28
|
+
## Regenerating
|
|
29
|
+
|
|
30
|
+
This package was produced by an automated generator from the source OpenAPI spec. To pick up spec changes, re-run the generator rather than hand-editing the generated files under `src/`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class BookshelfAPIApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookshelfAPIApi = void 0;
|
|
4
|
+
class BookshelfAPIApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'bookshelfAPIApi';
|
|
7
|
+
this.displayName = 'Bookshelf API';
|
|
8
|
+
this.documentationUrl = '';
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Base URL',
|
|
12
|
+
name: 'baseUrl',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: 'https://api.example.com/v1',
|
|
15
|
+
required: true,
|
|
16
|
+
description: 'Base URL every request is sent to. Change this to point the node at a different environment (staging, self-hosted, etc.).',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
displayName: 'X-API-Key (API Key)',
|
|
20
|
+
name: 'xAPIKey',
|
|
21
|
+
type: 'string',
|
|
22
|
+
typeOptions: { password: true },
|
|
23
|
+
default: '',
|
|
24
|
+
required: true,
|
|
25
|
+
description: 'Sent as the "X-API-Key" header on every request.',
|
|
26
|
+
},
|
|
27
|
+
];
|
|
28
|
+
this.authenticate = {
|
|
29
|
+
type: 'generic',
|
|
30
|
+
properties: {
|
|
31
|
+
headers: {
|
|
32
|
+
'X-API-Key': '={{$credentials.xAPIKey}}',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
this.test = {
|
|
37
|
+
request: {
|
|
38
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
39
|
+
url: '/',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.BookshelfAPIApi = BookshelfAPIApi;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookshelfAPINode = void 0;
|
|
4
|
+
class BookshelfAPINode {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Bookshelf API',
|
|
8
|
+
name: 'bookshelfAPI',
|
|
9
|
+
icon: 'file:icon.png',
|
|
10
|
+
group: ['transform'],
|
|
11
|
+
version: 1,
|
|
12
|
+
subtitle: '={{$parameter["operation"] + ($parameter["resource"] ? " " + $parameter["resource"] : "")}}',
|
|
13
|
+
description: 'A tiny demo API for managing books and authors.',
|
|
14
|
+
defaults: {
|
|
15
|
+
name: 'Bookshelf API',
|
|
16
|
+
},
|
|
17
|
+
inputs: ['main'],
|
|
18
|
+
outputs: ['main'],
|
|
19
|
+
credentials: [
|
|
20
|
+
{
|
|
21
|
+
name: 'bookshelfAPIApi',
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
requestDefaults: {
|
|
26
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
27
|
+
headers: {
|
|
28
|
+
Accept: 'application/json',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
properties: [
|
|
32
|
+
{
|
|
33
|
+
displayName: 'Resource',
|
|
34
|
+
name: 'resource',
|
|
35
|
+
type: 'options',
|
|
36
|
+
noDataExpression: true,
|
|
37
|
+
options: [
|
|
38
|
+
{ name: 'Book', value: 'book' },
|
|
39
|
+
{ name: 'Author', value: 'author' },
|
|
40
|
+
],
|
|
41
|
+
default: 'book',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
displayName: 'Operation',
|
|
45
|
+
name: 'operation',
|
|
46
|
+
type: 'options',
|
|
47
|
+
noDataExpression: true,
|
|
48
|
+
options: [
|
|
49
|
+
{
|
|
50
|
+
name: 'List Books',
|
|
51
|
+
value: 'listBooks',
|
|
52
|
+
action: 'List books',
|
|
53
|
+
description: 'List books',
|
|
54
|
+
routing: {
|
|
55
|
+
request: {
|
|
56
|
+
method: 'GET',
|
|
57
|
+
url: '=/books',
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'Create A Book',
|
|
63
|
+
value: 'createBook',
|
|
64
|
+
action: 'Create a book',
|
|
65
|
+
description: 'Create a book',
|
|
66
|
+
routing: {
|
|
67
|
+
request: {
|
|
68
|
+
method: 'POST',
|
|
69
|
+
url: '=/books',
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'Get A Book',
|
|
75
|
+
value: 'getBook',
|
|
76
|
+
action: 'Get a book',
|
|
77
|
+
description: 'Get a book',
|
|
78
|
+
routing: {
|
|
79
|
+
request: {
|
|
80
|
+
method: 'GET',
|
|
81
|
+
url: '=/books/{{$parameter["bookId"]}}',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'Delete A Book',
|
|
87
|
+
value: 'deleteBook',
|
|
88
|
+
action: 'Delete a book',
|
|
89
|
+
description: 'Delete a book',
|
|
90
|
+
routing: {
|
|
91
|
+
request: {
|
|
92
|
+
method: 'DELETE',
|
|
93
|
+
url: '=/books/{{$parameter["bookId"]}}',
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: {
|
|
100
|
+
resource: ['book'],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
default: 'listBooks',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: 'Operation',
|
|
107
|
+
name: 'operation',
|
|
108
|
+
type: 'options',
|
|
109
|
+
noDataExpression: true,
|
|
110
|
+
options: [
|
|
111
|
+
{
|
|
112
|
+
name: 'List Authors',
|
|
113
|
+
value: 'listAuthors',
|
|
114
|
+
action: 'List authors',
|
|
115
|
+
description: 'List authors',
|
|
116
|
+
routing: {
|
|
117
|
+
request: {
|
|
118
|
+
method: 'GET',
|
|
119
|
+
url: '=/authors',
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
displayOptions: {
|
|
125
|
+
show: {
|
|
126
|
+
resource: ['author'],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
default: 'listAuthors',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
displayName: 'Additional Fields',
|
|
133
|
+
name: 'additionalFields',
|
|
134
|
+
type: 'collection',
|
|
135
|
+
placeholder: 'Add Field',
|
|
136
|
+
default: {},
|
|
137
|
+
displayOptions: {
|
|
138
|
+
show: {
|
|
139
|
+
resource: ['book'],
|
|
140
|
+
operation: ['listBooks'],
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
options: [
|
|
144
|
+
{
|
|
145
|
+
displayName: 'Limit',
|
|
146
|
+
name: 'limit',
|
|
147
|
+
type: 'number',
|
|
148
|
+
default: 0,
|
|
149
|
+
description: '',
|
|
150
|
+
routing: {
|
|
151
|
+
send: {
|
|
152
|
+
type: 'query',
|
|
153
|
+
property: 'limit',
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
displayName: 'Author Id',
|
|
159
|
+
name: 'authorId',
|
|
160
|
+
type: 'string',
|
|
161
|
+
default: '',
|
|
162
|
+
description: '',
|
|
163
|
+
routing: {
|
|
164
|
+
send: {
|
|
165
|
+
type: 'query',
|
|
166
|
+
property: 'authorId',
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Title',
|
|
174
|
+
name: 'title',
|
|
175
|
+
type: 'string',
|
|
176
|
+
default: '',
|
|
177
|
+
required: true,
|
|
178
|
+
description: 'Book title',
|
|
179
|
+
displayOptions: {
|
|
180
|
+
show: {
|
|
181
|
+
resource: ['book'],
|
|
182
|
+
operation: ['createBook'],
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
routing: {
|
|
186
|
+
send: {
|
|
187
|
+
type: 'body',
|
|
188
|
+
property: 'title',
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
displayName: 'Additional Fields',
|
|
194
|
+
name: 'additionalFields',
|
|
195
|
+
type: 'collection',
|
|
196
|
+
placeholder: 'Add Field',
|
|
197
|
+
default: {},
|
|
198
|
+
displayOptions: {
|
|
199
|
+
show: {
|
|
200
|
+
resource: ['book'],
|
|
201
|
+
operation: ['createBook'],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
options: [
|
|
205
|
+
{
|
|
206
|
+
displayName: 'Author Id',
|
|
207
|
+
name: 'authorId',
|
|
208
|
+
type: 'string',
|
|
209
|
+
default: '',
|
|
210
|
+
description: '',
|
|
211
|
+
routing: {
|
|
212
|
+
send: {
|
|
213
|
+
type: 'body',
|
|
214
|
+
property: 'authorId',
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
displayName: 'Published',
|
|
220
|
+
name: 'published',
|
|
221
|
+
type: 'boolean',
|
|
222
|
+
default: false,
|
|
223
|
+
description: '',
|
|
224
|
+
routing: {
|
|
225
|
+
send: {
|
|
226
|
+
type: 'body',
|
|
227
|
+
property: 'published',
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
displayName: 'Book Id',
|
|
235
|
+
name: 'bookId',
|
|
236
|
+
type: 'string',
|
|
237
|
+
default: '',
|
|
238
|
+
required: true,
|
|
239
|
+
description: '',
|
|
240
|
+
displayOptions: {
|
|
241
|
+
show: {
|
|
242
|
+
resource: ['book'],
|
|
243
|
+
operation: ['getBook'],
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
displayName: 'Book Id',
|
|
249
|
+
name: 'bookId',
|
|
250
|
+
type: 'string',
|
|
251
|
+
default: '',
|
|
252
|
+
required: true,
|
|
253
|
+
description: '',
|
|
254
|
+
displayOptions: {
|
|
255
|
+
show: {
|
|
256
|
+
resource: ['book'],
|
|
257
|
+
operation: ['deleteBook'],
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
exports.BookshelfAPINode = BookshelfAPINode;
|
package/dist/icon.png
ADDED
|
Binary file
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-test-node",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A tiny demo API for managing books and authors.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package"
|
|
7
|
+
],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "tsc"
|
|
15
|
+
},
|
|
16
|
+
"n8n": {
|
|
17
|
+
"n8nNodesApiVersion": 1,
|
|
18
|
+
"credentials": [
|
|
19
|
+
"dist/BookshelfAPIApi.credentials.js"
|
|
20
|
+
],
|
|
21
|
+
"nodes": [
|
|
22
|
+
"dist/BookshelfAPINode.node.js"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"typescript": "^5.5.4",
|
|
27
|
+
"n8n-workflow": "*"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"n8n-workflow": "*"
|
|
31
|
+
}
|
|
32
|
+
}
|