mezon-js 2.12.68 → 2.12.70
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 +44 -105
- package/client.ts +18 -42
- package/dist/api.gen.d.ts +7 -13
- package/dist/client.d.ts +2 -5
- package/dist/mezon-js.cjs.js +39 -94
- package/dist/mezon-js.esm.mjs +39 -94
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -954,22 +954,6 @@ export interface ApiClanDescList {
|
|
954
954
|
clandesc?: Array<ApiClanDesc>;
|
955
955
|
}
|
956
956
|
|
957
|
-
/** */
|
958
|
-
export interface ApiClanDescProfile {
|
959
|
-
//
|
960
|
-
avatar_url?: string;
|
961
|
-
//
|
962
|
-
clan_id?: string;
|
963
|
-
//
|
964
|
-
creator_id?: string;
|
965
|
-
//
|
966
|
-
nick_name?: string;
|
967
|
-
//
|
968
|
-
profile_banner?: string;
|
969
|
-
//
|
970
|
-
profile_theme?: string;
|
971
|
-
}
|
972
|
-
|
973
957
|
/** */
|
974
958
|
export interface ApiClanEmoji {
|
975
959
|
//
|
@@ -3325,6 +3309,14 @@ export interface ApiIsFollowerResponse {
|
|
3325
3309
|
follow_id?: string;
|
3326
3310
|
}
|
3327
3311
|
|
3312
|
+
/** */
|
3313
|
+
export interface ApiTransferOwnershipRequest {
|
3314
|
+
//
|
3315
|
+
clan_id?: string;
|
3316
|
+
//
|
3317
|
+
new_owner_id?: string;
|
3318
|
+
}
|
3319
|
+
|
3328
3320
|
export class MezonApi {
|
3329
3321
|
basePath: string;
|
3330
3322
|
constructor(
|
@@ -5582,95 +5574,6 @@ export class MezonApi {
|
|
5582
5574
|
]);
|
5583
5575
|
}
|
5584
5576
|
|
5585
|
-
/** Get a clan desc profile */
|
5586
|
-
getClanDescProfile(
|
5587
|
-
bearerToken: string,
|
5588
|
-
clanId: string,
|
5589
|
-
options: any = {}
|
5590
|
-
): Promise<ApiClanDescProfile> {
|
5591
|
-
if (clanId === null || clanId === undefined) {
|
5592
|
-
throw new Error(
|
5593
|
-
"'clanId' is a required parameter but is null or undefined."
|
5594
|
-
);
|
5595
|
-
}
|
5596
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
5597
|
-
"{clanId}",
|
5598
|
-
encodeURIComponent(String(clanId))
|
5599
|
-
);
|
5600
|
-
const queryParams = new Map<string, any>();
|
5601
|
-
|
5602
|
-
let bodyJson: string = "";
|
5603
|
-
|
5604
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5605
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
5606
|
-
if (bearerToken) {
|
5607
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5608
|
-
}
|
5609
|
-
|
5610
|
-
return Promise.race([
|
5611
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
5612
|
-
if (response.status == 204) {
|
5613
|
-
return response;
|
5614
|
-
} else if (response.status >= 200 && response.status < 300) {
|
5615
|
-
return response.json();
|
5616
|
-
} else {
|
5617
|
-
throw response;
|
5618
|
-
}
|
5619
|
-
}),
|
5620
|
-
new Promise((_, reject) =>
|
5621
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5622
|
-
),
|
5623
|
-
]);
|
5624
|
-
}
|
5625
|
-
|
5626
|
-
/** Update fields in a given clan profile. */
|
5627
|
-
updateClanDescProfile(
|
5628
|
-
bearerToken: string,
|
5629
|
-
clanId: string,
|
5630
|
-
body: {},
|
5631
|
-
options: any = {}
|
5632
|
-
): Promise<any> {
|
5633
|
-
if (clanId === null || clanId === undefined) {
|
5634
|
-
throw new Error(
|
5635
|
-
"'clanId' is a required parameter but is null or undefined."
|
5636
|
-
);
|
5637
|
-
}
|
5638
|
-
if (body === null || body === undefined) {
|
5639
|
-
throw new Error(
|
5640
|
-
"'body' is a required parameter but is null or undefined."
|
5641
|
-
);
|
5642
|
-
}
|
5643
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
5644
|
-
"{clanId}",
|
5645
|
-
encodeURIComponent(String(clanId))
|
5646
|
-
);
|
5647
|
-
const queryParams = new Map<string, any>();
|
5648
|
-
|
5649
|
-
let bodyJson: string = "";
|
5650
|
-
bodyJson = JSON.stringify(body || {});
|
5651
|
-
|
5652
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5653
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
5654
|
-
if (bearerToken) {
|
5655
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5656
|
-
}
|
5657
|
-
|
5658
|
-
return Promise.race([
|
5659
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
5660
|
-
if (response.status == 204) {
|
5661
|
-
return response;
|
5662
|
-
} else if (response.status >= 200 && response.status < 300) {
|
5663
|
-
return response.json();
|
5664
|
-
} else {
|
5665
|
-
throw response;
|
5666
|
-
}
|
5667
|
-
}),
|
5668
|
-
new Promise((_, reject) =>
|
5669
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5670
|
-
),
|
5671
|
-
]);
|
5672
|
-
}
|
5673
|
-
|
5674
5577
|
/** */
|
5675
5578
|
createCategoryDesc(
|
5676
5579
|
bearerToken: string,
|
@@ -11213,4 +11116,40 @@ export class MezonApi {
|
|
11213
11116
|
]);
|
11214
11117
|
}
|
11215
11118
|
|
11119
|
+
/** */
|
11120
|
+
transferOwnership(bearerToken: string,
|
11121
|
+
body:ApiTransferOwnershipRequest,
|
11122
|
+
options: any = {}): Promise<any> {
|
11123
|
+
|
11124
|
+
if (body === null || body === undefined) {
|
11125
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
11126
|
+
}
|
11127
|
+
const urlPath = "/v2/transfer/ownership";
|
11128
|
+
const queryParams = new Map<string, any>();
|
11129
|
+
|
11130
|
+
let bodyJson : string = "";
|
11131
|
+
bodyJson = JSON.stringify(body || {});
|
11132
|
+
|
11133
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11134
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
11135
|
+
if (bearerToken) {
|
11136
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11137
|
+
}
|
11138
|
+
|
11139
|
+
return Promise.race([
|
11140
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11141
|
+
if (response.status == 204) {
|
11142
|
+
return response;
|
11143
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11144
|
+
return response.json();
|
11145
|
+
} else {
|
11146
|
+
throw response;
|
11147
|
+
}
|
11148
|
+
}),
|
11149
|
+
new Promise((_, reject) =>
|
11150
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11151
|
+
),
|
11152
|
+
]);
|
11153
|
+
}
|
11154
|
+
|
11216
11155
|
}
|
package/client.ts
CHANGED
@@ -43,7 +43,6 @@ import {
|
|
43
43
|
ApiUsers,
|
44
44
|
MezonApi,
|
45
45
|
ApiSession,
|
46
|
-
ApiClanDescProfile,
|
47
46
|
ApiClanProfile,
|
48
47
|
ApiChannelUserList,
|
49
48
|
ApiClanUserList,
|
@@ -171,6 +170,7 @@ import {
|
|
171
170
|
ApiUnlockedItemResponse,
|
172
171
|
ApiIsFollowerResponse,
|
173
172
|
ApiIsFollowerRequest,
|
173
|
+
ApiTransferOwnershipRequest,
|
174
174
|
} from "./api.gen";
|
175
175
|
|
176
176
|
import { Session } from "./session";
|
@@ -1743,26 +1743,6 @@ export class Client {
|
|
1743
1743
|
});
|
1744
1744
|
}
|
1745
1745
|
|
1746
|
-
/** Get a clan desc profile */
|
1747
|
-
async getClanDescProfile(
|
1748
|
-
session: Session,
|
1749
|
-
clanId: string
|
1750
|
-
): Promise<ApiClanDescProfile> {
|
1751
|
-
if (
|
1752
|
-
this.autoRefreshSession &&
|
1753
|
-
session.refresh_token &&
|
1754
|
-
session.isexpired(Date.now() / 1000)
|
1755
|
-
) {
|
1756
|
-
await this.sessionRefresh(session);
|
1757
|
-
}
|
1758
|
-
|
1759
|
-
return this.apiClient
|
1760
|
-
.getClanDescProfile(session.token, clanId)
|
1761
|
-
.then((response: ApiClanDescProfile) => {
|
1762
|
-
return Promise.resolve(response);
|
1763
|
-
});
|
1764
|
-
}
|
1765
|
-
|
1766
1746
|
async getUserProfileOnClan(
|
1767
1747
|
session: Session,
|
1768
1748
|
clanId: string
|
@@ -2230,27 +2210,6 @@ export class Client {
|
|
2230
2210
|
});
|
2231
2211
|
}
|
2232
2212
|
|
2233
|
-
/** Update fields in a given clan profile. */
|
2234
|
-
async updateClanDescProfile(
|
2235
|
-
session: Session,
|
2236
|
-
clanId: string,
|
2237
|
-
request: ApiUpdateClanDescProfileRequest
|
2238
|
-
): Promise<boolean> {
|
2239
|
-
if (
|
2240
|
-
this.autoRefreshSession &&
|
2241
|
-
session.refresh_token &&
|
2242
|
-
session.isexpired(Date.now() / 1000)
|
2243
|
-
) {
|
2244
|
-
await this.sessionRefresh(session);
|
2245
|
-
}
|
2246
|
-
|
2247
|
-
return this.apiClient
|
2248
|
-
.updateClanDescProfile(session.token, clanId, request)
|
2249
|
-
.then((response: any) => {
|
2250
|
-
return response !== undefined;
|
2251
|
-
});
|
2252
|
-
}
|
2253
|
-
|
2254
2213
|
async updateUserProfileByClan(
|
2255
2214
|
session: Session,
|
2256
2215
|
clanId: string,
|
@@ -4882,4 +4841,21 @@ export class Client {
|
|
4882
4841
|
});
|
4883
4842
|
}
|
4884
4843
|
|
4844
|
+
async transferOwnership(session: Session,
|
4845
|
+
req: ApiTransferOwnershipRequest): Promise<any> {
|
4846
|
+
if (
|
4847
|
+
this.autoRefreshSession &&
|
4848
|
+
session.refresh_token &&
|
4849
|
+
session.isexpired(Date.now() / 1000)
|
4850
|
+
) {
|
4851
|
+
await this.sessionRefresh(session);
|
4852
|
+
}
|
4853
|
+
|
4854
|
+
return this.apiClient
|
4855
|
+
.transferOwnership(session.token, req)
|
4856
|
+
.then((response: any) => {
|
4857
|
+
return response !== undefined;
|
4858
|
+
});
|
4859
|
+
}
|
4860
|
+
|
4885
4861
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -541,15 +541,6 @@ export interface ApiClanDescList {
|
|
541
541
|
clandesc?: Array<ApiClanDesc>;
|
542
542
|
}
|
543
543
|
/** */
|
544
|
-
export interface ApiClanDescProfile {
|
545
|
-
avatar_url?: string;
|
546
|
-
clan_id?: string;
|
547
|
-
creator_id?: string;
|
548
|
-
nick_name?: string;
|
549
|
-
profile_banner?: string;
|
550
|
-
profile_theme?: string;
|
551
|
-
}
|
552
|
-
/** */
|
553
544
|
export interface ApiClanEmoji {
|
554
545
|
category?: string;
|
555
546
|
clan_id?: string;
|
@@ -1904,6 +1895,11 @@ export interface ApiIsFollowerResponse {
|
|
1904
1895
|
is_follower?: boolean;
|
1905
1896
|
follow_id?: string;
|
1906
1897
|
}
|
1898
|
+
/** */
|
1899
|
+
export interface ApiTransferOwnershipRequest {
|
1900
|
+
clan_id?: string;
|
1901
|
+
new_owner_id?: string;
|
1902
|
+
}
|
1907
1903
|
export declare class MezonApi {
|
1908
1904
|
readonly serverKey: string;
|
1909
1905
|
readonly timeoutMs: number;
|
@@ -2020,10 +2016,6 @@ export declare class MezonApi {
|
|
2020
2016
|
listClanUsers(bearerToken: string, clanId: string, options?: any): Promise<ApiClanUserList>;
|
2021
2017
|
/** check duplicate clan name */
|
2022
2018
|
checkDuplicateClanName(bearerToken: string, clanName: string, options?: any): Promise<ApiCheckDuplicateClanNameResponse>;
|
2023
|
-
/** Get a clan desc profile */
|
2024
|
-
getClanDescProfile(bearerToken: string, clanId: string, options?: any): Promise<ApiClanDescProfile>;
|
2025
|
-
/** Update fields in a given clan profile. */
|
2026
|
-
updateClanDescProfile(bearerToken: string, clanId: string, body: {}, options?: any): Promise<any>;
|
2027
2019
|
/** */
|
2028
2020
|
createCategoryDesc(bearerToken: string, body: ApiCreateCategoryDescRequest, options?: any): Promise<ApiCategoryDesc>;
|
2029
2021
|
/** */
|
@@ -2307,4 +2299,6 @@ export declare class MezonApi {
|
|
2307
2299
|
listForSaleItems(bearerToken: string, page?: number, options?: any): Promise<ApiForSaleItemList>;
|
2308
2300
|
/** */
|
2309
2301
|
isFollower(bearerToken: string, body: ApiIsFollowerRequest, options?: any): Promise<ApiIsFollowerResponse>;
|
2302
|
+
/** */
|
2303
|
+
transferOwnership(bearerToken: string, body: ApiTransferOwnershipRequest, options?: any): Promise<any>;
|
2310
2304
|
}
|
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,
|
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, 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";
|
@@ -427,8 +427,6 @@ export declare class Client {
|
|
427
427
|
/** List user roles */
|
428
428
|
listRoleUsers(session: Session, roleId: string, limit?: number, cursor?: string): Promise<ApiRoleUserList>;
|
429
429
|
registFCMDeviceToken(session: Session, tokenId: string, deviceId: string, platform: string, voipToken?: string): Promise<ApiRegistFcmDeviceTokenResponse>;
|
430
|
-
/** Get a clan desc profile */
|
431
|
-
getClanDescProfile(session: Session, clanId: string): Promise<ApiClanDescProfile>;
|
432
430
|
getUserProfileOnClan(session: Session, clanId: string): Promise<ApiClanProfile>;
|
433
431
|
closeDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
|
434
432
|
openDirectMess(session: Session, request: ApiDeleteChannelDescRequest): Promise<boolean>;
|
@@ -460,8 +458,6 @@ export declare class Client {
|
|
460
458
|
updateClanDesc(session: Session, clanId: string, request: MezonUpdateClanDescBody): Promise<boolean>;
|
461
459
|
/** Update fields in a given category. */
|
462
460
|
updateCategory(session: Session, clanId: string, request: ApiUpdateCategoryDescRequest): Promise<boolean>;
|
463
|
-
/** Update fields in a given clan profile. */
|
464
|
-
updateClanDescProfile(session: Session, clanId: string, request: ApiUpdateClanDescProfileRequest): Promise<boolean>;
|
465
461
|
updateUserProfileByClan(session: Session, clanId: string, request: ApiUpdateClanProfileRequest): Promise<boolean>;
|
466
462
|
/** Update fields in a given role. */
|
467
463
|
updateRole(session: Session, roleId: string, request: ApiUpdateRoleRequest): Promise<boolean>;
|
@@ -622,4 +618,5 @@ export declare class Client {
|
|
622
618
|
unlockItem(session: Session, request: ApiUnlockedItemRequest): Promise<ApiUnlockedItemResponse>;
|
623
619
|
listForSaleItems(session: Session, page?: number): Promise<ApiForSaleItemList>;
|
624
620
|
isFollower(session: Session, req: ApiIsFollowerRequest): Promise<ApiIsFollowerResponse>;
|
621
|
+
transferOwnership(session: Session, req: ApiTransferOwnershipRequest): Promise<any>;
|
625
622
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -2492,78 +2492,6 @@ var MezonApi = class {
|
|
2492
2492
|
)
|
2493
2493
|
]);
|
2494
2494
|
}
|
2495
|
-
/** Get a clan desc profile */
|
2496
|
-
getClanDescProfile(bearerToken, clanId, options = {}) {
|
2497
|
-
if (clanId === null || clanId === void 0) {
|
2498
|
-
throw new Error(
|
2499
|
-
"'clanId' is a required parameter but is null or undefined."
|
2500
|
-
);
|
2501
|
-
}
|
2502
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2503
|
-
"{clanId}",
|
2504
|
-
encodeURIComponent(String(clanId))
|
2505
|
-
);
|
2506
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2507
|
-
let bodyJson = "";
|
2508
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2509
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2510
|
-
if (bearerToken) {
|
2511
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2512
|
-
}
|
2513
|
-
return Promise.race([
|
2514
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2515
|
-
if (response.status == 204) {
|
2516
|
-
return response;
|
2517
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2518
|
-
return response.json();
|
2519
|
-
} else {
|
2520
|
-
throw response;
|
2521
|
-
}
|
2522
|
-
}),
|
2523
|
-
new Promise(
|
2524
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2525
|
-
)
|
2526
|
-
]);
|
2527
|
-
}
|
2528
|
-
/** Update fields in a given clan profile. */
|
2529
|
-
updateClanDescProfile(bearerToken, clanId, body, options = {}) {
|
2530
|
-
if (clanId === null || clanId === void 0) {
|
2531
|
-
throw new Error(
|
2532
|
-
"'clanId' is a required parameter but is null or undefined."
|
2533
|
-
);
|
2534
|
-
}
|
2535
|
-
if (body === null || body === void 0) {
|
2536
|
-
throw new Error(
|
2537
|
-
"'body' is a required parameter but is null or undefined."
|
2538
|
-
);
|
2539
|
-
}
|
2540
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2541
|
-
"{clanId}",
|
2542
|
-
encodeURIComponent(String(clanId))
|
2543
|
-
);
|
2544
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2545
|
-
let bodyJson = "";
|
2546
|
-
bodyJson = JSON.stringify(body || {});
|
2547
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2548
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
2549
|
-
if (bearerToken) {
|
2550
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2551
|
-
}
|
2552
|
-
return Promise.race([
|
2553
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2554
|
-
if (response.status == 204) {
|
2555
|
-
return response;
|
2556
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2557
|
-
return response.json();
|
2558
|
-
} else {
|
2559
|
-
throw response;
|
2560
|
-
}
|
2561
|
-
}),
|
2562
|
-
new Promise(
|
2563
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2564
|
-
)
|
2565
|
-
]);
|
2566
|
-
}
|
2567
2495
|
/** */
|
2568
2496
|
createCategoryDesc(bearerToken, body, options = {}) {
|
2569
2497
|
if (body === null || body === void 0) {
|
@@ -6888,6 +6816,35 @@ var MezonApi = class {
|
|
6888
6816
|
)
|
6889
6817
|
]);
|
6890
6818
|
}
|
6819
|
+
/** */
|
6820
|
+
transferOwnership(bearerToken, body, options = {}) {
|
6821
|
+
if (body === null || body === void 0) {
|
6822
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6823
|
+
}
|
6824
|
+
const urlPath = "/v2/transfer/ownership";
|
6825
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6826
|
+
let bodyJson = "";
|
6827
|
+
bodyJson = JSON.stringify(body || {});
|
6828
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6829
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6830
|
+
if (bearerToken) {
|
6831
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6832
|
+
}
|
6833
|
+
return Promise.race([
|
6834
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6835
|
+
if (response.status == 204) {
|
6836
|
+
return response;
|
6837
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6838
|
+
return response.json();
|
6839
|
+
} else {
|
6840
|
+
throw response;
|
6841
|
+
}
|
6842
|
+
}),
|
6843
|
+
new Promise(
|
6844
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6845
|
+
)
|
6846
|
+
]);
|
6847
|
+
}
|
6891
6848
|
};
|
6892
6849
|
|
6893
6850
|
// session.ts
|
@@ -8939,17 +8896,6 @@ var Client = class {
|
|
8939
8896
|
});
|
8940
8897
|
});
|
8941
8898
|
}
|
8942
|
-
/** Get a clan desc profile */
|
8943
|
-
getClanDescProfile(session, clanId) {
|
8944
|
-
return __async(this, null, function* () {
|
8945
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8946
|
-
yield this.sessionRefresh(session);
|
8947
|
-
}
|
8948
|
-
return this.apiClient.getClanDescProfile(session.token, clanId).then((response) => {
|
8949
|
-
return Promise.resolve(response);
|
8950
|
-
});
|
8951
|
-
});
|
8952
|
-
}
|
8953
8899
|
getUserProfileOnClan(session, clanId) {
|
8954
8900
|
return __async(this, null, function* () {
|
8955
8901
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
@@ -9243,17 +9189,6 @@ var Client = class {
|
|
9243
9189
|
});
|
9244
9190
|
});
|
9245
9191
|
}
|
9246
|
-
/** Update fields in a given clan profile. */
|
9247
|
-
updateClanDescProfile(session, clanId, request) {
|
9248
|
-
return __async(this, null, function* () {
|
9249
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9250
|
-
yield this.sessionRefresh(session);
|
9251
|
-
}
|
9252
|
-
return this.apiClient.updateClanDescProfile(session.token, clanId, request).then((response) => {
|
9253
|
-
return response !== void 0;
|
9254
|
-
});
|
9255
|
-
});
|
9256
|
-
}
|
9257
9192
|
updateUserProfileByClan(session, clanId, request) {
|
9258
9193
|
return __async(this, null, function* () {
|
9259
9194
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
@@ -10722,4 +10657,14 @@ var Client = class {
|
|
10722
10657
|
});
|
10723
10658
|
});
|
10724
10659
|
}
|
10660
|
+
transferOwnership(session, req) {
|
10661
|
+
return __async(this, null, function* () {
|
10662
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10663
|
+
yield this.sessionRefresh(session);
|
10664
|
+
}
|
10665
|
+
return this.apiClient.transferOwnership(session.token, req).then((response) => {
|
10666
|
+
return response !== void 0;
|
10667
|
+
});
|
10668
|
+
});
|
10669
|
+
}
|
10725
10670
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2458,78 +2458,6 @@ var MezonApi = class {
|
|
2458
2458
|
)
|
2459
2459
|
]);
|
2460
2460
|
}
|
2461
|
-
/** Get a clan desc profile */
|
2462
|
-
getClanDescProfile(bearerToken, clanId, options = {}) {
|
2463
|
-
if (clanId === null || clanId === void 0) {
|
2464
|
-
throw new Error(
|
2465
|
-
"'clanId' is a required parameter but is null or undefined."
|
2466
|
-
);
|
2467
|
-
}
|
2468
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2469
|
-
"{clanId}",
|
2470
|
-
encodeURIComponent(String(clanId))
|
2471
|
-
);
|
2472
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2473
|
-
let bodyJson = "";
|
2474
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2475
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2476
|
-
if (bearerToken) {
|
2477
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2478
|
-
}
|
2479
|
-
return Promise.race([
|
2480
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2481
|
-
if (response.status == 204) {
|
2482
|
-
return response;
|
2483
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2484
|
-
return response.json();
|
2485
|
-
} else {
|
2486
|
-
throw response;
|
2487
|
-
}
|
2488
|
-
}),
|
2489
|
-
new Promise(
|
2490
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2491
|
-
)
|
2492
|
-
]);
|
2493
|
-
}
|
2494
|
-
/** Update fields in a given clan profile. */
|
2495
|
-
updateClanDescProfile(bearerToken, clanId, body, options = {}) {
|
2496
|
-
if (clanId === null || clanId === void 0) {
|
2497
|
-
throw new Error(
|
2498
|
-
"'clanId' is a required parameter but is null or undefined."
|
2499
|
-
);
|
2500
|
-
}
|
2501
|
-
if (body === null || body === void 0) {
|
2502
|
-
throw new Error(
|
2503
|
-
"'body' is a required parameter but is null or undefined."
|
2504
|
-
);
|
2505
|
-
}
|
2506
|
-
const urlPath = "/v2/clandescprofile/{clanId}".replace(
|
2507
|
-
"{clanId}",
|
2508
|
-
encodeURIComponent(String(clanId))
|
2509
|
-
);
|
2510
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2511
|
-
let bodyJson = "";
|
2512
|
-
bodyJson = JSON.stringify(body || {});
|
2513
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2514
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
2515
|
-
if (bearerToken) {
|
2516
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2517
|
-
}
|
2518
|
-
return Promise.race([
|
2519
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2520
|
-
if (response.status == 204) {
|
2521
|
-
return response;
|
2522
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2523
|
-
return response.json();
|
2524
|
-
} else {
|
2525
|
-
throw response;
|
2526
|
-
}
|
2527
|
-
}),
|
2528
|
-
new Promise(
|
2529
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2530
|
-
)
|
2531
|
-
]);
|
2532
|
-
}
|
2533
2461
|
/** */
|
2534
2462
|
createCategoryDesc(bearerToken, body, options = {}) {
|
2535
2463
|
if (body === null || body === void 0) {
|
@@ -6854,6 +6782,35 @@ var MezonApi = class {
|
|
6854
6782
|
)
|
6855
6783
|
]);
|
6856
6784
|
}
|
6785
|
+
/** */
|
6786
|
+
transferOwnership(bearerToken, body, options = {}) {
|
6787
|
+
if (body === null || body === void 0) {
|
6788
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
6789
|
+
}
|
6790
|
+
const urlPath = "/v2/transfer/ownership";
|
6791
|
+
const queryParams = /* @__PURE__ */ new Map();
|
6792
|
+
let bodyJson = "";
|
6793
|
+
bodyJson = JSON.stringify(body || {});
|
6794
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
6795
|
+
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
6796
|
+
if (bearerToken) {
|
6797
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
6798
|
+
}
|
6799
|
+
return Promise.race([
|
6800
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
6801
|
+
if (response.status == 204) {
|
6802
|
+
return response;
|
6803
|
+
} else if (response.status >= 200 && response.status < 300) {
|
6804
|
+
return response.json();
|
6805
|
+
} else {
|
6806
|
+
throw response;
|
6807
|
+
}
|
6808
|
+
}),
|
6809
|
+
new Promise(
|
6810
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
6811
|
+
)
|
6812
|
+
]);
|
6813
|
+
}
|
6857
6814
|
};
|
6858
6815
|
|
6859
6816
|
// session.ts
|
@@ -8905,17 +8862,6 @@ var Client = class {
|
|
8905
8862
|
});
|
8906
8863
|
});
|
8907
8864
|
}
|
8908
|
-
/** Get a clan desc profile */
|
8909
|
-
getClanDescProfile(session, clanId) {
|
8910
|
-
return __async(this, null, function* () {
|
8911
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
8912
|
-
yield this.sessionRefresh(session);
|
8913
|
-
}
|
8914
|
-
return this.apiClient.getClanDescProfile(session.token, clanId).then((response) => {
|
8915
|
-
return Promise.resolve(response);
|
8916
|
-
});
|
8917
|
-
});
|
8918
|
-
}
|
8919
8865
|
getUserProfileOnClan(session, clanId) {
|
8920
8866
|
return __async(this, null, function* () {
|
8921
8867
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
@@ -9209,17 +9155,6 @@ var Client = class {
|
|
9209
9155
|
});
|
9210
9156
|
});
|
9211
9157
|
}
|
9212
|
-
/** Update fields in a given clan profile. */
|
9213
|
-
updateClanDescProfile(session, clanId, request) {
|
9214
|
-
return __async(this, null, function* () {
|
9215
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
9216
|
-
yield this.sessionRefresh(session);
|
9217
|
-
}
|
9218
|
-
return this.apiClient.updateClanDescProfile(session.token, clanId, request).then((response) => {
|
9219
|
-
return response !== void 0;
|
9220
|
-
});
|
9221
|
-
});
|
9222
|
-
}
|
9223
9158
|
updateUserProfileByClan(session, clanId, request) {
|
9224
9159
|
return __async(this, null, function* () {
|
9225
9160
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
@@ -10688,6 +10623,16 @@ var Client = class {
|
|
10688
10623
|
});
|
10689
10624
|
});
|
10690
10625
|
}
|
10626
|
+
transferOwnership(session, req) {
|
10627
|
+
return __async(this, null, function* () {
|
10628
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10629
|
+
yield this.sessionRefresh(session);
|
10630
|
+
}
|
10631
|
+
return this.apiClient.transferOwnership(session.token, req).then((response) => {
|
10632
|
+
return response !== void 0;
|
10633
|
+
});
|
10634
|
+
});
|
10635
|
+
}
|
10691
10636
|
};
|
10692
10637
|
export {
|
10693
10638
|
ChannelStreamMode,
|