@babacarthiamdev/contracts 1.0.13 → 1.0.14
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 +215 -1
- package/gen/google/protobuf/empty.ts +55 -0
- package/package.json +1 -1
- package/proto/auth.proto +21 -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,25 @@ 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
|
+
|
|
43
63
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
44
64
|
|
|
45
65
|
function createBaseSendOtpRequest(): SendOtpRequest {
|
|
@@ -319,12 +339,200 @@ export const RefreshResponse: MessageFns<RefreshResponse> = {
|
|
|
319
339
|
},
|
|
320
340
|
};
|
|
321
341
|
|
|
342
|
+
function createBaseTelegramInitResponse(): TelegramInitResponse {
|
|
343
|
+
return { url: "" };
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export const TelegramInitResponse: MessageFns<TelegramInitResponse> = {
|
|
347
|
+
encode(message: TelegramInitResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
348
|
+
if (message.url !== "") {
|
|
349
|
+
writer.uint32(10).string(message.url);
|
|
350
|
+
}
|
|
351
|
+
return writer;
|
|
352
|
+
},
|
|
353
|
+
|
|
354
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramInitResponse {
|
|
355
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
356
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
357
|
+
const message = createBaseTelegramInitResponse();
|
|
358
|
+
while (reader.pos < end) {
|
|
359
|
+
const tag = reader.uint32();
|
|
360
|
+
switch (tag >>> 3) {
|
|
361
|
+
case 1: {
|
|
362
|
+
if (tag !== 10) {
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
message.url = reader.string();
|
|
367
|
+
continue;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
reader.skip(tag & 7);
|
|
374
|
+
}
|
|
375
|
+
return message;
|
|
376
|
+
},
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
function createBaseTelegramVerifyRequest(): TelegramVerifyRequest {
|
|
380
|
+
return { query: {} };
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export const TelegramVerifyRequest: MessageFns<TelegramVerifyRequest> = {
|
|
384
|
+
encode(message: TelegramVerifyRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
385
|
+
globalThis.Object.entries(message.query).forEach(([key, value]: [string, string]) => {
|
|
386
|
+
TelegramVerifyRequest_QueryEntry.encode({ key: key as any, value }, writer.uint32(10).fork()).join();
|
|
387
|
+
});
|
|
388
|
+
return writer;
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest {
|
|
392
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
393
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
394
|
+
const message = createBaseTelegramVerifyRequest();
|
|
395
|
+
while (reader.pos < end) {
|
|
396
|
+
const tag = reader.uint32();
|
|
397
|
+
switch (tag >>> 3) {
|
|
398
|
+
case 1: {
|
|
399
|
+
if (tag !== 10) {
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
const entry1 = TelegramVerifyRequest_QueryEntry.decode(reader, reader.uint32());
|
|
404
|
+
if (entry1.value !== undefined) {
|
|
405
|
+
message.query[entry1.key] = entry1.value;
|
|
406
|
+
}
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
reader.skip(tag & 7);
|
|
414
|
+
}
|
|
415
|
+
return message;
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
function createBaseTelegramVerifyRequest_QueryEntry(): TelegramVerifyRequest_QueryEntry {
|
|
420
|
+
return { key: "", value: "" };
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export const TelegramVerifyRequest_QueryEntry: MessageFns<TelegramVerifyRequest_QueryEntry> = {
|
|
424
|
+
encode(message: TelegramVerifyRequest_QueryEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
425
|
+
if (message.key !== "") {
|
|
426
|
+
writer.uint32(10).string(message.key);
|
|
427
|
+
}
|
|
428
|
+
if (message.value !== "") {
|
|
429
|
+
writer.uint32(18).string(message.value);
|
|
430
|
+
}
|
|
431
|
+
return writer;
|
|
432
|
+
},
|
|
433
|
+
|
|
434
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyRequest_QueryEntry {
|
|
435
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
436
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
437
|
+
const message = createBaseTelegramVerifyRequest_QueryEntry();
|
|
438
|
+
while (reader.pos < end) {
|
|
439
|
+
const tag = reader.uint32();
|
|
440
|
+
switch (tag >>> 3) {
|
|
441
|
+
case 1: {
|
|
442
|
+
if (tag !== 10) {
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
message.key = reader.string();
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
case 2: {
|
|
450
|
+
if (tag !== 18) {
|
|
451
|
+
break;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
message.value = reader.string();
|
|
455
|
+
continue;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
459
|
+
break;
|
|
460
|
+
}
|
|
461
|
+
reader.skip(tag & 7);
|
|
462
|
+
}
|
|
463
|
+
return message;
|
|
464
|
+
},
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
function createBaseTelegramVerifyResponse(): TelegramVerifyResponse {
|
|
468
|
+
return {};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export const TelegramVerifyResponse: MessageFns<TelegramVerifyResponse> = {
|
|
472
|
+
encode(message: TelegramVerifyResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
473
|
+
if (message.url !== undefined) {
|
|
474
|
+
writer.uint32(10).string(message.url);
|
|
475
|
+
}
|
|
476
|
+
if (message.accessToken !== undefined) {
|
|
477
|
+
writer.uint32(18).string(message.accessToken);
|
|
478
|
+
}
|
|
479
|
+
if (message.refreshToken !== undefined) {
|
|
480
|
+
writer.uint32(26).string(message.refreshToken);
|
|
481
|
+
}
|
|
482
|
+
return writer;
|
|
483
|
+
},
|
|
484
|
+
|
|
485
|
+
decode(input: BinaryReader | Uint8Array, length?: number): TelegramVerifyResponse {
|
|
486
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
487
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
488
|
+
const message = createBaseTelegramVerifyResponse();
|
|
489
|
+
while (reader.pos < end) {
|
|
490
|
+
const tag = reader.uint32();
|
|
491
|
+
switch (tag >>> 3) {
|
|
492
|
+
case 1: {
|
|
493
|
+
if (tag !== 10) {
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
message.url = reader.string();
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
case 2: {
|
|
501
|
+
if (tag !== 18) {
|
|
502
|
+
break;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
message.accessToken = reader.string();
|
|
506
|
+
continue;
|
|
507
|
+
}
|
|
508
|
+
case 3: {
|
|
509
|
+
if (tag !== 26) {
|
|
510
|
+
break;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
message.refreshToken = reader.string();
|
|
514
|
+
continue;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
518
|
+
break;
|
|
519
|
+
}
|
|
520
|
+
reader.skip(tag & 7);
|
|
521
|
+
}
|
|
522
|
+
return message;
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
|
|
322
526
|
export interface AuthServiceClient {
|
|
323
527
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
324
528
|
|
|
325
529
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOptResponse>;
|
|
326
530
|
|
|
327
531
|
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
532
|
+
|
|
533
|
+
telegramInit(request: Empty): Observable<TelegramInitResponse>;
|
|
534
|
+
|
|
535
|
+
telegramVerify(request: TelegramVerifyRequest): Observable<TelegramVerifyResponse>;
|
|
328
536
|
}
|
|
329
537
|
|
|
330
538
|
export interface AuthServiceController {
|
|
@@ -333,11 +541,17 @@ export interface AuthServiceController {
|
|
|
333
541
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOptResponse> | Observable<VerifyOptResponse> | VerifyOptResponse;
|
|
334
542
|
|
|
335
543
|
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
544
|
+
|
|
545
|
+
telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
|
|
546
|
+
|
|
547
|
+
telegramVerify(
|
|
548
|
+
request: TelegramVerifyRequest,
|
|
549
|
+
): Promise<TelegramVerifyResponse> | Observable<TelegramVerifyResponse> | TelegramVerifyResponse;
|
|
336
550
|
}
|
|
337
551
|
|
|
338
552
|
export function AuthServiceControllerMethods() {
|
|
339
553
|
return function (constructor: Function) {
|
|
340
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
554
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh", "telegramInit", "telegramVerify"];
|
|
341
555
|
for (const method of grpcMethods) {
|
|
342
556
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
343
557
|
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,15 @@ 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);
|
|
9
14
|
}
|
|
10
15
|
|
|
11
16
|
message SendOtpRequest {
|
|
@@ -35,4 +40,20 @@ message RefreshRequest {
|
|
|
35
40
|
message RefreshResponse {
|
|
36
41
|
string access_token = 1;
|
|
37
42
|
string refresh_token = 2;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message TelegramInitResponse {
|
|
46
|
+
string url = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message TelegramVerifyRequest {
|
|
50
|
+
map<string, string> query = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message TelegramVerifyResponse {
|
|
54
|
+
oneof result {
|
|
55
|
+
string url = 1;
|
|
56
|
+
string access_token = 2;
|
|
57
|
+
string refresh_token = 3;
|
|
58
|
+
}
|
|
38
59
|
}
|