@feng0531/dsh-vcs 0.10.5 → 0.10.6

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/index.mjs CHANGED
@@ -790,16 +790,14 @@ export function registerDirectAssets(ctx, load = filename => readFile(new URL('.
790
790
  }));
791
791
  }
792
792
 
793
- export function apply(ctx) {
794
- const host=createSvnHttpsHost(ctx,adapter);
795
- ctx.effect(()=>()=>{ host.dispose(); adapter.clearHistoricalCache?.(); });
793
+ export function registerVcsRpc(ctx, handleHost) {
796
794
  const connection=ctx.connection;
797
795
  if(!('browserPeer' in connection)){
798
796
  // Older hosts expose explicit owner registration.
799
- connection.register(ctx,RPC_CHANNEL,host.handle);
797
+ connection.register(ctx,RPC_CHANNEL,handleHost);
800
798
  }else{
801
799
  const handle=(endpoint,payload,signal,peer)=>
802
- peer?.principal?.kind==='owner'?host.handle(endpoint,payload,signal):failure('vcs/forbidden','VCS requires the local owner.');
800
+ peer?.principal?.kind==='owner'?handleHost(endpoint,payload,signal,peer):failure('vcs/forbidden','VCS requires the local owner.');
803
801
  if(typeof connection.authorizeIndex==='function' && typeof connection.register==='function'){
804
802
  // Pre-split authentication hosts can resolve webServer from Connection's
805
803
  // scope during rpc.handle(). Pass the VCS scope, which injects webServer.
@@ -808,6 +806,12 @@ export function apply(ctx) {
808
806
  connection.rpc.handle(RPC_CHANNEL,handle);
809
807
  }
810
808
  }
809
+ }
810
+
811
+ export function apply(ctx) {
812
+ const host=createSvnHttpsHost(ctx,adapter);
813
+ ctx.effect(()=>()=>{ host.dispose(); adapter.clearHistoricalCache?.(); });
814
+ registerVcsRpc(ctx,host.handle);
811
815
  registerAssets(ctx);
812
816
  registerDirectAssets(ctx);
813
817
  registerFrontendAssets(ctx,{running:runningFrontend});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feng0531/dsh-vcs",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "private": false,
5
5
  "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" },
6
6
  "type": "module",