Skip to content

Commit

Permalink
credential logo fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
anantanandgupta committed Oct 31, 2024
1 parent 1879959 commit 34bf4ab
Show file tree
Hide file tree
Showing 16 changed files with 660 additions and 644 deletions.
84 changes: 42 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@
* @type {import('@types/eslint').ESLint.ConfigData}
*/
module.exports = {
root: true,
root: true,

env: {
browser: true,
es6: true,
node: true,
},
env: {
browser: true,
es6: true,
node: true,
},

parser: '@typescript-eslint/parser',
parser: '@typescript-eslint/parser',

parserOptions: {
project: ['./tsconfig.json'],
sourceType: 'module',
extraFileExtensions: ['.json'],
},
parserOptions: {
project: ['./tsconfig.json'],
sourceType: 'module',
extraFileExtensions: ['.json'],
},

ignorePatterns: ['.eslintrc.js', '**/*.js', '**/node_modules/**', '**/dist/**'],
ignorePatterns: ['.eslintrc.js', '**/*.js', '**/node_modules/**', '**/dist/**'],

overrides: [
{
files: ['package.json'],
plugins: ['eslint-plugin-n8n-nodes-base'],
extends: ['plugin:n8n-nodes-base/community'],
rules: {
'n8n-nodes-base/community-package-json-name-still-default': 'off',
},
},
{
files: ['./credentials/**/*.ts'],
plugins: ['eslint-plugin-n8n-nodes-base'],
extends: ['plugin:n8n-nodes-base/credentials'],
rules: {
'n8n-nodes-base/cred-class-field-documentation-url-missing': 'off',
'n8n-nodes-base/cred-class-field-documentation-url-miscased': 'off',
},
},
{
files: ['./nodes/**/*.ts'],
plugins: ['eslint-plugin-n8n-nodes-base'],
extends: ['plugin:n8n-nodes-base/nodes'],
rules: {
'n8n-nodes-base/node-execute-block-missing-continue-on-fail': 'off',
'n8n-nodes-base/node-resource-description-filename-against-convention': 'off',
'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off',
},
},
],
overrides: [
{
files: ['package.json'],
plugins: ['eslint-plugin-n8n-nodes-base'],
extends: ['plugin:n8n-nodes-base/community'],
rules: {
'n8n-nodes-base/community-package-json-name-still-default': 'off',
},
},
{
files: ['./credentials/**/*.ts'],
plugins: ['eslint-plugin-n8n-nodes-base'],
extends: ['plugin:n8n-nodes-base/credentials'],
rules: {
'n8n-nodes-base/cred-class-field-documentation-url-missing': 'off',
'n8n-nodes-base/cred-class-field-documentation-url-miscased': 'off',
},
},
{
files: ['./nodes/**/*.ts'],
plugins: ['eslint-plugin-n8n-nodes-base'],
extends: ['plugin:n8n-nodes-base/nodes'],
rules: {
'n8n-nodes-base/node-execute-block-missing-continue-on-fail': 'off',
'n8n-nodes-base/node-resource-description-filename-against-convention': 'off',
'n8n-nodes-base/node-param-fixed-collection-type-unsorted-items': 'off',
},
},
],
};
20 changes: 10 additions & 10 deletions .eslintrc.prepublish.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
* @type {import('@types/eslint').ESLint.ConfigData}
*/
module.exports = {
extends: "./.eslintrc.js",
extends: "./.eslintrc.js",

overrides: [
{
files: ['package.json'],
plugins: ['eslint-plugin-n8n-nodes-base'],
rules: {
'n8n-nodes-base/community-package-json-name-still-default': 'error',
},
},
],
overrides: [
{
files: ['package.json'],
plugins: ['eslint-plugin-n8n-nodes-base'],
rules: {
'n8n-nodes-base/community-package-json-name-still-default': 'error',
},
},
],
};
98 changes: 49 additions & 49 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
module.exports = {
/**
* https://prettier.io/docs/en/options.html#semicolons
*/
semi: true,

/**
* https://prettier.io/docs/en/options.html#trailing-commas
*/
trailingComma: 'all',

/**
* https://prettier.io/docs/en/options.html#bracket-spacing
*/
bracketSpacing: true,

/**
* https://prettier.io/docs/en/options.html#tabs
*/
useTabs: true,

/**
* https://prettier.io/docs/en/options.html#tab-width
*/
tabWidth: 2,

/**
* https://prettier.io/docs/en/options.html#arrow-function-parentheses
*/
arrowParens: 'always',

/**
* https://prettier.io/docs/en/options.html#quotes
*/
singleQuote: true,

/**
* https://prettier.io/docs/en/options.html#quote-props
*/
quoteProps: 'as-needed',

/**
* https://prettier.io/docs/en/options.html#end-of-line
*/
endOfLine: 'lf',

/**
* https://prettier.io/docs/en/options.html#print-width
*/
printWidth: 100,
/**
* https://prettier.io/docs/en/options.html#semicolons
*/
semi: true,

/**
* https://prettier.io/docs/en/options.html#trailing-commas
*/
trailingComma: 'all',

/**
* https://prettier.io/docs/en/options.html#bracket-spacing
*/
bracketSpacing: true,

/**
* https://prettier.io/docs/en/options.html#tabs
*/
useTabs: true,

/**
* https://prettier.io/docs/en/options.html#tab-width
*/
tabWidth: 2,

/**
* https://prettier.io/docs/en/options.html#arrow-function-parentheses
*/
arrowParens: 'always',

/**
* https://prettier.io/docs/en/options.html#quotes
*/
singleQuote: true,

/**
* https://prettier.io/docs/en/options.html#quote-props
*/
quoteProps: 'as-needed',

/**
* https://prettier.io/docs/en/options.html#end-of-line
*/
endOfLine: 'lf',

/**
* https://prettier.io/docs/en/options.html#print-width
*/
printWidth: 100,
};
10 changes: 5 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
]
"recommendations": [
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
There is only one node in this package capable of interacting with below resources and respective operations:

- Short Links
- Create short url *(v0.0.1)*
- List short urls *(v0.0.2)*
- more options coming soon ...
- Create short url *(v0.0.1)*
- List short urls *(v0.0.2)*
- more options coming soon ...

## Credentials

Expand Down
9 changes: 9 additions & 0 deletions credentials/Shlink.icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions credentials/ShlinkApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
import { IAuthenticate, ICredentialType, INodeProperties } from 'n8n-workflow';

import { IAuthenticate, IconFile, ICredentialType, INodeProperties } from 'n8n-workflow';
const icon: IconFile = 'file:Shlink.icon.svg';
export class ShlinkApi implements ICredentialType {
name = 'shlinkApi';
icon = {
dark: icon,
light: icon,
};
displayName = 'Shlink API';
documentationUrl: string = 'https://shlink.io/documentation/api-docs/authentication/';
authenticate: IAuthenticate = {
type: 'generic',
properties: {
headers: {
'x-api-key': '={{ $credentials["apiKey"] }}'
}
}
'x-api-key': '={{ $credentials["apiKey"] }}',
},
},
};
properties: INodeProperties[] = [
{
Expand All @@ -21,7 +25,7 @@ export class ShlinkApi implements ICredentialType {
password: true,
},
required: true,
default: ''
default: '',
},
{
displayName: 'Host',
Expand Down
12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ const { task, src, dest } = require('gulp');
task('build:icons', copyIcons);

function copyIcons() {
const nodeSource = path.resolve('nodes', '**', '*.{png,svg}');
const nodeDestination = path.resolve('dist', 'nodes');
const nodeSource = path.resolve('nodes', '**', '*.{png,svg}');
const nodeDestination = path.resolve('dist', 'nodes');

src(nodeSource).pipe(dest(nodeDestination));
src(nodeSource).pipe(dest(nodeDestination));

const credSource = path.resolve('credentials', '**', '*.{png,svg}');
const credDestination = path.resolve('dist', 'credentials');
const credSource = path.resolve('credentials', '**', '*.{png,svg}');
const credDestination = path.resolve('dist', 'credentials');

return src(credSource).pipe(dest(credDestination));
return src(credSource).pipe(dest(credDestination));
}
32 changes: 16 additions & 16 deletions nodes/Shlink/Shlink.node.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"node": "n8n-nodes-base.Shlink",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Communication", "Sales", "Marketing & Content"],
"resources": {
"credentialDocumentation": [
{
"url": "https://shlink.io/documentation/api-docs/authentication/"
}
],
"primaryDocumentation": [
{
"url": "https://shlink.io/documentation/api-docs/authentication/"
}
]
}
"node": "n8n-nodes-base.Shlink",
"nodeVersion": "1.0",
"codexVersion": "1.0",
"categories": ["Communication", "Sales", "Marketing & Content"],
"resources": {
"credentialDocumentation": [
{
"url": "https://shlink.io/documentation/api-docs/authentication/"
}
],
"primaryDocumentation": [
{
"url": "https://shlink.io/documentation/api-docs/authentication/"
}
]
}
}
14 changes: 7 additions & 7 deletions nodes/Shlink/Shlink.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import { shortURLsOperationOptions } from "./operations";
export class Shlink implements INodeType {
description: INodeTypeDescription = {
displayName: 'Shlink',
name: 'shlink',
icon: {
name: 'shlink',
icon: {
dark: 'file:Shlink.icon.svg',
light: 'file:Shlink.icon.svg',
},
group: ['transform'],
version: [1],
defaultVersion: 1,
subtitle: '={{ $parameter["resource"] + " (" + $parameter["operation"] + ")" }}',
description: 'Call Shlink endpoints.',
description: 'Call Shlink endpoints.',
defaults: {
name: 'Shlink',
},
Expand All @@ -33,9 +33,9 @@ export class Shlink implements INodeType {
'Content-Type': 'application/json',
}
},
properties: [
resourceOptions,
properties: [
resourceOptions,
...shortURLsOperationOptions,
]
};
]
};
}
Loading

0 comments on commit 34bf4ab

Please sign in to comment.