mezon-js 2.10.86 → 2.10.88
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 +418 -132
- package/client.ts +10 -10
- package/dist/api.gen.d.ts +72 -12
- package/dist/client.d.ts +4 -4
- package/dist/mezon-js.cjs.js +201 -81
- package/dist/mezon-js.esm.mjs +201 -81
- package/dist/socket.d.ts +1 -0
- package/package.json +1 -1
- package/socket.ts +2 -0
package/dist/mezon-js.esm.mjs
CHANGED
@@ -931,39 +931,6 @@ var MezonApi = class {
|
|
931
931
|
)
|
932
932
|
]);
|
933
933
|
}
|
934
|
-
/** Authenticate a user with a custom id against the server. */
|
935
|
-
authenticateCustom(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
936
|
-
if (account === null || account === void 0) {
|
937
|
-
throw new Error(
|
938
|
-
"'account' is a required parameter but is null or undefined."
|
939
|
-
);
|
940
|
-
}
|
941
|
-
const urlPath = "/v2/account/authenticate/custom";
|
942
|
-
const queryParams = /* @__PURE__ */ new Map();
|
943
|
-
queryParams.set("create", create);
|
944
|
-
queryParams.set("username", username);
|
945
|
-
let bodyJson = "";
|
946
|
-
bodyJson = JSON.stringify(account || {});
|
947
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
948
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
949
|
-
if (basicAuthUsername) {
|
950
|
-
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
951
|
-
}
|
952
|
-
return Promise.race([
|
953
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
954
|
-
if (response.status == 204) {
|
955
|
-
return response;
|
956
|
-
} else if (response.status >= 200 && response.status < 300) {
|
957
|
-
return response.json();
|
958
|
-
} else {
|
959
|
-
throw response;
|
960
|
-
}
|
961
|
-
}),
|
962
|
-
new Promise(
|
963
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
964
|
-
)
|
965
|
-
]);
|
966
|
-
}
|
967
934
|
/** Authenticate a user with a device id against the server. */
|
968
935
|
authenticateDevice(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
969
936
|
if (account === null || account === void 0) {
|
@@ -1162,18 +1129,15 @@ var MezonApi = class {
|
|
1162
1129
|
)
|
1163
1130
|
]);
|
1164
1131
|
}
|
1165
|
-
/** Authenticate a user with
|
1166
|
-
|
1132
|
+
/** Authenticate a user with Mezon against the server. */
|
1133
|
+
authenticateMezon(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
|
1167
1134
|
if (account === null || account === void 0) {
|
1168
|
-
throw new Error(
|
1169
|
-
"'account' is a required parameter but is null or undefined."
|
1170
|
-
);
|
1135
|
+
throw new Error("'account' is a required parameter but is null or undefined.");
|
1171
1136
|
}
|
1172
|
-
const urlPath = "/v2/account/authenticate/
|
1137
|
+
const urlPath = "/v2/account/authenticate/mezon";
|
1173
1138
|
const queryParams = /* @__PURE__ */ new Map();
|
1174
1139
|
queryParams.set("create", create);
|
1175
1140
|
queryParams.set("username", username);
|
1176
|
-
queryParams.set("sync", sync);
|
1177
1141
|
let bodyJson = "";
|
1178
1142
|
bodyJson = JSON.stringify(account || {});
|
1179
1143
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -1196,21 +1160,24 @@ var MezonApi = class {
|
|
1196
1160
|
)
|
1197
1161
|
]);
|
1198
1162
|
}
|
1199
|
-
/**
|
1200
|
-
|
1201
|
-
if (
|
1163
|
+
/** Authenticate a user with Steam against the server. */
|
1164
|
+
authenticateSteam(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
|
1165
|
+
if (account === null || account === void 0) {
|
1202
1166
|
throw new Error(
|
1203
|
-
"'
|
1167
|
+
"'account' is a required parameter but is null or undefined."
|
1204
1168
|
);
|
1205
1169
|
}
|
1206
|
-
const urlPath = "/v2/account/
|
1170
|
+
const urlPath = "/v2/account/authenticate/steam";
|
1207
1171
|
const queryParams = /* @__PURE__ */ new Map();
|
1172
|
+
queryParams.set("create", create);
|
1173
|
+
queryParams.set("username", username);
|
1174
|
+
queryParams.set("sync", sync);
|
1208
1175
|
let bodyJson = "";
|
1209
|
-
bodyJson = JSON.stringify(
|
1176
|
+
bodyJson = JSON.stringify(account || {});
|
1210
1177
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
1211
1178
|
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
1212
|
-
if (
|
1213
|
-
fetchOptions.headers["Authorization"] = "
|
1179
|
+
if (basicAuthUsername) {
|
1180
|
+
fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
|
1214
1181
|
}
|
1215
1182
|
return Promise.race([
|
1216
1183
|
fetch(fullUrl, fetchOptions).then((response) => {
|
@@ -1227,14 +1194,14 @@ var MezonApi = class {
|
|
1227
1194
|
)
|
1228
1195
|
]);
|
1229
1196
|
}
|
1230
|
-
/** Add
|
1231
|
-
|
1197
|
+
/** Add an Apple ID to the social profiles on the current user's account. */
|
1198
|
+
linkApple(bearerToken, body, options = {}) {
|
1232
1199
|
if (body === null || body === void 0) {
|
1233
1200
|
throw new Error(
|
1234
1201
|
"'body' is a required parameter but is null or undefined."
|
1235
1202
|
);
|
1236
1203
|
}
|
1237
|
-
const urlPath = "/v2/account/link/
|
1204
|
+
const urlPath = "/v2/account/link/apple";
|
1238
1205
|
const queryParams = /* @__PURE__ */ new Map();
|
1239
1206
|
let bodyJson = "";
|
1240
1207
|
bodyJson = JSON.stringify(body || {});
|
@@ -1414,6 +1381,35 @@ var MezonApi = class {
|
|
1414
1381
|
)
|
1415
1382
|
]);
|
1416
1383
|
}
|
1384
|
+
/** Add a mezon ID to the social profiles on the current user's account. */
|
1385
|
+
linkMezon(bearerToken, body, options = {}) {
|
1386
|
+
if (body === null || body === void 0) {
|
1387
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
1388
|
+
}
|
1389
|
+
const urlPath = "/v2/account/link/mezon";
|
1390
|
+
const queryParams = /* @__PURE__ */ new Map();
|
1391
|
+
let bodyJson = "";
|
1392
|
+
bodyJson = JSON.stringify(body || {});
|
1393
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
1394
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
1395
|
+
if (bearerToken) {
|
1396
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
1397
|
+
}
|
1398
|
+
return Promise.race([
|
1399
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
1400
|
+
if (response.status == 204) {
|
1401
|
+
return response;
|
1402
|
+
} else if (response.status >= 200 && response.status < 300) {
|
1403
|
+
return response.json();
|
1404
|
+
} else {
|
1405
|
+
throw response;
|
1406
|
+
}
|
1407
|
+
}),
|
1408
|
+
new Promise(
|
1409
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
1410
|
+
)
|
1411
|
+
]);
|
1412
|
+
}
|
1417
1413
|
/** Add Google to the social profiles on the current user's account. */
|
1418
1414
|
linkGoogle(bearerToken, body, options = {}) {
|
1419
1415
|
if (body === null || body === void 0) {
|
@@ -1569,14 +1565,14 @@ var MezonApi = class {
|
|
1569
1565
|
)
|
1570
1566
|
]);
|
1571
1567
|
}
|
1572
|
-
/** Remove the
|
1573
|
-
|
1568
|
+
/** Remove the device ID from the social profiles on the current user's account. */
|
1569
|
+
unlinkDevice(bearerToken, body, options = {}) {
|
1574
1570
|
if (body === null || body === void 0) {
|
1575
1571
|
throw new Error(
|
1576
1572
|
"'body' is a required parameter but is null or undefined."
|
1577
1573
|
);
|
1578
1574
|
}
|
1579
|
-
const urlPath = "/v2/account/unlink/
|
1575
|
+
const urlPath = "/v2/account/unlink/device";
|
1580
1576
|
const queryParams = /* @__PURE__ */ new Map();
|
1581
1577
|
let bodyJson = "";
|
1582
1578
|
bodyJson = JSON.stringify(body || {});
|
@@ -1600,14 +1596,14 @@ var MezonApi = class {
|
|
1600
1596
|
)
|
1601
1597
|
]);
|
1602
1598
|
}
|
1603
|
-
/** Remove the
|
1604
|
-
|
1599
|
+
/** Remove the email+password from the social profiles on the current user's account. */
|
1600
|
+
unlinkEmail(bearerToken, body, options = {}) {
|
1605
1601
|
if (body === null || body === void 0) {
|
1606
1602
|
throw new Error(
|
1607
1603
|
"'body' is a required parameter but is null or undefined."
|
1608
1604
|
);
|
1609
1605
|
}
|
1610
|
-
const urlPath = "/v2/account/unlink/
|
1606
|
+
const urlPath = "/v2/account/unlink/email";
|
1611
1607
|
const queryParams = /* @__PURE__ */ new Map();
|
1612
1608
|
let bodyJson = "";
|
1613
1609
|
bodyJson = JSON.stringify(body || {});
|
@@ -1631,14 +1627,14 @@ var MezonApi = class {
|
|
1631
1627
|
)
|
1632
1628
|
]);
|
1633
1629
|
}
|
1634
|
-
/** Remove
|
1635
|
-
|
1630
|
+
/** Remove Facebook from the social profiles on the current user's account. */
|
1631
|
+
unlinkFacebook(bearerToken, body, options = {}) {
|
1636
1632
|
if (body === null || body === void 0) {
|
1637
1633
|
throw new Error(
|
1638
1634
|
"'body' is a required parameter but is null or undefined."
|
1639
1635
|
);
|
1640
1636
|
}
|
1641
|
-
const urlPath = "/v2/account/unlink/
|
1637
|
+
const urlPath = "/v2/account/unlink/facebook";
|
1642
1638
|
const queryParams = /* @__PURE__ */ new Map();
|
1643
1639
|
let bodyJson = "";
|
1644
1640
|
bodyJson = JSON.stringify(body || {});
|
@@ -1662,14 +1658,14 @@ var MezonApi = class {
|
|
1662
1658
|
)
|
1663
1659
|
]);
|
1664
1660
|
}
|
1665
|
-
/** Remove Facebook from the social profiles on the current user's account. */
|
1666
|
-
|
1661
|
+
/** Remove Facebook Instant Game profile from the social profiles on the current user's account. */
|
1662
|
+
unlinkFacebookInstantGame(bearerToken, body, options = {}) {
|
1667
1663
|
if (body === null || body === void 0) {
|
1668
1664
|
throw new Error(
|
1669
1665
|
"'body' is a required parameter but is null or undefined."
|
1670
1666
|
);
|
1671
1667
|
}
|
1672
|
-
const urlPath = "/v2/account/unlink/
|
1668
|
+
const urlPath = "/v2/account/unlink/facebookinstantgame";
|
1673
1669
|
const queryParams = /* @__PURE__ */ new Map();
|
1674
1670
|
let bodyJson = "";
|
1675
1671
|
bodyJson = JSON.stringify(body || {});
|
@@ -1693,14 +1689,14 @@ var MezonApi = class {
|
|
1693
1689
|
)
|
1694
1690
|
]);
|
1695
1691
|
}
|
1696
|
-
/** Remove
|
1697
|
-
|
1692
|
+
/** Remove Apple's GameCenter from the social profiles on the current user's account. */
|
1693
|
+
unlinkGameCenter(bearerToken, body, options = {}) {
|
1698
1694
|
if (body === null || body === void 0) {
|
1699
1695
|
throw new Error(
|
1700
1696
|
"'body' is a required parameter but is null or undefined."
|
1701
1697
|
);
|
1702
1698
|
}
|
1703
|
-
const urlPath = "/v2/account/unlink/
|
1699
|
+
const urlPath = "/v2/account/unlink/gamecenter";
|
1704
1700
|
const queryParams = /* @__PURE__ */ new Map();
|
1705
1701
|
let bodyJson = "";
|
1706
1702
|
bodyJson = JSON.stringify(body || {});
|
@@ -1724,14 +1720,14 @@ var MezonApi = class {
|
|
1724
1720
|
)
|
1725
1721
|
]);
|
1726
1722
|
}
|
1727
|
-
/** Remove
|
1728
|
-
|
1723
|
+
/** Remove Google from the social profiles on the current user's account. */
|
1724
|
+
unlinkGoogle(bearerToken, body, options = {}) {
|
1729
1725
|
if (body === null || body === void 0) {
|
1730
1726
|
throw new Error(
|
1731
1727
|
"'body' is a required parameter but is null or undefined."
|
1732
1728
|
);
|
1733
1729
|
}
|
1734
|
-
const urlPath = "/v2/account/unlink/
|
1730
|
+
const urlPath = "/v2/account/unlink/google";
|
1735
1731
|
const queryParams = /* @__PURE__ */ new Map();
|
1736
1732
|
let bodyJson = "";
|
1737
1733
|
bodyJson = JSON.stringify(body || {});
|
@@ -1755,14 +1751,12 @@ var MezonApi = class {
|
|
1755
1751
|
)
|
1756
1752
|
]);
|
1757
1753
|
}
|
1758
|
-
/** Remove
|
1759
|
-
|
1754
|
+
/** Remove the mezon ID from the social profiles on the current user's account. */
|
1755
|
+
unlinkMezon(bearerToken, body, options = {}) {
|
1760
1756
|
if (body === null || body === void 0) {
|
1761
|
-
throw new Error(
|
1762
|
-
"'body' is a required parameter but is null or undefined."
|
1763
|
-
);
|
1757
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
1764
1758
|
}
|
1765
|
-
const urlPath = "/v2/account/unlink/
|
1759
|
+
const urlPath = "/v2/account/unlink/mezon";
|
1766
1760
|
const queryParams = /* @__PURE__ */ new Map();
|
1767
1761
|
let bodyJson = "";
|
1768
1762
|
bodyJson = JSON.stringify(body || {});
|
@@ -4324,6 +4318,132 @@ var MezonApi = class {
|
|
4324
4318
|
)
|
4325
4319
|
]);
|
4326
4320
|
}
|
4321
|
+
/** Delete mezon OAuth client */
|
4322
|
+
deleteMezonOauthClient(bearerToken, accessTokenStrategy, allowedCorsOrigins, audience, authorizationCodeGrantAccessTokenLifespan, authorizationCodeGrantIdTokenLifespan, authorizationCodeGrantRefreshTokenLifespan, backchannelLogoutSessionRequired, backchannelLogoutUri, clientCredentialsGrantAccessTokenLifespan, clientId, clientName, clientSecret, clientSecretExpiresAt, clientUri, contacts, createdAt, frontchannelLogoutSessionRequired, frontchannelLogoutUri, grantTypes, implicitGrantAccessTokenLifespan, implicitGrantIdTokenLifespan, jwks, jwksUri, jwtBearerGrantAccessTokenLifespan, logoUri, owner, policyUri, postLogoutRedirectUris, redirectUris, refreshTokenGrantAccessTokenLifespan, refreshTokenGrantIdTokenLifespan, refreshTokenGrantRefreshTokenLifespan, registrationAccessToken, registrationClientUri, requestObjectSigningAlg, requestUris, responseTypes, scope, sectorIdentifierUri, skipConsent, skipLogoutConsent, subjectType, tokenEndpointAuthMethod, tokenEndpointAuthSigningAlg, tosUri, updatedAt, userinfoSignedResponseAlg, options = {}) {
|
4323
|
+
const urlPath = "/v2/mznoauthclient";
|
4324
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4325
|
+
queryParams.set("access_token_strategy", accessTokenStrategy);
|
4326
|
+
queryParams.set("allowed_cors_origins", allowedCorsOrigins);
|
4327
|
+
queryParams.set("audience", audience);
|
4328
|
+
queryParams.set("authorization_code_grant_access_token_lifespan", authorizationCodeGrantAccessTokenLifespan);
|
4329
|
+
queryParams.set("authorization_code_grant_id_token_lifespan", authorizationCodeGrantIdTokenLifespan);
|
4330
|
+
queryParams.set("authorization_code_grant_refresh_token_lifespan", authorizationCodeGrantRefreshTokenLifespan);
|
4331
|
+
queryParams.set("backchannel_logout_session_required", backchannelLogoutSessionRequired);
|
4332
|
+
queryParams.set("backchannel_logout_uri", backchannelLogoutUri);
|
4333
|
+
queryParams.set("client_credentials_grant_access_token_lifespan", clientCredentialsGrantAccessTokenLifespan);
|
4334
|
+
queryParams.set("client_id", clientId);
|
4335
|
+
queryParams.set("client_name", clientName);
|
4336
|
+
queryParams.set("client_secret", clientSecret);
|
4337
|
+
queryParams.set("client_secret_expires_at", clientSecretExpiresAt);
|
4338
|
+
queryParams.set("client_uri", clientUri);
|
4339
|
+
queryParams.set("contacts", contacts);
|
4340
|
+
queryParams.set("created_at", createdAt);
|
4341
|
+
queryParams.set("frontchannel_logout_session_required", frontchannelLogoutSessionRequired);
|
4342
|
+
queryParams.set("frontchannel_logout_uri", frontchannelLogoutUri);
|
4343
|
+
queryParams.set("grant_types", grantTypes);
|
4344
|
+
queryParams.set("implicit_grant_access_token_lifespan", implicitGrantAccessTokenLifespan);
|
4345
|
+
queryParams.set("implicit_grant_id_token_lifespan", implicitGrantIdTokenLifespan);
|
4346
|
+
queryParams.set("jwks", jwks);
|
4347
|
+
queryParams.set("jwks_uri", jwksUri);
|
4348
|
+
queryParams.set("jwt_bearer_grant_access_token_lifespan", jwtBearerGrantAccessTokenLifespan);
|
4349
|
+
queryParams.set("logo_uri", logoUri);
|
4350
|
+
queryParams.set("owner", owner);
|
4351
|
+
queryParams.set("policy_uri", policyUri);
|
4352
|
+
queryParams.set("post_logout_redirect_uris", postLogoutRedirectUris);
|
4353
|
+
queryParams.set("redirect_uris", redirectUris);
|
4354
|
+
queryParams.set("refresh_token_grant_access_token_lifespan", refreshTokenGrantAccessTokenLifespan);
|
4355
|
+
queryParams.set("refresh_token_grant_id_token_lifespan", refreshTokenGrantIdTokenLifespan);
|
4356
|
+
queryParams.set("refresh_token_grant_refresh_token_lifespan", refreshTokenGrantRefreshTokenLifespan);
|
4357
|
+
queryParams.set("registration_access_token", registrationAccessToken);
|
4358
|
+
queryParams.set("registration_client_uri", registrationClientUri);
|
4359
|
+
queryParams.set("request_object_signing_alg", requestObjectSigningAlg);
|
4360
|
+
queryParams.set("request_uris", requestUris);
|
4361
|
+
queryParams.set("response_types", responseTypes);
|
4362
|
+
queryParams.set("scope", scope);
|
4363
|
+
queryParams.set("sector_identifier_uri", sectorIdentifierUri);
|
4364
|
+
queryParams.set("skip_consent", skipConsent);
|
4365
|
+
queryParams.set("skip_logout_consent", skipLogoutConsent);
|
4366
|
+
queryParams.set("subject_type", subjectType);
|
4367
|
+
queryParams.set("token_endpoint_auth_method", tokenEndpointAuthMethod);
|
4368
|
+
queryParams.set("token_endpoint_auth_signing_alg", tokenEndpointAuthSigningAlg);
|
4369
|
+
queryParams.set("tos_uri", tosUri);
|
4370
|
+
queryParams.set("updated_at", updatedAt);
|
4371
|
+
queryParams.set("userinfo_signed_response_alg", userinfoSignedResponseAlg);
|
4372
|
+
let bodyJson = "";
|
4373
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4374
|
+
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
4375
|
+
if (bearerToken) {
|
4376
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4377
|
+
}
|
4378
|
+
return Promise.race([
|
4379
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4380
|
+
if (response.status == 204) {
|
4381
|
+
return response;
|
4382
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4383
|
+
return response.json();
|
4384
|
+
} else {
|
4385
|
+
throw response;
|
4386
|
+
}
|
4387
|
+
}),
|
4388
|
+
new Promise(
|
4389
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4390
|
+
)
|
4391
|
+
]);
|
4392
|
+
}
|
4393
|
+
/** List mezon OAuth client */
|
4394
|
+
listMezonOauthClient(bearerToken, options = {}) {
|
4395
|
+
const urlPath = "/v2/mznoauthclient";
|
4396
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4397
|
+
let bodyJson = "";
|
4398
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4399
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4400
|
+
if (bearerToken) {
|
4401
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4402
|
+
}
|
4403
|
+
return Promise.race([
|
4404
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4405
|
+
if (response.status == 204) {
|
4406
|
+
return response;
|
4407
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4408
|
+
return response.json();
|
4409
|
+
} else {
|
4410
|
+
throw response;
|
4411
|
+
}
|
4412
|
+
}),
|
4413
|
+
new Promise(
|
4414
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4415
|
+
)
|
4416
|
+
]);
|
4417
|
+
}
|
4418
|
+
/** Create mezon OAuth client */
|
4419
|
+
createMezonOauthClient(bearerToken, body, options = {}) {
|
4420
|
+
if (body === null || body === void 0) {
|
4421
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
4422
|
+
}
|
4423
|
+
const urlPath = "/v2/mznoauthclient";
|
4424
|
+
const queryParams = /* @__PURE__ */ new Map();
|
4425
|
+
let bodyJson = "";
|
4426
|
+
bodyJson = JSON.stringify(body || {});
|
4427
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4428
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
4429
|
+
if (bearerToken) {
|
4430
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4431
|
+
}
|
4432
|
+
return Promise.race([
|
4433
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
4434
|
+
if (response.status == 204) {
|
4435
|
+
return response;
|
4436
|
+
} else if (response.status >= 200 && response.status < 300) {
|
4437
|
+
return response.json();
|
4438
|
+
} else {
|
4439
|
+
throw response;
|
4440
|
+
}
|
4441
|
+
}),
|
4442
|
+
new Promise(
|
4443
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4444
|
+
)
|
4445
|
+
]);
|
4446
|
+
}
|
4327
4447
|
/** set mute notification user channel. */
|
4328
4448
|
setMuteNotificationCategory(bearerToken, body, options = {}) {
|
4329
4449
|
if (body === null || body === void 0) {
|
@@ -8219,12 +8339,12 @@ var Client = class {
|
|
8219
8339
|
});
|
8220
8340
|
}
|
8221
8341
|
/** Authenticate a user with a custom id against the server. */
|
8222
|
-
|
8342
|
+
authenticateMezon(token, create, username, vars = {}, options = {}) {
|
8223
8343
|
const request = {
|
8224
|
-
|
8344
|
+
token,
|
8225
8345
|
vars
|
8226
8346
|
};
|
8227
|
-
return this.apiClient.
|
8347
|
+
return this.apiClient.authenticateMezon(
|
8228
8348
|
this.serverkey,
|
8229
8349
|
"",
|
8230
8350
|
request,
|
@@ -9100,12 +9220,12 @@ var Client = class {
|
|
9100
9220
|
});
|
9101
9221
|
}
|
9102
9222
|
/** Add a custom ID to the social profiles on the current user's account. */
|
9103
|
-
|
9223
|
+
linkMezon(session, request) {
|
9104
9224
|
return __async(this, null, function* () {
|
9105
9225
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9106
9226
|
yield this.sessionRefresh(session);
|
9107
9227
|
}
|
9108
|
-
return this.apiClient.
|
9228
|
+
return this.apiClient.linkMezon(session.token, request).then((response) => {
|
9109
9229
|
return response !== void 0;
|
9110
9230
|
});
|
9111
9231
|
});
|
@@ -9355,7 +9475,7 @@ var Client = class {
|
|
9355
9475
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9356
9476
|
yield this.sessionRefresh(session);
|
9357
9477
|
}
|
9358
|
-
return this.apiClient.
|
9478
|
+
return this.apiClient.unlinkMezon(session.token, request).then((response) => {
|
9359
9479
|
return response !== void 0;
|
9360
9480
|
});
|
9361
9481
|
});
|
package/dist/socket.d.ts
CHANGED
package/package.json
CHANGED