@sa2-movie-ticket/contracts 1.0.13 → 1.0.15

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/dist/index.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  declare const GRPC_PROTO_PATH: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
+ readonly USERS: string;
4
5
  };
5
6
 
6
7
  export { GRPC_PROTO_PATH };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  declare const GRPC_PROTO_PATH: {
2
2
  readonly AUTH: string;
3
3
  readonly ACCOUNT: string;
4
+ readonly USERS: string;
4
5
  };
5
6
 
6
7
  export { GRPC_PROTO_PATH };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- 'use strict';var path=require('path');var t={AUTH:path.join(__dirname,"../../proto/auth.proto"),ACCOUNT:path.join(__dirname,"../../proto/account.proto")};exports.GRPC_PROTO_PATH=t;
1
+ 'use strict';var path=require('path');var t={AUTH:path.join(__dirname,"../../proto/auth.proto"),ACCOUNT:path.join(__dirname,"../../proto/account.proto"),USERS:path.join(__dirname,"../../proto/users.proto")};exports.GRPC_PROTO_PATH=t;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import {join}from'path';var t={AUTH:join(__dirname,"../../proto/auth.proto"),ACCOUNT:join(__dirname,"../../proto/account.proto")};export{t as GRPC_PROTO_PATH};
1
+ import {join}from'path';var t={AUTH:join(__dirname,"../../proto/auth.proto"),ACCOUNT:join(__dirname,"../../proto/account.proto"),USERS:join(__dirname,"../../proto/users.proto")};export{t as GRPC_PROTO_PATH};
package/gen/ts/account.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc v4.23.4
5
5
  // source: account.proto
6
6
 
@@ -19,7 +19,6 @@ import {
19
19
  type UntypedServiceImplementation,
20
20
  } from "@grpc/grpc-js";
21
21
  import { Empty } from "./google/protobuf/empty";
22
- import { FieldMask } from "./google/protobuf/field_mask";
23
22
  import { Timestamp } from "./google/protobuf/timestamp";
24
23
 
25
24
  export const protobufPackage = "account.v1";
@@ -96,22 +95,6 @@ export interface GetAccountRequest {
96
95
  id: string;
97
96
  }
98
97
 
99
- export interface UpdateAccountRequest {
100
- /** The account object containing the new values */
101
- account:
102
- | Account
103
- | undefined;
104
- /**
105
- * Specifies which fields in 'account' should be updated.
106
- * Example: paths: ["email", "phone"]
107
- */
108
- updateMask: string[] | undefined;
109
- }
110
-
111
- export interface DeleteAccountRequest {
112
- id: string;
113
- }
114
-
115
98
  export interface InitEmailChangeRequest {
116
99
  id: string;
117
100
  newEmail: string;
@@ -389,146 +372,6 @@ export const GetAccountRequest: MessageFns<GetAccountRequest> = {
389
372
  },
390
373
  };
391
374
 
392
- function createBaseUpdateAccountRequest(): UpdateAccountRequest {
393
- return { account: undefined, updateMask: undefined };
394
- }
395
-
396
- export const UpdateAccountRequest: MessageFns<UpdateAccountRequest> = {
397
- encode(message: UpdateAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
398
- if (message.account !== undefined) {
399
- Account.encode(message.account, writer.uint32(10).fork()).join();
400
- }
401
- if (message.updateMask !== undefined) {
402
- FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
403
- }
404
- return writer;
405
- },
406
-
407
- decode(input: BinaryReader | Uint8Array, length?: number): UpdateAccountRequest {
408
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
409
- const end = length === undefined ? reader.len : reader.pos + length;
410
- const message = createBaseUpdateAccountRequest();
411
- while (reader.pos < end) {
412
- const tag = reader.uint32();
413
- switch (tag >>> 3) {
414
- case 1: {
415
- if (tag !== 10) {
416
- break;
417
- }
418
-
419
- message.account = Account.decode(reader, reader.uint32());
420
- continue;
421
- }
422
- case 2: {
423
- if (tag !== 18) {
424
- break;
425
- }
426
-
427
- message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
428
- continue;
429
- }
430
- }
431
- if ((tag & 7) === 4 || tag === 0) {
432
- break;
433
- }
434
- reader.skip(tag & 7);
435
- }
436
- return message;
437
- },
438
-
439
- fromJSON(object: any): UpdateAccountRequest {
440
- return {
441
- account: isSet(object.account) ? Account.fromJSON(object.account) : undefined,
442
- updateMask: isSet(object.updateMask)
443
- ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask))
444
- : isSet(object.update_mask)
445
- ? FieldMask.unwrap(FieldMask.fromJSON(object.update_mask))
446
- : undefined,
447
- };
448
- },
449
-
450
- toJSON(message: UpdateAccountRequest): unknown {
451
- const obj: any = {};
452
- if (message.account !== undefined) {
453
- obj.account = Account.toJSON(message.account);
454
- }
455
- if (message.updateMask !== undefined) {
456
- obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
457
- }
458
- return obj;
459
- },
460
-
461
- create<I extends Exact<DeepPartial<UpdateAccountRequest>, I>>(base?: I): UpdateAccountRequest {
462
- return UpdateAccountRequest.fromPartial(base ?? ({} as any));
463
- },
464
- fromPartial<I extends Exact<DeepPartial<UpdateAccountRequest>, I>>(object: I): UpdateAccountRequest {
465
- const message = createBaseUpdateAccountRequest();
466
- message.account = (object.account !== undefined && object.account !== null)
467
- ? Account.fromPartial(object.account)
468
- : undefined;
469
- message.updateMask = object.updateMask ?? undefined;
470
- return message;
471
- },
472
- };
473
-
474
- function createBaseDeleteAccountRequest(): DeleteAccountRequest {
475
- return { id: "" };
476
- }
477
-
478
- export const DeleteAccountRequest: MessageFns<DeleteAccountRequest> = {
479
- encode(message: DeleteAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
480
- if (message.id !== "") {
481
- writer.uint32(10).string(message.id);
482
- }
483
- return writer;
484
- },
485
-
486
- decode(input: BinaryReader | Uint8Array, length?: number): DeleteAccountRequest {
487
- const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
488
- const end = length === undefined ? reader.len : reader.pos + length;
489
- const message = createBaseDeleteAccountRequest();
490
- while (reader.pos < end) {
491
- const tag = reader.uint32();
492
- switch (tag >>> 3) {
493
- case 1: {
494
- if (tag !== 10) {
495
- break;
496
- }
497
-
498
- message.id = reader.string();
499
- continue;
500
- }
501
- }
502
- if ((tag & 7) === 4 || tag === 0) {
503
- break;
504
- }
505
- reader.skip(tag & 7);
506
- }
507
- return message;
508
- },
509
-
510
- fromJSON(object: any): DeleteAccountRequest {
511
- return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
512
- },
513
-
514
- toJSON(message: DeleteAccountRequest): unknown {
515
- const obj: any = {};
516
- if (message.id !== "") {
517
- obj.id = message.id;
518
- }
519
- return obj;
520
- },
521
-
522
- create<I extends Exact<DeepPartial<DeleteAccountRequest>, I>>(base?: I): DeleteAccountRequest {
523
- return DeleteAccountRequest.fromPartial(base ?? ({} as any));
524
- },
525
- fromPartial<I extends Exact<DeepPartial<DeleteAccountRequest>, I>>(object: I): DeleteAccountRequest {
526
- const message = createBaseDeleteAccountRequest();
527
- message.id = object.id ?? "";
528
- return message;
529
- },
530
- };
531
-
532
375
  function createBaseInitEmailChangeRequest(): InitEmailChangeRequest {
533
376
  return { id: "", newEmail: "" };
534
377
  }
