wi-chat 0.7.0 → 0.7.2
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/core/index.cjs +1 -1
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +756 -580
- package/dist/core/useChatAuth.d.ts +91 -12
- package/dist/mobile-ui/chat/ChatContainer.vue.d.ts +1 -1
- package/dist/request/client.d.ts +8 -2
- package/dist/request/index.cjs +3 -3
- package/dist/request/index.d.ts +2 -2
- package/dist/request/index.js +474 -453
- package/dist/request/login.d.ts +36 -0
- package/dist/web-ui/chat/ChatContainer.vue.d.ts +1 -1
- package/package.json +6 -1
package/dist/request/login.d.ts
CHANGED
|
@@ -27,6 +27,14 @@ export interface LoginResult {
|
|
|
27
27
|
real_name?: string;
|
|
28
28
|
[key: string]: any;
|
|
29
29
|
}
|
|
30
|
+
/** /make_encrypt_login_status 响应 */
|
|
31
|
+
export interface MakeEncryptLoginStatusResult {
|
|
32
|
+
/** 业务成功标记 */
|
|
33
|
+
json_ok?: boolean;
|
|
34
|
+
/** 后端签发的登录密钥(使用前需再经 RSA 加密保存) */
|
|
35
|
+
encrypt_key?: string;
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}
|
|
30
38
|
/**
|
|
31
39
|
* 登录接口。前提:request 需先配置 baseURL;本函数通过 request 的 post 调用 /login。
|
|
32
40
|
* user / pass 外的其余字段(client / system_name 及任意自定义参数)平铺展开透传。
|
|
@@ -35,3 +43,31 @@ export interface LoginResult {
|
|
|
35
43
|
export declare const login: (request: {
|
|
36
44
|
post: <T = any>(url: string, data?: Record<string, unknown>) => Promise<T>;
|
|
37
45
|
}, params: LoginParams) => Promise<LoginResult>;
|
|
46
|
+
/**
|
|
47
|
+
* 签发登录密钥(/make_encrypt_login_status,与 WI 主工程登录密钥机制对齐)。
|
|
48
|
+
* 用当前有效 session 换取 encrypt_key,后续可凭密钥静默重登,无需保存账号密码。
|
|
49
|
+
* @param request 需携带 wisession 的请求客户端(session 失效时后端返回 AUTH/err_no_login)
|
|
50
|
+
* @param expireDays 密钥有效期(天),必须大于本地保持登录窗口
|
|
51
|
+
* @returns 后端原始响应:json_ok 且带 encrypt_key 表示签发成功;无签发权限时后端返回 AUTH
|
|
52
|
+
*/
|
|
53
|
+
export declare const makeEncryptLoginStatus: (request: {
|
|
54
|
+
post: <T = any>(url: string, data?: Record<string, unknown>) => Promise<T>;
|
|
55
|
+
}, expireDays: number) => Promise<MakeEncryptLoginStatusResult>;
|
|
56
|
+
/** loginByEncryptKey 入参 */
|
|
57
|
+
export interface LoginByEncryptKeyParams {
|
|
58
|
+
/** RSA 加密后的登录密钥(makeEncryptLoginStatus 的返回经 pwdEncrypt 加密后保存的值,原样透传) */
|
|
59
|
+
encrypt_key: string;
|
|
60
|
+
/** 登录端类型:标识从哪个端登录(可选) */
|
|
61
|
+
client?: string;
|
|
62
|
+
/** 其余任意字段直接展开透传到 /login 请求体(可选) */
|
|
63
|
+
[key: string]: unknown;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* 用登录密钥登录(/login 的 encrypt_key 方式,无需账号密码)。
|
|
67
|
+
* @param request 请求客户端(建议不带续期钩子,避免密钥失效时递归续期)
|
|
68
|
+
* @param params encrypt_key 为必传,其余字段平铺透传
|
|
69
|
+
* @returns 登录结果(含 wisession)
|
|
70
|
+
*/
|
|
71
|
+
export declare const loginByEncryptKey: (request: {
|
|
72
|
+
post: <T = any>(url: string, data?: Record<string, unknown>) => Promise<T>;
|
|
73
|
+
}, params: LoginByEncryptKeyParams) => Promise<LoginResult>;
|
|
@@ -129,8 +129,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<im
|
|
|
129
129
|
loading: boolean;
|
|
130
130
|
getFileUrl: (fileId: string) => string;
|
|
131
131
|
disabled: boolean;
|
|
132
|
-
talking: boolean;
|
|
133
132
|
session: string;
|
|
133
|
+
talking: boolean;
|
|
134
134
|
agentList: ChatAgentItem[];
|
|
135
135
|
currentAgent: ChatAgentItem;
|
|
136
136
|
hasMore: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wi-chat",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "AI 对话能力包(原 wi-chat-request/parser/theme/tools/core/renderers-ui/web-ui/mobile-ui 八包合并):请求层 + SSE/历史解析 + 主题 + 通用工具 + 对话状态机 + 共享回答渲染 + Web(Element Plus)/ 移动端(Vant)UI",
|
|
5
5
|
"author": "gerson wu <gersonwu@qq.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -80,6 +80,11 @@
|
|
|
80
80
|
"./web-ui/style.css": "./dist/web-ui/style.css",
|
|
81
81
|
"./mobile-ui/style.css": "./dist/mobile-ui/style.css",
|
|
82
82
|
"./right-panel/style.css": "./dist/right-panel/style.css",
|
|
83
|
+
"./tools/style.css": "./dist/tools/style.css",
|
|
84
|
+
"./renderers/style.css": "./dist/renderers/style.css",
|
|
85
|
+
"./web-ui/style.css": "./dist/web-ui/style.css",
|
|
86
|
+
"./mobile-ui/style.css": "./dist/mobile-ui/style.css",
|
|
87
|
+
"./right-panel/style.css": "./dist/right-panel/style.css",
|
|
83
88
|
"./tools/katex.css": "./dist/styles/katex.css",
|
|
84
89
|
"./tools/github.css": "./dist/styles/github.css",
|
|
85
90
|
"./package.json": "./package.json"
|