mezon-js 2.9.7 → 2.9.9

Sign up to get free protection for your applications and to get access to all the features.
package/api.gen.ts CHANGED
@@ -3470,9 +3470,10 @@ export class MezonApi {
3470
3470
  /** List a channel's message history. */
3471
3471
  listChannelMessages(bearerToken: string,
3472
3472
  channelId:string,
3473
+ clanId?:string,
3473
3474
  messageId?:string,
3474
- direction?:number,
3475
3475
  limit?:number,
3476
+ direction?:number,
3476
3477
  options: any = {}): Promise<ApiChannelMessageList> {
3477
3478
 
3478
3479
  if (channelId === null || channelId === undefined) {
@@ -3481,6 +3482,7 @@ export class MezonApi {
3481
3482
  const urlPath = "/v2/channel/{channelId}"
3482
3483
  .replace("{channelId}", encodeURIComponent(String(channelId)));
3483
3484
  const queryParams = new Map<string, any>();
3485
+ queryParams.set("clan_id", clanId);
3484
3486
  queryParams.set("message_id", messageId);
3485
3487
  queryParams.set("limit", limit);
3486
3488
  queryParams.set("direction", direction);
package/client.ts CHANGED
@@ -127,8 +127,9 @@ export enum ChannelType {
127
127
  CHANNEL_TYPE_VOICE = 4,
128
128
  CHANNEL_TYPE_FORUM = 5,
129
129
  CHANNEL_TYPE_STREAMING = 6,
130
- CHANNEL_TYPE_APP = 7,
131
- CHANNEL_TYPE_ANNOUNCEMENT = 8,
130
+ CHANNEL_TYPE_THREAD = 7,
131
+ CHANNEL_TYPE_APP = 8,
132
+ CHANNEL_TYPE_ANNOUNCEMENT = 9,
132
133
  }
133
134
  export enum ChannelStreamMode {
134
135
  STREAM_MODE_CHANNEL = 2,
@@ -1330,6 +1331,7 @@ export class Client {
1330
1331
  /** List a channel's message history. */
1331
1332
  async listChannelMessages(
1332
1333
  session: Session,
1334
+ clanId: string,
1333
1335
  channelId: string,
1334
1336
  messageId?: string,
1335
1337
  direction?: number,
@@ -1346,6 +1348,7 @@ export class Client {
1346
1348
  return this.apiClient
1347
1349
  .listChannelMessages(
1348
1350
  session.token,
1351
+ clanId,
1349
1352
  channelId,
1350
1353
  messageId,
1351
1354
  direction,
package/dist/api.gen.d.ts CHANGED
@@ -1152,7 +1152,7 @@ export declare class MezonApi {
1152
1152
  /** List channel apps. */
1153
1153
  listChannelApps(bearerToken: string, clanId?: string, options?: any): Promise<ApiListChannelAppsResponse>;
1154
1154
  /** List a channel's message history. */
1155
- listChannelMessages(bearerToken: string, channelId: string, messageId?: string, direction?: number, limit?: number, options?: any): Promise<ApiChannelMessageList>;
1155
+ listChannelMessages(bearerToken: string, channelId: string, clanId?: string, messageId?: string, limit?: number, direction?: number, options?: any): Promise<ApiChannelMessageList>;
1156
1156
  /** Add users to a channel. */
1157
1157
  addChannelUsers(bearerToken: string, channelId: string, userIds?: Array<string>, options?: any): Promise<any>;
1158
1158
  /** List all attachment that are part of a channel. */
package/dist/client.d.ts CHANGED
@@ -24,8 +24,9 @@ export declare enum ChannelType {
24
24
  CHANNEL_TYPE_VOICE = 4,
25
25
  CHANNEL_TYPE_FORUM = 5,
26
26
  CHANNEL_TYPE_STREAMING = 6,
27
- CHANNEL_TYPE_APP = 7,
28
- CHANNEL_TYPE_ANNOUNCEMENT = 8
27
+ CHANNEL_TYPE_THREAD = 7,
28
+ CHANNEL_TYPE_APP = 8,
29
+ CHANNEL_TYPE_ANNOUNCEMENT = 9
29
30
  }
30
31
  export declare enum ChannelStreamMode {
31
32
  STREAM_MODE_CHANNEL = 2,
@@ -401,7 +402,7 @@ export declare class Client {
401
402
  /** Kick users from a channel, or decline their join requests. */
402
403
  removeChannelUsers(session: Session, channelId: string, ids?: Array<string>): Promise<boolean>;
403
404
  /** List a channel's message history. */
404
- listChannelMessages(session: Session, channelId: string, messageId?: string, direction?: number, limit?: number): Promise<ChannelMessageList>;
405
+ listChannelMessages(session: Session, clanId: string, channelId: string, messageId?: string, direction?: number, limit?: number): Promise<ChannelMessageList>;
405
406
  /** List a channel's users. */
406
407
  listChannelVoiceUsers(session: Session, clanId: string, channelId: string, channelType: number, state?: number, limit?: number, cursor?: string): Promise<ApiVoiceChannelUserList>;
407
408
  /** List a channel's users. */
@@ -1973,12 +1973,13 @@ var MezonApi = class {
1973
1973
  ]);
1974
1974
  }
1975
1975
  /** List a channel's message history. */
1976
- listChannelMessages(bearerToken, channelId, messageId, direction, limit, options = {}) {
1976
+ listChannelMessages(bearerToken, channelId, clanId, messageId, limit, direction, options = {}) {
1977
1977
  if (channelId === null || channelId === void 0) {
1978
1978
  throw new Error("'channelId' is a required parameter but is null or undefined.");
1979
1979
  }
1980
1980
  const urlPath = "/v2/channel/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
1981
1981
  const queryParams = /* @__PURE__ */ new Map();
1982
+ queryParams.set("clan_id", clanId);
1982
1983
  queryParams.set("message_id", messageId);
1983
1984
  queryParams.set("limit", limit);
1984
1985
  queryParams.set("direction", direction);
@@ -5663,8 +5664,9 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
5663
5664
  ChannelType2[ChannelType2["CHANNEL_TYPE_VOICE"] = 4] = "CHANNEL_TYPE_VOICE";
5664
5665
  ChannelType2[ChannelType2["CHANNEL_TYPE_FORUM"] = 5] = "CHANNEL_TYPE_FORUM";
5665
5666
  ChannelType2[ChannelType2["CHANNEL_TYPE_STREAMING"] = 6] = "CHANNEL_TYPE_STREAMING";
5666
- ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 7] = "CHANNEL_TYPE_APP";
5667
- ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 8] = "CHANNEL_TYPE_ANNOUNCEMENT";
5667
+ ChannelType2[ChannelType2["CHANNEL_TYPE_THREAD"] = 7] = "CHANNEL_TYPE_THREAD";
5668
+ ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 8] = "CHANNEL_TYPE_APP";
5669
+ ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 9] = "CHANNEL_TYPE_ANNOUNCEMENT";
5668
5670
  return ChannelType2;
5669
5671
  })(ChannelType || {});
5670
5672
  var ChannelStreamMode = /* @__PURE__ */ ((ChannelStreamMode2) => {
@@ -6198,13 +6200,14 @@ var Client = class {
6198
6200
  });
6199
6201
  }
6200
6202
  /** List a channel's message history. */
6201
- listChannelMessages(session, channelId, messageId, direction, limit) {
6203
+ listChannelMessages(session, clanId, channelId, messageId, direction, limit) {
6202
6204
  return __async(this, null, function* () {
6203
6205
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6204
6206
  yield this.sessionRefresh(session);
6205
6207
  }
6206
6208
  return this.apiClient.listChannelMessages(
6207
6209
  session.token,
6210
+ clanId,
6208
6211
  channelId,
6209
6212
  messageId,
6210
6213
  direction,
@@ -1944,12 +1944,13 @@ var MezonApi = class {
1944
1944
  ]);
1945
1945
  }
1946
1946
  /** List a channel's message history. */
1947
- listChannelMessages(bearerToken, channelId, messageId, direction, limit, options = {}) {
1947
+ listChannelMessages(bearerToken, channelId, clanId, messageId, limit, direction, options = {}) {
1948
1948
  if (channelId === null || channelId === void 0) {
1949
1949
  throw new Error("'channelId' is a required parameter but is null or undefined.");
1950
1950
  }
1951
1951
  const urlPath = "/v2/channel/{channelId}".replace("{channelId}", encodeURIComponent(String(channelId)));
1952
1952
  const queryParams = /* @__PURE__ */ new Map();
1953
+ queryParams.set("clan_id", clanId);
1953
1954
  queryParams.set("message_id", messageId);
1954
1955
  queryParams.set("limit", limit);
1955
1956
  queryParams.set("direction", direction);
@@ -5634,8 +5635,9 @@ var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
5634
5635
  ChannelType2[ChannelType2["CHANNEL_TYPE_VOICE"] = 4] = "CHANNEL_TYPE_VOICE";
5635
5636
  ChannelType2[ChannelType2["CHANNEL_TYPE_FORUM"] = 5] = "CHANNEL_TYPE_FORUM";
5636
5637
  ChannelType2[ChannelType2["CHANNEL_TYPE_STREAMING"] = 6] = "CHANNEL_TYPE_STREAMING";
5637
- ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 7] = "CHANNEL_TYPE_APP";
5638
- ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 8] = "CHANNEL_TYPE_ANNOUNCEMENT";
5638
+ ChannelType2[ChannelType2["CHANNEL_TYPE_THREAD"] = 7] = "CHANNEL_TYPE_THREAD";
5639
+ ChannelType2[ChannelType2["CHANNEL_TYPE_APP"] = 8] = "CHANNEL_TYPE_APP";
5640
+ ChannelType2[ChannelType2["CHANNEL_TYPE_ANNOUNCEMENT"] = 9] = "CHANNEL_TYPE_ANNOUNCEMENT";
5639
5641
  return ChannelType2;
5640
5642
  })(ChannelType || {});
5641
5643
  var ChannelStreamMode = /* @__PURE__ */ ((ChannelStreamMode2) => {
@@ -6169,13 +6171,14 @@ var Client = class {
6169
6171
  });
6170
6172
  }
6171
6173
  /** List a channel's message history. */
6172
- listChannelMessages(session, channelId, messageId, direction, limit) {
6174
+ listChannelMessages(session, clanId, channelId, messageId, direction, limit) {
6173
6175
  return __async(this, null, function* () {
6174
6176
  if (this.autoRefreshSession && session.refresh_token && session.isexpired((Date.now() + this.expiredTimespanMs) / 1e3)) {
6175
6177
  yield this.sessionRefresh(session);
6176
6178
  }
6177
6179
  return this.apiClient.listChannelMessages(
6178
6180
  session.token,
6181
+ clanId,
6179
6182
  channelId,
6180
6183
  messageId,
6181
6184
  direction,
package/dist/socket.d.ts CHANGED
@@ -135,6 +135,7 @@ export interface LastPinMessageEvent {
135
135
  }
136
136
  /** Last seen message by user */
137
137
  export interface LastSeenMessageEvent {
138
+ clan_id: string;
138
139
  /** The channel this message belongs to. */
139
140
  channel_id: string;
140
141
  mode: number;
@@ -224,6 +225,8 @@ interface ChannelMessageUpdate {
224
225
  /** Remove a message previously sent to a realtime chat channel. */
225
226
  interface ChannelMessageRemove {
226
227
  channel_message_remove: {
228
+ /** The clan id */
229
+ clan_id: string;
227
230
  /** The server-assigned channel ID. */
228
231
  channel_id: string;
229
232
  mode: number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mezon-js",
3
3
 
4
- "version": "2.9.7",
4
+ "version": "2.9.9",
5
5
 
6
6
  "scripts": {
7
7
  "build": "npx tsc && npx rollup -c --bundleConfigAsCjs && node build.mjs"
package/socket.ts CHANGED
@@ -184,8 +184,10 @@ export interface LastPinMessageEvent {
184
184
 
185
185
  /** Last seen message by user */
186
186
  export interface LastSeenMessageEvent {
187
+ // The clan id
188
+ clan_id: string;
187
189
  /** The channel this message belongs to. */
188
- channel_id:string;
190
+ channel_id: string;
189
191
  // The mode
190
192
  mode: number;
191
193
  // The channel label
@@ -307,8 +309,10 @@ interface ChannelMessageUpdate {
307
309
  /** Remove a message previously sent to a realtime chat channel. */
308
310
  interface ChannelMessageRemove {
309
311
  channel_message_remove: {
312
+ /** The clan id */
313
+ clan_id: string;
310
314
  /** The server-assigned channel ID. */
311
- channel_id:string;
315
+ channel_id: string;
312
316
  // The mode
313
317
  mode: number;
314
318
  // The channel label