@mdbase-dev/sdk 0.1.0-beta.187 → 0.1.0-beta.189
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 +188 -953
- package/dist/app-grant/client.js +7 -3
- package/dist/app-grant/client.js.map +1 -1
- package/dist/app-grant/setup.js +2 -2
- package/dist/app-grant/setup.js.map +1 -1
- package/dist/app-host/cloud-copy-host.js +1 -1
- package/dist/app-host/cloud-copy-host.js.map +1 -1
- package/dist/app-host/collection-readiness.js +10 -12
- package/dist/app-host/collection-readiness.js.map +1 -1
- package/dist/app-host/handover.js +1 -1
- package/dist/app-host/handover.js.map +1 -1
- package/dist/app-host/initial-sync.js +4 -4
- package/dist/app-host/initial-sync.js.map +1 -1
- package/dist/application/browser-capabilities.d.ts +1 -1
- package/dist/application/browser-capabilities.js +3 -2
- package/dist/application/browser-capabilities.js.map +1 -1
- package/dist/application/configuration.js +12 -12
- package/dist/application/configuration.js.map +1 -1
- package/dist/application/entry.d.ts +51 -107
- package/dist/application/entry.js +139 -86
- package/dist/application/entry.js.map +1 -1
- package/dist/application/front-door.d.ts +30 -12
- package/dist/application/front-door.js +2 -89
- package/dist/application/front-door.js.map +1 -1
- package/dist/application/phase.d.ts +4 -1
- package/dist/application/phase.js +5 -4
- package/dist/application/phase.js.map +1 -1
- package/dist/application/private-collections.js +2 -1
- package/dist/application/private-collections.js.map +1 -1
- package/dist/application/registration-refusal.d.ts +1 -1
- package/dist/application/registration-refusal.js +1 -3
- package/dist/application/registration-refusal.js.map +1 -1
- package/dist/application/registration.js +1 -4
- package/dist/application/registration.js.map +1 -1
- package/dist/application/setup.d.ts +6 -9
- package/dist/application/setup.js +16 -0
- package/dist/application/setup.js.map +1 -1
- package/dist/application/tabs.d.ts +15 -2
- package/dist/application/tabs.js +35 -13
- package/dist/application/tabs.js.map +1 -1
- package/dist/application/unsynced-transfer.d.ts +1 -1
- package/dist/application/unsynced-transfer.js +3 -3
- package/dist/application/unsynced-transfer.js.map +1 -1
- package/dist/application/worker.js +928 -449
- package/dist/browser/mdbase-sdk.js +21271 -20750
- package/dist/browser/mdbase-sdk.min.js +65 -65
- package/dist/browser.d.ts +1 -0
- package/dist/browser.js +1 -0
- package/dist/browser.js.map +1 -1
- package/dist/client.d.ts +173 -84
- package/dist/client.js +236 -178
- package/dist/client.js.map +1 -1
- package/dist/codec.d.ts +15 -0
- package/dist/codec.js +44 -2
- package/dist/codec.js.map +1 -1
- package/dist/collection-api.d.ts +44 -0
- package/dist/collection-api.js +24 -0
- package/dist/collection-api.js.map +1 -0
- package/dist/collection-availability.js +1 -1
- package/dist/collection-availability.js.map +1 -1
- package/dist/contract-query.d.ts +22 -3
- package/dist/contract-query.js.map +1 -1
- package/dist/contract-records.d.ts +2 -1
- package/dist/contract-records.js.map +1 -1
- package/dist/describe-error.d.ts +1 -1
- package/dist/describe-error.js +7 -6
- package/dist/describe-error.js.map +1 -1
- package/dist/errors.d.ts +3 -5
- package/dist/errors.js +3 -8
- package/dist/errors.js.map +1 -1
- package/dist/files.d.ts +7 -5
- package/dist/files.js +16 -17
- package/dist/files.js.map +1 -1
- package/dist/holds.d.ts +2 -1
- package/dist/holds.js.map +1 -1
- package/dist/index.d.ts +7 -11
- package/dist/index.js +5 -7
- package/dist/index.js.map +1 -1
- package/dist/live.d.ts +2 -1
- package/dist/live.js.map +1 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/manifest.js +1 -1
- package/dist/native/provenance.json +1 -1
- package/dist/people.js +3 -7
- package/dist/people.js.map +1 -1
- package/dist/plain.d.ts +102 -0
- package/dist/plain.js +62 -0
- package/dist/plain.js.map +1 -0
- package/dist/presence.d.ts +2 -1
- package/dist/presence.js +3 -3
- package/dist/presence.js.map +1 -1
- package/dist/read-helpers.d.ts +8 -6
- package/dist/read-helpers.js +20 -13
- package/dist/read-helpers.js.map +1 -1
- package/dist/record-set.d.ts +98 -0
- package/dist/record-set.js +347 -0
- package/dist/record-set.js.map +1 -0
- package/dist/records/session.d.ts +2 -1
- package/dist/records/session.js +22 -20
- package/dist/records/session.js.map +1 -1
- package/dist/records/types.d.ts +5 -3
- package/dist/records/witness.d.ts +7 -4
- package/dist/records/witness.js +13 -8
- package/dist/records/witness.js.map +1 -1
- package/dist/records.js +5 -2
- package/dist/records.js.map +1 -1
- package/dist/saved-views.d.ts +12 -4
- package/dist/saved-views.js +51 -43
- package/dist/saved-views.js.map +1 -1
- package/dist/settle.d.ts +62 -0
- package/dist/settle.js +119 -0
- package/dist/settle.js.map +1 -0
- package/dist/status.d.ts +84 -28
- package/dist/status.js +54 -48
- package/dist/status.js.map +1 -1
- package/dist/testing/application.d.ts +16 -9
- package/dist/testing/application.js +49 -45
- package/dist/testing/application.js.map +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/testing/memory-contracts.d.ts +5 -0
- package/dist/testing/memory-contracts.js.map +1 -1
- package/dist/testing/memory-replica.d.ts +60 -5
- package/dist/testing/memory-replica.js +127 -20
- package/dist/testing/memory-replica.js.map +1 -1
- package/dist/testing/test-app.d.ts +9 -10
- package/dist/testing/test-app.js +8 -17
- package/dist/testing/test-app.js.map +1 -1
- package/dist/thin-client.d.ts +15 -38
- package/dist/thin-client.js +11 -20
- package/dist/thin-client.js.map +1 -1
- package/dist/transport/control-route.js +1 -1
- package/dist/transport/control-route.js.map +1 -1
- package/dist/transport/relay-close.d.ts +0 -1
- package/dist/transport/relay-close.js +4 -2
- package/dist/transport/relay-close.js.map +1 -1
- package/dist/transport/relay-pipe.js +2 -2
- package/dist/transport/relay-pipe.js.map +1 -1
- package/dist/type-packs.js +4 -4
- package/dist/type-packs.js.map +1 -1
- package/dist/validation.d.ts +1 -1
- package/dist/validation.js +2 -2
- package/dist/validation.js.map +1 -1
- package/dist/values.d.ts +4 -20
- package/dist/values.js +3 -49
- package/dist/values.js.map +1 -1
- package/dist/view-sources.d.ts +2 -1
- package/dist/view-sources.js +1 -1
- package/dist/view-sources.js.map +1 -1
- package/dist/wire.d.ts +7 -3
- package/dist/wire.js +4 -4
- package/dist/wire.js.map +1 -1
- package/dist/write-ledger.d.ts +2 -1
- package/dist/write-ledger.js +3 -6
- package/dist/write-ledger.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type MdbaseApplicationDeclaration } from "./declaration.js";
|
|
2
|
+
import { type DescribeErrorOptions } from "../describe-error.js";
|
|
2
3
|
import { type ApplicationCollectionSelectionSnapshot } from "./collection-selection.js";
|
|
3
|
-
import { type MdbaseTransferMap, type
|
|
4
|
-
import { type MdbaseAccessRequest, type MdbaseAccessRequestOptions, type MdbaseAccessResult } from "./file-access.js";
|
|
4
|
+
import { type MdbaseTransferMap, type MdbaseTransferProgress } from "./unsynced-transfer.js";
|
|
5
5
|
import type { MdbaseClient } from "../client.js";
|
|
6
6
|
import type { FilesApi } from "../files.js";
|
|
7
7
|
import type { MdbasePeopleClient } from "../people.js";
|
|
@@ -9,10 +9,9 @@ import type { TimersApi } from "../timers.js";
|
|
|
9
9
|
import type { AppWebSignInSnapshot } from "../app-host/web-sign-in-session.js";
|
|
10
10
|
import { type AppReplicaScope } from "../app-host/owner.js";
|
|
11
11
|
import { type AppStoragePolicy } from "../app-host/status.js";
|
|
12
|
-
import {
|
|
12
|
+
import type { Mdbase } from "./front-door.js";
|
|
13
13
|
import { type MdbasePhase } from "./phase.js";
|
|
14
|
-
import { type
|
|
15
|
-
import type { WriteLedgerSnapshot } from "../write-ledger.js";
|
|
14
|
+
import { type MdbaseSync } from "../status.js";
|
|
16
15
|
import type { AppCollectionReadinessFenceDetail } from "../app-host/collection-readiness.js";
|
|
17
16
|
export type MdbaseApplicationFacet = "capabilities" | "contracts" | "configuration" | "files" | "people" | "notifications";
|
|
18
17
|
export interface MdbaseApplicationProblem {
|
|
@@ -53,18 +52,21 @@ export interface MdbaseApplicationSnapshot extends AppWebSignInSnapshot {
|
|
|
53
52
|
/** R1: the one derived state for UI. Switch on `phase.kind`; never hand-roll
|
|
54
53
|
* a ready check from `status`/`readiness`. Always set by the SDK entry. */
|
|
55
54
|
readonly phase?: MdbasePhase;
|
|
56
|
-
/**
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
*
|
|
60
|
-
readonly
|
|
55
|
+
/** The one status to show for the open collection (null until it is ready):
|
|
56
|
+
* whether changes reach the cloud copy, what is waiting, including each
|
|
57
|
+
* unconfirmed and refused write (`sync.writes`, which survives a reload), and
|
|
58
|
+
* what needs the person. */
|
|
59
|
+
readonly sync?: MdbaseSync | null;
|
|
61
60
|
/** On-device storage policy for this origin, read by the SDK (null where the
|
|
62
61
|
* SDK cannot tell). `persistent` is the browser's answer, never a durability
|
|
63
62
|
* claim: only a log-confirmed receipt counts as saved. */
|
|
64
63
|
readonly storage?: AppStoragePolicy | null;
|
|
65
64
|
/** Pending replica edits on nonpersistent storage: set after 30 seconds
|
|
66
65
|
* continuously pending, or immediately while disconnected. Normal online
|
|
67
|
-
* edits do not flash a warning. Null at zero pending or with persistence.
|
|
66
|
+
* edits do not flash a warning. Null at zero pending or with persistence.
|
|
67
|
+
* The same fact as `storage_may_be_evicted` in `sync.attention`; kept for
|
|
68
|
+
* app-ui's `CollectionSaveWarning`, which pins a published SDK, and removed
|
|
69
|
+
* once that reads `sync.attention`. */
|
|
68
70
|
readonly saveWarning?: "storage_may_be_evicted" | null;
|
|
69
71
|
/** Connect pages for this account (SDK-4). Null where the SDK cannot run. */
|
|
70
72
|
readonly links?: MdbaseLinks | null;
|
|
@@ -120,13 +122,17 @@ export interface MdbaseSignInOpener {
|
|
|
120
122
|
* `dev.example.app://auth/mdbase/callback` for ID `dev.example.app`. */
|
|
121
123
|
readonly returnUrl?: string;
|
|
122
124
|
}
|
|
123
|
-
export interface
|
|
125
|
+
export interface MdbaseOptions {
|
|
124
126
|
readonly signIn?: MdbaseSignInOpener;
|
|
125
127
|
/** Drive `setForeground` from `document.visibilityState`, and sync at once
|
|
126
128
|
* when the page regains focus or the network comes back. A hidden page only
|
|
127
129
|
* finishes sending pending writes (for at most two minutes). Default true;
|
|
128
130
|
* false leaves `setForeground` to the app. */
|
|
129
131
|
readonly followVisibility?: boolean;
|
|
132
|
+
/** Copy for `phase.problem` and the signed-out notice in the person's
|
|
133
|
+
* language: replacement `title`, `message` and `actionLabel` by problem key,
|
|
134
|
+
* as `describeError` takes them. A key left out keeps the English copy. */
|
|
135
|
+
readonly messages?: DescribeErrorOptions["messages"];
|
|
130
136
|
/** Readiness policy. `typeIssues: "degrade"` keeps the collection ready when
|
|
131
137
|
* one of the app's own types has an error-level definition issue, and lists
|
|
132
138
|
* it in `readiness.assessment.unavailableTypes`; the app must then treat
|
|
@@ -148,7 +154,7 @@ export interface MdbaseConnectOptions {
|
|
|
148
154
|
* link or reload opens it, and Back/forward switch collections. Default
|
|
149
155
|
* true; false for a page with no URL of its own, such as a `blob:` document
|
|
150
156
|
* embedded in another app. The URL is then never read or written, and the
|
|
151
|
-
* app chooses with `select`, `approve` and `
|
|
157
|
+
* app chooses with `select`, `approve` and `chooseAnother`. */
|
|
152
158
|
readonly urlSelection?: boolean;
|
|
153
159
|
/** Construct the SDK's module Worker yourself, where the page cannot load
|
|
154
160
|
* it by URL as a secure context (for example a `blob:` document inside a
|
|
@@ -159,6 +165,18 @@ export interface MdbaseConnectOptions {
|
|
|
159
165
|
* returns no Worker fails with `application_worker_unavailable`. Default:
|
|
160
166
|
* `new Worker(url, {type: "module"})`. */
|
|
161
167
|
readonly worker?: (url: string) => Worker;
|
|
168
|
+
/** One session for contexts of this app that are built separately, such as
|
|
169
|
+
* a browser extension's pages, offscreen document and service worker. By
|
|
170
|
+
* default only contexts loading the same SDK module file share a session.
|
|
171
|
+
* `build` names this build of the app instead: every context of the origin
|
|
172
|
+
* that passes the same `build` and the same declaration uses one sign-in and
|
|
173
|
+
* one Worker. `host: false` is for a context that cannot run that Worker (a
|
|
174
|
+
* service worker) or should leave it to another: it joins the context that
|
|
175
|
+
* runs it and waits while there is none. Default: `host: true`. */
|
|
176
|
+
readonly session?: {
|
|
177
|
+
readonly build: string;
|
|
178
|
+
readonly host?: boolean;
|
|
179
|
+
};
|
|
162
180
|
}
|
|
163
181
|
export interface MdbaseApplicationConnection {
|
|
164
182
|
readonly id: string;
|
|
@@ -173,104 +191,19 @@ export interface MdbaseApplicationConnection {
|
|
|
173
191
|
readonly timers?: TimersApi;
|
|
174
192
|
isCurrent(): boolean;
|
|
175
193
|
}
|
|
176
|
-
export interface MdbaseApplication {
|
|
177
|
-
getSnapshot(): MdbaseApplicationSnapshot;
|
|
178
|
-
subscribe(listener: () => void): () => void;
|
|
179
|
-
start(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
180
|
-
/** Call from the user gesture (reserves the Connect popup synchronously):
|
|
181
|
-
* sign in, or approve the requested collection. Same as approve(). */
|
|
182
|
-
authorize(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
183
|
-
select(collectionId: string, options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
184
|
-
/** Call from the user gesture: approve one named collection (default: the requested one; none: choose in Connect). */
|
|
185
|
-
approve(collectionId?: string | null, options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
186
|
-
/** Call from the user gesture the first time the app needs an optional file
|
|
187
|
-
* action (for example adding an image). Resolves `granted` at once when it
|
|
188
|
-
* is already allowed; otherwise opens Connect for the open collection with
|
|
189
|
-
* your one-line reason. No reload: the connection and app state stay. An
|
|
190
|
-
* action the manifest does not declare rejects with `access_undeclared`.
|
|
191
|
-
* File writes the person has not allowed reject with `access_required`. */
|
|
192
|
-
requestAccess(request: MdbaseAccessRequest, options: MdbaseAccessRequestOptions): Promise<MdbaseAccessResult>;
|
|
193
|
-
/** Call from the user gesture: re-approve the open/requested collection. */
|
|
194
|
-
reauthorize(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
195
|
-
/** Re-read the approved collection list now (for example when a switcher
|
|
196
|
-
* opens). Focus and visibility already refresh it. */
|
|
197
|
-
refreshCollectionList?(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
198
|
-
/** Close the current collection and return to the chooser; Back restores it. */
|
|
199
|
-
chooseAnother(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
200
|
-
/** Refresh current aggregate evidence; checking/read errors never become READY. */
|
|
201
|
-
assess(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationReadinessSnapshot>;
|
|
202
|
-
/** Explicitly configure the current scope from its canonical declaration.
|
|
203
|
-
* No caller operations/plan/SQL; original recovery and consent stay SDK-owned. */
|
|
204
|
-
configure(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
205
|
-
/** Reviewable setup of the open collection: `plan` for one review screen,
|
|
206
|
-
* then `apply` that plan. `configure` is plan+apply with nothing to review. */
|
|
207
|
-
readonly setup: MdbaseApplicationSetup;
|
|
208
|
-
clearSelection(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
209
|
-
/** Local presentation/selection only; never revoke consent or delete records. */
|
|
210
|
-
forget(collectionId: string, options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
211
|
-
/** Owner only, from an explicit confirmation: delete a collection for
|
|
212
|
-
* everyone, on every device and app. `confirmName` is the name the person
|
|
213
|
-
* typed; it must equal the collection's current name. A refusal rejects
|
|
214
|
-
* with a `collection_delete_*` code for `describeError` and changes nothing
|
|
215
|
-
* locally. On success the collection leaves `collections`. */
|
|
216
|
-
deleteCollection(collectionId: string, options: MdbaseCollectionDeleteOptions): Promise<MdbaseApplicationSnapshot>;
|
|
217
|
-
/** Unlock the open Private collection (`phase.kind === "needs_unlock"`,
|
|
218
|
-
* `mode: "password"`) with the account's encryption password or recovery
|
|
219
|
-
* key. Resolves when the attempt settled: opened (`ready` or `needs_setup`),
|
|
220
|
-
* or still `needs_unlock` with `phase.problem` set (wrong password, service
|
|
221
|
-
* unreachable). Rejects with `invalid_request` when that collection is not
|
|
222
|
-
* waiting to be unlocked in this tab. No reload is needed either way.
|
|
223
|
-
* Optional for other implementations of this interface. */
|
|
224
|
-
unlock?(collectionId: string, secret: MdbaseUnlockSecret, options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
225
|
-
setForeground(active: boolean): void;
|
|
226
|
-
close(): Promise<void>;
|
|
227
|
-
/** Sign out of mdbase on this device: ends the server session and removes
|
|
228
|
-
* this browser's sign-in data, keys and cached collections for the account.
|
|
229
|
-
* Rejects with `sign_out_pending_writes` (a `conflict`) while changes have not
|
|
230
|
-
* reached mdbase, unless `{discard: true}`. Resolves signed out; Sign in works
|
|
231
|
-
* again without a reload, and a reload stays signed out. A server sign-out
|
|
232
|
-
* that could not complete (offline) still signs this device out; it shows
|
|
233
|
-
* in `signOutResult`. Optional for other implementations of this interface. */
|
|
234
|
-
signOut?(options?: MdbaseSignOutOptions): Promise<MdbaseApplicationSnapshot>;
|
|
235
|
-
/** Open this app's unsynced collection in this tab (work before
|
|
236
|
-
* connecting), creating it on first use. Optional for other implementations. */
|
|
237
|
-
openUnsynced?(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
238
|
-
/** Compare the unsynced collection with this tab's open (ready) collection,
|
|
239
|
-
* mapping each record with `map`. Nothing is written. Optional for other
|
|
240
|
-
* implementations. */
|
|
241
|
-
planUnsyncedTransfer?(options?: MdbaseTransferPlanOptions): Promise<MdbaseTransferPlan>;
|
|
242
|
-
/** Create a reviewed plan's records in this tab's open collection. Safe to
|
|
243
|
-
* plan and run again after an interruption. Optional for other implementations. */
|
|
244
|
-
transferUnsynced?(plan: MdbaseTransferPlan, options?: MdbaseTransferOptions): Promise<MdbaseTransferResult>;
|
|
245
|
-
/** Erase the unsynced collection from this browser, after the person
|
|
246
|
-
* confirmed it. A tab showing it continues in a new, empty one. Optional for
|
|
247
|
-
* other implementations. */
|
|
248
|
-
discardUnsynced?(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
249
|
-
/** @deprecated Use `createMdbase(...).addCollection(options)` or
|
|
250
|
-
* `approve(null, options)`: the same unified chooser, without a current hint.
|
|
251
|
-
* Optional for other implementations of this interface. */
|
|
252
|
-
addPrivateCollection?(options?: MdbaseApplicationRequestOptions): Promise<MdbaseApplicationSnapshot>;
|
|
253
|
-
}
|
|
254
|
-
/** Structural public consumer port; production uses MdbaseConnect. Explicit
|
|
255
|
-
* SDK testing fixtures may implement this without private fields or casts. */
|
|
256
|
-
export interface MdbaseApplicationEntry {
|
|
257
|
-
application(): MdbaseApplication;
|
|
258
|
-
connection(collectionId: string): MdbaseApplicationConnection | null;
|
|
259
|
-
}
|
|
260
194
|
export declare class MdbaseApplicationUnavailableError extends Error {
|
|
261
195
|
readonly code = "application_not_yet_available";
|
|
262
196
|
constructor();
|
|
263
197
|
}
|
|
264
|
-
/** The
|
|
265
|
-
*
|
|
266
|
-
* Declaration-only public entry. Construction is IO-free; SDK registration,
|
|
198
|
+
/** The entry behind `createMdbase(declaration)`: internal, apps hold its
|
|
199
|
+
* `mdbase`. Declaration-only. Construction is IO-free; SDK registration,
|
|
267
200
|
* same-artifact Worker and original profile/SQL start lazily on the first
|
|
268
201
|
* action. The URL names the requested collection; sign-in approval decides what
|
|
269
202
|
* opens. No private authority hooks, replacement actors or transport-only
|
|
270
203
|
* READY: a host's `worker` factory only constructs the SDK's own Worker, which
|
|
271
204
|
* checks its bootstrap and assets as always. */
|
|
272
|
-
export declare class
|
|
273
|
-
|
|
205
|
+
export declare class MdbaseEntry {
|
|
206
|
+
readonly mdbase: Mdbase;
|
|
274
207
|
private readonly declaration;
|
|
275
208
|
private readonly compiled;
|
|
276
209
|
private readonly lifetime;
|
|
@@ -303,6 +236,7 @@ export declare class MdbaseConnect implements MdbaseApplicationEntry {
|
|
|
303
236
|
private revision;
|
|
304
237
|
private readonly links;
|
|
305
238
|
private readonly cpOrigin;
|
|
239
|
+
private readonly messages;
|
|
306
240
|
private opening;
|
|
307
241
|
private syncing;
|
|
308
242
|
/** On-device storage policy for this origin; null where it cannot be read. */
|
|
@@ -311,6 +245,8 @@ export declare class MdbaseConnect implements MdbaseApplicationEntry {
|
|
|
311
245
|
private readonly signIn;
|
|
312
246
|
private readonly typeIssues;
|
|
313
247
|
private readonly createWorker;
|
|
248
|
+
/** The `session` option: the app's own build name, and whether this context may run the Worker. */
|
|
249
|
+
private readonly session;
|
|
314
250
|
/** SDK-10: this tab's Private collections (page-side thin clients, never the Worker). */
|
|
315
251
|
private readonly privates;
|
|
316
252
|
/** Open the unsynced collection when started signed out; tried once per start. */
|
|
@@ -320,18 +256,20 @@ export declare class MdbaseConnect implements MdbaseApplicationEntry {
|
|
|
320
256
|
private unsyncedOpening;
|
|
321
257
|
private readonly timing;
|
|
322
258
|
private readonly overlaid;
|
|
323
|
-
constructor(declaration: MdbaseApplicationDeclaration, options?:
|
|
259
|
+
constructor(declaration: MdbaseApplicationDeclaration, options?: MdbaseOptions);
|
|
324
260
|
/** SDK-10: the session's snapshot with this tab's Private collections listed
|
|
325
261
|
* and, while one is open, as the selected collection. Stable per change. */
|
|
326
262
|
private withPrivate;
|
|
327
263
|
private getSnapshot;
|
|
328
264
|
private linksFor;
|
|
329
|
-
/**
|
|
330
|
-
|
|
265
|
+
/** How long changes have been pending without a break, or null with none:
|
|
266
|
+
* one clock per continuously pending replica, not per edit or request. It
|
|
267
|
+
* wakes the snapshot when a save stops being brief and when it becomes long. */
|
|
268
|
+
private trackPending;
|
|
331
269
|
private clearPendingSave;
|
|
332
270
|
/** SDK-9: one timer per opening collection; `slow` after SLOW_OPENING_MS. */
|
|
333
271
|
private trackOpening;
|
|
334
|
-
/** Follow the open collection's
|
|
272
|
+
/** Follow the open collection's status, write ledger and link while it is ready. */
|
|
335
273
|
private trackSync;
|
|
336
274
|
private nativeAuthorization;
|
|
337
275
|
private account;
|
|
@@ -381,16 +319,23 @@ export declare class MdbaseConnect implements MdbaseApplicationEntry {
|
|
|
381
319
|
private signedOut;
|
|
382
320
|
/** Another tab signed out of the one shared session: this tab is signed out too. */
|
|
383
321
|
private observeSignOut;
|
|
322
|
+
/** This context's tab group. The capability probe has already required Web
|
|
323
|
+
* Locks and BroadcastChannel. */
|
|
384
324
|
private tabsFor;
|
|
385
325
|
/** The leader tab went away: start again, as the new leader or a follower of it.
|
|
386
326
|
* If it went because the session signed out, this tab is signed out too: it
|
|
387
327
|
* neither leads nor starts a new session (its snapshot may not have arrived). */
|
|
388
328
|
private readonly leaderLost;
|
|
329
|
+
/** A context that cannot run the Worker is waiting, and none runs it: start
|
|
330
|
+
* as this context would on load, unless it is already starting or running. */
|
|
331
|
+
private readonly hostWanted;
|
|
389
332
|
/** Every tab signed out, then another tab signed in again: follow that
|
|
390
333
|
* session as this tab would on load (no second sign-in or approval). */
|
|
391
334
|
private readonly signedInElsewhere;
|
|
392
335
|
private setForeground;
|
|
393
336
|
private followVisibility;
|
|
337
|
+
/** `sync.connection` says offline as soon as the browser does, not at the next failed request. */
|
|
338
|
+
private followNetwork;
|
|
394
339
|
/** Back/forward cache: a page parked there is frozen with its Worker, which
|
|
395
340
|
* would keep holding the collection lease and block the next document of
|
|
396
341
|
* this app ("busy"). On pagehide, stop the Worker synchronously (a frozen
|
|
@@ -410,7 +355,6 @@ export declare class MdbaseConnect implements MdbaseApplicationEntry {
|
|
|
410
355
|
private awaitingOtherTab;
|
|
411
356
|
private awaitOtherTab;
|
|
412
357
|
private close;
|
|
413
|
-
application(): MdbaseApplication;
|
|
414
358
|
/** Which revisions of the unsynced collection's records are already in a
|
|
415
359
|
* destination, shared by this browser's tabs. */
|
|
416
360
|
private transferLedger;
|