From ac43632800fff4fe606d1a2f03f6e3aa13834cd7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 19:35:28 +0000 Subject: [PATCH] chore: Remove template and example files Removes unused template and example files from the n8n custom node package: - credentials/ExampleCredentialsApi.credentials.ts - credentials/HttpBinApi.credentials.ts - nodes/ExampleNode/ (directory) - nodes/HttpBin/ (directory) - README_TEMPLATE.md Updates `package.json` to remove references to these deleted files in the `n8n.credentials` and `n8n.nodes` sections. --- README_TEMPLATE.md | 48 ---- .../ExampleCredentialsApi.credentials.ts | 59 ----- credentials/HttpBinApi.credentials.ts | 50 ---- nodes/ExampleNode/ExampleNode.node.ts | 77 ------ nodes/HttpBin/HttpBin.node.json | 18 -- nodes/HttpBin/HttpBin.node.ts | 62 ----- nodes/HttpBin/HttpVerbDescription.ts | 250 ------------------ nodes/HttpBin/httpbin.svg | 18 -- package.json | 4 - 9 files changed, 586 deletions(-) delete mode 100644 README_TEMPLATE.md delete mode 100644 credentials/ExampleCredentialsApi.credentials.ts delete mode 100644 credentials/HttpBinApi.credentials.ts delete mode 100644 nodes/ExampleNode/ExampleNode.node.ts delete mode 100644 nodes/HttpBin/HttpBin.node.json delete mode 100644 nodes/HttpBin/HttpBin.node.ts delete mode 100644 nodes/HttpBin/HttpVerbDescription.ts delete mode 100644 nodes/HttpBin/httpbin.svg diff --git a/README_TEMPLATE.md b/README_TEMPLATE.md deleted file mode 100644 index a8d7860..0000000 --- a/README_TEMPLATE.md +++ /dev/null @@ -1,48 +0,0 @@ -# n8n-nodes-_node-name_ - -This is an n8n community node. It lets you use _app/service name_ in your n8n workflows. - -_App/service name_ is _one or two sentences describing the service this node integrates with_. - -[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform. - -[Installation](#installation) -[Operations](#operations) -[Credentials](#credentials) -[Compatibility](#compatibility) -[Usage](#usage) -[Resources](#resources) -[Version history](#version-history) - -## Installation - -Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation. - -## Operations - -_List the operations supported by your node._ - -## Credentials - -_If users need to authenticate with the app/service, provide details here. You should include prerequisites (such as signing up with the service), available authentication methods, and how to set them up._ - -## Compatibility - -_State the minimum n8n version, as well as which versions you test against. You can also include any known version incompatibility issues._ - -## Usage - -_This is an optional section. Use it to help users with any difficult or confusing aspects of the node._ - -_By the time users are looking for community nodes, they probably already know n8n basics. But if you expect new users, you can link to the [Try it out](https://docs.n8n.io/try-it-out/) documentation to help them get started._ - -## Resources - -* [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes) -* _Link to app/service documentation._ - -## Version history - -_This is another optional section. If your node has multiple versions, include a short description of available versions and what changed, as well as any compatibility impact._ - - diff --git a/credentials/ExampleCredentialsApi.credentials.ts b/credentials/ExampleCredentialsApi.credentials.ts deleted file mode 100644 index 79a6ac2..0000000 --- a/credentials/ExampleCredentialsApi.credentials.ts +++ /dev/null @@ -1,59 +0,0 @@ -import { - IAuthenticateGeneric, - ICredentialTestRequest, - ICredentialType, - INodeProperties, -} from 'n8n-workflow'; - -export class ExampleCredentialsApi implements ICredentialType { - name = 'exampleCredentialsApi'; - displayName = 'Example Credentials API'; - - documentationUrl = 'https://your-docs-url'; - - properties: INodeProperties[] = [ - // The credentials to get from user and save encrypted. - // Properties can be defined exactly in the same way - // as node properties. - { - displayName: 'User Name', - name: 'username', - type: 'string', - default: '', - }, - { - displayName: 'Password', - name: 'password', - type: 'string', - typeOptions: { - password: true, - }, - default: '', - }, - ]; - - // This credential is currently not used by any node directly - // but the HTTP Request node can use it to make requests. - // The credential is also testable due to the `test` property below - authenticate: IAuthenticateGeneric = { - type: 'generic', - properties: { - auth: { - username: '={{ $credentials.username }}', - password: '={{ $credentials.password }}', - }, - qs: { - // Send this as part of the query string - n8n: 'rocks', - }, - }, - }; - - // The block below tells how this credential can be tested - test: ICredentialTestRequest = { - request: { - baseURL: 'https://example.com/', - url: '', - }, - }; -} diff --git a/credentials/HttpBinApi.credentials.ts b/credentials/HttpBinApi.credentials.ts deleted file mode 100644 index b9772e4..0000000 --- a/credentials/HttpBinApi.credentials.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { - IAuthenticateGeneric, - ICredentialTestRequest, - ICredentialType, - INodeProperties, -} from 'n8n-workflow'; - -export class HttpBinApi implements ICredentialType { - name = 'httpbinApi'; - displayName = 'HttpBin API'; - documentationUrl = 'https://your-docs-url'; - properties: INodeProperties[] = [ - { - displayName: 'Token', - name: 'token', - type: 'string', - default: '', - typeOptions: { - password: true, - } - }, - { - displayName: 'Domain', - name: 'domain', - type: 'string', - default: 'https://httpbin.org', - }, - ]; - - // This allows the credential to be used by other parts of n8n - // stating how this credential is injected as part of the request - // An example is the Http Request node that can make generic calls - // reusing this credential - authenticate: IAuthenticateGeneric = { - type: 'generic', - properties: { - headers: { - Authorization: '={{"Bearer " + $credentials.token}}', - }, - }, - }; - - // The block below tells how this credential can be tested - test: ICredentialTestRequest = { - request: { - baseURL: '={{$credentials?.domain}}', - url: '/bearer', - }, - }; -} diff --git a/nodes/ExampleNode/ExampleNode.node.ts b/nodes/ExampleNode/ExampleNode.node.ts deleted file mode 100644 index 1e0c9f6..0000000 --- a/nodes/ExampleNode/ExampleNode.node.ts +++ /dev/null @@ -1,77 +0,0 @@ -import type { - IExecuteFunctions, - INodeExecutionData, - INodeType, - INodeTypeDescription, -} from 'n8n-workflow'; -import { NodeConnectionType, NodeOperationError } from 'n8n-workflow'; - -export class ExampleNode implements INodeType { - description: INodeTypeDescription = { - displayName: 'Example Node', - name: 'exampleNode', - group: ['transform'], - version: 1, - description: 'Basic Example Node', - defaults: { - name: 'Example Node', - }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], - usableAsTool: true, - properties: [ - // Node properties which the user gets displayed and - // can change on the node. - { - displayName: 'My String', - name: 'myString', - type: 'string', - default: '', - placeholder: 'Placeholder value', - description: 'The description text', - }, - ], - }; - - // The function below is responsible for actually doing whatever this node - // is supposed to do. In this case, we're just appending the `myString` property - // with whatever the user has entered. - // You can make async calls and use `await`. - async execute(this: IExecuteFunctions): Promise { - const items = this.getInputData(); - - let item: INodeExecutionData; - let myString: string; - - // Iterates over all input items and add the key "myString" with the - // value the parameter "myString" resolves to. - // (This could be a different value for each item in case it contains an expression) - for (let itemIndex = 0; itemIndex < items.length; itemIndex++) { - try { - myString = this.getNodeParameter('myString', itemIndex, '') as string; - item = items[itemIndex]; - - item.json.myString = myString; - } catch (error) { - // This node should never fail but we want to showcase how - // to handle errors. - if (this.continueOnFail()) { - items.push({ json: this.getInputData(itemIndex)[0].json, error, pairedItem: itemIndex }); - } else { - // Adding `itemIndex` allows other workflows to handle this error - if (error.context) { - // If the error thrown already contains the context property, - // only append the itemIndex - error.context.itemIndex = itemIndex; - throw error; - } - throw new NodeOperationError(this.getNode(), error, { - itemIndex, - }); - } - } - } - - return [items]; - } -} diff --git a/nodes/HttpBin/HttpBin.node.json b/nodes/HttpBin/HttpBin.node.json deleted file mode 100644 index 2e5596c..0000000 --- a/nodes/HttpBin/HttpBin.node.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "node": "n8n-nodes-base.httpbin", - "nodeVersion": "1.0", - "codexVersion": "1.0", - "categories": ["Development", "Developer Tools"], - "resources": { - "credentialDocumentation": [ - { - "url": "http://httpbin.org/#/Auth/get_bearer" - } - ], - "primaryDocumentation": [ - { - "url": "http://httpbin.org/" - } - ] - } -} diff --git a/nodes/HttpBin/HttpBin.node.ts b/nodes/HttpBin/HttpBin.node.ts deleted file mode 100644 index fb84212..0000000 --- a/nodes/HttpBin/HttpBin.node.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { INodeType, INodeTypeDescription, NodeConnectionType } from 'n8n-workflow'; -import { httpVerbFields, httpVerbOperations } from './HttpVerbDescription'; - -export class HttpBin implements INodeType { - description: INodeTypeDescription = { - displayName: 'HttpBin', - name: 'httpBin', - icon: 'file:httpbin.svg', - group: ['transform'], - version: 1, - subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', - description: 'Interact with HttpBin API', - defaults: { - name: 'HttpBin', - }, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], - credentials: [ - { - name: 'httpbinApi', - required: false, - }, - ], - requestDefaults: { - baseURL: 'https://httpbin.org', - url: '', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - }, - }, - /** - * In the properties array we have two mandatory options objects required - * - * [Resource & Operation] - * - * https://docs.n8n.io/integrations/creating-nodes/code/create-first-node/#resources-and-operations - * - * In our example, the operations are separated into their own file (HTTPVerbDescription.ts) - * to keep this class easy to read. - * - */ - properties: [ - { - displayName: 'Resource', - name: 'resource', - type: 'options', - noDataExpression: true, - options: [ - { - name: 'HTTP Verb', - value: 'httpVerb', - }, - ], - default: 'httpVerb', - }, - - ...httpVerbOperations, - ...httpVerbFields, - ], - }; -} diff --git a/nodes/HttpBin/HttpVerbDescription.ts b/nodes/HttpBin/HttpVerbDescription.ts deleted file mode 100644 index fc8aac4..0000000 --- a/nodes/HttpBin/HttpVerbDescription.ts +++ /dev/null @@ -1,250 +0,0 @@ -import { INodeProperties } from 'n8n-workflow'; - -// When the resource `httpVerb` is selected, this `operation` parameter will be shown. -export const httpVerbOperations: INodeProperties[] = [ - { - displayName: 'Operation', - name: 'operation', - type: 'options', - noDataExpression: true, - - displayOptions: { - show: { - resource: ['httpVerb'], - }, - }, - options: [ - { - name: 'GET', - value: 'get', - description: 'Perform a GET request', - action: 'Perform a GET request', - routing: { - request: { - method: 'GET', - url: '/get', - }, - }, - }, - { - name: 'DELETE', - value: 'delete', - description: 'Perform a DELETE request', - action: 'Perform a DELETE request', - routing: { - request: { - method: 'DELETE', - url: '/delete', - }, - }, - }, - ], - default: 'get', - }, -]; - -// Here we define what to show when the `get` operation is selected. -// We do that by adding `operation: ["get"]` to `displayOptions.show` -const getOperation: INodeProperties[] = [ - { - displayName: 'Type of Data', - name: 'typeofData', - default: 'queryParameter', - description: 'Select type of data to send [Query Parameters]', - displayOptions: { - show: { - resource: ['httpVerb'], - operation: ['get'], - }, - }, - type: 'options', - options: [ - { - name: 'Query', - value: 'queryParameter', - }, - ], - required: true, - }, - { - displayName: 'Query Parameters', - name: 'arguments', - default: {}, - description: "The request's query parameters", - displayOptions: { - show: { - resource: ['httpVerb'], - operation: ['get'], - }, - }, - options: [ - { - name: 'keyvalue', - displayName: 'Key:Value', - values: [ - { - displayName: 'Key', - name: 'key', - type: 'string', - default: '', - required: true, - description: 'Key of query parameter', - }, - { - displayName: 'Value', - name: 'value', - type: 'string', - default: '', - routing: { - send: { - property: '={{$parent.key}}', - type: 'query', - }, - }, - required: true, - description: 'Value of query parameter', - }, - ], - }, - ], - type: 'fixedCollection', - typeOptions: { - multipleValues: true, - }, - }, -]; - -// Here we define what to show when the DELETE Operation is selected. -// We do that by adding `operation: ["delete"]` to `displayOptions.show` -const deleteOperation: INodeProperties[] = [ - { - displayName: 'Type of Data', - name: 'typeofData', - default: 'queryParameter', - description: 'Select type of data to send [Query Parameter Arguments, JSON-Body]', - displayOptions: { - show: { - resource: ['httpVerb'], - operation: ['delete'], - }, - }, - options: [ - { - name: 'Query', - value: 'queryParameter', - }, - { - name: 'JSON', - value: 'jsonData', - }, - ], - required: true, - type: 'options', - }, - { - displayName: 'Query Parameters', - name: 'arguments', - default: {}, - description: "The request's query parameters", - displayOptions: { - show: { - resource: ['httpVerb'], - operation: ['delete'], - typeofData: ['queryParameter'], - }, - }, - options: [ - { - name: 'keyvalue', - displayName: 'Key:Value', - values: [ - { - displayName: 'Key', - name: 'key', - type: 'string', - default: '', - required: true, - description: 'Key of query parameter', - }, - { - displayName: 'Value', - name: 'value', - type: 'string', - default: '', - routing: { - send: { - property: '={{$parent.key}}', - type: 'query', - }, - }, - required: true, - description: 'Value of query parameter', - }, - ], - }, - ], - type: 'fixedCollection', - typeOptions: { - multipleValues: true, - }, - }, - { - displayName: 'JSON Object', - name: 'arguments', - default: {}, - description: "The request's JSON properties", - displayOptions: { - show: { - resource: ['httpVerb'], - operation: ['delete'], - typeofData: ['jsonData'], - }, - }, - options: [ - { - name: 'keyvalue', - displayName: 'Key:Value', - values: [ - { - displayName: 'Key', - name: 'key', - type: 'string', - default: '', - required: true, - description: 'Key of JSON property', - }, - { - displayName: 'Value', - name: 'value', - type: 'string', - default: '', - routing: { - send: { - property: '={{$parent.key}}', - type: 'body', - }, - }, - required: true, - description: 'Value of JSON property', - }, - ], - }, - ], - type: 'fixedCollection', - typeOptions: { - multipleValues: true, - }, - }, -]; - -export const httpVerbFields: INodeProperties[] = [ - /* -------------------------------------------------------------------------- */ - /* httpVerb:get */ - /* -------------------------------------------------------------------------- */ - ...getOperation, - - /* -------------------------------------------------------------------------- */ - /* httpVerb:delete */ - /* -------------------------------------------------------------------------- */ - ...deleteOperation, -]; diff --git a/nodes/HttpBin/httpbin.svg b/nodes/HttpBin/httpbin.svg deleted file mode 100644 index aee1de1..0000000 --- a/nodes/HttpBin/httpbin.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - diff --git a/package.json b/package.json index 4a10fce..0088c36 100644 --- a/package.json +++ b/package.json @@ -34,13 +34,9 @@ "n8n": { "n8nNodesApiVersion": 1, "credentials": [ - "dist/credentials/ExampleCredentialsApi.credentials.js", - "dist/credentials/HttpBinApi.credentials.js", "dist/credentials/ResendApi.credentials.js" ], "nodes": [ - "dist/nodes/ExampleNode/ExampleNode.node.js", - "dist/nodes/HttpBin/HttpBin.node.js", "dist/nodes/Resend/Resend.node.js", "dist/nodes/Resend/ResendTrigger.node.js" ]