32 lines
907 B
TypeScript
32 lines
907 B
TypeScript
import type { INodeProperties, IExecuteFunctions } from 'n8n-workflow';
|
|
import { microsoftApiRequest } from '../../transport';
|
|
import { updateDisplayOptions } from '@utils/utilities';
|
|
|
|
const properties: INodeProperties[] = [
|
|
{
|
|
displayName: 'Task ID',
|
|
name: 'taskId',
|
|
required: true,
|
|
type: 'string',
|
|
description: 'The ID of the task to retrieve',
|
|
placeholder: 'e.g. h3ufgLvXPkSRzYm-zO5cY5gANtBQ',
|
|
default: '',
|
|
},
|
|
];
|
|
|
|
const displayOptions = {
|
|
show: {
|
|
resource: ['task'],
|
|
operation: ['get'],
|
|
},
|
|
};
|
|
|
|
export const description = updateDisplayOptions(displayOptions, properties);
|
|
|
|
export async function execute(this: IExecuteFunctions, i: number) {
|
|
//https://docs.microsoft.com/en-us/graph/api/plannertask-get?view=graph-rest-1.0&tabs=http
|
|
|
|
const taskId = this.getNodeParameter('taskId', i) as string;
|
|
return await microsoftApiRequest.call(this, 'GET', `/v1.0/planner/tasks/${taskId}`);
|
|
}
|