mezon-js 2.12.67 → 2.12.69
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 +46 -0
- package/client.ts +18 -0
- package/dist/api.gen.d.ts +8 -0
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +39 -0
- package/dist/mezon-js.esm.mjs +39 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -3303,6 +3303,8 @@ export interface ApiListClanDiscover {
|
|
3303
3303
|
|
3304
3304
|
/** */
|
3305
3305
|
export interface ApiClanDiscoverRequest {
|
3306
|
+
//
|
3307
|
+
clan_id?: string;
|
3306
3308
|
//
|
3307
3309
|
item_per_page?: number;
|
3308
3310
|
//
|
@@ -3323,6 +3325,14 @@ export interface ApiIsFollowerResponse {
|
|
3323
3325
|
follow_id?: string;
|
3324
3326
|
}
|
3325
3327
|
|
3328
|
+
/** */
|
3329
|
+
export interface ApiTransferOwnershipRequest {
|
3330
|
+
//
|
3331
|
+
clan_id?: string;
|
3332
|
+
//
|
3333
|
+
new_owner_id?: string;
|
3334
|
+
}
|
3335
|
+
|
3326
3336
|
export class MezonApi {
|
3327
3337
|
basePath: string;
|
3328
3338
|
constructor(
|
@@ -11211,4 +11221,40 @@ export class MezonApi {
|
|
11211
11221
|
]);
|
11212
11222
|
}
|
11213
11223
|
|
11224
|
+
/** */
|
11225
|
+
transferOwnership(bearerToken: string,
|
11226
|
+
body:ApiTransferOwnershipRequest,
|
11227
|
+
options: any = {}): Promise<any> {
|
11228
|
+
|
11229
|
+
if (body === null || body === undefined) {
|
11230
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
11231
|
+
}
|
11232
|
+
const urlPath = "/v2/transfer/ownership";
|
11233
|
+
const queryParams = new Map<string, any>();
|
11234
|
+
|
11235
|
+
let bodyJson : string = "";
|
11236
|
+
bodyJson = JSON.stringify(body || {});
|
11237
|
+
|
11238
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11239
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
11240
|
+
if (bearerToken) {
|
11241
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11242
|
+
}
|
11243
|
+
|
11244
|
+
return Promise.race([
|
11245
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11246
|
+
if (response.status == 204) {
|
11247
|
+
return response;
|
11248
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11249
|
+
return response.json();
|
11250
|
+
} else {
|
11251
|
+
throw response;
|
11252
|
+
}
|
11253
|
+
}),
|
11254
|
+
new Promise((_, reject) =>
|
11255
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11256
|
+
),
|
11257
|
+
]);
|
11258
|
+
}
|
11259
|
+
|
11214
11260
|
}
|
package/client.ts
CHANGED
@@ -171,6 +171,7 @@ import {
|
|
171
171
|
ApiUnlockedItemResponse,
|
172
172
|
ApiIsFollowerResponse,
|
173
173
|
ApiIsFollowerRequest,
|
174
|
+
ApiTransferOwnershipRequest,
|
174
175
|
} from "./api.gen";
|
175
176
|
|
176
177
|
import { Session } from "./session";
|
@@ -4882,4 +4883,21 @@ export class Client {
|
|
4882
4883
|
});
|
4883
4884
|
}
|
4884
4885
|
|
4886
|
+
async transferOwnership(session: Session,
|
4887
|
+
req: ApiTransferOwnershipRequest): Promise<any> {
|
4888
|
+
if (
|
4889
|
+
this.autoRefreshSession &&
|
4890
|
+
session.refresh_token &&
|
4891
|
+
session.isexpired(Date.now() / 1000)
|
4892
|
+
) {
|
4893
|
+
await this.sessionRefresh(session);
|
4894
|
+
}
|
4895
|
+
|
4896
|
+
return this.apiClient
|
4897
|
+
.transferOwnership(session.token, req)
|
4898
|
+
.then((response: any) => {
|
4899
|
+
return response !== undefined;
|
4900
|
+
});
|
4901
|
+
}
|
4902
|
+
|
4885
4903
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -1891,6 +1891,7 @@ export interface ApiListClanDiscover {
|
|
1891
1891
|
}
|
1892
1892
|
/** */
|
1893
1893
|
export interface ApiClanDiscoverRequest {
|
1894
|
+
clan_id?: string;
|
1894
1895
|
item_per_page?: number;
|
1895
1896
|
page_number?: number;
|
1896
1897
|
}
|
@@ -1903,6 +1904,11 @@ export interface ApiIsFollowerResponse {
|
|
1903
1904
|
is_follower?: boolean;
|
1904
1905
|
follow_id?: string;
|
1905
1906
|
}
|
1907
|
+
/** */
|
1908
|
+
export interface ApiTransferOwnershipRequest {
|
1909
|
+
clan_id?: string;
|
1910
|
+
new_owner_id?: string;
|
1911
|
+
}
|
1906
1912
|
export declare class MezonApi {
|
1907
1913
|
readonly serverKey: string;
|
1908
1914
|
readonly timeoutMs: number;
|
@@ -2306,4 +2312,6 @@ export declare class MezonApi {
|
|
2306
2312
|
listForSaleItems(bearerToken: string, page?: number, options?: any): Promise<ApiForSaleItemList>;
|
2307
2313
|
/** */
|
2308
2314
|
isFollower(bearerToken: string, body: ApiIsFollowerRequest, options?: any): Promise<ApiIsFollowerResponse>;
|
2315
|
+
/** */
|
2316
|
+
transferOwnership(bearerToken: string, body: ApiTransferOwnershipRequest, options?: any): Promise<any>;
|
2309
2317
|
}
|
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, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest } from "./api.gen";
|
16
|
+
import { ApiAccount, ApiAccountMezon, ApiAccountEmail, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiListOnboardingResponse, ApiCreateOnboardingRequest, MezonUpdateOnboardingBody, ApiOnboardingItem, ApiGenerateClanWebhookRequest, ApiGenerateClanWebhookResponse, ApiListClanWebhookResponse, MezonUpdateClanWebhookByIdBody, MezonUpdateClanDescBody, ApiUserStatusUpdate, ApiUserStatus, ApiListOnboardingStepResponse, MezonUpdateOnboardingStepByClanIdBody, ApiWalletLedgerList, ApiSdTopicList, ApiSdTopicRequest, ApiSdTopic, MezonUpdateEventBody, ApiTransactionDetail, MezonapiCreateRoomChannelApps, ApiGenerateMeetTokenRequest, ApiGenerateMeetTokenResponse, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, ApiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse, ApiUpdateClanOrderRequest, ApiMessage2InboxRequest, ApiListClanDiscover, ApiClanDiscoverRequest, ApiQuickMenuAccessList, ApiQuickMenuAccessRequest, ApiUnlockedItemRequest, ApiForSaleItemList, ApiUnlockedItemResponse, ApiIsFollowerResponse, ApiIsFollowerRequest, ApiTransferOwnershipRequest } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -622,4 +622,5 @@ export declare class Client {
|
|
622
622
|
unlockItem(session: Session, request: ApiUnlockedItemRequest): Promise<ApiUnlockedItemResponse>;
|
623
623
|
listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
|
624
624
|
isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
|
625
|
+
transferOwnership(session: Session, req: ApiTransferOwnershipRequest): Promise<any>;
|
625
626
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -6888,6 +6888,35 @@ var MezonApi = class {
|
|
6888
6888
|
)
|
6889
6889
|
]);
|
6890
6890
|
}
|
6891
|
+
/** */
|
6892
|
+
transferOwnership(bearerToken, body, options = {}) {
|
6893
|
+
if (body === null || body === void 0) {
|
6894
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6895
|
+
}
|
6896
|
+
const urlPath = "/v2/transfer/ownership";
|
6897
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6898
|
+
let bodyJson = "";
|
6899
|
+
bodyJson = JSON.stringify(body || {});
|
6900
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6901
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6902
|
+
if (bearerToken) {
|
6903
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6904
|
+
}
|
6905
|
+
return Promise.race([
|
6906
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6907
|
+
if (response.status == 204) {
|
6908
|
+
return response;
|
6909
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6910
|
+
return response.json();
|
6911
|
+
} else {
|
6912
|
+
throw response;
|
6913
|
+
}
|
6914
|
+
}),
|
6915
|
+
new Promise(
|
6916
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6917
|
+
)
|
6918
|
+
]);
|
6919
|
+
}
|
6891
6920
|
};
|
6892
6921
|
|
6893
6922
|
// session.ts
|
@@ -10722,4 +10751,14 @@ var Client = class {
|
|
10722
10751
|
});
|
10723
10752
|
});
|
10724
10753
|
}
|
10754
|
+
transferOwnership(session, req) {
|
10755
|
+
return __async(this, null, function* () {
|
10756
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10757
|
+
yield this.sessionRefresh(session);
|
10758
|
+
}
|
10759
|
+
return this.apiClient.transferOwnership(session.token, req).then((response) => {
|
10760
|
+
return response !== void 0;
|
10761
|
+
});
|
10762
|
+
});
|
10763
|
+
}
|
10725
10764
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -6854,6 +6854,35 @@ var MezonApi = class {
|
|
6854
6854
|
)
|
6855
6855
|
]);
|
6856
6856
|
}
|
6857
|
+
/** */
|
6858
|
+
transferOwnership(bearerToken, body, options = {}) {
|
6859
|
+
if (body === null || body === void 0) {
|
6860
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6861
|
+
}
|
6862
|
+
const urlPath = "/v2/transfer/ownership";
|
6863
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6864
|
+
let bodyJson = "";
|
6865
|
+
bodyJson = JSON.stringify(body || {});
|
6866
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6867
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6868
|
+
if (bearerToken) {
|
6869
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6870
|
+
}
|
6871
|
+
return Promise.race([
|
6872
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6873
|
+
if (response.status == 204) {
|
6874
|
+
return response;
|
6875
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6876
|
+
return response.json();
|
6877
|
+
} else {
|
6878
|
+
throw response;
|
6879
|
+
}
|
6880
|
+
}),
|
6881
|
+
new Promise(
|
6882
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6883
|
+
)
|
6884
|
+
]);
|
6885
|
+
}
|
6857
6886
|
};
|
6858
6887
|
|
6859
6888
|
// session.ts
|
@@ -10688,6 +10717,16 @@ var Client = class {
|
|
10688
10717
|
});
|
10689
10718
|
});
|
10690
10719
|
}
|
10720
|
+
transferOwnership(session, req) {
|
10721
|
+
return __async(this, null, function* () {
|
10722
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10723
|
+
yield this.sessionRefresh(session);
|
10724
|
+
}
|
10725
|
+
return this.apiClient.transferOwnership(session.token, req).then((response) => {
|
10726
|
+
return response !== void 0;
|
10727
|
+
});
|
10728
|
+
});
|
10729
|
+
}
|
10691
10730
|
};
|
10692
10731
|
export {
|
10693
10732
|
ChannelStreamMode,
|