@larksuiteoapi/node-sdk 1.34.0 → 1.36.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/README.md +14 -0
- package/README.zh.md +14 -0
- package/es/index.js +409 -9
- package/lib/index.js +409 -9
- package/package.json +1 -1
- package/types/index.d.ts +33 -0
package/lib/index.js
CHANGED
|
@@ -294,8 +294,16 @@ class Client$$ {
|
|
|
294
294
|
this.logger.error(formatErrors(e));
|
|
295
295
|
throw e;
|
|
296
296
|
});
|
|
297
|
+
const checkIsReadable = () => {
|
|
298
|
+
const consumedError = "The stream has already been consumed";
|
|
299
|
+
if (!res.readable) {
|
|
300
|
+
this.logger.error(consumedError);
|
|
301
|
+
throw new Error(consumedError);
|
|
302
|
+
}
|
|
303
|
+
};
|
|
297
304
|
return {
|
|
298
305
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
306
|
+
checkIsReadable();
|
|
299
307
|
return new Promise((resolve, reject) => {
|
|
300
308
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
301
309
|
writableStream.on("finish", () => {
|
|
@@ -307,6 +315,10 @@ class Client$$ {
|
|
|
307
315
|
res.pipe(writableStream);
|
|
308
316
|
});
|
|
309
317
|
}),
|
|
318
|
+
getReadableStream: () => {
|
|
319
|
+
checkIsReadable();
|
|
320
|
+
return res;
|
|
321
|
+
},
|
|
310
322
|
};
|
|
311
323
|
}),
|
|
312
324
|
},
|
|
@@ -530,8 +542,16 @@ class Client$$ {
|
|
|
530
542
|
this.logger.error(formatErrors(e));
|
|
531
543
|
throw e;
|
|
532
544
|
});
|
|
545
|
+
const checkIsReadable = () => {
|
|
546
|
+
const consumedError = "The stream has already been consumed";
|
|
547
|
+
if (!res.readable) {
|
|
548
|
+
this.logger.error(consumedError);
|
|
549
|
+
throw new Error(consumedError);
|
|
550
|
+
}
|
|
551
|
+
};
|
|
533
552
|
return {
|
|
534
553
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
554
|
+
checkIsReadable();
|
|
535
555
|
return new Promise((resolve, reject) => {
|
|
536
556
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
537
557
|
writableStream.on("finish", () => {
|
|
@@ -543,6 +563,10 @@ class Client$$ {
|
|
|
543
563
|
res.pipe(writableStream);
|
|
544
564
|
});
|
|
545
565
|
}),
|
|
566
|
+
getReadableStream: () => {
|
|
567
|
+
checkIsReadable();
|
|
568
|
+
return res;
|
|
569
|
+
},
|
|
546
570
|
};
|
|
547
571
|
}),
|
|
548
572
|
/**
|
|
@@ -775,8 +799,16 @@ class Client$$ {
|
|
|
775
799
|
this.logger.error(formatErrors(e));
|
|
776
800
|
throw e;
|
|
777
801
|
});
|
|
802
|
+
const checkIsReadable = () => {
|
|
803
|
+
const consumedError = "The stream has already been consumed";
|
|
804
|
+
if (!res.readable) {
|
|
805
|
+
this.logger.error(consumedError);
|
|
806
|
+
throw new Error(consumedError);
|
|
807
|
+
}
|
|
808
|
+
};
|
|
778
809
|
return {
|
|
779
810
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
811
|
+
checkIsReadable();
|
|
780
812
|
return new Promise((resolve, reject) => {
|
|
781
813
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
782
814
|
writableStream.on("finish", () => {
|
|
@@ -788,6 +820,10 @@ class Client$$ {
|
|
|
788
820
|
res.pipe(writableStream);
|
|
789
821
|
});
|
|
790
822
|
}),
|
|
823
|
+
getReadableStream: () => {
|
|
824
|
+
checkIsReadable();
|
|
825
|
+
return res;
|
|
826
|
+
},
|
|
791
827
|
};
|
|
792
828
|
}),
|
|
793
829
|
},
|
|
@@ -1011,8 +1047,16 @@ class Client$$ {
|
|
|
1011
1047
|
this.logger.error(formatErrors(e));
|
|
1012
1048
|
throw e;
|
|
1013
1049
|
});
|
|
1050
|
+
const checkIsReadable = () => {
|
|
1051
|
+
const consumedError = "The stream has already been consumed";
|
|
1052
|
+
if (!res.readable) {
|
|
1053
|
+
this.logger.error(consumedError);
|
|
1054
|
+
throw new Error(consumedError);
|
|
1055
|
+
}
|
|
1056
|
+
};
|
|
1014
1057
|
return {
|
|
1015
1058
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
1059
|
+
checkIsReadable();
|
|
1016
1060
|
return new Promise((resolve, reject) => {
|
|
1017
1061
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
1018
1062
|
writableStream.on("finish", () => {
|
|
@@ -1024,6 +1068,10 @@ class Client$$ {
|
|
|
1024
1068
|
res.pipe(writableStream);
|
|
1025
1069
|
});
|
|
1026
1070
|
}),
|
|
1071
|
+
getReadableStream: () => {
|
|
1072
|
+
checkIsReadable();
|
|
1073
|
+
return res;
|
|
1074
|
+
},
|
|
1027
1075
|
};
|
|
1028
1076
|
}),
|
|
1029
1077
|
/**
|
|
@@ -6176,8 +6224,16 @@ class Client$W extends Client$X {
|
|
|
6176
6224
|
this.logger.error(formatErrors(e));
|
|
6177
6225
|
throw e;
|
|
6178
6226
|
});
|
|
6227
|
+
const checkIsReadable = () => {
|
|
6228
|
+
const consumedError = "The stream has already been consumed";
|
|
6229
|
+
if (!res.readable) {
|
|
6230
|
+
this.logger.error(consumedError);
|
|
6231
|
+
throw new Error(consumedError);
|
|
6232
|
+
}
|
|
6233
|
+
};
|
|
6179
6234
|
return {
|
|
6180
6235
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
6236
|
+
checkIsReadable();
|
|
6181
6237
|
return new Promise((resolve, reject) => {
|
|
6182
6238
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
6183
6239
|
writableStream.on("finish", () => {
|
|
@@ -6189,6 +6245,10 @@ class Client$W extends Client$X {
|
|
|
6189
6245
|
res.pipe(writableStream);
|
|
6190
6246
|
});
|
|
6191
6247
|
}),
|
|
6248
|
+
getReadableStream: () => {
|
|
6249
|
+
checkIsReadable();
|
|
6250
|
+
return res;
|
|
6251
|
+
},
|
|
6192
6252
|
};
|
|
6193
6253
|
}),
|
|
6194
6254
|
/**
|
|
@@ -7278,8 +7338,16 @@ class Client$W extends Client$X {
|
|
|
7278
7338
|
this.logger.error(formatErrors(e));
|
|
7279
7339
|
throw e;
|
|
7280
7340
|
});
|
|
7341
|
+
const checkIsReadable = () => {
|
|
7342
|
+
const consumedError = "The stream has already been consumed";
|
|
7343
|
+
if (!res.readable) {
|
|
7344
|
+
this.logger.error(consumedError);
|
|
7345
|
+
throw new Error(consumedError);
|
|
7346
|
+
}
|
|
7347
|
+
};
|
|
7281
7348
|
return {
|
|
7282
7349
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
7350
|
+
checkIsReadable();
|
|
7283
7351
|
return new Promise((resolve, reject) => {
|
|
7284
7352
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
7285
7353
|
writableStream.on("finish", () => {
|
|
@@ -7291,6 +7359,10 @@ class Client$W extends Client$X {
|
|
|
7291
7359
|
res.pipe(writableStream);
|
|
7292
7360
|
});
|
|
7293
7361
|
}),
|
|
7362
|
+
getReadableStream: () => {
|
|
7363
|
+
checkIsReadable();
|
|
7364
|
+
return res;
|
|
7365
|
+
},
|
|
7294
7366
|
};
|
|
7295
7367
|
}),
|
|
7296
7368
|
/**
|
|
@@ -9178,8 +9250,16 @@ class Client$S extends Client$T {
|
|
|
9178
9250
|
this.logger.error(formatErrors(e));
|
|
9179
9251
|
throw e;
|
|
9180
9252
|
});
|
|
9253
|
+
const checkIsReadable = () => {
|
|
9254
|
+
const consumedError = "The stream has already been consumed";
|
|
9255
|
+
if (!res.readable) {
|
|
9256
|
+
this.logger.error(consumedError);
|
|
9257
|
+
throw new Error(consumedError);
|
|
9258
|
+
}
|
|
9259
|
+
};
|
|
9181
9260
|
return {
|
|
9182
9261
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
9262
|
+
checkIsReadable();
|
|
9183
9263
|
return new Promise((resolve, reject) => {
|
|
9184
9264
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
9185
9265
|
writableStream.on("finish", () => {
|
|
@@ -9191,6 +9271,10 @@ class Client$S extends Client$T {
|
|
|
9191
9271
|
res.pipe(writableStream);
|
|
9192
9272
|
});
|
|
9193
9273
|
}),
|
|
9274
|
+
getReadableStream: () => {
|
|
9275
|
+
checkIsReadable();
|
|
9276
|
+
return res;
|
|
9277
|
+
},
|
|
9194
9278
|
};
|
|
9195
9279
|
}),
|
|
9196
9280
|
/**
|
|
@@ -9680,8 +9764,16 @@ class Client$S extends Client$T {
|
|
|
9680
9764
|
this.logger.error(formatErrors(e));
|
|
9681
9765
|
throw e;
|
|
9682
9766
|
});
|
|
9767
|
+
const checkIsReadable = () => {
|
|
9768
|
+
const consumedError = "The stream has already been consumed";
|
|
9769
|
+
if (!res.readable) {
|
|
9770
|
+
this.logger.error(consumedError);
|
|
9771
|
+
throw new Error(consumedError);
|
|
9772
|
+
}
|
|
9773
|
+
};
|
|
9683
9774
|
return {
|
|
9684
9775
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
9776
|
+
checkIsReadable();
|
|
9685
9777
|
return new Promise((resolve, reject) => {
|
|
9686
9778
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
9687
9779
|
writableStream.on("finish", () => {
|
|
@@ -9693,6 +9785,10 @@ class Client$S extends Client$T {
|
|
|
9693
9785
|
res.pipe(writableStream);
|
|
9694
9786
|
});
|
|
9695
9787
|
}),
|
|
9788
|
+
getReadableStream: () => {
|
|
9789
|
+
checkIsReadable();
|
|
9790
|
+
return res;
|
|
9791
|
+
},
|
|
9696
9792
|
};
|
|
9697
9793
|
}),
|
|
9698
9794
|
/**
|
|
@@ -13131,8 +13227,16 @@ class Client$P extends Client$Q {
|
|
|
13131
13227
|
this.logger.error(formatErrors(e));
|
|
13132
13228
|
throw e;
|
|
13133
13229
|
});
|
|
13230
|
+
const checkIsReadable = () => {
|
|
13231
|
+
const consumedError = "The stream has already been consumed";
|
|
13232
|
+
if (!res.readable) {
|
|
13233
|
+
this.logger.error(consumedError);
|
|
13234
|
+
throw new Error(consumedError);
|
|
13235
|
+
}
|
|
13236
|
+
};
|
|
13134
13237
|
return {
|
|
13135
13238
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
13239
|
+
checkIsReadable();
|
|
13136
13240
|
return new Promise((resolve, reject) => {
|
|
13137
13241
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
13138
13242
|
writableStream.on("finish", () => {
|
|
@@ -13144,6 +13248,10 @@ class Client$P extends Client$Q {
|
|
|
13144
13248
|
res.pipe(writableStream);
|
|
13145
13249
|
});
|
|
13146
13250
|
}),
|
|
13251
|
+
getReadableStream: () => {
|
|
13252
|
+
checkIsReadable();
|
|
13253
|
+
return res;
|
|
13254
|
+
},
|
|
13147
13255
|
};
|
|
13148
13256
|
}),
|
|
13149
13257
|
},
|
|
@@ -22118,8 +22226,16 @@ class Client$I extends Client$J {
|
|
|
22118
22226
|
this.logger.error(formatErrors(e));
|
|
22119
22227
|
throw e;
|
|
22120
22228
|
});
|
|
22229
|
+
const checkIsReadable = () => {
|
|
22230
|
+
const consumedError = "The stream has already been consumed";
|
|
22231
|
+
if (!res.readable) {
|
|
22232
|
+
this.logger.error(consumedError);
|
|
22233
|
+
throw new Error(consumedError);
|
|
22234
|
+
}
|
|
22235
|
+
};
|
|
22121
22236
|
return {
|
|
22122
22237
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
22238
|
+
checkIsReadable();
|
|
22123
22239
|
return new Promise((resolve, reject) => {
|
|
22124
22240
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
22125
22241
|
writableStream.on("finish", () => {
|
|
@@ -22131,6 +22247,10 @@ class Client$I extends Client$J {
|
|
|
22131
22247
|
res.pipe(writableStream);
|
|
22132
22248
|
});
|
|
22133
22249
|
}),
|
|
22250
|
+
getReadableStream: () => {
|
|
22251
|
+
checkIsReadable();
|
|
22252
|
+
return res;
|
|
22253
|
+
},
|
|
22134
22254
|
};
|
|
22135
22255
|
}),
|
|
22136
22256
|
},
|
|
@@ -24785,8 +24905,16 @@ class Client$I extends Client$J {
|
|
|
24785
24905
|
this.logger.error(formatErrors(e));
|
|
24786
24906
|
throw e;
|
|
24787
24907
|
});
|
|
24908
|
+
const checkIsReadable = () => {
|
|
24909
|
+
const consumedError = "The stream has already been consumed";
|
|
24910
|
+
if (!res.readable) {
|
|
24911
|
+
this.logger.error(consumedError);
|
|
24912
|
+
throw new Error(consumedError);
|
|
24913
|
+
}
|
|
24914
|
+
};
|
|
24788
24915
|
return {
|
|
24789
24916
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
24917
|
+
checkIsReadable();
|
|
24790
24918
|
return new Promise((resolve, reject) => {
|
|
24791
24919
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
24792
24920
|
writableStream.on("finish", () => {
|
|
@@ -24798,6 +24926,10 @@ class Client$I extends Client$J {
|
|
|
24798
24926
|
res.pipe(writableStream);
|
|
24799
24927
|
});
|
|
24800
24928
|
}),
|
|
24929
|
+
getReadableStream: () => {
|
|
24930
|
+
checkIsReadable();
|
|
24931
|
+
return res;
|
|
24932
|
+
},
|
|
24801
24933
|
};
|
|
24802
24934
|
}),
|
|
24803
24935
|
},
|
|
@@ -30035,8 +30167,16 @@ class Client$E extends Client$F {
|
|
|
30035
30167
|
this.logger.error(formatErrors(e));
|
|
30036
30168
|
throw e;
|
|
30037
30169
|
});
|
|
30170
|
+
const checkIsReadable = () => {
|
|
30171
|
+
const consumedError = "The stream has already been consumed";
|
|
30172
|
+
if (!res.readable) {
|
|
30173
|
+
this.logger.error(consumedError);
|
|
30174
|
+
throw new Error(consumedError);
|
|
30175
|
+
}
|
|
30176
|
+
};
|
|
30038
30177
|
return {
|
|
30039
30178
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
30179
|
+
checkIsReadable();
|
|
30040
30180
|
return new Promise((resolve, reject) => {
|
|
30041
30181
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
30042
30182
|
writableStream.on("finish", () => {
|
|
@@ -30048,6 +30188,10 @@ class Client$E extends Client$F {
|
|
|
30048
30188
|
res.pipe(writableStream);
|
|
30049
30189
|
});
|
|
30050
30190
|
}),
|
|
30191
|
+
getReadableStream: () => {
|
|
30192
|
+
checkIsReadable();
|
|
30193
|
+
return res;
|
|
30194
|
+
},
|
|
30051
30195
|
};
|
|
30052
30196
|
}),
|
|
30053
30197
|
/**
|
|
@@ -30529,8 +30673,16 @@ class Client$E extends Client$F {
|
|
|
30529
30673
|
this.logger.error(formatErrors(e));
|
|
30530
30674
|
throw e;
|
|
30531
30675
|
});
|
|
30676
|
+
const checkIsReadable = () => {
|
|
30677
|
+
const consumedError = "The stream has already been consumed";
|
|
30678
|
+
if (!res.readable) {
|
|
30679
|
+
this.logger.error(consumedError);
|
|
30680
|
+
throw new Error(consumedError);
|
|
30681
|
+
}
|
|
30682
|
+
};
|
|
30532
30683
|
return {
|
|
30533
30684
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
30685
|
+
checkIsReadable();
|
|
30534
30686
|
return new Promise((resolve, reject) => {
|
|
30535
30687
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
30536
30688
|
writableStream.on("finish", () => {
|
|
@@ -30542,6 +30694,10 @@ class Client$E extends Client$F {
|
|
|
30542
30694
|
res.pipe(writableStream);
|
|
30543
30695
|
});
|
|
30544
30696
|
}),
|
|
30697
|
+
getReadableStream: () => {
|
|
30698
|
+
checkIsReadable();
|
|
30699
|
+
return res;
|
|
30700
|
+
},
|
|
30545
30701
|
};
|
|
30546
30702
|
}),
|
|
30547
30703
|
/**
|
|
@@ -31263,8 +31419,16 @@ class Client$E extends Client$F {
|
|
|
31263
31419
|
this.logger.error(formatErrors(e));
|
|
31264
31420
|
throw e;
|
|
31265
31421
|
});
|
|
31422
|
+
const checkIsReadable = () => {
|
|
31423
|
+
const consumedError = "The stream has already been consumed";
|
|
31424
|
+
if (!res.readable) {
|
|
31425
|
+
this.logger.error(consumedError);
|
|
31426
|
+
throw new Error(consumedError);
|
|
31427
|
+
}
|
|
31428
|
+
};
|
|
31266
31429
|
return {
|
|
31267
31430
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
31431
|
+
checkIsReadable();
|
|
31268
31432
|
return new Promise((resolve, reject) => {
|
|
31269
31433
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
31270
31434
|
writableStream.on("finish", () => {
|
|
@@ -31276,6 +31440,10 @@ class Client$E extends Client$F {
|
|
|
31276
31440
|
res.pipe(writableStream);
|
|
31277
31441
|
});
|
|
31278
31442
|
}),
|
|
31443
|
+
getReadableStream: () => {
|
|
31444
|
+
checkIsReadable();
|
|
31445
|
+
return res;
|
|
31446
|
+
},
|
|
31279
31447
|
};
|
|
31280
31448
|
}),
|
|
31281
31449
|
/**
|
|
@@ -31754,8 +31922,16 @@ class Client$E extends Client$F {
|
|
|
31754
31922
|
this.logger.error(formatErrors(e));
|
|
31755
31923
|
throw e;
|
|
31756
31924
|
});
|
|
31925
|
+
const checkIsReadable = () => {
|
|
31926
|
+
const consumedError = "The stream has already been consumed";
|
|
31927
|
+
if (!res.readable) {
|
|
31928
|
+
this.logger.error(consumedError);
|
|
31929
|
+
throw new Error(consumedError);
|
|
31930
|
+
}
|
|
31931
|
+
};
|
|
31757
31932
|
return {
|
|
31758
31933
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
31934
|
+
checkIsReadable();
|
|
31759
31935
|
return new Promise((resolve, reject) => {
|
|
31760
31936
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
31761
31937
|
writableStream.on("finish", () => {
|
|
@@ -31767,6 +31943,10 @@ class Client$E extends Client$F {
|
|
|
31767
31943
|
res.pipe(writableStream);
|
|
31768
31944
|
});
|
|
31769
31945
|
}),
|
|
31946
|
+
getReadableStream: () => {
|
|
31947
|
+
checkIsReadable();
|
|
31948
|
+
return res;
|
|
31949
|
+
},
|
|
31770
31950
|
};
|
|
31771
31951
|
}),
|
|
31772
31952
|
/**
|
|
@@ -32248,8 +32428,16 @@ class Client$E extends Client$F {
|
|
|
32248
32428
|
this.logger.error(formatErrors(e));
|
|
32249
32429
|
throw e;
|
|
32250
32430
|
});
|
|
32431
|
+
const checkIsReadable = () => {
|
|
32432
|
+
const consumedError = "The stream has already been consumed";
|
|
32433
|
+
if (!res.readable) {
|
|
32434
|
+
this.logger.error(consumedError);
|
|
32435
|
+
throw new Error(consumedError);
|
|
32436
|
+
}
|
|
32437
|
+
};
|
|
32251
32438
|
return {
|
|
32252
32439
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
32440
|
+
checkIsReadable();
|
|
32253
32441
|
return new Promise((resolve, reject) => {
|
|
32254
32442
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
32255
32443
|
writableStream.on("finish", () => {
|
|
@@ -32261,6 +32449,10 @@ class Client$E extends Client$F {
|
|
|
32261
32449
|
res.pipe(writableStream);
|
|
32262
32450
|
});
|
|
32263
32451
|
}),
|
|
32452
|
+
getReadableStream: () => {
|
|
32453
|
+
checkIsReadable();
|
|
32454
|
+
return res;
|
|
32455
|
+
},
|
|
32264
32456
|
};
|
|
32265
32457
|
}),
|
|
32266
32458
|
/**
|
|
@@ -32982,8 +33174,16 @@ class Client$E extends Client$F {
|
|
|
32982
33174
|
this.logger.error(formatErrors(e));
|
|
32983
33175
|
throw e;
|
|
32984
33176
|
});
|
|
33177
|
+
const checkIsReadable = () => {
|
|
33178
|
+
const consumedError = "The stream has already been consumed";
|
|
33179
|
+
if (!res.readable) {
|
|
33180
|
+
this.logger.error(consumedError);
|
|
33181
|
+
throw new Error(consumedError);
|
|
33182
|
+
}
|
|
33183
|
+
};
|
|
32985
33184
|
return {
|
|
32986
33185
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
33186
|
+
checkIsReadable();
|
|
32987
33187
|
return new Promise((resolve, reject) => {
|
|
32988
33188
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
32989
33189
|
writableStream.on("finish", () => {
|
|
@@ -32995,6 +33195,10 @@ class Client$E extends Client$F {
|
|
|
32995
33195
|
res.pipe(writableStream);
|
|
32996
33196
|
});
|
|
32997
33197
|
}),
|
|
33198
|
+
getReadableStream: () => {
|
|
33199
|
+
checkIsReadable();
|
|
33200
|
+
return res;
|
|
33201
|
+
},
|
|
32998
33202
|
};
|
|
32999
33203
|
}),
|
|
33000
33204
|
/**
|
|
@@ -33521,8 +33725,16 @@ class Client$C extends Client$D {
|
|
|
33521
33725
|
this.logger.error(formatErrors(e));
|
|
33522
33726
|
throw e;
|
|
33523
33727
|
});
|
|
33728
|
+
const checkIsReadable = () => {
|
|
33729
|
+
const consumedError = "The stream has already been consumed";
|
|
33730
|
+
if (!res.readable) {
|
|
33731
|
+
this.logger.error(consumedError);
|
|
33732
|
+
throw new Error(consumedError);
|
|
33733
|
+
}
|
|
33734
|
+
};
|
|
33524
33735
|
return {
|
|
33525
33736
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
33737
|
+
checkIsReadable();
|
|
33526
33738
|
return new Promise((resolve, reject) => {
|
|
33527
33739
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
33528
33740
|
writableStream.on("finish", () => {
|
|
@@ -33534,6 +33746,10 @@ class Client$C extends Client$D {
|
|
|
33534
33746
|
res.pipe(writableStream);
|
|
33535
33747
|
});
|
|
33536
33748
|
}),
|
|
33749
|
+
getReadableStream: () => {
|
|
33750
|
+
checkIsReadable();
|
|
33751
|
+
return res;
|
|
33752
|
+
},
|
|
33537
33753
|
};
|
|
33538
33754
|
}),
|
|
33539
33755
|
},
|
|
@@ -33646,8 +33862,16 @@ class Client$C extends Client$D {
|
|
|
33646
33862
|
this.logger.error(formatErrors(e));
|
|
33647
33863
|
throw e;
|
|
33648
33864
|
});
|
|
33865
|
+
const checkIsReadable = () => {
|
|
33866
|
+
const consumedError = "The stream has already been consumed";
|
|
33867
|
+
if (!res.readable) {
|
|
33868
|
+
this.logger.error(consumedError);
|
|
33869
|
+
throw new Error(consumedError);
|
|
33870
|
+
}
|
|
33871
|
+
};
|
|
33649
33872
|
return {
|
|
33650
33873
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
33874
|
+
checkIsReadable();
|
|
33651
33875
|
return new Promise((resolve, reject) => {
|
|
33652
33876
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
33653
33877
|
writableStream.on("finish", () => {
|
|
@@ -33659,6 +33883,10 @@ class Client$C extends Client$D {
|
|
|
33659
33883
|
res.pipe(writableStream);
|
|
33660
33884
|
});
|
|
33661
33885
|
}),
|
|
33886
|
+
getReadableStream: () => {
|
|
33887
|
+
checkIsReadable();
|
|
33888
|
+
return res;
|
|
33889
|
+
},
|
|
33662
33890
|
};
|
|
33663
33891
|
}),
|
|
33664
33892
|
},
|
|
@@ -34833,8 +35061,16 @@ class Client$v extends Client$w {
|
|
|
34833
35061
|
this.logger.error(formatErrors(e));
|
|
34834
35062
|
throw e;
|
|
34835
35063
|
});
|
|
35064
|
+
const checkIsReadable = () => {
|
|
35065
|
+
const consumedError = "The stream has already been consumed";
|
|
35066
|
+
if (!res.readable) {
|
|
35067
|
+
this.logger.error(consumedError);
|
|
35068
|
+
throw new Error(consumedError);
|
|
35069
|
+
}
|
|
35070
|
+
};
|
|
34836
35071
|
return {
|
|
34837
35072
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
35073
|
+
checkIsReadable();
|
|
34838
35074
|
return new Promise((resolve, reject) => {
|
|
34839
35075
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
34840
35076
|
writableStream.on("finish", () => {
|
|
@@ -34846,6 +35082,10 @@ class Client$v extends Client$w {
|
|
|
34846
35082
|
res.pipe(writableStream);
|
|
34847
35083
|
});
|
|
34848
35084
|
}),
|
|
35085
|
+
getReadableStream: () => {
|
|
35086
|
+
checkIsReadable();
|
|
35087
|
+
return res;
|
|
35088
|
+
},
|
|
34849
35089
|
};
|
|
34850
35090
|
}),
|
|
34851
35091
|
/**
|
|
@@ -35388,8 +35628,16 @@ class Client$v extends Client$w {
|
|
|
35388
35628
|
this.logger.error(formatErrors(e));
|
|
35389
35629
|
throw e;
|
|
35390
35630
|
});
|
|
35631
|
+
const checkIsReadable = () => {
|
|
35632
|
+
const consumedError = "The stream has already been consumed";
|
|
35633
|
+
if (!res.readable) {
|
|
35634
|
+
this.logger.error(consumedError);
|
|
35635
|
+
throw new Error(consumedError);
|
|
35636
|
+
}
|
|
35637
|
+
};
|
|
35391
35638
|
return {
|
|
35392
35639
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
35640
|
+
checkIsReadable();
|
|
35393
35641
|
return new Promise((resolve, reject) => {
|
|
35394
35642
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
35395
35643
|
writableStream.on("finish", () => {
|
|
@@ -35401,6 +35649,10 @@ class Client$v extends Client$w {
|
|
|
35401
35649
|
res.pipe(writableStream);
|
|
35402
35650
|
});
|
|
35403
35651
|
}),
|
|
35652
|
+
getReadableStream: () => {
|
|
35653
|
+
checkIsReadable();
|
|
35654
|
+
return res;
|
|
35655
|
+
},
|
|
35404
35656
|
};
|
|
35405
35657
|
}),
|
|
35406
35658
|
/**
|
|
@@ -36276,8 +36528,16 @@ class Client$v extends Client$w {
|
|
|
36276
36528
|
this.logger.error(formatErrors(e));
|
|
36277
36529
|
throw e;
|
|
36278
36530
|
});
|
|
36531
|
+
const checkIsReadable = () => {
|
|
36532
|
+
const consumedError = "The stream has already been consumed";
|
|
36533
|
+
if (!res.readable) {
|
|
36534
|
+
this.logger.error(consumedError);
|
|
36535
|
+
throw new Error(consumedError);
|
|
36536
|
+
}
|
|
36537
|
+
};
|
|
36279
36538
|
return {
|
|
36280
36539
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
36540
|
+
checkIsReadable();
|
|
36281
36541
|
return new Promise((resolve, reject) => {
|
|
36282
36542
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
36283
36543
|
writableStream.on("finish", () => {
|
|
@@ -36289,6 +36549,10 @@ class Client$v extends Client$w {
|
|
|
36289
36549
|
res.pipe(writableStream);
|
|
36290
36550
|
});
|
|
36291
36551
|
}),
|
|
36552
|
+
getReadableStream: () => {
|
|
36553
|
+
checkIsReadable();
|
|
36554
|
+
return res;
|
|
36555
|
+
},
|
|
36292
36556
|
};
|
|
36293
36557
|
}),
|
|
36294
36558
|
/**
|
|
@@ -36831,8 +37095,16 @@ class Client$v extends Client$w {
|
|
|
36831
37095
|
this.logger.error(formatErrors(e));
|
|
36832
37096
|
throw e;
|
|
36833
37097
|
});
|
|
37098
|
+
const checkIsReadable = () => {
|
|
37099
|
+
const consumedError = "The stream has already been consumed";
|
|
37100
|
+
if (!res.readable) {
|
|
37101
|
+
this.logger.error(consumedError);
|
|
37102
|
+
throw new Error(consumedError);
|
|
37103
|
+
}
|
|
37104
|
+
};
|
|
36834
37105
|
return {
|
|
36835
37106
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
37107
|
+
checkIsReadable();
|
|
36836
37108
|
return new Promise((resolve, reject) => {
|
|
36837
37109
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
36838
37110
|
writableStream.on("finish", () => {
|
|
@@ -36844,6 +37116,10 @@ class Client$v extends Client$w {
|
|
|
36844
37116
|
res.pipe(writableStream);
|
|
36845
37117
|
});
|
|
36846
37118
|
}),
|
|
37119
|
+
getReadableStream: () => {
|
|
37120
|
+
checkIsReadable();
|
|
37121
|
+
return res;
|
|
37122
|
+
},
|
|
36847
37123
|
};
|
|
36848
37124
|
}),
|
|
36849
37125
|
/**
|
|
@@ -48654,8 +48930,16 @@ class Client$s extends Client$t {
|
|
|
48654
48930
|
this.logger.error(formatErrors(e));
|
|
48655
48931
|
throw e;
|
|
48656
48932
|
});
|
|
48933
|
+
const checkIsReadable = () => {
|
|
48934
|
+
const consumedError = "The stream has already been consumed";
|
|
48935
|
+
if (!res.readable) {
|
|
48936
|
+
this.logger.error(consumedError);
|
|
48937
|
+
throw new Error(consumedError);
|
|
48938
|
+
}
|
|
48939
|
+
};
|
|
48657
48940
|
return {
|
|
48658
48941
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
48942
|
+
checkIsReadable();
|
|
48659
48943
|
return new Promise((resolve, reject) => {
|
|
48660
48944
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
48661
48945
|
writableStream.on("finish", () => {
|
|
@@ -48667,6 +48951,10 @@ class Client$s extends Client$t {
|
|
|
48667
48951
|
res.pipe(writableStream);
|
|
48668
48952
|
});
|
|
48669
48953
|
}),
|
|
48954
|
+
getReadableStream: () => {
|
|
48955
|
+
checkIsReadable();
|
|
48956
|
+
return res;
|
|
48957
|
+
},
|
|
48670
48958
|
};
|
|
48671
48959
|
}),
|
|
48672
48960
|
},
|
|
@@ -48727,8 +49015,16 @@ class Client$s extends Client$t {
|
|
|
48727
49015
|
this.logger.error(formatErrors(e));
|
|
48728
49016
|
throw e;
|
|
48729
49017
|
});
|
|
49018
|
+
const checkIsReadable = () => {
|
|
49019
|
+
const consumedError = "The stream has already been consumed";
|
|
49020
|
+
if (!res.readable) {
|
|
49021
|
+
this.logger.error(consumedError);
|
|
49022
|
+
throw new Error(consumedError);
|
|
49023
|
+
}
|
|
49024
|
+
};
|
|
48730
49025
|
return {
|
|
48731
49026
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
49027
|
+
checkIsReadable();
|
|
48732
49028
|
return new Promise((resolve, reject) => {
|
|
48733
49029
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
48734
49030
|
writableStream.on("finish", () => {
|
|
@@ -48740,6 +49036,10 @@ class Client$s extends Client$t {
|
|
|
48740
49036
|
res.pipe(writableStream);
|
|
48741
49037
|
});
|
|
48742
49038
|
}),
|
|
49039
|
+
getReadableStream: () => {
|
|
49040
|
+
checkIsReadable();
|
|
49041
|
+
return res;
|
|
49042
|
+
},
|
|
48743
49043
|
};
|
|
48744
49044
|
}),
|
|
48745
49045
|
},
|
|
@@ -49407,8 +49707,16 @@ class Client$s extends Client$t {
|
|
|
49407
49707
|
this.logger.error(formatErrors(e));
|
|
49408
49708
|
throw e;
|
|
49409
49709
|
});
|
|
49710
|
+
const checkIsReadable = () => {
|
|
49711
|
+
const consumedError = "The stream has already been consumed";
|
|
49712
|
+
if (!res.readable) {
|
|
49713
|
+
this.logger.error(consumedError);
|
|
49714
|
+
throw new Error(consumedError);
|
|
49715
|
+
}
|
|
49716
|
+
};
|
|
49410
49717
|
return {
|
|
49411
49718
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
49719
|
+
checkIsReadable();
|
|
49412
49720
|
return new Promise((resolve, reject) => {
|
|
49413
49721
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
49414
49722
|
writableStream.on("finish", () => {
|
|
@@ -49420,6 +49728,10 @@ class Client$s extends Client$t {
|
|
|
49420
49728
|
res.pipe(writableStream);
|
|
49421
49729
|
});
|
|
49422
49730
|
}),
|
|
49731
|
+
getReadableStream: () => {
|
|
49732
|
+
checkIsReadable();
|
|
49733
|
+
return res;
|
|
49734
|
+
},
|
|
49423
49735
|
};
|
|
49424
49736
|
}),
|
|
49425
49737
|
},
|
|
@@ -50744,8 +51056,16 @@ class Client$s extends Client$t {
|
|
|
50744
51056
|
this.logger.error(formatErrors(e));
|
|
50745
51057
|
throw e;
|
|
50746
51058
|
});
|
|
51059
|
+
const checkIsReadable = () => {
|
|
51060
|
+
const consumedError = "The stream has already been consumed";
|
|
51061
|
+
if (!res.readable) {
|
|
51062
|
+
this.logger.error(consumedError);
|
|
51063
|
+
throw new Error(consumedError);
|
|
51064
|
+
}
|
|
51065
|
+
};
|
|
50747
51066
|
return {
|
|
50748
51067
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
51068
|
+
checkIsReadable();
|
|
50749
51069
|
return new Promise((resolve, reject) => {
|
|
50750
51070
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
50751
51071
|
writableStream.on("finish", () => {
|
|
@@ -50757,6 +51077,10 @@ class Client$s extends Client$t {
|
|
|
50757
51077
|
res.pipe(writableStream);
|
|
50758
51078
|
});
|
|
50759
51079
|
}),
|
|
51080
|
+
getReadableStream: () => {
|
|
51081
|
+
checkIsReadable();
|
|
51082
|
+
return res;
|
|
51083
|
+
},
|
|
50760
51084
|
};
|
|
50761
51085
|
}),
|
|
50762
51086
|
},
|
|
@@ -50817,8 +51141,16 @@ class Client$s extends Client$t {
|
|
|
50817
51141
|
this.logger.error(formatErrors(e));
|
|
50818
51142
|
throw e;
|
|
50819
51143
|
});
|
|
51144
|
+
const checkIsReadable = () => {
|
|
51145
|
+
const consumedError = "The stream has already been consumed";
|
|
51146
|
+
if (!res.readable) {
|
|
51147
|
+
this.logger.error(consumedError);
|
|
51148
|
+
throw new Error(consumedError);
|
|
51149
|
+
}
|
|
51150
|
+
};
|
|
50820
51151
|
return {
|
|
50821
51152
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
51153
|
+
checkIsReadable();
|
|
50822
51154
|
return new Promise((resolve, reject) => {
|
|
50823
51155
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
50824
51156
|
writableStream.on("finish", () => {
|
|
@@ -50830,6 +51162,10 @@ class Client$s extends Client$t {
|
|
|
50830
51162
|
res.pipe(writableStream);
|
|
50831
51163
|
});
|
|
50832
51164
|
}),
|
|
51165
|
+
getReadableStream: () => {
|
|
51166
|
+
checkIsReadable();
|
|
51167
|
+
return res;
|
|
51168
|
+
},
|
|
50833
51169
|
};
|
|
50834
51170
|
}),
|
|
50835
51171
|
},
|
|
@@ -51497,8 +51833,16 @@ class Client$s extends Client$t {
|
|
|
51497
51833
|
this.logger.error(formatErrors(e));
|
|
51498
51834
|
throw e;
|
|
51499
51835
|
});
|
|
51836
|
+
const checkIsReadable = () => {
|
|
51837
|
+
const consumedError = "The stream has already been consumed";
|
|
51838
|
+
if (!res.readable) {
|
|
51839
|
+
this.logger.error(consumedError);
|
|
51840
|
+
throw new Error(consumedError);
|
|
51841
|
+
}
|
|
51842
|
+
};
|
|
51500
51843
|
return {
|
|
51501
51844
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
51845
|
+
checkIsReadable();
|
|
51502
51846
|
return new Promise((resolve, reject) => {
|
|
51503
51847
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
51504
51848
|
writableStream.on("finish", () => {
|
|
@@ -51510,6 +51854,10 @@ class Client$s extends Client$t {
|
|
|
51510
51854
|
res.pipe(writableStream);
|
|
51511
51855
|
});
|
|
51512
51856
|
}),
|
|
51857
|
+
getReadableStream: () => {
|
|
51858
|
+
checkIsReadable();
|
|
51859
|
+
return res;
|
|
51860
|
+
},
|
|
51513
51861
|
};
|
|
51514
51862
|
}),
|
|
51515
51863
|
},
|
|
@@ -52369,8 +52717,16 @@ class Client$r extends Client$s {
|
|
|
52369
52717
|
this.logger.error(formatErrors(e));
|
|
52370
52718
|
throw e;
|
|
52371
52719
|
});
|
|
52720
|
+
const checkIsReadable = () => {
|
|
52721
|
+
const consumedError = "The stream has already been consumed";
|
|
52722
|
+
if (!res.readable) {
|
|
52723
|
+
this.logger.error(consumedError);
|
|
52724
|
+
throw new Error(consumedError);
|
|
52725
|
+
}
|
|
52726
|
+
};
|
|
52372
52727
|
return {
|
|
52373
52728
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
52729
|
+
checkIsReadable();
|
|
52374
52730
|
return new Promise((resolve, reject) => {
|
|
52375
52731
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
52376
52732
|
writableStream.on("finish", () => {
|
|
@@ -52382,6 +52738,10 @@ class Client$r extends Client$s {
|
|
|
52382
52738
|
res.pipe(writableStream);
|
|
52383
52739
|
});
|
|
52384
52740
|
}),
|
|
52741
|
+
getReadableStream: () => {
|
|
52742
|
+
checkIsReadable();
|
|
52743
|
+
return res;
|
|
52744
|
+
},
|
|
52385
52745
|
};
|
|
52386
52746
|
}),
|
|
52387
52747
|
/**
|
|
@@ -63035,8 +63395,16 @@ class Client$4 extends Client$5 {
|
|
|
63035
63395
|
this.logger.error(formatErrors(e));
|
|
63036
63396
|
throw e;
|
|
63037
63397
|
});
|
|
63398
|
+
const checkIsReadable = () => {
|
|
63399
|
+
const consumedError = "The stream has already been consumed";
|
|
63400
|
+
if (!res.readable) {
|
|
63401
|
+
this.logger.error(consumedError);
|
|
63402
|
+
throw new Error(consumedError);
|
|
63403
|
+
}
|
|
63404
|
+
};
|
|
63038
63405
|
return {
|
|
63039
63406
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
63407
|
+
checkIsReadable();
|
|
63040
63408
|
return new Promise((resolve, reject) => {
|
|
63041
63409
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
63042
63410
|
writableStream.on("finish", () => {
|
|
@@ -63048,6 +63416,10 @@ class Client$4 extends Client$5 {
|
|
|
63048
63416
|
res.pipe(writableStream);
|
|
63049
63417
|
});
|
|
63050
63418
|
}),
|
|
63419
|
+
getReadableStream: () => {
|
|
63420
|
+
checkIsReadable();
|
|
63421
|
+
return res;
|
|
63422
|
+
},
|
|
63051
63423
|
};
|
|
63052
63424
|
}),
|
|
63053
63425
|
/**
|
|
@@ -64851,8 +65223,16 @@ class Client$4 extends Client$5 {
|
|
|
64851
65223
|
this.logger.error(formatErrors(e));
|
|
64852
65224
|
throw e;
|
|
64853
65225
|
});
|
|
65226
|
+
const checkIsReadable = () => {
|
|
65227
|
+
const consumedError = "The stream has already been consumed";
|
|
65228
|
+
if (!res.readable) {
|
|
65229
|
+
this.logger.error(consumedError);
|
|
65230
|
+
throw new Error(consumedError);
|
|
65231
|
+
}
|
|
65232
|
+
};
|
|
64854
65233
|
return {
|
|
64855
65234
|
writeFile: (filePath) => __awaiter(this, void 0, void 0, function* () {
|
|
65235
|
+
checkIsReadable();
|
|
64856
65236
|
return new Promise((resolve, reject) => {
|
|
64857
65237
|
const writableStream = fs__default["default"].createWriteStream(filePath);
|
|
64858
65238
|
writableStream.on("finish", () => {
|
|
@@ -64864,6 +65244,10 @@ class Client$4 extends Client$5 {
|
|
|
64864
65244
|
res.pipe(writableStream);
|
|
64865
65245
|
});
|
|
64866
65246
|
}),
|
|
65247
|
+
getReadableStream: () => {
|
|
65248
|
+
checkIsReadable();
|
|
65249
|
+
return res;
|
|
65250
|
+
},
|
|
64867
65251
|
};
|
|
64868
65252
|
}),
|
|
64869
65253
|
/**
|
|
@@ -69525,6 +69909,13 @@ var MessageType;
|
|
|
69525
69909
|
MessageType["ping"] = "ping";
|
|
69526
69910
|
MessageType["pong"] = "pong";
|
|
69527
69911
|
})(MessageType || (MessageType = {}));
|
|
69912
|
+
var HttpStatusCode;
|
|
69913
|
+
(function (HttpStatusCode) {
|
|
69914
|
+
// 2xx Success
|
|
69915
|
+
HttpStatusCode[HttpStatusCode["ok"] = 200] = "ok";
|
|
69916
|
+
// 5xx Server errors
|
|
69917
|
+
HttpStatusCode[HttpStatusCode["internal_server_error"] = 500] = "internal_server_error";
|
|
69918
|
+
})(HttpStatusCode || (HttpStatusCode = {}));
|
|
69528
69919
|
|
|
69529
69920
|
class WSClient {
|
|
69530
69921
|
constructor(params) {
|
|
@@ -69742,13 +70133,22 @@ class WSClient {
|
|
|
69742
70133
|
return;
|
|
69743
70134
|
}
|
|
69744
70135
|
this.logger.debug('[ws]', `receive message, message_type: ${type}; message_id: ${message_id}; trace_id: ${trace_id}; data: ${mergedData.data}`);
|
|
70136
|
+
const respPayload = {
|
|
70137
|
+
code: HttpStatusCode.ok,
|
|
70138
|
+
};
|
|
69745
70139
|
const startTime = Date.now();
|
|
69746
|
-
|
|
70140
|
+
try {
|
|
70141
|
+
const result = yield ((_a = this.eventDispatcher) === null || _a === void 0 ? void 0 : _a.invoke(mergedData, { needCheck: false }));
|
|
70142
|
+
if (result) {
|
|
70143
|
+
respPayload.data = Buffer.from(JSON.stringify(result)).toString("base64");
|
|
70144
|
+
}
|
|
70145
|
+
}
|
|
70146
|
+
catch (error) {
|
|
70147
|
+
respPayload.code = HttpStatusCode.internal_server_error;
|
|
70148
|
+
this.logger.error('[ws]', `invoke event failed, message_type: ${type}; message_id: ${message_id}; trace_id: ${trace_id}; error: ${error}`);
|
|
70149
|
+
}
|
|
69747
70150
|
const endTime = Date.now();
|
|
69748
|
-
this.sendMessage(Object.assign(Object.assign({}, data), { headers: [...data.headers, { key: HeaderKey.biz_rt, value: String(startTime - endTime) }], payload: new TextEncoder().encode(JSON.stringify(
|
|
69749
|
-
// http code
|
|
69750
|
-
code: 200
|
|
69751
|
-
})) }));
|
|
70151
|
+
this.sendMessage(Object.assign(Object.assign({}, data), { headers: [...data.headers, { key: HeaderKey.biz_rt, value: String(startTime - endTime) }], payload: new TextEncoder().encode(JSON.stringify(respPayload)) }));
|
|
69752
70152
|
});
|
|
69753
70153
|
}
|
|
69754
70154
|
sendMessage(data) {
|
|
@@ -69765,14 +70165,14 @@ class WSClient {
|
|
|
69765
70165
|
}
|
|
69766
70166
|
start(params) {
|
|
69767
70167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69768
|
-
this.logger.info('[ws]', `receive events through persistent connection only available in self-build & Feishu app, Configured in:
|
|
70168
|
+
this.logger.info('[ws]', `receive events or callbacks through persistent connection only available in self-build & Feishu app, Configured in:
|
|
69769
70169
|
Developer Console(开发者后台)
|
|
69770
70170
|
->
|
|
69771
|
-
Events and Callbacks(
|
|
70171
|
+
Events and Callbacks(事件与回调)
|
|
69772
70172
|
->
|
|
69773
|
-
Mode of event subscription(
|
|
70173
|
+
Mode of event/callback subscription(订阅方式)
|
|
69774
70174
|
->
|
|
69775
|
-
Receive events through persistent connection(
|
|
70175
|
+
Receive events/callbacks through persistent connection(使用 长连接 接收事件/回调)`);
|
|
69776
70176
|
const { eventDispatcher } = params;
|
|
69777
70177
|
if (!eventDispatcher) {
|
|
69778
70178
|
this.logger.warn('[ws]', 'client need to start with a eventDispatcher');
|