mezon-js 2.13.74 → 2.13.75

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 CHANGED
@@ -3621,19 +3621,21 @@ export class MezonApi {
3621
3621
  fetchOptions.headers["Authorization"] =
3622
3622
  "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3623
3623
  }
3624
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
3624
3625
 
3625
3626
  return Promise.race([
3626
- fetch(fullUrl, fetchOptions).then((response) => {
3627
+ fetch(fullUrl, fetchOptions).then(async (response) => {
3627
3628
  if (response.status == 204) {
3628
- return response;
3629
+ return {} as ApiSession;
3629
3630
  } else if (response.status >= 200 && response.status < 300) {
3630
- return response.json();
3631
+ const buffer = await response.arrayBuffer();
3632
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
3631
3633
  } else {
3632
3634
  throw response;
3633
3635
  }
3634
3636
  }),
3635
- new Promise((_, reject) =>
3636
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3637
+ new Promise<never>((_, reject) =>
3638
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
3637
3639
  ),
3638
3640
  ]);
3639
3641
  }
@@ -3816,19 +3818,21 @@ export class MezonApi {
3816
3818
  if (basicAuthUsername) {
3817
3819
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3818
3820
  }
3821
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
3819
3822
 
3820
3823
  return Promise.race([
3821
- fetch(fullUrl, fetchOptions).then((response) => {
3824
+ fetch(fullUrl, fetchOptions).then(async (response) => {
3822
3825
  if (response.status == 204) {
3823
- return response;
3826
+ return {} as ApiSession;
3824
3827
  } else if (response.status >= 200 && response.status < 300) {
3825
- return response.json();
3828
+ const buffer = await response.arrayBuffer();
3829
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
3826
3830
  } else {
3827
3831
  throw response;
3828
3832
  }
3829
3833
  }),
3830
- new Promise((_, reject) =>
3831
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3834
+ new Promise<never>((_, reject) =>
3835
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
3832
3836
  ),
3833
3837
  ]);
3834
3838
  }
@@ -3861,19 +3865,21 @@ export class MezonApi {
3861
3865
  if (basicAuthUsername) {
3862
3866
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3863
3867
  }
3868
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
3864
3869
 
3865
3870
  return Promise.race([
3866
- fetch(fullUrl, fetchOptions).then((response) => {
3871
+ fetch(fullUrl, fetchOptions).then(async (response) => {
3867
3872
  if (response.status == 204) {
3868
- return response;
3873
+ return {} as ApiSession;
3869
3874
  } else if (response.status >= 200 && response.status < 300) {
3870
- return response.json();
3875
+ const buffer = await response.arrayBuffer();
3876
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
3871
3877
  } else {
3872
3878
  throw response;
3873
3879
  }
3874
3880
  }),
3875
- new Promise((_, reject) =>
3876
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3881
+ new Promise<never>((_, reject) =>
3882
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
3877
3883
  ),
3878
3884
  ]);
3879
3885
  }
@@ -3972,19 +3978,21 @@ export class MezonApi {
3972
3978
  if (bearerToken) {
3973
3979
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3974
3980
  }
3981
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
3975
3982
 
3976
3983
  return Promise.race([
3977
- fetch(fullUrl, fetchOptions).then((response) => {
3984
+ fetch(fullUrl, fetchOptions).then(async (response) => {
3978
3985
  if (response.status == 204) {
3979
- return response;
3986
+ return {} as ApiSession;
3980
3987
  } else if (response.status >= 200 && response.status < 300) {
3981
- return response.json();
3988
+ const buffer = await response.arrayBuffer();
3989
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
3982
3990
  } else {
3983
3991
  throw response;
3984
3992
  }
3985
3993
  }),
3986
- new Promise((_, reject) =>
3987
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3994
+ new Promise<never>((_, reject) =>
3995
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
3988
3996
  ),
3989
3997
  ]);
3990
3998
  }
@@ -4010,19 +4018,21 @@ export class MezonApi {
4010
4018
  if (basicAuthUsername) {
4011
4019
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
4012
4020
  }
4021
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
4013
4022
 
4014
4023
  return Promise.race([
4015
- fetch(fullUrl, fetchOptions).then((response) => {
4024
+ fetch(fullUrl, fetchOptions).then(async(response) => {
4016
4025
  if (response.status == 204) {
4017
- return response;
4026
+ return {} as ApiSession;
4018
4027
  } else if (response.status >= 200 && response.status < 300) {
4019
- return response.json();
4028
+ const buffer = await response.arrayBuffer();
4029
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
4020
4030
  } else {
4021
4031
  throw response;
4022
4032
  }
4023
4033
  }),
4024
- new Promise((_, reject) =>
4025
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4034
+ new Promise<never>((_, reject) =>
4035
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
4026
4036
  ),
4027
4037
  ]);
4028
4038
  }
@@ -4049,19 +4059,21 @@ export class MezonApi {
4049
4059
  if (bearerToken) {
4050
4060
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4051
4061
  }
4062
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
4052
4063
 
4053
4064
  return Promise.race([
4054
- fetch(fullUrl, fetchOptions).then((response) => {
4065
+ fetch(fullUrl, fetchOptions).then(async (response) => {
4055
4066
  if (response.status == 204) {
4056
- return response;
4067
+ return {} as ApiSession;
4057
4068
  } else if (response.status >= 200 && response.status < 300) {
4058
- return response.json();
4069
+ const buffer = await response.arrayBuffer();
4070
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
4059
4071
  } else {
4060
4072
  throw response;
4061
4073
  }
4062
4074
  }),
4063
- new Promise((_, reject) =>
4064
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4075
+ new Promise<never>((_, reject) =>
4076
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
4065
4077
  ),
4066
4078
  ]);
4067
4079
  }
@@ -11636,19 +11648,21 @@ export class MezonApi {
11636
11648
  if (bearerToken) {
11637
11649
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
11638
11650
  }
11651
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
11639
11652
 
11640
11653
  return Promise.race([
11641
- fetch(fullUrl, fetchOptions).then((response) => {
11654
+ fetch(fullUrl, fetchOptions).then(async (response) => {
11642
11655
  if (response.status == 204) {
11643
- return response;
11656
+ return {} as ApiSession;
11644
11657
  } else if (response.status >= 200 && response.status < 300) {
11645
- return response.json();
11658
+ const buffer = await response.arrayBuffer();
11659
+ return tsproto.Session.decode(new Uint8Array(buffer)) as unknown as ApiSession;
11646
11660
  } else {
11647
11661
  throw response;
11648
11662
  }
11649
11663
  }),
11650
- new Promise((_, reject) =>
11651
- setTimeout(reject, this.timeoutMs, "Request timed out.")
11664
+ new Promise<never>((_, reject) =>
11665
+ setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
11652
11666
  ),
11653
11667
  ]);
11654
11668
  }
@@ -15193,18 +15193,20 @@ var MezonApi = class {
15193
15193
  if (basicAuthUsername) {
15194
15194
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15195
15195
  }
15196
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15196
15197
  return Promise.race([
15197
- fetch(fullUrl, fetchOptions).then((response) => {
15198
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15198
15199
  if (response.status == 204) {
15199
- return response;
15200
+ return {};
15200
15201
  } else if (response.status >= 200 && response.status < 300) {
15201
- return response.json();
15202
+ const buffer = yield response.arrayBuffer();
15203
+ return Session.decode(new Uint8Array(buffer));
15202
15204
  } else {
15203
15205
  throw response;
15204
15206
  }
15205
- }),
15207
+ })),
15206
15208
  new Promise(
15207
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15209
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15208
15210
  )
15209
15211
  ]);
15210
15212
  }
@@ -15342,18 +15344,20 @@ var MezonApi = class {
15342
15344
  if (basicAuthUsername) {
15343
15345
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15344
15346
  }
15347
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15345
15348
  return Promise.race([
15346
- fetch(fullUrl, fetchOptions).then((response) => {
15349
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15347
15350
  if (response.status == 204) {
15348
- return response;
15351
+ return {};
15349
15352
  } else if (response.status >= 200 && response.status < 300) {
15350
- return response.json();
15353
+ const buffer = yield response.arrayBuffer();
15354
+ return Session.decode(new Uint8Array(buffer));
15351
15355
  } else {
15352
15356
  throw response;
15353
15357
  }
15354
- }),
15358
+ })),
15355
15359
  new Promise(
15356
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15360
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15357
15361
  )
15358
15362
  ]);
15359
15363
  }
@@ -15374,18 +15378,20 @@ var MezonApi = class {
15374
15378
  if (basicAuthUsername) {
15375
15379
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15376
15380
  }
15381
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15377
15382
  return Promise.race([
15378
- fetch(fullUrl, fetchOptions).then((response) => {
15383
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15379
15384
  if (response.status == 204) {
15380
- return response;
15385
+ return {};
15381
15386
  } else if (response.status >= 200 && response.status < 300) {
15382
- return response.json();
15387
+ const buffer = yield response.arrayBuffer();
15388
+ return Session.decode(new Uint8Array(buffer));
15383
15389
  } else {
15384
15390
  throw response;
15385
15391
  }
15386
- }),
15392
+ })),
15387
15393
  new Promise(
15388
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15394
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15389
15395
  )
15390
15396
  ]);
15391
15397
  }
@@ -15463,18 +15469,20 @@ var MezonApi = class {
15463
15469
  if (bearerToken) {
15464
15470
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
15465
15471
  }
15472
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15466
15473
  return Promise.race([
15467
- fetch(fullUrl, fetchOptions).then((response) => {
15474
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15468
15475
  if (response.status == 204) {
15469
- return response;
15476
+ return {};
15470
15477
  } else if (response.status >= 200 && response.status < 300) {
15471
- return response.json();
15478
+ const buffer = yield response.arrayBuffer();
15479
+ return Session.decode(new Uint8Array(buffer));
15472
15480
  } else {
15473
15481
  throw response;
15474
15482
  }
15475
- }),
15483
+ })),
15476
15484
  new Promise(
15477
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15485
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15478
15486
  )
15479
15487
  ]);
15480
15488
  }
@@ -15492,18 +15500,20 @@ var MezonApi = class {
15492
15500
  if (basicAuthUsername) {
15493
15501
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15494
15502
  }
15503
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15495
15504
  return Promise.race([
15496
- fetch(fullUrl, fetchOptions).then((response) => {
15505
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15497
15506
  if (response.status == 204) {
15498
- return response;
15507
+ return {};
15499
15508
  } else if (response.status >= 200 && response.status < 300) {
15500
- return response.json();
15509
+ const buffer = yield response.arrayBuffer();
15510
+ return Session.decode(new Uint8Array(buffer));
15501
15511
  } else {
15502
15512
  throw response;
15503
15513
  }
15504
- }),
15514
+ })),
15505
15515
  new Promise(
15506
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15516
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15507
15517
  )
15508
15518
  ]);
15509
15519
  }
@@ -15523,18 +15533,20 @@ var MezonApi = class {
15523
15533
  if (bearerToken) {
15524
15534
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
15525
15535
  }
15536
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15526
15537
  return Promise.race([
15527
- fetch(fullUrl, fetchOptions).then((response) => {
15538
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15528
15539
  if (response.status == 204) {
15529
- return response;
15540
+ return {};
15530
15541
  } else if (response.status >= 200 && response.status < 300) {
15531
- return response.json();
15542
+ const buffer = yield response.arrayBuffer();
15543
+ return Session.decode(new Uint8Array(buffer));
15532
15544
  } else {
15533
15545
  throw response;
15534
15546
  }
15535
- }),
15547
+ })),
15536
15548
  new Promise(
15537
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15549
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15538
15550
  )
15539
15551
  ]);
15540
15552
  }
@@ -21467,18 +21479,20 @@ var MezonApi = class {
21467
21479
  if (bearerToken) {
21468
21480
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
21469
21481
  }
21482
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
21470
21483
  return Promise.race([
21471
- fetch(fullUrl, fetchOptions).then((response) => {
21484
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
21472
21485
  if (response.status == 204) {
21473
- return response;
21486
+ return {};
21474
21487
  } else if (response.status >= 200 && response.status < 300) {
21475
- return response.json();
21488
+ const buffer = yield response.arrayBuffer();
21489
+ return Session.decode(new Uint8Array(buffer));
21476
21490
  } else {
21477
21491
  throw response;
21478
21492
  }
21479
- }),
21493
+ })),
21480
21494
  new Promise(
21481
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
21495
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
21482
21496
  )
21483
21497
  ]);
