@larksuiteoapi/node-sdk 1.48.0-alpha.3 → 1.49.0-alpha.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 +1465 -166
  2. package/lib/index.js +1465 -166
  3. package/package.json +1 -1
  4. package/types/index.d.ts +6998 -812
package/es/index.js CHANGED
@@ -256,7 +256,7 @@ const formatErrors = (e) => {
256
256
  };
257
257
 
258
258
  // auto gen
259
- class Client$14 {
259
+ class Client$16 {
260
260
  constructor() {
261
261
  /**
262
262
  * 智能门禁
@@ -1313,11 +1313,11 @@ class Client$14 {
1313
1313
  }
1314
1314
 
1315
1315
  // auto gen
1316
- class Client$13 extends Client$14 {
1316
+ class Client$15 extends Client$16 {
1317
1317
  constructor() {
1318
1318
  super(...arguments);
1319
1319
  /**
1320
- * 管理后台-企业勋章
1320
+ * 管理后台-数据报表
1321
1321
  */
1322
1322
  this.admin = {
1323
1323
  /**
@@ -2409,7 +2409,7 @@ class Client$13 extends Client$14 {
2409
2409
  }
2410
2410
 
2411
2411
  // auto gen
2412
- class Client$12 extends Client$13 {
2412
+ class Client$14 extends Client$15 {
2413
2413
  constructor() {
2414
2414
  super(...arguments);
2415
2415
  /**
@@ -2793,6 +2793,75 @@ class Client$12 extends Client$13 {
2793
2793
  * app.data_asset
2794
2794
  */
2795
2795
  appDataAsset: {
2796
+ /**
2797
+ * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=create&version=v1 click to debug }
2798
+ *
2799
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=aily&resource=app.data_asset&version=v1 document }
2800
+ *
2801
+ * 创建数据知识
2802
+ */
2803
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
2804
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
2805
+ return this.httpInstance
2806
+ .request({
2807
+ url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`, path),
2808
+ method: "POST",
2809
+ data,
2810
+ params,
2811
+ headers,
2812
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
2813
+ })
2814
+ .catch((e) => {
2815
+ this.logger.error(formatErrors(e));
2816
+ throw e;
2817
+ });
2818
+ }),
2819
+ /**
2820
+ * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=delete&version=v1 click to debug }
2821
+ *
2822
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=aily&resource=app.data_asset&version=v1 document }
2823
+ *
2824
+ * 删除数据知识
2825
+ */
2826
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
2827
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
2828
+ return this.httpInstance
2829
+ .request({
2830
+ url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`, path),
2831
+ method: "DELETE",
2832
+ data,
2833
+ params,
2834
+ headers,
2835
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
2836
+ })
2837
+ .catch((e) => {
2838
+ this.logger.error(formatErrors(e));
2839
+ throw e;
2840
+ });
2841
+ }),
2842
+ /**
2843
+ * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=get&version=v1 click to debug }
2844
+ *
2845
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=app.data_asset&version=v1 document }
2846
+ *
2847
+ * 获取数据知识
2848
+ */
2849
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
2850
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
2851
+ return this.httpInstance
2852
+ .request({
2853
+ url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`, path),
2854
+ method: "GET",
2855
+ data,
2856
+ params,
2857
+ headers,
2858
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
2859
+ })
2860
+ .catch((e) => {
2861
+ this.logger.error(formatErrors(e));
2862
+ throw e;
2863
+ });
2864
+ }),
2796
2865
  listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
2797
2866
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
2798
2867
  const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
@@ -2868,6 +2937,30 @@ class Client$12 extends Client$13 {
2868
2937
  throw e;
2869
2938
  });
2870
2939
  }),
2940
+ /**
2941
+ * {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=upload_file&version=v1 click to debug }
2942
+ *
2943
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload_file&project=aily&resource=app.data_asset&version=v1 document }
2944
+ *
2945
+ * 上传数据知识文件
2946
+ */
2947
+ uploadFile: (payload, options) => __awaiter(this, void 0, void 0, function* () {
2948
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
2949
+ const res = yield this.httpInstance
2950
+ .request({
2951
+ url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`, path),
2952
+ method: "POST",
2953
+ data,
2954
+ params,
2955
+ headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
2956
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
2957
+ })
2958
+ .catch((e) => {
2959
+ this.logger.error(formatErrors(e));
2960
+ throw e;
2961
+ });
2962
+ return (res === null || res === void 0 ? void 0 : res.data) || null;
2963
+ }),
2871
2964
  },
2872
2965
  /**
2873
2966
  * app.data_asset_tag
@@ -3109,7 +3202,7 @@ class Client$12 extends Client$13 {
3109
3202
  }
3110
3203
 
3111
3204
  // auto gen
3112
- class Client$11 extends Client$12 {
3205
+ class Client$13 extends Client$14 {
3113
3206
  constructor() {
3114
3207
  super(...arguments);
3115
3208
  /**
@@ -4090,7 +4183,7 @@ class Client$11 extends Client$12 {
4090
4183
  }
4091
4184
 
4092
4185
  // auto gen
4093
- class Client$10 extends Client$11 {
4186
+ class Client$12 extends Client$13 {
4094
4187
  constructor() {
4095
4188
  super(...arguments);
4096
4189
  /**
@@ -5810,7 +5903,7 @@ class Client$10 extends Client$11 {
5810
5903
  }
5811
5904
 
5812
5905
  // auto gen
5813
- class Client$$ extends Client$10 {
5906
+ class Client$11 extends Client$12 {
5814
5907
  constructor() {
5815
5908
  super(...arguments);
5816
5909
  /**
@@ -5818,7 +5911,7 @@ class Client$$ extends Client$10 {
5818
5911
  */
