dsh-mobile-plugin 0.1.75 → 0.1.76
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/README.md +6 -0
- package/lib/mobile/attachments.js +15 -2
- package/lib/mobile/session-send.js +30 -1
- package/lib/mobile/sessions.js +4 -5
- package/lib/mobile/uploads.js +220 -0
- package/lib/mobile/workspaces.js +3 -2
- package/lib/panel/index.html +5 -5
- package/lib/routes/mobile-api.js +11 -0
- package/package.json +1 -1
package/lib/routes/mobile-api.js
CHANGED
|
@@ -37,6 +37,7 @@ const mobileCredentials = require('../mobile/credentials.js');
|
|
|
37
37
|
const subagents = require('../mobile/subagents.js');
|
|
38
38
|
const references = require('../mobile/references.js');
|
|
39
39
|
const plugins = require('../mobile/plugins.js');
|
|
40
|
+
const uploads = require('../mobile/uploads.js');
|
|
40
41
|
// 体检接口要自报身份:版本号只有一个来源,就是包自己的 package.json(与 relay/status.js 同)。
|
|
41
42
|
const pkg = require('../../package.json');
|
|
42
43
|
const desktopView = require('../desktop-view.cjs');
|
|
@@ -126,6 +127,7 @@ function registerMobileRoutes(deps) {
|
|
|
126
127
|
route('/api/mobile/v1/sessions', sessions.handleSessions)
|
|
127
128
|
route('/api/mobile/v1/session', sessions.handleSession)
|
|
128
129
|
route('/api/mobile/v1/session/messages', sessions.handleMessages)
|
|
130
|
+
route('/api/mobile/v1/session/attachment', sessions.handleSessionAttachment)
|
|
129
131
|
route('/api/mobile/v1/session/send', sessions.handleSend)
|
|
130
132
|
route('/api/mobile/v1/commands', sessions.handleCommands)
|
|
131
133
|
route('/api/mobile/v1/session/read', sessions.handleSessionRead)
|
|
@@ -224,6 +226,15 @@ function registerMobileRoutes(deps) {
|
|
|
224
226
|
// 经 typertGateway 命名空间 pluginInventory 取,见 mobile/plugins.js。
|
|
225
227
|
route('/api/mobile/v1/plugins', plugins.handlePlugins)
|
|
226
228
|
|
|
229
|
+
// 分享文件的落地通道(App 把手机分享进来的文件分片传上来,见 mobile/uploads.js)。
|
|
230
|
+
// 手机端没有「把文件交给宿主」的路:图片能进 session.send 的 base64 内容块,其它格式
|
|
231
|
+
// 一律进不去。四条端点只做「收字节 → 落盘到 ~/.dsh/mobile-inbox/<日期>/<文件名>」,
|
|
232
|
+
// 落盘路径由 App 写成 @提及 再随消息发给宿主,所以这里不认识工作区、也不认识会话。
|
|
233
|
+
route('/api/mobile/v1/upload/begin', uploads.handleUploadBegin)
|
|
234
|
+
route('/api/mobile/v1/upload/chunk', uploads.handleUploadChunk)
|
|
235
|
+
route('/api/mobile/v1/upload/finish', uploads.handleUploadFinish)
|
|
236
|
+
route('/api/mobile/v1/upload/abort', uploads.handleUploadAbort)
|
|
237
|
+
|
|
227
238
|
// 内置浏览器预览(App 侧「点 localhost 链接在内置浏览器里打开」的宿主端一半)。
|
|
228
239
|
//
|
|
229
240
|
// 这是一条 **WebSocket 升级**路由,不是普通 HTTP 路由:手机原生模块按端口在环回监听、
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobile-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.76",
|
|
4
4
|
"description": "Mobile API (/api/mobile/v1) and relay client for the DSH mobile app — desktop profile build (0.2.0-rc.2 compatible, peers resolved by the host)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|