@larksuiteoapi/node-sdk 1.16.0 → 1.17.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.
package/es/index.js CHANGED
@@ -436,7 +436,7 @@ class Client$1 {
436
436
  this.logger.error(formatErrors(e));
437
437
  throw e;
438
438
  });
439
- return get(res, "data", {});
439
+ return get(res, "data", null);
440
440
  }),
441
441
  },
442
442
  /**
@@ -570,7 +570,7 @@ class Client$1 {
570
570
  },
571
571
  };
572
572
  /**
573
- * 管理后台-数据报表
573
+ * 管理后台-企业勋章
574
574
  */
575
575
  this.admin = {
576
576
  /**
@@ -984,7 +984,7 @@ class Client$1 {
984
984
  this.logger.error(formatErrors(e));
985
985
  throw e;
986
986
  });
987
- return get(res, "data", {});
987
+ return get(res, "data", null);
988
988
  }),
989
989
  },
990
990
  /**
@@ -2549,7 +2549,7 @@ class Client$1 {
2549
2549
  this.logger.error(formatErrors(e));
2550
2550
  throw e;
2551
2551
  });
2552
- return get(res, "data", {});
2552
+ return get(res, "data", null);
2553
2553
  }),
2554
2554
  },
2555
2555
  /**
@@ -4071,7 +4071,7 @@ class Client$1 {
4071
4071
  this.logger.error(formatErrors(e));
4072
4072
  throw e;
4073
4073
  });
4074
- return get(res, "data", {});
4074
+ return get(res, "data", null);
4075
4075
  }),
4076
4076
  },
4077
4077
  };
@@ -9737,7 +9737,7 @@ class Client$1 {
9737
9737
  }),
9738
9738
  },
9739
9739
  /**
9740
- * 文件
9740
+ * 异步任务状态
9741
9741
  */
9742
9742
  file: {
9743
9743
  /**
@@ -10052,7 +10052,7 @@ class Client$1 {
10052
10052
  this.logger.error(formatErrors(e));
10053
10053
  throw e;
10054
10054
  });
10055
- return get(res, "data", {});
10055
+ return get(res, "data", null);
10056
10056
  }),
10057
10057
  /**
10058
10058
  * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_finish&version=v1 click to debug }
@@ -10105,7 +10105,7 @@ class Client$1 {
10105
10105
  this.logger.error(formatErrors(e));
10106
10106
  throw e;
10107
10107
  });
10108
- return get(res, "data", {});
10108
+ return get(res, "data", null);
10109
10109
  }),
10110
10110
  /**
10111
10111
  * {@link https://open.feishu.cn/api-explorer?project=drive&resource=file&apiName=upload_prepare&version=v1 click to debug }
@@ -10493,7 +10493,7 @@ class Client$1 {
10493
10493
  }),
10494
10494
  },
10495
10495
  /**
10496
- * 分片上传
10496
+ * 素材
10497
10497
  */
10498
10498
  media: {
10499
10499
  /**
@@ -10590,7 +10590,7 @@ class Client$1 {
10590
10590
  this.logger.error(formatErrors(e));
10591
10591
  throw e;
10592
10592
  });
10593
- return get(res, "data", {});
10593
+ return get(res, "data", null);
10594
10594
  }),
10595
10595
  /**
10596
10596
  * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_finish&version=v1 click to debug }
@@ -10643,7 +10643,7 @@ class Client$1 {
10643
10643
  this.logger.error(formatErrors(e));
10644
10644
  throw e;
10645
10645
  });
10646
- return get(res, "data", {});
10646
+ return get(res, "data", null);
10647
10647
  }),
10648
10648
  /**
10649
10649
  * {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_prepare&version=v1 click to debug }
@@ -12766,7 +12766,7 @@ class Client$1 {
12766
12766
  */
12767
12767
  this.hire = {
12768
12768
  /**
12769
- * 投递
12769
+ * 入职
12770
12770
  */
12771
12771
  application: {
12772
12772
  /**
@@ -13098,6 +13098,83 @@ class Client$1 {
13098
13098
  });
13099
13099
  }),
13100
13100
  },
13101
+ /**
13102
+ * 评估(灰度租户可见)
13103
+ */
13104
+ evaluation: {
13105
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13106
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13107
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
13108
+ const res = yield this.httpInstance
13109
+ .request({
13110
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluations`, path),
13111
+ method: "GET",
13112
+ headers: pickBy(innerPayload.headers, identity),
13113
+ params: pickBy(innerPayload.params, identity),
13114
+ })
13115
+ .catch((e) => {
13116
+ this.logger.error(formatErrors(e));
13117
+ });
13118
+ return res;
13119
+ });
13120
+ const Iterable = {
13121
+ [Symbol.asyncIterator]() {
13122
+ return __asyncGenerator(this, arguments, function* _a() {
13123
+ let hasMore = true;
13124
+ let pageToken;
13125
+ while (hasMore) {
13126
+ try {
13127
+ const res = yield __await(sendRequest({
13128
+ headers,
13129
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
13130
+ data,
13131
+ }));
13132
+ const _b = get(res, "data") || {}, {
13133
+ // @ts-ignore
13134
+ has_more,
13135
+ // @ts-ignore
13136
+ page_token,
13137
+ // @ts-ignore
13138
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
13139
+ yield yield __await(rest);
13140
+ hasMore = Boolean(has_more);
13141
+ pageToken = page_token || next_page_token;
13142
+ }
13143
+ catch (e) {
13144
+ yield yield __await(null);
13145
+ break;
13146
+ }
13147
+ }
13148
+ });
13149
+ },
13150
+ };
13151
+ return Iterable;
13152
+ }),
13153
+ /**
13154
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=evaluation&apiName=list&version=v1 click to debug }
13155
+ *
13156
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/evaluation/list document }
13157
+ *
13158
+ * 获取简历评估信息
13159
+ *
13160
+ * 获取简历评估信息
13161
+ */
13162
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13163
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13164
+ return this.httpInstance
13165
+ .request({
13166
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/evaluations`, path),
13167
+ method: "GET",
13168
+ data,
13169
+ params,
13170
+ headers,
13171
+ })
13172
+ .catch((e) => {
13173
+ this.logger.error(formatErrors(e));
13174
+ throw e;
13175
+ });
13176
+ }),
13177
+ },
13101
13178
  /**
13102
13179
  * 导入外部系统信息(灰度租户可见)
13103
13180
  */
@@ -13498,6 +13575,151 @@ class Client$1 {
13498
13575
  });
13499
13576
  }),
