mezon-js-protobuf 1.8.86 → 1.8.87

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/api.ts CHANGED
@@ -3614,10 +3614,10 @@ export interface Message2InboxRequest {
3614
3614
  clan_id: string;
3615
3615
  avatar: string;
3616
3616
  content: string;
3617
- mentions: Uint8Array;
3618
- attachments: Uint8Array;
3619
- reactions: Uint8Array;
3620
- references: Uint8Array;
3617
+ mentions: MessageMention[];
3618
+ attachments: MessageAttachment[];
3619
+ reactions: MessageReaction[];
3620
+ references: MessageRef[];
3621
3621
  }
3622
3622
 
3623
3623
  /** Send an email with password to the server. Used with authenticate/link/unlink. */
@@ -37306,10 +37306,10 @@ function createBaseMessage2InboxRequest(): Message2InboxRequest {
37306
37306
  clan_id: "",
37307
37307
  avatar: "",
37308
37308
  content: "",
37309
- mentions: new Uint8Array(0),
37310
- attachments: new Uint8Array(0),
37311
- reactions: new Uint8Array(0),
37312
- references: new Uint8Array(0),
37309
+ mentions: [],
37310
+ attachments: [],
37311
+ reactions: [],
37312
+ references: [],
37313
37313
  };
37314
37314
  }
37315
37315
 
