n8n-nodes-openapi-compatible 0.1.1 → 0.1.3
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 +3 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/credentials/ExampleCredentialsApi.credentials.d.ts +0 -8
- package/dist/credentials/ExampleCredentialsApi.credentials.js +0 -46
- package/dist/credentials/ExampleCredentialsApi.credentials.js.map +0 -1
- package/dist/credentials/HttpBinApi.credentials.d.ts +0 -9
- package/dist/credentials/HttpBinApi.credentials.js +0 -43
- package/dist/credentials/HttpBinApi.credentials.js.map +0 -1
- package/dist/nodes/ExampleNode/ExampleNode.node.d.ts +0 -5
- package/dist/nodes/ExampleNode/ExampleNode.node.js +0 -59
- package/dist/nodes/ExampleNode/ExampleNode.node.js.map +0 -1
- package/dist/nodes/HttpBin/HttpBin.node.d.ts +0 -4
- package/dist/nodes/HttpBin/HttpBin.node.js +0 -55
- package/dist/nodes/HttpBin/HttpBin.node.js.map +0 -1
- package/dist/nodes/HttpBin/HttpBin.node.json +0 -18
- package/dist/nodes/HttpBin/HttpVerbDescription.d.ts +0 -3
- package/dist/nodes/HttpBin/HttpVerbDescription.js +0 -234
- package/dist/nodes/HttpBin/HttpVerbDescription.js.map +0 -1
- package/dist/nodes/OpenAPINode/OpenAPIDescription.d.ts +0 -3
- package/dist/nodes/OpenAPINode/OpenAPIDescription.js +0 -145
- package/dist/nodes/OpenAPINode/OpenAPIDescription.js.map +0 -1
- package/dist/nodes/OpenAPINode/OpenAPIHelper.d.ts +0 -3
- package/dist/nodes/OpenAPINode/OpenAPIHelper.js +0 -79
- package/dist/nodes/OpenAPINode/OpenAPIHelper.js.map +0 -1
- package/dist/nodes/OpenAPINode/OpenAPINode.node.d.ts +0 -10
- package/dist/nodes/OpenAPINode/OpenAPINode.node.js +0 -117
- package/dist/nodes/OpenAPINode/OpenAPINode.node.js.map +0 -1
- package/dist/nodes/OpenAPINode/OpenApi.credentials.d.ts +0 -14
- package/dist/nodes/OpenAPINode/OpenApi.credentials.js +0 -71
- package/dist/nodes/OpenAPINode/OpenApi.credentials.js.map +0 -1
- package/dist/nodes/OpenAPINode/OpenApi.svg +0 -0
- package/dist/nodes/OpenAPINode/openapi.png +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"node": "n8n-nodes-base.httpbin",
|
|
3
|
-
"nodeVersion": "1.0",
|
|
4
|
-
"codexVersion": "1.0",
|
|
5
|
-
"categories": ["Development", "Developer Tools"],
|
|
6
|
-
"resources": {
|
|
7
|
-
"credentialDocumentation": [
|
|
8
|
-
{
|
|
9
|
-
"url": "http://httpbin.org/#/Auth/get_bearer"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"primaryDocumentation": [
|
|
13
|
-
{
|
|
14
|
-
"url": "http://httpbin.org/"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.httpVerbFields = exports.httpVerbOperations = void 0;
|
|
4
|
-
exports.httpVerbOperations = [
|
|
5
|
-
{
|
|
6
|
-
displayName: 'Operation',
|
|
7
|
-
name: 'operation',
|
|
8
|
-
type: 'options',
|
|
9
|
-
noDataExpression: true,
|
|
10
|
-
displayOptions: {
|
|
11
|
-
show: {
|
|
12
|
-
resource: ['httpVerb'],
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
options: [
|
|
16
|
-
{
|
|
17
|
-
name: 'GET',
|
|
18
|
-
value: 'get',
|
|
19
|
-
description: 'Perform a GET request',
|
|
20
|
-
routing: {
|
|
21
|
-
request: {
|
|
22
|
-
method: 'GET',
|
|
23
|
-
url: '/get',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
name: 'DELETE',
|
|
29
|
-
value: 'delete',
|
|
30
|
-
description: 'Perform a DELETE request',
|
|
31
|
-
routing: {
|
|
32
|
-
request: {
|
|
33
|
-
method: 'DELETE',
|
|
34
|
-
url: '/delete',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
default: 'get',
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
const getOperation = [
|
|
43
|
-
{
|
|
44
|
-
displayName: 'Type of Data',
|
|
45
|
-
name: 'typeofData',
|
|
46
|
-
default: 'queryParameter',
|
|
47
|
-
description: 'Select type of data to send [Query Parameters]',
|
|
48
|
-
displayOptions: {
|
|
49
|
-
show: {
|
|
50
|
-
resource: ['httpVerb'],
|
|
51
|
-
operation: ['get'],
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
type: 'options',
|
|
55
|
-
options: [
|
|
56
|
-
{
|
|
57
|
-
name: 'Query',
|
|
58
|
-
value: 'queryParameter',
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
required: true,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
displayName: 'Query Parameters',
|
|
65
|
-
name: 'arguments',
|
|
66
|
-
default: {},
|
|
67
|
-
description: "The request's query parameters",
|
|
68
|
-
displayOptions: {
|
|
69
|
-
show: {
|
|
70
|
-
resource: ['httpVerb'],
|
|
71
|
-
operation: ['get'],
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
options: [
|
|
75
|
-
{
|
|
76
|
-
name: 'keyvalue',
|
|
77
|
-
displayName: 'Key:Value',
|
|
78
|
-
values: [
|
|
79
|
-
{
|
|
80
|
-
displayName: 'Key',
|
|
81
|
-
name: 'key',
|
|
82
|
-
type: 'string',
|
|
83
|
-
default: '',
|
|
84
|
-
required: true,
|
|
85
|
-
description: 'Key of query parameter',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: 'Value',
|
|
89
|
-
name: 'value',
|
|
90
|
-
type: 'string',
|
|
91
|
-
default: '',
|
|
92
|
-
routing: {
|
|
93
|
-
send: {
|
|
94
|
-
property: '={{$parent.key}}',
|
|
95
|
-
type: 'query',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
required: true,
|
|
99
|
-
description: 'Value of query parameter',
|
|
100
|
-
},
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
type: 'fixedCollection',
|
|
105
|
-
typeOptions: {
|
|
106
|
-
multipleValues: true,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
];
|
|
110
|
-
const deleteOperation = [
|
|
111
|
-
{
|
|
112
|
-
displayName: 'Type of Data',
|
|
113
|
-
name: 'typeofData',
|
|
114
|
-
default: 'queryParameter',
|
|
115
|
-
description: 'Select type of data to send [Query Parameter Arguments, JSON-Body]',
|
|
116
|
-
displayOptions: {
|
|
117
|
-
show: {
|
|
118
|
-
resource: ['httpVerb'],
|
|
119
|
-
operation: ['delete'],
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
options: [
|
|
123
|
-
{
|
|
124
|
-
name: 'Query',
|
|
125
|
-
value: 'queryParameter',
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'JSON',
|
|
129
|
-
value: 'jsonData',
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
required: true,
|
|
133
|
-
type: 'options',
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
displayName: 'Query Parameters',
|
|
137
|
-
name: 'arguments',
|
|
138
|
-
default: {},
|
|
139
|
-
description: "The request's query parameters",
|
|
140
|
-
displayOptions: {
|
|
141
|
-
show: {
|
|
142
|
-
resource: ['httpVerb'],
|
|
143
|
-
operation: ['delete'],
|
|
144
|
-
typeofData: ['queryParameter'],
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
options: [
|
|
148
|
-
{
|
|
149
|
-
name: 'keyvalue',
|
|
150
|
-
displayName: 'Key:Value',
|
|
151
|
-
values: [
|
|
152
|
-
{
|
|
153
|
-
displayName: 'Key',
|
|
154
|
-
name: 'key',
|
|
155
|
-
type: 'string',
|
|
156
|
-
default: '',
|
|
157
|
-
required: true,
|
|
158
|
-
description: 'Key of query parameter',
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
displayName: 'Value',
|
|
162
|
-
name: 'value',
|
|
163
|
-
type: 'string',
|
|
164
|
-
default: '',
|
|
165
|
-
routing: {
|
|
166
|
-
send: {
|
|
167
|
-
property: '={{$parent.key}}',
|
|
168
|
-
type: 'query',
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
required: true,
|
|
172
|
-
description: 'Value of query parameter',
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
type: 'fixedCollection',
|
|
178
|
-
typeOptions: {
|
|
179
|
-
multipleValues: true,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
displayName: 'JSON Object',
|
|
184
|
-
name: 'arguments',
|
|
185
|
-
default: {},
|
|
186
|
-
description: "The request's JSON properties",
|
|
187
|
-
displayOptions: {
|
|
188
|
-
show: {
|
|
189
|
-
resource: ['httpVerb'],
|
|
190
|
-
operation: ['delete'],
|
|
191
|
-
typeofData: ['jsonData'],
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
options: [
|
|
195
|
-
{
|
|
196
|
-
name: 'keyvalue',
|
|
197
|
-
displayName: 'Key:Value',
|
|
198
|
-
values: [
|
|
199
|
-
{
|
|
200
|
-
displayName: 'Key',
|
|
201
|
-
name: 'key',
|
|
202
|
-
type: 'string',
|
|
203
|
-
default: '',
|
|
204
|
-
required: true,
|
|
205
|
-
description: 'Key of JSON property',
|
|
206
|
-
},
|
|
207
|
-
{
|
|
208
|
-
displayName: 'Value',
|
|
209
|
-
name: 'value',
|
|
210
|
-
type: 'string',
|
|
211
|
-
default: '',
|
|
212
|
-
routing: {
|
|
213
|
-
send: {
|
|
214
|
-
property: '={{$parent.key}}',
|
|
215
|
-
type: 'body',
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
required: true,
|
|
219
|
-
description: 'Value of JSON property',
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
type: 'fixedCollection',
|
|
225
|
-
typeOptions: {
|
|
226
|
-
multipleValues: true,
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
];
|
|
230
|
-
exports.httpVerbFields = [
|
|
231
|
-
...getOperation,
|
|
232
|
-
...deleteOperation,
|
|
233
|
-
];
|
|
234
|
-
//# sourceMappingURL=HttpVerbDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpVerbDescription.js","sourceRoot":"","sources":["../../../nodes/HttpBin/HttpVerbDescription.ts"],"names":[],"mappings":";;;AAGa,QAAA,kBAAkB,GAAsB;IACpD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QAEtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,UAAU,CAAC;aACtB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,uBAAuB;gBACpC,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,MAAM;qBACX;iBACD;aACD;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,0BAA0B;gBACvC,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,QAAQ;wBAChB,GAAG,EAAE,SAAS;qBACd;iBACD;aACD;SACD;QACD,OAAO,EAAE,KAAK;KACd;CACD,CAAC;AAIF,MAAM,YAAY,GAA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D;SACD;QACD,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,IAAI;SACpB;KACD;IACD;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,+BAA+B;QAC5C,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,UAAU,CAAC;gBACtB,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,UAAU,EAAE,CAAC,UAAU,CAAC;aACxB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,WAAW;gBACxB,MAAM,EAAE;oBACP;wBACC,WAAW,EAAE,KAAK;wBAClB,IAAI,EAAE,KAAK;wBACX,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,sBAAsB;qBACnC;oBACD;wBACC,WAAW,EAAE,OAAO;wBACpB,IAAI,EAAE,OAAO;wBACb,IAAI,EAAE,QAAQ;wBACd,OAAO,EAAE,EAAE;wBACX,OAAO,EAAE;4BACR,IAAI,EAAE;gCACL,QAAQ,EAAE,kBAAkB;gCAC5B,IAAI,EAAE,MAAM;6BACZ;yBACD;wBACD,QAAQ,EAAE,IAAI;wBACd,WAAW,EAAE,wBAAwB;qBACrC;iBACD;aACD;SACD;QACD,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,IAAI;SACpB;KACD;CACD,CAAC;AAEW,QAAA,cAAc,GAAsB;IAIhD,GAAG,YAAY;IAKf,GAAG,eAAe;CAClB,CAAC"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.openApiFields = exports.openApiOperations = void 0;
|
|
4
|
-
exports.openApiOperations = [
|
|
5
|
-
{
|
|
6
|
-
displayName: 'Operation Name or ID',
|
|
7
|
-
name: 'operation',
|
|
8
|
-
type: 'options',
|
|
9
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
10
|
-
noDataExpression: true,
|
|
11
|
-
displayOptions: {
|
|
12
|
-
show: {
|
|
13
|
-
resource: ['apiEndpoint'],
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
typeOptions: {
|
|
17
|
-
loadOptionsMethod: 'loadOperations',
|
|
18
|
-
},
|
|
19
|
-
default: '',
|
|
20
|
-
required: true,
|
|
21
|
-
},
|
|
22
|
-
];
|
|
23
|
-
exports.openApiFields = [
|
|
24
|
-
{
|
|
25
|
-
displayName: 'Parameters',
|
|
26
|
-
name: 'parameters',
|
|
27
|
-
placeholder: 'Add Parameter',
|
|
28
|
-
type: 'fixedCollection',
|
|
29
|
-
typeOptions: {
|
|
30
|
-
multipleValues: true,
|
|
31
|
-
},
|
|
32
|
-
displayOptions: {
|
|
33
|
-
show: {
|
|
34
|
-
resource: ['apiEndpoint'],
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
default: {},
|
|
38
|
-
options: [
|
|
39
|
-
{
|
|
40
|
-
name: 'parameter',
|
|
41
|
-
displayName: 'Parameter',
|
|
42
|
-
values: [
|
|
43
|
-
{
|
|
44
|
-
displayName: 'Name',
|
|
45
|
-
name: 'name',
|
|
46
|
-
type: 'string',
|
|
47
|
-
default: '',
|
|
48
|
-
description: 'Name of the parameter',
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
displayName: 'Value',
|
|
52
|
-
name: 'value',
|
|
53
|
-
type: 'string',
|
|
54
|
-
default: '',
|
|
55
|
-
description: 'Value of the parameter',
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
displayName: 'Type',
|
|
59
|
-
name: 'type',
|
|
60
|
-
type: 'options',
|
|
61
|
-
options: [
|
|
62
|
-
{
|
|
63
|
-
name: 'Query',
|
|
64
|
-
value: 'query',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'Path',
|
|
68
|
-
value: 'path',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'Header',
|
|
72
|
-
value: 'header',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: 'Cookie',
|
|
76
|
-
value: 'cookie',
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
default: 'query',
|
|
80
|
-
description: 'Type of the parameter',
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
description: 'Parameters to be sent',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: 'Request Body',
|
|
89
|
-
name: 'requestBody',
|
|
90
|
-
type: 'json',
|
|
91
|
-
displayOptions: {
|
|
92
|
-
show: {
|
|
93
|
-
resource: ['apiEndpoint'],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
default: '{}',
|
|
97
|
-
description: 'Request body as JSON',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
displayName: 'Options',
|
|
101
|
-
name: 'options',
|
|
102
|
-
type: 'collection',
|
|
103
|
-
placeholder: 'Add Option',
|
|
104
|
-
default: {},
|
|
105
|
-
displayOptions: {
|
|
106
|
-
show: {
|
|
107
|
-
resource: ['apiEndpoint'],
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
options: [
|
|
111
|
-
{
|
|
112
|
-
displayName: 'Response Format',
|
|
113
|
-
name: 'responseFormat',
|
|
114
|
-
type: 'options',
|
|
115
|
-
options: [
|
|
116
|
-
{
|
|
117
|
-
name: 'JSON',
|
|
118
|
-
value: 'json',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
name: 'String',
|
|
122
|
-
value: 'string',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: 'Binary',
|
|
126
|
-
value: 'binary',
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
default: 'json',
|
|
130
|
-
description: 'The format in which the data gets returned from the URL',
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
displayName: 'Timeout',
|
|
134
|
-
name: 'timeout',
|
|
135
|
-
type: 'number',
|
|
136
|
-
typeOptions: {
|
|
137
|
-
minValue: 1,
|
|
138
|
-
},
|
|
139
|
-
default: 10000,
|
|
140
|
-
description: 'Time in ms to wait for the request to complete',
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
];
|
|
145
|
-
//# sourceMappingURL=OpenAPIDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAPIDescription.js","sourceRoot":"","sources":["../../../nodes/OpenAPINode/OpenAPIDescription.ts"],"names":[],"mappings":";;;AAGa,QAAA,iBAAiB,GAAsB;IACnD;QACC,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,yHAAyH;QACtI,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,aAAa,CAAC;aACzB;SACD;QACD,WAAW,EAAE;YACZ,iBAAiB,EAAE,gBAAgB;SACnC;QACD,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;KACd;CACD,CAAC;AAGW,QAAA,aAAa,GAAsB;IAC/C;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE;YACZ,cAAc,EAAE,IAAI;SACpB;QACD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,aAAa,CAAC;aACzB;SACD;QACD,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,WAAW;gBACxB,MAAM,EAAE;oBACP;wBACC,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EAAE,SAAS;gBACf,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,MAAM;wBACZ,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;qBACf;oBACD;wBACC,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,QAAQ;qBACf;iBACD;gBACD,OAAO,EAAE,MAAM;gBACf,WAAW,EAAE,yDAAyD;aACtE;YACD;gBACC,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE;oBACZ,QAAQ,EAAE,CAAC;iBACX;gBACD,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,gDAAgD;aAC7D;SACD;KACD;CACD,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { IDataObject, ICredentialDataDecryptedObject } from 'n8n-workflow';
|
|
2
|
-
export declare function loadOpenApiSpec(url: string): Promise<any>;
|
|
3
|
-
export declare function executeOpenApiRequest(spec: any, method: string, path: string, parameters: IDataObject, requestBody: IDataObject, credentials?: ICredentialDataDecryptedObject): Promise<any>;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadOpenApiSpec = loadOpenApiSpec;
|
|
4
|
-
exports.executeOpenApiRequest = executeOpenApiRequest;
|
|
5
|
-
async function loadOpenApiSpec(url) {
|
|
6
|
-
try {
|
|
7
|
-
const response = await fetch(url);
|
|
8
|
-
if (!response.ok) {
|
|
9
|
-
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
10
|
-
}
|
|
11
|
-
return await response.json();
|
|
12
|
-
}
|
|
13
|
-
catch (error) {
|
|
14
|
-
throw new Error(`Failed to load OpenAPI spec: ${error.message}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
async function executeOpenApiRequest(spec, method, path, parameters, requestBody, credentials) {
|
|
18
|
-
const server = spec.servers && spec.servers.length > 0
|
|
19
|
-
? spec.servers[0].url
|
|
20
|
-
: '';
|
|
21
|
-
let urlPath = `${server}${path}`;
|
|
22
|
-
if (parameters && Array.isArray(parameters.parameter)) {
|
|
23
|
-
const pathParams = parameters.parameter.filter((param) => param.type === 'path');
|
|
24
|
-
for (const param of pathParams) {
|
|
25
|
-
urlPath = urlPath.replace(`{${param.name}}`, param.value);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
const queryParams = new URLSearchParams();
|
|
29
|
-
if (parameters && Array.isArray(parameters.parameter)) {
|
|
30
|
-
const queryParamItems = parameters.parameter.filter((param) => param.type === 'query');
|
|
31
|
-
for (const param of queryParamItems) {
|
|
32
|
-
queryParams.append(param.name, param.value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
const headers = {};
|
|
36
|
-
if (parameters && Array.isArray(parameters.parameter)) {
|
|
37
|
-
const headerParams = parameters.parameter.filter((param) => param.type === 'header');
|
|
38
|
-
for (const param of headerParams) {
|
|
39
|
-
headers[param.name] = param.value;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
if (credentials) {
|
|
43
|
-
if (credentials.apiKey) {
|
|
44
|
-
const keyName = credentials.apiKeyName || 'api-key';
|
|
45
|
-
const keyLocation = credentials.apiKeyLocation || 'header';
|
|
46
|
-
if (keyLocation === 'header') {
|
|
47
|
-
headers[keyName] = credentials.apiKey;
|
|
48
|
-
}
|
|
49
|
-
else if (keyLocation === 'query') {
|
|
50
|
-
queryParams.append(keyName, credentials.apiKey);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (credentials.username && credentials.password) {
|
|
54
|
-
const auth = Buffer.from(`${credentials.username}:${credentials.password}`).toString('base64');
|
|
55
|
-
headers['Authorization'] = `Basic ${auth}`;
|
|
56
|
-
}
|
|
57
|
-
else if (credentials.bearerToken) {
|
|
58
|
-
headers['Authorization'] = `Bearer ${credentials.bearerToken}`;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
const url = queryParams.toString() ? `${urlPath}?${queryParams.toString()}` : urlPath;
|
|
62
|
-
const options = {
|
|
63
|
-
method: method.toUpperCase(),
|
|
64
|
-
headers,
|
|
65
|
-
body: Object.keys(requestBody).length > 0 ? JSON.stringify(requestBody) : undefined,
|
|
66
|
-
};
|
|
67
|
-
try {
|
|
68
|
-
const response = await fetch(url, options);
|
|
69
|
-
if (!response.ok) {
|
|
70
|
-
const errorText = await response.text();
|
|
71
|
-
throw new Error(`Request failed with status code ${response.status}: ${errorText}`);
|
|
72
|
-
}
|
|
73
|
-
return await response.json();
|
|
74
|
-
}
|
|
75
|
-
catch (error) {
|
|
76
|
-
throw error instanceof Error ? error : new Error(String(error));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=OpenAPIHelper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAPIHelper.js","sourceRoot":"","sources":["../../../nodes/OpenAPINode/OpenAPIHelper.ts"],"names":[],"mappings":";;AAGA,0CAUC;AAGD,sDAoFC;AAjGM,KAAK,UAAU,eAAe,CAAC,GAAW;IAChD,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,uBAAuB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAClE,CAAC;AACF,CAAC;AAGM,KAAK,UAAU,qBAAqB,CAC1C,IAAS,EACT,MAAc,EACd,IAAY,EACZ,UAAuB,EACvB,WAAwB,EACxB,WA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AAQ,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;IAGtF,MAAM,OAAO,GAAgB;QAC5B,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;QAC5B,OAAO;QACP,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS;KACnF,CAAC;IAGF,IAAI,CAAC;QACJ,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAE3C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YAClB,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,mCAAmC,QAAQ,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC,CAAC;QACrF,CAAC;QAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACjE,CAAC;AACF,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IExecuteFunctions, INodeType, INodeTypeDescription, INodeExecutionData, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
-
export declare class OpenAPINode implements INodeType {
|
|
3
|
-
description: INodeTypeDescription;
|
|
4
|
-
methods: {
|
|
5
|
-
loadOptions: {
|
|
6
|
-
loadOperations(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
10
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OpenAPINode = void 0;
|
|
4
|
-
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
-
const OpenAPIDescription_1 = require("./OpenAPIDescription");
|
|
6
|
-
const OpenAPIHelper_1 = require("./OpenAPIHelper");
|
|
7
|
-
class OpenAPINode {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.description = {
|
|
10
|
-
displayName: 'OpenAPI',
|
|
11
|
-
name: 'openApiNode',
|
|
12
|
-
icon: 'file:openapi.svg',
|
|
13
|
-
group: ['transform'],
|
|
14
|
-
version: 1,
|
|
15
|
-
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
16
|
-
description: 'Consume any OpenAPI/Swagger based API',
|
|
17
|
-
defaults: {
|
|
18
|
-
name: 'OpenAPI',
|
|
19
|
-
},
|
|
20
|
-
inputs: ['main'],
|
|
21
|
-
outputs: ['main'],
|
|
22
|
-
credentials: [
|
|
23
|
-
{
|
|
24
|
-
name: 'openApiAuth',
|
|
25
|
-
required: false,
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
properties: [
|
|
29
|
-
{
|
|
30
|
-
displayName: 'OpenAPI Specification URL',
|
|
31
|
-
name: 'openApiUrl',
|
|
32
|
-
type: 'string',
|
|
33
|
-
default: '',
|
|
34
|
-
required: true,
|
|
35
|
-
description: 'URL of the OpenAPI/Swagger specification',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
displayName: 'Resource',
|
|
39
|
-
name: 'resource',
|
|
40
|
-
type: 'options',
|
|
41
|
-
noDataExpression: true,
|
|
42
|
-
options: [
|
|
43
|
-
{
|
|
44
|
-
name: 'API Endpoint',
|
|
45
|
-
value: 'apiEndpoint',
|
|
46
|
-
},
|
|
47
|
-
],
|
|
48
|
-
default: 'apiEndpoint',
|
|
49
|
-
},
|
|
50
|
-
...OpenAPIDescription_1.openApiOperations,
|
|
51
|
-
...OpenAPIDescription_1.openApiFields,
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
this.methods = {
|
|
55
|
-
loadOptions: {
|
|
56
|
-
async loadOperations() {
|
|
57
|
-
const openApiUrl = this.getNodeParameter('openApiUrl', 0);
|
|
58
|
-
try {
|
|
59
|
-
const spec = await (0, OpenAPIHelper_1.loadOpenApiSpec)(openApiUrl);
|
|
60
|
-
const operations = [];
|
|
61
|
-
for (const path in spec.paths) {
|
|
62
|
-
for (const method in spec.paths[path]) {
|
|
63
|
-
const operation = spec.paths[path][method];
|
|
64
|
-
operations.push({
|
|
65
|
-
name: `${method.toUpperCase()} ${path} - ${operation.summary || operation.operationId || ''}`,
|
|
66
|
-
value: `${method}:${path}`,
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
return operations;
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to load OpenAPI spec: ${error.message}`);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
async execute() {
|
|
80
|
-
const items = this.getInputData();
|
|
81
|
-
const returnItems = [];
|
|
82
|
-
const openApiUrl = this.getNodeParameter('openApiUrl', 0);
|
|
83
|
-
const spec = await (0, OpenAPIHelper_1.loadOpenApiSpec)(openApiUrl);
|
|
84
|
-
for (let i = 0; i < items.length; i++) {
|
|
85
|
-
try {
|
|
86
|
-
const operation = this.getNodeParameter('operation', i);
|
|
87
|
-
const [method, path] = operation.split(':');
|
|
88
|
-
const parameters = this.getNodeParameter('parameters', i, {});
|
|
89
|
-
const requestBody = this.getNodeParameter('requestBody', i, {});
|
|
90
|
-
const response = await (0, OpenAPIHelper_1.executeOpenApiRequest)(spec, method, path, parameters, requestBody, this.getCredentials('openApiAuth'));
|
|
91
|
-
returnItems.push({
|
|
92
|
-
json: response,
|
|
93
|
-
pairedItem: {
|
|
94
|
-
item: i,
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
if (this.continueOnFail()) {
|
|
100
|
-
returnItems.push({
|
|
101
|
-
json: {
|
|
102
|
-
error: error.message,
|
|
103
|
-
},
|
|
104
|
-
pairedItem: {
|
|
105
|
-
item: i,
|
|
106
|
-
},
|
|
107
|
-
});
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
throw error;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
return [returnItems];
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
exports.OpenAPINode = OpenAPINode;
|
|
117
|
-
//# sourceMappingURL=OpenAPINode.node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"OpenAPINode.node.js","sourceRoot":"","sources":["../../../nodes/OpenAPINode/OpenAPINode.node.ts"],"names":[],"mappings":";;;AASA,+CAAkD;AAClD,6DAAwE;AACxE,mDAAyE;AAEzE,MAAa,WAAW;IAAxB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE;gBACT,IAAI,EAAE,SAAS;aACf;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACZ;oBACC,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,KAAK;iBACf;aACD;YACD,UAAU,EAAE;gBACX;oBACC,WAAW,EAAE,2BAA2B;oBACxC,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,EAAE;oBACX,QAAQ,EAAE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AAI,CAAC;wBAChB,IAAI,EAAE;4BACL,KAAK,EAAE,KAAK,CAAC,OAAO;yBACpB;wBACD,UAAU,EAAE;4BACX,IAAI,EAAE,CAAC;yBACP;qBACD,CAAC,CAAC;oBACH,SAAS;gBACV,CAAC;gBACD,MAAM,KAAK,CAAC;YACb,CAAC;QACF,CAAC;QAED,OAAO,CAAC,WAAW,CAAC,CAAC;IACtB,CAAC;CACD;AAjID,kCAiIC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IAuthenticateGeneric, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
export declare class OpenApi implements ICredentialType {
|
|
3
|
-
name: string;
|
|
4
|
-
displayName: string;
|
|
5
|
-
documentationUrl: string;
|
|
6
|
-
properties: INodeProperties[];
|
|
7
|
-
authenticate: IAuthenticateGeneric;
|
|
8
|
-
test: {
|
|
9
|
-
request: {
|
|
10
|
-
baseURL: string;
|
|
11
|
-
url: string;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
}
|