@evolu/common 8.0.0-next.4 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/Array.d.ts +279 -173
- package/dist/src/Array.d.ts.map +1 -1
- package/dist/src/Array.js +105 -101
- package/dist/src/Assert.d.ts +44 -44
- package/dist/src/Assert.d.ts.map +1 -1
- package/dist/src/Assert.js +44 -32
- package/dist/src/BigInt.d.ts +6 -3
- package/dist/src/BigInt.d.ts.map +1 -1
- package/dist/src/BigInt.js +5 -2
- package/dist/src/Brand.d.ts +27 -40
- package/dist/src/Brand.d.ts.map +1 -1
- package/dist/src/Buffer.d.ts +27 -11
- package/dist/src/Buffer.d.ts.map +1 -1
- package/dist/src/Cache.d.ts +9 -4
- package/dist/src/Cache.d.ts.map +1 -1
- package/dist/src/Cache.js +8 -3
- package/dist/src/Callbacks.d.ts +30 -19
- package/dist/src/Callbacks.d.ts.map +1 -1
- package/dist/src/Console.d.ts +145 -66
- package/dist/src/Console.d.ts.map +1 -1
- package/dist/src/Console.js +91 -43
- package/dist/src/Crypto.d.ts +85 -42
- package/dist/src/Crypto.d.ts.map +1 -1
- package/dist/src/Crypto.js +44 -20
- package/dist/src/Eq.d.ts +87 -21
- package/dist/src/Eq.d.ts.map +1 -1
- package/dist/src/Eq.js +67 -19
- package/dist/src/Error.d.ts +5 -3
- package/dist/src/Error.d.ts.map +1 -1
- package/dist/src/Error.js +16 -0
- package/dist/src/Function.d.ts +119 -58
- package/dist/src/Function.d.ts.map +1 -1
- package/dist/src/Function.js +86 -43
- package/dist/src/Http.d.ts +394 -0
- package/dist/src/Http.d.ts.map +1 -0
- package/dist/src/Http.js +102 -0
- package/dist/src/Identicon.d.ts +16 -7
- package/dist/src/Identicon.d.ts.map +1 -1
- package/dist/src/Identicon.js +14 -5
- package/dist/src/LeakDetector.d.ts +88 -0
- package/dist/src/LeakDetector.d.ts.map +1 -0
- package/dist/src/LeakDetector.js +86 -0
- package/dist/src/LockManager.d.ts +18 -9
- package/dist/src/LockManager.d.ts.map +1 -1
- package/dist/src/LockManager.js +7 -8
- package/dist/src/Lookup.d.ts +43 -13
- package/dist/src/Lookup.d.ts.map +1 -1
- package/dist/src/Lookup.js +28 -8
- package/dist/src/Microtask.d.ts +1 -1
- package/dist/src/Microtask.d.ts.map +1 -1
- package/dist/src/Microtask.js +3 -7
- package/dist/src/Number.d.ts +49 -13
- package/dist/src/Number.d.ts.map +1 -1
- package/dist/src/Number.js +34 -5
- package/dist/src/Object.d.ts +160 -40
- package/dist/src/Object.d.ts.map +1 -1
- package/dist/src/Object.js +92 -46
- package/dist/src/Option.d.ts +10 -7
- package/dist/src/Option.d.ts.map +1 -1
- package/dist/src/Option.js +9 -6
- package/dist/src/Order.d.ts +21 -21
- package/dist/src/Order.d.ts.map +1 -1
- package/dist/src/Order.js +18 -21
- package/dist/src/Platform.d.ts +31 -0
- package/dist/src/Platform.d.ts.map +1 -1
- package/dist/src/Platform.js +98 -0
- package/dist/src/Random.d.ts +32 -17
- package/dist/src/Random.d.ts.map +1 -1
- package/dist/src/Random.js +12 -8
- package/dist/src/Redacted.d.ts +43 -29
- package/dist/src/Redacted.d.ts.map +1 -1
- package/dist/src/Redacted.js +14 -3
- package/dist/src/Ref.d.ts +11 -3
- package/dist/src/Ref.d.ts.map +1 -1
- package/dist/src/Ref.js +2 -2
- package/dist/src/RefCount.d.ts +2 -6
- package/dist/src/RefCount.d.ts.map +1 -1
- package/dist/src/RefCount.js +33 -90
- package/dist/src/Relation.d.ts +70 -5
- package/dist/src/Relation.d.ts.map +1 -1
- package/dist/src/Relation.js +77 -2
- package/dist/src/Resource.d.ts +590 -155
- package/dist/src/Resource.d.ts.map +1 -1
- package/dist/src/Resource.js +592 -343
- package/dist/src/Result.d.ts +838 -191
- package/dist/src/Result.d.ts.map +1 -1
- package/dist/src/Result.js +163 -102
- package/dist/src/Schedule.d.ts +684 -231
- package/dist/src/Schedule.d.ts.map +1 -1
- package/dist/src/Schedule.js +766 -295
- package/dist/src/Set.d.ts +89 -40
- package/dist/src/Set.d.ts.map +1 -1
- package/dist/src/Set.js +50 -29
- package/dist/src/Sqlite.d.ts +29 -72
- package/dist/src/Sqlite.d.ts.map +1 -1
- package/dist/src/Sqlite.js +41 -46
- package/dist/src/StackTrace.d.ts +40 -0
- package/dist/src/StackTrace.d.ts.map +1 -0
- package/dist/src/StackTrace.js +140 -0
- package/dist/src/Store.d.ts +5 -4
- package/dist/src/Store.d.ts.map +1 -1
- package/dist/src/Store.js +5 -4
- package/dist/src/String.d.ts +7 -1
- package/dist/src/String.d.ts.map +1 -1
- package/dist/src/String.js +20 -7
- package/dist/src/Task.d.ts +3572 -1770
- package/dist/src/Task.d.ts.map +1 -1
- package/dist/src/Task.js +1879 -1274
- package/dist/src/Test.d.ts +17 -125
- package/dist/src/Test.d.ts.map +1 -1
- package/dist/src/Test.js +17 -68
- package/dist/src/Time.d.ts +108 -49
- package/dist/src/Time.d.ts.map +1 -1
- package/dist/src/Time.js +172 -73
- package/dist/src/Type.d.ts +3542 -1926
- package/dist/src/Type.d.ts.map +1 -1
- package/dist/src/Type.js +3070 -1784
- package/dist/src/Types.d.ts +200 -108
- package/dist/src/Types.d.ts.map +1 -1
- package/dist/src/Types.js +39 -8
- package/dist/src/WebSocket.d.ts +48 -23
- package/dist/src/WebSocket.d.ts.map +1 -1
- package/dist/src/WebSocket.js +15 -6
- package/dist/src/Worker.d.ts +94 -36
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +58 -24
- package/dist/src/index.d.ts +55 -52
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -1
- package/dist/src/intl/cs.d.ts +94 -0
- package/dist/src/intl/cs.d.ts.map +1 -0
- package/dist/src/intl/cs.js +220 -0
- package/dist/src/intl/index.d.ts +7 -0
- package/dist/src/intl/index.d.ts.map +1 -0
- package/dist/src/intl/index.js +6 -0
- package/dist/src/local-first/Db.d.ts +12 -8
- package/dist/src/local-first/Db.d.ts.map +1 -1
- package/dist/src/local-first/Db.js +109 -132
- package/dist/src/local-first/Error.d.ts +4 -4
- package/dist/src/local-first/Evolu.d.ts +338 -92
- package/dist/src/local-first/Evolu.d.ts.map +1 -1
- package/dist/src/local-first/Evolu.js +47 -55
- package/dist/src/local-first/LocalAuth.d.ts +4 -4
- package/dist/src/local-first/LocalAuth.d.ts.map +1 -1
- package/dist/src/local-first/Owner.d.ts +61 -24
- package/dist/src/local-first/Owner.d.ts.map +1 -1
- package/dist/src/local-first/Owner.js +45 -8
- package/dist/src/local-first/Protocol.d.ts +44 -31
- package/dist/src/local-first/Protocol.d.ts.map +1 -1
- package/dist/src/local-first/Protocol.js +36 -13
- package/dist/src/local-first/Query.d.ts +147 -62
- package/dist/src/local-first/Query.d.ts.map +1 -1
- package/dist/src/local-first/Query.js +112 -58
- package/dist/src/local-first/Relay.d.ts +44 -14
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Schema.d.ts +92 -41
- package/dist/src/local-first/Schema.d.ts.map +1 -1
- package/dist/src/local-first/Schema.js +25 -8
- package/dist/src/local-first/Shared.d.ts +23 -21
- package/dist/src/local-first/Shared.d.ts.map +1 -1
- package/dist/src/local-first/Shared.js +100 -57
- package/dist/src/local-first/Storage.d.ts +53 -32
- package/dist/src/local-first/Storage.d.ts.map +1 -1
- package/dist/src/local-first/Storage.js +194 -234
- package/dist/src/local-first/Timestamp.d.ts +21 -21
- package/dist/src/local-first/Timestamp.d.ts.map +1 -1
- package/dist/src/local-first/Timestamp.js +2 -2
- package/dist/src/local-first/index.d.ts +11 -11
- package/package.json +14 -13
- package/src/Array.ts +306 -205
- package/src/Assert.ts +54 -69
- package/src/BigInt.ts +6 -3
- package/src/Brand.ts +27 -40
- package/src/Buffer.ts +28 -12
- package/src/Cache.ts +9 -4
- package/src/Callbacks.ts +30 -19
- package/src/Console.ts +156 -84
- package/src/Crypto.ts +83 -41
- package/src/Eq.ts +95 -22
- package/src/Error.ts +8 -4
- package/src/Function.ts +167 -59
- package/src/Http.ts +549 -0
- package/src/Identicon.ts +16 -7
- package/src/LeakDetector.ts +182 -0
- package/src/LockManager.ts +43 -39
- package/src/Lookup.ts +62 -28
- package/src/Microtask.ts +19 -23
- package/src/Number.ts +64 -12
- package/src/Object.ts +173 -49
- package/src/Option.ts +10 -7
- package/src/Order.ts +23 -21
- package/src/Platform.ts +136 -0
- package/src/Polyfills.ts +6 -12
- package/src/Random.ts +32 -19
- package/src/Redacted.ts +44 -30
- package/src/Ref.ts +14 -6
- package/src/RefCount.ts +38 -80
- package/src/Relation.ts +202 -10
- package/src/Resource.ts +1199 -591
- package/src/Result.ts +930 -271
- package/src/Schedule.ts +859 -343
- package/src/Set.ts +89 -40
- package/src/Sqlite.ts +144 -138
- package/src/StackTrace.ts +230 -0
- package/src/Store.ts +8 -7
- package/src/String.ts +22 -5
- package/src/Task.ts +5101 -2832
- package/src/Test.ts +20 -168
- package/src/Time.ts +293 -90
- package/src/Type.ts +10034 -4117
- package/src/Types.ts +227 -110
- package/src/WebSocket.ts +64 -36
- package/src/Worker.ts +180 -72
- package/src/index.ts +55 -52
- package/src/intl/cs.ts +388 -0
- package/src/intl/index.ts +7 -0
- package/src/local-first/Db.ts +152 -179
- package/src/local-first/Error.ts +4 -4
- package/src/local-first/Evolu.ts +495 -250
- package/src/local-first/LocalAuth.ts +6 -12
- package/src/local-first/Owner.ts +58 -21
- package/src/local-first/Protocol.ts +49 -31
- package/src/local-first/Query.ts +146 -61
- package/src/local-first/Relay.ts +51 -21
- package/src/local-first/Schema.ts +109 -51
- package/src/local-first/Shared.ts +266 -226
- package/src/local-first/Storage.ts +266 -264
- package/src/local-first/Timestamp.ts +25 -18
- package/src/local-first/index.ts +11 -11
- package/dist/src/Skiplist.d.ts +0 -28
- package/dist/src/Skiplist.d.ts.map +0 -1
- package/dist/src/Skiplist.js +0 -64
- package/dist/src/Tracer.d.ts +0 -48
- package/dist/src/Tracer.d.ts.map +0 -1
- package/dist/src/Tracer.js +0 -6
- package/src/Skiplist.ts +0 -108
- package/src/Tracer.ts +0 -54
|
@@ -3,21 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { type NonEmptyReadonlyArray } from "../Array.
|
|
7
|
-
import type { ConsoleDep } from "../Console.
|
|
8
|
-
import { type LockManagerDep } from "../LockManager.
|
|
9
|
-
import type { FlushSyncDep, ReloadAppDep } from "../Platform.
|
|
10
|
-
import type { Listener, ReadonlyStore, Unsubscribe } from "../Store.
|
|
11
|
-
import {
|
|
12
|
-
import type
|
|
13
|
-
import {
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
20
|
-
import type { SharedWorkerDep } from "./Shared.js";
|
|
6
|
+
import { type NonEmptyReadonlyArray } from "../Array.ts";
|
|
7
|
+
import type { ConsoleDep } from "../Console.ts";
|
|
8
|
+
import { type LockManagerDep } from "../LockManager.ts";
|
|
9
|
+
import type { FlushSyncDep, ReloadAppDep } from "../Platform.ts";
|
|
10
|
+
import type { Listener, ReadonlyStore, Unsubscribe } from "../Store.ts";
|
|
11
|
+
import type { Task } from "../Task.ts";
|
|
12
|
+
import { Name, type TypeError, UrlSafeString } from "../Type.ts";
|
|
13
|
+
import type { CreateBroadcastChannelDep, CreateMessageChannelDep } from "../Worker.ts";
|
|
14
|
+
import type { CreateDbWorkerDep } from "./Db.ts";
|
|
15
|
+
import type { EvoluError } from "./Error.ts";
|
|
16
|
+
import type { AppOwner, Owner, OwnerTransport, ReadonlyOwner } from "./Owner.ts";
|
|
17
|
+
import type { Queries, QueriesToQueryRowsPromises, Query, QueryRows, Row } from "./Query.ts";
|
|
18
|
+
import type { EvoluSchema, IndexesConfig, Mutation, ValidateSchema } from "./Schema.ts";
|
|
19
|
+
import type { SharedWorkerDep } from "./Shared.ts";
|
|
21
20
|
export interface EvoluConfig {
|
|
22
21
|
/**
|
|
23
22
|
* The app name. Evolu is multitenant - it can run multiple instances
|
|
@@ -33,27 +32,30 @@ export interface EvoluConfig {
|
|
|
33
32
|
* ### Example
|
|
34
33
|
*
|
|
35
34
|
* ```ts
|
|
36
|
-
*
|
|
35
|
+
* import { AppName } from "@evolu/common";
|
|
36
|
+
*
|
|
37
|
+
* const appName = AppName.orThrow("MyApp");
|
|
38
|
+
* expect(appName).toBe("MyApp");
|
|
37
39
|
* ```
|
|
38
40
|
*/
|
|
39
41
|
readonly appName: AppName;
|
|
40
42
|
/**
|
|
41
43
|
* {@link AppOwner} used to create this {@link Evolu} instance.
|
|
42
44
|
*
|
|
43
|
-
* Exposed as {@link Evolu.appOwner}.
|
|
44
|
-
*
|
|
45
|
+
* Exposed as {@link Evolu.appOwner}. Create an AppOwner before the first run,
|
|
46
|
+
* or restore one from secure storage before creating Evolu.
|
|
45
47
|
*
|
|
46
48
|
* AppOwner controls access to the encrypted local SQLite database. If its
|
|
47
49
|
* secret material (Owner secret / Mnemonic) is not stored safely, data
|
|
48
50
|
* written by that instance is permanently inaccessible.
|
|
49
51
|
*
|
|
50
|
-
* Best onboarding UX is accountless first use:
|
|
51
|
-
* app, then prompt backup of `evolu.appOwner`.
|
|
52
|
+
* Best onboarding UX is accountless first use: create an AppOwner, let users
|
|
53
|
+
* try a ready-to-use app, then prompt backup of `evolu.appOwner`.
|
|
52
54
|
*
|
|
53
55
|
* Recommended usage:
|
|
54
56
|
*
|
|
55
|
-
* -
|
|
56
|
-
*
|
|
57
|
+
* - Create and persist an `appOwner` for first run, then guide the user to back
|
|
58
|
+
* it up after user activity.
|
|
57
59
|
* - Pass `appOwner` restored from secure storage (for example, Expo
|
|
58
60
|
* SecureStore, WebAuthn-backed storage, or app-managed account recovery
|
|
59
61
|
* flow).
|
|
@@ -89,33 +91,51 @@ export interface EvoluConfig {
|
|
|
89
91
|
*
|
|
90
92
|
* The default value is:
|
|
91
93
|
*
|
|
92
|
-
* `{ type: "WebSocket", url: "wss://free.evoluhq.com" }`.
|
|
94
|
+
* `[{ type: "WebSocket", url: "wss://free.evoluhq.com" }]`.
|
|
93
95
|
*
|
|
94
96
|
* ### Example
|
|
95
97
|
*
|
|
96
98
|
* ```ts
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
+
* import {
|
|
100
|
+
* createAppOwner,
|
|
101
|
+
* createOwnerWebSocketTransport,
|
|
102
|
+
* createOwnerSecret,
|
|
103
|
+
* createRandomBytes,
|
|
104
|
+
* type OwnerTransport,
|
|
105
|
+
* } from "@evolu/common";
|
|
106
|
+
*
|
|
107
|
+
* // Create once, persist the mnemonic securely, and restore it on later runs.
|
|
108
|
+
* const appOwner = createAppOwner(
|
|
109
|
+
* createOwnerSecret({ randomBytes: createRandomBytes() }),
|
|
110
|
+
* );
|
|
111
|
+
*
|
|
112
|
+
* // Use one relay.
|
|
113
|
+
* const singleRelay = [
|
|
114
|
+
* { type: "WebSocket", url: "wss://relay1.example.com" },
|
|
115
|
+
* ] satisfies ReadonlyArray<OwnerTransport>;
|
|
99
116
|
*
|
|
100
|
-
* //
|
|
101
|
-
*
|
|
117
|
+
* // Use independent relays for redundancy.
|
|
118
|
+
* const redundantRelays = [
|
|
102
119
|
* { type: "WebSocket", url: "wss://relay1.example.com" },
|
|
103
120
|
* { type: "WebSocket", url: "wss://relay2.example.com" },
|
|
104
|
-
*
|
|
105
|
-
* ];
|
|
121
|
+
* ] satisfies ReadonlyArray<OwnerTransport>;
|
|
106
122
|
*
|
|
107
|
-
* //
|
|
108
|
-
* //
|
|
109
|
-
*
|
|
110
|
-
*
|
|
123
|
+
* // Start local-only before authentication. After authentication, pass an
|
|
124
|
+
* // owner-scoped transport to evolu.useOwner.
|
|
125
|
+
* const localOnlyBeforeAuthentication =
|
|
126
|
+
* [] satisfies ReadonlyArray<OwnerTransport>;
|
|
111
127
|
*
|
|
112
|
-
* //
|
|
113
|
-
*
|
|
128
|
+
* // Include the OwnerId when the relay authenticates owners.
|
|
129
|
+
* const authenticatedRelay = [
|
|
114
130
|
* createOwnerWebSocketTransport({
|
|
115
|
-
* url: "
|
|
116
|
-
* ownerId,
|
|
131
|
+
* url: "wss://relay.example.com",
|
|
132
|
+
* ownerId: appOwner.id,
|
|
117
133
|
* }),
|
|
118
134
|
* ];
|
|
135
|
+
*
|
|
136
|
+
* expect(authenticatedRelay[0]?.url).toBe(
|
|
137
|
+
* `wss://relay.example.com?ownerId=${appOwner.id}`,
|
|
138
|
+
* );
|
|
119
139
|
* ```
|
|
120
140
|
*/
|
|
121
141
|
readonly transports?: ReadonlyArray<OwnerTransport>;
|
|
@@ -140,7 +160,28 @@ export interface EvoluConfig {
|
|
|
140
160
|
* ### Example
|
|
141
161
|
*
|
|
142
162
|
* ```ts
|
|
143
|
-
*
|
|
163
|
+
* import {
|
|
164
|
+
* AppName,
|
|
165
|
+
* createAppOwner,
|
|
166
|
+
* createEvolu,
|
|
167
|
+
* createOwnerSecret,
|
|
168
|
+
* createRandomBytes,
|
|
169
|
+
* id,
|
|
170
|
+
* } from "@evolu/common";
|
|
171
|
+
*
|
|
172
|
+
* const Schema = {
|
|
173
|
+
* todo: { id: id("Todo") },
|
|
174
|
+
* todoCategory: { id: id("TodoCategory") },
|
|
175
|
+
* };
|
|
176
|
+
* // Create once, persist the mnemonic securely, and restore it on later runs.
|
|
177
|
+
* const appOwner = createAppOwner(
|
|
178
|
+
* createOwnerSecret({ randomBytes: createRandomBytes() }),
|
|
179
|
+
* );
|
|
180
|
+
*
|
|
181
|
+
* const createTodoEvolu = createEvolu(Schema, {
|
|
182
|
+
* appName: AppName.orThrow("IndexedTodos"),
|
|
183
|
+
* appOwner,
|
|
184
|
+
* transports: [],
|
|
144
185
|
* indexes: (create) => [
|
|
145
186
|
* create("todoCreatedAt").on("todo").column("createdAt"),
|
|
146
187
|
* create("todoCategoryCreatedAt")
|
|
@@ -148,6 +189,8 @@ export interface EvoluConfig {
|
|
|
148
189
|
* .column("createdAt"),
|
|
149
190
|
* ],
|
|
150
191
|
* });
|
|
192
|
+
*
|
|
193
|
+
* expect(createTodoEvolu).toBeTypeOf("function");
|
|
151
194
|
* ```
|
|
152
195
|
*/
|
|
153
196
|
readonly indexes?: IndexesConfig;
|
|
@@ -176,11 +219,12 @@ export interface EvoluConfig {
|
|
|
176
219
|
* Uses the same safe alphabet as {@link UrlSafeString} (letters, digits, `-`,
|
|
177
220
|
* `_`) and must be between 1 and 41 characters.
|
|
178
221
|
*/
|
|
179
|
-
export declare const AppName: import("../Type.
|
|
180
|
-
export type AppName = typeof AppName.
|
|
222
|
+
export declare const AppName: import("../Type.ts").BrandType<import("../Type.ts").BrandType<import("../Type.ts").Type<"String", string, string, import("../Type.ts").TypeOfError<"String">, null, import("../Type.ts").TypeOfError<"String">, never, string, true>, "UrlSafeString", import("../Type.ts").RegexError<"UrlSafeString">>, "AppName", AppNameError>;
|
|
223
|
+
export type AppName = typeof AppName.Output;
|
|
181
224
|
export interface AppNameError extends TypeError<"AppName"> {
|
|
225
|
+
readonly value: UrlSafeString;
|
|
182
226
|
}
|
|
183
|
-
export declare const testAppName: string & import("../Brand.
|
|
227
|
+
export declare const testAppName: string & import("../Brand.ts").Brand<"UrlSafeString"> & import("../Brand.ts").Brand<"AppName">;
|
|
184
228
|
/**
|
|
185
229
|
* Local-first SQL database with typed queries, mutations, and sync.
|
|
186
230
|
*
|
|
@@ -202,19 +246,45 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
202
246
|
* every row has a globally unique, conflict-free identifier without
|
|
203
247
|
* coordination.
|
|
204
248
|
*
|
|
249
|
+
* Pass `onComplete` when follow-up work must wait until the mutation and its
|
|
250
|
+
* query patches have been applied.
|
|
251
|
+
*
|
|
205
252
|
* ### Example
|
|
206
253
|
*
|
|
207
254
|
* ```ts
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
255
|
+
* import {
|
|
256
|
+
* id,
|
|
257
|
+
* NonEmptyTrimmedString100,
|
|
258
|
+
* type Evolu,
|
|
259
|
+
* } from "@evolu/common";
|
|
260
|
+
*
|
|
261
|
+
* const TodoId = id("Todo");
|
|
262
|
+
* type TodoId = typeof TodoId.Output;
|
|
263
|
+
* const Schema = {
|
|
264
|
+
* todo: { id: TodoId, title: NonEmptyTrimmedString100 },
|
|
265
|
+
* };
|
|
266
|
+
*
|
|
267
|
+
* const insertTodo = (evolu: Evolu<typeof Schema>) =>
|
|
268
|
+
* evolu.insert("todo", {
|
|
269
|
+
* title: NonEmptyTrimmedString100.orThrow("Learn Evolu"),
|
|
270
|
+
* }).id;
|
|
271
|
+
*
|
|
272
|
+
* const insertTodoAndNotify = (
|
|
273
|
+
* evolu: Evolu<typeof Schema>,
|
|
274
|
+
* onComplete: () => void,
|
|
275
|
+
* ) =>
|
|
276
|
+
* evolu.insert(
|
|
277
|
+
* "todo",
|
|
278
|
+
* { title: NonEmptyTrimmedString100.orThrow("Another todo") },
|
|
279
|
+
* { onComplete },
|
|
280
|
+
* ).id;
|
|
281
|
+
*
|
|
282
|
+
* expectTypeOf<
|
|
283
|
+
* [
|
|
284
|
+
* ReturnType<typeof insertTodo>,
|
|
285
|
+
* ReturnType<typeof insertTodoAndNotify>,
|
|
286
|
+
* ]
|
|
287
|
+
* >().toEqualTypeOf<[TodoId, TodoId]>();
|
|
218
288
|
* ```
|
|
219
289
|
*
|
|
220
290
|
* @see {@link Mutation}
|
|
@@ -228,13 +298,31 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
228
298
|
* ### Example
|
|
229
299
|
*
|
|
230
300
|
* ```ts
|
|
231
|
-
*
|
|
232
|
-
* id
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
301
|
+
* import {
|
|
302
|
+
* id,
|
|
303
|
+
* NonEmptyTrimmedString100,
|
|
304
|
+
* sqliteTrue,
|
|
305
|
+
* type Evolu,
|
|
306
|
+
* } from "@evolu/common";
|
|
307
|
+
*
|
|
308
|
+
* const TodoId = id("Todo");
|
|
309
|
+
* type TodoId = typeof TodoId.Output;
|
|
310
|
+
* const Schema = {
|
|
311
|
+
* todo: { id: TodoId, title: NonEmptyTrimmedString100 },
|
|
312
|
+
* };
|
|
313
|
+
*
|
|
314
|
+
* const renameTodo = (evolu: Evolu<typeof Schema>, todoId: TodoId) =>
|
|
315
|
+
* evolu.update("todo", {
|
|
316
|
+
* id: todoId,
|
|
317
|
+
* title: NonEmptyTrimmedString100.orThrow("Updated title"),
|
|
318
|
+
* }).id;
|
|
319
|
+
*
|
|
320
|
+
* const softDeleteTodo = (evolu: Evolu<typeof Schema>, todoId: TodoId) =>
|
|
321
|
+
* evolu.update("todo", { id: todoId, isDeleted: sqliteTrue }).id;
|
|
322
|
+
*
|
|
323
|
+
* expectTypeOf<
|
|
324
|
+
* [ReturnType<typeof renameTodo>, ReturnType<typeof softDeleteTodo>]
|
|
325
|
+
* >().toEqualTypeOf<[TodoId, TodoId]>();
|
|
238
326
|
* ```
|
|
239
327
|
*
|
|
240
328
|
* @see {@link Mutation}
|
|
@@ -255,11 +343,26 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
255
343
|
* ### Example
|
|
256
344
|
*
|
|
257
345
|
* ```ts
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
* id
|
|
261
|
-
*
|
|
262
|
-
*
|
|
346
|
+
* import {
|
|
347
|
+
* createIdFromString,
|
|
348
|
+
* id,
|
|
349
|
+
* NonEmptyTrimmedString100,
|
|
350
|
+
* type Evolu,
|
|
351
|
+
* } from "@evolu/common";
|
|
352
|
+
*
|
|
353
|
+
* const TodoId = id("Todo");
|
|
354
|
+
* type TodoId = typeof TodoId.Output;
|
|
355
|
+
* const Schema = {
|
|
356
|
+
* todo: { id: TodoId, title: NonEmptyTrimmedString100 },
|
|
357
|
+
* };
|
|
358
|
+
* const stableId = TodoId.orThrow(createIdFromString("my-todo-1"));
|
|
359
|
+
* const upsertTodo = (evolu: Evolu<typeof Schema>) =>
|
|
360
|
+
* evolu.upsert("todo", {
|
|
361
|
+
* id: stableId,
|
|
362
|
+
* title: NonEmptyTrimmedString100.orThrow("Learn Evolu"),
|
|
363
|
+
* }).id;
|
|
364
|
+
*
|
|
365
|
+
* expectTypeOf(upsertTodo).returns.toEqualTypeOf<TodoId>();
|
|
263
366
|
* ```
|
|
264
367
|
*
|
|
265
368
|
* @see {@link Mutation}
|
|
@@ -283,25 +386,74 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
283
386
|
* ### Example
|
|
284
387
|
*
|
|
285
388
|
* ```ts
|
|
389
|
+
* import {
|
|
390
|
+
* createQueryBuilder,
|
|
391
|
+
* id,
|
|
392
|
+
* NonEmptyTrimmedString100,
|
|
393
|
+
* type Evolu,
|
|
394
|
+
* type QueryRows,
|
|
395
|
+
* } from "@evolu/common";
|
|
396
|
+
*
|
|
397
|
+
* const Schema = {
|
|
398
|
+
* todo: { id: id("Todo"), title: NonEmptyTrimmedString100 },
|
|
399
|
+
* };
|
|
286
400
|
* const createQuery = createQueryBuilder(Schema);
|
|
287
401
|
* const allTodos = createQuery((db) =>
|
|
288
402
|
* db.selectFrom("todo").selectAll(),
|
|
289
403
|
* );
|
|
290
|
-
* evolu
|
|
291
|
-
*
|
|
292
|
-
*
|
|
404
|
+
* const loadTodos = async (evolu: Evolu<typeof Schema>) => {
|
|
405
|
+
* const rows = await evolu.loadQuery(allTodos);
|
|
406
|
+
* return rows;
|
|
407
|
+
* };
|
|
408
|
+
*
|
|
409
|
+
* expectTypeOf(loadTodos).returns.toEqualTypeOf<
|
|
410
|
+
* Promise<QueryRows<typeof allTodos.Row>>
|
|
411
|
+
* >();
|
|
293
412
|
* ```
|
|
294
413
|
*/
|
|
295
414
|
readonly loadQuery: <R extends Row>(query: Query<S, R>) => Promise<QueryRows<R>>;
|
|
296
415
|
/**
|
|
297
|
-
* Load an array of {@link Query}
|
|
416
|
+
* Load an array of {@link Query} values and return an array of
|
|
298
417
|
* {@link QueryRows} promises. It's like `queries.map(loadQuery)` but with
|
|
299
418
|
* proper types for returned promises.
|
|
300
419
|
*
|
|
301
420
|
* ### Example
|
|
302
421
|
*
|
|
303
422
|
* ```ts
|
|
304
|
-
*
|
|
423
|
+
* import {
|
|
424
|
+
* createIdFromString,
|
|
425
|
+
* createQueryBuilder,
|
|
426
|
+
* id,
|
|
427
|
+
* NonEmptyTrimmedString100,
|
|
428
|
+
* type Evolu,
|
|
429
|
+
* type QueryRows,
|
|
430
|
+
* } from "@evolu/common";
|
|
431
|
+
*
|
|
432
|
+
* const TodoId = id("Todo");
|
|
433
|
+
* type TodoId = typeof TodoId.Output;
|
|
434
|
+
* const Schema = {
|
|
435
|
+
* todo: { id: TodoId, title: NonEmptyTrimmedString100 },
|
|
436
|
+
* };
|
|
437
|
+
* const createQuery = createQueryBuilder(Schema);
|
|
438
|
+
* const allTodos = createQuery((db) =>
|
|
439
|
+
* db.selectFrom("todo").select(["id", "title"]),
|
|
440
|
+
* );
|
|
441
|
+
* const todoById = (todoId: TodoId) =>
|
|
442
|
+
* createQuery((db) =>
|
|
443
|
+
* db.selectFrom("todo").select("title").where("id", "=", todoId),
|
|
444
|
+
* );
|
|
445
|
+
* const firstTodo = todoById(
|
|
446
|
+
* TodoId.orThrow(createIdFromString("first-todo")),
|
|
447
|
+
* );
|
|
448
|
+
* const loadTodoQueries = (evolu: Evolu<typeof Schema>) =>
|
|
449
|
+
* evolu.loadQueries([allTodos, firstTodo]);
|
|
450
|
+
*
|
|
451
|
+
* expectTypeOf(loadTodoQueries).returns.toEqualTypeOf<
|
|
452
|
+
* [
|
|
453
|
+
* Promise<QueryRows<typeof allTodos.Row>>,
|
|
454
|
+
* Promise<QueryRows<typeof firstTodo.Row>>,
|
|
455
|
+
* ]
|
|
456
|
+
* >();
|
|
305
457
|
* ```
|
|
306
458
|
*/
|
|
307
459
|
readonly loadQueries: <Q extends Queries<S>>(queries: [...Q]) => [...QueriesToQueryRowsPromises<Q>];
|
|
@@ -311,9 +463,31 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
311
463
|
* ### Example
|
|
312
464
|
*
|
|
313
465
|
* ```ts
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
466
|
+
* import {
|
|
467
|
+
* createQueryBuilder,
|
|
468
|
+
* id,
|
|
469
|
+
* NonEmptyTrimmedString100,
|
|
470
|
+
* type Evolu,
|
|
471
|
+
* type QueryRows,
|
|
472
|
+
* type Unsubscribe,
|
|
473
|
+
* } from "@evolu/common";
|
|
474
|
+
*
|
|
475
|
+
* const Schema = {
|
|
476
|
+
* todo: { id: id("Todo"), title: NonEmptyTrimmedString100 },
|
|
477
|
+
* };
|
|
478
|
+
* const createQuery = createQueryBuilder(Schema);
|
|
479
|
+
* const allTodos = createQuery((db) =>
|
|
480
|
+
* db.selectFrom("todo").select("title"),
|
|
481
|
+
* );
|
|
482
|
+
* const subscribeToTodos = (
|
|
483
|
+
* evolu: Evolu<typeof Schema>,
|
|
484
|
+
* onRows: (rows: QueryRows<typeof allTodos.Row>) => void,
|
|
485
|
+
* ) =>
|
|
486
|
+
* evolu.subscribeQuery(allTodos)(() => {
|
|
487
|
+
* onRows(evolu.getQueryRows(allTodos));
|
|
488
|
+
* });
|
|
489
|
+
*
|
|
490
|
+
* expectTypeOf(subscribeToTodos).returns.toEqualTypeOf<Unsubscribe>();
|
|
317
491
|
* ```
|
|
318
492
|
*/
|
|
319
493
|
readonly subscribeQuery: (query: Query<S>) => (listener: Listener) => Unsubscribe;
|
|
@@ -323,9 +497,27 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
323
497
|
* ### Example
|
|
324
498
|
*
|
|
325
499
|
* ```ts
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
500
|
+
* import {
|
|
501
|
+
* createQueryBuilder,
|
|
502
|
+
* id,
|
|
503
|
+
* NonEmptyTrimmedString100,
|
|
504
|
+
* type Evolu,
|
|
505
|
+
* type QueryRows,
|
|
506
|
+
* } from "@evolu/common";
|
|
507
|
+
*
|
|
508
|
+
* const Schema = {
|
|
509
|
+
* todo: { id: id("Todo"), title: NonEmptyTrimmedString100 },
|
|
510
|
+
* };
|
|
511
|
+
* const createQuery = createQueryBuilder(Schema);
|
|
512
|
+
* const allTodos = createQuery((db) =>
|
|
513
|
+
* db.selectFrom("todo").select("title"),
|
|
514
|
+
* );
|
|
515
|
+
* const getTodos = (evolu: Evolu<typeof Schema>) =>
|
|
516
|
+
* evolu.getQueryRows(allTodos);
|
|
517
|
+
*
|
|
518
|
+
* expectTypeOf(getTodos).returns.toEqualTypeOf<
|
|
519
|
+
* QueryRows<typeof allTodos.Row>
|
|
520
|
+
* >();
|
|
329
521
|
* ```
|
|
330
522
|
*/
|
|
331
523
|
readonly getQueryRows: <R extends Row>(query: Query<S, R>) => QueryRows<R>;
|
|
@@ -353,6 +545,8 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
353
545
|
*
|
|
354
546
|
* All instances identified by {@link Evolu.name} will be self-disposed. Use
|
|
355
547
|
* {@link EvoluConfig.onDatabaseDeleted} to update app UI when that happens.
|
|
548
|
+
*
|
|
549
|
+
* Currently not implemented.
|
|
356
550
|
*/
|
|
357
551
|
readonly deleteDatabase: () => void;
|
|
358
552
|
/**
|
|
@@ -363,6 +557,8 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
363
557
|
*
|
|
364
558
|
* It also stops using that owner across all tabs and instances. Use
|
|
365
559
|
* {@link EvoluConfig.onOwnerDeleted} to update app UI when that happens.
|
|
560
|
+
*
|
|
561
|
+
* Currently not implemented.
|
|
366
562
|
*/
|
|
367
563
|
readonly deleteOwner: (owner: Owner) => void;
|
|
368
564
|
/**
|
|
@@ -381,20 +577,51 @@ export interface Evolu<S extends EvoluSchema = EvoluSchema> extends AsyncDisposa
|
|
|
381
577
|
* ### Example
|
|
382
578
|
*
|
|
383
579
|
* ```ts
|
|
384
|
-
*
|
|
385
|
-
*
|
|
386
|
-
* createOwnerWebSocketTransport
|
|
387
|
-
*
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
*
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
*
|
|
395
|
-
* //
|
|
396
|
-
* const
|
|
397
|
-
*
|
|
580
|
+
* import {
|
|
581
|
+
* createAppOwner,
|
|
582
|
+
* createOwnerWebSocketTransport,
|
|
583
|
+
* createOwnerSecret,
|
|
584
|
+
* createRandomBytes,
|
|
585
|
+
* deriveShardOwner,
|
|
586
|
+
* type Evolu,
|
|
587
|
+
* type ReadonlyOwner,
|
|
588
|
+
* type UnuseOwner,
|
|
589
|
+
* } from "@evolu/common";
|
|
590
|
+
*
|
|
591
|
+
* // Create once, persist the mnemonic securely, and restore it on later runs.
|
|
592
|
+
* const appOwner = createAppOwner(
|
|
593
|
+
* createOwnerSecret({ randomBytes: createRandomBytes() }),
|
|
594
|
+
* );
|
|
595
|
+
* const shardOwner = deriveShardOwner(appOwner, ["todos", 1]);
|
|
596
|
+
* const shardTransport = createOwnerWebSocketTransport({
|
|
597
|
+
* url: "wss://relay.example.com",
|
|
598
|
+
* ownerId: shardOwner.id,
|
|
599
|
+
* });
|
|
600
|
+
* const useShardOwner = (evolu: Evolu): UnuseOwner =>
|
|
601
|
+
* evolu.useOwner(shardOwner, [shardTransport]);
|
|
602
|
+
*
|
|
603
|
+
* const useOwners = (
|
|
604
|
+
* evolu: Evolu,
|
|
605
|
+
* owners: ReadonlyArray<ReadonlyOwner>,
|
|
606
|
+
* ): UnuseOwner => {
|
|
607
|
+
* const unuseOwners = owners.map((owner) =>
|
|
608
|
+
* evolu.useOwner(owner, [
|
|
609
|
+
* createOwnerWebSocketTransport({
|
|
610
|
+
* url: "wss://relay.example.com",
|
|
611
|
+
* ownerId: owner.id,
|
|
612
|
+
* }),
|
|
613
|
+
* ]),
|
|
614
|
+
* );
|
|
615
|
+
* return () => {
|
|
616
|
+
* for (const unuse of unuseOwners) unuse();
|
|
617
|
+
* };
|
|
618
|
+
* };
|
|
619
|
+
*
|
|
620
|
+
* // Call each returned UnuseOwner once to stop syncing.
|
|
621
|
+
* expect(shardTransport).toEqual({
|
|
622
|
+
* type: "WebSocket",
|
|
623
|
+
* url: `wss://relay.example.com?ownerId=${shardOwner.id}`,
|
|
624
|
+
* });
|
|
398
625
|
* ```
|
|
399
626
|
*/
|
|
400
627
|
readonly useOwner: (owner: ReadonlyOwner | Owner, transports?: NonEmptyReadonlyArray<OwnerTransport>) => UnuseOwner;
|
|
@@ -406,18 +633,28 @@ export interface EvoluErrorDep {
|
|
|
406
633
|
* {@link ReadonlyStore} of {@link EvoluError} shared by all {@link Evolu}
|
|
407
634
|
* instances created from the same {@link createEvoluDeps} result.
|
|
408
635
|
*
|
|
409
|
-
* Subscribe once to show user-facing messages across all instances.
|
|
410
|
-
* is handled by platform {@link createRun} global error handlers.
|
|
636
|
+
* Subscribe once to show user-facing error messages across all instances.
|
|
411
637
|
*
|
|
412
638
|
* ### Example
|
|
413
639
|
*
|
|
414
640
|
* ```ts
|
|
641
|
+
* import { createStore, Millis, type EvoluError } from "@evolu/common";
|
|
642
|
+
* import type { EvoluErrorDep } from "@evolu/common/local-first";
|
|
643
|
+
*
|
|
644
|
+
* // Stand-in for run.deps.evoluError from createEvoluDeps.
|
|
645
|
+
* using evoluError = createStore<EvoluError | null>(null);
|
|
646
|
+
* const deps = { evoluError } satisfies EvoluErrorDep;
|
|
647
|
+
* let displayedMessage = "";
|
|
648
|
+
* const showMessage = (message: string) => {
|
|
649
|
+
* displayedMessage = message;
|
|
650
|
+
* };
|
|
651
|
+
*
|
|
415
652
|
* deps.evoluError.subscribe(() => {
|
|
416
653
|
* const error = deps.evoluError.get();
|
|
417
654
|
* if (!error) return;
|
|
418
655
|
*
|
|
419
656
|
* switch (error.type) {
|
|
420
|
-
* case "
|
|
657
|
+
* case "TimestampDriftError":
|
|
421
658
|
* // Show guidance specific to the detected error.
|
|
422
659
|
* showMessage(
|
|
423
660
|
* "Your system clock appears incorrect. Please fix it.",
|
|
@@ -428,6 +665,15 @@ export interface EvoluErrorDep {
|
|
|
428
665
|
* showMessage("Something went wrong. Please try again.");
|
|
429
666
|
* }
|
|
430
667
|
* });
|
|
668
|
+
*
|
|
669
|
+
* deps.evoluError.set({
|
|
670
|
+
* type: "TimestampDriftError",
|
|
671
|
+
* next: Millis.orThrow(360000),
|
|
672
|
+
* now: Millis.orThrow(0),
|
|
673
|
+
* });
|
|
674
|
+
* expect(displayedMessage).toBe(
|
|
675
|
+
* "Your system clock appears incorrect. Please fix it.",
|
|
676
|
+
* );
|
|
431
677
|
* ```
|
|
432
678
|
*/
|
|
433
679
|
readonly evoluError: ReadonlyStore<EvoluError | null>;
|
|
@@ -438,7 +684,7 @@ export interface EvoluErrorDep {
|
|
|
438
684
|
* Includes platform adapters, the shared {@link EvoluErrorDep.evoluError} store,
|
|
439
685
|
* and disposal for owned resources.
|
|
440
686
|
*/
|
|
441
|
-
export type EvoluDeps = EvoluPlatformDeps & EvoluErrorDep & Disposable;
|
|
687
|
+
export type EvoluDeps = EvoluPlatformDeps & ConsoleDep & EvoluErrorDep & Disposable;
|
|
442
688
|
/**
|
|
443
689
|
* Platform-specific dependencies required to create {@link EvoluDeps}.
|
|
444
690
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Evolu.d.ts","sourceRoot":"","sources":["../../../src/local-first/Evolu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAIL,KAAK,qBAAqB,EAC3B,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Evolu.d.ts","sourceRoot":"","sources":["../../../src/local-first/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