@interncom/diplomatic 0.10.0 → 0.11.1
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/web/client.d.ts +7 -3
- package/dist/web/index.d.ts +6 -3
- package/dist/web/index.mjs +1 -1
- package/dist/web/passkey/seed.d.ts +64 -0
- package/dist/web/stores/idb/seed.d.ts +6 -2
- package/dist/web/stores/idb/store.d.ts +5 -1
- package/dist/web/stores/memory/seed.d.ts +2 -2
- package/dist/web/types.d.ts +44 -3
- package/dist/web/worker/client.d.ts +5 -3
- package/dist/web/worker/protocol.d.ts +5 -0
- package/dist/web/worker.mjs +1 -1
- package/package.json +1 -1
package/dist/web/client.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Status } from "./shared/consts";
|
|
|
4
4
|
import { EncodedMessage } from "./shared/message";
|
|
5
5
|
import { EntityID, Hash, HostHandle, ICrypto, IDeleteParams, IEntRev, IHostConnectionInfo, IInsertParams, IMessageHead, IStateManager, ITransport, IUpdateParams, MasterSeed } from "./shared/types";
|
|
6
6
|
import { ValStat } from "./shared/valstat";
|
|
7
|
-
import { ApldState, IClient, IDiplomaticClientState, IDiplomaticClientXferState, IHostRow, IStateEmitter, IStore, IStoredMessage, ListMsgsOpts, ReconcileOpts, ReconcileReport } from "./types";
|
|
7
|
+
import { ApldState, IClient, IDiplomaticClientState, IDiplomaticClientXferState, IHostRow, IStateEmitter, IStore, IStoredMessage, ListMsgsOpts, ReconcileOpts, ReconcileReport, SetSeedOpts, WipeOpts } from "./types";
|
|
8
8
|
export declare class SyncClient<Handle extends HostHandle> implements IClient<Handle> {
|
|
9
9
|
private clock;
|
|
10
10
|
private state;
|
|
@@ -54,7 +54,7 @@ export declare class SyncClient<Handle extends HostHandle> implements IClient<Ha
|
|
|
54
54
|
onScheduleSync?: (() => void) | undefined);
|
|
55
55
|
/** Record phase progress and notify xferState listeners. */
|
|
56
56
|
private emitProgress;
|
|
57
|
-
setSeed(seed: MasterSeed): Promise<void>;
|
|
57
|
+
setSeed(seed: MasterSeed, opts?: SetSeedOpts): Promise<void>;
|
|
58
58
|
private getClientState;
|
|
59
59
|
private getXferState;
|
|
60
60
|
/**
|
|
@@ -177,7 +177,11 @@ export declare class SyncClient<Handle extends HostHandle> implements IClient<Ha
|
|
|
177
177
|
* Caller must hold applyChain.
|
|
178
178
|
*/
|
|
179
179
|
private replay;
|
|
180
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Clear local app/protocol state. Default: msgs + ents + meta; **not** seed
|
|
182
|
+
* (no passkey/largeBlob interaction unless `{ seed: true }`).
|
|
183
|
+
*/
|
|
184
|
+
wipe(opts?: WipeOpts): Promise<void>;
|
|
181
185
|
import: (file: File, options?: {
|
|
182
186
|
onProgress?: (index: number, total: number, status: Status) => void;
|
|
183
187
|
}) => Promise<Status>;
|
package/dist/web/index.d.ts
CHANGED
|
@@ -18,17 +18,20 @@ import { nullStateManager, StateManager } from "./state";
|
|
|
18
18
|
import { IDBStore, openIDBStore } from "./stores/idb/store";
|
|
19
19
|
import { MemoryStore } from "./stores/memory/store";
|
|
20
20
|
import { SingletonStateManager } from "./shared/singleton";
|
|
21
|
-
import type { ApldState, Applier, HostStatsUpdate, IClient, IDiplomaticClientState, IHostRow, IStore, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ListMsgsOpts, ReconcileOpts, ReconcileReport } from "./types";
|
|
21
|
+
import type { ApldState, Applier, HostStatsUpdate, IClient, IDiplomaticClientState, IHostRow, IStore, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ListMsgsOpts, ReconcileOpts, ReconcileReport, SetSeedOpts } from "./types";
|
|
22
22
|
import { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, isApldState, isPendingApply, isTerminalApplyFailure, setApld } from "./types";
|
|
23
23
|
import type { SyncProgressEvent } from "./progress";
|
|
24
24
|
import { defaultPeekProgressEvery, idleProgress, shouldEmitItemProgress } from "./progress";
|
|
25
|
+
import { clearLargeBlobSeed, createLargeBlobCred, largeBlobCapable, PasskeySeedStore, readLargeBlobSeed, storeSeedLargeBlob, writeLargeBlobSeed } from "./passkey/seed";
|
|
26
|
+
import type { LargeBlobRp } from "./passkey/seed";
|
|
25
27
|
import { checksumEntRevs, checksumSet, cmpBytes, encodeEntRev } from "./shared/checksum";
|
|
26
28
|
import { openDiplomaticClient, type OpenDiplomaticClientMainOptions, type OpenDiplomaticClientOptions, type OpenDiplomaticClientWorkerOptions, type OpenedDiplomaticClient } from "./openClient";
|
|
27
29
|
import { WorkerClient } from "./worker/client";
|
|
28
30
|
import type { WorkerClientOptions } from "./worker/client";
|
|
31
|
+
import type { WipeOpts } from "./types";
|
|
29
32
|
export declare function genWebClient(stateMgr: IStateManager, url: URL): Promise<{
|
|
30
33
|
client: SyncClient<URL>;
|
|
31
34
|
setSeed: (seedHex: string) => Promise<void>;
|
|
32
35
|
}>;
|
|
33
|
-
export { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, b64tob, btob64, btoh, CachedEntDB, checksumEntRevs, checksumSet, Clock, cmpBytes, crypto, Decoder, defaultPeekProgressEvery, eidCodec, encodeEntRev, Encoder, EntDBMemory, EntIDB, EntitiesQuery, EntityID, entStateManager, genSingletonEID, GroupID, hostHTTPTransport, htob, HTTPTransport, IDBStore, idleProgress, IEntDB, IEntity, isApldState, isLiveEnt, isPendingApply, isTerminalApplyFailure, isTombstone, IStore, MasterSeed, MemoryStore, normalizeTags, nullEntDB, nullStateManager, openDiplomaticClient, openEntDB, openIDBStore, revFromEntity, revFromHead, setApld, shouldEmitItemProgress, SingletonStateManager, StateManager, Status, SyncClient, TypedEventEmitter, useClient, useClientState, useClientXferState, useStateWatcher, useStateWatcherSuspense, useSyncOnResume, WorkerClient, };
|
|
34
|
-
export type { ApldState, Applier, CachedEntDBOptions, EntDBMemoryOptions, HostHandle, HostStatsUpdate, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IEntRow, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITombstone, ITransport, IUpdateParams, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, ReconcileOpts, ReconcileReport, SyncProgressEvent, WorkerClientOptions, };
|
|
36
|
+
export { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, b64tob, btob64, btoh, CachedEntDB, checksumEntRevs, checksumSet, clearLargeBlobSeed, Clock, cmpBytes, createLargeBlobCred, crypto, Decoder, defaultPeekProgressEvery, eidCodec, encodeEntRev, Encoder, EntDBMemory, EntIDB, EntitiesQuery, EntityID, entStateManager, genSingletonEID, GroupID, hostHTTPTransport, htob, HTTPTransport, IDBStore, idleProgress, IEntDB, IEntity, isApldState, isLiveEnt, isPendingApply, isTerminalApplyFailure, isTombstone, IStore, largeBlobCapable, MasterSeed, MemoryStore, normalizeTags, nullEntDB, nullStateManager, openDiplomaticClient, openEntDB, openIDBStore, PasskeySeedStore, readLargeBlobSeed, revFromEntity, revFromHead, setApld, shouldEmitItemProgress, SingletonStateManager, StateManager, Status, storeSeedLargeBlob, SyncClient, TypedEventEmitter, useClient, useClientState, useClientXferState, useStateWatcher, useStateWatcherSuspense, useSyncOnResume, WorkerClient, writeLargeBlobSeed, };
|
|
37
|
+
export type { ApldState, Applier, CachedEntDBOptions, EntDBMemoryOptions, HostHandle, HostStatsUpdate, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IEntRow, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITombstone, ITransport, IUpdateParams, LargeBlobRp, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, ReconcileOpts, ReconcileReport, SetSeedOpts, SyncProgressEvent, WipeOpts, WorkerClientOptions, };
|