@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
63 lines • 2.08 kB
TypeScript
import type { JsonObject } from '../../types.ts';
export declare function extractTitle(page: JsonObject): string;
export declare function pageSegmentName(page: JsonObject): string;
export declare function databaseSegmentName(database: JsonObject): string;
export declare function dataSourceSegmentName(dataSource: JsonObject): string;
export declare function normalizePage(page: JsonObject, blocks: readonly JsonObject[]): {
markdown: string;
blocks: JsonObject[];
page_id: string;
title: string;
url: string;
created_time: string;
last_edited_time: string;
parent_type: string;
parent_id: string;
archived: boolean;
created_by: string;
last_edited_by: string;
properties: JsonObject;
};
/**
* One line of a data source's `rows.jsonl`: the row's `page.json` without
* the body, which a query does not carry, and with the path of that
* `page.json` below the data source. The rows are not listed as
* directories, so the line is where a row's directory name is found.
* Mirrors `normalize_row` in `mirage/core/notion/normalize.py`.
*/
export declare function normalizeRow(page: JsonObject): {
url: string;
created_time: string;
last_edited_time: string;
parent_type: string;
parent_id: string;
archived: boolean;
created_by: string;
last_edited_by: string;
properties: JsonObject;
page_id: string;
title: string;
path: string;
};
export declare function normalizeDatabase(database: JsonObject): {
database_id: string;
title: string;
url: string | null;
created_time: string | null;
last_edited_time: string | null;
parent: JsonObject;
archived: boolean;
is_inline: boolean;
data_sources: unknown[];
};
export declare function normalizeDataSource(dataSource: JsonObject): {
data_source_id: string;
database_id: string;
title: string;
created_time: string | null;
last_edited_time: string | null;
database_parent: JsonObject;
archived: boolean;
properties: JsonObject;
};
//# sourceMappingURL=normalize.d.ts.map