5819
5912
  this.approval = {
5820
5913
  /**
5821
- * 事件
5914
+ * 原生审批定义
5822
5915
  */
5823
5916
  approval: {
5824
5917
  /**
@@ -6113,7 +6206,7 @@ class Client$$ extends Client$10 {
6113
6206
  }),
6114
6207
  },
6115
6208
  /**
6116
- * 审批查询
6209
+ * 原生审批实例
6117
6210
  */
6118
6211
  instance: {
6119
6212
  /**
@@ -6615,7 +6708,7 @@ class Client$$ extends Client$10 {
6615
6708
  }),
6616
6709
  },
6617
6710
  /**
6618
- * 审批查询
6711
+ * 原生审批任务
6619
6712
  */
6620
6713
  task: {
6621
6714
  /**
@@ -6821,7 +6914,7 @@ class Client$$ extends Client$10 {
6821
6914
  },
6822
6915
  v4: {
6823
6916
  /**
6824
- * 事件
6917
+ * 原生审批定义
6825
6918
  */
6826
6919
  approval: {
6827
6920
  /**
@@ -7118,7 +7211,7 @@ class Client$$ extends Client$10 {
7118
7211
  }),
7119
7212
  },
7120
7213
  /**
7121
- * 审批查询
7214
+ * 原生审批实例
7122
7215
  */
7123
7216
  instance: {
7124
7217
  /**
@@ -7626,7 +7719,7 @@ class Client$$ extends Client$10 {
7626
7719
  }),
7627
7720
  },
7628
7721
  /**
7629
- * 审批查询
7722
+ * 原生审批任务
7630
7723
  */
7631
7724
  task: {
7632
7725
  /**
@@ -7838,7 +7931,7 @@ class Client$$ extends Client$10 {
7838
7931
  }
7839
7932
 
7840
7933
  // auto gen
7841
- class Client$_ extends Client$$ {
7934
+ class Client$10 extends Client$11 {
7842
7935
  constructor() {
7843
7936
  super(...arguments);
7844
7937
  /**
@@ -10292,7 +10385,7 @@ class Client$_ extends Client$$ {
10292
10385
  }
10293
10386
 
10294
10387
  // auto gen
10295
- class Client$Z extends Client$_ {
10388
+ class Client$$ extends Client$10 {
10296
10389
  constructor() {
10297
10390
  super(...arguments);
10298
10391
  /**
@@ -10546,7 +10639,7 @@ class Client$Z extends Client$_ {
10546
10639
  }
10547
10640
 
10548
10641
  // auto gen
10549
- class Client$Y extends Client$Z {
10642
+ class Client$_ extends Client$$ {
10550
10643
  constructor() {
10551
10644
  super(...arguments);
10552
10645
  /**
@@ -10820,7 +10913,7 @@ class Client$Y extends Client$Z {
10820
10913
  }
10821
10914
 
10822
10915
  // auto gen
10823
- class Client$X extends Client$Y {
10916
+ class Client$Z extends Client$_ {
10824
10917
  constructor() {
10825
10918
  super(...arguments);
10826
10919
  /**
@@ -10831,7 +10924,7 @@ class Client$X extends Client$Y {
10831
10924
  }
10832
10925
 
10833
10926
  // auto gen
10834
- class Client$W extends Client$X {
10927
+ class Client$Y extends Client$Z {
10835
10928
  constructor() {
10836
10929
  super(...arguments);
10837
10930
  /**
@@ -11909,7 +12002,147 @@ class Client$W extends Client$X {
11909
12002
  }
11910
12003
 
11911
12004
  // auto gen
11912
- class Client$V extends Client$W {
12005
+ class Client$X extends Client$Y {
12006
+ constructor() {
12007
+ super(...arguments);
12008
+ /**
12009
+
12010
+ */
12011
+ this.base = {
12012
+ v2: {
12013
+ /**
12014
+ * app.role
12015
+ */
12016
+ appRole: {
12017
+ /**
12018
+ * {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=create&version=v2 click to debug }
12019
+ *
12020
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=base&resource=app.role&version=v2 document }
12021
+ *
12022
+ * 新增自定义角色
12023
+ */
12024
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
12025
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
12026
+ return this.httpInstance
12027
+ .request({
12028
+ url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path),
12029
+ method: "POST",
12030
+ data,
12031
+ params,
12032
+ headers,
12033
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
12034
+ })
12035
+ .catch((e) => {
12036
+ this.logger.error(formatErrors(e));
12037
+ throw e;
12038
+ });
12039
+ }),
12040
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
12041
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
12042
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
12043
+ const res = yield this.httpInstance
12044
+ .request({
12045
+ url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path),
12046
+ method: "GET",
12047
+ headers: pickBy(innerPayload.headers, identity),
12048
+ params: pickBy(innerPayload.params, identity),
12049
+ data,
12050
+ paramsSerializer: (params) => stringify(params, {
12051
+ arrayFormat: "repeat",
12052
+ }),
12053
+ })
12054
+ .catch((e) => {
12055
+ this.logger.error(formatErrors(e));
12056
+ });
12057
+ return res;
12058
+ });
12059
+ const Iterable = {
12060
+ [Symbol.asyncIterator]() {
12061
+ return __asyncGenerator(this, arguments, function* _a() {
12062
+ let hasMore = true;
12063
+ let pageToken;
12064
+ while (hasMore) {
12065
+ try {
12066
+ const res = yield __await(sendRequest({
12067
+ headers,
12068
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
12069
+ data,
12070
+ }));
12071
+ const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
12072
+ // @ts-ignore
12073
+ has_more,
12074
+ // @ts-ignore
12075
+ page_token,
12076
+ // @ts-ignore
12077
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
12078
+ yield yield __await(rest);
12079
+ hasMore = Boolean(has_more);
12080
+ pageToken = page_token || next_page_token;
12081
+ }
12082
+ catch (e) {
12083
+ yield yield __await(null);
12084
+ break;
12085
+ }
12086
+ }
12087
+ });
12088
+ },
12089
+ };
12090
+ return Iterable;
12091
+ }),
12092
+ /**
12093
+ * {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=list&version=v2 click to debug }
12094
+ *
12095
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=base&resource=app.role&version=v2 document }
12096
+ *
12097
+ * 列出自定义角色
12098
+ */
12099
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
12100
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
12101
+ return this.httpInstance
12102
+ .request({
12103
+ url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path),
12104
+ method: "GET",
12105
+ data,
12106
+ params,
12107
+ headers,
12108
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
12109
+ })
12110
+ .catch((e) => {
12111
+ this.logger.error(formatErrors(e));
12112
+ throw e;
12113
+ });
12114
+ }),
12115
+ /**
12116
+ * {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=update&version=v2 click to debug }
12117
+ *
12118
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=base&resource=app.role&version=v2 document }
12119
+ *
12120
+ * 更新自定义角色
12121
+ */
12122
+ update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
12123
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
12124
+ return this.httpInstance
12125
+ .request({
12126
+ url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`, path),
12127
+ method: "PUT",
12128
+ data,
12129
+ params,
12130
+ headers,
12131
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
12132
+ })
12133
+ .catch((e) => {
12134
+ this.logger.error(formatErrors(e));
12135
+ throw e;
12136
+ });
12137
+ }),
12138
+ },
12139
+ },
12140
+ };
12141
+ }
12142
+ }
12143
+
12144
+ // auto gen
12145
+ class Client$W extends Client$X {
11913
12146
  constructor() {
11914
12147
  super(...arguments);
11915
12148
  /**
@@ -15421,7 +15654,7 @@ class Client$V extends Client$W {
15421
15654
  }
15422
15655
 
15423
15656
  // auto gen
15424
- class Client$U extends Client$V {
15657
+ class Client$V extends Client$W {
15425
15658
  constructor() {
15426
15659
  super(...arguments);
15427
15660
  /**
@@ -15605,7 +15838,7 @@ class Client$U extends Client$V {
15605
15838
  }
15606
15839
 
15607
15840
  // auto gen
15608
- class Client$T extends Client$U {
15841
+ class Client$U extends Client$V {
15609
15842
  constructor() {
15610
15843
  super(...arguments);
15611
15844
  /**
@@ -15702,7 +15935,7 @@ class Client$T extends Client$U {
15702
15935
  }
15703
15936
 
15704
15937
  // auto gen
15705
- class Client$S extends Client$T {
15938
+ class Client$T extends Client$U {
15706
15939
  constructor() {
15707
15940
  super(...arguments);
15708
15941
  /**
@@ -18442,7 +18675,7 @@ class Client$S extends Client$T {
18442
18675
  }
18443
18676
 
18444
18677
  // auto gen
18445
- class Client$R extends Client$S {
18678
+ class Client$S extends Client$T {
18446
18679
  constructor() {
18447
18680
  super(...arguments);
18448
18681
  /**
@@ -18696,7 +18929,7 @@ class Client$R extends Client$S {
18696
18929
  }
18697
18930
 
18698
18931
  // auto gen
18699
- class Client$Q extends Client$R {
18932
+ class Client$R extends Client$S {
18700
18933
  constructor() {
18701
18934
  super(...arguments);
18702
18935
  /**
@@ -18707,7 +18940,7 @@ class Client$Q extends Client$R {
18707
18940
  }
18708
18941
 
18709
18942
  // auto gen
18710
- class Client$P extends Client$Q {
18943
+ class Client$Q extends Client$R {
18711
18944
  constructor() {
18712
18945
  super(...arguments);
18713
18946
  /**
@@ -19137,7 +19370,7 @@ class Client$P extends Client$Q {
19137
19370
  }
19138
19371
 
19139
19372
  // auto gen
19140
- class Client$O extends Client$P {
19373
+ class Client$P extends Client$Q {
19141
19374
  constructor() {
19142
19375
  super(...arguments);
19143
19376
  /**
@@ -24165,7 +24398,7 @@ class Client$O extends Client$P {
24165
24398
  }
24166
24399
 
24167
24400
  // auto gen
24168
- class Client$N extends Client$O {
24401
+ class Client$O extends Client$P {
24169
24402
  constructor() {
24170
24403
  super(...arguments);
24171
24404
  /**
@@ -24176,7 +24409,7 @@ class Client$N extends Client$O {
24176
24409
  }
24177
24410
 
24178
24411
  // auto gen
24179
- class Client$M extends Client$N {
24412
+ class Client$N extends Client$O {
24180
24413
  constructor() {
24181
24414
  super(...arguments);
24182
24415
  /**
@@ -24187,7 +24420,7 @@ class Client$M extends Client$N {
24187
24420
  }
24188
24421
 
24189
24422
  // auto gen
24190
- class Client$L extends Client$M {
24423
+ class Client$M extends Client$N {
24191
24424
  constructor() {
24192
24425
  super(...arguments);
24193
24426
  /**
@@ -31420,61 +31653,21 @@ class Client$L extends Client$M {
31420
31653
  }),
31421
31654
  },
31422
31655
  /**
31423
- * default_cost_center
31656
+ * custom_org
31424
31657
  */
31425
- defaultCostCenter: {
31658
+ customOrg: {
31426
31659
  /**
31427
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=batch_query&version=v2 click to debug }
31660
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=active&version=v2 click to debug }
31428
31661
  *
31429
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=corehr&resource=default_cost_center&version=v2 document }
31430
- */
31431
- batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31432
- const { headers, params, data, path } = yield this.formatPayload(payload, options);
31433
- return this.httpInstance
31434
- .request({
31435
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`, path),
31436
- method: "POST",
31437
- data,
31438
- params,
31439
- headers,
31440
- paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31441
- })
31442
- .catch((e) => {
31443
- this.logger.error(formatErrors(e));
31444
- throw e;
31445
- });
31446
- }),
31447
- /**
31448
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=create_version&version=v2 click to debug }
31662
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=custom_org&version=v2 document }
31449
31663
  *
31450
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_version&project=corehr&resource=default_cost_center&version=v2 document }
31664
+ * 启/停用自定义组织
31451
31665
  */
