mezon-js 2.7.91 → 2.7.92
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 +45 -0
- package/client.ts +14 -1
- package/dist/api.gen.d.ts +5 -0
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +43 -0
- package/dist/mezon-js.esm.mjs +43 -0
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -29,6 +29,10 @@ export interface ClanUserListClanUser {
|
|
29
29
|
}
|
30
30
|
|
31
31
|
/** */
|
32
|
+
export interface MezonChangeChannelCategoryBody {
|
33
|
+
//
|
34
|
+
channel_id?: string;
|
35
|
+
}
|
32
36
|
|
33
37
|
|
34
38
|
/** Update fields in a given channel. */
|
@@ -5367,6 +5371,47 @@ export class MezonApi {
|
|
5367
5371
|
]);
|
5368
5372
|
}
|
5369
5373
|
|
5374
|
+
/** update the category of a channel */
|
5375
|
+
changeChannelCategory(bearerToken: string,
|
5376
|
+
newCategoryId:string,
|
5377
|
+
body:MezonChangeChannelCategoryBody,
|
5378
|
+
options: any = {}): Promise<any> {
|
5379
|
+
|
5380
|
+
if (newCategoryId === null || newCategoryId === undefined) {
|
5381
|
+
throw new Error("'newCategoryId' is a required parameter but is null or undefined.");
|
5382
|
+
}
|
5383
|
+
if (body === null || body === undefined) {
|
5384
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
5385
|
+
}
|
5386
|
+
const urlPath = "/v2/rolechannel/category/{newCategoryId}"
|
5387
|
+
.replace("{newCategoryId}", encodeURIComponent(String(newCategoryId)));
|
5388
|
+
const queryParams = new Map<string, any>();
|
5389
|
+
|
5390
|
+
let bodyJson : string = "";
|
5391
|
+
bodyJson = JSON.stringify(body || {});
|
5392
|
+
|
5393
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5394
|
+
const fetchOptions = buildFetchOptions("PATCH", options, bodyJson);
|
5395
|
+
if (bearerToken) {
|
5396
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
5397
|
+
}
|
5398
|
+
|
5399
|
+
return Promise.race([
|
5400
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
5401
|
+
if (response.status == 204) {
|
5402
|
+
return response;
|
5403
|
+
} else if (response.status >= 200 && response.status < 300) {
|
5404
|
+
return response.json();
|
5405
|
+
} else {
|
5406
|
+
throw response;
|
5407
|
+
}
|
5408
|
+
}),
|
5409
|
+
new Promise((_, reject) =>
|
5410
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
5411
|
+
),
|
5412
|
+
]);
|
5413
|
+
}
|
5414
|
+
|
5370
5415
|
/** Update a role when Delete a role by ID. */
|
5371
5416
|
deleteRoleChannelDesc(bearerToken: string,
|
5372
5417
|
body:ApiDeleteRoleRequest,
|
package/client.ts
CHANGED
@@ -106,6 +106,7 @@ import {
|
|
106
106
|
ApiClanStickerAddRequest,
|
107
107
|
ApiClanStickerListByClanIdResponse,
|
108
108
|
MezonUpdateClanStickerByIdBody,
|
109
|
+
MezonChangeChannelCategoryBody,
|
109
110
|
} from "./api.gen";
|
110
111
|
|
111
112
|
import { Session } from "./session";
|
@@ -2403,7 +2404,19 @@ async updateClanStickerById(session: Session,id: string,request: MezonUpdateClan
|
|
2403
2404
|
await this.sessionRefresh(session);
|
2404
2405
|
}
|
2405
2406
|
|
2406
|
-
return this.apiClient.updateClanStickerById(session.token, id,request).then((response: any) => {
|
2407
|
+
return this.apiClient.updateClanStickerById(session.token, id, request).then((response: any) => {
|
2408
|
+
return response !== undefined;
|
2409
|
+
})
|
2410
|
+
}
|
2411
|
+
|
2412
|
+
//** update the category of a channel */
|
2413
|
+
async changeChannelCategory(session: Session,id: string,request: MezonChangeChannelCategoryBody) {
|
2414
|
+
if (this.autoRefreshSession && session.refresh_token &&
|
2415
|
+
session.isexpired((Date.now() + this.expiredTimespanMs)/1000)) {
|
2416
|
+
await this.sessionRefresh(session);
|
2417
|
+
}
|
2418
|
+
|
2419
|
+
return this.apiClient.changeChannelCategory(session.token, id, request).then((response: any) => {
|
2407
2420
|
return response !== undefined;
|
2408
2421
|
})
|
2409
2422
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -13,6 +13,9 @@ export interface ClanUserListClanUser {
|
|
13
13
|
user?: ApiUser;
|
14
14
|
}
|
15
15
|
/** */
|
16
|
+
export interface MezonChangeChannelCategoryBody {
|
17
|
+
channel_id?: string;
|
18
|
+
}
|
16
19
|
/** Update fields in a given channel. */
|
17
20
|
export interface MezonUpdateChannelDescBody {
|
18
21
|
category_id?: string;
|
@@ -1144,6 +1147,8 @@ export declare class MezonApi {
|
|
1144
1147
|
createPinMessage(bearerToken: string, body: ApiPinMessageRequest, options?: any): Promise<any>;
|
1145
1148
|
/** */
|
1146
1149
|
addRolesChannelDesc(bearerToken: string, body: ApiAddRoleChannelDescRequest, options?: any): Promise<any>;
|
1150
|
+
/** update the category of a channel */
|
1151
|
+
changeChannelCategory(bearerToken: string, newCategoryId: string, body: MezonChangeChannelCategoryBody, options?: any): Promise<any>;
|
1147
1152
|
/** Update a role when Delete a role by ID. */
|
1148
1153
|
deleteRoleChannelDesc(bearerToken: string, body: ApiDeleteRoleRequest, options?: any): Promise<any>;
|
1149
1154
|
/** List user roles */
|
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, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiCreateWebhookRequest, ApiWebhookResponse, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiList, ApiClanEmojiCreateRequest, ApiChannelVoiceList, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, ApiClanStickerListByClanIdResponse, MezonUpdateClanStickerByIdBody } from "./api.gen";
|
16
|
+
import { ApiAccount, ApiAccountCustom, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiRoleList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiDeleteStorageObjectsRequest, ApiEvent, ApiReadStorageObjectsRequest, ApiStorageObjectAcks, ApiUpdateAccountRequest, ApiAccountApple, ApiLinkSteamRequest, ApiClanDescProfile, ApiClanProfile, ApiChannelUserList, ApiClanUserList, ApiLinkInviteUserRequest, ApiUpdateEventRequest, ApiLinkInviteUser, ApiInviteUserRes, ApiUploadAttachmentRequest, ApiUploadAttachment, ApiMessageReaction, ApiMessageMention, ApiMessageAttachment, ApiMessageRef, ApiChannelMessageHeader, ApiVoiceChannelUserList, ApiChannelAttachmentList, ApiCreateEventRequest, ApiEventManagement, ApiEventList, ApiDeleteEventRequest, ApiNotificationChannelCategoySettingsList, ApiNotificationSetting, ApiSetDefaultNotificationRequest, ApiNotificationUserChannel, ApiSetNotificationRequest, ApiNotifiReactMessage, ApiSetMuteNotificationRequest, ApiSearchMessageRequest, ApiSearchMessageResponse, ApiPinMessageRequest, ApiPinMessagesList, ApiCreateWebhookRequest, ApiWebhookResponse, ApiDeleteChannelDescRequest, ApiChangeChannelPrivateRequest, ApiClanEmojiList, ApiClanEmojiCreateRequest, ApiChannelVoiceList, MezonUpdateClanEmojiByIdBody, ApiWebhookCreateRequest, ApiWebhookListResponse, MezonUpdateWebhookByIdBody, ApiWebhookGenerateResponse, ApiCheckDuplicateClanNameResponse, ApiClanStickerAddRequest, ApiClanStickerListByClanIdResponse, MezonUpdateClanStickerByIdBody, MezonChangeChannelCategoryBody } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -596,4 +596,5 @@ export declare class Client {
|
|
596
596
|
listClanStickersByClanId(session: Session, id: string): Promise<ApiClanStickerListByClanIdResponse>;
|
597
597
|
deleteClanStickerById(session: Session, id: string): Promise<boolean>;
|
598
598
|
updateClanStickerById(session: Session, id: string, request: MezonUpdateClanStickerByIdBody): Promise<boolean>;
|
599
|
+
changeChannelCategory(session: Session, id: string, request: MezonChangeChannelCategoryBody): Promise<boolean>;
|
599
600
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -3585,6 +3585,38 @@ var MezonApi = class {
|
|
3585
3585
|
)
|
3586
3586
|
]);
|
3587
3587
|
}
|
3588
|
+
/** update the category of a channel */
|
3589
|
+
changeChannelCategory(bearerToken, newCategoryId, body, options = {}) {
|
3590
|
+
if (newCategoryId === null || newCategoryId === void 0) {
|
3591
|
+
throw new Error("'newCategoryId' is a required parameter but is null or undefined.");
|
3592
|
+
}
|
3593
|
+
if (body === null || body === void 0) {
|
3594
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
3595
|
+
}
|
3596
|
+
const urlPath = "/v2/rolechannel/category/{newCategoryId}".replace("{newCategoryId}", encodeURIComponent(String(newCategoryId)));
|
3597
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3598
|
+
let bodyJson = "";
|
3599
|
+
bodyJson = JSON.stringify(body || {});
|
3600
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3601
|
+
const fetchOptions = buildFetchOptions("PATCH", options, bodyJson);
|
3602
|
+
if (bearerToken) {
|
3603
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3604
|
+
}
|
3605
|
+
return Promise.race([
|
3606
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3607
|
+
if (response.status == 204) {
|
3608
|
+
return response;
|
3609
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3610
|
+
return response.json();
|
3611
|
+
} else {
|
3612
|
+
throw response;
|
3613
|
+
}
|
3614
|
+
}),
|
3615
|
+
new Promise(
|
3616
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3617
|
+
)
|
3618
|
+
]);
|
3619
|
+
}
|
3588
3620
|
/** Update a role when Delete a role by ID. */
|
3589
3621
|
deleteRoleChannelDesc(bearerToken, body, options = {}) {
|
3590
3622
|
if (body === null || body === void 0) {
|
@@ -6882,4 +6914,15 @@ var Client = class {
|
|
6882
6914
|
});
|
6883
6915
|
});
|
6884
6916
|
}
|
6917
|
+
//** update the category of a channel */
|
6918
|
+
changeChannelCategory(session, id, request) {
|
6919
|
+
return __async(this, null, function* () {
|
6920
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6921
|
+
yield this.sessionRefresh(session);
|
6922
|
+
}
|
6923
|
+
return this.apiClient.changeChannelCategory(session.token, id, request).then((response) => {
|
6924
|
+
return response !== void 0;
|
6925
|
+
});
|
6926
|
+
});
|
6927
|
+
}
|
6885
6928
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -3556,6 +3556,38 @@ var MezonApi = class {
|
|
3556
3556
|
)
|
3557
3557
|
]);
|
3558
3558
|
}
|
3559
|
+
/** update the category of a channel */
|
3560
|
+
changeChannelCategory(bearerToken, newCategoryId, body, options = {}) {
|
3561
|
+
if (newCategoryId === null || newCategoryId === void 0) {
|
3562
|
+
throw new Error("'newCategoryId' is a required parameter but is null or undefined.");
|
3563
|
+
}
|
3564
|
+
if (body === null || body === void 0) {
|
3565
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
3566
|
+
}
|
3567
|
+
const urlPath = "/v2/rolechannel/category/{newCategoryId}".replace("{newCategoryId}", encodeURIComponent(String(newCategoryId)));
|
3568
|
+
const queryParams = /* @__PURE__ */ new Map();
|
3569
|
+
let bodyJson = "";
|
3570
|
+
bodyJson = JSON.stringify(body || {});
|
3571
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3572
|
+
const fetchOptions = buildFetchOptions("PATCH", options, bodyJson);
|
3573
|
+
if (bearerToken) {
|
3574
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
3575
|
+
}
|
3576
|
+
return Promise.race([
|
3577
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
3578
|
+
if (response.status == 204) {
|
3579
|
+
return response;
|
3580
|
+
} else if (response.status >= 200 && response.status < 300) {
|
3581
|
+
return response.json();
|
3582
|
+
} else {
|
3583
|
+
throw response;
|
3584
|
+
}
|
3585
|
+
}),
|
3586
|
+
new Promise(
|
3587
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
3588
|
+
)
|
3589
|
+
]);
|
3590
|
+
}
|
3559
3591
|
/** Update a role when Delete a role by ID. */
|
3560
3592
|
deleteRoleChannelDesc(bearerToken, body, options = {}) {
|
3561
3593
|
if (body === null || body === void 0) {
|
@@ -6853,6 +6885,17 @@ var Client = class {
|
|
6853
6885
|
});
|
6854
6886
|
});
|
6855
6887
|
}
|
6888
|
+
//** update the category of a channel */
|
6889
|
+
changeChannelCategory(session, id, request) {
|
6890
|
+
return __async(this, null, function* () {
|
6891
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6892
|
+
yield this.sessionRefresh(session);
|
6893
|
+
}
|
6894
|
+
return this.apiClient.changeChannelCategory(session.token, id, request).then((response) => {
|
6895
|
+
return response !== void 0;
|
6896
|
+
});
|
6897
|
+
});
|
6898
|
+
}
|
6856
6899
|
};
|
6857
6900
|
export {
|
6858
6901
|
ChannelStreamMode,
|