UNPKG

@pnp/cli-microsoft365

Version:

Manage Microsoft 365 and SharePoint Framework projects on any platform

34 lines 1.12 kB
import { odata } from '../../../../utils/odata.js'; import GraphCommand from '../../../base/GraphCommand.js'; import commands from '../../commands.js'; import { z } from 'zod'; import { globalOptionsZod } from '../../../../Command.js'; export const options = z.strictObject({ ...globalOptionsZod.shape }); class ExternalConnectionListCommand extends GraphCommand { get name() { return commands.CONNECTION_LIST; } get description() { return 'Lists external connections defined in the Microsoft Search'; } alias() { return [commands.EXTERNALCONNECTION_LIST]; } get schema() { return options; } defaultProperties() { return ['id', 'name', 'state']; } async commandAction(logger) { try { const connections = await odata.getAllItems(`${this.resource}/v1.0/external/connections`); await logger.log(connections); } catch (err) { this.handleRejectedODataJsonPromise(err); } } } export default new ExternalConnectionListCommand(); //# sourceMappingURL=connection-list.js.map