13500
13577
  },
13578
+ /**
13579
+ * Offer
13580
+ */
13581
+ offer: {
13582
+ /**
13583
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=create&version=v1 click to debug }
13584
+ *
13585
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/create document }
13586
+ *
13587
+ * 创建 Offer
13588
+ *
13589
+ * 创建 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义
13590
+ */
13591
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13592
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13593
+ return this.httpInstance
13594
+ .request({
13595
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers`, path),
13596
+ method: "POST",
13597
+ data,
13598
+ params,
13599
+ headers,
13600
+ })
13601
+ .catch((e) => {
13602
+ this.logger.error(formatErrors(e));
13603
+ throw e;
13604
+ });
13605
+ }),
13606
+ /**
13607
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=get&version=v1 click to debug }
13608
+ *
13609
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/get document }
13610
+ *
13611
+ * 获取 Offer 详情
13612
+ *
13613
+ * 根据 Offer ID 获取 Offer 详细信息
13614
+ */
13615
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13616
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13617
+ return this.httpInstance
13618
+ .request({
13619
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id`, path),
13620
+ method: "GET",
13621
+ data,
13622
+ params,
13623
+ headers,
13624
+ })
13625
+ .catch((e) => {
13626
+ this.logger.error(formatErrors(e));
13627
+ throw e;
13628
+ });
13629
+ }),
13630
+ /**
13631
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=intern_offer_status&version=v1 click to debug }
13632
+ *
13633
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/intern_offer_status document }
13634
+ *
13635
+ * 更新实习 Offer 入/离职状态
13636
+ *
13637
+ * 对「实习待入职」状态的实习 Offer 确认入职、放弃入职,或对「实习已入职」状态的实习 Offer 操作离职
13638
+ */
13639
+ internOfferStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13640
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13641
+ return this.httpInstance
13642
+ .request({
13643
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id/intern_offer_status`, path),
13644
+ method: "POST",
13645
+ data,
13646
+ params,
13647
+ headers,
13648
+ })
13649
+ .catch((e) => {
13650
+ this.logger.error(formatErrors(e));
13651
+ throw e;
13652
+ });
13653
+ }),
13654
+ /**
13655
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=list&version=v1 click to debug }
13656
+ *
13657
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/list document }
13658
+ *
13659
+ * 获取 Offer 列表
13660
+ *
13661
+ * 根据人才 ID 获取 Offer 列表
13662
+ */
13663
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13664
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13665
+ return this.httpInstance
13666
+ .request({
13667
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers`, path),
13668
+ method: "GET",
13669
+ data,
13670
+ params,
13671
+ headers,
13672
+ })
13673
+ .catch((e) => {
13674
+ this.logger.error(formatErrors(e));
13675
+ throw e;
13676
+ });
13677
+ }),
13678
+ /**
13679
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=offer_status&version=v1 click to debug }
13680
+ *
13681
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=offer_status&project=hire&resource=offer&version=v1 document }
13682
+ */
13683
+ offerStatus: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13684
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13685
+ return this.httpInstance
13686
+ .request({
13687
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id/offer_status`, path),
13688
+ method: "PATCH",
13689
+ data,
13690
+ params,
13691
+ headers,
13692
+ })
13693
+ .catch((e) => {
13694
+ this.logger.error(formatErrors(e));
13695
+ throw e;
13696
+ });
13697
+ }),
13698
+ /**
13699
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=offer&apiName=update&version=v1 click to debug }
13700
+ *
13701
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/offer/update document }
13702
+ *
13703
+ * 更新 Offer 信息
13704
+ *
13705
+ * 1. 更新 Offer 时,需传入本文档中标注为必传的参数,其余参数是否必传参考「获取 Offer 申请表模板信息」的参数定义;;2. 对系统中已存在的 offer 进行更新的,若更新 offer 中含有「修改需审批」的字段,更新后原 Offer 的审批会自动撤回,需要重新发起审批
13706
+ */
13707
+ update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13708
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13709
+ return this.httpInstance
13710
+ .request({
13711
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/offers/:offer_id`, path),
13712
+ method: "PUT",
13713
+ data,
13714
+ params,
13715
+ headers,
13716
+ })
13717
+ .catch((e) => {
13718
+ this.logger.error(formatErrors(e));
13719
+ throw e;
13720
+ });
13721
+ }),
13722
+ },
13501
13723
  /**
13502
13724
  * offer_schema
13503
13725
  */
