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/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,12 @@ 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
+ /** Delete mezon OAuth client */
1947
+ deleteMezonOauthClient(bearerToken: string, accessTokenStrategy?: string, allowedCorsOrigins?: Array<string>, audience?: Array<string>, authorizationCodeGrantAccessTokenLifespan?: string, authorizationCodeGrantIdTokenLifespan?: string, authorizationCodeGrantRefreshTokenLifespan?: string, backchannelLogoutSessionRequired?: boolean, backchannelLogoutUri?: string, clientCredentialsGrantAccessTokenLifespan?: string, clientId?: string, clientName?: string, clientSecret?: string, clientSecretExpiresAt?: number, clientUri?: string, contacts?: Array<string>, createdAt?: string, frontchannelLogoutSessionRequired?: boolean, frontchannelLogoutUri?: string, grantTypes?: Array<string>, implicitGrantAccessTokenLifespan?: string, implicitGrantIdTokenLifespan?: string, jwks?: Array<string>, jwksUri?: string, jwtBearerGrantAccessTokenLifespan?: string, logoUri?: string, owner?: string, policyUri?: string, postLogoutRedirectUris?: Array<string>, redirectUris?: Array<string>, refreshTokenGrantAccessTokenLifespan?: string, refreshTokenGrantIdTokenLifespan?: string, refreshTokenGrantRefreshTokenLifespan?: string, registrationAccessToken?: string, registrationClientUri?: string, requestObjectSigningAlg?: string, requestUris?: Array<string>, responseTypes?: Array<string>, scope?: string, sectorIdentifierUri?: string, skipConsent?: boolean, skipLogoutConsent?: boolean, subjectType?: string, tokenEndpointAuthMethod?: string, tokenEndpointAuthSigningAlg?: string, tosUri?: string, updatedAt?: string, userinfoSignedResponseAlg?: string, options?: any): Promise<any>;
1948
+ /** List mezon OAuth client */
1949
+ listMezonOauthClient(bearerToken: string, options?: any): Promise<ApiMezonOauthClientList>;
1950
+ /** Create mezon OAuth client */
1951
+ createMezonOauthClient(bearerToken: string, body: ApiMezonOauthClient, options?: any): Promise<ApiMezonOauthClient>;
1892
1952
  /** set mute notification user channel. */
1893
1953
  setMuteNotificationCategory(bearerToken: string, body: ApiSetMuteNotificationRequest, options?: any): Promise<any>;
1894
1954
  /** 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 } 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. */
@@ -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,132 @@ var MezonApi = class {
4358
4352
  )
4359
4353
  ]);
4360
4354
  }
