@interncom/diplomatic 0.18.3 → 0.19.0
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/cli/shared/types.d.ts +0 -2
- package/dist/web/entdb/cached.d.ts +1 -1
- package/dist/web/entdb/entdb.d.ts +1 -4
- package/dist/web/entdb/idb.d.ts +3 -5
- package/dist/web/entdb/memory.d.ts +1 -3
- package/dist/web/index.d.ts +2 -2
- package/dist/web/index.mjs +1 -1
- package/dist/web/shared/types.d.ts +0 -2
- package/dist/web/worker.mjs +1 -1
- package/package.json +1 -1
|
@@ -8,14 +8,12 @@ import type { ValStat } from "./valstat.ts";
|
|
|
8
8
|
/** Identity seed brands — defined in seed.ts; re-exported for convenience. */
|
|
9
9
|
export type { MasterSeed, SealedMasterKey } from "./seed.ts";
|
|
10
10
|
export { asSealedMasterKey, MASTER_SEED_LEN, SEALED_MASTER_KEY_LEN, } from "./seed.ts";
|
|
11
|
-
export type GroupID = string;
|
|
12
11
|
declare const entityIDSymbol: unique symbol;
|
|
13
12
|
export type EntityID = Uint8Array & {
|
|
14
13
|
readonly [entityIDSymbol]: true;
|
|
15
14
|
};
|
|
16
15
|
export type SerializedContent = Uint8Array;
|
|
17
16
|
export interface IMsgEntBody<T = unknown> {
|
|
18
|
-
gid?: GroupID;
|
|
19
17
|
pid?: EntityID;
|
|
20
18
|
/**
|
|
21
19
|
* Optional multi-value tags for reverse multi-ref / label lookup (multiEntry-indexed).
|
|
@@ -10,7 +10,7 @@ export type OpenEntDBOptions = {
|
|
|
10
10
|
*/
|
|
11
11
|
cache?: boolean;
|
|
12
12
|
/**
|
|
13
|
-
* Secondary type/pid/
|
|
13
|
+
* Secondary type/pid/tag indexes on the in-memory layer (default true).
|
|
14
14
|
* Speeds up getEntities list queries after a type is warm.
|
|
15
15
|
* Ignored when `cache` is false.
|
|
16
16
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Status } from "../shared/consts";
|
|
2
2
|
import { ValStat } from "../shared/valstat";
|
|
3
|
-
import { EntityID,
|
|
3
|
+
import { EntityID, Hash, ICrypto, IEntRev, IMessageHead, IMsgEntBody, IOp } from "../shared/types";
|
|
4
4
|
export { entStateManager } from "./manager.ts";
|
|
5
5
|
export interface IEntity<T = unknown> extends Omit<IMsgEntBody<T>, "body"> {
|
|
6
6
|
eid: EntityID;
|
|
@@ -52,9 +52,6 @@ export type TagSpec = string | {
|
|
|
52
52
|
};
|
|
53
53
|
export type EntitiesQuery = {
|
|
54
54
|
type: string;
|
|
55
|
-
} | {
|
|
56
|
-
type: string;
|
|
57
|
-
gid: GroupID;
|
|
58
55
|
} | {
|
|
59
56
|
type: string;
|
|
60
57
|
pid: EntityID;
|
package/dist/web/entdb/idb.d.ts
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { Status } from "../shared/consts";
|
|
2
|
-
import { EntityID,
|
|
2
|
+
import { EntityID, Hash, ICrypto, IOp } from "../shared/types";
|
|
3
3
|
import { ValStat } from "../shared/valstat.ts";
|
|
4
4
|
import { EntitiesQuery, IEntDB, IEntity, IEntRow, TagSpec } from "./entdb";
|
|
5
5
|
export declare const entityTableName = "entities";
|
|
6
6
|
export declare const typeIndexName = "entity_type_created_at";
|
|
7
7
|
export declare const typeUpdatedAtIndexName = "entity_type_updated_at";
|
|
8
|
-
export declare const typeGroupIndexName = "entity_type_group_id";
|
|
9
8
|
export declare const typeParentIndexName = "entity_type_parent_id";
|
|
10
9
|
/** multiEntry index on tgs[]; query by tag then filter by type. */
|
|
11
10
|
export declare const tagsIndexName = "entity_tags";
|
|
12
11
|
/** Shared by main thread and sync worker — must stay in lockstep. */
|
|
13
12
|
export declare const ENT_IDB_NAME = "db";
|
|
14
|
-
/**
|
|
15
|
-
export declare const ENT_IDB_VERSION =
|
|
13
|
+
/** v14: drop [`typ`,`gid`] index (gid superseded by tags). */
|
|
14
|
+
export declare const ENT_IDB_VERSION = 14;
|
|
16
15
|
export declare class EntIDB implements IEntDB {
|
|
17
16
|
db: IDBDatabase | undefined;
|
|
18
17
|
/** In-flight open; coalesces concurrent ensureDb / peer upgrade reopen. */
|
|
@@ -34,7 +33,6 @@ export declare class EntIDB implements IEntDB {
|
|
|
34
33
|
getEnt<T>(eid: EntityID): Promise<ValStat<IEntity<T> | undefined>>;
|
|
35
34
|
/** List live ents of type matching an updatedAt spec. */
|
|
36
35
|
private getByUpdatedAt;
|
|
37
|
-
getGroupMembers<T>(opType: string, gid: GroupID): Promise<ValStat<IEntity<T>[]>>;
|
|
38
36
|
getAllOfType<T>(opType: string): Promise<ValStat<IEntity<T>[]>>;
|
|
39
37
|
getByTag<T>(opType: string, spec: TagSpec): Promise<ValStat<IEntity<T>[]>>;
|
|
40
38
|
private getAllEntities;
|
|
@@ -5,7 +5,7 @@ import { ValStat } from "../shared/valstat.ts";
|
|
|
5
5
|
/** Options for {@link EntDBMemory}. */
|
|
6
6
|
export type EntDBMemoryOptions = {
|
|
7
7
|
/**
|
|
8
|
-
* Secondary type / type+pid / type+
|
|
8
|
+
* Secondary type / type+pid / type+tag indexes for list queries.
|
|
9
9
|
* Default true. Disable only if you need to save the index memory.
|
|
10
10
|
*/
|
|
11
11
|
indexes?: boolean;
|
|
@@ -18,8 +18,6 @@ export declare class EntDBMemory implements IEntDB {
|
|
|
18
18
|
private byType;
|
|
19
19
|
/** type → pidKey → eidKey → ent */
|
|
20
20
|
private byTypePid;
|
|
21
|
-
/** type → gid → eidKey → ent */
|
|
22
|
-
private byTypeGid;
|
|
23
21
|
/** type → tag → eidKey → ent */
|
|
24
22
|
private byTypeTag;
|
|
25
23
|
constructor(initEnts?: IEntity[], opts?: EntDBMemoryOptions);
|
package/dist/web/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ import { Status } from "./shared/consts";
|
|
|
15
15
|
import { hostHTTPTransport, HTTPTransport } from "./shared/http";
|
|
16
16
|
import { TypedEventEmitter } from "./shared/events";
|
|
17
17
|
import { asSealedMasterKey, MASTER_SEED_LEN, SEALED_MASTER_KEY_LEN, type SealedMasterKey } from "./shared/seed";
|
|
18
|
-
import { EntityID,
|
|
18
|
+
import { EntityID, HostHandle, ICrypto, IDeleteParams, IEntRev, IHostConnectionInfo, IMessage, IMutateOp, type IOp, IStateManager, ITransport, IUpdateParams } from "./shared/types";
|
|
19
19
|
import { Enclave } from "./shared/crypto/enclave";
|
|
20
20
|
import { nullStateManager, StateManager } from "./state";
|
|
21
21
|
import { IDBSeedStore } from "./stores/idb/seed";
|
|
@@ -43,5 +43,5 @@ import type { WipeOpts } from "./types";
|
|
|
43
43
|
/** Platform advertises largeBlob (not a guarantee the binding key has it). */
|
|
44
44
|
export { largeBlobCapable } from "./shared/webauthn/largeBlob";
|
|
45
45
|
export { webAuthnLastError } from "./shared/webauthn/common";
|
|
46
|
-
export { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, asDHKEReq, asDHKEResp, asSealedMasterKey, b64tob, b64urltob, btob64, btob64url, btoh, CachedEntDB, checksumEntRevs, checksumSet, Clock, cmpBytes, crypto, Decoder, DEFAULT_PRF_SALT, defaultPeekProgressEvery, defaultWebAuthnRpId, eidCodec, Enclave, encodeEntRev, Encoder, EntDBMemory, EntIDB, EntitiesQuery, EntityID, entStateManager, genSingletonEID,
|
|
46
|
+
export { APLD_APPLIED, APLD_ERROR, APLD_PENDING, apldFromStored, asDHKEReq, asDHKEResp, asSealedMasterKey, b64tob, b64urltob, btob64, btob64url, btoh, CachedEntDB, checksumEntRevs, checksumSet, Clock, cmpBytes, crypto, Decoder, DEFAULT_PRF_SALT, defaultPeekProgressEvery, defaultWebAuthnRpId, eidCodec, Enclave, encodeEntRev, Encoder, EntDBMemory, EntIDB, EntitiesQuery, EntityID, entStateManager, genSingletonEID, hostHTTPTransport, htob, HTTPTransport, IDBSeedStore, IDBStore, idleProgress, IEntDB, IEntity, isApldState, isLiveEnt, isPendingApply, isTerminalApplyFailure, isTombstone, IStore, KEYRING_MAX, keyringCredIds, keyringKind, keyringLabel, MASTER_SEED_LEN, MemoryStore, normalizeTags, nullEntDB, nullStateManager, openDiplomaticClient, openEntDB, openIDBStore, PairRequest, PasskeySeedStore, prfCapable, PrfSeedStore, revFromEntity, revFromHead, SEALED_MASTER_KEY_LEN, setApld, shouldEmitItemProgress, SingletonStateManager, StateManager, Status, SyncClient, TypedEventEmitter, useClient, useClientState, useClientXferState, useStateWatcher, useStateWatcherSuspense, useSyncOnResume, WorkerClient, };
|
|
47
47
|
export type { ApldState, Applier, BundleHost, CachedEntDBOptions, DateSpec, DHKEReq, DHKEResp, EntDBMemoryOptions, HostHandle, HostStatsUpdate, IClient, ICrypto, IDateRange, IDeleteParams, IDiplomaticClientState, IEntRev, IEntRow, IHostConnectionInfo, IHostRow, IMessage, IMutateOp, IOp, IStateManager, IStoredMessage, IStoredMessageData, IStoredMessageWrite, ITagRange, ITombstone, ITransport, IUpdateParams, Keyring, KeyringEntry, KeyringRow, ListMsgsOpts, OpenDiplomaticClientMainOptions, OpenDiplomaticClientOptions, OpenDiplomaticClientWorkerOptions, OpenedDiplomaticClient, OpenEntDBOptions, PasskeySeedStoreOpts, PersistKeyring, PrfRp, PrfSeedStoreOpts, ReconcileOpts, ReconcileReport, SealedMasterKey, SetSeedOpts, SyncProgressEvent, TagSpec, WipeOpts, WorkerClientOptions, };
|