mezon-js 2.11.21 → 2.11.22
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 +56 -0
- package/client.ts +21 -0
- package/dist/api.gen.d.ts +14 -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
@@ -1217,6 +1217,8 @@ export interface ApiCreateRoleRequest {
|
|
1217
1217
|
role_icon?: string;
|
1218
1218
|
//
|
1219
1219
|
title?: string;
|
1220
|
+
//
|
1221
|
+
order_role?: number;
|
1220
1222
|
}
|
1221
1223
|
|
1222
1224
|
/** Delete a channel the user has access to. */
|
@@ -2095,6 +2097,22 @@ export interface ApiRegistrationEmailRequest {
|
|
2095
2097
|
vars?: Record<string, string>;
|
2096
2098
|
}
|
2097
2099
|
|
2100
|
+
/** */
|
2101
|
+
export interface ApiUpdateRoleOrderRequest {
|
2102
|
+
//
|
2103
|
+
clan_id?: string;
|
2104
|
+
//
|
2105
|
+
roles?: Array<ApiRoleOrderUpdate>;
|
2106
|
+
}
|
2107
|
+
|
2108
|
+
/** */
|
2109
|
+
export interface ApiRoleOrderUpdate {
|
2110
|
+
//
|
2111
|
+
order?: number;
|
2112
|
+
//
|
2113
|
+
role_id?: string;
|
2114
|
+
}
|
2115
|
+
|
2098
2116
|
/** */
|
2099
2117
|
export interface ApiRole {
|
2100
2118
|
//
|
@@ -2129,6 +2147,8 @@ export interface ApiRole {
|
|
2129
2147
|
slug?: string;
|
2130
2148
|
//
|
2131
2149
|
title?: string;
|
2150
|
+
//
|
2151
|
+
order_role ?: number;
|
2132
2152
|
}
|
2133
2153
|
|
2134
2154
|
/** A list of role description, usually a result of a list operation. */
|
@@ -11431,4 +11451,40 @@ export class MezonApi {
|
|
11431
11451
|
),
|
11432
11452
|
]);
|
11433
11453
|
}
|
11454
|
+
|
11455
|
+
/** */
|
11456
|
+
updateRoleOrder(bearerToken: string,
|
11457
|
+
body:ApiUpdateRoleOrderRequest,
|
11458
|
+
options: any = {}): Promise<any> {
|
11459
|
+
|
11460
|
+
if (body === null || body === undefined) {
|
11461
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
11462
|
+
}
|
11463
|
+
const urlPath = "/v2/role/orders";
|
11464
|
+
const queryParams = new Map<string, any>();
|
11465
|
+
|
11466
|
+
let bodyJson : string = "";
|
11467
|
+
bodyJson = JSON.stringify(body || {});
|
11468
|
+
|
11469
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11470
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
11471
|
+
if (bearerToken) {
|
11472
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11473
|
+
}
|
11474
|
+
|
11475
|
+
return Promise.race([
|
11476
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11477
|
+
if (response.status == 204) {
|
11478
|
+
return response;
|
11479
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11480
|
+
return response.json();
|
11481
|
+
} else {
|
11482
|
+
throw response;
|
11483
|
+
}
|
11484
|
+
}),
|
11485
|
+
new Promise((_, reject) =>
|
11486
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11487
|
+
),
|
11488
|
+
]);
|
11489
|
+
}
|
11434
11490
|
}
|
package/client.ts
CHANGED
@@ -166,6 +166,7 @@ import {
|
|
166
166
|
ApiCreateHashChannelAppsResponse,
|
167
167
|
MezonapiEmojiRecentList,
|
168
168
|
ApiUserEventRequest,
|
169
|
+
ApiUpdateRoleOrderRequest,
|
169
170
|
} from "./api.gen";
|
170
171
|
|
171
172
|
import { Session } from "./session";
|
@@ -5137,4 +5138,24 @@ export class Client {
|
|
5137
5138
|
return response !== undefined;
|
5138
5139
|
});
|
5139
5140
|
}
|
5141
|
+
|
5142
|
+
async updateRoleOrder(
|
5143
|
+
session: Session,
|
5144
|
+
request: ApiUpdateRoleOrderRequest
|
5145
|
+
): Promise<any> {
|
5146
|
+
if (
|
5147
|
+
this.autoRefreshSession &&
|
5148
|
+
session.refresh_token &&
|
5149
|
+
session.isexpired(Date.now() / 1000)
|
5150
|
+
) {
|
5151
|
+
await this.sessionRefresh(session);
|
5152
|
+
}
|
5153
|
+
|
5154
|
+
return this.apiClient
|
5155
|
+
.updateRoleOrder(session.token, request)
|
5156
|
+
.then((response: any) => {
|
5157
|
+
return Promise.resolve(response);
|
5158
|
+
});
|
5159
|
+
}
|
5160
|
+
|
5140
5161
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -692,6 +692,7 @@ export interface ApiCreateRoleRequest {
|
|
692
692
|
max_permission_id: string;
|
693
693
|
role_icon?: string;
|
694
694
|
title?: string;
|
695
|
+
order_role?: number;
|
695
696
|
}
|
696
697
|
/** Delete a channel the user has access to. */
|
697
698
|
export interface ApiDeleteChannelDescRequest {
|
@@ -1205,6 +1206,16 @@ export interface ApiRegistrationEmailRequest {
|
|
1205
1206
|
vars?: Record<string, string>;
|
1206
1207
|
}
|
1207
1208
|
/** */
|
1209
|
+
export interface ApiUpdateRoleOrderRequest {
|
1210
|
+
clan_id?: string;
|
1211
|
+
roles?: Array<ApiRoleOrderUpdate>;
|
1212
|
+
}
|
1213
|
+
/** */
|
1214
|
+
export interface ApiRoleOrderUpdate {
|
1215
|
+
order?: number;
|
1216
|
+
role_id?: string;
|
1217
|
+
}
|
1218
|
+
/** */
|
1208
1219
|
export interface ApiRole {
|
1209
1220
|
active?: number;
|
1210
1221
|
allow_mention?: number;
|
@@ -1222,6 +1233,7 @@ export interface ApiRole {
|
|
1222
1233
|
role_user_list?: ApiRoleUserList;
|
1223
1234
|
slug?: string;
|
1224
1235
|
title?: string;
|
1236
|
+
order_role?: number;
|
1225
1237
|
}
|
1226
1238
|
/** A list of role description, usually a result of a list operation. */
|
1227
1239
|
export interface ApiRoleList {
|
@@ -2207,4 +2219,6 @@ export declare class MezonApi {
|
|
2207
2219
|
addUserEvent(bearerToken: string, body: ApiUserEventRequest, options?: any): Promise<any>;
|
2208
2220
|
/** Delete user event */
|
2209
2221
|
deleteUserEvent(bearerToken: string, clanId?: string, eventId?: string, options?: any): Promise<any>;
|
2222
|
+
/** */
|
2223
|
+
updateRoleOrder(bearerToken: string, body: ApiUpdateRoleOrderRequest, options?: any): Promise<any>;
|
2210
2224
|
}
|
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, ApiAccountDevice, ApiAccountEmail, ApiAccountFacebook, ApiAccountFacebookInstantGame, ApiAccountGoogle, ApiAccountGameCenter, ApiAccountSteam, ApiChannelDescList, ApiChannelDescription, ApiCreateChannelDescRequest, ApiDeleteRoleRequest, ApiClanDescList, ApiCreateClanDescRequest, ApiClanDesc, ApiCategoryDesc, ApiCategoryDescList, ApiPermissionList, ApiRoleUserList, ApiRole, ApiCreateRoleRequest, ApiAddRoleChannelDescRequest, ApiCreateCategoryDescRequest, ApiUpdateCategoryDescRequest, ApiEvent, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, MezonapiEmojiRecentList, ApiUserEventRequest } 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, ApiNotificationList, ApiUpdateAccountRequest, ApiSession, 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, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse, MezonapiEmojiRecentList, ApiUserEventRequest, ApiUpdateRoleOrderRequest } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -653,4 +653,5 @@ export declare class Client {
|
|
653
653
|
addUserEvent(session: Session, request: ApiUserEventRequest): Promise<any>;
|
654
654
|
/** Delete user event */
|
655
655
|
deleteUserEvent(session: Session, clanId?: string, eventId?: string): Promise<any>;
|
656
|
+
updateRoleOrder(session: Session, request: ApiUpdateRoleOrderRequest): Promise<any>;
|
656
657
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -7224,6 +7224,35 @@ var MezonApi = class {
|
|
7224
7224
|
)
|
7225
7225
|
]);
|
7226
7226
|
}
|
7227
|
+
/** */
|
7228
|
+
updateRoleOrder(bearerToken, body, options = {}) {
|
7229
|
+
if (body === null || body === void 0) {
|
7230
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
7231
|
+
}
|
7232
|
+
const urlPath = "/v2/role/orders";
|
7233
|
+
const queryParams = /* @__PURE__ */ new Map();
|
7234
|
+
let bodyJson = "";
|
7235
|
+
bodyJson = JSON.stringify(body || {});
|
7236
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7237
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
7238
|
+
if (bearerToken) {
|
7239
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7240
|
+
}
|
7241
|
+
return Promise.race([
|
7242
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
7243
|
+
if (response.status == 204) {
|
7244
|
+
return response;
|
7245
|
+
} else if (response.status >= 200 && response.status < 300) {
|
7246
|
+
return response.json();
|
7247
|
+
} else {
|
7248
|
+
throw response;
|
7249
|
+
}
|
7250
|
+
}),
|
7251
|
+
new Promise(
|
7252
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7253
|
+
)
|
7254
|
+
]);
|
7255
|
+
}
|
7227
7256
|
};
|
7228
7257
|
|
7229
7258
|
// session.ts
|
@@ -11133,4 +11162,14 @@ var Client = class {
|
|
11133
11162
|
});
|
11134
11163
|
});
|
11135
11164
|
}
|
11165
|
+
updateRoleOrder(session, request) {
|
11166
|
+
return __async(this, null, function* () {
|
11167
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
11168
|
+
yield this.sessionRefresh(session);
|
11169
|
+
}
|
11170
|
+
return this.apiClient.updateRoleOrder(session.token, request).then((response) => {
|
11171
|
+
return Promise.resolve(response);
|
11172
|
+
});
|
11173
|
+
});
|
11174
|
+
}
|
11136
11175
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7190,6 +7190,35 @@ var MezonApi = class {
|
|
7190
7190
|
)
|
7191
7191
|
]);
|
7192
7192
|
}
|
7193
|
+
/** */
|
7194
|
+
updateRoleOrder(bearerToken, body, options = {}) {
|
7195
|
+
if (body === null || body === void 0) {
|
7196
|
+
throw new Error("'body' is a required parameter but is null or undefined.");
|
7197
|
+
}
|
7198
|
+
const urlPath = "/v2/role/orders";
|
7199
|
+
const queryParams = /* @__PURE__ */ new Map();
|
7200
|
+
let bodyJson = "";
|
7201
|
+
bodyJson = JSON.stringify(body || {});
|
7202
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7203
|
+
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
7204
|
+
if (bearerToken) {
|
7205
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7206
|
+
}
|
7207
|
+
return Promise.race([
|
7208
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
7209
|
+
if (response.status == 204) {
|
7210
|
+
return response;
|
7211
|
+
} else if (response.status >= 200 && response.status < 300) {
|
7212
|
+
return response.json();
|
7213
|
+
} else {
|
7214
|
+
throw response;
|
7215
|
+
}
|
7216
|
+
}),
|
7217
|
+
new Promise(
|
7218
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7219
|
+
)
|
7220
|
+
]);
|
7221
|
+
}
|
7193
7222
|
};
|
7194
7223
|
|
7195
7224
|
// session.ts
|
@@ -11099,6 +11128,16 @@ var Client = class {
|
|
11099
11128
|
});
|
11100
11129
|
});
|
11101
11130
|
}
|
11131
|
+
updateRoleOrder(session, request) {
|
11132
|
+
return __async(this, null, function* () {
|
11133
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
11134
|
+
yield this.sessionRefresh(session);
|
11135
|
+
}
|
11136
|
+
return this.apiClient.updateRoleOrder(session.token, request).then((response) => {
|
11137
|
+
return Promise.resolve(response);
|
11138
|
+
});
|
11139
|
+
});
|
11140
|
+
}
|
11102
11141
|
};
|
11103
11142
|
export {
|
11104
11143
|
ChannelStreamMode,
|