mezon-js-protobuf 1.7.2 → 1.7.3

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.
@@ -5099,6 +5099,115 @@ var Permission = {
5099
5099
  return message;
5100
5100
  }
5101
5101
  };
5102
+ function createBaseNotificationUserChannel() {
5103
+ return { id: "", notification_setting_type: 0, time_mute: void 0, active: 0, channel_id: "" };
5104
+ }
5105
+ var NotificationUserChannel = {
5106
+ encode(message, writer = import_minimal4.default.Writer.create()) {
5107
+ if (message.id !== "") {
5108
+ writer.uint32(10).string(message.id);
5109
+ }
5110
+ if (message.notification_setting_type !== 0) {
5111
+ writer.uint32(16).int32(message.notification_setting_type);
5112
+ }
5113
+ if (message.time_mute !== void 0) {
5114
+ Timestamp.encode(toTimestamp(message.time_mute), writer.uint32(26).fork()).ldelim();
5115
+ }
5116
+ if (message.active !== 0) {
5117
+ writer.uint32(32).int32(message.active);
5118
+ }
5119
+ if (message.channel_id !== "") {
5120
+ writer.uint32(42).string(message.channel_id);
5121
+ }
5122
+ return writer;
5123
+ },
5124
+ decode(input, length) {
5125
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
5126
+ let end = length === void 0 ? reader.len : reader.pos + length;
5127
+ const message = createBaseNotificationUserChannel();
5128
+ while (reader.pos < end) {
5129
+ const tag = reader.uint32();
5130
+ switch (tag >>> 3) {
5131
+ case 1:
5132
+ if (tag !== 10) {
5133
+ break;
5134
+ }
5135
+ message.id = reader.string();
5136
+ continue;
5137
+ case 2:
5138
+ if (tag !== 16) {
5139
+ break;
5140
+ }
5141
+ message.notification_setting_type = reader.int32();
5142
+ continue;
5143
+ case 3:
5144
+ if (tag !== 26) {
5145
+ break;
5146
+ }
5147
+ message.time_mute = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
5148
+ continue;
5149
+ case 4:
5150
+ if (tag !== 32) {
5151
+ break;
5152
+ }
5153
+ message.active = reader.int32();
5154
+ continue;
5155
+ case 5:
5156
+ if (tag !== 42) {
5157
+ break;
5158
+ }
5159
+ message.channel_id = reader.string();
5160
+ continue;
5161
+ }
5162
+ if ((tag & 7) === 4 || tag === 0) {
5163
+ break;
5164
+ }
5165
+ reader.skipType(tag & 7);
5166
+ }
5167
+ return message;
5168
+ },
5169
+ fromJSON(object) {
5170
+ return {
5171
+ id: isSet3(object.id) ? globalThis.String(object.id) : "",
5172
+ notification_setting_type: isSet3(object.notification_setting_type) ? globalThis.Number(object.notification_setting_type) : 0,
5173
+ time_mute: isSet3(object.time_mute) ? fromJsonTimestamp(object.time_mute) : void 0,
5174
+ active: isSet3(object.active) ? globalThis.Number(object.active) : 0,
5175
+ channel_id: isSet3(object.channel_id) ? globalThis.String(object.channel_id) : ""
5176
+ };
5177
+ },
5178
+ toJSON(message) {
5179
+ const obj = {};
5180
+ if (message.id !== "") {
5181
+ obj.id = message.id;
5182
+ }
5183
+ if (message.notification_setting_type !== 0) {
5184
+ obj.notification_setting_type = Math.round(message.notification_setting_type);
5185
+ }
5186
+ if (message.time_mute !== void 0) {
5187
+ obj.time_mute = message.time_mute.toISOString();
5188
+ }
5189
+ if (message.active !== 0) {
5190
+ obj.active = Math.round(message.active);
5191
+ }
5192
+ if (message.channel_id !== "") {
5193
+ obj.channel_id = message.channel_id;
5194
+ }
5195
+ return obj;
5196
+ },
5197
+ create(base) {
5198
+ return NotificationUserChannel.fromPartial(base != null ? base : {});
5199
+ },
5200
+ fromPartial(object) {
5201
+ var _a, _b, _c, _d, _e;
5202
+ const message = createBaseNotificationUserChannel();
5203
+ message.id = (_a = object.id) != null ? _a : "";
5204
+ message.notification_setting_type = (_b = object.notification_setting_type) != null ? _b : 0;
5205
+ message.time_mute = (_c = object.time_mute) != null ? _c : void 0;
5206
+ message.active = (_d = object.active) != null ? _d : 0;
5207
+ message.channel_id = (_e = object.channel_id) != null ? _e : "";
5208
+ return message;
5209
+ }
5210
+ };
5102
5211
  function createBasePermissionList() {
5103
5212
  return { permissions: [], max_level_permission: 0 };
5104
5213
  }
