n8n/packages/nodes-base/nodes/Harvest/ProjectDescription.ts

594 lines
13 KiB
TypeScript
Raw Normal View History

import {
INodeProperties,
} from 'n8n-workflow';
2020-01-28 07:50:15 -08:00
const resource = [
'project',
];
export const projectOperations: INodeProperties[] = [
2020-01-28 07:50:15 -08:00
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource,
2020-01-28 07:50:15 -08:00
},
},
options: [
{
name: 'Create',
value: 'create',
description: `Create a project`,
},
{
name: 'Delete',
value: 'delete',
description: `Delete a project`,
},
2020-01-28 07:50:15 -08:00
{
name: 'Get',
value: 'get',
description: 'Get data of a project',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get data of all projects',
},
2020-02-03 00:39:22 -08:00
{
name: 'Update',
value: 'update',
description: `Update a project`,
},
2020-01-28 07:50:15 -08:00
],
default: 'getAll',
2020-01-28 07:50:15 -08:00
description: 'The operation to perform.',
},
];
2020-01-28 07:50:15 -08:00
export const projectFields: INodeProperties[] = [
2020-01-28 07:50:15 -08:00
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
/* projects:getAll */
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
2020-01-28 07:50:15 -08:00
2020-02-03 00:39:22 -08:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource,
operation: [
'getAll',
],
},
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
default: false,
description: 'Returns a list of your projects.',
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource,
operation: [
'getAll',
],
returnAll: [
false,
],
},
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 100,
description: 'How many results to return.',
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource,
operation: [
'getAll',
],
},
},
options: [
{
displayName: 'Client Id',
name: 'client_id',
type: 'string',
default: '',
description: 'Only return projects belonging to the client with the given ID.',
},
{
displayName: 'Is Active',
name: 'is_active',
type: 'boolean',
default: true,
description: 'Pass true to only return active projects and false to return inactive projects.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Page',
name: 'page',
type: 'number',
typeOptions: {
minValue: 1,
},
default: 1,
description: 'The page number to use in pagination.',
},
{
displayName: 'Updated Since',
name: 'updated_since',
type: 'dateTime',
default: '',
description: 'Only return projects by updated_since.',
},
2020-10-22 06:46:03 -07:00
],
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
/* project:get */
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
{
displayName: 'Project Id',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'get',
],
resource,
},
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
description: 'The ID of the project you are retrieving.',
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
/* project:delete */
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
{
displayName: 'Project Id',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'delete',
],
resource,
},
},
description: 'The ID of the project want to delete.',
},
/* -------------------------------------------------------------------------- */
/* project:create */
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
{
displayName: 'Name',
name: 'name',
type: 'string',
displayOptions: {
show: {
operation: [
'create',
],
resource,
},
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
default: '',
required: true,
description: 'The name of the project.',
},
{
displayName: 'Client Id',
name: 'clientId',
2020-02-03 00:39:22 -08:00
type: 'string',
displayOptions: {
show: {
operation: [
'create',
],
resource,
},
},
default: '',
required: true,
description: 'The ID of the client to associate this project with.',
},
{
displayName: 'Is Billable',
name: 'isBillable',
type: 'boolean',
2020-02-03 00:39:22 -08:00
displayOptions: {
show: {
operation: [
'create',
],
resource,
},
2020-01-28 07:50:15 -08:00
},
default: true,
2020-02-03 00:39:22 -08:00
required: true,
description: 'Whether the project is billable or not.',
},
{
displayName: 'Bill By',
name: 'billBy',
type: 'options',
2020-02-03 00:39:22 -08:00
displayOptions: {
show: {
operation: [
'create',
],
resource,
},
2020-01-28 07:50:15 -08:00
},
options: [
{
name: 'none',
value: 'none',
},
{
name: 'People',
value: 'People',
},
{
name: 'Project',
value: 'Project',
},
{
name: 'Tasks',
value: 'Tasks',
},
],
default: 'none',
2020-02-03 00:39:22 -08:00
required: true,
description: 'The method by which the project is invoiced.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Budget By',
name: 'budgetBy',
2020-02-03 00:39:22 -08:00
type: 'string',
displayOptions: {
show: {
operation: [
'create',
],
resource,
},
2020-01-28 07:50:15 -08:00
},
default: 'none',
placeholder: '',
2020-02-03 00:39:22 -08:00
required: true,
description: 'The email of the user or "none".',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
'create',
],
resource,
},
2020-01-28 07:50:15 -08:00
},
2020-02-03 00:39:22 -08:00
default: {},
options: [
{
displayName: 'Budget',
name: 'budget',
type: 'number',
typeOptions: {
minValue: 0,
},
default: 0,
2020-10-22 06:46:03 -07:00
description: 'The budget in hours for the project when budgeting by time.',
},
{
displayName: 'Budget Is Monthly',
name: 'budget_is_monthly',
2020-02-03 00:39:22 -08:00
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Option to have the budget reset every month. Defaults to false.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Cost Budget',
name: 'cost_budget',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'The monetary budget for the project when budgeting by money.',
},
{
displayName: 'Cost Budget Include Expenses',
name: 'cost_budget_include_expenses',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Option for budget of Total Project Fees projects to include tracked expenses. Defaults to false.',
},
{
displayName: 'Ends On',
name: 'ends_on',
type: 'dateTime',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Date the project will end.',
},
{
displayName: 'Fee',
name: 'fee',
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'The amount you plan to invoice for the project. Only used by fixed-fee projects.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Hourly Rate',
name: 'hourly_rate',
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Rate for projects billed by Project Hourly Rate.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Is Active',
name: 'is_active',
type: 'boolean',
default: true,
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
description: 'Whether the project is active or archived. Defaults to true.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Is Fixed Fee',
name: 'is_fixed_fee',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Whether the project is a fixed-fee project or not.',
},
{
displayName: 'Notes',
name: 'notes',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Notes about the project.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Notify When Over Budget',
name: 'notify_when_over_budget',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Whether project managers should be notified when the project goes over budget. Defaults to false.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Over Budget Notification Percentage',
name: 'over_budget_notification_percentage',
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Percentage value used to trigger over budget email alerts. Example: use 10.0 for 10.0%.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Show Budget To All',
name: 'show_budget_to_all',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Starts On',
name: 'starts_on',
type: 'dateTime',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Date the project was started.',
2020-02-03 00:39:22 -08:00
},
],
2020-01-28 07:50:15 -08:00
},
2020-01-31 04:47:20 -08:00
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
/* project:update */
2020-02-03 00:39:22 -08:00
/* -------------------------------------------------------------------------- */
2020-02-03 01:54:21 -08:00
{
displayName: 'Project Id',
name: 'id',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'update',
],
resource,
},
},
description: 'The ID of the project want to update.',
},
2020-02-03 00:39:22 -08:00
{
2020-02-03 01:23:58 -08:00
displayName: 'Update Fields',
name: 'updateFields',
2020-02-03 00:39:22 -08:00
type: 'collection',
placeholder: 'Add Field',
displayOptions: {
show: {
operation: [
2020-02-03 01:54:21 -08:00
'update',
2020-02-03 00:39:22 -08:00
],
resource,
},
2020-01-31 04:47:20 -08:00
},
2020-02-03 00:39:22 -08:00
default: {},
options: [
{
displayName: 'Bill By',
name: 'bill_by',
type: 'options',
options: [
{
name: 'none',
value: 'none',
},
{
name: 'People',
value: 'People',
},
{
name: 'Project',
value: 'Project',
},
{
name: 'Tasks',
value: 'Tasks',
},
],
default: 'none',
description: 'The method by which the project is invoiced.',
},
{
displayName: 'Budget',
name: 'budget',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'The budget in hours for the project when budgeting by time.',
},
{
displayName: 'Budget By',
name: 'budget_by',
type: 'string',
default: '',
description: 'The email of the user or "none".',
},
{
displayName: 'Budget Is Monthly',
name: 'budget_is_monthly',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Option to have the budget reset every month. Defaults to false.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Client Id',
name: 'client_id',
type: 'string',
default: '',
description: 'The ID of the client to associate this project with.',
},
{
displayName: 'Cost Budget',
name: 'cost_budget',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'The monetary budget for the project when budgeting by money.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Cost Budget Include Expenses',
name: 'cost_budget_include_expenses',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Option for budget of Total Project Fees projects to include tracked expenses. Defaults to false.',
},
{
displayName: 'Ends On',
name: 'ends_on',
type: 'dateTime',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Date the project will end.',
},
{
displayName: 'Fee',
name: 'fee',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'The amount you plan to invoice for the project. Only used by fixed-fee projects.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Hourly Rate',
name: 'hourly_rate',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Rate for projects billed by Project Hourly Rate.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Is Active',
name: 'is_active',
type: 'boolean',
default: true,
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
description: 'Whether the project is active or archived. Defaults to true.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Is Billable',
name: 'is_billable',
type: 'boolean',
default: true,
description: 'Whether the project is billable or not.',
},
2020-02-03 00:39:22 -08:00
{
displayName: 'Is Fixed Fee',
name: 'is_fixed_fee',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Whether the project is a fixed-fee project or not.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Name',
name: 'name',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
description: 'The name of the project.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Notes',
name: 'notes',
2020-02-03 00:39:22 -08:00
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Notes about the project.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Notify When Over Budget',
name: 'notify_when_over_budget',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Whether project managers should be notified when the project goes over budget. Defaults to false.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Over Budget Notification Percentage',
name: 'over_budget_notification_percentage',
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Percentage value used to trigger over budget email alerts. Example: use 10.0 for 10.0%.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Show Budget To All',
name: 'show_budget_to_all',
type: 'boolean',
default: false,
2020-10-22 06:46:03 -07:00
description: 'Option to show project budget to all employees. Does not apply to Total Project Fee projects. Defaults to false.',
2020-02-03 00:39:22 -08:00
},
{
displayName: 'Starts On',
name: 'starts_on',
type: 'dateTime',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Date the project was started.',
2020-02-03 00:39:22 -08:00
},
],
2020-01-31 04:47:20 -08:00
},
2020-01-28 07:50:15 -08:00
];