31452
- createVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31453
- const { headers, params, data, path } = yield this.formatPayload(payload, options);
31454
- return this.httpInstance
31455
- .request({
31456
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`, path),
31457
- method: "POST",
31458
- data,
31459
- params,
31460
- headers,
31461
- paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31462
- })
31463
- .catch((e) => {
31464
- this.logger.error(formatErrors(e));
31465
- throw e;
31466
- });
31467
- }),
31468
- /**
31469
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=remove_version&version=v2 click to debug }
31470
- *
31471
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_version&project=corehr&resource=default_cost_center&version=v2 document }
31472
- */
31473
- removeVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31666
+ active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31474
31667
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
31475
31668
  return this.httpInstance
31476
31669
  .request({
31477
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`, path),
31670
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`, path),
31478
31671
  method: "POST",
31479
31672
  data,
31480
31673
  params,
@@ -31487,41 +31680,15 @@ class Client$L extends Client$M {
31487
31680
  });
31488
31681
  }),
31489
31682
  /**
31490
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=update_version&version=v2 click to debug }
31683
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=create&version=v2 click to debug }
31491
31684
  *
31492
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_version&project=corehr&resource=default_cost_center&version=v2 document }
31685
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=custom_org&version=v2 document }
31493
31686
  */
31494
- updateVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31495
- const { headers, params, data, path } = yield this.formatPayload(payload, options);
31496
- return this.httpInstance
31497
- .request({
31498
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`, path),
31499
- method: "POST",
31500
- data,
31501
- params,
31502
- headers,
31503
- paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31504
- })
31505
- .catch((e) => {
31506
- this.logger.error(formatErrors(e));
31507
- throw e;
31508
- });
31509
- }),
31510
- },
31511
- /**
31512
- * department
31513
- */
31514
- department: {
31515
- /**
31516
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=batch_get&version=v2 click to debug }
31517
- *
31518
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=department&version=v2 document }
31519
- */
31520
- batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31687
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31521
31688
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
31522
31689
  return this.httpInstance
31523
31690
  .request({
31524
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/batch_get`, path),
31691
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs`, path),
31525
31692
  method: "POST",
31526
31693
  data,
31527
31694
  params,
@@ -31534,38 +31701,17 @@ class Client$L extends Client$M {
31534
31701
  });
31535
31702
  }),
31536
31703
  /**
31537
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=delete&version=v2 click to debug }
31704
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=delete_org&version=v2 click to debug }
31538
31705
  *
31539
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=department&version=v2 document }
31706
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete_org&project=corehr&resource=custom_org&version=v2 document }
31540
31707
  *
31541
- * 删除部门数据
31708
+ * 删除自定义组织
31542
31709
  */
31543
- delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31710
+ deleteOrg: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31544
31711
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
31545
31712
  return this.httpInstance
31546
31713
  .request({
31547
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path),
31548
- method: "DELETE",
31549
- data,
31550
- params,
31551
- headers,
31552
- paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31553
- })
31554
- .catch((e) => {
31555
- this.logger.error(formatErrors(e));
31556
- throw e;
31557
- });
31558
- }),
31559
- /**
31560
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=parents&version=v2 click to debug }
31561
- *
31562
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 document }
31563
- */
31564
- parents: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31565
- const { headers, params, data, path } = yield this.formatPayload(payload, options);
31566
- return this.httpInstance
31567
- .request({
31568
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/parents`, path),
31714
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`, path),
31569
31715
  method: "POST",
31570
31716
  data,
31571
31717
  params,
@@ -31578,17 +31724,17 @@ class Client$L extends Client$M {
31578
31724
  });
31579
31725
  }),
31580
31726
  /**
31581
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=patch&version=v2 click to debug }
31727
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=patch&version=v2 click to debug }
31582
31728
  *
31583
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=department&version=v2 document }
31729
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=custom_org&version=v2 document }
31584
31730
  *
31585
- * 更新部门数据
31731
+ * 更新自定义组织
31586
31732
  */
31587
31733
  patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31588
31734
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
31589
31735
  return this.httpInstance
