@meocinema/contracts 1.0.10 → 1.0.11
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/auth.ts +355 -0
- package/gen/google/protobuf/empty.ts +86 -0
- package/package.json +1 -1
- package/proto/auth.proto +20 -0
package/gen/auth.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import { Empty } from "./google/protobuf/empty";
|
|
9
10
|
|
|
10
11
|
export const protobufPackage = "auth.v1";
|
|
11
12
|
|
|
@@ -38,6 +39,25 @@ export interface RefreshResponse {
|
|
|
38
39
|
refreshToken: string;
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
export interface TelegramInitResponse {
|
|
43
|
+
url: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface TelegramVerifyRequest {
|
|
47
|
+
query: { [key: string]: string };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface TelegramVerifyResponse {
|
|
56
|
+
url?: string | undefined;
|
|
57
|
+
accessToken?: string | undefined;
|
|
58
|
+
refreshToken?: string | undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
41
61
|
function createBaseSendOtpRequest(): SendOtpRequest {
|
|
42
62
|
return { identifier: "", type: "" };
|
|
43
63
|
}
|
|
@@ -474,10 +494,327 @@ export const RefreshResponse: MessageFns<RefreshResponse> = {
|
|
|
474
494
|
},
|
|
475
495
|
};
|
|
476
496
|
|
|
497
|
+
function createBaseTelegramInitResponse(): TelegramInitResponse {
|
|
498
|
+
return { url: "" };
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export const TelegramInitResponse: MessageFns<TelegramInitResponse> = {
|
|
502
|
+
encode(message: TelegramInitResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
503
|
+
if (message.url !== "") {
|
|
504
|
+
writer.uint32(10).string(message.url);
|
|
505
|
+
}
|
|
506
|
+
return writer;
|
|
507
|
+
},
|
|
508
|
+
|
|
509
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramInitResponse {
|
|
510
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
511
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
512
|
+
const message = createBaseTelegramInitResponse();
|
|
513
|
+
while (reader.pos < end) {
|
|
514
|
+
const tag = reader.uint32();
|
|
515
|
+
switch (tag >>> 3) {
|
|
516
|
+
case 1: {
|
|
517
|
+
if (tag !== 10) {
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
message.url = reader.string();
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
reader.skip(tag & 7);
|
|
529
|
+
}
|
|
530
|
+
return message;
|
|
531
|
+
},
|
|
532
|
+
|
|
533
|
+
fromJSON(object: any): TelegramInitResponse {
|
|
534
|
+
return { url: isSet(object.url) ? globalThis.String(object.url) : "" };
|
|
535
|
+
},
|
|
536
|
+
|
|
537
|
+
toJSON(message: TelegramInitResponse): unknown {
|
|
538
|
+
const obj: any = {};
|
|
539
|
+
if (message.url !== "") {
|
|
540
|
+
obj.url = message.url;
|
|
541
|
+
}
|
|
542
|
+
return obj;
|
|
543
|
+
},
|
|
544
|
+
|
|
545
|
+
create<I extends Exact<DeepPartial<TelegramInitResponse>, I>>(base?: I): TelegramInitResponse {
|
|
546
|
+
return TelegramInitResponse.fromPartial(base ?? ({} as any));
|
|
547
|
+
},
|
|
548
|
+
fromPartial<I extends Exact<DeepPartial<TelegramInitResponse>, I>>(object: I): TelegramInitResponse {
|
|
549
|
+
const message = createBaseTelegramInitResponse();
|
|
550
|
+
message.url = object.url ?? "";
|
|
551
|
+
return message;
|
|
552
|
+
},
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
function createBaseTelegramVerifyRequest(): TelegramVerifyRequest {
|
|
556
|
+
return { query: {} };
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
export const TelegramVerifyRequest: MessageFns<TelegramVerifyRequest> = {
|
|
560
|
+
encode(message: TelegramVerifyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
561
|
+
globalThis.Object.entries(message.query).forEach(([key, value]: [string, string]) => {
|
|
562
|
+
TelegramVerifyRequest_QueryEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
|
563
|
+
});
|
|
564
|
+
return writer;
|
|
565
|
+
},
|
|
566
|
+
|
|
567
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest {
|
|
568
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
569
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
570
|
+
const message = createBaseTelegramVerifyRequest();
|
|
571
|
+
while (reader.pos < end) {
|
|
572
|
+
const tag = reader.uint32();
|
|
573
|
+
switch (tag >>> 3) {
|
|
574
|
+
case 1: {
|
|
575
|
+
if (tag !== 10) {
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
const entry1 = TelegramVerifyRequest_QueryEntry.decode(reader, reader.uint32());
|
|
580
|
+
if (entry1.value !== undefined) {
|
|
581
|
+
message.query[entry1.key] = entry1.value;
|
|
582
|
+
}
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
587
|
+
break;
|
|
588
|
+
}
|
|
589
|
+
reader.skip(tag & 7);
|
|
590
|
+
}
|
|
591
|
+
return message;
|
|
592
|
+
},
|
|
593
|
+
|
|
594
|
+
fromJSON(object: any): TelegramVerifyRequest {
|
|
595
|
+
return {
|
|
596
|
+
query: isObject(object.query)
|
|
597
|
+
? (globalThis.Object.entries(object.query) as [string, any][]).reduce(
|
|
598
|
+
(acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
599
|
+
acc[key] = globalThis.String(value);
|
|
600
|
+
return acc;
|
|
601
|
+
},
|
|
602
|
+
{},
|
|
603
|
+
)
|
|
604
|
+
: {},
|
|
605
|
+
};
|
|
606
|
+
},
|
|
607
|
+
|
|
608
|
+
toJSON(message: TelegramVerifyRequest): unknown {
|
|
609
|
+
const obj: any = {};
|
|
610
|
+
if (message.query) {
|
|
611
|
+
const entries = globalThis.Object.entries(message.query) as [string, string][];
|
|
612
|
+
if (entries.length > 0) {
|
|
613
|
+
obj.query = {};
|
|
614
|
+
entries.forEach(([k, v]) => {
|
|
615
|
+
obj.query[k] = v;
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
return obj;
|
|
620
|
+
},
|
|
621
|
+
|
|
622
|
+
create<I extends Exact<DeepPartial<TelegramVerifyRequest>, I>>(base?: I): TelegramVerifyRequest {
|
|
623
|
+
return TelegramVerifyRequest.fromPartial(base ?? ({} as any));
|
|
624
|
+
},
|
|
625
|
+
fromPartial<I extends Exact<DeepPartial<TelegramVerifyRequest>, I>>(object: I): TelegramVerifyRequest {
|
|
626
|
+
const message = createBaseTelegramVerifyRequest();
|
|
627
|
+
message.query = (globalThis.Object.entries(object.query ?? {}) as [string, string][]).reduce(
|
|
628
|
+
(acc: { [key: string]: string }, [key, value]: [string, string]) => {
|
|
629
|
+
if (value !== undefined) {
|
|
630
|
+
acc[key] = globalThis.String(value);
|
|
631
|
+
}
|
|
632
|
+
return acc;
|
|
633
|
+
},
|
|
634
|
+
{},
|
|
635
|
+
);
|
|
636
|
+
return message;
|
|
637
|
+
},
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
function createBaseTelegramVerifyRequest_QueryEntry(): TelegramVerifyRequest_QueryEntry {
|
|
641
|
+
return { key: "", value: "" };
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
export const TelegramVerifyRequest_QueryEntry: MessageFns<TelegramVerifyRequest_QueryEntry> = {
|
|
645
|
+
encode(message: TelegramVerifyRequest_QueryEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
646
|
+
if (message.key !== "") {
|
|
647
|
+
writer.uint32(10).string(message.key);
|
|
648
|
+
}
|
|
649
|
+
if (message.value !== "") {
|
|
650
|
+
writer.uint32(18).string(message.value);
|
|
651
|
+
}
|
|
652
|
+
return writer;
|
|
653
|
+
},
|
|
654
|
+
|
|
655
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest_QueryEntry {
|
|
656
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
657
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
658
|
+
const message = createBaseTelegramVerifyRequest_QueryEntry();
|
|
659
|
+
while (reader.pos < end) {
|
|
660
|
+
const tag = reader.uint32();
|
|
661
|
+
switch (tag >>> 3) {
|
|
662
|
+
case 1: {
|
|
663
|
+
if (tag !== 10) {
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
message.key = reader.string();
|
|
668
|
+
continue;
|
|
669
|
+
}
|
|
670
|
+
case 2: {
|
|
671
|
+
if (tag !== 18) {
|
|
672
|
+
break;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
message.value = reader.string();
|
|
676
|
+
continue;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
680
|
+
break;
|
|
681
|
+
}
|
|
682
|
+
reader.skip(tag & 7);
|
|
683
|
+
}
|
|
684
|
+
return message;
|
|
685
|
+
},
|
|
686
|
+
|
|
687
|
+
fromJSON(object: any): TelegramVerifyRequest_QueryEntry {
|
|
688
|
+
return {
|
|
689
|
+
key: isSet(object.key) ? globalThis.String(object.key) : "",
|
|
690
|
+
value: isSet(object.value) ? globalThis.String(object.value) : "",
|
|
691
|
+
};
|
|
692
|
+
},
|
|
693
|
+
|
|
694
|
+
toJSON(message: TelegramVerifyRequest_QueryEntry): unknown {
|
|
695
|
+
const obj: any = {};
|
|
696
|
+
if (message.key !== "") {
|
|
697
|
+
obj.key = message.key;
|
|
698
|
+
}
|
|
699
|
+
if (message.value !== "") {
|
|
700
|
+
obj.value = message.value;
|
|
701
|
+
}
|
|
702
|
+
return obj;
|
|
703
|
+
},
|
|
704
|
+
|
|
705
|
+
create<I extends Exact<DeepPartial<TelegramVerifyRequest_QueryEntry>, I>>(
|
|
706
|
+
base?: I,
|
|
707
|
+
): TelegramVerifyRequest_QueryEntry {
|
|
708
|
+
return TelegramVerifyRequest_QueryEntry.fromPartial(base ?? ({} as any));
|
|
709
|
+
},
|
|
710
|
+
fromPartial<I extends Exact<DeepPartial<TelegramVerifyRequest_QueryEntry>, I>>(
|
|
711
|
+
object: I,
|
|
712
|
+
): TelegramVerifyRequest_QueryEntry {
|
|
713
|
+
const message = createBaseTelegramVerifyRequest_QueryEntry();
|
|
714
|
+
message.key = object.key ?? "";
|
|
715
|
+
message.value = object.value ?? "";
|
|
716
|
+
return message;
|
|
717
|
+
},
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
function createBaseTelegramVerifyResponse(): TelegramVerifyResponse {
|
|
721
|
+
return { url: undefined, accessToken: undefined, refreshToken: undefined };
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export const TelegramVerifyResponse: MessageFns<TelegramVerifyResponse> = {
|
|
725
|
+
encode(message: TelegramVerifyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
726
|
+
if (message.url !== undefined) {
|
|
727
|
+
writer.uint32(10).string(message.url);
|
|
728
|
+
}
|
|
729
|
+
if (message.accessToken !== undefined) {
|
|
730
|
+
writer.uint32(18).string(message.accessToken);
|
|
731
|
+
}
|
|
732
|
+
if (message.refreshToken !== undefined) {
|
|
733
|
+
writer.uint32(26).string(message.refreshToken);
|
|
734
|
+
}
|
|
735
|
+
return writer;
|
|
736
|
+
},
|
|
737
|
+
|
|
738
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyResponse {
|
|
739
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
740
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
741
|
+
const message = createBaseTelegramVerifyResponse();
|
|
742
|
+
while (reader.pos < end) {
|
|
743
|
+
const tag = reader.uint32();
|
|
744
|
+
switch (tag >>> 3) {
|
|
745
|
+
case 1: {
|
|
746
|
+
if (tag !== 10) {
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
message.url = reader.string();
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
case 2: {
|
|
754
|
+
if (tag !== 18) {
|
|
755
|
+
break;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
message.accessToken = reader.string();
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
case 3: {
|
|
762
|
+
if (tag !== 26) {
|
|
763
|
+
break;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
message.refreshToken = reader.string();
|
|
767
|
+
continue;
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
771
|
+
break;
|
|
772
|
+
}
|
|
773
|
+
reader.skip(tag & 7);
|
|
774
|
+
}
|
|
775
|
+
return message;
|
|
776
|
+
},
|
|
777
|
+
|
|
778
|
+
fromJSON(object: any): TelegramVerifyResponse {
|
|
779
|
+
return {
|
|
780
|
+
url: isSet(object.url) ? globalThis.String(object.url) : undefined,
|
|
781
|
+
accessToken: isSet(object.accessToken) ? globalThis.String(object.accessToken) : undefined,
|
|
782
|
+
refreshToken: isSet(object.refreshToken) ? globalThis.String(object.refreshToken) : undefined,
|
|
783
|
+
};
|
|
784
|
+
},
|
|
785
|
+
|
|
786
|
+
toJSON(message: TelegramVerifyResponse): unknown {
|
|
787
|
+
const obj: any = {};
|
|
788
|
+
if (message.url !== undefined) {
|
|
789
|
+
obj.url = message.url;
|
|
790
|
+
}
|
|
791
|
+
if (message.accessToken !== undefined) {
|
|
792
|
+
obj.accessToken = message.accessToken;
|
|
793
|
+
}
|
|
794
|
+
if (message.refreshToken !== undefined) {
|
|
795
|
+
obj.refreshToken = message.refreshToken;
|
|
796
|
+
}
|
|
797
|
+
return obj;
|
|
798
|
+
},
|
|
799
|
+
|
|
800
|
+
create<I extends Exact<DeepPartial<TelegramVerifyResponse>, I>>(base?: I): TelegramVerifyResponse {
|
|
801
|
+
return TelegramVerifyResponse.fromPartial(base ?? ({} as any));
|
|
802
|
+
},
|
|
803
|
+
fromPartial<I extends Exact<DeepPartial<TelegramVerifyResponse>, I>>(object: I): TelegramVerifyResponse {
|
|
804
|
+
const message = createBaseTelegramVerifyResponse();
|
|
805
|
+
message.url = object.url ?? undefined;
|
|
806
|
+
message.accessToken = object.accessToken ?? undefined;
|
|
807
|
+
message.refreshToken = object.refreshToken ?? undefined;
|
|
808
|
+
return message;
|
|
809
|
+
},
|
|
810
|
+
};
|
|
811
|
+
|
|
477
812
|
export interface AuthService {
|
|
478
813
|
SendOtp(request: SendOtpRequest): Promise<SendOtpResponse>;
|
|
479
814
|
VerifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse>;
|
|
480
815
|
Refresh(request: RefreshRequest): Promise<RefreshResponse>;
|
|
816
|
+
TelegramInit(request: Empty): Promise<TelegramInitResponse>;
|
|
817
|
+
TelegramVerify(request: TelegramVerifyRequest): Promise<TelegramVerifyResponse>;
|
|
481
818
|
}
|
|
482
819
|
|
|
483
820
|
export const AuthServiceServiceName = "auth.v1.AuthService";
|
|
@@ -490,6 +827,8 @@ export class AuthServiceClientImpl implements AuthService {
|
|
|
490
827
|
this.SendOtp = this.SendOtp.bind(this);
|
|
491
828
|
this.VerifyOtp = this.VerifyOtp.bind(this);
|
|
492
829
|
this.Refresh = this.Refresh.bind(this);
|
|
830
|
+
this.TelegramInit = this.TelegramInit.bind(this);
|
|
831
|
+
this.TelegramVerify = this.TelegramVerify.bind(this);
|
|
493
832
|
}
|
|
494
833
|
SendOtp(request: SendOtpRequest): Promise<SendOtpResponse> {
|
|
495
834
|
const data = SendOtpRequest.encode(request).finish();
|
|
@@ -508,6 +847,18 @@ export class AuthServiceClientImpl implements AuthService {
|
|
|
508
847
|
const promise = this.rpc.request(this.service, "Refresh", data);
|
|
509
848
|
return promise.then((data) => RefreshResponse.decode(new BinaryReader(data)));
|
|
510
849
|
}
|
|
850
|
+
|
|
851
|
+
TelegramInit(request: Empty): Promise<TelegramInitResponse> {
|
|
852
|
+
const data = Empty.encode(request).finish();
|
|
853
|
+
const promise = this.rpc.request(this.service, "TelegramInit", data);
|
|
854
|
+
return promise.then((data) => TelegramInitResponse.decode(new BinaryReader(data)));
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
TelegramVerify(request: TelegramVerifyRequest): Promise<TelegramVerifyResponse> {
|
|
858
|
+
const data = TelegramVerifyRequest.encode(request).finish();
|
|
859
|
+
const promise = this.rpc.request(this.service, "TelegramVerify", data);
|
|
860
|
+
return promise.then((data) => TelegramVerifyResponse.decode(new BinaryReader(data)));
|
|
861
|
+
}
|
|
511
862
|
}
|
|
512
863
|
|
|
513
864
|
interface Rpc {
|
|
@@ -526,6 +877,10 @@ type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
|
526
877
|
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
527
878
|
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
528
879
|
|
|
880
|
+
function isObject(value: any): boolean {
|
|
881
|
+
return typeof value === "object" && value !== null;
|
|
882
|
+
}
|
|
883
|
+
|
|
529
884
|
function isSet(value: any): boolean {
|
|
530
885
|
return value !== null && value !== undefined;
|
|
531
886
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v6.33.2
|
|
5
|
+
// source: google/protobuf/empty.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "google.protobuf";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A generic empty message that you can re-use to avoid defining duplicated
|
|
14
|
+
* empty messages in your APIs. A typical example is to use it as the request
|
|
15
|
+
* or the response type of an API method. For instance:
|
|
16
|
+
*
|
|
17
|
+
* service Foo {
|
|
18
|
+
* rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
|
19
|
+
* }
|
|
20
|
+
*/
|
|
21
|
+
export interface Empty {
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function createBaseEmpty(): Empty {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Empty: MessageFns<Empty> = {
|
|
29
|
+
encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
30
|
+
return writer;
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Empty {
|
|
34
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
35
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
36
|
+
const message = createBaseEmpty();
|
|
37
|
+
while (reader.pos < end) {
|
|
38
|
+
const tag = reader.uint32();
|
|
39
|
+
switch (tag >>> 3) {
|
|
40
|
+
}
|
|
41
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
reader.skip(tag & 7);
|
|
45
|
+
}
|
|
46
|
+
return message;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
fromJSON(_: any): Empty {
|
|
50
|
+
return {};
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
toJSON(_: Empty): unknown {
|
|
54
|
+
const obj: any = {};
|
|
55
|
+
return obj;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
create<I extends Exact<DeepPartial<Empty>, I>>(base?: I): Empty {
|
|
59
|
+
return Empty.fromPartial(base ?? ({} as any));
|
|
60
|
+
},
|
|
61
|
+
fromPartial<I extends Exact<DeepPartial<Empty>, I>>(_: I): Empty {
|
|
62
|
+
const message = createBaseEmpty();
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
68
|
+
|
|
69
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
70
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
71
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
72
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
73
|
+
: Partial<T>;
|
|
74
|
+
|
|
75
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
76
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
77
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
78
|
+
|
|
79
|
+
export interface MessageFns<T> {
|
|
80
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
81
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
82
|
+
fromJSON(object: any): T;
|
|
83
|
+
toJSON(message: T): unknown;
|
|
84
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
85
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
86
|
+
}
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
syntax = "proto3";
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
|
+
import "google/protobuf/empty.proto";
|
|
4
5
|
|
|
5
6
|
service AuthService {
|
|
6
7
|
rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
|
|
7
8
|
rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
8
9
|
rpc Refresh(RefreshRequest) returns (RefreshResponse);
|
|
10
|
+
|
|
11
|
+
rpc TelegramInit(google.protobuf.Empty) returns (TelegramInitResponse);
|
|
12
|
+
rpc TelegramVerify(TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
9
13
|
}
|
|
10
14
|
|
|
11
15
|
message SendOtpRequest {
|
|
@@ -35,4 +39,20 @@ message RefreshRequest {
|
|
|
35
39
|
message RefreshResponse {
|
|
36
40
|
string access_token = 1;
|
|
37
41
|
string refresh_token = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message TelegramInitResponse {
|
|
45
|
+
string url = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message TelegramVerifyRequest {
|
|
49
|
+
map<string, string> query = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message TelegramVerifyResponse {
|
|
53
|
+
oneof result {
|
|
54
|
+
string url = 1;
|
|
55
|
+
string access_token = 2;
|
|
56
|
+
string refresh_token = 3;
|
|
57
|
+
}
|
|
38
58
|
}
|