n8n/packages/nodes-base/nodes/Clockify/ClientDescription.ts
agobrech 447d19024c
feat(Clockify Node): Add more resources and improvements (#3411)
*  Add more Clockify resources

* Moved headers in credentials file and added testing

* add address to additional fields

* Add pagination to workflow

* 🎨 Rename additional fields to filter

* Remove non-required fields to additional fields

* 🔥 Remove loading of client id

*  Improvements

*  Small change

Co-authored-by: pemontto <pemontto@gmail.com>
Co-authored-by: ricardo <ricardoespinoza105@gmail.com>
2022-06-29 09:04:36 +02:00

272 lines
5 KiB
TypeScript

import {
INodeProperties,
} from 'n8n-workflow';
export const clientOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: [
'client',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a client',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a client',
},
{
name: 'Get',
value: 'get',
description: 'Get a client',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all clients',
},
{
name: 'Update',
value: 'update',
description: 'Update a client',
},
],
default: 'create',
},
];
export const clientFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* client:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'Client Name',
name: 'name',
type: 'string',
required: true,
default: '',
description: 'Name of client being created',
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'create',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* client:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'Client ID',
name: 'clientId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'delete',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* client:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'Client ID',
name: 'clientId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'get',
],
},
},
},
/* -------------------------------------------------------------------------- */
/* client:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'client',
],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'client',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'Max number of results to return',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'getAll',
],
},
},
default: {},
options: [
{
displayName: 'Archived',
name: 'archived',
type: 'boolean',
default: false,
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'If provided, clients will be filtered by name',
},
{
displayName: 'Sort Order',
name: 'sort-order',
type: 'options',
options: [
{
name: 'Ascending',
value: 'ASCENDING',
},
{
name: 'Descending',
value: 'DESCENDING',
},
],
default: '',
},
],
},
/* -------------------------------------------------------------------------- */
/* client:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'Client ID',
name: 'clientId',
type: 'string',
default: '',
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'update',
],
},
},
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'client',
],
operation: [
'update',
],
},
},
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'client',
],
},
},
default: {},
options: [
{
displayName: 'Address',
name: 'address',
type: 'string',
default: '',
description: 'Address of client being created/updated',
},
{
displayName: 'Archived',
name: 'archived',
type: 'boolean',
default: false,
},
],
},
];