@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
54 lines • 2.3 kB
TypeScript
import type { SharePointAccessor } from '../../accessor/sharepoint.ts';
import type { PathSpec } from '../../types.ts';
import type { resolveMsGraphConfig } from '../msgraph/config.ts';
import { DriveLoc } from '../msgraph/drive.ts';
export interface ResolvedPath {
level: 'root' | 'site' | 'drive' | 'item';
siteId: string | null;
driveId: string | null;
itemPath: string | null;
}
/**
* Every accessible site as `[display name, id]`, sorted by name.
*
* A site with no id or no name is skipped: nothing could address it.
* Unscoped paths use only the listed name. Internal names also resolve a
* configured site when the mount is scoped to one document library.
*
* Args:
* accessor: the mount's accessor.
*/
export declare function siteEntries(accessor: SharePointAccessor): Promise<[string, string][]>;
export declare function listSites(accessor: SharePointAccessor): Promise<string[]>;
/**
* A site's document libraries as `[name, id]`, sorted by name.
*
* Args:
* accessor: the mount's accessor.
* siteId: the site whose drives to list.
*/
export declare function driveEntries(accessor: SharePointAccessor, siteId: string): Promise<[string, string][]>;
export declare function listDrives(accessor: SharePointAccessor, siteId: string): Promise<string[]>;
/**
* Resolve a mount path to its site, drive and drive-relative item path.
*
* A mount scoped to one site and drive (both configured) lives inside that
* drive, so its paths are drive-relative and the namespace levels vanish.
* An unscoped mount exposes `/<site>/<library>/...`.
*
* Args:
* accessor: the mount's accessor.
* path: the path to resolve.
*/
export declare function resolve(accessor: SharePointAccessor, path: PathSpec): Promise<ResolvedPath>;
/**
* Raise ENOENT unless `resolved` names a drive item.
*
* Args:
* path: the path `resolved` came from, named by the error.
* resolved: its resolution.
*/
export declare function requireItem(path: PathSpec, resolved: ResolvedPath): void;
export declare function resolveItem(accessor: SharePointAccessor, path: PathSpec): Promise<ResolvedPath>;
export declare function driveLoc(config: ReturnType<typeof resolveMsGraphConfig>, resolved: ResolvedPath, virtual: string): DriveLoc;
//# sourceMappingURL=resolve.d.ts.map