@kubun/plugin-p2p 0.8.1 → 0.8.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/lib/context/group.d.ts +4 -0
- package/lib/context/group.js +1 -0
- package/lib/context/join.js +1 -1
- package/lib/context/types.d.ts +5 -5
- package/lib/groups/broadcast-codec.d.ts +3 -0
- package/lib/{spaces → groups}/broadcast-service.d.ts +33 -15
- package/lib/groups/broadcast-service.js +1 -0
- package/lib/{spaces → groups}/broadcast.d.ts +6 -6
- package/lib/groups/broadcast.js +1 -0
- package/lib/groups/events.d.ts +38 -0
- package/lib/{spaces → groups}/events.js +1 -1
- package/lib/{spaces → groups}/invite-payload.d.ts +2 -2
- package/lib/groups/join-utils.d.ts +19 -0
- package/lib/groups/join-utils.js +1 -0
- package/lib/{spaces → groups}/manager.d.ts +41 -39
- package/lib/groups/manager.js +1 -0
- package/lib/groups/mls-group-handle.d.ts +4 -0
- package/lib/groups/mls-group-handle.js +1 -0
- package/lib/groups/mls-state.d.ts +42 -0
- package/lib/groups/mls-state.js +1 -0
- package/lib/hub/connection-pool.d.ts +19 -0
- package/lib/hub/connection-pool.js +1 -0
- package/lib/hub/group-channel.d.ts +51 -0
- package/lib/hub/group-channel.js +1 -0
- package/lib/hub/receive-handler.d.ts +36 -0
- package/lib/hub/receive-handler.js +1 -0
- package/lib/hub/relay-manager.d.ts +37 -0
- package/lib/hub/relay-manager.js +1 -0
- package/lib/hub/send-handler.d.ts +28 -0
- package/lib/hub/send-handler.js +1 -0
- package/lib/index.d.ts +12 -10
- package/lib/index.js +1 -1
- package/lib/schema.d.ts +2 -2
- package/lib/schema.js +42 -42
- package/lib/sync/catalog-scope.js +1 -1
- package/lib/sync/peer-registry.js +1 -1
- package/lib/types.d.ts +39 -39
- package/package.json +17 -15
- package/lib/context/space.d.ts +0 -4
- package/lib/context/space.js +0 -1
- package/lib/spaces/broadcast-codec.d.ts +0 -3
- package/lib/spaces/broadcast-service.js +0 -1
- package/lib/spaces/broadcast.js +0 -1
- package/lib/spaces/events.d.ts +0 -38
- package/lib/spaces/group-handle.d.ts +0 -3
- package/lib/spaces/group-handle.js +0 -1
- package/lib/spaces/join-utils.d.ts +0 -19
- package/lib/spaces/join-utils.js +0 -1
- package/lib/spaces/manager.js +0 -1
- package/lib/spaces/mls-state.d.ts +0 -27
- package/lib/spaces/mls-state.js +0 -1
- /package/lib/{spaces → groups}/broadcast-codec.js +0 -0
- /package/lib/{spaces → groups}/invite-payload.js +0 -0
- /package/lib/{spaces → groups}/mls-json.d.ts +0 -0
- /package/lib/{spaces → groups}/mls-json.js +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Logger } from '@kubun/logger';
|
|
2
|
+
import type { P2PStoreAPI } from '@kubun/store-p2p';
|
|
3
|
+
import { type BroadcastService } from '../groups/broadcast-service.js';
|
|
4
|
+
/**
|
|
5
|
+
* Shape of a message pushed by `hub/receive`. Matches `@enkaku/hub-protocol`
|
|
6
|
+
* server-to-client push payload.
|
|
7
|
+
*/
|
|
8
|
+
export type ReceivedHubMessage = {
|
|
9
|
+
sequenceID: string;
|
|
10
|
+
senderDID: string;
|
|
11
|
+
groupID?: string;
|
|
12
|
+
/** base64-encoded encrypted MLS application message */
|
|
13
|
+
payload: string;
|
|
14
|
+
};
|
|
15
|
+
export type HandleReceivedMessageParams = {
|
|
16
|
+
groupID: string;
|
|
17
|
+
deviceID: string;
|
|
18
|
+
message: ReceivedHubMessage;
|
|
19
|
+
p2pStore: P2PStoreAPI;
|
|
20
|
+
broadcastService: BroadcastService;
|
|
21
|
+
logger?: Logger;
|
|
22
|
+
};
|
|
23
|
+
export type HandleReceivedMessageResult = {
|
|
24
|
+
ack: boolean;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Apply a single hub-received message for a group.
|
|
28
|
+
*
|
|
29
|
+
* Returns `{ ack: true }` when the message has been processed to a state where
|
|
30
|
+
* redelivery serves no purpose (applied successfully, or decrypt failed with
|
|
31
|
+
* no recovery path). Returns `{ ack: false }` when the hub should redeliver
|
|
32
|
+
* (transient apply or save failure, MLS state missing, unexpected error).
|
|
33
|
+
* Skips with `{ ack: false }` on groupID mismatch so the message stays queued
|
|
34
|
+
* for whichever recipient it was intended for.
|
|
35
|
+
*/
|
|
36
|
+
export declare function handleReceivedMessage(params: HandleReceivedMessageParams): Promise<HandleReceivedMessageResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{fromB64 as e}from"@enkaku/codec";import{ApplyError as r,DecryptError as a}from"../groups/broadcast-service.js";import{fromMLSStateRow as s,toMLSStateInsert as t}from"../groups/mls-state.js";export async function handleReceivedMessage(c){let n,{groupID:u,deviceID:i,message:o,p2pStore:p,broadcastService:l,logger:g}=c;if(o.groupID!==u)return g?.debug("hub message groupID mismatch, skipping",{groupID:u,messageGroupID:o.groupID,sequenceID:o.sequenceID}),{ack:!1};let d=await p.getMLSState(u,i);if(null==d)return g?.warn("mls state missing for group, skipping message",{groupID:u,sequenceID:o.sequenceID}),{ack:!1};let m=s(d),D=e(o.payload);try{n=await l.processReceived({groupID:u,encrypted:D,groupState:m})}catch(e){if(e instanceof a)return g?.debug("decrypt failed, acking and skipping",{groupID:u,sequenceID:o.sequenceID,error:e}),{ack:!0};if(e instanceof r)return g?.error("broadcast apply failed, will redeliver",{groupID:u,sequenceID:o.sequenceID,error:e}),{ack:!1};return g?.error("unexpected error processing hub message",{groupID:u,sequenceID:o.sequenceID,error:e}),{ack:!1}}try{await p.saveMLSState(t(n.updatedGroupState,u,i))}catch(e){return g?.error("save mls state failed after apply, will redeliver",{groupID:u,sequenceID:o.sequenceID,error:e}),{ack:!1}}return{ack:!0}}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Client } from '@enkaku/client';
|
|
2
|
+
import type { HubProtocol } from '@enkaku/hub-protocol';
|
|
3
|
+
import type { Logger } from '@kubun/logger';
|
|
4
|
+
import type { P2PStoreAPI } from '@kubun/store-p2p';
|
|
5
|
+
import type { GroupBroadcastMessage } from '../groups/broadcast.js';
|
|
6
|
+
import type { BroadcastService } from '../groups/broadcast-service.js';
|
|
7
|
+
import { GroupChannel, type GroupChannelParams } from './group-channel.js';
|
|
8
|
+
export type CreateHubClient = (hubURL: string) => Promise<Client<HubProtocol>>;
|
|
9
|
+
export type CreateGroupChannel = (params: GroupChannelParams) => GroupChannel;
|
|
10
|
+
export type HubRelayManagerParams = {
|
|
11
|
+
p2pStore: P2PStoreAPI;
|
|
12
|
+
broadcastService: BroadcastService;
|
|
13
|
+
deviceID: string;
|
|
14
|
+
createHubClient: CreateHubClient;
|
|
15
|
+
logger?: Logger;
|
|
16
|
+
ackFlushMs?: number;
|
|
17
|
+
ackFlushMax?: number;
|
|
18
|
+
backoffBaseMs?: number;
|
|
19
|
+
backoffMaxMs?: number;
|
|
20
|
+
backoffJitter?: number;
|
|
21
|
+
createGroupChannel?: CreateGroupChannel;
|
|
22
|
+
};
|
|
23
|
+
export declare class HubRelayManager {
|
|
24
|
+
#private;
|
|
25
|
+
constructor(params: HubRelayManagerParams);
|
|
26
|
+
/**
|
|
27
|
+
* Open channels for each group in parallel. Per-group failures are logged
|
|
28
|
+
* and swallowed: this method never rejects, so a single bad group does not
|
|
29
|
+
* block the others from starting. Callers who need per-group readiness
|
|
30
|
+
* signals must check `addGroup` / `broadcast` results individually.
|
|
31
|
+
*/
|
|
32
|
+
start(groupIDs: Array<string>): Promise<void>;
|
|
33
|
+
addGroup(groupID: string): Promise<void>;
|
|
34
|
+
removeGroup(groupID: string): Promise<void>;
|
|
35
|
+
broadcast(groupID: string, message: GroupBroadcastMessage): Promise<void>;
|
|
36
|
+
stop(): Promise<void>;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{HubConnectionPool as e}from"./connection-pool.js";import{GroupChannel as a}from"./group-channel.js";export class HubRelayManager{#e;#a;#t;#s;#r;#o;#i;#l;#c;#h;#u;#p=new Map;constructor(t){this.#e=t.p2pStore,this.#a=t.broadcastService,this.#t=t.deviceID,this.#r=t.logger,this.#o=t.ackFlushMs??500,this.#i=t.ackFlushMax??10,this.#l=t.backoffBaseMs??1e3,this.#c=t.backoffMaxMs??6e4,this.#h=t.backoffJitter??.25,this.#s=new e({createHubClient:t.createHubClient,logger:t.logger}),this.#u=t.createGroupChannel??(e=>new a(e))}async start(e){(await Promise.allSettled(e.map(e=>this.addGroup(e)))).forEach((a,t)=>{"rejected"===a.status&&this.#r?.error("addGroup failed during start",{groupID:e[t],error:a.reason})})}async addGroup(e){if(this.#p.has(e))return void this.#r?.debug("group already added",{groupID:e});let a=await this.#e.getGroup(e);if(null==a)throw Error(`Group ${e} not found`);let t=a.hub_urls;if(null==t||0===t.length)return void this.#r?.warn("group has no hub URLs, skipping",{groupID:e});t.length>1&&this.#r?.warn("multi-hub not yet supported, using first",{groupID:e,hubURLs:t});let s=this.#u({groupID:e,hubURL:t[0],deviceID:this.#t,pool:this.#s,broadcastService:this.#a,p2pStore:this.#e,logger:this.#r,ackFlushMs:this.#o,ackFlushMax:this.#i,backoffBaseMs:this.#l,backoffMaxMs:this.#c,backoffJitter:this.#h});await s.open(),this.#p.set(e,s)}async removeGroup(e){let a=this.#p.get(e);null!=a&&(this.#p.delete(e),await a.close())}async broadcast(e,a){let t=this.#p.get(e);if(null==t)throw Error(`Group ${e} is not active in HubRelayManager`);await t.broadcast(a)}async stop(){let e=[...this.#p.values()];this.#p.clear(),(await Promise.allSettled(e.map(e=>e.close()))).forEach(e=>{"rejected"===e.status&&this.#r?.warn("GroupChannel close failed",{error:e.reason})}),await this.#s.disposeAll()}}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Client } from '@enkaku/client';
|
|
2
|
+
import type { HubProtocol } from '@enkaku/hub-protocol';
|
|
3
|
+
import type { Logger } from '@kubun/logger';
|
|
4
|
+
import type { P2PStoreAPI } from '@kubun/store-p2p';
|
|
5
|
+
import type { GroupBroadcastMessage } from '../groups/broadcast.js';
|
|
6
|
+
import type { BroadcastService } from '../groups/broadcast-service.js';
|
|
7
|
+
export type HandleSendBroadcastParams = {
|
|
8
|
+
groupID: string;
|
|
9
|
+
deviceID: string;
|
|
10
|
+
message: GroupBroadcastMessage;
|
|
11
|
+
p2pStore: P2PStoreAPI;
|
|
12
|
+
broadcastService: BroadcastService;
|
|
13
|
+
hubClient: Client<HubProtocol>;
|
|
14
|
+
logger?: Logger;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Encrypt + send a broadcast for a group, then persist the advanced MLS state.
|
|
18
|
+
*
|
|
19
|
+
* Failure semantics:
|
|
20
|
+
* - Missing MLS state for (group, device) → throw, caller cannot broadcast.
|
|
21
|
+
* - `prepareSend` failure → throw, no save (epoch unchanged on disk).
|
|
22
|
+
* - `hub/group/send` failure → throw, do NOT save advanced MLS state.
|
|
23
|
+
* Prevents an MLS epoch wedge where local state outpaces recipients.
|
|
24
|
+
* - `saveMLSState` failure → throw. State has advanced in memory; on next call
|
|
25
|
+
* the load-from-disk path will re-derive a fresh handle from the prior epoch
|
|
26
|
+
* and re-encrypt. (Wedge protection only applies pre-save by design.)
|
|
27
|
+
*/
|
|
28
|
+
export declare function handleSendBroadcast(params: HandleSendBroadcastParams): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{toB64 as a}from"@enkaku/codec";import{fromMLSStateRow as r,toMLSStateInsert as t}from"../groups/mls-state.js";export async function handleSendBroadcast(e){let{groupID:o,deviceID:s,message:n,p2pStore:i,broadcastService:p,hubClient:d,logger:u}=e,c=await i.getMLSState(o,s);if(null==c)throw Error(`MLS state missing for group ${o}; cannot broadcast`);let l=r(c),{encrypted:m,updatedGroupState:S}=await p.prepareSend({groupID:o,message:n,groupState:l});try{await d.request("hub/group/send",{param:{groupID:o,payload:a(m)}})}catch(a){throw u?.error("hub/group/send failed",{groupID:o,error:a}),a}await i.saveMLSState(t(S,o,s))}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import type { KubunPlugin, PluginFactoryParams } from '@kubun/engine';
|
|
2
2
|
export type { ContextDeps, PendingJoinRequest } from './context/types.js';
|
|
3
|
+
export { type GroupBroadcastMessage, type ProcessBroadcastParams, processBroadcast, } from './groups/broadcast.js';
|
|
4
|
+
export { deserializeBroadcast, serializeBroadcast } from './groups/broadcast-codec.js';
|
|
5
|
+
export { ApplyError, type BroadcastEvent, BroadcastService, type BroadcastServiceEvents, type BroadcastServiceParams, DecryptError, type ReceiveBroadcastParams, type ReceiveBroadcastResult, type SendBroadcastParams, type SendBroadcastResult, } from './groups/broadcast-service.js';
|
|
6
|
+
export { createFilteredGenerator, createGroupEventEmitter, type GroupEventEmitter, type GroupEventMap, } from './groups/events.js';
|
|
7
|
+
export { decodeFullJoinRequest, decodeInvitePayload, decodeJoinRequest, encodeFullJoinRequest, encodeInvitePayload, encodeJoinRequest, type FullJoinRequestPayload, type InvitePayload, type JoinRequestPayload, } from './groups/invite-payload.js';
|
|
8
|
+
export { type AddCircleMemberParams, type AddCircleMemberResult, type CreateCircleParams, type CreateCircleResult, type CreateGroupParams, type CreateGroupResult, type DeleteCircleParams, type DeleteCircleResult, GroupManager, type GroupManagerParams, type InviteToGroupParams, type InviteToGroupResult, type JoinGroupParams, type JoinGroupResult, type LeaveGroupParams, type LeaveGroupResult, type RemoveCircleMemberParams, type RemoveCircleMemberResult, type RemoveGroupMemberParams, type RemoveGroupMemberResult, type RemoveMemberParams, type RemoveMemberResult, type UpdateCircleParams, type UpdateCircleResult, type UpdateGroupParams, type UpdateGroupResult, } from './groups/manager.js';
|
|
9
|
+
export { type MLSGroupHandle, restoreMLSGroupHandle } from './groups/mls-group-handle.js';
|
|
10
|
+
export { replacer as mlsJSONReplacer, reviver as mlsJSONReviver } from './groups/mls-json.js';
|
|
11
|
+
export { deserializeMLSGroupState, type MLSGroupState, type SerializedMLSGroupState, serializeMLSGroupState, } from './groups/mls-state.js';
|
|
3
12
|
export type { SyncClientMessage, SyncProtocol, SyncServerMessage } from './protocol.js';
|
|
4
13
|
export { createP2PSchemaExtension } from './schema.js';
|
|
5
|
-
export { type ProcessBroadcastParams, processBroadcast, type SpaceBroadcastMessage, } from './spaces/broadcast.js';
|
|
6
|
-
export { deserializeBroadcast, serializeBroadcast } from './spaces/broadcast-codec.js';
|
|
7
|
-
export { type BroadcastEvent, BroadcastService, type BroadcastServiceEvents, type BroadcastServiceParams, type ReceiveBroadcastParams, type ReceiveBroadcastResult, type SendBroadcastParams, type SendBroadcastResult, } from './spaces/broadcast-service.js';
|
|
8
|
-
export { createFilteredGenerator, createSpaceEventEmitter, type SpaceEventEmitter, type SpaceEventMap, } from './spaces/events.js';
|
|
9
|
-
export { restoreGroupHandle } from './spaces/group-handle.js';
|
|
10
|
-
export { decodeFullJoinRequest, decodeInvitePayload, decodeJoinRequest, encodeFullJoinRequest, encodeInvitePayload, encodeJoinRequest, type FullJoinRequestPayload, type InvitePayload, type JoinRequestPayload, } from './spaces/invite-payload.js';
|
|
11
|
-
export { type AddCircleMemberParams, type AddCircleMemberResult, type CreateCircleParams, type CreateCircleResult, type CreateSpaceParams, type CreateSpaceResult, type DeleteCircleParams, type DeleteCircleResult, type InviteToSpaceParams, type InviteToSpaceResult, type JoinSpaceParams, type JoinSpaceResult, type LeaveSpaceParams, type LeaveSpaceResult, type RemoveCircleMemberParams, type RemoveCircleMemberResult, type RemoveMemberParams, type RemoveMemberResult, type RemoveSpaceMemberParams, type RemoveSpaceMemberResult, SpaceManager, type SpaceManagerParams, type UpdateCircleParams, type UpdateCircleResult, type UpdateSpaceParams, type UpdateSpaceResult, } from './spaces/manager.js';
|
|
12
|
-
export { replacer as mlsJSONReplacer, reviver as mlsJSONReviver } from './spaces/mls-json.js';
|
|
13
|
-
export { deserializeGroupState, type GroupState, type SerializedGroupState, serializeGroupState, } from './spaces/mls-state.js';
|
|
14
14
|
export { type CatalogSyncScope, resolveCatalogSyncScopes } from './sync/catalog-scope.js';
|
|
15
15
|
export { checkSyncDelegation, negotiateDirection } from './sync/handlers.js';
|
|
16
16
|
export { type PeerConfig, type PeerConfigWithID, PeerRegistry } from './sync/peer-registry.js';
|
|
17
17
|
export { SyncClient, type SyncClientParams, type SyncScope, type SyncTransportProvider, } from './sync/sync-client.js';
|
|
18
18
|
export { type SyncEvent, SyncManager, type SyncManagerParams, type SyncSessionInfo, type SyncStatus, } from './sync/sync-manager.js';
|
|
19
|
-
export type {
|
|
19
|
+
export type { GroupChannel, GroupChannelParams } from './hub/group-channel.js';
|
|
20
|
+
export { type CreateGroupChannel, type CreateHubClient, HubRelayManager, type HubRelayManagerParams, } from './hub/relay-manager.js';
|
|
21
|
+
export type { CatalogData, CircleData, CircleMemberData, DeleteCatalogData, DeleteCircleData, GroupData, GroupMemberData, GroupRequestContext, InviteToGroupData, JoinGroupData, LeaveGroupData, P2PJoinRequestContext, RemoveCircleMemberData, RemoveGroupMemberData, SyncPluginAPI, SyncRequestContext, SyncSessionResult, UpdateCircleInput, UpdateGroupInput, } from './types.js';
|
|
20
22
|
export type P2PPluginOptions = {
|
|
21
23
|
autoAcceptPeers?: Array<string>;
|
|
22
24
|
http?: boolean | string;
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ServerTransport as e}from"@enkaku/http-server-transport";import{Server as r}from"@enkaku/server";import{DirectTransports as t}from"@enkaku/transport";import{HLC as
|
|
1
|
+
import{ServerTransport as e}from"@enkaku/http-server-transport";import{Server as r}from"@enkaku/server";import{DirectTransports as t}from"@enkaku/transport";import{HLC as o}from"@kubun/hlc";import{p2pStoreDefinition as s}from"@kubun/store-p2p";import{createGroupContext as n}from"./context/group.js";import{createJoinContext as a}from"./context/join.js";import{createSyncContext as i}from"./context/sync.js";import{createGroupEventEmitter as p}from"./groups/events.js";import{GroupManager as c}from"./groups/manager.js";import{createP2PSchemaExtension as m}from"./schema.js";import{createSyncHandlers as g}from"./sync/handlers.js";import{SyncManager as d}from"./sync/sync-manager.js";export{processBroadcast}from"./groups/broadcast.js";export{deserializeBroadcast,serializeBroadcast}from"./groups/broadcast-codec.js";export{ApplyError,BroadcastService,DecryptError}from"./groups/broadcast-service.js";export{createFilteredGenerator,createGroupEventEmitter}from"./groups/events.js";export{decodeFullJoinRequest,decodeInvitePayload,decodeJoinRequest,encodeFullJoinRequest,encodeInvitePayload,encodeJoinRequest}from"./groups/invite-payload.js";export{GroupManager}from"./groups/manager.js";export{restoreMLSGroupHandle}from"./groups/mls-group-handle.js";export{replacer as mlsJSONReplacer,reviver as mlsJSONReviver}from"./groups/mls-json.js";export{deserializeMLSGroupState,serializeMLSGroupState}from"./groups/mls-state.js";export{createP2PSchemaExtension}from"./schema.js";export{resolveCatalogSyncScopes}from"./sync/catalog-scope.js";export{checkSyncDelegation,negotiateDirection}from"./sync/handlers.js";export{PeerRegistry}from"./sync/peer-registry.js";export{SyncClient}from"./sync/sync-client.js";export{SyncManager}from"./sync/sync-manager.js";export{HubRelayManager}from"./hub/relay-manager.js";export function createP2PPlugin(l){return u=>{let y,f;u.db.register(s);let j=u.db.adapter,h=u.identity,v=new o({nodeID:h.id}),x=new c({identity:h,getRandomID:u.runtime.getRandomID}),P=p(),S=new d({deployClusters:async e=>{let r=Object.values(e);await u.engine.deployGraph({clusters:r})},runtime:u.runtime,identity:u.identity,logger:u.getLogger("sync")}),b=g({db:u.db,logger:u.getLogger("sync-handlers"),peerRegistry:S.peerRegistry}),R=new Map,w=[],k={addPeer:e=>S.addPeer({config:e,stores:u.db}),removePeer:e=>S.removePeer({peerDID:e,stores:u.db}),listPeers:()=>S.listPeers({stores:u.db}),syncWithPeer:e=>S.merkleSyncWithPeer({...e,stores:u.db}),getStatus:e=>S.getStatus({peerDID:e,stores:u.db}),onSyncEvent:e=>S.onSyncEvent(e),createSyncTransport:function(e){let o=new t({signal:e}),s=new r({accessControl:!1,getRandomID:u.runtime.getRandomID,handlers:b,logger:u.getLogger("sync-server"),transports:[o.server],signal:e});return w.push(s),o.client}};if(l?.http){let t="string"==typeof l.http?l.http.replace(/^\//,""):"sync";k.syncReady=(async()=>{let o=await u.engine.getAPI("http");await o.listening,y=new e({allowedOrigin:["*"]}),f=new r({accessControl:!1,getRandomID:u.runtime.getRandomID,handlers:b,logger:u.getLogger("sync-http-server"),transports:[y]}),w.push(f),o.registerProtocol(t,y.fetch.bind(y))})()}return{name:"p2p",schemaExtension:e=>m(P),api:k,createContextFactory:()=>(e,r)=>{let t={identity:h,groupManager:x,syncManager:S,stores:r,adapter:j,hlc:v,emitter:P,pendingJoinRequests:R,runtime:u.runtime,autoAcceptPeers:l?.autoAcceptPeers};return{...n(e,t),...i(e,t),...a(e,t)}},dispose:async()=>{for(let e of w)await e.dispose();await y?.dispose(),await S.dispose()}}}}
|
package/lib/schema.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { SchemaExtension } from '@kubun/engine';
|
|
2
|
-
import { type
|
|
3
|
-
export declare function createP2PSchemaExtension(emitter:
|
|
2
|
+
import { type GroupEventEmitter } from './groups/events.js';
|
|
3
|
+
export declare function createP2PSchemaExtension(emitter: GroupEventEmitter): SchemaExtension;
|
package/lib/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createFilteredGenerator as e}from"./
|
|
2
|
-
type
|
|
1
|
+
import{createFilteredGenerator as e}from"./groups/events.js";let r=`
|
|
2
|
+
type PeerGroup {
|
|
3
3
|
id: ID!
|
|
4
4
|
name: String!
|
|
5
5
|
description: String
|
|
@@ -7,8 +7,8 @@ type PeerSpace {
|
|
|
7
7
|
createdAt: String!
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
type
|
|
11
|
-
|
|
10
|
+
type PeerGroupMember {
|
|
11
|
+
groupID: ID!
|
|
12
12
|
memberDID: String!
|
|
13
13
|
role: String!
|
|
14
14
|
createdAt: String!
|
|
@@ -16,7 +16,7 @@ type PeerSpaceMember {
|
|
|
16
16
|
|
|
17
17
|
type PeerCircle {
|
|
18
18
|
id: ID!
|
|
19
|
-
|
|
19
|
+
groupID: ID!
|
|
20
20
|
name: String!
|
|
21
21
|
description: String
|
|
22
22
|
createdAt: String!
|
|
@@ -38,23 +38,23 @@ type PeerCatalog {
|
|
|
38
38
|
createdAt: String!
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
input
|
|
41
|
+
input CreateGroupInput {
|
|
42
42
|
name: String!
|
|
43
43
|
description: String
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
type
|
|
47
|
-
|
|
46
|
+
type CreateGroupPayload {
|
|
47
|
+
group: PeerGroup!
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
type
|
|
50
|
+
type InviteToGroupPayload {
|
|
51
51
|
invitePayload: String!
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
groupID: ID!
|
|
53
|
+
groupName: String!
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
type
|
|
57
|
-
|
|
56
|
+
type JoinGroupPayload {
|
|
57
|
+
group: PeerGroup
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
type PrepareJoinRequestPayload {
|
|
@@ -62,15 +62,15 @@ type PrepareJoinRequestPayload {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
type CompleteJoinPayload {
|
|
65
|
-
|
|
65
|
+
group: PeerGroup
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
type
|
|
69
|
-
|
|
68
|
+
type LeaveGroupPayload {
|
|
69
|
+
groupID: ID!
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
type
|
|
73
|
-
|
|
72
|
+
type RemoveGroupMemberPayload {
|
|
73
|
+
groupID: ID!
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
input UpdateCatalogInput {
|
|
@@ -79,14 +79,14 @@ input UpdateCatalogInput {
|
|
|
79
79
|
filterCriteria: String
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
input
|
|
83
|
-
|
|
82
|
+
input UpdateGroupInput {
|
|
83
|
+
groupID: ID!
|
|
84
84
|
name: String
|
|
85
85
|
description: String
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
type
|
|
89
|
-
|
|
88
|
+
type UpdateGroupPayload {
|
|
89
|
+
group: PeerGroup!
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
input UpdateCircleInput {
|
|
@@ -141,28 +141,28 @@ type RemoveSyncPeerPayload {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
extend type Query {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
circles(
|
|
144
|
+
groups: [PeerGroup!]!
|
|
145
|
+
group(id: ID!): PeerGroup
|
|
146
|
+
groupMembers(groupID: ID!): [PeerGroupMember!]!
|
|
147
|
+
circles(groupID: ID!): [PeerCircle!]!
|
|
148
148
|
syncPeers: [SyncPeer!]!
|
|
149
149
|
syncStatus: SyncStatus!
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
extend type Mutation {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
createCircle(
|
|
153
|
+
createGroup(input: CreateGroupInput!): CreateGroupPayload!
|
|
154
|
+
addGroupMember(groupID: ID!, memberDID: String!, role: String!): PeerGroupMember!
|
|
155
|
+
createCircle(groupID: ID!, name: String!, description: String): PeerCircle!
|
|
156
156
|
addCircleMember(circleID: ID!, memberDID: String!, role: String!): PeerCircleMember!
|
|
157
157
|
createCatalog(name: String!, description: String, filterCriteria: String!): PeerCatalog!
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
inviteToGroup(groupID: ID!, joinRequest: String!): InviteToGroupPayload!
|
|
159
|
+
joinGroup(invitePayload: String!, joinRequestPayload: String!): JoinGroupPayload!
|
|
160
160
|
prepareJoinRequest: PrepareJoinRequestPayload!
|
|
161
161
|
completeJoin(invitePayload: String!): CompleteJoinPayload!
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
leaveGroup(groupID: ID!): LeaveGroupPayload!
|
|
163
|
+
removeGroupMember(groupID: ID!, memberDID: String!): RemoveGroupMemberPayload!
|
|
164
164
|
updateCatalog(input: UpdateCatalogInput!): PeerCatalog!
|
|
165
|
-
|
|
165
|
+
updateGroup(input: UpdateGroupInput!): UpdateGroupPayload!
|
|
166
166
|
updateCircle(input: UpdateCircleInput!): UpdateCirclePayload!
|
|
167
167
|
deleteCatalog(catalogID: ID!): DeleteCatalogPayload!
|
|
168
168
|
deleteCircle(circleID: ID!): DeleteCirclePayload!
|
|
@@ -172,16 +172,16 @@ extend type Mutation {
|
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
extend type Subscription {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
circleCreated(
|
|
181
|
-
circleDeleted(
|
|
175
|
+
groupJoined: PeerGroup!
|
|
176
|
+
groupLeft: PeerGroup!
|
|
177
|
+
groupDataChanged(groupID: ID!): PeerGroup!
|
|
178
|
+
groupMemberJoined(groupID: ID!): PeerGroupMember!
|
|
179
|
+
groupMemberLeft(groupID: ID!): PeerGroupMember!
|
|
180
|
+
circleCreated(groupID: ID!): PeerCircle!
|
|
181
|
+
circleDeleted(groupID: ID!): PeerCircle!
|
|
182
182
|
circleDataChanged(circleID: ID!): PeerCircle!
|
|
183
183
|
circleMemberAdded(circleID: ID!): PeerCircleMember!
|
|
184
184
|
circleMemberRemoved(circleID: ID!): PeerCircleMember!
|
|
185
185
|
circleCatalogsChanged(circleID: ID!): PeerCircle!
|
|
186
186
|
}
|
|
187
|
-
`;export function createP2PSchemaExtension(
|
|
187
|
+
`;export function createP2PSchemaExtension(t){return{sdl:r,resolvers:{queryFields:{groups:async(e,r,t)=>await t.p2pGetGroups(),group:async(e,r,t)=>await t.p2pGetGroup(r.id),groupMembers:async(e,r,t)=>await t.p2pGetGroupMembers(r.groupID),circles:async(e,r,t)=>await t.p2pGetCircles(r.groupID),syncPeers:async(e,r,t)=>await t.syncListPeers(),syncStatus:(e,r,t)=>{let i=t.syncGetStatus();return{...i,lastSyncByPeer:JSON.stringify(i.lastSyncByPeer)}}},mutationFields:{createGroup:async(e,r,t)=>{let i=r.input;return{group:await t.p2pCreateGroup(i)}},addGroupMember:async(e,r,t)=>await t.p2pAddGroupMember(r.groupID,r.memberDID,r.role),createCircle:async(e,r,t)=>await t.p2pCreateCircle({groupID:r.groupID,name:r.name,description:r.description}),addCircleMember:async(e,r,t)=>await t.p2pAddCircleMember(r.circleID,r.memberDID,r.role),createCatalog:async(e,r,t)=>await t.p2pCreateCatalog({name:r.name,description:r.description,filterCriteria:r.filterCriteria}),inviteToGroup:async(e,r,t)=>await t.p2pInviteToGroup(r.groupID,r.joinRequest),joinGroup:async(e,r,t)=>await t.p2pJoinGroup(r.invitePayload,r.joinRequestPayload),prepareJoinRequest:async(e,r,t)=>await t.p2pPrepareJoinRequest(),completeJoin:async(e,r,t)=>await t.p2pCompleteJoin(r.invitePayload),leaveGroup:async(e,r,t)=>await t.p2pLeaveGroup(r.groupID),removeGroupMember:async(e,r,t)=>await t.p2pRemoveGroupMember(r.groupID,r.memberDID),updateCatalog:async(e,r,t)=>{let i=r.input;return await t.p2pUpdateCatalog(i)},updateGroup:async(e,r,t)=>{let i=r.input;return{group:await t.p2pUpdateGroup(i)}},updateCircle:async(e,r,t)=>{let i=r.input;return{circle:await t.p2pUpdateCircle(i)}},deleteCatalog:async(e,r,t)=>await t.p2pDeleteCatalog(r.catalogID),deleteCircle:async(e,r,t)=>await t.p2pDeleteCircle(r.circleID),removeCircleMember:async(e,r,t)=>await t.p2pRemoveCircleMember(r.circleID,r.memberDID),addSyncPeer:async(e,r,t)=>(await t.syncAddPeer({peerDID:r.peerDID,endpoint:r.endpoint,mode:r.mode??"on-demand",allowedUsers:{all:!0},priority:r.priority??"0",trustLevel:r.trustLevel??"trusted"}),!0),removeSyncPeer:async(e,r,t)=>(await t.syncRemovePeer(r.peerDID),{success:!0})},subscriptionFields:{groupJoined:{resolve:e=>e,subscribe:()=>e(t,"groupJoined")},groupLeft:{resolve:e=>e,subscribe:()=>e(t,"groupLeft")},groupDataChanged:{resolve:e=>e,subscribe:(r,i)=>e(t,"groupDataChanged",e=>e.groupID===i.groupID)},groupMemberJoined:{resolve:e=>e,subscribe:(r,i)=>e(t,"groupMemberJoined",e=>e.groupID===i.groupID)},groupMemberLeft:{resolve:e=>e,subscribe:(r,i)=>e(t,"groupMemberLeft",e=>e.groupID===i.groupID)},circleCreated:{resolve:e=>e,subscribe:(r,i)=>e(t,"circleCreated",e=>e.groupID===i.groupID)},circleDeleted:{resolve:e=>e,subscribe:(r,i)=>e(t,"circleDeleted",e=>e.groupID===i.groupID)},circleDataChanged:{resolve:e=>e,subscribe:(r,i)=>e(t,"circleDataChanged",e=>e.circleID===i.circleID)},circleMemberAdded:{resolve:e=>e,subscribe:(r,i)=>e(t,"circleMemberAdded",e=>e.circleID===i.circleID)},circleMemberRemoved:{resolve:e=>e,subscribe:(r,i)=>e(t,"circleMemberRemoved",e=>e.circleID===i.circleID)},circleCatalogsChanged:{resolve:e=>e,subscribe:(r,i)=>e(t,"circleCatalogsChanged",e=>e.circleID===i.circleID)}}}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getGraphStore as e}from"@kubun/store-graph";import{
|
|
1
|
+
import{getGraphStore as e}from"@kubun/store-graph";import{getP2PStore as r}from"@kubun/store-p2p";export async function resolveCatalogSyncScopes(l,t,o){let[a,i]=await Promise.all([e(l),r(l)]),s=new Set,f=new Set,n=!1;for(let e of t){let r=await a.resolveCatalogScope(e);if(null!=r.models)for(let e of r.models)s.add(e);if(null!=r.owners)for(let e of(n=!0,r.owners))f.add(e);let l=await a.getCatalog(e);if(null!=l){let e=l.filter_criteria;if(null!=e.circles&&e.circles.length>0)for(let r of(n=!0,e.circles))for(let e of(await i.listCircleMembers(r)))f.add(e.member_did)}}let d=Array.from(s),m=n?Array.from(f):void 0,u=new Set(o??[]),c=new Set,w=new Set;return await Promise.all(d.map(async e=>{let r=await a.getClusterForModel(e);null!=r&&(c.add(r),u.has(e)||w.add(r))})),{modelIDs:d,owners:m,requiredClusterIDs:Array.from(c),missingClusterIDs:Array.from(w)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{getP2PStore as e}from"@kubun/store-p2p";function t(e){var t,r;let i="string"==typeof(t=e.config)?JSON.parse(t):t??{};return{id:e.id,peerDID:e.peer_did,endpoint:e.endpoint,mode:e.mode,allowedUsers:"string"==typeof(r=e.allowed_users)?JSON.parse(r):r,priority:e.priority,trustLevel:e.trust_level,allowedDirection:i.allowedDirection,createdAt:e.created_at,updatedAt:e.updated_at}}export class PeerRegistry{#e;constructor(e){this.#e=e.runtime}async addPeer(t){let r=await e(t.stores);await r.addSyncPeer({id:this.#e.getRandomID(),peer_did:t.config.peerDID,endpoint:t.config.endpoint,mode:t.config.mode,allowed_users:t.config.allowedUsers,priority:t.config.priority,trust_level:t.config.trustLevel,config:{allowedDirection:t.config.allowedDirection},created_at:Date.now(),updated_at:Date.now()})}async getPeer(r){let i=await e(r.stores),o=await i.getSyncPeer(r.peerDID);if(o)return t(o)}async listPeers(r){let i=await e(r.stores);return(await i.listSyncPeers()).map(e=>t(e))}async updatePeer(t){let r=await this.getPeer({peerDID:t.peerDID,stores:t.stores});if(!r)throw Error(`Peer ${t.peerDID} not found`);let i={...r,...t.updates},o=await e(t.stores);await o.updateSyncPeer(t.peerDID,{endpoint:i.endpoint,mode:i.mode,allowed_users:i.allowedUsers,priority:i.priority,trust_level:i.trustLevel,config:{allowedDirection:i.allowedDirection}})}async removePeer(t){let r=await e(t.stores);await r.removeSyncPeer(t.peerDID)}async isPeerAllowed(e){return void 0!==await this.getPeer({peerDID:e.peerDID,stores:e.stores})}}
|
package/lib/types.d.ts
CHANGED
|
@@ -3,22 +3,22 @@ import type { SyncDirection, SyncProtocol } from './protocol.js';
|
|
|
3
3
|
import type { PeerConfig, PeerConfigWithID } from './sync/peer-registry.js';
|
|
4
4
|
import type { SyncScope } from './sync/sync-client.js';
|
|
5
5
|
import type { SyncEvent, SyncStatus } from './sync/sync-manager.js';
|
|
6
|
-
export type
|
|
6
|
+
export type GroupData = {
|
|
7
7
|
id: string;
|
|
8
8
|
name: string;
|
|
9
9
|
description: string;
|
|
10
10
|
createdBy: string;
|
|
11
11
|
createdAt: string;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
14
|
-
|
|
13
|
+
export type GroupMemberData = {
|
|
14
|
+
groupID: string;
|
|
15
15
|
memberDID: string;
|
|
16
16
|
role: string;
|
|
17
17
|
createdAt: string;
|
|
18
18
|
};
|
|
19
19
|
export type CircleData = {
|
|
20
20
|
id: string;
|
|
21
|
-
|
|
21
|
+
groupID: string;
|
|
22
22
|
name: string;
|
|
23
23
|
description: string;
|
|
24
24
|
createdAt: string;
|
|
@@ -37,19 +37,19 @@ export type CatalogData = {
|
|
|
37
37
|
filterCriteria: string;
|
|
38
38
|
createdAt: string;
|
|
39
39
|
};
|
|
40
|
-
export type
|
|
40
|
+
export type InviteToGroupData = {
|
|
41
41
|
invitePayload: string;
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
groupID: string;
|
|
43
|
+
groupName: string;
|
|
44
44
|
};
|
|
45
|
-
export type
|
|
46
|
-
|
|
45
|
+
export type JoinGroupData = {
|
|
46
|
+
group: GroupData | null;
|
|
47
47
|
};
|
|
48
|
-
export type
|
|
49
|
-
|
|
48
|
+
export type LeaveGroupData = {
|
|
49
|
+
groupID: string;
|
|
50
50
|
};
|
|
51
|
-
export type
|
|
52
|
-
|
|
51
|
+
export type RemoveGroupMemberData = {
|
|
52
|
+
groupID: string;
|
|
53
53
|
};
|
|
54
54
|
export type DeleteCatalogData = {
|
|
55
55
|
deletedID: string;
|
|
@@ -61,8 +61,8 @@ export type RemoveCircleMemberData = {
|
|
|
61
61
|
circleID: string;
|
|
62
62
|
memberDID: string;
|
|
63
63
|
};
|
|
64
|
-
export type
|
|
65
|
-
|
|
64
|
+
export type UpdateGroupInput = {
|
|
65
|
+
groupID: string;
|
|
66
66
|
name?: string;
|
|
67
67
|
description?: string;
|
|
68
68
|
};
|
|
@@ -72,42 +72,42 @@ export type UpdateCircleInput = {
|
|
|
72
72
|
description?: string;
|
|
73
73
|
catalogIDs?: Array<string>;
|
|
74
74
|
};
|
|
75
|
-
export type
|
|
76
|
-
|
|
75
|
+
export type GroupRequestContext = {
|
|
76
|
+
p2pCreateGroup: (input: {
|
|
77
77
|
name: string;
|
|
78
78
|
description?: string;
|
|
79
|
-
}) => Promise<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
}) => Promise<GroupData>;
|
|
80
|
+
p2pGetGroups: () => Promise<Array<GroupData>>;
|
|
81
|
+
p2pGetGroup: (id: string) => Promise<GroupData | null>;
|
|
82
|
+
p2pAddGroupMember: (groupID: string, memberDID: string, role: string) => Promise<GroupMemberData>;
|
|
83
|
+
p2pGetGroupMembers: (groupID: string) => Promise<Array<GroupMemberData>>;
|
|
84
|
+
p2pCreateCircle: (params: {
|
|
85
|
+
groupID: string;
|
|
86
86
|
name: string;
|
|
87
87
|
description?: string;
|
|
88
88
|
}) => Promise<CircleData>;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
p2pGetCircles: (groupID: string) => Promise<Array<CircleData>>;
|
|
90
|
+
p2pAddCircleMember: (circleID: string, memberDID: string, role: string) => Promise<CircleMemberData>;
|
|
91
|
+
p2pCreateCatalog: (params: {
|
|
92
92
|
name: string;
|
|
93
93
|
description?: string;
|
|
94
94
|
filterCriteria: string;
|
|
95
95
|
}) => Promise<CatalogData>;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
p2pGetCatalogs: (ownerDID?: string) => Promise<Array<CatalogData>>;
|
|
97
|
+
p2pInviteToGroup: (groupID: string, joinRequest: string) => Promise<InviteToGroupData>;
|
|
98
|
+
p2pJoinGroup: (invitePayload: string, joinRequestPayload: string) => Promise<JoinGroupData>;
|
|
99
|
+
p2pLeaveGroup: (groupID: string) => Promise<LeaveGroupData>;
|
|
100
|
+
p2pRemoveGroupMember: (groupID: string, memberDID: string) => Promise<RemoveGroupMemberData>;
|
|
101
|
+
p2pUpdateGroup: (input: UpdateGroupInput) => Promise<GroupData>;
|
|
102
|
+
p2pUpdateCircle: (input: UpdateCircleInput) => Promise<CircleData>;
|
|
103
|
+
p2pUpdateCatalog: (params: {
|
|
104
104
|
catalogID: string;
|
|
105
105
|
name?: string;
|
|
106
106
|
filterCriteria?: string;
|
|
107
107
|
}) => Promise<CatalogData>;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
108
|
+
p2pDeleteCatalog: (catalogID: string) => Promise<DeleteCatalogData>;
|
|
109
|
+
p2pDeleteCircle: (circleID: string) => Promise<DeleteCircleData>;
|
|
110
|
+
p2pRemoveCircleMember: (circleID: string, memberDID: string) => Promise<RemoveCircleMemberData>;
|
|
111
111
|
};
|
|
112
112
|
export type SyncRequestContext = {
|
|
113
113
|
syncAddPeer: (config: PeerConfig) => Promise<void>;
|
|
@@ -120,7 +120,7 @@ export type P2PJoinRequestContext = {
|
|
|
120
120
|
joinRequest: string;
|
|
121
121
|
}>;
|
|
122
122
|
p2pCompleteJoin: (invitePayload: string) => Promise<{
|
|
123
|
-
|
|
123
|
+
group: GroupData | null;
|
|
124
124
|
}>;
|
|
125
125
|
};
|
|
126
126
|
export type SyncSessionResult = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/plugin-p2p",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"license": "see LICENSE.md",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -14,45 +14,47 @@
|
|
|
14
14
|
],
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@enkaku/async": "^0.14.
|
|
17
|
+
"@enkaku/async": "^0.14.1",
|
|
18
18
|
"@enkaku/capability": "^0.14.0",
|
|
19
|
-
"@enkaku/client": "^0.14.
|
|
19
|
+
"@enkaku/client": "^0.14.4",
|
|
20
20
|
"@enkaku/codec": "^0.14.0",
|
|
21
21
|
"@enkaku/event": "^0.14.1",
|
|
22
22
|
"@enkaku/generator": "^0.14.0",
|
|
23
23
|
"@enkaku/group": "^0.14.6",
|
|
24
24
|
"@enkaku/http-client-transport": "^0.14.3",
|
|
25
25
|
"@enkaku/http-server-transport": "^0.14.2",
|
|
26
|
+
"@enkaku/hub-protocol": "^0.14.0",
|
|
26
27
|
"@enkaku/protocol": "^0.14.0",
|
|
27
28
|
"@enkaku/runtime": "^0.14.0",
|
|
28
29
|
"@enkaku/schema": "^0.14.0",
|
|
29
|
-
"@enkaku/server": "^0.14.
|
|
30
|
+
"@enkaku/server": "^0.14.4",
|
|
30
31
|
"@enkaku/stream": "^0.14.1",
|
|
31
32
|
"@enkaku/token": "0.14.1",
|
|
32
|
-
"@enkaku/transport": "0.14.
|
|
33
|
+
"@enkaku/transport": "0.14.1",
|
|
33
34
|
"@noble/hashes": "^2.2.0",
|
|
34
35
|
"graphql": "^16.13.2",
|
|
35
36
|
"kysely": "^0.28.16",
|
|
36
37
|
"@kubun/client": "^0.8.0",
|
|
37
|
-
"@kubun/
|
|
38
|
-
"@kubun/engine": "^0.8.1",
|
|
39
|
-
"@kubun/store-space": "^0.8.0",
|
|
40
|
-
"@kubun/db-adapter": "^0.8.1",
|
|
41
|
-
"@kubun/store-graph": "^0.8.0",
|
|
38
|
+
"@kubun/store-p2p": "^0.8.0",
|
|
42
39
|
"@kubun/graphql": "^0.8.1",
|
|
43
|
-
"@kubun/
|
|
40
|
+
"@kubun/engine": "^0.8.2",
|
|
44
41
|
"@kubun/id": "^0.8.0",
|
|
45
|
-
"@kubun/
|
|
42
|
+
"@kubun/hlc": "^0.8.0",
|
|
46
43
|
"@kubun/mutation": "^0.8.1",
|
|
47
|
-
"@kubun/
|
|
44
|
+
"@kubun/db": "^0.8.1",
|
|
45
|
+
"@kubun/store-graph": "^0.8.1",
|
|
46
|
+
"@kubun/protocol": "^0.8.1",
|
|
47
|
+
"@kubun/logger": "^0.8.0",
|
|
48
|
+
"@kubun/db-adapter": "^0.8.1"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
51
|
+
"@enkaku/hub-server": "^0.14.1",
|
|
50
52
|
"get-port": "^7.2.0",
|
|
51
53
|
"@kubun/db-better-sqlite": "^0.8.1",
|
|
52
54
|
"@kubun/plugin-connector": "^0.8.1",
|
|
55
|
+
"@kubun/plugin-rpc": "^0.8.1",
|
|
53
56
|
"@kubun/plugin-http": "^0.8.1",
|
|
54
|
-
"@kubun/test-utils": "^0.8.0"
|
|
55
|
-
"@kubun/plugin-rpc": "^0.8.1"
|
|
57
|
+
"@kubun/test-utils": "^0.8.0"
|
|
56
58
|
},
|
|
57
59
|
"scripts": {
|
|
58
60
|
"build:clean": "del lib",
|
package/lib/context/space.d.ts
DELETED