import { Client } from '@microsoft/microsoft-graph-client'; import { Adapter } from '../index.js'; import { OneDriveAdapterOptions } from '../onedrive/index.js'; interface SharePointAdapterOptions { /** * Direct SharePoint site ID (`,,` triple form from Graph). * Mutually exclusive with `siteUrl` / `hostname` / `sitePath`. * Falls back to `SHAREPOINT_SITE_ID`. */ siteId?: string; /** * SharePoint site URL (e.g. `https://contoso.sharepoint.com/sites/marketing`). * Resolved to a site ID on first call via Graph * `/sites/{hostname}:{path}`. Falls back to `SHAREPOINT_SITE_URL`. */ siteUrl?: string; /** * SharePoint hostname (e.g. `contoso.sharepoint.com`). Combine with * `sitePath`. Falls back to `SHAREPOINT_HOSTNAME`. */ hostname?: string; /** * Site path on the hostname (e.g. `/sites/marketing`). Used with * `hostname`. Defaults to the tenant root when omitted. */ sitePath?: string; /** * Name of the SharePoint document library to target (e.g. `Documents`, * `Reports`). Resolved to a drive ID on first call. Omit to use the * site's default library. Falls back to `SHAREPOINT_DOCUMENT_LIBRARY`. */ documentLibrary?: string; /** * Explicit drive ID. Skips both site and library resolution entirely. * Falls back to `SHAREPOINT_DRIVE_ID`. */ driveId?: string; /** * App-only (client credentials) auth. Same shape as `onedrive()`. Falls * back to `SHAREPOINT_TENANT_ID` + `SHAREPOINT_CLIENT_ID` + * `SHAREPOINT_CLIENT_SECRET`, then to the `ONEDRIVE_*` equivalents. */ clientCredentials?: OneDriveAdapterOptions["clientCredentials"]; /** * Delegated OAuth refresh-token auth. Same shape as `onedrive()`. */ oauth?: OneDriveAdapterOptions["oauth"]; /** * Static or dynamic access token. Same shape as `onedrive()`. Falls back * to `SHAREPOINT_ACCESS_TOKEN` then `ONEDRIVE_ACCESS_TOKEN`. */ accessToken?: OneDriveAdapterOptions["accessToken"]; /** * Pre-built `@microsoft/microsoft-graph-client` `Client`. Same escape * hatch as `onedrive()`. */ client?: Client; /** * Logical "bucket root" — virtual keys live under this folder path within * the document library. Must already exist on the drive. Defaults to the * drive root. */ rootFolderPath?: string; /** * Mint an anonymous-view sharing link on every upload and return it from * `url()`. Defaults to `false` — `url()` throws when off. Subject to * tenant link-sharing policy. */ publicByDefault?: boolean; /** * Maximum time (ms) to wait for a copy operation. Same semantics as * `onedrive()`. */ copyTimeoutMs?: number; } type SharePointAdapter = Adapter & { readonly rootFolderPath: string; }; declare const sharepoint: (opts?: SharePointAdapterOptions) => SharePointAdapter; export { type SharePointAdapter, type SharePointAdapterOptions, sharepoint };