@larksuiteoapi/node-sdk 1.8.1 → 1.10.0

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.
Files changed (4) hide show
  1. package/es/index.js +899 -171
  2. package/lib/index.js +899 -171
  3. package/package.json +1 -1
  4. package/types/index.d.ts +1682 -115
package/lib/index.js CHANGED
@@ -129,9 +129,17 @@ class DefaultCache {
129
129
  constructor() {
130
130
  this.values = new Map();
131
131
  }
132
- get(key) {
132
+ // When there is a namespace, splice the namespace and key to form a new key
133
+ getCacheKey(key, namespace) {
134
+ if (namespace) {
135
+ return `${namespace}/${key.toString()}`;
136
+ }
137
+ return key;
138
+ }
139
+ get(key, options) {
133
140
  return __awaiter(this, void 0, void 0, function* () {
134
- const data = this.values.get(key);
141
+ const cacheKey = this.getCacheKey(key, get__default["default"](options, 'namespace'));
142
+ const data = this.values.get(cacheKey);
135
143
  if (data) {
136
144
  const { value, expiredTime } = data;
137
145
  if (!expiredTime || expiredTime - new Date().getTime() > 0) {
@@ -141,9 +149,10 @@ class DefaultCache {
141
149
  return undefined;
142
150
  });
143
151
  }
144
- set(key, value, expiredTime) {
152
+ set(key, value, expiredTime, options) {
145
153
  return __awaiter(this, void 0, void 0, function* () {
146
- this.values.set(key, {
154
+ const cacheKey = this.getCacheKey(key, get__default["default"](options, 'namespace'));
155
+ this.values.set(cacheKey, {
147
156
  value,
148
157
  expiredTime,
149
158
  });
@@ -576,7 +585,7 @@ class Client$1 {
576
585
  },
577
586
  };
578
587
  /**
579
- * 管理后台-企业勋章
588
+ * 管理后台-密码
580
589
  */
581
590
  this.admin = {
582
591
  /**
@@ -1780,7 +1789,7 @@ class Client$1 {
1780
1789
  }),
1781
1790
  },
1782
1791
  /**
1783
- * 原生审批实例
1792
+ * 审批查询
1784
1793
  */
1785
1794
  instance: {
1786
1795
  /**
@@ -3379,6 +3388,86 @@ class Client$1 {
3379
3388
  }),
3380
3389
  },
3381
3390
  };
3391
+ /**
3392
+
3393
+ */
3394
+ this.authen = {
3395
+ /**
3396
+ * access_token
3397
+ */
3398
+ accessToken: {
3399
+ /**
3400
+ * {@link https://open.feishu.cn/api-explorer?project=authen&resource=access_token&apiName=create&version=v1 click to debug }
3401
+ *
3402
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=access_token&version=v1 document }
3403
+ */
3404
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
3405
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
3406
+ return httpInstance
3407
+ .request({
3408
+ url: fillApiPath(`${this.domain}/open-apis/authen/v1/access_token`, path),
3409
+ method: "POST",
3410
+ data,
3411
+ params,
3412
+ headers,
3413
+ })
3414
+ .catch((e) => {
3415
+ this.logger.error(formatErrors(e));
3416
+ throw e;
3417
+ });
3418
+ }),
3419
+ },
3420
+ /**
3421
+ * refresh_access_token
3422
+ */
3423
+ refreshAccessToken: {
3424
+ /**
3425
+ * {@link https://open.feishu.cn/api-explorer?project=authen&resource=refresh_access_token&apiName=create&version=v1 click to debug }
3426
+ *
3427
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=refresh_access_token&version=v1 document }
3428
+ */
3429
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
3430
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
3431
+ return httpInstance
3432
+ .request({
3433
+ url: fillApiPath(`${this.domain}/open-apis/authen/v1/refresh_access_token`, path),
3434
+ method: "POST",
3435
+ data,
3436
+ params,
3437
+ headers,
3438
+ })
3439
+ .catch((e) => {
3440
+ this.logger.error(formatErrors(e));
3441
+ throw e;
3442
+ });
3443
+ }),
3444
+ },
3445
+ /**
3446
+ * user_info
3447
+ */
3448
+ userInfo: {
3449
+ /**
3450
+ * {@link https://open.feishu.cn/api-explorer?project=authen&resource=user_info&apiName=get&version=v1 click to debug }
3451
+ *
3452
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=user_info&version=v1 document }
3453
+ */
3454
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
3455
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
3456
+ return httpInstance
3457
+ .request({
3458
+ url: fillApiPath(`${this.domain}/open-apis/authen/v1/user_info`, path),
3459
+ method: "GET",
3460
+ data,
3461
+ params,
3462
+ headers,
3463
+ })
3464
+ .catch((e) => {
3465
+ this.logger.error(formatErrors(e));
3466
+ throw e;
3467
+ });
3468
+ }),
3469
+ },
3470
+ };
3382
3471
  /**
3383
3472
 
3384
3473
  */
@@ -4558,6 +4647,26 @@ class Client$1 {
4558
4647
  throw e;
4559
4648
  });
4560
4649
  }),
4650
+ /**
4651
+ * {@link https://open.feishu.cn/api-explorer?project=bitable&resource=app.table&apiName=patch&version=v1 click to debug }
4652
+ *
4653
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/bitable-v1/app-table/patch document }
4654
+ */
4655
+ patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
4656
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
4657
+ return httpInstance
4658
+ .request({
4659
+ url: fillApiPath(`${this.domain}/open-apis/bitable/v1/apps/:app_token/tables/:table_id`, path),
4660
+ method: "PATCH",
4661
+ data,
4662
+ params,
4663
+ headers,
4664
+ })
4665
+ .catch((e) => {
4666
+ this.logger.error(formatErrors(e));
4667
+ throw e;
4668
+ });
4669
+ }),
4561
4670
  },
