feat(native): native reader for indexer (#14055)

This commit is contained in:
DarkSky
2025-12-07 16:22:11 +08:00
committed by GitHub
parent 69cdeedc4e
commit cf4e37c584
28 changed files with 1376 additions and 569 deletions

View File

@@ -1,3 +1,5 @@
import type { CrawlResult } from '@affine/nbstore';
export interface Blob {
key: string;
// base64 encoded data
@@ -149,4 +151,8 @@ export interface NbStorePlugin {
uploadedAt: number | null;
}) => Promise<void>;
clearClocks: (options: { id: string }) => Promise<void>;
crawlDocData: (options: {
id: string;
docId: string;
}) => Promise<CrawlResult>;
}

View File

@@ -4,6 +4,7 @@ import {
} from '@affine/core/modules/workspace-engine';
import {
type BlobRecord,
type CrawlResult,
type DocClock,
type DocRecord,
type ListedBlobRecord,
@@ -336,4 +337,10 @@ export const NbStoreNativeDBApis: NativeDBApis = {
uploadedAt: uploadedAt ? uploadedAt.getTime() : null,
});
},
crawlDocData: async function (
id: string,
docId: string
): Promise<CrawlResult> {
return await NbStore.crawlDocData({ id, docId });
},
};