@@ -901,26 +744,6 @@ export const AccountServiceService = {
901
744
  responseSerialize: (value: Account): Buffer => Buffer.from(Account.encode(value).finish()),
902
745
  responseDeserialize: (value: Buffer): Account => Account.decode(value),
903
746
  },
904
- /** Updates specific fields of an account using a FieldMask */
905
- updateAccount: {
906
- path: "/account.v1.AccountService/UpdateAccount",
907
- requestStream: false,
908
- responseStream: false,
909
- requestSerialize: (value: UpdateAccountRequest): Buffer => Buffer.from(UpdateAccountRequest.encode(value).finish()),
910
- requestDeserialize: (value: Buffer): UpdateAccountRequest => UpdateAccountRequest.decode(value),
911
- responseSerialize: (value: Account): Buffer => Buffer.from(Account.encode(value).finish()),
912
- responseDeserialize: (value: Buffer): Account => Account.decode(value),
913
- },
914
- /** Deletes an account and returns an empty response on success */
915
- deleteAccount: {
916
- path: "/account.v1.AccountService/DeleteAccount",
917
- requestStream: false,
918
- responseStream: false,
919
- requestSerialize: (value: DeleteAccountRequest): Buffer => Buffer.from(DeleteAccountRequest.encode(value).finish()),
920
- requestDeserialize: (value: Buffer): DeleteAccountRequest => DeleteAccountRequest.decode(value),
921
- responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
922
- responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
923
- },
924
747
  /** init email change */