4562
4671
  /**
4563
4672
  * 字段
@@ -8914,7 +9023,7 @@ class Client$1 {
8914
9023
  }),
8915
9024
  },
8916
9025
  /**
8917
- * 下载
9026
+ * 文件夹
8918
9027
  */
8919
9028
  file: {
8920
9029
  /**
@@ -9400,23 +9509,23 @@ class Client$1 {
9400
9509
  }),
9401
9510
  },
9402
9511
  /**
9403
- * 导入
9512
+ * 文档版本
9404
9513
  */
9405
- importTask: {
9514
+ fileVersion: {
9406
9515
  /**
9407
- * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=create&version=v1 click to debug }
9516
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=create&version=v1 click to debug }
9408
9517
  *
9409
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create document }
9518
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/create document }
9410
9519
  *
9411
- * 创建导入任务
9520
+ * 创建文档版本
9412
9521
  *
9413
- * 创建导入任务。支持导入为 doc、docx、sheet、bitable,参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide)
9522
+ * 创建文档版本。
9414
9523
  */
9415
9524
  create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9416
9525
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
9417
9526
  return httpInstance
9418
9527
  .request({
9419
- url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks`, path),
9528
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path),
9420
9529
  method: "POST",
9421
9530
  data,
9422
9531
  params,
@@ -9428,20 +9537,20 @@ class Client$1 {
9428
9537
  });
9429
9538
  }),
9430
9539
  /**
9431
- * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=get&version=v1 click to debug }
9540
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=delete&version=v1 click to debug }
9432
9541
  *
9433
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get document }
9542
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/delete document }
9434
9543
  *
9435
- * 查询导入结果
9544
+ * 删除文档版本
9436
9545
  *
9437
- * 根据创建导入任务返回的 ticket 查询导入结果。
9546
+ * 删除文档版本。
9438
9547
  */
9439
- get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9548
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9440
9549
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
9441
9550
  return httpInstance
9442
9551
  .request({
9443
- url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`, path),
9444
- method: "GET",
9552
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path),
9553
+ method: "DELETE",
9445
9554
  data,
9446
9555
  params,
9447
9556
  headers,
@@ -9451,27 +9560,68 @@ class Client$1 {
9451
9560
  throw e;
9452
9561
  });
9453
9562
  }),
9454
- },
9455
- /**
9456
- * 分片上传
9457
- */
9458
- media: {
9563
+ getWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9564
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9565
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
9566
+ const res = yield httpInstance
9567
+ .request({
9568
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path),
9569
+ method: "GET",
9570
+ headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
9571
+ params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
9572
+ })
9573
+ .catch((e) => {
9574
+ this.logger.error(formatErrors(e));
9575
+ });
9576
+ return res;
9577
+ });
9578
+ const Iterable = {
9579
+ [Symbol.asyncIterator]() {
9580
+ return __asyncGenerator(this, arguments, function* _a() {
9581
+ let hasMore = true;
9582
+ let pageToken;
9583
+ while (hasMore) {
9584
+ try {
9585
+ const res = yield __await(sendRequest({
9586
+ headers,
9587
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
9588
+ data,
9589
+ }));
9590
+ const _b = get__default["default"](res, "data") || {}, {
9591
+ // @ts-ignore
9592
+ has_more,
9593
+ // @ts-ignore
9594
+ page_token,
9595
+ // @ts-ignore
9596
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
9597
+ yield yield __await(rest);
9598
+ hasMore = Boolean(has_more);
9599
+ pageToken = page_token || next_page_token;
9600
+ }
9601
+ catch (e) {
9602
+ yield yield __await(null);
9603
+ break;
9604
+ }
9605
+ }
9606
+ });
9607
+ },
9608
+ };
9609
+ return Iterable;
9610
+ }),
9459
9611
  /**
9460
- * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=batch_get_tmp_download_url&version=v1 click to debug }
9612
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=get&version=v1 click to debug }
9461
9613
  *
9462
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url document }
9463
- *
9464
- * 获取素材临时下载链接
9614
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/get document }
9465
9615
  *
9466
- * 通过file_token获取素材临时下载链接,链接时效性是24小时,过期失效。
9616
+ * 获取文档版本
9467
9617
  *
9468
- * 该接口不支持太高的并发,且调用频率上限为5QPS
9618
+ * 获取文档版本。
9469
9619
  */
9470
- batchGetTmpDownloadUrl: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9620
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9471
9621
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
9472
9622
  return httpInstance
9473
9623
  .request({
9474
- url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`, path),
9624
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions/:version_id`, path),
9475
9625
  method: "GET",
9476
9626
  data,
9477
9627
  params,
@@ -9482,63 +9632,219 @@ class Client$1 {
9482
9632
  throw e;
9483
9633
  });
9484
9634
  }),
