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