@fatehan/tsrp 1.3.21 → 1.3.23

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.
@@ -8,7 +8,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
8
8
  return (mod && mod.__esModule) ? mod : { "default": mod };
9
9
  };
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.Credential = exports.OtpRequest = exports.AccessToken = exports.Identity = exports.TelegramAuth = exports.GoogleAuth = exports.OtpAuth = exports.QrCodeAuth = exports.PasswordAuth = exports.AuthRequest = exports.AuthResponse = exports.OtpCodeResponse = exports.OtpCodeRequest = exports.VerifyResponse = exports.VerifyRequest = exports.LogoutResponse = exports.LogoutRequest = exports.protobufPackage = void 0;
11
+ exports.Credential = exports.OtpRequest = exports.AccessToken = exports.Identity = exports.VerifyResponse = exports.VerifyRequest = exports.LogoutResponse = exports.LogoutRequest = exports.protobufPackage = void 0;
12
12
  /* eslint-disable */
13
13
  const wire_1 = require("@bufbuild/protobuf/wire");
14
14
  const long_1 = __importDefault(require("long"));
@@ -275,673 +275,19 @@ exports.VerifyResponse = {
275
275
  return message;
276
276
  },
277
277
  };
278
- function createBaseOtpCodeRequest() {
279
- return { phone: long_1.default.UZERO };
280
- }
281
- exports.OtpCodeRequest = {
282
- encode(message, writer = new wire_1.BinaryWriter()) {
283
- if (!message.phone.equals(long_1.default.UZERO)) {
284
- writer.uint32(8).uint64(message.phone.toString());
285
- }
286
- return writer;
287
- },
288
- decode(input, length) {
289
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
290
- const end = length === undefined ? reader.len : reader.pos + length;
291
- const message = createBaseOtpCodeRequest();
292
- while (reader.pos < end) {
293
- const tag = reader.uint32();
294
- switch (tag >>> 3) {
295
- case 1: {
296
- if (tag !== 8) {
297
- break;
298
- }
299
- message.phone = long_1.default.fromString(reader.uint64().toString(), true);
300
- continue;
301
- }
302
- }
303
- if ((tag & 7) === 4 || tag === 0) {
304
- break;
305
- }
306
- reader.skip(tag & 7);
307
- }
308
- return message;
309
- },
310
- fromJSON(object) {
311
- return { phone: isSet(object.phone) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO };
312
- },
313
- toJSON(message) {
314
- const obj = {};
315
- if (!message.phone.equals(long_1.default.UZERO)) {
316
- obj.phone = (message.phone || long_1.default.UZERO).toString();
317
- }
318
- return obj;
319
- },
320
- create(base) {
321
- return exports.OtpCodeRequest.fromPartial(base !== null && base !== void 0 ? base : {});
322
- },
323
- fromPartial(object) {
324
- const message = createBaseOtpCodeRequest();
325
- message.phone = (object.phone !== undefined && object.phone !== null) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO;
326
- return message;
327
- },
328
- };
329
- function createBaseOtpCodeResponse() {
330
- return { message: "", passwordRequired: false, status: 0, cost: 0 };
331
- }
332
- exports.OtpCodeResponse = {
333
- encode(message, writer = new wire_1.BinaryWriter()) {
334
- if (message.message !== "") {
335
- writer.uint32(10).string(message.message);
336
- }
337
- if (message.passwordRequired !== false) {
338
- writer.uint32(16).bool(message.passwordRequired);
339
- }
340
- if (message.status !== 0) {
341
- writer.uint32(24).uint32(message.status);
342
- }
343
- if (message.cost !== 0) {
344
- writer.uint32(32).uint32(message.cost);
345
- }
346
- return writer;
347
- },
348
- decode(input, length) {
349
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
350
- const end = length === undefined ? reader.len : reader.pos + length;
351
- const message = createBaseOtpCodeResponse();
352
- while (reader.pos < end) {
353
- const tag = reader.uint32();
354
- switch (tag >>> 3) {
355
- case 1: {
356
- if (tag !== 10) {
357
- break;
358
- }
359
- message.message = reader.string();
360
- continue;
361
- }
362
- case 2: {
363
- if (tag !== 16) {
364
- break;
365
- }
366
- message.passwordRequired = reader.bool();
367
- continue;
368
- }
369
- case 3: {
370
- if (tag !== 24) {
371
- break;
372
- }
373
- message.status = reader.uint32();
374
- continue;
375
- }
376
- case 4: {
377
- if (tag !== 32) {
378
- break;
379
- }
380
- message.cost = reader.uint32();
381
- continue;
382
- }
383
- }
384
- if ((tag & 7) === 4 || tag === 0) {
385
- break;
386
- }
387
- reader.skip(tag & 7);
388
- }
389
- return message;
390
- },
391
- fromJSON(object) {
392
- return {
393
- message: isSet(object.message) ? globalThis.String(object.message) : "",
394
- passwordRequired: isSet(object.password_required) ? globalThis.Boolean(object.password_required) : false,
395
- status: isSet(object.status) ? globalThis.Number(object.status) : 0,
396
- cost: isSet(object.cost) ? globalThis.Number(object.cost) : 0,
397
- };
398
- },
399
- toJSON(message) {
400
- const obj = {};
401
- if (message.message !== "") {
402
- obj.message = message.message;
403
- }
404
- if (message.passwordRequired !== false) {
405
- obj.password_required = message.passwordRequired;
406
- }
407
- if (message.status !== 0) {
408
- obj.status = Math.round(message.status);
409
- }
410
- if (message.cost !== 0) {
411
- obj.cost = Math.round(message.cost);
412
- }
413
- return obj;
414
- },
415
- create(base) {
416
- return exports.OtpCodeResponse.fromPartial(base !== null && base !== void 0 ? base : {});
417
- },
418
- fromPartial(object) {
419
- var _a, _b, _c, _d;
420
- const message = createBaseOtpCodeResponse();
421
- message.message = (_a = object.message) !== null && _a !== void 0 ? _a : "";
422
- message.passwordRequired = (_b = object.passwordRequired) !== null && _b !== void 0 ? _b : false;
423
- message.status = (_c = object.status) !== null && _c !== void 0 ? _c : 0;
424
- message.cost = (_d = object.cost) !== null && _d !== void 0 ? _d : 0;
425
- return message;
426
- },
427
- };
428
- function createBaseAuthResponse() {
429
- return { identity: undefined, token: "", cost: 0 };
430
- }
431
- exports.AuthResponse = {
432
- encode(message, writer = new wire_1.BinaryWriter()) {
433
- if (message.identity !== undefined) {
434
- exports.Identity.encode(message.identity, writer.uint32(10).fork()).join();
435
- }
436
- if (message.token !== "") {
437
- writer.uint32(18).string(message.token);
438
- }
439
- if (message.cost !== 0) {
440
- writer.uint32(24).uint32(message.cost);
441
- }
442
- return writer;
443
- },
444
- decode(input, length) {
445
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
446
- const end = length === undefined ? reader.len : reader.pos + length;
447
- const message = createBaseAuthResponse();
448
- while (reader.pos < end) {
449
- const tag = reader.uint32();
450
- switch (tag >>> 3) {
451
- case 1: {
452
- if (tag !== 10) {
453
- break;
454
- }
455
- message.identity = exports.Identity.decode(reader, reader.uint32());
456
- continue;
457
- }
458
- case 2: {
459
- if (tag !== 18) {
460
- break;
461
- }
462
- message.token = reader.string();
463
- continue;
464
- }
465
- case 3: {
466
- if (tag !== 24) {
467
- break;
468
- }
469
- message.cost = reader.uint32();
470
- continue;
471
- }
472
- }
473
- if ((tag & 7) === 4 || tag === 0) {
474
- break;
475
- }
476
- reader.skip(tag & 7);
477
- }
478
- return message;
479
- },
480
- fromJSON(object) {
481
- return {
482
- identity: isSet(object.identity) ? exports.Identity.fromJSON(object.identity) : undefined,
483
- token: isSet(object.token) ? globalThis.String(object.token) : "",
484
- cost: isSet(object.cost) ? globalThis.Number(object.cost) : 0,
485
- };
486
- },
487
- toJSON(message) {
488
- const obj = {};
489
- if (message.identity !== undefined) {
490
- obj.identity = exports.Identity.toJSON(message.identity);
491
- }
492
- if (message.token !== "") {
493
- obj.token = message.token;
494
- }
495
- if (message.cost !== 0) {
496
- obj.cost = Math.round(message.cost);
497
- }
498
- return obj;
499
- },
500
- create(base) {
501
- return exports.AuthResponse.fromPartial(base !== null && base !== void 0 ? base : {});
502
- },
503
- fromPartial(object) {
504
- var _a, _b;
505
- const message = createBaseAuthResponse();
506
- message.identity = (object.identity !== undefined && object.identity !== null)
507
- ? exports.Identity.fromPartial(object.identity)
508
- : undefined;
509
- message.token = (_a = object.token) !== null && _a !== void 0 ? _a : "";
510
- message.cost = (_b = object.cost) !== null && _b !== void 0 ? _b : 0;
511
- return message;
512
- },
513
- };
514
- function createBaseAuthRequest() {
515
- return {
516
- passwordAuth: undefined,
517
- googleAuth: undefined,
518
- qrCodeAuth: undefined,
519
- telegramAuth: undefined,
520
- otpAuth: undefined,
521
- };
522
- }
523
- exports.AuthRequest = {
524
- encode(message, writer = new wire_1.BinaryWriter()) {
525
- if (message.passwordAuth !== undefined) {
526
- exports.PasswordAuth.encode(message.passwordAuth, writer.uint32(90).fork()).join();
527
- }
528
- if (message.googleAuth !== undefined) {
529
- exports.GoogleAuth.encode(message.googleAuth, writer.uint32(98).fork()).join();
530
- }
531
- if (message.qrCodeAuth !== undefined) {
532
- exports.QrCodeAuth.encode(message.qrCodeAuth, writer.uint32(106).fork()).join();
533
- }
534
- if (message.telegramAuth !== undefined) {
535
- exports.TelegramAuth.encode(message.telegramAuth, writer.uint32(114).fork()).join();
536
- }
537
- if (message.otpAuth !== undefined) {
538
- exports.OtpAuth.encode(message.otpAuth, writer.uint32(122).fork()).join();
539
- }
540
- return writer;
541
- },
542
- decode(input, length) {
543
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
544
- const end = length === undefined ? reader.len : reader.pos + length;
545
- const message = createBaseAuthRequest();
546
- while (reader.pos < end) {
547
- const tag = reader.uint32();
548
- switch (tag >>> 3) {
549
- case 11: {
550
- if (tag !== 90) {
551
- break;
552
- }
553
- message.passwordAuth = exports.PasswordAuth.decode(reader, reader.uint32());
554
- continue;
555
- }
556
- case 12: {
557
- if (tag !== 98) {
558
- break;
559
- }
560
- message.googleAuth = exports.GoogleAuth.decode(reader, reader.uint32());
561
- continue;
562
- }
563
- case 13: {
564
- if (tag !== 106) {
565
- break;
566
- }
567
- message.qrCodeAuth = exports.QrCodeAuth.decode(reader, reader.uint32());
568
- continue;
569
- }
570
- case 14: {
571
- if (tag !== 114) {
572
- break;
573
- }
574
- message.telegramAuth = exports.TelegramAuth.decode(reader, reader.uint32());
575
- continue;
576
- }
577
- case 15: {
578
- if (tag !== 122) {
579
- break;
580
- }
581
- message.otpAuth = exports.OtpAuth.decode(reader, reader.uint32());
582
- continue;
583
- }
584
- }
585
- if ((tag & 7) === 4 || tag === 0) {
586
- break;
587
- }
588
- reader.skip(tag & 7);
589
- }
590
- return message;
591
- },
592
- fromJSON(object) {
593
- return {
594
- passwordAuth: isSet(object.password_auth) ? exports.PasswordAuth.fromJSON(object.password_auth) : undefined,
595
- googleAuth: isSet(object.google_auth) ? exports.GoogleAuth.fromJSON(object.google_auth) : undefined,
596
- qrCodeAuth: isSet(object.qr_code_auth) ? exports.QrCodeAuth.fromJSON(object.qr_code_auth) : undefined,
597
- telegramAuth: isSet(object.telegram_auth) ? exports.TelegramAuth.fromJSON(object.telegram_auth) : undefined,
598
- otpAuth: isSet(object.otp_auth) ? exports.OtpAuth.fromJSON(object.otp_auth) : undefined,
599
- };
600
- },
601
- toJSON(message) {
602
- const obj = {};
603
- if (message.passwordAuth !== undefined) {
604
- obj.password_auth = exports.PasswordAuth.toJSON(message.passwordAuth);
605
- }
606
- if (message.googleAuth !== undefined) {
607
- obj.google_auth = exports.GoogleAuth.toJSON(message.googleAuth);
608
- }
609
- if (message.qrCodeAuth !== undefined) {
610
- obj.qr_code_auth = exports.QrCodeAuth.toJSON(message.qrCodeAuth);
611
- }
612
- if (message.telegramAuth !== undefined) {
613
- obj.telegram_auth = exports.TelegramAuth.toJSON(message.telegramAuth);
614
- }
615
- if (message.otpAuth !== undefined) {
616
- obj.otp_auth = exports.OtpAuth.toJSON(message.otpAuth);
617
- }
618
- return obj;
619
- },
620
- create(base) {
621
- return exports.AuthRequest.fromPartial(base !== null && base !== void 0 ? base : {});
622
- },
623
- fromPartial(object) {
624
- const message = createBaseAuthRequest();
625
- message.passwordAuth = (object.passwordAuth !== undefined && object.passwordAuth !== null)
626
- ? exports.PasswordAuth.fromPartial(object.passwordAuth)
627
- : undefined;
628
- message.googleAuth = (object.googleAuth !== undefined && object.googleAuth !== null)
629
- ? exports.GoogleAuth.fromPartial(object.googleAuth)
630
- : undefined;
631
- message.qrCodeAuth = (object.qrCodeAuth !== undefined && object.qrCodeAuth !== null)
632
- ? exports.QrCodeAuth.fromPartial(object.qrCodeAuth)
633
- : undefined;
634
- message.telegramAuth = (object.telegramAuth !== undefined && object.telegramAuth !== null)
635
- ? exports.TelegramAuth.fromPartial(object.telegramAuth)
636
- : undefined;
637
- message.otpAuth = (object.otpAuth !== undefined && object.otpAuth !== null)
638
- ? exports.OtpAuth.fromPartial(object.otpAuth)
639
- : undefined;
640
- return message;
641
- },
642
- };
643
- function createBasePasswordAuth() {
644
- return { phone: long_1.default.UZERO, password: "" };
645
- }
646
- exports.PasswordAuth = {
647
- encode(message, writer = new wire_1.BinaryWriter()) {
648
- if (!message.phone.equals(long_1.default.UZERO)) {
649
- writer.uint32(8).uint64(message.phone.toString());
650
- }
651
- if (message.password !== "") {
652
- writer.uint32(18).string(message.password);
653
- }
654
- return writer;
655
- },
656
- decode(input, length) {
657
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
658
- const end = length === undefined ? reader.len : reader.pos + length;
659
- const message = createBasePasswordAuth();
660
- while (reader.pos < end) {
661
- const tag = reader.uint32();
662
- switch (tag >>> 3) {
663
- case 1: {
664
- if (tag !== 8) {
665
- break;
666
- }
667
- message.phone = long_1.default.fromString(reader.uint64().toString(), true);
668
- continue;
669
- }
670
- case 2: {
671
- if (tag !== 18) {
672
- break;
673
- }
674
- message.password = reader.string();
675
- continue;
676
- }
677
- }
678
- if ((tag & 7) === 4 || tag === 0) {
679
- break;
680
- }
681
- reader.skip(tag & 7);
682
- }
683
- return message;
684
- },
685
- fromJSON(object) {
686
- return {
687
- phone: isSet(object.phone) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO,
688
- password: isSet(object.password) ? globalThis.String(object.password) : "",
689
- };
690
- },
691
- toJSON(message) {
692
- const obj = {};
693
- if (!message.phone.equals(long_1.default.UZERO)) {
694
- obj.phone = (message.phone || long_1.default.UZERO).toString();
695
- }
696
- if (message.password !== "") {
697
- obj.password = message.password;
698
- }
699
- return obj;
700
- },
701
- create(base) {
702
- return exports.PasswordAuth.fromPartial(base !== null && base !== void 0 ? base : {});
703
- },
704
- fromPartial(object) {
705
- var _a;
706
- const message = createBasePasswordAuth();
707
- message.phone = (object.phone !== undefined && object.phone !== null) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO;
708
- message.password = (_a = object.password) !== null && _a !== void 0 ? _a : "";
709
- return message;
710
- },
711
- };
712
- function createBaseQrCodeAuth() {
713
- return { token: "" };
714
- }
715
- exports.QrCodeAuth = {
716
- encode(message, writer = new wire_1.BinaryWriter()) {
717
- if (message.token !== "") {
718
- writer.uint32(10).string(message.token);
719
- }
720
- return writer;
721
- },
722
- decode(input, length) {
723
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
724
- const end = length === undefined ? reader.len : reader.pos + length;
725
- const message = createBaseQrCodeAuth();
726
- while (reader.pos < end) {
727
- const tag = reader.uint32();
728
- switch (tag >>> 3) {
729
- case 1: {
730
- if (tag !== 10) {
731
- break;
732
- }
733
- message.token = reader.string();
734
- continue;
735
- }
736
- }
737
- if ((tag & 7) === 4 || tag === 0) {
738
- break;
739
- }
740
- reader.skip(tag & 7);
741
- }
742
- return message;
743
- },
744
- fromJSON(object) {
745
- return { token: isSet(object.token) ? globalThis.String(object.token) : "" };
746
- },
747
- toJSON(message) {
748
- const obj = {};
749
- if (message.token !== "") {
750
- obj.token = message.token;
751
- }
752
- return obj;
753
- },
754
- create(base) {
755
- return exports.QrCodeAuth.fromPartial(base !== null && base !== void 0 ? base : {});
756
- },
757
- fromPartial(object) {
758
- var _a;
759
- const message = createBaseQrCodeAuth();
760
- message.token = (_a = object.token) !== null && _a !== void 0 ? _a : "";
761
- return message;
762
- },
763
- };
764
- function createBaseOtpAuth() {
765
- return { phone: long_1.default.UZERO, code: 0, password: undefined, deviceType: "" };
766
- }
767
- exports.OtpAuth = {
768
- encode(message, writer = new wire_1.BinaryWriter()) {
769
- if (!message.phone.equals(long_1.default.UZERO)) {
770
- writer.uint32(8).uint64(message.phone.toString());
771
- }
772
- if (message.code !== 0) {
773
- writer.uint32(16).uint32(message.code);
774
- }
775
- if (message.password !== undefined) {
776
- writer.uint32(26).string(message.password);
777
- }
778
- if (message.deviceType !== "") {
779
- writer.uint32(34).string(message.deviceType);
780
- }
781
- return writer;
782
- },
783
- decode(input, length) {
784
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
785
- const end = length === undefined ? reader.len : reader.pos + length;
786
- const message = createBaseOtpAuth();
787
- while (reader.pos < end) {
788
- const tag = reader.uint32();
789
- switch (tag >>> 3) {
790
- case 1: {
791
- if (tag !== 8) {
792
- break;
793
- }
794
- message.phone = long_1.default.fromString(reader.uint64().toString(), true);
795
- continue;
796
- }
797
- case 2: {
798
- if (tag !== 16) {
799
- break;
800
- }
801
- message.code = reader.uint32();
802
- continue;
803
- }
804
- case 3: {
805
- if (tag !== 26) {
806
- break;
807
- }
808
- message.password = reader.string();
809
- continue;
810
- }
811
- case 4: {
812
- if (tag !== 34) {
813
- break;
814
- }
815
- message.deviceType = reader.string();
816
- continue;
817
- }
818
- }
819
- if ((tag & 7) === 4 || tag === 0) {
820
- break;
821
- }
822
- reader.skip(tag & 7);
823
- }
824
- return message;
825
- },
826
- fromJSON(object) {
827
- return {
828
- phone: isSet(object.phone) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO,
829
- code: isSet(object.code) ? globalThis.Number(object.code) : 0,
830
- password: isSet(object.password) ? globalThis.String(object.password) : undefined,
831
- deviceType: isSet(object.device_type) ? globalThis.String(object.device_type) : "",
832
- };
833
- },
834
- toJSON(message) {
835
- const obj = {};
836
- if (!message.phone.equals(long_1.default.UZERO)) {
837
- obj.phone = (message.phone || long_1.default.UZERO).toString();
838
- }
839
- if (message.code !== 0) {
840
- obj.code = Math.round(message.code);
841
- }
842
- if (message.password !== undefined) {
843
- obj.password = message.password;
844
- }
845
- if (message.deviceType !== "") {
846
- obj.device_type = message.deviceType;
847
- }
848
- return obj;
849
- },
850
- create(base) {
851
- return exports.OtpAuth.fromPartial(base !== null && base !== void 0 ? base : {});
852
- },
853
- fromPartial(object) {
854
- var _a, _b, _c;
855
- const message = createBaseOtpAuth();
856
- message.phone = (object.phone !== undefined && object.phone !== null) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO;
857
- message.code = (_a = object.code) !== null && _a !== void 0 ? _a : 0;
858
- message.password = (_b = object.password) !== null && _b !== void 0 ? _b : undefined;
859
- message.deviceType = (_c = object.deviceType) !== null && _c !== void 0 ? _c : "";
860
- return message;
861
- },
862
- };
863
- function createBaseGoogleAuth() {
864
- return {};
865
- }
866
- exports.GoogleAuth = {
867
- encode(_, writer = new wire_1.BinaryWriter()) {
868
- return writer;
869
- },
870
- decode(input, length) {
871
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
872
- const end = length === undefined ? reader.len : reader.pos + length;
873
- const message = createBaseGoogleAuth();
874
- while (reader.pos < end) {
875
- const tag = reader.uint32();
876
- switch (tag >>> 3) {
877
- }
878
- if ((tag & 7) === 4 || tag === 0) {
879
- break;
880
- }
881
- reader.skip(tag & 7);
882
- }
883
- return message;
884
- },
885
- fromJSON(_) {
886
- return {};
887
- },
888
- toJSON(_) {
889
- const obj = {};
890
- return obj;
891
- },
892
- create(base) {
893
- return exports.GoogleAuth.fromPartial(base !== null && base !== void 0 ? base : {});
894
- },
895
- fromPartial(_) {
896
- const message = createBaseGoogleAuth();
897
- return message;
898
- },
899
- };
900
- function createBaseTelegramAuth() {
901
- return {};
902
- }
903
- exports.TelegramAuth = {
904
- encode(_, writer = new wire_1.BinaryWriter()) {
905
- return writer;
906
- },
907
- decode(input, length) {
908
- const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
909
- const end = length === undefined ? reader.len : reader.pos + length;
910
- const message = createBaseTelegramAuth();
911
- while (reader.pos < end) {
912
- const tag = reader.uint32();
913
- switch (tag >>> 3) {
914
- }
915
- if ((tag & 7) === 4 || tag === 0) {
916
- break;
917
- }
918
- reader.skip(tag & 7);
919
- }
920
- return message;
921
- },
922
- fromJSON(_) {
923
- return {};
924
- },
925
- toJSON(_) {
926
- const obj = {};
927
- return obj;
928
- },
929
- create(base) {
930
- return exports.TelegramAuth.fromPartial(base !== null && base !== void 0 ? base : {});
931
- },
932
- fromPartial(_) {
933
- const message = createBaseTelegramAuth();
934
- return message;
935
- },
936
- };
937
278
  function createBaseIdentity() {
938
279
  return {
939
280
  id: long_1.default.UZERO,
940
281
  phone: long_1.default.UZERO,
282
+ email: undefined,
283
+ name: undefined,
284
+ picture: undefined,
941
285
  createdAt: undefined,
942
286
  updatedAt: undefined,
943
287
  encryptedPhone: new Uint8Array(0),
944
288
  phoneHash: new Uint8Array(0),
289
+ encryptedEmail: undefined,
290
+ emailHash: undefined,
945
291
  };
946
292
  }
