mezon-js 2.14.15 → 2.14.18
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/api.gen.ts +106 -92
- package/client.ts +1 -1
- package/dist/api.gen.d.ts +1 -1
- package/dist/mezon-js.cjs.js +220 -78
- package/dist/mezon-js.esm.mjs +220 -78
- package/dist/utils.d.ts +1 -0
- package/package.json +1 -1
- package/socket.ts +10 -10
- package/utils.ts +9 -0
package/api.gen.ts
CHANGED
|
@@ -2185,7 +2185,7 @@ export interface ApiPinMessage {
|
|
|
2185
2185
|
//
|
|
2186
2186
|
username?: string;
|
|
2187
2187
|
//
|
|
2188
|
-
attachment?:
|
|
2188
|
+
attachment?: Uint8Array;
|
|
2189
2189
|
}
|
|
2190
2190
|
|
|
2191
2191
|
/** */
|
|
@@ -3492,7 +3492,7 @@ export class MezonApi {
|
|
|
3492
3492
|
if (response.status == 204) {
|
|
3493
3493
|
return response;
|
|
3494
3494
|
} else if (response.status >= 200 && response.status < 300) {
|
|
3495
|
-
return response
|
|
3495
|
+
return response;
|
|
3496
3496
|
} else {
|
|
3497
3497
|
throw response;
|
|
3498
3498
|
}
|
|
@@ -3565,7 +3565,7 @@ export class MezonApi {
|
|
|
3565
3565
|
if (response.status == 204) {
|
|
3566
3566
|
return response;
|
|
3567
3567
|
} else if (response.status >= 200 && response.status < 300) {
|
|
3568
|
-
return response
|
|
3568
|
+
return response;
|
|
3569
3569
|
} else {
|
|
3570
3570
|
throw response;
|
|
3571
3571
|
}
|
|
@@ -3904,17 +3904,18 @@ export class MezonApi {
|
|
|
3904
3904
|
}
|
|
3905
3905
|
|
|
3906
3906
|
return Promise.race([
|
|
3907
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
3907
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
3908
3908
|
if (response.status == 204) {
|
|
3909
3909
|
return response;
|
|
3910
3910
|
} else if (response.status >= 200 && response.status < 300) {
|
|
3911
|
-
|
|
3911
|
+
const buffer = await response.arrayBuffer();
|
|
3912
|
+
return tsproto.LinkAccountConfirmRequest.decode(new Uint8Array(buffer)) as unknown as ApiLinkAccountConfirmRequest;
|
|
3912
3913
|
} else {
|
|
3913
3914
|
throw response;
|
|
3914
3915
|
}
|
|
3915
3916
|
}),
|
|
3916
|
-
new Promise((_, reject) =>
|
|
3917
|
-
setTimeout(reject
|
|
3917
|
+
new Promise<never>((_, reject) =>
|
|
3918
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
3918
3919
|
),
|
|
3919
3920
|
]);
|
|
3920
3921
|
}
|
|
@@ -3943,17 +3944,18 @@ export class MezonApi {
|
|
|
3943
3944
|
}
|
|
3944
3945
|
|
|
3945
3946
|
return Promise.race([
|
|
3946
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
3947
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
3947
3948
|
if (response.status == 204) {
|
|
3948
3949
|
return response;
|
|
3949
3950
|
} else if (response.status >= 200 && response.status < 300) {
|
|
3950
|
-
|
|
3951
|
+
const buffer = await response.arrayBuffer();
|
|
3952
|
+
return tsproto.LinkAccountConfirmRequest.decode(new Uint8Array(buffer)) as unknown as ApiLinkAccountConfirmRequest;
|
|
3951
3953
|
} else {
|
|
3952
3954
|
throw response;
|
|
3953
3955
|
}
|
|
3954
3956
|
}),
|
|
3955
|
-
new Promise((_, reject) =>
|
|
3956
|
-
setTimeout(reject
|
|
3957
|
+
new Promise<never>((_, reject) =>
|
|
3958
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
3957
3959
|
),
|
|
3958
3960
|
]);
|
|
3959
3961
|
}
|
|
@@ -4157,7 +4159,7 @@ export class MezonApi {
|
|
|
4157
4159
|
if (response.status == 204) {
|
|
4158
4160
|
return response;
|
|
4159
4161
|
} else if (response.status >= 200 && response.status < 300) {
|
|
4160
|
-
return response
|
|
4162
|
+
return response;
|
|
4161
4163
|
} else {
|
|
4162
4164
|
throw response;
|
|
4163
4165
|
}
|
|
@@ -5437,7 +5439,7 @@ export class MezonApi {
|
|
|
5437
5439
|
if (response.status == 204) {
|
|
5438
5440
|
return response;
|
|
5439
5441
|
} else if (response.status >= 200 && response.status < 300) {
|
|
5440
|
-
return response
|
|
5442
|
+
return response;
|
|
5441
5443
|
} else {
|
|
5442
5444
|
throw response;
|
|
5443
5445
|
}
|
|
@@ -5480,7 +5482,7 @@ export class MezonApi {
|
|
|
5480
5482
|
if (response.status == 204) {
|
|
5481
5483
|
return response;
|
|
5482
5484
|
} else if (response.status >= 200 && response.status < 300) {
|
|
5483
|
-
return response
|
|
5485
|
+
return response;
|
|
5484
5486
|
} else {
|
|
5485
5487
|
throw response;
|
|
5486
5488
|
}
|
|
@@ -5763,7 +5765,7 @@ export class MezonApi {
|
|
|
5763
5765
|
if (response.status == 204) {
|
|
5764
5766
|
return response;
|
|
5765
5767
|
} else if (response.status >= 200 && response.status < 300) {
|
|
5766
|
-
return response
|
|
5768
|
+
return response;
|
|
5767
5769
|
} else {
|
|
5768
5770
|
throw response;
|
|
5769
5771
|
}
|
|
@@ -5811,7 +5813,7 @@ export class MezonApi {
|
|
|
5811
5813
|
if (response.status == 204) {
|
|
5812
5814
|
return response;
|
|
5813
5815
|
} else if (response.status >= 200 && response.status < 300) {
|
|
5814
|
-
return response
|
|
5816
|
+
return response;
|
|
5815
5817
|
} else {
|
|
5816
5818
|
throw response;
|
|
5817
5819
|
}
|
|
@@ -6817,7 +6819,7 @@ export class MezonApi {
|
|
|
6817
6819
|
if (response.status == 204) {
|
|
6818
6820
|
return response;
|
|
6819
6821
|
} else if (response.status >= 200 && response.status < 300) {
|
|
6820
|
-
return response
|
|
6822
|
+
return response;
|
|
6821
6823
|
} else {
|
|
6822
6824
|
throw response;
|
|
6823
6825
|
}
|
|
@@ -6935,7 +6937,7 @@ export class MezonApi {
|
|
|
6935
6937
|
if (response.status == 204) {
|
|
6936
6938
|
return response;
|
|
6937
6939
|
} else if (response.status >= 200 && response.status < 300) {
|
|
6938
|
-
return response
|
|
6940
|
+
return response;
|
|
6939
6941
|
} else {
|
|
6940
6942
|
throw response;
|
|
6941
6943
|
}
|
|
@@ -6972,7 +6974,7 @@ export class MezonApi {
|
|
|
6972
6974
|
if (response.status == 204) {
|
|
6973
6975
|
return response;
|
|
6974
6976
|
} else if (response.status >= 200 && response.status < 300) {
|
|
6975
|
-
return response
|
|
6977
|
+
return response;
|
|
6976
6978
|
} else {
|
|
6977
6979
|
throw response;
|
|
6978
6980
|
}
|
|
@@ -7406,19 +7408,22 @@ export class MezonApi {
|
|
|
7406
7408
|
fetchOptions.headers["Authorization"] =
|
|
7407
7409
|
"Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
|
7408
7410
|
}
|
|
7411
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
7412
|
+
fetchOptions.headers["Content-Type"] = "application/json";
|
|
7409
7413
|
|
|
7410
7414
|
return Promise.race([
|
|
7411
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
7415
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
7412
7416
|
if (response.status == 204) {
|
|
7413
|
-
return
|
|
7417
|
+
return {} as ApiInviteUserRes;
|
|
7414
7418
|
} else if (response.status >= 200 && response.status < 300) {
|
|
7415
|
-
|
|
7419
|
+
const buffer = await response.arrayBuffer();
|
|
7420
|
+
return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiInviteUserRes;
|
|
7416
7421
|
} else {
|
|
7417
7422
|
throw response;
|
|
7418
7423
|
}
|
|
7419
7424
|
}),
|
|
7420
|
-
new Promise((_, reject) =>
|
|
7421
|
-
setTimeout(reject
|
|
7425
|
+
new Promise<never>((_, reject) =>
|
|
7426
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
7422
7427
|
),
|
|
7423
7428
|
]);
|
|
7424
7429
|
}
|
|
@@ -7642,7 +7647,7 @@ export class MezonApi {
|
|
|
7642
7647
|
if (response.status == 204) {
|
|
7643
7648
|
return response;
|
|
7644
7649
|
} else if (response.status >= 200 && response.status < 300) {
|
|
7645
|
-
return response
|
|
7650
|
+
return response;
|
|
7646
7651
|
} else {
|
|
7647
7652
|
throw response;
|
|
7648
7653
|
}
|
|
@@ -7732,7 +7737,7 @@ export class MezonApi {
|
|
|
7732
7737
|
if (response.status == 204) {
|
|
7733
7738
|
return response;
|
|
7734
7739
|
} else if (response.status >= 200 && response.status < 300) {
|
|
7735
|
-
return response
|
|
7740
|
+
return response;
|
|
7736
7741
|
} else {
|
|
7737
7742
|
throw response;
|
|
7738
7743
|
}
|
|
@@ -7774,7 +7779,7 @@ export class MezonApi {
|
|
|
7774
7779
|
if (response.status == 204) {
|
|
7775
7780
|
return response;
|
|
7776
7781
|
} else if (response.status >= 200 && response.status < 300) {
|
|
7777
|
-
return response
|
|
7782
|
+
return response;
|
|
7778
7783
|
} else {
|
|
7779
7784
|
throw response;
|
|
7780
7785
|
}
|
|
@@ -7816,7 +7821,7 @@ export class MezonApi {
|
|
|
7816
7821
|
if (response.status == 204) {
|
|
7817
7822
|
return response;
|
|
7818
7823
|
} else if (response.status >= 200 && response.status < 300) {
|
|
7819
|
-
return response
|
|
7824
|
+
return response;
|
|
7820
7825
|
} else {
|
|
7821
7826
|
throw response;
|
|
7822
7827
|
}
|
|
@@ -8210,17 +8215,18 @@ export class MezonApi {
|
|
|
8210
8215
|
}
|
|
8211
8216
|
|
|
8212
8217
|
return Promise.race([
|
|
8213
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
8218
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
8214
8219
|
if (response.status == 204) {
|
|
8215
|
-
return
|
|
8220
|
+
return {} as ApiChannelMessageHeader;
|
|
8216
8221
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8217
|
-
|
|
8222
|
+
const buffer = await response.arrayBuffer();
|
|
8223
|
+
return tsproto.ChannelMessageHeader.decode(new Uint8Array(buffer)) as unknown as ApiChannelMessageHeader;
|
|
8218
8224
|
} else {
|
|
8219
8225
|
throw response;
|
|
8220
8226
|
}
|
|
8221
8227
|
}),
|
|
8222
|
-
new Promise((_, reject) =>
|
|
8223
|
-
setTimeout(reject
|
|
8228
|
+
new Promise<never>((_, reject) =>
|
|
8229
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
8224
8230
|
),
|
|
8225
8231
|
]);
|
|
8226
8232
|
}
|
|
@@ -8252,17 +8258,18 @@ export class MezonApi {
|
|
|
8252
8258
|
}
|
|
8253
8259
|
|
|
8254
8260
|
return Promise.race([
|
|
8255
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
8261
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
8256
8262
|
if (response.status == 204) {
|
|
8257
|
-
return
|
|
8263
|
+
return {} as ApiChannelMessageHeader;
|
|
8258
8264
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8259
|
-
|
|
8265
|
+
const buffer = await response.arrayBuffer();
|
|
8266
|
+
return tsproto.ChannelMessageHeader.decode(new Uint8Array(buffer)) as unknown as ApiChannelMessageHeader;
|
|
8260
8267
|
} else {
|
|
8261
8268
|
throw response;
|
|
8262
8269
|
}
|
|
8263
8270
|
}),
|
|
8264
|
-
new Promise((_, reject) =>
|
|
8265
|
-
setTimeout(reject
|
|
8271
|
+
new Promise<never>((_, reject) =>
|
|
8272
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
8266
8273
|
),
|
|
8267
8274
|
]);
|
|
8268
8275
|
}
|
|
@@ -8289,17 +8296,18 @@ export class MezonApi {
|
|
|
8289
8296
|
}
|
|
8290
8297
|
|
|
8291
8298
|
return Promise.race([
|
|
8292
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
8299
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
8293
8300
|
if (response.status == 204) {
|
|
8294
|
-
return
|
|
8301
|
+
return {} as ApiGetPubKeysResponse;
|
|
8295
8302
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8296
|
-
|
|
8303
|
+
const buffer = await response.arrayBuffer();
|
|
8304
|
+
return tsproto.GetPubKeysResponse.decode(new Uint8Array(buffer)) as unknown as ApiGetPubKeysResponse;
|
|
8297
8305
|
} else {
|
|
8298
8306
|
throw response;
|
|
8299
8307
|
}
|
|
8300
8308
|
}),
|
|
8301
|
-
new Promise((_, reject) =>
|
|
8302
|
-
setTimeout(reject
|
|
8309
|
+
new Promise<never>((_, reject) =>
|
|
8310
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
8303
8311
|
),
|
|
8304
8312
|
]);
|
|
8305
8313
|
}
|
|
@@ -8335,7 +8343,7 @@ export class MezonApi {
|
|
|
8335
8343
|
if (response.status == 204) {
|
|
8336
8344
|
return response;
|
|
8337
8345
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8338
|
-
return response
|
|
8346
|
+
return response;
|
|
8339
8347
|
} else {
|
|
8340
8348
|
throw response;
|
|
8341
8349
|
}
|
|
@@ -8377,7 +8385,7 @@ export class MezonApi {
|
|
|
8377
8385
|
if (response.status == 204) {
|
|
8378
8386
|
return response;
|
|
8379
8387
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8380
|
-
return response
|
|
8388
|
+
return response;
|
|
8381
8389
|
} else {
|
|
8382
8390
|
throw response;
|
|
8383
8391
|
}
|
|
@@ -8428,7 +8436,7 @@ export class MezonApi {
|
|
|
8428
8436
|
if (response.status == 204) {
|
|
8429
8437
|
return response;
|
|
8430
8438
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8431
|
-
return response
|
|
8439
|
+
return response;
|
|
8432
8440
|
} else {
|
|
8433
8441
|
throw response;
|
|
8434
8442
|
}
|
|
@@ -8470,7 +8478,7 @@ export class MezonApi {
|
|
|
8470
8478
|
if (response.status == 204) {
|
|
8471
8479
|
return response;
|
|
8472
8480
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8473
|
-
return response
|
|
8481
|
+
return response;
|
|
8474
8482
|
} else {
|
|
8475
8483
|
throw response;
|
|
8476
8484
|
}
|
|
@@ -8607,7 +8615,7 @@ export class MezonApi {
|
|
|
8607
8615
|
if (response.status == 204) {
|
|
8608
8616
|
return response;
|
|
8609
8617
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8610
|
-
return response
|
|
8618
|
+
return response;
|
|
8611
8619
|
} else {
|
|
8612
8620
|
throw response;
|
|
8613
8621
|
}
|
|
@@ -8652,7 +8660,7 @@ export class MezonApi {
|
|
|
8652
8660
|
if (response.status == 204) {
|
|
8653
8661
|
return response;
|
|
8654
8662
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8655
|
-
return response
|
|
8663
|
+
return response;
|
|
8656
8664
|
} else {
|
|
8657
8665
|
throw response;
|
|
8658
8666
|
}
|
|
@@ -8700,7 +8708,7 @@ export class MezonApi {
|
|
|
8700
8708
|
if (response.status == 204) {
|
|
8701
8709
|
return response;
|
|
8702
8710
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8703
|
-
return response
|
|
8711
|
+
return response;
|
|
8704
8712
|
} else {
|
|
8705
8713
|
throw response;
|
|
8706
8714
|
}
|
|
@@ -8966,7 +8974,7 @@ export class MezonApi {
|
|
|
8966
8974
|
if (response.status == 204) {
|
|
8967
8975
|
return response;
|
|
8968
8976
|
} else if (response.status >= 200 && response.status < 300) {
|
|
8969
|
-
return response
|
|
8977
|
+
return response;
|
|
8970
8978
|
} else {
|
|
8971
8979
|
throw response;
|
|
8972
8980
|
}
|
|
@@ -9832,7 +9840,7 @@ export class MezonApi {
|
|
|
9832
9840
|
if (response.status == 204) {
|
|
9833
9841
|
return response;
|
|
9834
9842
|
} else if (response.status >= 200 && response.status < 300) {
|
|
9835
|
-
return response
|
|
9843
|
+
return response;
|
|
9836
9844
|
} else {
|
|
9837
9845
|
throw response;
|
|
9838
9846
|
}
|
|
@@ -9980,7 +9988,7 @@ export class MezonApi {
|
|
|
9980
9988
|
if (response.status == 204) {
|
|
9981
9989
|
return response;
|
|
9982
9990
|
} else if (response.status >= 200 && response.status < 300) {
|
|
9983
|
-
return response
|
|
9991
|
+
return response;
|
|
9984
9992
|
} else {
|
|
9985
9993
|
throw response;
|
|
9986
9994
|
}
|
|
@@ -10072,7 +10080,7 @@ export class MezonApi {
|
|
|
10072
10080
|
if (response.status == 204) {
|
|
10073
10081
|
return response;
|
|
10074
10082
|
} else if (response.status >= 200 && response.status < 300) {
|
|
10075
|
-
return response
|
|
10083
|
+
return response;
|
|
10076
10084
|
} else {
|
|
10077
10085
|
throw response;
|
|
10078
10086
|
}
|
|
@@ -10169,7 +10177,7 @@ export class MezonApi {
|
|
|
10169
10177
|
if (response.status == 204) {
|
|
10170
10178
|
return response;
|
|
10171
10179
|
} else if (response.status >= 200 && response.status < 300) {
|
|
10172
|
-
return response
|
|
10180
|
+
return response;
|
|
10173
10181
|
} else {
|
|
10174
10182
|
throw response;
|
|
10175
10183
|
}
|
|
@@ -10331,7 +10339,7 @@ export class MezonApi {
|
|
|
10331
10339
|
if (response.status == 204) {
|
|
10332
10340
|
return response;
|
|
10333
10341
|
} else if (response.status >= 200 && response.status < 300) {
|
|
10334
|
-
return response
|
|
10342
|
+
return response;
|
|
10335
10343
|
} else {
|
|
10336
10344
|
throw response;
|
|
10337
10345
|
}
|
|
@@ -10465,7 +10473,7 @@ export class MezonApi {
|
|
|
10465
10473
|
if (response.status == 204) {
|
|
10466
10474
|
return response;
|
|
10467
10475
|
} else if (response.status >= 200 && response.status < 300) {
|
|
10468
|
-
return response
|
|
10476
|
+
return response;
|
|
10469
10477
|
} else {
|
|
10470
10478
|
throw response;
|
|
10471
10479
|
}
|
|
@@ -10559,7 +10567,7 @@ export class MezonApi {
|
|
|
10559
10567
|
if (response.status == 204) {
|
|
10560
10568
|
return response;
|
|
10561
10569
|
} else if (response.status >= 200 && response.status < 300) {
|
|
10562
|
-
return response
|
|
10570
|
+
return response;
|
|
10563
10571
|
} else {
|
|
10564
10572
|
throw response;
|
|
10565
10573
|
}
|
|
@@ -11268,38 +11276,41 @@ export class MezonApi {
|
|
|
11268
11276
|
isGuest?:boolean,
|
|
11269
11277
|
options: any = {}): Promise<ApiGenerateMeetTokenExternalResponse> {
|
|
11270
11278
|
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
+
if (token === null || token === undefined) {
|
|
11280
|
+
throw new Error("'token' is a required parameter but is null or undefined.");
|
|
11281
|
+
}
|
|
11282
|
+
const urlPath = "/v2/meet/external/{token}"
|
|
11283
|
+
.replace("{token}", encodeURIComponent(String(token)));
|
|
11284
|
+
const queryParams = new Map<string, any>();
|
|
11285
|
+
queryParams.set("display_name", displayName);
|
|
11286
|
+
queryParams.set("is_guest", isGuest);
|
|
11279
11287
|
|
|
11280
|
-
|
|
11288
|
+
let bodyJson : string = "";
|
|
11281
11289
|
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11290
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
|
11291
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
|
11292
|
+
if (bearerToken) {
|
|
11293
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
|
11294
|
+
}
|
|
11295
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
11296
|
+
fetchOptions.headers["Content-Type"] = "application/json";
|
|
11287
11297
|
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
|
|
11296
|
-
|
|
11297
|
-
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11298
|
+
return Promise.race([
|
|
11299
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
11300
|
+
if (response.status == 204) {
|
|
11301
|
+
return {} as ApiGenerateMeetTokenExternalResponse;
|
|
11302
|
+
} else if (response.status >= 200 && response.status < 300) {
|
|
11303
|
+
const buffer = await response.arrayBuffer();
|
|
11304
|
+
return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiGenerateMeetTokenExternalResponse;
|
|
11305
|
+
} else {
|
|
11306
|
+
throw response;
|
|
11307
|
+
}
|
|
11308
|
+
}),
|
|
11309
|
+
new Promise<never>((_, reject) =>
|
|
11310
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
11311
|
+
),
|
|
11312
|
+
]);
|
|
11313
|
+
}
|
|
11303
11314
|
/** mute participant in the room */
|
|
11304
11315
|
muteParticipantMezonMeet(bearerToken: string,
|
|
11305
11316
|
body:ApiMeetParticipantRequest,
|
|
@@ -11483,19 +11494,22 @@ export class MezonApi {
|
|
|
11483
11494
|
if (basicAuthUsername) {
|
|
11484
11495
|
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
|
11485
11496
|
}
|
|
11497
|
+
fetchOptions.headers["Accept"] = "application/x-protobuf";
|
|
11498
|
+
fetchOptions.headers["Content-Type"] = "application/json";
|
|
11486
11499
|
|
|
11487
11500
|
return Promise.race([
|
|
11488
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
|
11501
|
+
fetch(fullUrl, fetchOptions).then(async (response) => {
|
|
11489
11502
|
if (response.status == 204) {
|
|
11490
|
-
return
|
|
11503
|
+
return {} as ApiListClanDiscover;
|
|
11491
11504
|
} else if (response.status >= 200 && response.status < 300) {
|
|
11492
|
-
|
|
11505
|
+
const buffer = await response.arrayBuffer();
|
|
11506
|
+
return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiListClanDiscover;
|
|
11493
11507
|
} else {
|
|
11494
11508
|
throw response;
|
|
11495
11509
|
}
|
|
11496
11510
|
}),
|
|
11497
|
-
new Promise((_, reject) =>
|
|
11498
|
-
setTimeout(reject
|
|
11511
|
+
new Promise<never>((_, reject) =>
|
|
11512
|
+
setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
|
|
11499
11513
|
),
|
|
11500
11514
|
]);
|
|
11501
11515
|
}
|
package/client.ts
CHANGED
|
@@ -2584,7 +2584,7 @@ export class Client {
|
|
|
2584
2584
|
message_id: p.message_id,
|
|
2585
2585
|
sender_id: p.sender_id,
|
|
2586
2586
|
username: p.username,
|
|
2587
|
-
attachment:
|
|
2587
|
+
attachment: p.attachment,
|
|
2588
2588
|
});
|
|
2589
2589
|
});
|
|
2590
2590
|
return Promise.resolve(result);
|
package/dist/api.gen.d.ts
CHANGED
|
@@ -1245,7 +1245,7 @@ export interface ApiPinMessage {
|
|
|
1245
1245
|
message_id?: string;
|
|
1246
1246
|
sender_id?: string;
|
|
1247
1247
|
username?: string;
|
|
1248
|
-
attachment?:
|
|
1248
|
+
attachment?: Uint8Array;
|
|
1249
1249
|
}
|
|
1250
1250
|
/** */
|
|
1251
1251
|
export interface ApiPinMessageRequest {
|