mezon-js 2.11.33 → 2.11.34
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 +11 -39
- package/client.ts +0 -17
- package/dist/api.gen.d.ts +6 -4
- package/dist/client.d.ts +1 -2
- package/dist/mezon-js.cjs.js +0 -39
- package/dist/mezon-js.esm.mjs +0 -39
- package/package.json +1 -1
package/api.gen.ts
CHANGED
@@ -98,16 +98,22 @@ export interface MezonUpdateCategoryBody {
|
|
98
98
|
|
99
99
|
/** */
|
100
100
|
export interface ApiAddAppRequest {
|
101
|
+
//
|
102
|
+
about_me?: string;
|
103
|
+
//
|
104
|
+
app_logo?: string;
|
105
|
+
//App url.
|
106
|
+
app_url?: string;
|
101
107
|
//The appname.
|
102
108
|
appname?: string;
|
103
109
|
//Creator of the app.
|
104
110
|
creator_id?: string;
|
111
|
+
//Is shadow.
|
112
|
+
is_shadow?: boolean;
|
105
113
|
//Role of this app.
|
106
|
-
role?:
|
114
|
+
role?: number;
|
107
115
|
//The password.
|
108
116
|
token?: string;
|
109
|
-
//Is shadow.
|
110
|
-
is_shadow?: boolean;
|
111
117
|
}
|
112
118
|
|
113
119
|
/**
|
@@ -483,6 +489,8 @@ export interface ApiApp {
|
|
483
489
|
//
|
484
490
|
about?: string;
|
485
491
|
//
|
492
|
+
app_url?: string;
|
493
|
+
//
|
486
494
|
applogo?: string;
|
487
495
|
//
|
488
496
|
appname?: string;
|
@@ -11641,40 +11649,4 @@ export class MezonApi {
|
|
11641
11649
|
),
|
11642
11650
|
]);
|
11643
11651
|
}
|
11644
|
-
|
11645
|
-
/** Add a new apps. */
|
11646
|
-
addChannelApp(bearerToken: string,
|
11647
|
-
body:ApiAddChannelAppRequest,
|
11648
|
-
options: any = {}): Promise<any> {
|
11649
|
-
|
11650
|
-
if (body === null || body === undefined) {
|
11651
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
11652
|
-
}
|
11653
|
-
const urlPath = "/v2/channelapp/add";
|
11654
|
-
const queryParams = new Map<string, any>();
|
11655
|
-
|
11656
|
-
let bodyJson : string = "";
|
11657
|
-
bodyJson = JSON.stringify(body || {});
|
11658
|
-
|
11659
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11660
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
11661
|
-
if (bearerToken) {
|
11662
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11663
|
-
}
|
11664
|
-
|
11665
|
-
return Promise.race([
|
11666
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
11667
|
-
if (response.status == 204) {
|
11668
|
-
return response;
|
11669
|
-
} else if (response.status >= 200 && response.status < 300) {
|
11670
|
-
return response.json();
|
11671
|
-
} else {
|
11672
|
-
throw response;
|
11673
|
-
}
|
11674
|
-
}),
|
11675
|
-
new Promise((_, reject) =>
|
11676
|
-
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11677
|
-
),
|
11678
|
-
]);
|
11679
|
-
}
|
11680
11652
|
}
|
package/client.ts
CHANGED
@@ -169,7 +169,6 @@ import {
|
|
169
169
|
ApiUpdateRoleOrderRequest,
|
170
170
|
ApiGenerateMezonMeetResponse,
|
171
171
|
ApiGenerateMeetTokenExternalResponse,
|
172
|
-
ApiAddChannelAppRequest,
|
173
172
|
} from "./api.gen";
|
174
173
|
|
175
174
|
import { Session } from "./session";
|
@@ -3507,22 +3506,6 @@ export class Client {
|
|
3507
3506
|
});
|
3508
3507
|
}
|
3509
3508
|
|
3510
|
-
async addChannelApp(session: Session, request: ApiAddChannelAppRequest): Promise<boolean> {
|
3511
|
-
if (
|
3512
|
-
this.autoRefreshSession &&
|
3513
|
-
session.refresh_token &&
|
3514
|
-
session.isexpired(Date.now() / 1000)
|
3515
|
-
) {
|
3516
|
-
await this.sessionRefresh(session);
|
3517
|
-
}
|
3518
|
-
|
3519
|
-
return this.apiClient
|
3520
|
-
.addChannelApp(session.token, request)
|
3521
|
-
.then((response: any) => {
|
3522
|
-
return response !== undefined;
|
3523
|
-
});
|
3524
|
-
}
|
3525
|
-
|
3526
3509
|
async getSystemMessagesList(
|
3527
3510
|
session: Session
|
3528
3511
|
): Promise<ApiSystemMessagesList> {
|
package/dist/api.gen.d.ts
CHANGED
@@ -55,11 +55,14 @@ export interface MezonUpdateCategoryBody {
|
|
55
55
|
}
|
56
56
|
/** */
|
57
57
|
export interface ApiAddAppRequest {
|
58
|
+
about_me?: string;
|
59
|
+
app_logo?: string;
|
60
|
+
app_url?: string;
|
58
61
|
appname?: string;
|
59
62
|
creator_id?: string;
|
60
|
-
role?: ApiAppRole;
|
61
|
-
token?: string;
|
62
63
|
is_shadow?: boolean;
|
64
|
+
role?: number;
|
65
|
+
token?: string;
|
63
66
|
}
|
64
67
|
/**
|
65
68
|
* - USER_ROLE_ADMIN: All access
|
@@ -282,6 +285,7 @@ export interface ApiAllUserClans {
|
|
282
285
|
/** App information. */
|
283
286
|
export interface ApiApp {
|
284
287
|
about?: string;
|
288
|
+
app_url?: string;
|
285
289
|
applogo?: string;
|
286
290
|
appname?: string;
|
287
291
|
creator_id?: string;
|
@@ -2254,6 +2258,4 @@ export declare class MezonApi {
|
|
2254
2258
|
generateMeetTokenExternal(bearerToken: string, token: string, displayName?: string, isGuest?: boolean, options?: any): Promise<ApiGenerateMeetTokenExternalResponse>;
|
2255
2259
|
/** List channels detail */
|
2256
2260
|
listChannelDetail(bearerToken: string, channelId: string, options?: any): Promise<ApiChannelDescription>;
|
2257
|
-
/** Add a new apps. */
|
2258
|
-
addChannelApp(bearerToken: string, body: ApiAddChannelAppRequest, options?: any): Promise<any>;
|
2259
2261
|
}
|
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, ApiUpdateRoleOrderRequest, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse
|
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, ApiGenerateMezonMeetResponse, ApiGenerateMeetTokenExternalResponse } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -566,7 +566,6 @@ export declare class Client {
|
|
566
566
|
getApp(session: Session, id: string): Promise<ApiApp>;
|
567
567
|
listApps(session: Session): Promise<ApiAppList>;
|
568
568
|
addAppToClan(session: Session, appId: string, clanId: string): Promise<boolean>;
|
569
|
-
addChannelApp(session: Session, request: ApiAddChannelAppRequest): Promise<boolean>;
|
570
569
|
getSystemMessagesList(session: Session): Promise<ApiSystemMessagesList>;
|
571
570
|
getSystemMessageByClanId(session: Session, clanId: string): Promise<ApiSystemMessage>;
|
572
571
|
createSystemMessage(session: Session, request: ApiSystemMessageRequest): Promise<any>;
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -7336,35 +7336,6 @@ var MezonApi = class {
|
|
7336
7336
|
)
|
7337
7337
|
]);
|
7338
7338
|
}
|
7339
|
-
/** Add a new apps. */
|
7340
|
-
addChannelApp(bearerToken, body, options = {}) {
|
7341
|
-
if (body === null || body === void 0) {
|
7342
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
7343
|
-
}
|
7344
|
-
const urlPath = "/v2/channelapp/add";
|
7345
|
-
const queryParams = /* @__PURE__ */ new Map();
|
7346
|
-
let bodyJson = "";
|
7347
|
-
bodyJson = JSON.stringify(body || {});
|
7348
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7349
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
7350
|
-
if (bearerToken) {
|
7351
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7352
|
-
}
|
7353
|
-
return Promise.race([
|
7354
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
7355
|
-
if (response.status == 204) {
|
7356
|
-
return response;
|
7357
|
-
} else if (response.status >= 200 && response.status < 300) {
|
7358
|
-
return response.json();
|
7359
|
-
} else {
|
7360
|
-
throw response;
|
7361
|
-
}
|
7362
|
-
}),
|
7363
|
-
new Promise(
|
7364
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7365
|
-
)
|
7366
|
-
]);
|
7367
|
-
}
|
7368
7339
|
};
|
7369
7340
|
|
7370
7341
|
// session.ts
|
@@ -10359,16 +10330,6 @@ var Client = class {
|
|
10359
10330
|
});
|
10360
10331
|
});
|
10361
10332
|
}
|
10362
|
-
addChannelApp(session, request) {
|
10363
|
-
return __async(this, null, function* () {
|
10364
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10365
|
-
yield this.sessionRefresh(session);
|
10366
|
-
}
|
10367
|
-
return this.apiClient.addChannelApp(session.token, request).then((response) => {
|
10368
|
-
return response !== void 0;
|
10369
|
-
});
|
10370
|
-
});
|
10371
|
-
}
|
10372
10333
|
getSystemMessagesList(session) {
|
10373
10334
|
return __async(this, null, function* () {
|
10374
10335
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7302,35 +7302,6 @@ var MezonApi = class {
|
|
7302
7302
|
)
|
7303
7303
|
]);
|
7304
7304
|
}
|
7305
|
-
/** Add a new apps. */
|
7306
|
-
addChannelApp(bearerToken, body, options = {}) {
|
7307
|
-
if (body === null || body === void 0) {
|
7308
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
7309
|
-
}
|
7310
|
-
const urlPath = "/v2/channelapp/add";
|
7311
|
-
const queryParams = /* @__PURE__ */ new Map();
|
7312
|
-
let bodyJson = "";
|
7313
|
-
bodyJson = JSON.stringify(body || {});
|
7314
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7315
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
7316
|
-
if (bearerToken) {
|
7317
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7318
|
-
}
|
7319
|
-
return Promise.race([
|
7320
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
7321
|
-
if (response.status == 204) {
|
7322
|
-
return response;
|
7323
|
-
} else if (response.status >= 200 && response.status < 300) {
|
7324
|
-
return response.json();
|
7325
|
-
} else {
|
7326
|
-
throw response;
|
7327
|
-
}
|
7328
|
-
}),
|
7329
|
-
new Promise(
|
7330
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7331
|
-
)
|
7332
|
-
]);
|
7333
|
-
}
|
7334
7305
|
};
|
7335
7306
|
|
7336
7307
|
// session.ts
|
@@ -10325,16 +10296,6 @@ var Client = class {
|
|
10325
10296
|
});
|
10326
10297
|
});
|
10327
10298
|
}
|
10328
|
-
addChannelApp(session, request) {
|
10329
|
-
return __async(this, null, function* () {
|
10330
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|
10331
|
-
yield this.sessionRefresh(session);
|
10332
|
-
}
|
10333
|
-
return this.apiClient.addChannelApp(session.token, request).then((response) => {
|
10334
|
-
return response !== void 0;
|
10335
|
-
});
|
10336
|
-
});
|
10337
|
-
}
|
10338
10299
|
getSystemMessagesList(session) {
|
10339
10300
|
return __async(this, null, function* () {
|
10340
10301
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired(Date.now() / 1e3)) {
|