mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
feat(Microsoft Teams Node): Enhancements and cleanup (#2940)
* Enhancements and cleanup for MS Teams node - Add option to limit groups to "member of" rather than whole directory - Defaults to "all" for compatibility - Add option to Get All tasks to pull from a plan instead of just a group member - Defaults to "member" for compatibility - Added in auto completiong for plans, buckets, labels and members in update fields for tasks - Update descriptions and normalize quotes for descriptions and display names * Bump MS Teams version number * ⚡ fixed version * 🔨 small fixes * 🔨 fixed nodelinter issues Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
parent
ff26a987fe
commit
d446f9e281
|
@ -7,6 +7,7 @@ export const channelOperations: INodeProperties[] = [
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
name: 'operation',
|
name: 'operation',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
noDataExpression: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
|
@ -42,7 +43,6 @@ export const channelOperations: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
description: 'The operation to perform.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ export const channelFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Channel name as it will appear to the user in Microsoft Teams.',
|
description: 'Channel name as it will appear to the user in Microsoft Teams',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Options',
|
displayName: 'Options',
|
||||||
|
@ -266,7 +266,7 @@ export const channelFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description: 'If all results should be returned or only up to a given limit.',
|
description: 'Whether to return all results or only up to a given limit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Limit',
|
displayName: 'Limit',
|
||||||
|
@ -289,8 +289,8 @@ export const channelFields: INodeProperties[] = [
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
maxValue: 500,
|
maxValue: 500,
|
||||||
},
|
},
|
||||||
default: 100,
|
default: 50,
|
||||||
description: 'How many results to return.',
|
description: 'Max number of results to return',
|
||||||
},
|
},
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -360,7 +360,7 @@ export const channelFields: INodeProperties[] = [
|
||||||
name: 'name',
|
name: 'name',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Channel name as it will appear to the user in Microsoft Teams.',
|
description: 'Channel name as it will appear to the user in Microsoft Teams',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Description',
|
displayName: 'Description',
|
||||||
|
|
|
@ -7,6 +7,7 @@ export const channelMessageOperations: INodeProperties[] = [
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
name: 'operation',
|
name: 'operation',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
noDataExpression: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
|
@ -27,7 +28,6 @@ export const channelMessageOperations: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
description: 'The operation to perform.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ export const channelMessageFields: INodeProperties[] = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: 'text',
|
||||||
description: 'The type of the content',
|
description: 'The type of the content',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -125,7 +125,7 @@ export const channelMessageFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The content of the item.',
|
description: 'The content of the item',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Options',
|
displayName: 'Options',
|
||||||
|
@ -149,7 +149,7 @@ export const channelMessageFields: INodeProperties[] = [
|
||||||
name: 'makeReply',
|
name: 'makeReply',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'An optional ID of the message you want to reply to.',
|
description: 'An optional ID of the message you want to reply to',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -213,7 +213,7 @@ export const channelMessageFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description: 'If all results should be returned or only up to a given limit.',
|
description: 'Whether to return all results or only up to a given limit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Limit',
|
displayName: 'Limit',
|
||||||
|
@ -236,7 +236,7 @@ export const channelMessageFields: INodeProperties[] = [
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
maxValue: 500,
|
maxValue: 500,
|
||||||
},
|
},
|
||||||
default: 100,
|
default: 50,
|
||||||
description: 'How many results to return.',
|
description: 'Max number of results to return',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -7,6 +7,7 @@ export const chatMessageOperations: INodeProperties[] = [
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
name: 'operation',
|
name: 'operation',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
noDataExpression: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
|
@ -32,7 +33,6 @@ export const chatMessageOperations: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
description: 'The operation to perform.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ export const chatMessageFields: INodeProperties[] = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: 'text',
|
||||||
description: 'The type of the content',
|
description: 'The type of the content',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -109,7 +109,7 @@ export const chatMessageFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The content of the item.',
|
description: 'The content of the item',
|
||||||
},
|
},
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -170,7 +170,7 @@ export const chatMessageFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description: 'If all results should be returned or only up to a given limit.',
|
description: 'Whether to return all results or only up to a given limit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Limit',
|
displayName: 'Limit',
|
||||||
|
@ -193,7 +193,7 @@ export const chatMessageFields: INodeProperties[] = [
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
maxValue: 500,
|
maxValue: 500,
|
||||||
},
|
},
|
||||||
default: 100,
|
default: 50,
|
||||||
description: 'How many results to return.',
|
description: 'Max number of results to return',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -9,6 +9,7 @@ import {
|
||||||
INodePropertyOptions,
|
INodePropertyOptions,
|
||||||
INodeType,
|
INodeType,
|
||||||
INodeTypeDescription,
|
INodeTypeDescription,
|
||||||
|
JsonObject,
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -61,6 +62,7 @@ export class MicrosoftTeams implements INodeType {
|
||||||
displayName: 'Resource',
|
displayName: 'Resource',
|
||||||
name: 'resource',
|
name: 'resource',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
noDataExpression: true,
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
name: 'Channel',
|
name: 'Channel',
|
||||||
|
@ -80,7 +82,7 @@ export class MicrosoftTeams implements INodeType {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'channel',
|
default: 'channel',
|
||||||
description: 'The resource to operate on.',
|
description: 'The resource to operate on',
|
||||||
},
|
},
|
||||||
// CHANNEL
|
// CHANNEL
|
||||||
...channelOperations,
|
...channelOperations,
|
||||||
|
@ -133,11 +135,17 @@ export class MicrosoftTeams implements INodeType {
|
||||||
// select them easily
|
// select them easily
|
||||||
async getGroups(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getGroups(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const { value } = await microsoftApiRequest.call(this, 'GET', '/v1.0/groups');
|
const groupSource = this.getCurrentNodeParameter('groupSource') as string;
|
||||||
|
let requestUrl = '/v1.0/groups' as string;
|
||||||
|
if (groupSource === 'mine') {
|
||||||
|
requestUrl = '/v1.0/me/transitiveMemberOf';
|
||||||
|
}
|
||||||
|
const { value } = await microsoftApiRequest.call(this, 'GET', requestUrl);
|
||||||
for (const group of value) {
|
for (const group of value) {
|
||||||
returnData.push({
|
returnData.push({
|
||||||
name: group.mail,
|
name: group.displayName || group.mail || group.id,
|
||||||
value: group.id,
|
value: group.id,
|
||||||
|
description: group.mail,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return returnData;
|
return returnData;
|
||||||
|
@ -146,7 +154,12 @@ export class MicrosoftTeams implements INodeType {
|
||||||
// select them easily
|
// select them easily
|
||||||
async getPlans(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getPlans(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const groupId = this.getCurrentNodeParameter('groupId') as string;
|
let groupId = this.getCurrentNodeParameter('groupId') as string;
|
||||||
|
const operation = this.getNodeParameter('operation', 0) as string;
|
||||||
|
if (operation === 'update' && (groupId === undefined || groupId === null)) {
|
||||||
|
// groupId not found at base, check updateFields for the groupId
|
||||||
|
groupId = this.getCurrentNodeParameter('updateFields.groupId') as string;
|
||||||
|
}
|
||||||
const { value } = await microsoftApiRequest.call(this, 'GET', `/v1.0/groups/${groupId}/planner/plans`);
|
const { value } = await microsoftApiRequest.call(this, 'GET', `/v1.0/groups/${groupId}/planner/plans`);
|
||||||
for (const plan of value) {
|
for (const plan of value) {
|
||||||
returnData.push({
|
returnData.push({
|
||||||
|
@ -160,7 +173,12 @@ export class MicrosoftTeams implements INodeType {
|
||||||
// select them easily
|
// select them easily
|
||||||
async getBuckets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getBuckets(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const planId = this.getCurrentNodeParameter('planId') as string;
|
let planId = this.getCurrentNodeParameter('planId') as string;
|
||||||
|
const operation = this.getNodeParameter('operation', 0) as string;
|
||||||
|
if (operation === 'update' && (planId === undefined || planId === null)) {
|
||||||
|
// planId not found at base, check updateFields for the planId
|
||||||
|
planId = this.getCurrentNodeParameter('updateFields.planId') as string;
|
||||||
|
}
|
||||||
const { value } = await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/plans/${planId}/buckets`);
|
const { value } = await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/plans/${planId}/buckets`);
|
||||||
for (const bucket of value) {
|
for (const bucket of value) {
|
||||||
returnData.push({
|
returnData.push({
|
||||||
|
@ -174,7 +192,12 @@ export class MicrosoftTeams implements INodeType {
|
||||||
// select them easily
|
// select them easily
|
||||||
async getMembers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getMembers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const groupId = this.getCurrentNodeParameter('groupId') as string;
|
let groupId = this.getCurrentNodeParameter('groupId') as string;
|
||||||
|
const operation = this.getNodeParameter('operation', 0) as string;
|
||||||
|
if (operation === 'update' && (groupId === undefined || groupId === null)) {
|
||||||
|
// groupId not found at base, check updateFields for the groupId
|
||||||
|
groupId = this.getCurrentNodeParameter('updateFields.groupId') as string;
|
||||||
|
}
|
||||||
const { value } = await microsoftApiRequest.call(this, 'GET', `/v1.0/groups/${groupId}/members`);
|
const { value } = await microsoftApiRequest.call(this, 'GET', `/v1.0/groups/${groupId}/members`);
|
||||||
for (const member of value) {
|
for (const member of value) {
|
||||||
returnData.push({
|
returnData.push({
|
||||||
|
@ -188,7 +211,13 @@ export class MicrosoftTeams implements INodeType {
|
||||||
// select them easily
|
// select them easily
|
||||||
async getLabels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
async getLabels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
|
||||||
const returnData: INodePropertyOptions[] = [];
|
const returnData: INodePropertyOptions[] = [];
|
||||||
const planId = this.getCurrentNodeParameter('planId') as string;
|
|
||||||
|
let planId = this.getCurrentNodeParameter('planId') as string;
|
||||||
|
const operation = this.getNodeParameter('operation', 0) as string;
|
||||||
|
if (operation === 'update' && (planId === undefined || planId === null)) {
|
||||||
|
// planId not found at base, check updateFields for the planId
|
||||||
|
planId = this.getCurrentNodeParameter('updateFields.planId') as string;
|
||||||
|
}
|
||||||
const { categoryDescriptions } = await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/plans/${planId}/details`);
|
const { categoryDescriptions } = await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/plans/${planId}/details`);
|
||||||
for (const key of Object.keys(categoryDescriptions)) {
|
for (const key of Object.keys(categoryDescriptions)) {
|
||||||
if (categoryDescriptions[key] !== null) {
|
if (categoryDescriptions[key] !== null) {
|
||||||
|
@ -407,16 +436,29 @@ export class MicrosoftTeams implements INodeType {
|
||||||
const taskId = this.getNodeParameter('taskId', i) as string;
|
const taskId = this.getNodeParameter('taskId', i) as string;
|
||||||
responseData = await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/tasks/${taskId}`);
|
responseData = await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/tasks/${taskId}`);
|
||||||
}
|
}
|
||||||
//https://docs.microsoft.com/en-us/graph/api/planneruser-list-tasks?view=graph-rest-1.0&tabs=http
|
|
||||||
if (operation === 'getAll') {
|
if (operation === 'getAll') {
|
||||||
const memberId = this.getNodeParameter('memberId', i) as string;
|
const tasksFor = this.getNodeParameter('tasksFor', i) as string;
|
||||||
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
const returnAll = this.getNodeParameter('returnAll', i) as boolean;
|
||||||
if (returnAll) {
|
if (tasksFor === 'member') {
|
||||||
responseData = await microsoftApiRequestAllItems.call(this, 'value', 'GET', `/v1.0/users/${memberId}/planner/tasks`);
|
//https://docs.microsoft.com/en-us/graph/api/planneruser-list-tasks?view=graph-rest-1.0&tabs=http
|
||||||
|
const memberId = this.getNodeParameter('memberId', i) as string;
|
||||||
|
if (returnAll) {
|
||||||
|
responseData = await microsoftApiRequestAllItems.call(this, 'value', 'GET', `/v1.0/users/${memberId}/planner/tasks`);
|
||||||
|
} else {
|
||||||
|
qs.limit = this.getNodeParameter('limit', i) as number;
|
||||||
|
responseData = await microsoftApiRequestAllItems.call(this, 'value', 'GET', `/v1.0/users/${memberId}/planner/tasks`, {});
|
||||||
|
responseData = responseData.splice(0, qs.limit);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
qs.limit = this.getNodeParameter('limit', i) as number;
|
//https://docs.microsoft.com/en-us/graph/api/plannerplan-list-tasks?view=graph-rest-1.0&tabs=http
|
||||||
responseData = await microsoftApiRequestAllItems.call(this, 'value', 'GET', `/v1.0/users/${memberId}/planner/tasks`, {});
|
const planId = this.getNodeParameter('planId', i) as string;
|
||||||
responseData = responseData.splice(0, qs.limit);
|
if (returnAll) {
|
||||||
|
responseData = await microsoftApiRequestAllItems.call(this, 'value', 'GET', `/v1.0/planner/plans/${planId}/tasks`);
|
||||||
|
} else {
|
||||||
|
qs.limit = this.getNodeParameter('limit', i) as number;
|
||||||
|
responseData = await microsoftApiRequestAllItems.call(this, 'value', 'GET', `/v1.0/planner/plans/${planId}/tasks`, {});
|
||||||
|
responseData = responseData.splice(0, qs.limit);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//https://docs.microsoft.com/en-us/graph/api/plannertask-update?view=graph-rest-1.0&tabs=http
|
//https://docs.microsoft.com/en-us/graph/api/plannertask-update?view=graph-rest-1.0&tabs=http
|
||||||
|
@ -436,6 +478,11 @@ export class MicrosoftTeams implements INodeType {
|
||||||
delete body.assignedTo;
|
delete body.assignedTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (body.groupId) {
|
||||||
|
// tasks are assigned to a plan and bucket, group is used for filtering
|
||||||
|
delete body.groupId;
|
||||||
|
}
|
||||||
|
|
||||||
if (Array.isArray(body.labels)) {
|
if (Array.isArray(body.labels)) {
|
||||||
body.appliedCategories = (body.labels as string[]).map((label) => ({ [label]: true }));
|
body.appliedCategories = (body.labels as string[]).map((label) => ({ [label]: true }));
|
||||||
}
|
}
|
||||||
|
@ -454,7 +501,7 @@ export class MicrosoftTeams implements INodeType {
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (this.continueOnFail()) {
|
if (this.continueOnFail()) {
|
||||||
returnData.push({ error: error.message });
|
returnData.push({ error: (error as JsonObject).message });
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
@ -7,6 +7,7 @@ export const taskOperations: INodeProperties[] = [
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
name: 'operation',
|
name: 'operation',
|
||||||
type: 'options',
|
type: 'options',
|
||||||
|
noDataExpression: true,
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
resource: [
|
resource: [
|
||||||
|
@ -42,15 +43,47 @@ export const taskOperations: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
default: 'create',
|
default: 'create',
|
||||||
description: 'The operation to perform.',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const taskFields: INodeProperties[] = [
|
export const taskFields: INodeProperties[] = [
|
||||||
|
{
|
||||||
|
displayName: 'Group Source',
|
||||||
|
name: 'groupSource',
|
||||||
|
required: true,
|
||||||
|
type: 'options',
|
||||||
|
default: 'all',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'getAll',
|
||||||
|
'create',
|
||||||
|
'update',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'task',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: 'All Groups',
|
||||||
|
value: 'all',
|
||||||
|
description: 'From all groups',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'My Groups',
|
||||||
|
value: 'mine',
|
||||||
|
description: 'Only load groups that account is member of',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* task:create */
|
/* task:create */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
{
|
{
|
||||||
displayName: 'Group ID',
|
displayName: 'Group ID',
|
||||||
name: 'groupId',
|
name: 'groupId',
|
||||||
|
@ -58,6 +91,9 @@ export const taskFields: INodeProperties[] = [
|
||||||
type: 'options',
|
type: 'options',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getGroups',
|
loadOptionsMethod: 'getGroups',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'groupSource',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -93,7 +129,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The ID of the Plan.',
|
description: 'The plan for the task to belong to',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Bucket ID',
|
displayName: 'Bucket ID',
|
||||||
|
@ -117,7 +153,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The ID of the Bucket.',
|
description: 'The bucket for the task to belong to',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Title',
|
displayName: 'Title',
|
||||||
|
@ -135,7 +171,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Title of the task.',
|
description: 'Title of the task',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Additional Fields',
|
displayName: 'Additional Fields',
|
||||||
|
@ -165,14 +201,14 @@ export const taskFields: INodeProperties[] = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
|
description: 'Who the task should be assigned to',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Due Date Time',
|
displayName: 'Due Date Time',
|
||||||
name: 'dueDateTime',
|
name: 'dueDateTime',
|
||||||
type: 'dateTime',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
|
description: 'Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Labels',
|
displayName: 'Labels',
|
||||||
|
@ -185,7 +221,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
default: [],
|
default: [],
|
||||||
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
|
description: 'Labels to assign to the task',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Percent Complete',
|
displayName: 'Percent Complete',
|
||||||
|
@ -196,7 +232,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
maxValue: 100,
|
maxValue: 100,
|
||||||
},
|
},
|
||||||
default: 0,
|
default: 0,
|
||||||
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
|
description: 'Percentage of task completion. When set to 100, the task is considered completed.',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -246,6 +282,36 @@ export const taskFields: INodeProperties[] = [
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
/* task:getAll */
|
/* task:getAll */
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
{
|
||||||
|
displayName: 'Tasks For',
|
||||||
|
name: 'tasksFor',
|
||||||
|
default: 'member',
|
||||||
|
required: true,
|
||||||
|
type: 'options',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'getAll',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'task',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: 'Group Member',
|
||||||
|
value: 'member',
|
||||||
|
description: 'Tasks assigned to group member',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Plan',
|
||||||
|
value: 'plan',
|
||||||
|
description: 'Tasks in group plan',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Group ID',
|
displayName: 'Group ID',
|
||||||
name: 'groupId',
|
name: 'groupId',
|
||||||
|
@ -253,6 +319,9 @@ export const taskFields: INodeProperties[] = [
|
||||||
type: 'options',
|
type: 'options',
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getGroups',
|
loadOptionsMethod: 'getGroups',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'groupSource',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
displayOptions: {
|
displayOptions: {
|
||||||
show: {
|
show: {
|
||||||
|
@ -285,6 +354,35 @@ export const taskFields: INodeProperties[] = [
|
||||||
resource: [
|
resource: [
|
||||||
'task',
|
'task',
|
||||||
],
|
],
|
||||||
|
tasksFor: [
|
||||||
|
'member',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Plan ID',
|
||||||
|
name: 'planId',
|
||||||
|
required: false,
|
||||||
|
type: 'options',
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsMethod: 'getPlans',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'groupId',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
operation: [
|
||||||
|
'getAll',
|
||||||
|
],
|
||||||
|
resource: [
|
||||||
|
'task',
|
||||||
|
],
|
||||||
|
tasksFor: [
|
||||||
|
'plan',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
|
@ -304,7 +402,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: false,
|
default: false,
|
||||||
description: 'If all results should be returned or only up to a given limit.',
|
description: 'Whether to return all results or only up to a given limit',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Limit',
|
displayName: 'Limit',
|
||||||
|
@ -327,8 +425,8 @@ export const taskFields: INodeProperties[] = [
|
||||||
minValue: 1,
|
minValue: 1,
|
||||||
maxValue: 500,
|
maxValue: 500,
|
||||||
},
|
},
|
||||||
default: 100,
|
default: 50,
|
||||||
description: 'How many results to return.',
|
description: 'Max number of results to return',
|
||||||
},
|
},
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
@ -350,7 +448,7 @@ export const taskFields: INodeProperties[] = [
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'The ID of the Task.',
|
description: 'The ID of the Task',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Update Fields',
|
displayName: 'Update Fields',
|
||||||
|
@ -380,26 +478,38 @@ export const taskFields: INodeProperties[] = [
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
|
description: 'Who the task should be assigned to',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Bucket ID',
|
displayName: 'Bucket ID',
|
||||||
name: 'bucketId',
|
name: 'bucketId',
|
||||||
type: 'string',
|
type: 'options',
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsMethod: 'getBuckets',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'updateFields.planId',
|
||||||
|
],
|
||||||
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Channel name as it will appear to the user in Microsoft Teams.',
|
description: 'The bucket for the task to belong to',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Due Date Time',
|
displayName: 'Due Date Time',
|
||||||
name: 'dueDateTime',
|
name: 'dueDateTime',
|
||||||
type: 'dateTime',
|
type: 'dateTime',
|
||||||
default: '',
|
default: '',
|
||||||
description: `Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.`,
|
description: 'Date and time at which the task is due. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Group ID',
|
displayName: 'Group ID',
|
||||||
name: 'groupId',
|
name: 'groupId',
|
||||||
type: 'string',
|
type: 'options',
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsMethod: 'getGroups',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'groupSource',
|
||||||
|
],
|
||||||
|
},
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -409,11 +519,11 @@ export const taskFields: INodeProperties[] = [
|
||||||
typeOptions: {
|
typeOptions: {
|
||||||
loadOptionsMethod: 'getLabels',
|
loadOptionsMethod: 'getLabels',
|
||||||
loadOptionsDependsOn: [
|
loadOptionsDependsOn: [
|
||||||
'planId',
|
'updateFields.planId',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
default: [],
|
default: [],
|
||||||
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
|
description: 'Labels to assign to the task',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Percent Complete',
|
displayName: 'Percent Complete',
|
||||||
|
@ -424,21 +534,27 @@ export const taskFields: INodeProperties[] = [
|
||||||
maxValue: 100,
|
maxValue: 100,
|
||||||
},
|
},
|
||||||
default: 0,
|
default: 0,
|
||||||
description: `Percentage of task completion. When set to 100, the task is considered completed.`,
|
description: 'Percentage of task completion. When set to 100, the task is considered completed.',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Plan ID',
|
displayName: 'Plan ID',
|
||||||
name: 'planId',
|
name: 'planId',
|
||||||
type: 'string',
|
type: 'options',
|
||||||
|
typeOptions: {
|
||||||
|
loadOptionsMethod: 'getPlans',
|
||||||
|
loadOptionsDependsOn: [
|
||||||
|
'groupId',
|
||||||
|
],
|
||||||
|
},
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Channel name as it will appear to the user in Microsoft Teams.',
|
description: 'The plan for the task to belong to',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Title',
|
displayName: 'Title',
|
||||||
name: 'title',
|
name: 'title',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
default: '',
|
default: '',
|
||||||
description: 'Title of the task.',
|
description: 'Title of the task',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue