@supalive/core 0.1.3 → 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 +308 -1
- 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 -45
- 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 -8
- package/dist/src/server/index.d.ts.map +0 -1
- package/dist/src/server/index.js +0 -7
- 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
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
export interface ErrorMessage {
|
|
3
|
-
type: "error";
|
|
4
|
-
id?: string;
|
|
5
|
-
error: string;
|
|
6
|
-
code?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare const AuthMessageSchema: z.ZodObject<{
|
|
9
|
-
type: z.ZodLiteral<"auth">;
|
|
10
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
11
|
-
}, z.core.$strip>;
|
|
12
|
-
export declare const CallMessageSchema: z.ZodObject<{
|
|
13
|
-
type: z.ZodLiteral<"call">;
|
|
14
|
-
id: z.ZodString;
|
|
15
|
-
procedure: z.ZodString;
|
|
16
|
-
input: z.ZodUnknown;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
export declare const SubscribeMessageSchema: z.ZodObject<{
|
|
19
|
-
type: z.ZodLiteral<"subscribe">;
|
|
20
|
-
id: z.ZodString;
|
|
21
|
-
procedure: z.ZodString;
|
|
22
|
-
input: z.ZodUnknown;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
export declare const UnsubscribeMessageSchema: z.ZodObject<{
|
|
25
|
-
type: z.ZodLiteral<"unsubscribe">;
|
|
26
|
-
subId: z.ZodString;
|
|
27
|
-
}, z.core.$strip>;
|
|
28
|
-
export declare const ClientMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
29
|
-
type: z.ZodLiteral<"auth">;
|
|
30
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
31
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
-
type: z.ZodLiteral<"call">;
|
|
33
|
-
id: z.ZodString;
|
|
34
|
-
procedure: z.ZodString;
|
|
35
|
-
input: z.ZodUnknown;
|
|
36
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
37
|
-
type: z.ZodLiteral<"subscribe">;
|
|
38
|
-
id: z.ZodString;
|
|
39
|
-
procedure: z.ZodString;
|
|
40
|
-
input: z.ZodUnknown;
|
|
41
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
42
|
-
type: z.ZodLiteral<"unsubscribe">;
|
|
43
|
-
subId: z.ZodString;
|
|
44
|
-
}, z.core.$strip>]>;
|
|
45
|
-
export type AuthMessage = z.infer<typeof AuthMessageSchema>;
|
|
46
|
-
export type CallMessage = z.infer<typeof CallMessageSchema>;
|
|
47
|
-
export type SubscribeMessage = z.infer<typeof SubscribeMessageSchema>;
|
|
48
|
-
export type UnsubscribeMessage = z.infer<typeof UnsubscribeMessageSchema>;
|
|
49
|
-
export type ClientMessage = z.infer<typeof ClientMessageSchema>;
|
|
50
|
-
export declare const ConnectedMessageSchema: z.ZodObject<{
|
|
51
|
-
type: z.ZodLiteral<"connected">;
|
|
52
|
-
sessionId: z.ZodString;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
export declare const AuthSuccessMessageSchema: z.ZodObject<{
|
|
55
|
-
type: z.ZodLiteral<"auth:success">;
|
|
56
|
-
userId: z.ZodString;
|
|
57
|
-
extra: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
58
|
-
}, z.core.$strip>;
|
|
59
|
-
export declare const AuthFailedMessageSchema: z.ZodObject<{
|
|
60
|
-
type: z.ZodLiteral<"auth:failed">;
|
|
61
|
-
message: z.ZodString;
|
|
62
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
63
|
-
}, z.core.$strip>;
|
|
64
|
-
export declare const ResponseMessageSchema: z.ZodObject<{
|
|
65
|
-
type: z.ZodLiteral<"response">;
|
|
66
|
-
id: z.ZodString;
|
|
67
|
-
success: z.ZodBoolean;
|
|
68
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
69
|
-
error: z.ZodOptional<z.ZodString>;
|
|
70
|
-
code: z.ZodOptional<z.ZodString>;
|
|
71
|
-
subId: z.ZodOptional<z.ZodString>;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
export declare const SubscriptionUpdateMessageSchema: z.ZodObject<{
|
|
74
|
-
type: z.ZodLiteral<"sub:update">;
|
|
75
|
-
subId: z.ZodString;
|
|
76
|
-
data: z.ZodUnknown;
|
|
77
|
-
dataHash: z.ZodOptional<z.ZodString>;
|
|
78
|
-
}, z.core.$strip>;
|
|
79
|
-
/**
|
|
80
|
-
* Notifies a client that a subscription is no longer tracked on the server
|
|
81
|
-
* and will not receive further updates. Sent when, during a sub-manager
|
|
82
|
-
* recovery cycle, the registration record could not be found (e.g. another
|
|
83
|
-
* app-server instance fully unregistered the sub while we were disconnected).
|
|
84
|
-
* The client may choose to re-subscribe or surface the state to the user.
|
|
85
|
-
*/
|
|
86
|
-
export declare const SubscriptionGoneMessageSchema: z.ZodObject<{
|
|
87
|
-
type: z.ZodLiteral<"sub:gone">;
|
|
88
|
-
subId: z.ZodString;
|
|
89
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
90
|
-
}, z.core.$strip>;
|
|
91
|
-
/**
|
|
92
|
-
* Server-driven liveness signal. Sent when the channel has been idle for
|
|
93
|
-
* the configured app-ping interval (default 15s) and again after every
|
|
94
|
-
* outbound message. Pure no-op for the client: receiving any message
|
|
95
|
-
* (including this one) resets the client's inactivity watchdog. The client
|
|
96
|
-
* does NOT reply.
|
|
97
|
-
*/
|
|
98
|
-
export declare const ServerPingMessageSchema: z.ZodObject<{
|
|
99
|
-
type: z.ZodLiteral<"ping">;
|
|
100
|
-
}, z.core.$strip>;
|
|
101
|
-
export declare const ServerMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
102
|
-
type: z.ZodLiteral<"connected">;
|
|
103
|
-
sessionId: z.ZodString;
|
|
104
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
105
|
-
type: z.ZodLiteral<"auth:success">;
|
|
106
|
-
userId: z.ZodString;
|
|
107
|
-
extra: z.ZodOptional<z.ZodObject<{}, z.core.$strip>>;
|
|
108
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
-
type: z.ZodLiteral<"auth:failed">;
|
|
110
|
-
message: z.ZodString;
|
|
111
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
112
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
113
|
-
type: z.ZodLiteral<"response">;
|
|
114
|
-
id: z.ZodString;
|
|
115
|
-
success: z.ZodBoolean;
|
|
116
|
-
data: z.ZodOptional<z.ZodUnknown>;
|
|
117
|
-
error: z.ZodOptional<z.ZodString>;
|
|
118
|
-
code: z.ZodOptional<z.ZodString>;
|
|
119
|
-
subId: z.ZodOptional<z.ZodString>;
|
|
120
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
121
|
-
type: z.ZodLiteral<"sub:update">;
|
|
122
|
-
subId: z.ZodString;
|
|
123
|
-
data: z.ZodUnknown;
|
|
124
|
-
dataHash: z.ZodOptional<z.ZodString>;
|
|
125
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
126
|
-
type: z.ZodLiteral<"sub:gone">;
|
|
127
|
-
subId: z.ZodString;
|
|
128
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
129
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
130
|
-
type: z.ZodLiteral<"ping">;
|
|
131
|
-
}, z.core.$strip>]>;
|
|
132
|
-
export type ConnectedMessage = z.infer<typeof ConnectedMessageSchema>;
|
|
133
|
-
export type AuthSuccessMessage = z.infer<typeof AuthSuccessMessageSchema>;
|
|
134
|
-
export type AuthFailedMessage = z.infer<typeof AuthFailedMessageSchema>;
|
|
135
|
-
export type ResponseMessage = z.infer<typeof ResponseMessageSchema>;
|
|
136
|
-
export type SubscriptionUpdateMessage = z.infer<typeof SubscriptionUpdateMessageSchema>;
|
|
137
|
-
export type SubscriptionGoneMessage = z.infer<typeof SubscriptionGoneMessageSchema>;
|
|
138
|
-
export type ServerPingMessage = z.infer<typeof ServerPingMessageSchema>;
|
|
139
|
-
export type ServerMessage = z.infer<typeof ServerMessageSchema>;
|
|
140
|
-
export declare class AuthenticationError extends Error {
|
|
141
|
-
extra: Record<string, unknown>;
|
|
142
|
-
constructor(message: string, extra?: Record<string, unknown>);
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Helper type to check if a procedure is internal.
|
|
146
|
-
*/
|
|
147
|
-
export type IsInternal<T> = T extends {
|
|
148
|
-
internal: infer I;
|
|
149
|
-
} ? (I extends true ? true : false) : false;
|
|
150
|
-
export interface Context {
|
|
151
|
-
requestId: string;
|
|
152
|
-
/** Authenticated user info */
|
|
153
|
-
user: {
|
|
154
|
-
userId: string;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=types_client_rpc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types_client_rpc.d.ts","sourceRoot":"","sources":["../../../src/db/types_client_rpc.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAKD,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;iBAK5B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAC;AAEH,eAAO,MAAM,mBA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AAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACpF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,qBAAa,mBAAoB,SAAQ,KAAK;IAGnC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;gBADrC,OAAO,EAAE,MAAM,EACR,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM;CAI7C;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,CAAC,CAAC,SAAS,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC;AAEtG,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,8BAA8B;IAC9B,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
// ─── WebSocket Message Schemas ────────────────────────────────────────────────
|
|
3
|
-
// Zod schemas for runtime validation of WebSocket messages
|
|
4
|
-
export const AuthMessageSchema = z.object({
|
|
5
|
-
type: z.literal("auth"),
|
|
6
|
-
data: z.record(z.string(), z.any()).optional(),
|
|
7
|
-
});
|
|
8
|
-
export const CallMessageSchema = z.object({
|
|
9
|
-
type: z.literal("call"),
|
|
10
|
-
id: z.string(),
|
|
11
|
-
procedure: z.string(),
|
|
12
|
-
input: z.unknown(),
|
|
13
|
-
});
|
|
14
|
-
export const SubscribeMessageSchema = z.object({
|
|
15
|
-
type: z.literal("subscribe"),
|
|
16
|
-
id: z.string(),
|
|
17
|
-
procedure: z.string(),
|
|
18
|
-
input: z.unknown(),
|
|
19
|
-
});
|
|
20
|
-
export const UnsubscribeMessageSchema = z.object({
|
|
21
|
-
type: z.literal("unsubscribe"),
|
|
22
|
-
subId: z.string(),
|
|
23
|
-
});
|
|
24
|
-
export const ClientMessageSchema = z.union([
|
|
25
|
-
AuthMessageSchema,
|
|
26
|
-
CallMessageSchema,
|
|
27
|
-
SubscribeMessageSchema,
|
|
28
|
-
UnsubscribeMessageSchema,
|
|
29
|
-
]);
|
|
30
|
-
// ─── Server Message Schemas ───────────────────────────────────────────────────
|
|
31
|
-
export const ConnectedMessageSchema = z.object({
|
|
32
|
-
type: z.literal("connected"),
|
|
33
|
-
sessionId: z.string(),
|
|
34
|
-
});
|
|
35
|
-
export const AuthSuccessMessageSchema = z.object({
|
|
36
|
-
type: z.literal("auth:success"),
|
|
37
|
-
userId: z.string(),
|
|
38
|
-
extra: z.object().optional()
|
|
39
|
-
});
|
|
40
|
-
export const AuthFailedMessageSchema = z.object({
|
|
41
|
-
type: z.literal("auth:failed"),
|
|
42
|
-
message: z.string(),
|
|
43
|
-
extra: z.record(z.string(), z.unknown()).optional()
|
|
44
|
-
});
|
|
45
|
-
export const ResponseMessageSchema = z.object({
|
|
46
|
-
type: z.literal("response"),
|
|
47
|
-
id: z.string(),
|
|
48
|
-
success: z.boolean(),
|
|
49
|
-
data: z.unknown().optional(),
|
|
50
|
-
error: z.string().optional(),
|
|
51
|
-
code: z.string().optional(),
|
|
52
|
-
/**
|
|
53
|
-
* Populated by the server only for a successful `subscribe` response.
|
|
54
|
-
* Carries the canonical, server-computed subscription id so the client
|
|
55
|
-
* can route subsequent `sub:update` / `sub:gone` messages without
|
|
56
|
-
* recomputing the hash locally (which would require the wasm runtime
|
|
57
|
-
* and would not reflect server-side per-procedure `queryIdentity`
|
|
58
|
-
* overrides).
|
|
59
|
-
*/
|
|
60
|
-
subId: z.string().optional(),
|
|
61
|
-
});
|
|
62
|
-
export const SubscriptionUpdateMessageSchema = z.object({
|
|
63
|
-
type: z.literal("sub:update"),
|
|
64
|
-
subId: z.string(),
|
|
65
|
-
data: z.unknown(),
|
|
66
|
-
dataHash: z.string().optional(),
|
|
67
|
-
});
|
|
68
|
-
/**
|
|
69
|
-
* Notifies a client that a subscription is no longer tracked on the server
|
|
70
|
-
* and will not receive further updates. Sent when, during a sub-manager
|
|
71
|
-
* recovery cycle, the registration record could not be found (e.g. another
|
|
72
|
-
* app-server instance fully unregistered the sub while we were disconnected).
|
|
73
|
-
* The client may choose to re-subscribe or surface the state to the user.
|
|
74
|
-
*/
|
|
75
|
-
export const SubscriptionGoneMessageSchema = z.object({
|
|
76
|
-
type: z.literal("sub:gone"),
|
|
77
|
-
subId: z.string(),
|
|
78
|
-
reason: z.string().optional(),
|
|
79
|
-
});
|
|
80
|
-
/**
|
|
81
|
-
* Server-driven liveness signal. Sent when the channel has been idle for
|
|
82
|
-
* the configured app-ping interval (default 15s) and again after every
|
|
83
|
-
* outbound message. Pure no-op for the client: receiving any message
|
|
84
|
-
* (including this one) resets the client's inactivity watchdog. The client
|
|
85
|
-
* does NOT reply.
|
|
86
|
-
*/
|
|
87
|
-
export const ServerPingMessageSchema = z.object({
|
|
88
|
-
type: z.literal("ping"),
|
|
89
|
-
});
|
|
90
|
-
export const ServerMessageSchema = z.union([
|
|
91
|
-
ConnectedMessageSchema,
|
|
92
|
-
AuthSuccessMessageSchema,
|
|
93
|
-
AuthFailedMessageSchema,
|
|
94
|
-
ResponseMessageSchema,
|
|
95
|
-
SubscriptionUpdateMessageSchema,
|
|
96
|
-
SubscriptionGoneMessageSchema,
|
|
97
|
-
ServerPingMessageSchema,
|
|
98
|
-
]);
|
|
99
|
-
export class AuthenticationError extends Error {
|
|
100
|
-
extra;
|
|
101
|
-
constructor(message, extra = {}) {
|
|
102
|
-
super(message);
|
|
103
|
-
this.extra = extra;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
//# sourceMappingURL=types_client_rpc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types_client_rpc.js","sourceRoot":"","sources":["../../../src/db/types_client_rpc.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AASpB,iFAAiF;AACjF,2DAA2D;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAA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
export type CommitTs = bigint;
|
|
4
|
-
export declare const BigIntSchema: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
|
|
5
|
-
export declare const CompareOperatorSchema: z.ZodEnum<{
|
|
6
|
-
"=": "=";
|
|
7
|
-
"!=": "!=";
|
|
8
|
-
">": ">";
|
|
9
|
-
">=": ">=";
|
|
10
|
-
"<": "<";
|
|
11
|
-
"<=": "<=";
|
|
12
|
-
like: "like";
|
|
13
|
-
ilike: "ilike";
|
|
14
|
-
contains: "contains";
|
|
15
|
-
icontains: "icontains";
|
|
16
|
-
between: "between";
|
|
17
|
-
jsonContains: "jsonContains";
|
|
18
|
-
jsonContainedBy: "jsonContainedBy";
|
|
19
|
-
jsonHasKey: "jsonHasKey";
|
|
20
|
-
jsonArrayContains: "jsonArrayContains";
|
|
21
|
-
isNull: "isNull";
|
|
22
|
-
isNotNull: "isNotNull";
|
|
23
|
-
}>;
|
|
24
|
-
export type CompareOperator = z.infer<typeof CompareOperatorSchema>;
|
|
25
|
-
export type Predicate = LeafPredicate | {
|
|
26
|
-
kind: "and";
|
|
27
|
-
children: Predicate[];
|
|
28
|
-
} | {
|
|
29
|
-
kind: "or";
|
|
30
|
-
children: Predicate[];
|
|
31
|
-
};
|
|
32
|
-
export declare const PredicateSchema: z.ZodType<Predicate>;
|
|
33
|
-
export declare const LeafPredicateSchema: z.ZodObject<{
|
|
34
|
-
kind: z.ZodLiteral<"leaf">;
|
|
35
|
-
column: z.ZodString;
|
|
36
|
-
operator: z.ZodEnum<{
|
|
37
|
-
"=": "=";
|
|
38
|
-
"!=": "!=";
|
|
39
|
-
">": ">";
|
|
40
|
-
">=": ">=";
|
|
41
|
-
"<": "<";
|
|
42
|
-
"<=": "<=";
|
|
43
|
-
like: "like";
|
|
44
|
-
ilike: "ilike";
|
|
45
|
-
contains: "contains";
|
|
46
|
-
icontains: "icontains";
|
|
47
|
-
between: "between";
|
|
48
|
-
jsonContains: "jsonContains";
|
|
49
|
-
jsonContainedBy: "jsonContainedBy";
|
|
50
|
-
jsonHasKey: "jsonHasKey";
|
|
51
|
-
jsonArrayContains: "jsonArrayContains";
|
|
52
|
-
isNull: "isNull";
|
|
53
|
-
isNotNull: "isNotNull";
|
|
54
|
-
}>;
|
|
55
|
-
value: z.ZodUnknown;
|
|
56
|
-
value2: z.ZodOptional<z.ZodUnknown>;
|
|
57
|
-
raw: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
-
path: z.ZodOptional<z.ZodString>;
|
|
59
|
-
mode: z.ZodOptional<z.ZodEnum<{
|
|
60
|
-
one: "one";
|
|
61
|
-
all: "all";
|
|
62
|
-
}>>;
|
|
63
|
-
}, z.core.$strip>;
|
|
64
|
-
export type LeafPredicate = z.infer<typeof LeafPredicateSchema>;
|
|
65
|
-
export declare const AndPredicateSchema: z.ZodObject<{
|
|
66
|
-
kind: z.ZodLiteral<"and">;
|
|
67
|
-
children: z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
export type AndPredicate = z.infer<typeof AndPredicateSchema>;
|
|
70
|
-
export declare const OrPredicateSchema: z.ZodObject<{
|
|
71
|
-
kind: z.ZodLiteral<"or">;
|
|
72
|
-
children: z.ZodArray<z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>>;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
export type OrPredicate = z.infer<typeof OrPredicateSchema>;
|
|
75
|
-
/** Query specification - what was queried (used for cache key generation) */
|
|
76
|
-
export type QuerySpec = ReadEntry;
|
|
77
|
-
export declare function normalizeIdToBytes(id: string | number, fromHex?: boolean): Uint8Array;
|
|
78
|
-
export declare function normalizeToBytes(value: Uint8Array | unknown): Uint8Array;
|
|
79
|
-
export declare function bytesFromJson(value: Uint8Array | unknown): Uint8Array;
|
|
80
|
-
export declare const PointReadSchema: z.ZodObject<{
|
|
81
|
-
kind: z.ZodLiteral<"point">;
|
|
82
|
-
table: z.ZodString;
|
|
83
|
-
id: z.ZodString;
|
|
84
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
85
|
-
expectedCommitTs: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>>>;
|
|
86
|
-
}, z.core.$strip>;
|
|
87
|
-
export type PointRead = z.infer<typeof PointReadSchema>;
|
|
88
|
-
export declare const RawPointReadSchema: z.ZodObject<{
|
|
89
|
-
kind: z.ZodLiteral<"point">;
|
|
90
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
91
|
-
id: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
92
|
-
table: z.ZodString;
|
|
93
|
-
expectedCommitTs: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>>>;
|
|
94
|
-
}, z.core.$strip>;
|
|
95
|
-
export type RawPointRead = z.infer<typeof RawPointReadSchema>;
|
|
96
|
-
/**
|
|
97
|
-
* Query specification for a range read (get with filters).
|
|
98
|
-
* This is the query definition, not the result.
|
|
99
|
-
*/
|
|
100
|
-
export declare const RangeReadSchema: z.ZodObject<{
|
|
101
|
-
kind: z.ZodLiteral<"range">;
|
|
102
|
-
table: z.ZodString;
|
|
103
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
104
|
-
predicate: z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>;
|
|
105
|
-
columns: z.ZodArray<z.ZodString>;
|
|
106
|
-
orderBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
107
|
-
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
108
|
-
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
109
|
-
}, z.core.$strip>;
|
|
110
|
-
export type RangeRead = z.infer<typeof RangeReadSchema>;
|
|
111
|
-
export declare const RawRangeReadSchema: z.ZodObject<{
|
|
112
|
-
kind: z.ZodLiteral<"range">;
|
|
113
|
-
table: z.ZodString;
|
|
114
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
115
|
-
predicate: z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>;
|
|
116
|
-
columns: z.ZodArray<z.ZodString>;
|
|
117
|
-
orderBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
118
|
-
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
119
|
-
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
120
|
-
}, z.core.$strip>;
|
|
121
|
-
export type RawRangeRead = z.infer<typeof RawRangeReadSchema>;
|
|
122
|
-
export declare const ReadEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
123
|
-
kind: z.ZodLiteral<"point">;
|
|
124
|
-
table: z.ZodString;
|
|
125
|
-
id: z.ZodString;
|
|
126
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
127
|
-
expectedCommitTs: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>>>;
|
|
128
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
129
|
-
kind: z.ZodLiteral<"range">;
|
|
130
|
-
table: z.ZodString;
|
|
131
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
132
|
-
predicate: z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>;
|
|
133
|
-
columns: z.ZodArray<z.ZodString>;
|
|
134
|
-
orderBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
-
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
136
|
-
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
137
|
-
}, z.core.$strip>]>;
|
|
138
|
-
export type ReadEntry = z.infer<typeof ReadEntrySchema>;
|
|
139
|
-
export declare const RawReadEntrySchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
140
|
-
kind: z.ZodLiteral<"point">;
|
|
141
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
142
|
-
id: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
143
|
-
table: z.ZodString;
|
|
144
|
-
expectedCommitTs: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>>>;
|
|
145
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
146
|
-
kind: z.ZodLiteral<"range">;
|
|
147
|
-
table: z.ZodString;
|
|
148
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
149
|
-
predicate: z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>;
|
|
150
|
-
columns: z.ZodArray<z.ZodString>;
|
|
151
|
-
orderBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
152
|
-
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
153
|
-
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
154
|
-
}, z.core.$strip>]>;
|
|
155
|
-
export type RawReadEntry = z.infer<typeof RawReadEntrySchema>;
|
|
156
|
-
export declare const WriteOpSchema: z.ZodEnum<{
|
|
157
|
-
insert: "insert";
|
|
158
|
-
update: "update";
|
|
159
|
-
delete: "delete";
|
|
160
|
-
}>;
|
|
161
|
-
export type WriteOp = z.infer<typeof WriteOpSchema>;
|
|
162
|
-
export declare const WriteEntrySchema: z.ZodObject<{
|
|
163
|
-
table: z.ZodString;
|
|
164
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
165
|
-
id: z.ZodString;
|
|
166
|
-
op: z.ZodEnum<{
|
|
167
|
-
insert: "insert";
|
|
168
|
-
update: "update";
|
|
169
|
-
delete: "delete";
|
|
170
|
-
}>;
|
|
171
|
-
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
172
|
-
prevData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
173
|
-
expectedCommitTs: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>>>;
|
|
174
|
-
}, z.core.$strip>;
|
|
175
|
-
export type WriteEntry = z.infer<typeof WriteEntrySchema>;
|
|
176
|
-
export interface CommitLogEntry {
|
|
177
|
-
id: Uint8Array;
|
|
178
|
-
ts: bigint;
|
|
179
|
-
tableId: Uint8Array;
|
|
180
|
-
data: Uint8Array;
|
|
181
|
-
_parsedData?: Record<string, unknown> | null;
|
|
182
|
-
}
|
|
183
|
-
export interface MutationResult<T> {
|
|
184
|
-
result: T;
|
|
185
|
-
writeSet: WriteEntry[];
|
|
186
|
-
commitTs: CommitTs;
|
|
187
|
-
}
|
|
188
|
-
export interface LiveResult<T> {
|
|
189
|
-
ts: bigint;
|
|
190
|
-
data: T;
|
|
191
|
-
readSet: ReadEntry[];
|
|
192
|
-
}
|
|
193
|
-
export declare const QueryCacheMetadataSchema: z.ZodObject<{
|
|
194
|
-
lastSnapshotTs: z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>;
|
|
195
|
-
readSet: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
196
|
-
kind: z.ZodLiteral<"point">;
|
|
197
|
-
table: z.ZodString;
|
|
198
|
-
id: z.ZodString;
|
|
199
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
200
|
-
expectedCommitTs: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<bigint, string>>>>;
|
|
201
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
202
|
-
kind: z.ZodLiteral<"range">;
|
|
203
|
-
table: z.ZodString;
|
|
204
|
-
tableId: z.ZodPipe<z.ZodAny, z.ZodTransform<Uint8Array<ArrayBufferLike>, any>>;
|
|
205
|
-
predicate: z.ZodType<Predicate, unknown, z.core.$ZodTypeInternals<Predicate, unknown>>;
|
|
206
|
-
columns: z.ZodArray<z.ZodString>;
|
|
207
|
-
orderBy: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
-
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
209
|
-
offset: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
210
|
-
}, z.core.$strip>]>>;
|
|
211
|
-
}, z.core.$strip>;
|
|
212
|
-
export type QueryCacheMetadata = z.infer<typeof QueryCacheMetadataSchema>;
|
|
213
|
-
export declare const QueryCacheEntrySchema: z.ZodObject<{
|
|
214
|
-
data: z.ZodUnknown;
|
|
215
|
-
}, z.core.$strip>;
|
|
216
|
-
export type QueryCacheEntry = z.infer<typeof QueryCacheEntrySchema>;
|
|
217
|
-
export declare const CachedPgMetadataSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
218
|
-
export type CachedPgMetadata = z.infer<typeof CachedPgMetadataSchema>;
|
|
219
|
-
export interface RetryConfig {
|
|
220
|
-
maxAttempts: number;
|
|
221
|
-
backoff: "none" | "linear" | "exponential";
|
|
222
|
-
delayMs?: number;
|
|
223
|
-
onConflict?: (attempt: number, error: OccConflictError) => void;
|
|
224
|
-
}
|
|
225
|
-
export declare const NO_RETRY: RetryConfig;
|
|
226
|
-
export declare const DEFAULT_RETRY: RetryConfig;
|
|
227
|
-
export declare class OccConflictError extends Error {
|
|
228
|
-
readonly reason: string;
|
|
229
|
-
readonly conflictDetail?: unknown | undefined;
|
|
230
|
-
constructor(reason: string, conflictDetail?: unknown | undefined);
|
|
231
|
-
static isOccConflictError(err: unknown): boolean;
|
|
232
|
-
}
|
|
233
|
-
export declare class OccAbortError extends Error {
|
|
234
|
-
constructor(message: string);
|
|
235
|
-
}
|
|
236
|
-
//# sourceMappingURL=types_db.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types_db.d.ts","sourceRoot":"","sources":["../../../src/db/types_db.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,kFAAkF;AAClF,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B,eAAO,MAAM,YAAY,wDAA6C,CAAC;AAEvE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAGpE,MAAM,MAAM,SAAS,GACjB,aAAa,GACb;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,SAAS,EAAE,CAAA;CAAE,CAAC;AAC1C,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAMhD,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;iBAG5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAA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