diff --git a/.gitignore b/.gitignore index 885ade0..4960213 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ +# 依赖包 node_modules/ +# 目标文件夹 dist/ +# IDE 配置文件夹 .vscode/ diff --git a/credentials/GwezzOceanengineOAuth2Api.credentials.ts b/credentials/GwezzOceanengineOAuth2Api.credentials.ts index e6326a7..a8c3eba 100644 --- a/credentials/GwezzOceanengineOAuth2Api.credentials.ts +++ b/credentials/GwezzOceanengineOAuth2Api.credentials.ts @@ -1,13 +1,14 @@ -import type { ICredentialType, INodeProperties } from 'n8n-workflow'; +import type { ICredentialType, INodeProperties, Icon } from 'n8n-workflow'; export class GwezzOceanengineOAuth2Api implements ICredentialType { name = 'gwezzOceanengineOAuth2Api'; extends = ['oAuth2Api']; - displayName = 'Gwezz Oceanengine OAuth2 API'; + displayName = 'Gwezz Ocean Engine OAuth2 API'; + + icon = { light: 'file:../icons/gwezz.svg', dark: 'file:../icons/gwezz.dark.svg' } as Icon; - // Link to your community node's README documentationUrl = 'https://github.com/org/-gwezz-oceanengine?tab=readme-ov-file#credentials'; properties: INodeProperties[] = [ diff --git a/icons/gwezz.dark.svg b/icons/gwezz.dark.svg new file mode 100644 index 0000000..66ccfa5 --- /dev/null +++ b/icons/gwezz.dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/icons/gwezz.svg b/icons/gwezz.svg new file mode 100644 index 0000000..66ccfa5 --- /dev/null +++ b/icons/gwezz.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/nodes/GwezzOceanengine/GwezzOceanengine.node.ts b/nodes/GwezzOceanengine/GwezzOceanengine.node.ts index 62ea9cf..a8c63f7 100644 --- a/nodes/GwezzOceanengine/GwezzOceanengine.node.ts +++ b/nodes/GwezzOceanengine/GwezzOceanengine.node.ts @@ -1,33 +1,26 @@ -import { NodeConnectionType, type INodeType, type INodeTypeDescription } from 'n8n-workflow'; +import { type INodeType, type INodeTypeDescription } from 'n8n-workflow'; import { userDescription } from './resources/user'; import { companyDescription } from './resources/company'; export class GwezzOceanengine implements INodeType { description: INodeTypeDescription = { - displayName: 'Gwezz Oceanengine', + displayName: 'Gwezz Ocean Engine', name: 'gwezzOceanengine', - icon: { light: 'file:gwezzOceanengine.svg', dark: 'file:gwezzOceanengine.dark.svg' }, + icon: { light: 'file:../../icons/gwezz.svg', dark: 'file:../../icons/gwezz.dark.svg' }, group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', - description: 'Interact with the Gwezz Oceanengine API', + description: 'Interact with the Gwezz Ocean Engine API', defaults: { - name: 'Gwezz Oceanengine', + name: 'Gwezz Ocean Engine', }, usableAsTool: true, - inputs: [NodeConnectionType.Main], - outputs: [NodeConnectionType.Main], + inputs: ['main'], + outputs: ['main'], credentials: [{ name: 'gwezzOceanengineOAuth2Api', required: true }], - requestDefaults: { - baseURL: 'https://api.oceanengine.com/open_api/v3.0', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - }, - }, properties: [ { - displayName: 'Resource', + displayName: '资源', name: 'resource', type: 'options', noDataExpression: true, diff --git a/nodes/GwezzOceanengine/gwezzOceanengine.dark.svg b/nodes/GwezzOceanengine/gwezzOceanengine.dark.svg deleted file mode 100644 index c07cb10..0000000 --- a/nodes/GwezzOceanengine/gwezzOceanengine.dark.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - diff --git a/nodes/GwezzOceanengine/gwezzOceanengine.svg b/nodes/GwezzOceanengine/gwezzOceanengine.svg deleted file mode 100644 index 703e1fe..0000000 --- a/nodes/GwezzOceanengine/gwezzOceanengine.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - diff --git a/package.json b/package.json index 86ccd1c..79d8fd2 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,19 @@ { "name": "n8n-nodes-gwezz-oceanengine", "version": "0.1.0", - "description": "", + "description": "n8n community node to integrate with Ocean Engine (ByteDance) APIs.", "license": "MIT", "homepage": "", - "keywords": ["n8n-community-node-package"], - "author": { "name": "sshelgwezz", "email": "sshelgwezz@foxmail.com" }, + "keywords": [ + "n8n-community-node-package" + ], + "author": { + "name": "sshelgwezz", + "email": "sshelgwezz@foxmail.com" + }, "repository": { "type": "git", - "url": "https://github.com/<...>/n8n-nodes-<...>.git" + "url": "https://gitea.gwezz.com/n8n-nodes/n8n-nodes-gwezz-oceanengine.git" }, "scripts": { "build": "n8n-node build", @@ -19,14 +24,18 @@ "release": "n8n-node release", "prepublishOnly": "n8n-node prerelease" }, - "files": ["dist"], + "files": [ + "dist" + ], "n8n": { "n8nNodesApiVersion": 1, "strict": true, "credentials": [ "dist/credentials/GwezzOceanengineOAuth2Api.credentials.js" ], - "nodes": ["dist/nodes/GwezzOceanengine/GwezzOceanengine.node.js"] + "nodes": [ + "dist/nodes/GwezzOceanengine/GwezzOceanengine.node.js" + ] }, "devDependencies": { "@n8n/node-cli": "*", @@ -35,5 +44,7 @@ "release-it": "^19.0.4", "typescript": "5.9.2" }, - "peerDependencies": { "n8n-workflow": "*" } -} + "peerDependencies": { + "n8n-workflow": "*" + } +} \ No newline at end of file