@babacarthiamdev/contracts 1.0.12 → 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/account.ts +431 -1
- package/gen/auth.ts +215 -1
- package/gen/google/protobuf/empty.ts +55 -0
- package/package.json +1 -1
- package/proto/account.proto +48 -1
- package/proto/auth.proto +21 -0
package/gen/account.ts
CHANGED
|
@@ -30,6 +30,44 @@ export interface GetAccountResponse {
|
|
|
30
30
|
role: Role;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export interface InitEmailChangeRequest {
|
|
34
|
+
email: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface InitEmailChangeResponse {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ConfirmEmailChangeRequest {
|
|
43
|
+
email: string;
|
|
44
|
+
code: string;
|
|
45
|
+
userId: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface ConfirmEmailChangeResponse {
|
|
49
|
+
ok: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface InitPhoneChangeRequest {
|
|
53
|
+
phone: string;
|
|
54
|
+
userId: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface InitPhoneChangeResponse {
|
|
58
|
+
ok: boolean;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ConfirmPhoneChangeRequest {
|
|
62
|
+
phone: string;
|
|
63
|
+
code: string;
|
|
64
|
+
userId: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ConfirmPhoneChangeResponse {
|
|
68
|
+
ok: boolean;
|
|
69
|
+
}
|
|
70
|
+
|
|
33
71
|
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
34
72
|
|
|
35
73
|
function createBaseGetAccountRequest(): GetAccountRequest {
|
|
@@ -161,19 +199,411 @@ export const GetAccountResponse: MessageFns<GetAccountResponse> = {
|
|
|
161
199
|
},
|
|
162
200
|
};
|
|
163
201
|
|
|
202
|
+
function createBaseInitEmailChangeRequest(): InitEmailChangeRequest {
|
|
203
|
+
return { email: "", userId: "" };
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export const InitEmailChangeRequest: MessageFns<InitEmailChangeRequest> = {
|
|
207
|
+
encode(message: InitEmailChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
208
|
+
if (message.email !== "") {
|
|
209
|
+
writer.uint32(10).string(message.email);
|
|
210
|
+
}
|
|
211
|
+
if (message.userId !== "") {
|
|
212
|
+
writer.uint32(18).string(message.userId);
|
|
213
|
+
}
|
|
214
|
+
return writer;
|
|
215
|
+
},
|
|
216
|
+
|
|
217
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitEmailChangeRequest {
|
|
218
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
219
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
220
|
+
const message = createBaseInitEmailChangeRequest();
|
|
221
|
+
while (reader.pos < end) {
|
|
222
|
+
const tag = reader.uint32();
|
|
223
|
+
switch (tag >>> 3) {
|
|
224
|
+
case 1: {
|
|
225
|
+
if (tag !== 10) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
message.email = reader.string();
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
case 2: {
|
|
233
|
+
if (tag !== 18) {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
message.userId = reader.string();
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
242
|
+
break;
|
|
243
|
+
}
|
|
244
|
+
reader.skip(tag & 7);
|
|
245
|
+
}
|
|
246
|
+
return message;
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
function createBaseInitEmailChangeResponse(): InitEmailChangeResponse {
|
|
251
|
+
return { ok: false };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export const InitEmailChangeResponse: MessageFns<InitEmailChangeResponse> = {
|
|
255
|
+
encode(message: InitEmailChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
256
|
+
if (message.ok !== false) {
|
|
257
|
+
writer.uint32(8).bool(message.ok);
|
|
258
|
+
}
|
|
259
|
+
return writer;
|
|
260
|
+
},
|
|
261
|
+
|
|
262
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitEmailChangeResponse {
|
|
263
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
264
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
265
|
+
const message = createBaseInitEmailChangeResponse();
|
|
266
|
+
while (reader.pos < end) {
|
|
267
|
+
const tag = reader.uint32();
|
|
268
|
+
switch (tag >>> 3) {
|
|
269
|
+
case 1: {
|
|
270
|
+
if (tag !== 8) {
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
message.ok = reader.bool();
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
reader.skip(tag & 7);
|
|
282
|
+
}
|
|
283
|
+
return message;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
function createBaseConfirmEmailChangeRequest(): ConfirmEmailChangeRequest {
|
|
288
|
+
return { email: "", code: "", userId: "" };
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export const ConfirmEmailChangeRequest: MessageFns<ConfirmEmailChangeRequest> = {
|
|
292
|
+
encode(message: ConfirmEmailChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
293
|
+
if (message.email !== "") {
|
|
294
|
+
writer.uint32(10).string(message.email);
|
|
295
|
+
}
|
|
296
|
+
if (message.code !== "") {
|
|
297
|
+
writer.uint32(18).string(message.code);
|
|
298
|
+
}
|
|
299
|
+
if (message.userId !== "") {
|
|
300
|
+
writer.uint32(26).string(message.userId);
|
|
301
|
+
}
|
|
302
|
+
return writer;
|
|
303
|
+
},
|
|
304
|
+
|
|
305
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmEmailChangeRequest {
|
|
306
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
307
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
308
|
+
const message = createBaseConfirmEmailChangeRequest();
|
|
309
|
+
while (reader.pos < end) {
|
|
310
|
+
const tag = reader.uint32();
|
|
311
|
+
switch (tag >>> 3) {
|
|
312
|
+
case 1: {
|
|
313
|
+
if (tag !== 10) {
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
message.email = reader.string();
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
case 2: {
|
|
321
|
+
if (tag !== 18) {
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
message.code = reader.string();
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
case 3: {
|
|
329
|
+
if (tag !== 26) {
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
message.userId = reader.string();
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
reader.skip(tag & 7);
|
|
341
|
+
}
|
|
342
|
+
return message;
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
function createBaseConfirmEmailChangeResponse(): ConfirmEmailChangeResponse {
|
|
347
|
+
return { ok: false };
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export const ConfirmEmailChangeResponse: MessageFns<ConfirmEmailChangeResponse> = {
|
|
351
|
+
encode(message: ConfirmEmailChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
352
|
+
if (message.ok !== false) {
|
|
353
|
+
writer.uint32(8).bool(message.ok);
|
|
354
|
+
}
|
|
355
|
+
return writer;
|
|
356
|
+
},
|
|
357
|
+
|
|
358
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmEmailChangeResponse {
|
|
359
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
360
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
361
|
+
const message = createBaseConfirmEmailChangeResponse();
|
|
362
|
+
while (reader.pos < end) {
|
|
363
|
+
const tag = reader.uint32();
|
|
364
|
+
switch (tag >>> 3) {
|
|
365
|
+
case 1: {
|
|
366
|
+
if (tag !== 8) {
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
message.ok = reader.bool();
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
375
|
+
break;
|
|
376
|
+
}
|
|
377
|
+
reader.skip(tag & 7);
|
|
378
|
+
}
|
|
379
|
+
return message;
|
|
380
|
+
},
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
function createBaseInitPhoneChangeRequest(): InitPhoneChangeRequest {
|
|
384
|
+
return { phone: "", userId: "" };
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export const InitPhoneChangeRequest: MessageFns<InitPhoneChangeRequest> = {
|
|
388
|
+
encode(message: InitPhoneChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
389
|
+
if (message.phone !== "") {
|
|
390
|
+
writer.uint32(10).string(message.phone);
|
|
391
|
+
}
|
|
392
|
+
if (message.userId !== "") {
|
|
393
|
+
writer.uint32(18).string(message.userId);
|
|
394
|
+
}
|
|
395
|
+
return writer;
|
|
396
|
+
},
|
|
397
|
+
|
|
398
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitPhoneChangeRequest {
|
|
399
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
400
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
401
|
+
const message = createBaseInitPhoneChangeRequest();
|
|
402
|
+
while (reader.pos < end) {
|
|
403
|
+
const tag = reader.uint32();
|
|
404
|
+
switch (tag >>> 3) {
|
|
405
|
+
case 1: {
|
|
406
|
+
if (tag !== 10) {
|
|
407
|
+
break;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
message.phone = reader.string();
|
|
411
|
+
continue;
|
|
412
|
+
}
|
|
413
|
+
case 2: {
|
|
414
|
+
if (tag !== 18) {
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
message.userId = reader.string();
|
|
419
|
+
continue;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
reader.skip(tag & 7);
|
|
426
|
+
}
|
|
427
|
+
return message;
|
|
428
|
+
},
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
function createBaseInitPhoneChangeResponse(): InitPhoneChangeResponse {
|
|
432
|
+
return { ok: false };
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export const InitPhoneChangeResponse: MessageFns<InitPhoneChangeResponse> = {
|
|
436
|
+
encode(message: InitPhoneChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
437
|
+
if (message.ok !== false) {
|
|
438
|
+
writer.uint32(8).bool(message.ok);
|
|
439
|
+
}
|
|
440
|
+
return writer;
|
|
441
|
+
},
|
|
442
|
+
|
|
443
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitPhoneChangeResponse {
|
|
444
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
445
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
446
|
+
const message = createBaseInitPhoneChangeResponse();
|
|
447
|
+
while (reader.pos < end) {
|
|
448
|
+
const tag = reader.uint32();
|
|
449
|
+
switch (tag >>> 3) {
|
|
450
|
+
case 1: {
|
|
451
|
+
if (tag !== 8) {
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
message.ok = reader.bool();
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
460
|
+
break;
|
|
461
|
+
}
|
|
462
|
+
reader.skip(tag & 7);
|
|
463
|
+
}
|
|
464
|
+
return message;
|
|
465
|
+
},
|
|
466
|
+
};
|
|
467
|
+
|
|
468
|
+
function createBaseConfirmPhoneChangeRequest(): ConfirmPhoneChangeRequest {
|
|
469
|
+
return { phone: "", code: "", userId: "" };
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export const ConfirmPhoneChangeRequest: MessageFns<ConfirmPhoneChangeRequest> = {
|
|
473
|
+
encode(message: ConfirmPhoneChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
474
|
+
if (message.phone !== "") {
|
|
475
|
+
writer.uint32(10).string(message.phone);
|
|
476
|
+
}
|
|
477
|
+
if (message.code !== "") {
|
|
478
|
+
writer.uint32(18).string(message.code);
|
|
479
|
+
}
|
|
480
|
+
if (message.userId !== "") {
|
|
481
|
+
writer.uint32(26).string(message.userId);
|
|
482
|
+
}
|
|
483
|
+
return writer;
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmPhoneChangeRequest {
|
|
487
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
488
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
489
|
+
const message = createBaseConfirmPhoneChangeRequest();
|
|
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.phone = reader.string();
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
case 2: {
|
|
502
|
+
if (tag !== 18) {
|
|
503
|
+
break;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
message.code = reader.string();
|
|
507
|
+
continue;
|
|
508
|
+
}
|
|
509
|
+
case 3: {
|
|
510
|
+
if (tag !== 26) {
|
|
511
|
+
break;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
message.userId = reader.string();
|
|
515
|
+
continue;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
519
|
+
break;
|
|
520
|
+
}
|
|
521
|
+
reader.skip(tag & 7);
|
|
522
|
+
}
|
|
523
|
+
return message;
|
|
524
|
+
},
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
function createBaseConfirmPhoneChangeResponse(): ConfirmPhoneChangeResponse {
|
|
528
|
+
return { ok: false };
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export const ConfirmPhoneChangeResponse: MessageFns<ConfirmPhoneChangeResponse> = {
|
|
532
|
+
encode(message: ConfirmPhoneChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
533
|
+
if (message.ok !== false) {
|
|
534
|
+
writer.uint32(8).bool(message.ok);
|
|
535
|
+
}
|
|
536
|
+
return writer;
|
|
537
|
+
},
|
|
538
|
+
|
|
539
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmPhoneChangeResponse {
|
|
540
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
541
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
542
|
+
const message = createBaseConfirmPhoneChangeResponse();
|
|
543
|
+
while (reader.pos < end) {
|
|
544
|
+
const tag = reader.uint32();
|
|
545
|
+
switch (tag >>> 3) {
|
|
546
|
+
case 1: {
|
|
547
|
+
if (tag !== 8) {
|
|
548
|
+
break;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
message.ok = reader.bool();
|
|
552
|
+
continue;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
reader.skip(tag & 7);
|
|
559
|
+
}
|
|
560
|
+
return message;
|
|
561
|
+
},
|
|
562
|
+
};
|
|
563
|
+
|
|
164
564
|
export interface AccountServiceClient {
|
|
165
565
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
566
|
+
|
|
567
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
568
|
+
|
|
569
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
570
|
+
|
|
571
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
572
|
+
|
|
573
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
166
574
|
}
|
|
167
575
|
|
|
168
576
|
export interface AccountServiceController {
|
|
169
577
|
getAccount(
|
|
170
578
|
request: GetAccountRequest,
|
|
171
579
|
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
580
|
+
|
|
581
|
+
initEmailChange(
|
|
582
|
+
request: InitEmailChangeRequest,
|
|
583
|
+
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
584
|
+
|
|
585
|
+
confirmEmailChange(
|
|
586
|
+
request: ConfirmEmailChangeRequest,
|
|
587
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
588
|
+
|
|
589
|
+
initPhoneChange(
|
|
590
|
+
request: InitPhoneChangeRequest,
|
|
591
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
592
|
+
|
|
593
|
+
confirmPhoneChange(
|
|
594
|
+
request: ConfirmPhoneChangeRequest,
|
|
595
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
172
596
|
}
|
|
173
597
|
|
|
174
598
|
export function AccountServiceControllerMethods() {
|
|
175
599
|
return function (constructor: Function) {
|
|
176
|
-
const grpcMethods: string[] = [
|
|
600
|
+
const grpcMethods: string[] = [
|
|
601
|
+
"getAccount",
|
|
602
|
+
"initEmailChange",
|
|
603
|
+
"confirmEmailChange",
|
|
604
|
+
"initPhoneChange",
|
|
605
|
+
"confirmPhoneChange",
|
|
606
|
+
];
|
|
177
607
|
for (const method of grpcMethods) {
|
|
178
608
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
179
609
|
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
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/account.proto
CHANGED
|
@@ -4,6 +4,13 @@ package account.v1;
|
|
|
4
4
|
|
|
5
5
|
service AccountService {
|
|
6
6
|
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
7
|
+
|
|
8
|
+
rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
9
|
+
rpc ConfirmEmailChange (ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
10
|
+
|
|
11
|
+
rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
12
|
+
rpc ConfirmPhoneChange (ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
13
|
+
|
|
7
14
|
}
|
|
8
15
|
|
|
9
16
|
message GetAccountRequest {
|
|
@@ -19,7 +26,47 @@ message GetAccountResponse {
|
|
|
19
26
|
Role role = 6;
|
|
20
27
|
}
|
|
21
28
|
|
|
29
|
+
message InitEmailChangeRequest{
|
|
30
|
+
string email = 1;
|
|
31
|
+
string user_id = 2;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message InitEmailChangeResponse{
|
|
35
|
+
bool ok = 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message ConfirmEmailChangeRequest{
|
|
39
|
+
string email = 1;
|
|
40
|
+
string code = 2;
|
|
41
|
+
string user_id = 3;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message ConfirmEmailChangeResponse{
|
|
45
|
+
bool ok = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
message InitPhoneChangeRequest{
|
|
50
|
+
string phone = 1;
|
|
51
|
+
string user_id = 2;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
message InitPhoneChangeResponse{
|
|
55
|
+
bool ok = 1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message ConfirmPhoneChangeRequest{
|
|
59
|
+
string phone = 1;
|
|
60
|
+
string code = 2;
|
|
61
|
+
string user_id = 3;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
message ConfirmPhoneChangeResponse{
|
|
65
|
+
bool ok = 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
22
68
|
enum Role {
|
|
23
69
|
USER = 0;
|
|
24
70
|
ADMIN = 1;
|
|
25
|
-
}
|
|
71
|
+
}
|
|
72
|
+
|
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
|
}
|