51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
import { userDescription } from './resources/user';
|
|
import { companyDescription } from './resources/company';
|
|
|
|
export class GwezzChangdunovel implements INodeType {
|
|
description: INodeTypeDescription = {
|
|
displayName: 'Gwezz Changdunovel',
|
|
name: 'gwezzChangdunovel',
|
|
icon: { light: 'file:gwezzChangdunovel.svg', dark: 'file:gwezzChangdunovel.dark.svg' },
|
|
group: ['transform'],
|
|
version: 1,
|
|
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
description: 'Interact with the Gwezz Changdunovel API',
|
|
defaults: {
|
|
name: 'Gwezz Changdunovel',
|
|
},
|
|
usableAsTool: true,
|
|
inputs: ['main'],
|
|
outputs: ['main'],
|
|
credentials: [],
|
|
requestDefaults: {
|
|
baseURL: 'https://www.changdunovel.com/novelsale/openapi',
|
|
headers: {
|
|
Accept: 'application/json',
|
|
'Content-Type': 'application/json',
|
|
},
|
|
},
|
|
properties: [
|
|
{
|
|
displayName: 'Resource',
|
|
name: 'resource',
|
|
type: 'options',
|
|
noDataExpression: true,
|
|
options: [
|
|
{
|
|
name: 'User',
|
|
value: 'user',
|
|
},
|
|
{
|
|
name: 'Company',
|
|
value: 'company',
|
|
},
|
|
],
|
|
default: 'user',
|
|
},
|
|
...userDescription,
|
|
...companyDescription,
|
|
],
|
|
};
|
|
}
|