@sa2-movie-ticket/contracts 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/gen/ts/account.ts +498 -0
- package/gen/ts/auth.ts +400 -0
- package/package.json +1 -1
- package/proto/account.proto +36 -1
- package/proto/auth.proto +20 -0
package/gen/ts/account.ts
CHANGED
|
@@ -112,6 +112,28 @@ export interface DeleteAccountRequest {
|
|
|
112
112
|
id: string;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
export interface InitEmailChangeRequest {
|
|
116
|
+
id: string;
|
|
117
|
+
newEmail: string;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface ConfirmEmailChangeRequest {
|
|
121
|
+
newEmail: string;
|
|
122
|
+
code: string;
|
|
123
|
+
userId: string;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface InitPhoneChangeRequest {
|
|
127
|
+
id: string;
|
|
128
|
+
newPhone: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ConfirmPhoneChangeRequest {
|
|
132
|
+
newPhone: string;
|
|
133
|
+
code: string;
|
|
134
|
+
userId: string;
|
|
135
|
+
}
|
|
136
|
+
|
|
115
137
|
function createBaseAccount(): Account {
|
|
116
138
|
return {
|
|
117
139
|
id: "",
|
|
@@ -507,6 +529,366 @@ export const DeleteAccountRequest: MessageFns<DeleteAccountRequest> = {
|
|
|
507
529
|
},
|
|
508
530
|
};
|
|
509
531
|
|
|
532
|
+
function createBaseInitEmailChangeRequest(): InitEmailChangeRequest {
|
|
533
|
+
return { id: "", newEmail: "" };
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export const InitEmailChangeRequest: MessageFns<InitEmailChangeRequest> = {
|
|
537
|
+
encode(message: InitEmailChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
538
|
+
if (message.id !== "") {
|
|
539
|
+
writer.uint32(10).string(message.id);
|
|
540
|
+
}
|
|
541
|
+
if (message.newEmail !== "") {
|
|
542
|
+
writer.uint32(18).string(message.newEmail);
|
|
543
|
+
}
|
|
544
|
+
return writer;
|
|
545
|
+
},
|
|
546
|
+
|
|
547
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitEmailChangeRequest {
|
|
548
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
549
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
550
|
+
const message = createBaseInitEmailChangeRequest();
|
|
551
|
+
while (reader.pos < end) {
|
|
552
|
+
const tag = reader.uint32();
|
|
553
|
+
switch (tag >>> 3) {
|
|
554
|
+
case 1: {
|
|
555
|
+
if (tag !== 10) {
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
message.id = reader.string();
|
|
560
|
+
continue;
|
|
561
|
+
}
|
|
562
|
+
case 2: {
|
|
563
|
+
if (tag !== 18) {
|
|
564
|
+
break;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
message.newEmail = reader.string();
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
reader.skip(tag & 7);
|
|
575
|
+
}
|
|
576
|
+
return message;
|
|
577
|
+
},
|
|
578
|
+
|
|
579
|
+
fromJSON(object: any): InitEmailChangeRequest {
|
|
580
|
+
return {
|
|
581
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
582
|
+
newEmail: isSet(object.newEmail)
|
|
583
|
+
? globalThis.String(object.newEmail)
|
|
584
|
+
: isSet(object.new_email)
|
|
585
|
+
? globalThis.String(object.new_email)
|
|
586
|
+
: "",
|
|
587
|
+
};
|
|
588
|
+
},
|
|
589
|
+
|
|
590
|
+
toJSON(message: InitEmailChangeRequest): unknown {
|
|
591
|
+
const obj: any = {};
|
|
592
|
+
if (message.id !== "") {
|
|
593
|
+
obj.id = message.id;
|
|
594
|
+
}
|
|
595
|
+
if (message.newEmail !== "") {
|
|
596
|
+
obj.newEmail = message.newEmail;
|
|
597
|
+
}
|
|
598
|
+
return obj;
|
|
599
|
+
},
|
|
600
|
+
|
|
601
|
+
create<I extends Exact<DeepPartial<InitEmailChangeRequest>, I>>(base?: I): InitEmailChangeRequest {
|
|
602
|
+
return InitEmailChangeRequest.fromPartial(base ?? ({} as any));
|
|
603
|
+
},
|
|
604
|
+
fromPartial<I extends Exact<DeepPartial<InitEmailChangeRequest>, I>>(object: I): InitEmailChangeRequest {
|
|
605
|
+
const message = createBaseInitEmailChangeRequest();
|
|
606
|
+
message.id = object.id ?? "";
|
|
607
|
+
message.newEmail = object.newEmail ?? "";
|
|
608
|
+
return message;
|
|
609
|
+
},
|
|
610
|
+
};
|
|
611
|
+
|
|
612
|
+
function createBaseConfirmEmailChangeRequest(): ConfirmEmailChangeRequest {
|
|
613
|
+
return { newEmail: "", code: "", userId: "" };
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export const ConfirmEmailChangeRequest: MessageFns<ConfirmEmailChangeRequest> = {
|
|
617
|
+
encode(message: ConfirmEmailChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
618
|
+
if (message.newEmail !== "") {
|
|
619
|
+
writer.uint32(10).string(message.newEmail);
|
|
620
|
+
}
|
|
621
|
+
if (message.code !== "") {
|
|
622
|
+
writer.uint32(18).string(message.code);
|
|
623
|
+
}
|
|
624
|
+
if (message.userId !== "") {
|
|
625
|
+
writer.uint32(26).string(message.userId);
|
|
626
|
+
}
|
|
627
|
+
return writer;
|
|
628
|
+
},
|
|
629
|
+
|
|
630
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmEmailChangeRequest {
|
|
631
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
632
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
633
|
+
const message = createBaseConfirmEmailChangeRequest();
|
|
634
|
+
while (reader.pos < end) {
|
|
635
|
+
const tag = reader.uint32();
|
|
636
|
+
switch (tag >>> 3) {
|
|
637
|
+
case 1: {
|
|
638
|
+
if (tag !== 10) {
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
message.newEmail = reader.string();
|
|
643
|
+
continue;
|
|
644
|
+
}
|
|
645
|
+
case 2: {
|
|
646
|
+
if (tag !== 18) {
|
|
647
|
+
break;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
message.code = reader.string();
|
|
651
|
+
continue;
|
|
652
|
+
}
|
|
653
|
+
case 3: {
|
|
654
|
+
if (tag !== 26) {
|
|
655
|
+
break;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
message.userId = reader.string();
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
reader.skip(tag & 7);
|
|
666
|
+
}
|
|
667
|
+
return message;
|
|
668
|
+
},
|
|
669
|
+
|
|
670
|
+
fromJSON(object: any): ConfirmEmailChangeRequest {
|
|
671
|
+
return {
|
|
672
|
+
newEmail: isSet(object.newEmail)
|
|
673
|
+
? globalThis.String(object.newEmail)
|
|
674
|
+
: isSet(object.new_email)
|
|
675
|
+
? globalThis.String(object.new_email)
|
|
676
|
+
: "",
|
|
677
|
+
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
678
|
+
userId: isSet(object.userId)
|
|
679
|
+
? globalThis.String(object.userId)
|
|
680
|
+
: isSet(object.user_id)
|
|
681
|
+
? globalThis.String(object.user_id)
|
|
682
|
+
: "",
|
|
683
|
+
};
|
|
684
|
+
},
|
|
685
|
+
|
|
686
|
+
toJSON(message: ConfirmEmailChangeRequest): unknown {
|
|
687
|
+
const obj: any = {};
|
|
688
|
+
if (message.newEmail !== "") {
|
|
689
|
+
obj.newEmail = message.newEmail;
|
|
690
|
+
}
|
|
691
|
+
if (message.code !== "") {
|
|
692
|
+
obj.code = message.code;
|
|
693
|
+
}
|
|
694
|
+
if (message.userId !== "") {
|
|
695
|
+
obj.userId = message.userId;
|
|
696
|
+
}
|
|
697
|
+
return obj;
|
|
698
|
+
},
|
|
699
|
+
|
|
700
|
+
create<I extends Exact<DeepPartial<ConfirmEmailChangeRequest>, I>>(base?: I): ConfirmEmailChangeRequest {
|
|
701
|
+
return ConfirmEmailChangeRequest.fromPartial(base ?? ({} as any));
|
|
702
|
+
},
|
|
703
|
+
fromPartial<I extends Exact<DeepPartial<ConfirmEmailChangeRequest>, I>>(object: I): ConfirmEmailChangeRequest {
|
|
704
|
+
const message = createBaseConfirmEmailChangeRequest();
|
|
705
|
+
message.newEmail = object.newEmail ?? "";
|
|
706
|
+
message.code = object.code ?? "";
|
|
707
|
+
message.userId = object.userId ?? "";
|
|
708
|
+
return message;
|
|
709
|
+
},
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
function createBaseInitPhoneChangeRequest(): InitPhoneChangeRequest {
|
|
713
|
+
return { id: "", newPhone: "" };
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export const InitPhoneChangeRequest: MessageFns<InitPhoneChangeRequest> = {
|
|
717
|
+
encode(message: InitPhoneChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
718
|
+
if (message.id !== "") {
|
|
719
|
+
writer.uint32(10).string(message.id);
|
|
720
|
+
}
|
|
721
|
+
if (message.newPhone !== "") {
|
|
722
|
+
writer.uint32(18).string(message.newPhone);
|
|
723
|
+
}
|
|
724
|
+
return writer;
|
|
725
|
+
},
|
|
726
|
+
|
|
727
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitPhoneChangeRequest {
|
|
728
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
729
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
730
|
+
const message = createBaseInitPhoneChangeRequest();
|
|
731
|
+
while (reader.pos < end) {
|
|
732
|
+
const tag = reader.uint32();
|
|
733
|
+
switch (tag >>> 3) {
|
|
734
|
+
case 1: {
|
|
735
|
+
if (tag !== 10) {
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
message.id = reader.string();
|
|
740
|
+
continue;
|
|
741
|
+
}
|
|
742
|
+
case 2: {
|
|
743
|
+
if (tag !== 18) {
|
|
744
|
+
break;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
message.newPhone = reader.string();
|
|
748
|
+
continue;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
752
|
+
break;
|
|
753
|
+
}
|
|
754
|
+
reader.skip(tag & 7);
|
|
755
|
+
}
|
|
756
|
+
return message;
|
|
757
|
+
},
|
|
758
|
+
|
|
759
|
+
fromJSON(object: any): InitPhoneChangeRequest {
|
|
760
|
+
return {
|
|
761
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
762
|
+
newPhone: isSet(object.newPhone)
|
|
763
|
+
? globalThis.String(object.newPhone)
|
|
764
|
+
: isSet(object.new_phone)
|
|
765
|
+
? globalThis.String(object.new_phone)
|
|
766
|
+
: "",
|
|
767
|
+
};
|
|
768
|
+
},
|
|
769
|
+
|
|
770
|
+
toJSON(message: InitPhoneChangeRequest): unknown {
|
|
771
|
+
const obj: any = {};
|
|
772
|
+
if (message.id !== "") {
|
|
773
|
+
obj.id = message.id;
|
|
774
|
+
}
|
|
775
|
+
if (message.newPhone !== "") {
|
|
776
|
+
obj.newPhone = message.newPhone;
|
|
777
|
+
}
|
|
778
|
+
return obj;
|
|
779
|
+
},
|
|
780
|
+
|
|
781
|
+
create<I extends Exact<DeepPartial<InitPhoneChangeRequest>, I>>(base?: I): InitPhoneChangeRequest {
|
|
782
|
+
return InitPhoneChangeRequest.fromPartial(base ?? ({} as any));
|
|
783
|
+
},
|
|
784
|
+
fromPartial<I extends Exact<DeepPartial<InitPhoneChangeRequest>, I>>(object: I): InitPhoneChangeRequest {
|
|
785
|
+
const message = createBaseInitPhoneChangeRequest();
|
|
786
|
+
message.id = object.id ?? "";
|
|
787
|
+
message.newPhone = object.newPhone ?? "";
|
|
788
|
+
return message;
|
|
789
|
+
},
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
function createBaseConfirmPhoneChangeRequest(): ConfirmPhoneChangeRequest {
|
|
793
|
+
return { newPhone: "", code: "", userId: "" };
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export const ConfirmPhoneChangeRequest: MessageFns<ConfirmPhoneChangeRequest> = {
|
|
797
|
+
encode(message: ConfirmPhoneChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
798
|
+
if (message.newPhone !== "") {
|
|
799
|
+
writer.uint32(10).string(message.newPhone);
|
|
800
|
+
}
|
|
801
|
+
if (message.code !== "") {
|
|
802
|
+
writer.uint32(18).string(message.code);
|
|
803
|
+
}
|
|
804
|
+
if (message.userId !== "") {
|
|
805
|
+
writer.uint32(26).string(message.userId);
|
|
806
|
+
}
|
|
807
|
+
return writer;
|
|
808
|
+
},
|
|
809
|
+
|
|
810
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmPhoneChangeRequest {
|
|
811
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
812
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
813
|
+
const message = createBaseConfirmPhoneChangeRequest();
|
|
814
|
+
while (reader.pos < end) {
|
|
815
|
+
const tag = reader.uint32();
|
|
816
|
+
switch (tag >>> 3) {
|
|
817
|
+
case 1: {
|
|
818
|
+
if (tag !== 10) {
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
message.newPhone = reader.string();
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
case 2: {
|
|
826
|
+
if (tag !== 18) {
|
|
827
|
+
break;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
message.code = reader.string();
|
|
831
|
+
continue;
|
|
832
|
+
}
|
|
833
|
+
case 3: {
|
|
834
|
+
if (tag !== 26) {
|
|
835
|
+
break;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
message.userId = reader.string();
|
|
839
|
+
continue;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
843
|
+
break;
|
|
844
|
+
}
|
|
845
|
+
reader.skip(tag & 7);
|
|
846
|
+
}
|
|
847
|
+
return message;
|
|
848
|
+
},
|
|
849
|
+
|
|
850
|
+
fromJSON(object: any): ConfirmPhoneChangeRequest {
|
|
851
|
+
return {
|
|
852
|
+
newPhone: isSet(object.newPhone)
|
|
853
|
+
? globalThis.String(object.newPhone)
|
|
854
|
+
: isSet(object.new_phone)
|
|
855
|
+
? globalThis.String(object.new_phone)
|
|
856
|
+
: "",
|
|
857
|
+
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
858
|
+
userId: isSet(object.userId)
|
|
859
|
+
? globalThis.String(object.userId)
|
|
860
|
+
: isSet(object.user_id)
|
|
861
|
+
? globalThis.String(object.user_id)
|
|
862
|
+
: "",
|
|
863
|
+
};
|
|
864
|
+
},
|
|
865
|
+
|
|
866
|
+
toJSON(message: ConfirmPhoneChangeRequest): unknown {
|
|
867
|
+
const obj: any = {};
|
|
868
|
+
if (message.newPhone !== "") {
|
|
869
|
+
obj.newPhone = message.newPhone;
|
|
870
|
+
}
|
|
871
|
+
if (message.code !== "") {
|
|
872
|
+
obj.code = message.code;
|
|
873
|
+
}
|
|
874
|
+
if (message.userId !== "") {
|
|
875
|
+
obj.userId = message.userId;
|
|
876
|
+
}
|
|
877
|
+
return obj;
|
|
878
|
+
},
|
|
879
|
+
|
|
880
|
+
create<I extends Exact<DeepPartial<ConfirmPhoneChangeRequest>, I>>(base?: I): ConfirmPhoneChangeRequest {
|
|
881
|
+
return ConfirmPhoneChangeRequest.fromPartial(base ?? ({} as any));
|
|
882
|
+
},
|
|
883
|
+
fromPartial<I extends Exact<DeepPartial<ConfirmPhoneChangeRequest>, I>>(object: I): ConfirmPhoneChangeRequest {
|
|
884
|
+
const message = createBaseConfirmPhoneChangeRequest();
|
|
885
|
+
message.newPhone = object.newPhone ?? "";
|
|
886
|
+
message.code = object.code ?? "";
|
|
887
|
+
message.userId = object.userId ?? "";
|
|
888
|
+
return message;
|
|
889
|
+
},
|
|
890
|
+
};
|
|
891
|
+
|
|
510
892
|
export type AccountServiceService = typeof AccountServiceService;
|
|
511
893
|
export const AccountServiceService = {
|
|
512
894
|
/** Retrieves a specific account by ID */
|
|
@@ -539,6 +921,50 @@ export const AccountServiceService = {
|
|
|
539
921
|
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
540
922
|
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
541
923
|
},
|
|
924
|
+
/** init email change */
|
|
925
|
+
initEmailChange: {
|
|
926
|
+
path: "/account.v1.AccountService/InitEmailChange",
|
|
927
|
+
requestStream: false,
|
|
928
|
+
responseStream: false,
|
|
929
|
+
requestSerialize: (value: InitEmailChangeRequest): Buffer =>
|
|
930
|
+
Buffer.from(InitEmailChangeRequest.encode(value).finish()),
|
|
931
|
+
requestDeserialize: (value: Buffer): InitEmailChangeRequest => InitEmailChangeRequest.decode(value),
|
|
932
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
933
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
934
|
+
},
|
|
935
|
+
/** confirm email change */
|
|
936
|
+
confirmEmailChange: {
|
|
937
|
+
path: "/account.v1.AccountService/ConfirmEmailChange",
|
|
938
|
+
requestStream: false,
|
|
939
|
+
responseStream: false,
|
|
940
|
+
requestSerialize: (value: ConfirmEmailChangeRequest): Buffer =>
|
|
941
|
+
Buffer.from(ConfirmEmailChangeRequest.encode(value).finish()),
|
|
942
|
+
requestDeserialize: (value: Buffer): ConfirmEmailChangeRequest => ConfirmEmailChangeRequest.decode(value),
|
|
943
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
944
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
945
|
+
},
|
|
946
|
+
/** init phone change */
|
|
947
|
+
initPhoneChange: {
|
|
948
|
+
path: "/account.v1.AccountService/InitPhoneChange",
|
|
949
|
+
requestStream: false,
|
|
950
|
+
responseStream: false,
|
|
951
|
+
requestSerialize: (value: InitPhoneChangeRequest): Buffer =>
|
|
952
|
+
Buffer.from(InitPhoneChangeRequest.encode(value).finish()),
|
|
953
|
+
requestDeserialize: (value: Buffer): InitPhoneChangeRequest => InitPhoneChangeRequest.decode(value),
|
|
954
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
955
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
956
|
+
},
|
|
957
|
+
/** confirm phone change */
|
|
958
|
+
confirmPhoneChange: {
|
|
959
|
+
path: "/account.v1.AccountService/ConfirmPhoneChange",
|
|
960
|
+
requestStream: false,
|
|
961
|
+
responseStream: false,
|
|
962
|
+
requestSerialize: (value: ConfirmPhoneChangeRequest): Buffer =>
|
|
963
|
+
Buffer.from(ConfirmPhoneChangeRequest.encode(value).finish()),
|
|
964
|
+
requestDeserialize: (value: Buffer): ConfirmPhoneChangeRequest => ConfirmPhoneChangeRequest.decode(value),
|
|
965
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
966
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
967
|
+
},
|
|
542
968
|
} as const;
|
|
543
969
|
|
|
544
970
|
export interface AccountServiceServer extends UntypedServiceImplementation {
|
|
@@ -548,6 +974,14 @@ export interface AccountServiceServer extends UntypedServiceImplementation {
|
|
|
548
974
|
updateAccount: handleUnaryCall<UpdateAccountRequest, Account>;
|
|
549
975
|
/** Deletes an account and returns an empty response on success */
|
|
550
976
|
deleteAccount: handleUnaryCall<DeleteAccountRequest, Empty>;
|
|
977
|
+
/** init email change */
|
|
978
|
+
initEmailChange: handleUnaryCall<InitEmailChangeRequest, Empty>;
|
|
979
|
+
/** confirm email change */
|
|
980
|
+
confirmEmailChange: handleUnaryCall<ConfirmEmailChangeRequest, Empty>;
|
|
981
|
+
/** init phone change */
|
|
982
|
+
initPhoneChange: handleUnaryCall<InitPhoneChangeRequest, Empty>;
|
|
983
|
+
/** confirm phone change */
|
|
984
|
+
confirmPhoneChange: handleUnaryCall<ConfirmPhoneChangeRequest, Empty>;
|
|
551
985
|
}
|
|
552
986
|
|
|
553
987
|
export interface AccountServiceClient extends Client {
|
|
@@ -599,6 +1033,70 @@ export interface AccountServiceClient extends Client {
|
|
|
599
1033
|
options: Partial<CallOptions>,
|
|
600
1034
|
callback: (error: ServiceError | null, response: Empty) => void,
|
|
601
1035
|
): ClientUnaryCall;
|
|
1036
|
+
/** init email change */
|
|
1037
|
+
initEmailChange(
|
|
1038
|
+
request: InitEmailChangeRequest,
|
|
1039
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1040
|
+
): ClientUnaryCall;
|
|
1041
|
+
initEmailChange(
|
|
1042
|
+
request: InitEmailChangeRequest,
|
|
1043
|
+
metadata: Metadata,
|
|
1044
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1045
|
+
): ClientUnaryCall;
|
|
1046
|
+
initEmailChange(
|
|
1047
|
+
request: InitEmailChangeRequest,
|
|
1048
|
+
metadata: Metadata,
|
|
1049
|
+
options: Partial<CallOptions>,
|
|
1050
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1051
|
+
): ClientUnaryCall;
|
|
1052
|
+
/** confirm email change */
|
|
1053
|
+
confirmEmailChange(
|
|
1054
|
+
request: ConfirmEmailChangeRequest,
|
|
1055
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1056
|
+
): ClientUnaryCall;
|
|
1057
|
+
confirmEmailChange(
|
|
1058
|
+
request: ConfirmEmailChangeRequest,
|
|
1059
|
+
metadata: Metadata,
|
|
1060
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1061
|
+
): ClientUnaryCall;
|
|
1062
|
+
confirmEmailChange(
|
|
1063
|
+
request: ConfirmEmailChangeRequest,
|
|
1064
|
+
metadata: Metadata,
|
|
1065
|
+
options: Partial<CallOptions>,
|
|
1066
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1067
|
+
): ClientUnaryCall;
|
|
1068
|
+
/** init phone change */
|
|
1069
|
+
initPhoneChange(
|
|
1070
|
+
request: InitPhoneChangeRequest,
|
|
1071
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1072
|
+
): ClientUnaryCall;
|
|
1073
|
+
initPhoneChange(
|
|
1074
|
+
request: InitPhoneChangeRequest,
|
|
1075
|
+
metadata: Metadata,
|
|
1076
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1077
|
+
): ClientUnaryCall;
|
|
1078
|
+
initPhoneChange(
|
|
1079
|
+
request: InitPhoneChangeRequest,
|
|
1080
|
+
metadata: Metadata,
|
|
1081
|
+
options: Partial<CallOptions>,
|
|
1082
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1083
|
+
): ClientUnaryCall;
|
|
1084
|
+
/** confirm phone change */
|
|
1085
|
+
confirmPhoneChange(
|
|
1086
|
+
request: ConfirmPhoneChangeRequest,
|
|
1087
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1088
|
+
): ClientUnaryCall;
|
|
1089
|
+
confirmPhoneChange(
|
|
1090
|
+
request: ConfirmPhoneChangeRequest,
|
|
1091
|
+
metadata: Metadata,
|
|
1092
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1093
|
+
): ClientUnaryCall;
|
|
1094
|
+
confirmPhoneChange(
|
|
1095
|
+
request: ConfirmPhoneChangeRequest,
|
|
1096
|
+
metadata: Metadata,
|
|
1097
|
+
options: Partial<CallOptions>,
|
|
1098
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1099
|
+
): ClientUnaryCall;
|
|
602
1100
|
}
|
|
603
1101
|
|
|
604
1102
|
export const AccountServiceClient = makeGenericClientConstructor(
|
package/gen/ts/auth.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
type ServiceError,
|
|
19
19
|
type UntypedServiceImplementation,
|
|
20
20
|
} from "@grpc/grpc-js";
|
|
21
|
+
import { Empty } from "./google/protobuf/empty";
|
|
21
22
|
|
|
22
23
|
export const protobufPackage = "auth.v1";
|
|
23
24
|
|
|
@@ -50,6 +51,25 @@ export interface RefreshResponse {
|
|
|
50
51
|
refreshToken: string;
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
export interface TelegramInitResponse {
|
|
55
|
+
url: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface TelegramVerifyRequest {
|
|
59
|
+
query: { [key: string]: string };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
63
|
+
key: string;
|
|
64
|
+
value: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface TelegramVerifyResponse {
|
|
68
|
+
url?: string | undefined;
|
|
69
|
+
accessToken?: string | undefined;
|
|
70
|
+
refreshToken?: string | undefined;
|
|
71
|
+
}
|
|
72
|
+
|
|
53
73
|
function createBaseSendOtpRequest(): SendOtpRequest {
|
|
54
74
|
return { identifier: "", type: "" };
|
|
55
75
|
}
|
|
@@ -508,6 +528,329 @@ export const RefreshResponse: MessageFns<RefreshResponse> = {
|
|
|
508
528
|
},
|
|
509
529
|
};
|
|
510
530
|
|
|
531
|
+
function createBaseTelegramInitResponse(): TelegramInitResponse {
|
|
532
|
+
return { url: "" };
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
export const TelegramInitResponse: MessageFns<TelegramInitResponse> = {
|
|
536
|
+
encode(message: TelegramInitResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
537
|
+
if (message.url !== "") {
|
|
538
|
+
writer.uint32(10).string(message.url);
|
|
539
|
+
}
|
|
540
|
+
return writer;
|
|
541
|
+
},
|
|
542
|
+
|
|
543
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramInitResponse {
|
|
544
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
545
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
546
|
+
const message = createBaseTelegramInitResponse();
|
|
547
|
+
while (reader.pos < end) {
|
|
548
|
+
const tag = reader.uint32();
|
|
549
|
+
switch (tag >>> 3) {
|
|
550
|
+
case 1: {
|
|
551
|
+
if (tag !== 10) {
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
message.url = reader.string();
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
reader.skip(tag & 7);
|
|
563
|
+
}
|
|
564
|
+
return message;
|
|
565
|
+
},
|
|
566
|
+
|
|
567
|
+
fromJSON(object: any): TelegramInitResponse {
|
|
568
|
+
return { url: isSet(object.url) ? globalThis.String(object.url) : "" };
|
|
569
|
+
},
|
|
570
|
+
|
|
571
|
+
toJSON(message: TelegramInitResponse): unknown {
|
|
572
|
+
const obj: any = {};
|
|
573
|
+
if (message.url !== "") {
|
|
574
|
+
obj.url = message.url;
|
|
575
|
+
}
|
|
576
|
+
return obj;
|
|
577
|
+
},
|
|
578
|
+
|
|
579
|
+
create<I extends Exact<DeepPartial<TelegramInitResponse>, I>>(base?: I): TelegramInitResponse {
|
|
580
|
+
return TelegramInitResponse.fromPartial(base ?? ({} as any));
|
|
581
|
+
},
|
|
582
|
+
fromPartial<I extends Exact<DeepPartial<TelegramInitResponse>, I>>(object: I): TelegramInitResponse {
|
|
583
|
+
const message = createBaseTelegramInitResponse();
|
|
584
|
+
message.url = object.url ?? "";
|
|
585
|
+
return message;
|
|
586
|
+
},
|
|
587
|
+
};
|
|
588
|
+
|
|
589
|
+
function createBaseTelegramVerifyRequest(): TelegramVerifyRequest {
|
|
590
|
+
return { query: {} };
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
export const TelegramVerifyRequest: MessageFns<TelegramVerifyRequest> = {
|
|
594
|
+
encode(message: TelegramVerifyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
595
|
+
globalThis.Object.entries(message.query).forEach(([key, value]: [string, string]) => {
|
|
596
|
+
TelegramVerifyRequest_QueryEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
|
597
|
+
});
|
|
598
|
+
return writer;
|
|
599
|
+
},
|
|
600
|
+
|
|
601
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest {
|
|
602
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
603
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
604
|
+
const message = createBaseTelegramVerifyRequest();
|
|
605
|
+
while (reader.pos < end) {
|
|
606
|
+
const tag = reader.uint32();
|
|
607
|
+
switch (tag >>> 3) {
|
|
608
|
+
case 1: {
|
|
609
|
+
if (tag !== 10) {
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
const entry1 = TelegramVerifyRequest_QueryEntry.decode(reader, reader.uint32());
|
|
614
|
+
if (entry1.value !== undefined) {
|
|
615
|
+
message.query[entry1.key] = entry1.value;
|
|
616
|
+
}
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
621
|
+
break;
|
|
622
|
+
}
|
|
623
|
+
reader.skip(tag & 7);
|
|
624
|
+
}
|
|
625
|
+
return message;
|
|
626
|
+
},
|
|
627
|
+
|
|
628
|
+
fromJSON(object: any): TelegramVerifyRequest {
|
|
629
|
+
return {
|
|
630
|
+
query: isObject(object.query)
|
|
631
|
+
? (globalThis.Object.entries(object.query) as [string, any][]).reduce(
|
|
632
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
633
|
+
acc[key] = globalThis.String(value);
|
|
634
|
+
return acc;
|
|
635
|
+
},
|
|
636
|
+
{},
|
|
637
|
+
)
|
|
638
|
+
: {},
|
|
639
|
+
};
|
|
640
|
+
},
|
|
641
|
+
|
|
642
|
+
toJSON(message: TelegramVerifyRequest): unknown {
|
|
643
|
+
const obj: any = {};
|
|
644
|
+
if (message.query) {
|
|
645
|
+
const entries = globalThis.Object.entries(message.query) as [string, string][];
|
|
646
|
+
if (entries.length > 0) {
|
|
647
|
+
obj.query = {};
|
|
648
|
+
entries.forEach(([k, v]) => {
|
|
649
|
+
obj.query[k] = v;
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
return obj;
|
|
654
|
+
},
|
|
655
|
+
|
|
656
|
+
create<I extends Exact<DeepPartial<TelegramVerifyRequest>, I>>(base?: I): TelegramVerifyRequest {
|
|
657
|
+
return TelegramVerifyRequest.fromPartial(base ?? ({} as any));
|
|
658
|
+
},
|
|
659
|
+
fromPartial<I extends Exact<DeepPartial<TelegramVerifyRequest>, I>>(object: I): TelegramVerifyRequest {
|
|
660
|
+
const message = createBaseTelegramVerifyRequest();
|
|
661
|
+
message.query = (globalThis.Object.entries(object.query ?? {}) as [string, string][]).reduce(
|
|
662
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
663
|
+
if (value !== undefined) {
|
|
664
|
+
acc[key] = globalThis.String(value);
|
|
665
|
+
}
|
|
666
|
+
return acc;
|
|
667
|
+
},
|
|
668
|
+
{},
|
|
669
|
+
);
|
|
670
|
+
return message;
|
|
671
|
+
},
|
|
672
|
+
};
|
|
673
|
+
|
|
674
|
+
function createBaseTelegramVerifyRequest_QueryEntry(): TelegramVerifyRequest_QueryEntry {
|
|
675
|
+
return { key: "", value: "" };
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export const TelegramVerifyRequest_QueryEntry: MessageFns<TelegramVerifyRequest_QueryEntry> = {
|
|
679
|
+
encode(message: TelegramVerifyRequest_QueryEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
680
|
+
if (message.key !== "") {
|
|
681
|
+
writer.uint32(10).string(message.key);
|
|
682
|
+
}
|
|
683
|
+
if (message.value !== "") {
|
|
684
|
+
writer.uint32(18).string(message.value);
|
|
685
|
+
}
|
|
686
|
+
return writer;
|
|
687
|
+
},
|
|
688
|
+
|
|
689
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest_QueryEntry {
|
|
690
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
691
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
692
|
+
const message = createBaseTelegramVerifyRequest_QueryEntry();
|
|
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
|
+
|
|
701
|
+
message.key = reader.string();
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
case 2: {
|
|
705
|
+
if (tag !== 18) {
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
message.value = reader.string();
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
714
|
+
break;
|
|
715
|
+
}
|
|
716
|
+
reader.skip(tag & 7);
|
|
717
|
+
}
|
|
718
|
+
return message;
|
|
719
|
+
},
|
|
720
|
+
|
|
721
|
+
fromJSON(object: any): TelegramVerifyRequest_QueryEntry {
|
|
722
|
+
return {
|
|
723
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
724
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
725
|
+
};
|
|
726
|
+
},
|
|
727
|
+
|
|
728
|
+
toJSON(message: TelegramVerifyRequest_QueryEntry): unknown {
|
|
729
|
+
const obj: any = {};
|
|
730
|
+
if (message.key !== "") {
|
|
731
|
+
obj.key = message.key;
|
|
732
|
+
}
|
|
733
|
+
if (message.value !== "") {
|
|
734
|
+
obj.value = message.value;
|
|
735
|
+
}
|
|
736
|
+
return obj;
|
|
737
|
+
},
|
|
738
|
+
|
|
739
|
+
create<I extends Exact<DeepPartial<TelegramVerifyRequest_QueryEntry>, I>>(
|
|
740
|
+
base?: I,
|
|
741
|
+
): TelegramVerifyRequest_QueryEntry {
|
|
742
|
+
return TelegramVerifyRequest_QueryEntry.fromPartial(base ?? ({} as any));
|
|
743
|
+
},
|
|
744
|
+
fromPartial<I extends Exact<DeepPartial<TelegramVerifyRequest_QueryEntry>, I>>(
|
|
745
|
+
object: I,
|
|
746
|
+
): TelegramVerifyRequest_QueryEntry {
|
|
747
|
+
const message = createBaseTelegramVerifyRequest_QueryEntry();
|
|
748
|
+
message.key = object.key ?? "";
|
|
749
|
+
message.value = object.value ?? "";
|
|
750
|
+
return message;
|
|
751
|
+
},
|
|
752
|
+
};
|
|
753
|
+
|
|
754
|
+
function createBaseTelegramVerifyResponse(): TelegramVerifyResponse {
|
|
755
|
+
return { url: undefined, accessToken: undefined, refreshToken: undefined };
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
export const TelegramVerifyResponse: MessageFns<TelegramVerifyResponse> = {
|
|
759
|
+
encode(message: TelegramVerifyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
760
|
+
if (message.url !== undefined) {
|
|
761
|
+
writer.uint32(10).string(message.url);
|
|
762
|
+
}
|
|
763
|
+
if (message.accessToken !== undefined) {
|
|
764
|
+
writer.uint32(18).string(message.accessToken);
|
|
765
|
+
}
|
|
766
|
+
if (message.refreshToken !== undefined) {
|
|
767
|
+
writer.uint32(26).string(message.refreshToken);
|
|
768
|
+
}
|
|
769
|
+
return writer;
|
|
770
|
+
},
|
|
771
|
+
|
|
772
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyResponse {
|
|
773
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
774
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
775
|
+
const message = createBaseTelegramVerifyResponse();
|
|
776
|
+
while (reader.pos < end) {
|
|
777
|
+
const tag = reader.uint32();
|
|
778
|
+
switch (tag >>> 3) {
|
|
779
|
+
case 1: {
|
|
780
|
+
if (tag !== 10) {
|
|
781
|
+
break;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
message.url = reader.string();
|
|
785
|
+
continue;
|
|
786
|
+
}
|
|
787
|
+
case 2: {
|
|
788
|
+
if (tag !== 18) {
|
|
789
|
+
break;
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
message.accessToken = reader.string();
|
|
793
|
+
continue;
|
|
794
|
+
}
|
|
795
|
+
case 3: {
|
|
796
|
+
if (tag !== 26) {
|
|
797
|
+
break;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
message.refreshToken = reader.string();
|
|
801
|
+
continue;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
805
|
+
break;
|
|
806
|
+
}
|
|
807
|
+
reader.skip(tag & 7);
|
|
808
|
+
}
|
|
809
|
+
return message;
|
|
810
|
+
},
|
|
811
|
+
|
|
812
|
+
fromJSON(object: any): TelegramVerifyResponse {
|
|
813
|
+
return {
|
|
814
|
+
url: isSet(object.url) ? globalThis.String(object.url) : undefined,
|
|
815
|
+
accessToken: isSet(object.accessToken)
|
|
816
|
+
? globalThis.String(object.accessToken)
|
|
817
|
+
: isSet(object.access_token)
|
|
818
|
+
? globalThis.String(object.access_token)
|
|
819
|
+
: undefined,
|
|
820
|
+
refreshToken: isSet(object.refreshToken)
|
|
821
|
+
? globalThis.String(object.refreshToken)
|
|
822
|
+
: isSet(object.refresh_token)
|
|
823
|
+
? globalThis.String(object.refresh_token)
|
|
824
|
+
: undefined,
|
|
825
|
+
};
|
|
826
|
+
},
|
|
827
|
+
|
|
828
|
+
toJSON(message: TelegramVerifyResponse): unknown {
|
|
829
|
+
const obj: any = {};
|
|
830
|
+
if (message.url !== undefined) {
|
|
831
|
+
obj.url = message.url;
|
|
832
|
+
}
|
|
833
|
+
if (message.accessToken !== undefined) {
|
|
834
|
+
obj.accessToken = message.accessToken;
|
|
835
|
+
}
|
|
836
|
+
if (message.refreshToken !== undefined) {
|
|
837
|
+
obj.refreshToken = message.refreshToken;
|
|
838
|
+
}
|
|
839
|
+
return obj;
|
|
840
|
+
},
|
|
841
|
+
|
|
842
|
+
create<I extends Exact<DeepPartial<TelegramVerifyResponse>, I>>(base?: I): TelegramVerifyResponse {
|
|
843
|
+
return TelegramVerifyResponse.fromPartial(base ?? ({} as any));
|
|
844
|
+
},
|
|
845
|
+
fromPartial<I extends Exact<DeepPartial<TelegramVerifyResponse>, I>>(object: I): TelegramVerifyResponse {
|
|
846
|
+
const message = createBaseTelegramVerifyResponse();
|
|
847
|
+
message.url = object.url ?? undefined;
|
|
848
|
+
message.accessToken = object.accessToken ?? undefined;
|
|
849
|
+
message.refreshToken = object.refreshToken ?? undefined;
|
|
850
|
+
return message;
|
|
851
|
+
},
|
|
852
|
+
};
|
|
853
|
+
|
|
511
854
|
export type AuthServiceService = typeof AuthServiceService;
|
|
512
855
|
export const AuthServiceService = {
|
|
513
856
|
sendOtp: {
|
|
@@ -537,12 +880,35 @@ export const AuthServiceService = {
|
|
|
537
880
|
responseSerialize: (value: RefreshResponse): Buffer => Buffer.from(RefreshResponse.encode(value).finish()),
|
|
538
881
|
responseDeserialize: (value: Buffer): RefreshResponse => RefreshResponse.decode(value),
|
|
539
882
|
},
|
|
883
|
+
telegramInit: {
|
|
884
|
+
path: "/auth.v1.AuthService/TelegramInit",
|
|
885
|
+
requestStream: false,
|
|
886
|
+
responseStream: false,
|
|
887
|
+
requestSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
888
|
+
requestDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
889
|
+
responseSerialize: (value: TelegramInitResponse): Buffer =>
|
|
890
|
+
Buffer.from(TelegramInitResponse.encode(value).finish()),
|
|
891
|
+
responseDeserialize: (value: Buffer): TelegramInitResponse => TelegramInitResponse.decode(value),
|
|
892
|
+
},
|
|
893
|
+
telegramVerify: {
|
|
894
|
+
path: "/auth.v1.AuthService/TelegramVerify",
|
|
895
|
+
requestStream: false,
|
|
896
|
+
responseStream: false,
|
|
897
|
+
requestSerialize: (value: TelegramVerifyRequest): Buffer =>
|
|
898
|
+
Buffer.from(TelegramVerifyRequest.encode(value).finish()),
|
|
899
|
+
requestDeserialize: (value: Buffer): TelegramVerifyRequest => TelegramVerifyRequest.decode(value),
|
|
900
|
+
responseSerialize: (value: TelegramVerifyResponse): Buffer =>
|
|
901
|
+
Buffer.from(TelegramVerifyResponse.encode(value).finish()),
|
|
902
|
+
responseDeserialize: (value: Buffer): TelegramVerifyResponse => TelegramVerifyResponse.decode(value),
|
|
903
|
+
},
|
|
540
904
|
} as const;
|
|
541
905
|
|
|
542
906
|
export interface AuthServiceServer extends UntypedServiceImplementation {
|
|
543
907
|
sendOtp: handleUnaryCall<SendOtpRequest, SendOtpResponse>;
|
|
544
908
|
verifyOtp: handleUnaryCall<VerifyOtpRequest, VerifyOtpResponse>;
|
|
545
909
|
refresh: handleUnaryCall<RefreshRequest, RefreshResponse>;
|
|
910
|
+
telegramInit: handleUnaryCall<Empty, TelegramInitResponse>;
|
|
911
|
+
telegramVerify: handleUnaryCall<TelegramVerifyRequest, TelegramVerifyResponse>;
|
|
546
912
|
}
|
|
547
913
|
|
|
548
914
|
export interface AuthServiceClient extends Client {
|
|
@@ -591,6 +957,36 @@ export interface AuthServiceClient extends Client {
|
|
|
591
957
|
options: Partial<CallOptions>,
|
|
592
958
|
callback: (error: ServiceError | null, response: RefreshResponse) => void,
|
|
593
959
|
): ClientUnaryCall;
|
|
960
|
+
telegramInit(
|
|
961
|
+
request: Empty,
|
|
962
|
+
callback: (error: ServiceError | null, response: TelegramInitResponse) => void,
|
|
963
|
+
): ClientUnaryCall;
|
|
964
|
+
telegramInit(
|
|
965
|
+
request: Empty,
|
|
966
|
+
metadata: Metadata,
|
|
967
|
+
callback: (error: ServiceError | null, response: TelegramInitResponse) => void,
|
|
968
|
+
): ClientUnaryCall;
|
|
969
|
+
telegramInit(
|
|
970
|
+
request: Empty,
|
|
971
|
+
metadata: Metadata,
|
|
972
|
+
options: Partial<CallOptions>,
|
|
973
|
+
callback: (error: ServiceError | null, response: TelegramInitResponse) => void,
|
|
974
|
+
): ClientUnaryCall;
|
|
975
|
+
telegramVerify(
|
|
976
|
+
request: TelegramVerifyRequest,
|
|
977
|
+
callback: (error: ServiceError | null, response: TelegramVerifyResponse) => void,
|
|
978
|
+
): ClientUnaryCall;
|
|
979
|
+
telegramVerify(
|
|
980
|
+
request: TelegramVerifyRequest,
|
|
981
|
+
metadata: Metadata,
|
|
982
|
+
callback: (error: ServiceError | null, response: TelegramVerifyResponse) => void,
|
|
983
|
+
): ClientUnaryCall;
|
|
984
|
+
telegramVerify(
|
|
985
|
+
request: TelegramVerifyRequest,
|
|
986
|
+
metadata: Metadata,
|
|
987
|
+
options: Partial<CallOptions>,
|
|
988
|
+
callback: (error: ServiceError | null, response: TelegramVerifyResponse) => void,
|
|
989
|
+
): ClientUnaryCall;
|
|
594
990
|
}
|
|
595
991
|
|
|
596
992
|
export const AuthServiceClient = makeGenericClientConstructor(AuthServiceService, "auth.v1.AuthService") as unknown as {
|
|
@@ -611,6 +1007,10 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
611
1007
|
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
612
1008
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
613
1009
|
|
|
1010
|
+
function isObject(value: any): boolean {
|
|
1011
|
+
return typeof value === "object" && value !== null;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
614
1014
|
function isSet(value: any): boolean {
|
|
615
1015
|
return value !== null && value !== undefined;
|
|
616
1016
|
}
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -17,6 +17,18 @@ service AccountService {
|
|
|
17
17
|
|
|
18
18
|
// Deletes an account and returns an empty response on success
|
|
19
19
|
rpc DeleteAccount (DeleteAccountRequest) returns (google.protobuf.Empty);
|
|
20
|
+
|
|
21
|
+
// init email change
|
|
22
|
+
rpc InitEmailChange (InitEmailChangeRequest) returns (google.protobuf.Empty);
|
|
23
|
+
|
|
24
|
+
// confirm email change
|
|
25
|
+
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (google.protobuf.Empty);
|
|
26
|
+
|
|
27
|
+
// init phone change
|
|
28
|
+
rpc InitPhoneChange (InitPhoneChangeRequest) returns (google.protobuf.Empty);
|
|
29
|
+
|
|
30
|
+
// confirm phone change
|
|
31
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (google.protobuf.Empty);
|
|
20
32
|
}
|
|
21
33
|
|
|
22
34
|
enum Role {
|
|
@@ -54,4 +66,27 @@ message UpdateAccountRequest {
|
|
|
54
66
|
|
|
55
67
|
message DeleteAccountRequest {
|
|
56
68
|
string id = 1;
|
|
57
|
-
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message InitEmailChangeRequest {
|
|
72
|
+
string id = 1;
|
|
73
|
+
string new_email = 2;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
message ConfirmEmailChangeRequest {
|
|
77
|
+
string new_email = 1;
|
|
78
|
+
string code = 2;
|
|
79
|
+
string user_id = 3;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
message InitPhoneChangeRequest {
|
|
83
|
+
string id = 1;
|
|
84
|
+
string new_phone = 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message ConfirmPhoneChangeRequest {
|
|
88
|
+
string new_phone = 1;
|
|
89
|
+
string code = 2;
|
|
90
|
+
string user_id = 3;
|
|
91
|
+
}
|
|
92
|
+
|
package/proto/auth.proto
CHANGED
|
@@ -4,10 +4,15 @@ package auth.v1;
|
|
|
4
4
|
|
|
5
5
|
option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/auth";
|
|
6
6
|
|
|
7
|
+
import "google/protobuf/empty.proto";
|
|
8
|
+
|
|
7
9
|
service AuthService {
|
|
8
10
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
11
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
10
12
|
rpc Refresh(RefreshRequest) returns (RefreshResponse);
|
|
13
|
+
|
|
14
|
+
rpc TelegramInit(google.protobuf.Empty) returns (TelegramInitResponse);
|
|
15
|
+
rpc TelegramVerify(TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
11
16
|
}
|
|
12
17
|
|
|
13
18
|
message SendOtpRequest {
|
|
@@ -39,3 +44,18 @@ message RefreshResponse {
|
|
|
39
44
|
string refresh_token = 2;
|
|
40
45
|
}
|
|
41
46
|
|
|
47
|
+
message TelegramInitResponse {
|
|
48
|
+
string url = 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
message TelegramVerifyRequest {
|
|
52
|
+
map<string, string> query = 1;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message TelegramVerifyResponse {
|
|
56
|
+
oneof result {
|
|
57
|
+
string url = 1;
|
|
58
|
+
string access_token = 2;
|
|
59
|
+
string refresh_token = 3;
|
|
60
|
+
}
|
|
61
|
+
}
|