@sa2-movie-ticket/contracts 1.0.11 → 1.0.12

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 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sa2-movie-ticket/contracts",
3
3
  "description": "Contracts for movie ticket microservices",
4
- "version": "1.0.11",
4
+ "version": "1.0.12",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
@@ -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
+