@evolu/common 6.0.1-preview.19 → 6.0.1-preview.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/Assert.d.ts.map +1 -1
- package/dist/src/Assert.js +1 -1
- package/dist/src/Buffer.d.ts +1 -1
- package/dist/src/Buffer.d.ts.map +1 -1
- package/dist/src/Buffer.js +1 -1
- package/dist/src/CallbackRegistry.d.ts +53 -0
- package/dist/src/CallbackRegistry.d.ts.map +1 -0
- package/dist/src/CallbackRegistry.js +25 -0
- package/dist/src/Console.d.ts +31 -6
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +72 -9
- package/dist/src/Crypto.d.ts +48 -37
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +27 -50
- package/dist/src/Evolu/Db.d.ts +138 -66
- package/dist/src/Evolu/Db.d.ts.map +1 -1
- package/dist/src/Evolu/Db.js +248 -645
- package/dist/src/Evolu/Diff.d.ts +3 -3
- package/dist/src/Evolu/Diff.d.ts.map +1 -1
- package/dist/src/Evolu/Diff.js +7 -5
- package/dist/src/Evolu/Evolu.d.ts +79 -116
- package/dist/src/Evolu/Evolu.d.ts.map +1 -1
- package/dist/src/Evolu/Evolu.js +275 -132
- package/dist/src/Evolu/Internal.d.ts +0 -2
- package/dist/src/Evolu/Internal.d.ts.map +1 -1
- package/dist/src/Evolu/Internal.js +0 -2
- package/dist/src/Evolu/LocalAuth.d.ts +144 -0
- package/dist/src/Evolu/LocalAuth.d.ts.map +1 -0
- package/dist/src/Evolu/LocalAuth.js +171 -0
- package/dist/src/Evolu/Owner.d.ts +129 -83
- package/dist/src/Evolu/Owner.d.ts.map +1 -1
- package/dist/src/Evolu/Owner.js +80 -89
- package/dist/src/Evolu/Platform.d.ts +9 -7
- package/dist/src/Evolu/Platform.d.ts.map +1 -1
- package/dist/src/Evolu/Protocol.d.ts +114 -191
- package/dist/src/Evolu/Protocol.d.ts.map +1 -1
- package/dist/src/Evolu/Protocol.js +409 -416
- package/dist/src/Evolu/Public.d.ts +6 -8
- package/dist/src/Evolu/Public.d.ts.map +1 -1
- package/dist/src/Evolu/Public.js +2 -3
- package/dist/src/Evolu/PublicKysely.js +3 -3
- package/dist/src/Evolu/Relay.d.ts +1 -2
- package/dist/src/Evolu/Relay.d.ts.map +1 -1
- package/dist/src/Evolu/Relay.js +11 -9
- package/dist/src/Evolu/Schema.d.ts +88 -27
- package/dist/src/Evolu/Schema.d.ts.map +1 -1
- package/dist/src/Evolu/Schema.js +141 -24
- package/dist/src/Evolu/Storage.d.ts +158 -14
- package/dist/src/Evolu/Storage.d.ts.map +1 -1
- package/dist/src/Evolu/Storage.js +32 -32
- package/dist/src/Evolu/Sync.d.ts +77 -13
- package/dist/src/Evolu/Sync.d.ts.map +1 -1
- package/dist/src/Evolu/Sync.js +453 -20
- package/dist/src/Evolu/Timestamp.d.ts +29 -27
- package/dist/src/Evolu/Timestamp.d.ts.map +1 -1
- package/dist/src/Evolu/Timestamp.js +20 -18
- package/dist/src/ManyToManyMap.d.ts +74 -10
- package/dist/src/ManyToManyMap.d.ts.map +1 -1
- package/dist/src/ManyToManyMap.js +41 -6
- package/dist/src/Random.d.ts +3 -2
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/RefCountedResourceManager.d.ts +119 -0
- package/dist/src/RefCountedResourceManager.d.ts.map +1 -0
- package/dist/src/RefCountedResourceManager.js +197 -0
- package/dist/src/Result.d.ts +144 -22
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +5 -2
- package/dist/src/Sqlite.d.ts +20 -4
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +50 -8
- package/dist/src/Task.d.ts +511 -0
- package/dist/src/Task.d.ts.map +1 -0
- package/dist/src/Task.js +410 -0
- package/dist/src/Time.d.ts +59 -0
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +87 -4
- package/dist/src/Type.d.ts +431 -341
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +458 -466
- package/dist/src/WebSocket.d.ts +5 -2
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +12 -13
- package/dist/src/Worker.d.ts +39 -11
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +22 -4
- package/dist/src/index.d.ts +2 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -3
- package/package.json +7 -7
- package/src/Assert.ts +2 -4
- package/src/Buffer.ts +1 -1
- package/src/CallbackRegistry.ts +84 -0
- package/src/Console.ts +91 -11
- package/src/Crypto.ts +78 -91
- package/src/Evolu/Db.ts +455 -947
- package/src/Evolu/Diff.ts +7 -5
- package/src/Evolu/Evolu.ts +545 -307
- package/src/Evolu/Internal.ts +0 -2
- package/src/Evolu/LocalAuth.ts +422 -0
- package/src/Evolu/Owner.ts +191 -131
- package/src/Evolu/Platform.ts +9 -9
- package/src/Evolu/Protocol.ts +536 -653
- package/src/Evolu/Public.ts +7 -9
- package/src/Evolu/PublicKysely.ts +3 -3
- package/src/Evolu/Relay.ts +17 -12
- package/src/Evolu/Schema.ts +271 -66
- package/src/Evolu/Storage.ts +263 -55
- package/src/Evolu/Sync.ts +758 -37
- package/src/Evolu/Timestamp.ts +30 -35
- package/src/ManyToManyMap.ts +127 -24
- package/src/Random.ts +3 -2
- package/src/RefCountedResourceManager.ts +368 -0
- package/src/Result.ts +149 -23
- package/src/Sqlite.ts +59 -24
- package/src/Task.ts +779 -0
- package/src/Time.ts +168 -4
- package/src/Type.ts +657 -695
- package/src/WebSocket.ts +23 -17
- package/src/Worker.ts +72 -23
- package/src/index.ts +2 -3
- package/dist/src/Callbacks.d.ts +0 -20
- package/dist/src/Callbacks.d.ts.map +0 -1
- package/dist/src/Callbacks.js +0 -18
- package/dist/src/Evolu/Config.d.ts +0 -82
- package/dist/src/Evolu/Config.d.ts.map +0 -1
- package/dist/src/Evolu/Config.js +0 -9
- package/dist/src/Evolu/Kysely.d.ts +0 -6
- package/dist/src/Evolu/Kysely.d.ts.map +0 -1
- package/dist/src/Evolu/Kysely.js +0 -21
- package/dist/src/NanoId.d.ts +0 -27
- package/dist/src/NanoId.d.ts.map +0 -1
- package/dist/src/NanoId.js +0 -6
- package/dist/src/Promise.d.ts +0 -180
- package/dist/src/Promise.d.ts.map +0 -1
- package/dist/src/Promise.js +0 -176
- package/src/Callbacks.ts +0 -43
- package/src/Evolu/Config.ts +0 -97
- package/src/Evolu/Kysely.ts +0 -38
- package/src/NanoId.ts +0 -39
- package/src/Promise.ts +0 -295
package/src/WebSocket.ts
CHANGED
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
import { assertNoErrorInCatch } from "./Assert.js";
|
|
8
8
|
import { constVoid } from "./Function.js";
|
|
9
|
-
import { retry, RetryError, RetryOptions } from "./Promise.js";
|
|
10
9
|
import { err, ok, Result } from "./Result.js";
|
|
10
|
+
import { retry, RetryError, RetryOptions } from "./Task.js";
|
|
11
|
+
import { maxPositiveInt } from "./Type.js";
|
|
11
12
|
|
|
12
13
|
/** WebSocket with auto-reconnect and offline support. */
|
|
13
14
|
export interface WebSocket extends Disposable {
|
|
@@ -20,10 +21,14 @@ export interface WebSocket extends Disposable {
|
|
|
20
21
|
) => Result<void, WebSocketSendError>;
|
|
21
22
|
|
|
22
23
|
readonly getReadyState: () => WebSocketReadyState;
|
|
24
|
+
|
|
25
|
+
/** Returns true if the WebSocket is open and ready to send data. */
|
|
26
|
+
readonly isOpen: () => boolean;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
/**
|
|
26
|
-
* An error that occurs when trying to send data but WebSocket is
|
|
30
|
+
* An error that occurs when trying to send data but WebSocket is not available
|
|
31
|
+
* or is in the CONNECTING state.
|
|
27
32
|
*
|
|
28
33
|
* https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
|
|
29
34
|
*/
|
|
@@ -141,8 +146,9 @@ export interface WebSocketConnectionCloseError {
|
|
|
141
146
|
*
|
|
142
147
|
* TODO:
|
|
143
148
|
*/
|
|
144
|
-
export const createWebSocket: CreateWebSocket = (
|
|
145
|
-
|
|
149
|
+
export const createWebSocket: CreateWebSocket = (
|
|
150
|
+
url,
|
|
151
|
+
{
|
|
146
152
|
protocols,
|
|
147
153
|
binaryType,
|
|
148
154
|
onOpen,
|
|
@@ -151,14 +157,14 @@ export const createWebSocket: CreateWebSocket = (url, options = {}) => {
|
|
|
151
157
|
onError,
|
|
152
158
|
retryOptions,
|
|
153
159
|
WebSocketConstructor = globalThis.WebSocket,
|
|
154
|
-
} =
|
|
160
|
+
} = {},
|
|
161
|
+
) => {
|
|
155
162
|
let isDisposed = false;
|
|
156
163
|
|
|
157
164
|
const reconnectController = new AbortController();
|
|
158
165
|
|
|
159
166
|
const defaultRetryOptions: RetryOptions<WebSocketRetryError> = {
|
|
160
|
-
|
|
161
|
-
maxRetries: Infinity,
|
|
167
|
+
retries: maxPositiveInt, // Practically infinite retries
|
|
162
168
|
};
|
|
163
169
|
|
|
164
170
|
let socket: globalThis.WebSocket | null = null;
|
|
@@ -187,6 +193,10 @@ export const createWebSocket: CreateWebSocket = (url, options = {}) => {
|
|
|
187
193
|
* - Is resolved when WebSocket is disposed().
|
|
188
194
|
*/
|
|
189
195
|
retry(
|
|
196
|
+
{
|
|
197
|
+
...defaultRetryOptions,
|
|
198
|
+
...retryOptions,
|
|
199
|
+
},
|
|
190
200
|
(): Promise<Result<void, WebSocketRetryError>> =>
|
|
191
201
|
new Promise((resolve) => {
|
|
192
202
|
disposePromise = () => {
|
|
@@ -227,20 +237,16 @@ export const createWebSocket: CreateWebSocket = (url, options = {}) => {
|
|
|
227
237
|
onMessage?.(event.data as string | ArrayBuffer | Blob);
|
|
228
238
|
};
|
|
229
239
|
}),
|
|
230
|
-
|
|
231
|
-
...defaultRetryOptions,
|
|
232
|
-
...retryOptions,
|
|
233
|
-
},
|
|
234
|
-
)
|
|
240
|
+
)(reconnectController)
|
|
235
241
|
.then((result) => {
|
|
236
|
-
if (result.ok || result.error.type === "
|
|
237
|
-
onError?.(result.error);
|
|
242
|
+
if (result.ok || result.error.type === "AbortError") return;
|
|
243
|
+
onError?.(result.error as WebSocketError);
|
|
238
244
|
})
|
|
239
245
|
.catch((error: unknown) => {
|
|
240
246
|
assertNoErrorInCatch("WebSocket retry", error);
|
|
241
247
|
});
|
|
242
248
|
|
|
243
|
-
|
|
249
|
+
return {
|
|
244
250
|
send: (data) => {
|
|
245
251
|
// https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
|
|
246
252
|
if (!socket || socket.readyState === socket.CONNECTING) {
|
|
@@ -253,6 +259,8 @@ export const createWebSocket: CreateWebSocket = (url, options = {}) => {
|
|
|
253
259
|
getReadyState: () =>
|
|
254
260
|
socket ? nativeToStringState[socket.readyState] : "connecting",
|
|
255
261
|
|
|
262
|
+
isOpen: () => (socket ? socket.readyState === socket.OPEN : false),
|
|
263
|
+
|
|
256
264
|
[Symbol.dispose]() {
|
|
257
265
|
if (isDisposed) return;
|
|
258
266
|
isDisposed = true;
|
|
@@ -261,8 +269,6 @@ export const createWebSocket: CreateWebSocket = (url, options = {}) => {
|
|
|
261
269
|
disposePromise?.();
|
|
262
270
|
},
|
|
263
271
|
};
|
|
264
|
-
|
|
265
|
-
return webSocket;
|
|
266
272
|
};
|
|
267
273
|
|
|
268
274
|
const nativeToStringState: Record<number, WebSocketReadyState> = {
|
package/src/Worker.ts
CHANGED
|
@@ -20,6 +20,32 @@ export interface WorkerPostMessageDep<Output> {
|
|
|
20
20
|
readonly postMessage: (message: Output) => void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Error reporting wrapper that catches synchronous errors in handlers and
|
|
25
|
+
* converts them to transferable error messages sent to the main thread.
|
|
26
|
+
*/
|
|
27
|
+
export type WithErrorReporting = <A extends Array<any>>(
|
|
28
|
+
handler: (...args: A) => void,
|
|
29
|
+
) => (...args: A) => void;
|
|
30
|
+
|
|
31
|
+
type HasInit<Input> =
|
|
32
|
+
Extract<Input, { type: "init" }> extends never
|
|
33
|
+
? ["Input must contain a variant with { type: 'init' }"]
|
|
34
|
+
: unknown;
|
|
35
|
+
|
|
36
|
+
type HasWorkerErrorOutput<T> =
|
|
37
|
+
Extract<T, { type: "onError" }> extends infer E
|
|
38
|
+
? [E] extends [never]
|
|
39
|
+
? [
|
|
40
|
+
"Output must contain { type: 'onError'; error: TransferableError | ... }",
|
|
41
|
+
]
|
|
42
|
+
: E extends { error: infer Err }
|
|
43
|
+
? TransferableError extends Err
|
|
44
|
+
? unknown
|
|
45
|
+
: ["Output.onError.error must include TransferableError"]
|
|
46
|
+
: ["Output.onError must have an error property"]
|
|
47
|
+
: never;
|
|
48
|
+
|
|
23
49
|
/**
|
|
24
50
|
* Creates a {@link Worker} that supports initialization with dependencies and
|
|
25
51
|
* safe error handling.
|
|
@@ -35,9 +61,7 @@ export const createInitializedWorker = <
|
|
|
35
61
|
readonly init: (
|
|
36
62
|
initMessage: Extract<Input, { type: "init" }>,
|
|
37
63
|
postMessage: (msg: Output) => void,
|
|
38
|
-
|
|
39
|
-
handler: (...args: A) => void,
|
|
40
|
-
) => (...args: A) => void,
|
|
64
|
+
withErrorReporting: WithErrorReporting,
|
|
41
65
|
) => Promise<Deps | null>;
|
|
42
66
|
readonly onMessage: (
|
|
43
67
|
deps: Deps,
|
|
@@ -62,7 +86,11 @@ export const createInitializedWorker = <
|
|
|
62
86
|
} as unknown as Output);
|
|
63
87
|
};
|
|
64
88
|
|
|
65
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Wraps function to catch errors and send them to the main thread instead of
|
|
91
|
+
* crashing the worker.
|
|
92
|
+
*/
|
|
93
|
+
const withErrorReporting =
|
|
66
94
|
<A extends Array<any>>(handler: (...args: A) => void) =>
|
|
67
95
|
(...args: A) => {
|
|
68
96
|
try {
|
|
@@ -78,7 +106,7 @@ export const createInitializedWorker = <
|
|
|
78
106
|
if (!deps) {
|
|
79
107
|
pendingMessages.push(message);
|
|
80
108
|
} else {
|
|
81
|
-
|
|
109
|
+
withErrorReporting(onMessage(deps))(message as NonInitMessage);
|
|
82
110
|
}
|
|
83
111
|
return;
|
|
84
112
|
}
|
|
@@ -89,13 +117,13 @@ export const createInitializedWorker = <
|
|
|
89
117
|
init(
|
|
90
118
|
message as Extract<Input, { type: "init" }>,
|
|
91
119
|
postMessage,
|
|
92
|
-
|
|
120
|
+
withErrorReporting,
|
|
93
121
|
)
|
|
94
122
|
.then((_deps) => {
|
|
95
123
|
if (_deps == null) return;
|
|
96
124
|
deps = _deps;
|
|
97
125
|
for (const message of pendingMessages) {
|
|
98
|
-
|
|
126
|
+
withErrorReporting(onMessage(deps))(message as NonInitMessage);
|
|
99
127
|
}
|
|
100
128
|
pendingMessages.length = 0;
|
|
101
129
|
})
|
|
@@ -110,20 +138,41 @@ export const createInitializedWorker = <
|
|
|
110
138
|
return worker;
|
|
111
139
|
};
|
|
112
140
|
|
|
113
|
-
type
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
:
|
|
141
|
+
/** Type helper to extract message types from a union type */
|
|
142
|
+
export type MessageHandlers<Input extends { readonly type: string }, Deps> = {
|
|
143
|
+
readonly [K in Input["type"]]: (
|
|
144
|
+
deps: Deps,
|
|
145
|
+
) => (message: Extract<Input, { type: K }>) => void;
|
|
146
|
+
};
|
|
117
147
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Creates a {@link Worker} with type-safe message handlers for each message
|
|
150
|
+
* type. This provides better type safety and organization compared to a single
|
|
151
|
+
* onMessage handler.
|
|
152
|
+
*/
|
|
153
|
+
export const createInitializedWorkerWithHandlers = <
|
|
154
|
+
Input extends { readonly type: string } & HasInit<Input>,
|
|
155
|
+
Output extends { readonly type: string } & HasWorkerErrorOutput<Output>,
|
|
156
|
+
Deps,
|
|
157
|
+
>({
|
|
158
|
+
init,
|
|
159
|
+
handlers,
|
|
160
|
+
}: {
|
|
161
|
+
readonly init: (
|
|
162
|
+
initMessage: Extract<Input, { type: "init" }>,
|
|
163
|
+
postMessage: (msg: Output) => void,
|
|
164
|
+
withErrorReporting: WithErrorReporting,
|
|
165
|
+
) => Promise<Deps | null>;
|
|
166
|
+
readonly handlers: Omit<MessageHandlers<Input, Deps>, "init">;
|
|
167
|
+
}): Worker<Input, Output> =>
|
|
168
|
+
createInitializedWorker({
|
|
169
|
+
init,
|
|
170
|
+
onMessage: (deps) => (message) => {
|
|
171
|
+
type NonInitMessageType = Exclude<Input["type"], "init">;
|
|
172
|
+
const messageType = message.type as NonInitMessageType;
|
|
173
|
+
const handler = handlers[messageType];
|
|
174
|
+
|
|
175
|
+
// TypeScript knows handler exists because handlers covers all non-init message types
|
|
176
|
+
handler(deps)(message as Extract<Input, { type: typeof messageType }>);
|
|
177
|
+
},
|
|
178
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ export * from "./Assert.js";
|
|
|
3
3
|
export * from "./BigInt.js";
|
|
4
4
|
export * from "./Brand.js";
|
|
5
5
|
export * from "./Buffer.js";
|
|
6
|
-
export * from "./
|
|
6
|
+
export * from "./CallbackRegistry.js";
|
|
7
7
|
export * from "./Console.js";
|
|
8
8
|
export * from "./Crypto.js";
|
|
9
9
|
export * from "./Eq.js";
|
|
@@ -11,17 +11,16 @@ export * from "./Error.js";
|
|
|
11
11
|
export * from "./Evolu/Public.js";
|
|
12
12
|
export * from "./Function.js";
|
|
13
13
|
export * from "./ManyToManyMap.js";
|
|
14
|
-
export * from "./NanoId.js";
|
|
15
14
|
export * from "./Number.js";
|
|
16
15
|
export * from "./Object.js";
|
|
17
16
|
export * from "./Order.js";
|
|
18
|
-
export * from "./Promise.js";
|
|
19
17
|
export * from "./Random.js";
|
|
20
18
|
export * from "./Ref.js";
|
|
21
19
|
export * from "./Result.js";
|
|
22
20
|
export * from "./Sqlite.js";
|
|
23
21
|
export * from "./Store.js";
|
|
24
22
|
export * from "./String.js";
|
|
23
|
+
export * from "./Task.js";
|
|
25
24
|
export * from "./Time.js";
|
|
26
25
|
export * from "./Type.js";
|
|
27
26
|
export * from "./Types.js";
|
package/dist/src/Callbacks.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { NanoIdLibDep } from "./NanoId.js";
|
|
2
|
-
import { Brand } from "./Brand.js";
|
|
3
|
-
/**
|
|
4
|
-
* Manages one-time callback functions.
|
|
5
|
-
*
|
|
6
|
-
* Allows registering callbacks with a unique ID and executing them once with an
|
|
7
|
-
* optional argument. Executed callbacks are automatically removed.
|
|
8
|
-
*
|
|
9
|
-
* This is useful for managing event-driven or asynchronous workflows where
|
|
10
|
-
* callbacks need to be invoked only once.
|
|
11
|
-
*/
|
|
12
|
-
export interface Callbacks {
|
|
13
|
-
/** Registers a callback function and returns a unique ID. */
|
|
14
|
-
readonly register: (callback: (arg?: unknown) => void) => CallbackId;
|
|
15
|
-
/** Executes and removes a callback associated with the given ID. */
|
|
16
|
-
readonly execute: (id: CallbackId, arg?: unknown) => void;
|
|
17
|
-
}
|
|
18
|
-
export type CallbackId = string & Brand<"CallbackId">;
|
|
19
|
-
export declare const createCallbacks: (deps: NanoIdLibDep) => Callbacks;
|
|
20
|
-
//# sourceMappingURL=Callbacks.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Callbacks.d.ts","sourceRoot":"","sources":["../../src/Callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,6DAA6D;IAC7D,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,KAAK,UAAU,CAAC;IAErE,oEAAoE;IACpE,QAAQ,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,CAAC;AAEtD,eAAO,MAAM,eAAe,GAAI,MAAM,YAAY,KAAG,SAoBpD,CAAC"}
|
package/dist/src/Callbacks.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const createCallbacks = (deps) => {
|
|
2
|
-
const callbackMap = new Map();
|
|
3
|
-
const callbacks = {
|
|
4
|
-
register: (callback) => {
|
|
5
|
-
const id = deps.nanoIdLib.nanoid();
|
|
6
|
-
callbackMap.set(id, callback);
|
|
7
|
-
return id;
|
|
8
|
-
},
|
|
9
|
-
execute: (id, arg) => {
|
|
10
|
-
const callback = callbackMap.get(id);
|
|
11
|
-
if (callback) {
|
|
12
|
-
callbackMap.delete(id);
|
|
13
|
-
callback(arg);
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
return callbacks;
|
|
18
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ConsoleConfig } from "../Console.js";
|
|
2
|
-
import { SimpleName } from "../Type.js";
|
|
3
|
-
import type { DbIndexesBuilder } from "./Kysely.js";
|
|
4
|
-
import type { AppOwner } from "./Owner.js";
|
|
5
|
-
export interface Config extends ConsoleConfig {
|
|
6
|
-
/**
|
|
7
|
-
* The name of the Evolu instance. Evolu is multitenant - it can run multiple
|
|
8
|
-
* instances concurrently. Each instance must have a unique name.
|
|
9
|
-
*
|
|
10
|
-
* The instance name is used as the SQLite database filename for persistent
|
|
11
|
-
* storage, ensuring that database files are separated and invisible to each
|
|
12
|
-
* other.
|
|
13
|
-
*
|
|
14
|
-
* The default value is: `Evolu`.
|
|
15
|
-
*
|
|
16
|
-
* ### Example
|
|
17
|
-
*
|
|
18
|
-
* ```ts
|
|
19
|
-
* // name: getOrThrow(SimpleName.from("MyApp"))
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
readonly name: SimpleName;
|
|
23
|
-
/**
|
|
24
|
-
* URL for Evolu sync and backup server.
|
|
25
|
-
*
|
|
26
|
-
* The default value is `wss://free.evoluhq.com`.
|
|
27
|
-
*/
|
|
28
|
-
readonly syncUrl: string;
|
|
29
|
-
/**
|
|
30
|
-
* URL to reload browser tabs after reset or restore.
|
|
31
|
-
*
|
|
32
|
-
* The default value is `/`.
|
|
33
|
-
*/
|
|
34
|
-
readonly reloadUrl: string;
|
|
35
|
-
/**
|
|
36
|
-
* Maximum physical clock drift allowed in ms.
|
|
37
|
-
*
|
|
38
|
-
* The default value is 5 * 60 * 1000 (5 minutes).
|
|
39
|
-
*/
|
|
40
|
-
readonly maxDrift: number;
|
|
41
|
-
/**
|
|
42
|
-
* Use the `indexes` option to define SQLite indexes.
|
|
43
|
-
*
|
|
44
|
-
* Table and column names are not typed because Kysely doesn't support it.
|
|
45
|
-
*
|
|
46
|
-
* https://medium.com/@JasonWyatt/squeezing-performance-from-sqlite-indexes-indexes-c4e175f3c346
|
|
47
|
-
*
|
|
48
|
-
* ### Example
|
|
49
|
-
*
|
|
50
|
-
* ```ts
|
|
51
|
-
* const evolu = createEvolu(evoluReactDeps)(Schema, {
|
|
52
|
-
* indexes: (create) => [
|
|
53
|
-
* create("todoCreatedAt").on("todo").column("createdAt"),
|
|
54
|
-
* create("todoCategoryCreatedAt")
|
|
55
|
-
* .on("todoCategory")
|
|
56
|
-
* .column("createdAt"),
|
|
57
|
-
* ],
|
|
58
|
-
* });
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
readonly indexes?: DbIndexesBuilder;
|
|
62
|
-
/**
|
|
63
|
-
* Initial AppOwner to use when creating Evolu instance. If omitted, a new
|
|
64
|
-
* AppOwner will be generated automatically.
|
|
65
|
-
*/
|
|
66
|
-
readonly initialAppOwner?: AppOwner;
|
|
67
|
-
/**
|
|
68
|
-
* Use in-memory SQLite database instead of persistent storage. Useful for
|
|
69
|
-
* testing or temporary data that doesn't need persistence.
|
|
70
|
-
*
|
|
71
|
-
* In-memory databases exist only in RAM and are completely destroyed when the
|
|
72
|
-
* process ends, making them forensically safe for sensitive data.
|
|
73
|
-
*
|
|
74
|
-
* The default value is: `false`.
|
|
75
|
-
*/
|
|
76
|
-
readonly inMemory?: boolean;
|
|
77
|
-
}
|
|
78
|
-
export interface ConfigDep {
|
|
79
|
-
readonly config: Config;
|
|
80
|
-
}
|
|
81
|
-
export declare const defaultConfig: Config;
|
|
82
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../../src/Evolu/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,MAAM,WAAW,MAAO,SAAQ,aAAa;IAC3C;;;;;;;;;;;;;;;OAeG;IACH,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAE1B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,QAAQ,CAAC;IAEpC;;;;;;;;OAQG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,aAAa,EAAE,MAM3B,CAAC"}
|
package/dist/src/Evolu/Config.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { getOrThrow } from "../Result.js";
|
|
2
|
-
import { SimpleName } from "../Type.js";
|
|
3
|
-
export const defaultConfig = {
|
|
4
|
-
name: getOrThrow(SimpleName.fromParent("Evolu")),
|
|
5
|
-
syncUrl: "wss://free.evoluhq.com",
|
|
6
|
-
reloadUrl: "/",
|
|
7
|
-
maxDrift: 5 * 60 * 1000,
|
|
8
|
-
enableLogging: false,
|
|
9
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CreateIndexBuilder, Kysely } from "kysely";
|
|
2
|
-
import { DbIndex } from "./Db.js";
|
|
3
|
-
export declare const kysely: Kysely<unknown>;
|
|
4
|
-
export type DbIndexesBuilder = (create: (indexName: string) => CreateIndexBuilder) => ReadonlyArray<CreateIndexBuilder<any>>;
|
|
5
|
-
export declare const createIndexes: (indexes?: DbIndexesBuilder) => ReadonlyArray<DbIndex>;
|
|
6
|
-
//# sourceMappingURL=Kysely.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Kysely.d.ts","sourceRoot":"","sources":["../../../src/Evolu/Kysely.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAElB,MAAM,EAGP,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC,eAAO,MAAM,MAAM,iBASjB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAC7B,MAAM,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,kBAAkB,KAC9C,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC;AAI5C,eAAO,MAAM,aAAa,GACxB,UAAU,gBAAgB,KACzB,aAAa,CAAC,OAAO,CAQvB,CAAC"}
|
package/dist/src/Evolu/Kysely.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { DummyDriver, Kysely, SqliteAdapter, SqliteQueryCompiler, } from "kysely";
|
|
2
|
-
// https://kysely.dev/docs/recipes/splitting-query-building-and-execution
|
|
3
|
-
export const kysely = new Kysely({
|
|
4
|
-
dialect: {
|
|
5
|
-
createAdapter: () => new SqliteAdapter(),
|
|
6
|
-
createDriver: () => new DummyDriver(),
|
|
7
|
-
createIntrospector() {
|
|
8
|
-
throw new Error("Not implemeneted");
|
|
9
|
-
},
|
|
10
|
-
createQueryCompiler: () => new SqliteQueryCompiler(),
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
const createIndex = kysely.schema.createIndex.bind(kysely.schema);
|
|
14
|
-
export const createIndexes = (indexes) => {
|
|
15
|
-
if (!indexes)
|
|
16
|
-
return [];
|
|
17
|
-
return indexes(createIndex).map((index) => ({
|
|
18
|
-
name: index.toOperationNode().name.name,
|
|
19
|
-
sql: index.compile().sql,
|
|
20
|
-
}));
|
|
21
|
-
};
|
package/dist/src/NanoId.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Interface representing a NanoId library.
|
|
3
|
-
*
|
|
4
|
-
* It's useful for testing by allowing ID generation to be mocked, ensuring
|
|
5
|
-
* consistent results.
|
|
6
|
-
*
|
|
7
|
-
* @see https://github.com/ai/nanoid
|
|
8
|
-
*
|
|
9
|
-
* ### Example
|
|
10
|
-
*
|
|
11
|
-
* ```ts
|
|
12
|
-
* const foo = createFoo({
|
|
13
|
-
* ...createNanoIdLib(),
|
|
14
|
-
* ...createTime(),
|
|
15
|
-
* });
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
export interface NanoIdLib {
|
|
19
|
-
readonly urlAlphabet: string;
|
|
20
|
-
readonly customAlphabet: (alphabet: string, defaultSize?: number) => (size?: number) => string;
|
|
21
|
-
readonly nanoid: (size?: number) => string;
|
|
22
|
-
}
|
|
23
|
-
export interface NanoIdLibDep {
|
|
24
|
-
readonly nanoIdLib: NanoIdLib;
|
|
25
|
-
}
|
|
26
|
-
export declare const createNanoIdLib: () => NanoIdLib;
|
|
27
|
-
//# sourceMappingURL=NanoId.d.ts.map
|
package/dist/src/NanoId.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NanoId.d.ts","sourceRoot":"","sources":["../../src/NanoId.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,QAAQ,CAAC,cAAc,EAAE,CACvB,QAAQ,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,MAAM,KACjB,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAE/B,QAAQ,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;CAC/B;AAED,eAAO,MAAM,eAAe,QAAO,SAIjC,CAAC"}
|
package/dist/src/NanoId.js
DELETED
package/dist/src/Promise.d.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { Result } from "./Result.js";
|
|
2
|
-
import { Predicate } from "./Types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Helper function to delay execution for a specified number of milliseconds.
|
|
5
|
-
*
|
|
6
|
-
* ### Example
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* await wait(10);
|
|
10
|
-
* ```
|
|
11
|
-
*/
|
|
12
|
-
export declare const wait: (ms: number) => Promise<Result<void, never>>;
|
|
13
|
-
/** Options for configuring retry behavior. */
|
|
14
|
-
export interface RetryOptions<E> {
|
|
15
|
-
/**
|
|
16
|
-
* Maximum number of retry attempts after the initial attempt (default: 3).
|
|
17
|
-
* For example, with maxRetries = 3, the function will be called up to 4 times
|
|
18
|
-
* (1 initial attempt + 3 retries).
|
|
19
|
-
*/
|
|
20
|
-
maxRetries?: number;
|
|
21
|
-
/**
|
|
22
|
-
* Initial delay between retry attempts in milliseconds (default: 100). This
|
|
23
|
-
* is the delay after the first failed attempt. Subsequent delays increase
|
|
24
|
-
* exponentially according to the factor option.
|
|
25
|
-
*/
|
|
26
|
-
initialDelay?: number;
|
|
27
|
-
/**
|
|
28
|
-
* Maximum delay between retry attempts in milliseconds (default: 10000). This
|
|
29
|
-
* caps the exponential backoff to prevent extremely long delays after many
|
|
30
|
-
* retries.
|
|
31
|
-
*/
|
|
32
|
-
maxDelay?: number;
|
|
33
|
-
/**
|
|
34
|
-
* Multiplier that determines how quickly the delay increases (default: 2).
|
|
35
|
-
* With the default value, each successive delay is twice as long as the
|
|
36
|
-
* previous one (e.g., 100ms, 200ms, 400ms, 800ms, etc).
|
|
37
|
-
*/
|
|
38
|
-
factor?: number;
|
|
39
|
-
/**
|
|
40
|
-
* Random jitter factor between 0 and 1 (default: 0.1). Adds randomness to
|
|
41
|
-
* delay times to prevent retry storms in distributed systems.
|
|
42
|
-
*/
|
|
43
|
-
jitter?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Optional AbortSignal to cancel retries. If the signal is aborted, the retry
|
|
46
|
-
* operation stops and returns a RetryAbortError.
|
|
47
|
-
*/
|
|
48
|
-
signal?: AbortSignal;
|
|
49
|
-
/**
|
|
50
|
-
* Optional predicate to determine if an error should be retried. Returns true
|
|
51
|
-
* if the error is retryable, false otherwise. This allows selectively
|
|
52
|
-
* retrying only certain types of errors. By default, all errors are
|
|
53
|
-
* considered retryable.
|
|
54
|
-
*/
|
|
55
|
-
retryable?: Predicate<E>;
|
|
56
|
-
/**
|
|
57
|
-
* Optional callback called before each retry attempt. Receives the error that
|
|
58
|
-
* caused the retry, the current attempt number (starting at 1), and the delay
|
|
59
|
-
* in milliseconds before the next attempt.
|
|
60
|
-
*/
|
|
61
|
-
onRetry?: (error: E, attempt: number, delay: number) => void;
|
|
62
|
-
}
|
|
63
|
-
/** Error representing a retry operation that failed after multiple attempts. */
|
|
64
|
-
export interface RetryError<E> {
|
|
65
|
-
readonly type: "RetryError";
|
|
66
|
-
/** The original error that caused the retry to fail */
|
|
67
|
-
readonly cause: E;
|
|
68
|
-
/** Number of retry attempts made */
|
|
69
|
-
readonly attempts: number;
|
|
70
|
-
}
|
|
71
|
-
/** Error representing a retry operation that was aborted. */
|
|
72
|
-
export interface RetryAbortError {
|
|
73
|
-
readonly type: "RetryAbortError";
|
|
74
|
-
readonly abortedBeforeExecution: boolean;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Executes a function with retry logic using exponential backoff and jitter.
|
|
78
|
-
*
|
|
79
|
-
* ### Example with Result-based API
|
|
80
|
-
*
|
|
81
|
-
* ```ts
|
|
82
|
-
* interface ApiError {
|
|
83
|
-
* type: "ApiError";
|
|
84
|
-
* statusCode: number;
|
|
85
|
-
* }
|
|
86
|
-
*
|
|
87
|
-
* const fetchData = async (
|
|
88
|
-
* url: string,
|
|
89
|
-
* ): Promise<Result<Data, ApiError>> => {
|
|
90
|
-
* // Implementation that returns Result
|
|
91
|
-
* };
|
|
92
|
-
*
|
|
93
|
-
* const result = await retry(
|
|
94
|
-
* async () => fetchData("https://api.example.com/data"),
|
|
95
|
-
* {
|
|
96
|
-
* maxRetries: 5,
|
|
97
|
-
* initialDelay: 200,
|
|
98
|
-
* // Only retry on specific status codes
|
|
99
|
-
* retryable: (error) =>
|
|
100
|
-
* error.type === "ApiError" && [429, 503].includes(error.statusCode),
|
|
101
|
-
* },
|
|
102
|
-
* );
|
|
103
|
-
*
|
|
104
|
-
* if (!result.ok) {
|
|
105
|
-
* if (result.error.type === "RetryAbortError") {
|
|
106
|
-
* console.log("Operation was aborted");
|
|
107
|
-
* } else {
|
|
108
|
-
* console.log(`Failed after ${result.error.attempts} attempts`);
|
|
109
|
-
* }
|
|
110
|
-
* return;
|
|
111
|
-
* }
|
|
112
|
-
*
|
|
113
|
-
* // Use result.value
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* ### Example with tryAsync for exception-based API
|
|
117
|
-
*
|
|
118
|
-
* ```ts
|
|
119
|
-
* interface FetchError {
|
|
120
|
-
* type: "FetchError";
|
|
121
|
-
* message: string;
|
|
122
|
-
* }
|
|
123
|
-
*
|
|
124
|
-
* const controller = new AbortController();
|
|
125
|
-
*
|
|
126
|
-
* const result = await retry(
|
|
127
|
-
* async () =>
|
|
128
|
-
* tryAsync(
|
|
129
|
-
* async () => {
|
|
130
|
-
* const response = await fetch("https://api.example.com/data", {
|
|
131
|
-
* signal: controller.signal,
|
|
132
|
-
* });
|
|
133
|
-
*
|
|
134
|
-
* if (!response.ok) {
|
|
135
|
-
* throw new Error(`HTTP error ${response.status}`);
|
|
136
|
-
* }
|
|
137
|
-
*
|
|
138
|
-
* return await response.json();
|
|
139
|
-
* },
|
|
140
|
-
* (error): FetchError => ({
|
|
141
|
-
* type: "FetchError",
|
|
142
|
-
* message: String(error),
|
|
143
|
-
* }),
|
|
144
|
-
* ),
|
|
145
|
-
* {
|
|
146
|
-
* maxRetries: 3,
|
|
147
|
-
* signal: controller.signal,
|
|
148
|
-
* },
|
|
149
|
-
* );
|
|
150
|
-
* ```
|
|
151
|
-
*
|
|
152
|
-
* ## HTTP Request Recommendations
|
|
153
|
-
*
|
|
154
|
-
* For HTTP requests, configure the `retryable` option to only retry on
|
|
155
|
-
* appropriate errors:
|
|
156
|
-
*
|
|
157
|
-
* - **DO retry**: 429 (Too Many Requests), 503 (Service Unavailable), network
|
|
158
|
-
* errors
|
|
159
|
-
* - **DON'T retry**: 4xx client errors (except 429), most 5xx server errors
|
|
160
|
-
*/
|
|
161
|
-
export declare const retry: <T, E>(fn: () => Promise<Result<T, E>>, options?: RetryOptions<E>) => Promise<Result<T, RetryError<E> | RetryAbortError>>;
|
|
162
|
-
export interface TimeoutError {
|
|
163
|
-
readonly type: "TimeoutError";
|
|
164
|
-
readonly timeoutMs: number;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Wraps an async function with a timeout, returning {@link Result} that fails
|
|
168
|
-
* with {@link TimeoutError} if the timeout is exceeded. The provided function
|
|
169
|
-
* must accept an AbortSignal and return a Result.
|
|
170
|
-
*
|
|
171
|
-
* ### Example
|
|
172
|
-
*
|
|
173
|
-
* ```ts
|
|
174
|
-
* const fetchWithTimeout = () =>
|
|
175
|
-
* withTimeout((signal) => fetch("url", signal), 5000);
|
|
176
|
-
* const result = await retry(fetchWithTimeout, { maxRetries: 3 });
|
|
177
|
-
* ```
|
|
178
|
-
*/
|
|
179
|
-
export declare const withTimeout: <T, E>(fn: (signal: AbortSignal) => Promise<Result<T, E>>, timeoutMs: number) => Promise<Result<T, E | TimeoutError>>;
|
|
180
|
-
//# sourceMappingURL=Promise.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Promise.d.ts","sourceRoot":"","sources":["../../src/Promise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAW,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,GAAI,IAAI,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAK1D,CAAC;AAEJ,8CAA8C;AAC9C,MAAM,WAAW,YAAY,CAAC,CAAC;IAC7B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAEzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9D;AAED,gFAAgF;AAChF,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,uDAAuD;IACvD,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAClB,oCAAoC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IACjC,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;CAC1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoFG;AACH,eAAO,MAAM,KAAK,GAAU,CAAC,EAAE,CAAC,EAC9B,IAAI,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC/B,UAAS,YAAY,CAAC,CAAC,CAAM,KAC5B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CA2EpD,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,WAAW,GAAU,CAAC,EAAE,CAAC,EACpC,IAAI,CAAC,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAClD,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,CAerC,CAAC"}
|