mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat: Create NPM node (#6177)
This commit is contained in:
committed by
GitHub
parent
80831cd7c6
commit
f3bc6f19b6
46
packages/nodes-base/credentials/NpmApi.credentials.ts
Normal file
46
packages/nodes-base/credentials/NpmApi.credentials.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type {
|
||||
IAuthenticateGeneric,
|
||||
ICredentialTestRequest,
|
||||
ICredentialType,
|
||||
INodeProperties,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
export class NpmApi implements ICredentialType {
|
||||
name = 'npmApi';
|
||||
|
||||
displayName = 'Npm API';
|
||||
|
||||
documentationUrl = 'npm';
|
||||
|
||||
properties: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Access Token',
|
||||
name: 'accessToken',
|
||||
type: 'string',
|
||||
typeOptions: { password: true },
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Registry Url',
|
||||
name: 'registryUrl',
|
||||
type: 'string',
|
||||
default: 'https://registry.npmjs.org',
|
||||
},
|
||||
];
|
||||
|
||||
authenticate: IAuthenticateGeneric = {
|
||||
type: 'generic',
|
||||
properties: {
|
||||
headers: {
|
||||
Authorization: '=Bearer {{$credentials.accessToken}}',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
test: ICredentialTestRequest = {
|
||||
request: {
|
||||
baseURL: '={{$credentials.registryUrl}}',
|
||||
url: '/-/whoami',
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user