import { O as OneDriveFile, a as OneDriveStorageOptions } from "../../packem_shared/types.d-ZrDWKyVi.js"; export type { b as OneDriveClientCredentialsAuth, c as OneDriveOAuthRefreshAuth } from "../../packem_shared/types.d-ZrDWKyVi.js"; import { L as LocalMetaStorage } from "../../packem_shared/local-meta-storage.d-CYWYyCUo.js"; import { L as LocalMetaStorageOptions, M as MetaStorage, d as FileInit, O as OperationOptions, e as FilePart, f as FileQuery, g as FileReturn, B as BaseStorage } from "../../packem_shared/storage.d-C9EdfTf1.js"; import { Client } from '@microsoft/microsoft-graph-client'; import 'node:stream'; import 'node:timers'; import 'node:crypto'; import 'node:http'; import 'lru-cache'; declare class OneDriveMetaStorage extends LocalMetaStorage { constructor(config?: LocalMetaStorageOptions); } /** * OneDrive / SharePoint storage backend (Microsoft Graph). * * Routes virtual keys onto items under `rootFolderPath` in the target drive. * Uploads use a single `PUT :/content` request up to 250 MB and switch to * Microsoft Graph upload sessions above that threshold. * * **Auth precedence**: * 1. `client` (pre-built `@microsoft/microsoft-graph-client` `Client`) * 2. `accessToken` (string or `() => string | Promise<string>`) * 3. `clientCredentials` (`tenantId` + `clientId` + `clientSecret`) — app-only * 4. `oauth` (`refreshToken` + `clientId` [+ `clientSecret`, `tenantId`]) — delegated * 5. Env fallback: `ONEDRIVE_ACCESS_TOKEN`; or `ONEDRIVE_REFRESH_TOKEN` + * `ONEDRIVE_CLIENT_ID` (+ optional `ONEDRIVE_CLIENT_SECRET`, `ONEDRIVE_TENANT_ID`); * or `ONEDRIVE_CLIENT_ID` + `ONEDRIVE_CLIENT_SECRET` + `ONEDRIVE_TENANT_ID`. * * **Targeting**: at most one of `driveId`, `siteId`, `userId`. With no * targeting and delegated auth, defaults to `/me/drive`. App-only auth * (`clientCredentials`) cannot use `/me/drive` — pick a target explicitly. * * **Limitations**: * - `cacheControl` is not supported. * - `metadata` is preserved via the local metafile only; Graph does not store * arbitrary key/value metadata on `driveItem`. * - `getUploadUrl` returns an upload-session URL — clients should `PUT` chunks * directly to it with `Content-Range` headers (not a PUT-with-body URL). * - `responseContentDisposition` and `responseContentType` are not supported * on signed download URLs (Graph downloadUrls have no overrides). * - `write()` buffers the full part body in memory before deciding between * simple `PUT :/content` and upload-session paths. For multi-GB transfers * prefer `getUploadUrl()` and stream chunks directly to the returned * upload-session URL from the client. * - ⚠️ Per-operation `signal`/`timeout` are best-effort: the underlying SDK does not support request cancellation, so an in-flight call may complete server-side even after abort. `retries` is honored. */ declare class OneDriveStorage extends BaseStorage { static override readonly name: string; override checksumTypes: string[]; protected meta: MetaStorage; private readonly basePath; private readonly client; private readonly copyTimeoutMs; private readonly publicByDefault; private readonly rootFolderPath; constructor(config: OneDriveStorageOptions); override get raw(): Client; create(config: FileInit, _options?: OperationOptions): Promise; write(part: FilePart | FileQuery | OneDriveFile, options?: OperationOptions): Promise; delete({ id }: FileQuery, options?: OperationOptions): Promise; get({ id }: FileQuery, options?: OperationOptions): Promise; copy(name: string, destination: string, options?: OperationOptions & { storageClass?: string; }): Promise; move(name: string, destination: string, options?: OperationOptions): Promise; override list(limit?: number, options?: OperationOptions): Promise; override getReadUrl(key: string, options?: { expiresIn?: number; responseContentDisposition?: string; responseContentType?: string; }): Promise; override getUploadUrl(key: string, options?: { contentLength?: number; contentType?: string; expiresIn?: number; }): Promise; private keyParts; private itemApiPath; private itemActionPath; private folderListChildrenPath; /** * Build a `parentReference.path` for move/copy. Microsoft Graph requires * this path to be relative to the drive, prefixed with `/drive/root:` — * **not** with the configured base path (`/me/drive`, `/drives/{id}`, …). */ private parentReferencePath; private itemPathToKey; private uploadSimple; private uploadSession; private pollCopyMonitor; private internalOnComplete; } export { OneDriveFile, OneDriveMetaStorage, OneDriveStorage, type OneDriveStorageOptions };