@larksuiteoapi/node-sdk 1.20.0 → 1.21.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 +196 -105
- package/lib/index.js +196 -105
- package/package.json +1 -1
- package/types/index.d.ts +1087 -400
package/es/index.js
CHANGED
|
@@ -570,7 +570,7 @@ class Client$1 {
|
|
|
570
570
|
},
|
|
571
571
|
};
|
|
572
572
|
/**
|
|
573
|
-
*
|
|
573
|
+
* 管理后台-数据报表
|
|
574
574
|
*/
|
|
575
575
|
this.admin = {
|
|
576
576
|
/**
|
|
@@ -1302,6 +1302,31 @@ class Client$1 {
|
|
|
1302
1302
|
});
|
|
1303
1303
|
}),
|
|
1304
1304
|
},
|
|
1305
|
+
/**
|
|
1306
|
+
* application.contacts_range
|
|
1307
|
+
*/
|
|
1308
|
+
applicationContactsRange: {
|
|
1309
|
+
/**
|
|
1310
|
+
* {@link https://open.feishu.cn/api-explorer?project=application&resource=application.contacts_range&apiName=patch&version=v6 click to debug }
|
|
1311
|
+
*
|
|
1312
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.contacts_range&version=v6 document }
|
|
1313
|
+
*/
|
|
1314
|
+
patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
1315
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
1316
|
+
return this.httpInstance
|
|
1317
|
+
.request({
|
|
1318
|
+
url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/contacts_range`, path),
|
|
1319
|
+
method: "PATCH",
|
|
1320
|
+
data,
|
|
1321
|
+
params,
|
|
1322
|
+
headers,
|
|
1323
|
+
})
|
|
1324
|
+
.catch((e) => {
|
|
1325
|
+
this.logger.error(formatErrors(e));
|
|
1326
|
+
throw e;
|
|
1327
|
+
});
|
|
1328
|
+
}),
|
|
1329
|
+
},
|
|
1305
1330
|
/**
|
|
1306
1331
|
* 应用
|
|
1307
1332
|
*/
|
|
@@ -1524,6 +1549,26 @@ class Client$1 {
|
|
|
1524
1549
|
throw e;
|
|
1525
1550
|
});
|
|
1526
1551
|
}),
|
|
1552
|
+
/**
|
|
1553
|
+
* {@link https://open.feishu.cn/api-explorer?project=application&resource=application.visibility&apiName=patch&version=v6 click to debug }
|
|
1554
|
+
*
|
|
1555
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=patch&project=application&resource=application.visibility&version=v6 document }
|
|
1556
|
+
*/
|
|
1557
|
+
patch: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
1558
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
1559
|
+
return this.httpInstance
|
|
1560
|
+
.request({
|
|
1561
|
+
url: fillApiPath(`${this.domain}/open-apis/application/v6/applications/:app_id/visibility`, path),
|
|
1562
|
+
method: "PATCH",
|
|
1563
|
+
data,
|
|
1564
|
+
params,
|
|
1565
|
+
headers,
|
|
1566
|
+
})
|
|
1567
|
+
.catch((e) => {
|
|
1568
|
+
this.logger.error(formatErrors(e));
|
|
1569
|
+
throw e;
|
|
1570
|
+
});
|
|
1571
|
+
}),
|
|
1527
1572
|
},
|
|
1528
1573
|
};
|
|
1529
1574
|
/**
|
|
@@ -1531,7 +1576,7 @@ class Client$1 {
|
|
|
1531
1576
|
*/
|
|
1532
1577
|
this.approval = {
|
|
1533
1578
|
/**
|
|
1534
|
-
*
|
|
1579
|
+
* 原生审批定义
|
|
1535
1580
|
*/
|
|
1536
1581
|
approval: {
|
|
1537
1582
|
/**
|
|
@@ -2297,7 +2342,7 @@ class Client$1 {
|
|
|
2297
2342
|
}),
|
|
2298
2343
|
},
|
|
2299
2344
|
/**
|
|
2300
|
-
*
|
|
2345
|
+
* 原生审批任务
|
|
2301
2346
|
*/
|
|
2302
2347
|
task: {
|
|
2303
2348
|
/**
|
|
@@ -3613,6 +3658,81 @@ class Client$1 {
|
|
|
3613
3658
|
});
|
|
3614
3659
|
}),
|
|
3615
3660
|
},
|
|
3661
|
+
/**
|
|
3662
|
+
* authorize
|
|
3663
|
+
*/
|
|
3664
|
+
authorize: {
|
|
3665
|
+
/**
|
|
3666
|
+
* {@link https://open.feishu.cn/api-explorer?project=authen&resource=authorize&apiName=get&version=v1 click to debug }
|
|
3667
|
+
*
|
|
3668
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=get&project=authen&resource=authorize&version=v1 document }
|
|
3669
|
+
*/
|
|
3670
|
+
get: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
3671
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
3672
|
+
return this.httpInstance
|
|
3673
|
+
.request({
|
|
3674
|
+
url: fillApiPath(`${this.domain}/open-apis/authen/v1/authorize`, path),
|
|
3675
|
+
method: "GET",
|
|
3676
|
+
data,
|
|
3677
|
+
params,
|
|
3678
|
+
headers,
|
|
3679
|
+
})
|
|
3680
|
+
.catch((e) => {
|
|
3681
|
+
this.logger.error(formatErrors(e));
|
|
3682
|
+
throw e;
|
|
3683
|
+
});
|
|
3684
|
+
}),
|
|
3685
|
+
},
|
|
3686
|
+
/**
|
|
3687
|
+
* oidc.access_token
|
|
3688
|
+
*/
|
|
3689
|
+
oidcAccessToken: {
|
|
3690
|
+
/**
|
|
3691
|
+
* {@link https://open.feishu.cn/api-explorer?project=authen&resource=oidc.access_token&apiName=create&version=v1 click to debug }
|
|
3692
|
+
*
|
|
3693
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.access_token&version=v1 document }
|
|
3694
|
+
*/
|
|
3695
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
3696
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
3697
|
+
return this.httpInstance
|
|
3698
|
+
.request({
|
|
3699
|
+
url: fillApiPath(`${this.domain}/open-apis/authen/v1/oidc/access_token`, path),
|
|
3700
|
+
method: "POST",
|
|
3701
|
+
data,
|
|
3702
|
+
params,
|
|
3703
|
+
headers,
|
|
3704
|
+
})
|
|
3705
|
+
.catch((e) => {
|
|
3706
|
+
this.logger.error(formatErrors(e));
|
|
3707
|
+
throw e;
|
|
3708
|
+
});
|
|
3709
|
+
}),
|
|
3710
|
+
},
|
|
3711
|
+
/**
|
|
3712
|
+
* oidc.refresh_access_token
|
|
3713
|
+
*/
|
|
3714
|
+
oidcRefreshAccessToken: {
|
|
3715
|
+
/**
|
|
3716
|
+
* {@link https://open.feishu.cn/api-explorer?project=authen&resource=oidc.refresh_access_token&apiName=create&version=v1 click to debug }
|
|
3717
|
+
*
|
|
3718
|
+
* {@link https://open.feishu.cn/api-explorer?from=op_doc_tab&apiName=create&project=authen&resource=oidc.refresh_access_token&version=v1 document }
|
|
3719
|
+
*/
|
|
3720
|
+
create: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
3721
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
3722
|
+
return this.httpInstance
|
|
3723
|
+
.request({
|
|
3724
|
+
url: fillApiPath(`${this.domain}/open-apis/authen/v1/oidc/refresh_access_token`, path),
|
|
3725
|
+
method: "POST",
|
|
3726
|
+
data,
|
|
3727
|
+
params,
|
|
3728
|
+
headers,
|
|
3729
|
+
})
|
|
3730
|
+
.catch((e) => {
|
|
3731
|
+
this.logger.error(formatErrors(e));
|
|
3732
|
+
throw e;
|
|
3733
|
+
});
|
|
3734
|
+
}),
|
|
3735
|
+
},
|
|
3616
3736
|
/**
|
|
3617
3737
|
* refresh_access_token
|
|
3618
3738
|
*/
|
|
@@ -12387,6 +12507,78 @@ class Client$1 {
|
|
|
12387
12507
|
throw e;
|
|
12388
12508
|
});
|
|
12389
12509
|
}),
|
|
12510
|
+
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
12511
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
12512
|
+
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
12513
|
+
const res = yield this.httpInstance
|
|
12514
|
+
.request({
|
|
12515
|
+
url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`, path),
|
|
12516
|
+
method: "GET",
|
|
12517
|
+
headers: pickBy(innerPayload.headers, identity),
|
|
12518
|
+
params: pickBy(innerPayload.params, identity),
|
|
12519
|
+
})
|
|
12520
|
+
.catch((e) => {
|
|
12521
|
+
this.logger.error(formatErrors(e));
|
|
12522
|
+
});
|
|
12523
|
+
return res;
|
|
12524
|
+
});
|
|
12525
|
+
const Iterable = {
|
|
12526
|
+
[Symbol.asyncIterator]() {
|
|
12527
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
12528
|
+
let hasMore = true;
|
|
12529
|
+
let pageToken;
|
|
12530
|
+
while (hasMore) {
|
|
12531
|
+
try {
|
|
12532
|
+
const res = yield __await(sendRequest({
|
|
12533
|
+
headers,
|
|
12534
|
+
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
12535
|
+
data,
|
|
12536
|
+
}));
|
|
12537
|
+
const _b = get(res, "data") || {}, {
|
|
12538
|
+
// @ts-ignore
|
|
12539
|
+
has_more,
|
|
12540
|
+
// @ts-ignore
|
|
12541
|
+
page_token,
|
|
12542
|
+
// @ts-ignore
|
|
12543
|
+
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
12544
|
+
yield yield __await(rest);
|
|
12545
|
+
hasMore = Boolean(has_more);
|
|
12546
|
+
pageToken = page_token || next_page_token;
|
|
12547
|
+
}
|
|
12548
|
+
catch (e) {
|
|
12549
|
+
yield yield __await(null);
|
|
12550
|
+
break;
|
|
12551
|
+
}
|
|
12552
|
+
}
|
|
12553
|
+
});
|
|
12554
|
+
},
|
|
12555
|
+
};
|
|
12556
|
+
return Iterable;
|
|
12557
|
+
}),
|
|
12558
|
+
/**
|
|
12559
|
+
* {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=list&version=v1 click to debug }
|
|
12560
|
+
*
|
|
12561
|
+
* {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/drive-v1/file-comment-reply/list document }
|
|
12562
|
+
*
|
|
12563
|
+
* 获取回复
|
|
12564
|
+
*
|
|
12565
|
+
* 该接口用于根据评论 ID 以及分页参数,获取回复。
|
|
12566
|
+
*/
|
|
12567
|
+
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
12568
|
+
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
12569
|
+
return this.httpInstance
|
|
12570
|
+
.request({
|
|
12571
|
+
url: fillApiPath(`${this.domain}/open-apis/drive/v1/files/:file_token/comments/:comment_id/replies`, path),
|
|
12572
|
+
method: "GET",
|
|
12573
|
+
data,
|
|
12574
|
+
params,
|
|
12575
|
+
headers,
|
|
12576
|
+
})
|
|
12577
|
+
.catch((e) => {
|
|
12578
|
+
this.logger.error(formatErrors(e));
|
|
12579
|
+
throw e;
|
|
12580
|
+
});
|
|
12581
|
+
}),
|
|
12390
12582
|
/**
|
|
12391
12583
|
* {@link https://open.feishu.cn/api-explorer?project=drive&resource=file.comment.reply&apiName=update&version=v1 click to debug }
|
|
12392
12584
|
*
|
|
@@ -18495,7 +18687,7 @@ class Client$1 {
|
|
|
18495
18687
|
}),
|
|
18496
18688
|
},
|
|
18497
18689
|
/**
|
|
18498
|
-
*
|
|
18690
|
+
* 消息 - 消息卡片
|
|
18499
18691
|
*/
|
|
18500
18692
|
message: {
|
|
18501
18693
|
/**
|
|
@@ -19283,107 +19475,6 @@ class Client$1 {
|
|
|
19283
19475
|
});
|
|
19284
19476
|
}),
|
|
19285
19477
|
},
|
|
19286
|
-
/**
|
|
19287
|
-
* 特别关注(灰度租户可见)
|
|
19288
|
-
*/
|
|
19289
|
-
specialFocus: {
|
|
19290
|
-
listWithIterator: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
19291
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
19292
|
-
const sendRequest = (innerPayload) => __awaiter(this, void 0, void 0, function* () {
|
|
19293
|
-
const res = yield this.httpInstance
|
|
19294
|
-
.request({
|
|
19295
|
-
url: fillApiPath(`${this.domain}/open-apis/im/v1/special_focus`, path),
|
|
19296
|
-
method: "GET",
|
|
19297
|
-
headers: pickBy(innerPayload.headers, identity),
|
|
19298
|
-
params: pickBy(innerPayload.params, identity),
|
|
19299
|
-
})
|
|
19300
|
-
.catch((e) => {
|
|
19301
|
-
this.logger.error(formatErrors(e));
|
|
19302
|
-
});
|
|
19303
|
-
return res;
|
|
19304
|
-
});
|
|
19305
|
-
const Iterable = {
|
|
19306
|
-
[Symbol.asyncIterator]() {
|
|
19307
|
-
return __asyncGenerator(this, arguments, function* _a() {
|
|
19308
|
-
let hasMore = true;
|
|
19309
|
-
let pageToken;
|
|
19310
|
-
while (hasMore) {
|
|
19311
|
-
try {
|
|
19312
|
-
const res = yield __await(sendRequest({
|
|
19313
|
-
headers,
|
|
19314
|
-
params: Object.assign(Object.assign({}, params), { page_token: pageToken }),
|
|
19315
|
-
data,
|
|
19316
|
-
}));
|
|
19317
|
-
const _b = get(res, "data") || {}, {
|
|
19318
|
-
// @ts-ignore
|
|
19319
|
-
has_more,
|
|
19320
|
-
// @ts-ignore
|
|
19321
|
-
page_token,
|
|
19322
|
-
// @ts-ignore
|
|
19323
|
-
next_page_token } = _b, rest = __rest(_b, ["has_more", "page_token", "next_page_token"]);
|
|
19324
|
-
yield yield __await(rest);
|
|
19325
|
-
hasMore = Boolean(has_more);
|
|
19326
|
-
pageToken = page_token || next_page_token;
|
|
19327
|
-
}
|
|
19328
|
-
catch (e) {
|
|
19329
|
-
yield yield __await(null);
|
|
19330
|
-
break;
|
|
19331
|
-
}
|
|
19332
|
-
}
|
|
19333
|
-
});
|
|
19334
|
-
},
|
|
19335
|
-
};
|
|
19336
|
-
return Iterable;
|
|
19337
|
-
}),
|
|
19338
|
-
/**
|
|
19339
|
-
* {@link https://open.feishu.cn/api-explorer?project=im&resource=special_focus&apiName=list&version=v1 click to debug }
|
|
19340
|
-
*
|
|
19341
|
-
* {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/special_focus/list document }
|
|
19342
|
-
*
|
|
19343
|
-
* 获取特别关注列表
|
|
19344
|
-
*
|
|
19345
|
-
* 获取用户的特别关注列表。
|
|
19346
|
-
*/
|
|
19347
|
-
list: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
19348
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
19349
|
-
return this.httpInstance
|
|
19350
|
-
.request({
|
|
19351
|
-
url: fillApiPath(`${this.domain}/open-apis/im/v1/special_focus`, path),
|
|
19352
|
-
method: "GET",
|
|
19353
|
-
data,
|
|
19354
|
-
params,
|
|
19355
|
-
headers,
|
|
19356
|
-
})
|
|
19357
|
-
.catch((e) => {
|
|
19358
|
-
this.logger.error(formatErrors(e));
|
|
19359
|
-
throw e;
|
|
19360
|
-
});
|
|
19361
|
-
}),
|
|
19362
|
-
/**
|
|
19363
|
-
* {@link https://open.feishu.cn/api-explorer?project=im&resource=special_focus&apiName=unread&version=v1 click to debug }
|
|
19364
|
-
*
|
|
19365
|
-
* {@link https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/im-v1/special_focus/unread document }
|
|
19366
|
-
*
|
|
19367
|
-
* 获取特别关注未读信息
|
|
19368
|
-
*
|
|
19369
|
-
* 支持按单聊类型和群聊类型获取用户的特别关注未读消息数。
|
|
19370
|
-
*/
|
|
19371
|
-
unread: (payload, options) => __awaiter(this, void 0, void 0, function* () {
|
|
19372
|
-
const { headers, params, data, path } = yield this.formatPayload(payload, options);
|
|
19373
|
-
return this.httpInstance
|
|
19374
|
-
.request({
|
|
19375
|
-
url: fillApiPath(`${this.domain}/open-apis/im/v1/special_focus/unread`, path),
|
|
19376
|
-
method: "POST",
|
|
19377
|
-
data,
|
|
19378
|
-
params,
|
|
19379
|
-
headers,
|
|
19380
|
-
})
|
|
19381
|
-
.catch((e) => {
|
|
19382
|
-
this.logger.error(formatErrors(e));
|
|
19383
|
-
throw e;
|
|
19384
|
-
});
|
|
19385
|
-
}),
|
|
19386
|
-
},
|
|
19387
19478
|
};
|
|
19388
19479
|
/**
|
|
19389
19480
|
* 邮箱
|