@fatehan/tsrp 1.5.7 → 1.5.10

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.
@@ -18,15 +18,18 @@ export var Via;
18
18
  Via[Via["DATABASE"] = 4] = "DATABASE";
19
19
  Via[Via["CALL"] = 5] = "CALL";
20
20
  Via[Via["WEBHOOK"] = 6] = "WEBHOOK";
21
+ Via[Via["DIRECT"] = 7] = "DIRECT";
21
22
  Via[Via["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
22
23
  })(Via || (Via = {}));
23
24
  export var ObjectType;
24
25
  (function (ObjectType) {
25
- ObjectType[ObjectType["UNKNOWN"] = 0] = "UNKNOWN";
26
+ ObjectType[ObjectType["UNSPECIFIED"] = 0] = "UNSPECIFIED";
26
27
  ObjectType[ObjectType["DEVICE"] = 1] = "DEVICE";
27
28
  ObjectType[ObjectType["USER"] = 2] = "USER";
28
29
  ObjectType[ObjectType["OPERATION"] = 3] = "OPERATION";
29
30
  ObjectType[ObjectType["WORKFLOW_TASK"] = 4] = "WORKFLOW_TASK";
31
+ ObjectType[ObjectType["MAINTENANCE"] = 5] = "MAINTENANCE";
32
+ ObjectType[ObjectType["EVENT"] = 6] = "EVENT";
30
33
  ObjectType[ObjectType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
31
34
  })(ObjectType || (ObjectType = {}));
32
35
  export var AreaEventType;
@@ -55,47 +58,6 @@ export var NotifyJob_Priority;
55
58
  NotifyJob_Priority[NotifyJob_Priority["HIGH"] = 2] = "HIGH";
56
59
  NotifyJob_Priority[NotifyJob_Priority["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
57
60
  })(NotifyJob_Priority || (NotifyJob_Priority = {}));
58
- function createBaseTestMessage() {
59
- return { name: "" };
60
- }
61
- export const TestMessage = {
62
- encode(message, writer = new BinaryWriter()) {
63
- if (message.name !== "") {
64
- writer.uint32(10).string(message.name);
65
- }
66
- return writer;
67
- },
68
- decode(input, length) {
69
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
70
- const end = length === undefined ? reader.len : reader.pos + length;
71
- const message = createBaseTestMessage();
72
- while (reader.pos < end) {
73
- const tag = reader.uint32();
74
- switch (tag >>> 3) {
75
- case 1: {
76
- if (tag !== 10) {
77
- break;
78
- }
79
- message.name = reader.string();
80
- continue;
81
- }
82
- }
83
- if ((tag & 7) === 4 || tag === 0) {
84
- break;
85
- }
86
- reader.skip(tag & 7);
87
- }
88
- return message;
89
- },
90
- create(base) {
91
- return TestMessage.fromPartial(base ?? {});
92
- },
93
- fromPartial(object) {
94
- const message = createBaseTestMessage();
95
- message.name = object.name ?? "";
96
- return message;
97
- },
98
- };
99
61
  function createBaseNotifyJob() {
100
62
  return { id: Long.UZERO, userId: Long.UZERO, retries: 0, priority: 0, notify: undefined, via: [] };
101
63
  }
@@ -116,7 +78,7 @@ export const NotifyJob = {
116
78
  if (message.notify !== undefined) {
117
79
  Notify.encode(message.notify, writer.uint32(42).fork()).join();
118
80
  }
119
- writer.uint32(50).fork();
81
+ writer.uint32(98).fork();
120
82
  for (const v of message.via) {
121
83
  writer.int32(v);
122
84
  }
@@ -165,12 +127,12 @@ export const NotifyJob = {
165
127
  message.notify = Notify.decode(reader, reader.uint32());
166
128
  continue;
167
129
  }
168
- case 6: {
169
- if (tag === 48) {
130
+ case 12: {
131
+ if (tag === 96) {
170
132
  message.via.push(reader.int32());
171
133
  continue;
172
134
  }
173
- if (tag === 50) {
135
+ if (tag === 98) {
174
136
  const end2 = reader.uint32() + reader.pos;
175
137
  while (reader.pos < end2) {
176
138
  message.via.push(reader.int32());
@@ -205,519 +167,7 @@ export const NotifyJob = {
205
167
  return message;
206
168
  },
207
169
  };
208
- function createBaseUserDeviceAlert() {
209
- return {
210
- id: Long.UZERO,
211
- userId: Long.UZERO,
212
- deviceId: Long.UZERO,
213
- organizationId: Long.UZERO,
214
- alertId: Long.UZERO,
215
- condition: {},
216
- timing: {},
217
- status: false,
218
- format: "",
219
- alert: 0,
220
- unit: undefined,
221
- objectType: undefined,
222
- objectId: undefined,
223
- };
224
- }
225
- export const UserDeviceAlert = {
226
- encode(message, writer = new BinaryWriter()) {
227
- if (!message.id.equals(Long.UZERO)) {
228
- writer.uint32(8).uint64(message.id.toString());
229
- }
230
- if (!message.userId.equals(Long.UZERO)) {
231
- writer.uint32(16).uint64(message.userId.toString());
232
- }
233
- if (!message.deviceId.equals(Long.UZERO)) {
234
- writer.uint32(32).uint64(message.deviceId.toString());
235
- }
236
- if (!message.organizationId.equals(Long.UZERO)) {
237
- writer.uint32(88).uint64(message.organizationId.toString());
238
- }
239
- if (!message.alertId.equals(Long.UZERO)) {
240
- writer.uint32(40).uint64(message.alertId.toString());
241
- }
242
- globalThis.Object.entries(message.condition).forEach(([key, value]) => {
243
- UserDeviceAlert_ConditionEntry.encode({ key: key, value }, writer.uint32(50).fork()).join();
244
- });
245
- globalThis.Object.entries(message.timing).forEach(([key, value]) => {
246
- UserDeviceAlert_TimingEntry.encode({ key: key, value }, writer.uint32(114).fork()).join();
247
- });
248
- if (message.status !== false) {
249
- writer.uint32(56).bool(message.status);
250
- }
251
- if (message.format !== "") {
252
- writer.uint32(66).string(message.format);
253
- }
254
- if (message.alert !== 0) {
255
- writer.uint32(72).int32(message.alert);
256
- }
257
- if (message.unit !== undefined) {
258
- writer.uint32(82).string(message.unit);
259
- }
260
- if (message.objectType !== undefined) {
261
- writer.uint32(98).string(message.objectType);
262
- }
263
- if (message.objectId !== undefined) {
264
- writer.uint32(104).uint64(message.objectId.toString());
265
- }
266
- return writer;
267
- },
268
- decode(input, length) {
269
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
270
- const end = length === undefined ? reader.len : reader.pos + length;
271
- const message = createBaseUserDeviceAlert();
272
- while (reader.pos < end) {
273
- const tag = reader.uint32();
274
- switch (tag >>> 3) {
275
- case 1: {
276
- if (tag !== 8) {
277
- break;
278
- }
279
- message.id = Long.fromString(reader.uint64().toString(), true);
280
- continue;
281
- }
282
- case 2: {
283
- if (tag !== 16) {
284
- break;
285
- }
286
- message.userId = Long.fromString(reader.uint64().toString(), true);
287
- continue;
288
- }
289
- case 4: {
290
- if (tag !== 32) {
291
- break;
292
- }
293
- message.deviceId = Long.fromString(reader.uint64().toString(), true);
294
- continue;
295
- }
296
- case 11: {
297
- if (tag !== 88) {
298
- break;
299
- }
300
- message.organizationId = Long.fromString(reader.uint64().toString(), true);
301
- continue;
302
- }
303
- case 5: {
304
- if (tag !== 40) {
305
- break;
306
- }
307
- message.alertId = Long.fromString(reader.uint64().toString(), true);
308
- continue;
309
- }
310
- case 6: {
311
- if (tag !== 50) {
312
- break;
313
- }
314
- const entry6 = UserDeviceAlert_ConditionEntry.decode(reader, reader.uint32());
315
- if (entry6.value !== undefined) {
316
- message.condition[entry6.key] = entry6.value;
317
- }
318
- continue;
319
- }
320
- case 14: {
321
- if (tag !== 114) {
322
- break;
323
- }
324
- const entry14 = UserDeviceAlert_TimingEntry.decode(reader, reader.uint32());
325
- if (entry14.value !== undefined) {
326
- message.timing[entry14.key] = entry14.value;
327
- }
328
- continue;
329
- }
330
- case 7: {
331
- if (tag !== 56) {
332
- break;
333
- }
334
- message.status = reader.bool();
335
- continue;
336
- }
337
- case 8: {
338
- if (tag !== 66) {
339
- break;
340
- }
341
- message.format = reader.string();
342
- continue;
343
- }
344
- case 9: {
345
- if (tag !== 72) {
346
- break;
347
- }
348
- message.alert = reader.int32();
349
- continue;
350
- }
351
- case 10: {
352
- if (tag !== 82) {
353
- break;
354
- }
355
- message.unit = reader.string();
356
- continue;
357
- }
358
- case 12: {
359
- if (tag !== 98) {
360
- break;
361
- }
362
- message.objectType = reader.string();
363
- continue;
364
- }
365
- case 13: {
366
- if (tag !== 104) {
367
- break;
368
- }
369
- message.objectId = Long.fromString(reader.uint64().toString(), true);
370
- continue;
371
- }
372
- }
373
- if ((tag & 7) === 4 || tag === 0) {
374
- break;
375
- }
376
- reader.skip(tag & 7);
377
- }
378
- return message;
379
- },
380
- create(base) {
381
- return UserDeviceAlert.fromPartial(base ?? {});
382
- },
383
- fromPartial(object) {
384
- const message = createBaseUserDeviceAlert();
385
- message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
386
- message.userId = (object.userId !== undefined && object.userId !== null)
387
- ? Long.fromValue(object.userId)
388
- : Long.UZERO;
389
- message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
390
- ? Long.fromValue(object.deviceId)
391
- : Long.UZERO;
392
- message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
393
- ? Long.fromValue(object.organizationId)
394
- : Long.UZERO;
395
- message.alertId = (object.alertId !== undefined && object.alertId !== null)
396
- ? Long.fromValue(object.alertId)
397
- : Long.UZERO;
398
- message.condition = globalThis.Object.entries(object.condition ?? {})
399
- .reduce((acc, [key, value]) => {
400
- if (value !== undefined) {
401
- acc[globalThis.Number(key)] = UserDeviceAlert_ConditionList.fromPartial(value);
402
- }
403
- return acc;
404
- }, {});
405
- message.timing = globalThis.Object.entries(object.timing ?? {})
406
- .reduce((acc, [key, value]) => {
407
- if (value !== undefined) {
408
- acc[globalThis.Number(key)] = UserDeviceAlert_ConditionList.fromPartial(value);
409
- }
410
- return acc;
411
- }, {});
412
- message.status = object.status ?? false;
413
- message.format = object.format ?? "";
414
- message.alert = object.alert ?? 0;
415
- message.unit = object.unit ?? undefined;
416
- message.objectType = object.objectType ?? undefined;
417
- message.objectId = (object.objectId !== undefined && object.objectId !== null)
418
- ? Long.fromValue(object.objectId)
419
- : undefined;
420
- return message;
421
- },
422
- };
423
- function createBaseUserDeviceAlert_Condition() {
424
- return { fromTime: undefined, toTime: undefined, soundId: undefined, text: undefined, value: undefined, type: [] };
425
- }
426
- export const UserDeviceAlert_Condition = {
427
- encode(message, writer = new BinaryWriter()) {
428
- if (message.fromTime !== undefined) {
429
- writer.uint32(10).string(message.fromTime);
430
- }
431
- if (message.toTime !== undefined) {
432
- writer.uint32(18).string(message.toTime);
433
- }
434
- if (message.soundId !== undefined) {
435
- writer.uint32(24).uint64(message.soundId.toString());
436
- }
437
- if (message.text !== undefined) {
438
- writer.uint32(34).string(message.text);
439
- }
440
- if (message.value !== undefined) {
441
- writer.uint32(40).sint64(message.value.toString());
442
- }
443
- writer.uint32(50).fork();
444
- for (const v of message.type) {
445
- writer.int32(v);
446
- }
447
- writer.join();
448
- return writer;
449
- },
450
- decode(input, length) {
451
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
452
- const end = length === undefined ? reader.len : reader.pos + length;
453
- const message = createBaseUserDeviceAlert_Condition();
454
- while (reader.pos < end) {
455
- const tag = reader.uint32();
456
- switch (tag >>> 3) {
457
- case 1: {
458
- if (tag !== 10) {
459
- break;
460
- }
461
- message.fromTime = reader.string();
462
- continue;
463
- }
464
- case 2: {
465
- if (tag !== 18) {
466
- break;
467
- }
468
- message.toTime = reader.string();
469
- continue;
470
- }
471
- case 3: {
472
- if (tag !== 24) {
473
- break;
474
- }
475
- message.soundId = Long.fromString(reader.uint64().toString(), true);
476
- continue;
477
- }
478
- case 4: {
479
- if (tag !== 34) {
480
- break;
481
- }
482
- message.text = reader.string();
483
- continue;
484
- }
485
- case 5: {
486
- if (tag !== 40) {
487
- break;
488
- }
489
- message.value = Long.fromString(reader.sint64().toString());
490
- continue;
491
- }
492
- case 6: {
493
- if (tag === 48) {
494
- message.type.push(reader.int32());
495
- continue;
496
- }
497
- if (tag === 50) {
498
- const end2 = reader.uint32() + reader.pos;
499
- while (reader.pos < end2) {
500
- message.type.push(reader.int32());
501
- }
502
- continue;
503
- }
504
- break;
505
- }
506
- }
507
- if ((tag & 7) === 4 || tag === 0) {
508
- break;
509
- }
510
- reader.skip(tag & 7);
511
- }
512
- return message;
513
- },
514
- create(base) {
515
- return UserDeviceAlert_Condition.fromPartial(base ?? {});
516
- },
517
- fromPartial(object) {
518
- const message = createBaseUserDeviceAlert_Condition();
519
- message.fromTime = object.fromTime ?? undefined;
520
- message.toTime = object.toTime ?? undefined;
521
- message.soundId = (object.soundId !== undefined && object.soundId !== null)
522
- ? Long.fromValue(object.soundId)
523
- : undefined;
524
- message.text = object.text ?? undefined;
525
- message.value = (object.value !== undefined && object.value !== null) ? Long.fromValue(object.value) : undefined;
526
- message.type = object.type?.map((e) => e) || [];
527
- return message;
528
- },
529
- };
530
- function createBaseUserDeviceAlert_ConditionList() {
531
- return { condition: [] };
532
- }
533
- export const UserDeviceAlert_ConditionList = {
534
- encode(message, writer = new BinaryWriter()) {
535
- for (const v of message.condition) {
536
- UserDeviceAlert_Condition.encode(v, writer.uint32(10).fork()).join();
537
- }
538
- return writer;
539
- },
540
- decode(input, length) {
541
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
542
- const end = length === undefined ? reader.len : reader.pos + length;
543
- const message = createBaseUserDeviceAlert_ConditionList();
544
- while (reader.pos < end) {
545
- const tag = reader.uint32();
546
- switch (tag >>> 3) {
547
- case 1: {
548
- if (tag !== 10) {
549
- break;
550
- }
551
- message.condition.push(UserDeviceAlert_Condition.decode(reader, reader.uint32()));
552
- continue;
553
- }
554
- }
555
- if ((tag & 7) === 4 || tag === 0) {
556
- break;
557
- }
558
- reader.skip(tag & 7);
559
- }
560
- return message;
561
- },
562
- create(base) {
563
- return UserDeviceAlert_ConditionList.fromPartial(base ?? {});
564
- },
565
- fromPartial(object) {
566
- const message = createBaseUserDeviceAlert_ConditionList();
567
- message.condition = object.condition?.map((e) => UserDeviceAlert_Condition.fromPartial(e)) || [];
568
- return message;
569
- },
570
- };
571
- function createBaseUserDeviceAlert_ConditionEntry() {
572
- return { key: 0, value: undefined };
573
- }
574
- export const UserDeviceAlert_ConditionEntry = {
575
- encode(message, writer = new BinaryWriter()) {
576
- if (message.key !== 0) {
577
- writer.uint32(8).uint32(message.key);
578
- }
579
- if (message.value !== undefined) {
580
- UserDeviceAlert_ConditionList.encode(message.value, writer.uint32(18).fork()).join();
581
- }
582
- return writer;
583
- },
584
- decode(input, length) {
585
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
586
- const end = length === undefined ? reader.len : reader.pos + length;
587
- const message = createBaseUserDeviceAlert_ConditionEntry();
588
- while (reader.pos < end) {
589
- const tag = reader.uint32();
590
- switch (tag >>> 3) {
591
- case 1: {
592
- if (tag !== 8) {
593
- break;
594
- }
595
- message.key = reader.uint32();
596
- continue;
597
- }
598
- case 2: {
599
- if (tag !== 18) {
600
- break;
601
- }
602
- message.value = UserDeviceAlert_ConditionList.decode(reader, reader.uint32());
603
- continue;
604
- }
605
- }
606
- if ((tag & 7) === 4 || tag === 0) {
607
- break;
608
- }
609
- reader.skip(tag & 7);
610
- }
611
- return message;
612
- },
613
- create(base) {
614
- return UserDeviceAlert_ConditionEntry.fromPartial(base ?? {});
615
- },
616
- fromPartial(object) {
617
- const message = createBaseUserDeviceAlert_ConditionEntry();
618
- message.key = object.key ?? 0;
619
- message.value = (object.value !== undefined && object.value !== null)
620
- ? UserDeviceAlert_ConditionList.fromPartial(object.value)
621
- : undefined;
622
- return message;
623
- },
624
- };
625
- function createBaseUserDeviceAlert_TimingEntry() {
626
- return { key: 0, value: undefined };
627
- }
628
- export const UserDeviceAlert_TimingEntry = {
629
- encode(message, writer = new BinaryWriter()) {
630
- if (message.key !== 0) {
631
- writer.uint32(8).uint32(message.key);
632
- }
633
- if (message.value !== undefined) {
634
- UserDeviceAlert_ConditionList.encode(message.value, writer.uint32(18).fork()).join();
635
- }
636
- return writer;
637
- },
638
- decode(input, length) {
639
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
640
- const end = length === undefined ? reader.len : reader.pos + length;
641
- const message = createBaseUserDeviceAlert_TimingEntry();
642
- while (reader.pos < end) {
643
- const tag = reader.uint32();
644
- switch (tag >>> 3) {
645
- case 1: {
646
- if (tag !== 8) {
647
- break;
648
- }
649
- message.key = reader.uint32();
650
- continue;
651
- }
652
- case 2: {
653
- if (tag !== 18) {
654
- break;
655
- }
656
- message.value = UserDeviceAlert_ConditionList.decode(reader, reader.uint32());
657
- continue;
658
- }
659
- }
660
- if ((tag & 7) === 4 || tag === 0) {
661
- break;
662
- }
663
- reader.skip(tag & 7);
664
- }
665
- return message;
666
- },
667
- create(base) {
668
- return UserDeviceAlert_TimingEntry.fromPartial(base ?? {});
669
- },
670
- fromPartial(object) {
671
- const message = createBaseUserDeviceAlert_TimingEntry();
672
- message.key = object.key ?? 0;
673
- message.value = (object.value !== undefined && object.value !== null)
674
- ? UserDeviceAlert_ConditionList.fromPartial(object.value)
675
- : undefined;
676
- return message;
677
- },
678
- };
679
- function createBaseUserDeviceAlertList() {
680
- return { list: [] };
681
- }
682
- export const UserDeviceAlertList = {
683
- encode(message, writer = new BinaryWriter()) {
684
- for (const v of message.list) {
685
- UserDeviceAlert.encode(v, writer.uint32(10).fork()).join();
686
- }
687
- return writer;
688
- },
689
- decode(input, length) {
690
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
691
- const end = length === undefined ? reader.len : reader.pos + length;
692
- const message = createBaseUserDeviceAlertList();
693
- while (reader.pos < end) {
694
- const tag = reader.uint32();
695
- switch (tag >>> 3) {
696
- case 1: {
697
- if (tag !== 10) {
698
- break;
699
- }
700
- message.list.push(UserDeviceAlert.decode(reader, reader.uint32()));
701
- continue;
702
- }
703
- }
704
- if ((tag & 7) === 4 || tag === 0) {
705
- break;
706
- }
707
- reader.skip(tag & 7);
708
- }
709
- return message;
710
- },
711
- create(base) {
712
- return UserDeviceAlertList.fromPartial(base ?? {});
713
- },
714
- fromPartial(object) {
715
- const message = createBaseUserDeviceAlertList();
716
- message.list = object.list?.map((e) => UserDeviceAlert.fromPartial(e)) || [];
717
- return message;
718
- },
719
- };
720
- function createBaseNotify() {
170
+ function createBaseNotify() {
721
171
  return {
722
172
  title: "",
723
173
  body: undefined,
@@ -725,287 +175,54 @@ function createBaseNotify() {
725
175
  image: undefined,
726
176
  icon: undefined,
727
177
  receiver: undefined,
728
- objectId: undefined,
729
- objectType: 0,
730
- timestamp: undefined,
731
- data: {},
732
- };
733
- }
734
- export const Notify = {
735
- encode(message, writer = new BinaryWriter()) {
736
- if (message.title !== "") {
737
- writer.uint32(10).string(message.title);
738
- }
739
- if (message.body !== undefined) {
740
- writer.uint32(18).string(message.body);
741
- }
742
- if (message.sound !== undefined) {
743
- writer.uint32(24).uint64(message.sound.toString());
744
- }
745
- if (message.image !== undefined) {
746
- writer.uint32(34).string(message.image);
747
- }
748
- if (message.icon !== undefined) {
749
- writer.uint32(42).string(message.icon);
750
- }
751
- if (message.receiver !== undefined) {
752
- Receiver.encode(message.receiver, writer.uint32(50).fork()).join();
753
- }
754
- if (message.objectId !== undefined) {
755
- writer.uint32(56).uint64(message.objectId.toString());
756
- }
757
- if (message.objectType !== 0) {
758
- writer.uint32(64).int32(message.objectType);
759
- }
760
- if (message.timestamp !== undefined) {
761
- Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(74).fork()).join();
762
- }
763
- globalThis.Object.entries(message.data).forEach(([key, value]) => {
764
- Notify_DataEntry.encode({ key: key, value }, writer.uint32(82).fork()).join();
765
- });
766
- return writer;
767
- },
768
- decode(input, length) {
769
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
770
- const end = length === undefined ? reader.len : reader.pos + length;
771
- const message = createBaseNotify();
772
- while (reader.pos < end) {
773
- const tag = reader.uint32();
774
- switch (tag >>> 3) {
775
- case 1: {
776
- if (tag !== 10) {
777
- break;
778
- }
779
- message.title = reader.string();
780
- continue;
781
- }
782
- case 2: {
783
- if (tag !== 18) {
784
- break;
785
- }
786
- message.body = reader.string();
787
- continue;
788
- }
789
- case 3: {
790
- if (tag !== 24) {
791
- break;
792
- }
793
- message.sound = Long.fromString(reader.uint64().toString(), true);
794
- continue;
795
- }
796
- case 4: {
797
- if (tag !== 34) {
798
- break;
799
- }
800
- message.image = reader.string();
801
- continue;
802
- }
803
- case 5: {
804
- if (tag !== 42) {
805
- break;
806
- }
807
- message.icon = reader.string();
808
- continue;
809
- }
810
- case 6: {
811
- if (tag !== 50) {
812
- break;
813
- }
814
- message.receiver = Receiver.decode(reader, reader.uint32());
815
- continue;
816
- }
817
- case 7: {
818
- if (tag !== 56) {
819
- break;
820
- }
821
- message.objectId = Long.fromString(reader.uint64().toString(), true);
822
- continue;
823
- }
824
- case 8: {
825
- if (tag !== 64) {
826
- break;
827
- }
828
- message.objectType = reader.int32();
829
- continue;
830
- }
831
- case 9: {
832
- if (tag !== 74) {
833
- break;
834
- }
835
- message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
836
- continue;
837
- }
838
- case 10: {
839
- if (tag !== 82) {
840
- break;
841
- }
842
- const entry10 = Notify_DataEntry.decode(reader, reader.uint32());
843
- if (entry10.value !== undefined) {
844
- message.data[entry10.key] = entry10.value;
845
- }
846
- continue;
847
- }
848
- }
849
- if ((tag & 7) === 4 || tag === 0) {
850
- break;
851
- }
852
- reader.skip(tag & 7);
853
- }
854
- return message;
855
- },
856
- create(base) {
857
- return Notify.fromPartial(base ?? {});
858
- },
859
- fromPartial(object) {
860
- const message = createBaseNotify();
861
- message.title = object.title ?? "";
862
- message.body = object.body ?? undefined;
863
- message.sound = (object.sound !== undefined && object.sound !== null) ? Long.fromValue(object.sound) : undefined;
864
- message.image = object.image ?? undefined;
865
- message.icon = object.icon ?? undefined;
866
- message.receiver = (object.receiver !== undefined && object.receiver !== null)
867
- ? Receiver.fromPartial(object.receiver)
868
- : undefined;
869
- message.objectId = (object.objectId !== undefined && object.objectId !== null)
870
- ? Long.fromValue(object.objectId)
871
- : undefined;
872
- message.objectType = object.objectType ?? 0;
873
- message.timestamp = object.timestamp ?? undefined;
874
- message.data = globalThis.Object.entries(object.data ?? {}).reduce((acc, [key, value]) => {
875
- if (value !== undefined) {
876
- acc[key] = globalThis.String(value);
877
- }
878
- return acc;
879
- }, {});
880
- return message;
881
- },
882
- };
883
- function createBaseNotify_DataEntry() {
884
- return { key: "", value: "" };
885
- }
886
- export const Notify_DataEntry = {
887
- encode(message, writer = new BinaryWriter()) {
888
- if (message.key !== "") {
889
- writer.uint32(10).string(message.key);
890
- }
891
- if (message.value !== "") {
892
- writer.uint32(18).string(message.value);
893
- }
894
- return writer;
895
- },
896
- decode(input, length) {
897
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
898
- const end = length === undefined ? reader.len : reader.pos + length;
899
- const message = createBaseNotify_DataEntry();
900
- while (reader.pos < end) {
901
- const tag = reader.uint32();
902
- switch (tag >>> 3) {
903
- case 1: {
904
- if (tag !== 10) {
905
- break;
906
- }
907
- message.key = reader.string();
908
- continue;
909
- }
910
- case 2: {
911
- if (tag !== 18) {
912
- break;
913
- }
914
- message.value = reader.string();
915
- continue;
916
- }
917
- }
918
- if ((tag & 7) === 4 || tag === 0) {
919
- break;
920
- }
921
- reader.skip(tag & 7);
922
- }
923
- return message;
924
- },
925
- create(base) {
926
- return Notify_DataEntry.fromPartial(base ?? {});
927
- },
928
- fromPartial(object) {
929
- const message = createBaseNotify_DataEntry();
930
- message.key = object.key ?? "";
931
- message.value = object.value ?? "";
932
- return message;
933
- },
934
- };
935
- function createBaseNotification() {
936
- return {
937
- uuid: "",
938
- userId: Long.UZERO,
939
- objectId: undefined,
940
- objectType: undefined,
941
- title: "",
942
- body: undefined,
943
- alertId: undefined,
944
- alert: 0,
945
- via: [],
178
+ deviceId: undefined,
179
+ objectId: undefined,
180
+ objectType: 0,
181
+ timestamp: undefined,
946
182
  data: {},
947
- image: undefined,
948
- sound: undefined,
949
- createdAt: undefined,
950
- readAt: undefined,
951
- userAlertId: undefined,
952
183
  };
953
184
  }
954
- export const Notification = {
185
+ export const Notify = {
955
186
  encode(message, writer = new BinaryWriter()) {
956
- if (message.uuid !== "") {
957
- writer.uint32(10).string(message.uuid);
958
- }
959
- if (!message.userId.equals(Long.UZERO)) {
960
- writer.uint32(16).uint64(message.userId.toString());
961
- }
962
- if (message.objectId !== undefined) {
963
- writer.uint32(24).uint64(message.objectId.toString());
964
- }
965
- if (message.objectType !== undefined) {
966
- writer.uint32(32).int32(message.objectType);
967
- }
968
187
  if (message.title !== "") {
969
- writer.uint32(42).string(message.title);
188
+ writer.uint32(10).string(message.title);
970
189
  }
971
190
  if (message.body !== undefined) {
972
- writer.uint32(50).string(message.body);
191
+ writer.uint32(18).string(message.body);
973
192
  }
974
- if (message.alertId !== undefined) {
975
- writer.uint32(56).uint64(message.alertId.toString());
193
+ if (message.sound !== undefined) {
194
+ writer.uint32(26).string(message.sound);
976
195
  }
977
- if (message.alert !== 0) {
978
- writer.uint32(64).int32(message.alert);
196
+ if (message.image !== undefined) {
197
+ writer.uint32(34).string(message.image);
979
198
  }
980
- writer.uint32(74).fork();
981
- for (const v of message.via) {
982
- writer.int32(v);
199
+ if (message.icon !== undefined) {
200
+ writer.uint32(42).string(message.icon);
983
201
  }
984
- writer.join();
985
- globalThis.Object.entries(message.data).forEach(([key, value]) => {
986
- Notification_DataEntry.encode({ key: key, value }, writer.uint32(82).fork()).join();
987
- });
988
- if (message.image !== undefined) {
989
- writer.uint32(90).string(message.image);
202
+ if (message.receiver !== undefined) {
203
+ Receiver.encode(message.receiver, writer.uint32(50).fork()).join();
990
204
  }
991
- if (message.sound !== undefined) {
992
- writer.uint32(96).uint64(message.sound.toString());
205
+ if (message.deviceId !== undefined) {
206
+ writer.uint32(56).uint64(message.deviceId.toString());
993
207
  }
994
- if (message.createdAt !== undefined) {
995
- Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(106).fork()).join();
208
+ if (message.objectId !== undefined) {
209
+ writer.uint32(64).uint64(message.objectId.toString());
996
210
  }
997
- if (message.readAt !== undefined) {
998
- Timestamp.encode(toTimestamp(message.readAt), writer.uint32(114).fork()).join();
211
+ if (message.objectType !== 0) {
212
+ writer.uint32(72).int32(message.objectType);
999
213
  }
1000
- if (message.userAlertId !== undefined) {
1001
- writer.uint32(120).uint64(message.userAlertId.toString());
214
+ if (message.timestamp !== undefined) {
215
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(82).fork()).join();
1002
216
  }
217
+ globalThis.Object.entries(message.data).forEach(([key, value]) => {
218
+ Notify_DataEntry.encode({ key: key, value }, writer.uint32(90).fork()).join();
219
+ });
1003
220
  return writer;
1004
221
  },
1005
222
  decode(input, length) {
1006
223
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1007
224
  const end = length === undefined ? reader.len : reader.pos + length;
1008
- const message = createBaseNotification();
225
+ const message = createBaseNotify();
1009
226
  while (reader.pos < end) {
1010
227
  const tag = reader.uint32();
1011
228
  switch (tag >>> 3) {
@@ -1013,115 +230,80 @@ export const Notification = {
1013
230
  if (tag !== 10) {
1014
231
  break;
1015
232
  }
1016
- message.uuid = reader.string();
233
+ message.title = reader.string();
1017
234
  continue;
1018
235
  }
1019
236
  case 2: {
1020
- if (tag !== 16) {
237
+ if (tag !== 18) {
1021
238
  break;
1022
239
  }
1023
- message.userId = Long.fromString(reader.uint64().toString(), true);
240
+ message.body = reader.string();
1024
241
  continue;
1025
242
  }
1026
243
  case 3: {
1027
- if (tag !== 24) {
244
+ if (tag !== 26) {
1028
245
  break;
1029
246
  }
1030
- message.objectId = Long.fromString(reader.uint64().toString(), true);
247
+ message.sound = reader.string();
1031
248
  continue;
1032
249
  }
1033
250
  case 4: {
1034
- if (tag !== 32) {
251
+ if (tag !== 34) {
1035
252
  break;
1036
253
  }
1037
- message.objectType = reader.int32();
254
+ message.image = reader.string();
1038
255
  continue;
1039
256
  }
1040
257
  case 5: {
1041
258
  if (tag !== 42) {
1042
259
  break;
1043
260
  }
1044
- message.title = reader.string();
261
+ message.icon = reader.string();
1045
262
  continue;
1046
263
  }
1047
264
  case 6: {
1048
265
  if (tag !== 50) {
1049
266
  break;
1050
267
  }
1051
- message.body = reader.string();
268
+ message.receiver = Receiver.decode(reader, reader.uint32());
1052
269
  continue;
1053
270
  }
1054
271
  case 7: {
1055
272
  if (tag !== 56) {
1056
273
  break;
1057
274
  }
1058
- message.alertId = Long.fromString(reader.uint64().toString(), true);
275
+ message.deviceId = Long.fromString(reader.uint64().toString(), true);
1059
276
  continue;
1060
277
  }
1061
278
  case 8: {
1062
279
  if (tag !== 64) {
1063
280
  break;
1064
281
  }
1065
- message.alert = reader.int32();
282
+ message.objectId = Long.fromString(reader.uint64().toString(), true);
1066
283
  continue;
1067
284
  }
1068
285
  case 9: {
1069
- if (tag === 72) {
1070
- message.via.push(reader.int32());
1071
- continue;
1072
- }
1073
- if (tag === 74) {
1074
- const end2 = reader.uint32() + reader.pos;
1075
- while (reader.pos < end2) {
1076
- message.via.push(reader.int32());
1077
- }
1078
- continue;
286
+ if (tag !== 72) {
287
+ break;
1079
288
  }
1080
- break;
289
+ message.objectType = reader.int32();
290
+ continue;
1081
291
  }
1082
292
  case 10: {
1083
293
  if (tag !== 82) {
1084
294
  break;
1085
295
  }
1086
- const entry10 = Notification_DataEntry.decode(reader, reader.uint32());
1087
- if (entry10.value !== undefined) {
1088
- message.data[entry10.key] = entry10.value;
1089
- }
296
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1090
297
  continue;
1091
298
  }
1092
299
  case 11: {
1093
300
  if (tag !== 90) {
1094
301
  break;
1095
302
  }
1096
- message.image = reader.string();
1097
- continue;
1098
- }
1099
- case 12: {
1100
- if (tag !== 96) {
1101
- break;
1102
- }
1103
- message.sound = Long.fromString(reader.uint64().toString(), true);
1104
- continue;
1105
- }
1106
- case 13: {
1107
- if (tag !== 106) {
1108
- break;
1109
- }
1110
- message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1111
- continue;
1112
- }
1113
- case 14: {
1114
- if (tag !== 114) {
1115
- break;
1116
- }
1117
- message.readAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1118
- continue;
1119
- }
1120
- case 15: {
1121
- if (tag !== 120) {
1122
- break;
303
+ const entry11 = Notify_DataEntry.decode(reader, reader.uint32());
304
+ if (entry11.value !== undefined) {
305
+ message.data[entry11.key] = entry11.value;
1123
306
  }
1124
- message.userAlertId = Long.fromString(reader.uint64().toString(), true);
1125
307
  continue;
1126
308
  }
1127
309
  }
@@ -1133,45 +315,39 @@ export const Notification = {
1133
315
  return message;
1134
316
  },
1135
317
  create(base) {
1136
- return Notification.fromPartial(base ?? {});
318
+ return Notify.fromPartial(base ?? {});
1137
319
  },
1138
320
  fromPartial(object) {
1139
- const message = createBaseNotification();
1140
- message.uuid = object.uuid ?? "";
1141
- message.userId = (object.userId !== undefined && object.userId !== null)
1142
- ? Long.fromValue(object.userId)
1143
- : Long.UZERO;
1144
- message.objectId = (object.objectId !== undefined && object.objectId !== null)
1145
- ? Long.fromValue(object.objectId)
1146
- : undefined;
1147
- message.objectType = object.objectType ?? undefined;
321
+ const message = createBaseNotify();
1148
322
  message.title = object.title ?? "";
1149
323
  message.body = object.body ?? undefined;
1150
- message.alertId = (object.alertId !== undefined && object.alertId !== null)
1151
- ? Long.fromValue(object.alertId)
324
+ message.sound = object.sound ?? undefined;
325
+ message.image = object.image ?? undefined;
326
+ message.icon = object.icon ?? undefined;
327
+ message.receiver = (object.receiver !== undefined && object.receiver !== null)
328
+ ? Receiver.fromPartial(object.receiver)
1152
329
  : undefined;
1153
- message.alert = object.alert ?? 0;
1154
- message.via = object.via?.map((e) => e) || [];
330
+ message.deviceId = (object.deviceId !== undefined && object.deviceId !== null)
331
+ ? Long.fromValue(object.deviceId)
332
+ : undefined;
333
+ message.objectId = (object.objectId !== undefined && object.objectId !== null)
334
+ ? Long.fromValue(object.objectId)
335
+ : undefined;
336
+ message.objectType = object.objectType ?? 0;
337
+ message.timestamp = object.timestamp ?? undefined;
1155
338
  message.data = globalThis.Object.entries(object.data ?? {}).reduce((acc, [key, value]) => {
1156
339
  if (value !== undefined) {
1157
340
  acc[key] = globalThis.String(value);
1158
341
  }
1159
342
  return acc;
1160
343
  }, {});
1161
- message.image = object.image ?? undefined;
1162
- message.sound = (object.sound !== undefined && object.sound !== null) ? Long.fromValue(object.sound) : undefined;
1163
- message.createdAt = object.createdAt ?? undefined;
1164
- message.readAt = object.readAt ?? undefined;
1165
- message.userAlertId = (object.userAlertId !== undefined && object.userAlertId !== null)
1166
- ? Long.fromValue(object.userAlertId)
1167
- : undefined;
1168
344
  return message;
1169
345
  },
1170
346
  };
1171
- function createBaseNotification_DataEntry() {
347
+ function createBaseNotify_DataEntry() {
1172
348
  return { key: "", value: "" };
1173
349
  }
1174
- export const Notification_DataEntry = {
350
+ export const Notify_DataEntry = {
1175
351
  encode(message, writer = new BinaryWriter()) {
1176
352
  if (message.key !== "") {
1177
353
  writer.uint32(10).string(message.key);
@@ -1184,7 +360,7 @@ export const Notification_DataEntry = {
1184
360
  decode(input, length) {
1185
361
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1186
362
  const end = length === undefined ? reader.len : reader.pos + length;
1187
- const message = createBaseNotification_DataEntry();
363
+ const message = createBaseNotify_DataEntry();
1188
364
  while (reader.pos < end) {
1189
365
  const tag = reader.uint32();
1190
366
  switch (tag >>> 3) {
@@ -1211,204 +387,96 @@ export const Notification_DataEntry = {
1211
387
  return message;
1212
388
  },
1213
389
  create(base) {
1214
- return Notification_DataEntry.fromPartial(base ?? {});
390
+ return Notify_DataEntry.fromPartial(base ?? {});
1215
391
  },
1216
392
  fromPartial(object) {
1217
- const message = createBaseNotification_DataEntry();
393
+ const message = createBaseNotify_DataEntry();
1218
394
  message.key = object.key ?? "";
1219
395
  message.value = object.value ?? "";
1220
396
  return message;
1221
397
  },
1222
398
  };
1223
- function createBaseAlertModel() {
1224
- return {
1225
- id: Long.UZERO,
1226
- organizationId: Long.UZERO,
1227
- alertId: Long.UZERO,
1228
- alertType: Long.UZERO,
1229
- unit: undefined,
1230
- value: undefined,
1231
- message: "",
1232
- name: "",
1233
- minValue: undefined,
1234
- maxValue: undefined,
1235
- picture: undefined,
1236
- createdBy: undefined,
1237
- updatedBy: undefined,
1238
- createdAt: undefined,
1239
- updatedAt: undefined,
1240
- objectType: undefined,
1241
- };
399
+ function createBaseNotification() {
400
+ return { id: "", userId: Long.UZERO, payload: undefined, via: [], createdAt: undefined, readAt: undefined };
1242
401
  }
1243
- export const AlertModel = {
402
+ export const Notification = {
1244
403
  encode(message, writer = new BinaryWriter()) {
1245
- if (!message.id.equals(Long.UZERO)) {
1246
- writer.uint32(8).uint64(message.id.toString());
1247
- }
1248
- if (!message.organizationId.equals(Long.UZERO)) {
1249
- writer.uint32(16).uint64(message.organizationId.toString());
1250
- }
1251
- if (!message.alertId.equals(Long.UZERO)) {
1252
- writer.uint32(24).uint64(message.alertId.toString());
1253
- }
1254
- if (!message.alertType.equals(Long.UZERO)) {
1255
- writer.uint32(32).uint64(message.alertType.toString());
404
+ if (message.id !== "") {
405
+ writer.uint32(10).string(message.id);
1256
406
  }
1257
- if (message.unit !== undefined) {
1258
- writer.uint32(42).string(message.unit);
1259
- }
1260
- if (message.value !== undefined) {
1261
- writer.uint32(48).uint64(message.value.toString());
1262
- }
1263
- if (message.message !== "") {
1264
- writer.uint32(58).string(message.message);
1265
- }
1266
- if (message.name !== "") {
1267
- writer.uint32(66).string(message.name);
1268
- }
1269
- if (message.minValue !== undefined) {
1270
- writer.uint32(74).string(message.minValue);
1271
- }
1272
- if (message.maxValue !== undefined) {
1273
- writer.uint32(82).string(message.maxValue);
1274
- }
1275
- if (message.picture !== undefined) {
1276
- writer.uint32(90).string(message.picture);
407
+ if (!message.userId.equals(Long.UZERO)) {
408
+ writer.uint32(16).uint64(message.userId.toString());
1277
409
  }
1278
- if (message.createdBy !== undefined) {
1279
- writer.uint32(96).uint64(message.createdBy.toString());
410
+ if (message.payload !== undefined) {
411
+ Notify.encode(message.payload, writer.uint32(26).fork()).join();
1280
412
  }
1281
- if (message.updatedBy !== undefined) {
1282
- writer.uint32(104).uint64(message.updatedBy.toString());
413
+ writer.uint32(34).fork();
414
+ for (const v of message.via) {
415
+ writer.int32(v);
1283
416
  }
417
+ writer.join();
1284
418
  if (message.createdAt !== undefined) {
1285
- Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(114).fork()).join();
1286
- }
1287
- if (message.updatedAt !== undefined) {
1288
- Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(122).fork()).join();
419
+ Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(42).fork()).join();
1289
420
  }
1290
- if (message.objectType !== undefined) {
1291
- writer.uint32(130).string(message.objectType);
421
+ if (message.readAt !== undefined) {
422
+ Timestamp.encode(toTimestamp(message.readAt), writer.uint32(50).fork()).join();
1292
423
  }
1293
424
  return writer;
1294
425
  },
1295
426
  decode(input, length) {
1296
427
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1297
428
  const end = length === undefined ? reader.len : reader.pos + length;
1298
- const message = createBaseAlertModel();
429
+ const message = createBaseNotification();
1299
430
  while (reader.pos < end) {
1300
431
  const tag = reader.uint32();
1301
432
  switch (tag >>> 3) {
1302
433
  case 1: {
1303
- if (tag !== 8) {
434
+ if (tag !== 10) {
1304
435
  break;
1305
436
  }
1306
- message.id = Long.fromString(reader.uint64().toString(), true);
437
+ message.id = reader.string();
1307
438
  continue;
1308
439
  }
1309
440
  case 2: {
1310
441
  if (tag !== 16) {
1311
442
  break;
1312
443
  }
1313
- message.organizationId = Long.fromString(reader.uint64().toString(), true);
444
+ message.userId = Long.fromString(reader.uint64().toString(), true);
1314
445
  continue;
1315
446
  }
1316
447
  case 3: {
1317
- if (tag !== 24) {
448
+ if (tag !== 26) {
1318
449
  break;
1319
450
  }
1320
- message.alertId = Long.fromString(reader.uint64().toString(), true);
451
+ message.payload = Notify.decode(reader, reader.uint32());
1321
452
  continue;
1322
453
  }
1323
454
  case 4: {
1324
- if (tag !== 32) {
1325
- break;
455
+ if (tag === 32) {
456
+ message.via.push(reader.int32());
457
+ continue;
1326
458
  }
1327
- message.alertType = Long.fromString(reader.uint64().toString(), true);
1328
- continue;
459
+ if (tag === 34) {
460
+ const end2 = reader.uint32() + reader.pos;
461
+ while (reader.pos < end2) {
462
+ message.via.push(reader.int32());
463
+ }
464
+ continue;
465
+ }
466
+ break;
1329
467
  }
1330
468
  case 5: {
1331
469
  if (tag !== 42) {
1332
470
  break;
1333
471
  }
1334
- message.unit = reader.string();
1335
- continue;
1336
- }
1337
- case 6: {
1338
- if (tag !== 48) {
1339
- break;
1340
- }
1341
- message.value = Long.fromString(reader.uint64().toString(), true);
1342
- continue;
1343
- }
1344
- case 7: {
1345
- if (tag !== 58) {
1346
- break;
1347
- }
1348
- message.message = reader.string();
1349
- continue;
1350
- }
1351
- case 8: {
1352
- if (tag !== 66) {
1353
- break;
1354
- }
1355
- message.name = reader.string();
1356
- continue;
1357
- }
1358
- case 9: {
1359
- if (tag !== 74) {
1360
- break;
1361
- }
1362
- message.minValue = reader.string();
1363
- continue;
1364
- }
1365
- case 10: {
1366
- if (tag !== 82) {
1367
- break;
1368
- }
1369
- message.maxValue = reader.string();
1370
- continue;
1371
- }
1372
- case 11: {
1373
- if (tag !== 90) {
1374
- break;
1375
- }
1376
- message.picture = reader.string();
1377
- continue;
1378
- }
1379
- case 12: {
1380
- if (tag !== 96) {
1381
- break;
1382
- }
1383
- message.createdBy = Long.fromString(reader.uint64().toString(), true);
1384
- continue;
1385
- }
1386
- case 13: {
1387
- if (tag !== 104) {
1388
- break;
1389
- }
1390
- message.updatedBy = Long.fromString(reader.uint64().toString(), true);
1391
- continue;
1392
- }
1393
- case 14: {
1394
- if (tag !== 114) {
1395
- break;
1396
- }
1397
472
  message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1398
473
  continue;
1399
474
  }
1400
- case 15: {
1401
- if (tag !== 122) {
1402
- break;
1403
- }
1404
- message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1405
- continue;
1406
- }
1407
- case 16: {
1408
- if (tag !== 130) {
475
+ case 6: {
476
+ if (tag !== 50) {
1409
477
  break;
1410
478
  }
1411
- message.objectType = reader.string();
479
+ message.readAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1412
480
  continue;
1413
481
  }
1414
482
  }
@@ -1420,36 +488,20 @@ export const AlertModel = {
1420
488
  return message;
1421
489
  },
1422
490
  create(base) {
1423
- return AlertModel.fromPartial(base ?? {});
491
+ return Notification.fromPartial(base ?? {});
1424
492
  },
1425
493
  fromPartial(object) {
1426
- const message = createBaseAlertModel();
1427
- message.id = (object.id !== undefined && object.id !== null) ? Long.fromValue(object.id) : Long.UZERO;
1428
- message.organizationId = (object.organizationId !== undefined && object.organizationId !== null)
1429
- ? Long.fromValue(object.organizationId)
1430
- : Long.UZERO;
1431
- message.alertId = (object.alertId !== undefined && object.alertId !== null)
1432
- ? Long.fromValue(object.alertId)
1433
- : Long.UZERO;
1434
- message.alertType = (object.alertType !== undefined && object.alertType !== null)
1435
- ? Long.fromValue(object.alertType)
494
+ const message = createBaseNotification();
495
+ message.id = object.id ?? "";
496
+ message.userId = (object.userId !== undefined && object.userId !== null)
497
+ ? Long.fromValue(object.userId)
1436
498
  : Long.UZERO;
1437
- message.unit = object.unit ?? undefined;
1438
- message.value = (object.value !== undefined && object.value !== null) ? Long.fromValue(object.value) : undefined;
1439
- message.message = object.message ?? "";
1440
- message.name = object.name ?? "";
1441
- message.minValue = object.minValue ?? undefined;
1442
- message.maxValue = object.maxValue ?? undefined;
1443
- message.picture = object.picture ?? undefined;
1444
- message.createdBy = (object.createdBy !== undefined && object.createdBy !== null)
1445
- ? Long.fromValue(object.createdBy)
1446
- : undefined;
1447
- message.updatedBy = (object.updatedBy !== undefined && object.updatedBy !== null)
1448
- ? Long.fromValue(object.updatedBy)
499
+ message.payload = (object.payload !== undefined && object.payload !== null)
500
+ ? Notify.fromPartial(object.payload)
1449
501
  : undefined;
502
+ message.via = object.via?.map((e) => e) || [];
1450
503
  message.createdAt = object.createdAt ?? undefined;
1451
- message.updatedAt = object.updatedAt ?? undefined;
1452
- message.objectType = object.objectType ?? undefined;
504
+ message.readAt = object.readAt ?? undefined;
1453
505
  return message;
1454
506
  },
1455
507
  };
@@ -1852,9 +904,11 @@ export const EventData = {
1852
904
  for (const v of message.eventModules) {
1853
905
  EventModule.encode(v, writer.uint32(50).fork()).join();
1854
906
  }
907
+ writer.uint32(58).fork();
1855
908
  for (const v of message.via) {
1856
- writer.uint32(56).int32(v);
909
+ writer.int32(v);
1857
910
  }
911
+ writer.join();
1858
912
  if (message.templateId !== undefined) {
1859
913
  writer.uint32(64).uint64(message.templateId.toString());
1860
914
  }
@@ -2044,7 +1098,7 @@ export const AlertNotify = {
2044
1098
  writer.uint32(18).string(message.body);
2045
1099
  }
2046
1100
  if (message.sound !== undefined) {
2047
- writer.uint32(24).uint64(message.sound.toString());
1101
+ writer.uint32(26).string(message.sound);
2048
1102
  }
2049
1103
  if (message.image !== undefined) {
2050
1104
  writer.uint32(34).string(message.image);
@@ -2076,10 +1130,10 @@ export const AlertNotify = {
2076
1130
  continue;
2077
1131
  }
2078
1132
  case 3: {
2079
- if (tag !== 24) {
1133
+ if (tag !== 26) {
2080
1134
  break;
2081
1135
  }
2082
- message.sound = Long.fromString(reader.uint64().toString(), true);
1136
+ message.sound = reader.string();
2083
1137
  continue;
2084
1138
  }
2085
1139
  case 4: {
@@ -2111,7 +1165,7 @@ export const AlertNotify = {
2111
1165
  const message = createBaseAlertNotify();
2112
1166
  message.title = object.title ?? "";
2113
1167
  message.body = object.body ?? undefined;
2114
- message.sound = (object.sound !== undefined && object.sound !== null) ? Long.fromValue(object.sound) : undefined;
1168
+ message.sound = object.sound ?? undefined;
2115
1169
  message.image = object.image ?? undefined;
2116
1170
  message.icon = object.icon ?? undefined;
2117
1171
  return message;