mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat: Create NPM node (#6177)
This commit is contained in:
committed by
GitHub
parent
80831cd7c6
commit
f3bc6f19b6
54
packages/nodes-base/nodes/Npm/Npm.node.ts
Normal file
54
packages/nodes-base/nodes/Npm/Npm.node.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { INodeType, INodeTypeDescription } from 'n8n-workflow';
|
||||
import { packageFields, packageOperations } from './PackageDescription';
|
||||
import { distTagFields, distTagOperations } from './DistTagDescription';
|
||||
|
||||
export class Npm implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
displayName: 'Npm',
|
||||
name: 'npm',
|
||||
icon: 'file:npm.svg',
|
||||
group: ['input'],
|
||||
version: 1,
|
||||
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
|
||||
description: 'Consume NPM registry API',
|
||||
defaults: {
|
||||
name: 'npm',
|
||||
},
|
||||
inputs: ['main'],
|
||||
outputs: ['main'],
|
||||
credentials: [
|
||||
{
|
||||
name: 'npmApi',
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
requestDefaults: {
|
||||
baseURL: '={{ $credentials.registryUrl }}',
|
||||
},
|
||||
properties: [
|
||||
{
|
||||
displayName: 'Resource',
|
||||
name: 'resource',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
options: [
|
||||
{
|
||||
name: 'Package',
|
||||
value: 'package',
|
||||
},
|
||||
{
|
||||
name: 'Distribution Tag',
|
||||
value: 'distTag',
|
||||
},
|
||||
],
|
||||
default: 'package',
|
||||
},
|
||||
|
||||
...packageOperations,
|
||||
...packageFields,
|
||||
|
||||
...distTagOperations,
|
||||
...distTagFields,
|
||||
],
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user