@interncom/diplomatic 0.8.0 → 0.8.2
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 +17 -1
- package/dist/web/index.d.ts +2 -2
- package/dist/web/index.mjs +1 -1
- package/dist/web/stores/idb/hosts.d.ts +2 -1
- package/dist/web/stores/idb/msgs.d.ts +3 -2
- package/dist/web/stores/memory/hosts.d.ts +4 -1
- package/dist/web/stores/memory/msgs.d.ts +3 -2
- package/dist/web/sync.d.ts +11 -1
- package/dist/web/types.d.ts +105 -5
- package/dist/web/worker/client.d.ts +10 -2
- package/dist/web/worker/protocol.d.ts +7 -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 { IClient, IDiplomaticClientState, IDiplomaticClientXferState, IHostRow, IStateEmitter, IStore } from "./types";
|
|
7
|
+
import { ApldState, IClient, IDiplomaticClientState, IDiplomaticClientXferState, IHostRow, IStateEmitter, IStore, IStoredMessage, ListMsgsOpts, ReconcileOpts } from "./types";
|
|
8
8
|
export declare class SyncClient<Handle extends HostHandle> implements IClient<Handle> {
|
|
9
9
|
private clock;
|
|
10
10
|
private state;
|
|
@@ -152,6 +152,22 @@ export declare class SyncClient<Handle extends HostHandle> implements IClient<Ha
|
|
|
152
152
|
* Store key encoding is irrelevant; we always sort decoded (binary) hashes.
|
|
153
153
|
*/
|
|
154
154
|
msgcheck(): Promise<Hash>;
|
|
155
|
+
/**
|
|
156
|
+
* List local archive rows (failed apply, pending drain, full dump).
|
|
157
|
+
* Bodies included by default; pass `body: false` for lighter listings.
|
|
158
|
+
*/
|
|
159
|
+
listMsgs(opts?: ListMsgsOpts): Promise<IStoredMessage[]>;
|
|
160
|
+
/** Count archive rows; optional apld filter. Prefer over list+length. */
|
|
161
|
+
countMsgs(apld?: ApldState): Promise<number>;
|
|
162
|
+
/**
|
|
163
|
+
* Full inventory of one host (peek seq 0): set numBags/numDupes/lastSeq on
|
|
164
|
+
* the host row; optionally enqueue downloads (`pull`, default true) and/or
|
|
165
|
+
* uploads (`push`, default false). Waits out in-flight {@link sync} first
|
|
166
|
+
* (same as {@link rebuild}). By default runs {@link sync} afterward so
|
|
167
|
+
* queues drain. Returns ephemeral host msg checksum (distinct msgs on host;
|
|
168
|
+
* same construction as {@link msgcheck}). Read counts via {@link hosts}.
|
|
169
|
+
*/
|
|
170
|
+
reconcile(hostLabel: string, opts?: ReconcileOpts): Promise<ValStat<Hash>>;
|
|
155
171
|
/**
|
|
156
172
|
* Peek each host from seq 0 and pull any bags not already in the archive.
|
|
157
173
|
* Leaves open msgs as APLD_PENDING; does not exec (rebuild replays everything).
|
package/dist/web/index.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ 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, IClient, IDiplomaticClientState, IHostRow, IStore, IStoredMessage, IStoredMessageData, IStoredMessageWrite } from "./types";
|
|
21
|
+
import type { ApldState, Applier, HostStatsUpdate, IClient, IDiplomaticClientState, IHostRow, IStore, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ListMsgsOpts, ReconcileOpts } 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";
|
|
@@ -31,4 +31,4 @@ export declare function genWebClient(stateMgr: IStateManager, url: URL): Promise
|
|
|
31
31
|
setSeed: (seedHex: string) => Promise<void>;
|
|
32
32
|
}>;
|
|
33
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, isPendingApply, isTerminalApplyFailure, 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, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITransport, IUpdateParams, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, SyncProgressEvent, WorkerClientOptions, };
|
|
34
|
+
export type { ApldState, Applier, CachedEntDBOptions, EntDBMemoryOptions, HostHandle, HostStatsUpdate, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITransport, IUpdateParams, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, ReconcileOpts, SyncProgressEvent, WorkerClientOptions, };
|