mezon-js 2.11.46 → 2.12.1
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 +116 -1135
- package/client.ts +42 -574
- package/dist/api.gen.d.ts +5 -99
- package/dist/client.d.ts +8 -54
- package/dist/mezon-js.cjs.js +83 -1134
- package/dist/mezon-js.esm.mjs +83 -1134
- package/package.json +1 -1
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;
|
@@ -3365,53 +3288,9 @@ export class MezonApi {
|
|
3365
3288
|
]);
|
3366
3289
|
}
|
3367
3290
|
|
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
3291
|
/** */
|
3414
3292
|
checkLoginRequest(
|
3293
|
+
basePath: string,
|
3415
3294
|
basicAuthUsername: string,
|
3416
3295
|
basicAuthPassword: string,
|
3417
3296
|
body: ApiConfirmLoginRequest,
|
@@ -3428,7 +3307,7 @@ export class MezonApi {
|
|
3428
3307
|
let bodyJson: string = "";
|
3429
3308
|
bodyJson = JSON.stringify(body || {});
|
3430
3309
|
|
3431
|
-
const fullUrl = this.buildFullUrl(
|
3310
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
3432
3311
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3433
3312
|
if (basicAuthUsername) {
|
3434
3313
|
fetchOptions.headers["Authorization"] =
|
@@ -3453,6 +3332,7 @@ export class MezonApi {
|
|
3453
3332
|
|
3454
3333
|
/** */
|
3455
3334
|
confirmLogin(
|
3335
|
+
basePath: string,
|
3456
3336
|
bearerToken: string,
|
3457
3337
|
body: ApiConfirmLoginRequest,
|
3458
3338
|
options: any = {}
|
@@ -3468,7 +3348,7 @@ export class MezonApi {
|
|
3468
3348
|
let bodyJson: string = "";
|
3469
3349
|
bodyJson = JSON.stringify(body || {});
|
3470
3350
|
|
3471
|
-
const fullUrl = this.buildFullUrl(
|
3351
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
3472
3352
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3473
3353
|
if (bearerToken) {
|
3474
3354
|
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
@@ -3492,6 +3372,7 @@ export class MezonApi {
|
|
3492
3372
|
|
3493
3373
|
/** */
|
3494
3374
|
createQRLogin(
|
3375
|
+
basePath: string,
|
3495
3376
|
basicAuthUsername: string,
|
3496
3377
|
basicAuthPassword: string,
|
3497
3378
|
body: ApiLoginRequest,
|
@@ -3508,7 +3389,7 @@ export class MezonApi {
|
|
3508
3389
|
let bodyJson: string = "";
|
3509
3390
|
bodyJson = JSON.stringify(body || {});
|
3510
3391
|
|
3511
|
-
const fullUrl = this.buildFullUrl(
|
3392
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
3512
3393
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3513
3394
|
if (basicAuthUsername) {
|
3514
3395
|
fetchOptions.headers["Authorization"] =
|
@@ -3531,33 +3412,28 @@ export class MezonApi {
|
|
3531
3412
|
]);
|
3532
3413
|
}
|
3533
3414
|
|
3534
|
-
|
3535
|
-
|
3415
|
+
|
3416
|
+
/** Authenticate a user with an email+password against the server. */
|
3417
|
+
authenticateEmail(
|
3418
|
+
basePath: string,
|
3536
3419
|
basicAuthUsername: string,
|
3537
3420
|
basicAuthPassword: string,
|
3538
|
-
|
3539
|
-
|
3540
|
-
|
3541
|
-
|
3542
|
-
|
3543
|
-
if (account === null || account === undefined) {
|
3544
|
-
throw new Error(
|
3545
|
-
"'account' is a required parameter but is null or undefined."
|
3546
|
-
);
|
3421
|
+
body:ApiAuthenticateEmailRequest,
|
3422
|
+
options: any = {}): Promise<ApiSession> {
|
3423
|
+
|
3424
|
+
if (body === null || body === undefined) {
|
3425
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
3547
3426
|
}
|
3548
|
-
const urlPath = "/v2/account/authenticate/
|
3427
|
+
const urlPath = "/v2/account/authenticate/email";
|
3549
3428
|
const queryParams = new Map<string, any>();
|
3550
|
-
queryParams.set("create", create);
|
3551
|
-
queryParams.set("username", username);
|
3552
3429
|
|
3553
|
-
let bodyJson: string = "";
|
3554
|
-
bodyJson = JSON.stringify(
|
3430
|
+
let bodyJson : string = "";
|
3431
|
+
bodyJson = JSON.stringify(body || {});
|
3555
3432
|
|
3556
|
-
const fullUrl = this.buildFullUrl(
|
3433
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
3557
3434
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3558
3435
|
if (basicAuthUsername) {
|
3559
|
-
fetchOptions.headers["Authorization"] =
|
3560
|
-
"Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
3436
|
+
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
3561
3437
|
}
|
3562
3438
|
|
3563
3439
|
return Promise.race([
|
@@ -3576,26 +3452,35 @@ export class MezonApi {
|
|
3576
3452
|
]);
|
3577
3453
|
}
|
3578
3454
|
|
3579
|
-
/** Authenticate a user with
|
3580
|
-
|
3455
|
+
/** Authenticate a user with Mezon against the server. */
|
3456
|
+
authenticateMezon(
|
3457
|
+
basePath: string,
|
3458
|
+
basicAuthUsername: string,
|
3581
3459
|
basicAuthPassword: string,
|
3582
|
-
|
3583
|
-
|
3460
|
+
account:ApiAccountMezon,
|
3461
|
+
create?:boolean,
|
3462
|
+
username?:string,
|
3463
|
+
isRemember?:boolean,
|
3464
|
+
options: any = {}
|
3465
|
+
): Promise<ApiSession> {
|
3584
3466
|
|
3585
|
-
if (
|
3586
|
-
throw new Error("'
|
3467
|
+
if (account === null || account === undefined) {
|
3468
|
+
throw new Error("'account' is a required parameter but is null or undefined.");
|
3587
3469
|
}
|
3588
|
-
const urlPath = "/v2/account/authenticate/
|
3470
|
+
const urlPath = "/v2/account/authenticate/mezon";
|
3589
3471
|
const queryParams = new Map<string, any>();
|
3472
|
+
queryParams.set("create", create);
|
3473
|
+
queryParams.set("username", username);
|
3474
|
+
queryParams.set("is_remember", isRemember);
|
3590
3475
|
|
3591
3476
|
let bodyJson : string = "";
|
3592
|
-
bodyJson = JSON.stringify(
|
3477
|
+
bodyJson = JSON.stringify(account || {});
|
3593
3478
|
|
3594
|
-
const fullUrl = this.buildFullUrl(
|
3479
|
+
const fullUrl = this.buildFullUrl(basePath, urlPath, queryParams);
|
3595
3480
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3596
|
-
|
3597
|
-
|
3598
|
-
|
3481
|
+
if (basicAuthUsername) {
|
3482
|
+
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
3483
|
+
}
|
3599
3484
|
|
3600
3485
|
return Promise.race([
|
3601
3486
|
fetch(fullUrl, fetchOptions).then((response) => {
|
@@ -3613,35 +3498,27 @@ export class MezonApi {
|
|
3613
3498
|
]);
|
3614
3499
|
}
|
3615
3500
|
|
3616
|
-
/**
|
3617
|
-
|
3618
|
-
|
3619
|
-
|
3620
|
-
account: ApiAccountFacebook,
|
3621
|
-
create?: boolean,
|
3622
|
-
username?: string,
|
3623
|
-
sync?: boolean,
|
3501
|
+
/** Add an email+password to the social profiles on the current user's account. */
|
3502
|
+
linkEmail(
|
3503
|
+
bearerToken: string,
|
3504
|
+
body: ApiAccountEmail,
|
3624
3505
|
options: any = {}
|
3625
|
-
): Promise<
|
3626
|
-
if (
|
3506
|
+
): Promise<any> {
|
3507
|
+
if (body === null || body === undefined) {
|
3627
3508
|
throw new Error(
|
3628
|
-
"'
|
3509
|
+
"'body' is a required parameter but is null or undefined."
|
3629
3510
|
);
|
3630
3511
|
}
|
3631
|
-
const urlPath = "/v2/account/
|
3512
|
+
const urlPath = "/v2/account/link/email";
|
3632
3513
|
const queryParams = new Map<string, any>();
|
3633
|
-
queryParams.set("create", create);
|
3634
|
-
queryParams.set("username", username);
|
3635
|
-
queryParams.set("sync", sync);
|
3636
3514
|
|
3637
3515
|
let bodyJson: string = "";
|
3638
|
-
bodyJson = JSON.stringify(
|
3516
|
+
bodyJson = JSON.stringify(body || {});
|
3639
3517
|
|
3640
3518
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3641
3519
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3642
|
-
if (
|
3643
|
-
fetchOptions.headers["Authorization"] =
|
3644
|
-
"Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
3520
|
+
if (bearerToken) {
|
3521
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3645
3522
|
}
|
3646
3523
|
|
3647
3524
|
return Promise.race([
|
@@ -3660,33 +3537,63 @@ export class MezonApi {
|
|
3660
3537
|
]);
|
3661
3538
|
}
|
3662
3539
|
|
3663
|
-
/**
|
3664
|
-
|
3665
|
-
|
3666
|
-
|
3667
|
-
|
3668
|
-
|
3669
|
-
|
3540
|
+
/** Add a mezon ID to the social profiles on the current user's account. */
|
3541
|
+
linkMezon(bearerToken: string,
|
3542
|
+
body:ApiAccountMezon,
|
3543
|
+
options: any = {}): Promise<any> {
|
3544
|
+
|
3545
|
+
if (body === null || body === undefined) {
|
3546
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
3547
|
+
}
|
3548
|
+
const urlPath = "/v2/account/link/mezon";
|
3549
|
+
const queryParams = new Map<string, any>();
|
3550
|
+
|
3551
|
+
let bodyJson : string = "";
|
3552
|
+
bodyJson = JSON.stringify(body || {});
|
3553
|
+
|
3554
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3555
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3556
|
+
if (bearerToken) {
|
3557
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3558
|
+
}
|
3559
|
+
|
3560
|
+
return Promise.race([
|
3561
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3562
|
+
if (response.status == 204) {
|
3563
|
+
return response;
|
3564
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3565
|
+
return response.json();
|
3566
|
+
} else {
|
3567
|
+
throw response;
|
3568
|
+
}
|
3569
|
+
}),
|
3570
|
+
new Promise((_, reject) =>
|
3571
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3572
|
+
),
|
3573
|
+
]);
|
3574
|
+
}
|
3575
|
+
|
3576
|
+
/** Authenticate a user with an email+password against the server. */
|
3577
|
+
registrationEmail(
|
3578
|
+
bearerToken: string,
|
3579
|
+
body: ApiRegistrationEmailRequest,
|
3670
3580
|
options: any = {}
|
3671
3581
|
): Promise<ApiSession> {
|
3672
|
-
if (
|
3582
|
+
if (body === null || body === undefined) {
|
3673
3583
|
throw new Error(
|
3674
|
-
"'
|
3584
|
+
"'body' is a required parameter but is null or undefined."
|
3675
3585
|
);
|
3676
3586
|
}
|
3677
|
-
const urlPath = "/v2/account/
|
3587
|
+
const urlPath = "/v2/account/registry";
|
3678
3588
|
const queryParams = new Map<string, any>();
|
3679
|
-
queryParams.set("create", create);
|
3680
|
-
queryParams.set("username", username);
|
3681
3589
|
|
3682
3590
|
let bodyJson: string = "";
|
3683
|
-
bodyJson = JSON.stringify(
|
3591
|
+
bodyJson = JSON.stringify(body || {});
|
3684
3592
|
|
3685
3593
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3686
3594
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3687
|
-
if (
|
3688
|
-
fetchOptions.headers["Authorization"] =
|
3689
|
-
"Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
3595
|
+
if (bearerToken) {
|
3596
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3690
3597
|
}
|
3691
3598
|
|
3692
3599
|
return Promise.race([
|
@@ -3705,27 +3612,23 @@ export class MezonApi {
|
|
3705
3612
|
]);
|
3706
3613
|
}
|
3707
3614
|
|
3708
|
-
/**
|
3709
|
-
|
3615
|
+
/** Refresh a user's session using a refresh token retrieved from a previous authentication request. */
|
3616
|
+
sessionRefresh(
|
3710
3617
|
basicAuthUsername: string,
|
3711
3618
|
basicAuthPassword: string,
|
3712
|
-
|
3713
|
-
create?: boolean,
|
3714
|
-
username?: string,
|
3619
|
+
body: ApiSessionRefreshRequest,
|
3715
3620
|
options: any = {}
|
3716
3621
|
): Promise<ApiSession> {
|
3717
|
-
if (
|
3622
|
+
if (body === null || body === undefined) {
|
3718
3623
|
throw new Error(
|
3719
|
-
"'
|
3624
|
+
"'body' is a required parameter but is null or undefined."
|
3720
3625
|
);
|
3721
3626
|
}
|
3722
|
-
const urlPath = "/v2/account/
|
3627
|
+
const urlPath = "/v2/account/session/refresh";
|
3723
3628
|
const queryParams = new Map<string, any>();
|
3724
|
-
queryParams.set("create", create);
|
3725
|
-
queryParams.set("username", username);
|
3726
3629
|
|
3727
3630
|
let bodyJson: string = "";
|
3728
|
-
bodyJson = JSON.stringify(
|
3631
|
+
bodyJson = JSON.stringify(body || {});
|
3729
3632
|
|
3730
3633
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3731
3634
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
@@ -3750,828 +3653,27 @@ export class MezonApi {
|
|
3750
3653
|
]);
|
3751
3654
|
}
|
3752
3655
|
|
3753
|
-
/**
|
3754
|
-
|
3755
|
-
|
3756
|
-
|
3757
|
-
account: ApiAccountGoogle,
|
3758
|
-
create?: boolean,
|
3759
|
-
username?: string,
|
3656
|
+
/** Remove the email+password from the social profiles on the current user's account. */
|
3657
|
+
unlinkEmail(
|
3658
|
+
bearerToken: string,
|
3659
|
+
body: ApiAccountEmail,
|
3760
3660
|
options: any = {}
|
3761
|
-
): Promise<
|
3762
|
-
if (
|
3661
|
+
): Promise<any> {
|
3662
|
+
if (body === null || body === undefined) {
|
3763
3663
|
throw new Error(
|
3764
|
-
"'
|
3664
|
+
"'body' is a required parameter but is null or undefined."
|
3765
3665
|
);
|
3766
3666
|
}
|
3767
|
-
const urlPath = "/v2/account/
|
3667
|
+
const urlPath = "/v2/account/unlink/email";
|
3768
3668
|
const queryParams = new Map<string, any>();
|
3769
|
-
queryParams.set("create", create);
|
3770
|
-
queryParams.set("username", username);
|
3771
3669
|
|
3772
3670
|
let bodyJson: string = "";
|
3773
|
-
bodyJson = JSON.stringify(
|
3671
|
+
bodyJson = JSON.stringify(body || {});
|
3774
3672
|
|
3775
3673
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3776
3674
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
3777
|
-
if (
|
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;
|
3675
|
+
if (bearerToken) {
|
3676
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4575
3677
|
}
|
4576
3678
|
|
4577
3679
|
return Promise.race([
|
@@ -4626,45 +3728,6 @@ export class MezonApi {
|
|
4626
3728
|
]);
|
4627
3729
|
}
|
4628
3730
|
|
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
3731
|
/** List activity */
|
4669
3732
|
listActivity(
|
4670
3733
|
bearerToken: string,
|
@@ -7301,88 +6364,6 @@ export class MezonApi {
|
|
7301
6364
|
]);
|
7302
6365
|
}
|
7303
6366
|
|
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
6367
|
/** List GetChannelCategoryNotiSettingsList */
|
7387
6368
|
getChannelCategoryNotiSettingsList(
|
7388
6369
|
bearerToken: string,
|