@@ -6430,7 +6539,8 @@ function createBaseEnvelope() {
6430
6539
  channel_app_event: void 0,
6431
6540
  user_status_event: void 0,
6432
6541
  remove_friend: void 0,
6433
- webhook_event: void 0
6542
+ webhook_event: void 0,
6543
+ noti_user_channel: void 0
6434
6544
  };
6435
6545
  }
6436
6546
  var Envelope = {
@@ -6648,6 +6758,9 @@ var Envelope = {
6648
6758
  if (message.webhook_event !== void 0) {
6649
6759
  Webhook.encode(message.webhook_event, writer.uint32(570).fork()).ldelim();
6650
6760
  }
6761
+ if (message.noti_user_channel !== void 0) {
6762
+ NotificationUserChannel.encode(message.noti_user_channel, writer.uint32(578).fork()).ldelim();
6763
+ }
6651
6764
  return writer;
6652
6765
  },
6653
6766
  decode(input, length) {
@@ -7083,6 +7196,12 @@ var Envelope = {
7083
7196
  }
7084
7197
  message.webhook_event = Webhook.decode(reader, reader.uint32());
7085
7198
  continue;
7199
+ case 72:
7200
+ if (tag !== 578) {
7201
+ break;
7202
+ }
7203
+ message.noti_user_channel = NotificationUserChannel.decode(reader, reader.uint32());
7204
+ continue;
7086
7205
  }
7087
7206
  if ((tag & 7) === 4 || tag === 0) {
7088
7207
  break;
@@ -7163,7 +7282,8 @@ var Envelope = {
7163
7282
  channel_app_event: isSet4(object.channel_app_event) ? ChannelAppEvent.fromJSON(object.channel_app_event) : void 0,
7164
7283
  user_status_event: isSet4(object.user_status_event) ? UserStatusEvent.fromJSON(object.user_status_event) : void 0,
7165
7284
  remove_friend: isSet4(object.remove_friend) ? RemoveFriend.fromJSON(object.remove_friend) : void 0,
7166
- webhook_event: isSet4(object.webhook_event) ? Webhook.fromJSON(object.webhook_event) : void 0
7285
+ webhook_event: isSet4(object.webhook_event) ? Webhook.fromJSON(object.webhook_event) : void 0,
7286
+ noti_user_channel: isSet4(object.noti_user_channel) ? NotificationUserChannel.fromJSON(object.noti_user_channel) : void 0
7167
7287
  };
7168
7288
  },
7169
7289
  toJSON(message) {
@@ -7381,6 +7501,9 @@ var Envelope = {
7381
7501
  if (message.webhook_event !== void 0) {
7382
7502
  obj.webhook_event = Webhook.toJSON(message.webhook_event);
7383
7503
  }
7504
+ if (message.noti_user_channel !== void 0) {
7505
+ obj.noti_user_channel = NotificationUserChannel.toJSON(message.noti_user_channel);
7506
+ }
7384
7507
  return obj;
7385
7508
  },
7386
7509
  create(base) {
@@ -7460,6 +7583,7 @@ var Envelope = {
7460
7583
  message.user_status_event = object.user_status_event !== void 0 && object.user_status_event !== null ? UserStatusEvent.fromPartial(object.user_status_event) : void 0;
7461
7584
  message.remove_friend = object.remove_friend !== void 0 && object.remove_friend !== null ? RemoveFriend.fromPartial(object.remove_friend) : void 0;
7462
7585
  message.webhook_event = object.webhook_event !== void 0 && object.webhook_event !== null ? Webhook.fromPartial(object.webhook_event) : void 0;
7586
+ message.noti_user_channel = object.noti_user_channel !== void 0 && object.noti_user_channel !== null ? NotificationUserChannel.fromPartial(object.noti_user_channel) : void 0;
7463
7587
  return message;
7464
7588
  }
7465
7589
  };
@@ -5086,6 +5086,115 @@ var Permission = {
5086
5086
  return message;
5087
5087
  }
5088
5088
  };
5089
+ function createBaseNotificationUserChannel() {
5090
+ return { id: "", notification_setting_type: 0, time_mute: void 0, active: 0, channel_id: "" };
5091
+ }
5092
+ var NotificationUserChannel = {
5093
+ encode(message, writer = import_minimal4.default.Writer.create()) {
5094
+ if (message.id !== "") {
5095
+ writer.uint32(10).string(message.id);
5096
+ }
5097
+ if (message.notification_setting_type !== 0) {
5098
+ writer.uint32(16).int32(message.notification_setting_type);
5099
+ }
5100
+ if (message.time_mute !== void 0) {
5101
+ Timestamp.encode(toTimestamp(message.time_mute), writer.uint32(26).fork()).ldelim();
5102
+ }
5103
+ if (message.active !== 0) {
5104
+ writer.uint32(32).int32(message.active);
5105
+ }
5106
+ if (message.channel_id !== "") {
5107
+ writer.uint32(42).string(message.channel_id);
5108
+ }
5109
+ return writer;
5110
+ },
5111
+ decode(input, length) {
5112
+ const reader = input instanceof import_minimal4.default.Reader ? input : import_minimal4.default.Reader.create(input);
5113
+ let end = length === void 0 ? reader.len : reader.pos + length;
5114
+ const message = createBaseNotificationUserChannel();
5115
+ while (reader.pos < end) {
5116
+ const tag = reader.uint32();
5117
+ switch (tag >>> 3) {
5118
+ case 1:
5119
+ if (tag !== 10) {
5120
+ break;
5121
+ }
5122
+ message.id = reader.string();
5123
+ continue;
5124
+ case 2:
5125
+ if (tag !== 16) {
5126
+ break;
5127
+ }
5128
+ message.notification_setting_type = reader.int32();
5129
+ continue;
5130
+ case 3:
5131
+ if (tag !== 26) {
5132
+ break;
5133
+ }
5134
+ message.time_mute = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
5135
+ continue;
5136
+ case 4:
5137
+ if (tag !== 32) {
5138
+ break;
5139
+ }
5140
+ message.active = reader.int32();
5141
+ continue;
5142
+ case 5:
5143
+ if (tag !== 42) {
5144
+ break;
5145
+ }
5146
+ message.channel_id = reader.string();
5147
+ continue;
5148
+ }
5149
+ if ((tag & 7) === 4 || tag === 0) {
5150
+ break;
5151
+ }
5152
+ reader.skipType(tag & 7);
5153
+ }
5154
+ return message;
5155
+ },
5156
+ fromJSON(object) {
5157
+ return {
5158
+ id: isSet3(object.id) ? globalThis.String(object.id) : "",
5159
+ notification_setting_type: isSet3(object.notification_setting_type) ? globalThis.Number(object.notification_setting_type) : 0,
5160
+ time_mute: isSet3(object.time_mute) ? fromJsonTimestamp(object.time_mute) : void 0,
5161
+ active: isSet3(object.active) ? globalThis.Number(object.active) : 0,
5162
+ channel_id: isSet3(object.channel_id) ? globalThis.String(object.channel_id) : ""
5163
+ };
5164
+ },
5165
+ toJSON(message) {
5166
+ const obj = {};
5167
+ if (message.id !== "") {
5168
+ obj.id = message.id;
5169
+ }
5170
+ if (message.notification_setting_type !== 0) {
5171
+ obj.notification_setting_type = Math.round(message.notification_setting_type);
5172
+ }
5173
+ if (message.time_mute !== void 0) {
5174
+ obj.time_mute = message.time_mute.toISOString();
5175
+ }
5176
+ if (message.active !== 0) {
5177
+ obj.active = Math.round(message.active);
5178
+ }
5179
+ if (message.channel_id !== "") {
5180
+ obj.channel_id = message.channel_id;
5181
+ }
5182
+ return obj;
5183
+ },
5184
+ create(base) {
5185
+ return NotificationUserChannel.fromPartial(base != null ? base : {});
5186
+ },
5187
+ fromPartial(object) {
5188
+ var _a, _b, _c, _d, _e;
5189
+ const message = createBaseNotificationUserChannel();
5190
+ message.id = (_a = object.id) != null ? _a : "";
5191
+ message.notification_setting_type = (_b = object.notification_setting_type) != null ? _b : 0;
5192
+ message.time_mute = (_c = object.time_mute) != null ? _c : void 0;
5193
+ message.active = (_d = object.active) != null ? _d : 0;
5194
+ message.channel_id = (_e = object.channel_id) != null ? _e : "";
5195
+ return message;
5196
+ }
5197
+ };
5089
5198
  function createBasePermissionList() {
5090
5199
  return { permissions: [], max_level_permission: 0 };
5091
5200
  }
@@ -6417,7 +6526,8 @@ function createBaseEnvelope() {
6417
6526
  channel_app_event: void 0,
6418
6527
  user_status_event: void 0,
6419
6528
  remove_friend: void 0,
6420
- webhook_event: void 0
6529
+ webhook_event: void 0,
6530
+ noti_user_channel: void 0
6421
6531
  };
6422
6532
  }