21484
21498
  }
@@ -15168,18 +15168,20 @@ var MezonApi = class {
15168
15168
  if (basicAuthUsername) {
15169
15169
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15170
15170
  }
15171
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15171
15172
  return Promise.race([
15172
- fetch(fullUrl, fetchOptions).then((response) => {
15173
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15173
15174
  if (response.status == 204) {
15174
- return response;
15175
+ return {};
15175
15176
  } else if (response.status >= 200 && response.status < 300) {
15176
- return response.json();
15177
+ const buffer = yield response.arrayBuffer();
15178
+ return Session.decode(new Uint8Array(buffer));
15177
15179
  } else {
15178
15180
  throw response;
15179
15181
  }
15180
- }),
15182
+ })),
15181
15183
  new Promise(
15182
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15184
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15183
15185
  )
15184
15186
  ]);
15185
15187
  }
@@ -15317,18 +15319,20 @@ var MezonApi = class {
15317
15319
  if (basicAuthUsername) {
15318
15320
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15319
15321
  }
15322
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15320
15323
  return Promise.race([
15321
- fetch(fullUrl, fetchOptions).then((response) => {
15324
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15322
15325
  if (response.status == 204) {
15323
- return response;
15326
+ return {};
15324
15327
  } else if (response.status >= 200 && response.status < 300) {
15325
- return response.json();
15328
+ const buffer = yield response.arrayBuffer();
15329
+ return Session.decode(new Uint8Array(buffer));
15326
15330
  } else {
15327
15331
  throw response;
15328
15332
  }
15329
- }),
15333
+ })),
15330
15334
  new Promise(
15331
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15335
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15332
15336
  )
