@aigne/afs-sqlite 1.11.0-beta → 1.11.0-beta.10
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/LICENSE.md +17 -84
- package/README.md +3 -6
- package/dist/_virtual/_@oxc-project_runtime@0.108.0/helpers/decorate.cjs +11 -0
- package/dist/_virtual/_@oxc-project_runtime@0.108.0/helpers/decorate.mjs +10 -0
- package/dist/_virtual/rolldown_runtime.mjs +7 -0
- package/dist/actions/built-in.cjs +1389 -0
- package/dist/actions/built-in.d.cts +10 -0
- package/dist/actions/built-in.d.cts.map +1 -0
- package/dist/actions/built-in.d.mts +10 -0
- package/dist/actions/built-in.d.mts.map +1 -0
- package/dist/actions/built-in.mjs +1390 -0
- package/dist/actions/built-in.mjs.map +1 -0
- package/dist/actions/operators.cjs +156 -0
- package/dist/actions/operators.mjs +157 -0
- package/dist/actions/operators.mjs.map +1 -0
- package/dist/actions/registry.cjs +123 -0
- package/dist/actions/registry.d.cts +73 -0
- package/dist/actions/registry.d.cts.map +1 -0
- package/dist/actions/registry.d.mts +73 -0
- package/dist/actions/registry.d.mts.map +1 -0
- package/dist/actions/registry.mjs +123 -0
- package/dist/actions/registry.mjs.map +1 -0
- package/dist/actions/types.cjs +33 -0
- package/dist/actions/types.d.cts +97 -0
- package/dist/actions/types.d.cts.map +1 -0
- package/dist/actions/types.d.mts +97 -0
- package/dist/actions/types.d.mts.map +1 -0
- package/dist/actions/types.mjs +32 -0
- package/dist/actions/types.mjs.map +1 -0
- package/dist/config.cjs +27 -0
- package/dist/config.d.cts +54 -0
- package/dist/config.d.cts.map +1 -0
- package/dist/config.d.mts +54 -0
- package/dist/config.d.mts.map +1 -0
- package/dist/config.mjs +28 -0
- package/dist/config.mjs.map +1 -0
- package/dist/index.cjs +39 -1324
- package/dist/index.d.cts +15 -758
- package/dist/index.d.mts +15 -758
- package/dist/index.mjs +13 -1299
- package/dist/node/builder.cjs +162 -0
- package/dist/node/builder.d.cts +44 -0
- package/dist/node/builder.d.cts.map +1 -0
- package/dist/node/builder.d.mts +44 -0
- package/dist/node/builder.d.mts.map +1 -0
- package/dist/node/builder.mjs +155 -0
- package/dist/node/builder.mjs.map +1 -0
- package/dist/operations/crud.cjs +132 -0
- package/dist/operations/crud.d.cts +54 -0
- package/dist/operations/crud.d.cts.map +1 -0
- package/dist/operations/crud.d.mts +54 -0
- package/dist/operations/crud.d.mts.map +1 -0
- package/dist/operations/crud.mjs +133 -0
- package/dist/operations/crud.mjs.map +1 -0
- package/dist/operations/query-builder.cjs +77 -0
- package/dist/operations/query-builder.d.cts +34 -0
- package/dist/operations/query-builder.d.cts.map +1 -0
- package/dist/operations/query-builder.d.mts +34 -0
- package/dist/operations/query-builder.d.mts.map +1 -0
- package/dist/operations/query-builder.mjs +72 -0
- package/dist/operations/query-builder.mjs.map +1 -0
- package/dist/operations/search.cjs +135 -0
- package/dist/operations/search.d.cts +75 -0
- package/dist/operations/search.d.cts.map +1 -0
- package/dist/operations/search.d.mts +75 -0
- package/dist/operations/search.d.mts.map +1 -0
- package/dist/operations/search.mjs +135 -0
- package/dist/operations/search.mjs.map +1 -0
- package/dist/router/path-router.cjs +71 -0
- package/dist/router/path-router.d.cts +39 -0
- package/dist/router/path-router.d.cts.map +1 -0
- package/dist/router/path-router.d.mts +39 -0
- package/dist/router/path-router.d.mts.map +1 -0
- package/dist/router/path-router.mjs +68 -0
- package/dist/router/path-router.mjs.map +1 -0
- package/dist/router/types.d.cts +34 -0
- package/dist/router/types.d.cts.map +1 -0
- package/dist/router/types.d.mts +34 -0
- package/dist/router/types.d.mts.map +1 -0
- package/dist/schema/introspector.cjs +160 -0
- package/dist/schema/introspector.d.cts +49 -0
- package/dist/schema/introspector.d.cts.map +1 -0
- package/dist/schema/introspector.d.mts +49 -0
- package/dist/schema/introspector.d.mts.map +1 -0
- package/dist/schema/introspector.mjs +161 -0
- package/dist/schema/introspector.mjs.map +1 -0
- package/dist/schema/service.cjs +86 -0
- package/dist/schema/service.d.cts +52 -0
- package/dist/schema/service.d.cts.map +1 -0
- package/dist/schema/service.d.mts +52 -0
- package/dist/schema/service.d.mts.map +1 -0
- package/dist/schema/service.mjs +87 -0
- package/dist/schema/service.mjs.map +1 -0
- package/dist/schema/types.cjs +15 -0
- package/dist/schema/types.d.cts +104 -0
- package/dist/schema/types.d.cts.map +1 -0
- package/dist/schema/types.d.mts +104 -0
- package/dist/schema/types.d.mts.map +1 -0
- package/dist/schema/types.mjs +15 -0
- package/dist/schema/types.mjs.map +1 -0
- package/dist/sqlite-afs.cjs +836 -0
- package/dist/sqlite-afs.d.cts +330 -0
- package/dist/sqlite-afs.d.cts.map +1 -0
- package/dist/sqlite-afs.d.mts +330 -0
- package/dist/sqlite-afs.d.mts.map +1 -0
- package/dist/sqlite-afs.mjs +838 -0
- package/dist/sqlite-afs.mjs.map +1 -0
- package/package.json +6 -5
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { TableSchema } from "./schema/types.cjs";
|
|
2
|
+
import { ActionContext } from "./actions/types.cjs";
|
|
3
|
+
import { SQLiteAFSOptions } from "./config.cjs";
|
|
4
|
+
import { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
5
|
+
import { AFSAccessMode, AFSDeleteResult, AFSEntry, AFSExplainResult, AFSListResult, AFSModuleLoadParams, AFSSearchOptions, AFSStatResult, AFSWriteEntryPayload, ProviderManifest } from "@aigne/afs";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { AFSBaseProvider, RouteContext } from "@aigne/afs/provider";
|
|
8
|
+
|
|
9
|
+
//#region src/sqlite-afs.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* SQLite AFS Module
|
|
12
|
+
*
|
|
13
|
+
* Exposes SQLite databases as AFS nodes with full CRUD support,
|
|
14
|
+
* schema introspection, FTS5 search, and virtual paths (.meta, .actions).
|
|
15
|
+
*/
|
|
16
|
+
declare class SQLiteAFS extends AFSBaseProvider {
|
|
17
|
+
private options;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly description?: string;
|
|
20
|
+
readonly accessMode: AFSAccessMode;
|
|
21
|
+
private db;
|
|
22
|
+
private schemaService;
|
|
23
|
+
private crud;
|
|
24
|
+
private ftsSearch;
|
|
25
|
+
private actions;
|
|
26
|
+
private ftsConfig;
|
|
27
|
+
private initialized;
|
|
28
|
+
constructor(options: SQLiteAFSOptions & {
|
|
29
|
+
localPath?: string;
|
|
30
|
+
uri?: string;
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Returns the Zod schema for configuration validation
|
|
34
|
+
*/
|
|
35
|
+
static schema(): z.ZodObject<{
|
|
36
|
+
url: z.ZodString;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
accessMode: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
readonly: "readonly";
|
|
41
|
+
readwrite: "readwrite";
|
|
42
|
+
}>>;
|
|
43
|
+
tables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
excludeTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
fts: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
tables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
wal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
static manifest(): ProviderManifest;
|
|
52
|
+
/**
|
|
53
|
+
* Loads a module instance from configuration
|
|
54
|
+
*/
|
|
55
|
+
static load({
|
|
56
|
+
config
|
|
57
|
+
}?: AFSModuleLoadParams): Promise<SQLiteAFS>;
|
|
58
|
+
/**
|
|
59
|
+
* Initializes the database connection and schema service
|
|
60
|
+
*/
|
|
61
|
+
private initialize;
|
|
62
|
+
/**
|
|
63
|
+
* Ensures the module is initialized.
|
|
64
|
+
* This is called automatically by handlers, but can also be called
|
|
65
|
+
* manually to trigger initialization (e.g., in tests).
|
|
66
|
+
*/
|
|
67
|
+
ensureInitialized(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* List all tables
|
|
70
|
+
* Note: list() returns only children, never the path itself (per new semantics)
|
|
71
|
+
*/
|
|
72
|
+
listTablesHandler(_ctx: RouteContext): Promise<AFSListResult>;
|
|
73
|
+
/**
|
|
74
|
+
* List rows in a table
|
|
75
|
+
* Note: list() returns only children (rows), never the table itself (per new semantics)
|
|
76
|
+
*/
|
|
77
|
+
listTableHandler(ctx: RouteContext<{
|
|
78
|
+
table: string;
|
|
79
|
+
}>): Promise<AFSListResult>;
|
|
80
|
+
/**
|
|
81
|
+
* List a row - rows are leaf nodes with no children
|
|
82
|
+
* Note: list() returns only children, never the path itself (per new semantics)
|
|
83
|
+
*/
|
|
84
|
+
listRowHandler(ctx: RouteContext<{
|
|
85
|
+
table: string;
|
|
86
|
+
pk: string;
|
|
87
|
+
}>): Promise<AFSListResult>;
|
|
88
|
+
/**
|
|
89
|
+
* List actions for a row
|
|
90
|
+
*/
|
|
91
|
+
listActionsHandler(ctx: RouteContext<{
|
|
92
|
+
table: string;
|
|
93
|
+
pk: string;
|
|
94
|
+
}>): Promise<AFSListResult>;
|
|
95
|
+
/**
|
|
96
|
+
* List actions for a table (table-level actions)
|
|
97
|
+
*/
|
|
98
|
+
listTableActionsHandler(ctx: RouteContext<{
|
|
99
|
+
table: string;
|
|
100
|
+
}>): Promise<AFSListResult>;
|
|
101
|
+
/**
|
|
102
|
+
* List actions at root level (database-level actions)
|
|
103
|
+
*/
|
|
104
|
+
listRootActionsHandler(_ctx: RouteContext): Promise<AFSListResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Read root (database) entry
|
|
107
|
+
*/
|
|
108
|
+
readRootHandler(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
109
|
+
/**
|
|
110
|
+
* Read root metadata (database-level schema information)
|
|
111
|
+
*/
|
|
112
|
+
readRootMetaHandler(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
113
|
+
/**
|
|
114
|
+
* Read capabilities manifest
|
|
115
|
+
* Returns information about available actions at different levels
|
|
116
|
+
*/
|
|
117
|
+
readCapabilitiesHandler(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
118
|
+
/**
|
|
119
|
+
* Read table (directory) entry
|
|
120
|
+
*/
|
|
121
|
+
readTableHandler(ctx: RouteContext<{
|
|
122
|
+
table: string;
|
|
123
|
+
}>): Promise<AFSEntry | undefined>;
|
|
124
|
+
/**
|
|
125
|
+
* Read table metadata (table-level schema information)
|
|
126
|
+
*/
|
|
127
|
+
readTableMetaHandler(ctx: RouteContext<{
|
|
128
|
+
table: string;
|
|
129
|
+
}>): Promise<AFSEntry | undefined>;
|
|
130
|
+
/**
|
|
131
|
+
* Read a row
|
|
132
|
+
*/
|
|
133
|
+
readRowHandler(ctx: RouteContext<{
|
|
134
|
+
table: string;
|
|
135
|
+
pk: string;
|
|
136
|
+
}>): Promise<AFSEntry | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* Get row metadata (@meta suffix - SQLite-specific)
|
|
139
|
+
*/
|
|
140
|
+
getMetaHandler(ctx: RouteContext<{
|
|
141
|
+
table: string;
|
|
142
|
+
pk: string;
|
|
143
|
+
}>): Promise<AFSEntry | undefined>;
|
|
144
|
+
/**
|
|
145
|
+
* Get row metadata (.meta suffix - row-level schema information)
|
|
146
|
+
*/
|
|
147
|
+
getRowDotMetaHandler(ctx: RouteContext<{
|
|
148
|
+
table: string;
|
|
149
|
+
pk: string;
|
|
150
|
+
}>): Promise<AFSEntry | undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* Create a new row
|
|
153
|
+
*/
|
|
154
|
+
createRowHandler(ctx: RouteContext<{
|
|
155
|
+
table: string;
|
|
156
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
157
|
+
data: AFSEntry;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* Update an existing row
|
|
161
|
+
*/
|
|
162
|
+
updateRowHandler(ctx: RouteContext<{
|
|
163
|
+
table: string;
|
|
164
|
+
pk: string;
|
|
165
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
166
|
+
data: AFSEntry;
|
|
167
|
+
}>;
|
|
168
|
+
/**
|
|
169
|
+
* Execute action via write (for triggering row-level actions)
|
|
170
|
+
*/
|
|
171
|
+
executeActionWriteHandler(ctx: RouteContext<{
|
|
172
|
+
table: string;
|
|
173
|
+
pk: string;
|
|
174
|
+
action: string;
|
|
175
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
176
|
+
data: AFSEntry;
|
|
177
|
+
}>;
|
|
178
|
+
/**
|
|
179
|
+
* Execute action via write (for triggering table-level actions)
|
|
180
|
+
*/
|
|
181
|
+
executeTableActionWriteHandler(ctx: RouteContext<{
|
|
182
|
+
table: string;
|
|
183
|
+
action: string;
|
|
184
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
185
|
+
data: AFSEntry;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Execute action via write (for triggering root-level actions)
|
|
189
|
+
*/
|
|
190
|
+
executeRootActionWriteHandler(ctx: RouteContext<{
|
|
191
|
+
action: string;
|
|
192
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
193
|
+
data: AFSEntry;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Delete a table entry (not supported - always throws)
|
|
197
|
+
*/
|
|
198
|
+
deleteTableHandler(ctx: RouteContext<{
|
|
199
|
+
table: string;
|
|
200
|
+
}>): Promise<AFSDeleteResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Delete a row
|
|
203
|
+
*/
|
|
204
|
+
deleteRowHandler(ctx: RouteContext<{
|
|
205
|
+
table: string;
|
|
206
|
+
pk: string;
|
|
207
|
+
}>): Promise<AFSDeleteResult>;
|
|
208
|
+
/**
|
|
209
|
+
* Search all tables
|
|
210
|
+
*/
|
|
211
|
+
searchAllHandler(_ctx: RouteContext, query: string, options?: AFSSearchOptions): Promise<{
|
|
212
|
+
data: AFSEntry[];
|
|
213
|
+
message?: string;
|
|
214
|
+
}>;
|
|
215
|
+
/**
|
|
216
|
+
* Search a specific table
|
|
217
|
+
*/
|
|
218
|
+
searchTableHandler(ctx: RouteContext<{
|
|
219
|
+
table: string;
|
|
220
|
+
}>, query: string, options?: AFSSearchOptions): Promise<{
|
|
221
|
+
data: AFSEntry[];
|
|
222
|
+
message?: string;
|
|
223
|
+
}>;
|
|
224
|
+
/**
|
|
225
|
+
* Get stat for root (database level)
|
|
226
|
+
*/
|
|
227
|
+
statRootHandler(_ctx: RouteContext): Promise<AFSStatResult>;
|
|
228
|
+
/**
|
|
229
|
+
* Get stat for a table
|
|
230
|
+
*/
|
|
231
|
+
statTableHandler(ctx: RouteContext<{
|
|
232
|
+
table: string;
|
|
233
|
+
}>): Promise<AFSStatResult>;
|
|
234
|
+
/**
|
|
235
|
+
* Get stat for a row
|
|
236
|
+
*/
|
|
237
|
+
statRowHandler(ctx: RouteContext<{
|
|
238
|
+
table: string;
|
|
239
|
+
pk: string;
|
|
240
|
+
}>): Promise<AFSStatResult>;
|
|
241
|
+
/**
|
|
242
|
+
* Explain root (database level)
|
|
243
|
+
*/
|
|
244
|
+
explainRootHandler(ctx: RouteContext): Promise<AFSExplainResult>;
|
|
245
|
+
/**
|
|
246
|
+
* Explain a table
|
|
247
|
+
*/
|
|
248
|
+
explainTableHandler(ctx: RouteContext<{
|
|
249
|
+
table: string;
|
|
250
|
+
}>): Promise<AFSExplainResult>;
|
|
251
|
+
/**
|
|
252
|
+
* Explain a row
|
|
253
|
+
*/
|
|
254
|
+
explainRowHandler(ctx: RouteContext<{
|
|
255
|
+
table: string;
|
|
256
|
+
pk: string;
|
|
257
|
+
}>): Promise<AFSExplainResult>;
|
|
258
|
+
/**
|
|
259
|
+
* Execute action via exec (row-level)
|
|
260
|
+
*/
|
|
261
|
+
handleRowActionExec(ctx: RouteContext<{
|
|
262
|
+
table: string;
|
|
263
|
+
pk: string;
|
|
264
|
+
action: string;
|
|
265
|
+
}>, args: Record<string, unknown>): Promise<{
|
|
266
|
+
success: boolean;
|
|
267
|
+
data?: Record<string, unknown>;
|
|
268
|
+
}>;
|
|
269
|
+
/**
|
|
270
|
+
* Execute action via exec (table-level)
|
|
271
|
+
*/
|
|
272
|
+
handleTableActionExec(ctx: RouteContext<{
|
|
273
|
+
table: string;
|
|
274
|
+
action: string;
|
|
275
|
+
}>, args: Record<string, unknown>): Promise<{
|
|
276
|
+
success: boolean;
|
|
277
|
+
data?: Record<string, unknown>;
|
|
278
|
+
}>;
|
|
279
|
+
/**
|
|
280
|
+
* Execute action via exec (root-level)
|
|
281
|
+
*/
|
|
282
|
+
handleRootActionExec(ctx: RouteContext<{
|
|
283
|
+
action: string;
|
|
284
|
+
}>, args: Record<string, unknown>): Promise<{
|
|
285
|
+
success: boolean;
|
|
286
|
+
data?: Record<string, unknown>;
|
|
287
|
+
}>;
|
|
288
|
+
/**
|
|
289
|
+
* Executes an action and returns raw result (for exec handlers)
|
|
290
|
+
* Returns AFSExecResult structure: { success: boolean, data?: Record<string, unknown> }
|
|
291
|
+
*/
|
|
292
|
+
private executeActionRaw;
|
|
293
|
+
/**
|
|
294
|
+
* Executes a root-level action and returns raw result (for exec handlers)
|
|
295
|
+
* Returns AFSExecResult structure: { success: boolean, data?: Record<string, unknown> }
|
|
296
|
+
*/
|
|
297
|
+
private executeRootActionRaw;
|
|
298
|
+
/**
|
|
299
|
+
* Executes an action (for write handlers - wraps in AFSEntry)
|
|
300
|
+
*/
|
|
301
|
+
private executeAction;
|
|
302
|
+
/**
|
|
303
|
+
* Executes a root-level action (for write handlers - wraps in AFSEntry)
|
|
304
|
+
*/
|
|
305
|
+
private executeRootAction;
|
|
306
|
+
/**
|
|
307
|
+
* Exports table data in specified format
|
|
308
|
+
*/
|
|
309
|
+
exportTable(table: string, format: string): Promise<unknown>;
|
|
310
|
+
/**
|
|
311
|
+
* Registers a custom action
|
|
312
|
+
*/
|
|
313
|
+
registerAction(name: string, handler: (ctx: ActionContext, params: Record<string, unknown>) => Promise<unknown>, options?: {
|
|
314
|
+
description?: string;
|
|
315
|
+
tableLevel?: boolean;
|
|
316
|
+
rowLevel?: boolean;
|
|
317
|
+
}): void;
|
|
318
|
+
/**
|
|
319
|
+
* Gets table schemas (for external access)
|
|
320
|
+
* Note: This queries the database on-demand
|
|
321
|
+
*/
|
|
322
|
+
getSchemas(): Promise<Map<string, TableSchema>>;
|
|
323
|
+
/**
|
|
324
|
+
* Gets the database instance (for advanced operations)
|
|
325
|
+
*/
|
|
326
|
+
getDatabase(): LibSQLDatabase;
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
329
|
+
export { SQLiteAFS };
|
|
330
|
+
//# sourceMappingURL=sqlite-afs.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-afs.d.cts","names":[],"sources":["../src/sqlite-afs.ts"],"mappings":";;;;;;;;;;AAsDA;;;;;cAAa,SAAA,SAAkB,eAAA;EAAA,QAaT,OAAA;EAAA,SAZF,IAAA;EAAA,SACA,WAAA;EAAA,SACA,UAAA,EAAY,aAAA;EAAA,QAEtB,EAAA;EAAA,QACA,aAAA;EAAA,QACA,IAAA;EAAA,QACA,SAAA;EAAA,QACA,OAAA;EAAA,QACA,SAAA;EAAA,QACA,WAAA;cAEY,OAAA,EAAS,gBAAA;IAAqB,SAAA;IAAoB,GAAA;EAAA;;;;SA+B/D,MAAA,CAAA,GAAM,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;SAIN,QAAA,CAAA,GAAY,gBAAA;EAkE0B;;;EAAA,OAnDhC,IAAA,CAAA;IAAO;EAAA,IAAU,mBAAA,GAA2B,OAAA,CAAQ,SAAA;EA8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B,WAAA,CAAY,KAAA,UAAe,MAAA,WAAiB,OAAA;EAj5B5C;;;EAi7BN,cAAA,CACE,IAAA,UACA,OAAA,GAAU,GAAA,EAAK,aAAA,EAAe,MAAA,EAAQ,MAAA,sBAA4B,OAAA,WAClE,OAAA;IACE,WAAA;IACA,UAAA;IACA,QAAA;EAAA;EAp5B+C;;;;EAq6B7C,UAAA,CAAA,GAAc,OAAA,CAAQ,GAAA,SAAY,WAAA;EAp0BjB;;;EA40BvB,WAAA,CAAA,GAAe,cAAA;AAAA"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import { TableSchema } from "./schema/types.mjs";
|
|
2
|
+
import { ActionContext } from "./actions/types.mjs";
|
|
3
|
+
import { SQLiteAFSOptions } from "./config.mjs";
|
|
4
|
+
import { AFSAccessMode, AFSDeleteResult, AFSEntry, AFSExplainResult, AFSListResult, AFSModuleLoadParams, AFSSearchOptions, AFSStatResult, AFSWriteEntryPayload, ProviderManifest } from "@aigne/afs";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { AFSBaseProvider, RouteContext } from "@aigne/afs/provider";
|
|
7
|
+
import { LibSQLDatabase } from "drizzle-orm/libsql";
|
|
8
|
+
|
|
9
|
+
//#region src/sqlite-afs.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* SQLite AFS Module
|
|
12
|
+
*
|
|
13
|
+
* Exposes SQLite databases as AFS nodes with full CRUD support,
|
|
14
|
+
* schema introspection, FTS5 search, and virtual paths (.meta, .actions).
|
|
15
|
+
*/
|
|
16
|
+
declare class SQLiteAFS extends AFSBaseProvider {
|
|
17
|
+
private options;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly description?: string;
|
|
20
|
+
readonly accessMode: AFSAccessMode;
|
|
21
|
+
private db;
|
|
22
|
+
private schemaService;
|
|
23
|
+
private crud;
|
|
24
|
+
private ftsSearch;
|
|
25
|
+
private actions;
|
|
26
|
+
private ftsConfig;
|
|
27
|
+
private initialized;
|
|
28
|
+
constructor(options: SQLiteAFSOptions & {
|
|
29
|
+
localPath?: string;
|
|
30
|
+
uri?: string;
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Returns the Zod schema for configuration validation
|
|
34
|
+
*/
|
|
35
|
+
static schema(): z.ZodObject<{
|
|
36
|
+
url: z.ZodString;
|
|
37
|
+
name: z.ZodOptional<z.ZodString>;
|
|
38
|
+
description: z.ZodOptional<z.ZodString>;
|
|
39
|
+
accessMode: z.ZodOptional<z.ZodEnum<{
|
|
40
|
+
readonly: "readonly";
|
|
41
|
+
readwrite: "readwrite";
|
|
42
|
+
}>>;
|
|
43
|
+
tables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
44
|
+
excludeTables: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
fts: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
47
|
+
tables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
wal: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
static manifest(): ProviderManifest;
|
|
52
|
+
/**
|
|
53
|
+
* Loads a module instance from configuration
|
|
54
|
+
*/
|
|
55
|
+
static load({
|
|
56
|
+
config
|
|
57
|
+
}?: AFSModuleLoadParams): Promise<SQLiteAFS>;
|
|
58
|
+
/**
|
|
59
|
+
* Initializes the database connection and schema service
|
|
60
|
+
*/
|
|
61
|
+
private initialize;
|
|
62
|
+
/**
|
|
63
|
+
* Ensures the module is initialized.
|
|
64
|
+
* This is called automatically by handlers, but can also be called
|
|
65
|
+
* manually to trigger initialization (e.g., in tests).
|
|
66
|
+
*/
|
|
67
|
+
ensureInitialized(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* List all tables
|
|
70
|
+
* Note: list() returns only children, never the path itself (per new semantics)
|
|
71
|
+
*/
|
|
72
|
+
listTablesHandler(_ctx: RouteContext): Promise<AFSListResult>;
|
|
73
|
+
/**
|
|
74
|
+
* List rows in a table
|
|
75
|
+
* Note: list() returns only children (rows), never the table itself (per new semantics)
|
|
76
|
+
*/
|
|
77
|
+
listTableHandler(ctx: RouteContext<{
|
|
78
|
+
table: string;
|
|
79
|
+
}>): Promise<AFSListResult>;
|
|
80
|
+
/**
|
|
81
|
+
* List a row - rows are leaf nodes with no children
|
|
82
|
+
* Note: list() returns only children, never the path itself (per new semantics)
|
|
83
|
+
*/
|
|
84
|
+
listRowHandler(ctx: RouteContext<{
|
|
85
|
+
table: string;
|
|
86
|
+
pk: string;
|
|
87
|
+
}>): Promise<AFSListResult>;
|
|
88
|
+
/**
|
|
89
|
+
* List actions for a row
|
|
90
|
+
*/
|
|
91
|
+
listActionsHandler(ctx: RouteContext<{
|
|
92
|
+
table: string;
|
|
93
|
+
pk: string;
|
|
94
|
+
}>): Promise<AFSListResult>;
|
|
95
|
+
/**
|
|
96
|
+
* List actions for a table (table-level actions)
|
|
97
|
+
*/
|
|
98
|
+
listTableActionsHandler(ctx: RouteContext<{
|
|
99
|
+
table: string;
|
|
100
|
+
}>): Promise<AFSListResult>;
|
|
101
|
+
/**
|
|
102
|
+
* List actions at root level (database-level actions)
|
|
103
|
+
*/
|
|
104
|
+
listRootActionsHandler(_ctx: RouteContext): Promise<AFSListResult>;
|
|
105
|
+
/**
|
|
106
|
+
* Read root (database) entry
|
|
107
|
+
*/
|
|
108
|
+
readRootHandler(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
109
|
+
/**
|
|
110
|
+
* Read root metadata (database-level schema information)
|
|
111
|
+
*/
|
|
112
|
+
readRootMetaHandler(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
113
|
+
/**
|
|
114
|
+
* Read capabilities manifest
|
|
115
|
+
* Returns information about available actions at different levels
|
|
116
|
+
*/
|
|
117
|
+
readCapabilitiesHandler(_ctx: RouteContext): Promise<AFSEntry | undefined>;
|
|
118
|
+
/**
|
|
119
|
+
* Read table (directory) entry
|
|
120
|
+
*/
|
|
121
|
+
readTableHandler(ctx: RouteContext<{
|
|
122
|
+
table: string;
|
|
123
|
+
}>): Promise<AFSEntry | undefined>;
|
|
124
|
+
/**
|
|
125
|
+
* Read table metadata (table-level schema information)
|
|
126
|
+
*/
|
|
127
|
+
readTableMetaHandler(ctx: RouteContext<{
|
|
128
|
+
table: string;
|
|
129
|
+
}>): Promise<AFSEntry | undefined>;
|
|
130
|
+
/**
|
|
131
|
+
* Read a row
|
|
132
|
+
*/
|
|
133
|
+
readRowHandler(ctx: RouteContext<{
|
|
134
|
+
table: string;
|
|
135
|
+
pk: string;
|
|
136
|
+
}>): Promise<AFSEntry | undefined>;
|
|
137
|
+
/**
|
|
138
|
+
* Get row metadata (@meta suffix - SQLite-specific)
|
|
139
|
+
*/
|
|
140
|
+
getMetaHandler(ctx: RouteContext<{
|
|
141
|
+
table: string;
|
|
142
|
+
pk: string;
|
|
143
|
+
}>): Promise<AFSEntry | undefined>;
|
|
144
|
+
/**
|
|
145
|
+
* Get row metadata (.meta suffix - row-level schema information)
|
|
146
|
+
*/
|
|
147
|
+
getRowDotMetaHandler(ctx: RouteContext<{
|
|
148
|
+
table: string;
|
|
149
|
+
pk: string;
|
|
150
|
+
}>): Promise<AFSEntry | undefined>;
|
|
151
|
+
/**
|
|
152
|
+
* Create a new row
|
|
153
|
+
*/
|
|
154
|
+
createRowHandler(ctx: RouteContext<{
|
|
155
|
+
table: string;
|
|
156
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
157
|
+
data: AFSEntry;
|
|
158
|
+
}>;
|
|
159
|
+
/**
|
|
160
|
+
* Update an existing row
|
|
161
|
+
*/
|
|
162
|
+
updateRowHandler(ctx: RouteContext<{
|
|
163
|
+
table: string;
|
|
164
|
+
pk: string;
|
|
165
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
166
|
+
data: AFSEntry;
|
|
167
|
+
}>;
|
|
168
|
+
/**
|
|
169
|
+
* Execute action via write (for triggering row-level actions)
|
|
170
|
+
*/
|
|
171
|
+
executeActionWriteHandler(ctx: RouteContext<{
|
|
172
|
+
table: string;
|
|
173
|
+
pk: string;
|
|
174
|
+
action: string;
|
|
175
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
176
|
+
data: AFSEntry;
|
|
177
|
+
}>;
|
|
178
|
+
/**
|
|
179
|
+
* Execute action via write (for triggering table-level actions)
|
|
180
|
+
*/
|
|
181
|
+
executeTableActionWriteHandler(ctx: RouteContext<{
|
|
182
|
+
table: string;
|
|
183
|
+
action: string;
|
|
184
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
185
|
+
data: AFSEntry;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Execute action via write (for triggering root-level actions)
|
|
189
|
+
*/
|
|
190
|
+
executeRootActionWriteHandler(ctx: RouteContext<{
|
|
191
|
+
action: string;
|
|
192
|
+
}>, content: AFSWriteEntryPayload): Promise<{
|
|
193
|
+
data: AFSEntry;
|
|
194
|
+
}>;
|
|
195
|
+
/**
|
|
196
|
+
* Delete a table entry (not supported - always throws)
|
|
197
|
+
*/
|
|
198
|
+
deleteTableHandler(ctx: RouteContext<{
|
|
199
|
+
table: string;
|
|
200
|
+
}>): Promise<AFSDeleteResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Delete a row
|
|
203
|
+
*/
|
|
204
|
+
deleteRowHandler(ctx: RouteContext<{
|
|
205
|
+
table: string;
|
|
206
|
+
pk: string;
|
|
207
|
+
}>): Promise<AFSDeleteResult>;
|
|
208
|
+
/**
|
|
209
|
+
* Search all tables
|
|
210
|
+
*/
|
|
211
|
+
searchAllHandler(_ctx: RouteContext, query: string, options?: AFSSearchOptions): Promise<{
|
|
212
|
+
data: AFSEntry[];
|
|
213
|
+
message?: string;
|
|
214
|
+
}>;
|
|
215
|
+
/**
|
|
216
|
+
* Search a specific table
|
|
217
|
+
*/
|
|
218
|
+
searchTableHandler(ctx: RouteContext<{
|
|
219
|
+
table: string;
|
|
220
|
+
}>, query: string, options?: AFSSearchOptions): Promise<{
|
|
221
|
+
data: AFSEntry[];
|
|
222
|
+
message?: string;
|
|
223
|
+
}>;
|
|
224
|
+
/**
|
|
225
|
+
* Get stat for root (database level)
|
|
226
|
+
*/
|
|
227
|
+
statRootHandler(_ctx: RouteContext): Promise<AFSStatResult>;
|
|
228
|
+
/**
|
|
229
|
+
* Get stat for a table
|
|
230
|
+
*/
|
|
231
|
+
statTableHandler(ctx: RouteContext<{
|
|
232
|
+
table: string;
|
|
233
|
+
}>): Promise<AFSStatResult>;
|
|
234
|
+
/**
|
|
235
|
+
* Get stat for a row
|
|
236
|
+
*/
|
|
237
|
+
statRowHandler(ctx: RouteContext<{
|
|
238
|
+
table: string;
|
|
239
|
+
pk: string;
|
|
240
|
+
}>): Promise<AFSStatResult>;
|
|
241
|
+
/**
|
|
242
|
+
* Explain root (database level)
|
|
243
|
+
*/
|
|
244
|
+
explainRootHandler(ctx: RouteContext): Promise<AFSExplainResult>;
|
|
245
|
+
/**
|
|
246
|
+
* Explain a table
|
|
247
|
+
*/
|
|
248
|
+
explainTableHandler(ctx: RouteContext<{
|
|
249
|
+
table: string;
|
|
250
|
+
}>): Promise<AFSExplainResult>;
|
|
251
|
+
/**
|
|
252
|
+
* Explain a row
|
|
253
|
+
*/
|
|
254
|
+
explainRowHandler(ctx: RouteContext<{
|
|
255
|
+
table: string;
|
|
256
|
+
pk: string;
|
|
257
|
+
}>): Promise<AFSExplainResult>;
|
|
258
|
+
/**
|
|
259
|
+
* Execute action via exec (row-level)
|
|
260
|
+
*/
|
|
261
|
+
handleRowActionExec(ctx: RouteContext<{
|
|
262
|
+
table: string;
|
|
263
|
+
pk: string;
|
|
264
|
+
action: string;
|
|
265
|
+
}>, args: Record<string, unknown>): Promise<{
|
|
266
|
+
success: boolean;
|
|
267
|
+
data?: Record<string, unknown>;
|
|
268
|
+
}>;
|
|
269
|
+
/**
|
|
270
|
+
* Execute action via exec (table-level)
|
|
271
|
+
*/
|
|
272
|
+
handleTableActionExec(ctx: RouteContext<{
|
|
273
|
+
table: string;
|
|
274
|
+
action: string;
|
|
275
|
+
}>, args: Record<string, unknown>): Promise<{
|
|
276
|
+
success: boolean;
|
|
277
|
+
data?: Record<string, unknown>;
|
|
278
|
+
}>;
|
|
279
|
+
/**
|
|
280
|
+
* Execute action via exec (root-level)
|
|
281
|
+
*/
|
|
282
|
+
handleRootActionExec(ctx: RouteContext<{
|
|
283
|
+
action: string;
|
|
284
|
+
}>, args: Record<string, unknown>): Promise<{
|
|
285
|
+
success: boolean;
|
|
286
|
+
data?: Record<string, unknown>;
|
|
287
|
+
}>;
|
|
288
|
+
/**
|
|
289
|
+
* Executes an action and returns raw result (for exec handlers)
|
|
290
|
+
* Returns AFSExecResult structure: { success: boolean, data?: Record<string, unknown> }
|
|
291
|
+
*/
|
|
292
|
+
private executeActionRaw;
|
|
293
|
+
/**
|
|
294
|
+
* Executes a root-level action and returns raw result (for exec handlers)
|
|
295
|
+
* Returns AFSExecResult structure: { success: boolean, data?: Record<string, unknown> }
|
|
296
|
+
*/
|
|
297
|
+
private executeRootActionRaw;
|
|
298
|
+
/**
|
|
299
|
+
* Executes an action (for write handlers - wraps in AFSEntry)
|
|
300
|
+
*/
|
|
301
|
+
private executeAction;
|
|
302
|
+
/**
|
|
303
|
+
* Executes a root-level action (for write handlers - wraps in AFSEntry)
|
|
304
|
+
*/
|
|
305
|
+
private executeRootAction;
|
|
306
|
+
/**
|
|
307
|
+
* Exports table data in specified format
|
|
308
|
+
*/
|
|
309
|
+
exportTable(table: string, format: string): Promise<unknown>;
|
|
310
|
+
/**
|
|
311
|
+
* Registers a custom action
|
|
312
|
+
*/
|
|
313
|
+
registerAction(name: string, handler: (ctx: ActionContext, params: Record<string, unknown>) => Promise<unknown>, options?: {
|
|
314
|
+
description?: string;
|
|
315
|
+
tableLevel?: boolean;
|
|
316
|
+
rowLevel?: boolean;
|
|
317
|
+
}): void;
|
|
318
|
+
/**
|
|
319
|
+
* Gets table schemas (for external access)
|
|
320
|
+
* Note: This queries the database on-demand
|
|
321
|
+
*/
|
|
322
|
+
getSchemas(): Promise<Map<string, TableSchema>>;
|
|
323
|
+
/**
|
|
324
|
+
* Gets the database instance (for advanced operations)
|
|
325
|
+
*/
|
|
326
|
+
getDatabase(): LibSQLDatabase;
|
|
327
|
+
}
|
|
328
|
+
//#endregion
|
|
329
|
+
export { SQLiteAFS };
|
|
330
|
+
//# sourceMappingURL=sqlite-afs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-afs.d.mts","names":[],"sources":["../src/sqlite-afs.ts"],"mappings":";;;;;;;;;;AAsDA;;;;;cAAa,SAAA,SAAkB,eAAA;EAAA,QAaT,OAAA;EAAA,SAZF,IAAA;EAAA,SACA,WAAA;EAAA,SACA,UAAA,EAAY,aAAA;EAAA,QAEtB,EAAA;EAAA,QACA,aAAA;EAAA,QACA,IAAA;EAAA,QACA,SAAA;EAAA,QACA,OAAA;EAAA,QACA,SAAA;EAAA,QACA,WAAA;cAEY,OAAA,EAAS,gBAAA;IAAqB,SAAA;IAAoB,GAAA;EAAA;;;;SA+B/D,MAAA,CAAA,GAAM,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;SAIN,QAAA,CAAA,GAAY,gBAAA;EAkE0B;;;EAAA,OAnDhC,IAAA,CAAA;IAAO;EAAA,IAAU,mBAAA,GAA2B,OAAA,CAAQ,SAAA;EA8EvC;;;EAAA,QAtEZ,UAAA;EAuFH;;;;;EAzDL,iBAAA,CAAA,GAAqB,OAAA;EA2G+B;;;;EA9FpD,iBAAA,CAAkB,IAAA,EAAM,YAAA,GAAe,OAAA,CAAQ,aAAA;EA6HrB;;;;EAlH1B,gBAAA,CAAiB,GAAA,EAAK,YAAA;IAAe,KAAA;EAAA,KAAmB,OAAA,CAAQ,aAAA;EAsPA;;;;EAtOhE,cAAA,CAAe,GAAA,E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