9635
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9636
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9637
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
9638
+ const res = yield httpInstance
9639
+ .request({
9640
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path),
9641
+ method: "GET",
9642
+ headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
9643
+ params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
9644
+ })
9645
+ .catch((e) => {
9646
+ this.logger.error(formatErrors(e));
9647
+ });
9648
+ return res;
9649
+ });
9650
+ const Iterable = {
9651
+ [Symbol.asyncIterator]() {
9652
+ return __asyncGenerator(this, arguments, function* _a() {
9653
+ let hasMore = true;
9654
+ let pageToken;
9655
+ while (hasMore) {
9656
+ try {
9657
+ const res = yield __await(sendRequest({
9658
+ headers,
9659
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
9660
+ data,
9661
+ }));
9662
+ const _b = get__default["default"](res, "data") || {}, {
9663
+ // @ts-ignore
9664
+ has_more,
9665
+ // @ts-ignore
9666
+ page_token,
9667
+ // @ts-ignore
9668
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
9669
+ yield yield __await(rest);
9670
+ hasMore = Boolean(has_more);
9671
+ pageToken = page_token || next_page_token;
9672
+ }
9673
+ catch (e) {
9674
+ yield yield __await(null);
9675
+ break;
9676
+ }
9677
+ }
9678
+ });
9679
+ },
9680
+ };
9681
+ return Iterable;
9682
+ }),
9485
9683
  /**
9486
- * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=download&version=v1 click to debug }
9684
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.version&apiName=list&version=v1 click to debug }
9487
9685
  *
9488
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download document }
9489
- *
9490
- * 下载素材
9686
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-version/list document }
9491
9687
  *
9492
- * 使用该接口可以下载素材。素材表示在各种创作容器里的文件,如Doc文档内的图片,文件均属于素材。支持range下载。
9688
+ * 获取文档版本列表
9493
9689
  *
9494
- * 该接口不支持太高的并发,且调用频率上限为5QPS
9690
+ * 获取文档所有版本。
9495
9691
  */
9496
- download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9692
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9497
9693
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
9498
- const res = yield httpInstance
9694
+ return httpInstance
9499
9695
  .request({
9500
- url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`, path),
9696
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/versions`, path),
9501
9697
  method: "GET",
9502
- headers,
9503
9698
  data,
9504
9699
  params,
9505
- responseType: "stream",
9700
+ headers,
9506
9701
  })
9507
9702
  .catch((e) => {
9508
9703
  this.logger.error(formatErrors(e));
9509
9704
  throw e;
9510
9705
  });
9511
- return {
9512
- writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
9513
- return new Promise((resolve, reject) => {
9514
- const writableStream = fs__default["default"].createWriteStream(filePath);
9515
- writableStream.on("finish", () => {
9516
- resolve(filePath);
9517
- });
9518
- writableStream.on("error", (e) => {
9519
- reject(e);
9520
- });
9521
- res.pipe(writableStream);
9522
- });
9523
- }),
9524
- };
9525
9706
  }),
