2020-10-30 01:31:27 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const calendarOperations : INodeProperties [ ] = [
2020-10-30 01:31:27 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-14 01:44:19 -07:00
noDataExpression : true ,
2020-10-30 01:31:27 -07:00
displayOptions : {
show : {
resource : [
2020-10-30 01:32:35 -07:00
'calendar' ,
2020-10-30 01:31:27 -07:00
] ,
} ,
} ,
options : [
{
2020-10-30 01:32:35 -07:00
name : 'Availability' ,
value : 'availability' ,
description : 'If a time-slot is available in a calendar' ,
2022-07-10 13:50:51 -07:00
action : 'Get availability in a calendar' ,
2020-10-30 01:31:27 -07:00
} ,
] ,
2020-10-30 01:32:35 -07:00
default : 'availability' ,
2020-10-30 01:31:27 -07:00
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-10-30 01:31:27 -07:00
2021-12-03 00:44:16 -08:00
export const calendarFields : INodeProperties [ ] = [
2020-10-30 01:32:35 -07:00
/* -------------------------------------------------------------------------- */
2022-03-13 04:00:12 -07:00
/* calendar:availability */
2020-10-30 01:32:35 -07:00
/* -------------------------------------------------------------------------- */
2020-10-30 01:31:27 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Calendar Name or ID' ,
2020-10-30 01:32:35 -07:00
name : 'calendar' ,
2020-10-30 01:31:27 -07:00
type : 'options' ,
2022-07-14 13:05:11 -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-30 01:31:27 -07:00
typeOptions : {
loadOptionsMethod : 'getCalendars' ,
} ,
required : true ,
displayOptions : {
show : {
resource : [
2020-10-30 01:32:35 -07:00
'calendar' ,
2020-10-30 01:31:27 -07:00
] ,
} ,
} ,
default : '' ,
} ,
{
2020-10-30 01:32:35 -07:00
displayName : 'Start Time' ,
2020-10-30 01:31:27 -07:00
name : 'timeMin' ,
type : 'dateTime' ,
required : true ,
displayOptions : {
show : {
operation : [
2020-10-30 01:32:35 -07:00
'availability' ,
2020-10-30 01:31:27 -07:00
] ,
resource : [
2020-10-30 01:32:35 -07:00
'calendar' ,
2020-10-30 01:31:27 -07:00
] ,
} ,
} ,
default : '' ,
description : 'Start of the interval' ,
} ,
{
2020-10-30 01:32:35 -07:00
displayName : 'End Time' ,
2020-10-30 01:31:27 -07:00
name : 'timeMax' ,
type : 'dateTime' ,
required : true ,
displayOptions : {
show : {
operation : [
2020-10-30 01:32:35 -07:00
'availability' ,
2020-10-30 01:31:27 -07:00
] ,
resource : [
2020-10-30 01:32:35 -07:00
'calendar' ,
2020-10-30 01:31:27 -07:00
] ,
} ,
} ,
default : '' ,
description : 'End of the interval' ,
} ,
{
2020-10-30 01:32:35 -07:00
displayName : 'Options' ,
name : 'options' ,
2020-10-30 01:31:27 -07:00
type : 'collection' ,
2020-10-30 01:32:35 -07:00
placeholder : 'Add Options' ,
2020-10-30 01:31:27 -07:00
displayOptions : {
show : {
operation : [
2020-10-30 01:32:35 -07:00
'availability' ,
2020-10-30 01:31:27 -07:00
] ,
resource : [
2020-10-30 01:32:35 -07:00
'calendar' ,
2020-10-30 01:31:27 -07:00
] ,
} ,
} ,
default : { } ,
options : [
2020-10-30 01:32:35 -07:00
{
displayName : 'Output Format' ,
name : 'outputFormat' ,
type : 'options' ,
options : [
{
name : 'Availability' ,
value : 'availability' ,
2022-05-06 14:01:25 -07:00
description : 'Returns if there are any events in the given time or not' ,
2020-10-30 01:32:35 -07:00
} ,
{
name : 'Booked Slots' ,
value : 'bookedSlots' ,
2022-05-06 14:01:25 -07:00
description : 'Returns the booked slots' ,
2020-10-30 01:32:35 -07:00
} ,
{
name : 'RAW' ,
value : 'raw' ,
2022-05-06 14:01:25 -07:00
description : 'Returns the RAW data from the API' ,
2020-10-30 01:32:35 -07:00
} ,
] ,
default : 'availability' ,
2022-05-06 14:01:25 -07:00
description : 'The format to return the data in' ,
2020-10-30 01:32:35 -07:00
} ,
2020-10-30 01:31:27 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Timezone Name or ID' ,
2020-10-30 01:31:27 -07:00
name : 'timezone' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getTimezones' ,
} ,
default : '' ,
2022-07-14 13:05:11 -07:00
description : 'Time zone used in the response. By default n8n timezone is used. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-10-30 01:31:27 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;