4355
+ /** Delete mezon OAuth client */
4356
+ 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 = {}) {
4357
+ const urlPath = "/v2/mznoauthclient";
4358
+ const queryParams = /* @__PURE__ */ new Map();
4359
+ queryParams.set("access_token_strategy", accessTokenStrategy);
4360
+ queryParams.set("allowed_cors_origins", allowedCorsOrigins);
4361
+ queryParams.set("audience", audience);
4362
+ queryParams.set("authorization_code_grant_access_token_lifespan", authorizationCodeGrantAccessTokenLifespan);
4363
+ queryParams.set("authorization_code_grant_id_token_lifespan", authorizationCodeGrantIdTokenLifespan);
4364
+ queryParams.set("authorization_code_grant_refresh_token_lifespan", authorizationCodeGrantRefreshTokenLifespan);
4365
+ queryParams.set("backchannel_logout_session_required", backchannelLogoutSessionRequired);
4366
+ queryParams.set("backchannel_logout_uri", backchannelLogoutUri);
4367
+ queryParams.set("client_credentials_grant_access_token_lifespan", clientCredentialsGrantAccessTokenLifespan);
4368
+ queryParams.set("client_id", clientId);
4369
+ queryParams.set("client_name", clientName);
4370
+ queryParams.set("client_secret", clientSecret);
4371
+ queryParams.set("client_secret_expires_at", clientSecretExpiresAt);
4372
+ queryParams.set("client_uri", clientUri);
4373
+ queryParams.set("contacts", contacts);
4374
+ queryParams.set("created_at", createdAt);
4375
+ queryParams.set("frontchannel_logout_session_required", frontchannelLogoutSessionRequired);
4376
+ queryParams.set("frontchannel_logout_uri", frontchannelLogoutUri);
4377
+ queryParams.set("grant_types", grantTypes);
4378
+ queryParams.set("implicit_grant_access_token_lifespan", implicitGrantAccessTokenLifespan);
4379
+ queryParams.set("implicit_grant_id_token_lifespan", implicitGrantIdTokenLifespan);
4380
+ queryParams.set("jwks", jwks);
4381
+ queryParams.set("jwks_uri", jwksUri);
4382
+ queryParams.set("jwt_bearer_grant_access_token_lifespan", jwtBearerGrantAccessTokenLifespan);
4383
+ queryParams.set("logo_uri", logoUri);
4384
+ queryParams.set("owner", owner);
4385
+ queryParams.set("policy_uri", policyUri);
4386
+ queryParams.set("post_logout_redirect_uris", postLogoutRedirectUris);
4387
+ queryParams.set("redirect_uris", redirectUris);
4388
+ queryParams.set("refresh_token_grant_access_token_lifespan", refreshTokenGrantAccessTokenLifespan);
4389
+ queryParams.set("refresh_token_grant_id_token_lifespan", refreshTokenGrantIdTokenLifespan);
4390
+ queryParams.set("refresh_token_grant_refresh_token_lifespan", refreshTokenGrantRefreshTokenLifespan);
4391
+ queryParams.set("registration_access_token", registrationAccessToken);
4392
+ queryParams.set("registration_client_uri", registrationClientUri);
4393
+ queryParams.set("request_object_signing_alg", requestObjectSigningAlg);
4394
+ queryParams.set("request_uris", requestUris);
4395
+ queryParams.set("response_types", responseTypes);
4396
+ queryParams.set("scope", scope);
4397
+ queryParams.set("sector_identifier_uri", sectorIdentifierUri);
4398
+ queryParams.set("skip_consent", skipConsent);
4399
+ queryParams.set("skip_logout_consent", skipLogoutConsent);
4400
+ queryParams.set("subject_type", subjectType);
4401
+ queryParams.set("token_endpoint_auth_method", tokenEndpointAuthMethod);
4402
+ queryParams.set("token_endpoint_auth_signing_alg", tokenEndpointAuthSigningAlg);
4403
+ queryParams.set("tos_uri", tosUri);
4404
+ queryParams.set("updated_at", updatedAt);
4405
+ queryParams.set("userinfo_signed_response_alg", userinfoSignedResponseAlg);
4406
+ let bodyJson = "";
4407
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4408
+ const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
4409
+ if (bearerToken) {
4410
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4411
+ }
4412
+ return Promise.race([
4413
+ fetch(fullUrl, fetchOptions).then((response) => {
4414
+ if (response.status == 204) {
4415
+ return response;
4416
+ } else if (response.status >= 200 && response.status < 300) {
4417
+ return response.json();
4418
+ } else {
4419
+ throw response;
4420
+ }
4421
+ }),
4422
+ new Promise(
4423
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4424
+ )
4425
+ ]);
4426
+ }
4427
+ /** List mezon OAuth client */
4428
+ listMezonOauthClient(bearerToken, options = {}) {
4429
+ const urlPath = "/v2/mznoauthclient";
4430
+ const queryParams = /* @__PURE__ */ new Map();
4431
+ let bodyJson = "";
4432
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4433
+ const fetchOptions = buildFetchOptions("GET", options, bodyJson);
4434
+ if (bearerToken) {
4435
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4436
+ }
4437
+ return Promise.race([
4438
+ fetch(fullUrl, fetchOptions).then((response) => {
4439
+ if (response.status == 204) {
4440
+ return response;
4441
+ } else if (response.status >= 200 && response.status < 300) {
4442
+ return response.json();
4443
+ } else {
4444
+ throw response;
4445
+ }
4446
+ }),
4447
+ new Promise(
4448
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4449
+ )
4450
+ ]);
4451
+ }
4452
+ /** Create mezon OAuth client */
4453
+ createMezonOauthClient(bearerToken, body, options = {}) {
4454
+ if (body === null || body === void 0) {
4455
+ throw new Error("'body' is a required parameter but is null or undefined.");
4456
+ }
4457
+ const urlPath = "/v2/mznoauthclient";
4458
+ const queryParams = /* @__PURE__ */ new Map();
4459
+ let bodyJson = "";
4460
+ bodyJson = JSON.stringify(body || {});
4461
+ const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
4462
+ const fetchOptions = buildFetchOptions("POST", options, bodyJson);
4463
+ if (bearerToken) {
4464
+ fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
4465
+ }
4466
+ return Promise.race([
4467
+ fetch(fullUrl, fetchOptions).then((response) => {
4468
+ if (response.status == 204) {
4469
+ return response;
4470
+ } else if (response.status >= 200 && response.status < 300) {
4471
+ return response.json();
4472
+ } else {
4473
+ throw response;
4474
+ }
4475
+ }),
4476
+ new Promise(
4477
+ (_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
4478
+ )
4479
+ ]);
4480
+ }
4361
4481
  /** set mute notification user channel. */
4362
4482
  setMuteNotificationCategory(bearerToken, body, options = {}) {
4363
4483
  if (body === null || body === void 0) {
@@ -8253,12 +8373,12 @@ var Client = class {
8253
8373
  });
8254
8374
  }
8255
8375
  /** Authenticate a user with a custom id against the server. */
8256
- authenticateCustom(id, create, username, vars = {}, options = {}) {
8376
+ authenticateMezon(token, create, username, vars = {}, options = {}) {
8257
8377
  const request = {
8258
- id,
8378
+ token,
8259
8379
  vars
8260
8380
  };
8261
- return this.apiClient.authenticateCustom(
8381
+ return this.apiClient.authenticateMezon(
8262
8382
  this.serverkey,
8263
8383
  "",
8264
8384
  request,
@@ -9134,12 +9254,12 @@ var Client = class {
9134
9254
  });
9135
9255
  }
9136
9256
  /** Add a custom ID to the social profiles on the current user's account. */
9137
- linkCustom(session, request) {
9257
+ linkMezon(session, request) {
9138
9258
  return __async(this, null, function* () {
9139
9259
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9140
9260
  yield this.sessionRefresh(session);
9141
9261
  }
9142
- return this.apiClient.linkCustom(session.token, request).then((response) => {
9262
+ return this.apiClient.linkMezon(session.token, request).then((response) => {
9143
9263
  return response !== void 0;
9144
9264
  });
9145
9265
  });
@@ -9389,7 +9509,7 @@ var Client = class {
9389
9509
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
9390
9510
  yield this.sessionRefresh(session);
9391
9511
  }
9392
- return this.apiClient.unlinkCustom(session.token, request).then((response) => {
9512
+ return this.apiClient.unlinkMezon(session.token, request).then((response) => {
9393
9513
  return response !== void 0;
9394
9514
  });
9395
9515
  });