@interncom/diplomatic 0.2.0 → 0.2.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/README.md +3 -1
- package/dist/cli/index.mjs +3 -6009
- package/dist/cli/shared/client.d.ts +6 -1
- package/dist/cli/shared/http/listener.d.ts +1 -1
- package/dist/cli/shared/types.d.ts +1 -1
- package/dist/cli/src/index.d.ts +2 -1
- package/dist/web/index.d.ts +4 -4
- package/dist/web/index.mjs +1 -7645
- package/dist/web/shared/client.d.ts +6 -1
- package/dist/web/shared/http/listener.d.ts +1 -1
- package/dist/web/shared/lpc/listener.d.ts +1 -1
- package/dist/web/shared/types.d.ts +1 -1
- package/package.json +9 -10
- package/dist/cli/index.js +0 -6020
- package/dist/web/index.js +0 -6800
|
@@ -18,5 +18,10 @@ export default class DiplomaticClientAPI<Handle extends HostHandle> {
|
|
|
18
18
|
peek: (lastSeq: number) => Promise<ValStat<import("./codecs/peekItem.ts").IBagPeekItem[]>>;
|
|
19
19
|
push: (bags: IBag[]) => Promise<ValStat<import("./codecs/pushItem.ts").IBagPushItem[]>>;
|
|
20
20
|
pull: (seqs: number[]) => Promise<ValStat<import("./codecs/pullItem.ts").IBagPullItem[]>>;
|
|
21
|
-
listen: (recv: PushReceiver) => Promise<Status>;
|
|
21
|
+
listen: (recv: PushReceiver, onDisconnect?: () => void, onConnect?: () => void) => Promise<Status>;
|
|
22
|
+
/** Returns whether this client has an active connection to its host.
|
|
23
|
+
* If a push listener is active, reports the listener's connected state.
|
|
24
|
+
* Otherwise (listen=false), reports true if registered.
|
|
25
|
+
*/
|
|
26
|
+
isConnected(): boolean;
|
|
22
27
|
}
|
|
@@ -6,6 +6,6 @@ export declare class WebsocketListener implements IPushListener {
|
|
|
6
6
|
private websocket?;
|
|
7
7
|
constructor(url: URL);
|
|
8
8
|
connected(): boolean;
|
|
9
|
-
connect(authTS: IAuthTimestamp, recv: PushReceiver, onDisconnect
|
|
9
|
+
connect(authTS: IAuthTimestamp, recv: PushReceiver, onDisconnect?: () => void, onConnect?: () => void): Promise<Status>;
|
|
10
10
|
disconnect(): void;
|
|
11
11
|
}
|
|
@@ -11,6 +11,6 @@ export declare class CallbackListener implements IPushListener {
|
|
|
11
11
|
private _shut?;
|
|
12
12
|
constructor(notifier: IPushNotifier, crypto: IHostCrypto, clock: IClock);
|
|
13
13
|
connected(): boolean;
|
|
14
|
-
connect(authTS: IAuthTimestamp, recv: PushReceiver, _onDisconnect
|
|
14
|
+
connect(authTS: IAuthTimestamp, recv: PushReceiver, _onDisconnect?: () => void, onConnect?: () => void): Promise<Status>;
|
|
15
15
|
disconnect(): void;
|
|
16
16
|
}
|
|
@@ -115,7 +115,7 @@ export interface IPushNotifier {
|
|
|
115
115
|
push(pubKey: PublicKey, data: Uint8Array): void;
|
|
116
116
|
}
|
|
117
117
|
export interface IPushListener {
|
|
118
|
-
connect(authTS: IAuthTimestamp, recv: PushReceiver, onDisconnect
|
|
118
|
+
connect(authTS: IAuthTimestamp, recv: PushReceiver, onDisconnect?: () => void, onConnect?: () => void): Promise<Status>;
|
|
119
119
|
connected(): boolean;
|
|
120
120
|
disconnect(): void;
|
|
121
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@interncom/diplomatic",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Secure sync layer and CLI utilities for DIPLOMATIC",
|
|
6
6
|
"files": [
|
|
@@ -37,15 +37,14 @@
|
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/bun": "
|
|
41
|
-
"@types/file-saver": "
|
|
42
|
-
"@types/node": "
|
|
43
|
-
"@types/react": "
|
|
44
|
-
"@vitest/coverage-v8": "
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"vitest": "^4.0.17"
|
|
40
|
+
"@types/bun": "1.3.13",
|
|
41
|
+
"@types/file-saver": "2.0.7",
|
|
42
|
+
"@types/node": "20.14.11",
|
|
43
|
+
"@types/react": "19.1.0",
|
|
44
|
+
"@vitest/coverage-v8": "4.0.17",
|
|
45
|
+
"react": "19.1.0",
|
|
46
|
+
"typescript": "5.8.3",
|
|
47
|
+
"vitest": "4.0.17"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"react": "^19.0.0"
|