@interncom/diplomatic 0.8.0 → 0.8.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.
@@ -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 } 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,13 @@ 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>;
155
162
  /**
156
163
  * Peek each host from seq 0 and pull any bags not already in the archive.
157
164
  * Leaves open msgs as APLD_PENDING; does not exec (rebuild replays everything).
@@ -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, IClient, IDiplomaticClientState, IHostRow, IStore, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ListMsgsOpts } 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, IClient, ICrypto, IDeleteParams, IDiplomaticClientState, IEntRev, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITransport, IUpdateParams, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, SyncProgressEvent, WorkerClientOptions, };