@babacarthiamdev/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/gen/auth.ts +423 -1
- package/gen/google/protobuf/empty.ts +55 -0
- package/package.json +1 -1
- package/proto/auth.proto +43 -0
package/gen/auth.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
9
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
10
10
|
import { Observable } from "rxjs";
|
|
11
|
+
import { Empty } from "./google/protobuf/empty";
|
|
11
12
|
|
|
12
13
|
export const protobufPackage = "auth.v1";
|
|
13
14
|
|
|
@@ -40,6 +41,43 @@ export interface RefreshResponse {
|
|
|
40
41
|
refreshToken: string;
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
export interface TelegramInitResponse {
|
|
45
|
+
url: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface TelegramVerifyRequest {
|
|
49
|
+
query: { [key: string]: string };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface TelegramVerifyRequest_QueryEntry {
|
|
53
|
+
key: string;
|
|
54
|
+
value: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface TelegramVerifyResponse {
|
|
58
|
+
url?: string | undefined;
|
|
59
|
+
accessToken?: string | undefined;
|
|
60
|
+
refreshToken?: string | undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface TelegramCompleteRequest {
|
|
64
|
+
sessionId: string;
|
|
65
|
+
phone: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TelegramCompleteResponse {
|
|
69
|
+
sessionId: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface TelegramConsumeRequest {
|
|
73
|
+
sessionId: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface TelegramConsumeResponse {
|
|
77
|
+
accessToken: string;
|
|
78
|
+
refreshToken: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
43
81
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
44
82
|
|
|
45
83
|
function createBaseSendOtpRequest(): SendOtpRequest {
|
|
@@ -319,12 +357,374 @@ export const RefreshResponse: MessageFns<RefreshResponse> = {
|
|
|
319
357
|
},
|
|
320
358
|
};
|
|
321
359
|
|
|
360
|
+
function createBaseTelegramInitResponse(): TelegramInitResponse {
|
|
361
|
+
return { url: "" };
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export const TelegramInitResponse: MessageFns<TelegramInitResponse> = {
|
|
365
|
+
encode(message: TelegramInitResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
366
|
+
if (message.url !== "") {
|
|
367
|
+
writer.uint32(10).string(message.url);
|
|
368
|
+
}
|
|
369
|
+
return writer;
|
|
370
|
+
},
|
|
371
|
+
|
|
372
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramInitResponse {
|
|
373
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
374
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
375
|
+
const message = createBaseTelegramInitResponse();
|
|
376
|
+
while (reader.pos < end) {
|
|
377
|
+
const tag = reader.uint32();
|
|
378
|
+
switch (tag >>> 3) {
|
|
379
|
+
case 1: {
|
|
380
|
+
if (tag !== 10) {
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
message.url = reader.string();
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
reader.skip(tag & 7);
|
|
392
|
+
}
|
|
393
|
+
return message;
|
|
394
|
+
},
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
function createBaseTelegramVerifyRequest(): TelegramVerifyRequest {
|
|
398
|
+
return { query: {} };
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export const TelegramVerifyRequest: MessageFns<TelegramVerifyRequest> = {
|
|
402
|
+
encode(message: TelegramVerifyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
403
|
+
globalThis.Object.entries(message.query).forEach(([key, value]: [string, string]) => {
|
|
404
|
+
TelegramVerifyRequest_QueryEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
|
405
|
+
});
|
|
406
|
+
return writer;
|
|
407
|
+
},
|
|
408
|
+
|
|
409
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest {
|
|
410
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
411
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
412
|
+
const message = createBaseTelegramVerifyRequest();
|
|
413
|
+
while (reader.pos < end) {
|
|
414
|
+
const tag = reader.uint32();
|
|
415
|
+
switch (tag >>> 3) {
|
|
416
|
+
case 1: {
|
|
417
|
+
if (tag !== 10) {
|
|
418
|
+
break;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
const entry1 = TelegramVerifyRequest_QueryEntry.decode(reader, reader.uint32());
|
|
422
|
+
if (entry1.value !== undefined) {
|
|
423
|
+
message.query[entry1.key] = entry1.value;
|
|
424
|
+
}
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
reader.skip(tag & 7);
|
|
432
|
+
}
|
|
433
|
+
return message;
|
|
434
|
+
},
|
|
435
|
+
};
|
|
436
|
+
|
|
437
|
+
function createBaseTelegramVerifyRequest_QueryEntry(): TelegramVerifyRequest_QueryEntry {
|
|
438
|
+
return { key: "", value: "" };
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export const TelegramVerifyRequest_QueryEntry: MessageFns<TelegramVerifyRequest_QueryEntry> = {
|
|
442
|
+
encode(message: TelegramVerifyRequest_QueryEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
443
|
+
if (message.key !== "") {
|
|
444
|
+
writer.uint32(10).string(message.key);
|
|
445
|
+
}
|
|
446
|
+
if (message.value !== "") {
|
|
447
|
+
writer.uint32(18).string(message.value);
|
|
448
|
+
}
|
|
449
|
+
return writer;
|
|
450
|
+
},
|
|
451
|
+
|
|
452
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest_QueryEntry {
|
|
453
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
454
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
455
|
+
const message = createBaseTelegramVerifyRequest_QueryEntry();
|
|
456
|
+
while (reader.pos < end) {
|
|
457
|
+
const tag = reader.uint32();
|
|
458
|
+
switch (tag >>> 3) {
|
|
459
|
+
case 1: {
|
|
460
|
+
if (tag !== 10) {
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
message.key = reader.string();
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
case 2: {
|
|
468
|
+
if (tag !== 18) {
|
|
469
|
+
break;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
message.value = reader.string();
|
|
473
|
+
continue;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
reader.skip(tag & 7);
|
|
480
|
+
}
|
|
481
|
+
return message;
|
|
482
|
+
},
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
function createBaseTelegramVerifyResponse(): TelegramVerifyResponse {
|
|
486
|
+
return {};
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
export const TelegramVerifyResponse: MessageFns<TelegramVerifyResponse> = {
|
|
490
|
+
encode(message: TelegramVerifyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
491
|
+
if (message.url !== undefined) {
|
|
492
|
+
writer.uint32(10).string(message.url);
|
|
493
|
+
}
|
|
494
|
+
if (message.accessToken !== undefined) {
|
|
495
|
+
writer.uint32(18).string(message.accessToken);
|
|
496
|
+
}
|
|
497
|
+
if (message.refreshToken !== undefined) {
|
|
498
|
+
writer.uint32(26).string(message.refreshToken);
|
|
499
|
+
}
|
|
500
|
+
return writer;
|
|
501
|
+
},
|
|
502
|
+
|
|
503
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyResponse {
|
|
504
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
505
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
506
|
+
const message = createBaseTelegramVerifyResponse();
|
|
507
|
+
while (reader.pos < end) {
|
|
508
|
+
const tag = reader.uint32();
|
|
509
|
+
switch (tag >>> 3) {
|
|
510
|
+
case 1: {
|
|
511
|
+
if (tag !== 10) {
|
|
512
|
+
break;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
message.url = reader.string();
|
|
516
|
+
continue;
|
|
517
|
+
}
|
|
518
|
+
case 2: {
|
|
519
|
+
if (tag !== 18) {
|
|
520
|
+
break;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
message.accessToken = reader.string();
|
|
524
|
+
continue;
|
|
525
|
+
}
|
|
526
|
+
case 3: {
|
|
527
|
+
if (tag !== 26) {
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
message.refreshToken = reader.string();
|
|
532
|
+
continue;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
536
|
+
break;
|
|
537
|
+
}
|
|
538
|
+
reader.skip(tag & 7);
|
|
539
|
+
}
|
|
540
|
+
return message;
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
function createBaseTelegramCompleteRequest(): TelegramCompleteRequest {
|
|
545
|
+
return { sessionId: "", phone: "" };
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export const TelegramCompleteRequest: MessageFns<TelegramCompleteRequest> = {
|
|
549
|
+
encode(message: TelegramCompleteRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
550
|
+
if (message.sessionId !== "") {
|
|
551
|
+
writer.uint32(10).string(message.sessionId);
|
|
552
|
+
}
|
|
553
|
+
if (message.phone !== "") {
|
|
554
|
+
writer.uint32(18).string(message.phone);
|
|
555
|
+
}
|
|
556
|
+
return writer;
|
|
557
|
+
},
|
|
558
|
+
|
|
559
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramCompleteRequest {
|
|
560
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
561
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
562
|
+
const message = createBaseTelegramCompleteRequest();
|
|
563
|
+
while (reader.pos < end) {
|
|
564
|
+
const tag = reader.uint32();
|
|
565
|
+
switch (tag >>> 3) {
|
|
566
|
+
case 1: {
|
|
567
|
+
if (tag !== 10) {
|
|
568
|
+
break;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
message.sessionId = reader.string();
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
case 2: {
|
|
575
|
+
if (tag !== 18) {
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
message.phone = reader.string();
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
584
|
+
break;
|
|
585
|
+
}
|
|
586
|
+
reader.skip(tag & 7);
|
|
587
|
+
}
|
|
588
|
+
return message;
|
|
589
|
+
},
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
function createBaseTelegramCompleteResponse(): TelegramCompleteResponse {
|
|
593
|
+
return { sessionId: "" };
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export const TelegramCompleteResponse: MessageFns<TelegramCompleteResponse> = {
|
|
597
|
+
encode(message: TelegramCompleteResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
598
|
+
if (message.sessionId !== "") {
|
|
599
|
+
writer.uint32(10).string(message.sessionId);
|
|
600
|
+
}
|
|
601
|
+
return writer;
|
|
602
|
+
},
|
|
603
|
+
|
|
604
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramCompleteResponse {
|
|
605
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
606
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
607
|
+
const message = createBaseTelegramCompleteResponse();
|
|
608
|
+
while (reader.pos < end) {
|
|
609
|
+
const tag = reader.uint32();
|
|
610
|
+
switch (tag >>> 3) {
|
|
611
|
+
case 1: {
|
|
612
|
+
if (tag !== 10) {
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
message.sessionId = reader.string();
|
|
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
|
+
|
|
629
|
+
function createBaseTelegramConsumeRequest(): TelegramConsumeRequest {
|
|
630
|
+
return { sessionId: "" };
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export const TelegramConsumeRequest: MessageFns<TelegramConsumeRequest> = {
|
|
634
|
+
encode(message: TelegramConsumeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
635
|
+
if (message.sessionId !== "") {
|
|
636
|
+
writer.uint32(10).string(message.sessionId);
|
|
637
|
+
}
|
|
638
|
+
return writer;
|
|
639
|
+
},
|
|
640
|
+
|
|
641
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramConsumeRequest {
|
|
642
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
643
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
644
|
+
const message = createBaseTelegramConsumeRequest();
|
|
645
|
+
while (reader.pos < end) {
|
|
646
|
+
const tag = reader.uint32();
|
|
647
|
+
switch (tag >>> 3) {
|
|
648
|
+
case 1: {
|
|
649
|
+
if (tag !== 10) {
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
message.sessionId = reader.string();
|
|
654
|
+
continue;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
658
|
+
break;
|
|
659
|
+
}
|
|
660
|
+
reader.skip(tag & 7);
|
|
661
|
+
}
|
|
662
|
+
return message;
|
|
663
|
+
},
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
function createBaseTelegramConsumeResponse(): TelegramConsumeResponse {
|
|
667
|
+
return { accessToken: "", refreshToken: "" };
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
export const TelegramConsumeResponse: MessageFns<TelegramConsumeResponse> = {
|
|
671
|
+
encode(message: TelegramConsumeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
672
|
+
if (message.accessToken !== "") {
|
|
673
|
+
writer.uint32(10).string(message.accessToken);
|
|
674
|
+
}
|
|
675
|
+
if (message.refreshToken !== "") {
|
|
676
|
+
writer.uint32(18).string(message.refreshToken);
|
|
677
|
+
}
|
|
678
|
+
return writer;
|
|
679
|
+
},
|
|
680
|
+
|
|
681
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramConsumeResponse {
|
|
682
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
683
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
684
|
+
const message = createBaseTelegramConsumeResponse();
|
|
685
|
+
while (reader.pos < end) {
|
|
686
|
+
const tag = reader.uint32();
|
|
687
|
+
switch (tag >>> 3) {
|
|
688
|
+
case 1: {
|
|
689
|
+
if (tag !== 10) {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
message.accessToken = reader.string();
|
|
694
|
+
continue;
|
|
695
|
+
}
|
|
696
|
+
case 2: {
|
|
697
|
+
if (tag !== 18) {
|
|
698
|
+
break;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
message.refreshToken = reader.string();
|
|
702
|
+
continue;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
706
|
+
break;
|
|
707
|
+
}
|
|
708
|
+
reader.skip(tag & 7);
|
|
709
|
+
}
|
|
710
|
+
return message;
|
|
711
|
+
},
|
|
712
|
+
};
|
|
713
|
+
|
|
322
714
|
export interface AuthServiceClient {
|
|
323
715
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
324
716
|
|
|
325
717
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOptResponse>;
|
|
326
718
|
|
|
327
719
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
720
|
+
|
|
721
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
722
|
+
|
|
723
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
724
|
+
|
|
725
|
+
telegramComplete(request: TelegramCompleteRequest): Observable<TelegramCompleteResponse>;
|
|
726
|
+
|
|
727
|
+
telegramConsume(request: TelegramConsumeRequest): Observable<TelegramConsumeResponse>;
|
|
328
728
|
}
|
|
329
729
|
|
|
330
730
|
export interface AuthServiceController {
|
|
@@ -333,11 +733,33 @@ export interface AuthServiceController {
|
|
|
333
733
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOptResponse> | Observable<VerifyOptResponse> | VerifyOptResponse;
|
|
334
734
|
|
|
335
735
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
736
|
+
|
|
737
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
738
|
+
|
|
739
|
+
telegramVerify(
|
|
740
|
+
request: TelegramVerifyRequest,
|
|
741
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
742
|
+
|
|
743
|
+
telegramComplete(
|
|
744
|
+
request: TelegramCompleteRequest,
|
|
745
|
+
): Promise<TelegramCompleteResponse> | Observable<TelegramCompleteResponse> | TelegramCompleteResponse;
|
|
746
|
+
|
|
747
|
+
telegramConsume(
|
|
748
|
+
request: TelegramConsumeRequest,
|
|
749
|
+
): Promise<TelegramConsumeResponse> | Observable<TelegramConsumeResponse> | TelegramConsumeResponse;
|
|
336
750
|
}
|
|
337
751
|
|
|
338
752
|
export function AuthServiceControllerMethods() {
|
|
339
753
|
return function (constructor: Function) {
|
|
340
|
-
const grpcMethods: string[] = [
|
|
754
|
+
const grpcMethods: string[] = [
|
|
755
|
+
"sendOtp",
|
|
756
|
+
"verifyOtp",
|
|
757
|
+
"refresh",
|
|
758
|
+
"telegramInit",
|
|
759
|
+
"telegramVerify",
|
|
760
|
+
"telegramComplete",
|
|
761
|
+
"telegramConsume",
|
|
762
|
+
];
|
|
341
763
|
for (const method of grpcMethods) {
|
|
342
764
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
343
765
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
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
|
+
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
25
|
+
|
|
26
|
+
function createBaseEmpty(): Empty {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const Empty: MessageFns<Empty> = {
|
|
31
|
+
encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
32
|
+
return writer;
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Empty {
|
|
36
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
37
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
38
|
+
const message = createBaseEmpty();
|
|
39
|
+
while (reader.pos < end) {
|
|
40
|
+
const tag = reader.uint32();
|
|
41
|
+
switch (tag >>> 3) {
|
|
42
|
+
}
|
|
43
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
reader.skip(tag & 7);
|
|
47
|
+
}
|
|
48
|
+
return message;
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export interface MessageFns<T> {
|
|
53
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
54
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
55
|
+
}
|
package/package.json
CHANGED
package/proto/auth.proto
CHANGED
|
@@ -2,10 +2,18 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package auth.v1;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
5
7
|
service AuthService {
|
|
6
8
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
7
9
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOptResponse);
|
|
8
10
|
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
11
|
+
|
|
12
|
+
rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
|
|
13
|
+
rpc TelegramVerify (TelegramVerifyRequest) returns (TelegramVerifyResponse);
|
|
14
|
+
rpc TelegramComplete (TelegramCompleteRequest) returns (TelegramCompleteResponse);
|
|
15
|
+
rpc TelegramConsume (TelegramConsumeRequest) returns (TelegramConsumeResponse);
|
|
16
|
+
|
|
9
17
|
}
|
|
10
18
|
|
|
11
19
|
message SendOtpRequest {
|
|
@@ -35,4 +43,39 @@ message RefreshRequest {
|
|
|
35
43
|
message RefreshResponse {
|
|
36
44
|
string access_token = 1;
|
|
37
45
|
string refresh_token = 2;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message TelegramInitResponse {
|
|
49
|
+
string url = 1;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message TelegramVerifyRequest {
|
|
53
|
+
map<string, string> query = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message TelegramVerifyResponse {
|
|
57
|
+
oneof result {
|
|
58
|
+
string url = 1;
|
|
59
|
+
string access_token = 2;
|
|
60
|
+
string refresh_token = 3;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message TelegramCompleteRequest {
|
|
65
|
+
string session_id = 1;
|
|
66
|
+
string phone = 2;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message TelegramCompleteResponse {
|
|
70
|
+
string session_id = 1;
|
|
71
|
+
|
|
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;
|
|
38
81
|
}
|