@@ -37330,17 +37330,17 @@ export const Message2InboxRequest = {
37330
37330
  if (message.content !== "") {
37331
37331
  writer.uint32(42).string(message.content);
37332
37332
  }
37333
- if (message.mentions.length !== 0) {
37334
- writer.uint32(50).bytes(message.mentions);
37333
+ for (const v of message.mentions) {
37334
+ MessageMention.encode(v!, writer.uint32(50).fork()).ldelim();
37335
37335
  }
37336
- if (message.attachments.length !== 0) {
37337
- writer.uint32(58).bytes(message.attachments);
37336
+ for (const v of message.attachments) {
37337
+ MessageAttachment.encode(v!, writer.uint32(58).fork()).ldelim();
37338
37338
  }
37339
- if (message.reactions.length !== 0) {
37340
- writer.uint32(66).bytes(message.reactions);
37339
+ for (const v of message.reactions) {
37340
+ MessageReaction.encode(v!, writer.uint32(66).fork()).ldelim();
37341
37341
  }
37342
- if (message.references.length !== 0) {
37343
- writer.uint32(74).bytes(message.references);
37342
+ for (const v of message.references) {
37343
+ MessageRef.encode(v!, writer.uint32(74).fork()).ldelim();
37344
37344
  }
37345
37345
  return writer;
37346
37346
  },
@@ -37392,28 +37392,28 @@ export const Message2InboxRequest = {
37392
37392
  break;
37393
37393
  }
37394
37394
 
37395
- message.mentions = reader.bytes();
37395
+ message.mentions.push(MessageMention.decode(reader, reader.uint32()));
37396
37396
  continue;
37397
37397
  case 7:
37398
37398
  if (tag !== 58) {
37399
37399
  break;
37400
37400
  }
37401
37401
 
37402
- message.attachments = reader.bytes();
37402
+ message.attachments.push(MessageAttachment.decode(reader, reader.uint32()));
37403
37403
  continue;
37404
37404
  case 8:
37405
37405
  if (tag !== 66) {
37406
37406
  break;
37407
37407
  }
37408
37408
 
37409
- message.reactions = reader.bytes();
37409
+ message.reactions.push(MessageReaction.decode(reader, reader.uint32()));
37410
37410
  continue;
37411
37411
  case 9:
37412
37412
  if (tag !== 74) {
37413
37413
  break;
37414
37414
  }
37415
37415
 
37416
- message.references = reader.bytes();
37416
+ message.references.push(MessageRef.decode(reader, reader.uint32()));
37417
37417
  continue;
37418
37418
  }
37419
37419
  if ((tag & 7) === 4 || tag === 0) {
@@ -37431,10 +37431,18 @@ export const Message2InboxRequest = {
37431
37431
  clan_id: isSet(object.clan_id) ? globalThis.String(object.clan_id) : "",
37432
37432
  avatar: isSet(object.avatar) ? globalThis.String(object.avatar) : "",
37433
37433
  content: isSet(object.content) ? globalThis.String(object.content) : "",
37434
- mentions: isSet(object.mentions) ? bytesFromBase64(object.mentions) : new Uint8Array(0),
37435
- attachments: isSet(object.attachments) ? bytesFromBase64(object.attachments) : new Uint8Array(0),
37436
- reactions: isSet(object.reactions) ? bytesFromBase64(object.reactions) : new Uint8Array(0),
37437
- references: isSet(object.references) ? bytesFromBase64(object.references) : new Uint8Array(0),
37434
+ mentions: globalThis.Array.isArray(object?.mentions)
37435
+ ? object.mentions.map((e: any) => MessageMention.fromJSON(e))
37436
+ : [],
37437
+ attachments: globalThis.Array.isArray(object?.attachments)
37438
+ ? object.attachments.map((e: any) => MessageAttachment.fromJSON(e))
37439
+ : [],
37440
+ reactions: globalThis.Array.isArray(object?.reactions)
37441
+ ? object.reactions.map((e: any) => MessageReaction.fromJSON(e))
37442
+ : [],
37443
+ references: globalThis.Array.isArray(object?.references)
37444
+ ? object.references.map((e: any) => MessageRef.fromJSON(e))
37445
+ : [],
37438
37446
  };
37439
37447
  },
37440
37448
 
@@ -37455,17 +37463,17 @@ export const Message2InboxRequest = {
37455
37463
  if (message.content !== "") {
37456
37464
  obj.content = message.content;
37457
37465
  }
37458
- if (message.mentions.length !== 0) {
37459
- obj.mentions = base64FromBytes(message.mentions);
37466
+ if (message.mentions?.length) {
37467
+ obj.mentions = message.mentions.map((e) => MessageMention.toJSON(e));
37460
37468
  }
37461
- if (message.attachments.length !== 0) {
37462
- obj.attachments = base64FromBytes(message.attachments);
37469
+ if (message.attachments?.length) {
37470
+ obj.attachments = message.attachments.map((e) => MessageAttachment.toJSON(e));
37463
37471
  }
37464
- if (message.reactions.length !== 0) {
37465
- obj.reactions = base64FromBytes(message.reactions);
37472
+ if (message.reactions?.length) {
37473
+ obj.reactions = message.reactions.map((e) => MessageReaction.toJSON(e));
37466
37474
  }
37467
- if (message.references.length !== 0) {
37468
- obj.references = base64FromBytes(message.references);
37475
+ if (message.references?.length) {
37476
+ obj.references = message.references.map((e) => MessageRef.toJSON(e));
37469
37477
  }
37470
37478
  return obj;
37471
37479
  },
@@ -37480,10 +37488,10 @@ export const Message2InboxRequest = {
37480
37488
  message.clan_id = object.clan_id ?? "";
37481
37489
  message.avatar = object.avatar ?? "";
37482
37490
  message.content = object.content ?? "";
37483
- message.mentions = object.mentions ?? new Uint8Array(0);
37484
- message.attachments = object.attachments ?? new Uint8Array(0);
37485
- message.reactions = object.reactions ?? new Uint8Array(0);
37486
- message.references = object.references ?? new Uint8Array(0);
37491
+ message.mentions = object.mentions?.map((e) => MessageMention.fromPartial(e)) || [];
37492
+ message.attachments = object.attachments?.map((e) => MessageAttachment.fromPartial(e)) || [];
37493
+ message.reactions = object.reactions?.map((e) => MessageReaction.fromPartial(e)) || [];
37494
+ message.references = object.references?.map((e) => MessageRef.fromPartial(e)) || [];
37487
37495
  return message;
37488
37496
  },
37489
37497
  };