9707
+ },
9708
+ /**
9709
+ * 导入
9710
+ */
9711
+ importTask: {
9526
9712
  /**
9527
- * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_all&version=v1 click to debug }
9528
- *
9529
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all document }
9530
- *
9531
- * 上传素材
9713
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=create&version=v1 click to debug }
9532
9714
  *
9533
- * 将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示,只会显示在对应云文档中。
9715
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/create document }
9534
9716
  *
9535
- * 该接口支持调用频率上限为5QPS
9717
+ * 创建导入任务
9536
9718
  *
9537
- * 请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)
9719
+ * 创建导入任务。支持导入为 doc、docx、sheet、bitable,参考[导入用户指南](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/import-user-guide)
9538
9720
  */
9539
- uploadAll: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9721
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9540
9722
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
9541
- const res = yield httpInstance
9723
+ return httpInstance
9724
+ .request({
9725
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks`, path),
9726
+ method: "POST",
9727
+ data,
9728
+ params,
9729
+ headers,
9730
+ })
9731
+ .catch((e) => {
9732
+ this.logger.error(formatErrors(e));
9733
+ throw e;
9734
+ });
9735
+ }),
9736
+ /**
9737
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=import_task&apiName=get&version=v1 click to debug }
9738
+ *
9739
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/import_task/get document }
9740
+ *
9741
+ * 查询导入结果
9742
+ *
9743
+ * 根据创建导入任务返回的 ticket 查询导入结果。
9744
+ */
9745
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9746
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9747
+ return httpInstance
9748
+ .request({
9749
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/import_tasks/:ticket`, path),
9750
+ method: "GET",
9751
+ data,
9752
+ params,
9753
+ headers,
9754
+ })
9755
+ .catch((e) => {
9756
+ this.logger.error(formatErrors(e));
9757
+ throw e;
9758
+ });
9759
+ }),
9760
+ },
9761
+ /**
9762
+ * 素材
9763
+ */
9764
+ media: {
9765
+ /**
9766
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=batch_get_tmp_download_url&version=v1 click to debug }
9767
+ *
9768
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/batch_get_tmp_download_url document }
9769
+ *
9770
+ * 获取素材临时下载链接
9771
+ *
9772
+ * 通过file_token获取素材临时下载链接,链接时效性是24小时,过期失效。
9773
+ *
9774
+ * 该接口不支持太高的并发,且调用频率上限为5QPS
9775
+ */
9776
+ batchGetTmpDownloadUrl: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9777
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9778
+ return httpInstance
9779
+ .request({
9780
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/batch_get_tmp_download_url`, path),
9781
+ method: "GET",
9782
+ data,
9783
+ params,
9784
+ headers,
9785
+ })
9786
+ .catch((e) => {
9787
+ this.logger.error(formatErrors(e));
9788
+ throw e;
9789
+ });
9790
+ }),
9791
+ /**
9792
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=download&version=v1 click to debug }
9793
+ *
9794
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/download document }
9795
+ *
9796
+ * 下载素材
9797
+ *
9798
+ * 使用该接口可以下载素材。素材表示在各种创作容器里的文件,如Doc文档内的图片,文件均属于素材。支持range下载。
9799
+ *
9800
+ * 该接口不支持太高的并发,且调用频率上限为5QPS
9801
+ */
9802
+ download: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9803
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9804
+ const res = yield httpInstance
9805
+ .request({
9806
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/:file_token/download`, path),
9807
+ method: "GET",
9808
+ headers,
9809
+ data,
9810
+ params,
9811
+ responseType: "stream",
9812
+ })
9813
+ .catch((e) => {
9814
+ this.logger.error(formatErrors(e));
9815
+ throw e;
9816
+ });
9817
+ return {
9818
+ writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
9819
+ return new Promise((resolve, reject) => {
9820
+ const writableStream = fs__default["default"].createWriteStream(filePath);
9821
+ writableStream.on("finish", () => {
9822
+ resolve(filePath);
9823
+ });
9824
+ writableStream.on("error", (e) => {
9825
+ reject(e);
9826
+ });
9827
+ res.pipe(writableStream);
9828
+ });
9829
+ }),
9830
+ };
9831
+ }),
9832
+ /**
9833
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_all&version=v1 click to debug }
9834
+ *
9835
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/upload_all document }
9836
+ *
9837
+ * 上传素材
9838
+ *
9839
+ * 将文件、图片、视频等素材文件上传到指定云文档中。素材文件在云空间中不会显示,只会显示在对应云文档中。
9840
+ *
9841
+ * 该接口支持调用频率上限为5QPS
9842
+ *
9843
+ * 请不要使用这个接口上传大于20MB的文件,如果有这个需求可以尝试使用[分片上传接口](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/media/multipart-upload-media/introduction)。
9844
+ */
9845
+ uploadAll: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9846
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9847
+ const res = yield httpInstance
9542
9848
  .request({
9543
9849
  url: fillApiPath(`${this.domain}/open-apis/drive/v1/medias/upload_all`, path),
9544
9850
  method: "POST",
@@ -9667,6 +9973,26 @@ class Client$1 {
9667
9973
  * 成员
9668
9974
  */
9669
9975
  permissionMember: {
9976
+ /**
9977
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=auth&version=v1 click to debug }
9978
+ *
9979
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=auth&project=drive&resource=permission.member&version=v1 document }
9980
+ */
9981
+ auth: (payload, options) => __awaiter(this, void 0, void 0, function* () {
9982
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
9983
+ return httpInstance
9984
+ .request({
9985
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/auth`, path),
9986
+ method: "GET",
9987
+ data,
9988
+ params,
9989
+ headers,
9990
+ })
9991
+ .catch((e) => {
9992
+ this.logger.error(formatErrors(e));
9993
+ throw e;
9994
+ });
9995
+ }),
9670
9996
  /**
9671
9997
  * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=create&version=v1 click to debug }
9672
9998
  *
@@ -9741,6 +10067,26 @@ class Client$1 {
9741
10067
  throw e;
9742
10068
  });
9743
10069
  }),
10070
+ /**
10071
+ * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=transfer_owner&version=v1 click to debug }
10072
+ *
10073
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=transfer_owner&project=drive&resource=permission.member&version=v1 document }
10074
+ */
10075
+ transferOwner: (payload, options) => __awaiter(this, void 0, void 0, function* () {
10076
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
10077
+ return httpInstance
10078
+ .request({
10079
+ url: fillApiPath(`${this.domain}/open-apis/drive/v1/permissions/:token/members/transfer_owner`, path),
10080
+ method: "POST",
10081
+ data,
10082
+ params,
10083
+ headers,
10084
+ })
10085
+ .catch((e) => {
10086
+ this.logger.error(formatErrors(e));
10087
+ throw e;
10088
+ });
10089
+ }),
9744
10090
  /**
9745
10091
  * {@link https://open.feishu.cn/api-explorer?project=drive&resource=permission.member&apiName=update&version=v1 click to debug }
9746
10092
  *
@@ -12013,6 +12359,30 @@ class Client$1 {
12013
12359
  throw e;
12014
12360
  });
12015
12361
  }),
12362
+ /**
12363
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=combined_update&version=v1 click to debug }
12364
+ *
12365
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/job/combined_update document }
12366
+ *
12367
+ * 更新职位
12368
+ *
12369
+ * 更新职位信息,该接口为全量更新,若字段没有返回值,则原有值将会被清空。字段的是否必填,将以系统中的「职位字段管理」中的设置为准。
12370
+ */
12371
+ combinedUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
12372
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
12373
+ return httpInstance
12374
+ .request({
12375
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/jobs/:job_id/combined_update`, path),
12376
+ method: "POST",
12377
+ data,
12378
+ params,
12379
+ headers,
12380
+ })
12381
+ .catch((e) => {
12382
+ this.logger.error(formatErrors(e));
12383
+ throw e;
12384
+ });
12385
+ }),
12016
12386
  /**
12017
12387
  * {@link https://open.feishu.cn/api-explorer?project=hire&resource=job&apiName=config&version=v1 click to debug }
12018
12388
  *
@@ -13133,6 +13503,146 @@ class Client$1 {
13133
13503
  });
13134
13504
  }),
13135
13505
  },
13506
+ /**
13507
+ * chat.menu_item
13508
+ */
13509
+ chatMenuItem: {
13510
+ /**
13511
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_item&apiName=patch&version=v1 click to debug }
13512
+ *
13513
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_item/patch document }
13514
+ *
13515
+ * 修改群菜单元信息
13516
+ *
13517
+ * 修改某个一级菜单或者二级菜单的元信息。
13518
+ *
13519
+ * 注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。
13520
+ */
13521
+ patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13522
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13523
+ return httpInstance
13524
+ .request({
13525
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_items/:menu_item_id`, path),
13526
+ method: "PATCH",
13527
+ data,
13528
+ params,
13529
+ headers,
13530
+ })
13531
+ .catch((e) => {
13532
+ this.logger.error(formatErrors(e));
13533
+ throw e;
13534
+ });
13535
+ }),
13536
+ },
13537
+ /**
13538
+ * 群组 - 群菜单
13539
+ */
13540
+ chatMenuTree: {
13541
+ /**
13542
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=create&version=v1 click to debug }
13543
+ *
13544
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/create document }
13545
+ *
13546
+ * 添加群菜单
13547
+ *
13548
+ * 向群内添加群菜单。
13549
+ *
13550
+ * 注意事项:;- 该API是向群内追加菜单,群内原来存在的菜单并不会被覆盖。操作API后,将返回群内所有菜单。;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 一个群内,一级菜单最多有3个,每个一级菜单最多有5个二级菜单。
13551
+ */
13552
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13553
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13554
+ return httpInstance
13555
+ .request({
13556
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path),
13557
+ method: "POST",
13558
+ data,
13559
+ params,
13560
+ headers,
13561
+ })
13562
+ .catch((e) => {
13563
+ this.logger.error(formatErrors(e));
13564
+ throw e;
13565
+ });
13566
+ }),
13567
+ /**
13568
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=delete&version=v1 click to debug }
13569
+ *
13570
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/delete document }
13571
+ *
13572
+ * 删除群菜单。
13573
+ *
13574
+ * 删除群内菜单。
13575
+ *
13576
+ * 注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。
13577
+ */
13578
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13579
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13580
+ return httpInstance
13581
+ .request({
13582
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path),
13583
+ method: "DELETE",
13584
+ data,
13585
+ params,
13586
+ headers,
13587
+ })
13588
+ .catch((e) => {
13589
+ this.logger.error(formatErrors(e));
13590
+ throw e;
13591
+ });
13592
+ }),
13593
+ /**
13594
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=get&version=v1 click to debug }
13595
+ *
13596
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/get document }
13597
+ *
13598
+ * 获取群内菜单
13599
+ *
13600
+ * 通过群ID获取群内菜单。
13601
+ *
13602
+ * 注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。
13603
+ */
13604
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13605
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13606
+ return httpInstance
13607
+ .request({
13608
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree`, path),
13609
+ method: "GET",
13610
+ data,
13611
+ params,
13612
+ headers,
13613
+ })
13614
+ .catch((e) => {
13615
+ this.logger.error(formatErrors(e));
13616
+ throw e;
13617
+ });
13618
+ }),
13619
+ /**
13620
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=chat.menu_tree&apiName=sort&version=v1 click to debug }
13621
+ *
13622
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/chat-menu_tree/sort document }
13623
+ *
13624
+ * 排序群菜单
13625
+ *
13626
+ * 给一个群内的一级菜单排序。
13627
+ *
13628
+ * 注意事项:;- 应用需要开启[机器人能力](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-enable-bot-ability)。;- 机器人必须在群里。;- 操作API后,将返回群内所有菜单。
13629
+ */
13630
+ sort: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13631
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13632
+ return httpInstance
13633
+ .request({
13634
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/chats/:chat_id/menu_tree/sort`, path),
13635
+ method: "POST",
13636
+ data,
13637
+ params,
13638
+ headers,
13639
+ })
13640
+ .catch((e) => {
13641
+ this.logger.error(formatErrors(e));
13642
+ throw e;
13643
+ });
13644
+ }),
13645
+ },
13136
13646
  /**
13137
13647
  * chat.moderation
13138
13648
  */
@@ -14488,6 +14998,46 @@ class Client$1 {
14488
14998
  * 邮件组成员
14489
14999
  */
14490
15000
  mailgroupMember: {
15001
+ /**
15002
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=batch_create&version=v1 click to debug }
15003
+ *
15004
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.member&version=v1 document }
15005
+ */
15006
+ batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15007
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15008
+ return httpInstance
15009
+ .request({
15010
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_create`, path),
15011
+ method: "POST",
15012
+ data,
15013
+ params,
15014
+ headers,
15015
+ })
15016
+ .catch((e) => {
15017
+ this.logger.error(formatErrors(e));
15018
+ throw e;
15019
+ });
15020
+ }),
15021
+ /**
15022
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=batch_delete&version=v1 click to debug }
15023
+ *
15024
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.member&version=v1 document }
15025
+ */
15026
+ batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15027
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15028
+ return httpInstance
15029
+ .request({
15030
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members/batch_delete`, path),
15031
+ method: "DELETE",
15032
+ data,
15033
+ params,
15034
+ headers,
15035
+ })
15036
+ .catch((e) => {
15037
+ this.logger.error(formatErrors(e));
15038
+ throw e;
15039
+ });
15040
+ }),
14491
15041
  /**
14492
15042
  * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=create&version=v1 click to debug }
14493
15043
  *
@@ -14609,20 +15159,65 @@ class Client$1 {
14609
15159
  return Iterable;
14610
15160
  }),
14611
15161
  /**
14612
- * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=list&version=v1 click to debug }
15162
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.member&apiName=list&version=v1 click to debug }
15163
+ *
15164
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list document }
15165
+ *
15166
+ * 批量获取邮件组成员
15167
+ *
15168
+ * 分页批量获取邮件组成员列表
15169
+ */
15170
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15171
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15172
+ return httpInstance
15173
+ .request({
15174
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path),
15175
+ method: "GET",
15176
+ data,
15177
+ params,
15178
+ headers,
15179
+ })
15180
+ .catch((e) => {
15181
+ this.logger.error(formatErrors(e));
15182
+ throw e;
15183
+ });
15184
+ }),
15185
+ },
15186
+ /**
15187
+ * 邮件组权限成员
15188
+ */
15189
+ mailgroupPermissionMember: {
15190
+ /**
15191
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=batch_create&version=v1 click to debug }
15192
+ *
15193
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=mailgroup.permission_member&version=v1 document }
15194
+ */
15195
+ batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15196
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15197
+ return httpInstance
15198
+ .request({
15199
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_create`, path),
15200
+ method: "POST",
15201
+ data,
15202
+ params,
15203
+ headers,
15204
+ })
15205
+ .catch((e) => {
15206
+ this.logger.error(formatErrors(e));
15207
+ throw e;
15208
+ });
15209
+ }),
15210
+ /**
15211
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=batch_delete&version=v1 click to debug }
14613
15212
  *
14614
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/mail-v1/mailgroup-member/list document }
14615
- *
14616
- * 批量获取邮件组成员
14617
- *
14618
- * 分页批量获取邮件组成员列表
15213
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=mailgroup.permission_member&version=v1 document }
14619
15214
  */
