feat(Microsoft Outlook Node): Node overhaul (#4449)

[N8N-4995](https://linear.app/n8n/issue/N8N-4995)

---------

Co-authored-by: Giulio Andreini <g.andreini@gmail.com>
This commit is contained in:
Michael Kret
2023-09-15 12:52:18 +03:00
committed by GitHub
parent bb215bd12a
commit 556a6132ba
98 changed files with 11215 additions and 1202 deletions

View File

@@ -0,0 +1,394 @@
import type { INodeProperties } from 'n8n-workflow';
export const returnAllOrLimit: INodeProperties[] = [
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
},
default: 100,
description: 'Max number of results to return',
},
];
export const folderFields = [
{
name: 'Child Folder Count',
value: 'childFolderCount',
},
{
name: 'Display Name',
value: 'displayName',
},
{
name: 'Is Hidden',
value: 'isHidden',
},
{
name: 'Parent Folder ID',
value: 'parentFolderId',
},
{
name: 'Total Item Count',
value: 'totalItemCount',
},
{
name: 'Unread Item Count',
value: 'unreadItemCount',
},
];
export const contactFields: INodeProperties[] = [
{
displayName: 'Assistant Name',
name: 'assistantName',
type: 'string',
default: '',
description: "The name of the contact's assistant",
},
{
displayName: 'Birthday',
name: 'birthday',
type: 'dateTime',
default: '',
},
{
displayName: 'Business Address',
name: 'businessAddress',
type: 'fixedCollection',
placeholder: 'Add Address',
default: {
values: { sity: '', street: '', postalCode: '', countryOrRegion: '', state: '' },
},
options: [
{
displayName: 'Address',
name: 'values',
values: [
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'Country/Region',
name: 'countryOrRegion',
type: 'string',
default: '',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Street',
name: 'street',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Business Home Page',
name: 'businessHomePage',
type: 'string',
default: '',
},
{
displayName: 'Business Phones',
name: 'businessPhones',
type: 'string',
description: 'Comma-separated list of business phone numbers',
default: '',
},
{
displayName: 'Categories',
name: 'categories',
description: 'Comma-separated list of categories associated with the contact',
type: 'string',
default: '',
},
{
displayName: 'Children',
name: 'children',
description: "Comma-separated list of names of the contact's children",
type: 'string',
default: '',
},
{
displayName: 'Company Name',
name: 'companyName',
type: 'string',
default: '',
},
{
displayName: 'Department',
name: 'department',
type: 'string',
default: '',
},
{
displayName: 'Display Name',
name: 'displayName',
type: 'string',
default: '',
},
{
displayName: 'Email Address',
name: 'emailAddresses',
type: 'fixedCollection',
placeholder: 'Add Email',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
displayName: 'Email',
name: 'values',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
},
{
displayName: 'Address',
name: 'address',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'File As',
name: 'fileAs',
type: 'string',
default: '',
description: 'The name the contact is filed under',
},
{
displayName: 'Home Address',
name: 'homeAddress',
type: 'fixedCollection',
placeholder: 'Add Address',
default: {
values: { sity: '', street: '', postalCode: '', countryOrRegion: '', state: '' },
},
options: [
{
displayName: 'Address',
name: 'values',
values: [
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'Country/Region',
name: 'countryOrRegion',
type: 'string',
default: '',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Street',
name: 'street',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Home Phones',
name: 'homePhones',
type: 'string',
default: '',
hint: 'Multiple phones can be added separated by ,',
},
{
displayName: 'Instant Messaging Addresses',
name: 'imAddresses',
description: "The contact's instant messaging (IM) addresses",
type: 'string',
default: '',
hint: 'Multiple addresses can be added separated by ,',
},
{
displayName: 'Initials',
name: 'initials',
type: 'string',
default: '',
},
{
displayName: 'Job Title',
name: 'jobTitle',
type: 'string',
default: '',
},
{
displayName: 'Manager',
name: 'manager',
type: 'string',
default: '',
description: "The name of the contact's manager",
},
{
displayName: 'Middle Name',
name: 'middleName',
type: 'string',
default: '',
},
{
displayName: 'Mobile Phone',
name: 'mobilePhone',
type: 'string',
default: '',
},
{
displayName: 'Name',
name: 'givenName',
type: 'string',
default: '',
displayOptions: {
show: {
'/operation': ['update'],
},
},
},
{
displayName: 'Nickname',
name: 'nickName',
type: 'string',
default: '',
},
{
displayName: 'Office Location',
name: 'officeLocation',
type: 'string',
default: '',
},
{
displayName: 'Other Address',
name: 'otherAddress',
type: 'fixedCollection',
placeholder: 'Add Address',
default: {
values: { sity: '', street: '', postalCode: '', countryOrRegion: '', state: '' },
},
options: [
{
displayName: 'Address',
name: 'values',
values: [
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
},
{
displayName: 'Country/Region',
name: 'countryOrRegion',
type: 'string',
default: '',
},
{
displayName: 'Postal Code',
name: 'postalCode',
type: 'string',
default: '',
},
{
displayName: 'State',
name: 'state',
type: 'string',
default: '',
},
{
displayName: 'Street',
name: 'street',
type: 'string',
default: '',
},
],
},
],
},
{
displayName: 'Personal Notes',
name: 'personalNotes',
type: 'string',
default: '',
typeOptions: {
alwaysOpenEditWindow: true,
},
},
{
displayName: 'Profession',
name: 'profession',
type: 'string',
default: '',
},
{
displayName: 'Spouse Name',
name: 'spouseName',
type: 'string',
default: '',
},
{
displayName: 'Surname',
name: 'surname',
type: 'string',
default: '',
},
{
displayName: 'Title',
name: 'title',
type: 'string',
default: '',
},
];

View File

@@ -0,0 +1,2 @@
export * from './rlc.description';
export * from './common.descriptions';

View File

@@ -0,0 +1,229 @@
import type { INodeProperties } from 'n8n-workflow';
export const calendarRLC: INodeProperties = {
displayName: 'Calendar',
name: 'calendarId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a calendar...',
typeOptions: {
searchListMethod: 'searchCalendars',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};
export const contactRLC: INodeProperties = {
displayName: 'Contact',
name: 'contactId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a contact...',
typeOptions: {
searchListMethod: 'searchContacts',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};
export const draftRLC: INodeProperties = {
displayName: 'Draft',
name: 'draftId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a draft...',
typeOptions: {
searchListMethod: 'searchDrafts',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};
export const messageRLC: INodeProperties = {
displayName: 'Message',
name: 'messageId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a message...',
typeOptions: {
searchListMethod: 'searchMessages',
searchable: true,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};
export const eventRLC: INodeProperties = {
displayName: 'Event',
name: 'eventId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
typeOptions: {
loadOptionsDependsOn: ['calendarId.value'],
},
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a event...',
typeOptions: {
searchListMethod: 'searchEvents',
searchable: true,
},
},
{
displayName: 'Link',
name: 'url',
type: 'string',
placeholder: 'e.g. https://outlook.office365.com/calendar/item/AAMkADlhOTA0M...UAAA%3D',
extractValue: {
type: 'regex',
regex:
'https:\\/\\/outlook\\.office365\\.com\\/calendar\\/item\\/([A-Za-z0-9%]+)(?:\\/.*|)',
},
validation: [
{
type: 'regex',
properties: {
regex:
'https:\\/\\/outlook\\.office365\\.com\\/calendar\\/item\\/([A-Za-z0-9%]+)(?:\\/.*|)',
errorMessage: 'Not a valid Outlook Event URL',
},
},
],
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};
export const folderRLC: INodeProperties = {
displayName: 'Folder',
name: 'folderId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a folder...',
typeOptions: {
searchListMethod: 'searchFolders',
searchable: true,
},
},
{
displayName: 'Link',
name: 'url',
type: 'string',
placeholder: 'e.g. https://outlook.office365.com/mail/AAMkADlhOT...AAA%3D',
extractValue: {
type: 'regex',
regex: 'https:\\/\\/outlook\\.office365\\.com\\/mail\\/([A-Za-z0-9%]+)(?:\\/.*|)',
},
validation: [
{
type: 'regex',
properties: {
regex: 'https:\\/\\/outlook\\.office365\\.com\\/mail\\/([A-Za-z0-9%]+)(?:\\/.*|)',
errorMessage: 'Not a valid Outlook Folder URL',
},
},
],
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};
export const attachmentRLC: INodeProperties = {
displayName: 'Attachment',
name: 'attachmentId',
type: 'resourceLocator',
default: { mode: 'list', value: '' },
required: true,
typeOptions: {
loadOptionsDependsOn: ['messageId.value'],
},
modes: [
{
displayName: 'From List',
name: 'list',
type: 'list',
placeholder: 'Select a attachment...',
typeOptions: {
searchListMethod: 'searchAttachments',
searchable: false,
},
},
{
displayName: 'ID',
name: 'id',
type: 'string',
placeholder: 'e.g. AAAkAAAhAAA0BBc5LLLwOOOtNNNkZS05Nz...',
},
],
};