devframe 0.2.1 → 0.2.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/adapters/build.d.mts +1 -1
- package/dist/adapters/build.mjs +6 -6
- package/dist/adapters/cli.d.mts +1 -1
- package/dist/adapters/cli.mjs +2 -2
- package/dist/adapters/dev.d.mts +2 -2
- package/dist/adapters/dev.mjs +1 -1
- package/dist/adapters/embedded.d.mts +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.mjs +3 -3
- package/dist/client/index.d.mts +18 -4
- package/dist/client/index.mjs +314 -8
- package/dist/{context-BaX-SZti.d.mts → context-GUzIxrEK.d.mts} +1 -1
- package/dist/{dev-CA0-8Amw.mjs → dev-BVtS7qBK.mjs} +4 -4
- package/dist/{devframe-BXZUBuy6.d.mts → devframe-C4DNeFuG.d.mts} +3 -52
- package/dist/diagnostics-D7miaTpL.mjs +36 -0
- package/dist/{rpc-BlVCyk9W.mjs → dump-C5LPsKJC.mjs} +139 -126
- package/dist/helpers/vite.d.mts +1 -1
- package/dist/helpers/vite.mjs +3 -3
- package/dist/{host-h3-CpYkiCIU.mjs → host-h3-DYFKJxAV.mjs} +255 -7
- package/dist/human-id-CiBWzVcg.mjs +803 -0
- package/dist/{index-BO4daMzR.d.mts → index-CSi2Y5JU.d.mts} +31 -78
- package/dist/index-DWczSqdd.d.mts +79 -0
- package/dist/index-aNunf5Za.d.mts +639 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/{launch-editor-1dAC7Uk5.mjs → launch-editor-BbNhtg7b.mjs} +25 -1
- package/dist/node/auth.d.mts +2 -2
- package/dist/node/auth.mjs +1 -2
- package/dist/node/index.d.mts +5 -5
- package/dist/node/index.mjs +3 -3
- package/dist/node/internal.d.mts +2 -2
- package/dist/node/internal.mjs +3 -4
- package/dist/recipes/open-helpers.d.mts +1 -1
- package/dist/recipes/open-helpers.mjs +3 -3
- package/dist/rpc/dump.d.mts +2 -0
- package/dist/rpc/dump.mjs +2 -0
- package/dist/rpc/index.d.mts +2 -2
- package/dist/rpc/index.mjs +129 -3
- package/dist/rpc/transports/ws-client.d.mts +25 -1
- package/dist/rpc/transports/ws-client.mjs +2 -2
- package/dist/rpc/transports/ws-server.d.mts +1 -1
- package/dist/rpc/transports/ws-server.mjs +2 -2
- package/dist/{serialization-CwO31axa.mjs → serialization-lBLV02kQ.mjs} +2 -36
- package/dist/{server-CgqyJG9m.d.mts → server-DjMtJQhO.d.mts} +1 -1
- package/dist/shared-state-SzgfilJP.mjs +1058 -0
- package/dist/{shared-state-q9-1EOSX.mjs → shared-state-u0y123fi.mjs} +6 -6
- package/dist/{storage-BaLJK6e_.mjs → storage-CTlHUtXI.mjs} +1 -2
- package/dist/structured-clone-qP1sPovr.mjs +208 -0
- package/dist/types/index.d.mts +3 -3
- package/dist/utils/colors.mjs +30 -1
- package/dist/utils/events.d.mts +1 -1
- package/dist/utils/hash.mjs +1 -1
- package/dist/utils/human-id.d.mts +1 -1
- package/dist/utils/human-id.mjs +768 -1
- package/dist/utils/launch-editor.mjs +1 -1
- package/dist/utils/open.mjs +1 -1
- package/dist/utils/shared-state.d.mts +1 -1
- package/dist/utils/shared-state.mjs +1 -1
- package/dist/utils/streaming-channel.d.mts +1 -1
- package/dist/utils/structured-clone.mjs +1 -1
- package/dist/{ws-server-kW8RZXTw.d.mts → ws-server-lHQaafrS.d.mts} +1 -1
- package/package.json +2 -5
- package/dist/chunk-e9Ob2GDo.mjs +0 -26
- package/dist/colors-DS7k8ljB.mjs +0 -123
- package/dist/diagnostics-Cg9ycFIM.mjs +0 -56
- package/dist/human-id-mPh1HcFO.mjs +0 -852
- package/dist/revoke-CWSPBbJH.mjs +0 -35
- package/dist/ws-client-DFUf-xgm.d.mts +0 -26
- /package/dist/{_shared-C_yZKUmx.mjs → _shared-BNoPn1NG.mjs} +0 -0
- /package/dist/{define-CW9gLnyG.mjs → define-Bb4zh-Dc.mjs} +0 -0
- /package/dist/{hash-CIBte1yS.mjs → hash-bwOD8RgU.mjs} +0 -0
- /package/dist/{open-CWL4Zasd.mjs → open-CX4CiMyw.mjs} +0 -0
- /package/dist/{server-G1ymmN3_.mjs → server-DxiOFSpu.mjs} +0 -0
- /package/dist/{structured-clone-CD2l4fI3.mjs → structured-clone-PdCZwt7F.mjs} +0 -0
- /package/dist/{transports-BLwT342H.mjs → transports-Bl1zuYhZ.mjs} +0 -0
- /package/dist/{types-ip8THGH1.d.mts → types-kKDaD2NT.d.mts} +0 -0
package/dist/revoke-CWSPBbJH.mjs
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
//#region src/node/auth/revoke.ts
|
|
2
|
-
/**
|
|
3
|
-
* Flip `isTrusted` to false on any live WS clients connected with `token`
|
|
4
|
-
* and broadcast the `auth:revoked` event so they can react.
|
|
5
|
-
*
|
|
6
|
-
* Shared between persisted-auth revocation and remote-dock token revocation.
|
|
7
|
-
*/
|
|
8
|
-
async function revokeActiveConnectionsForToken(context, token) {
|
|
9
|
-
const rpcHost = context.rpc;
|
|
10
|
-
if (!rpcHost?._rpcGroup) return;
|
|
11
|
-
const affectedSessionIds = /* @__PURE__ */ new Set();
|
|
12
|
-
for (const client of rpcHost._rpcGroup.clients) if (client.$meta.clientAuthToken === token) {
|
|
13
|
-
affectedSessionIds.add(client.$meta.id);
|
|
14
|
-
client.$meta.isTrusted = false;
|
|
15
|
-
client.$meta.clientAuthToken = void 0;
|
|
16
|
-
}
|
|
17
|
-
if (affectedSessionIds.size === 0) return;
|
|
18
|
-
await rpcHost.broadcast({
|
|
19
|
-
method: "devframe:auth:revoked",
|
|
20
|
-
args: [],
|
|
21
|
-
filter: (client) => affectedSessionIds.has(client.$meta.id)
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Revoke an auth token: remove from storage and notify all connected clients
|
|
26
|
-
* using this token that they are no longer trusted.
|
|
27
|
-
*/
|
|
28
|
-
async function revokeAuthToken(context, storage, token) {
|
|
29
|
-
storage.mutate((state) => {
|
|
30
|
-
delete state.trusted[token];
|
|
31
|
-
});
|
|
32
|
-
await revokeActiveConnectionsForToken(context, token);
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
export { revokeAuthToken as n, revokeActiveConnectionsForToken as t };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { _ as RpcFunctionDefinitionAny } from "./types-ip8THGH1.mjs";
|
|
2
|
-
import { ChannelOptions } from "birpc";
|
|
3
|
-
|
|
4
|
-
//#region src/rpc/transports/ws-client.d.ts
|
|
5
|
-
interface WsRpcChannelOptions {
|
|
6
|
-
url: string;
|
|
7
|
-
onConnected?: (e: Event) => void;
|
|
8
|
-
onError?: (e: Error) => void;
|
|
9
|
-
onDisconnected?: (e: CloseEvent) => void;
|
|
10
|
-
authToken?: string;
|
|
11
|
-
/**
|
|
12
|
-
* RPC function definitions (or just the `jsonSerializable` flag per
|
|
13
|
-
* method) used to dispatch the per-call wire serializer. Pass an
|
|
14
|
-
* empty / partial map on clients that don't have the full registry —
|
|
15
|
-
* encoding falls back to structured-clone (the safer superset) and
|
|
16
|
-
* decoding still routes correctly via the wire prefix.
|
|
17
|
-
*/
|
|
18
|
-
definitions?: ReadonlyMap<string, Pick<RpcFunctionDefinitionAny, 'jsonSerializable'>>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Build a birpc `ChannelOptions` object backed by a browser `WebSocket`.
|
|
22
|
-
* Pass the result straight to `createRpcClient`'s `channel` option.
|
|
23
|
-
*/
|
|
24
|
-
declare function createWsRpcChannel(options: WsRpcChannelOptions): ChannelOptions;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { createWsRpcChannel as n, WsRpcChannelOptions as t };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|