2022-08-01 13:47:55 -07:00
|
|
|
import { INodeProperties } from 'n8n-workflow';
|
2020-10-10 10:11:14 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const timeEntryOperations: INodeProperties[] = [
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-10-10 10:11:14 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Create',
|
|
|
|
value: 'create',
|
|
|
|
description: 'Create a time entry',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Create a time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Delete',
|
|
|
|
value: 'delete',
|
2020-10-10 10:12:19 -07:00
|
|
|
description: 'Delete a time entry',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Delete a time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Get',
|
|
|
|
value: 'get',
|
2020-10-10 10:12:19 -07:00
|
|
|
description: 'Get a time entry',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Get a time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
2022-09-07 07:51:14 -07:00
|
|
|
name: 'Get Many',
|
2020-10-10 10:11:14 -07:00
|
|
|
value: 'getAll',
|
2022-09-13 03:36:36 -07:00
|
|
|
description: 'Get many time entries',
|
2022-09-08 08:10:13 -07:00
|
|
|
action: 'Get many time entries',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Start',
|
|
|
|
value: 'start',
|
2020-10-10 10:12:19 -07:00
|
|
|
description: 'Start a time entry',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Start a time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Stop',
|
|
|
|
value: 'stop',
|
2020-10-10 10:12:19 -07:00
|
|
|
description: 'Stop the current running timer',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Stop a time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Update',
|
|
|
|
value: 'update',
|
2020-10-10 10:12:19 -07:00
|
|
|
description: 'Update a time Entry',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Update a time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-10-10 10:11:14 -07:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const timeEntryFields: INodeProperties[] = [
|
2020-10-10 10:12:19 -07:00
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:getAll */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['getAll'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['getAll'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['getAll'],
|
|
|
|
returnAll: [false],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 10,
|
|
|
|
},
|
|
|
|
default: 5,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Filters',
|
|
|
|
name: 'filters',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['getAll'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'End Date',
|
|
|
|
name: 'end_date',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Start Date',
|
|
|
|
name: 'start_date',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-10-10 10:12:19 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:get */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['get'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Running',
|
|
|
|
name: 'running',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['get'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether to return just the current running time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Time Entry ID',
|
|
|
|
name: 'timeEntry',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['get'],
|
|
|
|
running: [false],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2020-10-10 10:12:19 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:create */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Space Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'space',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['team'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Folderless List',
|
|
|
|
name: 'folderless',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Folder Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'folder',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
|
|
|
folderless: [false],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolders',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['space'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'List Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'list',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
|
|
|
folderless: [true],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolderlessLists',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['space'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'List Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'list',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
|
|
|
folderless: [false],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getLists',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['folder'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Start',
|
|
|
|
name: 'start',
|
|
|
|
type: 'dateTime',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Duration (Minutes)',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'duration',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 0,
|
|
|
|
required: true,
|
|
|
|
description: 'Duration in minutes',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Task Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'task',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTasks',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['list'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['create'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Assignee Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'assignee',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getAssignees',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['list'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Billable',
|
|
|
|
name: 'billable',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-10-22 06:46:03 -07:00
|
|
|
description: 'Description of the time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
2022-06-20 07:54:01 -07:00
|
|
|
displayName: 'Tag Names or IDs',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'tags',
|
|
|
|
type: 'multiOptions',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
typeOptions: {
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['team'],
|
2020-10-22 06:46:03 -07:00
|
|
|
loadOptionsMethod: 'getTimeEntryTags',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-10-10 10:12:19 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:start */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['start'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Task ID',
|
|
|
|
name: 'task',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['start'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['start'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Billable',
|
|
|
|
name: 'billable',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-10-22 06:46:03 -07:00
|
|
|
description: 'Description of the time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-10-10 10:12:19 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:stop */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['stop'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2020-10-10 10:12:19 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:delete */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['delete'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Time Entry ID',
|
|
|
|
name: 'timeEntry',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['delete'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
2020-10-10 10:12:19 -07:00
|
|
|
|
|
|
|
/* -------------------------------------------------------------------------- */
|
|
|
|
/* timeEntry:update */
|
|
|
|
/* -------------------------------------------------------------------------- */
|
2020-10-10 10:11:14 -07:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Team Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'team',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTeams',
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Space Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'space',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getSpaces',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['team'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Folderless List',
|
|
|
|
name: 'folderless',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Folder Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'folder',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
|
|
|
folderless: [false],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolders',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['space'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'List Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'list',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
|
|
|
folderless: [true],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getFolderlessLists',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['space'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'List Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'list',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
|
|
|
folderless: [false],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getLists',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['folder'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Archived',
|
|
|
|
name: 'archived',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Time Entry ID',
|
|
|
|
name: 'timeEntry',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['timeEntry'],
|
|
|
|
operation: ['update'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Assignee Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'assignee',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getAssignees',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['list'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Billable',
|
|
|
|
name: 'billable',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-10-22 06:46:03 -07:00
|
|
|
description: 'Description of the time entry',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Duration (Minutes)',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'duration',
|
|
|
|
type: 'number',
|
|
|
|
default: 0,
|
|
|
|
description: 'Duration in minutes',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Start',
|
|
|
|
name: 'start',
|
|
|
|
type: 'dateTime',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2022-06-20 07:54:01 -07:00
|
|
|
displayName: 'Tag Names or IDs',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'tags',
|
|
|
|
type: 'multiOptions',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
typeOptions: {
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['spaceId'],
|
2020-10-22 06:46:03 -07:00
|
|
|
loadOptionsMethod: 'getTags',
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
default: [],
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Task Name or ID',
|
2020-10-10 10:11:14 -07:00
|
|
|
name: 'task',
|
|
|
|
type: 'options',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
2020-10-10 10:11:14 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'getTasks',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['archived', 'list'],
|
2020-10-10 10:11:14 -07:00
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|