@petercatai/whisker-client 3.0.0 → 3.0.202603061556

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 CHANGED
@@ -256,11 +256,12 @@ export declare enum IKnowledgeSourceEnum {
256
256
  CloudStorageText = "cloud_storage_text",
257
257
  CloudStorageFile = "cloud_storage_file",
258
258
  CloudStorageImage = "cloud_storage_image",
259
- Os = "os",
259
+ Virtual = "virtual",
260
260
  Yuque = "yuque",
261
261
  YuquePersonalDoc = "yuque_personal_doc",
262
262
  YuquePersonalNote = "yuque_personal_note",
263
- HituNodePackage = "hitu_node_package"
263
+ HituNodePackage = "hitu_node_package",
264
+ Webpage = "webpage"
264
265
  }
265
266
  /** CliChangeOp */
266
267
  export declare enum ICliChangeOp {
@@ -1208,6 +1209,7 @@ export interface ICliApplyResultItem {
1208
1209
  knowledge_type?: string | null;
1209
1210
  /** Message */
1210
1211
  message?: string | null;
1212
+ sync_item_after?: ISyncSnapshotItem | null;
1211
1213
  }
1212
1214
  /** CliChangesetEntry */
1213
1215
  export interface ICliChangesetEntry {
@@ -1246,6 +1248,64 @@ export interface ICondition {
1246
1248
  /** Value */
1247
1249
  value: any;
1248
1250
  }
1251
+ /**
1252
+ * DocxCreate
1253
+ * Word 文档创建 DTO - 通过 markitdown 转换为 Markdown 后处理
1254
+ */
1255
+ export interface IDocxCreate {
1256
+ /**
1257
+ * Space Id
1258
+ * the space of knowledge, example: petercat bot id, github repo name
1259
+ */
1260
+ space_id: string;
1261
+ /**
1262
+ * Knowledge Type
1263
+ * type of knowledge resource
1264
+ * @default "docx"
1265
+ */
1266
+ knowledge_type?: "docx";
1267
+ /**
1268
+ * Knowledge Name
1269
+ * name of the knowledge resource
1270
+ * @maxLength 255
1271
+ */
1272
+ knowledge_name: string;
1273
+ /**
1274
+ * Metadata
1275
+ * additional metadata, user can update it
1276
+ * @default {}
1277
+ */
1278
+ metadata?: Record<string, any>;
1279
+ /** source type */
1280
+ source_type: IKnowledgeSourceEnum;
1281
+ /**
1282
+ * Embedding Model Name
1283
+ * name of the embedding model. you can set any other model if target embedding service registered
1284
+ */
1285
+ embedding_model_name: string;
1286
+ /**
1287
+ * File Sha
1288
+ * SHA of the file
1289
+ */
1290
+ file_sha: string;
1291
+ /**
1292
+ * File Size
1293
+ * Byte size of the file
1294
+ */
1295
+ file_size: number;
1296
+ /**
1297
+ * Parent Id
1298
+ * parent id of the knowledge
1299
+ */
1300
+ parent_id?: string | null;
1301
+ /**
1302
+ * Source Config
1303
+ * source config of the knowledge
1304
+ */
1305
+ source_config: IOpenUrlSourceConfig | IOpenIdSourceConfig | IS3SourceConfig;
1306
+ /** split config of the knowledge (markdown after markitdown conversion) */
1307
+ split_config: IMarkdownSplitConfig;
1308
+ }
1249
1309
  /** EnableStatusUpdate */
1250
1310
  export interface IEnableStatusUpdate {
1251
1311
  /** Knowledge Id */
@@ -1319,10 +1379,10 @@ export interface IFolderCreate {
1319
1379
  metadata?: Record<string, any>;
1320
1380
  /**
1321
1381
  * Source Type
1322
- * folder source type
1323
- * @default "os"
1382
+ * virtual source type for folder knowledge
1383
+ * @default "virtual"
1324
1384
  */
1325
- source_type?: "os";
1385
+ source_type?: "virtual";
1326
1386
  /**
1327
1387
  * Embedding Model Name
1328
1388
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -2860,12 +2920,12 @@ export interface IPDFCreate {
2860
2920
  * File Sha
2861
2921
  * SHA of the file
2862
2922
  */
2863
- file_sha?: string | null;
2923
+ file_sha: string;
2864
2924
  /**
2865
2925
  * File Size
2866
2926
  * Byte size of the file
2867
2927
  */
2868
- file_size?: number | null;
2928
+ file_size: number;
2869
2929
  /**
2870
2930
  * Parent Id
2871
2931
  * parent id of the knowledge
@@ -5035,6 +5095,8 @@ export interface ISyncMaterializeItem {
5035
5095
  source_locator?: Record<string, any> | null;
5036
5096
  /** Materialize Error */
5037
5097
  materialize_error?: string | null;
5098
+ /** Remote Revision */
5099
+ remote_revision?: string | null;
5038
5100
  }
5039
5101
  /** SyncMaterializeRequest */
5040
5102
  export interface ISyncMaterializeRequest {
@@ -5042,6 +5104,8 @@ export interface ISyncMaterializeRequest {
5042
5104
  space_id: string;
5043
5105
  /** Knowledge Ids */
5044
5106
  knowledge_ids?: string[];
5107
+ /** Expected Snapshot Token */
5108
+ expected_snapshot_token?: string | null;
5045
5109
  }
5046
5110
  /** SyncSnapshotData */
5047
5111
  export interface ISyncSnapshotData {
@@ -5072,6 +5136,8 @@ export interface ISyncSnapshotItem {
5072
5136
  metadata_digest?: string | null;
5073
5137
  /** Parent Id */
5074
5138
  parent_id?: string | null;
5139
+ /** Remote Revision */
5140
+ remote_revision?: string | null;
5075
5141
  }
5076
5142
  /** Tag */
5077
5143
  export interface ITag {
@@ -5350,6 +5416,17 @@ export interface ITenantCreate {
5350
5416
  email: string;
5351
5417
  /** Metadata */
5352
5418
  metadata?: Record<string, any> | null;
5419
+ /**
5420
+ * Notify
5421
+ * 是否发送邮件通知,默认 true
5422
+ * @default true
5423
+ */
5424
+ notify?: boolean;
5425
+ /**
5426
+ * Tenant Id
5427
+ * 租户ID(可选),支持字母、数字、下划线、中划线
5428
+ */
5429
+ tenant_id?: string | null;
5353
5430
  }
5354
5431
  /** TenantLog */
5355
5432
  export interface ITenantLog {
@@ -5779,8 +5856,12 @@ export interface IWebpageCreate {
5779
5856
  * @default {}
5780
5857
  */
5781
5858
  metadata?: Record<string, any>;
5782
- /** source type */
5783
- source_type: IKnowledgeSourceEnum;
5859
+ /**
5860
+ * Source Type
5861
+ * source type
5862
+ * @default "webpage"
5863
+ */
5864
+ source_type?: "webpage";
5784
5865
  /**
5785
5866
  * Embedding Model Name
5786
5867
  * name of the embedding model. you can set any other model if target embedding service registered
@@ -6086,7 +6167,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6086
6167
  * @summary Add Knowledge
6087
6168
  * @request POST:/api/knowledge/add
6088
6169
  */
6089
- addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IPowerPointCreate | IWebpageCreate | IGithubRepoCreate | IQACreate | IYuqueCreate | IHituNodePackageCreate | IHituNodePackageElementCreate | IFolderCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
6170
+ addKnowledge: (data: (ITextCreate | IImageCreate | IJSONCreate | IMarkdownCreate | IPDFCreate | IDocxCreate | IPowerPointCreate | IWebpageCreate | IGithubRepoCreate | IQACreate | IYuqueCreate | IHituNodePackageCreate | IHituNodePackageElementCreate | IFolderCreate)[], params?: RequestParams) => Promise<HttpResponse<IResponseModelListKnowledge, void | IHTTPValidationError>>;
6090
6171
  /**
6091
6172
  * @description 更新知识(全量更新) 更新知识的完整信息,支持以下字段变更: - 元数据(metadata)变更:同步更新对应 chunk 的 metadata - 启用状态(enabled)变更:同步更新对应 chunk 的启用状态 - 嵌入模型/分片配置/来源配置变更:自动触发重新入库任务 注意:knowledge_type、source_type 等核心字段不可变更。 Args: knowledge: 完整的知识对象,需包含 knowledge_id Returns: 更新后的知识对象(auth_info 字段已脱敏)
6092
6173
  *
@@ -6448,7 +6529,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
6448
6529
  */
6449
6530
  checkTenantName: (data: ITenantNameCheckRequest, params?: RequestParams) => Promise<HttpResponse<IResponseModelTenantNameCheckResponse, void | IHTTPValidationError>>;
6450
6531
  /**
6451
- * @description 创建租户 创建新租户并自动生成认证密钥(secret_key): - tenant_id secret_key 由系统自动生成 - secret_key 仅在创建时返回一次,后续无法再次获取,请妥善保存 - 创建成功后会发送通知邮件到指定邮箱 Args: params.tenant_name: 租户名称,必须唯一 params.email: 联系邮箱,用于接收通知 params.metadata: 自定义元数据(可选) Returns: 创建的租户信息,包含 secret_key(仅此一次) Raises: 400: 租户名称已存在
6532
+ * @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已存在
6452
6533
  *
6453
6534
  * @tags tenant
6454
6535
  * @name CreateTenant
package/dist/api.js CHANGED
@@ -301,11 +301,12 @@ var IKnowledgeSourceEnum;
301
301
  IKnowledgeSourceEnum["CloudStorageText"] = "cloud_storage_text";
302
302
  IKnowledgeSourceEnum["CloudStorageFile"] = "cloud_storage_file";
303
303
  IKnowledgeSourceEnum["CloudStorageImage"] = "cloud_storage_image";
304
- IKnowledgeSourceEnum["Os"] = "os";
304
+ IKnowledgeSourceEnum["Virtual"] = "virtual";
305
305
  IKnowledgeSourceEnum["Yuque"] = "yuque";
306
306
  IKnowledgeSourceEnum["YuquePersonalDoc"] = "yuque_personal_doc";
307
307
  IKnowledgeSourceEnum["YuquePersonalNote"] = "yuque_personal_note";
308
308
  IKnowledgeSourceEnum["HituNodePackage"] = "hitu_node_package";
309
+ IKnowledgeSourceEnum["Webpage"] = "webpage";
309
310
  })(IKnowledgeSourceEnum || (exports.IKnowledgeSourceEnum = IKnowledgeSourceEnum = {}));
310
311
  /** CliChangeOp */
311
312
  var ICliChangeOp;
@@ -845,7 +846,7 @@ class Api extends HttpClient {
845
846
  */
846
847
  checkTenantName: (data, params = {}) => this.request(Object.assign({ path: `/api/tenant/check-name`, method: "POST", body: data, type: ContentType.Json, format: "json" }, params)),
847
848
  /**
848
- * @description 创建租户 创建新租户并自动生成认证密钥(secret_key): - tenant_id secret_key 由系统自动生成 - secret_key 仅在创建时返回一次,后续无法再次获取,请妥善保存 - 创建成功后会发送通知邮件到指定邮箱 Args: params.tenant_name: 租户名称,必须唯一 params.email: 联系邮箱,用于接收通知 params.metadata: 自定义元数据(可选) Returns: 创建的租户信息,包含 secret_key(仅此一次) Raises: 400: 租户名称已存在
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已存在
849
850
  *
850
851
  * @tags tenant
851
852
  * @name CreateTenant
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@petercatai/whisker-client",
3
- "version": "3.0.0",
3
+ "version": "3.0.202603061556",
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.3",
19
+ "@types/node": "^25.3.5",
20
20
  "axios": "^1.13.6",
21
21
  "typescript": "^5.9.3"
22
22
  }