@larksuiteoapi/node-sdk 1.48.0-alpha.2 → 1.48.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 +1455 -162
- package/lib/index.js +1455 -162
- package/package.json +1 -1
- package/types/index.d.ts +6997 -812
package/lib/index.js
CHANGED
|
@@ -271,7 +271,7 @@ const formatErrors = (e) => {
|
|
|
271
271
|
};
|
|
272
272
|
|
|
273
273
|
// auto gen
|
|
274
|
-
class Client$
|
|
274
|
+
class Client$16 {
|
|
275
275
|
constructor() {
|
|
276
276
|
/**
|
|
277
277
|
* 智能门禁
|
|
@@ -1328,11 +1328,11 @@ class Client$14 {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
|
|
1330
1330
|
// auto gen
|
|
1331
|
-
class Client$
|
|
1331
|
+
class Client$15 extends Client$16 {
|
|
1332
1332
|
constructor() {
|
|
1333
1333
|
super(...arguments);
|
|
1334
1334
|
/**
|
|
1335
|
-
*
|
|
1335
|
+
* 管理后台-数据报表
|
|
1336
1336
|
*/
|
|
1337
1337
|
this.admin = {
|
|
1338
1338
|
/**
|
|
@@ -2424,7 +2424,7 @@ class Client$13 extends Client$14 {
|
|
|
2424
2424
|
}
|
|
2425
2425
|
|
|
2426
2426
|
// auto gen
|
|
2427
|
-
class Client$
|
|
2427
|
+
class Client$14 extends Client$15 {
|
|
2428
2428
|
constructor() {
|
|
2429
2429
|
super(...arguments);
|
|
2430
2430
|
/**
|
|
@@ -2808,6 +2808,75 @@ class Client$12 extends Client$13 {
|
|
|
2808
2808
|
* app.data_asset
|
|
2809
2809
|
*/
|
|
2810
2810
|
appDataAsset: {
|
|
2811
|
+
/**
|
|
2812
|
+
* {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=create&version=v1 click to debug }
|
|
2813
|
+
*
|
|
2814
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=aily&resource=app.data_asset&version=v1 document }
|
|
2815
|
+
*
|
|
2816
|
+
* 创建数据知识
|
|
2817
|
+
*/
|
|
2818
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
2819
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
2820
|
+
return this.httpInstance
|
|
2821
|
+
.request({
|
|
2822
|
+
url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets`, path),
|
|
2823
|
+
method: "POST",
|
|
2824
|
+
data,
|
|
2825
|
+
params,
|
|
2826
|
+
headers,
|
|
2827
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
2828
|
+
})
|
|
2829
|
+
.catch((e) => {
|
|
2830
|
+
this.logger.error(formatErrors(e));
|
|
2831
|
+
throw e;
|
|
2832
|
+
});
|
|
2833
|
+
}),
|
|
2834
|
+
/**
|
|
2835
|
+
* {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=delete&version=v1 click to debug }
|
|
2836
|
+
*
|
|
2837
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=aily&resource=app.data_asset&version=v1 document }
|
|
2838
|
+
*
|
|
2839
|
+
* 删除数据知识
|
|
2840
|
+
*/
|
|
2841
|
+
delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
2842
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
2843
|
+
return this.httpInstance
|
|
2844
|
+
.request({
|
|
2845
|
+
url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`, path),
|
|
2846
|
+
method: "DELETE",
|
|
2847
|
+
data,
|
|
2848
|
+
params,
|
|
2849
|
+
headers,
|
|
2850
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
2851
|
+
})
|
|
2852
|
+
.catch((e) => {
|
|
2853
|
+
this.logger.error(formatErrors(e));
|
|
2854
|
+
throw e;
|
|
2855
|
+
});
|
|
2856
|
+
}),
|
|
2857
|
+
/**
|
|
2858
|
+
* {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=get&version=v1 click to debug }
|
|
2859
|
+
*
|
|
2860
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=aily&resource=app.data_asset&version=v1 document }
|
|
2861
|
+
*
|
|
2862
|
+
* 获取数据知识
|
|
2863
|
+
*/
|
|
2864
|
+
get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
2865
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
2866
|
+
return this.httpInstance
|
|
2867
|
+
.request({
|
|
2868
|
+
url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/:data_asset_id`, path),
|
|
2869
|
+
method: "GET",
|
|
2870
|
+
data,
|
|
2871
|
+
params,
|
|
2872
|
+
headers,
|
|
2873
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
2874
|
+
})
|
|
2875
|
+
.catch((e) => {
|
|
2876
|
+
this.logger.error(formatErrors(e));
|
|
2877
|
+
throw e;
|
|
2878
|
+
});
|
|
2879
|
+
}),
|
|
2811
2880
|
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
2812
2881
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
2813
2882
|
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -2883,6 +2952,30 @@ class Client$12 extends Client$13 {
|
|
|
2883
2952
|
throw e;
|
|
2884
2953
|
});
|
|
2885
2954
|
}),
|
|
2955
|
+
/**
|
|
2956
|
+
* {@link https://open.feishu.cn/api-explorer?project=aily&resource=app.data_asset&apiName=upload_file&version=v1 click to debug }
|
|
2957
|
+
*
|
|
2958
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=upload_file&project=aily&resource=app.data_asset&version=v1 document }
|
|
2959
|
+
*
|
|
2960
|
+
* 上传数据知识文件
|
|
2961
|
+
*/
|
|
2962
|
+
uploadFile: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
2963
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
2964
|
+
const res = yield this.httpInstance
|
|
2965
|
+
.request({
|
|
2966
|
+
url: fillApiPath(`${this.domain}/open-apis/aily/v1/apps/:app_id/data_assets/upload_file`, path),
|
|
2967
|
+
method: "POST",
|
|
2968
|
+
data,
|
|
2969
|
+
params,
|
|
2970
|
+
headers: Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" }),
|
|
2971
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
2972
|
+
})
|
|
2973
|
+
.catch((e) => {
|
|
2974
|
+
this.logger.error(formatErrors(e));
|
|
2975
|
+
throw e;
|
|
2976
|
+
});
|
|
2977
|
+
return (res === null || res === void 0 ? void 0 : res.data) || null;
|
|
2978
|
+
}),
|
|
2886
2979
|
},
|
|
2887
2980
|
/**
|
|
2888
2981
|
* app.data_asset_tag
|
|
@@ -3124,7 +3217,7 @@ class Client$12 extends Client$13 {
|
|
|
3124
3217
|
}
|
|
3125
3218
|
|
|
3126
3219
|
// auto gen
|
|
3127
|
-
class Client$
|
|
3220
|
+
class Client$13 extends Client$14 {
|
|
3128
3221
|
constructor() {
|
|
3129
3222
|
super(...arguments);
|
|
3130
3223
|
/**
|
|
@@ -4105,7 +4198,7 @@ class Client$11 extends Client$12 {
|
|
|
4105
4198
|
}
|
|
4106
4199
|
|
|
4107
4200
|
// auto gen
|
|
4108
|
-
class Client$
|
|
4201
|
+
class Client$12 extends Client$13 {
|
|
4109
4202
|
constructor() {
|
|
4110
4203
|
super(...arguments);
|
|
4111
4204
|
/**
|
|
@@ -5825,7 +5918,7 @@ class Client$10 extends Client$11 {
|
|
|
5825
5918
|
}
|
|
5826
5919
|
|
|
5827
5920
|
// auto gen
|
|
5828
|
-
class Client
|
|
5921
|
+
class Client$11 extends Client$12 {
|
|
5829
5922
|
constructor() {
|
|
5830
5923
|
super(...arguments);
|
|
5831
5924
|
/**
|
|
@@ -5833,7 +5926,7 @@ class Client$$ extends Client$10 {
|
|
|
5833
5926
|
*/
|
|
5834
5927
|
this.approval = {
|
|
5835
5928
|
/**
|
|
5836
|
-
*
|
|
5929
|
+
* 原生审批定义
|
|
5837
5930
|
*/
|
|
5838
5931
|
approval: {
|
|
5839
5932
|
/**
|
|
@@ -6128,7 +6221,7 @@ class Client$$ extends Client$10 {
|
|
|
6128
6221
|
}),
|
|
6129
6222
|
},
|
|
6130
6223
|
/**
|
|
6131
|
-
*
|
|
6224
|
+
* 原生审批实例
|
|
6132
6225
|
*/
|
|
6133
6226
|
instance: {
|
|
6134
6227
|
/**
|
|
@@ -6630,7 +6723,7 @@ class Client$$ extends Client$10 {
|
|
|
6630
6723
|
}),
|
|
6631
6724
|
},
|
|
6632
6725
|
/**
|
|
6633
|
-
*
|
|
6726
|
+
* 原生审批任务
|
|
6634
6727
|
*/
|
|
6635
6728
|
task: {
|
|
6636
6729
|
/**
|
|
@@ -6836,7 +6929,7 @@ class Client$$ extends Client$10 {
|
|
|
6836
6929
|
},
|
|
6837
6930
|
v4: {
|
|
6838
6931
|
/**
|
|
6839
|
-
*
|
|
6932
|
+
* 原生审批定义
|
|
6840
6933
|
*/
|
|
6841
6934
|
approval: {
|
|
6842
6935
|
/**
|
|
@@ -7133,7 +7226,7 @@ class Client$$ extends Client$10 {
|
|
|
7133
7226
|
}),
|
|
7134
7227
|
},
|
|
7135
7228
|
/**
|
|
7136
|
-
*
|
|
7229
|
+
* 原生审批实例
|
|
7137
7230
|
*/
|
|
7138
7231
|
instance: {
|
|
7139
7232
|
/**
|
|
@@ -7641,7 +7734,7 @@ class Client$$ extends Client$10 {
|
|
|
7641
7734
|
}),
|
|
7642
7735
|
},
|
|
7643
7736
|
/**
|
|
7644
|
-
*
|
|
7737
|
+
* 原生审批任务
|
|
7645
7738
|
*/
|
|
7646
7739
|
task: {
|
|
7647
7740
|
/**
|
|
@@ -7853,7 +7946,7 @@ class Client$$ extends Client$10 {
|
|
|
7853
7946
|
}
|
|
7854
7947
|
|
|
7855
7948
|
// auto gen
|
|
7856
|
-
class Client$
|
|
7949
|
+
class Client$10 extends Client$11 {
|
|
7857
7950
|
constructor() {
|
|
7858
7951
|
super(...arguments);
|
|
7859
7952
|
/**
|
|
@@ -10307,7 +10400,7 @@ class Client$_ extends Client$$ {
|
|
|
10307
10400
|
}
|
|
10308
10401
|
|
|
10309
10402
|
// auto gen
|
|
10310
|
-
class Client
|
|
10403
|
+
class Client$$ extends Client$10 {
|
|
10311
10404
|
constructor() {
|
|
10312
10405
|
super(...arguments);
|
|
10313
10406
|
/**
|
|
@@ -10561,7 +10654,7 @@ class Client$Z extends Client$_ {
|
|
|
10561
10654
|
}
|
|
10562
10655
|
|
|
10563
10656
|
// auto gen
|
|
10564
|
-
class Client$
|
|
10657
|
+
class Client$_ extends Client$$ {
|
|
10565
10658
|
constructor() {
|
|
10566
10659
|
super(...arguments);
|
|
10567
10660
|
/**
|
|
@@ -10835,7 +10928,7 @@ class Client$Y extends Client$Z {
|
|
|
10835
10928
|
}
|
|
10836
10929
|
|
|
10837
10930
|
// auto gen
|
|
10838
|
-
class Client$
|
|
10931
|
+
class Client$Z extends Client$_ {
|
|
10839
10932
|
constructor() {
|
|
10840
10933
|
super(...arguments);
|
|
10841
10934
|
/**
|
|
@@ -10846,7 +10939,7 @@ class Client$X extends Client$Y {
|
|
|
10846
10939
|
}
|
|
10847
10940
|
|
|
10848
10941
|
// auto gen
|
|
10849
|
-
class Client$
|
|
10942
|
+
class Client$Y extends Client$Z {
|
|
10850
10943
|
constructor() {
|
|
10851
10944
|
super(...arguments);
|
|
10852
10945
|
/**
|
|
@@ -11924,7 +12017,147 @@ class Client$W extends Client$X {
|
|
|
11924
12017
|
}
|
|
11925
12018
|
|
|
11926
12019
|
// auto gen
|
|
11927
|
-
class Client$
|
|
12020
|
+
class Client$X extends Client$Y {
|
|
12021
|
+
constructor() {
|
|
12022
|
+
super(...arguments);
|
|
12023
|
+
/**
|
|
12024
|
+
|
|
12025
|
+
*/
|
|
12026
|
+
this.base = {
|
|
12027
|
+
v2: {
|
|
12028
|
+
/**
|
|
12029
|
+
* app.role
|
|
12030
|
+
*/
|
|
12031
|
+
appRole: {
|
|
12032
|
+
/**
|
|
12033
|
+
* {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=create&version=v2 click to debug }
|
|
12034
|
+
*
|
|
12035
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=base&resource=app.role&version=v2 document }
|
|
12036
|
+
*
|
|
12037
|
+
* 新增自定义角色
|
|
12038
|
+
*/
|
|
12039
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
12040
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
12041
|
+
return this.httpInstance
|
|
12042
|
+
.request({
|
|
12043
|
+
url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path),
|
|
12044
|
+
method: "POST",
|
|
12045
|
+
data,
|
|
12046
|
+
params,
|
|
12047
|
+
headers,
|
|
12048
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
12049
|
+
})
|
|
12050
|
+
.catch((e) => {
|
|
12051
|
+
this.logger.error(formatErrors(e));
|
|
12052
|
+
throw e;
|
|
12053
|
+
});
|
|
12054
|
+
}),
|
|
12055
|
+
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
12056
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
12057
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
12058
|
+
const res = yield this.httpInstance
|
|
12059
|
+
.request({
|
|
12060
|
+
url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path),
|
|
12061
|
+
method: "GET",
|
|
12062
|
+
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
12063
|
+
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
12064
|
+
data,
|
|
12065
|
+
paramsSerializer: (params) => qs.stringify(params, {
|
|
12066
|
+
arrayFormat: "repeat",
|
|
12067
|
+
}),
|
|
12068
|
+
})
|
|
12069
|
+
.catch((e) => {
|
|
12070
|
+
this.logger.error(formatErrors(e));
|
|
12071
|
+
});
|
|
12072
|
+
return res;
|
|
12073
|
+
});
|
|
12074
|
+
const Iterable = {
|
|
12075
|
+
[Symbol.asyncIterator]() {
|
|
12076
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
12077
|
+
let hasMore = true;
|
|
12078
|
+
let pageToken;
|
|
12079
|
+
while (hasMore) {
|
|
12080
|
+
try {
|
|
12081
|
+
const res = yield __await(sendRequest({
|
|
12082
|
+
headers,
|
|
12083
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
12084
|
+
data,
|
|
12085
|
+
}));
|
|
12086
|
+
const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
|
|
12087
|
+
// @ts-ignore
|
|
12088
|
+
has_more,
|
|
12089
|
+
// @ts-ignore
|
|
12090
|
+
page_token,
|
|
12091
|
+
// @ts-ignore
|
|
12092
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
12093
|
+
yield yield __await(rest);
|
|
12094
|
+
hasMore = Boolean(has_more);
|
|
12095
|
+
pageToken = page_token || next_page_token;
|
|
12096
|
+
}
|
|
12097
|
+
catch (e) {
|
|
12098
|
+
yield yield __await(null);
|
|
12099
|
+
break;
|
|
12100
|
+
}
|
|
12101
|
+
}
|
|
12102
|
+
});
|
|
12103
|
+
},
|
|
12104
|
+
};
|
|
12105
|
+
return Iterable;
|
|
12106
|
+
}),
|
|
12107
|
+
/**
|
|
12108
|
+
* {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=list&version=v2 click to debug }
|
|
12109
|
+
*
|
|
12110
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=base&resource=app.role&version=v2 document }
|
|
12111
|
+
*
|
|
12112
|
+
* 列出自定义角色
|
|
12113
|
+
*/
|
|
12114
|
+
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
12115
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
12116
|
+
return this.httpInstance
|
|
12117
|
+
.request({
|
|
12118
|
+
url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles`, path),
|
|
12119
|
+
method: "GET",
|
|
12120
|
+
data,
|
|
12121
|
+
params,
|
|
12122
|
+
headers,
|
|
12123
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
12124
|
+
})
|
|
12125
|
+
.catch((e) => {
|
|
12126
|
+
this.logger.error(formatErrors(e));
|
|
12127
|
+
throw e;
|
|
12128
|
+
});
|
|
12129
|
+
}),
|
|
12130
|
+
/**
|
|
12131
|
+
* {@link https://open.feishu.cn/api-explorer?project=base&resource=app.role&apiName=update&version=v2 click to debug }
|
|
12132
|
+
*
|
|
12133
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=base&resource=app.role&version=v2 document }
|
|
12134
|
+
*
|
|
12135
|
+
* 更新自定义角色
|
|
12136
|
+
*/
|
|
12137
|
+
update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
12138
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
12139
|
+
return this.httpInstance
|
|
12140
|
+
.request({
|
|
12141
|
+
url: fillApiPath(`${this.domain}/open-apis/base/v2/apps/:app_token/roles/:role_id`, path),
|
|
12142
|
+
method: "PUT",
|
|
12143
|
+
data,
|
|
12144
|
+
params,
|
|
12145
|
+
headers,
|
|
12146
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
12147
|
+
})
|
|
12148
|
+
.catch((e) => {
|
|
12149
|
+
this.logger.error(formatErrors(e));
|
|
12150
|
+
throw e;
|
|
12151
|
+
});
|
|
12152
|
+
}),
|
|
12153
|
+
},
|
|
12154
|
+
},
|
|
12155
|
+
};
|
|
12156
|
+
}
|
|
12157
|
+
}
|
|
12158
|
+
|
|
12159
|
+
// auto gen
|
|
12160
|
+
class Client$W extends Client$X {
|
|
11928
12161
|
constructor() {
|
|
11929
12162
|
super(...arguments);
|
|
11930
12163
|
/**
|
|
@@ -15436,7 +15669,7 @@ class Client$V extends Client$W {
|
|
|
15436
15669
|
}
|
|
15437
15670
|
|
|
15438
15671
|
// auto gen
|
|
15439
|
-
class Client$
|
|
15672
|
+
class Client$V extends Client$W {
|
|
15440
15673
|
constructor() {
|
|
15441
15674
|
super(...arguments);
|
|
15442
15675
|
/**
|
|
@@ -15620,7 +15853,7 @@ class Client$U extends Client$V {
|
|
|
15620
15853
|
}
|
|
15621
15854
|
|
|
15622
15855
|
// auto gen
|
|
15623
|
-
class Client$
|
|
15856
|
+
class Client$U extends Client$V {
|
|
15624
15857
|
constructor() {
|
|
15625
15858
|
super(...arguments);
|
|
15626
15859
|
/**
|
|
@@ -15717,7 +15950,7 @@ class Client$T extends Client$U {
|
|
|
15717
15950
|
}
|
|
15718
15951
|
|
|
15719
15952
|
// auto gen
|
|
15720
|
-
class Client$
|
|
15953
|
+
class Client$T extends Client$U {
|
|
15721
15954
|
constructor() {
|
|
15722
15955
|
super(...arguments);
|
|
15723
15956
|
/**
|
|
@@ -18457,7 +18690,7 @@ class Client$S extends Client$T {
|
|
|
18457
18690
|
}
|
|
18458
18691
|
|
|
18459
18692
|
// auto gen
|
|
18460
|
-
class Client$
|
|
18693
|
+
class Client$S extends Client$T {
|
|
18461
18694
|
constructor() {
|
|
18462
18695
|
super(...arguments);
|
|
18463
18696
|
/**
|
|
@@ -18711,7 +18944,7 @@ class Client$R extends Client$S {
|
|
|
18711
18944
|
}
|
|
18712
18945
|
|
|
18713
18946
|
// auto gen
|
|
18714
|
-
class Client$
|
|
18947
|
+
class Client$R extends Client$S {
|
|
18715
18948
|
constructor() {
|
|
18716
18949
|
super(...arguments);
|
|
18717
18950
|
/**
|
|
@@ -18722,7 +18955,7 @@ class Client$Q extends Client$R {
|
|
|
18722
18955
|
}
|
|
18723
18956
|
|
|
18724
18957
|
// auto gen
|
|
18725
|
-
class Client$
|
|
18958
|
+
class Client$Q extends Client$R {
|
|
18726
18959
|
constructor() {
|
|
18727
18960
|
super(...arguments);
|
|
18728
18961
|
/**
|
|
@@ -19152,7 +19385,7 @@ class Client$P extends Client$Q {
|
|
|
19152
19385
|
}
|
|
19153
19386
|
|
|
19154
19387
|
// auto gen
|
|
19155
|
-
class Client$
|
|
19388
|
+
class Client$P extends Client$Q {
|
|
19156
19389
|
constructor() {
|
|
19157
19390
|
super(...arguments);
|
|
19158
19391
|
/**
|
|
@@ -24180,7 +24413,7 @@ class Client$O extends Client$P {
|
|
|
24180
24413
|
}
|
|
24181
24414
|
|
|
24182
24415
|
// auto gen
|
|
24183
|
-
class Client$
|
|
24416
|
+
class Client$O extends Client$P {
|
|
24184
24417
|
constructor() {
|
|
24185
24418
|
super(...arguments);
|
|
24186
24419
|
/**
|
|
@@ -24191,7 +24424,7 @@ class Client$N extends Client$O {
|
|
|
24191
24424
|
}
|
|
24192
24425
|
|
|
24193
24426
|
// auto gen
|
|
24194
|
-
class Client$
|
|
24427
|
+
class Client$N extends Client$O {
|
|
24195
24428
|
constructor() {
|
|
24196
24429
|
super(...arguments);
|
|
24197
24430
|
/**
|
|
@@ -24202,7 +24435,7 @@ class Client$M extends Client$N {
|
|
|
24202
24435
|
}
|
|
24203
24436
|
|
|
24204
24437
|
// auto gen
|
|
24205
|
-
class Client$
|
|
24438
|
+
class Client$M extends Client$N {
|
|
24206
24439
|
constructor() {
|
|
24207
24440
|
super(...arguments);
|
|
24208
24441
|
/**
|
|
@@ -31435,61 +31668,21 @@ class Client$L extends Client$M {
|
|
|
31435
31668
|
}),
|
|
31436
31669
|
},
|
|
31437
31670
|
/**
|
|
31438
|
-
*
|
|
31671
|
+
* custom_org
|
|
31439
31672
|
*/
|
|
31440
|
-
|
|
31673
|
+
customOrg: {
|
|
31441
31674
|
/**
|
|
31442
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=
|
|
31675
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=active&version=v2 click to debug }
|
|
31443
31676
|
*
|
|
31444
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=
|
|
31445
|
-
*/
|
|
31446
|
-
batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31447
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31448
|
-
return this.httpInstance
|
|
31449
|
-
.request({
|
|
31450
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`, path),
|
|
31451
|
-
method: "POST",
|
|
31452
|
-
data,
|
|
31453
|
-
params,
|
|
31454
|
-
headers,
|
|
31455
|
-
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31456
|
-
})
|
|
31457
|
-
.catch((e) => {
|
|
31458
|
-
this.logger.error(formatErrors(e));
|
|
31459
|
-
throw e;
|
|
31460
|
-
});
|
|
31461
|
-
}),
|
|
31462
|
-
/**
|
|
31463
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=create_version&version=v2 click to debug }
|
|
31677
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=active&project=corehr&resource=custom_org&version=v2 document }
|
|
31464
31678
|
*
|
|
31465
|
-
*
|
|
31679
|
+
* 启/停用自定义组织
|
|
31466
31680
|
*/
|
|
31467
|
-
|
|
31468
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31469
|
-
return this.httpInstance
|
|
31470
|
-
.request({
|
|
31471
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`, path),
|
|
31472
|
-
method: "POST",
|
|
31473
|
-
data,
|
|
31474
|
-
params,
|
|
31475
|
-
headers,
|
|
31476
|
-
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31477
|
-
})
|
|
31478
|
-
.catch((e) => {
|
|
31479
|
-
this.logger.error(formatErrors(e));
|
|
31480
|
-
throw e;
|
|
31481
|
-
});
|
|
31482
|
-
}),
|
|
31483
|
-
/**
|
|
31484
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=remove_version&version=v2 click to debug }
|
|
31485
|
-
*
|
|
31486
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_version&project=corehr&resource=default_cost_center&version=v2 document }
|
|
31487
|
-
*/
|
|
31488
|
-
removeVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31681
|
+
active: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31489
31682
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31490
31683
|
return this.httpInstance
|
|
31491
31684
|
.request({
|
|
31492
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/
|
|
31685
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/active`, path),
|
|
31493
31686
|
method: "POST",
|
|
31494
31687
|
data,
|
|
31495
31688
|
params,
|
|
@@ -31502,41 +31695,15 @@ class Client$L extends Client$M {
|
|
|
31502
31695
|
});
|
|
31503
31696
|
}),
|
|
31504
31697
|
/**
|
|
31505
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=
|
|
31698
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=create&version=v2 click to debug }
|
|
31506
31699
|
*
|
|
31507
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=
|
|
31700
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=corehr&resource=custom_org&version=v2 document }
|
|
31508
31701
|
*/
|
|
31509
|
-
|
|
31510
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31511
|
-
return this.httpInstance
|
|
31512
|
-
.request({
|
|
31513
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`, path),
|
|
31514
|
-
method: "POST",
|
|
31515
|
-
data,
|
|
31516
|
-
params,
|
|
31517
|
-
headers,
|
|
31518
|
-
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31519
|
-
})
|
|
31520
|
-
.catch((e) => {
|
|
31521
|
-
this.logger.error(formatErrors(e));
|
|
31522
|
-
throw e;
|
|
31523
|
-
});
|
|
31524
|
-
}),
|
|
31525
|
-
},
|
|
31526
|
-
/**
|
|
31527
|
-
* department
|
|
31528
|
-
*/
|
|
31529
|
-
department: {
|
|
31530
|
-
/**
|
|
31531
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=batch_get&version=v2 click to debug }
|
|
31532
|
-
*
|
|
31533
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=department&version=v2 document }
|
|
31534
|
-
*/
|
|
31535
|
-
batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31702
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31536
31703
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31537
31704
|
return this.httpInstance
|
|
31538
31705
|
.request({
|
|
31539
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/
|
|
31706
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs`, path),
|
|
31540
31707
|
method: "POST",
|
|
31541
31708
|
data,
|
|
31542
31709
|
params,
|
|
@@ -31549,38 +31716,17 @@ class Client$L extends Client$M {
|
|
|
31549
31716
|
});
|
|
31550
31717
|
}),
|
|
31551
31718
|
/**
|
|
31552
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=
|
|
31719
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=delete_org&version=v2 click to debug }
|
|
31553
31720
|
*
|
|
31554
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=
|
|
31721
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete_org&project=corehr&resource=custom_org&version=v2 document }
|
|
31555
31722
|
*
|
|
31556
|
-
*
|
|
31723
|
+
* 删除自定义组织
|
|
31557
31724
|
*/
|
|
31558
|
-
|
|
31725
|
+
deleteOrg: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31559
31726
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31560
31727
|
return this.httpInstance
|
|
31561
31728
|
.request({
|
|
31562
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/
|
|
31563
|
-
method: "DELETE",
|
|
31564
|
-
data,
|
|
31565
|
-
params,
|
|
31566
|
-
headers,
|
|
31567
|
-
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31568
|
-
})
|
|
31569
|
-
.catch((e) => {
|
|
31570
|
-
this.logger.error(formatErrors(e));
|
|
31571
|
-
throw e;
|
|
31572
|
-
});
|
|
31573
|
-
}),
|
|
31574
|
-
/**
|
|
31575
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=parents&version=v2 click to debug }
|
|
31576
|
-
*
|
|
31577
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 document }
|
|
31578
|
-
*/
|
|
31579
|
-
parents: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31580
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31581
|
-
return this.httpInstance
|
|
31582
|
-
.request({
|
|
31583
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/parents`, path),
|
|
31729
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/delete_org`, path),
|
|
31584
31730
|
method: "POST",
|
|
31585
31731
|
data,
|
|
31586
31732
|
params,
|
|
@@ -31593,17 +31739,17 @@ class Client$L extends Client$M {
|
|
|
31593
31739
|
});
|
|
31594
31740
|
}),
|
|
31595
31741
|
/**
|
|
31596
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=
|
|
31742
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=patch&version=v2 click to debug }
|
|
31597
31743
|
*
|
|
31598
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=
|
|
31744
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=custom_org&version=v2 document }
|
|
31599
31745
|
*
|
|
31600
|
-
*
|
|
31746
|
+
* 更新自定义组织
|
|
31601
31747
|
*/
|
|
31602
31748
|
patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31603
31749
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31604
31750
|
return this.httpInstance
|
|
31605
31751
|
.request({
|
|
31606
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/
|
|
31752
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/:org_id`, path),
|
|
31607
31753
|
method: "PATCH",
|
|
31608
31754
|
data,
|
|
31609
31755
|
params,
|
|
@@ -31616,17 +31762,17 @@ class Client$L extends Client$M {
|
|
|
31616
31762
|
});
|
|
31617
31763
|
}),
|
|
31618
31764
|
/**
|
|
31619
|
-
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=
|
|
31765
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=query&version=v2 click to debug }
|
|
31620
31766
|
*
|
|
31621
|
-
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=
|
|
31767
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query&project=corehr&resource=custom_org&version=v2 document }
|
|
31622
31768
|
*
|
|
31623
|
-
*
|
|
31769
|
+
* 查询自定义组织信息
|
|
31624
31770
|
*/
|
|
31625
|
-
|
|
31771
|
+
query: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31626
31772
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31627
31773
|
return this.httpInstance
|
|
31628
31774
|
.request({
|
|
31629
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/
|
|
31775
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query`, path),
|
|
31630
31776
|
method: "POST",
|
|
31631
31777
|
data,
|
|
31632
31778
|
params,
|
|
@@ -31638,13 +31784,314 @@ class Client$L extends Client$M {
|
|
|
31638
31784
|
throw e;
|
|
31639
31785
|
});
|
|
31640
31786
|
}),
|
|
31641
|
-
|
|
31787
|
+
queryRecentChangeWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31642
31788
|
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31643
31789
|
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
31644
31790
|
const res = yield this.httpInstance
|
|
31645
31791
|
.request({
|
|
31646
|
-
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/
|
|
31647
|
-
method: "
|
|
31792
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`, path),
|
|
31793
|
+
method: "GET",
|
|
31794
|
+
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
31795
|
+
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
31796
|
+
data,
|
|
31797
|
+
paramsSerializer: (params) => qs.stringify(params, {
|
|
31798
|
+
arrayFormat: "repeat",
|
|
31799
|
+
}),
|
|
31800
|
+
})
|
|
31801
|
+
.catch((e) => {
|
|
31802
|
+
this.logger.error(formatErrors(e));
|
|
31803
|
+
});
|
|
31804
|
+
return res;
|
|
31805
|
+
});
|
|
31806
|
+
const Iterable = {
|
|
31807
|
+
[Symbol.asyncIterator]() {
|
|
31808
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
31809
|
+
let hasMore = true;
|
|
31810
|
+
let pageToken;
|
|
31811
|
+
while (hasMore) {
|
|
31812
|
+
try {
|
|
31813
|
+
const res = yield __await(sendRequest({
|
|
31814
|
+
headers,
|
|
31815
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
31816
|
+
data,
|
|
31817
|
+
}));
|
|
31818
|
+
const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
|
|
31819
|
+
// @ts-ignore
|
|
31820
|
+
has_more,
|
|
31821
|
+
// @ts-ignore
|
|
31822
|
+
page_token,
|
|
31823
|
+
// @ts-ignore
|
|
31824
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
31825
|
+
yield yield __await(rest);
|
|
31826
|
+
hasMore = Boolean(has_more);
|
|
31827
|
+
pageToken = page_token || next_page_token;
|
|
31828
|
+
}
|
|
31829
|
+
catch (e) {
|
|
31830
|
+
yield yield __await(null);
|
|
31831
|
+
break;
|
|
31832
|
+
}
|
|
31833
|
+
}
|
|
31834
|
+
});
|
|
31835
|
+
},
|
|
31836
|
+
};
|
|
31837
|
+
return Iterable;
|
|
31838
|
+
}),
|
|
31839
|
+
/**
|
|
31840
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=query_recent_change&version=v2 click to debug }
|
|
31841
|
+
*
|
|
31842
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_recent_change&project=corehr&resource=custom_org&version=v2 document }
|
|
31843
|
+
*/
|
|
31844
|
+
queryRecentChange: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31845
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31846
|
+
return this.httpInstance
|
|
31847
|
+
.request({
|
|
31848
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/query_recent_change`, path),
|
|
31849
|
+
method: "GET",
|
|
31850
|
+
data,
|
|
31851
|
+
params,
|
|
31852
|
+
headers,
|
|
31853
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31854
|
+
})
|
|
31855
|
+
.catch((e) => {
|
|
31856
|
+
this.logger.error(formatErrors(e));
|
|
31857
|
+
throw e;
|
|
31858
|
+
});
|
|
31859
|
+
}),
|
|
31860
|
+
/**
|
|
31861
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=custom_org&apiName=update_rule&version=v2 click to debug }
|
|
31862
|
+
*
|
|
31863
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_rule&project=corehr&resource=custom_org&version=v2 document }
|
|
31864
|
+
*
|
|
31865
|
+
* 更新匹配规则
|
|
31866
|
+
*/
|
|
31867
|
+
updateRule: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31868
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31869
|
+
return this.httpInstance
|
|
31870
|
+
.request({
|
|
31871
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/custom_orgs/update_rule`, path),
|
|
31872
|
+
method: "POST",
|
|
31873
|
+
data,
|
|
31874
|
+
params,
|
|
31875
|
+
headers,
|
|
31876
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31877
|
+
})
|
|
31878
|
+
.catch((e) => {
|
|
31879
|
+
this.logger.error(formatErrors(e));
|
|
31880
|
+
throw e;
|
|
31881
|
+
});
|
|
31882
|
+
}),
|
|
31883
|
+
},
|
|
31884
|
+
/**
|
|
31885
|
+
* default_cost_center
|
|
31886
|
+
*/
|
|
31887
|
+
defaultCostCenter: {
|
|
31888
|
+
/**
|
|
31889
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=batch_query&version=v2 click to debug }
|
|
31890
|
+
*
|
|
31891
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_query&project=corehr&resource=default_cost_center&version=v2 document }
|
|
31892
|
+
*/
|
|
31893
|
+
batchQuery: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31894
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31895
|
+
return this.httpInstance
|
|
31896
|
+
.request({
|
|
31897
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/batch_query`, path),
|
|
31898
|
+
method: "POST",
|
|
31899
|
+
data,
|
|
31900
|
+
params,
|
|
31901
|
+
headers,
|
|
31902
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31903
|
+
})
|
|
31904
|
+
.catch((e) => {
|
|
31905
|
+
this.logger.error(formatErrors(e));
|
|
31906
|
+
throw e;
|
|
31907
|
+
});
|
|
31908
|
+
}),
|
|
31909
|
+
/**
|
|
31910
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=create_version&version=v2 click to debug }
|
|
31911
|
+
*
|
|
31912
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create_version&project=corehr&resource=default_cost_center&version=v2 document }
|
|
31913
|
+
*/
|
|
31914
|
+
createVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31915
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31916
|
+
return this.httpInstance
|
|
31917
|
+
.request({
|
|
31918
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/create_version`, path),
|
|
31919
|
+
method: "POST",
|
|
31920
|
+
data,
|
|
31921
|
+
params,
|
|
31922
|
+
headers,
|
|
31923
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31924
|
+
})
|
|
31925
|
+
.catch((e) => {
|
|
31926
|
+
this.logger.error(formatErrors(e));
|
|
31927
|
+
throw e;
|
|
31928
|
+
});
|
|
31929
|
+
}),
|
|
31930
|
+
/**
|
|
31931
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=remove_version&version=v2 click to debug }
|
|
31932
|
+
*
|
|
31933
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=remove_version&project=corehr&resource=default_cost_center&version=v2 document }
|
|
31934
|
+
*/
|
|
31935
|
+
removeVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31936
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31937
|
+
return this.httpInstance
|
|
31938
|
+
.request({
|
|
31939
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/remove_version`, path),
|
|
31940
|
+
method: "POST",
|
|
31941
|
+
data,
|
|
31942
|
+
params,
|
|
31943
|
+
headers,
|
|
31944
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31945
|
+
})
|
|
31946
|
+
.catch((e) => {
|
|
31947
|
+
this.logger.error(formatErrors(e));
|
|
31948
|
+
throw e;
|
|
31949
|
+
});
|
|
31950
|
+
}),
|
|
31951
|
+
/**
|
|
31952
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=default_cost_center&apiName=update_version&version=v2 click to debug }
|
|
31953
|
+
*
|
|
31954
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update_version&project=corehr&resource=default_cost_center&version=v2 document }
|
|
31955
|
+
*/
|
|
31956
|
+
updateVersion: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31957
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31958
|
+
return this.httpInstance
|
|
31959
|
+
.request({
|
|
31960
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/default_cost_centers/update_version`, path),
|
|
31961
|
+
method: "POST",
|
|
31962
|
+
data,
|
|
31963
|
+
params,
|
|
31964
|
+
headers,
|
|
31965
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31966
|
+
})
|
|
31967
|
+
.catch((e) => {
|
|
31968
|
+
this.logger.error(formatErrors(e));
|
|
31969
|
+
throw e;
|
|
31970
|
+
});
|
|
31971
|
+
}),
|
|
31972
|
+
},
|
|
31973
|
+
/**
|
|
31974
|
+
* department
|
|
31975
|
+
*/
|
|
31976
|
+
department: {
|
|
31977
|
+
/**
|
|
31978
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=batch_get&version=v2 click to debug }
|
|
31979
|
+
*
|
|
31980
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=batch_get&project=corehr&resource=department&version=v2 document }
|
|
31981
|
+
*/
|
|
31982
|
+
batchGet: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
31983
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
31984
|
+
return this.httpInstance
|
|
31985
|
+
.request({
|
|
31986
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/batch_get`, path),
|
|
31987
|
+
method: "POST",
|
|
31988
|
+
data,
|
|
31989
|
+
params,
|
|
31990
|
+
headers,
|
|
31991
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
31992
|
+
})
|
|
31993
|
+
.catch((e) => {
|
|
31994
|
+
this.logger.error(formatErrors(e));
|
|
31995
|
+
throw e;
|
|
31996
|
+
});
|
|
31997
|
+
}),
|
|
31998
|
+
/**
|
|
31999
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=delete&version=v2 click to debug }
|
|
32000
|
+
*
|
|
32001
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=corehr&resource=department&version=v2 document }
|
|
32002
|
+
*
|
|
32003
|
+
* 删除部门数据
|
|
32004
|
+
*/
|
|
32005
|
+
delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
32006
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
32007
|
+
return this.httpInstance
|
|
32008
|
+
.request({
|
|
32009
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path),
|
|
32010
|
+
method: "DELETE",
|
|
32011
|
+
data,
|
|
32012
|
+
params,
|
|
32013
|
+
headers,
|
|
32014
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
32015
|
+
})
|
|
32016
|
+
.catch((e) => {
|
|
32017
|
+
this.logger.error(formatErrors(e));
|
|
32018
|
+
throw e;
|
|
32019
|
+
});
|
|
32020
|
+
}),
|
|
32021
|
+
/**
|
|
32022
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=parents&version=v2 click to debug }
|
|
32023
|
+
*
|
|
32024
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=parents&project=corehr&resource=department&version=v2 document }
|
|
32025
|
+
*/
|
|
32026
|
+
parents: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
32027
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
32028
|
+
return this.httpInstance
|
|
32029
|
+
.request({
|
|
32030
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/parents`, path),
|
|
32031
|
+
method: "POST",
|
|
32032
|
+
data,
|
|
32033
|
+
params,
|
|
32034
|
+
headers,
|
|
32035
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
32036
|
+
})
|
|
32037
|
+
.catch((e) => {
|
|
32038
|
+
this.logger.error(formatErrors(e));
|
|
32039
|
+
throw e;
|
|
32040
|
+
});
|
|
32041
|
+
}),
|
|
32042
|
+
/**
|
|
32043
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=patch&version=v2 click to debug }
|
|
32044
|
+
*
|
|
32045
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=corehr&resource=department&version=v2 document }
|
|
32046
|
+
*
|
|
32047
|
+
* 更新部门数据
|
|
32048
|
+
*/
|
|
32049
|
+
patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
32050
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
32051
|
+
return this.httpInstance
|
|
32052
|
+
.request({
|
|
32053
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/:department_id`, path),
|
|
32054
|
+
method: "PATCH",
|
|
32055
|
+
data,
|
|
32056
|
+
params,
|
|
32057
|
+
headers,
|
|
32058
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
32059
|
+
})
|
|
32060
|
+
.catch((e) => {
|
|
32061
|
+
this.logger.error(formatErrors(e));
|
|
32062
|
+
throw e;
|
|
32063
|
+
});
|
|
32064
|
+
}),
|
|
32065
|
+
/**
|
|
32066
|
+
* {@link https://open.feishu.cn/api-explorer?project=corehr&resource=department&apiName=query_multi_timeline&version=v2 click to debug }
|
|
32067
|
+
*
|
|
32068
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=query_multi_timeline&project=corehr&resource=department&version=v2 document }
|
|
32069
|
+
*
|
|
32070
|
+
* 查询任意日期部门信息
|
|
32071
|
+
*/
|
|
32072
|
+
queryMultiTimeline: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
32073
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
32074
|
+
return this.httpInstance
|
|
32075
|
+
.request({
|
|
32076
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_multi_timeline`, path),
|
|
32077
|
+
method: "POST",
|
|
32078
|
+
data,
|
|
32079
|
+
params,
|
|
32080
|
+
headers,
|
|
32081
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
32082
|
+
})
|
|
32083
|
+
.catch((e) => {
|
|
32084
|
+
this.logger.error(formatErrors(e));
|
|
32085
|
+
throw e;
|
|
32086
|
+
});
|
|
32087
|
+
}),
|
|
32088
|
+
queryOperationLogsWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
32089
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
32090
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
32091
|
+
const res = yield this.httpInstance
|
|
32092
|
+
.request({
|
|
32093
|
+
url: fillApiPath(`${this.domain}/open-apis/corehr/v2/departments/query_operation_logs`, path),
|
|
32094
|
+
method: "POST",
|
|
31648
32095
|
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
31649
32096
|
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
31650
32097
|
data,
|
|
@@ -34250,6 +34697,726 @@ class Client$L extends Client$M {
|
|
|
34250
34697
|
}
|
|
34251
34698
|
}
|
|
34252
34699
|
|
|
34700
|
+
// auto gen
|
|
34701
|
+
class Client$L extends Client$M {
|
|
34702
|
+
constructor() {
|
|
34703
|
+
super(...arguments);
|
|
34704
|
+
/**
|
|
34705
|
+
|
|
34706
|
+
*/
|
|
34707
|
+
this.directory = {
|
|
34708
|
+
v1: {
|
|
34709
|
+
/**
|
|
34710
|
+
* collaboration_rule
|
|
34711
|
+
*/
|
|
34712
|
+
collaborationRule: {
|
|
34713
|
+
/**
|
|
34714
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=create&version=v1 click to debug }
|
|
34715
|
+
*
|
|
34716
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=collaboration_rule&version=v1 document }
|
|
34717
|
+
*
|
|
34718
|
+
* 创建关联组织规则
|
|
34719
|
+
*/
|
|
34720
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34721
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34722
|
+
return this.httpInstance
|
|
34723
|
+
.request({
|
|
34724
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path),
|
|
34725
|
+
method: "POST",
|
|
34726
|
+
data,
|
|
34727
|
+
params,
|
|
34728
|
+
headers,
|
|
34729
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
34730
|
+
})
|
|
34731
|
+
.catch((e) => {
|
|
34732
|
+
this.logger.error(formatErrors(e));
|
|
34733
|
+
throw e;
|
|
34734
|
+
});
|
|
34735
|
+
}),
|
|
34736
|
+
/**
|
|
34737
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=delete&version=v1 click to debug }
|
|
34738
|
+
*
|
|
34739
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=collaboration_rule&version=v1 document }
|
|
34740
|
+
*
|
|
34741
|
+
* 删除关联组织的规则
|
|
34742
|
+
*/
|
|
34743
|
+
delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34744
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34745
|
+
return this.httpInstance
|
|
34746
|
+
.request({
|
|
34747
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`, path),
|
|
34748
|
+
method: "DELETE",
|
|
34749
|
+
data,
|
|
34750
|
+
params,
|
|
34751
|
+
headers,
|
|
34752
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
34753
|
+
})
|
|
34754
|
+
.catch((e) => {
|
|
34755
|
+
this.logger.error(formatErrors(e));
|
|
34756
|
+
throw e;
|
|
34757
|
+
});
|
|
34758
|
+
}),
|
|
34759
|
+
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34760
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34761
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
34762
|
+
const res = yield this.httpInstance
|
|
34763
|
+
.request({
|
|
34764
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path),
|
|
34765
|
+
method: "GET",
|
|
34766
|
+
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
34767
|
+
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
34768
|
+
data,
|
|
34769
|
+
paramsSerializer: (params) => qs.stringify(params, {
|
|
34770
|
+
arrayFormat: "repeat",
|
|
34771
|
+
}),
|
|
34772
|
+
})
|
|
34773
|
+
.catch((e) => {
|
|
34774
|
+
this.logger.error(formatErrors(e));
|
|
34775
|
+
});
|
|
34776
|
+
return res;
|
|
34777
|
+
});
|
|
34778
|
+
const Iterable = {
|
|
34779
|
+
[Symbol.asyncIterator]() {
|
|
34780
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
34781
|
+
let hasMore = true;
|
|
34782
|
+
let pageToken;
|
|
34783
|
+
while (hasMore) {
|
|
34784
|
+
try {
|
|
34785
|
+
const res = yield __await(sendRequest({
|
|
34786
|
+
headers,
|
|
34787
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
34788
|
+
data,
|
|
34789
|
+
}));
|
|
34790
|
+
const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
|
|
34791
|
+
// @ts-ignore
|
|
34792
|
+
has_more,
|
|
34793
|
+
// @ts-ignore
|
|
34794
|
+
page_token,
|
|
34795
|
+
// @ts-ignore
|
|
34796
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
34797
|
+
yield yield __await(rest);
|
|
34798
|
+
hasMore = Boolean(has_more);
|
|
34799
|
+
pageToken = page_token || next_page_token;
|
|
34800
|
+
}
|
|
34801
|
+
catch (e) {
|
|
34802
|
+
yield yield __await(null);
|
|
34803
|
+
break;
|
|
34804
|
+
}
|
|
34805
|
+
}
|
|
34806
|
+
});
|
|
34807
|
+
},
|
|
34808
|
+
};
|
|
34809
|
+
return Iterable;
|
|
34810
|
+
}),
|
|
34811
|
+
/**
|
|
34812
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=list&version=v1 click to debug }
|
|
34813
|
+
*
|
|
34814
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collaboration_rule&version=v1 document }
|
|
34815
|
+
*
|
|
34816
|
+
* 获取关联组织规则列表
|
|
34817
|
+
*/
|
|
34818
|
+
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34819
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34820
|
+
return this.httpInstance
|
|
34821
|
+
.request({
|
|
34822
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules`, path),
|
|
34823
|
+
method: "GET",
|
|
34824
|
+
data,
|
|
34825
|
+
params,
|
|
34826
|
+
headers,
|
|
34827
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
34828
|
+
})
|
|
34829
|
+
.catch((e) => {
|
|
34830
|
+
this.logger.error(formatErrors(e));
|
|
34831
|
+
throw e;
|
|
34832
|
+
});
|
|
34833
|
+
}),
|
|
34834
|
+
/**
|
|
34835
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_rule&apiName=update&version=v1 click to debug }
|
|
34836
|
+
*
|
|
34837
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=update&project=directory&resource=collaboration_rule&version=v1 document }
|
|
34838
|
+
*
|
|
34839
|
+
* 更新关联组织规则
|
|
34840
|
+
*/
|
|
34841
|
+
update: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34842
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34843
|
+
return this.httpInstance
|
|
34844
|
+
.request({
|
|
34845
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_rules/:collaboration_rule_id`, path),
|
|
34846
|
+
method: "PUT",
|
|
34847
|
+
data,
|
|
34848
|
+
params,
|
|
34849
|
+
headers,
|
|
34850
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
34851
|
+
})
|
|
34852
|
+
.catch((e) => {
|
|
34853
|
+
this.logger.error(formatErrors(e));
|
|
34854
|
+
throw e;
|
|
34855
|
+
});
|
|
34856
|
+
}),
|
|
34857
|
+
},
|
|
34858
|
+
/**
|
|
34859
|
+
* collaboration_tenant
|
|
34860
|
+
*/
|
|
34861
|
+
collaborationTenant: {
|
|
34862
|
+
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34863
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34864
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
34865
|
+
const res = yield this.httpInstance
|
|
34866
|
+
.request({
|
|
34867
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_tenants`, path),
|
|
34868
|
+
method: "GET",
|
|
34869
|
+
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
34870
|
+
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
34871
|
+
data,
|
|
34872
|
+
paramsSerializer: (params) => qs.stringify(params, {
|
|
34873
|
+
arrayFormat: "repeat",
|
|
34874
|
+
}),
|
|
34875
|
+
})
|
|
34876
|
+
.catch((e) => {
|
|
34877
|
+
this.logger.error(formatErrors(e));
|
|
34878
|
+
});
|
|
34879
|
+
return res;
|
|
34880
|
+
});
|
|
34881
|
+
const Iterable = {
|
|
34882
|
+
[Symbol.asyncIterator]() {
|
|
34883
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
34884
|
+
let hasMore = true;
|
|
34885
|
+
let pageToken;
|
|
34886
|
+
while (hasMore) {
|
|
34887
|
+
try {
|
|
34888
|
+
const res = yield __await(sendRequest({
|
|
34889
|
+
headers,
|
|
34890
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
34891
|
+
data,
|
|
34892
|
+
}));
|
|
34893
|
+
const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
|
|
34894
|
+
// @ts-ignore
|
|
34895
|
+
has_more,
|
|
34896
|
+
// @ts-ignore
|
|
34897
|
+
page_token,
|
|
34898
|
+
// @ts-ignore
|
|
34899
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
34900
|
+
yield yield __await(rest);
|
|
34901
|
+
hasMore = Boolean(has_more);
|
|
34902
|
+
pageToken = page_token || next_page_token;
|
|
34903
|
+
}
|
|
34904
|
+
catch (e) {
|
|
34905
|
+
yield yield __await(null);
|
|
34906
|
+
break;
|
|
34907
|
+
}
|
|
34908
|
+
}
|
|
34909
|
+
});
|
|
34910
|
+
},
|
|
34911
|
+
};
|
|
34912
|
+
return Iterable;
|
|
34913
|
+
}),
|
|
34914
|
+
/**
|
|
34915
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=collaboration_tenant&apiName=list&version=v1 click to debug }
|
|
34916
|
+
*
|
|
34917
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collaboration_tenant&version=v1 document }
|
|
34918
|
+
*
|
|
34919
|
+
* 在创建规则时,需要知道对方租户的tenant key,为拿到有效的tenant key,这里提供一个专门给管理员获取关联组织租户的接口,该接口可以直接请求到所有关联组织列表。
|
|
34920
|
+
*/
|
|
34921
|
+
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34922
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34923
|
+
return this.httpInstance
|
|
34924
|
+
.request({
|
|
34925
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/collaboration_tenants`, path),
|
|
34926
|
+
method: "GET",
|
|
34927
|
+
data,
|
|
34928
|
+
params,
|
|
34929
|
+
headers,
|
|
34930
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
34931
|
+
})
|
|
34932
|
+
.catch((e) => {
|
|
34933
|
+
this.logger.error(formatErrors(e));
|
|
34934
|
+
throw e;
|
|
34935
|
+
});
|
|
34936
|
+
}),
|
|
34937
|
+
},
|
|
34938
|
+
/**
|
|
34939
|
+
* collboration_share_entity
|
|
34940
|
+
*/
|
|
34941
|
+
collborationShareEntity: {
|
|
34942
|
+
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
34943
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
34944
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
34945
|
+
const res = yield this.httpInstance
|
|
34946
|
+
.request({
|
|
34947
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/share_entities`, path),
|
|
34948
|
+
method: "GET",
|
|
34949
|
+
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
34950
|
+
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
34951
|
+
data,
|
|
34952
|
+
paramsSerializer: (params) => qs.stringify(params, {
|
|
34953
|
+
arrayFormat: "repeat",
|
|
34954
|
+
}),
|
|
34955
|
+
})
|
|
34956
|
+
.catch((e) => {
|
|
34957
|
+
this.logger.error(formatErrors(e));
|
|
34958
|
+
});
|
|
34959
|
+
return res;
|
|
34960
|
+
});
|
|
34961
|
+
const Iterable = {
|
|
34962
|
+
[Symbol.asyncIterator]() {
|
|
34963
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
34964
|
+
let hasMore = true;
|
|
34965
|
+
let pageToken;
|
|
34966
|
+
while (hasMore) {
|
|
34967
|
+
try {
|
|
34968
|
+
const res = yield __await(sendRequest({
|
|
34969
|
+
headers,
|
|
34970
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
34971
|
+
data,
|
|
34972
|
+
}));
|
|
34973
|
+
const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
|
|
34974
|
+
// @ts-ignore
|
|
34975
|
+
has_more,
|
|
34976
|
+
// @ts-ignore
|
|
34977
|
+
page_token,
|
|
34978
|
+
// @ts-ignore
|
|
34979
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
34980
|
+
yield yield __await(rest);
|
|
34981
|
+
hasMore = Boolean(has_more);
|
|
34982
|
+
pageToken = page_token || next_page_token;
|
|
34983
|
+
}
|
|
34984
|
+
catch (e) {
|
|
34985
|
+
yield yield __await(null);
|
|
34986
|
+
break;
|
|
34987
|
+
}
|
|
34988
|
+
}
|
|
34989
|
+
});
|
|
34990
|
+
},
|
|
34991
|
+
};
|
|
34992
|
+
return Iterable;
|
|
34993
|
+
}),
|
|
34994
|
+
/**
|
|
34995
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=collboration_share_entity&apiName=list&version=v1 click to debug }
|
|
34996
|
+
*
|
|
34997
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=directory&resource=collboration_share_entity&version=v1 document }
|
|
34998
|
+
*
|
|
34999
|
+
* 获取双方租户分享的实体ID,完成可见性规则的设置
|
|
35000
|
+
*/
|
|
35001
|
+
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35002
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35003
|
+
return this.httpInstance
|
|
35004
|
+
.request({
|
|
35005
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/share_entities`, path),
|
|
35006
|
+
method: "GET",
|
|
35007
|
+
data,
|
|
35008
|
+
params,
|
|
35009
|
+
headers,
|
|
35010
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35011
|
+
})
|
|
35012
|
+
.catch((e) => {
|
|
35013
|
+
this.logger.error(formatErrors(e));
|
|
35014
|
+
throw e;
|
|
35015
|
+
});
|
|
35016
|
+
}),
|
|
35017
|
+
},
|
|
35018
|
+
/**
|
|
35019
|
+
* department
|
|
35020
|
+
*/
|
|
35021
|
+
department: {
|
|
35022
|
+
/**
|
|
35023
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=create&version=v1 click to debug }
|
|
35024
|
+
*
|
|
35025
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=department&version=v1 document }
|
|
35026
|
+
*
|
|
35027
|
+
* 创建部门信息
|
|
35028
|
+
*/
|
|
35029
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35030
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35031
|
+
return this.httpInstance
|
|
35032
|
+
.request({
|
|
35033
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments`, path),
|
|
35034
|
+
method: "POST",
|
|
35035
|
+
data,
|
|
35036
|
+
params,
|
|
35037
|
+
headers,
|
|
35038
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35039
|
+
})
|
|
35040
|
+
.catch((e) => {
|
|
35041
|
+
this.logger.error(formatErrors(e));
|
|
35042
|
+
throw e;
|
|
35043
|
+
});
|
|
35044
|
+
}),
|
|
35045
|
+
/**
|
|
35046
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=delete&version=v1 click to debug }
|
|
35047
|
+
*
|
|
35048
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=department&version=v1 document }
|
|
35049
|
+
*
|
|
35050
|
+
* 删除部门信息
|
|
35051
|
+
*/
|
|
35052
|
+
delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35053
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35054
|
+
return this.httpInstance
|
|
35055
|
+
.request({
|
|
35056
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/:department_id`, path),
|
|
35057
|
+
method: "DELETE",
|
|
35058
|
+
data,
|
|
35059
|
+
params,
|
|
35060
|
+
headers,
|
|
35061
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35062
|
+
})
|
|
35063
|
+
.catch((e) => {
|
|
35064
|
+
this.logger.error(formatErrors(e));
|
|
35065
|
+
throw e;
|
|
35066
|
+
});
|
|
35067
|
+
}),
|
|
35068
|
+
/**
|
|
35069
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=filter&version=v1 click to debug }
|
|
35070
|
+
*
|
|
35071
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=filter&project=directory&resource=department&version=v1 document }
|
|
35072
|
+
*
|
|
35073
|
+
* 查询部门ID列表
|
|
35074
|
+
*/
|
|
35075
|
+
filter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35076
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35077
|
+
return this.httpInstance
|
|
35078
|
+
.request({
|
|
35079
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/filter`, path),
|
|
35080
|
+
method: "POST",
|
|
35081
|
+
data,
|
|
35082
|
+
params,
|
|
35083
|
+
headers,
|
|
35084
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35085
|
+
})
|
|
35086
|
+
.catch((e) => {
|
|
35087
|
+
this.logger.error(formatErrors(e));
|
|
35088
|
+
throw e;
|
|
35089
|
+
});
|
|
35090
|
+
}),
|
|
35091
|
+
/**
|
|
35092
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=idconvert&version=v1 click to debug }
|
|
35093
|
+
*
|
|
35094
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=idconvert&project=directory&resource=department&version=v1 document }
|
|
35095
|
+
*/
|
|
35096
|
+
idconvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35097
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35098
|
+
return this.httpInstance
|
|
35099
|
+
.request({
|
|
35100
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/idconvert`, path),
|
|
35101
|
+
method: "POST",
|
|
35102
|
+
data,
|
|
35103
|
+
params,
|
|
35104
|
+
headers,
|
|
35105
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35106
|
+
})
|
|
35107
|
+
.catch((e) => {
|
|
35108
|
+
this.logger.error(formatErrors(e));
|
|
35109
|
+
throw e;
|
|
35110
|
+
});
|
|
35111
|
+
}),
|
|
35112
|
+
/**
|
|
35113
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=mget&version=v1 click to debug }
|
|
35114
|
+
*
|
|
35115
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=directory&resource=department&version=v1 document }
|
|
35116
|
+
*
|
|
35117
|
+
* 查询部门
|
|
35118
|
+
*/
|
|
35119
|
+
mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35120
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35121
|
+
return this.httpInstance
|
|
35122
|
+
.request({
|
|
35123
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/mget`, path),
|
|
35124
|
+
method: "POST",
|
|
35125
|
+
data,
|
|
35126
|
+
params,
|
|
35127
|
+
headers,
|
|
35128
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35129
|
+
})
|
|
35130
|
+
.catch((e) => {
|
|
35131
|
+
this.logger.error(formatErrors(e));
|
|
35132
|
+
throw e;
|
|
35133
|
+
});
|
|
35134
|
+
}),
|
|
35135
|
+
/**
|
|
35136
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=patch&version=v1 click to debug }
|
|
35137
|
+
*
|
|
35138
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=directory&resource=department&version=v1 document }
|
|
35139
|
+
*
|
|
35140
|
+
* 更新部门信息
|
|
35141
|
+
*/
|
|
35142
|
+
patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35143
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35144
|
+
return this.httpInstance
|
|
35145
|
+
.request({
|
|
35146
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/:department_id`, path),
|
|
35147
|
+
method: "PATCH",
|
|
35148
|
+
data,
|
|
35149
|
+
params,
|
|
35150
|
+
headers,
|
|
35151
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35152
|
+
})
|
|
35153
|
+
.catch((e) => {
|
|
35154
|
+
this.logger.error(formatErrors(e));
|
|
35155
|
+
throw e;
|
|
35156
|
+
});
|
|
35157
|
+
}),
|
|
35158
|
+
/**
|
|
35159
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=department&apiName=search&version=v1 click to debug }
|
|
35160
|
+
*
|
|
35161
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=directory&resource=department&version=v1 document }
|
|
35162
|
+
*
|
|
35163
|
+
* 搜索租户内部门
|
|
35164
|
+
*/
|
|
35165
|
+
search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35166
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35167
|
+
return this.httpInstance
|
|
35168
|
+
.request({
|
|
35169
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/departments/search`, path),
|
|
35170
|
+
method: "POST",
|
|
35171
|
+
data,
|
|
35172
|
+
params,
|
|
35173
|
+
headers,
|
|
35174
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35175
|
+
})
|
|
35176
|
+
.catch((e) => {
|
|
35177
|
+
this.logger.error(formatErrors(e));
|
|
35178
|
+
throw e;
|
|
35179
|
+
});
|
|
35180
|
+
}),
|
|
35181
|
+
},
|
|
35182
|
+
/**
|
|
35183
|
+
* employee
|
|
35184
|
+
*/
|
|
35185
|
+
employee: {
|
|
35186
|
+
/**
|
|
35187
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=create&version=v1 click to debug }
|
|
35188
|
+
*
|
|
35189
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=directory&resource=employee&version=v1 document }
|
|
35190
|
+
*
|
|
35191
|
+
* 创建员工信息
|
|
35192
|
+
*/
|
|
35193
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35194
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35195
|
+
return this.httpInstance
|
|
35196
|
+
.request({
|
|
35197
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees`, path),
|
|
35198
|
+
method: "POST",
|
|
35199
|
+
data,
|
|
35200
|
+
params,
|
|
35201
|
+
headers,
|
|
35202
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35203
|
+
})
|
|
35204
|
+
.catch((e) => {
|
|
35205
|
+
this.logger.error(formatErrors(e));
|
|
35206
|
+
throw e;
|
|
35207
|
+
});
|
|
35208
|
+
}),
|
|
35209
|
+
/**
|
|
35210
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=delete&version=v1 click to debug }
|
|
35211
|
+
*
|
|
35212
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=delete&project=directory&resource=employee&version=v1 document }
|
|
35213
|
+
*
|
|
35214
|
+
* 离职员工信息
|
|
35215
|
+
*/
|
|
35216
|
+
delete: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35217
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35218
|
+
return this.httpInstance
|
|
35219
|
+
.request({
|
|
35220
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id`, path),
|
|
35221
|
+
method: "DELETE",
|
|
35222
|
+
data,
|
|
35223
|
+
params,
|
|
35224
|
+
headers,
|
|
35225
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35226
|
+
})
|
|
35227
|
+
.catch((e) => {
|
|
35228
|
+
this.logger.error(formatErrors(e));
|
|
35229
|
+
throw e;
|
|
35230
|
+
});
|
|
35231
|
+
}),
|
|
35232
|
+
/**
|
|
35233
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=filter&version=v1 click to debug }
|
|
35234
|
+
*
|
|
35235
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=filter&project=directory&resource=employee&version=v1 document }
|
|
35236
|
+
*
|
|
35237
|
+
* 查询员工ID列表
|
|
35238
|
+
*/
|
|
35239
|
+
filter: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35240
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35241
|
+
return this.httpInstance
|
|
35242
|
+
.request({
|
|
35243
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/filter`, path),
|
|
35244
|
+
method: "POST",
|
|
35245
|
+
data,
|
|
35246
|
+
params,
|
|
35247
|
+
headers,
|
|
35248
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35249
|
+
})
|
|
35250
|
+
.catch((e) => {
|
|
35251
|
+
this.logger.error(formatErrors(e));
|
|
35252
|
+
throw e;
|
|
35253
|
+
});
|
|
35254
|
+
}),
|
|
35255
|
+
/**
|
|
35256
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=idconvert&version=v1 click to debug }
|
|
35257
|
+
*
|
|
35258
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=idconvert&project=directory&resource=employee&version=v1 document }
|
|
35259
|
+
*/
|
|
35260
|
+
idconvert: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35261
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35262
|
+
return this.httpInstance
|
|
35263
|
+
.request({
|
|
35264
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/idconvert`, path),
|
|
35265
|
+
method: "POST",
|
|
35266
|
+
data,
|
|
35267
|
+
params,
|
|
35268
|
+
headers,
|
|
35269
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35270
|
+
})
|
|
35271
|
+
.catch((e) => {
|
|
35272
|
+
this.logger.error(formatErrors(e));
|
|
35273
|
+
throw e;
|
|
35274
|
+
});
|
|
35275
|
+
}),
|
|
35276
|
+
/**
|
|
35277
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=mget&version=v1 click to debug }
|
|
35278
|
+
*
|
|
35279
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=mget&project=directory&resource=employee&version=v1 document }
|
|
35280
|
+
*
|
|
35281
|
+
* 批量获取员工数据
|
|
35282
|
+
*/
|
|
35283
|
+
mget: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35284
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35285
|
+
return this.httpInstance
|
|
35286
|
+
.request({
|
|
35287
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/mget`, path),
|
|
35288
|
+
method: "POST",
|
|
35289
|
+
data,
|
|
35290
|
+
params,
|
|
35291
|
+
headers,
|
|
35292
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35293
|
+
})
|
|
35294
|
+
.catch((e) => {
|
|
35295
|
+
this.logger.error(formatErrors(e));
|
|
35296
|
+
throw e;
|
|
35297
|
+
});
|
|
35298
|
+
}),
|
|
35299
|
+
/**
|
|
35300
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=patch&version=v1 click to debug }
|
|
35301
|
+
*
|
|
35302
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=directory&resource=employee&version=v1 document }
|
|
35303
|
+
*
|
|
35304
|
+
* 更新员工信息
|
|
35305
|
+
*/
|
|
35306
|
+
patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35307
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35308
|
+
return this.httpInstance
|
|
35309
|
+
.request({
|
|
35310
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id`, path),
|
|
35311
|
+
method: "PATCH",
|
|
35312
|
+
data,
|
|
35313
|
+
params,
|
|
35314
|
+
headers,
|
|
35315
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35316
|
+
})
|
|
35317
|
+
.catch((e) => {
|
|
35318
|
+
this.logger.error(formatErrors(e));
|
|
35319
|
+
throw e;
|
|
35320
|
+
});
|
|
35321
|
+
}),
|
|
35322
|
+
/**
|
|
35323
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=regular&version=v1 click to debug }
|
|
35324
|
+
*
|
|
35325
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=regular&project=directory&resource=employee&version=v1 document }
|
|
35326
|
+
*
|
|
35327
|
+
* 待离职雇员恢复成在职状态
|
|
35328
|
+
*/
|
|
35329
|
+
regular: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35330
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35331
|
+
return this.httpInstance
|
|
35332
|
+
.request({
|
|
35333
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/regular`, path),
|
|
35334
|
+
method: "PATCH",
|
|
35335
|
+
data,
|
|
35336
|
+
params,
|
|
35337
|
+
headers,
|
|
35338
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35339
|
+
})
|
|
35340
|
+
.catch((e) => {
|
|
35341
|
+
this.logger.error(formatErrors(e));
|
|
35342
|
+
throw e;
|
|
35343
|
+
});
|
|
35344
|
+
}),
|
|
35345
|
+
/**
|
|
35346
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=resurrect&version=v1 click to debug }
|
|
35347
|
+
*
|
|
35348
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=resurrect&project=directory&resource=employee&version=v1 document }
|
|
35349
|
+
*
|
|
35350
|
+
* 恢复员工信息
|
|
35351
|
+
*/
|
|
35352
|
+
resurrect: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35353
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35354
|
+
return this.httpInstance
|
|
35355
|
+
.request({
|
|
35356
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/resurrect`, path),
|
|
35357
|
+
method: "POST",
|
|
35358
|
+
data,
|
|
35359
|
+
params,
|
|
35360
|
+
headers,
|
|
35361
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35362
|
+
})
|
|
35363
|
+
.catch((e) => {
|
|
35364
|
+
this.logger.error(formatErrors(e));
|
|
35365
|
+
throw e;
|
|
35366
|
+
});
|
|
35367
|
+
}),
|
|
35368
|
+
/**
|
|
35369
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=search&version=v1 click to debug }
|
|
35370
|
+
*
|
|
35371
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=search&project=directory&resource=employee&version=v1 document }
|
|
35372
|
+
*
|
|
35373
|
+
* 搜索租户内员工
|
|
35374
|
+
*/
|
|
35375
|
+
search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35376
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35377
|
+
return this.httpInstance
|
|
35378
|
+
.request({
|
|
35379
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/search`, path),
|
|
35380
|
+
method: "POST",
|
|
35381
|
+
data,
|
|
35382
|
+
params,
|
|
35383
|
+
headers,
|
|
35384
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35385
|
+
})
|
|
35386
|
+
.catch((e) => {
|
|
35387
|
+
this.logger.error(formatErrors(e));
|
|
35388
|
+
throw e;
|
|
35389
|
+
});
|
|
35390
|
+
}),
|
|
35391
|
+
/**
|
|
35392
|
+
* {@link https://open.feishu.cn/api-explorer?project=directory&resource=employee&apiName=to_be_resigned&version=v1 click to debug }
|
|
35393
|
+
*
|
|
35394
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=to_be_resigned&project=directory&resource=employee&version=v1 document }
|
|
35395
|
+
*
|
|
35396
|
+
* 更新在职雇员到待离职状态
|
|
35397
|
+
*/
|
|
35398
|
+
toBeResigned: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
35399
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
35400
|
+
return this.httpInstance
|
|
35401
|
+
.request({
|
|
35402
|
+
url: fillApiPath(`${this.domain}/open-apis/directory/v1/employees/:employee_id/to_be_resigned`, path),
|
|
35403
|
+
method: "PATCH",
|
|
35404
|
+
data,
|
|
35405
|
+
params,
|
|
35406
|
+
headers,
|
|
35407
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
35408
|
+
})
|
|
35409
|
+
.catch((e) => {
|
|
35410
|
+
this.logger.error(formatErrors(e));
|
|
35411
|
+
throw e;
|
|
35412
|
+
});
|
|
35413
|
+
}),
|
|
35414
|
+
},
|
|
35415
|
+
},
|
|
35416
|
+
};
|
|
35417
|
+
}
|
|
35418
|
+
}
|
|
35419
|
+
|
|
34253
35420
|
// auto gen
|
|
34254
35421
|
class Client$K extends Client$L {
|
|
34255
35422
|
constructor() {
|
|
@@ -36535,7 +37702,7 @@ class Client$G extends Client$H {
|
|
|
36535
37702
|
}),
|
|
36536
37703
|
},
|
|
36537
37704
|
/**
|
|
36538
|
-
*
|
|
37705
|
+
* 下载
|
|
36539
37706
|
*/
|
|
36540
37707
|
file: {
|
|
36541
37708
|
/**
|
|
@@ -38355,7 +39522,7 @@ class Client$G extends Client$H {
|
|
|
38355
39522
|
}),
|
|
38356
39523
|
},
|
|
38357
39524
|
/**
|
|
38358
|
-
*
|
|
39525
|
+
* 下载
|
|
38359
39526
|
*/
|
|
38360
39527
|
file: {
|
|
38361
39528
|
/**
|
|
@@ -65390,6 +66557,64 @@ class Client$s extends Client$t {
|
|
|
65390
66557
|
}),
|
|
65391
66558
|
},
|
|
65392
66559
|
},
|
|
66560
|
+
v3: {
|
|
66561
|
+
/**
|
|
66562
|
+
* batch_country_region
|
|
66563
|
+
*/
|
|
66564
|
+
batchCountryRegion: {
|
|
66565
|
+
/**
|
|
66566
|
+
* {@link https://open.feishu.cn/api-explorer?project=mdm&resource=batch_country_region&apiName=get&version=v3 click to debug }
|
|
66567
|
+
*
|
|
66568
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=mdm&resource=batch_country_region&version=v3 document }
|
|
66569
|
+
*
|
|
66570
|
+
* 查询国家 / 地区
|
|
66571
|
+
*/
|
|
66572
|
+
get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
66573
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
66574
|
+
return this.httpInstance
|
|
66575
|
+
.request({
|
|
66576
|
+
url: fillApiPath(`${this.domain}/open-apis/mdm/v3/batch_country_region`, path),
|
|
66577
|
+
method: "GET",
|
|
66578
|
+
data,
|
|
66579
|
+
params,
|
|
66580
|
+
headers,
|
|
66581
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
66582
|
+
})
|
|
66583
|
+
.catch((e) => {
|
|
66584
|
+
this.logger.error(formatErrors(e));
|
|
66585
|
+
throw e;
|
|
66586
|
+
});
|
|
66587
|
+
}),
|
|
66588
|
+
},
|
|
66589
|
+
/**
|
|
66590
|
+
* country_region
|
|
66591
|
+
*/
|
|
66592
|
+
countryRegion: {
|
|
66593
|
+
/**
|
|
66594
|
+
* {@link https://open.feishu.cn/api-explorer?project=mdm&resource=country_region&apiName=list&version=v3 click to debug }
|
|
66595
|
+
*
|
|
66596
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=list&project=mdm&resource=country_region&version=v3 document }
|
|
66597
|
+
*
|
|
66598
|
+
* 搜索国家 / 地区
|
|
66599
|
+
*/
|
|
66600
|
+
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
66601
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
66602
|
+
return this.httpInstance
|
|
66603
|
+
.request({
|
|
66604
|
+
url: fillApiPath(`${this.domain}/open-apis/mdm/v3/country_regions`, path),
|
|
66605
|
+
method: "GET",
|
|
66606
|
+
data,
|
|
66607
|
+
params,
|
|
66608
|
+
headers,
|
|
66609
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
66610
|
+
})
|
|
66611
|
+
.catch((e) => {
|
|
66612
|
+
this.logger.error(formatErrors(e));
|
|
66613
|
+
throw e;
|
|
66614
|
+
});
|
|
66615
|
+
}),
|
|
66616
|
+
},
|
|
66617
|
+
},
|
|
65393
66618
|
};
|
|
65394
66619
|
}
|
|
65395
66620
|
}
|
|
@@ -78520,9 +79745,6 @@ class Client$2 extends Client$3 {
|
|
|
78520
79745
|
* 云文档-知识库
|
|
78521
79746
|
*/
|
|
78522
79747
|
this.wiki = {
|
|
78523
|
-
/**
|
|
78524
|
-
* 知识空间
|
|
78525
|
-
*/
|
|
78526
79748
|
space: {
|
|
78527
79749
|
/**
|
|
78528
79750
|
* {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space&apiName=create&version=v2 click to debug }
|
|
@@ -78683,9 +79905,6 @@ class Client$2 extends Client$3 {
|
|
|
78683
79905
|
});
|
|
78684
79906
|
}),
|
|
78685
79907
|
},
|
|
78686
|
-
/**
|
|
78687
|
-
* 空间成员
|
|
78688
|
-
*/
|
|
78689
79908
|
spaceMember: {
|
|
78690
79909
|
/**
|
|
78691
79910
|
* {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.member&apiName=create&version=v2 click to debug }
|
|
@@ -78763,9 +79982,6 @@ class Client$2 extends Client$3 {
|
|
|
78763
79982
|
});
|
|
78764
79983
|
}),
|
|
78765
79984
|
},
|
|
78766
|
-
/**
|
|
78767
|
-
* 节点
|
|
78768
|
-
*/
|
|
78769
79985
|
spaceNode: {
|
|
78770
79986
|
/**
|
|
78771
79987
|
* {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.node&apiName=copy&version=v2 click to debug }
|
|
@@ -78980,9 +80196,6 @@ class Client$2 extends Client$3 {
|
|
|
78980
80196
|
});
|
|
78981
80197
|
}),
|
|
78982
80198
|
},
|
|
78983
|
-
/**
|
|
78984
|
-
* 空间设置
|
|
78985
|
-
*/
|
|
78986
80199
|
spaceSetting: {
|
|
78987
80200
|
/**
|
|
78988
80201
|
* {@link https://open.feishu.cn/api-explorer?project=wiki&resource=space.setting&apiName=update&version=v2 click to debug }
|
|
@@ -79012,9 +80225,6 @@ class Client$2 extends Client$3 {
|
|
|
79012
80225
|
});
|
|
79013
80226
|
}),
|
|
79014
80227
|
},
|
|
79015
|
-
/**
|
|
79016
|
-
* 云文档
|
|
79017
|
-
*/
|
|
79018
80228
|
task: {
|
|
79019
80229
|
/**
|
|
79020
80230
|
* {@link https://open.feishu.cn/api-explorer?project=wiki&resource=task&apiName=get&version=v2 click to debug }
|
|
@@ -79044,6 +80254,86 @@ class Client$2 extends Client$3 {
|
|
|
79044
80254
|
});
|
|
79045
80255
|
}),
|
|
79046
80256
|
},
|
|
80257
|
+
v1: {
|
|
80258
|
+
/**
|
|
80259
|
+
* 知识库
|
|
80260
|
+
*/
|
|
80261
|
+
node: {
|
|
80262
|
+
searchWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
80263
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
80264
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
80265
|
+
const res = yield this.httpInstance
|
|
80266
|
+
.request({
|
|
80267
|
+
url: fillApiPath(`${this.domain}/open-apis/wiki/v1/nodes/search`, path),
|
|
80268
|
+
method: "POST",
|
|
80269
|
+
headers: pickBy__default["default"](innerPayload.headers, identity__default["default"]),
|
|
80270
|
+
params: pickBy__default["default"](innerPayload.params, identity__default["default"]),
|
|
80271
|
+
data,
|
|
80272
|
+
paramsSerializer: (params) => qs.stringify(params, {
|
|
80273
|
+
arrayFormat: "repeat",
|
|
80274
|
+
}),
|
|
80275
|
+
})
|
|
80276
|
+
.catch((e) => {
|
|
80277
|
+
this.logger.error(formatErrors(e));
|
|
80278
|
+
});
|
|
80279
|
+
return res;
|
|
80280
|
+
});
|
|
80281
|
+
const Iterable = {
|
|
80282
|
+
[Symbol.asyncIterator]() {
|
|
80283
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
80284
|
+
let hasMore = true;
|
|
80285
|
+
let pageToken;
|
|
80286
|
+
while (hasMore) {
|
|
80287
|
+
try {
|
|
80288
|
+
const res = yield __await(sendRequest({
|
|
80289
|
+
headers,
|
|
80290
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
80291
|
+
data,
|
|
80292
|
+
}));
|
|
80293
|
+
const _b = (res === null || res === void 0 ? void 0 : res.data) || {}, {
|
|
80294
|
+
// @ts-ignore
|
|
80295
|
+
has_more,
|
|
80296
|
+
// @ts-ignore
|
|
80297
|
+
page_token,
|
|
80298
|
+
// @ts-ignore
|
|
80299
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
80300
|
+
yield yield __await(rest);
|
|
80301
|
+
hasMore = Boolean(has_more);
|
|
80302
|
+
pageToken = page_token || next_page_token;
|
|
80303
|
+
}
|
|
80304
|
+
catch (e) {
|
|
80305
|
+
yield yield __await(null);
|
|
80306
|
+
break;
|
|
80307
|
+
}
|
|
80308
|
+
}
|
|
80309
|
+
});
|
|
80310
|
+
},
|
|
80311
|
+
};
|
|
80312
|
+
return Iterable;
|
|
80313
|
+
}),
|
|
80314
|
+
/**
|
|
80315
|
+
* {@link https://open.feishu.cn/api-explorer?project=wiki&resource=node&apiName=search&version=v1 click to debug }
|
|
80316
|
+
*
|
|
80317
|
+
* {@link https://open.feishu.cn/document/ukTMukTMukTM/uEzN0YjLxcDN24SM3QjN/search_wiki document }
|
|
80318
|
+
*/
|
|
80319
|
+
search: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
80320
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
80321
|
+
return this.httpInstance
|
|
80322
|
+
.request({
|
|
80323
|
+
url: fillApiPath(`${this.domain}/open-apis/wiki/v1/nodes/search`, path),
|
|
80324
|
+
method: "POST",
|
|
80325
|
+
data,
|
|
80326
|
+
params,
|
|
80327
|
+
headers,
|
|
80328
|
+
paramsSerializer: (params) => qs.stringify(params, { arrayFormat: "repeat" }),
|
|
80329
|
+
})
|
|
80330
|
+
.catch((e) => {
|
|
80331
|
+
this.logger.error(formatErrors(e));
|
|
80332
|
+
throw e;
|
|
80333
|
+
});
|
|
80334
|
+
}),
|
|
80335
|
+
},
|
|
80336
|
+
},
|
|
79047
80337
|
v2: {
|
|
79048
80338
|
/**
|
|
79049
80339
|
* 知识空间
|
|
@@ -81562,7 +82852,11 @@ class WSClient {
|
|
|
81562
82852
|
if (this.pingInterval) {
|
|
81563
82853
|
clearTimeout(this.pingInterval);
|
|
81564
82854
|
}
|
|
82855
|
+
const wsInstance = this.wsConfig.getWSInstance();
|
|
81565
82856
|
if (isStart) {
|
|
82857
|
+
if (wsInstance) {
|
|
82858
|
+
wsInstance === null || wsInstance === void 0 ? void 0 : wsInstance.terminate();
|
|
82859
|
+
}
|
|
81566
82860
|
const isSuccess = yield tryConnect();
|
|
81567
82861
|
if (!isSuccess) {
|
|
81568
82862
|
this.logger.error('[ws]', 'connect failed');
|
|
@@ -81571,7 +82865,6 @@ class WSClient {
|
|
|
81571
82865
|
this.logger.info('[ws]', 'ws client ready');
|
|
81572
82866
|
return;
|
|
81573
82867
|
}
|
|
81574
|
-
const wsInstance = this.wsConfig.getWSInstance();
|
|
81575
82868
|
const { autoReconnect, reconnectNonce, reconnectCount, reconnectInterval } = this.wsConfig.getWS();
|
|
81576
82869
|
if (!autoReconnect) {
|
|
81577
82870
|
return;
|