dsh-univer-office 0.3.0 → 0.3.1
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/docs/viewer-same-origin-deployment.md +1 -1
- package/lib/build-info.json +2 -2
- package/lib/index.js +24 -10
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@ DSH WebServer 上由本插件注册三个路由:
|
|
|
25
25
|
| --- | --- | --- |
|
|
26
26
|
| `/univer-viewer` | HTTP prefix | Viewer 文档与静态资源,原样转发到 Gateway 同路径 |
|
|
27
27
|
| `/uf` | HTTP prefix | Gateway 领域 API(snapshot/changeset/upload/authz 等),逐请求校验范围后转发 |
|
|
28
|
-
| `/univer-viewer/ws` | 精确路径 upgrade | WebSocket 隧道:`?target=/uf/...`
|
|
28
|
+
| `/univer-viewer/ws` | 精确路径 upgrade | WebSocket 隧道:`?target=/uf/...` 携带真实上游路径,外层其余 query 参数(端点协议,如 comb 握手的 `sessionTicket`)逐字转发上游 |
|
|
29
29
|
|
|
30
30
|
DSH WebServer 的 upgrade 注册只支持精确路径,而 Gateway 的 WS 端点路径是动态的
|
|
31
31
|
(`/uf/<key>[/worktrees/<id>]/universer-api/comb/connect` 与 `/uf/<key>[/worktrees/<id>]/events`),
|
package/lib/build-info.json
CHANGED
package/lib/index.js
CHANGED
|
@@ -9572,13 +9572,20 @@ async function resolveBrowserExecutablePath2(configured) {
|
|
|
9572
9572
|
if (process.platform !== "win32") return void 0;
|
|
9573
9573
|
const resolved = await C5({ env: process.env });
|
|
9574
9574
|
if (resolved.status !== "missing") return void 0;
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9575
|
+
return edgeBrowserCandidatePaths(process.env).find((candidate) => existsSync(candidate));
|
|
9576
|
+
}
|
|
9577
|
+
function edgeBrowserCandidatePaths(env) {
|
|
9578
|
+
const programFiles = env.ProgramFiles ?? "C:\\Program Files";
|
|
9579
|
+
const programFilesX86 = env["ProgramFiles(x86)"] ?? "C:\\Program Files (x86)";
|
|
9580
|
+
const candidates = [
|
|
9578
9581
|
join3(programFilesX86, "Microsoft", "Edge", "Application", "msedge.exe"),
|
|
9579
9582
|
join3(programFiles, "Microsoft", "Edge", "Application", "msedge.exe")
|
|
9580
9583
|
];
|
|
9581
|
-
|
|
9584
|
+
const localAppData = env.LOCALAPPDATA?.trim();
|
|
9585
|
+
if (localAppData !== void 0 && localAppData.length > 0) {
|
|
9586
|
+
candidates.push(join3(localAppData, "Microsoft", "Edge", "Application", "msedge.exe"));
|
|
9587
|
+
}
|
|
9588
|
+
return candidates;
|
|
9582
9589
|
}
|
|
9583
9590
|
function captureInput(source, target, signal) {
|
|
9584
9591
|
const common = signal === void 0 ? source : { ...source, signal };
|
|
@@ -12980,6 +12987,11 @@ connection: close\r
|
|
|
12980
12987
|
const bridgeTunnel = (req, socket, head, target, resolveOrigin, sessionIds) => {
|
|
12981
12988
|
void (async () => {
|
|
12982
12989
|
const upstreamUrl = new URL(target, rewriteLoopback(await resolveOrigin()));
|
|
12990
|
+
for (const [name7, value] of new URL(req.url ?? "/", "http://localhost").searchParams) {
|
|
12991
|
+
if (name7 !== "target") {
|
|
12992
|
+
upstreamUrl.searchParams.set(name7, value);
|
|
12993
|
+
}
|
|
12994
|
+
}
|
|
12983
12995
|
wss.handleUpgrade(req, socket, head, (client) => {
|
|
12984
12996
|
const pending = [];
|
|
12985
12997
|
let closed = false;
|
|
@@ -13007,17 +13019,18 @@ connection: close\r
|
|
|
13007
13019
|
}
|
|
13008
13020
|
};
|
|
13009
13021
|
bridges.add(close);
|
|
13010
|
-
client.on("message", (data) => {
|
|
13011
|
-
if (upstream.readyState === import_websocket.default.OPEN) upstream.send(data);
|
|
13012
|
-
else if (upstream.readyState === import_websocket.default.CONNECTING)
|
|
13022
|
+
client.on("message", (data, binary) => {
|
|
13023
|
+
if (upstream.readyState === import_websocket.default.OPEN) upstream.send(data, { binary });
|
|
13024
|
+
else if (upstream.readyState === import_websocket.default.CONNECTING)
|
|
13025
|
+
pending.push({ data: toBuffer(data), binary });
|
|
13013
13026
|
});
|
|
13014
13027
|
client.on("close", close);
|
|
13015
13028
|
client.on("error", close);
|
|
13016
13029
|
upstream.on("open", () => {
|
|
13017
|
-
for (const frame of pending.splice(0)) upstream.send(frame);
|
|
13030
|
+
for (const frame of pending.splice(0)) upstream.send(frame.data, { binary: frame.binary });
|
|
13018
13031
|
});
|
|
13019
|
-
upstream.on("message", (data) => {
|
|
13020
|
-
client.send(data);
|
|
13032
|
+
upstream.on("message", (data, binary) => {
|
|
13033
|
+
client.send(data, { binary });
|
|
13021
13034
|
});
|
|
13022
13035
|
upstream.on("close", close);
|
|
13023
13036
|
upstream.on("error", close);
|
|
@@ -13217,6 +13230,7 @@ export {
|
|
|
13217
13230
|
captureTelemetry,
|
|
13218
13231
|
createUniverRouter,
|
|
13219
13232
|
createViewerProxy,
|
|
13233
|
+
edgeBrowserCandidatePaths,
|
|
13220
13234
|
name6 as name,
|
|
13221
13235
|
parseTelemetryState,
|
|
13222
13236
|
resolveConfig,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-univer-office",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "DSH × Univer integration with a bundled collaboration Gateway and Viewer: inline previews, live floating Worktree windows, and session-end review actions in DeepSeek Harness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|