import type { z } from 'zod'; import type { Command } from './command-types.js'; import { type ODataKey } from './odata-query.js'; /** * Options accepted by every builder that knows about `$select` (i.e. every * builder except `buildCommand` / `buildElevatedCommand`, which take no OData * passthroughs at all). `defaultSelect`, when set and the user did NOT pass * `--select`, is injected into the OData query string so default invocations * return a slim projection instead of a 50 KB resource. User-supplied * `--select` always wins. Audit Hervé-session §A: pairs the `list-mail-attachments` * pattern with the builder layer so the 6 heaviest endpoints stop returning * the full Graph resource by default. */ type SelectDefaults = { readonly defaultSelect?: string; }; declare const buildCommand: (pathFn: (params: Record) => string, schema: z.ZodType) => Pick; declare const buildElevatedCommand: (pathFn: (params: Record) => string, schema: z.ZodType) => Pick; declare const buildListCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, options?: SelectDefaults) => Pick; declare const buildElevatedListCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, options?: SelectDefaults) => Pick; /** * Single-resource GET that supports the OData `$select` and `$expand` query * parameters. Mirrors `buildListCommand` but exposes only the two flags that * make sense on a non-paginated resource — no `$top`/`$skip`/`$filter`/ * `$orderby` since there's no collection to slice. Lets an LLM ask only for * the fields it needs (e.g. `--select id,subject`) instead of swallowing a * 50 KB resource just to read a subject line. */ declare const buildSelectableCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, options?: SelectDefaults) => Pick; /** * Elevated-token twin of `buildSelectableCommand`. Use for single-resource * GETs on endpoints that require the M365ChatClient identity (e.g. `/chats/{id}`) * AND benefit from `$select`/`$expand` projection. The basic `buildElevatedCommand` * builder takes no OData passthroughs — use this when the endpoint honours * field projection, so an LLM can avoid pulling the whole resource just to * read a topic or chatType. */ declare const buildElevatedSelectableCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, options?: SelectDefaults) => Pick; /** * Collection GET that supports ONLY `$filter` and `$select` — for endpoints * Microsoft documents as rejecting the other OData passthroughs (`/teams/{id}/channels` * is the canonical case: Graph returns BadRequest on `$top`, `$skip`, `$orderby`, * `$expand`). Advertising the unsupported flags would be a usability lie. */ declare const buildFilterSelectListCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, options?: SelectDefaults) => Pick; /** * Collection GET on an endpoint that supports the usual OData passthroughs * EXCEPT `$skip` (e.g. `/me/drive/recent`, `/sites/{id}/lists`, * `/me/drive/search`). Graph rejects `$skip` with * `invalidRequest: $skip is not supported on this API.`; the CLI mirrors * by dropping `--skip` from the advertised flag set. */ declare const buildNoSkipListCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, options?: SelectDefaults) => Pick; /** * Collection GET that supports an EXPLICIT subset of OData passthroughs. * Use for endpoints where Graph silently drops some flags — passing * `keys: ['top', 'select']` advertises only `--top` and `--select` and * keeps the manifest honest. The other narrower builders * (`buildNoSkipListCommand`, `buildFilterSelectListCommand`) are * specializations; this is the generic escape hatch. */ declare const buildPickODataListCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, keys: ReadonlyArray, options?: SelectDefaults) => Pick; /** * Elevated-token twin of `buildPickODataListCommand`. Use for endpoints that * require the M365ChatClient identity (e.g. `/me/chats`, `/chats/{}/members`) * AND honour only a subset of OData passthroughs — the chats family rejects * `$orderby` / `$expand` with `BadRequest`, so the picker is the right tool. */ declare const buildElevatedPickODataListCommand: (pathFn: (params: z.infer>) => string, schema: z.ZodObject, keys: ReadonlyArray, options?: SelectDefaults) => Pick; export { buildCommand, buildElevatedCommand, buildElevatedListCommand, buildElevatedPickODataListCommand, buildElevatedSelectableCommand, buildFilterSelectListCommand, buildListCommand, buildNoSkipListCommand, buildPickODataListCommand, buildSelectableCommand, };