6423
6533
  var Envelope = {
@@ -6635,6 +6745,9 @@ var Envelope = {
6635
6745
  if (message.webhook_event !== void 0) {
6636
6746
  Webhook.encode(message.webhook_event, writer.uint32(570).fork()).ldelim();
6637
6747
  }
6748
+ if (message.noti_user_channel !== void 0) {
6749
+ NotificationUserChannel.encode(message.noti_user_channel, writer.uint32(578).fork()).ldelim();
6750
+ }
6638
6751
  return writer;
6639
6752
  },
6640
6753
  decode(input, length) {
@@ -7070,6 +7183,12 @@ var Envelope = {
7070
7183
  }
7071
7184
  message.webhook_event = Webhook.decode(reader, reader.uint32());
7072
7185
  continue;
7186
+ case 72:
7187
+ if (tag !== 578) {
7188
+ break;
7189
+ }
7190
+ message.noti_user_channel = NotificationUserChannel.decode(reader, reader.uint32());
7191
+ continue;
7073
7192
  }
7074
7193
  if ((tag & 7) === 4 || tag === 0) {
7075
7194
  break;
@@ -7150,7 +7269,8 @@ var Envelope = {
7150
7269
  channel_app_event: isSet4(object.channel_app_event) ? ChannelAppEvent.fromJSON(object.channel_app_event) : void 0,
7151
7270
  user_status_event: isSet4(object.user_status_event) ? UserStatusEvent.fromJSON(object.user_status_event) : void 0,
7152
7271
  remove_friend: isSet4(object.remove_friend) ? RemoveFriend.fromJSON(object.remove_friend) : void 0,
7153
- webhook_event: isSet4(object.webhook_event) ? Webhook.fromJSON(object.webhook_event) : void 0
7272
+ webhook_event: isSet4(object.webhook_event) ? Webhook.fromJSON(object.webhook_event) : void 0,
7273
+ noti_user_channel: isSet4(object.noti_user_channel) ? NotificationUserChannel.fromJSON(object.noti_user_channel) : void 0
7154
7274
  };
7155
7275
  },
7156
7276
  toJSON(message) {
@@ -7368,6 +7488,9 @@ var Envelope = {
7368
7488
  if (message.webhook_event !== void 0) {
7369
7489
  obj.webhook_event = Webhook.toJSON(message.webhook_event);
7370
7490
  }
7491
+ if (message.noti_user_channel !== void 0) {
7492
+ obj.noti_user_channel = NotificationUserChannel.toJSON(message.noti_user_channel);
7493
+ }
7371
7494
  return obj;
7372
7495
  },
7373
7496
  create(base) {
@@ -7447,6 +7570,7 @@ var Envelope = {
7447
7570
  message.user_status_event = object.user_status_event !== void 0 && object.user_status_event !== null ? UserStatusEvent.fromPartial(object.user_status_event) : void 0;
7448
7571
  message.remove_friend = object.remove_friend !== void 0 && object.remove_friend !== null ? RemoveFriend.fromPartial(object.remove_friend) : void 0;
7449
7572
  message.webhook_event = object.webhook_event !== void 0 && object.webhook_event !== null ? Webhook.fromPartial(object.webhook_event) : void 0;
7573
+ message.noti_user_channel = object.noti_user_channel !== void 0 && object.noti_user_channel !== null ? NotificationUserChannel.fromPartial(object.noti_user_channel) : void 0;
7450
7574
  return message;
7451
7575
  }
7452
7576
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mezon-js-protobuf",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Websocket adapter adding protocol buffer support to the Mezon Javascript client.",
5
5
  "main": "dist/mezon-js-protobuf.cjs.js",
6
6
  "module": "dist/mezon-js-protobuf.esm.mjs",
package/rtapi/realtime.ts CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  MessageReaction,
18
18
  MessageRef,
19
19
  Notification,
20
+ NotificationUserChannel,
20
21
  PermissionUpdate,
21
22
  Role,
22
23
  Rpc,
@@ -308,7 +309,11 @@ export interface Envelope {
308
309
  | RemoveFriend
309
310
  | undefined;
310
311
  /** */
311
- webhook_event?: Webhook | undefined;
312
+ webhook_event?:
313
+ | Webhook
314
+ | undefined;
315
+ /** */
316
+ noti_user_channel?: NotificationUserChannel | undefined;
312
317
  }
313
318
 
314
319
  export interface FollowEvent {
@@ -1383,6 +1388,7 @@ function createBaseEnvelope(): Envelope {
1383
1388
  user_status_event: undefined,
1384
1389
  remove_friend: undefined,
1385
1390
  webhook_event: undefined,
1391
+ noti_user_channel: undefined,
1386
1392
  };
1387
1393
  }
1388
1394
 
@@ -1601,6 +1607,9 @@ export const Envelope = {
1601
1607
  if (message.webhook_event !== undefined) {
1602
1608
  Webhook.encode(message.webhook_event, writer.uint32(570).fork()).ldelim();
1603
1609
  }
1610
+ if (message.noti_user_channel !== undefined) {
1611
+ NotificationUserChannel.encode(message.noti_user_channel, writer.uint32(578).fork()).ldelim();
1612
+ }
1604
1613
  return writer;
1605
1614
  },
1606
1615
 
@@ -2108,6 +2117,13 @@ export const Envelope = {
2108
2117
 
2109
2118
  message.webhook_event = Webhook.decode(reader, reader.uint32());
2110
2119
  continue;
2120
+ case 72:
2121
+ if (tag !== 578) {
2122
+ break;
2123
+ }
2124
+
2125
+ message.noti_user_channel = NotificationUserChannel.decode(reader, reader.uint32());
2126
+ continue;
2111
2127
  }
2112
2128
  if ((tag & 7) === 4 || tag === 0) {
2113
2129
  break;
@@ -2282,6 +2298,9 @@ export const Envelope = {
2282
2298
  : undefined,
2283
2299
  remove_friend: isSet(object.remove_friend) ? RemoveFriend.fromJSON(object.remove_friend) : undefined,
2284
2300
  webhook_event: isSet(object.webhook_event) ? Webhook.fromJSON(object.webhook_event) : undefined,
2301
+ noti_user_channel: isSet(object.noti_user_channel)
2302
+ ? NotificationUserChannel.fromJSON(object.noti_user_channel)
2303
+ : undefined,
2285
2304
  };
2286
2305
  },
2287
2306
 
@@ -2500,6 +2519,9 @@ export const Envelope = {
2500
2519
  if (message.webhook_event !== undefined) {
2501
2520
  obj.webhook_event = Webhook.toJSON(message.webhook_event);
2502
2521
  }
2522
+ if (message.noti_user_channel !== undefined) {
2523
+ obj.noti_user_channel = NotificationUserChannel.toJSON(message.noti_user_channel);
2524
+ }
2503
2525
  return obj;
2504
2526
  },
2505
2527
 
@@ -2735,6 +2757,9 @@ export const Envelope = {
2735
2757
  message.webhook_event = (object.webhook_event !== undefined && object.webhook_event !== null)
2736
2758
  ? Webhook.fromPartial(object.webhook_event)
2737
2759
  : undefined;
2760
+ message.noti_user_channel = (object.noti_user_channel !== undefined && object.noti_user_channel !== null)
2761
+ ? NotificationUserChannel.fromPartial(object.noti_user_channel)
2762
+ : undefined;
2738
2763
  return message;
2739
2764
  },
2740
2765
  };