mezon-js 2.10.39 → 2.10.41
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 +59 -40
- package/client.ts +24 -11
- package/dist/api.gen.d.ts +8 -5
- package/dist/client.d.ts +5 -5
- package/dist/mezon-js.cjs.js +39 -15
- package/dist/mezon-js.esm.mjs +39 -15
- package/dist/socket.d.ts +12 -1
- package/package.json +1 -1
- package/socket.ts +43 -1
package/api.gen.ts
CHANGED
@@ -506,7 +506,7 @@ export interface ApiAuditLog {
|
|
506
506
|
action_log?: string;
|
507
507
|
//
|
508
508
|
channel_id?: string;
|
509
|
-
//
|
509
|
+
//
|
510
510
|
channel_label?: string;
|
511
511
|
//
|
512
512
|
clan_id?: string;
|
@@ -1187,6 +1187,8 @@ export interface ApiDeleteEventRequest {
|
|
1187
1187
|
creator_id?: string;
|
1188
1188
|
//The id of a event.
|
1189
1189
|
event_id?: string;
|
1190
|
+
//
|
1191
|
+
event_label?: string;
|
1190
1192
|
}
|
1191
1193
|
|
1192
1194
|
/** Delete a role the user has access to. */
|
@@ -1197,6 +1199,8 @@ export interface ApiDeleteRoleRequest {
|
|
1197
1199
|
clan_id?: string;
|
1198
1200
|
//The id of a role.
|
1199
1201
|
role_id?: string;
|
1202
|
+
//
|
1203
|
+
role_label?: string;
|
1200
1204
|
}
|
1201
1205
|
|
1202
1206
|
/** Storage objects to delete. */
|
@@ -2312,6 +2316,8 @@ export interface ApiUpdateRoleChannelRequest {
|
|
2312
2316
|
//The ID of the role to update.
|
2313
2317
|
role_id?: string;
|
2314
2318
|
//
|
2319
|
+
role_label?: string;
|
2320
|
+
//The ID of the role to update.
|
2315
2321
|
user_id?: string;
|
2316
2322
|
}
|
2317
2323
|
|
@@ -2559,7 +2565,7 @@ export interface MezonapiEvent {
|
|
2559
2565
|
|
2560
2566
|
/** */
|
2561
2567
|
export interface MezonapiListAuditLog {
|
2562
|
-
//
|
2568
|
+
//
|
2563
2569
|
date_log?: string;
|
2564
2570
|
//
|
2565
2571
|
logs?: Array<ApiAuditLog>;
|
@@ -4591,13 +4597,14 @@ export class MezonApi {
|
|
4591
4597
|
}
|
4592
4598
|
|
4593
4599
|
/** */
|
4594
|
-
listAuditLog(
|
4595
|
-
|
4596
|
-
|
4597
|
-
|
4598
|
-
|
4599
|
-
|
4600
|
-
|
4600
|
+
listAuditLog(
|
4601
|
+
bearerToken: string,
|
4602
|
+
actionLog?: string,
|
4603
|
+
userId?: string,
|
4604
|
+
clanId?: string,
|
4605
|
+
dateLog?: string,
|
4606
|
+
options: any = {}
|
4607
|
+
): Promise<MezonapiListAuditLog> {
|
4601
4608
|
const urlPath = "/v2/audit_log";
|
4602
4609
|
const queryParams = new Map<string, any>();
|
4603
4610
|
queryParams.set("action_log", actionLog);
|
@@ -6022,6 +6029,7 @@ export class MezonApi {
|
|
6022
6029
|
bearerToken: string,
|
6023
6030
|
categoryId: string,
|
6024
6031
|
clanId: string,
|
6032
|
+
categoryLabel?: string,
|
6025
6033
|
options: any = {}
|
6026
6034
|
): Promise<any> {
|
6027
6035
|
if (categoryId === null || categoryId === undefined) {
|
@@ -6039,6 +6047,7 @@ export class MezonApi {
|
|
6039
6047
|
.replace("{categoryId}", encodeURIComponent(String(categoryId)))
|
6040
6048
|
.replace("{clanId}", encodeURIComponent(String(clanId)));
|
6041
6049
|
const queryParams = new Map<string, any>();
|
6050
|
+
queryParams.set("category_label", categoryLabel);
|
6042
6051
|
|
6043
6052
|
let bodyJson: string = "";
|
6044
6053
|
|
@@ -6265,6 +6274,7 @@ export class MezonApi {
|
|
6265
6274
|
bearerToken: string,
|
6266
6275
|
id: string,
|
6267
6276
|
clanId?: string,
|
6277
|
+
emojiLabel?: string,
|
6268
6278
|
options: any = {}
|
6269
6279
|
): Promise<any> {
|
6270
6280
|
if (id === null || id === undefined) {
|
@@ -6276,6 +6286,7 @@ export class MezonApi {
|
|
6276
6286
|
);
|
6277
6287
|
const queryParams = new Map<string, any>();
|
6278
6288
|
queryParams.set("clan_id", clanId);
|
6289
|
+
queryParams.set("emoji_label", emojiLabel);
|
6279
6290
|
|
6280
6291
|
const body = { clan_id: clanId };
|
6281
6292
|
let bodyJson = JSON.stringify(body || {});
|
@@ -6572,6 +6583,7 @@ export class MezonApi {
|
|
6572
6583
|
eventId: string,
|
6573
6584
|
clanId?: string,
|
6574
6585
|
creatorId?: string,
|
6586
|
+
eventLabel?: string,
|
6575
6587
|
options: any = {}
|
6576
6588
|
): Promise<any> {
|
6577
6589
|
if (eventId === null || eventId === undefined) {
|
@@ -6586,6 +6598,7 @@ export class MezonApi {
|
|
6586
6598
|
const queryParams = new Map<string, any>();
|
6587
6599
|
queryParams.set("clan_id", clanId);
|
6588
6600
|
queryParams.set("creator_id", creatorId);
|
6601
|
+
queryParams.set("event_label", eventLabel);
|
6589
6602
|
|
6590
6603
|
let bodyJson: string = "";
|
6591
6604
|
|
@@ -8444,6 +8457,7 @@ export class MezonApi {
|
|
8444
8457
|
roleId: string,
|
8445
8458
|
channelId?: string,
|
8446
8459
|
clanId?: string,
|
8460
|
+
roleLabel?: string,
|
8447
8461
|
options: any = {}
|
8448
8462
|
): Promise<any> {
|
8449
8463
|
if (roleId === null || roleId === undefined) {
|
@@ -8458,6 +8472,8 @@ export class MezonApi {
|
|
8458
8472
|
const queryParams = new Map<string, any>();
|
8459
8473
|
queryParams.set("channel_id", channelId);
|
8460
8474
|
queryParams.set("clan_id", clanId);
|
8475
|
+
queryParams.set("role_label", roleLabel);
|
8476
|
+
|
8461
8477
|
let bodyJson: string = "";
|
8462
8478
|
|
8463
8479
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -8884,6 +8900,7 @@ export class MezonApi {
|
|
8884
8900
|
bearerToken: string,
|
8885
8901
|
id: string,
|
8886
8902
|
clanId?: string,
|
8903
|
+
stickerLabel?: string,
|
8887
8904
|
options: any = {}
|
8888
8905
|
): Promise<any> {
|
8889
8906
|
if (id === null || id === undefined) {
|
@@ -8895,6 +8912,7 @@ export class MezonApi {
|
|
8895
8912
|
);
|
8896
8913
|
const queryParams = new Map<string, any>();
|
8897
8914
|
queryParams.set("clan_id", clanId);
|
8915
|
+
queryParams.set("sticker_label", stickerLabel);
|
8898
8916
|
|
8899
8917
|
let bodyJson: string = "";
|
8900
8918
|
|
@@ -10606,37 +10624,38 @@ export class MezonApi {
|
|
10606
10624
|
]);
|
10607
10625
|
}
|
10608
10626
|
|
10609
|
-
|
10610
|
-
|
10611
|
-
|
10612
|
-
|
10613
|
-
|
10614
|
-
|
10615
|
-
|
10616
|
-
|
10617
|
-
|
10618
|
-
|
10619
|
-
|
10620
|
-
|
10621
|
-
|
10622
|
-
|
10623
|
-
|
10624
|
-
|
10625
|
-
|
10626
|
-
|
10627
|
-
|
10628
|
-
|
10629
|
-
|
10630
|
-
|
10631
|
-
|
10632
|
-
|
10633
|
-
|
10634
|
-
|
10635
|
-
}
|
10636
|
-
|
10637
|
-
|
10638
|
-
)
|
10639
|
-
|
10627
|
+
/** Sd Topic */
|
10628
|
+
getTopicDetail(
|
10629
|
+
bearerToken: string,
|
10630
|
+
topicId?: string,
|
10631
|
+
options: any = {}
|
10632
|
+
): Promise<ApiSdTopic> {
|
10633
|
+
const urlPath = "/v2/sdmtopic/detail";
|
10634
|
+
const queryParams = new Map<string, any>();
|
10635
|
+
queryParams.set("topic_id", topicId);
|
10636
|
+
|
10637
|
+
let bodyJson: string = "";
|
10638
|
+
|
10639
|
+
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
10640
|
+
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
10641
|
+
if (bearerToken) {
|
10642
|
+
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
10643
|
+
}
|
10644
|
+
|
10645
|
+
return Promise.race([
|
10646
|
+
fetch(fullUrl, fetchOptions).then((response) => {
|
10647
|
+
if (response.status == 204) {
|
10648
|
+
return response;
|
10649
|
+
} else if (response.status >= 200 && response.status < 300) {
|
10650
|
+
return response.json();
|
10651
|
+
} else {
|
10652
|
+
throw response;
|
10653
|
+
}
|
10654
|
+
}),
|
10655
|
+
new Promise((_, reject) =>
|
10656
|
+
setTimeout(reject, this.timeoutMs, "Request timed out.")
|
10657
|
+
),
|
10658
|
+
]);
|
10640
10659
|
}
|
10641
10660
|
|
10642
10661
|
/** List onboarding step. */
|
package/client.ts
CHANGED
@@ -1139,7 +1139,8 @@ export class Client {
|
|
1139
1139
|
async deleteCategoryDesc(
|
1140
1140
|
session: Session,
|
1141
1141
|
categoryId: string,
|
1142
|
-
clanId: string
|
1142
|
+
clanId: string,
|
1143
|
+
categoryLabel?: string
|
1143
1144
|
): Promise<boolean> {
|
1144
1145
|
if (
|
1145
1146
|
this.autoRefreshSession &&
|
@@ -1150,7 +1151,7 @@ export class Client {
|
|
1150
1151
|
}
|
1151
1152
|
|
1152
1153
|
return this.apiClient
|
1153
|
-
.deleteCategoryDesc(session.token, categoryId, clanId)
|
1154
|
+
.deleteCategoryDesc(session.token, categoryId, clanId, categoryLabel)
|
1154
1155
|
.then((response: any) => {
|
1155
1156
|
return response !== undefined;
|
1156
1157
|
});
|
@@ -1180,7 +1181,8 @@ export class Client {
|
|
1180
1181
|
async deleteRole(
|
1181
1182
|
session: Session,
|
1182
1183
|
roleId: string,
|
1183
|
-
clanId: string
|
1184
|
+
clanId: string,
|
1185
|
+
roleLabel?: string
|
1184
1186
|
): Promise<boolean> {
|
1185
1187
|
if (
|
1186
1188
|
this.autoRefreshSession &&
|
@@ -1191,7 +1193,7 @@ export class Client {
|
|
1191
1193
|
}
|
1192
1194
|
|
1193
1195
|
return this.apiClient
|
1194
|
-
.deleteRole(session.token, roleId, "", clanId)
|
1196
|
+
.deleteRole(session.token, roleId, "", clanId, roleLabel)
|
1195
1197
|
.then((response: any) => {
|
1196
1198
|
return response !== undefined;
|
1197
1199
|
});
|
@@ -1202,7 +1204,8 @@ export class Client {
|
|
1202
1204
|
session: Session,
|
1203
1205
|
eventId: string,
|
1204
1206
|
clanId: string,
|
1205
|
-
creatorId: string
|
1207
|
+
creatorId: string,
|
1208
|
+
eventLabel?: string
|
1206
1209
|
): Promise<boolean> {
|
1207
1210
|
if (
|
1208
1211
|
this.autoRefreshSession &&
|
@@ -1213,7 +1216,7 @@ export class Client {
|
|
1213
1216
|
}
|
1214
1217
|
|
1215
1218
|
return this.apiClient
|
1216
|
-
.deleteEvent(session.token, eventId, clanId, creatorId)
|
1219
|
+
.deleteEvent(session.token, eventId, clanId, creatorId, eventLabel)
|
1217
1220
|
.then((response: any) => {
|
1218
1221
|
return response !== undefined;
|
1219
1222
|
});
|
@@ -3154,7 +3157,12 @@ export class Client {
|
|
3154
3157
|
}
|
3155
3158
|
|
3156
3159
|
//**delete clan emoji by id */
|
3157
|
-
async deleteByIdClanEmoji(
|
3160
|
+
async deleteByIdClanEmoji(
|
3161
|
+
session: Session,
|
3162
|
+
id: string,
|
3163
|
+
clan_id: string,
|
3164
|
+
emojiLabel?: string
|
3165
|
+
) {
|
3158
3166
|
if (
|
3159
3167
|
this.autoRefreshSession &&
|
3160
3168
|
session.refresh_token &&
|
@@ -3164,7 +3172,7 @@ export class Client {
|
|
3164
3172
|
}
|
3165
3173
|
|
3166
3174
|
return this.apiClient
|
3167
|
-
.deleteClanEmojiById(session.token, id, clan_id)
|
3175
|
+
.deleteClanEmojiById(session.token, id, clan_id, emojiLabel)
|
3168
3176
|
.then((response: any) => {
|
3169
3177
|
return response !== undefined;
|
3170
3178
|
});
|
@@ -3291,7 +3299,12 @@ export class Client {
|
|
3291
3299
|
}
|
3292
3300
|
|
3293
3301
|
//**Delete a sticker by ID*/
|
3294
|
-
async deleteClanStickerById(
|
3302
|
+
async deleteClanStickerById(
|
3303
|
+
session: Session,
|
3304
|
+
id: string,
|
3305
|
+
clan_id: string,
|
3306
|
+
stickerLabel?: string
|
3307
|
+
) {
|
3295
3308
|
if (
|
3296
3309
|
this.autoRefreshSession &&
|
3297
3310
|
session.refresh_token &&
|
@@ -3301,7 +3314,7 @@ export class Client {
|
|
3301
3314
|
}
|
3302
3315
|
|
3303
3316
|
return this.apiClient
|
3304
|
-
.deleteClanStickerById(session.token, id, clan_id)
|
3317
|
+
.deleteClanStickerById(session.token, id, clan_id, stickerLabel)
|
3305
3318
|
.then((response: any) => {
|
3306
3319
|
return response !== undefined;
|
3307
3320
|
});
|
@@ -4844,7 +4857,7 @@ export class Client {
|
|
4844
4857
|
//**list sd topic */
|
4845
4858
|
async getTopicDetail(
|
4846
4859
|
session: Session,
|
4847
|
-
topicId?: string
|
4860
|
+
topicId?: string
|
4848
4861
|
): Promise<ApiSdTopic> {
|
4849
4862
|
if (
|
4850
4863
|
this.autoRefreshSession &&
|
package/dist/api.gen.d.ts
CHANGED
@@ -680,12 +680,14 @@ export interface ApiDeleteEventRequest {
|
|
680
680
|
clan_id?: string;
|
681
681
|
creator_id?: string;
|
682
682
|
event_id?: string;
|
683
|
+
event_label?: string;
|
683
684
|
}
|
684
685
|
/** Delete a role the user has access to. */
|
685
686
|
export interface ApiDeleteRoleRequest {
|
686
687
|
channel_id?: string;
|
687
688
|
clan_id?: string;
|
688
689
|
role_id?: string;
|
690
|
+
role_label?: string;
|
689
691
|
}
|
690
692
|
/** Storage objects to delete. */
|
691
693
|
export interface ApiDeleteStorageObjectId {
|
@@ -1343,6 +1345,7 @@ export interface ApiUpdateRoleChannelRequest {
|
|
1343
1345
|
max_permission_id: string;
|
1344
1346
|
permission_update?: Array<ApiPermissionUpdate>;
|
1345
1347
|
role_id?: string;
|
1348
|
+
role_label?: string;
|
1346
1349
|
user_id?: string;
|
1347
1350
|
}
|
1348
1351
|
/** Fetch a batch of zero or more users from the server. */
|
@@ -1767,7 +1770,7 @@ export declare class MezonApi {
|
|
1767
1770
|
/** */
|
1768
1771
|
createCategoryDesc(bearerToken: string, body: ApiCreateCategoryDescRequest, options?: any): Promise<ApiCategoryDesc>;
|
1769
1772
|
/** */
|
1770
|
-
deleteCategoryDesc(bearerToken: string, categoryId: string, clanId: string, options?: any): Promise<any>;
|
1773
|
+
deleteCategoryDesc(bearerToken: string, categoryId: string, clanId: string, categoryLabel?: string, options?: any): Promise<any>;
|
1771
1774
|
/** */
|
1772
1775
|
deleteCategoryOrder(bearerToken: string, clanId: string, options?: any): Promise<any>;
|
1773
1776
|
/** regist fcm device token */
|
@@ -1779,7 +1782,7 @@ export declare class MezonApi {
|
|
1779
1782
|
/** Post clan Emoji /v2/emoji/create */
|
1780
1783
|
createClanEmoji(bearerToken: string, body: ApiClanEmojiCreateRequest, options?: any): Promise<any>;
|
1781
1784
|
/** Delete a emoji by ID. */
|
1782
|
-
deleteClanEmojiById(bearerToken: string, id: string, clanId?: string, options?: any): Promise<any>;
|
1785
|
+
deleteClanEmojiById(bearerToken: string, id: string, clanId?: string, emojiLabel?: string, options?: any): Promise<any>;
|
1783
1786
|
/** Update ClanEmoj By id */
|
1784
1787
|
updateClanEmojiById(bearerToken: string, id: string, body: MezonUpdateClanEmojiByIdBody, options?: any): Promise<any>;
|
1785
1788
|
/** get list emoji by user id */
|
@@ -1795,7 +1798,7 @@ export declare class MezonApi {
|
|
1795
1798
|
/** Update fields in a given event. */
|
1796
1799
|
updateEventUser(bearerToken: string, body: ApiDeleteEventRequest, options?: any): Promise<any>;
|
1797
1800
|
/** Delete a event by ID. */
|
1798
|
-
deleteEvent(bearerToken: string, eventId: string, clanId?: string, creatorId?: string, options?: any): Promise<any>;
|
1801
|
+
deleteEvent(bearerToken: string, eventId: string, clanId?: string, creatorId?: string, eventLabel?: string, options?: any): Promise<any>;
|
1799
1802
|
/** Update fields in a given event. */
|
1800
1803
|
updateEvent(bearerToken: string, eventId: string, body: MezonUpdateEventBody, options?: any): Promise<any>;
|
1801
1804
|
/** Delete one or more users by ID or username. */
|
@@ -1893,7 +1896,7 @@ export declare class MezonApi {
|
|
1893
1896
|
/** Update a role when Delete a role by ID. */
|
1894
1897
|
updateRoleDelete(bearerToken: string, roleId: string, body: MezonUpdateRoleDeleteBody, options?: any): Promise<any>;
|
1895
1898
|
/** Delete a role by ID. */
|
1896
|
-
deleteRole(bearerToken: string, roleId: string, channelId?: string, clanId?: string, options?: any): Promise<any>;
|
1899
|
+
deleteRole(bearerToken: string, roleId: string, channelId?: string, clanId?: string, roleLabel?: string, options?: any): Promise<any>;
|
1897
1900
|
/** Update fields in a given role. */
|
1898
1901
|
updateRole(bearerToken: string, roleId: string, body: MezonUpdateRoleBody, options?: any): Promise<any>;
|
1899
1902
|
/** List role permissions */
|
@@ -1913,7 +1916,7 @@ export declare class MezonApi {
|
|
1913
1916
|
/** Add a new sticker */
|
1914
1917
|
addClanSticker(bearerToken: string, body: ApiClanStickerAddRequest, options?: any): Promise<any>;
|
1915
1918
|
/** Delete a sticker by ID */
|
1916
|
-
deleteClanStickerById(bearerToken: string, id: string, clanId?: string, options?: any): Promise<any>;
|
1919
|
+
deleteClanStickerById(bearerToken: string, id: string, clanId?: string, stickerLabel?: string, options?: any): Promise<any>;
|
1917
1920
|
/** Update a sticker by ID */
|
1918
1921
|
updateClanStickerById(bearerToken: string, id: string, body: MezonUpdateClanStickerByIdBody, options?: any): Promise<any>;
|
1919
1922
|
/** get list sticker by user id */
|
package/dist/client.d.ts
CHANGED
@@ -394,13 +394,13 @@ export declare class Client {
|
|
394
394
|
/** Delete a clan desc by ID. */
|
395
395
|
deleteClanDesc(session: Session, clanDescId: string): Promise<boolean>;
|
396
396
|
/** Delete a category by ID. */
|
397
|
-
deleteCategoryDesc(session: Session, categoryId: string, clanId: string): Promise<boolean>;
|
397
|
+
deleteCategoryDesc(session: Session, categoryId: string, clanId: string, categoryLabel?: string): Promise<boolean>;
|
398
398
|
/** Delete one or more notifications */
|
399
399
|
deleteNotifications(session: Session, ids?: Array<string>): Promise<boolean>;
|
400
400
|
/** Delete a role by ID. */
|
401
|
-
deleteRole(session: Session, roleId: string, clanId: string): Promise<boolean>;
|
401
|
+
deleteRole(session: Session, roleId: string, clanId: string, roleLabel?: string): Promise<boolean>;
|
402
402
|
/** Delete a event by ID. */
|
403
|
-
deleteEvent(session: Session, eventId: string, clanId: string, creatorId: string): Promise<boolean>;
|
403
|
+
deleteEvent(session: Session, eventId: string, clanId: string, creatorId: string, eventLabel?: string): Promise<boolean>;
|
404
404
|
/** update user a event by ID. */
|
405
405
|
updateEventUser(session: Session, request: ApiDeleteEventRequest): Promise<boolean>;
|
406
406
|
/** Submit an event for processing in the server's registered runtime custom events handler. */
|
@@ -546,14 +546,14 @@ export declare class Client {
|
|
546
546
|
/** create clan emoji */
|
547
547
|
createClanEmoji(session: Session, request: ApiClanEmojiCreateRequest): Promise<boolean>;
|
548
548
|
updateClanEmojiById(session: Session, id: string, request: MezonUpdateClanEmojiByIdBody): Promise<boolean>;
|
549
|
-
deleteByIdClanEmoji(session: Session, id: string, clan_id: string): Promise<boolean>;
|
549
|
+
deleteByIdClanEmoji(session: Session, id: string, clan_id: string, emojiLabel?: string): Promise<boolean>;
|
550
550
|
generateWebhookLink(session: Session, request: ApiWebhookCreateRequest): Promise<ApiWebhookGenerateResponse>;
|
551
551
|
listWebhookByChannelId(session: Session, channel_id: string, clan_id: string): Promise<ApiWebhookListResponse>;
|
552
552
|
updateWebhookById(session: Session, id: string, request: MezonUpdateWebhookByIdBody): Promise<boolean>;
|
553
553
|
deleteWebhookById(session: Session, id: string, request: MezonDeleteWebhookByIdBody): Promise<boolean>;
|
554
554
|
checkDuplicateClanName(session: Session, clan_name: string): Promise<ApiCheckDuplicateClanNameResponse>;
|
555
555
|
addClanSticker(session: Session, request: ApiClanStickerAddRequest): Promise<boolean>;
|
556
|
-
deleteClanStickerById(session: Session, id: string, clan_id: string): Promise<boolean>;
|
556
|
+
deleteClanStickerById(session: Session, id: string, clan_id: string, stickerLabel?: string): Promise<boolean>;
|
557
557
|
updateClanStickerById(session: Session, id: string, request: MezonUpdateClanStickerByIdBody): Promise<boolean>;
|
558
558
|
changeChannelCategory(session: Session, id: string, request: MezonChangeChannelCategoryBody): Promise<boolean>;
|
559
559
|
/** */
|
package/dist/mezon-js.cjs.js
CHANGED
@@ -3275,7 +3275,7 @@ var MezonApi = class {
|
|
3275
3275
|
]);
|
3276
3276
|
}
|
3277
3277
|
/** */
|
3278
|
-
deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
|
3278
|
+
deleteCategoryDesc(bearerToken, categoryId, clanId, categoryLabel, options = {}) {
|
3279
3279
|
if (categoryId === null || categoryId === void 0) {
|
3280
3280
|
throw new Error(
|
3281
3281
|
"'categoryId' is a required parameter but is null or undefined."
|
@@ -3288,6 +3288,7 @@ var MezonApi = class {
|
|
3288
3288
|
}
|
3289
3289
|
const urlPath = "/v2/deletecategory/category_id/{categoryId}/clan_id/{clanId}".replace("{categoryId}", encodeURIComponent(String(categoryId))).replace("{clanId}", encodeURIComponent(String(clanId)));
|
3290
3290
|
const queryParams = /* @__PURE__ */ new Map();
|
3291
|
+
queryParams.set("category_label", categoryLabel);
|
3291
3292
|
let bodyJson = "";
|
3292
3293
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3293
3294
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -3464,7 +3465,7 @@ var MezonApi = class {
|
|
3464
3465
|
]);
|
3465
3466
|
}
|
3466
3467
|
/** Delete a emoji by ID. */
|
3467
|
-
deleteClanEmojiById(bearerToken, id, clanId, options = {}) {
|
3468
|
+
deleteClanEmojiById(bearerToken, id, clanId, emojiLabel, options = {}) {
|
3468
3469
|
if (id === null || id === void 0) {
|
3469
3470
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
3470
3471
|
}
|
@@ -3474,6 +3475,7 @@ var MezonApi = class {
|
|
3474
3475
|
);
|
3475
3476
|
const queryParams = /* @__PURE__ */ new Map();
|
3476
3477
|
queryParams.set("clan_id", clanId);
|
3478
|
+
queryParams.set("emoji_label", emojiLabel);
|
3477
3479
|
const body = { clan_id: clanId };
|
3478
3480
|
let bodyJson = JSON.stringify(body || {});
|
3479
3481
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -3709,7 +3711,7 @@ var MezonApi = class {
|
|
3709
3711
|
]);
|
3710
3712
|
}
|
3711
3713
|
/** Delete a event by ID. */
|
3712
|
-
deleteEvent(bearerToken, eventId, clanId, creatorId, options = {}) {
|
3714
|
+
deleteEvent(bearerToken, eventId, clanId, creatorId, eventLabel, options = {}) {
|
3713
3715
|
if (eventId === null || eventId === void 0) {
|
3714
3716
|
throw new Error(
|
3715
3717
|
"'eventId' is a required parameter but is null or undefined."
|
@@ -3722,6 +3724,7 @@ var MezonApi = class {
|
|
3722
3724
|
const queryParams = /* @__PURE__ */ new Map();
|
3723
3725
|
queryParams.set("clan_id", clanId);
|
3724
3726
|
queryParams.set("creator_id", creatorId);
|
3727
|
+
queryParams.set("event_label", eventLabel);
|
3725
3728
|
let bodyJson = "";
|
3726
3729
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3727
3730
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -5163,7 +5166,7 @@ var MezonApi = class {
|
|
5163
5166
|
]);
|
5164
5167
|
}
|
5165
5168
|
/** Delete a role by ID. */
|
5166
|
-
deleteRole(bearerToken, roleId, channelId, clanId, options = {}) {
|
5169
|
+
deleteRole(bearerToken, roleId, channelId, clanId, roleLabel, options = {}) {
|
5167
5170
|
if (roleId === null || roleId === void 0) {
|
5168
5171
|
throw new Error(
|
5169
5172
|
"'roleId' is a required parameter but is null or undefined."
|
@@ -5176,6 +5179,7 @@ var MezonApi = class {
|
|
5176
5179
|
const queryParams = /* @__PURE__ */ new Map();
|
5177
5180
|
queryParams.set("channel_id", channelId);
|
5178
5181
|
queryParams.set("clan_id", clanId);
|
5182
|
+
queryParams.set("role_label", roleLabel);
|
5179
5183
|
let bodyJson = "";
|
5180
5184
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5181
5185
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -5509,7 +5513,7 @@ var MezonApi = class {
|
|
5509
5513
|
]);
|
5510
5514
|
}
|
5511
5515
|
/** Delete a sticker by ID */
|
5512
|
-
deleteClanStickerById(bearerToken, id, clanId, options = {}) {
|
5516
|
+
deleteClanStickerById(bearerToken, id, clanId, stickerLabel, options = {}) {
|
5513
5517
|
if (id === null || id === void 0) {
|
5514
5518
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
5515
5519
|
}
|
@@ -5519,6 +5523,7 @@ var MezonApi = class {
|
|
5519
5523
|
);
|
5520
5524
|
const queryParams = /* @__PURE__ */ new Map();
|
5521
5525
|
queryParams.set("clan_id", clanId);
|
5526
|
+
queryParams.set("sticker_label", stickerLabel);
|
5522
5527
|
let bodyJson = "";
|
5523
5528
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5524
5529
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -7361,6 +7366,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7361
7366
|
this.onpttchannelleaved(message.ptt_leaved_event);
|
7362
7367
|
} else if (message.sd_topic_event) {
|
7363
7368
|
this.onsdtopicevent(message.sd_topic_event);
|
7369
|
+
} else if (message.channel_app_event) {
|
7370
|
+
this.onchannelappevent(message.channel_app_event);
|
7364
7371
|
} else {
|
7365
7372
|
if (this.verbose && window && window.console) {
|
7366
7373
|
console.log("Unrecognized message received: %o", message);
|
@@ -7683,6 +7690,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7683
7690
|
console.log(sd_topic_event);
|
7684
7691
|
}
|
7685
7692
|
}
|
7693
|
+
onchannelappevent(event) {
|
7694
|
+
if (this.verbose && window && window.console) {
|
7695
|
+
console.log(event);
|
7696
|
+
}
|
7697
|
+
}
|
7686
7698
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
7687
7699
|
const untypedMessage = message;
|
7688
7700
|
return new Promise((resolve, reject) => {
|
@@ -7999,6 +8011,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7999
8011
|
return response.webrtc_signaling_fwd;
|
8000
8012
|
});
|
8001
8013
|
}
|
8014
|
+
writeChannelAppEvent(clan_id, channel_id, action) {
|
8015
|
+
return __async(this, null, function* () {
|
8016
|
+
const response = yield this.send({
|
8017
|
+
channel_app_event: {
|
8018
|
+
clan_id,
|
8019
|
+
channel_id,
|
8020
|
+
action
|
8021
|
+
}
|
8022
|
+
});
|
8023
|
+
return response.channel_app_event;
|
8024
|
+
});
|
8025
|
+
}
|
8002
8026
|
pingPong() {
|
8003
8027
|
return __async(this, null, function* () {
|
8004
8028
|
if (!this.adapter.isOpen()) {
|
@@ -8428,12 +8452,12 @@ var Client = class {
|
|
8428
8452
|
});
|
8429
8453
|
}
|
8430
8454
|
/** Delete a category by ID. */
|
8431
|
-
deleteCategoryDesc(session, categoryId, clanId) {
|
8455
|
+
deleteCategoryDesc(session, categoryId, clanId, categoryLabel) {
|
8432
8456
|
return __async(this, null, function* () {
|
8433
8457
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8434
8458
|
yield this.sessionRefresh(session);
|
8435
8459
|
}
|
8436
|
-
return this.apiClient.deleteCategoryDesc(session.token, categoryId, clanId).then((response) => {
|
8460
|
+
return this.apiClient.deleteCategoryDesc(session.token, categoryId, clanId, categoryLabel).then((response) => {
|
8437
8461
|
return response !== void 0;
|
8438
8462
|
});
|
8439
8463
|
});
|
@@ -8450,23 +8474,23 @@ var Client = class {
|
|
8450
8474
|
});
|
8451
8475
|
}
|
8452
8476
|
/** Delete a role by ID. */
|
8453
|
-
deleteRole(session, roleId, clanId) {
|
8477
|
+
deleteRole(session, roleId, clanId, roleLabel) {
|
8454
8478
|
return __async(this, null, function* () {
|
8455
8479
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8456
8480
|
yield this.sessionRefresh(session);
|
8457
8481
|
}
|
8458
|
-
return this.apiClient.deleteRole(session.token, roleId, "", clanId).then((response) => {
|
8482
|
+
return this.apiClient.deleteRole(session.token, roleId, "", clanId, roleLabel).then((response) => {
|
8459
8483
|
return response !== void 0;
|
8460
8484
|
});
|
8461
8485
|
});
|
8462
8486
|
}
|
8463
8487
|
/** Delete a event by ID. */
|
8464
|
-
deleteEvent(session, eventId, clanId, creatorId) {
|
8488
|
+
deleteEvent(session, eventId, clanId, creatorId, eventLabel) {
|
8465
8489
|
return __async(this, null, function* () {
|
8466
8490
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8467
8491
|
yield this.sessionRefresh(session);
|
8468
8492
|
}
|
8469
|
-
return this.apiClient.deleteEvent(session.token, eventId, clanId, creatorId).then((response) => {
|
8493
|
+
return this.apiClient.deleteEvent(session.token, eventId, clanId, creatorId, eventLabel).then((response) => {
|
8470
8494
|
return response !== void 0;
|
8471
8495
|
});
|
8472
8496
|
});
|
@@ -9642,12 +9666,12 @@ var Client = class {
|
|
9642
9666
|
});
|
9643
9667
|
}
|
9644
9668
|
//**delete clan emoji by id */
|
9645
|
-
deleteByIdClanEmoji(session, id, clan_id) {
|
9669
|
+
deleteByIdClanEmoji(session, id, clan_id, emojiLabel) {
|
9646
9670
|
return __async(this, null, function* () {
|
9647
9671
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9648
9672
|
yield this.sessionRefresh(session);
|
9649
9673
|
}
|
9650
|
-
return this.apiClient.deleteClanEmojiById(session.token, id, clan_id).then((response) => {
|
9674
|
+
return this.apiClient.deleteClanEmojiById(session.token, id, clan_id, emojiLabel).then((response) => {
|
9651
9675
|
return response !== void 0;
|
9652
9676
|
});
|
9653
9677
|
});
|
@@ -9719,12 +9743,12 @@ var Client = class {
|
|
9719
9743
|
});
|
9720
9744
|
}
|
9721
9745
|
//**Delete a sticker by ID*/
|
9722
|
-
deleteClanStickerById(session, id, clan_id) {
|
9746
|
+
deleteClanStickerById(session, id, clan_id, stickerLabel) {
|
9723
9747
|
return __async(this, null, function* () {
|
9724
9748
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9725
9749
|
yield this.sessionRefresh(session);
|
9726
9750
|
}
|
9727
|
-
return this.apiClient.deleteClanStickerById(session.token, id, clan_id).then((response) => {
|
9751
|
+
return this.apiClient.deleteClanStickerById(session.token, id, clan_id, stickerLabel).then((response) => {
|
9728
9752
|
return response !== void 0;
|
9729
9753
|
});
|
9730
9754
|
});
|
package/dist/mezon-js.esm.mjs
CHANGED
@@ -3241,7 +3241,7 @@ var MezonApi = class {
|
|
3241
3241
|
]);
|
3242
3242
|
}
|
3243
3243
|
/** */
|
3244
|
-
deleteCategoryDesc(bearerToken, categoryId, clanId, options = {}) {
|
3244
|
+
deleteCategoryDesc(bearerToken, categoryId, clanId, categoryLabel, options = {}) {
|
3245
3245
|
if (categoryId === null || categoryId === void 0) {
|
3246
3246
|
throw new Error(
|
3247
3247
|
"'categoryId' is a required parameter but is null or undefined."
|
@@ -3254,6 +3254,7 @@ var MezonApi = class {
|
|
3254
3254
|
}
|
3255
3255
|
const urlPath = "/v2/deletecategory/category_id/{categoryId}/clan_id/{clanId}".replace("{categoryId}", encodeURIComponent(String(categoryId))).replace("{clanId}", encodeURIComponent(String(clanId)));
|
3256
3256
|
const queryParams = /* @__PURE__ */ new Map();
|
3257
|
+
queryParams.set("category_label", categoryLabel);
|
3257
3258
|
let bodyJson = "";
|
3258
3259
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3259
3260
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -3430,7 +3431,7 @@ var MezonApi = class {
|
|
3430
3431
|
]);
|
3431
3432
|
}
|
3432
3433
|
/** Delete a emoji by ID. */
|
3433
|
-
deleteClanEmojiById(bearerToken, id, clanId, options = {}) {
|
3434
|
+
deleteClanEmojiById(bearerToken, id, clanId, emojiLabel, options = {}) {
|
3434
3435
|
if (id === null || id === void 0) {
|
3435
3436
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
3436
3437
|
}
|
@@ -3440,6 +3441,7 @@ var MezonApi = class {
|
|
3440
3441
|
);
|
3441
3442
|
const queryParams = /* @__PURE__ */ new Map();
|
3442
3443
|
queryParams.set("clan_id", clanId);
|
3444
|
+
queryParams.set("emoji_label", emojiLabel);
|
3443
3445
|
const body = { clan_id: clanId };
|
3444
3446
|
let bodyJson = JSON.stringify(body || {});
|
3445
3447
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
@@ -3675,7 +3677,7 @@ var MezonApi = class {
|
|
3675
3677
|
]);
|
3676
3678
|
}
|
3677
3679
|
/** Delete a event by ID. */
|
3678
|
-
deleteEvent(bearerToken, eventId, clanId, creatorId, options = {}) {
|
3680
|
+
deleteEvent(bearerToken, eventId, clanId, creatorId, eventLabel, options = {}) {
|
3679
3681
|
if (eventId === null || eventId === void 0) {
|
3680
3682
|
throw new Error(
|
3681
3683
|
"'eventId' is a required parameter but is null or undefined."
|
@@ -3688,6 +3690,7 @@ var MezonApi = class {
|
|
3688
3690
|
const queryParams = /* @__PURE__ */ new Map();
|
3689
3691
|
queryParams.set("clan_id", clanId);
|
3690
3692
|
queryParams.set("creator_id", creatorId);
|
3693
|
+
queryParams.set("event_label", eventLabel);
|
3691
3694
|
let bodyJson = "";
|
3692
3695
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
3693
3696
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -5129,7 +5132,7 @@ var MezonApi = class {
|
|
5129
5132
|
]);
|
5130
5133
|
}
|
5131
5134
|
/** Delete a role by ID. */
|
5132
|
-
deleteRole(bearerToken, roleId, channelId, clanId, options = {}) {
|
5135
|
+
deleteRole(bearerToken, roleId, channelId, clanId, roleLabel, options = {}) {
|
5133
5136
|
if (roleId === null || roleId === void 0) {
|
5134
5137
|
throw new Error(
|
5135
5138
|
"'roleId' is a required parameter but is null or undefined."
|
@@ -5142,6 +5145,7 @@ var MezonApi = class {
|
|
5142
5145
|
const queryParams = /* @__PURE__ */ new Map();
|
5143
5146
|
queryParams.set("channel_id", channelId);
|
5144
5147
|
queryParams.set("clan_id", clanId);
|
5148
|
+
queryParams.set("role_label", roleLabel);
|
5145
5149
|
let bodyJson = "";
|
5146
5150
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5147
5151
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -5475,7 +5479,7 @@ var MezonApi = class {
|
|
5475
5479
|
]);
|
5476
5480
|
}
|
5477
5481
|
/** Delete a sticker by ID */
|
5478
|
-
deleteClanStickerById(bearerToken, id, clanId, options = {}) {
|
5482
|
+
deleteClanStickerById(bearerToken, id, clanId, stickerLabel, options = {}) {
|
5479
5483
|
if (id === null || id === void 0) {
|
5480
5484
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
5481
5485
|
}
|
@@ -5485,6 +5489,7 @@ var MezonApi = class {
|
|
5485
5489
|
);
|
5486
5490
|
const queryParams = /* @__PURE__ */ new Map();
|
5487
5491
|
queryParams.set("clan_id", clanId);
|
5492
|
+
queryParams.set("sticker_label", stickerLabel);
|
5488
5493
|
let bodyJson = "";
|
5489
5494
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
5490
5495
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
@@ -7327,6 +7332,8 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7327
7332
|
this.onpttchannelleaved(message.ptt_leaved_event);
|
7328
7333
|
} else if (message.sd_topic_event) {
|
7329
7334
|
this.onsdtopicevent(message.sd_topic_event);
|
7335
|
+
} else if (message.channel_app_event) {
|
7336
|
+
this.onchannelappevent(message.channel_app_event);
|
7330
7337
|
} else {
|
7331
7338
|
if (this.verbose && window && window.console) {
|
7332
7339
|
console.log("Unrecognized message received: %o", message);
|
@@ -7649,6 +7656,11 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7649
7656
|
console.log(sd_topic_event);
|
7650
7657
|
}
|
7651
7658
|
}
|
7659
|
+
onchannelappevent(event) {
|
7660
|
+
if (this.verbose && window && window.console) {
|
7661
|
+
console.log(event);
|
7662
|
+
}
|
7663
|
+
}
|
7652
7664
|
send(message, sendTimeout = _DefaultSocket.DefaultSendTimeoutMs) {
|
7653
7665
|
const untypedMessage = message;
|
7654
7666
|
return new Promise((resolve, reject) => {
|
@@ -7965,6 +7977,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
7965
7977
|
return response.webrtc_signaling_fwd;
|
7966
7978
|
});
|
7967
7979
|
}
|
7980
|
+
writeChannelAppEvent(clan_id, channel_id, action) {
|
7981
|
+
return __async(this, null, function* () {
|
7982
|
+
const response = yield this.send({
|
7983
|
+
channel_app_event: {
|
7984
|
+
clan_id,
|
7985
|
+
channel_id,
|
7986
|
+
action
|
7987
|
+
}
|
7988
|
+
});
|
7989
|
+
return response.channel_app_event;
|
7990
|
+
});
|
7991
|
+
}
|
7968
7992
|
pingPong() {
|
7969
7993
|
return __async(this, null, function* () {
|
7970
7994
|
if (!this.adapter.isOpen()) {
|
@@ -8394,12 +8418,12 @@ var Client = class {
|
|
8394
8418
|
});
|
8395
8419
|
}
|
8396
8420
|
/** Delete a category by ID. */
|
8397
|
-
deleteCategoryDesc(session, categoryId, clanId) {
|
8421
|
+
deleteCategoryDesc(session, categoryId, clanId, categoryLabel) {
|
8398
8422
|
return __async(this, null, function* () {
|
8399
8423
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8400
8424
|
yield this.sessionRefresh(session);
|
8401
8425
|
}
|
8402
|
-
return this.apiClient.deleteCategoryDesc(session.token, categoryId, clanId).then((response) => {
|
8426
|
+
return this.apiClient.deleteCategoryDesc(session.token, categoryId, clanId, categoryLabel).then((response) => {
|
8403
8427
|
return response !== void 0;
|
8404
8428
|
});
|
8405
8429
|
});
|
@@ -8416,23 +8440,23 @@ var Client = class {
|
|
8416
8440
|
});
|
8417
8441
|
}
|
8418
8442
|
/** Delete a role by ID. */
|
8419
|
-
deleteRole(session, roleId, clanId) {
|
8443
|
+
deleteRole(session, roleId, clanId, roleLabel) {
|
8420
8444
|
return __async(this, null, function* () {
|
8421
8445
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8422
8446
|
yield this.sessionRefresh(session);
|
8423
8447
|
}
|
8424
|
-
return this.apiClient.deleteRole(session.token, roleId, "", clanId).then((response) => {
|
8448
|
+
return this.apiClient.deleteRole(session.token, roleId, "", clanId, roleLabel).then((response) => {
|
8425
8449
|
return response !== void 0;
|
8426
8450
|
});
|
8427
8451
|
});
|
8428
8452
|
}
|
8429
8453
|
/** Delete a event by ID. */
|
8430
|
-
deleteEvent(session, eventId, clanId, creatorId) {
|
8454
|
+
deleteEvent(session, eventId, clanId, creatorId, eventLabel) {
|
8431
8455
|
return __async(this, null, function* () {
|
8432
8456
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
8433
8457
|
yield this.sessionRefresh(session);
|
8434
8458
|
}
|
8435
|
-
return this.apiClient.deleteEvent(session.token, eventId, clanId, creatorId).then((response) => {
|
8459
|
+
return this.apiClient.deleteEvent(session.token, eventId, clanId, creatorId, eventLabel).then((response) => {
|
8436
8460
|
return response !== void 0;
|
8437
8461
|
});
|
8438
8462
|
});
|
@@ -9608,12 +9632,12 @@ var Client = class {
|
|
9608
9632
|
});
|
9609
9633
|
}
|
9610
9634
|
//**delete clan emoji by id */
|
9611
|
-
deleteByIdClanEmoji(session, id, clan_id) {
|
9635
|
+
deleteByIdClanEmoji(session, id, clan_id, emojiLabel) {
|
9612
9636
|
return __async(this, null, function* () {
|
9613
9637
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9614
9638
|
yield this.sessionRefresh(session);
|
9615
9639
|
}
|
9616
|
-
return this.apiClient.deleteClanEmojiById(session.token, id, clan_id).then((response) => {
|
9640
|
+
return this.apiClient.deleteClanEmojiById(session.token, id, clan_id, emojiLabel).then((response) => {
|
9617
9641
|
return response !== void 0;
|
9618
9642
|
});
|
9619
9643
|
});
|
@@ -9685,12 +9709,12 @@ var Client = class {
|
|
9685
9709
|
});
|
9686
9710
|
}
|
9687
9711
|
//**Delete a sticker by ID*/
|
9688
|
-
deleteClanStickerById(session, id, clan_id) {
|
9712
|
+
deleteClanStickerById(session, id, clan_id, stickerLabel) {
|
9689
9713
|
return __async(this, null, function* () {
|
9690
9714
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
9691
9715
|
yield this.sessionRefresh(session);
|
9692
9716
|
}
|
9693
|
-
return this.apiClient.deleteClanStickerById(session.token, id, clan_id).then((response) => {
|
9717
|
+
return this.apiClient.deleteClanStickerById(session.token, id, clan_id, stickerLabel).then((response) => {
|
9694
9718
|
return response !== void 0;
|
9695
9719
|
});
|
9696
9720
|
});
|
package/dist/socket.d.ts
CHANGED
@@ -575,6 +575,13 @@ export interface StreamingEndedEvent {
|
|
575
575
|
/** channel id */
|
576
576
|
channel_id: string;
|
577
577
|
}
|
578
|
+
export interface ChannelAppEvent {
|
579
|
+
user_id: string;
|
580
|
+
username: string;
|
581
|
+
clan_id: string;
|
582
|
+
channel_id: string;
|
583
|
+
action: number;
|
584
|
+
}
|
578
585
|
export interface PermissionSet {
|
579
586
|
/** Role ID */
|
580
587
|
role_id: string;
|
@@ -730,6 +737,7 @@ export interface Socket {
|
|
730
737
|
handleDropdownBoxSelected: (message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>) => Promise<DropdownBoxSelected>;
|
731
738
|
forwardWebrtcSignaling: (receiverId: string, dataType: number, jsonData: string, channelId: string, caller_id: string) => Promise<WebrtcSignalingFwd>;
|
732
739
|
makeCallPush: (receiverId: string, jsonData: string, channelId: string, caller_id: string) => Promise<IncomingCallPush>;
|
740
|
+
writeChannelAppEvent: (clan_id: string, channel_id: string, action: number) => Promise<ChannelAppEvent>;
|
733
741
|
/** Handle disconnect events received from the socket. */
|
734
742
|
ondisconnect: (evt: Event) => void;
|
735
743
|
/** Handle error events received from the socket. */
|
@@ -806,6 +814,7 @@ export interface Socket {
|
|
806
814
|
onpttchanneljoined: (ptt_joined_event: PTTJoinedEvent) => void;
|
807
815
|
onpttchannelleaved: (ptt_leaved_event: PTTLeavedEvent) => void;
|
808
816
|
onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
|
817
|
+
onchannelappevent: (event: ChannelAppEvent) => void;
|
809
818
|
}
|
810
819
|
/** Reports an error received from a socket message. */
|
811
820
|
export interface SocketError {
|
@@ -889,7 +898,8 @@ export declare class DefaultSocket implements Socket {
|
|
889
898
|
onjoinpttchannel(join_ptt_channel: JoinPTTChannel): void;
|
890
899
|
ontalkpttchannel(talk_ptt_channel: TalkPTTChannel): void;
|
891
900
|
onsdtopicevent(sd_topic_event: SdTopicEvent): void;
|
892
|
-
|
901
|
+
onchannelappevent(event: ChannelAppEvent): void;
|
902
|
+
send(message: ChannelJoin | ChannelLeave | ChannelMessageSend | ChannelMessageUpdate | CustomStatusEvent | ChannelMessageRemove | MessageTypingEvent | LastSeenMessageEvent | Rpc | StatusFollow | StatusUnfollow | StatusUpdate | Ping | WebrtcSignalingFwd | IncomingCallPush | MessageButtonClicked | DropdownBoxSelected | ChannelAppEvent, sendTimeout?: number): Promise<any>;
|
893
903
|
followUsers(userIds: string[]): Promise<Status>;
|
894
904
|
joinClanChat(clan_id: string): Promise<ClanJoin>;
|
895
905
|
follower(): Promise<void>;
|
@@ -913,6 +923,7 @@ export declare class DefaultSocket implements Socket {
|
|
913
923
|
makeCallPush(receiver_id: string, json_data: string, channel_id: string, caller_id: string): Promise<IncomingCallPush>;
|
914
924
|
handleDropdownBoxSelected(message_id: string, channel_id: string, selectbox_id: string, sender_id: string, user_id: string, value: Array<string>): Promise<DropdownBoxSelected>;
|
915
925
|
handleMessageButtonClick(message_id: string, channel_id: string, button_id: string, sender_id: string, user_id: string, extra_data: string): Promise<MessageButtonClicked>;
|
926
|
+
writeChannelAppEvent(clan_id: string, channel_id: string, action: number): Promise<ChannelAppEvent>;
|
916
927
|
private pingPong;
|
917
928
|
}
|
918
929
|
export {};
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -825,6 +825,14 @@ export interface StreamingEndedEvent {
|
|
825
825
|
channel_id: string;
|
826
826
|
}
|
827
827
|
|
828
|
+
export interface ChannelAppEvent {
|
829
|
+
user_id: string;
|
830
|
+
username: string;
|
831
|
+
clan_id: string;
|
832
|
+
channel_id: string;
|
833
|
+
action: number;
|
834
|
+
}
|
835
|
+
|
828
836
|
export interface PermissionSet {
|
829
837
|
/** Role ID */
|
830
838
|
role_id: string;
|
@@ -1151,6 +1159,12 @@ export interface Socket {
|
|
1151
1159
|
caller_id: string
|
1152
1160
|
) => Promise<IncomingCallPush>;
|
1153
1161
|
|
1162
|
+
writeChannelAppEvent: (
|
1163
|
+
clan_id: string,
|
1164
|
+
channel_id: string,
|
1165
|
+
action: number
|
1166
|
+
) => Promise<ChannelAppEvent>;
|
1167
|
+
|
1154
1168
|
/** Handle disconnect events received from the socket. */
|
1155
1169
|
ondisconnect: (evt: Event) => void;
|
1156
1170
|
|
@@ -1302,6 +1316,8 @@ export interface Socket {
|
|
1302
1316
|
onpttchannelleaved: (ptt_leaved_event: PTTLeavedEvent) => void;
|
1303
1317
|
|
1304
1318
|
onsdtopicevent: (sd_topic_event: SdTopicEvent) => void;
|
1319
|
+
|
1320
|
+
onchannelappevent: (event: ChannelAppEvent) => void;
|
1305
1321
|
}
|
1306
1322
|
|
1307
1323
|
/** Reports an error received from a socket message. */
|
@@ -1577,6 +1593,8 @@ export class DefaultSocket implements Socket {
|
|
1577
1593
|
this.onpttchannelleaved(<PTTLeavedEvent>message.ptt_leaved_event);
|
1578
1594
|
} else if (message.sd_topic_event) {
|
1579
1595
|
this.onsdtopicevent(<SdTopicEvent>message.sd_topic_event);
|
1596
|
+
} else if (message.channel_app_event) {
|
1597
|
+
this.onchannelappevent(<ChannelAppEvent>message.channel_app_event);
|
1580
1598
|
} else {
|
1581
1599
|
if (this.verbose && window && window.console) {
|
1582
1600
|
console.log("Unrecognized message received: %o", message);
|
@@ -1955,11 +1973,19 @@ export class DefaultSocket implements Socket {
|
|
1955
1973
|
console.log(talk_ptt_channel);
|
1956
1974
|
}
|
1957
1975
|
}
|
1976
|
+
|
1958
1977
|
onsdtopicevent(sd_topic_event: SdTopicEvent) {
|
1959
1978
|
if (this.verbose && window && window.console) {
|
1960
1979
|
console.log(sd_topic_event);
|
1961
1980
|
}
|
1962
1981
|
}
|
1982
|
+
|
1983
|
+
onchannelappevent(event: ChannelAppEvent) {
|
1984
|
+
if (this.verbose && window && window.console) {
|
1985
|
+
console.log(event);
|
1986
|
+
}
|
1987
|
+
}
|
1988
|
+
|
1963
1989
|
send(
|
1964
1990
|
message:
|
1965
1991
|
| ChannelJoin
|
@@ -1978,7 +2004,8 @@ export class DefaultSocket implements Socket {
|
|
1978
2004
|
| WebrtcSignalingFwd
|
1979
2005
|
| IncomingCallPush
|
1980
2006
|
| MessageButtonClicked
|
1981
|
-
| DropdownBoxSelected
|
2007
|
+
| DropdownBoxSelected
|
2008
|
+
| ChannelAppEvent,
|
1982
2009
|
sendTimeout = DefaultSocket.DefaultSendTimeoutMs
|
1983
2010
|
): Promise<any> {
|
1984
2011
|
const untypedMessage = message as any;
|
@@ -2408,6 +2435,21 @@ export class DefaultSocket implements Socket {
|
|
2408
2435
|
return response.webrtc_signaling_fwd;
|
2409
2436
|
}
|
2410
2437
|
|
2438
|
+
async writeChannelAppEvent(
|
2439
|
+
clan_id: string,
|
2440
|
+
channel_id: string,
|
2441
|
+
action: number
|
2442
|
+
): Promise<ChannelAppEvent> {
|
2443
|
+
const response = await this.send({
|
2444
|
+
channel_app_event: {
|
2445
|
+
clan_id: clan_id,
|
2446
|
+
channel_id: channel_id,
|
2447
|
+
action: action
|
2448
|
+
},
|
2449
|
+
});
|
2450
|
+
return response.channel_app_event;
|
2451
|
+
}
|
2452
|
+
|
2411
2453
|
private async pingPong(): Promise<void> {
|
2412
2454
|
if (!this.adapter.isOpen()) {
|
2413
2455
|
return;
|