15333
15337
  ]);
15334
15338
  }
@@ -15349,18 +15353,20 @@ var MezonApi = class {
15349
15353
  if (basicAuthUsername) {
15350
15354
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15351
15355
  }
15356
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15352
15357
  return Promise.race([
15353
- fetch(fullUrl, fetchOptions).then((response) => {
15358
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15354
15359
  if (response.status == 204) {
15355
- return response;
15360
+ return {};
15356
15361
  } else if (response.status >= 200 && response.status < 300) {
15357
- return response.json();
15362
+ const buffer = yield response.arrayBuffer();
15363
+ return Session.decode(new Uint8Array(buffer));
15358
15364
  } else {
15359
15365
  throw response;
15360
15366
  }
15361
- }),
15367
+ })),
15362
15368
  new Promise(
15363
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15369
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15364
15370
  )
15365
15371
  ]);
15366
15372
  }
@@ -15438,18 +15444,20 @@ var MezonApi = class {
15438
15444
  if (bearerToken) {
15439
15445
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
15440
15446
  }
15447
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15441
15448
  return Promise.race([
15442
- fetch(fullUrl, fetchOptions).then((response) => {
15449
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15443
15450
  if (response.status == 204) {
15444
- return response;
15451
+ return {};
15445
15452
  } else if (response.status >= 200 && response.status < 300) {
15446
- return response.json();
15453
+ const buffer = yield response.arrayBuffer();
15454
+ return Session.decode(new Uint8Array(buffer));
15447
15455
  } else {
15448
15456
  throw response;
15449
15457
  }
15450
- }),
15458
+ })),
15451
15459
  new Promise(
15452
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15460
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15453
15461
  )
