@larksuiteoapi/node-sdk 1.2.1 → 1.2.3
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 +142 -15
- package/lib/index.js +142 -14
- package/package.json +3 -1
- package/types/index.d.ts +16 -15
package/es/index.js
CHANGED
|
@@ -241,7 +241,16 @@ class Client$1 {
|
|
|
241
241
|
});
|
|
242
242
|
return {
|
|
243
243
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
244
|
-
|
|
244
|
+
return new Promise((resolve, reject) => {
|
|
245
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
246
|
+
writableStream.on("finish", () => {
|
|
247
|
+
resolve(filePath);
|
|
248
|
+
});
|
|
249
|
+
writableStream.on("error", (e) => {
|
|
250
|
+
reject(e);
|
|
251
|
+
});
|
|
252
|
+
res.pipe(writableStream);
|
|
253
|
+
});
|
|
245
254
|
}),
|
|
246
255
|
};
|
|
247
256
|
}),
|
|
@@ -382,7 +391,16 @@ class Client$1 {
|
|
|
382
391
|
});
|
|
383
392
|
return {
|
|
384
393
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
385
|
-
|
|
394
|
+
return new Promise((resolve, reject) => {
|
|
395
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
396
|
+
writableStream.on("finish", () => {
|
|
397
|
+
resolve(filePath);
|
|
398
|
+
});
|
|
399
|
+
writableStream.on("error", (e) => {
|
|
400
|
+
reject(e);
|
|
401
|
+
});
|
|
402
|
+
res.pipe(writableStream);
|
|
403
|
+
});
|
|
386
404
|
}),
|
|
387
405
|
};
|
|
388
406
|
}),
|
|
@@ -2408,7 +2426,16 @@ class Client$1 {
|
|
|
2408
2426
|
});
|
|
2409
2427
|
return {
|
|
2410
2428
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
2411
|
-
|
|
2429
|
+
return new Promise((resolve, reject) => {
|
|
2430
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
2431
|
+
writableStream.on("finish", () => {
|
|
2432
|
+
resolve(filePath);
|
|
2433
|
+
});
|
|
2434
|
+
writableStream.on("error", (e) => {
|
|
2435
|
+
reject(e);
|
|
2436
|
+
});
|
|
2437
|
+
res.pipe(writableStream);
|
|
2438
|
+
});
|
|
2412
2439
|
}),
|
|
2413
2440
|
};
|
|
2414
2441
|
}),
|
|
@@ -3693,7 +3720,16 @@ class Client$1 {
|
|
|
3693
3720
|
});
|
|
3694
3721
|
return {
|
|
3695
3722
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
3696
|
-
|
|
3723
|
+
return new Promise((resolve, reject) => {
|
|
3724
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
3725
|
+
writableStream.on("finish", () => {
|
|
3726
|
+
resolve(filePath);
|
|
3727
|
+
});
|
|
3728
|
+
writableStream.on("error", (e) => {
|
|
3729
|
+
reject(e);
|
|
3730
|
+
});
|
|
3731
|
+
res.pipe(writableStream);
|
|
3732
|
+
});
|
|
3697
3733
|
}),
|
|
3698
3734
|
};
|
|
3699
3735
|
}),
|
|
@@ -8397,7 +8433,16 @@ class Client$1 {
|
|
|
8397
8433
|
});
|
|
8398
8434
|
return {
|
|
8399
8435
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
8400
|
-
|
|
8436
|
+
return new Promise((resolve, reject) => {
|
|
8437
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
8438
|
+
writableStream.on("finish", () => {
|
|
8439
|
+
resolve(filePath);
|
|
8440
|
+
});
|
|
8441
|
+
writableStream.on("error", (e) => {
|
|
8442
|
+
reject(e);
|
|
8443
|
+
});
|
|
8444
|
+
res.pipe(writableStream);
|
|
8445
|
+
});
|
|
8401
8446
|
}),
|
|
8402
8447
|
};
|
|
8403
8448
|
}),
|
|
@@ -8742,7 +8787,16 @@ class Client$1 {
|
|
|
8742
8787
|
});
|
|
8743
8788
|
return {
|
|
8744
8789
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
8745
|
-
|
|
8790
|
+
return new Promise((resolve, reject) => {
|
|
8791
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
8792
|
+
writableStream.on("finish", () => {
|
|
8793
|
+
resolve(filePath);
|
|
8794
|
+
});
|
|
8795
|
+
writableStream.on("error", (e) => {
|
|
8796
|
+
reject(e);
|
|
8797
|
+
});
|
|
8798
|
+
res.pipe(writableStream);
|
|
8799
|
+
});
|
|
8746
8800
|
}),
|
|
8747
8801
|
};
|
|
8748
8802
|
}),
|
|
@@ -9218,7 +9272,16 @@ class Client$1 {
|
|
|
9218
9272
|
});
|
|
9219
9273
|
return {
|
|
9220
9274
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
9221
|
-
|
|
9275
|
+
return new Promise((resolve, reject) => {
|
|
9276
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
9277
|
+
writableStream.on("finish", () => {
|
|
9278
|
+
resolve(filePath);
|
|
9279
|
+
});
|
|
9280
|
+
writableStream.on("error", (e) => {
|
|
9281
|
+
reject(e);
|
|
9282
|
+
});
|
|
9283
|
+
res.pipe(writableStream);
|
|
9284
|
+
});
|
|
9222
9285
|
}),
|
|
9223
9286
|
};
|
|
9224
9287
|
}),
|
|
@@ -9535,7 +9598,16 @@ class Client$1 {
|
|
|
9535
9598
|
});
|
|
9536
9599
|
return {
|
|
9537
9600
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
9538
|
-
|
|
9601
|
+
return new Promise((resolve, reject) => {
|
|
9602
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
9603
|
+
writableStream.on("finish", () => {
|
|
9604
|
+
resolve(filePath);
|
|
9605
|
+
});
|
|
9606
|
+
writableStream.on("error", (e) => {
|
|
9607
|
+
reject(e);
|
|
9608
|
+
});
|
|
9609
|
+
res.pipe(writableStream);
|
|
9610
|
+
});
|
|
9539
9611
|
}),
|
|
9540
9612
|
};
|
|
9541
9613
|
}),
|
|
@@ -10494,7 +10566,16 @@ class Client$1 {
|
|
|
10494
10566
|
});
|
|
10495
10567
|
return {
|
|
10496
10568
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
10497
|
-
|
|
10569
|
+
return new Promise((resolve, reject) => {
|
|
10570
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
10571
|
+
writableStream.on("finish", () => {
|
|
10572
|
+
resolve(filePath);
|
|
10573
|
+
});
|
|
10574
|
+
writableStream.on("error", (e) => {
|
|
10575
|
+
reject(e);
|
|
10576
|
+
});
|
|
10577
|
+
res.pipe(writableStream);
|
|
10578
|
+
});
|
|
10498
10579
|
}),
|
|
10499
10580
|
};
|
|
10500
10581
|
}),
|
|
@@ -11038,7 +11119,16 @@ class Client$1 {
|
|
|
11038
11119
|
});
|
|
11039
11120
|
return {
|
|
11040
11121
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
11041
|
-
|
|
11122
|
+
return new Promise((resolve, reject) => {
|
|
11123
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
11124
|
+
writableStream.on("finish", () => {
|
|
11125
|
+
resolve(filePath);
|
|
11126
|
+
});
|
|
11127
|
+
writableStream.on("error", (e) => {
|
|
11128
|
+
reject(e);
|
|
11129
|
+
});
|
|
11130
|
+
res.pipe(writableStream);
|
|
11131
|
+
});
|
|
11042
11132
|
}),
|
|
11043
11133
|
};
|
|
11044
11134
|
}),
|
|
@@ -13008,7 +13098,16 @@ class Client$1 {
|
|
|
13008
13098
|
});
|
|
13009
13099
|
return {
|
|
13010
13100
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13011
|
-
|
|
13101
|
+
return new Promise((resolve, reject) => {
|
|
13102
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
13103
|
+
writableStream.on("finish", () => {
|
|
13104
|
+
resolve(filePath);
|
|
13105
|
+
});
|
|
13106
|
+
writableStream.on("error", (e) => {
|
|
13107
|
+
reject(e);
|
|
13108
|
+
});
|
|
13109
|
+
res.pipe(writableStream);
|
|
13110
|
+
});
|
|
13012
13111
|
}),
|
|
13013
13112
|
};
|
|
13014
13113
|
}),
|
|
@@ -13072,7 +13171,16 @@ class Client$1 {
|
|
|
13072
13171
|
});
|
|
13073
13172
|
return {
|
|
13074
13173
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13075
|
-
|
|
13174
|
+
return new Promise((resolve, reject) => {
|
|
13175
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
13176
|
+
writableStream.on("finish", () => {
|
|
13177
|
+
resolve(filePath);
|
|
13178
|
+
});
|
|
13179
|
+
writableStream.on("error", (e) => {
|
|
13180
|
+
reject(e);
|
|
13181
|
+
});
|
|
13182
|
+
res.pipe(writableStream);
|
|
13183
|
+
});
|
|
13076
13184
|
}),
|
|
13077
13185
|
};
|
|
13078
13186
|
}),
|
|
@@ -13559,7 +13667,16 @@ class Client$1 {
|
|
|
13559
13667
|
});
|
|
13560
13668
|
return {
|
|
13561
13669
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13562
|
-
|
|
13670
|
+
return new Promise((resolve, reject) => {
|
|
13671
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
13672
|
+
writableStream.on("finish", () => {
|
|
13673
|
+
resolve(filePath);
|
|
13674
|
+
});
|
|
13675
|
+
writableStream.on("error", (e) => {
|
|
13676
|
+
reject(e);
|
|
13677
|
+
});
|
|
13678
|
+
res.pipe(writableStream);
|
|
13679
|
+
});
|
|
13563
13680
|
}),
|
|
13564
13681
|
};
|
|
13565
13682
|
}),
|
|
@@ -17392,7 +17509,16 @@ class Client$1 {
|
|
|
17392
17509
|
});
|
|
17393
17510
|
return {
|
|
17394
17511
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
17395
|
-
|
|
17512
|
+
return new Promise((resolve, reject) => {
|
|
17513
|
+
const writableStream = fs.createWriteStream(filePath);
|
|
17514
|
+
writableStream.on("finish", () => {
|
|
17515
|
+
resolve(filePath);
|
|
17516
|
+
});
|
|
17517
|
+
writableStream.on("error", (e) => {
|
|
17518
|
+
reject(e);
|
|
17519
|
+
});
|
|
17520
|
+
res.pipe(writableStream);
|
|
17521
|
+
});
|
|
17396
17522
|
}),
|
|
17397
17523
|
};
|
|
17398
17524
|
}),
|
|
@@ -18767,6 +18893,7 @@ class Client extends Client$1 {
|
|
|
18767
18893
|
this.logger = new LoggerProxy(params.loggerLevel || LoggerLevel.info, params.logger || defaultLogger);
|
|
18768
18894
|
this.appId = params.appId;
|
|
18769
18895
|
this.appSecret = params.appSecret;
|
|
18896
|
+
this.disableTokenCache = params.disableTokenCache;
|
|
18770
18897
|
assert(!this.appId, () => this.logger.error('appId is needed'));
|
|
18771
18898
|
assert(!this.appSecret, () => this.logger.error('appSecret is needed'));
|
|
18772
18899
|
this.helpDeskId = params.helpDeskId;
|
|
@@ -19181,4 +19308,4 @@ const adaptKoaRouter = (dispatcher, options) => (ctx, next) => __awaiter(void 0,
|
|
|
19181
19308
|
yield next();
|
|
19182
19309
|
});
|
|
19183
19310
|
|
|
19184
|
-
export { AESCipher, AppType, CardActionHandler, Client, Domain, EventDispatcher, LoggerLevel, adaptDefault, adaptExpress, adaptKoa, adaptKoaRouter, withAll, withHelpDeskCredential, withTenantKey, withTenantToken, withUserAccessToken };
|
|
19311
|
+
export { AESCipher, AppType, CAppTicket, CardActionHandler, Client, Domain, EventDispatcher, LoggerLevel, adaptDefault, adaptExpress, adaptKoa, adaptKoaRouter, withAll, withHelpDeskCredential, withTenantKey, withTenantToken, withUserAccessToken };
|
package/lib/index.js
CHANGED
|
@@ -256,7 +256,16 @@ class Client$1 {
|
|
|
256
256
|
});
|
|
257
257
|
return {
|
|
258
258
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
259
|
-
|
|
259
|
+
return new Promise((resolve, reject) => {
|
|
260
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
261
|
+
writableStream.on("finish", () => {
|
|
262
|
+
resolve(filePath);
|
|
263
|
+
});
|
|
264
|
+
writableStream.on("error", (e) => {
|
|
265
|
+
reject(e);
|
|
266
|
+
});
|
|
267
|
+
res.pipe(writableStream);
|
|
268
|
+
});
|
|
260
269
|
}),
|
|
261
270
|
};
|
|
262
271
|
}),
|
|
@@ -397,7 +406,16 @@ class Client$1 {
|
|
|
397
406
|
});
|
|
398
407
|
return {
|
|
399
408
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
400
|
-
|
|
409
|
+
return new Promise((resolve, reject) => {
|
|
410
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
411
|
+
writableStream.on("finish", () => {
|
|
412
|
+
resolve(filePath);
|
|
413
|
+
});
|
|
414
|
+
writableStream.on("error", (e) => {
|
|
415
|
+
reject(e);
|
|
416
|
+
});
|
|
417
|
+
res.pipe(writableStream);
|
|
418
|
+
});
|
|
401
419
|
}),
|
|
402
420
|
};
|
|
403
421
|
}),
|
|
@@ -2423,7 +2441,16 @@ class Client$1 {
|
|
|
2423
2441
|
});
|
|
2424
2442
|
return {
|
|
2425
2443
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
2426
|
-
|
|
2444
|
+
return new Promise((resolve, reject) => {
|
|
2445
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
2446
|
+
writableStream.on("finish", () => {
|
|
2447
|
+
resolve(filePath);
|
|
2448
|
+
});
|
|
2449
|
+
writableStream.on("error", (e) => {
|
|
2450
|
+
reject(e);
|
|
2451
|
+
});
|
|
2452
|
+
res.pipe(writableStream);
|
|
2453
|
+
});
|
|
2427
2454
|
}),
|
|
2428
2455
|
};
|
|
2429
2456
|
}),
|
|
@@ -3708,7 +3735,16 @@ class Client$1 {
|
|
|
3708
3735
|
});
|
|
3709
3736
|
return {
|
|
3710
3737
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
3711
|
-
|
|
3738
|
+
return new Promise((resolve, reject) => {
|
|
3739
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
3740
|
+
writableStream.on("finish", () => {
|
|
3741
|
+
resolve(filePath);
|
|
3742
|
+
});
|
|
3743
|
+
writableStream.on("error", (e) => {
|
|
3744
|
+
reject(e);
|
|
3745
|
+
});
|
|
3746
|
+
res.pipe(writableStream);
|
|
3747
|
+
});
|
|
3712
3748
|
}),
|
|
3713
3749
|
};
|
|
3714
3750
|
}),
|
|
@@ -8412,7 +8448,16 @@ class Client$1 {
|
|
|
8412
8448
|
});
|
|
8413
8449
|
return {
|
|
8414
8450
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
8415
|
-
|
|
8451
|
+
return new Promise((resolve, reject) => {
|
|
8452
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
8453
|
+
writableStream.on("finish", () => {
|
|
8454
|
+
resolve(filePath);
|
|
8455
|
+
});
|
|
8456
|
+
writableStream.on("error", (e) => {
|
|
8457
|
+
reject(e);
|
|
8458
|
+
});
|
|
8459
|
+
res.pipe(writableStream);
|
|
8460
|
+
});
|
|
8416
8461
|
}),
|
|
8417
8462
|
};
|
|
8418
8463
|
}),
|
|
@@ -8757,7 +8802,16 @@ class Client$1 {
|
|
|
8757
8802
|
});
|
|
8758
8803
|
return {
|
|
8759
8804
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
8760
|
-
|
|
8805
|
+
return new Promise((resolve, reject) => {
|
|
8806
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
8807
|
+
writableStream.on("finish", () => {
|
|
8808
|
+
resolve(filePath);
|
|
8809
|
+
});
|
|
8810
|
+
writableStream.on("error", (e) => {
|
|
8811
|
+
reject(e);
|
|
8812
|
+
});
|
|
8813
|
+
res.pipe(writableStream);
|
|
8814
|
+
});
|
|
8761
8815
|
}),
|
|
8762
8816
|
};
|
|
8763
8817
|
}),
|
|
@@ -9233,7 +9287,16 @@ class Client$1 {
|
|
|
9233
9287
|
});
|
|
9234
9288
|
return {
|
|
9235
9289
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
9236
|
-
|
|
9290
|
+
return new Promise((resolve, reject) => {
|
|
9291
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
9292
|
+
writableStream.on("finish", () => {
|
|
9293
|
+
resolve(filePath);
|
|
9294
|
+
});
|
|
9295
|
+
writableStream.on("error", (e) => {
|
|
9296
|
+
reject(e);
|
|
9297
|
+
});
|
|
9298
|
+
res.pipe(writableStream);
|
|
9299
|
+
});
|
|
9237
9300
|
}),
|
|
9238
9301
|
};
|
|
9239
9302
|
}),
|
|
@@ -9550,7 +9613,16 @@ class Client$1 {
|
|
|
9550
9613
|
});
|
|
9551
9614
|
return {
|
|
9552
9615
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
9553
|
-
|
|
9616
|
+
return new Promise((resolve, reject) => {
|
|
9617
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
9618
|
+
writableStream.on("finish", () => {
|
|
9619
|
+
resolve(filePath);
|
|
9620
|
+
});
|
|
9621
|
+
writableStream.on("error", (e) => {
|
|
9622
|
+
reject(e);
|
|
9623
|
+
});
|
|
9624
|
+
res.pipe(writableStream);
|
|
9625
|
+
});
|
|
9554
9626
|
}),
|
|
9555
9627
|
};
|
|
9556
9628
|
}),
|
|
@@ -10509,7 +10581,16 @@ class Client$1 {
|
|
|
10509
10581
|
});
|
|
10510
10582
|
return {
|
|
10511
10583
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
10512
|
-
|
|
10584
|
+
return new Promise((resolve, reject) => {
|
|
10585
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
10586
|
+
writableStream.on("finish", () => {
|
|
10587
|
+
resolve(filePath);
|
|
10588
|
+
});
|
|
10589
|
+
writableStream.on("error", (e) => {
|
|
10590
|
+
reject(e);
|
|
10591
|
+
});
|
|
10592
|
+
res.pipe(writableStream);
|
|
10593
|
+
});
|
|
10513
10594
|
}),
|
|
10514
10595
|
};
|
|
10515
10596
|
}),
|
|
@@ -11053,7 +11134,16 @@ class Client$1 {
|
|
|
11053
11134
|
});
|
|
11054
11135
|
return {
|
|
11055
11136
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
11056
|
-
|
|
11137
|
+
return new Promise((resolve, reject) => {
|
|
11138
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
11139
|
+
writableStream.on("finish", () => {
|
|
11140
|
+
resolve(filePath);
|
|
11141
|
+
});
|
|
11142
|
+
writableStream.on("error", (e) => {
|
|
11143
|
+
reject(e);
|
|
11144
|
+
});
|
|
11145
|
+
res.pipe(writableStream);
|
|
11146
|
+
});
|
|
11057
11147
|
}),
|
|
11058
11148
|
};
|
|
11059
11149
|
}),
|
|
@@ -13023,7 +13113,16 @@ class Client$1 {
|
|
|
13023
13113
|
});
|
|
13024
13114
|
return {
|
|
13025
13115
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13026
|
-
|
|
13116
|
+
return new Promise((resolve, reject) => {
|
|
13117
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
13118
|
+
writableStream.on("finish", () => {
|
|
13119
|
+
resolve(filePath);
|
|
13120
|
+
});
|
|
13121
|
+
writableStream.on("error", (e) => {
|
|
13122
|
+
reject(e);
|
|
13123
|
+
});
|
|
13124
|
+
res.pipe(writableStream);
|
|
13125
|
+
});
|
|
13027
13126
|
}),
|
|
13028
13127
|
};
|
|
13029
13128
|
}),
|
|
@@ -13087,7 +13186,16 @@ class Client$1 {
|
|
|
13087
13186
|
});
|
|
13088
13187
|
return {
|
|
13089
13188
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13090
|
-
|
|
13189
|
+
return new Promise((resolve, reject) => {
|
|
13190
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
13191
|
+
writableStream.on("finish", () => {
|
|
13192
|
+
resolve(filePath);
|
|
13193
|
+
});
|
|
13194
|
+
writableStream.on("error", (e) => {
|
|
13195
|
+
reject(e);
|
|
13196
|
+
});
|
|
13197
|
+
res.pipe(writableStream);
|
|
13198
|
+
});
|
|
13091
13199
|
}),
|
|
13092
13200
|
};
|
|
13093
13201
|
}),
|
|
@@ -13574,7 +13682,16 @@ class Client$1 {
|
|
|
13574
13682
|
});
|
|
13575
13683
|
return {
|
|
13576
13684
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13577
|
-
|
|
13685
|
+
return new Promise((resolve, reject) => {
|
|
13686
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
13687
|
+
writableStream.on("finish", () => {
|
|
13688
|
+
resolve(filePath);
|
|
13689
|
+
});
|
|
13690
|
+
writableStream.on("error", (e) => {
|
|
13691
|
+
reject(e);
|
|
13692
|
+
});
|
|
13693
|
+
res.pipe(writableStream);
|
|
13694
|
+
});
|
|
13578
13695
|
}),
|
|
13579
13696
|
};
|
|
13580
13697
|
}),
|
|
@@ -17407,7 +17524,16 @@ class Client$1 {
|
|
|
17407
17524
|
});
|
|
17408
17525
|
return {
|
|
17409
17526
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
17410
|
-
|
|
17527
|
+
return new Promise((resolve, reject) => {
|
|
17528
|
+
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
17529
|
+
writableStream.on("finish", () => {
|
|
17530
|
+
resolve(filePath);
|
|
17531
|
+
});
|
|
17532
|
+
writableStream.on("error", (e) => {
|
|
17533
|
+
reject(e);
|
|
17534
|
+
});
|
|
17535
|
+
res.pipe(writableStream);
|
|
17536
|
+
});
|
|
17411
17537
|
}),
|
|
17412
17538
|
};
|
|
17413
17539
|
}),
|
|
@@ -18782,6 +18908,7 @@ class Client extends Client$1 {
|
|
|
18782
18908
|
this.logger = new LoggerProxy(params.loggerLevel || exports.LoggerLevel.info, params.logger || defaultLogger);
|
|
18783
18909
|
this.appId = params.appId;
|
|
18784
18910
|
this.appSecret = params.appSecret;
|
|
18911
|
+
this.disableTokenCache = params.disableTokenCache;
|
|
18785
18912
|
assert(!this.appId, () => this.logger.error('appId is needed'));
|
|
18786
18913
|
assert(!this.appSecret, () => this.logger.error('appSecret is needed'));
|
|
18787
18914
|
this.helpDeskId = params.helpDeskId;
|
|
@@ -19197,6 +19324,7 @@ const adaptKoaRouter = (dispatcher, options) => (ctx, next) => __awaiter(void 0,
|
|
|
19197
19324
|
});
|
|
19198
19325
|
|
|
19199
19326
|
exports.AESCipher = AESCipher;
|
|
19327
|
+
exports.CAppTicket = CAppTicket;
|
|
19200
19328
|
exports.CardActionHandler = CardActionHandler;
|
|
19201
19329
|
exports.Client = Client;
|
|
19202
19330
|
exports.EventDispatcher = EventDispatcher;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@larksuiteoapi/node-sdk",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "larksuite open sdk for nodejs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"feishu",
|
|
@@ -54,7 +54,9 @@
|
|
|
54
54
|
"rollup-plugin-dts": "^4.2.2",
|
|
55
55
|
"rollup-plugin-license": "^2.8.1",
|
|
56
56
|
"ts-jest": "^28.0.5",
|
|
57
|
+
"tsconfig-paths": "^4.0.0",
|
|
57
58
|
"tslib": "^2.4.0",
|
|
59
|
+
"ts-node": "^10.8.1",
|
|
58
60
|
"typescript": "^4.7.3"
|
|
59
61
|
},
|
|
60
62
|
"publishConfig": {
|
package/types/index.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ declare enum LoggerLevel {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
declare const CTenantKey: unique symbol;
|
|
44
|
+
declare const CAppTicket: unique symbol;
|
|
44
45
|
declare const CWithHelpdeskAuthorization: unique symbol;
|
|
45
46
|
declare const CWithUserAccessToken: unique symbol;
|
|
46
47
|
|
|
@@ -111,7 +112,7 @@ declare abstract class Client$1 {
|
|
|
111
112
|
access_record_id?: string;
|
|
112
113
|
};
|
|
113
114
|
}, options?: IRequestOptions$1) => Promise<{
|
|
114
|
-
writeFile: (filePath: string) => Promise<
|
|
115
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
115
116
|
}>;
|
|
116
117
|
};
|
|
117
118
|
/**
|
|
@@ -225,7 +226,7 @@ declare abstract class Client$1 {
|
|
|
225
226
|
user_id: string;
|
|
226
227
|
};
|
|
227
228
|
}, options?: IRequestOptions$1) => Promise<{
|
|
228
|
-
writeFile: (filePath: string) => Promise<
|
|
229
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
229
230
|
}>;
|
|
230
231
|
/**
|
|
231
232
|
* {@link https://open.feishu.cn/api-explorer?project=acs&resource=user.face&apiName=update&version=v1 click to debug }
|
|
@@ -3137,7 +3138,7 @@ declare abstract class Client$1 {
|
|
|
3137
3138
|
file_id: string;
|
|
3138
3139
|
};
|
|
3139
3140
|
}, options?: IRequestOptions$1) => Promise<{
|
|
3140
|
-
writeFile: (filePath: string) => Promise<
|
|
3141
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
3141
3142
|
}>;
|
|
3142
3143
|
/**
|
|
3143
3144
|
* {@link https://open.feishu.cn/api-explorer?project=attendance&resource=file&apiName=upload&version=v1 click to debug }
|
|
@@ -5914,7 +5915,7 @@ declare abstract class Client$1 {
|
|
|
5914
5915
|
file_token?: string;
|
|
5915
5916
|
};
|
|
5916
5917
|
}, options?: IRequestOptions$1) => Promise<{
|
|
5917
|
-
writeFile: (filePath: string) => Promise<
|
|
5918
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
5918
5919
|
}>;
|
|
5919
5920
|
/**
|
|
5920
5921
|
* {@link https://open.feishu.cn/api-explorer?project=baike&resource=file&apiName=upload&version=v1 click to debug }
|
|
@@ -22576,7 +22577,7 @@ declare abstract class Client$1 {
|
|
|
22576
22577
|
file_token: string;
|
|
22577
22578
|
};
|
|
22578
22579
|
}, options?: IRequestOptions$1) => Promise<{
|
|
22579
|
-
writeFile: (filePath: string) => Promise<
|
|
22580
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
22580
22581
|
}>;
|
|
22581
22582
|
/**
|
|
22582
22583
|
* {@link https://open.feishu.cn/api-explorer?project=drive&resource=export_task&apiName=get&version=v1 click to debug }
|
|
@@ -23098,7 +23099,7 @@ declare abstract class Client$1 {
|
|
|
23098
23099
|
file_token?: string;
|
|
23099
23100
|
};
|
|
23100
23101
|
}, options?: IRequestOptions$1) => Promise<{
|
|
23101
|
-
writeFile: (filePath: string) => Promise<
|
|
23102
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
23102
23103
|
}>;
|
|
23103
23104
|
listWithIterator: (payload?: {
|
|
23104
23105
|
params?: {
|
|
@@ -23560,7 +23561,7 @@ declare abstract class Client$1 {
|
|
|
23560
23561
|
file_token: string;
|
|
23561
23562
|
};
|
|
23562
23563
|
}, options?: IRequestOptions$1) => Promise<{
|
|
23563
|
-
writeFile: (filePath: string) => Promise<
|
|
23564
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
23564
23565
|
}>;
|
|
23565
23566
|
/**
|
|
23566
23567
|
* {@link https://open.feishu.cn/api-explorer?project=drive&resource=media&apiName=upload_all&version=v1 click to debug }
|
|
@@ -23907,7 +23908,7 @@ declare abstract class Client$1 {
|
|
|
23907
23908
|
token: string;
|
|
23908
23909
|
};
|
|
23909
23910
|
}, options?: IRequestOptions$1) => Promise<{
|
|
23910
|
-
writeFile: (filePath: string) => Promise<
|
|
23911
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
23911
23912
|
}>;
|
|
23912
23913
|
};
|
|
23913
23914
|
/**
|
|
@@ -25203,7 +25204,7 @@ declare abstract class Client$1 {
|
|
|
25203
25204
|
image_key?: string;
|
|
25204
25205
|
};
|
|
25205
25206
|
}, options?: IRequestOptions$1) => Promise<{
|
|
25206
|
-
writeFile: (filePath: string) => Promise<
|
|
25207
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
25207
25208
|
}>;
|
|
25208
25209
|
/**
|
|
25209
25210
|
* {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=faq&apiName=get&version=v1 click to debug }
|
|
@@ -26179,7 +26180,7 @@ declare abstract class Client$1 {
|
|
|
26179
26180
|
index?: number;
|
|
26180
26181
|
};
|
|
26181
26182
|
}, options?: IRequestOptions$1) => Promise<{
|
|
26182
|
-
writeFile: (filePath: string) => Promise<
|
|
26183
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
26183
26184
|
}>;
|
|
26184
26185
|
/**
|
|
26185
26186
|
* {@link https://open.feishu.cn/api-explorer?project=helpdesk&resource=ticket&apiName=update&version=v1 click to debug }
|
|
@@ -29189,7 +29190,7 @@ declare abstract class Client$1 {
|
|
|
29189
29190
|
file_key: string;
|
|
29190
29191
|
};
|
|
29191
29192
|
}, options?: IRequestOptions$1) => Promise<{
|
|
29192
|
-
writeFile: (filePath: string) => Promise<
|
|
29193
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
29193
29194
|
}>;
|
|
29194
29195
|
};
|
|
29195
29196
|
/**
|
|
@@ -29231,7 +29232,7 @@ declare abstract class Client$1 {
|
|
|
29231
29232
|
image_key: string;
|
|
29232
29233
|
};
|
|
29233
29234
|
}, options?: IRequestOptions$1) => Promise<{
|
|
29234
|
-
writeFile: (filePath: string) => Promise<
|
|
29235
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
29235
29236
|
}>;
|
|
29236
29237
|
};
|
|
29237
29238
|
/**
|
|
@@ -29805,7 +29806,7 @@ declare abstract class Client$1 {
|
|
|
29805
29806
|
file_key: string;
|
|
29806
29807
|
};
|
|
29807
29808
|
}, options?: IRequestOptions$1) => Promise<{
|
|
29808
|
-
writeFile: (filePath: string) => Promise<
|
|
29809
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
29809
29810
|
}>;
|
|
29810
29811
|
};
|
|
29811
29812
|
/**
|
|
@@ -34388,7 +34389,7 @@ declare abstract class Client$1 {
|
|
|
34388
34389
|
file_token: string;
|
|
34389
34390
|
};
|
|
34390
34391
|
}, options?: IRequestOptions$1) => Promise<{
|
|
34391
|
-
writeFile: (filePath: string) => Promise<
|
|
34392
|
+
writeFile: (filePath: string) => Promise<unknown>;
|
|
34392
34393
|
}>;
|
|
34393
34394
|
/**
|
|
34394
34395
|
* {@link https://open.feishu.cn/api-explorer?project=vc&resource=export&apiName=get&version=v1 click to debug }
|
|
@@ -39456,4 +39457,4 @@ declare const adaptKoaRouter: (dispatcher: EventDispatcher | CardActionHandler,
|
|
|
39456
39457
|
logger?: Logger;
|
|
39457
39458
|
}) => (ctx: any, next: any) => Promise<void>;
|
|
39458
39459
|
|
|
39459
|
-
export { AESCipher, AppType, CardActionHandler, Client, Domain, EventDispatcher, IHandles as EventHandles, LoggerLevel, adaptDefault, adaptExpress, adaptKoa, adaptKoaRouter, withAll, withHelpDeskCredential, withTenantKey, withTenantToken, withUserAccessToken };
|
|
39460
|
+
export { AESCipher, AppType, CAppTicket, CardActionHandler, Client, Domain, EventDispatcher, IHandles as EventHandles, LoggerLevel, adaptDefault, adaptExpress, adaptKoa, adaptKoaRouter, withAll, withHelpDeskCredential, withTenantKey, withTenantToken, withUserAccessToken };
|