31590
31736
  .request({
31591
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path),
31737
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`, path),
31592
31738
  method: "PATCH",
31593
31739
  data,
31594
31740
  params,
@@ -31601,17 +31747,17 @@ class Client$L extends Client$M {
31601
31747
  });
31602
31748
  }),
31603
31749
  /**
31604
- * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_multi_timeline&version=v2 click to debug }
31750
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=query&version=v2 click to debug }
31605
31751
  *
31606
- * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_multi_timeline&project=corehr&resource=department&version=v2 document }
31752
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=custom_org&version=v2 document }
31607
31753
  *
31608
- * 查询任意日期部门信息
31754
+ * 查询自定义组织信息
31609
31755
  */
31610
- queryMultiTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31756
+ query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31611
31757
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
31612
31758
  return this.httpInstance
31613
31759
  .request({
31614
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`, path),
31760
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`, path),
31615
31761
  method: "POST",
31616
31762
  data,
31617
31763
  params,
@@ -31623,13 +31769,314 @@ class Client$L extends Client$M {
31623
31769
  throw e;
31624
31770
  });
31625
31771
  }),
31626
- queryOperationLogsWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31772
+ queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31627
31773
  const { headers, params, data, path } = yield this.formatPayload(payload, options);
31628
31774
  const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
31629
31775
  const res = yield this.httpInstance
31630
31776
  .request({
31631
- url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`, path),
31632
- method: "POST",
31777
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`, path),
31778
+ method: "GET",
31779
+ headers: pickBy(innerPayload.headers, identity),
31780
+ params: pickBy(innerPayload.params, identity),
31781
+ data,
31782
+ paramsSerializer: (params) => stringify(params, {
31783
+ arrayFormat: "repeat",
31784
+ }),
31785
+ })
31786
+ .catch((e) => {
31787
+ this.logger.error(formatErrors(e));
31788
+ });
31789
+ return res;
31790
+ });
31791
+ const Iterable = {
31792
+ [Symbol.asyncIterator]() {
31793
+ return __asyncGenerator(this, arguments, function* _a() {
31794
+ let hasMore = true;
31795
+ let pageToken;
31796
+ while (hasMore) {
31797
+ try {
31798
+ const res = yield __await(sendRequest({
31799
+ headers,
31800
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
31801
+ data,
31802
+ }));
31803
+ const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
31804
+ // @ts-ignore
31805
+ has_more,
31806
+ // @ts-ignore
31807
+ page_token,
31808
+ // @ts-ignore
31809
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
31810
+ yield yield __await(rest);
31811
+ hasMore = Boolean(has_more);
31812
+ pageToken = page_token || next_page_token;
31813
+ }
31814
+ catch (e) {
31815
+ yield yield __await(null);
31816
+ break;
31817
+ }
31818
+ }
31819
+ });
31820
+ },
31821
+ };
31822
+ return Iterable;
31823
+ }),
31824
+ /**
31825
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=query_recent_change&version=v2 click to debug }
31826
+ *
31827
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=custom_org&version=v2 document }
31828
+ */
31829
+ queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31830
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31831
+ return this.httpInstance
31832
+ .request({
31833
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`, path),
31834
+ method: "GET",
31835
+ data,
31836
+ params,
31837
+ headers,
31838
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31839
+ })
31840
+ .catch((e) => {
31841
+ this.logger.error(formatErrors(e));
31842
+ throw e;
31843
+ });
31844
+ }),
31845
+ /**
31846
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=update_rule&version=v2 click to debug }
31847
+ *
31848
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_rule&project=corehr&resource=custom_org&version=v2 document }
31849
+ *
31850
+ * 更新匹配规则
31851
+ */
31852
+ updateRule: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31853
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31854
+ return this.httpInstance
31855
+ .request({
31856
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`, path),
31857
+ method: "POST",
31858
+ data,
31859
+ params,
31860
+ headers,
31861
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31862
+ })
31863
+ .catch((e) => {
31864
+ this.logger.error(formatErrors(e));
31865
+ throw e;
31866
+ });
31867
+ }),
31868
+ },
31869
+ /**
31870
+ * default_cost_center
31871
+ */
31872
+ defaultCostCenter: {
31873
+ /**
31874
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=batch_query&version=v2 click to debug }
31875
+ *
31876
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=corehr&resource=default_cost_center&version=v2 document }
31877
+ */
31878
+ batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31879
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31880
+ return this.httpInstance
31881
+ .request({
31882
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`, path),
31883
+ method: "POST",
31884
+ data,
31885
+ params,
31886
+ headers,
31887
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31888
+ })
31889
+ .catch((e) => {
31890
+ this.logger.error(formatErrors(e));
31891
+ throw e;
31892
+ });
31893
+ }),
31894
+ /**
31895
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=create_version&version=v2 click to debug }
31896
+ *
31897
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_version&project=corehr&resource=default_cost_center&version=v2 document }
31898
+ */
31899
+ createVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31900
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31901
+ return this.httpInstance
31902
+ .request({
31903
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`, path),
31904
+ method: "POST",
31905
+ data,
31906
+ params,
31907
+ headers,
31908
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31909
+ })
31910
+ .catch((e) => {
31911
+ this.logger.error(formatErrors(e));
31912
+ throw e;
31913
+ });
31914
+ }),
31915
+ /**
31916
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=remove_version&version=v2 click to debug }
31917
+ *
31918
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_version&project=corehr&resource=default_cost_center&version=v2 document }
31919
+ */
31920
+ removeVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31921
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31922
+ return this.httpInstance
31923
+ .request({
31924
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`, path),
31925
+ method: "POST",
31926
+ data,
31927
+ params,
31928
+ headers,
31929
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31930
+ })
31931
+ .catch((e) => {
31932
+ this.logger.error(formatErrors(e));
31933
+ throw e;
31934
+ });
31935
+ }),
31936
+ /**
31937
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=update_version&version=v2 click to debug }
31938
+ *
31939
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_version&project=corehr&resource=default_cost_center&version=v2 document }
31940
+ */
31941
+ updateVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31942
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31943
+ return this.httpInstance
31944
+ .request({
31945
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`, path),
31946
+ method: "POST",
31947
+ data,
31948
+ params,
31949
+ headers,
31950
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31951
+ })
31952
+ .catch((e) => {
31953
+ this.logger.error(formatErrors(e));
31954
+ throw e;
31955
+ });
31956
+ }),
31957
+ },
31958
+ /**
31959
+ * department
31960
+ */
31961
+ department: {
31962
+ /**
31963
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=batch_get&version=v2 click to debug }
31964
+ *
31965
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=department&version=v2 document }
31966
+ */
31967
+ batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31968
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31969
+ return this.httpInstance
31970
+ .request({
31971
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/batch_get`, path),
31972
+ method: "POST",
31973
+ data,
31974
+ params,
31975
+ headers,
31976
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
31977
+ })
31978
+ .catch((e) => {
31979
+ this.logger.error(formatErrors(e));
31980
+ throw e;
31981
+ });
31982
+ }),
31983
+ /**
31984
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=delete&version=v2 click to debug }
31985
+ *
31986
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=department&version=v2 document }
31987
+ *
31988
+ * 删除部门数据
31989
+ */
31990
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
31991
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
31992
+ return this.httpInstance
31993
+ .request({
31994
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path),
31995
+ method: "DELETE",
31996
+ data,
31997
+ params,
31998
+ headers,
31999
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
32000
+ })
32001
+ .catch((e) => {
32002
+ this.logger.error(formatErrors(e));
32003
+ throw e;
32004
+ });
32005
+ }),
32006
+ /**
32007
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=parents&version=v2 click to debug }
32008
+ *
32009
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 document }
32010
+ */
32011
+ parents: (payload, options) => __awaiter(this, void 0, void 0, function* () {
32012
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
32013
+ return this.httpInstance
32014
+ .request({
32015
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/parents`, path),
32016
+ method: "POST",
32017
+ data,
32018
+ params,
32019
+ headers,
32020
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
32021
+ })
32022
+ .catch((e) => {
32023
+ this.logger.error(formatErrors(e));
32024
+ throw e;
32025
+ });
32026
+ }),
32027
+ /**
32028
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=patch&version=v2 click to debug }
32029
+ *
32030
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=department&version=v2 document }
32031
+ *
32032
+ * 更新部门数据
32033
+ */
32034
+ patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
32035
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
32036
+ return this.httpInstance
32037
+ .request({
32038
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path),
32039
+ method: "PATCH",
32040
+ data,
32041
+ params,
32042
+ headers,
32043
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
32044
+ })
32045
+ .catch((e) => {
32046
+ this.logger.error(formatErrors(e));
32047
+ throw e;
32048
+ });
32049
+ }),
32050
+ /**
32051
+ * {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_multi_timeline&version=v2 click to debug }
32052
+ *
32053
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_multi_timeline&project=corehr&resource=department&version=v2 document }
32054
+ *
32055
+ * 查询任意日期部门信息
32056
+ */
32057
+ queryMultiTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
32058
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
32059
+ return this.httpInstance
32060
+ .request({
32061
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`, path),
32062
+ method: "POST",
32063
+ data,
32064
+ params,
32065
+ headers,
32066
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
32067
+ })
32068
+ .catch((e) => {
32069
+ this.logger.error(formatErrors(e));
32070
+ throw e;
32071
+ });
32072
+ }),
32073
+ queryOperationLogsWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
32074
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
32075
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
32076
+ const res = yield this.httpInstance
32077
+ .request({
32078
+ url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`, path),
32079
+ method: "POST",
31633
32080
  headers: pickBy(innerPayload.headers, identity),
31634
32081
  params: pickBy(innerPayload.params, identity),
31635
32082
  data,
@@ -34235,6 +34682,726 @@ class Client$L extends Client$M {
34235
34682
  }
34236
34683
  }
34237
34684
 
34685
+ // auto gen
34686
+ class Client$L extends Client$M {
34687
+ constructor() {
34688
+ super(...arguments);
34689
+ /**
34690
+
34691
+ */
34692
+ this.directory = {
34693
+ v1: {
34694
+ /**
34695
+ * collaboration_rule
34696
+ */
34697
+ collaborationRule: {
34698
+ /**
34699
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=create&version=v1 click to debug }
34700
+ *
34701
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=collaboration_rule&version=v1 document }
34702
+ *
34703
+ * 创建关联组织规则
34704
+ */
34705
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34706
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34707
+ return this.httpInstance
34708
+ .request({
34709
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path),
34710
+ method: "POST",
34711
+ data,
34712
+ params,
34713
+ headers,
34714
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
34715
+ })
34716
+ .catch((e) => {
34717
+ this.logger.error(formatErrors(e));
34718
+ throw e;
34719
+ });
34720
+ }),
34721
+ /**
34722
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=delete&version=v1 click to debug }
34723
+ *
34724
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=collaboration_rule&version=v1 document }
34725
+ *
34726
+ * 删除关联组织的规则
34727
+ */
34728
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34729
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34730
+ return this.httpInstance
34731
+ .request({
34732
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`, path),
34733
+ method: "DELETE",
34734
+ data,
34735
+ params,
34736
+ headers,
34737
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
34738
+ })
34739
+ .catch((e) => {
34740
+ this.logger.error(formatErrors(e));
34741
+ throw e;
34742
+ });
34743
+ }),
34744
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34745
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34746
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
34747
+ const res = yield this.httpInstance
34748
+ .request({
34749
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path),
34750
+ method: "GET",
34751
+ headers: pickBy(innerPayload.headers, identity),
34752
+ params: pickBy(innerPayload.params, identity),
34753
+ data,
34754
+ paramsSerializer: (params) => stringify(params, {
34755
+ arrayFormat: "repeat",
34756
+ }),
34757
+ })
34758
+ .catch((e) => {
34759
+ this.logger.error(formatErrors(e));
34760
+ });
34761
+ return res;
34762
+ });
34763
+ const Iterable = {
34764
+ [Symbol.asyncIterator]() {
34765
+ return __asyncGenerator(this, arguments, function* _a() {
34766
+ let hasMore = true;
34767
+ let pageToken;
34768
+ while (hasMore) {
34769
+ try {
34770
+ const res = yield __await(sendRequest({
34771
+ headers,
34772
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
34773
+ data,
34774
+ }));
34775
+ const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
34776
+ // @ts-ignore
34777
+ has_more,
34778
+ // @ts-ignore
34779
+ page_token,
34780
+ // @ts-ignore
34781
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
34782
+ yield yield __await(rest);
34783
+ hasMore = Boolean(has_more);
34784
+ pageToken = page_token || next_page_token;
34785
+ }
34786
+ catch (e) {
34787
+ yield yield __await(null);
34788
+ break;
34789
+ }
34790
+ }
34791
+ });
34792
+ },
34793
+ };
34794
+ return Iterable;
34795
+ }),
34796
+ /**
34797
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=list&version=v1 click to debug }
34798
+ *
34799
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collaboration_rule&version=v1 document }
34800
+ *
34801
+ * 获取关联组织规则列表
34802
+ */
34803
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34804
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34805
+ return this.httpInstance
34806
+ .request({
34807
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path),
34808
+ method: "GET",
34809
+ data,
34810
+ params,
34811
+ headers,
34812
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
34813
+ })
34814
+ .catch((e) => {
34815
+ this.logger.error(formatErrors(e));
34816
+ throw e;
34817
+ });
34818
+ }),
34819
+ /**
34820
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=update&version=v1 click to debug }
34821
+ *
34822
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=directory&resource=collaboration_rule&version=v1 document }
34823
+ *
34824
+ * 更新关联组织规则
34825
+ */
34826
+ update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34827
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34828
+ return this.httpInstance
34829
+ .request({
34830
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`, path),
34831
+ method: "PUT",
34832
+ data,
34833
+ params,
34834
+ headers,
34835
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
34836
+ })
34837
+ .catch((e) => {
34838
+ this.logger.error(formatErrors(e));
34839
+ throw e;
34840
+ });
34841
+ }),
34842
+ },
34843
+ /**
34844
+ * collaboration_tenant
34845
+ */
34846
+ collaborationTenant: {
34847
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34848
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34849
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
34850
+ const res = yield this.httpInstance
34851
+ .request({
34852
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_tenants`, path),
34853
+ method: "GET",
34854
+ headers: pickBy(innerPayload.headers, identity),
34855
+ params: pickBy(innerPayload.params, identity),
34856
+ data,
34857
+ paramsSerializer: (params) => stringify(params, {
34858
+ arrayFormat: "repeat",
34859
+ }),
34860
+ })
34861
+ .catch((e) => {
34862
+ this.logger.error(formatErrors(e));
34863
+ });
34864
+ return res;
34865
+ });
34866
+ const Iterable = {
34867
+ [Symbol.asyncIterator]() {
34868
+ return __asyncGenerator(this, arguments, function* _a() {
34869
+ let hasMore = true;
34870
+ let pageToken;
34871
+ while (hasMore) {
34872
+ try {
34873
+ const res = yield __await(sendRequest({
34874
+ headers,
34875
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
34876
+ data,
34877
+ }));
34878
+ const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
34879
+ // @ts-ignore
34880
+ has_more,
34881
+ // @ts-ignore
34882
+ page_token,
34883
+ // @ts-ignore
34884
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
34885
+ yield yield __await(rest);
34886
+ hasMore = Boolean(has_more);
34887
+ pageToken = page_token || next_page_token;
34888
+ }
34889
+ catch (e) {
34890
+ yield yield __await(null);
34891
+ break;
34892
+ }
34893
+ }
34894
+ });
34895
+ },
34896
+ };
34897
+ return Iterable;
34898
+ }),
34899
+ /**
34900
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_tenant&apiName=list&version=v1 click to debug }
34901
+ *
34902
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collaboration_tenant&version=v1 document }
34903
+ *
34904
+ * 在创建规则时,需要知道对方租户的tenant key,为拿到有效的tenant key,这里提供一个专门给管理员获取关联组织租户的接口,该接口可以直接请求到所有关联组织列表。
34905
+ */
34906
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34907
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34908
+ return this.httpInstance
34909
+ .request({
34910
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_tenants`, path),
34911
+ method: "GET",
34912
+ data,
34913
+ params,
34914
+ headers,
34915
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
34916
+ })
34917
+ .catch((e) => {
34918
+ this.logger.error(formatErrors(e));
34919
+ throw e;
34920
+ });
34921
+ }),
34922
+ },
34923
+ /**
34924
+ * collboration_share_entity
34925
+ */
34926
+ collborationShareEntity: {
34927
+ listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34928
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34929
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
34930
+ const res = yield this.httpInstance
34931
+ .request({
34932
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/share_entities`, path),
34933
+ method: "GET",
34934
+ headers: pickBy(innerPayload.headers, identity),
34935
+ params: pickBy(innerPayload.params, identity),
34936
+ data,
34937
+ paramsSerializer: (params) => stringify(params, {
34938
+ arrayFormat: "repeat",
34939
+ }),
34940
+ })
34941
+ .catch((e) => {
34942
+ this.logger.error(formatErrors(e));
34943
+ });
34944
+ return res;
34945
+ });
34946
+ const Iterable = {
34947
+ [Symbol.asyncIterator]() {
34948
+ return __asyncGenerator(this, arguments, function* _a() {
34949
+ let hasMore = true;
34950
+ let pageToken;
34951
+ while (hasMore) {
34952
+ try {
34953
+ const res = yield __await(sendRequest({
34954
+ headers,
34955
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
34956
+ data,
34957
+ }));
34958
+ const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
34959
+ // @ts-ignore
34960
+ has_more,
34961
+ // @ts-ignore
34962
+ page_token,
34963
+ // @ts-ignore
34964
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
34965
+ yield yield __await(rest);
34966
+ hasMore = Boolean(has_more);
34967
+ pageToken = page_token || next_page_token;
34968
+ }
34969
+ catch (e) {
34970
+ yield yield __await(null);
34971
+ break;
34972
+ }
34973
+ }
34974
+ });
34975
+ },
34976
+ };
34977
+ return Iterable;
34978
+ }),
34979
+ /**
34980
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=collboration_share_entity&apiName=list&version=v1 click to debug }
34981
+ *
34982
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collboration_share_entity&version=v1 document }
34983
+ *
34984
+ * 获取双方租户分享的实体ID,完成可见性规则的设置
34985
+ */
34986
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
34987
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
34988
+ return this.httpInstance
34989
+ .request({
34990
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/share_entities`, path),
34991
+ method: "GET",
34992
+ data,
34993
+ params,
34994
+ headers,
34995
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
34996
+ })
34997
+ .catch((e) => {
34998
+ this.logger.error(formatErrors(e));
34999
+ throw e;
35000
+ });
35001
+ }),
35002
+ },
35003
+ /**
35004
+ * department
35005
+ */
35006
+ department: {
35007
+ /**
35008
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=create&version=v1 click to debug }
35009
+ *
35010
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=department&version=v1 document }
35011
+ *
35012
+ * 创建部门信息
35013
+ */
35014
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35015
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35016
+ return this.httpInstance
35017
+ .request({
35018
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments`, path),
35019
+ method: "POST",
35020
+ data,
35021
+ params,
35022
+ headers,
35023
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35024
+ })
35025
+ .catch((e) => {
35026
+ this.logger.error(formatErrors(e));
35027
+ throw e;
35028
+ });
35029
+ }),
35030
+ /**
35031
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=delete&version=v1 click to debug }
35032
+ *
35033
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=department&version=v1 document }
35034
+ *
35035
+ * 删除部门信息
35036
+ */
35037
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35038
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35039
+ return this.httpInstance
35040
+ .request({
35041
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/:department_id`, path),
35042
+ method: "DELETE",
35043
+ data,
35044
+ params,
35045
+ headers,
35046
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35047
+ })
35048
+ .catch((e) => {
35049
+ this.logger.error(formatErrors(e));
35050
+ throw e;
35051
+ });
35052
+ }),
35053
+ /**
35054
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=filter&version=v1 click to debug }
35055
+ *
35056
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=filter&project=directory&resource=department&version=v1 document }
35057
+ *
35058
+ * 查询部门ID列表
35059
+ */
35060
+ filter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35061
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35062
+ return this.httpInstance
35063
+ .request({
35064
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/filter`, path),
35065
+ method: "POST",
35066
+ data,
35067
+ params,
35068
+ headers,
35069
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35070
+ })
35071
+ .catch((e) => {
35072
+ this.logger.error(formatErrors(e));
35073
+ throw e;
35074
+ });
35075
+ }),
35076
+ /**
35077
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=idconvert&version=v1 click to debug }
35078
+ *
35079
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=idconvert&project=directory&resource=department&version=v1 document }
35080
+ */
35081
+ idconvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35082
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35083
+ return this.httpInstance
35084
+ .request({
35085
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/idconvert`, path),
35086
+ method: "POST",
35087
+ data,
35088
+ params,
35089
+ headers,
35090
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35091
+ })
35092
+ .catch((e) => {
35093
+ this.logger.error(formatErrors(e));
35094
+ throw e;
35095
+ });
35096
+ }),
35097
+ /**
35098
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=mget&version=v1 click to debug }
35099
+ *
35100
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=directory&resource=department&version=v1 document }
35101
+ *
35102
+ * 查询部门
35103
+ */
35104
+ mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35105
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35106
+ return this.httpInstance
35107
+ .request({
35108
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/mget`, path),
35109
+ method: "POST",
35110
+ data,
35111
+ params,
35112
+ headers,
35113
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35114
+ })
35115
+ .catch((e) => {
35116
+ this.logger.error(formatErrors(e));
35117
+ throw e;
35118
+ });
35119
+ }),
35120
+ /**
35121
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=patch&version=v1 click to debug }
35122
+ *
35123
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=directory&resource=department&version=v1 document }
35124
+ *
35125
+ * 更新部门信息
35126
+ */
35127
+ patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35128
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35129
+ return this.httpInstance
35130
+ .request({
35131
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/:department_id`, path),
35132
+ method: "PATCH",
35133
+ data,
35134
+ params,
35135
+ headers,
35136
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35137
+ })
35138
+ .catch((e) => {
35139
+ this.logger.error(formatErrors(e));
35140
+ throw e;
35141
+ });
35142
+ }),
35143
+ /**
35144
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=search&version=v1 click to debug }
35145
+ *
35146
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=directory&resource=department&version=v1 document }
35147
+ *
35148
+ * 搜索租户内部门
35149
+ */
35150
+ search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35151
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35152
+ return this.httpInstance
35153
+ .request({
35154
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/search`, path),
35155
+ method: "POST",
35156
+ data,
35157
+ params,
35158
+ headers,
35159
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35160
+ })
35161
+ .catch((e) => {
35162
+ this.logger.error(formatErrors(e));
35163
+ throw e;
35164
+ });
35165
+ }),
35166
+ },
35167
+ /**
35168
+ * employee
35169
+ */
35170
+ employee: {
35171
+ /**
35172
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=create&version=v1 click to debug }
35173
+ *
35174
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=employee&version=v1 document }
35175
+ *
35176
+ * 创建员工信息
35177
+ */
35178
+ create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35179
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35180
+ return this.httpInstance
35181
+ .request({
35182
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees`, path),
35183
+ method: "POST",
35184
+ data,
35185
+ params,
35186
+ headers,
35187
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35188
+ })
35189
+ .catch((e) => {
35190
+ this.logger.error(formatErrors(e));
35191
+ throw e;
35192
+ });
35193
+ }),
35194
+ /**
35195
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=delete&version=v1 click to debug }
35196
+ *
35197
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=employee&version=v1 document }
35198
+ *
35199
+ * 离职员工信息
35200
+ */
35201
+ delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35202
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35203
+ return this.httpInstance
35204
+ .request({
35205
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id`, path),
35206
+ method: "DELETE",
35207
+ data,
35208
+ params,
35209
+ headers,
35210
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35211
+ })
35212
+ .catch((e) => {
35213
+ this.logger.error(formatErrors(e));
35214
+ throw e;
35215
+ });
35216
+ }),
35217
+ /**
35218
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=filter&version=v1 click to debug }
35219
+ *
35220
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=filter&project=directory&resource=employee&version=v1 document }
35221
+ *
35222
+ * 查询员工ID列表
35223
+ */
35224
+ filter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35225
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35226
+ return this.httpInstance
35227
+ .request({
35228
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/filter`, path),
35229
+ method: "POST",
35230
+ data,
35231
+ params,
35232
+ headers,
35233
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35234
+ })
35235
+ .catch((e) => {
35236
+ this.logger.error(formatErrors(e));
35237
+ throw e;
35238
+ });
35239
+ }),
35240
+ /**
35241
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=idconvert&version=v1 click to debug }
35242
+ *
35243
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=idconvert&project=directory&resource=employee&version=v1 document }
35244
+ */
35245
+ idconvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35246
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35247
+ return this.httpInstance
35248
+ .request({
35249
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/idconvert`, path),
35250
+ method: "POST",
35251
+ data,
35252
+ params,
35253
+ headers,
35254
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35255
+ })
35256
+ .catch((e) => {
35257
+ this.logger.error(formatErrors(e));
35258
+ throw e;
35259
+ });
35260
+ }),
35261
+ /**
35262
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=mget&version=v1 click to debug }
35263
+ *
35264
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=directory&resource=employee&version=v1 document }
35265
+ *
35266
+ * 批量获取员工数据
35267
+ */
35268
+ mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35269
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35270
+ return this.httpInstance
35271
+ .request({
35272
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/mget`, path),
35273
+ method: "POST",
35274
+ data,
35275
+ params,
35276
+ headers,
35277
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35278
+ })
35279
+ .catch((e) => {
35280
+ this.logger.error(formatErrors(e));
35281
+ throw e;
35282
+ });
35283
+ }),
35284
+ /**
35285
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=patch&version=v1 click to debug }
35286
+ *
35287
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=directory&resource=employee&version=v1 document }
35288
+ *
35289
+ * 更新员工信息
35290
+ */
35291
+ patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35292
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35293
+ return this.httpInstance
35294
+ .request({
35295
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id`, path),
35296
+ method: "PATCH",
35297
+ data,
35298
+ params,
35299
+ headers,
35300
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35301
+ })
35302
+ .catch((e) => {
35303
+ this.logger.error(formatErrors(e));
35304
+ throw e;
35305
+ });
35306
+ }),
35307
+ /**
35308
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=regular&version=v1 click to debug }
35309
+ *
35310
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=regular&project=directory&resource=employee&version=v1 document }
35311
+ *
35312
+ * 待离职雇员恢复成在职状态
35313
+ */
35314
+ regular: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35315
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35316
+ return this.httpInstance
35317
+ .request({
35318
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`, path),
35319
+ method: "PATCH",
35320
+ data,
35321
+ params,
35322
+ headers,
35323
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35324
+ })
35325
+ .catch((e) => {
35326
+ this.logger.error(formatErrors(e));
35327
+ throw e;
35328
+ });
35329
+ }),
35330
+ /**
35331
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=resurrect&version=v1 click to debug }
35332
+ *
35333
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resurrect&project=directory&resource=employee&version=v1 document }
35334
+ *
35335
+ * 恢复员工信息
35336
+ */
35337
+ resurrect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35338
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35339
+ return this.httpInstance
35340
+ .request({
35341
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`, path),
35342
+ method: "POST",
35343
+ data,
35344
+ params,
35345
+ headers,
35346
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35347
+ })
35348
+ .catch((e) => {
35349
+ this.logger.error(formatErrors(e));
35350
+ throw e;
35351
+ });
35352
+ }),
35353
+ /**
35354
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=search&version=v1 click to debug }
35355
+ *
35356
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=directory&resource=employee&version=v1 document }
35357
+ *
35358
+ * 搜索租户内员工
35359
+ */
35360
+ search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35361
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35362
+ return this.httpInstance
35363
+ .request({
35364
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/search`, path),
35365
+ method: "POST",
35366
+ data,
35367
+ params,
35368
+ headers,
35369
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35370
+ })
35371
+ .catch((e) => {
35372
+ this.logger.error(formatErrors(e));
35373
+ throw e;
35374
+ });
35375
+ }),
35376
+ /**
35377
+ * {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=to_be_resigned&version=v1 click to debug }
35378
+ *
35379
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=to_be_resigned&project=directory&resource=employee&version=v1 document }
35380
+ *
35381
+ * 更新在职雇员到待离职状态
35382
+ */
35383
+ toBeResigned: (payload, options) => __awaiter(this, void 0, void 0, function* () {
35384
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
35385
+ return this.httpInstance
35386
+ .request({
35387
+ url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`, path),
35388
+ method: "PATCH",
35389
+ data,
35390
+ params,
35391
+ headers,
35392
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
35393
+ })
35394
+ .catch((e) => {
35395
+ this.logger.error(formatErrors(e));
35396
+ throw e;
35397
+ });
35398
+ }),
35399
+ },
35400
+ },
35401
+ };
35402
+ }
35403
+ }
35404
+
34238
35405
  // auto gen