15454
15462
  ]);
15455
15463
  }
@@ -15467,18 +15475,20 @@ var MezonApi = class {
15467
15475
  if (basicAuthUsername) {
15468
15476
  fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
15469
15477
  }
15478
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15470
15479
  return Promise.race([
15471
- fetch(fullUrl, fetchOptions).then((response) => {
15480
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15472
15481
  if (response.status == 204) {
15473
- return response;
15482
+ return {};
15474
15483
  } else if (response.status >= 200 && response.status < 300) {
15475
- return response.json();
15484
+ const buffer = yield response.arrayBuffer();
15485
+ return Session.decode(new Uint8Array(buffer));
15476
15486
  } else {
15477
15487
  throw response;
15478
15488
  }
15479
- }),
15489
+ })),
15480
15490
  new Promise(
15481
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15491
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15482
15492
  )
15483
15493
  ]);
15484
15494
  }
@@ -15498,18 +15508,20 @@ var MezonApi = class {
15498
15508
  if (bearerToken) {
15499
15509
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
15500
15510
  }
15511
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
15501
15512
  return Promise.race([
15502
- fetch(fullUrl, fetchOptions).then((response) => {
15513
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
15503
15514
  if (response.status == 204) {
15504
- return response;
15515
+ return {};
15505
15516
  } else if (response.status >= 200 && response.status < 300) {
15506
- return response.json();
15517
+ const buffer = yield response.arrayBuffer();
15518
+ return Session.decode(new Uint8Array(buffer));
15507
15519
  } else {
15508
15520
  throw response;
15509
15521
  }
15510
- }),
15522
+ })),
15511
15523
  new Promise(
15512
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
15524
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
15513
15525
  )
15514
15526
  ]);
15515
15527
  }
@@ -21442,18 +21454,20 @@ var MezonApi = class {
21442
21454
  if (bearerToken) {
21443
21455
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
21444
21456
  }
21457
+ fetchOptions.headers["Accept"] = "application/x-protobuf";
21445
21458
  return Promise.race([
21446
- fetch(fullUrl, fetchOptions).then((response) => {
21459
+ fetch(fullUrl, fetchOptions).then((response) => __async(this, null, function* () {
21447
21460
  if (response.status == 204) {
21448
- return response;
21461
+ return {};
21449
21462
  } else if (response.status >= 200 && response.status < 300) {
21450
- return response.json();
21463
+ const buffer = yield response.arrayBuffer();
21464
+ return Session.decode(new Uint8Array(buffer));
21451
21465
  } else {
21452
21466
  throw response;
21453
21467
  }
21454
- }),
21468
+ })),
21455
21469
  new Promise(
21456
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
21470
+ (_, reject) => setTimeout(() => reject(new Error("Request timed out.")), this.timeoutMs)
21457
21471
  )
21458
21472
  ]);
21459
21473
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js",
3
- "version": "2.13.74",
3
+ "version": "2.13.75",
4
4
  "scripts": {
5
5
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
6
6
  },