@@ -13523,6 +13745,35 @@ class Client$1 {
13523
13745
  });
13524
13746
  }),
13525
13747
  },
13748
+ /**
13749
+ * 问卷(灰度租户可见)
13750
+ */
13751
+ questionnaire: {
13752
+ /**
13753
+ * {@link https://open.feishu.cn/api-explorer?project=hire&resource=questionnaire&apiName=list&version=v1 click to debug }
13754
+ *
13755
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uMzM1YjLzMTN24yMzUjN/hire-v1/questionnaire/list document }
13756
+ *
13757
+ * 获取面试满意度问卷列表
13758
+ *
13759
+ * 获取面试满意度问卷列表
13760
+ */
13761
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
13762
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
13763
+ return this.httpInstance
13764
+ .request({
13765
+ url: fillApiPath(`${this.domain}/open-apis/hire/v1/questionnaires`, path),
13766
+ method: "GET",
13767
+ data,
13768
+ params,
13769
+ headers,
13770
+ })
13771
+ .catch((e) => {
13772
+ this.logger.error(formatErrors(e));
13773
+ throw e;
13774
+ });
13775
+ }),
13776
+ },
13526
13777
  /**
13527
13778
  * 内推
13528
13779
  */
@@ -14953,7 +15204,7 @@ class Client$1 {
14953
15204
  this.logger.error(formatErrors(e));
14954
15205
  throw e;
14955
15206
  });
14956
- return get(res, "data", {});
15207
+ return get(res, "data", null);
14957
15208
  }),
14958
15209
  /**
14959
15210
  * {@link https://open.feishu.cn/api-explorer?project=im&resource=file&apiName=get&version=v1 click to debug }
@@ -15026,7 +15277,7 @@ class Client$1 {
15026
15277
  this.logger.error(formatErrors(e));
15027
15278
  throw e;
15028
15279
  });
15029
- return get(res, "data", {});
15280
+ return get(res, "data", null);
15030
15281
  }),
15031
15282
  /**
15032
15283
  * {@link https://open.feishu.cn/api-explorer?project=im&resource=image&apiName=get&version=v1 click to debug }
@@ -15071,7 +15322,7 @@ class Client$1 {
15071
15322
  }),
15072
15323
  },
15073
15324
  /**
15074
- * 消息加急
15325
+ * 消息
15075
15326
  */
