qing-client 0.0.18 → 0.0.20
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/lib/client/BaseClient.js +2 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.js +5 -1
- package/lib/service/FileService.d.ts +100 -0
- package/lib/service/FileService.js +193 -0
- package/lib/service/UserService.d.ts +5 -1
- package/lib/service/UserService.js +23 -0
- package/lib/types/file.d.ts +52 -0
- package/lib/types/file.js +4 -0
- package/lib/types/user.d.ts +9 -0
- package/package.json +1 -1
package/lib/client/BaseClient.js
CHANGED
|
@@ -125,7 +125,8 @@ class BaseClient {
|
|
|
125
125
|
case 'auth': return this.config.authServiceUrl;
|
|
126
126
|
case 'msg': return this.config.msgServiceUrl;
|
|
127
127
|
case 'users': return this.config.userServiceUrl;
|
|
128
|
-
case 'file': return this.config.fileServiceUrl;
|
|
128
|
+
case 'file': return this.config.fileServiceUrl; // V1 兼容路由
|
|
129
|
+
case 'files': return this.config.fileServiceUrl; // V2 新路由
|
|
129
130
|
case 'survey': return this.config.surveyServiceUrl;
|
|
130
131
|
case 'token': return this.config.tokenServiceUrl;
|
|
131
132
|
case 'aigc': return this.config.aigcServiceUrl;
|
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { AuthService } from './service/AuthService';
|
|
|
3
3
|
export { MsgService } from './service/MsgService';
|
|
4
4
|
export { TokenService } from './service/TokenService';
|
|
5
5
|
export { UserService } from './service/UserService';
|
|
6
|
+
export { FileService } from './service/FileService';
|
|
6
7
|
export { AigcService } from './service/AigcService';
|
|
7
8
|
export { AuditLogService } from "./service/AuditLogService";
|
|
8
9
|
export { FrontHostService } from "./service/FrontHostService";
|
|
@@ -10,6 +11,9 @@ export * from './types';
|
|
|
10
11
|
export * from './types/msg';
|
|
11
12
|
export * from './types/token';
|
|
12
13
|
export * from './types/user';
|
|
14
|
+
export * from './types/file';
|
|
13
15
|
export * from "./types/fronthost";
|
|
14
16
|
export * from "./types/audit";
|
|
17
|
+
export * from "./types/aigc";
|
|
18
|
+
export { ApiSuccessResponse, ApiErrorResponse, PaginatedResponse, ChatCompletionRequest, ChatCompletionResponse, ChatCompletionStreamResponse, ProviderListItem, ProviderDetail, ProviderModel, ModelListItem, ModelDetail, ModelConfig, CreateAssistantRequest, UpdateAssistantRequest, AssistantResponse, AssistantListResponse, SessionMessage, SessionResponse, SessionListResponse, SessionDetailResponse, SessionStatistics, PaginatedSessionMessageResponse, SessionMessageDetail, BatchDeleteSessionsResponse, AssistantModelsResponse, ModelInfoResponse, AddMessageRequest, SwitchModelRequest, } from "./types/ai";
|
|
15
19
|
export { BaseClient } from './client/BaseClient';
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.BaseClient = exports.FrontHostService = exports.AuditLogService = exports.AigcService = exports.UserService = exports.TokenService = exports.MsgService = exports.AuthService = exports.Client = void 0;
|
|
17
|
+
exports.BaseClient = exports.FrontHostService = exports.AuditLogService = exports.AigcService = exports.FileService = exports.UserService = exports.TokenService = exports.MsgService = exports.AuthService = exports.Client = void 0;
|
|
18
18
|
// 导出核心客户端类
|
|
19
19
|
var client_1 = require("./client");
|
|
20
20
|
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_1.Client; } });
|
|
@@ -27,6 +27,8 @@ var TokenService_1 = require("./service/TokenService");
|
|
|
27
27
|
Object.defineProperty(exports, "TokenService", { enumerable: true, get: function () { return TokenService_1.TokenService; } });
|
|
28
28
|
var UserService_1 = require("./service/UserService");
|
|
29
29
|
Object.defineProperty(exports, "UserService", { enumerable: true, get: function () { return UserService_1.UserService; } });
|
|
30
|
+
var FileService_1 = require("./service/FileService");
|
|
31
|
+
Object.defineProperty(exports, "FileService", { enumerable: true, get: function () { return FileService_1.FileService; } });
|
|
30
32
|
var AigcService_1 = require("./service/AigcService");
|
|
31
33
|
Object.defineProperty(exports, "AigcService", { enumerable: true, get: function () { return AigcService_1.AigcService; } });
|
|
32
34
|
var AuditLogService_1 = require("./service/AuditLogService");
|
|
@@ -38,7 +40,9 @@ __exportStar(require("./types"), exports);
|
|
|
38
40
|
__exportStar(require("./types/msg"), exports);
|
|
39
41
|
__exportStar(require("./types/token"), exports);
|
|
40
42
|
__exportStar(require("./types/user"), exports);
|
|
43
|
+
__exportStar(require("./types/file"), exports);
|
|
41
44
|
__exportStar(require("./types/fronthost"), exports);
|
|
42
45
|
__exportStar(require("./types/audit"), exports);
|
|
46
|
+
__exportStar(require("./types/aigc"), exports);
|
|
43
47
|
var BaseClient_1 = require("./client/BaseClient");
|
|
44
48
|
Object.defineProperty(exports, "BaseClient", { enumerable: true, get: function () { return BaseClient_1.BaseClient; } });
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { BaseClient } from "../client/BaseClient";
|
|
2
|
+
import { ClientConfig, RequestOptions, PaginatedResponse } from "../types";
|
|
3
|
+
import { File, CreateFileRequest, UpdateFileRequest, FileListQuery } from "../types/file";
|
|
4
|
+
export declare class FileService extends BaseClient {
|
|
5
|
+
constructor(config: ClientConfig);
|
|
6
|
+
/**
|
|
7
|
+
* 创建文件记录(OSS回调使用)
|
|
8
|
+
* POST /api/files (网关转发到 /api/v1/files)
|
|
9
|
+
*/
|
|
10
|
+
createFile(fileData: CreateFileRequest, options?: RequestOptions): Promise<File>;
|
|
11
|
+
/**
|
|
12
|
+
* 获取文件详情
|
|
13
|
+
* GET /api/files/:id (网关转发到 /api/v1/files/:id)
|
|
14
|
+
*/
|
|
15
|
+
getFileById(fileId: string, options?: RequestOptions): Promise<File>;
|
|
16
|
+
/**
|
|
17
|
+
* 更新文件
|
|
18
|
+
* PUT /api/files/:id (网关转发到 /api/v1/files/:id)
|
|
19
|
+
*/
|
|
20
|
+
updateFile(fileId: string, updateData: UpdateFileRequest, options?: RequestOptions): Promise<File>;
|
|
21
|
+
/**
|
|
22
|
+
* 删除文件
|
|
23
|
+
* DELETE /api/files/:id (网关转发到 /api/v1/files/:id)
|
|
24
|
+
*/
|
|
25
|
+
deleteFile(fileId: string, options?: RequestOptions): Promise<{
|
|
26
|
+
message: string;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* 获取文件列表
|
|
30
|
+
* GET /api/files (网关转发到 /api/v1/files)
|
|
31
|
+
*/
|
|
32
|
+
listFiles(query?: FileListQuery, options?: RequestOptions): Promise<PaginatedResponse<File>>;
|
|
33
|
+
/**
|
|
34
|
+
* 生成 OSS 上传签名
|
|
35
|
+
* POST /api/files/oss/generate-sign (网关转发到 /api/v1/files/oss/generate-sign)
|
|
36
|
+
*/
|
|
37
|
+
generateOSSUploadSign(request: {
|
|
38
|
+
taskKey?: string;
|
|
39
|
+
fileName?: string;
|
|
40
|
+
fileSize?: number;
|
|
41
|
+
taskId?: string;
|
|
42
|
+
folderId?: string;
|
|
43
|
+
}, options?: RequestOptions): Promise<{
|
|
44
|
+
policy: string;
|
|
45
|
+
signature: string;
|
|
46
|
+
OSSAccessKeyId: string;
|
|
47
|
+
host: string;
|
|
48
|
+
expire: string;
|
|
49
|
+
callback?: string;
|
|
50
|
+
key: string;
|
|
51
|
+
taskId: string;
|
|
52
|
+
jwt: string;
|
|
53
|
+
projectId?: string;
|
|
54
|
+
}>;
|
|
55
|
+
/**
|
|
56
|
+
* 获取项目 OSS 配置
|
|
57
|
+
* GET /api/files/oss/config/:projectId (网关转发到 /api/v1/files/oss/config/:projectId)
|
|
58
|
+
*/
|
|
59
|
+
getOSSConfig(projectId: string, options?: RequestOptions): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* 创建文件夹
|
|
62
|
+
* POST /api/files/folders (网关转发到 /api/v1/files/folders)
|
|
63
|
+
*/
|
|
64
|
+
createFolder(request: {
|
|
65
|
+
name: string;
|
|
66
|
+
parentId?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
}, options?: RequestOptions): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* 获取文件夹详情
|
|
71
|
+
* GET /api/files/folders/:id (网关转发到 /api/v1/files/folders/:id)
|
|
72
|
+
*/
|
|
73
|
+
getFolderById(folderId: string, options?: RequestOptions): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* 更新文件夹
|
|
76
|
+
* PUT /api/files/folders/:id (网关转发到 /api/v1/files/folders/:id)
|
|
77
|
+
*/
|
|
78
|
+
updateFolder(folderId: string, updateData: {
|
|
79
|
+
name?: string;
|
|
80
|
+
description?: string;
|
|
81
|
+
parentId?: string;
|
|
82
|
+
}, options?: RequestOptions): Promise<any>;
|
|
83
|
+
/**
|
|
84
|
+
* 删除文件夹
|
|
85
|
+
* DELETE /api/files/folders/:id (网关转发到 /api/v1/files/folders/:id)
|
|
86
|
+
*/
|
|
87
|
+
deleteFolder(folderId: string, options?: RequestOptions): Promise<{
|
|
88
|
+
message: string;
|
|
89
|
+
}>;
|
|
90
|
+
/**
|
|
91
|
+
* 获取文件夹列表
|
|
92
|
+
* GET /api/files/folders?parentId=xxx (网关转发到 /api/v1/files/folders?parentId=xxx)
|
|
93
|
+
*/
|
|
94
|
+
listFolders(parentId?: string, options?: RequestOptions): Promise<any[]>;
|
|
95
|
+
/**
|
|
96
|
+
* 获取文件夹树
|
|
97
|
+
* GET /api/files/folders/tree?parentId=xxx (网关转发到 /api/v1/files/folders/tree?parentId=xxx)
|
|
98
|
+
*/
|
|
99
|
+
getFolderTree(parentId?: string, options?: RequestOptions): Promise<any[]>;
|
|
100
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileService = void 0;
|
|
4
|
+
const BaseClient_1 = require("../client/BaseClient");
|
|
5
|
+
class FileService extends BaseClient_1.BaseClient {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
super(config, 'files');
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 创建文件记录(OSS回调使用)
|
|
11
|
+
* POST /api/files (网关转发到 /api/v1/files)
|
|
12
|
+
*/
|
|
13
|
+
async createFile(fileData, options) {
|
|
14
|
+
return this.request('', {
|
|
15
|
+
...options,
|
|
16
|
+
method: 'POST',
|
|
17
|
+
body: {
|
|
18
|
+
bucket: fileData.bucket,
|
|
19
|
+
object: fileData.object,
|
|
20
|
+
url: fileData.url,
|
|
21
|
+
taskId: fileData.taskId,
|
|
22
|
+
size: fileData.size,
|
|
23
|
+
mimeType: fileData.mimeType,
|
|
24
|
+
fileExtension: fileData.fileExtension,
|
|
25
|
+
description: fileData.description,
|
|
26
|
+
source: fileData.source || '阿里云',
|
|
27
|
+
acl: fileData.acl || 'private',
|
|
28
|
+
etag: fileData.etag,
|
|
29
|
+
contentMd5: fileData.contentMd5,
|
|
30
|
+
folderId: fileData.folderId
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 获取文件详情
|
|
36
|
+
* GET /api/files/:id (网关转发到 /api/v1/files/:id)
|
|
37
|
+
*/
|
|
38
|
+
async getFileById(fileId, options) {
|
|
39
|
+
return this.request(`/${fileId}`, {
|
|
40
|
+
...options,
|
|
41
|
+
method: 'GET'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 更新文件
|
|
46
|
+
* PUT /api/files/:id (网关转发到 /api/v1/files/:id)
|
|
47
|
+
*/
|
|
48
|
+
async updateFile(fileId, updateData, options) {
|
|
49
|
+
return this.request(`/${fileId}`, {
|
|
50
|
+
...options,
|
|
51
|
+
method: 'PUT',
|
|
52
|
+
body: {
|
|
53
|
+
acl: updateData.acl,
|
|
54
|
+
description: updateData.description,
|
|
55
|
+
folderId: updateData.folderId
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 删除文件
|
|
61
|
+
* DELETE /api/files/:id (网关转发到 /api/v1/files/:id)
|
|
62
|
+
*/
|
|
63
|
+
async deleteFile(fileId, options) {
|
|
64
|
+
return this.request(`/${fileId}`, {
|
|
65
|
+
...options,
|
|
66
|
+
method: 'DELETE'
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 获取文件列表
|
|
71
|
+
* GET /api/files (网关转发到 /api/v1/files)
|
|
72
|
+
*/
|
|
73
|
+
async listFiles(query, options) {
|
|
74
|
+
const params = {};
|
|
75
|
+
if (query?.page !== undefined) {
|
|
76
|
+
params.page = query.page;
|
|
77
|
+
}
|
|
78
|
+
if (query?.pageSize !== undefined) {
|
|
79
|
+
params.pageSize = query.pageSize;
|
|
80
|
+
}
|
|
81
|
+
if (query?.folderId !== undefined) {
|
|
82
|
+
params.folderId = query.folderId;
|
|
83
|
+
}
|
|
84
|
+
if (query?.taskId !== undefined) {
|
|
85
|
+
params.taskId = query.taskId;
|
|
86
|
+
}
|
|
87
|
+
if (query?.acl !== undefined) {
|
|
88
|
+
params.acl = query.acl;
|
|
89
|
+
}
|
|
90
|
+
const response = await this.paginatedRequest('', {
|
|
91
|
+
...options,
|
|
92
|
+
method: 'GET',
|
|
93
|
+
params
|
|
94
|
+
});
|
|
95
|
+
return response;
|
|
96
|
+
}
|
|
97
|
+
// ==================== OSS 相关接口 ====================
|
|
98
|
+
/**
|
|
99
|
+
* 生成 OSS 上传签名
|
|
100
|
+
* POST /api/files/oss/generate-sign (网关转发到 /api/v1/files/oss/generate-sign)
|
|
101
|
+
*/
|
|
102
|
+
async generateOSSUploadSign(request, options) {
|
|
103
|
+
return this.request('/oss/generate-sign', {
|
|
104
|
+
...options,
|
|
105
|
+
method: 'POST',
|
|
106
|
+
body: request
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 获取项目 OSS 配置
|
|
111
|
+
* GET /api/files/oss/config/:projectId (网关转发到 /api/v1/files/oss/config/:projectId)
|
|
112
|
+
*/
|
|
113
|
+
async getOSSConfig(projectId, options) {
|
|
114
|
+
return this.request(`/oss/config/${projectId}`, {
|
|
115
|
+
...options,
|
|
116
|
+
method: 'GET'
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
// ==================== 文件夹相关接口 ====================
|
|
120
|
+
/**
|
|
121
|
+
* 创建文件夹
|
|
122
|
+
* POST /api/files/folders (网关转发到 /api/v1/files/folders)
|
|
123
|
+
*/
|
|
124
|
+
async createFolder(request, options) {
|
|
125
|
+
return this.request('/folders', {
|
|
126
|
+
...options,
|
|
127
|
+
method: 'POST',
|
|
128
|
+
body: request
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* 获取文件夹详情
|
|
133
|
+
* GET /api/files/folders/:id (网关转发到 /api/v1/files/folders/:id)
|
|
134
|
+
*/
|
|
135
|
+
async getFolderById(folderId, options) {
|
|
136
|
+
return this.request(`/folders/${folderId}`, {
|
|
137
|
+
...options,
|
|
138
|
+
method: 'GET'
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 更新文件夹
|
|
143
|
+
* PUT /api/files/folders/:id (网关转发到 /api/v1/files/folders/:id)
|
|
144
|
+
*/
|
|
145
|
+
async updateFolder(folderId, updateData, options) {
|
|
146
|
+
return this.request(`/folders/${folderId}`, {
|
|
147
|
+
...options,
|
|
148
|
+
method: 'PUT',
|
|
149
|
+
body: updateData
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 删除文件夹
|
|
154
|
+
* DELETE /api/files/folders/:id (网关转发到 /api/v1/files/folders/:id)
|
|
155
|
+
*/
|
|
156
|
+
async deleteFolder(folderId, options) {
|
|
157
|
+
return this.request(`/folders/${folderId}`, {
|
|
158
|
+
...options,
|
|
159
|
+
method: 'DELETE'
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* 获取文件夹列表
|
|
164
|
+
* GET /api/files/folders?parentId=xxx (网关转发到 /api/v1/files/folders?parentId=xxx)
|
|
165
|
+
*/
|
|
166
|
+
async listFolders(parentId, options) {
|
|
167
|
+
const params = {};
|
|
168
|
+
if (parentId !== undefined) {
|
|
169
|
+
params.parentId = parentId;
|
|
170
|
+
}
|
|
171
|
+
return this.request('/folders', {
|
|
172
|
+
...options,
|
|
173
|
+
method: 'GET',
|
|
174
|
+
params
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 获取文件夹树
|
|
179
|
+
* GET /api/files/folders/tree?parentId=xxx (网关转发到 /api/v1/files/folders/tree?parentId=xxx)
|
|
180
|
+
*/
|
|
181
|
+
async getFolderTree(parentId, options) {
|
|
182
|
+
const params = {};
|
|
183
|
+
if (parentId !== undefined) {
|
|
184
|
+
params.parentId = parentId;
|
|
185
|
+
}
|
|
186
|
+
return this.request('/folders/tree', {
|
|
187
|
+
...options,
|
|
188
|
+
method: 'GET',
|
|
189
|
+
params
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
exports.FileService = FileService;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseClient } from "../client/BaseClient";
|
|
2
2
|
import { ClientConfig, RequestOptions, PaginatedResponse } from "../types";
|
|
3
|
-
import { User, UserCreateRequest, UserUpdateRequest } from "../types/user";
|
|
3
|
+
import { User, UserCreateRequest, UserUpdateRequest, SelfPasswordChangeRequest, SelfUserUpdateRequest } from "../types/user";
|
|
4
4
|
export declare class UserService extends BaseClient {
|
|
5
5
|
constructor(config: ClientConfig);
|
|
6
6
|
getCurrentUser(options?: RequestOptions): Promise<User>;
|
|
@@ -15,4 +15,8 @@ export declare class UserService extends BaseClient {
|
|
|
15
15
|
resetPassword(userId: number, newPassword: string, options?: RequestOptions): Promise<{
|
|
16
16
|
id: number;
|
|
17
17
|
}>;
|
|
18
|
+
changeOwnPassword(passwordData: SelfPasswordChangeRequest, options?: RequestOptions): Promise<{
|
|
19
|
+
id: number;
|
|
20
|
+
}>;
|
|
21
|
+
updateCurrentUser(updateData: SelfUserUpdateRequest, options?: RequestOptions): Promise<User>;
|
|
18
22
|
}
|
|
@@ -91,5 +91,28 @@ class UserService extends BaseClient_1.BaseClient {
|
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
+
// 修改自己的密码
|
|
95
|
+
async changeOwnPassword(passwordData, options) {
|
|
96
|
+
return this.request('/me/password', {
|
|
97
|
+
...options,
|
|
98
|
+
method: 'PUT',
|
|
99
|
+
body: {
|
|
100
|
+
old_password: passwordData.old_password,
|
|
101
|
+
new_password: passwordData.new_password
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// 更新自己的资料
|
|
106
|
+
async updateCurrentUser(updateData, options) {
|
|
107
|
+
return this.request('/me', {
|
|
108
|
+
...options,
|
|
109
|
+
method: 'PUT',
|
|
110
|
+
body: {
|
|
111
|
+
name: updateData.name,
|
|
112
|
+
avatar: updateData.avatar,
|
|
113
|
+
phone: updateData.phone
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
94
117
|
}
|
|
95
118
|
exports.UserService = UserService;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface File {
|
|
2
|
+
id: string;
|
|
3
|
+
bucket?: string;
|
|
4
|
+
object: string;
|
|
5
|
+
url: string;
|
|
6
|
+
taskId: string;
|
|
7
|
+
size?: number;
|
|
8
|
+
mimeType?: string;
|
|
9
|
+
fileExtension?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
source: string;
|
|
12
|
+
acl: 'private' | 'public-read';
|
|
13
|
+
etag?: string;
|
|
14
|
+
contentMd5?: string;
|
|
15
|
+
folderId?: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CreateFileRequest {
|
|
20
|
+
bucket?: string;
|
|
21
|
+
object: string;
|
|
22
|
+
url: string;
|
|
23
|
+
taskId: string;
|
|
24
|
+
size?: number;
|
|
25
|
+
mimeType?: string;
|
|
26
|
+
fileExtension?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
source?: string;
|
|
29
|
+
acl?: 'private' | 'public-read';
|
|
30
|
+
etag?: string;
|
|
31
|
+
contentMd5?: string;
|
|
32
|
+
folderId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface UpdateFileRequest {
|
|
35
|
+
acl?: 'private' | 'public-read';
|
|
36
|
+
description?: string;
|
|
37
|
+
folderId?: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface FileListQuery {
|
|
40
|
+
page?: number;
|
|
41
|
+
pageSize?: number;
|
|
42
|
+
folderId?: string;
|
|
43
|
+
taskId?: string;
|
|
44
|
+
acl?: 'private' | 'public-read';
|
|
45
|
+
}
|
|
46
|
+
export interface FileListResponse {
|
|
47
|
+
data: File[];
|
|
48
|
+
total: number;
|
|
49
|
+
page: number;
|
|
50
|
+
pageSize: number;
|
|
51
|
+
totalPages: number;
|
|
52
|
+
}
|
package/lib/types/user.d.ts
CHANGED
|
@@ -38,6 +38,15 @@ export interface LoginResponse {
|
|
|
38
38
|
export interface PasswordResetRequest {
|
|
39
39
|
new_password: string;
|
|
40
40
|
}
|
|
41
|
+
export interface SelfPasswordChangeRequest {
|
|
42
|
+
old_password: string;
|
|
43
|
+
new_password: string;
|
|
44
|
+
}
|
|
45
|
+
export interface SelfUserUpdateRequest {
|
|
46
|
+
name?: string;
|
|
47
|
+
avatar?: string;
|
|
48
|
+
phone?: string;
|
|
49
|
+
}
|
|
41
50
|
export interface UserOperationResponse {
|
|
42
51
|
id: number;
|
|
43
52
|
message?: string;
|