mezon-js 2.10.87 → 2.10.89

Sign up to get free protection for your applications and to get access to all the features.
package/dist/api.gen.d.ts CHANGED
@@ -205,11 +205,6 @@ export interface ApiAccountApple {
205
205
  token?: string;
206
206
  vars?: Record<string, string>;
207
207
  }
208
- /** Send a custom ID to the server. Used with authenticate/link/unlink. */
209
- export interface ApiAccountCustom {
210
- id?: string;
211
- vars?: Record<string, string>;
212
- }
213
208
  /** Send a device to the server. Used with authenticate/link/unlink and user. */
214
209
  export interface ApiAccountDevice {
215
210
  id?: string;
@@ -248,6 +243,11 @@ export interface ApiAccountGoogle {
248
243
  token?: string;
249
244
  vars?: Record<string, string>;
250
245
  }
246
+ /** Send a Mezon token to the server. Used with authenticate/link/unlink. */
247
+ export interface ApiAccountMezon {
248
+ token?: string;
249
+ vars?: Record<string, string>;
250
+ }
251
251
  /** Send a Steam token to the server. Used with authenticate/link/unlink. */
252
252
  export interface ApiAccountSteam {
253
253
  token?: string;
@@ -885,7 +885,7 @@ export interface ApiLoginIDResponse {
885
885
  platform?: string;
886
886
  status?: number;
887
887
  user_id?: string;
888
- user_name?: string;
888
+ username?: string;
889
889
  }
890
890
  /** */
891
891
  export interface ApiMarkAsReadRequest {
@@ -944,6 +944,60 @@ export interface ApiListStreamingChannelsResponse {
944
944
  streaming_channels?: Array<ApiStreamingChannelResponse>;
945
945
  }
946
946
  /** */
947
+ export interface ApiMezonOauthClient {
948
+ access_token_strategy?: string;
949
+ allowed_cors_origins?: Array<string>;
950
+ audience?: Array<string>;
951
+ authorization_code_grant_access_token_lifespan?: string;
952
+ authorization_code_grant_id_token_lifespan?: string;
953
+ authorization_code_grant_refresh_token_lifespan?: string;
954
+ backchannel_logout_session_required?: boolean;
955
+ backchannel_logout_uri?: string;
956
+ client_credentials_grant_access_token_lifespan?: string;
957
+ client_id?: string;
958
+ client_name?: string;
959
+ client_secret?: string;
960
+ client_secret_expires_at?: number;
961
+ client_uri?: string;
962
+ contacts?: Array<string>;
963
+ created_at?: string;
964
+ frontchannel_logout_session_required?: boolean;
965
+ frontchannel_logout_uri?: string;
966
+ grant_types?: Array<string>;
967
+ implicit_grant_access_token_lifespan?: string;
968
+ implicit_grant_id_token_lifespan?: string;
969
+ jwks?: Array<string>;
970
+ jwks_uri?: string;
971
+ jwt_bearer_grant_access_token_lifespan?: string;
972
+ logo_uri?: string;
973
+ owner?: string;
974
+ policy_uri?: string;
975
+ post_logout_redirect_uris?: Array<string>;
976
+ redirect_uris?: Array<string>;
977
+ refresh_token_grant_access_token_lifespan?: string;
978
+ refresh_token_grant_id_token_lifespan?: string;
979
+ refresh_token_grant_refresh_token_lifespan?: string;
980
+ registration_access_token?: string;
981
+ registration_client_uri?: string;
982
+ request_object_signing_alg?: string;
983
+ request_uris?: Array<string>;
984
+ response_types?: Array<string>;
985
+ scope?: string;
986
+ sector_identifier_uri?: string;
987
+ skip_consent?: boolean;
988
+ skip_logout_consent?: boolean;
989
+ subject_type?: string;
990
+ token_endpoint_auth_method?: string;
991
+ token_endpoint_auth_signing_alg?: string;
992
+ tos_uri?: string;
993
+ updated_at?: string;
994
+ userinfo_signed_response_alg?: string;
995
+ }
996
+ /** */
997
+ export interface ApiMezonOauthClientList {
998
+ list_mezon_oauth_client?: Array<ApiMezonOauthClient>;
999
+ }
1000
+ /** */
947
1001
  export interface ApiMessageRef {
948
1002
  message_id?: string;
949
1003
  message_ref_id?: string;
@@ -1675,8 +1729,6 @@ export declare class MezonApi {
1675
1729
  confirmLogin(bearerToken: string, body: ApiConfirmLoginRequest, options?: any): Promise<any>;
1676
1730
  /** */
1677
1731
  createQRLogin(basicAuthUsername: string, basicAuthPassword: string, body: ApiLoginRequest, options?: any): Promise<ApiLoginIDResponse>;
1678
- /** Authenticate a user with a custom id against the server. */
1679
- authenticateCustom(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountCustom, create?: boolean, username?: string, options?: any): Promise<ApiSession>;
1680
1732
  /** Authenticate a user with a device id against the server. */
1681
1733
  authenticateDevice(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountDevice, create?: boolean, username?: string, options?: any): Promise<ApiSession>;
1682
1734
  /** Authenticate a user with an email+password against the server. */
@@ -1689,12 +1741,12 @@ export declare class MezonApi {
1689
1741
  authenticateGameCenter(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountGameCenter, create?: boolean, username?: string, options?: any): Promise<ApiSession>;
1690
1742
  /** Authenticate a user with Google against the server. */
1691
1743
  authenticateGoogle(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountGoogle, create?: boolean, username?: string, options?: any): Promise<ApiSession>;
1744
+ /** Authenticate a user with Mezon against the server. */
1745
+ authenticateMezon(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountMezon, create?: boolean, username?: string, options?: any): Promise<ApiSession>;
1692
1746
  /** Authenticate a user with Steam against the server. */
1693
1747
  authenticateSteam(basicAuthUsername: string, basicAuthPassword: string, account: ApiAccountSteam, create?: boolean, username?: string, sync?: boolean, options?: any): Promise<ApiSession>;
1694
1748
  /** Add an Apple ID to the social profiles on the current user's account. */
1695
1749
  linkApple(bearerToken: string, body: ApiAccountApple, options?: any): Promise<any>;
1696
- /** Add a custom ID to the social profiles on the current user's account. */
1697
- linkCustom(bearerToken: string, body: ApiAccountCustom, options?: any): Promise<any>;
1698
1750
  /** Add a device ID to the social profiles on the current user's account. */
1699
1751
  linkDevice(bearerToken: string, body: ApiAccountDevice, options?: any): Promise<any>;
1700
1752
  /** Add an email+password to the social profiles on the current user's account. */
@@ -1705,6 +1757,8 @@ export declare class MezonApi {
1705
1757
  linkFacebookInstantGame(bearerToken: string, body: ApiAccountFacebookInstantGame, options?: any): Promise<any>;
1706
1758
  /** Add Apple's GameCenter to the social profiles on the current user's account. */
1707
1759
  linkGameCenter(bearerToken: string, body: ApiAccountGameCenter, options?: any): Promise<any>;
1760
+ /** Add a mezon ID to the social profiles on the current user's account. */
1761
+ linkMezon(bearerToken: string, body: ApiAccountMezon, options?: any): Promise<any>;
1708
1762
  /** Add Google to the social profiles on the current user's account. */
1709
1763
  linkGoogle(bearerToken: string, body: ApiAccountGoogle, options?: any): Promise<any>;
1710
1764
  /** Add Steam to the social profiles on the current user's account. */
@@ -1715,8 +1769,6 @@ export declare class MezonApi {
1715
1769
  sessionRefresh(basicAuthUsername: string, basicAuthPassword: string, body: ApiSessionRefreshRequest, options?: any): Promise<ApiSession>;
1716
1770
  /** Remove the Apple ID from the social profiles on the current user's account. */
1717
1771
  unlinkApple(bearerToken: string, body: ApiAccountApple, options?: any): Promise<any>;
1718
- /** Remove the custom ID from the social profiles on the current user's account. */
1719
- unlinkCustom(bearerToken: string, body: ApiAccountCustom, options?: any): Promise<any>;
1720
1772
  /** Remove the device ID from the social profiles on the current user's account. */
1721
1773
  unlinkDevice(bearerToken: string, body: ApiAccountDevice, options?: any): Promise<any>;
1722
1774
  /** Remove the email+password from the social profiles on the current user's account. */
@@ -1729,6 +1781,8 @@ export declare class MezonApi {
1729
1781
  unlinkGameCenter(bearerToken: string, body: ApiAccountGameCenter, options?: any): Promise<any>;
1730
1782
  /** Remove Google from the social profiles on the current user's account. */
1731
1783
  unlinkGoogle(bearerToken: string, body: ApiAccountGoogle, options?: any): Promise<any>;
1784
+ /** Remove the mezon ID from the social profiles on the current user's account. */
1785
+ unlinkMezon(bearerToken: string, body: ApiAccountMezon, options?: any): Promise<any>;
1732
1786
  /** Remove Steam from the social profiles on the current user's account. */
1733
1787
  unlinkSteam(bearerToken: string, body: ApiAccountSteam, options?: any): Promise<any>;
1734
1788
  /** List activity */
@@ -1889,6 +1943,8 @@ export declare class MezonApi {
1889
1943
  listChannelByUserId(bearerToken: string, options?: any): Promise<ApiChannelDescList>;
1890
1944
  /** Mark as read */
1891
1945
  markAsRead(bearerToken: string, body: ApiMarkAsReadRequest, options?: any): Promise<any>;
1946
+ /** List mezon OAuth client */
1947
+ listMezonOauthClient(bearerToken: string, options?: any): Promise<ApiMezonOauthClientList>;
1892
1948
  /** set mute notification user channel. */
1893
1949
  setMuteNotificationCategory(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
1894
1950
  /** set mute notification user channel. */
package/dist/client.d.ts CHANGED
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiHandleParticipantMeetStateRequest } from "./api.gen";
16
+ import { ApiAccount, ApiAccountMezon, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiSetDefaultNotificationRequest, ApiSetNotificationRequest, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiCreateRequest, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody, ApiUpdateRoleChannelRequest, ApiAddAppRequest, ApiAppList, ApiApp, MezonUpdateAppBody, ApiSystemMessagesList, ApiSystemMessage, ApiSystemMessageRequest, MezonUpdateSystemMessageBody, ApiUpdateCategoryOrderRequest, ApiGiveCoffeeEvent, ApiListStreamingChannelsResponse, ApiStreamingChannelUserList, ApiRegisterStreamingChannelRequest, ApiRoleList, ApiListChannelAppsResponse, ApiNotificationChannelCategorySettingList, ApiNotificationUserChannel, ApiNotificationSetting, ApiNotifiReactMessage, ApiHashtagDmList, ApiEmojiListedResponse, ApiStickerListedResponse, ApiAllUsersAddChannelResponse, ApiRoleListEventResponse, ApiAllUserClans, ApiUserPermissionInChannelListResponse, ApiPermissionRoleChannelListEventResponse, ApiMarkAsReadRequest, ApiChannelCanvasListResponse, ApiEditChannelCanvasRequest, ApiChannelSettingListResponse, ApiAddFavoriteChannelResponse, ApiRegistFcmDeviceTokenResponse, ApiListUserActivity, ApiCreateActivityRequest, ApiLoginIDResponse, ApiLoginRequest, ApiConfirmLoginRequest, ApiUserActivity, ApiChanEncryptionMethod, ApiGetPubKeysResponse, ApiPubKey, ApiGetKeyServerResp, MezonapiListAuditLog, ApiTokenSentEvent, MezonDeleteWebhookByIdBody, ApiWithdrawTokenRequest, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiHandleParticipantMeetStateRequest, ApiMezonOauthClientList } from "./api.gen";
17
17
  import { Session } from "./session";
18
18
  import { Socket } from "./socket";
19
19
  import { WebSocketAdapter } from "./web_socket_adapter";
@@ -355,7 +355,7 @@ export declare class Client {
355
355
  /** Authenticate a user with an Apple ID against the server. */
356
356
  authenticateApple(token: string, create?: boolean, username?: string, vars?: Record<string, string>, options?: any): Promise<Session>;
357
357
  /** Authenticate a user with a custom id against the server. */
358
- authenticateCustom(id: string, create?: boolean, username?: string, vars?: Record<string, string>, options?: any): Promise<Session>;
358
+ authenticateMezon(token: string, create?: boolean, username?: string, vars?: Record<string, string>, options?: any): Promise<Session>;
359
359
  /** Authenticate a user with a device id against the server. */
360
360
  authenticateDevice(id: string, create?: boolean, username?: string, vars?: Record<string, string>): Promise<Session>;
361
361
  /** Authenticate a user with an email+password against the server. */
@@ -454,7 +454,7 @@ export declare class Client {
454
454
  closeDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
455
455
  openDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
456
456
  /** Add a custom ID to the social profiles on the current user's account. */
457
- linkCustom(session: Session, request: ApiAccountCustom): Promise<boolean>;
457
+ linkMezon(session: Session, request: ApiAccountMezon): Promise<boolean>;
458
458
  /** Add a device ID to the social profiles on the current user's account. */
459
459
  linkDevice(session: Session, request: ApiAccountDevice): Promise<boolean>;
460
460
  /** Add an email+password to the social profiles on the current user's account. */
@@ -484,7 +484,7 @@ export declare class Client {
484
484
  /** Remove the Apple ID from the social profiles on the current user's account. */
485
485
  unlinkApple(session: Session, request: ApiAccountApple): Promise<boolean>;
486
486
  /** Remove custom ID from the social profiles on the current user's account. */
487
- unlinkCustom(session: Session, request: ApiAccountCustom): Promise<boolean>;
487
+ unlinkCustom(session: Session, request: ApiAccountMezon): Promise<boolean>;
488
488
  /** Remove a device ID from the social profiles on the current user's account. */
489
489
  unlinkDevice(session: Session, request: ApiAccountDevice): Promise<boolean>;
490
490
  /** Remove an email+password from the social profiles on the current user's account. */
@@ -644,4 +644,5 @@ export declare class Client {
644
644
  generateMeetToken(session: Session, body: ApiGenerateMeetTokenRequest): Promise<ApiGenerateMeetTokenResponse>;
645
645
  /** Handle participant meet state */
646
646
  handleParticipantMeetState(session: Session, body: ApiHandleParticipantMeetStateRequest): Promise<any>;
647
+ listMezonOauthClient(session: Session): Promise<ApiMezonOauthClientList>;
647
648
  }
@@ -965,39 +965,6 @@ var MezonApi = class {
965
965
  )
966
966
  ]);
967
967
  }
968
- /** Authenticate a user with a custom id against the server. */
969
- authenticateCustom(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
970
- if (account === null || account === void 0) {
971
- throw new Error(
972
- "'account' is a required parameter but is null or undefined."
973
- );
974
- }
975
- const urlPath = "/v2/account/authenticate/custom";
976
- const queryParams = /* @__PURE__ */ new Map();
977
- queryParams.set("create", create);
978
- queryParams.set("username", username);
979
- let bodyJson = "";
980
- bodyJson = JSON.stringify(account || {});
981
- const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
982
- const fetchOptions = buildFetchOptions("POST", options, bodyJson);
983
- if (basicAuthUsername) {
984
- fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
985
- }
986
- return Promise.race([
987
- fetch(fullUrl, fetchOptions).then((response) => {
988
- if (response.status == 204) {
989
- return response;
990
- } else if (response.status >= 200 && response.status < 300) {
991
- return response.json();
992
- } else {
993
- throw response;
994
- }
995
- }),
996
- new Promise(
997
- (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
998
- )
999
- ]);
1000
- }
1001
968
  /** Authenticate a user with a device id against the server. */
1002
969
  authenticateDevice(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
1003
970
  if (account === null || account === void 0) {
@@ -1196,18 +1163,15 @@ var MezonApi = class {
1196
1163
  )
1197
1164
  ]);
1198
1165
  }
1199
- /** Authenticate a user with Steam against the server. */
1200
- authenticateSteam(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
1166
+ /** Authenticate a user with Mezon against the server. */
1167
+ authenticateMezon(basicAuthUsername, basicAuthPassword, account, create, username, options = {}) {
1201
1168
  if (account === null || account === void 0) {
1202
- throw new Error(
1203
- "'account' is a required parameter but is null or undefined."
1204
- );
1169
+ throw new Error("'account' is a required parameter but is null or undefined.");
1205
1170
  }
1206
- const urlPath = "/v2/account/authenticate/steam";
1171
+ const urlPath = "/v2/account/authenticate/mezon";
1207
1172
  const queryParams = /* @__PURE__ */ new Map();
1208
1173
  queryParams.set("create", create);
1209
1174
  queryParams.set("username", username);
1210
- queryParams.set("sync", sync);
1211
1175
  let bodyJson = "";
1212
1176
  bodyJson = JSON.stringify(account || {});
1213
1177
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
@@ -1230,21 +1194,24 @@ var MezonApi = class {
1230
1194
  )
1231
1195
  ]);
1232
1196
  }
1233
- /** Add an Apple ID to the social profiles on the current user's account. */
1234
- linkApple(bearerToken, body, options = {}) {
1235
- if (body === null || body === void 0) {
1197
+ /** Authenticate a user with Steam against the server. */
1198
+ authenticateSteam(basicAuthUsername, basicAuthPassword, account, create, username, sync, options = {}) {
1199
+ if (account === null || account === void 0) {
1236
1200
  throw new Error(
1237
- "'body' is a required parameter but is null or undefined."
1201
+ "'account' is a required parameter but is null or undefined."
1238
1202
  );
1239
1203
  }
1240
- const urlPath = "/v2/account/link/apple";
1204
+ const urlPath = "/v2/account/authenticate/steam";
1241
1205
  const queryParams = /* @__PURE__ */ new Map();
1206
+ queryParams.set("create", create);
1207
+ queryParams.set("username", username);
1208
+ queryParams.set("sync", sync);
1242
1209
  let bodyJson = "";
1243
- bodyJson = JSON.stringify(body || {});
1210
+ bodyJson = JSON.stringify(account || {});
1244
1211
  const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1245
1212
  const fetchOptions = buildFetchOptions("POST", options, bodyJson);
1246
- if (bearerToken) {
1247
- fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1213
+ if (basicAuthUsername) {
1214
+ fetchOptions.headers["Authorization"] = "Basic " + encode(basicAuthUsername + ":" + basicAuthPassword);
1248
1215
  }
1249
1216
  return Promise.race([
1250
1217
  fetch(fullUrl, fetchOptions).then((response) => {
@@ -1261,14 +1228,14 @@ var MezonApi = class {
1261
1228
  )
1262
1229
  ]);
1263
1230
  }
1264
- /** Add a custom ID to the social profiles on the current user's account. */
1265
- linkCustom(bearerToken, body, options = {}) {
1231
+ /** Add an Apple ID to the social profiles on the current user's account. */
1232
+ linkApple(bearerToken, body, options = {}) {
1266
1233
  if (body === null || body === void 0) {
1267
1234
  throw new Error(
1268
1235
  "'body' is a required parameter but is null or undefined."
1269
1236
  );
1270
1237
  }
1271
- const urlPath = "/v2/account/link/custom";
1238
+ const urlPath = "/v2/account/link/apple";
1272
1239
  const queryParams = /* @__PURE__ */ new Map();
1273
1240
  let bodyJson = "";
1274
1241
  bodyJson = JSON.stringify(body || {});
@@ -1448,6 +1415,35 @@ var MezonApi = class {
1448
1415
  )
1449
1416
  ]);
1450
1417
  }
1418
+ /** Add a mezon ID to the social profiles on the current user's account. */
1419
+ linkMezon(bearerToken, body, options = {}) {
1420
+ if (body === null || body === void 0) {
1421
+ throw new Error("'body' is a required parameter but is null or undefined.");
1422
+ }
1423
+ const urlPath = "/v2/account/link/mezon";
1424
+ const queryParams = /* @__PURE__ */ new Map();
1425
+ let bodyJson = "";
1426
+ bodyJson = JSON.stringify(body || {});
1427
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
1428
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
1429
+ if (bearerToken) {
1430
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
1431
+ }
1432
+ return Promise.race([
1433
+ fetch(fullUrl, fetchOptions).then((response) => {
1434
+ if (response.status == 204) {
1435
+ return response;
1436
+ } else if (response.status >= 200 && response.status < 300) {
1437
+ return response.json();
1438
+ } else {
1439
+ throw response;
1440
+ }
1441
+ }),
1442
+ new Promise(
1443
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
1444
+ )
1445
+ ]);
1446
+ }
1451
1447
  /** Add Google to the social profiles on the current user's account. */
1452
1448
  linkGoogle(bearerToken, body, options = {}) {
1453
1449
  if (body === null || body === void 0) {
@@ -1603,14 +1599,14 @@ var MezonApi = class {
1603
1599
  )
1604
1600
  ]);
1605
1601
  }
1606
- /** Remove the custom ID from the social profiles on the current user's account. */
1607
- unlinkCustom(bearerToken, body, options = {}) {
1602
+ /** Remove the device ID from the social profiles on the current user's account. */
1603
+ unlinkDevice(bearerToken, body, options = {}) {
1608
1604
  if (body === null || body === void 0) {
1609
1605
  throw new Error(
1610
1606
  "'body' is a required parameter but is null or undefined."
1611
1607
  );
1612
1608
  }
1613
- const urlPath = "/v2/account/unlink/custom";
1609
+ const urlPath = "/v2/account/unlink/device";
1614
1610
  const queryParams = /* @__PURE__ */ new Map();
1615
1611
  let bodyJson = "";
1616
1612
  bodyJson = JSON.stringify(body || {});
@@ -1634,14 +1630,14 @@ var MezonApi = class {
1634
1630
  )
1635
1631
  ]);
1636
1632
  }
1637
- /** Remove the device ID from the social profiles on the current user's account. */
1638
- unlinkDevice(bearerToken, body, options = {}) {
1633
+ /** Remove the email+password from the social profiles on the current user's account. */
1634
+ unlinkEmail(bearerToken, body, options = {}) {
1639
1635
  if (body === null || body === void 0) {
1640
1636
  throw new Error(
1641
1637
  "'body' is a required parameter but is null or undefined."
1642
1638
  );
1643
1639
  }
1644
- const urlPath = "/v2/account/unlink/device";
1640
+ const urlPath = "/v2/account/unlink/email";
1645
1641
  const queryParams = /* @__PURE__ */ new Map();
1646
1642
  let bodyJson = "";
1647
1643
  bodyJson = JSON.stringify(body || {});
@@ -1665,14 +1661,14 @@ var MezonApi = class {
1665
1661
  )
1666
1662
  ]);
1667
1663
  }
1668
- /** Remove the email+password from the social profiles on the current user's account. */
1669
- unlinkEmail(bearerToken, body, options = {}) {
1664
+ /** Remove Facebook from the social profiles on the current user's account. */
1665
+ unlinkFacebook(bearerToken, body, options = {}) {
1670
1666
  if (body === null || body === void 0) {
1671
1667
  throw new Error(
1672
1668
  "'body' is a required parameter but is null or undefined."
1673
1669
  );
1674
1670
  }
1675
- const urlPath = "/v2/account/unlink/email";
1671
+ const urlPath = "/v2/account/unlink/facebook";
1676
1672
  const queryParams = /* @__PURE__ */ new Map();
1677
1673
  let bodyJson = "";
1678
1674
  bodyJson = JSON.stringify(body || {});
@@ -1696,14 +1692,14 @@ var MezonApi = class {
1696
1692
  )
1697
1693
  ]);
1698
1694
  }
1699
- /** Remove Facebook from the social profiles on the current user's account. */
1700
- unlinkFacebook(bearerToken, body, options = {}) {
1695
+ /** Remove Facebook Instant Game profile from the social profiles on the current user's account. */
1696
+ unlinkFacebookInstantGame(bearerToken, body, options = {}) {
1701
1697
  if (body === null || body === void 0) {
1702
1698
  throw new Error(
1703
1699
  "'body' is a required parameter but is null or undefined."
1704
1700
  );
1705
1701
  }
1706
- const urlPath = "/v2/account/unlink/facebook";
1702
+ const urlPath = "/v2/account/unlink/facebookinstantgame";
1707
1703
  const queryParams = /* @__PURE__ */ new Map();
1708
1704
  let bodyJson = "";
1709
1705
  bodyJson = JSON.stringify(body || {});
@@ -1727,14 +1723,14 @@ var MezonApi = class {
1727
1723
  )
1728
1724
  ]);
1729
1725
  }
1730
- /** Remove Facebook Instant Game profile from the social profiles on the current user's account. */
1731
- unlinkFacebookInstantGame(bearerToken, body, options = {}) {
1726
+ /** Remove Apple's GameCenter from the social profiles on the current user's account. */
1727
+ unlinkGameCenter(bearerToken, body, options = {}) {
1732
1728
  if (body === null || body === void 0) {
1733
1729
  throw new Error(
1734
1730
  "'body' is a required parameter but is null or undefined."
1735
1731
  );
1736
1732
  }
1737
- const urlPath = "/v2/account/unlink/facebookinstantgame";
1733
+ const urlPath = "/v2/account/unlink/gamecenter";
1738
1734
  const queryParams = /* @__PURE__ */ new Map();
1739
1735
  let bodyJson = "";
1740
1736
  bodyJson = JSON.stringify(body || {});
@@ -1758,14 +1754,14 @@ var MezonApi = class {
1758
1754
  )
1759
1755
  ]);
1760
1756
  }
1761
- /** Remove Apple's GameCenter from the social profiles on the current user's account. */
1762
- unlinkGameCenter(bearerToken, body, options = {}) {
1757
+ /** Remove Google from the social profiles on the current user's account. */
1758
+ unlinkGoogle(bearerToken, body, options = {}) {
1763
1759
  if (body === null || body === void 0) {
1764
1760
  throw new Error(
1765
1761
  "'body' is a required parameter but is null or undefined."
1766
1762
  );
1767
1763
  }
1768
- const urlPath = "/v2/account/unlink/gamecenter";
1764
+ const urlPath = "/v2/account/unlink/google";
1769
1765
  const queryParams = /* @__PURE__ */ new Map();
1770
1766
  let bodyJson = "";
1771
1767
  bodyJson = JSON.stringify(body || {});
@@ -1789,14 +1785,12 @@ var MezonApi = class {
1789
1785
  )
1790
1786
  ]);
1791
1787
  }
1792
- /** Remove Google from the social profiles on the current user's account. */
1793
- unlinkGoogle(bearerToken, body, options = {}) {
1788
+ /** Remove the mezon ID from the social profiles on the current user's account. */
1789
+ unlinkMezon(bearerToken, body, options = {}) {
1794
1790
  if (body === null || body === void 0) {
1795
- throw new Error(
1796
- "'body' is a required parameter but is null or undefined."
1797
- );
1791
+ throw new Error("'body' is a required parameter but is null or undefined.");
1798
1792
  }
1799
- const urlPath = "/v2/account/unlink/google";
1793
+ const urlPath = "/v2/account/unlink/mezon";
1800
1794
  const queryParams = /* @__PURE__ */ new Map();
1801
1795
  let bodyJson = "";
1802
1796
  bodyJson = JSON.stringify(body || {});
@@ -4358,6 +4352,31 @@ var MezonApi = class {
4358
4352
  )
4359
4353
  ]);
4360
4354
  }
4355
+ /** List mezon OAuth client */
4356
+ listMezonOauthClient(bearerToken, options = {}) {
4357
+ const urlPath = "/v2/mznoauthclient";
4358
+ const queryParams = /* @__PURE__ */ new Map();
4359
+ let bodyJson = "";
4360
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4361
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4362
+ if (bearerToken) {
4363
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4364
+ }
4365
+ return Promise.race([
4366
+ fetch(fullUrl, fetchOptions).then((response) => {
4367
+ if (response.status == 204) {
4368
+ return response;
4369
+ } else if (response.status >= 200 && response.status < 300) {
4370
+ return response.json();
4371
+ } else {
4372
+ throw response;
4373
+ }
4374
+ }),
4375
+ new Promise(
4376
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4377
+ )
4378
+ ]);
4379
+ }
4361
4380
  /** set mute notification user channel. */
4362
4381
  setMuteNotificationCategory(bearerToken, body, options = {}) {
4363
4382
  if (body === null || body === void 0) {
@@ -8253,12 +8272,12 @@ var Client = class {
8253
8272
  });
8254
8273
  }
8255
8274
  /** Authenticate a user with a custom id against the server. */
8256
- authenticateCustom(id, create, username, vars = {}, options = {}) {
8275
+ authenticateMezon(token, create, username, vars = {}, options = {}) {
8257
8276
  const request = {
8258
- id,
8277
+ token,
8259
8278
  vars
8260
8279
  };
8261
- return this.apiClient.authenticateCustom(
8280
+ return this.apiClient.authenticateMezon(
8262
8281
  this.serverkey,
8263
8282
  "",
8264
8283
  request,
@@ -9134,12 +9153,12 @@ var Client = class {
9134
9153
  });
9135
9154
  }
9136
9155
  /** Add a custom ID to the social profiles on the current user's account. */
9137
- linkCustom(session, request) {
9156
+ linkMezon(session, request) {
9138
9157
  return __async(this, null, function* () {
9139
9158
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9140
9159
  yield this.sessionRefresh(session);
9141
9160
  }
9142
- return this.apiClient.linkCustom(session.token, request).then((response) => {
9161
+ return this.apiClient.linkMezon(session.token, request).then((response) => {
9143
9162
  return response !== void 0;
9144
9163
  });
9145
9164
  });
@@ -9389,7 +9408,7 @@ var Client = class {
9389
9408
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9390
9409
  yield this.sessionRefresh(session);
9391
9410
  }
9392
- return this.apiClient.unlinkCustom(session.token, request).then((response) => {
9411
+ return this.apiClient.unlinkMezon(session.token, request).then((response) => {
9393
9412
  return response !== void 0;
9394
9413
  });
9395
9414
  });
@@ -10781,4 +10800,15 @@ var Client = class {
10781
10800
  });
10782
10801
  });
10783
10802
  }
10803
+ //**list webhook belong to the clan */
10804
+ listMezonOauthClient(session) {
10805
+ return __async(this, null, function* () {
10806
+ if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
10807
+ yield this.sessionRefresh(session);
10808
+ }
10809
+ return this.apiClient.listMezonOauthClient(session.token).then((response) => {
10810
+ return Promise.resolve(response);
10811
+ });
10812
+ });
10813
+ }
10784
10814
  };