925
748
  initEmailChange: {
926
749
  path: "/account.v1.AccountService/InitEmailChange",
@@ -970,10 +793,6 @@ export const AccountServiceService = {
970
793
  export interface AccountServiceServer extends UntypedServiceImplementation {
971
794
  /** Retrieves a specific account by ID */
972
795
  getAccount: handleUnaryCall<GetAccountRequest, Account>;
973
- /** Updates specific fields of an account using a FieldMask */
974
- updateAccount: handleUnaryCall<UpdateAccountRequest, Account>;
975
- /** Deletes an account and returns an empty response on success */
976
- deleteAccount: handleUnaryCall<DeleteAccountRequest, Empty>;
977
796
  /** init email change */
978
797
  initEmailChange: handleUnaryCall<InitEmailChangeRequest, Empty>;
979
798
  /** confirm email change */
@@ -1001,38 +820,6 @@ export interface AccountServiceClient extends Client {
1001
820
  options: Partial<CallOptions>,
1002
821
  callback: (error: ServiceError | null, response: Account) => void,
1003
822
  ): ClientUnaryCall;
1004
- /** Updates specific fields of an account using a FieldMask */
1005
- updateAccount(
1006
- request: UpdateAccountRequest,
1007
- callback: (error: ServiceError | null, response: Account) => void,
1008
- ): ClientUnaryCall;
1009
- updateAccount(
1010
- request: UpdateAccountRequest,
1011
- metadata: Metadata,
1012
- callback: (error: ServiceError | null, response: Account) => void,
1013
- ): ClientUnaryCall;
1014
- updateAccount(
1015
- request: UpdateAccountRequest,
1016
- metadata: Metadata,
1017
- options: Partial<CallOptions>,
1018
- callback: (error: ServiceError | null, response: Account) => void,
1019
- ): ClientUnaryCall;
1020
- /** Deletes an account and returns an empty response on success */
1021
- deleteAccount(
1022
- request: DeleteAccountRequest,
1023
- callback: (error: ServiceError | null, response: Empty) => void,
1024
- ): ClientUnaryCall;
1025
- deleteAccount(
1026
- request: DeleteAccountRequest,
1027
- metadata: Metadata,
1028
- callback: (error: ServiceError | null, response: Empty) => void,
1029
- ): ClientUnaryCall;
1030
- deleteAccount(
1031
- request: DeleteAccountRequest,
1032
- metadata: Metadata,
1033
- options: Partial<CallOptions>,
1034
- callback: (error: ServiceError | null, response: Empty) => void,
1035
- ): ClientUnaryCall;
1036
823
  /** init email change */
1037
824
  initEmailChange(
1038
825
  request: InitEmailChangeRequest,
package/gen/ts/auth.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc v4.23.4
5
5
  // source: auth.proto
6
6
 
@@ -70,6 +70,24 @@ export interface TelegramVerifyResponse {
70
70
  refreshToken?: string | undefined;
71
71
  }
72
72
 
73
+ export interface TelegramCompleteRequest {
74
+ phoneNumber: string;
75
+ sessionId: string;
76
+ }
77
+
78
+ export interface TelegramCompleteResponse {
79
+ sessionId: string;
80
+ }
81
+
82
+ export interface TelegramConsumeRequest {
83
+ sessionId: string;
84
+ }
85
+
86
+ export interface TelegramConsumeResponse {
87
+ accessToken: string;
88
+ refreshToken: string;
89
+ }
90
+
73
91
  function createBaseSendOtpRequest(): SendOtpRequest {
74
92
  return { identifier: "", type: "" };
75
93
  }
@@ -851,6 +869,302 @@ export const TelegramVerifyResponse: MessageFns<TelegramVerifyResponse> = {
851
869
  },
852
870
  };
853
871
 
872
+ function createBaseTelegramCompleteRequest(): TelegramCompleteRequest {
873
+ return { phoneNumber: "", sessionId: "" };
874
+ }
875
+
876
+ export const TelegramCompleteRequest: MessageFns<TelegramCompleteRequest> = {
877
+ encode(message: TelegramCompleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
878
+ if (message.phoneNumber !== "") {
879
+ writer.uint32(10).string(message.phoneNumber);
880
+ }
881
+ if (message.sessionId !== "") {
882
+ writer.uint32(18).string(message.sessionId);
883
+ }
884
+ return writer;
885
+ },
886
+
887
+ decode(input: BinaryReader | Uint8Array, length?: number): TelegramCompleteRequest {
888
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
889
+ const end = length === undefined ? reader.len : reader.pos + length;
890
+ const message = createBaseTelegramCompleteRequest();
891
+ while (reader.pos < end) {
892
+ const tag = reader.uint32();
893
+ switch (tag >>> 3) {
894
+ case 1: {
895
+ if (tag !== 10) {
896
+ break;
897
+ }
898
+
899
+ message.phoneNumber = reader.string();
900
+ continue;
901
+ }
902
+ case 2: {
903
+ if (tag !== 18) {
904
+ break;
905
+ }
906
+
907
+ message.sessionId = reader.string();
908
+ continue;
909
+ }
910
+ }
911
+ if ((tag & 7) === 4 || tag === 0) {
912
+ break;
913
+ }
914
+ reader.skip(tag & 7);
915
+ }
916
+ return message;
917
+ },
918
+
919
+ fromJSON(object: any): TelegramCompleteRequest {
920
+ return {
921
+ phoneNumber: isSet(object.phoneNumber)
922
+ ? globalThis.String(object.phoneNumber)
923
+ : isSet(object.phone_number)
924
+ ? globalThis.String(object.phone_number)
925
+ : "",
926
+ sessionId: isSet(object.sessionId)
927
+ ? globalThis.String(object.sessionId)
928
+ : isSet(object.session_id)
929
+ ? globalThis.String(object.session_id)
930
+ : "",
931
+ };
932
+ },
933
+
934
+ toJSON(message: TelegramCompleteRequest): unknown {
935
+ const obj: any = {};
936
+ if (message.phoneNumber !== "") {
937
+ obj.phoneNumber = message.phoneNumber;
938
+ }
939
+ if (message.sessionId !== "") {
940
+ obj.sessionId = message.sessionId;
941
+ }
942
+ return obj;
943
+ },
944
+
945
+ create<I extends Exact<DeepPartial<TelegramCompleteRequest>, I>>(base?: I): TelegramCompleteRequest {
946
+ return TelegramCompleteRequest.fromPartial(base ?? ({} as any));
947
+ },
948
+ fromPartial<I extends Exact<DeepPartial<TelegramCompleteRequest>, I>>(object: I): TelegramCompleteRequest {
949
+ const message = createBaseTelegramCompleteRequest();
950
+ message.phoneNumber = object.phoneNumber ?? "";
951
+ message.sessionId = object.sessionId ?? "";
952
+ return message;
953
+ },
954
+ };
955
+
956
+ function createBaseTelegramCompleteResponse(): TelegramCompleteResponse {
957
+ return { sessionId: "" };
958
+ }
959
+
960
+ export const TelegramCompleteResponse: MessageFns<TelegramCompleteResponse> = {
961
+ encode(message: TelegramCompleteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
962
+ if (message.sessionId !== "") {
963
+ writer.uint32(10).string(message.sessionId);
964
+ }
965
+ return writer;
966
+ },
967
+
968
+ decode(input: BinaryReader | Uint8Array, length?: number): TelegramCompleteResponse {
969
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
970
+ const end = length === undefined ? reader.len : reader.pos + length;
971
+ const message = createBaseTelegramCompleteResponse();
972
+ while (reader.pos < end) {
973
+ const tag = reader.uint32();
974
+ switch (tag >>> 3) {
975
+ case 1: {
976
+ if (tag !== 10) {
977
+ break;
978
+ }
979
+
980
+ message.sessionId = reader.string();
981
+ continue;
982
+ }
983
+ }
984
+ if ((tag & 7) === 4 || tag === 0) {
985
+ break;
986
+ }
987
+ reader.skip(tag & 7);
988
+ }
989
+ return message;
990
+ },
991
+
992
+ fromJSON(object: any): TelegramCompleteResponse {
993
+ return {
994
+ sessionId: isSet(object.sessionId)
995
+ ? globalThis.String(object.sessionId)
996
+ : isSet(object.session_id)
997
+ ? globalThis.String(object.session_id)
998
+ : "",
999
+ };
1000
+ },
1001
+
1002
+ toJSON(message: TelegramCompleteResponse): unknown {
1003
+ const obj: any = {};
1004
+ if (message.sessionId !== "") {
1005
+ obj.sessionId = message.sessionId;
1006
+ }
1007
+ return obj;
1008
+ },
1009
+
1010
+ create<I extends Exact<DeepPartial<TelegramCompleteResponse>, I>>(base?: I): TelegramCompleteResponse {
1011
+ return TelegramCompleteResponse.fromPartial(base ?? ({} as any));
1012
+ },
1013
+ fromPartial<I extends Exact<DeepPartial<TelegramCompleteResponse>, I>>(object: I): TelegramCompleteResponse {
1014
+ const message = createBaseTelegramCompleteResponse();
1015
+ message.sessionId = object.sessionId ?? "";
1016
+ return message;
1017
+ },
1018
+ };
1019
+
1020
+ function createBaseTelegramConsumeRequest(): TelegramConsumeRequest {
1021
+ return { sessionId: "" };
1022
+ }
1023
+
1024
+ export const TelegramConsumeRequest: MessageFns<TelegramConsumeRequest> = {
1025
+ encode(message: TelegramConsumeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1026
+ if (message.sessionId !== "") {
1027
+ writer.uint32(10).string(message.sessionId);
1028
+ }
1029
+ return writer;
1030
+ },
1031
+
1032
+ decode(input: BinaryReader | Uint8Array, length?: number): TelegramConsumeRequest {
1033
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1034
+ const end = length === undefined ? reader.len : reader.pos + length;
1035
+ const message = createBaseTelegramConsumeRequest();
1036
+ while (reader.pos < end) {
1037
+ const tag = reader.uint32();
1038
+ switch (tag >>> 3) {
1039
+ case 1: {
1040
+ if (tag !== 10) {
1041
+ break;
1042
+ }
1043
+
1044
+ message.sessionId = reader.string();
1045
+ continue;
1046
+ }
1047
+ }
1048
+ if ((tag & 7) === 4 || tag === 0) {
1049
+ break;
1050
+ }
1051
+ reader.skip(tag & 7);
1052
+ }
1053
+ return message;
1054
+ },
1055
+
1056
+ fromJSON(object: any): TelegramConsumeRequest {
1057
+ return {
1058
+ sessionId: isSet(object.sessionId)
1059
+ ? globalThis.String(object.sessionId)
1060
+ : isSet(object.session_id)
1061
+ ? globalThis.String(object.session_id)
1062
+ : "",
1063
+ };
1064
+ },
1065
+
1066
+ toJSON(message: TelegramConsumeRequest): unknown {
1067
+ const obj: any = {};
1068
+ if (message.sessionId !== "") {
1069
+ obj.sessionId = message.sessionId;
1070
+ }
1071
+ return obj;
1072
+ },
1073
+
1074
+ create<I extends Exact<DeepPartial<TelegramConsumeRequest>, I>>(base?: I): TelegramConsumeRequest {
1075
+ return TelegramConsumeRequest.fromPartial(base ?? ({} as any));
1076
+ },
1077
+ fromPartial<I extends Exact<DeepPartial<TelegramConsumeRequest>, I>>(object: I): TelegramConsumeRequest {
1078
+ const message = createBaseTelegramConsumeRequest();
1079
+ message.sessionId = object.sessionId ?? "";
1080
+ return message;
1081
+ },
1082
+ };
1083
+
1084
+ function createBaseTelegramConsumeResponse(): TelegramConsumeResponse {
1085
+ return { accessToken: "", refreshToken: "" };
1086
+ }
1087
+
1088
+ export const TelegramConsumeResponse: MessageFns<TelegramConsumeResponse> = {
1089
+ encode(message: TelegramConsumeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
1090
+ if (message.accessToken !== "") {
1091
+ writer.uint32(10).string(message.accessToken);
1092
+ }
1093
+ if (message.refreshToken !== "") {
1094
+ writer.uint32(18).string(message.refreshToken);
1095
+ }
1096
+ return writer;
1097
+ },
1098
+
1099
+ decode(input: BinaryReader | Uint8Array, length?: number): TelegramConsumeResponse {
1100
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1101
+ const end = length === undefined ? reader.len : reader.pos + length;
1102
+ const message = createBaseTelegramConsumeResponse();
1103
+ while (reader.pos < end) {
1104
+ const tag = reader.uint32();
1105
+ switch (tag >>> 3) {
1106
+ case 1: {
1107
+ if (tag !== 10) {
1108
+ break;
1109
+ }
1110
+
1111
+ message.accessToken = reader.string();
1112
+ continue;
1113
+ }
1114
+ case 2: {
1115
+ if (tag !== 18) {
1116
+ break;
1117
+ }
1118
+
1119
+ message.refreshToken = reader.string();
1120
+ continue;
1121
+ }
1122
+ }
1123
+ if ((tag & 7) === 4 || tag === 0) {
1124
+ break;
1125
+ }
1126
+ reader.skip(tag & 7);
1127
+ }
1128
+ return message;
1129
+ },
1130
+
1131
+ fromJSON(object: any): TelegramConsumeResponse {
1132
+ return {
1133
+ accessToken: isSet(object.accessToken)
1134
+ ? globalThis.String(object.accessToken)
1135
+ : isSet(object.access_token)
1136
+ ? globalThis.String(object.access_token)
1137
+ : "",
1138
+ refreshToken: isSet(object.refreshToken)
1139
+ ? globalThis.String(object.refreshToken)
1140
+ : isSet(object.refresh_token)
1141
+ ? globalThis.String(object.refresh_token)
1142
+ : "",
1143
+ };
1144
+ },
1145
+
1146
+ toJSON(message: TelegramConsumeResponse): unknown {
1147
+ const obj: any = {};
1148
+ if (message.accessToken !== "") {
1149
+ obj.accessToken = message.accessToken;
1150
+ }
1151
+ if (message.refreshToken !== "") {
1152
+ obj.refreshToken = message.refreshToken;
1153
+ }
1154
+ return obj;
1155
+ },
1156
+
1157
+ create<I extends Exact<DeepPartial<TelegramConsumeResponse>, I>>(base?: I): TelegramConsumeResponse {
1158
+ return TelegramConsumeResponse.fromPartial(base ?? ({} as any));
1159
+ },
1160
+ fromPartial<I extends Exact<DeepPartial<TelegramConsumeResponse>, I>>(object: I): TelegramConsumeResponse {
1161
+ const message = createBaseTelegramConsumeResponse();
1162
+ message.accessToken = object.accessToken ?? "";
1163
+ message.refreshToken = object.refreshToken ?? "";
1164
+ return message;
1165
+ },
1166
+ };
1167
+
854
1168
  export type AuthServiceService = typeof AuthServiceService;
855
1169
  export const AuthServiceService = {
856
1170
  sendOtp: {
@@ -901,6 +1215,28 @@ export const AuthServiceService = {
901
1215
  Buffer.from(TelegramVerifyResponse.encode(value).finish()),
902
1216
  responseDeserialize: (value: Buffer): TelegramVerifyResponse => TelegramVerifyResponse.decode(value),
903
1217
  },
1218
+ telegramComplete: {
1219
+ path: "/auth.v1.AuthService/TelegramComplete",
1220
+ requestStream: false,
1221
+ responseStream: false,
1222
+ requestSerialize: (value: TelegramCompleteRequest): Buffer =>
1223
+ Buffer.from(TelegramCompleteRequest.encode(value).finish()),
1224
+ requestDeserialize: (value: Buffer): TelegramCompleteRequest => TelegramCompleteRequest.decode(value),
1225
+ responseSerialize: (value: TelegramCompleteResponse): Buffer =>
1226
+ Buffer.from(TelegramCompleteResponse.encode(value).finish()),
1227
+ responseDeserialize: (value: Buffer): TelegramCompleteResponse => TelegramCompleteResponse.decode(value),
1228
+ },
1229
+ telegramConsume: {
1230
+ path: "/auth.v1.AuthService/TelegramConsume",
1231
+ requestStream: false,
1232
+ responseStream: false,
1233
+ requestSerialize: (value: TelegramConsumeRequest): Buffer =>
1234
+ Buffer.from(TelegramConsumeRequest.encode(value).finish()),
1235
+ requestDeserialize: (value: Buffer): TelegramConsumeRequest => TelegramConsumeRequest.decode(value),
1236
+ responseSerialize: (value: TelegramConsumeResponse): Buffer =>
1237
+ Buffer.from(TelegramConsumeResponse.encode(value).finish()),
1238
+ responseDeserialize: (value: Buffer): TelegramConsumeResponse => TelegramConsumeResponse.decode(value),
1239
+ },
904
1240
  } as const;
905
1241
 
906
1242
  export interface AuthServiceServer extends UntypedServiceImplementation {
@@ -909,6 +1245,8 @@ export interface AuthServiceServer extends UntypedServiceImplementation {
909
1245
  refresh: handleUnaryCall<RefreshRequest, RefreshResponse>;
910
1246
  telegramInit: handleUnaryCall<Empty, TelegramInitResponse>;
911
1247
  telegramVerify: handleUnaryCall<TelegramVerifyRequest, TelegramVerifyResponse>;
1248
+ telegramComplete: handleUnaryCall<TelegramCompleteRequest, TelegramCompleteResponse>;
1249
+ telegramConsume: handleUnaryCall<TelegramConsumeRequest, TelegramConsumeResponse>;
912
1250
  }
913
1251
 
914
1252
  export interface AuthServiceClient extends Client {
@@ -987,6 +1325,36 @@ export interface AuthServiceClient extends Client {
987
1325
  options: Partial<CallOptions>,
988
1326
  callback: (error: ServiceError | null, response: TelegramVerifyResponse) => void,
989
1327
  ): ClientUnaryCall;
1328
+ telegramComplete(
1329
+ request: TelegramCompleteRequest,
1330
+ callback: (error: ServiceError | null, response: TelegramCompleteResponse) => void,
1331
+ ): ClientUnaryCall;
1332
+ telegramComplete(
1333
+ request: TelegramCompleteRequest,
1334
+ metadata: Metadata,
1335
+ callback: (error: ServiceError | null, response: TelegramCompleteResponse) => void,
1336
+ ): ClientUnaryCall;
1337
+ telegramComplete(
1338
+ request: TelegramCompleteRequest,
1339
+ metadata: Metadata,
1340
+ options: Partial<CallOptions>,
1341
+ callback: (error: ServiceError | null, response: TelegramCompleteResponse) => void,
1342
+ ): ClientUnaryCall;
1343
+ telegramConsume(
1344
+ request: TelegramConsumeRequest,
1345
+ callback: (error: ServiceError | null, response: TelegramConsumeResponse) => void,
1346
+ ): ClientUnaryCall;
1347
+ telegramConsume(
1348
+ request: TelegramConsumeRequest,
1349
+ metadata: Metadata,
1350
+ callback: (error: ServiceError | null, response: TelegramConsumeResponse) => void,
1351
+ ): ClientUnaryCall;
1352
+ telegramConsume(
1353
+ request: TelegramConsumeRequest,
1354
+ metadata: Metadata,
1355
+ options: Partial<CallOptions>,
1356
+ callback: (error: ServiceError | null, response: TelegramConsumeResponse) => void,
1357
+ ): ClientUnaryCall;
990
1358
  }
991
1359
 
992
1360
  export const AuthServiceClient = makeGenericClientConstructor(AuthServiceService, "auth.v1.AuthService") as unknown as {
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc v4.23.4
5
5
  // source: google/protobuf/empty.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc v4.23.4
5
5
  // source: google/protobuf/field_mask.proto
6
6
 
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.11.2
3
+ // protoc-gen-ts_proto v2.11.4
4
4
  // protoc v4.23.4
5
5
  // source: google/protobuf/timestamp.proto
6
6
 
@@ -0,0 +1,485 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v4.23.4
5
+ // source: users.proto
6
+
7
+ /* eslint-disable */
8
+ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
9
+ import {
10
+ type CallOptions,
11
+ type ChannelCredentials,
12
+ Client,
13
+ type ClientOptions,
14
+ type ClientUnaryCall,
15
+ type handleUnaryCall,
16
+ makeGenericClientConstructor,
17
+ type Metadata,
18
+ type ServiceError,
19
+ type UntypedServiceImplementation,
20
+ } from "@grpc/grpc-js";
21
+ import { Empty } from "./google/protobuf/empty";
22
+
23
+ export const protobufPackage = "users.v1";
24
+
25
+ export interface GetUserByIdRequest {
26
+ id: string;
27
+ }
28
+
29
+ export interface CreateUserRequest {
30
+ id: string;
31
+ }
32
+
33
+ export interface UserResponse {
34
+ user: User | undefined;
35
+ }
36
+
37
+ export interface User {
38
+ id: string;
39
+ name?: string | undefined;
40
+ email?: string | undefined;
41
+ phone?: string | undefined;
42
+ avatar?: string | undefined;
43
+ createdAt?: string | undefined;
44
+ updatedAt?: string | undefined;
45
+ }
46
+
47
+ function createBaseGetUserByIdRequest(): GetUserByIdRequest {
48
+ return { id: "" };
49
+ }
50
+
51
+ export const GetUserByIdRequest: MessageFns<GetUserByIdRequest> = {
52
+ encode(message: GetUserByIdRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
53
+ if (message.id !== "") {
54
+ writer.uint32(10).string(message.id);
55
+ }
56
+ return writer;
57
+ },
58
+
59
+ decode(input: BinaryReader | Uint8Array, length?: number): GetUserByIdRequest {
60
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
61
+ const end = length === undefined ? reader.len : reader.pos + length;
62
+ const message = createBaseGetUserByIdRequest();
63
+ while (reader.pos < end) {
64
+ const tag = reader.uint32();
65
+ switch (tag >>> 3) {
66
+ case 1: {
67
+ if (tag !== 10) {
68
+ break;
69
+ }
70
+
71
+ message.id = reader.string();
72
+ continue;
73
+ }
74
+ }
75
+ if ((tag & 7) === 4 || tag === 0) {
76
+ break;
77
+ }
78
+ reader.skip(tag & 7);
79
+ }
80
+ return message;
81
+ },
82
+
83
+ fromJSON(object: any): GetUserByIdRequest {
84
+ return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
85
+ },
86
+
87
+ toJSON(message: GetUserByIdRequest): unknown {
88
+ const obj: any = {};
89
+ if (message.id !== "") {
90
+ obj.id = message.id;
91
+ }
92
+ return obj;
93
+ },
94
+
95
+ create<I extends Exact<DeepPartial<GetUserByIdRequest>, I>>(base?: I): GetUserByIdRequest {
96
+ return GetUserByIdRequest.fromPartial(base ?? ({} as any));
97
+ },
98
+ fromPartial<I extends Exact<DeepPartial<GetUserByIdRequest>, I>>(object: I): GetUserByIdRequest {
99
+ const message = createBaseGetUserByIdRequest();
100
+ message.id = object.id ?? "";
101
+ return message;
102
+ },
103
+ };
104
+
105
+ function createBaseCreateUserRequest(): CreateUserRequest {
106
+ return { id: "" };
107
+ }
108
+
109
+ export const CreateUserRequest: MessageFns<CreateUserRequest> = {
110
+ encode(message: CreateUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
111
+ if (message.id !== "") {
112
+ writer.uint32(10).string(message.id);
113
+ }
114
+ return writer;
115
+ },
116
+
117
+ decode(input: BinaryReader | Uint8Array, length?: number): CreateUserRequest {
118
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
119
+ const end = length === undefined ? reader.len : reader.pos + length;
120
+ const message = createBaseCreateUserRequest();
121
+ while (reader.pos < end) {
122
+ const tag = reader.uint32();
123
+ switch (tag >>> 3) {
124
+ case 1: {
125
+ if (tag !== 10) {
126
+ break;
127
+ }
128
+
129
+ message.id = reader.string();
130
+ continue;
131
+ }
132
+ }
133
+ if ((tag & 7) === 4 || tag === 0) {
134
+ break;
135
+ }
136
+ reader.skip(tag & 7);
137
+ }
138
+ return message;
139
+ },
140
+
141
+ fromJSON(object: any): CreateUserRequest {
142
+ return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
143
+ },
144
+
145
+ toJSON(message: CreateUserRequest): unknown {
146
+ const obj: any = {};
147
+ if (message.id !== "") {
148
+ obj.id = message.id;
149
+ }
150
+ return obj;
151
+ },
152
+
153
+ create<I extends Exact<DeepPartial<CreateUserRequest>, I>>(base?: I): CreateUserRequest {
154
+ return CreateUserRequest.fromPartial(base ?? ({} as any));
155
+ },
156
+ fromPartial<I extends Exact<DeepPartial<CreateUserRequest>, I>>(object: I): CreateUserRequest {
157
+ const message = createBaseCreateUserRequest();
158
+ message.id = object.id ?? "";
159
+ return message;
160
+ },
161
+ };
162
+
163
+ function createBaseUserResponse(): UserResponse {
164
+ return { user: undefined };
165
+ }
166
+
167
+ export const UserResponse: MessageFns<UserResponse> = {
168
+ encode(message: UserResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
169
+ if (message.user !== undefined) {
170
+ User.encode(message.user, writer.uint32(10).fork()).join();
171
+ }
172
+ return writer;
173
+ },
174
+
175
+ decode(input: BinaryReader | Uint8Array, length?: number): UserResponse {
176
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
177
+ const end = length === undefined ? reader.len : reader.pos + length;
178
+ const message = createBaseUserResponse();
179
+ while (reader.pos < end) {
180
+ const tag = reader.uint32();
181
+ switch (tag >>> 3) {
182
+ case 1: {
183
+ if (tag !== 10) {
184
+ break;
185
+ }
186
+
187
+ message.user = User.decode(reader, reader.uint32());
188
+ continue;
189
+ }
190
+ }
191
+ if ((tag & 7) === 4 || tag === 0) {
192
+ break;
193
+ }
194
+ reader.skip(tag & 7);
195
+ }
196
+ return message;
197
+ },
198
+
199
+ fromJSON(object: any): UserResponse {
200
+ return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined };
201
+ },
202
+
203
+ toJSON(message: UserResponse): unknown {
204
+ const obj: any = {};
205
+ if (message.user !== undefined) {
206
+ obj.user = User.toJSON(message.user);
207
+ }
208
+ return obj;
209
+ },
210
+
211
+ create<I extends Exact<DeepPartial<UserResponse>, I>>(base?: I): UserResponse {
212
+ return UserResponse.fromPartial(base ?? ({} as any));
213
+ },
214
+ fromPartial<I extends Exact<DeepPartial<UserResponse>, I>>(object: I): UserResponse {
215
+ const message = createBaseUserResponse();
216
+ message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
217
+ return message;
218
+ },
219
+ };
220
+
221
+ function createBaseUser(): User {
222
+ return {
223
+ id: "",
224
+ name: undefined,
225
+ email: undefined,
226
+ phone: undefined,
227
+ avatar: undefined,
228
+ createdAt: undefined,
229
+ updatedAt: undefined,
230
+ };
231
+ }
232
+
233
+ export const User: MessageFns<User> = {
234
+ encode(message: User, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
235
+ if (message.id !== "") {
236
+ writer.uint32(10).string(message.id);
237
+ }
238
+ if (message.name !== undefined) {
239
+ writer.uint32(18).string(message.name);
240
+ }
241
+ if (message.email !== undefined) {
242
+ writer.uint32(26).string(message.email);
243
+ }
244
+ if (message.phone !== undefined) {
245
+ writer.uint32(34).string(message.phone);
246
+ }
247
+ if (message.avatar !== undefined) {
248
+ writer.uint32(42).string(message.avatar);
249
+ }
250
+ if (message.createdAt !== undefined) {
251
+ writer.uint32(50).string(message.createdAt);
252
+ }
253
+ if (message.updatedAt !== undefined) {
254
+ writer.uint32(58).string(message.updatedAt);
255
+ }
256
+ return writer;
257
+ },
258
+
259
+ decode(input: BinaryReader | Uint8Array, length?: number): User {
260
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
261
+ const end = length === undefined ? reader.len : reader.pos + length;
262
+ const message = createBaseUser();
263
+ while (reader.pos < end) {
264
+ const tag = reader.uint32();
265
+ switch (tag >>> 3) {
266
+ case 1: {
267
+ if (tag !== 10) {
268
+ break;
269
+ }
270
+
271
+ message.id = reader.string();
272
+ continue;
273
+ }
274
+ case 2: {
275
+ if (tag !== 18) {
276
+ break;
277
+ }
278
+
279
+ message.name = reader.string();
280
+ continue;
281
+ }
282
+ case 3: {
283
+ if (tag !== 26) {
284
+ break;
285
+ }
286
+
287
+ message.email = reader.string();
288
+ continue;
289
+ }
290
+ case 4: {
291
+ if (tag !== 34) {
292
+ break;
293
+ }
294
+
295
+ message.phone = reader.string();
296
+ continue;
297
+ }
298
+ case 5: {
299
+ if (tag !== 42) {
300
+ break;
301
+ }
302
+
303
+ message.avatar = reader.string();
304
+ continue;
305
+ }
306
+ case 6: {
307
+ if (tag !== 50) {
308
+ break;
309
+ }
310
+
311
+ message.createdAt = reader.string();
312
+ continue;
313
+ }
314
+ case 7: {
315
+ if (tag !== 58) {
316
+ break;
317
+ }
318
+
319
+ message.updatedAt = reader.string();
320
+ continue;
321
+ }
322
+ }
323
+ if ((tag & 7) === 4 || tag === 0) {
324
+ break;
325
+ }
326
+ reader.skip(tag & 7);
327
+ }
328
+ return message;
329
+ },
330
+
331
+ fromJSON(object: any): User {
332
+ return {
333
+ id: isSet(object.id) ? globalThis.String(object.id) : "",
334
+ name: isSet(object.name) ? globalThis.String(object.name) : undefined,
335
+ email: isSet(object.email) ? globalThis.String(object.email) : undefined,
336
+ phone: isSet(object.phone) ? globalThis.String(object.phone) : undefined,
337
+ avatar: isSet(object.avatar) ? globalThis.String(object.avatar) : undefined,
338
+ createdAt: isSet(object.createdAt)
339
+ ? globalThis.String(object.createdAt)
340
+ : isSet(object.created_at)
341
+ ? globalThis.String(object.created_at)
342
+ : undefined,
343
+ updatedAt: isSet(object.updatedAt)
344
+ ? globalThis.String(object.updatedAt)
345
+ : isSet(object.updated_at)
346
+ ? globalThis.String(object.updated_at)
347
+ : undefined,
348
+ };
349
+ },
350
+
351
+ toJSON(message: User): unknown {
352
+ const obj: any = {};
353
+ if (message.id !== "") {
354
+ obj.id = message.id;
355
+ }
356
+ if (message.name !== undefined) {
357
+ obj.name = message.name;
358
+ }
359
+ if (message.email !== undefined) {
360
+ obj.email = message.email;
361
+ }
362
+ if (message.phone !== undefined) {
363
+ obj.phone = message.phone;
364
+ }
365
+ if (message.avatar !== undefined) {
366
+ obj.avatar = message.avatar;
367
+ }
368
+ if (message.createdAt !== undefined) {
369
+ obj.createdAt = message.createdAt;
370
+ }
371
+ if (message.updatedAt !== undefined) {
372
+ obj.updatedAt = message.updatedAt;
373
+ }
374
+ return obj;
375
+ },
376
+
377
+ create<I extends Exact<DeepPartial<User>, I>>(base?: I): User {
378
+ return User.fromPartial(base ?? ({} as any));
379
+ },
380
+ fromPartial<I extends Exact<DeepPartial<User>, I>>(object: I): User {
381
+ const message = createBaseUser();
382
+ message.id = object.id ?? "";
383
+ message.name = object.name ?? undefined;
384
+ message.email = object.email ?? undefined;
385
+ message.phone = object.phone ?? undefined;
386
+ message.avatar = object.avatar ?? undefined;
387
+ message.createdAt = object.createdAt ?? undefined;
388
+ message.updatedAt = object.updatedAt ?? undefined;
389
+ return message;
390
+ },
391
+ };
392
+
393
+ export type UsersServiceService = typeof UsersServiceService;
394
+ export const UsersServiceService = {
395
+ getUserById: {
396
+ path: "/users.v1.UsersService/GetUserById",
397
+ requestStream: false,
398
+ responseStream: false,
399
+ requestSerialize: (value: GetUserByIdRequest): Buffer => Buffer.from(GetUserByIdRequest.encode(value).finish()),
400
+ requestDeserialize: (value: Buffer): GetUserByIdRequest => GetUserByIdRequest.decode(value),
401
+ responseSerialize: (value: UserResponse): Buffer => Buffer.from(UserResponse.encode(value).finish()),
402
+ responseDeserialize: (value: Buffer): UserResponse => UserResponse.decode(value),
403
+ },
404
+ createUser: {
405
+ path: "/users.v1.UsersService/CreateUser",
406
+ requestStream: false,
407
+ responseStream: false,
408
+ requestSerialize: (value: CreateUserRequest): Buffer => Buffer.from(CreateUserRequest.encode(value).finish()),
409
+ requestDeserialize: (value: Buffer): CreateUserRequest => CreateUserRequest.decode(value),
410
+ responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
411
+ responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
412
+ },
413
+ } as const;
414
+
415
+ export interface UsersServiceServer extends UntypedServiceImplementation {
416
+ getUserById: handleUnaryCall<GetUserByIdRequest, UserResponse>;
417
+ createUser: handleUnaryCall<CreateUserRequest, Empty>;
418
+ }
419
+
420
+ export interface UsersServiceClient extends Client {
421
+ getUserById(
422
+ request: GetUserByIdRequest,
423
+ callback: (error: ServiceError | null, response: UserResponse) => void,
424
+ ): ClientUnaryCall;
425
+ getUserById(
426
+ request: GetUserByIdRequest,
427
+ metadata: Metadata,
428
+ callback: (error: ServiceError | null, response: UserResponse) => void,
429
+ ): ClientUnaryCall;
430
+ getUserById(
431
+ request: GetUserByIdRequest,
432
+ metadata: Metadata,
433
+ options: Partial<CallOptions>,
434
+ callback: (error: ServiceError | null, response: UserResponse) => void,
435
+ ): ClientUnaryCall;
436
+ createUser(
437
+ request: CreateUserRequest,
438
+ callback: (error: ServiceError | null, response: Empty) => void,
439
+ ): ClientUnaryCall;
440
+ createUser(
441
+ request: CreateUserRequest,
442
+ metadata: Metadata,
443
+ callback: (error: ServiceError | null, response: Empty) => void,
444
+ ): ClientUnaryCall;
445
+ createUser(
446
+ request: CreateUserRequest,
447
+ metadata: Metadata,
448
+ options: Partial<CallOptions>,
449
+ callback: (error: ServiceError | null, response: Empty) => void,
450
+ ): ClientUnaryCall;
451
+ }
452
+
453
+ export const UsersServiceClient = makeGenericClientConstructor(
454
+ UsersServiceService,
455
+ "users.v1.UsersService",
456
+ ) as unknown as {
457
+ new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): UsersServiceClient;
458
+ service: typeof UsersServiceService;
459
+ serviceName: string;
460
+ };
461
+
462
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
463
+
464
+ export type DeepPartial<T> = T extends Builtin ? T
465
+ : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
466
+ : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
467
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
468
+ : Partial<T>;
469
+
470
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
471
+ export type Exact<P, I extends P> = P extends Builtin ? P
472
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
473
+
474
+ function isSet(value: any): boolean {
475
+ return value !== null && value !== undefined;
476
+ }
477
+
478
+ export interface MessageFns<T> {
479
+ encode(message: T, writer?: BinaryWriter): BinaryWriter;
480
+ decode(input: BinaryReader | Uint8Array, length?: number): T;
481
+ fromJSON(object: any): T;
482
+ toJSON(message: T): unknown;
483
+ create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
484
+ fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
485
+ }
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.13",
4
+ "version": "1.0.15",
5
5
  "license": "ISC",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
@@ -11,12 +11,6 @@ option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/account";
11
11
  service AccountService {
12
12
  // Retrieves a specific account by ID
13
13
  rpc GetAccount (GetAccountRequest) returns (Account);
14
-
15
- // Updates specific fields of an account using a FieldMask
16
- rpc UpdateAccount (UpdateAccountRequest) returns (Account);
17
-
18
- // Deletes an account and returns an empty response on success
19
- rpc DeleteAccount (DeleteAccountRequest) returns (google.protobuf.Empty);
20
14
 
21
15
  // init email change
22
16
  rpc InitEmailChange (InitEmailChangeRequest) returns (google.protobuf.Empty);
@@ -55,18 +49,6 @@ message GetAccountRequest {
55
49
  string id = 1;
56
50
  }
57
51
 
58
- message UpdateAccountRequest {
59
- // The account object containing the new values
60
- Account account = 1;
61
-
62
- // Specifies which fields in 'account' should be updated.
63
- // Example: paths: ["email", "phone"]
64
- google.protobuf.FieldMask update_mask = 2;
65
- }
66
-
67
- message DeleteAccountRequest {
68
- string id = 1;
69
- }
70
52
 
71
53
  message InitEmailChangeRequest {
72
54
  string id = 1;
package/proto/auth.proto CHANGED
@@ -13,6 +13,8 @@ service AuthService {
13
13
 
14
14
  rpc TelegramInit(google.protobuf.Empty) returns (TelegramInitResponse);
15
15
  rpc TelegramVerify(TelegramVerifyRequest) returns (TelegramVerifyResponse);
16
+ rpc TelegramComplete(TelegramCompleteRequest) returns (TelegramCompleteResponse);
17
+ rpc TelegramConsume(TelegramConsumeRequest) returns (TelegramConsumeResponse);
16
18
  }
17
19
 
18
20
  message SendOtpRequest {
@@ -59,3 +61,21 @@ message TelegramVerifyResponse {
59
61
  string refresh_token = 3;
60
62
  }
61
63
  }
64
+
65
+ message TelegramCompleteRequest {
66
+ string phone_number = 1;
67
+ string session_id = 2;
68
+ }
69
+
70
+ message TelegramCompleteResponse {
71
+ string session_id = 1;
72
+ }
73
+
74
+ message TelegramConsumeRequest {
75
+ string session_id = 1;
76
+ }
77
+
78
+ message TelegramConsumeResponse {
79
+ string access_token = 1;
80
+ string refresh_token = 2;
81
+ }
@@ -0,0 +1,34 @@
1
+ syntax = "proto3";
2
+
3
+ package users.v1;
4
+ option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/users";
5
+
6
+ import "google/protobuf/empty.proto";
7
+
8
+ service UsersService {
9
+ rpc GetUserById(GetUserByIdRequest) returns (UserResponse);
10
+ rpc CreateUser(CreateUserRequest) returns (google.protobuf.Empty);
11
+
12
+ }
13
+
14
+ message GetUserByIdRequest {
15
+ string id = 1;
16
+ }
17
+
18
+ message CreateUserRequest {
19
+ string id = 1;
20
+ }
21
+
22
+ message UserResponse {
23
+ User user = 1;
24
+ }
25
+
26
+ message User {
27
+ string id = 1;
28
+ optional string name = 2;
29
+ optional string email = 3;
30
+ optional string phone = 4;
31
+ optional string avatar = 5;
32
+ optional string created_at = 6;
33
+ optional string updated_at = 7;
34
+ }