UNPKG

@pnp/cli-microsoft365

Version:

Manage Microsoft 365 and SharePoint Framework projects on any platform

39 lines 1.36 kB
import { z } from 'zod'; import { globalOptionsZod } from '../../../../Command.js'; import request from '../../../../request.js'; import { formatting } from '../../../../utils/formatting.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; export const options = z.strictObject({ ...globalOptionsZod.shape, taskId: z.string().alias('i') }); class PlannerTaskReferenceListCommand extends GraphCommand { get name() { return commands.TASK_REFERENCE_LIST; } get description() { return 'Retrieves the references associated to a Planner task'; } get schema() { return options; } async commandAction(logger, args) { const requestOptions = { url: `${this.resource}/v1.0/planner/tasks/${formatting.encodeQueryParameter(args.options.taskId)}/details?$select=references`, headers: { accept: 'application/json;odata.metadata=none' }, responseType: 'json' }; try { const res = await request.get(requestOptions); await logger.log(res.references); } catch (err) { this.handleRejectedODataJsonPromise(err); } } } export default new PlannerTaskReferenceListCommand(); //# sourceMappingURL=task-reference-list.js.map