n8n-nodes-test-node 1.0.6 → 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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # n8n-nodes-test-node
2
2
 
3
- Auto-generated n8n community node for the **IPstack API** API (spec version 1.0.0), built from its OpenAPI document.
3
+ Auto-generated n8n community node for the **Swagger Petstore** API (spec version 1.0.7), built from its OpenAPI document.
4
4
 
5
5
  ## Install
6
6
 
@@ -14,16 +14,25 @@ npm install n8n-nodes-test-node
14
14
 
15
15
  ## What was generated
16
16
 
17
- - 2 resource(s), 2 operation(s).
18
- - Credential type **iPstackAPIApi**, with an editable **Base URL** field (the spec declared no security requirements, so this credential only holds the Base URL).
19
- - Default Base URL: `https://api.ipstack.com` (override it in the credential's "Base URL" field to point at a different environment)
17
+ - 3 resource(s), 13 operation(s).
18
+ - Credential type **swaggerPetstoreApi**, with an editable **Base URL** field, plus: API Key / Bearer token field(s) per the spec's security scheme.
19
+ - Default Base URL: `https://petstore.swagger.io/v2` (override it in the credential's "Base URL" field to point at a different environment)
20
+ - **7 operation(s) from the spec were left out** because their only auth option isn't usable by this node's credential:
21
+ - `POST /pet/{petId}/uploadImage` (requires "petstore_auth")
22
+ - `PUT /pet` (requires "petstore_auth")
23
+ - `POST /pet` (requires "petstore_auth")
24
+ - `GET /pet/findByStatus` (requires "petstore_auth")
25
+ - `GET /pet/findByTags` (requires "petstore_auth")
26
+ - `POST /pet/{petId}` (requires "petstore_auth")
27
+ - `DELETE /pet/{petId}` (requires "petstore_auth")
20
28
 
21
29
  ## Limitations
22
30
 
23
31
  - 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.
32
+ - Supported authentication: **API Key** (header or query), **HTTP Bearer**, **HTTP Basic**, and **OAuth2** (authorization code or client credentials flow only -- not implicit or password grants). Anything else (OpenID Connect, HTTP Digest, mutual TLS) is refused at generation time rather than silently broken.
33
+ - OAuth2 and HTTP Basic each use n8n's own built-in credential mechanism and can't be combined with each other or with API Key/Bearer in one credential. If a spec declares more than one auth *family* as alternatives, this generator picks one deterministically -- **OAuth2 > HTTP Basic > API Key/Bearer** -- and the rest are ignored (logged during generation, and listed above if applicable). Multiple schemes *within* the API Key/Bearer family are still combined into one credential.
34
+ - If some operations require only an unsupported scheme while others are covered by this node's credential (the classic Swagger Petstore spec is a real example -- OAuth2 implicit flow for writes, an API key for some reads), the unsupported operations are left out of the node rather than the whole build failing -- see above for which ones, if any.
25
35
  - Request bodies with nested objects, arrays, or genuine `oneOf`/`anyOf`/`allOf` type unions are exposed as a single raw "Body (JSON)" field rather than individual fields. A nullable/optional primitive field (OpenAPI 3.1's `anyOf: [{type: 'string'}, {type: 'null'}]`, as FastAPI/Pydantic generates for `Optional[str]`) is still recognized as simple and gets its own field.
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
36
 
28
37
  ## Regenerating
29
38
 
@@ -0,0 +1,9 @@
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
+ export declare class SwaggerPetstoreApi implements ICredentialType {
3
+ name: string;
4
+ displayName: string;
5
+ documentationUrl: string;
6
+ properties: INodeProperties[];
7
+ authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
9
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwaggerPetstoreApi = void 0;
4
+ class SwaggerPetstoreApi {
5
+ constructor() {
6
+ this.name = 'swaggerPetstoreApi';
7
+ this.displayName = 'Swagger Petstore API';
8
+ this.documentationUrl = '';
9
+ this.properties = [
10
+ {
11
+ displayName: 'Base URL',
12
+ name: 'baseUrl',
13
+ type: 'string',
14
+ default: 'https://petstore.swagger.io/v2',
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: 'api_key (API Key)',
20
+ name: 'apiKey',
21
+ type: 'string',
22
+ typeOptions: { password: true },
23
+ default: '',
24
+ required: true,
25
+ description: 'Sent as the "api_key" header on every request.',
26
+ },
27
+ ];
28
+ this.authenticate = {
29
+ type: 'generic',
30
+ properties: {
31
+ headers: {
32
+ api_key: '={{$credentials.apiKey}}',
33
+ },
34
+ },
35
+ };
36
+ this.test = {
37
+ request: {
38
+ baseURL: '={{$credentials.baseUrl}}',
39
+ url: '/user/logout',
40
+ method: 'GET',
41
+ },
42
+ };
43
+ }
44
+ }
45
+ exports.SwaggerPetstoreApi = SwaggerPetstoreApi;
@@ -1,4 +1,4 @@
1
1
  import type { INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class HarToOpenApiNode implements INodeType {
2
+ export declare class SwaggerPetstoreNode implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  }