|
|
hai 14 horas | |
|---|---|---|
| .. | ||
| README.md | hai 14 horas | |
| fmodeagent-chatthreads.id | hai 14 horas | |
| fmodeagent-chatthreads.js | hai 14 horas | |
平台把云函数存在 Parse 库的 Function 表(objectId 即前端调用的函数 id)。
本目录保存源码副本,便于 code review 与回滚;发布方式见下。
| 文件 | Function.objectId | name | path | version |
|---|---|---|---|---|
fmodeagent-chatthreads.js |
oR5O67i1Cm |
fmodeagent-chatthreads | /fmodeagent/chatthreads | 0.1.3(已热更 2026-11-01 05:06 UTC) |
v0.1.3 已热更到线上并经端到端验证(9/9 通过)。 改动:upsert 查重键从
(user, roomId, threadRoot)改为(user, threadRoot), 并折叠同一线程根的历史重复记录。 回滚用cloud/backup/oR5O67i1Cm-fmodeagent-chatthreads-v0.1.0.js覆盖code字段即可。 详见docs/03-interface/会话存储与生命周期-20261101.md§六。
# 新建(objectId 自动生成)
curl -X POST https://server.fmode.cn/parse/classes/Function \
-H "X-Parse-Application-Id: ncloudmaster" -H "X-Parse-Master-Key: <MK>" \
-H "Content-Type: application/json" -d '{"name":"...","code":"...","enabled":true,...}'
# 热更(免重启)
curl -X PUT https://server.fmode.cn/parse/classes/Function/<objectId> \
-H "X-Parse-Application-Id: ncloudmaster" -H "X-Parse-Master-Key: <MK>" \
-H "Content-Type: application/json" -d '{"code":"..."}'
async function handler(request, response);入参在全局 params。request.user 由平台按 X-Parse-Session-Token 解析后注入。response.status(200).json(...) 显式写出;直接 return 对象 平台不回包(请求挂起)。X-Parse-Session-Token 请求头;放 body 的 token 字段会被平台鉴权层直接 401。