UNPKG

@struktoai/mirage-core

Version:

A Unified Virtual Filesystem For AI Agents

44 lines • 3.43 kB
import { type ByteWindow } from '../../utils/ranges.ts'; import { ApiError } from '../api/errors.ts'; import type { resolveMsGraphConfig } from './config.ts'; export declare function encodedPath(path: string): string; export declare class GraphError extends ApiError { readonly status: number; readonly code: string; constructor(status: number, code: string, message: string); } export declare function graphGet(config: ReturnType<typeof resolveMsGraphConfig>, url: string, params?: Record<string, string | number | boolean>): Promise<Record<string, unknown>>; /** * Every item a Graph collection answers, a page at a time; no page past the * one that brings `limit` items. Mirrors Python's `graph_list`. */ export declare function graphList(config: ReturnType<typeof resolveMsGraphConfig>, url: string, params?: Record<string, string | number | boolean>, limit?: number): Promise<Record<string, unknown>[]>; export declare function graphGetBytes(config: ReturnType<typeof resolveMsGraphConfig>, url: string, window?: ByteWindow, auth?: boolean): Promise<Uint8Array>; export declare function graphStream(config: ReturnType<typeof resolveMsGraphConfig>, url: string, auth?: boolean): AsyncIterable<Uint8Array>; export declare function graphPost(config: ReturnType<typeof resolveMsGraphConfig>, url: string, body?: Record<string, unknown>): Promise<Record<string, unknown>>; /** * The answers to several GETs from one JSON batch (`$batch`), each as its * status, its body and the seconds its `Retry-After` asks to be waited, in the * order of `urls`. * * Graph runs at most `BATCH_LIMIT` requests in a batch. Each URL is a full one * under the mount's service root, and goes in relative to it, as a batch names * its requests. A request the reply leaves out answers status 0, a body that * is not an object answers empty, and a wait is at most `MAX_BACKOFF`, 0 when * the answer names none. Mirrors Python's `graph_batch`. */ export declare function graphBatch(config: ReturnType<typeof resolveMsGraphConfig>, urls: readonly string[]): Promise<[number, Record<string, unknown>, number][]>; /** * The seconds a batched answer's `Retry-After` asks to be waited, at most * `MAX_BACKOFF`; 0 for none, or for one that is not a count of seconds. * Mirrors Python's `_retry_after`. */ export declare function retryAfter(headers: Record<string, unknown>): number; export declare function graphPostMonitor(config: ReturnType<typeof resolveMsGraphConfig>, url: string, body?: Record<string, unknown>): Promise<string>; export declare function graphPatch(config: ReturnType<typeof resolveMsGraphConfig>, url: string, body: Record<string, unknown>): Promise<Record<string, unknown>>; export declare function graphDelete(config: ReturnType<typeof resolveMsGraphConfig>, url: string): Promise<void>; export declare function graphPutBytes(config: ReturnType<typeof resolveMsGraphConfig>, url: string, data: Uint8Array): Promise<Record<string, unknown>>; export declare function pollMonitor(url: string, timeout: number, interval?: number): Promise<Record<string, unknown>>; export declare function uploadChunk(config: ReturnType<typeof resolveMsGraphConfig>, uploadUrl: string, data: Uint8Array, start: number, total: number): Promise<Record<string, unknown>>; export declare function cancelUpload(config: ReturnType<typeof resolveMsGraphConfig>, uploadUrl: string): Promise<void>; //# sourceMappingURL=client.d.ts.map