@petercatai/whisker-client 2.0.0 → 3.0.202603061047
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/api.d.ts +516 -18
- package/dist/api.js +72 -5
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -206,7 +206,10 @@ export declare enum IKnowledgeTypeEnum {
|
|
|
206
206
|
Json = "json",
|
|
207
207
|
Docx = "docx",
|
|
208
208
|
Pdf = "pdf",
|
|
209
|
+
Powerpoint = "powerpoint",
|
|
210
|
+
Webpage = "webpage",
|
|
209
211
|
Qa = "qa",
|
|
212
|
+
Folder = "folder",
|
|
210
213
|
Yuquedoc = "yuquedoc",
|
|
211
214
|
YuqueBook = "yuque_book",
|
|
212
215
|
GithubRepo = "github_repo",
|
|
@@ -251,11 +254,26 @@ export declare enum IKnowledgeSourceEnum {
|
|
|
251
254
|
GithubFile = "github_file",
|
|
252
255
|
UserInputText = "user_input_text",
|
|
253
256
|
CloudStorageText = "cloud_storage_text",
|
|
257
|
+
CloudStorageFile = "cloud_storage_file",
|
|
254
258
|
CloudStorageImage = "cloud_storage_image",
|
|
259
|
+
Os = "os",
|
|
255
260
|
Yuque = "yuque",
|
|
256
261
|
YuquePersonalDoc = "yuque_personal_doc",
|
|
257
262
|
YuquePersonalNote = "yuque_personal_note",
|
|
258
|
-
HituNodePackage = "hitu_node_package"
|
|
263
|
+
HituNodePackage = "hitu_node_package",
|
|
264
|
+
Webpage = "webpage"
|
|
265
|
+
}
|
|
266
|
+
/** CliChangeOp */
|
|
267
|
+
export declare enum ICliChangeOp {
|
|
268
|
+
Add = "add",
|
|
269
|
+
Modify = "modify",
|
|
270
|
+
Delete = "delete"
|
|
271
|
+
}
|
|
272
|
+
/** CliApplyStatus */
|
|
273
|
+
export declare enum ICliApplyStatus {
|
|
274
|
+
Applied = "applied",
|
|
275
|
+
Skipped = "skipped",
|
|
276
|
+
Failed = "failed"
|
|
259
277
|
}
|
|
260
278
|
/** Action */
|
|
261
279
|
export declare enum IAction {
|
|
@@ -1130,6 +1148,96 @@ export interface ICleanupHistoryResponse {
|
|
|
1130
1148
|
*/
|
|
1131
1149
|
before_time: string;
|
|
1132
1150
|
}
|
|
1151
|
+
/** CliApplyRequest */
|
|
1152
|
+
export interface ICliApplyRequest {
|
|
1153
|
+
/** Space Id */
|
|
1154
|
+
space_id: string;
|
|
1155
|
+
/** Expected Snapshot Token */
|
|
1156
|
+
expected_snapshot_token?: string | null;
|
|
1157
|
+
/**
|
|
1158
|
+
* Force
|
|
1159
|
+
* @default false
|
|
1160
|
+
*/
|
|
1161
|
+
force?: boolean;
|
|
1162
|
+
/** Entries */
|
|
1163
|
+
entries: ICliChangesetEntry[];
|
|
1164
|
+
}
|
|
1165
|
+
/** CliApplyResponse */
|
|
1166
|
+
export interface ICliApplyResponse {
|
|
1167
|
+
/** Space Id */
|
|
1168
|
+
space_id: string;
|
|
1169
|
+
/** Expected Snapshot Token */
|
|
1170
|
+
expected_snapshot_token?: string | null;
|
|
1171
|
+
/** Snapshot Token Before */
|
|
1172
|
+
snapshot_token_before: string;
|
|
1173
|
+
/** Snapshot Token After */
|
|
1174
|
+
snapshot_token_after: string;
|
|
1175
|
+
/**
|
|
1176
|
+
* Version Conflict
|
|
1177
|
+
* @default false
|
|
1178
|
+
*/
|
|
1179
|
+
version_conflict?: boolean;
|
|
1180
|
+
/**
|
|
1181
|
+
* Applied
|
|
1182
|
+
* @default 0
|
|
1183
|
+
*/
|
|
1184
|
+
applied?: number;
|
|
1185
|
+
/**
|
|
1186
|
+
* Skipped
|
|
1187
|
+
* @default 0
|
|
1188
|
+
*/
|
|
1189
|
+
skipped?: number;
|
|
1190
|
+
/**
|
|
1191
|
+
* Failed
|
|
1192
|
+
* @default 0
|
|
1193
|
+
*/
|
|
1194
|
+
failed?: number;
|
|
1195
|
+
/** Results */
|
|
1196
|
+
results: ICliApplyResultItem[];
|
|
1197
|
+
}
|
|
1198
|
+
/** CliApplyResultItem */
|
|
1199
|
+
export interface ICliApplyResultItem {
|
|
1200
|
+
/** Path */
|
|
1201
|
+
path: string;
|
|
1202
|
+
op: ICliChangeOp;
|
|
1203
|
+
status: ICliApplyStatus;
|
|
1204
|
+
/** Knowledge Id */
|
|
1205
|
+
knowledge_id?: string | null;
|
|
1206
|
+
/** Knowledge Name */
|
|
1207
|
+
knowledge_name?: string | null;
|
|
1208
|
+
/** Knowledge Type */
|
|
1209
|
+
knowledge_type?: string | null;
|
|
1210
|
+
/** Message */
|
|
1211
|
+
message?: string | null;
|
|
1212
|
+
}
|
|
1213
|
+
/** CliChangesetEntry */
|
|
1214
|
+
export interface ICliChangesetEntry {
|
|
1215
|
+
op: ICliChangeOp;
|
|
1216
|
+
/** Path */
|
|
1217
|
+
path: string;
|
|
1218
|
+
/** Knowledge Id */
|
|
1219
|
+
knowledge_id?: string | null;
|
|
1220
|
+
/** Knowledge Name */
|
|
1221
|
+
knowledge_name?: string | null;
|
|
1222
|
+
/** Knowledge Type */
|
|
1223
|
+
knowledge_type?: string | null;
|
|
1224
|
+
/** Source Type */
|
|
1225
|
+
source_type?: string | null;
|
|
1226
|
+
/** Source Config */
|
|
1227
|
+
source_config?: Record<string, any>;
|
|
1228
|
+
/** Embedding Model Name */
|
|
1229
|
+
embedding_model_name?: string | null;
|
|
1230
|
+
/** Split Config */
|
|
1231
|
+
split_config?: Record<string, any>;
|
|
1232
|
+
/** Metadata */
|
|
1233
|
+
metadata?: Record<string, any>;
|
|
1234
|
+
/** File Sha */
|
|
1235
|
+
file_sha?: string | null;
|
|
1236
|
+
/** File Size */
|
|
1237
|
+
file_size?: number | null;
|
|
1238
|
+
/** Parent Id */
|
|
1239
|
+
parent_id?: string | null;
|
|
1240
|
+
}
|
|
1133
1241
|
/** Condition */
|
|
1134
1242
|
export interface ICondition {
|
|
1135
1243
|
/** Field */
|
|
@@ -1185,6 +1293,90 @@ export interface IFilterGroup {
|
|
|
1185
1293
|
/** Conditions */
|
|
1186
1294
|
conditions: (ICondition | IFilterGroup)[];
|
|
1187
1295
|
}
|
|
1296
|
+
/** FolderCreate */
|
|
1297
|
+
export interface IFolderCreate {
|
|
1298
|
+
/**
|
|
1299
|
+
* Space Id
|
|
1300
|
+
* the space of knowledge, example: petercat bot id, github repo name
|
|
1301
|
+
*/
|
|
1302
|
+
space_id: string;
|
|
1303
|
+
/**
|
|
1304
|
+
* Knowledge Type
|
|
1305
|
+
* folder knowledge type
|
|
1306
|
+
* @default "folder"
|
|
1307
|
+
*/
|
|
1308
|
+
knowledge_type?: "folder";
|
|
1309
|
+
/**
|
|
1310
|
+
* Knowledge Name
|
|
1311
|
+
* name of the knowledge resource
|
|
1312
|
+
* @maxLength 255
|
|
1313
|
+
*/
|
|
1314
|
+
knowledge_name: string;
|
|
1315
|
+
/**
|
|
1316
|
+
* Metadata
|
|
1317
|
+
* additional metadata, user can update it
|
|
1318
|
+
* @default {}
|
|
1319
|
+
*/
|
|
1320
|
+
metadata?: Record<string, any>;
|
|
1321
|
+
/**
|
|
1322
|
+
* Source Type
|
|
1323
|
+
* folder source type
|
|
1324
|
+
* @default "os"
|
|
1325
|
+
*/
|
|
1326
|
+
source_type?: "os";
|
|
1327
|
+
/**
|
|
1328
|
+
* Embedding Model Name
|
|
1329
|
+
* name of the embedding model. you can set any other model if target embedding service registered
|
|
1330
|
+
*/
|
|
1331
|
+
embedding_model_name: string;
|
|
1332
|
+
/**
|
|
1333
|
+
* File Sha
|
|
1334
|
+
* SHA of the file
|
|
1335
|
+
*/
|
|
1336
|
+
file_sha?: string | null;
|
|
1337
|
+
/**
|
|
1338
|
+
* File Size
|
|
1339
|
+
* size of the file
|
|
1340
|
+
*/
|
|
1341
|
+
file_size?: number | null;
|
|
1342
|
+
/**
|
|
1343
|
+
* Parent Id
|
|
1344
|
+
* parent id of the knowledge
|
|
1345
|
+
*/
|
|
1346
|
+
parent_id?: string | null;
|
|
1347
|
+
/** folder source config */
|
|
1348
|
+
source_config: IFolderSourceConfig;
|
|
1349
|
+
/**
|
|
1350
|
+
* folder split config
|
|
1351
|
+
* @default {"type":"folder"}
|
|
1352
|
+
*/
|
|
1353
|
+
split_config?: IFolderSplitConfig;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* FolderSourceConfig
|
|
1357
|
+
* 文件夹来源配置
|
|
1358
|
+
*
|
|
1359
|
+
* 路径必须是绝对路径,以 / 开头,不允许相对路径。
|
|
1360
|
+
*/
|
|
1361
|
+
export interface IFolderSourceConfig {
|
|
1362
|
+
/**
|
|
1363
|
+
* Path
|
|
1364
|
+
* 文件夹绝对路径,必须以 / 开头,如 /docs/api/
|
|
1365
|
+
* @default "/"
|
|
1366
|
+
*/
|
|
1367
|
+
path?: string;
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* FolderSplitConfig
|
|
1371
|
+
* 文件夹分块配置(空配置,folder 不分块)
|
|
1372
|
+
*/
|
|
1373
|
+
export interface IFolderSplitConfig {
|
|
1374
|
+
/**
|
|
1375
|
+
* Type
|
|
1376
|
+
* @default "folder"
|
|
1377
|
+
*/
|
|
1378
|
+
type?: "folder";
|
|
1379
|
+
}
|
|
1188
1380
|
/**
|
|
1189
1381
|
* GeaGraphSplitConfig
|
|
1190
1382
|
* JSON document split configuration
|
|
@@ -1698,7 +1890,7 @@ export interface IKnowledgeInput {
|
|
|
1698
1890
|
* Source Config
|
|
1699
1891
|
* source config of the knowledge
|
|
1700
1892
|
*/
|
|
1701
|
-
source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig;
|
|
1893
|
+
source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig | IFolderSourceConfig;
|
|
1702
1894
|
/**
|
|
1703
1895
|
* Embedding Model Name
|
|
1704
1896
|
* name of the embedding model. you can set any other model if target embedding service registered
|
|
@@ -1708,7 +1900,7 @@ export interface IKnowledgeInput {
|
|
|
1708
1900
|
* Split Config
|
|
1709
1901
|
* configuration for splitting the knowledge
|
|
1710
1902
|
*/
|
|
1711
|
-
split_config:
|
|
1903
|
+
split_config: IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig | IFolderSplitConfig | IBaseCharSplitConfig;
|
|
1712
1904
|
/**
|
|
1713
1905
|
* File Sha
|
|
1714
1906
|
* SHA of the file
|
|
@@ -1784,7 +1976,7 @@ export interface IKnowledgeOutput {
|
|
|
1784
1976
|
* Source Config
|
|
1785
1977
|
* source config of the knowledge
|
|
1786
1978
|
*/
|
|
1787
|
-
source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig;
|
|
1979
|
+
source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig | IFolderSourceConfig;
|
|
1788
1980
|
/**
|
|
1789
1981
|
* Embedding Model Name
|
|
1790
1982
|
* name of the embedding model. you can set any other model if target embedding service registered
|
|
@@ -1794,7 +1986,7 @@ export interface IKnowledgeOutput {
|
|
|
1794
1986
|
* Split Config
|
|
1795
1987
|
* configuration for splitting the knowledge
|
|
1796
1988
|
*/
|
|
1797
|
-
split_config:
|
|
1989
|
+
split_config: IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig | IFolderSplitConfig | IBaseCharSplitConfig;
|
|
1798
1990
|
/**
|
|
1799
1991
|
* File Sha
|
|
1800
1992
|
* SHA of the file
|
|
@@ -2036,7 +2228,7 @@ export interface IKnowledgeResponse {
|
|
|
2036
2228
|
* Source Config
|
|
2037
2229
|
* source config of the knowledge
|
|
2038
2230
|
*/
|
|
2039
|
-
source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig;
|
|
2231
|
+
source_config: IGithubRepoSourceConfig | IGithubFileSourceConfig | IS3SourceConfig | IOpenUrlSourceConfig | ITextSourceConfig | IOpenIdSourceConfig | IYuqueSourceConfig | IYuquePersonalDocSourceConfig | IYuquePersonalNoteSourceConfig | INodePackageSourceConfig | IFolderSourceConfig;
|
|
2040
2232
|
/**
|
|
2041
2233
|
* Embedding Model Name
|
|
2042
2234
|
* name of the embedding model. you can set any other model if target embedding service registered
|
|
@@ -2046,7 +2238,7 @@ export interface IKnowledgeResponse {
|
|
|
2046
2238
|
* Split Config
|
|
2047
2239
|
* configuration for splitting the knowledge
|
|
2048
2240
|
*/
|
|
2049
|
-
split_config:
|
|
2241
|
+
split_config: IMarkdownSplitConfig | ITextSplitConfig | IJSONSplitConfig | IPDFSplitConfig | IYuqueSplitConfig | IGeaGraphSplitConfig | IGithubRepoParseConfig | IBaseCodeSplitConfig | IImageSplitConfig | INodePackageParseConfig | IMemorySplitConfig | IFolderSplitConfig | IBaseCharSplitConfig;
|
|
2050
2242
|
/**
|
|
2051
2243
|
* File Sha
|
|
2052
2244
|
* SHA of the file
|
|
@@ -2570,6 +2762,16 @@ export interface IMemoryUpdate {
|
|
|
2570
2762
|
*/
|
|
2571
2763
|
metadata?: Record<string, any> | null;
|
|
2572
2764
|
}
|
|
2765
|
+
/**
|
|
2766
|
+
* MoveKnowledgeRequest
|
|
2767
|
+
* 移动知识请求
|
|
2768
|
+
*/
|
|
2769
|
+
export interface IMoveKnowledgeRequest {
|
|
2770
|
+
/** Knowledge Ids */
|
|
2771
|
+
knowledge_ids: string[];
|
|
2772
|
+
/** Target Folder Id */
|
|
2773
|
+
target_folder_id?: string | null;
|
|
2774
|
+
}
|
|
2573
2775
|
/** NodePackageParseConfig */
|
|
2574
2776
|
export interface INodePackageParseConfig {
|
|
2575
2777
|
/**
|
|
@@ -2620,7 +2822,10 @@ export interface IOpenUrlSourceConfig {
|
|
|
2620
2822
|
*/
|
|
2621
2823
|
auth_info?: string | Record<string, any> | null;
|
|
2622
2824
|
}
|
|
2623
|
-
/**
|
|
2825
|
+
/**
|
|
2826
|
+
* PDFCreate
|
|
2827
|
+
* PDF 文档创建 DTO - 通过 markitdown 转换为 Markdown 后处理
|
|
2828
|
+
*/
|
|
2624
2829
|
export interface IPDFCreate {
|
|
2625
2830
|
/**
|
|
2626
2831
|
* Space Id
|
|
@@ -2656,12 +2861,12 @@ export interface IPDFCreate {
|
|
|
2656
2861
|
* File Sha
|
|
2657
2862
|
* SHA of the file
|
|
2658
2863
|
*/
|
|
2659
|
-
file_sha
|
|
2864
|
+
file_sha?: string | null;
|
|
2660
2865
|
/**
|
|
2661
2866
|
* File Size
|
|
2662
2867
|
* Byte size of the file
|
|
2663
2868
|
*/
|
|
2664
|
-
file_size
|
|
2869
|
+
file_size?: number | null;
|
|
2665
2870
|
/**
|
|
2666
2871
|
* Parent Id
|
|
2667
2872
|
* parent id of the knowledge
|
|
@@ -2672,8 +2877,8 @@ export interface IPDFCreate {
|
|
|
2672
2877
|
* source config of the knowledge
|
|
2673
2878
|
*/
|
|
2674
2879
|
source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
|
|
2675
|
-
/** split config of the knowledge */
|
|
2676
|
-
split_config:
|
|
2880
|
+
/** split config of the knowledge (markdown after markitdown conversion) */
|
|
2881
|
+
split_config: IMarkdownSplitConfig;
|
|
2677
2882
|
}
|
|
2678
2883
|
/**
|
|
2679
2884
|
* PDFSplitConfig
|
|
@@ -3434,6 +3639,64 @@ export interface IPermission {
|
|
|
3434
3639
|
/** Conditions */
|
|
3435
3640
|
conditions?: Record<string, any> | null;
|
|
3436
3641
|
}
|
|
3642
|
+
/**
|
|
3643
|
+
* PowerPointCreate
|
|
3644
|
+
* PowerPoint 文档创建 DTO - 通过 markitdown 转换为 Markdown 后处理
|
|
3645
|
+
*/
|
|
3646
|
+
export interface IPowerPointCreate {
|
|
3647
|
+
/**
|
|
3648
|
+
* Space Id
|
|
3649
|
+
* the space of knowledge, example: petercat bot id, github repo name
|
|
3650
|
+
*/
|
|
3651
|
+
space_id: string;
|
|
3652
|
+
/**
|
|
3653
|
+
* Knowledge Type
|
|
3654
|
+
* type of knowledge resource
|
|
3655
|
+
* @default "powerpoint"
|
|
3656
|
+
*/
|
|
3657
|
+
knowledge_type?: "powerpoint";
|
|
3658
|
+
/**
|
|
3659
|
+
* Knowledge Name
|
|
3660
|
+
* name of the knowledge resource
|
|
3661
|
+
* @maxLength 255
|
|
3662
|
+
*/
|
|
3663
|
+
knowledge_name: string;
|
|
3664
|
+
/**
|
|
3665
|
+
* Metadata
|
|
3666
|
+
* additional metadata, user can update it
|
|
3667
|
+
* @default {}
|
|
3668
|
+
*/
|
|
3669
|
+
metadata?: Record<string, any>;
|
|
3670
|
+
/** source type */
|
|
3671
|
+
source_type: IKnowledgeSourceEnum;
|
|
3672
|
+
/**
|
|
3673
|
+
* Embedding Model Name
|
|
3674
|
+
* name of the embedding model. you can set any other model if target embedding service registered
|
|
3675
|
+
*/
|
|
3676
|
+
embedding_model_name: string;
|
|
3677
|
+
/**
|
|
3678
|
+
* File Sha
|
|
3679
|
+
* SHA of the file
|
|
3680
|
+
*/
|
|
3681
|
+
file_sha: string;
|
|
3682
|
+
/**
|
|
3683
|
+
* File Size
|
|
3684
|
+
* Byte size of the file
|
|
3685
|
+
*/
|
|
3686
|
+
file_size: number;
|
|
3687
|
+
/**
|
|
3688
|
+
* Parent Id
|
|
3689
|
+
* parent id of the knowledge
|
|
3690
|
+
*/
|
|
3691
|
+
parent_id?: string | null;
|
|
3692
|
+
/**
|
|
3693
|
+
* Source Config
|
|
3694
|
+
* source config of the knowledge
|
|
3695
|
+
*/
|
|
3696
|
+
source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
|
|
3697
|
+
/** split config of the knowledge (markdown after markitdown conversion) */
|
|
3698
|
+
split_config: IMarkdownSplitConfig;
|
|
3699
|
+
}
|
|
3437
3700
|
/** QACreate */
|
|
3438
3701
|
export interface IQACreate {
|
|
3439
3702
|
/**
|
|
@@ -3622,6 +3885,14 @@ export interface IResponseModelCleanupHistoryResponse {
|
|
|
3622
3885
|
/** Message */
|
|
3623
3886
|
message?: string | null;
|
|
3624
3887
|
}
|
|
3888
|
+
/** ResponseModel[CliApplyResponse] */
|
|
3889
|
+
export interface IResponseModelCliApplyResponse {
|
|
3890
|
+
/** Success */
|
|
3891
|
+
success: boolean;
|
|
3892
|
+
data?: ICliApplyResponse | null;
|
|
3893
|
+
/** Message */
|
|
3894
|
+
message?: string | null;
|
|
3895
|
+
}
|
|
3625
3896
|
/** ResponseModel[Dict[str, Any]] */
|
|
3626
3897
|
export interface IResponseModelDictStrAny {
|
|
3627
3898
|
/** Success */
|
|
@@ -3698,6 +3969,15 @@ export interface IResponseModelListArtifactIndex {
|
|
|
3698
3969
|
/** Message */
|
|
3699
3970
|
message?: string | null;
|
|
3700
3971
|
}
|
|
3972
|
+
/** ResponseModel[List[Dict[str, Any]]] */
|
|
3973
|
+
export interface IResponseModelListDictStrAny {
|
|
3974
|
+
/** Success */
|
|
3975
|
+
success: boolean;
|
|
3976
|
+
/** Data */
|
|
3977
|
+
data?: Record<string, any>[] | null;
|
|
3978
|
+
/** Message */
|
|
3979
|
+
message?: string | null;
|
|
3980
|
+
}
|
|
3701
3981
|
/** ResponseModel[List[Knowledge]] */
|
|
3702
3982
|
export interface IResponseModelListKnowledge {
|
|
3703
3983
|
/** Success */
|
|
@@ -3965,6 +4245,22 @@ export interface IResponseModelStatusStatisticsPageResponseTask {
|
|
|
3965
4245
|
/** Message */
|
|
3966
4246
|
message?: string | null;
|
|
3967
4247
|
}
|
|
4248
|
+
/** ResponseModel[SyncMaterializeData] */
|
|
4249
|
+
export interface IResponseModelSyncMaterializeData {
|
|
4250
|
+
/** Success */
|
|
4251
|
+
success: boolean;
|
|
4252
|
+
data?: ISyncMaterializeData | null;
|
|
4253
|
+
/** Message */
|
|
4254
|
+
message?: string | null;
|
|
4255
|
+
}
|
|
4256
|
+
/** ResponseModel[SyncSnapshotData] */
|
|
4257
|
+
export interface IResponseModelSyncSnapshotData {
|
|
4258
|
+
/** Success */
|
|
4259
|
+
success: boolean;
|
|
4260
|
+
data?: ISyncSnapshotData | null;
|
|
4261
|
+
/** Message */
|
|
4262
|
+
message?: string | null;
|
|
4263
|
+
}
|
|
3968
4264
|
/** ResponseModel[Tag] */
|
|
3969
4265
|
export interface IResponseModelTag {
|
|
3970
4266
|
/** Success */
|
|
@@ -4707,6 +5003,77 @@ export interface IStatusStatisticsPageResponseTask {
|
|
|
4707
5003
|
*/
|
|
4708
5004
|
deleted?: number;
|
|
4709
5005
|
}
|
|
5006
|
+
/** SyncMaterializeData */
|
|
5007
|
+
export interface ISyncMaterializeData {
|
|
5008
|
+
/** Space Id */
|
|
5009
|
+
space_id: string;
|
|
5010
|
+
/** Items */
|
|
5011
|
+
items: ISyncMaterializeItem[];
|
|
5012
|
+
}
|
|
5013
|
+
/** SyncMaterializeItem */
|
|
5014
|
+
export interface ISyncMaterializeItem {
|
|
5015
|
+
/** Knowledge Id */
|
|
5016
|
+
knowledge_id: string;
|
|
5017
|
+
/** Knowledge Name */
|
|
5018
|
+
knowledge_name: string;
|
|
5019
|
+
/** Knowledge Type */
|
|
5020
|
+
knowledge_type: string;
|
|
5021
|
+
/** Source Type */
|
|
5022
|
+
source_type: string;
|
|
5023
|
+
/** File Sha */
|
|
5024
|
+
file_sha?: string | null;
|
|
5025
|
+
/** File Size */
|
|
5026
|
+
file_size?: number | null;
|
|
5027
|
+
/** Parent Id */
|
|
5028
|
+
parent_id?: string | null;
|
|
5029
|
+
/** Metadata */
|
|
5030
|
+
metadata?: Record<string, any>;
|
|
5031
|
+
/** Text Content */
|
|
5032
|
+
text_content?: string | null;
|
|
5033
|
+
/** File Url */
|
|
5034
|
+
file_url?: string | null;
|
|
5035
|
+
/** Source Locator */
|
|
5036
|
+
source_locator?: Record<string, any> | null;
|
|
5037
|
+
/** Materialize Error */
|
|
5038
|
+
materialize_error?: string | null;
|
|
5039
|
+
}
|
|
5040
|
+
/** SyncMaterializeRequest */
|
|
5041
|
+
export interface ISyncMaterializeRequest {
|
|
5042
|
+
/** Space Id */
|
|
5043
|
+
space_id: string;
|
|
5044
|
+
/** Knowledge Ids */
|
|
5045
|
+
knowledge_ids?: string[];
|
|
5046
|
+
}
|
|
5047
|
+
/** SyncSnapshotData */
|
|
5048
|
+
export interface ISyncSnapshotData {
|
|
5049
|
+
/** Space Id */
|
|
5050
|
+
space_id: string;
|
|
5051
|
+
/** Snapshot Token */
|
|
5052
|
+
snapshot_token: string;
|
|
5053
|
+
/** Items */
|
|
5054
|
+
items: ISyncSnapshotItem[];
|
|
5055
|
+
}
|
|
5056
|
+
/** SyncSnapshotItem */
|
|
5057
|
+
export interface ISyncSnapshotItem {
|
|
5058
|
+
/** Knowledge Id */
|
|
5059
|
+
knowledge_id: string;
|
|
5060
|
+
/** Knowledge Name */
|
|
5061
|
+
knowledge_name: string;
|
|
5062
|
+
/** Knowledge Type */
|
|
5063
|
+
knowledge_type: string;
|
|
5064
|
+
/** Source Type */
|
|
5065
|
+
source_type: string;
|
|
5066
|
+
/** File Sha */
|
|
5067
|
+
file_sha?: string | null;
|
|
5068
|
+
/** File Size */
|
|
5069
|
+
file_size?: number | null;
|
|
5070
|
+
/** Updated At */
|
|
5071
|
+
updated_at?: string | null;
|
|
5072
|
+
/** Metadata Digest */
|
|
5073
|
+
metadata_digest?: string | null;
|
|
5074
|
+
/** Parent Id */
|
|
5075
|
+
parent_id?: string | null;
|
|
5076
|
+
}
|
|
4710
5077
|
/** Tag */
|
|
4711
5078
|
export interface ITag {
|
|
4712
5079
|
/**
|
|
@@ -4984,6 +5351,17 @@ export interface ITenantCreate {
|
|
|
4984
5351
|
email: string;
|
|
4985
5352
|
/** Metadata */
|
|
4986
5353
|
metadata?: Record<string, any> | null;
|
|
5354
|
+
/**
|
|
5355
|
+
* Notify
|
|
5356
|
+
* 是否发送邮件通知,默认 true
|
|
5357
|
+
* @default true
|
|
5358
|
+
*/
|
|
5359
|
+
notify?: boolean;
|
|
5360
|
+
/**
|
|
5361
|
+
* Tenant Id
|
|
5362
|
+
* 租户ID(可选),支持字母、数字、下划线、中划线
|
|
5363
|
+
*/
|
|
5364
|
+
tenant_id?: string | null;
|
|
4987
5365
|
}
|
|
4988
5366
|
/** TenantLog */
|
|
4989
5367
|
export interface ITenantLog {
|
|
@@ -5385,6 +5763,65 @@ export interface IWebhookTestResponse {
|
|
|
5385
5763
|
/** Error */
|
|
5386
5764
|
error: string | null;
|
|
5387
5765
|
}
|
|
5766
|
+
/**
|
|
5767
|
+
* WebpageCreate
|
|
5768
|
+
* 网页 URL 创建 DTO - 通过 markdown.new 转换为 Markdown 后处理
|
|
5769
|
+
*/
|
|
5770
|
+
export interface IWebpageCreate {
|
|
5771
|
+
/**
|
|
5772
|
+
* Space Id
|
|
5773
|
+
* the space of knowledge, example: petercat bot id, github repo name
|
|
5774
|
+
*/
|
|
5775
|
+
space_id: string;
|
|
5776
|
+
/**
|
|
5777
|
+
* Knowledge Type
|
|
5778
|
+
* type of knowledge resource
|
|
5779
|
+
* @default "webpage"
|
|
5780
|
+
*/
|
|
5781
|
+
knowledge_type?: "webpage";
|
|
5782
|
+
/**
|
|
5783
|
+
* Knowledge Name
|
|
5784
|
+
* name of the knowledge resource
|
|
5785
|
+
* @maxLength 255
|
|
5786
|
+
*/
|
|
5787
|
+
knowledge_name: string;
|
|
5788
|
+
/**
|
|
5789
|
+
* Metadata
|
|
5790
|
+
* additional metadata, user can update it
|
|
5791
|
+
* @default {}
|
|
5792
|
+
*/
|
|
5793
|
+
metadata?: Record<string, any>;
|
|
5794
|
+
/**
|
|
5795
|
+
* Source Type
|
|
5796
|
+
* source type
|
|
5797
|
+
* @default "webpage"
|
|
5798
|
+
*/
|
|
5799
|
+
source_type?: "webpage";
|
|
5800
|
+
/**
|
|
5801
|
+
* Embedding Model Name
|
|
5802
|
+
* name of the embedding model. you can set any other model if target embedding service registered
|
|
5803
|
+
*/
|
|
5804
|
+
embedding_model_name: string;
|
|
5805
|
+
/**
|
|
5806
|
+
* File Sha
|
|
5807
|
+
* SHA of the file
|
|
5808
|
+
*/
|
|
5809
|
+
file_sha?: string | null;
|
|
5810
|
+
/**
|
|
5811
|
+
* File Size
|
|
5812
|
+
* size of the file
|
|
5813
|
+
*/
|
|
5814
|
+
file_size?: number | null;
|
|
5815
|
+
/**
|
|
5816
|
+
* Parent Id
|
|
5817
|
+
* parent id of the knowledge
|
|
5818
|
+
*/
|
|
5819
|
+
parent_id?: string | null;
|
|
5820
|
+
/** source config of the knowledge (webpage URL) */
|
|
5821
|
+
source_config: IOpenUrlSourceConfig;
|
|
5822
|
+
/** split config of the knowledge (markdown after markdown.new conversion) */
|
|
5823
|
+
split_config: IMarkdownSplitConfig;
|
|
5824
|
+
}
|
|
5388
5825
|
/**
|
|
5389
5826
|
* WohuProductSpace
|
|
5390
5827
|
* 产品空间响应模型
|
|
@@ -5665,7 +6102,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5665
6102
|
* @summary Add Knowledge
|
|
5666
6103
|
* @request POST:/api/knowledge/add
|
|
5667
6104
|
*/
|
|
5668
|
-
addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IGithubRepoCreate | IQACreate | IYuqueCreate | IHituNodePackageCreate | IHituNodePackageElementCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
|
|
6105
|
+
addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IPowerPointCreate | IWebpageCreate | IGithubRepoCreate | IQACreate | IYuqueCreate | IHituNodePackageCreate | IHituNodePackageElementCreate | IFolderCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
|
|
5669
6106
|
/**
|
|
5670
6107
|
* @description 更新知识(全量更新) 更新知识的完整信息,支持以下字段变更: - 元数据(metadata)变更:同步更新对应 chunk 的 metadata - 启用状态(enabled)变更:同步更新对应 chunk 的启用状态 - 嵌入模型/分片配置/来源配置变更:自动触发重新入库任务 注意:knowledge_type、source_type 等核心字段不可变更。 Args: knowledge: 完整的知识对象,需包含 knowledge_id Returns: 更新后的知识对象(auth_info 字段已脱敏)
|
|
5671
6108
|
*
|
|
@@ -5733,7 +6170,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5733
6170
|
knowledge_id: string;
|
|
5734
6171
|
}, params?: RequestParams) => Promise<HttpResponse<IResponseModelKnowledge, void | IHTTPValidationError>>;
|
|
5735
6172
|
/**
|
|
5736
|
-
* @description 删除知识 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
|
|
6173
|
+
* @description 删除知识 如果删除的是 folder 类型,会自动级联删除所有子孙节点。 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
|
|
5737
6174
|
*
|
|
5738
6175
|
* @tags knowledge
|
|
5739
6176
|
* @name DeleteKnowledge
|
|
@@ -5752,7 +6189,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5752
6189
|
* @summary Get Embedding Models List
|
|
5753
6190
|
* @request GET:/api/knowledge/embedding/models
|
|
5754
6191
|
*/
|
|
5755
|
-
getEmbeddingModelsList: (params?: RequestParams) => Promise<HttpResponse<
|
|
6192
|
+
getEmbeddingModelsList: (params?: RequestParams) => Promise<HttpResponse<IResponseModelListDictStrAny, void | IHTTPValidationError>>;
|
|
5756
6193
|
/**
|
|
5757
6194
|
* @description 根据名称批量查询知识 在指定 Space 下,根据知识名称列表批量查询知识详情。 适用于已知知识名称需要获取完整信息的场景。 Args: body.space_id: 空间ID body.knowledge_names: 知识名称列表 Returns: 符合条件的知识列表(auth_info 字段已脱敏)
|
|
5758
6195
|
*
|
|
@@ -5801,6 +6238,35 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5801
6238
|
* @request POST:/api/knowledge/refresh/by_conditions
|
|
5802
6239
|
*/
|
|
5803
6240
|
refreshKnowledgeByConditions: (data: IKnowledgeRefreshByConditionsRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelKnowledgeRefreshResult, void | IHTTPValidationError>>;
|
|
6241
|
+
/**
|
|
6242
|
+
* @description 获取目录树结构 获取指定空间下的文件夹树形结构,返回嵌套的树形数据。 自动检测并处理循环引用。 Args: space_id: 空间ID root_id: 根节点ID,None 表示从空间根目录开始 Returns: 嵌套的树形结构,包含 items 列表
|
|
6243
|
+
*
|
|
6244
|
+
* @tags knowledge
|
|
6245
|
+
* @name GetFolderTree
|
|
6246
|
+
* @summary Get Folder Tree
|
|
6247
|
+
* @request GET:/api/knowledge/folder/tree
|
|
6248
|
+
*/
|
|
6249
|
+
getFolderTree: (query: {
|
|
6250
|
+
/**
|
|
6251
|
+
* Space Id
|
|
6252
|
+
* 空间ID
|
|
6253
|
+
*/
|
|
6254
|
+
space_id: string;
|
|
6255
|
+
/**
|
|
6256
|
+
* Root Id
|
|
6257
|
+
* 根节点ID,None 表示从空间根目录开始
|
|
6258
|
+
*/
|
|
6259
|
+
root_id?: string | null;
|
|
6260
|
+
}, params?: RequestParams) => Promise<HttpResponse<IResponseModelDictStrAny, void | IHTTPValidationError>>;
|
|
6261
|
+
/**
|
|
6262
|
+
* @description 移动知识到指定文件夹下 将指定的知识批量移动到目标文件夹。如果目标文件夹不存在或不是文件夹类型, 将抛出异常。不支持将文件夹移动到自身或其子文件夹下。 Args: body.knowledge_ids: 要移动的知识ID列表 body.target_folder_id: 目标文件夹ID,None 表示移动到根目录 Returns: 成功时返回 None
|
|
6263
|
+
*
|
|
6264
|
+
* @tags knowledge
|
|
6265
|
+
* @name MoveKnowledgeToFolder
|
|
6266
|
+
* @summary Move Knowledge To Folder
|
|
6267
|
+
* @request POST:/api/knowledge/folder/move
|
|
6268
|
+
*/
|
|
6269
|
+
moveKnowledgeToFolder: (data: IMoveKnowledgeRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelNoneType, void | IHTTPValidationError>>;
|
|
5804
6270
|
};
|
|
5805
6271
|
knowledgeIndex: {
|
|
5806
6272
|
/**
|
|
@@ -5998,7 +6464,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
5998
6464
|
*/
|
|
5999
6465
|
checkTenantName: (data: ITenantNameCheckRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelTenantNameCheckResponse, void | IHTTPValidationError>>;
|
|
6000
6466
|
/**
|
|
6001
|
-
* @description 创建租户 创建新租户并自动生成认证密钥(secret_key): - tenant_id
|
|
6467
|
+
* @description 创建租户 创建新租户并自动生成认证密钥(secret_key): - tenant_id 可自定义或由系统自动生成 - secret_key 由系统自动生成,仅在创建时返回一次 - 创建成功后根据 notify 参数决定是否发送通知邮件 Args: params.tenant_name: 租户名称,必须唯一 params.email: 联系邮箱,用于接收通知 params.metadata: 自定义元数据(可选) params.notify: 是否发送邮件通知,默认 true params.tenant_id: 自定义租户ID(可选),支持字母、数字、下划线、中划线 Returns: 创建的租户信息,包含 secret_key(仅此一次) Raises: 400: 租户名称或ID已存在
|
|
6002
6468
|
*
|
|
6003
6469
|
* @tags tenant
|
|
6004
6470
|
* @name CreateTenant
|
|
@@ -6054,7 +6520,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6054
6520
|
page_size?: number;
|
|
6055
6521
|
}, params?: RequestParams) => Promise<HttpResponse<IResponseModelPageResponseTenant, void | IHTTPValidationError>>;
|
|
6056
6522
|
/**
|
|
6057
|
-
* @description 获取当前租户信息
|
|
6523
|
+
* @description 获取当前租户信息 Returns: 当前租户的详细信息(secret_key 字段已脱敏)
|
|
6058
6524
|
*
|
|
6059
6525
|
* @tags tenant
|
|
6060
6526
|
* @name GetTenant
|
|
@@ -6796,7 +7262,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6796
7262
|
};
|
|
6797
7263
|
file: {
|
|
6798
7264
|
/**
|
|
6799
|
-
* @description 上传文件到 AFTS 存储
|
|
7265
|
+
* @description 上传文件到 AFTS 存储 需要 FILE 资源的 CREATE 权限。上传的文件会被存储到 AFTS(Ant File Transfer Service)。 文件路径生成规则: - tenant_id 作为根路径:{tenant_id}/ - 使用日期做分隔:{year}/{month}/{day}/ - 随机码作为路径层级:{random_code}/ - 文件名保持原样:{filename} - 最终格式:tenant_xxx/2026/03/01/abc123def456/image.png 设计意图: - tenant_id 追踪文件归属 - 文件名保持原样,方便识别和管理 - 随机码作为路径层级,增加不可预测性 - 文件可读,但路径不可猜测 Args: file: 上传的文件 Returns: FileUploadResponse: 包含文件 ID、URL、路径等信息
|
|
6800
7266
|
*
|
|
6801
7267
|
* @tags file
|
|
6802
7268
|
* @name UploadFile
|
|
@@ -6805,6 +7271,38 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
6805
7271
|
*/
|
|
6806
7272
|
uploadFile: (data: IBodyUploadFile, params?: RequestParams) => Promise<HttpResponse<IResponseModelFileUploadResponse, void | IHTTPValidationError>>;
|
|
6807
7273
|
};
|
|
7274
|
+
cli: {
|
|
7275
|
+
/**
|
|
7276
|
+
* No description
|
|
7277
|
+
*
|
|
7278
|
+
* @tags cli_sync
|
|
7279
|
+
* @name CliSyncSnapshot
|
|
7280
|
+
* @summary Get Sync Snapshot
|
|
7281
|
+
* @request GET:/api/cli/sync/snapshot
|
|
7282
|
+
*/
|
|
7283
|
+
cliSyncSnapshot: (query: {
|
|
7284
|
+
/** Space Id */
|
|
7285
|
+
space_id: string;
|
|
7286
|
+
}, params?: RequestParams) => Promise<HttpResponse<IResponseModelSyncSnapshotData, void | IHTTPValidationError>>;
|
|
7287
|
+
/**
|
|
7288
|
+
* No description
|
|
7289
|
+
*
|
|
7290
|
+
* @tags cli_sync
|
|
7291
|
+
* @name CliSyncMaterialize
|
|
7292
|
+
* @summary Materialize Sync Knowledge
|
|
7293
|
+
* @request POST:/api/cli/sync/materialize
|
|
7294
|
+
*/
|
|
7295
|
+
cliSyncMaterialize: (data: ISyncMaterializeRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelSyncMaterializeData, void | IHTTPValidationError>>;
|
|
7296
|
+
/**
|
|
7297
|
+
* No description
|
|
7298
|
+
*
|
|
7299
|
+
* @tags cli_sync
|
|
7300
|
+
* @name CliSyncApply
|
|
7301
|
+
* @summary Apply Sync Changeset
|
|
7302
|
+
* @request POST:/api/cli/sync/apply
|
|
7303
|
+
*/
|
|
7304
|
+
cliSyncApply: (data: ICliApplyRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelCliApplyResponse, void | IHTTPValidationError>>;
|
|
7305
|
+
};
|
|
6808
7306
|
healthChecker: {
|
|
6809
7307
|
/**
|
|
6810
7308
|
* No description
|
package/dist/api.js
CHANGED
|
@@ -22,7 +22,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
22
22
|
return t;
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
exports.Api = exports.HttpClient = exports.ContentType = exports.IAction = exports.IKnowledgeSourceEnum = exports.IKnowledgeTypeEnum = exports.ILanguage = exports.IMemoryStatusEnum = exports.IMemoryTypeEnum = exports.IOperator = exports.IResource = exports.ISchedulerCronTimezone = exports.ISchedulerIntervalType = exports.ISchedulerJobStatus = exports.ISchedulerJobType = exports.ISchedulerRunResult = exports.ISchedulerTargetType = exports.ITagObjectType = exports.ITaskStatus = exports.ITextKnowledgeContentUpdateStatusEnum = exports.IWebhookDeliveryStatus = exports.IWebhookEventType = exports.IWebhookOutboxStatus = exports.IWebhookSubscriptionStatus = void 0;
|
|
25
|
+
exports.Api = exports.HttpClient = exports.ContentType = exports.IAction = exports.ICliApplyStatus = exports.ICliChangeOp = exports.IKnowledgeSourceEnum = exports.IKnowledgeTypeEnum = exports.ILanguage = exports.IMemoryStatusEnum = exports.IMemoryTypeEnum = exports.IOperator = exports.IResource = exports.ISchedulerCronTimezone = exports.ISchedulerIntervalType = exports.ISchedulerJobStatus = exports.ISchedulerJobType = exports.ISchedulerRunResult = exports.ISchedulerTargetType = exports.ITagObjectType = exports.ITaskStatus = exports.ITextKnowledgeContentUpdateStatusEnum = exports.IWebhookDeliveryStatus = exports.IWebhookEventType = exports.IWebhookOutboxStatus = exports.IWebhookSubscriptionStatus = void 0;
|
|
26
26
|
/**
|
|
27
27
|
* WebhookSubscriptionStatus
|
|
28
28
|
* Webhook订阅状态
|
|
@@ -250,7 +250,10 @@ var IKnowledgeTypeEnum;
|
|
|
250
250
|
IKnowledgeTypeEnum["Json"] = "json";
|
|
251
251
|
IKnowledgeTypeEnum["Docx"] = "docx";
|
|
252
252
|
IKnowledgeTypeEnum["Pdf"] = "pdf";
|
|
253
|
+
IKnowledgeTypeEnum["Powerpoint"] = "powerpoint";
|
|
254
|
+
IKnowledgeTypeEnum["Webpage"] = "webpage";
|
|
253
255
|
IKnowledgeTypeEnum["Qa"] = "qa";
|
|
256
|
+
IKnowledgeTypeEnum["Folder"] = "folder";
|
|
254
257
|
IKnowledgeTypeEnum["Yuquedoc"] = "yuquedoc";
|
|
255
258
|
IKnowledgeTypeEnum["YuqueBook"] = "yuque_book";
|
|
256
259
|
IKnowledgeTypeEnum["GithubRepo"] = "github_repo";
|
|
@@ -296,12 +299,29 @@ var IKnowledgeSourceEnum;
|
|
|
296
299
|
IKnowledgeSourceEnum["GithubFile"] = "github_file";
|
|
297
300
|
IKnowledgeSourceEnum["UserInputText"] = "user_input_text";
|
|
298
301
|
IKnowledgeSourceEnum["CloudStorageText"] = "cloud_storage_text";
|
|
302
|
+
IKnowledgeSourceEnum["CloudStorageFile"] = "cloud_storage_file";
|
|
299
303
|
IKnowledgeSourceEnum["CloudStorageImage"] = "cloud_storage_image";
|
|
304
|
+
IKnowledgeSourceEnum["Os"] = "os";
|
|
300
305
|
IKnowledgeSourceEnum["Yuque"] = "yuque";
|
|
301
306
|
IKnowledgeSourceEnum["YuquePersonalDoc"] = "yuque_personal_doc";
|
|
302
307
|
IKnowledgeSourceEnum["YuquePersonalNote"] = "yuque_personal_note";
|
|
303
308
|
IKnowledgeSourceEnum["HituNodePackage"] = "hitu_node_package";
|
|
309
|
+
IKnowledgeSourceEnum["Webpage"] = "webpage";
|
|
304
310
|
})(IKnowledgeSourceEnum || (exports.IKnowledgeSourceEnum = IKnowledgeSourceEnum = {}));
|
|
311
|
+
/** CliChangeOp */
|
|
312
|
+
var ICliChangeOp;
|
|
313
|
+
(function (ICliChangeOp) {
|
|
314
|
+
ICliChangeOp["Add"] = "add";
|
|
315
|
+
ICliChangeOp["Modify"] = "modify";
|
|
316
|
+
ICliChangeOp["Delete"] = "delete";
|
|
317
|
+
})(ICliChangeOp || (exports.ICliChangeOp = ICliChangeOp = {}));
|
|
318
|
+
/** CliApplyStatus */
|
|
319
|
+
var ICliApplyStatus;
|
|
320
|
+
(function (ICliApplyStatus) {
|
|
321
|
+
ICliApplyStatus["Applied"] = "applied";
|
|
322
|
+
ICliApplyStatus["Skipped"] = "skipped";
|
|
323
|
+
ICliApplyStatus["Failed"] = "failed";
|
|
324
|
+
})(ICliApplyStatus || (exports.ICliApplyStatus = ICliApplyStatus = {}));
|
|
305
325
|
/** Action */
|
|
306
326
|
var IAction;
|
|
307
327
|
(function (IAction) {
|
|
@@ -555,7 +575,7 @@ class Api extends HttpClient {
|
|
|
555
575
|
*/
|
|
556
576
|
getKnowledgeById: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/detail`, method: "GET", query: query, format: "json" }, params)),
|
|
557
577
|
/**
|
|
558
|
-
* @description 删除知识 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
|
|
578
|
+
* @description 删除知识 如果删除的是 folder 类型,会自动级联删除所有子孙节点。 级联删除知识及其关联数据: - 删除 MySQL 中的知识记录和相关任务 - 删除向量数据库中的所有 chunk 数据 - 清除所属 Space 的总结时间标记(下次总结时将进行全量总结) Args: knowledge_id: 要删除的知识ID Raises: 404: 知识不存在
|
|
559
579
|
*
|
|
560
580
|
* @tags knowledge
|
|
561
581
|
* @name DeleteKnowledge
|
|
@@ -617,6 +637,24 @@ class Api extends HttpClient {
|
|
|
617
637
|
* @request POST:/api/knowledge/refresh/by_conditions
|
|
618
638
|
*/
|
|
619
639
|
refreshKnowledgeByConditions: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/refresh/by_conditions`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
640
|
+
/**
|
|
641
|
+
* @description 获取目录树结构 获取指定空间下的文件夹树形结构,返回嵌套的树形数据。 自动检测并处理循环引用。 Args: space_id: 空间ID root_id: 根节点ID,None 表示从空间根目录开始 Returns: 嵌套的树形结构,包含 items 列表
|
|
642
|
+
*
|
|
643
|
+
* @tags knowledge
|
|
644
|
+
* @name GetFolderTree
|
|
645
|
+
* @summary Get Folder Tree
|
|
646
|
+
* @request GET:/api/knowledge/folder/tree
|
|
647
|
+
*/
|
|
648
|
+
getFolderTree: (query, params = {}) => this.request(Object.assign({ path: `/api/knowledge/folder/tree`, method: "GET", query: query, format: "json" }, params)),
|
|
649
|
+
/**
|
|
650
|
+
* @description 移动知识到指定文件夹下 将指定的知识批量移动到目标文件夹。如果目标文件夹不存在或不是文件夹类型, 将抛出异常。不支持将文件夹移动到自身或其子文件夹下。 Args: body.knowledge_ids: 要移动的知识ID列表 body.target_folder_id: 目标文件夹ID,None 表示移动到根目录 Returns: 成功时返回 None
|
|
651
|
+
*
|
|
652
|
+
* @tags knowledge
|
|
653
|
+
* @name MoveKnowledgeToFolder
|
|
654
|
+
* @summary Move Knowledge To Folder
|
|
655
|
+
* @request POST:/api/knowledge/folder/move
|
|
656
|
+
*/
|
|
657
|
+
moveKnowledgeToFolder: (data, params = {}) => this.request(Object.assign({ path: `/api/knowledge/folder/move`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
620
658
|
};
|
|
621
659
|
this.knowledgeIndex = {
|
|
622
660
|
/**
|
|
@@ -808,7 +846,7 @@ class Api extends HttpClient {
|
|
|
808
846
|
*/
|
|
809
847
|
checkTenantName: (data, params = {}) => this.request(Object.assign({ path: `/api/tenant/check-name`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
810
848
|
/**
|
|
811
|
-
* @description 创建租户 创建新租户并自动生成认证密钥(secret_key): - tenant_id
|
|
849
|
+
* @description 创建租户 创建新租户并自动生成认证密钥(secret_key): - tenant_id 可自定义或由系统自动生成 - secret_key 由系统自动生成,仅在创建时返回一次 - 创建成功后根据 notify 参数决定是否发送通知邮件 Args: params.tenant_name: 租户名称,必须唯一 params.email: 联系邮箱,用于接收通知 params.metadata: 自定义元数据(可选) params.notify: 是否发送邮件通知,默认 true params.tenant_id: 自定义租户ID(可选),支持字母、数字、下划线、中划线 Returns: 创建的租户信息,包含 secret_key(仅此一次) Raises: 400: 租户名称或ID已存在
|
|
812
850
|
*
|
|
813
851
|
* @tags tenant
|
|
814
852
|
* @name CreateTenant
|
|
@@ -853,7 +891,7 @@ class Api extends HttpClient {
|
|
|
853
891
|
*/
|
|
854
892
|
getTenantList: (query, params = {}) => this.request(Object.assign({ path: `/api/tenant/list`, method: "GET", query: query, format: "json" }, params)),
|
|
855
893
|
/**
|
|
856
|
-
* @description 获取当前租户信息
|
|
894
|
+
* @description 获取当前租户信息 Returns: 当前租户的详细信息(secret_key 字段已脱敏)
|
|
857
895
|
*
|
|
858
896
|
* @tags tenant
|
|
859
897
|
* @name GetTenant
|
|
@@ -1566,7 +1604,7 @@ class Api extends HttpClient {
|
|
|
1566
1604
|
};
|
|
1567
1605
|
this.file = {
|
|
1568
1606
|
/**
|
|
1569
|
-
* @description 上传文件到 AFTS 存储
|
|
1607
|
+
* @description 上传文件到 AFTS 存储 需要 FILE 资源的 CREATE 权限。上传的文件会被存储到 AFTS(Ant File Transfer Service)。 文件路径生成规则: - tenant_id 作为根路径:{tenant_id}/ - 使用日期做分隔:{year}/{month}/{day}/ - 随机码作为路径层级:{random_code}/ - 文件名保持原样:{filename} - 最终格式:tenant_xxx/2026/03/01/abc123def456/image.png 设计意图: - tenant_id 追踪文件归属 - 文件名保持原样,方便识别和管理 - 随机码作为路径层级,增加不可预测性 - 文件可读,但路径不可猜测 Args: file: 上传的文件 Returns: FileUploadResponse: 包含文件 ID、URL、路径等信息
|
|
1570
1608
|
*
|
|
1571
1609
|
* @tags file
|
|
1572
1610
|
* @name UploadFile
|
|
@@ -1575,6 +1613,35 @@ class Api extends HttpClient {
|
|
|
1575
1613
|
*/
|
|
1576
1614
|
uploadFile: (data, params = {}) => this.request(Object.assign({ path: `/api/file/upload`, method: "POST", body: data, type: ContentType.FormData, format: "json" }, params)),
|
|
1577
1615
|
};
|
|
1616
|
+
this.cli = {
|
|
1617
|
+
/**
|
|
1618
|
+
* No description
|
|
1619
|
+
*
|
|
1620
|
+
* @tags cli_sync
|
|
1621
|
+
* @name CliSyncSnapshot
|
|
1622
|
+
* @summary Get Sync Snapshot
|
|
1623
|
+
* @request GET:/api/cli/sync/snapshot
|
|
1624
|
+
*/
|
|
1625
|
+
cliSyncSnapshot: (query, params = {}) => this.request(Object.assign({ path: `/api/cli/sync/snapshot`, method: "GET", query: query, format: "json" }, params)),
|
|
1626
|
+
/**
|
|
1627
|
+
* No description
|
|
1628
|
+
*
|
|
1629
|
+
* @tags cli_sync
|
|
1630
|
+
* @name CliSyncMaterialize
|
|
1631
|
+
* @summary Materialize Sync Knowledge
|
|
1632
|
+
* @request POST:/api/cli/sync/materialize
|
|
1633
|
+
*/
|
|
1634
|
+
cliSyncMaterialize: (data, params = {}) => this.request(Object.assign({ path: `/api/cli/sync/materialize`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
1635
|
+
/**
|
|
1636
|
+
* No description
|
|
1637
|
+
*
|
|
1638
|
+
* @tags cli_sync
|
|
1639
|
+
* @name CliSyncApply
|
|
1640
|
+
* @summary Apply Sync Changeset
|
|
1641
|
+
* @request POST:/api/cli/sync/apply
|
|
1642
|
+
*/
|
|
1643
|
+
cliSyncApply: (data, params = {}) => this.request(Object.assign({ path: `/api/cli/sync/apply`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
|
|
1644
|
+
};
|
|
1578
1645
|
this.healthChecker = {
|
|
1579
1646
|
/**
|
|
1580
1647
|
* No description
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@petercatai/whisker-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.202603061047",
|
|
4
4
|
"description": "Generated API client (Production)",
|
|
5
5
|
"main": "dist/api.js",
|
|
6
6
|
"types": "dist/api.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"tag": "latest"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/node": "^25.3.
|
|
19
|
+
"@types/node": "^25.3.5",
|
|
20
20
|
"axios": "^1.13.6",
|
|
21
21
|
"typescript": "^5.9.3"
|
|
22
22
|
}
|