mezon-js 2.11.46 → 2.12.2

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
@@ -344,8 +344,6 @@ export interface ApiUpdateClanOrderRequest {
344
344
  export interface ApiAccount {
345
345
  //The custom id in the user's account.
346
346
  custom_id?: string;
347
- //The devices which belong to the user's account.
348
- devices?: Array<ApiAccountDevice>;
349
347
  //The UNIX time (for gRPC clients) or ISO string (for REST clients) when the user's account was disabled/banned.
350
348
  disable_time?: string;
351
349
  //The email address of the user.
@@ -376,22 +374,6 @@ export interface ApiAccountApp {
376
374
  vars?: Record<string, string>;
377
375
  }
378
376
 
379
- /** Send a Apple Sign In token to the server. Used with authenticate/link/unlink. */
380
- export interface ApiAccountApple {
381
- //The ID token received from Apple to validate.
382
- token?: string;
383
- //Extra information that will be bundled in the session token.
384
- vars?: Record<string, string>;
385
- }
386
-
387
- /** Send a device to the server. Used with authenticate/link/unlink and user. */
388
- export interface ApiAccountDevice {
389
- //A device identifier. Should be obtained by a platform-specific device API.
390
- id?: string;
391
- //Extra information that will be bundled in the session token.
392
- vars?: Record<string, string>;
393
- }
394
-
395
377
  /** Send an email with password to the server. Used with authenticate/link/unlink. */
396
378
  export interface ApiAccountEmail {
397
379
  //A valid RFC-5322 email address.
@@ -402,50 +384,6 @@ export interface ApiAccountEmail {
402
384
  vars?: Record<string, string>;
403
385
  }
404
386
 
405
- /** Send a Facebook token to the server. Used with authenticate/link/unlink. */
406
- export interface ApiAccountFacebook {
407
- //The OAuth token received from Facebook to access their profile API.
408
- token?: string;
409
- //Extra information that will be bundled in the session token.
410
- vars?: Record<string, string>;
411
- }
412
-
413
- /** Send a Facebook Instant Game token to the server. Used with authenticate/link/unlink. */
414
- export interface ApiAccountFacebookInstantGame {
415
- //
416
- signed_player_info?: string;
417
- //Extra information that will be bundled in the session token.
418
- vars?: Record<string, string>;
419
- }
420
-
421
- /** Send Apple's Game Center account credentials to the server. Used with authenticate/link/unlink.
422
-
423
- https://developer.apple.com/documentation/gamekit/gklocalplayer/1515407-generateidentityverificationsign */
424
- export interface ApiAccountGameCenter {
425
- //Bundle ID (generated by GameCenter).
426
- bundle_id?: string;
427
- //Player ID (generated by GameCenter).
428
- player_id?: string;
429
- //The URL for the public encryption key.
430
- public_key_url?: string;
431
- //A random "NSString" used to compute the hash and keep it randomized.
432
- salt?: string;
433
- //The verification signature data generated.
434
- signature?: string;
435
- //Time since UNIX epoch when the signature was created.
436
- timestamp_seconds?: number;
437
- //Extra information that will be bundled in the session token.
438
- vars?: Record<string, string>;
439
- }
440
-
441
- /** Send a Google token to the server. Used with authenticate/link/unlink. */
442
- export interface ApiAccountGoogle {
443
- //The OAuth token received from Google to access their profile API.
444
- token?: string;
445
- //Extra information that will be bundled in the session token.
446
- vars?: Record<string, string>;
447
- }
448
-
449
387
  /** Send a Mezon token to the server. Used with authenticate/link/unlink. */
450
388
  export interface ApiAccountMezon {
451
389
  //The OAuth token received from Google to access their profile API.
@@ -454,13 +392,6 @@ export interface ApiAccountMezon {
454
392
  vars?: Record<string, string>;
455
393
  }
456
394
 
457
- /** Send a Steam token to the server. Used with authenticate/link/unlink. */
458
- export interface ApiAccountSteam {
459
- //The account token received from Steam to access their profile API.
460
- token?: string;
461
- //Extra information that will be bundled in the session token.
462
- vars?: Record<string, string>;
463
- }
464
395
 
465
396
  /** */
466
397
  export interface ApiAddFavoriteChannelRequest {
@@ -1572,14 +1503,6 @@ export interface ApiLinkInviteUserRequest {
1572
1503
  expiry_time?: number;
1573
1504
  }
1574
1505
 
1575
- /** Link Steam to the current user's account. */
1576
- export interface ApiLinkSteamRequest {
1577
- //The Facebook account details.
1578
- account?: ApiAccountSteam;
1579
- //Import Steam friends for the user.
1580
- sync?: boolean;
1581
- }
1582
-
1583
1506
  export interface ApiNotifiReactMessage {
1584
1507
  //
1585
1508
  channel_id?: string;
@@ -2403,6 +2326,7 @@ export interface ApiSession {
2403
2326
  token?: string;
2404
2327
  // Whether to enable "Remember Me" for extended session duration.
2405
2328
  is_remember?: boolean;
2329
+ api_url?: string;
2406
2330
  }
2407
2331
 
2408
2332
  /** Log out a session, invalidate a refresh token, or log out all sessions/refresh tokens for a user. */
@@ -3365,53 +3289,9 @@ export class MezonApi {
3365
3289
  ]);
3366
3290
  }
3367
3291
 
3368
- /** Authenticate a user with an Apple ID against the server. */
3369
- authenticateApple(
3370
- basicAuthUsername: string,
3371
- basicAuthPassword: string,
3372
- account: ApiAccountApple,
3373
- create?: boolean,
3374
- username?: string,
3375
- options: any = {}
3376
- ): Promise<ApiSession> {
3377
- if (account === null || account === undefined) {
3378
- throw new Error(
3379
- "'account' is a required parameter but is null or undefined."
3380
- );
3381
- }
3382
- const urlPath = "/v2/account/authenticate/apple";
3383
- const queryParams = new Map<string, any>();
3384
- queryParams.set("create", create);
3385
- queryParams.set("username", username);
3386
-
3387
- let bodyJson: string = "";
3388
- bodyJson = JSON.stringify(account || {});
3389
-
3390
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3391
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3392
- if (basicAuthUsername) {
3393
- fetchOptions.headers["Authorization"] =
3394
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3395
- }
3396
-
3397
- return Promise.race([
3398
- fetch(fullUrl, fetchOptions).then((response) => {
3399
- if (response.status == 204) {
3400
- return response;
3401
- } else if (response.status >= 200 && response.status < 300) {
3402
- return response.json();
3403
- } else {
3404
- throw response;
3405
- }
3406
- }),
3407
- new Promise((_, reject) =>
3408
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3409
- ),
3410
- ]);
3411
- }
3412
-
3413
3292
  /** */
3414
3293
  checkLoginRequest(
3294
+ basePath: string,
3415
3295
  basicAuthUsername: string,
3416
3296
  basicAuthPassword: string,
3417
3297
  body: ApiConfirmLoginRequest,
@@ -3428,7 +3308,7 @@ export class MezonApi {
3428
3308
  let bodyJson: string = "";
3429
3309
  bodyJson = JSON.stringify(body || {});
3430
3310
 
3431
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3311
+ const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
3432
3312
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3433
3313
  if (basicAuthUsername) {
3434
3314
  fetchOptions.headers["Authorization"] =
@@ -3453,6 +3333,7 @@ export class MezonApi {
3453
3333
 
3454
3334
  /** */
3455
3335
  confirmLogin(
3336
+ basePath: string,
3456
3337
  bearerToken: string,
3457
3338
  body: ApiConfirmLoginRequest,
3458
3339
  options: any = {}
@@ -3468,7 +3349,7 @@ export class MezonApi {
3468
3349
  let bodyJson: string = "";
3469
3350
  bodyJson = JSON.stringify(body || {});
3470
3351
 
3471
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3352
+ const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
3472
3353
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3473
3354
  if (bearerToken) {
3474
3355
  fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
@@ -3492,6 +3373,7 @@ export class MezonApi {
3492
3373
 
3493
3374
  /** */
3494
3375
  createQRLogin(
3376
+ basePath: string,
3495
3377
  basicAuthUsername: string,
3496
3378
  basicAuthPassword: string,
3497
3379
  body: ApiLoginRequest,
@@ -3508,7 +3390,7 @@ export class MezonApi {
3508
3390
  let bodyJson: string = "";
3509
3391
  bodyJson = JSON.stringify(body || {});
3510
3392
 
3511
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3393
+ const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
3512
3394
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3513
3395
  if (basicAuthUsername) {
3514
3396
  fetchOptions.headers["Authorization"] =
@@ -3531,33 +3413,28 @@ export class MezonApi {
3531
3413
  ]);
3532
3414
  }
3533
3415
 
3534
- /** Authenticate a user with a device id against the server. */
3535
- authenticateDevice(
3416
+
3417
+ /** Authenticate a user with an email+password against the server. */
3418
+ authenticateEmail(
3419
+ basePath: string,
3536
3420
  basicAuthUsername: string,
3537
3421
  basicAuthPassword: string,
3538
- account: ApiAccountDevice,
3539
- create?: boolean,
3540
- username?: string,
3541
- options: any = {}
3542
- ): Promise<ApiSession> {
3543
- if (account === null || account === undefined) {
3544
- throw new Error(
3545
- "'account' is a required parameter but is null or undefined."
3546
- );
3422
+ body:ApiAuthenticateEmailRequest,
3423
+ options: any = {}): Promise<ApiSession> {
3424
+
3425
+ if (body === null || body === undefined) {
3426
+ throw new Error("'body' is a required parameter but is null or undefined.");
3547
3427
  }
3548
- const urlPath = "/v2/account/authenticate/device";
3428
+ const urlPath = "/v2/account/authenticate/email";
3549
3429
  const queryParams = new Map<string, any>();
3550
- queryParams.set("create", create);
3551
- queryParams.set("username", username);
3552
3430
 
3553
- let bodyJson: string = "";
3554
- bodyJson = JSON.stringify(account || {});
3431
+ let bodyJson : string = "";
3432
+ bodyJson = JSON.stringify(body || {});
3555
3433
 
3556
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3434
+ const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
3557
3435
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3558
3436
  if (basicAuthUsername) {
3559
- fetchOptions.headers["Authorization"] =
3560
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3437
+ fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3561
3438
  }
3562
3439
 
3563
3440
  return Promise.race([
@@ -3576,26 +3453,35 @@ export class MezonApi {
3576
3453
  ]);
3577
3454
  }
3578
3455
 
3579
- /** Authenticate a user with an email+password against the server. */
3580
- authenticateEmail(basicAuthUsername: string,
3456
+ /** Authenticate a user with Mezon against the server. */
3457
+ authenticateMezon(
3458
+ basePath: string,
3459
+ basicAuthUsername: string,
3581
3460
  basicAuthPassword: string,
3582
- body:ApiAuthenticateEmailRequest,
3583
- options: any = {}): Promise<ApiSession> {
3461
+ account:ApiAccountMezon,
3462
+ create?:boolean,
3463
+ username?:string,
3464
+ isRemember?:boolean,
3465
+ options: any = {}
3466
+ ): Promise<ApiSession> {
3584
3467
 
3585
- if (body === null || body === undefined) {
3586
- throw new Error("'body' is a required parameter but is null or undefined.");
3468
+ if (account === null || account === undefined) {
3469
+ throw new Error("'account' is a required parameter but is null or undefined.");
3587
3470
  }
3588
- const urlPath = "/v2/account/authenticate/email";
3471
+ const urlPath = "/v2/account/authenticate/mezon";
3589
3472
  const queryParams = new Map<string, any>();
3473
+ queryParams.set("create", create);
3474
+ queryParams.set("username", username);
3475
+ queryParams.set("is_remember", isRemember);
3590
3476
 
3591
3477
  let bodyJson : string = "";
3592
- bodyJson = JSON.stringify(body || {});
3478
+ bodyJson = JSON.stringify(account || {});
3593
3479
 
3594
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3480
+ const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
3595
3481
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3596
- if (basicAuthUsername) {
3597
- fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3598
- }
3482
+ if (basicAuthUsername) {
3483
+ fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3484
+ }
3599
3485
 
3600
3486
  return Promise.race([
3601
3487
  fetch(fullUrl, fetchOptions).then((response) => {
@@ -3613,35 +3499,27 @@ export class MezonApi {
3613
3499
  ]);
3614
3500
  }
3615
3501
 
3616
- /** Authenticate a user with a Facebook OAuth token against the server. */
3617
- authenticateFacebook(
3618
- basicAuthUsername: string,
3619
- basicAuthPassword: string,
3620
- account: ApiAccountFacebook,
3621
- create?: boolean,
3622
- username?: string,
3623
- sync?: boolean,
3502
+ /** Add an email+password to the social profiles on the current user's account. */
3503
+ linkEmail(
3504
+ bearerToken: string,
3505
+ body: ApiAccountEmail,
3624
3506
  options: any = {}
3625
- ): Promise<ApiSession> {
3626
- if (account === null || account === undefined) {
3507
+ ): Promise<any> {
3508
+ if (body === null || body === undefined) {
3627
3509
  throw new Error(
3628
- "'account' is a required parameter but is null or undefined."
3510
+ "'body' is a required parameter but is null or undefined."
3629
3511
  );
3630
3512
  }
3631
- const urlPath = "/v2/account/authenticate/facebook";
3513
+ const urlPath = "/v2/account/link/email";
3632
3514
  const queryParams = new Map<string, any>();
3633
- queryParams.set("create", create);
3634
- queryParams.set("username", username);
3635
- queryParams.set("sync", sync);
3636
3515
 
3637
3516
  let bodyJson: string = "";
3638
- bodyJson = JSON.stringify(account || {});
3517
+ bodyJson = JSON.stringify(body || {});
3639
3518
 
3640
3519
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3641
3520
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3642
- if (basicAuthUsername) {
3643
- fetchOptions.headers["Authorization"] =
3644
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3521
+ if (bearerToken) {
3522
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3645
3523
  }
3646
3524
 
3647
3525
  return Promise.race([
@@ -3660,33 +3538,63 @@ export class MezonApi {
3660
3538
  ]);
3661
3539
  }
3662
3540
 
3663
- /** Authenticate a user with a Facebook Instant Game token against the server. */
3664
- authenticateFacebookInstantGame(
3665
- basicAuthUsername: string,
3666
- basicAuthPassword: string,
3667
- account: ApiAccountFacebookInstantGame,
3668
- create?: boolean,
3669
- username?: string,
3541
+ /** Add a mezon ID to the social profiles on the current user's account. */
3542
+ linkMezon(bearerToken: string,
3543
+ body:ApiAccountMezon,
3544
+ options: any = {}): Promise<any> {
3545
+
3546
+ if (body === null || body === undefined) {
3547
+ throw new Error("'body' is a required parameter but is null or undefined.");
3548
+ }
3549
+ const urlPath = "/v2/account/link/mezon";
3550
+ const queryParams = new Map<string, any>();
3551
+
3552
+ let bodyJson : string = "";
3553
+ bodyJson = JSON.stringify(body || {});
3554
+
3555
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3556
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3557
+ if (bearerToken) {
3558
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3559
+ }
3560
+
3561
+ return Promise.race([
3562
+ fetch(fullUrl, fetchOptions).then((response) => {
3563
+ if (response.status == 204) {
3564
+ return response;
3565
+ } else if (response.status >= 200 && response.status < 300) {
3566
+ return response.json();
3567
+ } else {
3568
+ throw response;
3569
+ }
3570
+ }),
3571
+ new Promise((_, reject) =>
3572
+ setTimeout(reject, this.timeoutMs, "Request timed out.")
3573
+ ),
3574
+ ]);
3575
+ }
3576
+
3577
+ /** Authenticate a user with an email+password against the server. */
3578
+ registrationEmail(
3579
+ bearerToken: string,
3580
+ body: ApiRegistrationEmailRequest,
3670
3581
  options: any = {}
3671
3582
  ): Promise<ApiSession> {
3672
- if (account === null || account === undefined) {
3583
+ if (body === null || body === undefined) {
3673
3584
  throw new Error(
3674
- "'account' is a required parameter but is null or undefined."
3585
+ "'body' is a required parameter but is null or undefined."
3675
3586
  );
3676
3587
  }
3677
- const urlPath = "/v2/account/authenticate/facebookinstantgame";
3588
+ const urlPath = "/v2/account/registry";
3678
3589
  const queryParams = new Map<string, any>();
3679
- queryParams.set("create", create);
3680
- queryParams.set("username", username);
3681
3590
 
3682
3591
  let bodyJson: string = "";
3683
- bodyJson = JSON.stringify(account || {});
3592
+ bodyJson = JSON.stringify(body || {});
3684
3593
 
3685
3594
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3686
3595
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3687
- if (basicAuthUsername) {
3688
- fetchOptions.headers["Authorization"] =
3689
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3596
+ if (bearerToken) {
3597
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3690
3598
  }
3691
3599
 
3692
3600
  return Promise.race([
@@ -3705,27 +3613,23 @@ export class MezonApi {
3705
3613
  ]);
3706
3614
  }
3707
3615
 
3708
- /** Authenticate a user with Apple's GameCenter against the server. */
3709
- authenticateGameCenter(
3616
+ /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
3617
+ sessionRefresh(
3710
3618
  basicAuthUsername: string,
3711
3619
  basicAuthPassword: string,
3712
- account: ApiAccountGameCenter,
3713
- create?: boolean,
3714
- username?: string,
3620
+ body: ApiSessionRefreshRequest,
3715
3621
  options: any = {}
3716
3622
  ): Promise<ApiSession> {
3717
- if (account === null || account === undefined) {
3623
+ if (body === null || body === undefined) {
3718
3624
  throw new Error(
3719
- "'account' is a required parameter but is null or undefined."
3625
+ "'body' is a required parameter but is null or undefined."
3720
3626
  );
3721
3627
  }
3722
- const urlPath = "/v2/account/authenticate/gamecenter";
3628
+ const urlPath = "/v2/account/session/refresh";
3723
3629
  const queryParams = new Map<string, any>();
3724
- queryParams.set("create", create);
3725
- queryParams.set("username", username);
3726
3630
 
3727
3631
  let bodyJson: string = "";
3728
- bodyJson = JSON.stringify(account || {});
3632
+ bodyJson = JSON.stringify(body || {});
3729
3633
 
3730
3634
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3731
3635
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
@@ -3750,828 +3654,27 @@ export class MezonApi {
3750
3654
  ]);
3751
3655
  }
3752
3656
 
3753
- /** Authenticate a user with Google against the server. */
3754
- authenticateGoogle(
3755
- basicAuthUsername: string,
3756
- basicAuthPassword: string,
3757
- account: ApiAccountGoogle,
3758
- create?: boolean,
3759
- username?: string,
3657
+ /** Remove the email+password from the social profiles on the current user's account. */
3658
+ unlinkEmail(
3659
+ bearerToken: string,
3660
+ body: ApiAccountEmail,
3760
3661
  options: any = {}
3761
- ): Promise<ApiSession> {
3762
- if (account === null || account === undefined) {
3662
+ ): Promise<any> {
3663
+ if (body === null || body === undefined) {
3763
3664
  throw new Error(
3764
- "'account' is a required parameter but is null or undefined."
3665
+ "'body' is a required parameter but is null or undefined."
3765
3666
  );
3766
3667
  }
3767
- const urlPath = "/v2/account/authenticate/google";
3668
+ const urlPath = "/v2/account/unlink/email";
3768
3669
  const queryParams = new Map<string, any>();
3769
- queryParams.set("create", create);
3770
- queryParams.set("username", username);
3771
3670
 
3772
3671
  let bodyJson: string = "";
3773
- bodyJson = JSON.stringify(account || {});
3672
+ bodyJson = JSON.stringify(body || {});
3774
3673
 
3775
3674
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3776
3675
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3777
- if (basicAuthUsername) {
3778
- fetchOptions.headers["Authorization"] =
3779
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3780
- }
3781
-
3782
- return Promise.race([
3783
- fetch(fullUrl, fetchOptions).then((response) => {
3784
- if (response.status == 204) {
3785
- return response;
3786
- } else if (response.status >= 200 && response.status < 300) {
3787
- return response.json();
3788
- } else {
3789
- throw response;
3790
- }
3791
- }),
3792
- new Promise((_, reject) =>
3793
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3794
- ),
3795
- ]);
3796
- }
3797
-
3798
- /** Authenticate a user with Mezon against the server. */
3799
- authenticateMezon(
3800
- basicAuthUsername: string,
3801
- basicAuthPassword: string,
3802
- account:ApiAccountMezon,
3803
- create?:boolean,
3804
- username?:string,
3805
- isRemember?:boolean,
3806
- options: any = {}
3807
- ): Promise<ApiSession> {
3808
-
3809
- if (account === null || account === undefined) {
3810
- throw new Error("'account' is a required parameter but is null or undefined.");
3811
- }
3812
- const urlPath = "/v2/account/authenticate/mezon";
3813
- const queryParams = new Map<string, any>();
3814
- queryParams.set("create", create);
3815
- queryParams.set("username", username);
3816
- queryParams.set("is_remember", isRemember);
3817
-
3818
- let bodyJson : string = "";
3819
- bodyJson = JSON.stringify(account || {});
3820
-
3821
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3822
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3823
- if (basicAuthUsername) {
3824
- fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3825
- }
3826
-
3827
- return Promise.race([
3828
- fetch(fullUrl, fetchOptions).then((response) => {
3829
- if (response.status == 204) {
3830
- return response;
3831
- } else if (response.status >= 200 && response.status < 300) {
3832
- return response.json();
3833
- } else {
3834
- throw response;
3835
- }
3836
- }),
3837
- new Promise((_, reject) =>
3838
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3839
- ),
3840
- ]);
3841
- }
3842
-
3843
- /** Authenticate a user with Steam against the server. */
3844
- authenticateSteam(
3845
- basicAuthUsername: string,
3846
- basicAuthPassword: string,
3847
- account: ApiAccountSteam,
3848
- create?: boolean,
3849
- username?: string,
3850
- sync?: boolean,
3851
- options: any = {}
3852
- ): Promise<ApiSession> {
3853
- if (account === null || account === undefined) {
3854
- throw new Error(
3855
- "'account' is a required parameter but is null or undefined."
3856
- );
3857
- }
3858
- const urlPath = "/v2/account/authenticate/steam";
3859
- const queryParams = new Map<string, any>();
3860
- queryParams.set("create", create);
3861
- queryParams.set("username", username);
3862
- queryParams.set("sync", sync);
3863
-
3864
- let bodyJson: string = "";
3865
- bodyJson = JSON.stringify(account || {});
3866
-
3867
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3868
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3869
- if (basicAuthUsername) {
3870
- fetchOptions.headers["Authorization"] =
3871
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
3872
- }
3873
-
3874
- return Promise.race([
3875
- fetch(fullUrl, fetchOptions).then((response) => {
3876
- if (response.status == 204) {
3877
- return response;
3878
- } else if (response.status >= 200 && response.status < 300) {
3879
- return response.json();
3880
- } else {
3881
- throw response;
3882
- }
3883
- }),
3884
- new Promise((_, reject) =>
3885
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3886
- ),
3887
- ]);
3888
- }
3889
-
3890
- /** Add an Apple ID to the social profiles on the current user's account. */
3891
- linkApple(
3892
- bearerToken: string,
3893
- body: ApiAccountApple,
3894
- options: any = {}
3895
- ): Promise<any> {
3896
- if (body === null || body === undefined) {
3897
- throw new Error(
3898
- "'body' is a required parameter but is null or undefined."
3899
- );
3900
- }
3901
- const urlPath = "/v2/account/link/apple";
3902
- const queryParams = new Map<string, any>();
3903
-
3904
- let bodyJson: string = "";
3905
- bodyJson = JSON.stringify(body || {});
3906
-
3907
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3908
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3909
- if (bearerToken) {
3910
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3911
- }
3912
-
3913
- return Promise.race([
3914
- fetch(fullUrl, fetchOptions).then((response) => {
3915
- if (response.status == 204) {
3916
- return response;
3917
- } else if (response.status >= 200 && response.status < 300) {
3918
- return response.json();
3919
- } else {
3920
- throw response;
3921
- }
3922
- }),
3923
- new Promise((_, reject) =>
3924
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3925
- ),
3926
- ]);
3927
- }
3928
-
3929
- /** Add a device ID to the social profiles on the current user's account. */
3930
- linkDevice(
3931
- bearerToken: string,
3932
- body: ApiAccountDevice,
3933
- options: any = {}
3934
- ): Promise<any> {
3935
- if (body === null || body === undefined) {
3936
- throw new Error(
3937
- "'body' is a required parameter but is null or undefined."
3938
- );
3939
- }
3940
- const urlPath = "/v2/account/link/device";
3941
- const queryParams = new Map<string, any>();
3942
-
3943
- let bodyJson: string = "";
3944
- bodyJson = JSON.stringify(body || {});
3945
-
3946
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3947
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3948
- if (bearerToken) {
3949
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3950
- }
3951
-
3952
- return Promise.race([
3953
- fetch(fullUrl, fetchOptions).then((response) => {
3954
- if (response.status == 204) {
3955
- return response;
3956
- } else if (response.status >= 200 && response.status < 300) {
3957
- return response.json();
3958
- } else {
3959
- throw response;
3960
- }
3961
- }),
3962
- new Promise((_, reject) =>
3963
- setTimeout(reject, this.timeoutMs, "Request timed out.")
3964
- ),
3965
- ]);
3966
- }
3967
-
3968
- /** Add an email+password to the social profiles on the current user's account. */
3969
- linkEmail(
3970
- bearerToken: string,
3971
- body: ApiAccountEmail,
3972
- options: any = {}
3973
- ): Promise<any> {
3974
- if (body === null || body === undefined) {
3975
- throw new Error(
3976
- "'body' is a required parameter but is null or undefined."
3977
- );
3978
- }
3979
- const urlPath = "/v2/account/link/email";
3980
- const queryParams = new Map<string, any>();
3981
-
3982
- let bodyJson: string = "";
3983
- bodyJson = JSON.stringify(body || {});
3984
-
3985
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
3986
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
3987
- if (bearerToken) {
3988
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3989
- }
3990
-
3991
- return Promise.race([
3992
- fetch(fullUrl, fetchOptions).then((response) => {
3993
- if (response.status == 204) {
3994
- return response;
3995
- } else if (response.status >= 200 && response.status < 300) {
3996
- return response.json();
3997
- } else {
3998
- throw response;
3999
- }
4000
- }),
4001
- new Promise((_, reject) =>
4002
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4003
- ),
4004
- ]);
4005
- }
4006
-
4007
- /** Add Facebook to the social profiles on the current user's account. */
4008
- linkFacebook(
4009
- bearerToken: string,
4010
- account: ApiAccountFacebook,
4011
- sync?: boolean,
4012
- options: any = {}
4013
- ): Promise<any> {
4014
- if (account === null || account === undefined) {
4015
- throw new Error(
4016
- "'account' is a required parameter but is null or undefined."
4017
- );
4018
- }
4019
- const urlPath = "/v2/account/link/facebook";
4020
- const queryParams = new Map<string, any>();
4021
- queryParams.set("sync", sync);
4022
-
4023
- let bodyJson: string = "";
4024
- bodyJson = JSON.stringify(account || {});
4025
-
4026
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4027
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4028
- if (bearerToken) {
4029
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4030
- }
4031
-
4032
- return Promise.race([
4033
- fetch(fullUrl, fetchOptions).then((response) => {
4034
- if (response.status == 204) {
4035
- return response;
4036
- } else if (response.status >= 200 && response.status < 300) {
4037
- return response.json();
4038
- } else {
4039
- throw response;
4040
- }
4041
- }),
4042
- new Promise((_, reject) =>
4043
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4044
- ),
4045
- ]);
4046
- }
4047
-
4048
- /** Add Facebook Instant Game to the social profiles on the current user's account. */
4049
- linkFacebookInstantGame(
4050
- bearerToken: string,
4051
- body: ApiAccountFacebookInstantGame,
4052
- options: any = {}
4053
- ): Promise<any> {
4054
- if (body === null || body === undefined) {
4055
- throw new Error(
4056
- "'body' is a required parameter but is null or undefined."
4057
- );
4058
- }
4059
- const urlPath = "/v2/account/link/facebookinstantgame";
4060
- const queryParams = new Map<string, any>();
4061
-
4062
- let bodyJson: string = "";
4063
- bodyJson = JSON.stringify(body || {});
4064
-
4065
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4066
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4067
- if (bearerToken) {
4068
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4069
- }
4070
-
4071
- return Promise.race([
4072
- fetch(fullUrl, fetchOptions).then((response) => {
4073
- if (response.status == 204) {
4074
- return response;
4075
- } else if (response.status >= 200 && response.status < 300) {
4076
- return response.json();
4077
- } else {
4078
- throw response;
4079
- }
4080
- }),
4081
- new Promise((_, reject) =>
4082
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4083
- ),
4084
- ]);
4085
- }
4086
-
4087
- /** Add Apple's GameCenter to the social profiles on the current user's account. */
4088
- linkGameCenter(
4089
- bearerToken: string,
4090
- body: ApiAccountGameCenter,
4091
- options: any = {}
4092
- ): Promise<any> {
4093
- if (body === null || body === undefined) {
4094
- throw new Error(
4095
- "'body' is a required parameter but is null or undefined."
4096
- );
4097
- }
4098
- const urlPath = "/v2/account/link/gamecenter";
4099
- const queryParams = new Map<string, any>();
4100
-
4101
- let bodyJson: string = "";
4102
- bodyJson = JSON.stringify(body || {});
4103
-
4104
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4105
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4106
- if (bearerToken) {
4107
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4108
- }
4109
-
4110
- return Promise.race([
4111
- fetch(fullUrl, fetchOptions).then((response) => {
4112
- if (response.status == 204) {
4113
- return response;
4114
- } else if (response.status >= 200 && response.status < 300) {
4115
- return response.json();
4116
- } else {
4117
- throw response;
4118
- }
4119
- }),
4120
- new Promise((_, reject) =>
4121
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4122
- ),
4123
- ]);
4124
- }
4125
-
4126
- /** Add a mezon ID to the social profiles on the current user's account. */
4127
- linkMezon(bearerToken: string,
4128
- body:ApiAccountMezon,
4129
- options: any = {}): Promise<any> {
4130
-
4131
- if (body === null || body === undefined) {
4132
- throw new Error("'body' is a required parameter but is null or undefined.");
4133
- }
4134
- const urlPath = "/v2/account/link/mezon";
4135
- const queryParams = new Map<string, any>();
4136
-
4137
- let bodyJson : string = "";
4138
- bodyJson = JSON.stringify(body || {});
4139
-
4140
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4141
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4142
- if (bearerToken) {
4143
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4144
- }
4145
-
4146
- return Promise.race([
4147
- fetch(fullUrl, fetchOptions).then((response) => {
4148
- if (response.status == 204) {
4149
- return response;
4150
- } else if (response.status >= 200 && response.status < 300) {
4151
- return response.json();
4152
- } else {
4153
- throw response;
4154
- }
4155
- }),
4156
- new Promise((_, reject) =>
4157
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4158
- ),
4159
- ]);
4160
- }
4161
-
4162
- /** Add Google to the social profiles on the current user's account. */
4163
- linkGoogle(
4164
- bearerToken: string,
4165
- body: ApiAccountGoogle,
4166
- options: any = {}
4167
- ): Promise<any> {
4168
- if (body === null || body === undefined) {
4169
- throw new Error(
4170
- "'body' is a required parameter but is null or undefined."
4171
- );
4172
- }
4173
- const urlPath = "/v2/account/link/google";
4174
- const queryParams = new Map<string, any>();
4175
-
4176
- let bodyJson: string = "";
4177
- bodyJson = JSON.stringify(body || {});
4178
-
4179
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4180
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4181
- if (bearerToken) {
4182
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4183
- }
4184
-
4185
- return Promise.race([
4186
- fetch(fullUrl, fetchOptions).then((response) => {
4187
- if (response.status == 204) {
4188
- return response;
4189
- } else if (response.status >= 200 && response.status < 300) {
4190
- return response.json();
4191
- } else {
4192
- throw response;
4193
- }
4194
- }),
4195
- new Promise((_, reject) =>
4196
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4197
- ),
4198
- ]);
4199
- }
4200
-
4201
- /** Add Steam to the social profiles on the current user's account. */
4202
- linkSteam(
4203
- bearerToken: string,
4204
- body: ApiLinkSteamRequest,
4205
- options: any = {}
4206
- ): Promise<any> {
4207
- if (body === null || body === undefined) {
4208
- throw new Error(
4209
- "'body' is a required parameter but is null or undefined."
4210
- );
4211
- }
4212
- const urlPath = "/v2/account/link/steam";
4213
- const queryParams = new Map<string, any>();
4214
-
4215
- let bodyJson: string = "";
4216
- bodyJson = JSON.stringify(body || {});
4217
-
4218
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4219
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4220
- if (bearerToken) {
4221
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4222
- }
4223
-
4224
- return Promise.race([
4225
- fetch(fullUrl, fetchOptions).then((response) => {
4226
- if (response.status == 204) {
4227
- return response;
4228
- } else if (response.status >= 200 && response.status < 300) {
4229
- return response.json();
4230
- } else {
4231
- throw response;
4232
- }
4233
- }),
4234
- new Promise((_, reject) =>
4235
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4236
- ),
4237
- ]);
4238
- }
4239
-
4240
- /** Authenticate a user with an email+password against the server. */
4241
- registrationEmail(
4242
- bearerToken: string,
4243
- body: ApiRegistrationEmailRequest,
4244
- options: any = {}
4245
- ): Promise<ApiSession> {
4246
- if (body === null || body === undefined) {
4247
- throw new Error(
4248
- "'body' is a required parameter but is null or undefined."
4249
- );
4250
- }
4251
- const urlPath = "/v2/account/registry";
4252
- const queryParams = new Map<string, any>();
4253
-
4254
- let bodyJson: string = "";
4255
- bodyJson = JSON.stringify(body || {});
4256
-
4257
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4258
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4259
- if (bearerToken) {
4260
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4261
- }
4262
-
4263
- return Promise.race([
4264
- fetch(fullUrl, fetchOptions).then((response) => {
4265
- if (response.status == 204) {
4266
- return response;
4267
- } else if (response.status >= 200 && response.status < 300) {
4268
- return response.json();
4269
- } else {
4270
- throw response;
4271
- }
4272
- }),
4273
- new Promise((_, reject) =>
4274
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4275
- ),
4276
- ]);
4277
- }
4278
-
4279
- /** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
4280
- sessionRefresh(
4281
- basicAuthUsername: string,
4282
- basicAuthPassword: string,
4283
- body: ApiSessionRefreshRequest,
4284
- options: any = {}
4285
- ): Promise<ApiSession> {
4286
- if (body === null || body === undefined) {
4287
- throw new Error(
4288
- "'body' is a required parameter but is null or undefined."
4289
- );
4290
- }
4291
- const urlPath = "/v2/account/session/refresh";
4292
- const queryParams = new Map<string, any>();
4293
-
4294
- let bodyJson: string = "";
4295
- bodyJson = JSON.stringify(body || {});
4296
-
4297
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4298
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4299
- if (basicAuthUsername) {
4300
- fetchOptions.headers["Authorization"] =
4301
- "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
4302
- }
4303
-
4304
- return Promise.race([
4305
- fetch(fullUrl, fetchOptions).then((response) => {
4306
- if (response.status == 204) {
4307
- return response;
4308
- } else if (response.status >= 200 && response.status < 300) {
4309
- return response.json();
4310
- } else {
4311
- throw response;
4312
- }
4313
- }),
4314
- new Promise((_, reject) =>
4315
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4316
- ),
4317
- ]);
4318
- }
4319
-
4320
- /** Remove the Apple ID from the social profiles on the current user's account. */
4321
- unlinkApple(
4322
- bearerToken: string,
4323
- body: ApiAccountApple,
4324
- options: any = {}
4325
- ): Promise<any> {
4326
- if (body === null || body === undefined) {
4327
- throw new Error(
4328
- "'body' is a required parameter but is null or undefined."
4329
- );
4330
- }
4331
- const urlPath = "/v2/account/unlink/apple";
4332
- const queryParams = new Map<string, any>();
4333
-
4334
- let bodyJson: string = "";
4335
- bodyJson = JSON.stringify(body || {});
4336
-
4337
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4338
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4339
- if (bearerToken) {
4340
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4341
- }
4342
-
4343
- return Promise.race([
4344
- fetch(fullUrl, fetchOptions).then((response) => {
4345
- if (response.status == 204) {
4346
- return response;
4347
- } else if (response.status >= 200 && response.status < 300) {
4348
- return response.json();
4349
- } else {
4350
- throw response;
4351
- }
4352
- }),
4353
- new Promise((_, reject) =>
4354
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4355
- ),
4356
- ]);
4357
- }
4358
-
4359
- /** Remove the device ID from the social profiles on the current user's account. */
4360
- unlinkDevice(
4361
- bearerToken: string,
4362
- body: ApiAccountDevice,
4363
- options: any = {}
4364
- ): Promise<any> {
4365
- if (body === null || body === undefined) {
4366
- throw new Error(
4367
- "'body' is a required parameter but is null or undefined."
4368
- );
4369
- }
4370
- const urlPath = "/v2/account/unlink/device";
4371
- const queryParams = new Map<string, any>();
4372
-
4373
- let bodyJson: string = "";
4374
- bodyJson = JSON.stringify(body || {});
4375
-
4376
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4377
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4378
- if (bearerToken) {
4379
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4380
- }
4381
-
4382
- return Promise.race([
4383
- fetch(fullUrl, fetchOptions).then((response) => {
4384
- if (response.status == 204) {
4385
- return response;
4386
- } else if (response.status >= 200 && response.status < 300) {
4387
- return response.json();
4388
- } else {
4389
- throw response;
4390
- }
4391
- }),
4392
- new Promise((_, reject) =>
4393
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4394
- ),
4395
- ]);
4396
- }
4397
-
4398
- /** Remove the email+password from the social profiles on the current user's account. */
4399
- unlinkEmail(
4400
- bearerToken: string,
4401
- body: ApiAccountEmail,
4402
- options: any = {}
4403
- ): Promise<any> {
4404
- if (body === null || body === undefined) {
4405
- throw new Error(
4406
- "'body' is a required parameter but is null or undefined."
4407
- );
4408
- }
4409
- const urlPath = "/v2/account/unlink/email";
4410
- const queryParams = new Map<string, any>();
4411
-
4412
- let bodyJson: string = "";
4413
- bodyJson = JSON.stringify(body || {});
4414
-
4415
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4416
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4417
- if (bearerToken) {
4418
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4419
- }
4420
-
4421
- return Promise.race([
4422
- fetch(fullUrl, fetchOptions).then((response) => {
4423
- if (response.status == 204) {
4424
- return response;
4425
- } else if (response.status >= 200 && response.status < 300) {
4426
- return response.json();
4427
- } else {
4428
- throw response;
4429
- }
4430
- }),
4431
- new Promise((_, reject) =>
4432
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4433
- ),
4434
- ]);
4435
- }
4436
-
4437
- /** Remove Facebook from the social profiles on the current user's account. */
4438
- unlinkFacebook(
4439
- bearerToken: string,
4440
- body: ApiAccountFacebook,
4441
- options: any = {}
4442
- ): Promise<any> {
4443
- if (body === null || body === undefined) {
4444
- throw new Error(
4445
- "'body' is a required parameter but is null or undefined."
4446
- );
4447
- }
4448
- const urlPath = "/v2/account/unlink/facebook";
4449
- const queryParams = new Map<string, any>();
4450
-
4451
- let bodyJson: string = "";
4452
- bodyJson = JSON.stringify(body || {});
4453
-
4454
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4455
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4456
- if (bearerToken) {
4457
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4458
- }
4459
-
4460
- return Promise.race([
4461
- fetch(fullUrl, fetchOptions).then((response) => {
4462
- if (response.status == 204) {
4463
- return response;
4464
- } else if (response.status >= 200 && response.status < 300) {
4465
- return response.json();
4466
- } else {
4467
- throw response;
4468
- }
4469
- }),
4470
- new Promise((_, reject) =>
4471
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4472
- ),
4473
- ]);
4474
- }
4475
-
4476
- /** Remove Facebook Instant Game profile from the social profiles on the current user's account. */
4477
- unlinkFacebookInstantGame(
4478
- bearerToken: string,
4479
- body: ApiAccountFacebookInstantGame,
4480
- options: any = {}
4481
- ): Promise<any> {
4482
- if (body === null || body === undefined) {
4483
- throw new Error(
4484
- "'body' is a required parameter but is null or undefined."
4485
- );
4486
- }
4487
- const urlPath = "/v2/account/unlink/facebookinstantgame";
4488
- const queryParams = new Map<string, any>();
4489
-
4490
- let bodyJson: string = "";
4491
- bodyJson = JSON.stringify(body || {});
4492
-
4493
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4494
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4495
- if (bearerToken) {
4496
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4497
- }
4498
-
4499
- return Promise.race([
4500
- fetch(fullUrl, fetchOptions).then((response) => {
4501
- if (response.status == 204) {
4502
- return response;
4503
- } else if (response.status >= 200 && response.status < 300) {
4504
- return response.json();
4505
- } else {
4506
- throw response;
4507
- }
4508
- }),
4509
- new Promise((_, reject) =>
4510
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4511
- ),
4512
- ]);
4513
- }
4514
-
4515
- /** Remove Apple's GameCenter from the social profiles on the current user's account. */
4516
- unlinkGameCenter(
4517
- bearerToken: string,
4518
- body: ApiAccountGameCenter,
4519
- options: any = {}
4520
- ): Promise<any> {
4521
- if (body === null || body === undefined) {
4522
- throw new Error(
4523
- "'body' is a required parameter but is null or undefined."
4524
- );
4525
- }
4526
- const urlPath = "/v2/account/unlink/gamecenter";
4527
- const queryParams = new Map<string, any>();
4528
-
4529
- let bodyJson: string = "";
4530
- bodyJson = JSON.stringify(body || {});
4531
-
4532
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4533
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4534
- if (bearerToken) {
4535
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4536
- }
4537
-
4538
- return Promise.race([
4539
- fetch(fullUrl, fetchOptions).then((response) => {
4540
- if (response.status == 204) {
4541
- return response;
4542
- } else if (response.status >= 200 && response.status < 300) {
4543
- return response.json();
4544
- } else {
4545
- throw response;
4546
- }
4547
- }),
4548
- new Promise((_, reject) =>
4549
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4550
- ),
4551
- ]);
4552
- }
4553
-
4554
- /** Remove Google from the social profiles on the current user's account. */
4555
- unlinkGoogle(
4556
- bearerToken: string,
4557
- body: ApiAccountGoogle,
4558
- options: any = {}
4559
- ): Promise<any> {
4560
- if (body === null || body === undefined) {
4561
- throw new Error(
4562
- "'body' is a required parameter but is null or undefined."
4563
- );
4564
- }
4565
- const urlPath = "/v2/account/unlink/google";
4566
- const queryParams = new Map<string, any>();
4567
-
4568
- let bodyJson: string = "";
4569
- bodyJson = JSON.stringify(body || {});
4570
-
4571
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4572
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4573
- if (bearerToken) {
4574
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
3676
+ if (bearerToken) {
3677
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4575
3678
  }
4576
3679
 
4577
3680
  return Promise.race([
@@ -4626,45 +3729,6 @@ export class MezonApi {
4626
3729
  ]);
4627
3730
  }
4628
3731
 
4629
- /** Remove Steam from the social profiles on the current user's account. */
4630
- unlinkSteam(
4631
- bearerToken: string,
4632
- body: ApiAccountSteam,
4633
- options: any = {}
4634
- ): Promise<any> {
4635
- if (body === null || body === undefined) {
4636
- throw new Error(
4637
- "'body' is a required parameter but is null or undefined."
4638
- );
4639
- }
4640
- const urlPath = "/v2/account/unlink/steam";
4641
- const queryParams = new Map<string, any>();
4642
-
4643
- let bodyJson: string = "";
4644
- bodyJson = JSON.stringify(body || {});
4645
-
4646
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4647
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4648
- if (bearerToken) {
4649
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4650
- }
4651
-
4652
- return Promise.race([
4653
- fetch(fullUrl, fetchOptions).then((response) => {
4654
- if (response.status == 204) {
4655
- return response;
4656
- } else if (response.status >= 200 && response.status < 300) {
4657
- return response.json();
4658
- } else {
4659
- throw response;
4660
- }
4661
- }),
4662
- new Promise((_, reject) =>
4663
- setTimeout(reject, this.timeoutMs, "Request timed out.")
4664
- ),
4665
- ]);
4666
- }
4667
-
4668
3732
  /** List activity */
4669
3733
  listActivity(
4670
3734
  bearerToken: string,
@@ -7301,88 +6365,6 @@ export class MezonApi {
7301
6365
  ]);
7302
6366
  }
7303
6367
 
7304
- /** Import Facebook friends and add them to a user's account. */
7305
- importFacebookFriends(
7306
- bearerToken: string,
7307
- account: ApiAccountFacebook,
7308
- reset?: boolean,
7309
- options: any = {}
7310
- ): Promise<any> {
7311
- if (account === null || account === undefined) {
7312
- throw new Error(
7313
- "'account' is a required parameter but is null or undefined."
7314
- );
7315
- }
7316
- const urlPath = "/v2/friend/facebook";
7317
- const queryParams = new Map<string, any>();
7318
- queryParams.set("reset", reset);
7319
-
7320
- let bodyJson: string = "";
7321
- bodyJson = JSON.stringify(account || {});
7322
-
7323
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7324
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
7325
- if (bearerToken) {
7326
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7327
- }
7328
-
7329
- return Promise.race([
7330
- fetch(fullUrl, fetchOptions).then((response) => {
7331
- if (response.status == 204) {
7332
- return response;
7333
- } else if (response.status >= 200 && response.status < 300) {
7334
- return response.json();
7335
- } else {
7336
- throw response;
7337
- }
7338
- }),
7339
- new Promise((_, reject) =>
7340
- setTimeout(reject, this.timeoutMs, "Request timed out.")
7341
- ),
7342
- ]);
7343
- }
7344
-
7345
- /** Import Steam friends and add them to a user's account. */
7346
- importSteamFriends(
7347
- bearerToken: string,
7348
- account: ApiAccountSteam,
7349
- reset?: boolean,
7350
- options: any = {}
7351
- ): Promise<any> {
7352
- if (account === null || account === undefined) {
7353
- throw new Error(
7354
- "'account' is a required parameter but is null or undefined."
7355
- );
7356
- }
7357
- const urlPath = "/v2/friend/steam";
7358
- const queryParams = new Map<string, any>();
7359
- queryParams.set("reset", reset);
7360
-
7361
- let bodyJson: string = "";
7362
- bodyJson = JSON.stringify(account || {});
7363
-
7364
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
7365
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
7366
- if (bearerToken) {
7367
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
7368
- }
7369
-
7370
- return Promise.race([
7371
- fetch(fullUrl, fetchOptions).then((response) => {
7372
- if (response.status == 204) {
7373
- return response;
7374
- } else if (response.status >= 200 && response.status < 300) {
7375
- return response.json();
7376
- } else {
7377
- throw response;
7378
- }
7379
- }),
7380
- new Promise((_, reject) =>
7381
- setTimeout(reject, this.timeoutMs, "Request timed out.")
7382
- ),
7383
- ]);
7384
- }
7385
-
7386
6368
  /** List GetChannelCategoryNotiSettingsList */
7387
6369
  getChannelCategoryNotiSettingsList(
7388
6370
  bearerToken: string,