947
293
  exports.Identity = {
@@ -952,6 +298,15 @@ exports.Identity = {
952
298
  if (!message.phone.equals(long_1.default.UZERO)) {
953
299
  writer.uint32(16).uint64(message.phone.toString());
954
300
  }
301
+ if (message.email !== undefined) {
302
+ writer.uint32(58).string(message.email);
303
+ }
304
+ if (message.name !== undefined) {
305
+ writer.uint32(66).string(message.name);
306
+ }
307
+ if (message.picture !== undefined) {
308
+ writer.uint32(74).string(message.picture);
309
+ }
955
310
  if (message.createdAt !== undefined) {
956
311
  timestamp_1.Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(26).fork()).join();
957
312
  }
@@ -964,6 +319,12 @@ exports.Identity = {
964
319
  if (message.phoneHash.length !== 0) {
965
320
  writer.uint32(50).bytes(message.phoneHash);
966
321
  }
322
+ if (message.encryptedEmail !== undefined) {
323
+ writer.uint32(82).bytes(message.encryptedEmail);
324
+ }
325
+ if (message.emailHash !== undefined) {
326
+ writer.uint32(90).bytes(message.emailHash);
327
+ }
967
328
  return writer;
968
329
  },
969
330
  decode(input, length) {
@@ -987,6 +348,27 @@ exports.Identity = {
987
348
  message.phone = long_1.default.fromString(reader.uint64().toString(), true);
988
349
  continue;
989
350
  }
351
+ case 7: {
352
+ if (tag !== 58) {
353
+ break;
354
+ }
355
+ message.email = reader.string();
356
+ continue;
357
+ }
358
+ case 8: {
359
+ if (tag !== 66) {
360
+ break;
361
+ }
362
+ message.name = reader.string();
363
+ continue;
364
+ }
365
+ case 9: {
366
+ if (tag !== 74) {
367
+ break;
368
+ }
369
+ message.picture = reader.string();
370
+ continue;
371
+ }
990
372
  case 3: {
991
373
  if (tag !== 26) {
992
374
  break;
@@ -1015,6 +397,20 @@ exports.Identity = {
1015
397
  message.phoneHash = reader.bytes();
1016
398
  continue;
1017
399
  }
400
+ case 10: {
401
+ if (tag !== 82) {
402
+ break;
403
+ }
404
+ message.encryptedEmail = reader.bytes();
405
+ continue;
406
+ }
407
+ case 11: {
408
+ if (tag !== 90) {
409
+ break;
410
+ }
411
+ message.emailHash = reader.bytes();
412
+ continue;
413
+ }
1018
414
  }
1019
415
  if ((tag & 7) === 4 || tag === 0) {
1020
416
  break;
@@ -1027,10 +423,15 @@ exports.Identity = {
1027
423
  return {
1028
424
  id: isSet(object.id) ? long_1.default.fromValue(object.id) : long_1.default.UZERO,
1029
425
  phone: isSet(object.phone) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO,
426
+ email: isSet(object.email) ? globalThis.String(object.email) : undefined,
427
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
428
+ picture: isSet(object.picture) ? globalThis.String(object.picture) : undefined,
1030
429
  createdAt: isSet(object.created_at) ? fromJsonTimestamp(object.created_at) : undefined,
1031
430
  updatedAt: isSet(object.updated_at) ? fromJsonTimestamp(object.updated_at) : undefined,
1032
431
  encryptedPhone: isSet(object.encrypted_phone) ? bytesFromBase64(object.encrypted_phone) : new Uint8Array(0),
1033
432
  phoneHash: isSet(object.phone_hash) ? bytesFromBase64(object.phone_hash) : new Uint8Array(0),
433
+ encryptedEmail: isSet(object.encrypted_email) ? bytesFromBase64(object.encrypted_email) : undefined,
434
+ emailHash: isSet(object.email_hash) ? bytesFromBase64(object.email_hash) : undefined,
1034
435
  };
1035
436
  },
1036
437
  toJSON(message) {
@@ -1041,6 +442,15 @@ exports.Identity = {
1041
442
  if (!message.phone.equals(long_1.default.UZERO)) {
1042
443
  obj.phone = (message.phone || long_1.default.UZERO).toString();
1043
444
  }
445
+ if (message.email !== undefined) {
446
+ obj.email = message.email;
447
+ }
448
+ if (message.name !== undefined) {
449
+ obj.name = message.name;
450
+ }
451
+ if (message.picture !== undefined) {
452
+ obj.picture = message.picture;
453
+ }
1044
454
  if (message.createdAt !== undefined) {
1045
455
  obj.created_at = message.createdAt.toISOString();
1046
456
  }
@@ -1053,20 +463,31 @@ exports.Identity = {
1053
463
  if (message.phoneHash.length !== 0) {
1054
464
  obj.phone_hash = base64FromBytes(message.phoneHash);
1055
465
  }
466
+ if (message.encryptedEmail !== undefined) {
467
+ obj.encrypted_email = base64FromBytes(message.encryptedEmail);
468
+ }
469
+ if (message.emailHash !== undefined) {
470
+ obj.email_hash = base64FromBytes(message.emailHash);
471
+ }
1056
472
  return obj;
1057
473
  },
1058
474
  create(base) {
1059
475
  return exports.Identity.fromPartial(base !== null && base !== void 0 ? base : {});
1060
476
  },
1061
477
  fromPartial(object) {
1062
- var _a, _b, _c, _d;
478
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1063
479
  const message = createBaseIdentity();
1064
480
  message.id = (object.id !== undefined && object.id !== null) ? long_1.default.fromValue(object.id) : long_1.default.UZERO;
1065
481
  message.phone = (object.phone !== undefined && object.phone !== null) ? long_1.default.fromValue(object.phone) : long_1.default.UZERO;
1066
- message.createdAt = (_a = object.createdAt) !== null && _a !== void 0 ? _a : undefined;
1067
- message.updatedAt = (_b = object.updatedAt) !== null && _b !== void 0 ? _b : undefined;
1068
- message.encryptedPhone = (_c = object.encryptedPhone) !== null && _c !== void 0 ? _c : new Uint8Array(0);
1069
- message.phoneHash = (_d = object.phoneHash) !== null && _d !== void 0 ? _d : new Uint8Array(0);
482
+ message.email = (_a = object.email) !== null && _a !== void 0 ? _a : undefined;
483
+ message.name = (_b = object.name) !== null && _b !== void 0 ? _b : undefined;
484
+ message.picture = (_c = object.picture) !== null && _c !== void 0 ? _c : undefined;
485
+ message.createdAt = (_d = object.createdAt) !== null && _d !== void 0 ? _d : undefined;
486
+ message.updatedAt = (_e = object.updatedAt) !== null && _e !== void 0 ? _e : undefined;
487
+ message.encryptedPhone = (_f = object.encryptedPhone) !== null && _f !== void 0 ? _f : new Uint8Array(0);
488
+ message.phoneHash = (_g = object.phoneHash) !== null && _g !== void 0 ? _g : new Uint8Array(0);
489
+ message.encryptedEmail = (_h = object.encryptedEmail) !== null && _h !== void 0 ? _h : undefined;
490
+ message.emailHash = (_j = object.emailHash) !== null && _j !== void 0 ? _j : undefined;
1070
491
  return message;
1071
492
  },
1072
493
  };