抽取公共部分
This commit is contained in:
@@ -1,15 +1,3 @@
|
||||
type ApiCallbackMessage = {
|
||||
msg: string,
|
||||
/**
|
||||
* 200: 成功
|
||||
* 400: 伺服器端無法理解客戶端請求
|
||||
* 401: 需要身份驗證
|
||||
* 403: 伺服器端拒絕執行客戶端請求
|
||||
* 404: Not Found
|
||||
* 500: 伺服器端錯誤
|
||||
* 501: 伺服器端不支持請求的功能
|
||||
*/
|
||||
code: 200 | 400 | 401 | 403 | 404 | 500 | 501 | -1,
|
||||
data?: { [key: string]: unknown },
|
||||
}
|
||||
export default ApiCallbackMessage
|
||||
import { ApiCallbackMessage } from 'lingchair-internal-shared'
|
||||
|
||||
export type { ApiCallbackMessage as default }
|
||||
|
||||
@@ -1,62 +1 @@
|
||||
export type CallMethod =
|
||||
// 用户验证
|
||||
"User.auth" |
|
||||
"User.register" |
|
||||
"User.login" |
|
||||
"User.refreshAccessToken" |
|
||||
|
||||
// 账号
|
||||
"User.setAvatar" |
|
||||
"User.updateProfile" |
|
||||
"User.getMyInfo" |
|
||||
"User.resetPassword" |
|
||||
|
||||
// 用户资料
|
||||
"User.getInfo" |
|
||||
|
||||
// 收藏对话列表
|
||||
"User.getMyContacts" |
|
||||
"User.addContacts" |
|
||||
"User.removeContacts" |
|
||||
|
||||
// 最近对话列表
|
||||
"User.getMyRecentChats" |
|
||||
|
||||
// 所有对话列表
|
||||
"User.getMyAllChats" |
|
||||
|
||||
// 对话信息
|
||||
"Chat.getInfo" |
|
||||
"Chat.getAnotherUserIdFromPrivate" |
|
||||
"Chat.getMembers" |
|
||||
|
||||
// 对话设置
|
||||
"Chat.updateSettings" |
|
||||
"Chat.setAvatar" |
|
||||
|
||||
// 对话创建
|
||||
"Chat.createGroup" |
|
||||
"Chat.getIdForPrivate" |
|
||||
|
||||
// 入群请求
|
||||
"Chat.processJoinRequest" |
|
||||
"Chat.sendJoinRequest" |
|
||||
"Chat.getJoinRequests" |
|
||||
|
||||
// 对话消息
|
||||
"Chat.sendMessage" |
|
||||
"Chat.getMessageHistory"
|
||||
|
||||
// (废弃) 文件上传
|
||||
// "Chat.uploadFile"
|
||||
|
||||
export type ClientEvent =
|
||||
// 对话收消息
|
||||
"Client.onMessage"
|
||||
|
||||
export const CallableMethodBeforeAuth = [
|
||||
"User.auth",
|
||||
"User.register",
|
||||
"User.login",
|
||||
"User.refreshAccessToken",
|
||||
]
|
||||
export * from 'lingchair-internal-shared'
|
||||
|
||||
@@ -9,10 +9,6 @@
|
||||
"jsxImportSource": "react",
|
||||
"jsxImportSourceTypes": "@types/react"
|
||||
},
|
||||
"links": [
|
||||
"./mdui_patched",
|
||||
],
|
||||
"nodeModulesDir": "auto",
|
||||
"imports": {
|
||||
"@deno/vite-plugin": "npm:@deno/vite-plugin@1.0.5",
|
||||
"@types/react": "npm:@types/react@18.3.1",
|
||||
@@ -34,6 +30,8 @@
|
||||
"socket.io-client": "npm:socket.io-client@4.8.1",
|
||||
"marked": "npm:marked@16.3.0",
|
||||
"dompurify": "npm:dompurify@3.2.7",
|
||||
"pinch-zoom-element": "npm:pinch-zoom-element@1.1.1"
|
||||
"pinch-zoom-element": "npm:pinch-zoom-element@1.1.1",
|
||||
|
||||
"lingchair-internal-shared": "../internal-shared/mod.ts"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user