@interncom/diplomatic 0.8.1 → 0.8.3
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 +10 -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/memory/hosts.d.ts +4 -1
- package/dist/web/sync.d.ts +11 -1
- package/dist/web/types.d.ts +73 -0
- package/dist/web/worker/client.d.ts +7 -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 { ApldState, IClient, IDiplomaticClientState, IDiplomaticClientXferState, IHostRow, IStateEmitter, IStore, IStoredMessage, ListMsgsOpts } 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;
|
|
@@ -159,6 +159,15 @@ export declare class SyncClient<Handle extends HostHandle> implements IClient<Ha
|
|
|
159
159
|
listMsgs(opts?: ListMsgsOpts): Promise<IStoredMessage[]>;
|
|
160
160
|
/** Count archive rows; optional apld filter. Prefer over list+length. */
|
|
161
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, then re-inventories so the returned host msg checksum (and
|
|
168
|
+
* bag counts) reflect post-drain host state. Read counts via {@link hosts}.
|
|
169
|
+
*/
|
|
170
|
+
reconcile(hostLabel: string, opts?: ReconcileOpts): Promise<ValStat<Hash>>;
|
|
162
171
|
/**
|
|
163
172
|
* Peek each host from seq 0 and pull any bags not already in the archive.
|
|
164
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, ListMsgsOpts } 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, ListMsgsOpts, 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, };
|