34239
35406
  class Client$K extends Client$L {
34240
35407
  constructor() {
@@ -36520,7 +37687,7 @@ class Client$G extends Client$H {
36520
37687
  }),
36521
37688
  },
36522
37689
  /**
36523
- * 异步任务状态
37690
+ * 下载
36524
37691
  */
36525
37692
  file: {
36526
37693
  /**
@@ -38340,7 +39507,7 @@ class Client$G extends Client$H {
38340
39507
  }),
38341
39508
  },
38342
39509
  /**
38343
- * 异步任务状态
39510
+ * 下载
38344
39511
  */
38345
39512
  file: {
38346
39513
  /**
@@ -65375,6 +66542,64 @@ class Client$s extends Client$t {
65375
66542
  }),
65376
66543
  },
65377
66544
  },
66545
+ v3: {
66546
+ /**
66547
+ * batch_country_region
66548
+ */
66549
+ batchCountryRegion: {
66550
+ /**
66551
+ * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=batch_country_region&apiName=get&version=v3 click to debug }
66552
+ *
66553
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=mdm&resource=batch_country_region&version=v3 document }
66554
+ *
66555
+ * 查询国家 / 地区
66556
+ */
66557
+ get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
66558
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
66559
+ return this.httpInstance
66560
+ .request({
66561
+ url: fillApiPath(`${this.domain}/open-apis/mdm/v3/batch_country_region`, path),
66562
+ method: "GET",
66563
+ data,
66564
+ params,
66565
+ headers,
66566
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
66567
+ })
66568
+ .catch((e) => {
66569
+ this.logger.error(formatErrors(e));
66570
+ throw e;
66571
+ });
66572
+ }),
66573
+ },
66574
+ /**
66575
+ * country_region
66576
+ */
66577
+ countryRegion: {
66578
+ /**
66579
+ * {@link https://open.feishu.cn/api-explorer?project=mdm&resource=country_region&apiName=list&version=v3 click to debug }
66580
+ *
66581
+ * {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mdm&resource=country_region&version=v3 document }
66582
+ *
66583
+ * 搜索国家 / 地区
66584
+ */
66585
+ list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
66586
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
66587
+ return this.httpInstance
66588
+ .request({
66589
+ url: fillApiPath(`${this.domain}/open-apis/mdm/v3/country_regions`, path),
66590
+ method: "GET",
66591
+ data,
66592
+ params,
66593
+ headers,
66594
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
66595
+ })
66596
+ .catch((e) => {
66597
+ this.logger.error(formatErrors(e));
66598
+ throw e;
66599
+ });
66600
+ }),
66601
+ },
66602
+ },
65378
66603
  };
