@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/dist/client.js +4 -3
- package/dist/editor.js +41 -41
- package/dist/frontend.json +1 -1
- package/dist/interface.js +4 -3
- package/index.mjs +9 -5
- package/package.json +1 -1
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
|
|
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,
|
|
797
|
+
connection.register(ctx,RPC_CHANNEL,handleHost);
|
|
800
798
|
}else{
|
|
801
799
|
const handle=(endpoint,payload,signal,peer)=>
|
|
802
|
-
peer?.principal?.kind==='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});
|