@hatk/hatk 0.0.1-alpha.41 → 0.0.1-alpha.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +16 -553
- package/dist/database/adapters/sqlite.d.ts.map +1 -1
- package/dist/database/adapters/sqlite.js +2 -1
- package/dist/database/db.d.ts +23 -0
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +81 -4
- package/dist/labels.d.ts +2 -0
- package/dist/labels.d.ts.map +1 -1
- package/dist/labels.js +5 -0
- package/dist/lexicon-resolve.d.ts.map +1 -1
- package/dist/lexicon-resolve.js +27 -112
- package/dist/lexicons/com/atproto/label/defs.json +75 -0
- package/dist/lexicons/com/atproto/moderation/defs.json +30 -0
- package/dist/lexicons/com/atproto/repo/strongRef.json +24 -0
- package/dist/lexicons/dev/hatk/createRecord.json +40 -0
- package/dist/lexicons/dev/hatk/createReport.json +48 -0
- package/dist/lexicons/dev/hatk/deleteRecord.json +25 -0
- package/dist/lexicons/dev/hatk/describeCollections.json +41 -0
- package/dist/lexicons/dev/hatk/describeFeeds.json +29 -0
- package/dist/lexicons/dev/hatk/describeLabels.json +31 -0
- package/dist/lexicons/dev/hatk/getFeed.json +30 -0
- package/dist/lexicons/dev/hatk/getPreferences.json +19 -0
- package/dist/lexicons/dev/hatk/getRecord.json +26 -0
- package/dist/lexicons/dev/hatk/getRecords.json +32 -0
- package/dist/lexicons/dev/hatk/putPreference.json +28 -0
- package/dist/lexicons/dev/hatk/putRecord.json +41 -0
- package/dist/lexicons/dev/hatk/searchRecords.json +32 -0
- package/dist/lexicons/dev/hatk/uploadBlob.json +23 -0
- package/dist/oauth/server.d.ts.map +1 -1
- package/dist/oauth/server.js +2 -1
- package/dist/pds-proxy.d.ts.map +1 -1
- package/dist/pds-proxy.js +15 -0
- package/dist/server-init.d.ts.map +1 -1
- package/dist/server-init.js +3 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +91 -13
- package/dist/templates/feed.tpl +14 -0
- package/dist/templates/hook.tpl +5 -0
- package/dist/templates/label.tpl +15 -0
- package/dist/templates/og.tpl +17 -0
- package/dist/templates/seed.tpl +11 -0
- package/dist/templates/setup.tpl +5 -0
- package/dist/templates/test-feed.tpl +19 -0
- package/dist/templates/test-xrpc.tpl +19 -0
- package/dist/templates/xrpc.tpl +41 -0
- package/package.json +3 -2
- package/public/admin.html +133 -0
- package/dist/cloudflare/container.d.ts +0 -73
- package/dist/cloudflare/container.d.ts.map +0 -1
- package/dist/cloudflare/container.js +0 -232
- package/dist/cloudflare/hooks.d.ts +0 -33
- package/dist/cloudflare/hooks.d.ts.map +0 -1
- package/dist/cloudflare/hooks.js +0 -40
- package/dist/cloudflare/init.d.ts +0 -27
- package/dist/cloudflare/init.d.ts.map +0 -1
- package/dist/cloudflare/init.js +0 -103
- package/dist/cloudflare/worker.d.ts +0 -27
- package/dist/cloudflare/worker.d.ts.map +0 -1
- package/dist/cloudflare/worker.js +0 -54
- package/dist/database/adapters/d1.d.ts +0 -56
- package/dist/database/adapters/d1.d.ts.map +0 -1
- package/dist/database/adapters/d1.js +0 -108
- package/dist/db.d.ts +0 -134
- package/dist/db.d.ts.map +0 -1
- package/dist/db.js +0 -1327
- package/dist/fts.d.ts +0 -20
- package/dist/fts.d.ts.map +0 -1
- package/dist/fts.js +0 -767
- package/dist/oauth/hooks.d.ts +0 -10
- package/dist/oauth/hooks.d.ts.map +0 -1
- package/dist/oauth/hooks.js +0 -40
- package/dist/schema.d.ts +0 -59
- package/dist/schema.d.ts.map +0 -1
- package/dist/schema.js +0 -387
- package/dist/test-browser.d.ts +0 -14
- package/dist/test-browser.d.ts.map +0 -1
- package/dist/test-browser.js +0 -26
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Cloudflare initialization logic used by both the standalone Worker
|
|
3
|
-
* entry and the SvelteKit handle hook.
|
|
4
|
-
*/
|
|
5
|
-
export interface CloudflareEnv {
|
|
6
|
-
DB: D1Database;
|
|
7
|
-
HATK_RELAY?: string;
|
|
8
|
-
HATK_PLC?: string;
|
|
9
|
-
HATK_OAUTH_ISSUER?: string;
|
|
10
|
-
HATK_OAUTH_SCOPES?: string;
|
|
11
|
-
HATK_ADMINS?: string;
|
|
12
|
-
HATK_COLLECTIONS?: string;
|
|
13
|
-
[key: string]: unknown;
|
|
14
|
-
}
|
|
15
|
-
interface D1Database {
|
|
16
|
-
prepare(sql: string): any;
|
|
17
|
-
batch<T = unknown>(statements: any[]): Promise<any[]>;
|
|
18
|
-
exec(sql: string): Promise<any>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Ensure initialization has completed. Concurrent calls share the same promise.
|
|
22
|
-
*/
|
|
23
|
-
export declare function ensureInit(env: CloudflareEnv): Promise<void>;
|
|
24
|
-
/** Get the hatk request handler (only valid after init). */
|
|
25
|
-
export declare function getHandler(): ((request: Request) => Promise<Response>) | null;
|
|
26
|
-
export {};
|
|
27
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/cloudflare/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,UAAU,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,UAAU,UAAU;IAClB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;IACzB,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IACrD,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;CAChC;AAoFD;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAS5D;AAED,4DAA4D;AAC5D,wBAAgB,UAAU,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAI,CAE7E"}
|
package/dist/cloudflare/init.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Cloudflare initialization logic used by both the standalone Worker
|
|
3
|
-
* entry and the SvelteKit handle hook.
|
|
4
|
-
*/
|
|
5
|
-
import { D1Adapter } from "../database/adapters/d1.js";
|
|
6
|
-
import { initDatabase, migrateSchema } from "../database/db.js";
|
|
7
|
-
import { storeLexicons, discoverCollections, buildSchemas } from "../database/schema.js";
|
|
8
|
-
import { discoverViews } from "../views.js";
|
|
9
|
-
import { getDialect } from "../database/dialect.js";
|
|
10
|
-
import { setSearchPort } from "../database/fts.js";
|
|
11
|
-
import { initOAuth } from "../oauth/server.js";
|
|
12
|
-
import { parseSessionCookie, getSessionCookieName } from "../oauth/session.js";
|
|
13
|
-
import { createHandler, registerCoreHandlers } from "../server.js";
|
|
14
|
-
import { configureRelay } from "../xrpc.js";
|
|
15
|
-
import { callXrpc } from "../xrpc.js";
|
|
16
|
-
import { validateLexicons } from '@bigmoves/lexicon';
|
|
17
|
-
let handler = null;
|
|
18
|
-
let initPromise = null;
|
|
19
|
-
/**
|
|
20
|
-
* One-time initialization. Sets up D1 adapter, database schemas, XRPC
|
|
21
|
-
* handlers, OAuth, and the globalThis bridge for SvelteKit SSR.
|
|
22
|
-
*/
|
|
23
|
-
async function initialize(env) {
|
|
24
|
-
const relay = env.HATK_RELAY || 'wss://bsky.network';
|
|
25
|
-
const plc = env.HATK_PLC || 'https://plc.directory';
|
|
26
|
-
configureRelay(relay);
|
|
27
|
-
const admins = env.HATK_ADMINS ? env.HATK_ADMINS.split(',').map((s) => s.trim()) : [];
|
|
28
|
-
// Load lexicons — injected at build time via virtual module
|
|
29
|
-
let lexicons;
|
|
30
|
-
try {
|
|
31
|
-
// @ts-expect-error — virtual module generated at build time
|
|
32
|
-
const lexiconModule = await import('virtual:hatk-lexicons');
|
|
33
|
-
lexicons = new Map(Object.entries(lexiconModule.default));
|
|
34
|
-
}
|
|
35
|
-
catch {
|
|
36
|
-
lexicons = new Map();
|
|
37
|
-
}
|
|
38
|
-
const lexiconErrors = validateLexicons([...lexicons.values()]);
|
|
39
|
-
if (lexiconErrors) {
|
|
40
|
-
for (const [nsid, errors] of Object.entries(lexiconErrors)) {
|
|
41
|
-
for (const err of errors) {
|
|
42
|
-
console.error(`[hatk] Invalid lexicon ${nsid}: ${err}`);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
throw new Error('Invalid lexicons — check build output');
|
|
46
|
-
}
|
|
47
|
-
storeLexicons(lexicons);
|
|
48
|
-
const collections = env.HATK_COLLECTIONS
|
|
49
|
-
? env.HATK_COLLECTIONS.split(',').map((s) => s.trim())
|
|
50
|
-
: discoverCollections(lexicons);
|
|
51
|
-
// Build schemas and init D1
|
|
52
|
-
discoverViews();
|
|
53
|
-
const engineDialect = getDialect('d1');
|
|
54
|
-
const { schemas, ddlStatements } = buildSchemas(lexicons, collections, engineDialect);
|
|
55
|
-
const adapter = new D1Adapter();
|
|
56
|
-
adapter.initWithBinding(env.DB);
|
|
57
|
-
setSearchPort(null);
|
|
58
|
-
await initDatabase(adapter, ':memory:', schemas, ddlStatements);
|
|
59
|
-
await migrateSchema(schemas);
|
|
60
|
-
// Register core XRPC handlers
|
|
61
|
-
const oauthConfig = env.HATK_OAUTH_ISSUER
|
|
62
|
-
? {
|
|
63
|
-
issuer: env.HATK_OAUTH_ISSUER,
|
|
64
|
-
scopes: env.HATK_OAUTH_SCOPES ? env.HATK_OAUTH_SCOPES.split(',').map((s) => s.trim()) : ['read', 'write'],
|
|
65
|
-
clients: [],
|
|
66
|
-
}
|
|
67
|
-
: null;
|
|
68
|
-
registerCoreHandlers(collections, oauthConfig);
|
|
69
|
-
if (oauthConfig) {
|
|
70
|
-
await initOAuth(oauthConfig, plc, relay);
|
|
71
|
-
}
|
|
72
|
-
// Expose bridge for SvelteKit SSR
|
|
73
|
-
;
|
|
74
|
-
globalThis.__hatk_callXrpc = callXrpc;
|
|
75
|
-
globalThis.__hatk_parseSessionCookie = parseSessionCookie;
|
|
76
|
-
globalThis.__hatk_sessionCookieName = getSessionCookieName();
|
|
77
|
-
// Create the request handler
|
|
78
|
-
handler = createHandler({
|
|
79
|
-
collections,
|
|
80
|
-
publicDir: null,
|
|
81
|
-
oauth: oauthConfig,
|
|
82
|
-
admins,
|
|
83
|
-
onResync: undefined,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Ensure initialization has completed. Concurrent calls share the same promise.
|
|
88
|
-
*/
|
|
89
|
-
export function ensureInit(env) {
|
|
90
|
-
if (handler)
|
|
91
|
-
return Promise.resolve();
|
|
92
|
-
if (!initPromise) {
|
|
93
|
-
initPromise = initialize(env).catch((err) => {
|
|
94
|
-
initPromise = null;
|
|
95
|
-
throw err;
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
return initPromise;
|
|
99
|
-
}
|
|
100
|
-
/** Get the hatk request handler (only valid after init). */
|
|
101
|
-
export function getHandler() {
|
|
102
|
-
return handler;
|
|
103
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflare Worker entry point for hatk.
|
|
3
|
-
*
|
|
4
|
-
* Handles HTTP requests via the Workers fetch handler. The firehose indexer
|
|
5
|
-
* and backfill run in a companion Container — the Worker only serves the
|
|
6
|
-
* API and web UI.
|
|
7
|
-
*
|
|
8
|
-
* For SvelteKit apps, prefer using the handle hook from
|
|
9
|
-
* '@hatk/hatk/cloudflare/hooks' with adapter-cloudflare instead.
|
|
10
|
-
*/
|
|
11
|
-
import { type CloudflareEnv } from './init.ts';
|
|
12
|
-
interface ContainerBinding {
|
|
13
|
-
resync(did: string): Promise<void>;
|
|
14
|
-
fetch(request: Request): Promise<Response>;
|
|
15
|
-
}
|
|
16
|
-
interface Env extends CloudflareEnv {
|
|
17
|
-
CONTAINER: ContainerBinding;
|
|
18
|
-
}
|
|
19
|
-
interface ExecutionContext {
|
|
20
|
-
waitUntil(promise: Promise<unknown>): void;
|
|
21
|
-
passThroughOnException(): void;
|
|
22
|
-
}
|
|
23
|
-
declare const _default: {
|
|
24
|
-
fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
25
|
-
};
|
|
26
|
-
export default _default;
|
|
27
|
-
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/cloudflare/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA0B,KAAK,aAAa,EAAE,MAAM,WAAW,CAAA;AAGtE,UAAU,gBAAgB;IACxB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClC,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C;AAED,UAAU,GAAI,SAAQ,aAAa;IACjC,SAAS,EAAE,gBAAgB,CAAA;CAC5B;AAED,UAAU,gBAAgB;IACxB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,IAAI,CAAA;IAC1C,sBAAsB,IAAI,IAAI,CAAA;CAC/B;;mBAGsB,OAAO,OAAO,GAAG,OAAO,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;;AADnF,wBA2CC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudflare Worker entry point for hatk.
|
|
3
|
-
*
|
|
4
|
-
* Handles HTTP requests via the Workers fetch handler. The firehose indexer
|
|
5
|
-
* and backfill run in a companion Container — the Worker only serves the
|
|
6
|
-
* API and web UI.
|
|
7
|
-
*
|
|
8
|
-
* For SvelteKit apps, prefer using the handle hook from
|
|
9
|
-
* '@hatk/hatk/cloudflare/hooks' with adapter-cloudflare instead.
|
|
10
|
-
*/
|
|
11
|
-
import { ensureInit, getHandler } from "./init.js";
|
|
12
|
-
import { isHatkRoute } from "../adapter.js";
|
|
13
|
-
export default {
|
|
14
|
-
async fetch(request, env, ctx) {
|
|
15
|
-
try {
|
|
16
|
-
await ensureInit(env);
|
|
17
|
-
}
|
|
18
|
-
catch (err) {
|
|
19
|
-
return new Response(JSON.stringify({ error: 'Initialization failed', detail: err.message }), {
|
|
20
|
-
status: 500,
|
|
21
|
-
headers: { 'Content-Type': 'application/json' },
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
const url = new URL(request.url);
|
|
25
|
-
const handler = getHandler();
|
|
26
|
-
// Intercept admin resync to delegate to the Container via RPC
|
|
27
|
-
if (url.pathname === '/admin/repos/resync' && request.method === 'POST') {
|
|
28
|
-
try {
|
|
29
|
-
const body = await request.text();
|
|
30
|
-
const { dids } = body ? JSON.parse(body) : {};
|
|
31
|
-
if (Array.isArray(dids)) {
|
|
32
|
-
for (const did of dids) {
|
|
33
|
-
ctx.waitUntil(env.CONTAINER.resync(did));
|
|
34
|
-
}
|
|
35
|
-
return new Response(JSON.stringify({ resyncing: dids.length }), {
|
|
36
|
-
headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' },
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch (err) {
|
|
41
|
-
return new Response(JSON.stringify({ error: err.message }), {
|
|
42
|
-
status: 500,
|
|
43
|
-
headers: { 'Content-Type': 'application/json' },
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// hatk routes → handler
|
|
48
|
-
if (isHatkRoute(url.pathname)) {
|
|
49
|
-
return handler(request);
|
|
50
|
-
}
|
|
51
|
-
// Everything else → 404 (use cloudflare/hooks for SvelteKit integration)
|
|
52
|
-
return new Response('Not found', { status: 404 });
|
|
53
|
-
},
|
|
54
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { DatabasePort, BulkInserter, Dialect } from '../ports.ts';
|
|
2
|
-
/**
|
|
3
|
-
* D1 database adapter for Cloudflare Workers/Containers.
|
|
4
|
-
*
|
|
5
|
-
* D1 is SQLite under the hood but accessed via an HTTP-based binding API.
|
|
6
|
-
* Key differences from the SQLite adapter:
|
|
7
|
-
* - No raw transactions — uses d1.batch() for atomic multi-statement execution
|
|
8
|
-
* - No prepared statement reuse — each query is a fresh prepare+bind
|
|
9
|
-
* - Bulk inserts use batched INSERT statements instead of native appenders
|
|
10
|
-
*/
|
|
11
|
-
/** Minimal D1 type definitions (matches Cloudflare's D1Database binding) */
|
|
12
|
-
interface D1Database {
|
|
13
|
-
prepare(sql: string): D1PreparedStatement;
|
|
14
|
-
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
|
|
15
|
-
exec(sql: string): Promise<D1ExecResult>;
|
|
16
|
-
}
|
|
17
|
-
interface D1PreparedStatement {
|
|
18
|
-
bind(...values: unknown[]): D1PreparedStatement;
|
|
19
|
-
all<T = Record<string, unknown>>(): Promise<D1Result<T>>;
|
|
20
|
-
run(): Promise<D1Result>;
|
|
21
|
-
first<T = Record<string, unknown>>(column?: string): Promise<T | null>;
|
|
22
|
-
}
|
|
23
|
-
interface D1Result<T = unknown> {
|
|
24
|
-
results: T[];
|
|
25
|
-
success: boolean;
|
|
26
|
-
meta: Record<string, unknown>;
|
|
27
|
-
}
|
|
28
|
-
interface D1ExecResult {
|
|
29
|
-
count: number;
|
|
30
|
-
duration: number;
|
|
31
|
-
}
|
|
32
|
-
export declare class D1Adapter implements DatabasePort {
|
|
33
|
-
dialect: Dialect;
|
|
34
|
-
private db;
|
|
35
|
-
private txBuffer;
|
|
36
|
-
/**
|
|
37
|
-
* Initialize with an existing D1 binding (from env.DB in Worker/Container).
|
|
38
|
-
* The `path` argument is ignored — D1 bindings are configured in wrangler.jsonc.
|
|
39
|
-
*/
|
|
40
|
-
open(_path: string): Promise<void>;
|
|
41
|
-
/** Set the D1 binding directly (called before open). */
|
|
42
|
-
initWithBinding(db: D1Database): void;
|
|
43
|
-
close(): void;
|
|
44
|
-
query<T = Record<string, unknown>>(sql: string, params?: unknown[]): Promise<T[]>;
|
|
45
|
-
execute(sql: string, params?: unknown[]): Promise<void>;
|
|
46
|
-
executeMultiple(sql: string): Promise<void>;
|
|
47
|
-
beginTransaction(): Promise<void>;
|
|
48
|
-
commit(): Promise<void>;
|
|
49
|
-
rollback(): Promise<void>;
|
|
50
|
-
createBulkInserter(table: string, columns: string[], options?: {
|
|
51
|
-
onConflict?: 'ignore' | 'replace';
|
|
52
|
-
batchSize?: number;
|
|
53
|
-
}): Promise<BulkInserter>;
|
|
54
|
-
}
|
|
55
|
-
export {};
|
|
56
|
-
//# sourceMappingURL=d1.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"d1.d.ts","sourceRoot":"","sources":["../../../src/database/adapters/d1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAEtE;;;;;;;;GAQG;AAEH,4EAA4E;AAC5E,UAAU,UAAU;IAClB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAAA;IACzC,KAAK,CAAC,CAAC,GAAG,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC7E,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OA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AAO,CAAC,IAAI,CAAC;IAa3D,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3C,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IASvB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAClE,OAAO,CAAC,YAAY,CAAC;CA+BzB"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Translate DuckDB-style $1, $2 placeholders to ? placeholders.
|
|
3
|
-
* Same logic as the SQLite adapter — D1 uses ? style.
|
|
4
|
-
*/
|
|
5
|
-
function translateParams(sql, params) {
|
|
6
|
-
if (params.length === 0)
|
|
7
|
-
return { sql, params };
|
|
8
|
-
const expandedParams = [];
|
|
9
|
-
const translated = sql.replace(/\$(\d+)/g, (_match, numStr) => {
|
|
10
|
-
const idx = parseInt(numStr) - 1;
|
|
11
|
-
expandedParams.push(params[idx]);
|
|
12
|
-
return '?';
|
|
13
|
-
});
|
|
14
|
-
return { sql: translated, params: expandedParams };
|
|
15
|
-
}
|
|
16
|
-
export class D1Adapter {
|
|
17
|
-
dialect = 'd1';
|
|
18
|
-
db;
|
|
19
|
-
txBuffer = null;
|
|
20
|
-
/**
|
|
21
|
-
* Initialize with an existing D1 binding (from env.DB in Worker/Container).
|
|
22
|
-
* The `path` argument is ignored — D1 bindings are configured in wrangler.jsonc.
|
|
23
|
-
*/
|
|
24
|
-
async open(_path) {
|
|
25
|
-
// D1 binding is injected via initWithBinding(), not opened by path.
|
|
26
|
-
// This is a no-op if already initialized.
|
|
27
|
-
if (!this.db) {
|
|
28
|
-
throw new Error('D1Adapter requires initWithBinding(db) before use');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
/** Set the D1 binding directly (called before open). */
|
|
32
|
-
initWithBinding(db) {
|
|
33
|
-
this.db = db;
|
|
34
|
-
}
|
|
35
|
-
close() {
|
|
36
|
-
// D1 bindings don't need explicit cleanup
|
|
37
|
-
}
|
|
38
|
-
async query(sql, params = []) {
|
|
39
|
-
const t = translateParams(sql, params);
|
|
40
|
-
const stmt = t.params.length > 0 ? this.db.prepare(t.sql).bind(...t.params) : this.db.prepare(t.sql);
|
|
41
|
-
const result = await stmt.all();
|
|
42
|
-
return result.results;
|
|
43
|
-
}
|
|
44
|
-
async execute(sql, params = []) {
|
|
45
|
-
const t = translateParams(sql, params);
|
|
46
|
-
const stmt = t.params.length > 0 ? this.db.prepare(t.sql).bind(...t.params) : this.db.prepare(t.sql);
|
|
47
|
-
// If inside a transaction, buffer instead of executing
|
|
48
|
-
if (this.txBuffer !== null) {
|
|
49
|
-
this.txBuffer.push(stmt);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
await stmt.run();
|
|
53
|
-
}
|
|
54
|
-
async executeMultiple(sql) {
|
|
55
|
-
// D1's exec() can be unreliable with multi-statement SQL.
|
|
56
|
-
// Split on semicolons and run each statement via prepare().run().
|
|
57
|
-
const statements = sql
|
|
58
|
-
.split(';')
|
|
59
|
-
.map((s) => s.trim())
|
|
60
|
-
.filter((s) => s.length > 0);
|
|
61
|
-
for (const stmt of statements) {
|
|
62
|
-
await this.db.prepare(stmt).run();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
async beginTransaction() {
|
|
66
|
-
this.txBuffer = [];
|
|
67
|
-
}
|
|
68
|
-
async commit() {
|
|
69
|
-
if (this.txBuffer === null)
|
|
70
|
-
return;
|
|
71
|
-
const statements = this.txBuffer;
|
|
72
|
-
this.txBuffer = null;
|
|
73
|
-
if (statements.length > 0) {
|
|
74
|
-
await this.db.batch(statements);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
async rollback() {
|
|
78
|
-
this.txBuffer = null;
|
|
79
|
-
}
|
|
80
|
-
async createBulkInserter(table, columns, options) {
|
|
81
|
-
const placeholders = columns.map(() => '?').join(', ');
|
|
82
|
-
const conflict = options?.onConflict === 'ignore' ? ' OR IGNORE' : options?.onConflict === 'replace' ? ' OR REPLACE' : '';
|
|
83
|
-
const sqlTemplate = `INSERT${conflict} INTO ${table} (${columns.join(', ')}) VALUES (${placeholders})`;
|
|
84
|
-
const buffer = [];
|
|
85
|
-
const batchSize = options?.batchSize ?? 200; // smaller batches for D1 CPU limits
|
|
86
|
-
const db = this.db;
|
|
87
|
-
const flush = async () => {
|
|
88
|
-
if (buffer.length > 0) {
|
|
89
|
-
await db.batch(buffer);
|
|
90
|
-
buffer.length = 0;
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
return {
|
|
94
|
-
append(values) {
|
|
95
|
-
buffer.push(db.prepare(sqlTemplate).bind(...values));
|
|
96
|
-
if (buffer.length >= batchSize) {
|
|
97
|
-
flush();
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
async flush() {
|
|
101
|
-
await flush();
|
|
102
|
-
},
|
|
103
|
-
async close() {
|
|
104
|
-
await flush();
|
|
105
|
-
},
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
package/dist/db.d.ts
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { type TableSchema } from './schema.ts';
|
|
2
|
-
import type { Row } from './lex-types.ts';
|
|
3
|
-
export declare function closeDatabase(): void;
|
|
4
|
-
export declare function runBatch(operations: Array<{
|
|
5
|
-
sql: string;
|
|
6
|
-
params: any[];
|
|
7
|
-
}>): Promise<void>;
|
|
8
|
-
export declare function initDatabase(dbPath: string, tableSchemas: TableSchema[], ddlStatements: string[]): Promise<void>;
|
|
9
|
-
export declare function getCursor(key: string): Promise<string | null>;
|
|
10
|
-
export declare function setCursor(key: string, value: string): Promise<void>;
|
|
11
|
-
export declare function getRepoStatus(did: string): Promise<string | null>;
|
|
12
|
-
export declare function setRepoStatus(did: string, status: string, rev?: string, opts?: {
|
|
13
|
-
retryCount?: number;
|
|
14
|
-
retryAfter?: number;
|
|
15
|
-
handle?: string | null;
|
|
16
|
-
}): Promise<void>;
|
|
17
|
-
export declare function getRepoRev(did: string): Promise<string | null>;
|
|
18
|
-
export declare function getRepoRetryInfo(did: string): Promise<{
|
|
19
|
-
retryCount: number;
|
|
20
|
-
retryAfter: number;
|
|
21
|
-
} | null>;
|
|
22
|
-
export declare function listRetryEligibleRepos(maxRetries: number): Promise<string[]>;
|
|
23
|
-
export declare function listPendingRepos(): Promise<string[]>;
|
|
24
|
-
export declare function listAllRepoStatuses(): Promise<Array<{
|
|
25
|
-
did: string;
|
|
26
|
-
status: string;
|
|
27
|
-
}>>;
|
|
28
|
-
export declare function listReposPaginated(opts?: {
|
|
29
|
-
limit?: number;
|
|
30
|
-
offset?: number;
|
|
31
|
-
status?: string;
|
|
32
|
-
q?: string;
|
|
33
|
-
}): Promise<{
|
|
34
|
-
repos: any[];
|
|
35
|
-
total: number;
|
|
36
|
-
}>;
|
|
37
|
-
export declare function getCollectionCounts(): Promise<Record<string, number>>;
|
|
38
|
-
export declare function getSchemaDump(): Promise<string>;
|
|
39
|
-
export declare function buildInsertOp(collection: string, uri: string, cid: string, authorDid: string, record: Record<string, any>): {
|
|
40
|
-
sql: string;
|
|
41
|
-
params: any[];
|
|
42
|
-
};
|
|
43
|
-
export declare function insertRecord(collection: string, uri: string, cid: string, authorDid: string, record: Record<string, any>): Promise<void>;
|
|
44
|
-
export declare function deleteRecord(collection: string, uri: string): Promise<void>;
|
|
45
|
-
export declare function insertLabels(labels: Array<{
|
|
46
|
-
src: string;
|
|
47
|
-
uri: string;
|
|
48
|
-
val: string;
|
|
49
|
-
neg?: boolean;
|
|
50
|
-
cts?: string;
|
|
51
|
-
exp?: string;
|
|
52
|
-
}>): Promise<void>;
|
|
53
|
-
export declare function queryLabelsForUris(uris: string[]): Promise<Map<string, Array<{
|
|
54
|
-
src: string;
|
|
55
|
-
uri: string;
|
|
56
|
-
val: string;
|
|
57
|
-
neg: boolean;
|
|
58
|
-
cts: string;
|
|
59
|
-
exp: string | null;
|
|
60
|
-
}>>>;
|
|
61
|
-
export interface BulkRecord {
|
|
62
|
-
collection: string;
|
|
63
|
-
uri: string;
|
|
64
|
-
cid: string;
|
|
65
|
-
did: string;
|
|
66
|
-
record: Record<string, any>;
|
|
67
|
-
}
|
|
68
|
-
export declare function bulkInsertRecords(records: BulkRecord[]): Promise<number>;
|
|
69
|
-
interface QueryOpts {
|
|
70
|
-
limit?: number;
|
|
71
|
-
cursor?: string;
|
|
72
|
-
filters?: Record<string, string>;
|
|
73
|
-
sort?: string;
|
|
74
|
-
order?: 'asc' | 'desc';
|
|
75
|
-
}
|
|
76
|
-
export declare function queryRecords(collection: string, opts?: QueryOpts): Promise<{
|
|
77
|
-
records: any[];
|
|
78
|
-
cursor?: string;
|
|
79
|
-
}>;
|
|
80
|
-
export declare function getRecordByUri(uri: string): Promise<any | null>;
|
|
81
|
-
export declare function getRecordsByUris(collection: string, uris: string[]): Promise<any[]>;
|
|
82
|
-
/**
|
|
83
|
-
* Multi-phase search across any collection's records.
|
|
84
|
-
*
|
|
85
|
-
* 1. **BM25** — Full-text search via DuckDB FTS. Multi-word queries use conjunctive
|
|
86
|
-
* mode (ALL terms required) to avoid spurious single-token matches.
|
|
87
|
-
* 2. **Exact substring** — ILIKE scan on all TEXT/JSON columns catches phrase matches
|
|
88
|
-
* that BM25 missed or ranked low (e.g. "bad bunny"). Results are prepended to BM25.
|
|
89
|
-
* 3. **Recent rows** — ILIKE scan of rows ingested since the last FTS rebuild, so newly
|
|
90
|
-
* written records are immediately searchable before the index catches up.
|
|
91
|
-
* 4. **Fuzzy** — Jaro-Winkler similarity fallback for typo tolerance when earlier phases
|
|
92
|
-
* return fewer than `limit` results.
|
|
93
|
-
*
|
|
94
|
-
* All phases derive searchable columns generically from the collection schema — no
|
|
95
|
-
* column names are hardcoded.
|
|
96
|
-
*/
|
|
97
|
-
export declare function searchRecords(collection: string, query: string, opts?: {
|
|
98
|
-
limit?: number;
|
|
99
|
-
cursor?: string;
|
|
100
|
-
fuzzy?: boolean;
|
|
101
|
-
}): Promise<{
|
|
102
|
-
records: any[];
|
|
103
|
-
cursor?: string;
|
|
104
|
-
}>;
|
|
105
|
-
export declare function querySQL(sql: string, params?: any[]): Promise<any[]>;
|
|
106
|
-
export declare function runSQL(sql: string, ...params: any[]): Promise<void>;
|
|
107
|
-
export declare function getSchema(collection: string): TableSchema | undefined;
|
|
108
|
-
export declare function countByField(collection: string, field: string, value: string): Promise<number>;
|
|
109
|
-
export declare function countByFieldBatch(collection: string, field: string, values: string[]): Promise<Map<string, number>>;
|
|
110
|
-
export declare function findByField(collection: string, field: string, value: string): Promise<any | null>;
|
|
111
|
-
export declare function findByFieldBatch(collection: string, field: string, values: string[]): Promise<Map<string, any[]>>;
|
|
112
|
-
export declare function lookupByFieldBatch(collection: string, field: string, values: string[]): Promise<Map<string, Row<unknown>>>;
|
|
113
|
-
export declare function findUriByFields(collection: string, conditions: {
|
|
114
|
-
field: string;
|
|
115
|
-
value: string;
|
|
116
|
-
}[]): Promise<string | null>;
|
|
117
|
-
export declare function normalizeValue(v: any): any;
|
|
118
|
-
export declare function getChildRows(childTableName: string, parentUris: string[]): Promise<Map<string, any[]>>;
|
|
119
|
-
export declare function reshapeRow(row: any, childData?: Map<string, Map<string, any[]>>, unionData?: Map<string, Map<string, Map<string, any[]>>>): Row<unknown> | null;
|
|
120
|
-
export declare function packCursor(sortVal: unknown, cid: string): string;
|
|
121
|
-
export declare function unpackCursor(cursor: string): {
|
|
122
|
-
primary: string;
|
|
123
|
-
cid: string;
|
|
124
|
-
} | null;
|
|
125
|
-
export declare function queryLabelsByDid(did: string): Promise<any[]>;
|
|
126
|
-
export declare function searchAccounts(query: string, limit?: number): Promise<any[]>;
|
|
127
|
-
export declare function getAccountRecordCount(did: string): Promise<number>;
|
|
128
|
-
export declare function getAllRecordUrisForDid(did: string): Promise<string[]>;
|
|
129
|
-
export declare function isTakendownDid(did: string): Promise<boolean>;
|
|
130
|
-
export declare function getPreferences(did: string): Promise<Record<string, any>>;
|
|
131
|
-
export declare function putPreference(did: string, key: string, value: any): Promise<void>;
|
|
132
|
-
export declare function filterTakendownDids(dids: string[]): Promise<Set<string>>;
|
|
133
|
-
export {};
|
|
134
|
-
//# sourceMappingURL=db.d.ts.map
|
package/dist/db.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"db.d.ts","sourceRoot":"","sources":["../src/db.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAA;AAUzC,wBAAgB,aAAa,IAAI,IAAI,CAUpC;AA+DD,wBAAsB,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,GAAG,EAAE,CAAA;CAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAkB/F;AAiBD,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,WAAW,EAAE,EAC3B,aAAa,EAAE,MAAM,EAAE,GACtB,OAAO,CAAC,IAAI,CAAC,CAiEf;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGnE;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEzE;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGvE;AAED,wBAAsB,aAAa,CACjC,GAAG,EAAE,MAAM,EAC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