15076
15327
  message: {
15077
15328
  /**
@@ -15126,6 +15377,28 @@ class Client$1 {
15126
15377
  throw e;
15127
15378
  });
15128
15379
  }),
15380
+ /**
15381
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=forward&version=v1 click to debug }
15382
+ *
15383
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=forward&project=im&resource=message&version=v1 document }
15384
+ *
15385
+ * 转发一条消息
15386
+ */
15387
+ forward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15388
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15389
+ return this.httpInstance
15390
+ .request({
15391
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/:message_id/forward`, path),
15392
+ method: "POST",
15393
+ data,
15394
+ params,
15395
+ headers,
15396
+ })
15397
+ .catch((e) => {
15398
+ this.logger.error(formatErrors(e));
15399
+ throw e;
15400
+ });
15401
+ }),
15129
15402
  /**
15130
15403
  * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=get&version=v1 click to debug }
15131
15404
  *
@@ -15228,6 +15501,28 @@ class Client$1 {
15228
15501
  throw e;
15229
15502
  });
15230
15503
  }),
15504
+ /**
15505
+ * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=merge_forward&version=v1 click to debug }
15506
+ *
15507
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=merge_forward&project=im&resource=message&version=v1 document }
15508
+ *
15509
+ * 合并转发多条消息
15510
+ */
15511
+ mergeForward: (payload, options) => __awaiter(this, void 0, void 0, function* () {
15512
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
15513
+ return this.httpInstance
15514
+ .request({
15515
+ url: fillApiPath(`${this.domain}/open-apis/im/v1/messages/merge_forward`, path),
15516
+ method: "POST",
15517
+ data,
15518
+ params,
15519
+ headers,
15520
+ })
15521
+ .catch((e) => {
15522
+ this.logger.error(formatErrors(e));
15523
+ throw e;
15524
+ });
15525
+ }),
15231
15526
  /**
15232
15527
  * {@link https://open.feishu.cn/api-explorer?project=im&resource=message&apiName=patch&version=v1 click to debug }
15233
15528
  *
@@ -17134,7 +17429,7 @@ class Client$1 {
17134
17429
  this.logger.error(formatErrors(e));
17135
17430
  throw e;
17136
17431
  });
17137
- return get(res, "data", {});
17432
+ return get(res, "data", null);
17138
17433
  }),
17139
17434
  },
17140
17435
  /**
@@ -18436,7 +18731,7 @@ class Client$1 {
18436
18731
  }),
18437
18732
  },
18438
18733
  /**
18439
- * 工作表
18734
+ * 单元格
18440
18735
  */
18441
18736
  spreadsheetSheet: {
18442
18737
  /**
@@ -19717,6 +20012,83 @@ class Client$1 {
19717
20012
  * 视频会议
19718
20013
  */
19719
20014
  this.vc = {
20015
+ /**
20016
+ * 告警中心
20017
+ */
20018
+ alert: {
20019
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
20020
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
20021
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
20022
+ const res = yield this.httpInstance
20023
+ .request({
20024
+ url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path),
20025
+ method: "GET",
20026
+ headers: pickBy(innerPayload.headers, identity),
20027
+ params: pickBy(innerPayload.params, identity),
20028
+ })
20029
+ .catch((e) => {
20030
+ this.logger.error(formatErrors(e));
20031
+ });
20032
+ return res;
20033
+ });
20034
+ const Iterable = {
20035
+ [Symbol.asyncIterator]() {
20036
+ return __asyncGenerator(this, arguments, function* _a() {
20037
+ let hasMore = true;
20038
+ let pageToken;
20039
+ while (hasMore) {
20040
+ try {
20041
+ const res = yield __await(sendRequest({
20042
+ headers,
20043
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
20044
+ data,
20045
+ }));
20046
+ const _b = get(res, "data") || {}, {
20047
+ // @ts-ignore
20048
+ has_more,
20049
+ // @ts-ignore
20050
+ page_token,
20051
+ // @ts-ignore
20052
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
20053
+ yield yield __await(rest);
20054
+ hasMore = Boolean(has_more);
20055
+ pageToken = page_token || next_page_token;
20056
+ }
20057
+ catch (e) {
20058
+ yield yield __await(null);
20059
+ break;
20060
+ }
20061
+ }
20062
+ });
20063
+ },
20064
+ };
20065
+ return Iterable;
20066
+ }),
20067
+ /**
20068
+ * {@link https://open.feishu.cn/api-explorer?project=vc&resource=alert&apiName=list&version=v1 click to debug }
20069
+ *
20070
+ * {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/vc-v1/alert/list document }
20071
+ *
20072
+ * 获取告警记录
20073
+ *
20074
+ * 获取特定条件下租户的设备告警记录
20075
+ */
20076
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
20077
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
20078
+ return this.httpInstance
20079
+ .request({
20080
+ url: fillApiPath(`${this.domain}/open-apis/vc/v1/alerts`, path),
20081
+ method: "GET",
20082
+ data,
20083
+ params,
20084
+ headers,
20085
+ })
20086
+ .catch((e) => {
20087
+ this.logger.error(formatErrors(e));
20088
+ throw e;
20089
+ });
20090
+ }),
20091
+ },
19720
20092
  /**
19721
20093
  * 导出
19722
20094
  */