@sa2-movie-ticket/contracts 1.0.12 → 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/auth.ts +400 -0
- package/package.json +1 -1
- package/proto/auth.proto +20 -0
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/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
|
+
}
|