mezon-js 2.10.95 → 2.10.97
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 +43 -0
- package/client.ts +21 -0
- package/dist/api.gen.d.ts +8 -0
- package/dist/client.d.ts +2 -1
- package/dist/mezon-js.cjs.js +44 -0
- package/dist/mezon-js.esm.mjs +44 -0
- package/dist/socket.d.ts +14 -0
- package/package.json +1 -1
- package/socket.ts +32 -0
package/api.gen.ts
CHANGED
@@ -691,6 +691,8 @@ export interface ApiEditChannelCanvasRequest {
|
|
691
691
|
is_default?: boolean;
|
692
692
|
//
|
693
693
|
title?: string;
|
694
|
+
//
|
695
|
+
status?: number;
|
694
696
|
}
|
695
697
|
|
696
698
|
/** */
|
@@ -3064,6 +3066,14 @@ export interface ApiMezonOauthClient {
|
|
3064
3066
|
userinfo_signed_response_alg?: string;
|
3065
3067
|
}
|
3066
3068
|
|
3069
|
+
/** */
|
3070
|
+
export interface ApiCreateHashChannelAppsResponse {
|
3071
|
+
//
|
3072
|
+
hash?: string;
|
3073
|
+
//
|
3074
|
+
user_id?: string;
|
3075
|
+
}
|
3076
|
+
|
3067
3077
|
export class MezonApi {
|
3068
3078
|
constructor(
|
3069
3079
|
readonly serverKey: string,
|
@@ -11279,4 +11289,37 @@ export class MezonApi {
|
|
11279
11289
|
),
|
11280
11290
|
]);
|
11281
11291
|
}
|
11292
|
+
/** */
|
11293
|
+
generateHashChannelApps(bearerToken: string,
|
11294
|
+
appId?:string,
|
11295
|
+
options: any = {}
|
11296
|
+
): Promise<ApiCreateHashChannelAppsResponse> {
|
11297
|
+
|
11298
|
+
const urlPath = "/v2/channel-apps/hash";
|
11299
|
+
const queryParams = new Map<string, any>();
|
11300
|
+
queryParams.set("app_id", appId);
|
11301
|
+
|
11302
|
+
let bodyJson : string = "";
|
11303
|
+
|
11304
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
11305
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
11306
|
+
if (bearerToken) {
|
11307
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
11308
|
+
}
|
11309
|
+
|
11310
|
+
return Promise.race([
|
11311
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
11312
|
+
if (response.status == 204) {
|
11313
|
+
return response;
|
11314
|
+
} else if (response.status >= 200 && response.status < 300) {
|
11315
|
+
return response.json();
|
11316
|
+
} else {
|
11317
|
+
throw response;
|
11318
|
+
}
|
11319
|
+
}),
|
11320
|
+
new Promise((_, reject) =>
|
11321
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
11322
|
+
),
|
11323
|
+
]);
|
11324
|
+
}
|
11282
11325
|
}
|
package/client.ts
CHANGED
@@ -164,6 +164,7 @@ import {
|
|
164
164
|
ApiHandleParticipantMeetStateRequest,
|
165
165
|
ApiMezonOauthClientList,
|
166
166
|
ApiMezonOauthClient,
|
167
|
+
ApiCreateHashChannelAppsResponse,
|
167
168
|
} from "./api.gen";
|
168
169
|
|
169
170
|
import { Session } from "./session";
|
@@ -5012,4 +5013,24 @@ export class Client {
|
|
5012
5013
|
return Promise.resolve(response);
|
5013
5014
|
});
|
5014
5015
|
}
|
5016
|
+
|
5017
|
+
//**Generate Hash */
|
5018
|
+
async generateHashChannelApps(
|
5019
|
+
session: Session,
|
5020
|
+
appId?:string,
|
5021
|
+
): Promise<ApiCreateHashChannelAppsResponse> {
|
5022
|
+
if (
|
5023
|
+
this.autoRefreshSession &&
|
5024
|
+
session.refresh_token &&
|
5025
|
+
session.isexpired((Date.now() + this.expiredTimespanMs) / 1000)
|
5026
|
+
) {
|
5027
|
+
await this.sessionRefresh(session);
|
5028
|
+
}
|
5029
|
+
|
5030
|
+
return this.apiClient
|
5031
|
+
.generateHashChannelApps(session.token, appId)
|
5032
|
+
.then((response: ApiCreateHashChannelAppsResponse) => {
|
5033
|
+
return Promise.resolve(response);
|
5034
|
+
});
|
5035
|
+
}
|
5015
5036
|
}
|
package/dist/api.gen.d.ts
CHANGED
@@ -402,6 +402,7 @@ export interface ApiEditChannelCanvasRequest {
|
|
402
402
|
id?: string;
|
403
403
|
is_default?: boolean;
|
404
404
|
title?: string;
|
405
|
+
status?: number;
|
405
406
|
}
|
406
407
|
/** */
|
407
408
|
export interface ApiEditChannelCanvasResponse {
|
@@ -1760,6 +1761,11 @@ export interface ApiMezonOauthClient {
|
|
1760
1761
|
updated_at?: string;
|
1761
1762
|
userinfo_signed_response_alg?: string;
|
1762
1763
|
}
|
1764
|
+
/** */
|
1765
|
+
export interface ApiCreateHashChannelAppsResponse {
|
1766
|
+
hash?: string;
|
1767
|
+
user_id?: string;
|
1768
|
+
}
|
1763
1769
|
export declare class MezonApi {
|
1764
1770
|
readonly serverKey: string;
|
1765
1771
|
readonly basePath: string;
|
@@ -2174,4 +2180,6 @@ export declare class MezonApi {
|
|
2174
2180
|
getMezonOauthClient(bearerToken: string, clientId?: string, options?: any): Promise<ApiMezonOauthClient>;
|
2175
2181
|
/** update mezon OAuth */
|
2176
2182
|
updateMezonOauthClient(bearerToken: string, body: ApiMezonOauthClient, options?: any): Promise<ApiMezonOauthClient>;
|
2183
|
+
/** */
|
2184
|
+
generateHashChannelApps(bearerToken: string, appId?: string, options?: any): Promise<ApiCreateHashChannelAppsResponse>;
|
2177
2185
|
}
|
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, ApiUpdateAccountRequest, 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, ApiHandleParticipantMeetStateRequest, ApiMezonOauthClientList, ApiMezonOauthClient } 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, ApiUpdateAccountRequest, 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, ApiHandleParticipantMeetStateRequest, ApiMezonOauthClientList, ApiMezonOauthClient, ApiCreateHashChannelAppsResponse } from "./api.gen";
|
17
17
|
import { Session } from "./session";
|
18
18
|
import { Socket } from "./socket";
|
19
19
|
import { WebSocketAdapter } from "./web_socket_adapter";
|
@@ -648,4 +648,5 @@ export declare class Client {
|
|
648
648
|
getMezonOauthClient(session: Session, clientId?: string): Promise<ApiMezonOauthClient>;
|
649
649
|
updateMezonOauthClient(session: Session, body: ApiMezonOauthClient): Promise<ApiMezonOauthClient>;
|
650
650
|
searchThread(session: Session, clanId?: string, channelId?: string, label?: string): Promise<ApiChannelDescList>;
|
651
|
+
generateHashChannelApps(session: Session, appId?: string): Promise<ApiCreateHashChannelAppsResponse>;
|
651
652
|
}
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -7146,6 +7146,32 @@ var MezonApi = class {
|
|
7146
7146
|
)
|
7147
7147
|
]);
|
7148
7148
|
}
|
7149
|
+
/** */
|
7150
|
+
generateHashChannelApps(bearerToken, appId, options = {}) {
|
7151
|
+
const urlPath = "/v2/channel-apps/hash";
|
7152
|
+
const queryParams = /* @__PURE__ */ new Map();
|
7153
|
+
queryParams.set("app_id", appId);
|
7154
|
+
let bodyJson = "";
|
7155
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7156
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
7157
|
+
if (bearerToken) {
|
7158
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7159
|
+
}
|
7160
|
+
return Promise.race([
|
7161
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
7162
|
+
if (response.status == 204) {
|
7163
|
+
return response;
|
7164
|
+
} else if (response.status >= 200 && response.status < 300) {
|
7165
|
+
return response.json();
|
7166
|
+
} else {
|
7167
|
+
throw response;
|
7168
|
+
}
|
7169
|
+
}),
|
7170
|
+
new Promise(
|
7171
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7172
|
+
)
|
7173
|
+
]);
|
7174
|
+
}
|
7149
7175
|
};
|
7150
7176
|
|
7151
7177
|
// session.ts
|
@@ -7480,6 +7506,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7480
7506
|
);
|
7481
7507
|
} else if (message.custom_status_event) {
|
7482
7508
|
this.oncustomstatus(message.custom_status_event);
|
7509
|
+
} else if (message.canvas_event) {
|
7510
|
+
this.oncanvasevent(message.canvas_event);
|
7483
7511
|
} else if (message.user_channel_added_event) {
|
7484
7512
|
this.onuserchanneladded(
|
7485
7513
|
message.user_channel_added_event
|
@@ -7793,6 +7821,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7793
7821
|
console.log(statusEvent);
|
7794
7822
|
}
|
7795
7823
|
}
|
7824
|
+
oncanvasevent(canvasEvent) {
|
7825
|
+
if (this.verbose && window && window.console) {
|
7826
|
+
console.log(canvasEvent);
|
7827
|
+
}
|
7828
|
+
}
|
7796
7829
|
oneventcreated(clan_event_created) {
|
7797
7830
|
if (this.verbose && window && window.console) {
|
7798
7831
|
console.log(clan_event_created);
|
@@ -10932,4 +10965,15 @@ var Client = class {
|
|
10932
10965
|
});
|
10933
10966
|
});
|
10934
10967
|
}
|
10968
|
+
//**Generate Hash */
|
10969
|
+
generateHashChannelApps(session, appId) {
|
10970
|
+
return __async(this, null, function* () {
|
10971
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10972
|
+
yield this.sessionRefresh(session);
|
10973
|
+
}
|
10974
|
+
return this.apiClient.generateHashChannelApps(session.token, appId).then((response) => {
|
10975
|
+
return Promise.resolve(response);
|
10976
|
+
});
|
10977
|
+
});
|
10978
|
+
}
|
10935
10979
|
};
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -7112,6 +7112,32 @@ var MezonApi = class {
|
|
7112
7112
|
)
|
7113
7113
|
]);
|
7114
7114
|
}
|
7115
|
+
/** */
|
7116
|
+
generateHashChannelApps(bearerToken, appId, options = {}) {
|
7117
|
+
const urlPath = "/v2/channel-apps/hash";
|
7118
|
+
const queryParams = /* @__PURE__ */ new Map();
|
7119
|
+
queryParams.set("app_id", appId);
|
7120
|
+
let bodyJson = "";
|
7121
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
7122
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
7123
|
+
if (bearerToken) {
|
7124
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
7125
|
+
}
|
7126
|
+
return Promise.race([
|
7127
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
7128
|
+
if (response.status == 204) {
|
7129
|
+
return response;
|
7130
|
+
} else if (response.status >= 200 && response.status < 300) {
|
7131
|
+
return response.json();
|
7132
|
+
} else {
|
7133
|
+
throw response;
|
7134
|
+
}
|
7135
|
+
}),
|
7136
|
+
new Promise(
|
7137
|
+
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
7138
|
+
)
|
7139
|
+
]);
|
7140
|
+
}
|
7115
7141
|
};
|
7116
7142
|
|
7117
7143
|
// session.ts
|
@@ -7446,6 +7472,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7446
7472
|
);
|
7447
7473
|
} else if (message.custom_status_event) {
|
7448
7474
|
this.oncustomstatus(message.custom_status_event);
|
7475
|
+
} else if (message.canvas_event) {
|
7476
|
+
this.oncanvasevent(message.canvas_event);
|
7449
7477
|
} else if (message.user_channel_added_event) {
|
7450
7478
|
this.onuserchanneladded(
|
7451
7479
|
message.user_channel_added_event
|
@@ -7759,6 +7787,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7759
7787
|
console.log(statusEvent);
|
7760
7788
|
}
|
7761
7789
|
}
|
7790
|
+
oncanvasevent(canvasEvent) {
|
7791
|
+
if (this.verbose && window && window.console) {
|
7792
|
+
console.log(canvasEvent);
|
7793
|
+
}
|
7794
|
+
}
|
7762
7795
|
oneventcreated(clan_event_created) {
|
7763
7796
|
if (this.verbose && window && window.console) {
|
7764
7797
|
console.log(clan_event_created);
|
@@ -10898,6 +10931,17 @@ var Client = class {
|
|
10898
10931
|
});
|
10899
10932
|
});
|
10900
10933
|
}
|
10934
|
+
//**Generate Hash */
|
10935
|
+
generateHashChannelApps(session, appId) {
|
10936
|
+
return __async(this, null, function* () {
|
10937
|
+
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
10938
|
+
yield this.sessionRefresh(session);
|
10939
|
+
}
|
10940
|
+
return this.apiClient.generateHashChannelApps(session.token, appId).then((response) => {
|
10941
|
+
return Promise.resolve(response);
|
10942
|
+
});
|
10943
|
+
});
|
10944
|
+
}
|
10901
10945
|
};
|
10902
10946
|
export {
|
10903
10947
|
ChannelStreamMode,
|
package/dist/socket.d.ts
CHANGED
@@ -345,6 +345,7 @@ export interface ChannelDeletedEvent {
|
|
345
345
|
category_id: string;
|
346
346
|
channel_id: string;
|
347
347
|
deletor: string;
|
348
|
+
parrent_id: string;
|
348
349
|
}
|
349
350
|
export interface StickerCreateEvent {
|
350
351
|
clan_id: string;
|
@@ -693,6 +694,17 @@ export interface JoinChannelAppData {
|
|
693
694
|
username: string;
|
694
695
|
hash: string;
|
695
696
|
}
|
697
|
+
/** */
|
698
|
+
export interface ChannelCanvas {
|
699
|
+
content?: string;
|
700
|
+
creator_id?: string;
|
701
|
+
editor_id?: string;
|
702
|
+
id?: string;
|
703
|
+
is_default?: boolean;
|
704
|
+
title?: string;
|
705
|
+
channel_id?: string;
|
706
|
+
status?: number;
|
707
|
+
}
|
696
708
|
/** A socket connection to Mezon server. */
|
697
709
|
export interface Socket {
|
698
710
|
/** Connection is Open */
|
@@ -765,6 +777,7 @@ export interface Socket {
|
|
765
777
|
*/
|
766
778
|
onheartbeattimeout: () => void;
|
767
779
|
oncustomstatus: (statusEvent: CustomStatusEvent) => void;
|
780
|
+
oncanvasevent: (canvasEvent: ChannelCanvas) => void;
|
768
781
|
/** Receive channel message. */
|
769
782
|
onchannelmessage: (channelMessage: ChannelMessage) => void;
|
770
783
|
/** Receive typing event */
|
@@ -890,6 +903,7 @@ export declare class DefaultSocket implements Socket {
|
|
890
903
|
onstreamdata(streamData: StreamData): void;
|
891
904
|
onheartbeattimeout(): void;
|
892
905
|
oncustomstatus(statusEvent: CustomStatusEvent): void;
|
906
|
+
oncanvasevent(canvasEvent: ChannelCanvas): void;
|
893
907
|
oneventcreated(clan_event_created: ApiCreateEventRequest): void;
|
894
908
|
oncoffeegiven(give_coffee_event: ApiGiveCoffeeEvent): void;
|
895
909
|
onroleassign(role_assign_event: RoleAssignedEvent): void;
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -518,6 +518,8 @@ export interface ChannelDeletedEvent {
|
|
518
518
|
channel_id: string;
|
519
519
|
// deletor
|
520
520
|
deletor: string;
|
521
|
+
// parrent id
|
522
|
+
parrent_id: string;
|
521
523
|
}
|
522
524
|
|
523
525
|
export interface StickerCreateEvent {
|
@@ -975,6 +977,26 @@ export interface JoinChannelAppData {
|
|
975
977
|
hash: string;
|
976
978
|
}
|
977
979
|
|
980
|
+
/** */
|
981
|
+
export interface ChannelCanvas {
|
982
|
+
//
|
983
|
+
content?: string;
|
984
|
+
//
|
985
|
+
creator_id?: string;
|
986
|
+
//
|
987
|
+
editor_id?: string;
|
988
|
+
//
|
989
|
+
id?: string;
|
990
|
+
//
|
991
|
+
is_default?: boolean;
|
992
|
+
//
|
993
|
+
title?: string;
|
994
|
+
//
|
995
|
+
channel_id?: string;
|
996
|
+
//
|
997
|
+
status?: number;
|
998
|
+
}
|
999
|
+
|
978
1000
|
/** A socket connection to Mezon server. */
|
979
1001
|
export interface Socket {
|
980
1002
|
/** Connection is Open */
|
@@ -1226,6 +1248,8 @@ export interface Socket {
|
|
1226
1248
|
|
1227
1249
|
oncustomstatus: (statusEvent: CustomStatusEvent) => void;
|
1228
1250
|
|
1251
|
+
oncanvasevent: (canvasEvent: ChannelCanvas) => void;
|
1252
|
+
|
1229
1253
|
/** Receive channel message. */
|
1230
1254
|
onchannelmessage: (channelMessage: ChannelMessage) => void;
|
1231
1255
|
|
@@ -1561,6 +1585,8 @@ export class DefaultSocket implements Socket {
|
|
1561
1585
|
);
|
1562
1586
|
} else if (message.custom_status_event) {
|
1563
1587
|
this.oncustomstatus(<CustomStatusEvent>message.custom_status_event);
|
1588
|
+
} else if (message.canvas_event) {
|
1589
|
+
this.oncanvasevent(<ChannelCanvas>message.canvas_event);
|
1564
1590
|
} else if (message.user_channel_added_event) {
|
1565
1591
|
this.onuserchanneladded(
|
1566
1592
|
<UserChannelAddedEvent>message.user_channel_added_event
|
@@ -1920,6 +1946,12 @@ export class DefaultSocket implements Socket {
|
|
1920
1946
|
}
|
1921
1947
|
}
|
1922
1948
|
|
1949
|
+
oncanvasevent(canvasEvent: ChannelCanvas) {
|
1950
|
+
if (this.verbose && window && window.console) {
|
1951
|
+
console.log(canvasEvent);
|
1952
|
+
}
|
1953
|
+
}
|
1954
|
+
|
1923
1955
|
oneventcreated(clan_event_created: ApiCreateEventRequest) {
|
1924
1956
|
if (this.verbose && window && window.console) {
|
1925
1957
|
console.log(clan_event_created);
|