@supalive/core 0.1.4 → 0.1.5
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 +17 -2
- package/dist/helper-CiacMqje.d.ts +14 -0
- package/dist/helper-CiacMqje.d.ts.map +1 -0
- package/dist/helper-zdJT5FUc.js +58 -0
- package/dist/helper-zdJT5FUc.js.map +1 -0
- package/dist/index-CTyXKcq_.d.ts +1736 -0
- package/dist/index-CTyXKcq_.d.ts.map +1 -0
- package/dist/mysql-C8SN443m.d.ts +104 -0
- package/dist/mysql-C8SN443m.d.ts.map +1 -0
- package/dist/mysql-DELSRrpY.js +569 -0
- package/dist/mysql-DELSRrpY.js.map +1 -0
- package/dist/overlap-checker-CVkbbuEQ.js +187 -0
- package/dist/overlap-checker-CVkbbuEQ.js.map +1 -0
- package/dist/postgres-DE-XyNAQ.js +823 -0
- package/dist/postgres-DE-XyNAQ.js.map +1 -0
- package/dist/postgres-D_gwCHx-.d.ts +108 -0
- package/dist/postgres-D_gwCHx-.d.ts.map +1 -0
- package/dist/query-CbQLjeME.js +713 -0
- package/dist/query-CbQLjeME.js.map +1 -0
- package/dist/realtime_db-D9p2X2PH.js +246 -0
- package/dist/realtime_db-D9p2X2PH.js.map +1 -0
- package/dist/router-DlTYWpop.js +81 -0
- package/dist/router-DlTYWpop.js.map +1 -0
- package/dist/schema-SKcIWHfo.js +167 -0
- package/dist/schema-SKcIWHfo.js.map +1 -0
- package/dist/src/client/index.d.ts +2 -17
- package/dist/src/client/index.js +1151 -18
- package/dist/src/client/index.js.map +1 -1
- package/dist/src/exports/mysql.d.ts +2 -2
- package/dist/src/exports/mysql.js +2 -2
- package/dist/src/exports/postgres.d.ts +2 -2
- package/dist/src/exports/postgres.js +2 -2
- package/dist/src/exports/procedure.d.ts +3 -5
- package/dist/src/exports/procedure.js +5 -5
- package/dist/src/exports/server.d.ts +368 -2
- package/dist/src/exports/server.d.ts.map +1 -1
- package/dist/src/exports/server.js +1346 -2
- package/dist/src/exports/server.js.map +1 -1
- package/dist/src/exports/subscription-manager-worker-entry.d.ts +1 -0
- package/dist/src/exports/subscription-manager-worker-entry.js +115 -0
- package/dist/src/exports/subscription-manager-worker-entry.js.map +1 -0
- package/dist/src/exports/types.d.ts +4 -6
- package/dist/src/exports/types.js +5 -6
- package/dist/subscription-worker-BurdPO8d.js +511 -0
- package/dist/subscription-worker-BurdPO8d.js.map +1 -0
- package/dist/types_client_rpc-CIsjQQGG.js +105 -0
- package/dist/types_client_rpc-CIsjQQGG.js.map +1 -0
- package/dist/types_db-Ctf-ksoy.js +168 -0
- package/dist/types_db-Ctf-ksoy.js.map +1 -0
- package/dist/types_server-Ch56y8L3.d.ts +216 -0
- package/dist/types_server-Ch56y8L3.d.ts.map +1 -0
- package/dist/types_server-Dk6o_B7N.js +24 -0
- package/dist/types_server-Dk6o_B7N.js.map +1 -0
- package/package.json +3 -3
- package/dist/src/client/caller_client.d.ts +0 -42
- package/dist/src/client/caller_client.d.ts.map +0 -1
- package/dist/src/client/caller_client.js +0 -77
- package/dist/src/client/caller_client.js.map +0 -1
- package/dist/src/client/client.d.ts +0 -149
- package/dist/src/client/client.d.ts.map +0 -1
- package/dist/src/client/client.js +0 -308
- package/dist/src/client/client.js.map +0 -1
- package/dist/src/client/index.d.ts.map +0 -1
- package/dist/src/client/sub_key.d.ts +0 -20
- package/dist/src/client/sub_key.d.ts.map +0 -1
- package/dist/src/client/sub_key.js +0 -37
- package/dist/src/client/sub_key.js.map +0 -1
- package/dist/src/client/ws_client_manager.d.ts +0 -268
- package/dist/src/client/ws_client_manager.d.ts.map +0 -1
- package/dist/src/client/ws_client_manager.js +0 -1013
- package/dist/src/client/ws_client_manager.js.map +0 -1
- package/dist/src/config.d.ts +0 -117
- package/dist/src/config.d.ts.map +0 -1
- package/dist/src/config.js +0 -2
- package/dist/src/config.js.map +0 -1
- package/dist/src/db/bytes.d.ts +0 -4
- package/dist/src/db/bytes.d.ts.map +0 -1
- package/dist/src/db/bytes.js +0 -24
- package/dist/src/db/bytes.js.map +0 -1
- package/dist/src/db/cache.d.ts +0 -30
- package/dist/src/db/cache.d.ts.map +0 -1
- package/dist/src/db/cache.js +0 -153
- package/dist/src/db/cache.js.map +0 -1
- package/dist/src/db/codec.d.ts +0 -10
- package/dist/src/db/codec.d.ts.map +0 -1
- package/dist/src/db/codec.js +0 -73
- package/dist/src/db/codec.js.map +0 -1
- package/dist/src/db/context.d.ts +0 -28
- package/dist/src/db/context.d.ts.map +0 -1
- package/dist/src/db/context.js +0 -147
- package/dist/src/db/context.js.map +0 -1
- package/dist/src/db/db.d.ts +0 -154
- package/dist/src/db/db.d.ts.map +0 -1
- package/dist/src/db/db.js +0 -23
- package/dist/src/db/db.js.map +0 -1
- package/dist/src/db/mysql.d.ts +0 -120
- package/dist/src/db/mysql.d.ts.map +0 -1
- package/dist/src/db/mysql.js +0 -708
- package/dist/src/db/mysql.js.map +0 -1
- package/dist/src/db/postgres.d.ts +0 -116
- package/dist/src/db/postgres.d.ts.map +0 -1
- package/dist/src/db/postgres.js +0 -998
- package/dist/src/db/postgres.js.map +0 -1
- package/dist/src/db/query.d.ts +0 -174
- package/dist/src/db/query.d.ts.map +0 -1
- package/dist/src/db/query.js +0 -790
- package/dist/src/db/query.js.map +0 -1
- package/dist/src/db/query_definition.d.ts +0 -54
- package/dist/src/db/query_definition.d.ts.map +0 -1
- package/dist/src/db/query_definition.js +0 -47
- package/dist/src/db/query_definition.js.map +0 -1
- package/dist/src/db/realtime_db.d.ts +0 -19
- package/dist/src/db/realtime_db.d.ts.map +0 -1
- package/dist/src/db/realtime_db.js +0 -98
- package/dist/src/db/realtime_db.js.map +0 -1
- package/dist/src/db/schema.d.ts +0 -110
- package/dist/src/db/schema.d.ts.map +0 -1
- package/dist/src/db/schema.js +0 -47
- package/dist/src/db/schema.js.map +0 -1
- package/dist/src/db/types_client_rpc.d.ts +0 -157
- package/dist/src/db/types_client_rpc.d.ts.map +0 -1
- package/dist/src/db/types_client_rpc.js +0 -106
- package/dist/src/db/types_client_rpc.js.map +0 -1
- package/dist/src/db/types_db.d.ts +0 -236
- package/dist/src/db/types_db.d.ts.map +0 -1
- package/dist/src/db/types_db.js +0 -188
- package/dist/src/db/types_db.js.map +0 -1
- package/dist/src/exports/mysql.d.ts.map +0 -1
- package/dist/src/exports/mysql.js.map +0 -1
- package/dist/src/exports/postgres.d.ts.map +0 -1
- package/dist/src/exports/postgres.js.map +0 -1
- package/dist/src/exports/procedure.d.ts.map +0 -1
- package/dist/src/exports/procedure.js.map +0 -1
- package/dist/src/exports/types.d.ts.map +0 -1
- package/dist/src/exports/types.js.map +0 -1
- package/dist/src/helper.d.ts +0 -11
- package/dist/src/helper.d.ts.map +0 -1
- package/dist/src/helper.js +0 -45
- package/dist/src/helper.js.map +0 -1
- package/dist/src/logger.d.ts +0 -7
- package/dist/src/logger.d.ts.map +0 -1
- package/dist/src/logger.js +0 -47
- package/dist/src/logger.js.map +0 -1
- package/dist/src/router/index.d.ts +0 -4
- package/dist/src/router/index.d.ts.map +0 -1
- package/dist/src/router/index.js +0 -4
- package/dist/src/router/index.js.map +0 -1
- package/dist/src/router/procedure.d.ts +0 -204
- package/dist/src/router/procedure.d.ts.map +0 -1
- package/dist/src/router/procedure.js +0 -122
- package/dist/src/router/procedure.js.map +0 -1
- package/dist/src/router/router.d.ts +0 -88
- package/dist/src/router/router.d.ts.map +0 -1
- package/dist/src/router/router.js +0 -88
- package/dist/src/router/router.js.map +0 -1
- package/dist/src/server/hash.d.ts +0 -12
- package/dist/src/server/hash.d.ts.map +0 -1
- package/dist/src/server/hash.js +0 -20
- package/dist/src/server/hash.js.map +0 -1
- package/dist/src/server/hash.test.d.ts +0 -2
- package/dist/src/server/hash.test.d.ts.map +0 -1
- package/dist/src/server/hash.test.js +0 -43
- package/dist/src/server/hash.test.js.map +0 -1
- package/dist/src/server/index.d.ts +0 -9
- package/dist/src/server/index.d.ts.map +0 -1
- package/dist/src/server/index.js +0 -8
- package/dist/src/server/index.js.map +0 -1
- package/dist/src/server/overlap-checker.d.ts +0 -18
- package/dist/src/server/overlap-checker.d.ts.map +0 -1
- package/dist/src/server/overlap-checker.js +0 -247
- package/dist/src/server/overlap-checker.js.map +0 -1
- package/dist/src/server/sub_hash.d.ts +0 -23
- package/dist/src/server/sub_hash.d.ts.map +0 -1
- package/dist/src/server/sub_hash.js +0 -38
- package/dist/src/server/sub_hash.js.map +0 -1
- package/dist/src/server/subscription-manager-client.d.ts +0 -120
- package/dist/src/server/subscription-manager-client.d.ts.map +0 -1
- package/dist/src/server/subscription-manager-client.js +0 -207
- package/dist/src/server/subscription-manager-client.js.map +0 -1
- package/dist/src/server/subscription-manager-types.d.ts +0 -168
- package/dist/src/server/subscription-manager-types.d.ts.map +0 -1
- package/dist/src/server/subscription-manager-types.js +0 -94
- package/dist/src/server/subscription-manager-types.js.map +0 -1
- package/dist/src/server/subscription-manager-worker-entry.d.ts +0 -2
- package/dist/src/server/subscription-manager-worker-entry.d.ts.map +0 -1
- package/dist/src/server/subscription-manager-worker-entry.js +0 -127
- package/dist/src/server/subscription-manager-worker-entry.js.map +0 -1
- package/dist/src/server/subscription-manager-worker-protocol.d.ts +0 -40
- package/dist/src/server/subscription-manager-worker-protocol.d.ts.map +0 -1
- package/dist/src/server/subscription-manager-worker-protocol.js +0 -20
- package/dist/src/server/subscription-manager-worker-protocol.js.map +0 -1
- package/dist/src/server/subscription-manager.d.ts +0 -32
- package/dist/src/server/subscription-manager.d.ts.map +0 -1
- package/dist/src/server/subscription-manager.js +0 -249
- package/dist/src/server/subscription-manager.js.map +0 -1
- package/dist/src/server/subscription-manager.test.d.ts +0 -2
- package/dist/src/server/subscription-manager.test.d.ts.map +0 -1
- package/dist/src/server/subscription-manager.test.js +0 -610
- package/dist/src/server/subscription-manager.test.js.map +0 -1
- package/dist/src/server/subscription-worker.d.ts +0 -32
- package/dist/src/server/subscription-worker.d.ts.map +0 -1
- package/dist/src/server/subscription-worker.js +0 -190
- package/dist/src/server/subscription-worker.js.map +0 -1
- package/dist/src/server/supalive-server.d.ts +0 -158
- package/dist/src/server/supalive-server.d.ts.map +0 -1
- package/dist/src/server/supalive-server.js +0 -1048
- package/dist/src/server/supalive-server.js.map +0 -1
- package/dist/src/server/types_server.d.ts +0 -96
- package/dist/src/server/types_server.d.ts.map +0 -1
- package/dist/src/server/types_server.js +0 -36
- package/dist/src/server/types_server.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { s as commitTsCodec } from "./query-CbQLjeME.js";
|
|
2
|
+
import { o as utf8Encode } from "./helper-zdJT5FUc.js";
|
|
3
|
+
import { z as z$1 } from "zod";
|
|
4
|
+
//#region src/router/procedure.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a query builder with a pre-defined context type.
|
|
7
|
+
* This allows you to define the context type once and have it inferred
|
|
8
|
+
* automatically in all your query handlers.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Define your server context
|
|
12
|
+
* interface ServerContext {
|
|
13
|
+
* auth: { userId: string };
|
|
14
|
+
* requestId: string;
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* // Create a typed query builder
|
|
18
|
+
* const query = createQueryBuilder<ServerContext>();
|
|
19
|
+
*
|
|
20
|
+
* // Use it - context type is automatically inferred!
|
|
21
|
+
* const getUser = query({
|
|
22
|
+
* args: z.object({ id: z.string() }),
|
|
23
|
+
* handler: async (ctx, { id }) => {
|
|
24
|
+
* // ctx.db for database queries
|
|
25
|
+
* const user = await ctx.db.query(UsersSchema).find(id);
|
|
26
|
+
* // ctx.context for server context
|
|
27
|
+
* console.log(ctx.context.requestId);
|
|
28
|
+
* return user;
|
|
29
|
+
* }
|
|
30
|
+
* });
|
|
31
|
+
*/
|
|
32
|
+
function createQueryBuilder() {
|
|
33
|
+
return function query(config) {
|
|
34
|
+
return {
|
|
35
|
+
_type: "procedure",
|
|
36
|
+
procedureType: "query",
|
|
37
|
+
inputSchema: config.args,
|
|
38
|
+
fn: config.handler,
|
|
39
|
+
internal: config.internal ?? false,
|
|
40
|
+
queryIdentity: config.queryIdentity
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create a mutation builder with a pre-defined context type.
|
|
46
|
+
* This allows you to define the context type once and have it inferred
|
|
47
|
+
* automatically in all your mutation handlers.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Define your server context
|
|
51
|
+
* interface ServerContext {
|
|
52
|
+
* auth: { userId: string };
|
|
53
|
+
* requestId: string;
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* // Create a typed mutation builder
|
|
57
|
+
* const mutation = createMutationBuilder<ServerContext>();
|
|
58
|
+
*
|
|
59
|
+
* // Use it - context type is automatically inferred!
|
|
60
|
+
* const createUser = mutation({
|
|
61
|
+
* args: z.object({ name: z.string() }),
|
|
62
|
+
* handler: async (ctx, { name }) => {
|
|
63
|
+
* // ctx.db for mutations
|
|
64
|
+
* await ctx.db.insert(UsersSchema, id, { name });
|
|
65
|
+
* // ctx.context for server context
|
|
66
|
+
* console.log(ctx.context.requestId);
|
|
67
|
+
* return { success: true };
|
|
68
|
+
* }
|
|
69
|
+
* });
|
|
70
|
+
*/
|
|
71
|
+
function createMutationBuilder() {
|
|
72
|
+
return function mutation(config) {
|
|
73
|
+
return {
|
|
74
|
+
_type: "procedure",
|
|
75
|
+
procedureType: "mutation",
|
|
76
|
+
inputSchema: config.args,
|
|
77
|
+
fn: config.handler,
|
|
78
|
+
internal: config.internal ?? false
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Create an action builder with a pre-defined context type.
|
|
84
|
+
* Actions have access to the full SupaliveDb for both queries and mutations.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // Define your server context
|
|
88
|
+
* interface ServerContext {
|
|
89
|
+
* auth: { userId: string };
|
|
90
|
+
* requestId: string;
|
|
91
|
+
* }
|
|
92
|
+
*
|
|
93
|
+
* // Create a typed action builder
|
|
94
|
+
* const action = createActionBuilder<ServerContext>();
|
|
95
|
+
*
|
|
96
|
+
* // Use it - context type is automatically inferred!
|
|
97
|
+
* const processOrder = action({
|
|
98
|
+
* args: z.object({ orderId: z.string() }),
|
|
99
|
+
* handler: async (ctx, { orderId }) => {
|
|
100
|
+
* // ctx.db for full database access
|
|
101
|
+
* const order = await ctx.db.query(async (db) => {
|
|
102
|
+
* return db.query(OrdersSchema).find(orderId);
|
|
103
|
+
* });
|
|
104
|
+
* await ctx.db.mutation(async (db) => {
|
|
105
|
+
* await db.update(OrdersSchema, orderId, { status: "processed" });
|
|
106
|
+
* });
|
|
107
|
+
* // ctx.context for server context
|
|
108
|
+
* console.log(ctx.context.requestId);
|
|
109
|
+
* return { success: true };
|
|
110
|
+
* }
|
|
111
|
+
* });
|
|
112
|
+
*/
|
|
113
|
+
function createActionBuilder() {
|
|
114
|
+
return function action(config) {
|
|
115
|
+
return {
|
|
116
|
+
_type: "procedure",
|
|
117
|
+
procedureType: "action",
|
|
118
|
+
inputSchema: config.args,
|
|
119
|
+
fn: config.handler,
|
|
120
|
+
internal: config.internal ?? false
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/db/schema.ts
|
|
126
|
+
function defineComputedField(config) {
|
|
127
|
+
return config;
|
|
128
|
+
}
|
|
129
|
+
function defineSchema(config) {
|
|
130
|
+
const columns = {};
|
|
131
|
+
if (config.columns) Object.assign(columns, {
|
|
132
|
+
"id": "id",
|
|
133
|
+
"commitTs": "commit_ts",
|
|
134
|
+
...config.columns
|
|
135
|
+
});
|
|
136
|
+
else {
|
|
137
|
+
for (const key of Object.keys(config.schema)) columns[key] = key;
|
|
138
|
+
columns["id"] = "id";
|
|
139
|
+
columns["commitTs"] = "commit_ts";
|
|
140
|
+
}
|
|
141
|
+
const augmentedShape = {
|
|
142
|
+
...config.schema,
|
|
143
|
+
id: z$1.string(),
|
|
144
|
+
commitTs: z$1.coerce.bigint()
|
|
145
|
+
};
|
|
146
|
+
const mergedCodecs = {
|
|
147
|
+
...config.options?.codecs ?? {},
|
|
148
|
+
commitTs: commitTsCodec
|
|
149
|
+
};
|
|
150
|
+
return {
|
|
151
|
+
tableId: tableNameToId(config.name),
|
|
152
|
+
table: config.name,
|
|
153
|
+
schema: z$1.object(augmentedShape),
|
|
154
|
+
columnsOptions: {
|
|
155
|
+
...config.options,
|
|
156
|
+
codecs: mergedCodecs
|
|
157
|
+
},
|
|
158
|
+
columns
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function tableNameToId(tableName) {
|
|
162
|
+
return utf8Encode(tableName);
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { createMutationBuilder as a, createActionBuilder as i, defineSchema as n, createQueryBuilder as o, tableNameToId as r, defineComputedField as t };
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=schema-SKcIWHfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-SKcIWHfo.js","names":["z"],"sources":["../src/router/procedure.ts","../src/db/schema.ts"],"sourcesContent":["import type { ZodType } from \"zod\";\nimport type { DbReader, DbWriter } from \"../db/context\";\nimport type { SupaliveDb } from \"../db/realtime_db\";\n\n// ─── Context Types ───────────────────────────────────────────────────────────\n\n/**\n * Query context passed to query handlers.\n * Contains database reader and user-defined server context.\n */\nexport interface QueryCtx<TContext = unknown> {\n /** Database reader for queries */\n db: DbReader;\n /** User-defined server context (auth, requestId, etc.) */\n serverCtx: TContext;\n}\n\n/**\n * Mutation context passed to mutation handlers.\n * Contains database writer and user-defined server context.\n */\nexport interface MutationCtx<TContext = unknown> {\n /** Database writer for mutations (includes insert/update/delete) */\n db: DbWriter;\n /** User-defined server context (auth, requestId, etc.) */\n serverCtx: TContext;\n}\n\n/**\n * Action context passed to action handlers.\n * Contains the full SupaliveDb for both queries and mutations, plus user-defined server context.\n */\nexport interface ActionCtx<TContext = unknown> {\n /** Full database interface for queries and mutations */\n db: SupaliveDb;\n /** User-defined server context (auth, requestId, etc.) */\n serverCtx: TContext;\n}\n\n// ─── Procedure Types ─────────────────────────────────────────────────────────\n\nexport type QueryFn<TInput, TResult, TContext = unknown> = (\n ctx: QueryCtx<TContext>,\n input: TInput,\n) => Promise<TResult>;\n\nexport type MutationFn<TInput, TResult, TContext = unknown> = (\n ctx: MutationCtx<TContext>,\n input: TInput,\n) => Promise<TResult>;\n\nexport type ActionFn<TInput, TResult, TContext = unknown> = (\n ctx: ActionCtx<TContext>,\n input: TInput,\n) => Promise<TResult>;\n\n/**\n * Per-procedure override for the cache/subscription segmentation key.\n *\n * omitted | undefined → fall back to `config.getUserId(serverCtx)` (default)\n * false → no identity in hash; cache/sub shared across all users\n * string → a static identity literal (e.g. \"public\" or a tenant id)\n * function → compute from serverCtx + input (sync)\n *\n * When the result of a query is identical regardless of who calls it, set\n * this to a literal (or `false`) so a single cache entry serves everyone.\n *\n * The function form intentionally takes `serverCtx` (not the full `QueryCtx`)\n * because identity is resolved before any DB read is issued.\n */\nexport type QueryIdentitySpec<TInput, TContext> =\n | false\n | string\n | ((serverCtx: TContext, input: TInput) => string | null | undefined);\n\nexport interface BaseProcedure<\n TInput, TResult,\n TType extends \"query\" | \"mutation\" | \"action\",\n TContext = unknown,\n TInternal extends boolean = boolean\n> {\n readonly _type: \"procedure\";\n readonly procedureType: TType;\n readonly inputSchema: ZodType<TInput>;\n readonly fn: QueryFn<TInput, TResult, TContext> | MutationFn<TInput, TResult, TContext> | ActionFn<TInput, TResult, TContext>;\n readonly internal: TInternal;\n}\n\nexport interface QueryProcedure<\n TInput, TResult,\n TContext = unknown,\n TInternal extends boolean = boolean\n> extends BaseProcedure<TInput, TResult, \"query\", TContext, TInternal> {\n readonly procedureType: \"query\";\n readonly fn: QueryFn<TInput, TResult, TContext>;\n readonly queryIdentity?: QueryIdentitySpec<TInput, TContext>;\n}\n\nexport interface MutationProcedure<\n TInput, TResult,\n TContext = unknown,\n TInternal extends boolean = boolean\n> extends BaseProcedure<TInput, TResult, \"mutation\", TContext, TInternal> {\n readonly procedureType: \"mutation\";\n readonly fn: MutationFn<TInput, TResult, TContext>;\n}\n\nexport interface ActionProcedure<\n TInput, TResult,\n TContext = unknown,\n TInternal extends boolean = boolean\n> extends BaseProcedure<TInput, TResult, \"action\", TContext, TInternal> {\n readonly procedureType: \"action\";\n readonly fn: ActionFn<TInput, TResult, TContext>;\n}\n\nexport type AnyProcedure<TContext = unknown> =\n | QueryProcedure<any, any, TContext>\n | MutationProcedure<any, any, TContext>\n | ActionProcedure<any, any, TContext>;\n\n// ─── Procedure Configuration Types ───────────────────────────────────────────\n\nexport interface QueryConfig<TInput, TResult, TContext = unknown> {\n /** Zod schema for input validation */\n args: ZodType<TInput>;\n /** The query handler function */\n handler: QueryFn<TInput, TResult, TContext>;\n /** Mark as internal (server-only). Default: false */\n internal?: boolean;\n /**\n * Override the cache/subscription segmentation key for this procedure.\n * See {@link QueryIdentitySpec}. Omit to keep the default (per-user) behavior.\n */\n queryIdentity?: QueryIdentitySpec<TInput, TContext>;\n}\n\nexport interface MutationConfig<TInput, TResult, TContext = unknown> {\n /** Zod schema for input validation */\n args: ZodType<TInput>;\n /** The mutation handler function */\n handler: MutationFn<TInput, TResult, TContext>;\n /** Mark as internal (server-only). Default: false */\n internal?: boolean;\n}\n\nexport interface ActionConfig<TInput, TResult, TContext = unknown> {\n /** Zod schema for input validation */\n args: ZodType<TInput>;\n /** The action handler function */\n handler: ActionFn<TInput, TResult, TContext>;\n /** Mark as internal (server-only). Default: false */\n internal?: boolean;\n}\n\n/** Extract input type from a procedure */\nexport type InputOf<T> = T extends BaseProcedure<infer I, any, any, any> ? I : never;\n\n/** Extract output type from a procedure */\nexport type OutputOf<T> = T extends BaseProcedure<any, infer O, any, any> ? O : never;\n\n/** Extract procedure type (query/mutation) */\nexport type TypeOf<T> = T extends BaseProcedure<any, any, infer Type, any> ? Type : never;\n\n/** Extract server context type from a procedure */\nexport type ContextOf<T> = T extends BaseProcedure<any, any, any, infer C> ? C : never;\n\n/**\n * Create a query builder with a pre-defined context type.\n * This allows you to define the context type once and have it inferred\n * automatically in all your query handlers.\n * \n * @example\n * // Define your server context\n * interface ServerContext {\n * auth: { userId: string };\n * requestId: string;\n * }\n * \n * // Create a typed query builder\n * const query = createQueryBuilder<ServerContext>();\n * \n * // Use it - context type is automatically inferred!\n * const getUser = query({\n * args: z.object({ id: z.string() }),\n * handler: async (ctx, { id }) => {\n * // ctx.db for database queries\n * const user = await ctx.db.query(UsersSchema).find(id);\n * // ctx.context for server context\n * console.log(ctx.context.requestId);\n * return user;\n * }\n * });\n */\nexport function createQueryBuilder<TContext = unknown>() {\n return function query<TInput, TResult, const TInternal extends boolean = false>(\n config: QueryConfig<TInput, TResult, TContext> & { internal?: TInternal }\n ): QueryProcedure<TInput, TResult, TContext, TInternal> {\n return {\n _type: \"procedure\",\n procedureType: \"query\",\n inputSchema: config.args,\n fn: config.handler,\n internal: (config.internal ?? false) as TInternal,\n queryIdentity: config.queryIdentity,\n };\n };\n}\n\n// ─── Mutation Builder Factory ────────────────────────────────────────────────\n\n/**\n * Create a mutation builder with a pre-defined context type.\n * This allows you to define the context type once and have it inferred\n * automatically in all your mutation handlers.\n * \n * @example\n * // Define your server context\n * interface ServerContext {\n * auth: { userId: string };\n * requestId: string;\n * }\n * \n * // Create a typed mutation builder\n * const mutation = createMutationBuilder<ServerContext>();\n * \n * // Use it - context type is automatically inferred!\n * const createUser = mutation({\n * args: z.object({ name: z.string() }),\n * handler: async (ctx, { name }) => {\n * // ctx.db for mutations\n * await ctx.db.insert(UsersSchema, id, { name });\n * // ctx.context for server context\n * console.log(ctx.context.requestId);\n * return { success: true };\n * }\n * });\n */\nexport function createMutationBuilder<TContext = unknown>() {\n return function mutation<TInput, TResult, const TInternal extends boolean = false>(\n config: MutationConfig<TInput, TResult, TContext> & { internal?: TInternal }\n ): MutationProcedure<TInput, TResult, TContext, TInternal> {\n return {\n _type: \"procedure\",\n procedureType: \"mutation\",\n inputSchema: config.args,\n fn: config.handler,\n internal: (config.internal ?? false) as TInternal,\n };\n };\n}\n\n// ─── Action Builder Factory ──────────────────────────────────────────────────\n\n/**\n * Create an action builder with a pre-defined context type.\n * Actions have access to the full SupaliveDb for both queries and mutations.\n *\n * @example\n * // Define your server context\n * interface ServerContext {\n * auth: { userId: string };\n * requestId: string;\n * }\n *\n * // Create a typed action builder\n * const action = createActionBuilder<ServerContext>();\n *\n * // Use it - context type is automatically inferred!\n * const processOrder = action({\n * args: z.object({ orderId: z.string() }),\n * handler: async (ctx, { orderId }) => {\n * // ctx.db for full database access\n * const order = await ctx.db.query(async (db) => {\n * return db.query(OrdersSchema).find(orderId);\n * });\n * await ctx.db.mutation(async (db) => {\n * await db.update(OrdersSchema, orderId, { status: \"processed\" });\n * });\n * // ctx.context for server context\n * console.log(ctx.context.requestId);\n * return { success: true };\n * }\n * });\n */\nexport function createActionBuilder<TContext = unknown>() {\n return function action<TInput, TResult, const TInternal extends boolean = false>(\n config: ActionConfig<TInput, TResult, TContext> & { internal?: TInternal }\n ): ActionProcedure<TInput, TResult, TContext, TInternal> {\n return {\n _type: \"procedure\",\n procedureType: \"action\",\n inputSchema: config.args,\n fn: config.handler,\n internal: (config.internal ?? false) as TInternal,\n };\n };\n}","import { z, ZodRawShape } from \"zod\";\nimport { commitTsCodec } from \"./codec\";\nimport { LiveQueryHandle } from \"../client\";\nimport { utf8Encode } from \"./bytes\";\n\nexport interface ColumnCodec<TData = unknown, TDriver = unknown> {\n encode?: (value: TData) => TDriver;\n decode?: (value: TDriver) => TData;\n}\n\n// Constrain a codec's decoded type to match the schema field's inferred type.\n// Without this, `decode` could return any value (e.g. a string outside an enum)\n// and silently override the schema's declared type at the type level.\ntype SchemaCodecField<TSchema extends ZodRawShape, K extends PropertyKey> =\n K extends keyof TSchema\n ? TSchema[K] extends z.ZodTypeAny ? z.infer<TSchema[K]> : unknown\n : K extends keyof BaseSchema\n ? BaseSchema[K] extends z.ZodTypeAny ? z.infer<BaseSchema[K]> : unknown\n : unknown;\n\nexport type SchemaCodecs<TSchema extends ZodRawShape> = Partial<{\n [K in keyof (TSchema & BaseSchema)]: ColumnCodec<SchemaCodecField<TSchema, K>, any>;\n}>;\n\nexport interface SchemaColumnsOptions<TSchema extends ZodRawShape = ZodRawShape> {\n codecs?: SchemaCodecs<TSchema>;\n}\n\nexport interface SchemaColumnMapping {\n [key: string]: string;\n}\n\nexport interface DefineSchemaConfig<TSchema extends ZodRawShape> {\n name: string;\n schema: TSchema;\n options?: SchemaColumnsOptions<TSchema>;\n columns?: SchemaColumnMapping;\n}\n\n// Tuple-wrap the `undefined` checks so they don't fall through to the\n// object-shape conditionals when consumers compile under `strict: false`\n// (without `strictNullChecks`, `undefined` is assignable to object types and\n// would otherwise match `{ decode: ... }` / `ColumnCodec<...>` with all\n// `infer`s collapsing to `unknown`).\ntype CodecDataType<TCodec, TFallback> =\n [TCodec] extends [undefined] ? TFallback\n : TCodec extends { decode: (...args: any[]) => infer TDecoded } ? TDecoded\n : TCodec extends ColumnCodec<infer TData, unknown> ? TData\n : TFallback;\n\ntype ZodOutput<TZod> =\n [TZod] extends [undefined] ? unknown\n : TZod extends z.ZodTypeAny ? z.infer<TZod>\n : unknown;\nexport type ComputedDataType<TCodec, TZod> = CodecDataType<TCodec, ZodOutput<TZod>>;\nexport type ComputedCodec<TData, TDriver> = ColumnCodec<TData, TDriver>;\nexport type OverrideField<TObj, TKey extends PropertyKey, TValue> = Omit<TObj, TKey> & { [K in TKey]: TValue };\nexport interface ComputedFieldConfig<\n TField extends string,\n TDecoded = unknown,\n TDriver = unknown,\n TZodType extends z.ZodTypeAny | undefined = undefined,\n> {\n field: TField;\n sql: string;\n alias?: string;\n type?: TZodType;\n codec?: {\n decode: (value: TDriver) => TDecoded;\n encode?: (value: TDecoded) => TDriver;\n };\n}\n\nexport type ComputedField = {\n field: string;\n sql: string;\n alias: string;\n codec?: ColumnCodec<any, any>;\n};\n\nexport function defineComputedField<\n TField extends string,\n TDecoded = unknown,\n TDriver = unknown,\n TZodType extends z.ZodTypeAny | undefined = undefined,\n>(\n config: ComputedFieldConfig<TField, TDecoded, TDriver, TZodType>\n): ComputedFieldConfig<TField, TDecoded, TDriver, TZodType> {\n return config;\n}\n\nexport type Prettify<T> = { [K in keyof T]: T[K] } & {};\n\ntype ApplySchemaCodecs<TBase, TCodecs> = {\n [K in keyof TBase]: K extends keyof TCodecs ? CodecDataType<TCodecs[K], TBase[K]> : TBase[K];\n};\n\n// Only apply codecs when `options.codecs` is explicitly provided. Without this\n// guard, the default constraint (`SchemaColumnsOptions<TSchema>`) makes\n// `TOptions[\"codecs\"]` infer as `Partial<{ [K]: ColumnCodec<any, any> }>`,\n// which collapses every field to `any` inside `ApplySchemaCodecs`.\ntype ResolveSchemaType<\n TSchema extends ZodRawShape,\n TOptions extends SchemaColumnsOptions<TSchema>\n> = TOptions extends { codecs: infer TCodecs }\n ? Prettify<ApplySchemaCodecs<z.infer<z.ZodObject<TSchema & BaseSchema>>, TCodecs>>\n : Prettify<z.infer<z.ZodObject<TSchema & BaseSchema>>>;\n\n// Helper to detect if a Zod type is optional or nullable\ntype IsOptionalField<T> =\n T extends z.ZodOptional<any> ? true :\n T extends z.ZodNullable<any> ? true :\n T extends z.ZodDefault<any> ? true :\n false;\n\n// Split schema keys into required vs optional\ntype OptionalKeys<TZod extends ZodRawShape> = {\n [K in keyof TZod]: IsOptionalField<TZod[K]> extends true ? K : never\n}[keyof TZod];\n\ntype RequiredKeys<TZod extends ZodRawShape> = {\n [K in keyof TZod]: IsOptionalField<TZod[K]> extends true ? never : K\n}[keyof TZod];\n\n// Add a base shape type that all schemas will include\ntype BaseSchema = {\n id: z.ZodString;\n commitTs: z.ZodCoercedBigInt;\n};\n\nexport function defineSchema<\n TSchema extends ZodRawShape,\n TName extends string,\n TOptions extends SchemaColumnsOptions<TSchema> = SchemaColumnsOptions<TSchema>\n>(\n config: DefineSchemaConfig<TSchema> & { name: TName; options?: TOptions }\n): SchemaDefinition<TName, Prettify<TSchema & BaseSchema>, ResolveSchemaType<TSchema, TOptions>> {\n const columns: Record<string, string> = {};\n\n if (config.columns) {\n Object.assign(columns, { 'id': 'id', 'commitTs': 'commit_ts', ...config.columns });\n } else {\n // Default: use field name as column name\n for (const key of Object.keys(config.schema)) {\n columns[key] = key;\n }\n columns['id'] = 'id';\n columns['commitTs'] = 'commit_ts';\n }\n\n // Merge id/commitTs into the Zod schema, user-defined fields win for everything else,\n // but id/commitTs are always forced to their correct types\n const augmentedShape = {\n ...config.schema,\n id: z.string(), // always string, even if user defined it differently\n commitTs: z.coerce.bigint(), // always number, mapped to commit_ts column\n };\n\n const userCodecs = config.options?.codecs ?? {};\n const mergedCodecs = {\n ...userCodecs,\n commitTs: commitTsCodec,\n };\n\n const result = {\n tableId: tableNameToId(config.name),\n table: config.name,\n schema: z.object(augmentedShape),\n columnsOptions: {\n ...config.options,\n codecs: mergedCodecs,\n },\n columns,\n } as SchemaDefinition<TName, TSchema & BaseSchema, ResolveSchemaType<TSchema, TOptions>>;\n\n return result\n}\n\nexport function tableNameToId(tableName: string): Uint8Array {\n return utf8Encode(tableName);\n}\n\n// Stored codec map is intentionally loose: the strict per-field constraint is\n// enforced on the input (`DefineSchemaConfig.options`), but storing the strict\n// type here would break variance when assigning a specific schema to a generic\n// `SchemaDefinition<string, ZodRawShape>` constraint (ColumnCodec.encode is\n// contravariant in its data type).\nexport interface StoredSchemaColumnsOptions {\n codecs?: Record<string, ColumnCodec<any, any>>;\n}\n\nexport interface SchemaDefinition<\n TTable extends string,\n TZod extends ZodRawShape,\n TData = z.infer<z.ZodObject<TZod>>\n> {\n tableId: Uint8Array;\n table: TTable;\n schema: z.ZodObject<TZod>;\n columnsOptions: StoredSchemaColumnsOptions;\n columns: Record<string, string>;\n _dataType?: TData;\n}\n\nexport type InferSchema<T extends SchemaDefinition<string, ZodRawShape, any>> =\n T extends SchemaDefinition<string, ZodRawShape, infer TData> ? TData : never;\n\nexport type InsertData<T extends SchemaDefinition<string, ZodRawShape, any>> =\n T extends SchemaDefinition<string, infer TZod, infer TData>\n ? {\n [K in RequiredKeys<TZod> as K extends \"id\" | \"commitTs\" ? never : K]:\n Extract<K, string> extends keyof TData ? TData[Extract<K, string>] : never\n } & {\n [K in OptionalKeys<TZod> as K extends \"id\" | \"commitTs\" ? never : K]?:\n Extract<K, string> extends keyof TData ? TData[Extract<K, string>] : never\n }\n : never;\n\nexport interface Model {\n table: string;\n tableId: Uint8Array,\n columns: Record<string, string>;\n reverseColumns: Record<string, string>;\n types: Record<string, string>;\n codecs: Record<string, ColumnCodec<any, any>>;\n}\n\n\ntype MaybePromise<T> = T | Promise<T>;\n\nexport type ReturnLiveQuery<\n TLiveQueryFn extends (...args: any[]) => MaybePromise<LiveQueryHandle<any>>\n> =\n Awaited<ReturnType<TLiveQueryFn>> extends LiveQueryHandle<infer T>\n ? T\n : never;\n\nexport type ReturnQuery<TQueryFn extends (...args: any[]) => any> =\n Awaited<ReturnType<TQueryFn>>;\n\nexport type QueryArgs<TQueryFn extends (...args: any[]) => any> =\n Parameters<TQueryFn>[0];\n\nexport type MutationArgs<TMutationFn extends (...args: any[]) => any> =\n Parameters<TMutationFn>[0];\n\nexport type ActionArgs<TActionFn extends (...args: any[]) => any> =\n Parameters<TActionFn>[0];"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkMA,SAAgB,qBAAyC;CACvD,OAAO,SAAS,MACd,QACsD;EACtD,OAAO;GACL,OAAO;GACP,eAAe;GACf,aAAa,OAAO;GACpB,IAAI,OAAO;GACX,UAAW,OAAO,YAAY;GAC9B,eAAe,OAAO;EACxB;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,wBAA4C;CAC1D,OAAO,SAAS,SACd,QACyD;EACzD,OAAO;GACL,OAAO;GACP,eAAe;GACf,aAAa,OAAO;GACpB,IAAI,OAAO;GACX,UAAW,OAAO,YAAY;EAChC;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAgB,sBAA0C;CACxD,OAAO,SAAS,OACd,QACuD;EACvD,OAAO;GACL,OAAO;GACP,eAAe;GACf,aAAa,OAAO;GACpB,IAAI,OAAO;GACX,UAAW,OAAO,YAAY;EAChC;CACF;AACF;;;ACzNA,SAAgB,oBAMZ,QACwD;CACxD,OAAO;AACX;AAyCA,SAAgB,aAKZ,QAC6F;CAC7F,MAAM,UAAkC,CAAC;CAEzC,IAAI,OAAO,SACP,OAAO,OAAO,SAAS;EAAE,MAAM;EAAM,YAAY;EAAa,GAAG,OAAO;CAAQ,CAAC;MAC9E;EAEH,KAAK,MAAM,OAAO,OAAO,KAAK,OAAO,MAAM,GACvC,QAAQ,OAAO;EAEnB,QAAQ,QAAQ;EAChB,QAAQ,cAAc;CAC1B;CAIA,MAAM,iBAAiB;EACnB,GAAG,OAAO;EACV,IAAIA,IAAE,OAAO;EACb,UAAUA,IAAE,OAAO,OAAO;CAC9B;CAGA,MAAM,eAAe;EACjB,GAFe,OAAO,SAAS,UAAU,CAAC;EAG1C,UAAU;CACd;CAaA,OAAO;EAVH,SAAS,cAAc,OAAO,IAAI;EAClC,OAAO,OAAO;EACd,QAAQA,IAAE,OAAO,cAAc;EAC/B,gBAAgB;GACZ,GAAG,OAAO;GACV,QAAQ;EACZ;EACA;CAGQ;AAChB;AAEA,SAAgB,cAAc,WAA+B;CACzD,OAAO,WAAW,SAAS;AAC/B"}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
export { SupaliveDb, sleep } from "../db/realtime_db";
|
|
4
|
-
export { TxContext, DbReader, DbWriter } from "../db/context";
|
|
5
|
-
export { DbReader as ReadContext, DbWriter as WritableContext } from "../db/context";
|
|
6
|
-
export { defineSchema, defineComputedField } from "../db/schema";
|
|
7
|
-
export type { Model } from "../db/schema";
|
|
8
|
-
export type { ComputedFieldConfig, ColumnCodec, SchemaCodecs, SchemaDefinition, SchemaColumnsOptions, InferSchema, InsertData, } from "../db/schema";
|
|
9
|
-
export type { Database, RawClient, PooledClient, DbQueryResult, } from "../db/db";
|
|
10
|
-
export { matchesPredicate } from "../db/query";
|
|
11
|
-
export * from "../db/types_db";
|
|
12
|
-
export { NO_RETRY, DEFAULT_RETRY, OccConflictError, OccAbortError, } from "../db/types_db";
|
|
13
|
-
export { createQueryBuilder, createMutationBuilder, createActionBuilder, type QueryProcedure, type MutationProcedure, type ActionProcedure, type AnyProcedure, type QueryFn, type MutationFn, type ActionFn, type OutputOf, type TypeOf, type ContextOf, type QueryConfig, type MutationConfig, type ActionConfig, type QueryCtx, type MutationCtx, type ActionCtx, } from "../router/procedure";
|
|
14
|
-
export { router, type Router, type AppRouter, type RegisteredProcedure, type QueryProcedures, type MutationProcedures, type ActionProcedures, type PublicProcedures, type ProcedureNames, } from "../router/router";
|
|
15
|
-
export { WsClientManager, RPCError, type WSClientOptions, type HeartbeatOptions, type ClientPublicState, } from "./ws_client_manager";
|
|
16
|
-
export { createClient, type ClientOptions, type LiveQueryHandle, type LiveQueryState, type LiveQueryStatus, type WSClientMethods, type ClientFromProcedures, type CallOptions, } from "./client";
|
|
17
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { $ as PublicProcedures, $n as LiveResult, $t as InferSchema, Ar as bytesFromJson, At as ResultOf, Cr as ReadEntry, Ct as createQueryBuilder, Dr as WriteEntrySchema, Dt as DefsToMap, Er as WriteEntry, Et as AnyQueryDef, Ft as TxContext, G as RPCError, Gn as CachedPgMetadataSchema, Gt as matchesPredicate, Hn as AndPredicateSchema, J as ActionProcedures, Jn as CompareOperator, K as WSClientOptions, Kn as CommitLogEntry, Mr as normalizeToBytes, Mt as defineQuery, Nt as DbReader, Or as WriteOp, Ot as ParamsOf, Pt as DbWriter, Q as ProcedureNames, Qn as LeafPredicateSchema, Sn as RawClient, Sr as RawReadEntrySchema, St as createMutationBuilder, Tr as RetryConfig, Tt as sleep, U as ClientPublicState, Un as BigIntSchema, Vn as AndPredicate, W as HeartbeatOptions, Wn as CachedPgMetadata, Xn as DEFAULT_RETRY, Y as AppRouter, Yn as CompareOperatorSchema, Z as MutationProcedures, Zn as LeafPredicate, Zt as ComputedFieldConfig, _n as DbQueryResult, _r as RawPointRead, _t as QueryCtx, a as CallOptions, ar as OrPredicateSchema, at as ActionConfig, bn as PooledClient, br as RawRangeReadSchema, bt as TypeOf, c as LiveQueryHandle, cn as SchemaCodecs, cr as Predicate, ct as ActionProcedure, d as WSClientMethods, dn as SchemaDefinition, dr as QueryCacheEntrySchema, dt as MutationConfig, en as InsertData, er as MutationResult, et as QueryProcedures, f as createClient, fr as QueryCacheMetadata, ft as MutationCtx, gn as Database, gr as RangeReadSchema, gt as QueryConfig, hr as RangeRead, ht as OutputOf, i as createCaller, ir as OrPredicate, it as router, jr as normalizeIdToBytes, jt as _resetGlobalDefs, kr as WriteOpSchema, kt as QueryDefinition, l as LiveQueryState, lr as PredicateSchema, lt as AnyProcedure, mn as defineSchema, mr as QuerySpec, mt as MutationProcedure, n as CallerFromRouter, nr as OccAbortError, nt as Router, o as ClientFromProcedures, or as PointRead, ot as ActionCtx, pn as defineComputedField, pr as QueryCacheMetadataSchema, pt as MutationFn, q as WsClientManager, qn as CommitTs, qt as ColumnCodec, r as CallerOptions, rr as OccConflictError, s as ClientOptions, sr as PointReadSchema, st as ActionFn, t as CallerFromProcedures, tn as Model, tr as NO_RETRY, tt as RegisteredProcedure, u as LiveQueryStatus, un as SchemaColumnsOptions, ur as QueryCacheEntry, ut as ContextOf, vr as RawPointReadSchema, vt as QueryFn, wr as ReadEntrySchema, wt as SupaliveDb, xr as RawReadEntry, xt as createActionBuilder, yr as RawRangeRead, yt as QueryProcedure } from "../../index-CTyXKcq_.js";
|
|
2
|
+
export { type ActionConfig, type ActionCtx, type ActionFn, type ActionProcedure, type ActionProcedures, AndPredicate, AndPredicateSchema, type AnyProcedure, type AnyQueryDef, type AppRouter, BigIntSchema, CachedPgMetadata, CachedPgMetadataSchema, type CallOptions, CallerFromProcedures, CallerFromRouter, CallerOptions, type ClientFromProcedures, type ClientOptions, type ClientPublicState, type ColumnCodec, CommitLogEntry, CommitTs, CompareOperator, CompareOperatorSchema, type ComputedFieldConfig, type ContextOf, DEFAULT_RETRY, type Database, type DbQueryResult, DbReader, DbReader as ReadContext, DbWriter, DbWriter as WritableContext, type DefsToMap, type HeartbeatOptions, type InferSchema, type InsertData, LeafPredicate, LeafPredicateSchema, type LiveQueryHandle, type LiveQueryState, type LiveQueryStatus, LiveResult, type Model, type MutationConfig, type MutationCtx, type MutationFn, type MutationProcedure, type MutationProcedures, MutationResult, NO_RETRY, OccAbortError, OccConflictError, OrPredicate, OrPredicateSchema, type OutputOf, type ParamsOf, PointRead, PointReadSchema, type PooledClient, Predicate, PredicateSchema, type ProcedureNames, type PublicProcedures, QueryCacheEntry, QueryCacheEntrySchema, QueryCacheMetadata, QueryCacheMetadataSchema, type QueryConfig, type QueryCtx, type QueryDefinition, type QueryFn, type QueryProcedure, type QueryProcedures, QuerySpec, RPCError, RangeRead, RangeReadSchema, type RawClient, RawPointRead, RawPointReadSchema, RawRangeRead, RawRangeReadSchema, RawReadEntry, RawReadEntrySchema, ReadEntry, ReadEntrySchema, type RegisteredProcedure, type ResultOf, RetryConfig, type Router, type SchemaCodecs, type SchemaColumnsOptions, type SchemaDefinition, SupaliveDb, TxContext, type TypeOf, type WSClientMethods, type WSClientOptions, WriteEntry, WriteEntrySchema, WriteOp, WriteOpSchema, WsClientManager, _resetGlobalDefs, bytesFromJson, createActionBuilder, createCaller, createClient, createMutationBuilder, createQueryBuilder, defineComputedField, defineQuery, defineSchema, matchesPredicate, normalizeIdToBytes, normalizeToBytes, router, sleep };
|