@typicalday/firegraph 0.14.1 → 0.15.0
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/README.md +23 -3
- package/dist/{backend-DuvHGgK1.d.cts → backend-BpYLdwCW.d.cts} +1 -1
- package/dist/{backend-DuvHGgK1.d.ts → backend-BpYLdwCW.d.ts} +1 -1
- package/dist/backend-CvImIwTY.d.cts +137 -0
- package/dist/backend-YH5HtawN.d.ts +137 -0
- package/dist/backend.d.cts +2 -2
- package/dist/backend.d.ts +2 -2
- package/dist/{chunk-3AHHXMWX.js → chunk-5HIRYV2S.js} +12 -35
- package/dist/chunk-5HIRYV2S.js.map +1 -0
- package/dist/{chunk-DJI3VXXA.js → chunk-7IEZ6IYY.js} +2 -2
- package/dist/chunk-7IEZ6IYY.js.map +1 -0
- package/dist/chunk-FODIMIWY.js +721 -0
- package/dist/chunk-FODIMIWY.js.map +1 -0
- package/dist/chunk-NGAJCALM.js +34 -0
- package/dist/chunk-NGAJCALM.js.map +1 -0
- package/dist/chunk-ULRDQ6HZ.js +862 -0
- package/dist/chunk-ULRDQ6HZ.js.map +1 -0
- package/dist/{client-BKi3vk0Q.d.ts → client-B5o39X79.d.ts} +1 -1
- package/dist/{client-BrsaXtDV.d.cts → client-BGHwxwPg.d.cts} +1 -1
- package/dist/{client-Bk2Cm6xv.d.cts → client-DoyEdJ5w.d.cts} +1 -1
- package/dist/{client-Bk2Cm6xv.d.ts → client-DoyEdJ5w.d.ts} +1 -1
- package/dist/cloudflare/index.cjs +148 -158
- package/dist/cloudflare/index.cjs.map +1 -1
- package/dist/cloudflare/index.d.cts +73 -70
- package/dist/cloudflare/index.d.ts +73 -70
- package/dist/cloudflare/index.js +53 -588
- package/dist/cloudflare/index.js.map +1 -1
- package/dist/codegen/index.d.cts +1 -1
- package/dist/codegen/index.d.ts +1 -1
- package/dist/firestore-enterprise/index.cjs.map +1 -1
- package/dist/firestore-enterprise/index.d.cts +3 -3
- package/dist/firestore-enterprise/index.d.ts +3 -3
- package/dist/firestore-enterprise/index.js +5 -3
- package/dist/firestore-enterprise/index.js.map +1 -1
- package/dist/firestore-standard/index.cjs.map +1 -1
- package/dist/firestore-standard/index.d.cts +3 -3
- package/dist/firestore-standard/index.d.ts +3 -3
- package/dist/firestore-standard/index.js +3 -2
- package/dist/firestore-standard/index.js.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/query-client/index.d.cts +2 -2
- package/dist/query-client/index.d.ts +2 -2
- package/dist/{registry-Bc7h6WTM.d.cts → registry-BGh7Jqpb.d.cts} +2 -2
- package/dist/{registry-C2KUPVZj.d.ts → registry-tKTb5Kx1.d.ts} +2 -2
- package/dist/sqlite/index.cjs +578 -371
- package/dist/sqlite/index.cjs.map +1 -1
- package/dist/sqlite/index.d.cts +4 -110
- package/dist/sqlite/index.d.ts +4 -110
- package/dist/sqlite/index.js +7 -1144
- package/dist/sqlite/index.js.map +1 -1
- package/dist/sqlite/local.cjs +1835 -0
- package/dist/sqlite/local.cjs.map +1 -0
- package/dist/sqlite/local.d.cts +83 -0
- package/dist/sqlite/local.d.ts +83 -0
- package/dist/sqlite/local.js +121 -0
- package/dist/sqlite/local.js.map +1 -0
- package/package.json +15 -1
- package/dist/chunk-3AHHXMWX.js.map +0 -1
- package/dist/chunk-DJI3VXXA.js.map +0 -1
- package/dist/chunk-NNBSUOOF.js +0 -289
- package/dist/chunk-NNBSUOOF.js.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Database } from 'better-sqlite3';
|
|
2
|
+
import { S as StorageBackend } from '../backend-BpYLdwCW.js';
|
|
3
|
+
import { a as SqliteCapability, S as SqliteBackendOptions, b as SqliteExecutor } from '../backend-YH5HtawN.js';
|
|
4
|
+
import '@google-cloud/firestore';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Local SQLite backend over `better-sqlite3`.
|
|
8
|
+
*
|
|
9
|
+
* This entry point is published as `firegraph/sqlite-local` and is the only
|
|
10
|
+
* module in the library that references `better-sqlite3` — keep it out of
|
|
11
|
+
* `firegraph/sqlite` so that D1 / workerd bundles never see the native
|
|
12
|
+
* dependency. `better-sqlite3` is loaded via dynamic `import()` at factory
|
|
13
|
+
* call time, so merely importing this module stays side-effect free.
|
|
14
|
+
*
|
|
15
|
+
* The factory accepts either a database file path (`':memory:'` works) or an
|
|
16
|
+
* already-open `better-sqlite3` Database. Path-opened databases get
|
|
17
|
+
* `journal_mode = WAL` and a `busy_timeout` applied; caller-provided
|
|
18
|
+
* databases are used as-is (only `busy_timeout` is set) since the caller
|
|
19
|
+
* owns their pragma configuration.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
interface LocalSqliteBackendOptions extends SqliteBackendOptions {
|
|
23
|
+
/** Root graph table name. Defaults to `'firegraph'`. */
|
|
24
|
+
tableName?: string;
|
|
25
|
+
/**
|
|
26
|
+
* `PRAGMA busy_timeout` in milliseconds — how long a connection waits on a
|
|
27
|
+
* lock held by another process before erroring. Defaults to 5000.
|
|
28
|
+
*/
|
|
29
|
+
busyTimeoutMs?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Extra pragmas applied after the defaults, e.g.
|
|
32
|
+
* `{ synchronous: 'NORMAL', cache_size: -64000 }`. Applied in object
|
|
33
|
+
* order via `PRAGMA <key> = <value>`.
|
|
34
|
+
*/
|
|
35
|
+
pragmas?: Record<string, string | number>;
|
|
36
|
+
/**
|
|
37
|
+
* When opening by path: throw if the file does not already exist instead
|
|
38
|
+
* of creating it. Defaults to false.
|
|
39
|
+
*/
|
|
40
|
+
fileMustExist?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface LocalSqliteBackend {
|
|
43
|
+
/** The graph storage backend — pass to `createGraphClient`. */
|
|
44
|
+
backend: StorageBackend<SqliteCapability>;
|
|
45
|
+
/** The underlying better-sqlite3 database, for raw access. */
|
|
46
|
+
db: Database;
|
|
47
|
+
/**
|
|
48
|
+
* Close the database. No-op when the factory was given an already-open
|
|
49
|
+
* Database (the caller owns its lifecycle).
|
|
50
|
+
*/
|
|
51
|
+
close(): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build a transaction-capable `SqliteExecutor` over a better-sqlite3
|
|
55
|
+
* Database. Interactive transactions use manual `BEGIN IMMEDIATE` /
|
|
56
|
+
* `COMMIT` / `ROLLBACK` because `db.transaction()` requires a synchronous
|
|
57
|
+
* callback while `SqliteExecutor.transaction` callbacks are async.
|
|
58
|
+
*
|
|
59
|
+
* Exported for callers that want to wire `createSqliteBackend` directly
|
|
60
|
+
* (e.g. to share one executor across several root tables).
|
|
61
|
+
*/
|
|
62
|
+
declare function createBetterSqliteExecutor(db: Database): SqliteExecutor;
|
|
63
|
+
/**
|
|
64
|
+
* Open (or wrap) a local SQLite database and return a graph storage backend
|
|
65
|
+
* over it.
|
|
66
|
+
*
|
|
67
|
+
* ```typescript
|
|
68
|
+
* import { createLocalSqliteBackend } from 'firegraph/sqlite-local';
|
|
69
|
+
* import { createGraphClient } from 'firegraph/sqlite';
|
|
70
|
+
*
|
|
71
|
+
* const { backend, close } = await createLocalSqliteBackend('./graph.db');
|
|
72
|
+
* const client = createGraphClient(backend);
|
|
73
|
+
* // ... use the client ...
|
|
74
|
+
* close();
|
|
75
|
+
* ```
|
|
76
|
+
*
|
|
77
|
+
* Requires `better-sqlite3` to be installed (declared as an optional peer
|
|
78
|
+
* dependency). The factory is async because the driver is loaded via
|
|
79
|
+
* dynamic `import()`.
|
|
80
|
+
*/
|
|
81
|
+
declare function createLocalSqliteBackend(pathOrDb: string | Database, options?: LocalSqliteBackendOptions): Promise<LocalSqliteBackend>;
|
|
82
|
+
|
|
83
|
+
export { type LocalSqliteBackend, type LocalSqliteBackendOptions, createBetterSqliteExecutor, createLocalSqliteBackend };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createSqliteBackend
|
|
3
|
+
} from "../chunk-FODIMIWY.js";
|
|
4
|
+
import "../chunk-ULRDQ6HZ.js";
|
|
5
|
+
import "../chunk-2DHMNTV6.js";
|
|
6
|
+
import "../chunk-N5HFDWQX.js";
|
|
7
|
+
import "../chunk-NGAJCALM.js";
|
|
8
|
+
import {
|
|
9
|
+
FiregraphError
|
|
10
|
+
} from "../chunk-SIHE4UY4.js";
|
|
11
|
+
import "../chunk-EQJUUVFG.js";
|
|
12
|
+
|
|
13
|
+
// src/sqlite/local.ts
|
|
14
|
+
function createBetterSqliteExecutor(db) {
|
|
15
|
+
return {
|
|
16
|
+
async all(sql, params) {
|
|
17
|
+
return db.prepare(sql).all(...params);
|
|
18
|
+
},
|
|
19
|
+
async run(sql, params) {
|
|
20
|
+
db.prepare(sql).run(...params);
|
|
21
|
+
},
|
|
22
|
+
async batch(statements) {
|
|
23
|
+
const tx = db.transaction((stmts) => {
|
|
24
|
+
for (const s of stmts) {
|
|
25
|
+
db.prepare(s.sql).run(...s.params);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
tx(statements);
|
|
29
|
+
},
|
|
30
|
+
async transaction(fn) {
|
|
31
|
+
db.exec("BEGIN IMMEDIATE");
|
|
32
|
+
try {
|
|
33
|
+
const result = await fn({
|
|
34
|
+
async all(sql, params) {
|
|
35
|
+
return db.prepare(sql).all(...params);
|
|
36
|
+
},
|
|
37
|
+
async run(sql, params) {
|
|
38
|
+
db.prepare(sql).run(...params);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
db.exec("COMMIT");
|
|
42
|
+
return result;
|
|
43
|
+
} catch (err) {
|
|
44
|
+
db.exec("ROLLBACK");
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function isDatabase(value) {
|
|
51
|
+
return typeof value === "object" && value !== null && typeof value.prepare === "function" && typeof value.exec === "function";
|
|
52
|
+
}
|
|
53
|
+
var PRAGMA_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
54
|
+
var PRAGMA_VALUE_PATTERN = /^-?[A-Za-z0-9_]+$/;
|
|
55
|
+
function applyPragmas(db, pragmas) {
|
|
56
|
+
for (const [key, value] of Object.entries(pragmas)) {
|
|
57
|
+
if (!PRAGMA_KEY_PATTERN.test(key)) {
|
|
58
|
+
throw new FiregraphError(`Invalid pragma name: ${JSON.stringify(key)}`, "INVALID_ARGUMENT");
|
|
59
|
+
}
|
|
60
|
+
if (!PRAGMA_VALUE_PATTERN.test(String(value)) || typeof value === "number" && !Number.isFinite(value)) {
|
|
61
|
+
throw new FiregraphError(
|
|
62
|
+
`Invalid pragma value for ${key}: ${JSON.stringify(value)}`,
|
|
63
|
+
"INVALID_ARGUMENT"
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
db.pragma(`${key} = ${value}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function createLocalSqliteBackend(pathOrDb, options = {}) {
|
|
70
|
+
const {
|
|
71
|
+
tableName = "firegraph",
|
|
72
|
+
busyTimeoutMs = 5e3,
|
|
73
|
+
pragmas,
|
|
74
|
+
fileMustExist,
|
|
75
|
+
...backendOptions
|
|
76
|
+
} = options;
|
|
77
|
+
let db;
|
|
78
|
+
let ownsDb;
|
|
79
|
+
if (typeof pathOrDb === "string") {
|
|
80
|
+
let Database;
|
|
81
|
+
try {
|
|
82
|
+
Database = (await import("better-sqlite3")).default;
|
|
83
|
+
} catch (err) {
|
|
84
|
+
throw new FiregraphError(
|
|
85
|
+
`createLocalSqliteBackend requires the optional peer dependency 'better-sqlite3' \u2014 install it to use the local SQLite backend (${err instanceof Error ? err.message : String(err)})`,
|
|
86
|
+
"MISSING_DEPENDENCY"
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
db = new Database(pathOrDb, fileMustExist ? { fileMustExist: true } : {});
|
|
90
|
+
ownsDb = true;
|
|
91
|
+
db.pragma("journal_mode = WAL");
|
|
92
|
+
} else if (isDatabase(pathOrDb)) {
|
|
93
|
+
db = pathOrDb;
|
|
94
|
+
ownsDb = false;
|
|
95
|
+
} else {
|
|
96
|
+
throw new FiregraphError(
|
|
97
|
+
"createLocalSqliteBackend expects a file path or an open better-sqlite3 Database",
|
|
98
|
+
"INVALID_ARGUMENT"
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
db.pragma(`busy_timeout = ${Math.max(0, Math.floor(busyTimeoutMs))}`);
|
|
102
|
+
if (pragmas) {
|
|
103
|
+
applyPragmas(db, pragmas);
|
|
104
|
+
}
|
|
105
|
+
const backend = createSqliteBackend(createBetterSqliteExecutor(db), tableName, backendOptions);
|
|
106
|
+
let closed = false;
|
|
107
|
+
return {
|
|
108
|
+
backend,
|
|
109
|
+
db,
|
|
110
|
+
close() {
|
|
111
|
+
if (closed || !ownsDb) return;
|
|
112
|
+
closed = true;
|
|
113
|
+
db.close();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
createBetterSqliteExecutor,
|
|
119
|
+
createLocalSqliteBackend
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/sqlite/local.ts"],"sourcesContent":["/**\n * Local SQLite backend over `better-sqlite3`.\n *\n * This entry point is published as `firegraph/sqlite-local` and is the only\n * module in the library that references `better-sqlite3` — keep it out of\n * `firegraph/sqlite` so that D1 / workerd bundles never see the native\n * dependency. `better-sqlite3` is loaded via dynamic `import()` at factory\n * call time, so merely importing this module stays side-effect free.\n *\n * The factory accepts either a database file path (`':memory:'` works) or an\n * already-open `better-sqlite3` Database. Path-opened databases get\n * `journal_mode = WAL` and a `busy_timeout` applied; caller-provided\n * databases are used as-is (only `busy_timeout` is set) since the caller\n * owns their pragma configuration.\n */\n\nimport type { Database as BetterSqliteDb, default as BetterSqliteDatabase } from 'better-sqlite3';\n\nimport { FiregraphError } from '../errors.js';\nimport type { StorageBackend } from '../internal/backend.js';\nimport type { SqliteExecutor, SqliteTxExecutor } from '../internal/sqlite-executor.js';\nimport type { SqliteBackendOptions, SqliteCapability } from './backend.js';\nimport { createSqliteBackend } from './backend.js';\n\nexport interface LocalSqliteBackendOptions extends SqliteBackendOptions {\n /** Root graph table name. Defaults to `'firegraph'`. */\n tableName?: string;\n /**\n * `PRAGMA busy_timeout` in milliseconds — how long a connection waits on a\n * lock held by another process before erroring. Defaults to 5000.\n */\n busyTimeoutMs?: number;\n /**\n * Extra pragmas applied after the defaults, e.g.\n * `{ synchronous: 'NORMAL', cache_size: -64000 }`. Applied in object\n * order via `PRAGMA <key> = <value>`.\n */\n pragmas?: Record<string, string | number>;\n /**\n * When opening by path: throw if the file does not already exist instead\n * of creating it. Defaults to false.\n */\n fileMustExist?: boolean;\n}\n\nexport interface LocalSqliteBackend {\n /** The graph storage backend — pass to `createGraphClient`. */\n backend: StorageBackend<SqliteCapability>;\n /** The underlying better-sqlite3 database, for raw access. */\n db: BetterSqliteDb;\n /**\n * Close the database. No-op when the factory was given an already-open\n * Database (the caller owns its lifecycle).\n */\n close(): void;\n}\n\n/**\n * Build a transaction-capable `SqliteExecutor` over a better-sqlite3\n * Database. Interactive transactions use manual `BEGIN IMMEDIATE` /\n * `COMMIT` / `ROLLBACK` because `db.transaction()` requires a synchronous\n * callback while `SqliteExecutor.transaction` callbacks are async.\n *\n * Exported for callers that want to wire `createSqliteBackend` directly\n * (e.g. to share one executor across several root tables).\n */\nexport function createBetterSqliteExecutor(db: BetterSqliteDb): SqliteExecutor {\n return {\n async all(sql: string, params: unknown[]): Promise<Record<string, unknown>[]> {\n return db.prepare(sql).all(...params) as Record<string, unknown>[];\n },\n async run(sql: string, params: unknown[]): Promise<void> {\n db.prepare(sql).run(...params);\n },\n async batch(statements): Promise<void> {\n const tx = db.transaction((stmts: typeof statements) => {\n for (const s of stmts) {\n db.prepare(s.sql).run(...s.params);\n }\n });\n tx(statements);\n },\n async transaction<T>(fn: (tx: SqliteTxExecutor) => Promise<T>): Promise<T> {\n db.exec('BEGIN IMMEDIATE');\n try {\n const result = await fn({\n async all(sql: string, params: unknown[]) {\n return db.prepare(sql).all(...params) as Record<string, unknown>[];\n },\n async run(sql: string, params: unknown[]) {\n db.prepare(sql).run(...params);\n },\n });\n db.exec('COMMIT');\n return result;\n } catch (err) {\n db.exec('ROLLBACK');\n throw err;\n }\n },\n };\n}\n\nfunction isDatabase(value: unknown): value is BetterSqliteDb {\n return (\n typeof value === 'object' &&\n value !== null &&\n typeof (value as { prepare?: unknown }).prepare === 'function' &&\n typeof (value as { exec?: unknown }).exec === 'function'\n );\n}\n\nconst PRAGMA_KEY_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\n// Pragma values are identifiers (WAL, NORMAL) or integers — never compound\n// expressions, so anything else is rejected rather than interpolated.\nconst PRAGMA_VALUE_PATTERN = /^-?[A-Za-z0-9_]+$/;\n\nfunction applyPragmas(db: BetterSqliteDb, pragmas: Record<string, string | number>): void {\n for (const [key, value] of Object.entries(pragmas)) {\n if (!PRAGMA_KEY_PATTERN.test(key)) {\n throw new FiregraphError(`Invalid pragma name: ${JSON.stringify(key)}`, 'INVALID_ARGUMENT');\n }\n if (\n !PRAGMA_VALUE_PATTERN.test(String(value)) ||\n (typeof value === 'number' && !Number.isFinite(value))\n ) {\n throw new FiregraphError(\n `Invalid pragma value for ${key}: ${JSON.stringify(value)}`,\n 'INVALID_ARGUMENT',\n );\n }\n db.pragma(`${key} = ${value}`);\n }\n}\n\n/**\n * Open (or wrap) a local SQLite database and return a graph storage backend\n * over it.\n *\n * ```typescript\n * import { createLocalSqliteBackend } from 'firegraph/sqlite-local';\n * import { createGraphClient } from 'firegraph/sqlite';\n *\n * const { backend, close } = await createLocalSqliteBackend('./graph.db');\n * const client = createGraphClient(backend);\n * // ... use the client ...\n * close();\n * ```\n *\n * Requires `better-sqlite3` to be installed (declared as an optional peer\n * dependency). The factory is async because the driver is loaded via\n * dynamic `import()`.\n */\nexport async function createLocalSqliteBackend(\n pathOrDb: string | BetterSqliteDb,\n options: LocalSqliteBackendOptions = {},\n): Promise<LocalSqliteBackend> {\n const {\n tableName = 'firegraph',\n busyTimeoutMs = 5000,\n pragmas,\n fileMustExist,\n ...backendOptions\n } = options;\n\n let db: BetterSqliteDb;\n let ownsDb: boolean;\n if (typeof pathOrDb === 'string') {\n let Database: typeof BetterSqliteDatabase;\n try {\n Database = (await import('better-sqlite3')).default;\n } catch (err) {\n throw new FiregraphError(\n `createLocalSqliteBackend requires the optional peer dependency 'better-sqlite3' — install it to use the local SQLite backend (${\n err instanceof Error ? err.message : String(err)\n })`,\n 'MISSING_DEPENDENCY',\n );\n }\n db = new Database(pathOrDb, fileMustExist ? { fileMustExist: true } : {});\n ownsDb = true;\n // WAL lets concurrent readers coexist with a writer — the right default\n // for a long-lived local graph file. On ':memory:' databases SQLite\n // reports 'memory' and ignores the request, which is fine.\n db.pragma('journal_mode = WAL');\n } else if (isDatabase(pathOrDb)) {\n db = pathOrDb;\n ownsDb = false;\n } else {\n throw new FiregraphError(\n 'createLocalSqliteBackend expects a file path or an open better-sqlite3 Database',\n 'INVALID_ARGUMENT',\n );\n }\n\n db.pragma(`busy_timeout = ${Math.max(0, Math.floor(busyTimeoutMs))}`);\n if (pragmas) {\n applyPragmas(db, pragmas);\n }\n\n const backend = createSqliteBackend(createBetterSqliteExecutor(db), tableName, backendOptions);\n let closed = false;\n return {\n backend,\n db,\n close(): void {\n if (closed || !ownsDb) return;\n closed = true;\n db.close();\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;AAkEO,SAAS,2BAA2B,IAAoC;AAC7E,SAAO;AAAA,IACL,MAAM,IAAI,KAAa,QAAuD;AAC5E,aAAO,GAAG,QAAQ,GAAG,EAAE,IAAI,GAAG,MAAM;AAAA,IACtC;AAAA,IACA,MAAM,IAAI,KAAa,QAAkC;AACvD,SAAG,QAAQ,GAAG,EAAE,IAAI,GAAG,MAAM;AAAA,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
+
"version": "0.15.0",
|
|
4
4
|
"description": "Generic Firestore adjacency graph client with smart query planning",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -96,6 +96,16 @@
|
|
|
96
96
|
"types": "./dist/sqlite/index.d.cts",
|
|
97
97
|
"default": "./dist/sqlite/index.cjs"
|
|
98
98
|
}
|
|
99
|
+
},
|
|
100
|
+
"./sqlite-local": {
|
|
101
|
+
"import": {
|
|
102
|
+
"types": "./dist/sqlite/local.d.ts",
|
|
103
|
+
"default": "./dist/sqlite/local.js"
|
|
104
|
+
},
|
|
105
|
+
"require": {
|
|
106
|
+
"types": "./dist/sqlite/local.d.cts",
|
|
107
|
+
"default": "./dist/sqlite/local.cjs"
|
|
108
|
+
}
|
|
99
109
|
}
|
|
100
110
|
},
|
|
101
111
|
"bin": {
|
|
@@ -136,6 +146,7 @@
|
|
|
136
146
|
"peerDependencies": {
|
|
137
147
|
"@cloudflare/workers-types": "^4.20240419.0",
|
|
138
148
|
"@google-cloud/firestore": "^8.5.0",
|
|
149
|
+
"better-sqlite3": ">=9.0.0",
|
|
139
150
|
"react": "^18.0.0 || ^19.0.0",
|
|
140
151
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
141
152
|
"svelte": "^5.0.0"
|
|
@@ -144,6 +155,9 @@
|
|
|
144
155
|
"@cloudflare/workers-types": {
|
|
145
156
|
"optional": true
|
|
146
157
|
},
|
|
158
|
+
"better-sqlite3": {
|
|
159
|
+
"optional": true
|
|
160
|
+
},
|
|
147
161
|
"react": {
|
|
148
162
|
"optional": true
|
|
149
163
|
},
|