first commit
This commit is contained in:
61
nodes/GwezzChangdunovel/resources/company/getAll.ts
Normal file
61
nodes/GwezzChangdunovel/resources/company/getAll.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
|
||||
const showOnlyForCompanyGetMany = {
|
||||
operation: ['getAll'],
|
||||
resource: ['company'],
|
||||
};
|
||||
|
||||
export const companyGetManyDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
...showOnlyForCompanyGetMany,
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
maxValue: 100,
|
||||
},
|
||||
default: 50,
|
||||
routing: {
|
||||
send: {
|
||||
type: 'query',
|
||||
property: 'limit',
|
||||
},
|
||||
output: {
|
||||
maxResults: '={{$value}}',
|
||||
},
|
||||
},
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
displayOptions: {
|
||||
show: showOnlyForCompanyGetMany,
|
||||
},
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
routing: {
|
||||
send: {
|
||||
paginate: '={{ $value }}',
|
||||
},
|
||||
operations: {
|
||||
pagination: {
|
||||
type: 'offset',
|
||||
properties: {
|
||||
limitParameter: 'limit',
|
||||
offsetParameter: 'offset',
|
||||
pageSize: 100,
|
||||
type: 'query',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
34
nodes/GwezzChangdunovel/resources/company/index.ts
Normal file
34
nodes/GwezzChangdunovel/resources/company/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
import { companyGetManyDescription } from './getAll';
|
||||
|
||||
const showOnlyForCompanies = {
|
||||
resource: ['company'],
|
||||
};
|
||||
|
||||
export const companyDescription: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: showOnlyForCompanies,
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
action: 'Get companies',
|
||||
description: 'Get companies',
|
||||
routing: {
|
||||
request: {
|
||||
method: 'GET',
|
||||
url: '/companies',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
default: 'getAll',
|
||||
},
|
||||
...companyGetManyDescription,
|
||||
];
|
||||
Reference in New Issue
Block a user