14620
- list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15215
+ batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
14621
15216
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
14622
15217
  return httpInstance
14623
15218
  .request({
14624
- url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/members`, path),
14625
- method: "GET",
15219
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/mailgroups/:mailgroup_id/permission_members/batch_delete`, path),
15220
+ method: "DELETE",
14626
15221
  data,
14627
15222
  params,
14628
15223
  headers,
@@ -14632,11 +15227,6 @@ class Client$1 {
14632
15227
  throw e;
14633
15228
  });
14634
15229
  }),
14635
- },
14636
- /**
14637
- * 邮件组权限成员
14638
- */
14639
- mailgroupPermissionMember: {
14640
15230
  /**
14641
15231
  * {@link https://open.feishu.cn/api-explorer?project=mail&resource=mailgroup.permission_member&apiName=create&version=v1 click to debug }
14642
15232
  *
@@ -15060,6 +15650,46 @@ class Client$1 {
15060
15650
  * 公共邮箱成员
15061
15651
  */
15062
15652
  publicMailboxMember: {
15653
+ /**
15654
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=batch_create&version=v1 click to debug }
15655
+ *
15656
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_create&project=mail&resource=public_mailbox.member&version=v1 document }
15657
+ */
15658
+ batchCreate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15659
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15660
+ return httpInstance
15661
+ .request({
15662
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_create`, path),
15663
+ method: "POST",
15664
+ data,
15665
+ params,
15666
+ headers,
15667
+ })
15668
+ .catch((e) => {
15669
+ this.logger.error(formatErrors(e));
15670
+ throw e;
15671
+ });
15672
+ }),
15673
+ /**
15674
+ * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=batch_delete&version=v1 click to debug }
15675
+ *
15676
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_delete&project=mail&resource=public_mailbox.member&version=v1 document }
15677
+ */
15678
+ batchDelete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15679
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15680
+ return httpInstance
15681
+ .request({
15682
+ url: fillApiPath(`${this.domain}/open-apis/mail/v1/public_mailboxes/:public_mailbox_id/members/batch_delete`, path),
15683
+ method: "DELETE",
15684
+ data,
15685
+ params,
15686
+ headers,
15687
+ })
15688
+ .catch((e) => {
15689
+ this.logger.error(formatErrors(e));
15690
+ throw e;
15691
+ });
15692
+ }),
15063
15693
  /**
15064
15694
  * {@link https://open.feishu.cn/api-explorer?project=mail&resource=public_mailbox.member&apiName=clear&version=v1 click to debug }
15065
15695
  *
@@ -15459,6 +16089,165 @@ class Client$1 {
15459
16089
  return get__default["default"](res, "data", {});
15460
16090
  }),
15461
16091
  },
16092
+ /**
16093
+ * 指标库
16094
+ */
16095
+ metricSource: {
16096
+ /**
16097
+ * {@link https://open.feishu.cn/api-explorer?project=okr&resource=metric_source&apiName=list&version=v1 click to debug }
16098
+ *
16099
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/metric_source/list document }
16100
+ *
16101
+ * 获取指标库
16102
+ *
16103
+ * 获取租户下全部 OKR 指标库(仅限 OKR 企业版使用)
16104
+ */
16105
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
16106
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
16107
+ return httpInstance
16108
+ .request({
16109
+ url: fillApiPath(`${this.domain}/open-apis/okr/v1/metric_sources`, path),
16110
+ method: "GET",
16111
+ data,
16112
+ params,
16113
+ headers,
16114
+ })
16115
+ .catch((e) => {
16116
+ this.logger.error(formatErrors(e));
16117
+ throw e;
16118
+ });
16119
+ }),
16120
+ },
16121
+ /**
16122
+ * 指标项
16123
+ */
16124
+ metricSourceTableItem: {
16125
+ /**
16126
+ * {@link https://open.feishu.cn/api-explorer?project=okr&resource=metric_source.table.item&apiName=batch_update&version=v1 click to debug }
16127
+ *
16128
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/metric_source-table-item/batch_update document }
16129
+ *
16130
+ * 批量更新指标项
16131
+ *
16132
+ * - 该接口用于批量更新多项指标,单次调用最多更新 100 条记录。接口仅限 OKR 企业版使用。;; 更新成功后 OKR 系统会给以下人员发送消息通知:;; - 首次更新目标值的人员 ;; - 已经将指标添加为 KR、且本次目标值/起始值/支撑的上级有变更的人员,不包含仅更新了进度值的人员
16133
+ */
16134
+ batchUpdate: (payload, options) => __awaiter(this, void 0, void 0, function* () {
16135
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
16136
+ return httpInstance
16137
+ .request({
16138
+ url: fillApiPath(`${this.domain}/open-apis/okr/v1/metric_sources/:metric_source_id/tables/:metric_table_id/items/batch_update`, path),
16139
+ method: "PATCH",
16140
+ data,
16141
+ params,
16142
+ headers,
16143
+ })
16144
+ .catch((e) => {
16145
+ this.logger.error(formatErrors(e));
16146
+ throw e;
16147
+ });
16148
+ }),
16149
+ /**
16150
+ * {@link https://open.feishu.cn/api-explorer?project=okr&resource=metric_source.table.item&apiName=get&version=v1 click to debug }
16151
+ *
16152
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/metric_source-table-item/get document }
16153
+ *
16154
+ * 获取指标项详情
16155
+ *
16156
+ * 获取某项指标的具体内容(仅限 OKR 企业版使用)
16157
+ */
16158
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
16159
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
16160
+ return httpInstance
16161
+ .request({
16162
+ url: fillApiPath(`${this.domain}/open-apis/okr/v1/metric_sources/:metric_source_id/tables/:metric_table_id/items/:metric_item_id`, path),
16163
+ method: "GET",
16164
+ data,
16165
+ params,
16166
+ headers,
16167
+ })
16168
+ .catch((e) => {
16169
+ this.logger.error(formatErrors(e));
16170
+ throw e;
16171
+ });
16172
+ }),
16173
+ /**
16174
+ * {@link https://open.feishu.cn/api-explorer?project=okr&resource=metric_source.table.item&apiName=list&version=v1 click to debug }
16175
+ *
16176
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/metric_source-table-item/list document }
16177
+ *
16178
+ * 获取指标项
16179
+ *
16180
+ * 获取指定指标表下的所有指标项(仅限 OKR 企业版使用)
16181
+ */
16182
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
16183
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
16184
+ return httpInstance
16185
+ .request({
16186
+ url: fillApiPath(`${this.domain}/open-apis/okr/v1/metric_sources/:metric_source_id/tables/:metric_table_id/items`, path),
16187
+ method: "GET",
16188
+ data,
16189
+ params,
16190
+ headers,
16191
+ })
16192
+ .catch((e) => {
16193
+ this.logger.error(formatErrors(e));
16194
+ throw e;
16195
+ });
16196
+ }),
16197
+ /**
16198
+ * {@link https://open.feishu.cn/api-explorer?project=okr&resource=metric_source.table.item&apiName=patch&version=v1 click to debug }
16199
+ *
16200
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/metric_source-table-item/patch document }
16201
+ *
16202
+ * 更新指标项
16203
+ *
16204
+ * - 该接口用于更新某项指标,接口仅限 OKR 企业版使用。;; 更新成功后 OKR 系统会给以下人员发送消息通知:;; - 首次更新目标值的人员 ;; - 已经将指标添加为 KR、且本次目标值/起始值/支撑的上级有变更的人员,不包含仅更新了进度值的人员
16205
+ */
16206
+ patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
16207
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
16208
+ return httpInstance
16209
+ .request({
16210
+ url: fillApiPath(`${this.domain}/open-apis/okr/v1/metric_sources/:metric_source_id/tables/:metric_table_id/items/:metric_item_id`, path),
16211
+ method: "PATCH",
16212
+ data,
16213
+ params,
16214
+ headers,
16215
+ })
16216
+ .catch((e) => {
16217
+ this.logger.error(formatErrors(e));
16218
+ throw e;
16219
+ });
16220
+ }),
16221
+ },
16222
+ /**
16223
+ * 指标表
16224
+ */
16225
+ metricSourceTable: {
16226
+ /**
16227
+ * {@link https://open.feishu.cn/api-explorer?project=okr&resource=metric_source.table&apiName=list&version=v1 click to debug }
16228
+ *
16229
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/okr-v1/metric_source-table/list document }
16230
+ *
16231
+ * 获取指标表
16232
+ *
16233
+ * 获取指定指标库下有哪些指标表(仅限 OKR 企业版使用)
16234
+ */
16235
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
16236
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
16237
+ return httpInstance
16238
+ .request({
16239
+ url: fillApiPath(`${this.domain}/open-apis/okr/v1/metric_sources/:metric_source_id/tables`, path),
16240
+ method: "GET",
16241
+ data,
16242
+ params,
16243
+ headers,
16244
+ })
16245
+ .catch((e) => {
16246
+ this.logger.error(formatErrors(e));
16247
+ throw e;
16248
+ });
16249
+ }),
16250
+ },
15462
16251
  /**
15463
16252
  * OKR
15464
16253
  */
@@ -16553,7 +17342,7 @@ class Client$1 {
16553
17342
  }),
16554
17343
  },
16555
17344
  /**
16556
- * 单元格
17345
+ * 工作表
16557
17346
  */
16558
17347
  spreadsheetSheet: {
16559
17348
  /**
@@ -17809,83 +18598,6 @@ class Client$1 {
17809
18598
  * 视频会议
17810
18599
  */
17811
18600
  this.vc = {
17812
- /**
17813
- * 告警中心
17814
- */
17815
- alert: {
17816
- listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
17817
- const { headers, params, data, path } = yield this.formatPayload(payload, options);
17818
- const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
17819
- const res = yield httpInstance
17820
- .request({
17821
- url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path),
17822
- method: "GET",
17823
- headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
17824
- params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
17825
- })
17826
- .catch((e) => {
17827
- this.logger.error(formatErrors(e));
17828
- });
17829
- return res;
17830
- });
17831
- const Iterable = {
17832
- [Symbol.asyncIterator]() {
17833
- return __asyncGenerator(this, arguments, function* _a() {
17834
- let hasMore = true;
17835
- let pageToken;
17836
- while (hasMore) {
17837
- try {
17838
- const res = yield __await(sendRequest({
17839
- headers,
17840
- params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
17841
- data,
17842
- }));
17843
- const _b = get__default["default"](res, "data") || {}, {
17844
- // @ts-ignore
17845
- has_more,
17846
- // @ts-ignore
17847
- page_token,
17848
- // @ts-ignore
17849
- next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
17850
- yield yield __await(rest);
17851
- hasMore = Boolean(has_more);
17852
- pageToken = page_token || next_page_token;
17853
- }
17854
- catch (e) {
17855
- yield yield __await(null);
17856
- break;
17857
- }
17858
- }
17859
- });
17860
- },
17861
- };
17862
- return Iterable;
17863
- }),
17864
- /**
17865
- * {@link https://open.feishu.cn/api-explorer?project=vc&resource=alert&apiName=list&version=v1 click to debug }
17866
- *
17867
- * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list document }
17868
- *
17869
- * 获取告警记录
17870
- *
17871
- * 获取特定条件下租户的设备告警记录
17872
- */
17873
- list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
17874
- const { headers, params, data, path } = yield this.formatPayload(payload, options);
17875
- return httpInstance
17876
- .request({
17877
- url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path),
17878
- method: "GET",
17879
- data,
17880
- params,
17881
- headers,
17882
- })
17883
- .catch((e) => {
17884
- this.logger.error(formatErrors(e));
17885
- throw e;
17886
- });
17887
- }),
17888
- },
17889
18601
  /**
17890
18602
  * 导出
17891
18603
  */
@@ -19712,7 +20424,9 @@ class AppTicketManager {
19712
20424
  var _a;
19713
20425
  return __awaiter(this, void 0, void 0, function* () {
19714
20426
  if (this.appType === exports.AppType.ISV) {
19715
- const appTicket = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CAppTicket));
20427
+ const appTicket = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CAppTicket, {
20428
+ namespace: this.appId
20429
+ }));
19716
20430
  if (!appTicket) {
19717
20431
  this.requestAppTicket();
19718
20432
  }
@@ -19735,7 +20449,9 @@ class AppTicketManager {
19735
20449
  getAppTicket() {
19736
20450
  var _a;
19737
20451
  return __awaiter(this, void 0, void 0, function* () {
19738
- const appTicket = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CAppTicket));
20452
+ const appTicket = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CAppTicket, {
20453
+ namespace: this.appId
20454
+ }));
19739
20455
  if (appTicket) {
19740
20456
  this.logger.debug('use cache app ticket');
19741
20457
  return appTicket;
@@ -19767,7 +20483,9 @@ class TokenManager {
19767
20483
  getCustomTenantAccessToken() {
19768
20484
  var _a, _b;
19769
20485
  return __awaiter(this, void 0, void 0, function* () {
19770
- const cachedTenantAccessToken = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CTenantAccessToken));
20486
+ const cachedTenantAccessToken = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(CTenantAccessToken, {
20487
+ namespace: this.appId
20488
+ }));
19771
20489
  if (cachedTenantAccessToken) {
19772
20490
  this.logger.debug('use cache token');
19773
20491
  return cachedTenantAccessToken;
@@ -19784,7 +20502,9 @@ class TokenManager {
19784
20502
  });
19785
20503
  yield ((_b = this.cache) === null || _b === void 0 ? void 0 : _b.set(CTenantAccessToken, tenant_access_token,
19786
20504
  // Due to the time-consuming network, the expiration time needs to be 3 minutes earlier
19787
- new Date().getTime() + expire * 1000 - 3 * 60 * 1000));
20505
+ new Date().getTime() + expire * 1000 - 3 * 60 * 1000, {
20506
+ namespace: this.appId
20507
+ }));
19788
20508
  return tenant_access_token;
19789
20509
  });
19790
20510
  }
@@ -19795,7 +20515,9 @@ class TokenManager {
19795
20515
  this.logger.error('market app request need tenant key');
19796
20516
  return undefined;
19797
20517
  }
19798
- const tenantAccessToken = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(`larkMarketAccessToken${tenantKey}`));
20518
+ const tenantAccessToken = yield ((_a = this.cache) === null || _a === void 0 ? void 0 : _a.get(`larkMarketAccessToken${tenantKey}`, {
20519
+ namespace: this.appId
20520
+ }));
19799
20521
  if (tenantAccessToken) {
19800
20522
  this.logger.debug('use cache token');
19801
20523
  return tenantAccessToken;
@@ -19832,7 +20554,9 @@ class TokenManager {
19832
20554
  // 设置tenant_access_token
19833
20555
  yield this.cache.set(`larkMarketAccessToken${tenantKey}`, tenant_access_token,
19834
20556
  // Due to the time-consuming network, the expiration time needs to be 3 minutes earlier
19835
- new Date().getTime() + expire * 1000 - 3 * 60 * 1000);
20557
+ new Date().getTime() + expire * 1000 - 3 * 60 * 1000, {
20558
+ namespace: this.appId
20559
+ });
19836
20560
  return tenant_access_token;
19837
20561
  });
19838
20562
  }
@@ -20058,9 +20782,11 @@ class EventDispatcher {
20058
20782
  registerAppTicketHandle() {
20059
20783
  this.register({
20060
20784
  app_ticket: (data) => __awaiter(this, void 0, void 0, function* () {
20061
- const { app_ticket } = data;
20785
+ const { app_ticket, app_id } = data;
20062
20786
  if (app_ticket) {
20063
- yield this.cache.set(CAppTicket, app_ticket);
20787
+ yield this.cache.set(CAppTicket, app_ticket, undefined, {
20788
+ namespace: app_id
20789
+ });
20064
20790
  this.logger.debug('set app ticket');
20065
20791
  }
20066
20792
  else {
@@ -20121,9 +20847,11 @@ class CardActionHandler {
20121
20847
  registerAppTicketHandle() {
20122
20848
  this.register({
20123
20849
  app_ticket: (data) => __awaiter(this, void 0, void 0, function* () {
20124
- const { app_ticket } = data;
20850
+ const { app_ticket, app_id } = data;
20125
20851
  if (app_ticket) {
20126
- yield this.cache.set(CAppTicket, app_ticket);
20852
+ yield this.cache.set(CAppTicket, app_ticket, undefined, {
20853
+ namespace: app_id
20854
+ });
20127
20855
  this.logger.debug('set app ticket');
20128
20856
  }
20129
20857
  else {