mezon-js 2.8.23 → 2.8.25
Sign up to get free protection for your applications and to get access to all the features.
- package/api.gen.ts +3 -256
- package/client.ts +2 -119
- package/dist/api.gen.d.ts +1 -27
- package/dist/api1.gen.d.ts +1157 -0
- package/dist/client.d.ts +1 -10
- package/dist/mezon-js.cjs.js +18 -283
- package/dist/mezon-js.esm.mjs +18 -283
- package/dist/socket.d.ts +36 -2
- package/package.json +1 -1
- package/socket.ts +71 -3
package/dist/mezon-js.esm.mjs
CHANGED
@@ -2389,14 +2389,15 @@ var MezonApi = class {
|
|
2389
2389
|
]);
|
2390
2390
|
}
|
2391
2391
|
/** Delete a emoji by ID. */
|
2392
|
-
|
2392
|
+
deleteClanEmojiById(bearerToken, id, clanId, options = {}) {
|
2393
2393
|
if (id === null || id === void 0) {
|
2394
2394
|
throw new Error("'id' is a required parameter but is null or undefined.");
|
2395
2395
|
}
|
2396
2396
|
const urlPath = "/v2/emoji/{id}".replace("{id}", encodeURIComponent(String(id)));
|
2397
2397
|
const queryParams = /* @__PURE__ */ new Map();
|
2398
2398
|
queryParams.set("clan_id", clanId);
|
2399
|
-
|
2399
|
+
const body = { clan_id: clanId };
|
2400
|
+
let bodyJson = JSON.stringify(body || {});
|
2400
2401
|
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2401
2402
|
const fetchOptions = buildFetchOptions("DELETE", options, bodyJson);
|
2402
2403
|
if (bearerToken) {
|
@@ -2848,33 +2849,6 @@ var MezonApi = class {
|
|
2848
2849
|
)
|
2849
2850
|
]);
|
2850
2851
|
}
|
2851
|
-
/** List channelvoices */
|
2852
|
-
hashtagDMVoiceList(bearerToken, userId, limit, options = {}) {
|
2853
|
-
const urlPath = "/v2/hashtagdmvoice";
|
2854
|
-
const queryParams = /* @__PURE__ */ new Map();
|
2855
|
-
queryParams.set("user_id", userId);
|
2856
|
-
queryParams.set("limit", limit);
|
2857
|
-
let bodyJson = "";
|
2858
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
2859
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
2860
|
-
if (bearerToken) {
|
2861
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
2862
|
-
}
|
2863
|
-
return Promise.race([
|
2864
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
2865
|
-
if (response.status == 204) {
|
2866
|
-
return response;
|
2867
|
-
} else if (response.status >= 200 && response.status < 300) {
|
2868
|
-
return response.json();
|
2869
|
-
} else {
|
2870
|
-
throw response;
|
2871
|
-
}
|
2872
|
-
}),
|
2873
|
-
new Promise(
|
2874
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
2875
|
-
)
|
2876
|
-
]);
|
2877
|
-
}
|
2878
2852
|
/** Add users to a channel. */
|
2879
2853
|
createLinkInviteUser(bearerToken, body, options = {}) {
|
2880
2854
|
if (body === null || body === void 0) {
|
@@ -4044,157 +4018,6 @@ var MezonApi = class {
|
|
4044
4018
|
)
|
4045
4019
|
]);
|
4046
4020
|
}
|
4047
|
-
/** Get storage objects. */
|
4048
|
-
readStorageObjects(bearerToken, body, options = {}) {
|
4049
|
-
if (body === null || body === void 0) {
|
4050
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
4051
|
-
}
|
4052
|
-
const urlPath = "/v2/storage";
|
4053
|
-
const queryParams = /* @__PURE__ */ new Map();
|
4054
|
-
let bodyJson = "";
|
4055
|
-
bodyJson = JSON.stringify(body || {});
|
4056
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4057
|
-
const fetchOptions = buildFetchOptions("POST", options, bodyJson);
|
4058
|
-
if (bearerToken) {
|
4059
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4060
|
-
}
|
4061
|
-
return Promise.race([
|
4062
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
4063
|
-
if (response.status == 204) {
|
4064
|
-
return response;
|
4065
|
-
} else if (response.status >= 200 && response.status < 300) {
|
4066
|
-
return response.json();
|
4067
|
-
} else {
|
4068
|
-
throw response;
|
4069
|
-
}
|
4070
|
-
}),
|
4071
|
-
new Promise(
|
4072
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4073
|
-
)
|
4074
|
-
]);
|
4075
|
-
}
|
4076
|
-
/** Write objects into the storage engine. */
|
4077
|
-
writeStorageObjects(bearerToken, body, options = {}) {
|
4078
|
-
if (body === null || body === void 0) {
|
4079
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
4080
|
-
}
|
4081
|
-
const urlPath = "/v2/storage";
|
4082
|
-
const queryParams = /* @__PURE__ */ new Map();
|
4083
|
-
let bodyJson = "";
|
4084
|
-
bodyJson = JSON.stringify(body || {});
|
4085
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4086
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
4087
|
-
if (bearerToken) {
|
4088
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4089
|
-
}
|
4090
|
-
return Promise.race([
|
4091
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
4092
|
-
if (response.status == 204) {
|
4093
|
-
return response;
|
4094
|
-
} else if (response.status >= 200 && response.status < 300) {
|
4095
|
-
return response.json();
|
4096
|
-
} else {
|
4097
|
-
throw response;
|
4098
|
-
}
|
4099
|
-
}),
|
4100
|
-
new Promise(
|
4101
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4102
|
-
)
|
4103
|
-
]);
|
4104
|
-
}
|
4105
|
-
/** Delete one or more objects by ID or username. */
|
4106
|
-
deleteStorageObjects(bearerToken, body, options = {}) {
|
4107
|
-
if (body === null || body === void 0) {
|
4108
|
-
throw new Error("'body' is a required parameter but is null or undefined.");
|
4109
|
-
}
|
4110
|
-
const urlPath = "/v2/storage/delete";
|
4111
|
-
const queryParams = /* @__PURE__ */ new Map();
|
4112
|
-
let bodyJson = "";
|
4113
|
-
bodyJson = JSON.stringify(body || {});
|
4114
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4115
|
-
const fetchOptions = buildFetchOptions("PUT", options, bodyJson);
|
4116
|
-
if (bearerToken) {
|
4117
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4118
|
-
}
|
4119
|
-
return Promise.race([
|
4120
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
4121
|
-
if (response.status == 204) {
|
4122
|
-
return response;
|
4123
|
-
} else if (response.status >= 200 && response.status < 300) {
|
4124
|
-
return response.json();
|
4125
|
-
} else {
|
4126
|
-
throw response;
|
4127
|
-
}
|
4128
|
-
}),
|
4129
|
-
new Promise(
|
4130
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4131
|
-
)
|
4132
|
-
]);
|
4133
|
-
}
|
4134
|
-
/** List publicly readable storage objects in a given collection. */
|
4135
|
-
listStorageObjects(bearerToken, collection, userId, limit, cursor, options = {}) {
|
4136
|
-
if (collection === null || collection === void 0) {
|
4137
|
-
throw new Error("'collection' is a required parameter but is null or undefined.");
|
4138
|
-
}
|
4139
|
-
const urlPath = "/v2/storage/{collection}".replace("{collection}", encodeURIComponent(String(collection)));
|
4140
|
-
const queryParams = /* @__PURE__ */ new Map();
|
4141
|
-
queryParams.set("user_id", userId);
|
4142
|
-
queryParams.set("limit", limit);
|
4143
|
-
queryParams.set("cursor", cursor);
|
4144
|
-
let bodyJson = "";
|
4145
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4146
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4147
|
-
if (bearerToken) {
|
4148
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4149
|
-
}
|
4150
|
-
return Promise.race([
|
4151
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
4152
|
-
if (response.status == 204) {
|
4153
|
-
return response;
|
4154
|
-
} else if (response.status >= 200 && response.status < 300) {
|
4155
|
-
return response.json();
|
4156
|
-
} else {
|
4157
|
-
throw response;
|
4158
|
-
}
|
4159
|
-
}),
|
4160
|
-
new Promise(
|
4161
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4162
|
-
)
|
4163
|
-
]);
|
4164
|
-
}
|
4165
|
-
/** List publicly readable storage objects in a given collection. */
|
4166
|
-
listStorageObjects2(bearerToken, collection, userId, limit, cursor, options = {}) {
|
4167
|
-
if (collection === null || collection === void 0) {
|
4168
|
-
throw new Error("'collection' is a required parameter but is null or undefined.");
|
4169
|
-
}
|
4170
|
-
if (userId === null || userId === void 0) {
|
4171
|
-
throw new Error("'userId' is a required parameter but is null or undefined.");
|
4172
|
-
}
|
4173
|
-
const urlPath = "/v2/storage/{collection}/{userId}".replace("{collection}", encodeURIComponent(String(collection))).replace("{userId}", encodeURIComponent(String(userId)));
|
4174
|
-
const queryParams = /* @__PURE__ */ new Map();
|
4175
|
-
queryParams.set("limit", limit);
|
4176
|
-
queryParams.set("cursor", cursor);
|
4177
|
-
let bodyJson = "";
|
4178
|
-
const fullUrl = this.buildFullUrl(this.basePath, urlPath, queryParams);
|
4179
|
-
const fetchOptions = buildFetchOptions("GET", options, bodyJson);
|
4180
|
-
if (bearerToken) {
|
4181
|
-
fetchOptions.headers["Authorization"] = "Bearer " + bearerToken;
|
4182
|
-
}
|
4183
|
-
return Promise.race([
|
4184
|
-
fetch(fullUrl, fetchOptions).then((response) => {
|
4185
|
-
if (response.status == 204) {
|
4186
|
-
return response;
|
4187
|
-
} else if (response.status >= 200 && response.status < 300) {
|
4188
|
-
return response.json();
|
4189
|
-
} else {
|
4190
|
-
throw response;
|
4191
|
-
}
|
4192
|
-
}),
|
4193
|
-
new Promise(
|
4194
|
-
(_, reject) => setTimeout(reject, this.timeoutMs, "Request timed out.")
|
4195
|
-
)
|
4196
|
-
]);
|
4197
|
-
}
|
4198
4021
|
/** Update fields in a given category. */
|
4199
4022
|
updateCategory(bearerToken, body, options = {}) {
|
4200
4023
|
if (body === null || body === void 0) {
|
@@ -5064,9 +4887,9 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5064
4887
|
unfollowUsers(user_ids) {
|
5065
4888
|
return this.send({ status_unfollow: { user_ids } });
|
5066
4889
|
}
|
5067
|
-
updateChatMessage(clan_id, channel_id, mode, message_id, content, mentions) {
|
4890
|
+
updateChatMessage(clan_id, channel_id, mode, message_id, content, mentions, attachments) {
|
5068
4891
|
return __async(this, null, function* () {
|
5069
|
-
const response = yield this.send({ channel_message_update: { clan_id, channel_id, message_id, content, mentions, mode } });
|
4892
|
+
const response = yield this.send({ channel_message_update: { clan_id, channel_id, message_id, content, mentions, attachments, mode } });
|
5070
4893
|
return response.channel_message_ack;
|
5071
4894
|
});
|
5072
4895
|
}
|
@@ -5133,6 +4956,18 @@ var _DefaultSocket = class _DefaultSocket {
|
|
5133
4956
|
return response.emojis_listed_event;
|
5134
4957
|
});
|
5135
4958
|
}
|
4959
|
+
ListChannelByUserId() {
|
4960
|
+
return __async(this, null, function* () {
|
4961
|
+
const response = yield this.send({ channel_desc_list_event: {} });
|
4962
|
+
return response.channel_desc_list_event;
|
4963
|
+
});
|
4964
|
+
}
|
4965
|
+
hashtagDMList(user_id, limit) {
|
4966
|
+
return __async(this, null, function* () {
|
4967
|
+
const response = yield this.send({ hashtag_dm_list_event: { user_id, limit } });
|
4968
|
+
return response.hashtag_dm_list_event;
|
4969
|
+
});
|
4970
|
+
}
|
5136
4971
|
listClanStickersByClanId(clan_id) {
|
5137
4972
|
return __async(this, null, function* () {
|
5138
4973
|
const response = yield this.send({ sticker_listed_event: { clan_id } });
|
@@ -5517,17 +5352,6 @@ var Client = class {
|
|
5517
5352
|
});
|
5518
5353
|
});
|
5519
5354
|
}
|
5520
|
-
/** Delete one or more storage objects */
|
5521
|
-
deleteStorageObjects(session, request) {
|
5522
|
-
return __async(this, null, function* () {
|
5523
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
5524
|
-
yield this.sessionRefresh(session);
|
5525
|
-
}
|
5526
|
-
return this.apiClient.deleteStorageObjects(session.token, request).then((response) => {
|
5527
|
-
return Promise.resolve(response != void 0);
|
5528
|
-
});
|
5529
|
-
});
|
5530
|
-
}
|
5531
5355
|
/** Delete a role by ID. */
|
5532
5356
|
deleteRole(session, roleId) {
|
5533
5357
|
return __async(this, null, function* () {
|
@@ -6219,65 +6043,6 @@ var Client = class {
|
|
6219
6043
|
});
|
6220
6044
|
});
|
6221
6045
|
}
|
6222
|
-
/** List storage objects. */
|
6223
|
-
listStorageObjects(session, collection, userId, limit, cursor) {
|
6224
|
-
return __async(this, null, function* () {
|
6225
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6226
|
-
yield this.sessionRefresh(session);
|
6227
|
-
}
|
6228
|
-
return this.apiClient.listStorageObjects(session.token, collection, userId, limit, cursor).then((response) => {
|
6229
|
-
var result = {
|
6230
|
-
objects: [],
|
6231
|
-
cursor: response.cursor
|
6232
|
-
};
|
6233
|
-
if (response.objects == null) {
|
6234
|
-
return Promise.resolve(result);
|
6235
|
-
}
|
6236
|
-
response.objects.forEach((o) => {
|
6237
|
-
result.objects.push({
|
6238
|
-
collection: o.collection,
|
6239
|
-
key: o.key,
|
6240
|
-
permission_read: o.permission_read ? Number(o.permission_read) : 0,
|
6241
|
-
permission_write: o.permission_write ? Number(o.permission_write) : 0,
|
6242
|
-
value: o.value ? JSON.parse(o.value) : void 0,
|
6243
|
-
version: o.version,
|
6244
|
-
user_id: o.user_id,
|
6245
|
-
create_time: o.create_time,
|
6246
|
-
update_time: o.update_time
|
6247
|
-
});
|
6248
|
-
});
|
6249
|
-
return Promise.resolve(result);
|
6250
|
-
});
|
6251
|
-
});
|
6252
|
-
}
|
6253
|
-
/** Fetch storage objects. */
|
6254
|
-
readStorageObjects(session, request) {
|
6255
|
-
return __async(this, null, function* () {
|
6256
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6257
|
-
yield this.sessionRefresh(session);
|
6258
|
-
}
|
6259
|
-
return this.apiClient.readStorageObjects(session.token, request).then((response) => {
|
6260
|
-
var result = { objects: [] };
|
6261
|
-
if (response.objects == null) {
|
6262
|
-
return Promise.resolve(result);
|
6263
|
-
}
|
6264
|
-
response.objects.forEach((o) => {
|
6265
|
-
result.objects.push({
|
6266
|
-
collection: o.collection,
|
6267
|
-
key: o.key,
|
6268
|
-
permission_read: o.permission_read ? Number(o.permission_read) : 0,
|
6269
|
-
permission_write: o.permission_write ? Number(o.permission_write) : 0,
|
6270
|
-
value: o.value ? JSON.parse(o.value) : void 0,
|
6271
|
-
version: o.version,
|
6272
|
-
user_id: o.user_id,
|
6273
|
-
create_time: o.create_time,
|
6274
|
-
update_time: o.update_time
|
6275
|
-
});
|
6276
|
-
});
|
6277
|
-
return Promise.resolve(result);
|
6278
|
-
});
|
6279
|
-
});
|
6280
|
-
}
|
6281
6046
|
/** Execute an RPC function on the server. */
|
6282
6047
|
rpc(session, basicAuthUsername, basicAuthPassword, id, input) {
|
6283
6048
|
return __async(this, null, function* () {
|
@@ -6564,26 +6329,6 @@ var Client = class {
|
|
6564
6329
|
});
|
6565
6330
|
});
|
6566
6331
|
}
|
6567
|
-
/** Write storage objects. */
|
6568
|
-
writeStorageObjects(session, objects) {
|
6569
|
-
return __async(this, null, function* () {
|
6570
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6571
|
-
yield this.sessionRefresh(session);
|
6572
|
-
}
|
6573
|
-
var request = { objects: [] };
|
6574
|
-
objects.forEach((o) => {
|
6575
|
-
request.objects.push({
|
6576
|
-
collection: o.collection,
|
6577
|
-
key: o.key,
|
6578
|
-
permission_read: o.permission_read,
|
6579
|
-
permission_write: o.permission_write,
|
6580
|
-
value: JSON.stringify(o.value),
|
6581
|
-
version: o.version
|
6582
|
-
});
|
6583
|
-
});
|
6584
|
-
return this.apiClient.writeStorageObjects(session.token, request);
|
6585
|
-
});
|
6586
|
-
}
|
6587
6332
|
/** Set default notification clan*/
|
6588
6333
|
setNotificationClan(session, request) {
|
6589
6334
|
return __async(this, null, function* () {
|
@@ -6767,16 +6512,6 @@ var Client = class {
|
|
6767
6512
|
});
|
6768
6513
|
});
|
6769
6514
|
}
|
6770
|
-
hashtagDmVoiceList(session, userId, limit) {
|
6771
|
-
return __async(this, null, function* () {
|
6772
|
-
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6773
|
-
yield this.sessionRefresh(session);
|
6774
|
-
}
|
6775
|
-
return this.apiClient.hashtagDMVoiceList(session.token, userId, limit).then((response) => {
|
6776
|
-
return Promise.resolve(response);
|
6777
|
-
});
|
6778
|
-
});
|
6779
|
-
}
|
6780
6515
|
//** */
|
6781
6516
|
deletePinMessage(session, message_id) {
|
6782
6517
|
return __async(this, null, function* () {
|
@@ -6816,7 +6551,7 @@ var Client = class {
|
|
6816
6551
|
if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
|
6817
6552
|
yield this.sessionRefresh(session);
|
6818
6553
|
}
|
6819
|
-
return this.apiClient.
|
6554
|
+
return this.apiClient.deleteClanEmojiById(session.token, id, clan_id).then((response) => {
|
6820
6555
|
return response !== void 0;
|
6821
6556
|
});
|
6822
6557
|
});
|
package/dist/socket.d.ts
CHANGED
@@ -270,6 +270,8 @@ interface ChannelMessageUpdate {
|
|
270
270
|
content: any;
|
271
271
|
/** mentions */
|
272
272
|
mentions?: Array<MessageMentionEvent>;
|
273
|
+
/** attachments */
|
274
|
+
attachments?: Array<MessageAttachmentEvent>;
|
273
275
|
/** The mode payload. */
|
274
276
|
mode: number;
|
275
277
|
};
|
@@ -469,6 +471,34 @@ export interface ClanEmoji {
|
|
469
471
|
shortname?: string;
|
470
472
|
src?: string;
|
471
473
|
}
|
474
|
+
/** */
|
475
|
+
export interface ChannelDescListEvent {
|
476
|
+
channeldesc?: Array<ChannelDescription>;
|
477
|
+
}
|
478
|
+
/** */
|
479
|
+
export interface ChannelDescription {
|
480
|
+
clan_id?: string;
|
481
|
+
channel_id?: string;
|
482
|
+
type?: number;
|
483
|
+
channel_label?: string;
|
484
|
+
channel_private?: number;
|
485
|
+
meeting_code?: string;
|
486
|
+
clan_name?: string;
|
487
|
+
}
|
488
|
+
export interface HashtagDmListEvent {
|
489
|
+
user_id?: Array<string>;
|
490
|
+
limit?: number;
|
491
|
+
hashtag_dm?: Array<HashtagDm>;
|
492
|
+
}
|
493
|
+
export interface HashtagDm {
|
494
|
+
channel_id?: string;
|
495
|
+
channel_label?: string;
|
496
|
+
clan_id?: string;
|
497
|
+
clan_name?: string;
|
498
|
+
meeting_code?: string;
|
499
|
+
type?: number;
|
500
|
+
channel_private?: number;
|
501
|
+
}
|
472
502
|
/** A socket connection to Mezon server. */
|
473
503
|
export interface Socket {
|
474
504
|
/** Connection is Open */
|
@@ -492,7 +522,7 @@ export interface Socket {
|
|
492
522
|
/** Unfollow one or more users from their status updates. */
|
493
523
|
unfollowUsers(user_ids: string[]): Promise<void>;
|
494
524
|
/** Update a chat message on a chat channel in the server. */
|
495
|
-
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id: string, content: any, mentions?: Array<ApiMessageMention>): Promise<ChannelMessageAck>;
|
525
|
+
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>): Promise<ChannelMessageAck>;
|
496
526
|
/** Update the status for the current user online. */
|
497
527
|
updateStatus(status?: string): Promise<void>;
|
498
528
|
/** Send a chat message to a chat channel on the server. */
|
@@ -563,6 +593,8 @@ export interface Socket {
|
|
563
593
|
checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
|
564
594
|
listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
|
565
595
|
listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
|
596
|
+
ListChannelByUserId(): Promise<ChannelDescListEvent>;
|
597
|
+
hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
|
566
598
|
}
|
567
599
|
/** Reports an error received from a socket message. */
|
568
600
|
export interface SocketError {
|
@@ -628,7 +660,7 @@ export declare class DefaultSocket implements Socket {
|
|
628
660
|
rpc(id?: string, payload?: string, http_key?: string): Promise<ApiRpc>;
|
629
661
|
sendPartyData(party_id: string, op_code: number, data: string | Uint8Array): Promise<void>;
|
630
662
|
unfollowUsers(user_ids: string[]): Promise<void>;
|
631
|
-
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id: string, content: any, mentions?: Array<ApiMessageMention>): Promise<ChannelMessageAck>;
|
663
|
+
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id: string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>): Promise<ChannelMessageAck>;
|
632
664
|
updateStatus(status?: string): Promise<void>;
|
633
665
|
writeChatMessage(clan_id: string, channel_id: string, mode: number, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>, references?: Array<ApiMessageRef>, anonymous_message?: boolean, mention_everyone?: Boolean, notifi_content?: any): Promise<ChannelMessageAck>;
|
634
666
|
writeMessageReaction(id: string, clan_id: string, channel_id: string, mode: number, message_id: string, emoji_id: string, emoji: string, count: number, message_sender_id: string, action_delete: boolean): Promise<MessageReactionEvent>;
|
@@ -640,6 +672,8 @@ export declare class DefaultSocket implements Socket {
|
|
640
672
|
writeCustomStatus(clan_id: string, status: string): Promise<CustomStatusEvent>;
|
641
673
|
checkDuplicateClanName(clan_name: string): Promise<ClanNameExistedEvent>;
|
642
674
|
listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
|
675
|
+
ListChannelByUserId(): Promise<ChannelDescListEvent>;
|
676
|
+
hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
|
643
677
|
listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
|
644
678
|
private pingPong;
|
645
679
|
}
|
package/package.json
CHANGED
package/socket.ts
CHANGED
@@ -381,6 +381,8 @@ interface ChannelMessageUpdate {
|
|
381
381
|
content: any,
|
382
382
|
/** mentions */
|
383
383
|
mentions?: Array<MessageMentionEvent>;
|
384
|
+
/** attachments */
|
385
|
+
attachments?: Array<MessageAttachmentEvent>;
|
384
386
|
/** The mode payload. */
|
385
387
|
mode: number;
|
386
388
|
};
|
@@ -673,6 +675,58 @@ export interface ClanEmoji {
|
|
673
675
|
src?: string;
|
674
676
|
}
|
675
677
|
|
678
|
+
/** */
|
679
|
+
export interface ChannelDescListEvent {
|
680
|
+
//
|
681
|
+
channeldesc?: Array<ChannelDescription>;
|
682
|
+
}
|
683
|
+
|
684
|
+
/** */
|
685
|
+
export interface ChannelDescription {
|
686
|
+
// The clan of this channel
|
687
|
+
clan_id?: string;
|
688
|
+
// The channel this message belongs to.
|
689
|
+
channel_id?: string;
|
690
|
+
// The channel type.
|
691
|
+
type?: number;
|
692
|
+
// The channel lable
|
693
|
+
channel_label?: string;
|
694
|
+
// The channel private
|
695
|
+
channel_private?: number;
|
696
|
+
// meeting code
|
697
|
+
meeting_code?: string;
|
698
|
+
//
|
699
|
+
clan_name?: string;
|
700
|
+
}
|
701
|
+
|
702
|
+
// A list of Channel
|
703
|
+
export interface HashtagDmListEvent {
|
704
|
+
// user Id
|
705
|
+
user_id?: Array<string>;
|
706
|
+
// Max number of records to return. Between 1 and 100.
|
707
|
+
limit?: number;
|
708
|
+
// A list of channel.
|
709
|
+
hashtag_dm?: Array<HashtagDm>;
|
710
|
+
}
|
711
|
+
|
712
|
+
// hashtagDM
|
713
|
+
export interface HashtagDm {
|
714
|
+
// The channel id.
|
715
|
+
channel_id?: string;
|
716
|
+
// The channel lable
|
717
|
+
channel_label?: string;
|
718
|
+
// The clan of this channel
|
719
|
+
clan_id?: string;
|
720
|
+
// The clan name
|
721
|
+
clan_name?: string;
|
722
|
+
//
|
723
|
+
meeting_code?: string;
|
724
|
+
//
|
725
|
+
type?: number;
|
726
|
+
//
|
727
|
+
channel_private?: number;
|
728
|
+
}
|
729
|
+
|
676
730
|
/** A socket connection to Mezon server. */
|
677
731
|
export interface Socket {
|
678
732
|
/** Connection is Open */
|
@@ -706,7 +760,7 @@ export interface Socket {
|
|
706
760
|
unfollowUsers(user_ids : string[]) : Promise<void>;
|
707
761
|
|
708
762
|
/** Update a chat message on a chat channel in the server. */
|
709
|
-
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id : string, content: any, mentions?: Array<ApiMessageMention>) : Promise<ChannelMessageAck>;
|
763
|
+
updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id : string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>) : Promise<ChannelMessageAck>;
|
710
764
|
|
711
765
|
/** Update the status for the current user online. */
|
712
766
|
updateStatus(status? : string) : Promise<void>;
|
@@ -828,6 +882,10 @@ export interface Socket {
|
|
828
882
|
listClanEmojiByClanId(clan_id: string): Promise<EmojiListedEvent>;
|
829
883
|
|
830
884
|
listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent>;
|
885
|
+
|
886
|
+
ListChannelByUserId(): Promise<ChannelDescListEvent>;
|
887
|
+
|
888
|
+
hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent>;
|
831
889
|
}
|
832
890
|
|
833
891
|
/** Reports an error received from a socket message. */
|
@@ -1312,8 +1370,8 @@ export class DefaultSocket implements Socket {
|
|
1312
1370
|
return this.send({status_unfollow: {user_ids: user_ids}});
|
1313
1371
|
}
|
1314
1372
|
|
1315
|
-
async updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id : string, content: any, mentions?: Array<ApiMessageMention>): Promise<ChannelMessageAck> {
|
1316
|
-
const response = await this.send({channel_message_update: {clan_id: clan_id, channel_id: channel_id, message_id: message_id, content: content, mentions: mentions, mode: mode}});
|
1373
|
+
async updateChatMessage(clan_id: string, channel_id: string, mode: number, message_id : string, content: any, mentions?: Array<ApiMessageMention>, attachments?: Array<ApiMessageAttachment>): Promise<ChannelMessageAck> {
|
1374
|
+
const response = await this.send({channel_message_update: {clan_id: clan_id, channel_id: channel_id, message_id: message_id, content: content, mentions: mentions, attachments: attachments, mode: mode}});
|
1317
1375
|
return response.channel_message_ack;
|
1318
1376
|
}
|
1319
1377
|
|
@@ -1371,6 +1429,16 @@ export class DefaultSocket implements Socket {
|
|
1371
1429
|
return response.emojis_listed_event
|
1372
1430
|
}
|
1373
1431
|
|
1432
|
+
async ListChannelByUserId(): Promise<ChannelDescListEvent> {
|
1433
|
+
const response = await this.send({channel_desc_list_event: {}});
|
1434
|
+
return response.channel_desc_list_event
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
async hashtagDMList(user_id: Array<string>, limit: number): Promise<HashtagDmListEvent> {
|
1438
|
+
const response = await this.send({hashtag_dm_list_event: {user_id: user_id, limit: limit }});
|
1439
|
+
return response.hashtag_dm_list_event
|
1440
|
+
}
|
1441
|
+
|
1374
1442
|
async listClanStickersByClanId(clan_id: string): Promise<StrickerListedEvent> {
|
1375
1443
|
const response = await this.send({sticker_listed_event: {clan_id: clan_id}});
|
1376
1444
|
return response.sticker_listed_event
|