65379
66604
  }
65380
66605
  }
@@ -78505,9 +79730,6 @@ class Client$2 extends Client$3 {
78505
79730
  * 云文档-知识库
78506
79731
  */
78507
79732
  this.wiki = {
78508
- /**
78509
- * 知识空间
78510
- */
78511
79733
  space: {
78512
79734
  /**
78513
79735
  * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=create&version=v2 click to debug }
@@ -78668,9 +79890,6 @@ class Client$2 extends Client$3 {
78668
79890
  });
78669
79891
  }),
78670
79892
  },
78671
- /**
78672
- * 空间成员
78673
- */
78674
79893
  spaceMember: {
78675
79894
  /**
78676
79895
  * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=create&version=v2 click to debug }
@@ -78748,9 +79967,6 @@ class Client$2 extends Client$3 {
78748
79967
  });
78749
79968
  }),
78750
79969
  },
78751
- /**
78752
- * 节点
78753
- */
78754
79970
  spaceNode: {
78755
79971
  /**
78756
79972
  * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=copy&version=v2 click to debug }
@@ -78965,9 +80181,6 @@ class Client$2 extends Client$3 {
78965
80181
  });
78966
80182
  }),
78967
80183
  },
78968
- /**
78969
- * 空间设置
78970
- */
78971
80184
  spaceSetting: {
78972
80185
  /**
78973
80186
  * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.setting&apiName=update&version=v2 click to debug }
@@ -78997,9 +80210,6 @@ class Client$2 extends Client$3 {
78997
80210
  });
78998
80211
  }),
78999
80212
  },
79000
- /**
79001
- * 云文档
79002
- */
79003
80213
  task: {
79004
80214
  /**
79005
80215
  * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=task&apiName=get&version=v2 click to debug }
@@ -79029,6 +80239,86 @@ class Client$2 extends Client$3 {
79029
80239
  });
79030
80240
  }),
79031
80241
  },
80242
+ v1: {
80243
+ /**
80244
+ * 知识库
80245
+ */
80246
+ node: {
80247
+ searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
80248
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
80249
+ const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
80250
+ const res = yield this.httpInstance
80251
+ .request({
80252
+ url: fillApiPath(`${this.domain}/open-apis/wiki/v1/nodes/search`, path),
80253
+ method: "POST",
80254
+ headers: pickBy(innerPayload.headers, identity),
80255
+ params: pickBy(innerPayload.params, identity),
80256
+ data,
80257
+ paramsSerializer: (params) => stringify(params, {
80258
+ arrayFormat: "repeat",
80259
+ }),
80260
+ })
80261
+ .catch((e) => {
80262
+ this.logger.error(formatErrors(e));
80263
+ });
80264
+ return res;
80265
+ });
80266
+ const Iterable = {
80267
+ [Symbol.asyncIterator]() {
80268
+ return __asyncGenerator(this, arguments, function* _a() {
80269
+ let hasMore = true;
80270
+ let pageToken;
80271
+ while (hasMore) {
80272
+ try {
80273
+ const res = yield __await(sendRequest({
80274
+ headers,
80275
+ params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
80276
+ data,
80277
+ }));
80278
+ const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
80279
+ // @ts-ignore
80280
+ has_more,
80281
+ // @ts-ignore
80282
+ page_token,
80283
+ // @ts-ignore
80284
+ next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
80285
+ yield yield __await(rest);
80286
+ hasMore = Boolean(has_more);
80287
+ pageToken = page_token || next_page_token;
80288
+ }
80289
+ catch (e) {
80290
+ yield yield __await(null);
80291
+ break;
80292
+ }
80293
+ }
80294
+ });
80295
+ },
80296
+ };
80297
+ return Iterable;
80298
+ }),
80299
+ /**
80300
+ * {@link https://open.feishu.cn/api-explorer?project=wiki&resource=node&apiName=search&version=v1 click to debug }
80301
+ *
80302
+ * {@link https://open.feishu.cn/document/ukTMukTMukTM/uEzN0YjLxcDN24SM3QjN/search_wiki document }
80303
+ */
80304
+ search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
80305
+ const { headers, params, data, path } = yield this.formatPayload(payload, options);
80306
+ return this.httpInstance
80307
+ .request({
80308
+ url: fillApiPath(`${this.domain}/open-apis/wiki/v1/nodes/search`, path),
80309
+ method: "POST",
80310
+ data,
80311
+ params,
80312
+ headers,
80313
+ paramsSerializer: (params) => stringify(params, { arrayFormat: "repeat" }),
80314
+ })
80315
+ .catch((e) => {
80316
+ this.logger.error(formatErrors(e));
80317
+ throw e;
80318
+ });
80319
+ }),
80320
+ },
80321
+ },
79032
80322
  v2: {
79033
80323
  /**
79034
80324
  * 知识空间
@@ -81540,8 +82830,6 @@ class WSClient {
81540
82830
  return Promise.resolve(true);
81541
82831
  }
81542
82832
  return Promise.resolve(false);
81543
- }).finally(() => {
81544
- this.isConnecting = false;
81545
82833
  });
81546
82834
  };
81547
82835
  if (this.pingInterval) {
@@ -81552,7 +82840,16 @@ class WSClient {
81552
82840
  if (wsInstance) {
81553
82841
  wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.terminate();
81554
82842
  }
81555
- const isSuccess = yield tryConnect();
82843
+ if (this.reconnectInterval) {
82844
+ clearTimeout(this.reconnectInterval);
82845
+ }
82846
+ let isSuccess = false;
82847
+ try {
82848
+ isSuccess = yield tryConnect();
82849
+ }
82850
+ finally {
82851
+ this.isConnecting = false;
82852
+ }
81556
82853
  if (!isSuccess) {
81557
82854
  this.logger.error('[ws]', 'connect failed');
81558
82855
  yield this.reConnect();
@@ -81569,7 +82866,7 @@ class WSClient {
81569
82866
  wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.terminate();
81570
82867
  }
81571
82868
  this.wsConfig.setWSInstance(null);
81572
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
82869
+ this.reconnectInterval = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
81573
82870
  (function loopReConnect(count) {
81574
82871
  return __awaiter(this, void 0, void 0, function* () {
81575
82872
  count++;
@@ -81577,13 +82874,15 @@ class WSClient {
81577
82874
  // if reconnectCount < 0, the reconnect time is infinite
81578
82875
  if (isSuccess) {
81579
82876
  this.logger.debug('[ws]', 'reconnect success');
82877
+ this.isConnecting = false;
81580
82878
  return;
81581
82879
  }
81582
82880
  this.logger.info('ws', `unable to connect to the server after trying ${count} times")`);
81583
82881
  if (reconnectCount >= 0 && count >= reconnectCount) {
82882
+ this.isConnecting = false;
81584
82883
  return;
81585
82884
  }
81586
- setTimeout(() => {
82885
+ this.reconnectInterval = setTimeout(() => {
81587
82886
  loopReConnect.bind(this)(count);
81588
82887
  }, reconnectInterval);
81589
82888
  });