@babacarthiamdev/contracts 1.0.11 → 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/account.ts +442 -12
- package/package.json +1 -1
- package/proto/account.proto +50 -3
package/gen/account.ts
CHANGED
|
@@ -25,11 +25,49 @@ export interface GetAccountResponse {
|
|
|
25
25
|
id: string;
|
|
26
26
|
phone: string;
|
|
27
27
|
email: string;
|
|
28
|
-
isPhoneVerified:
|
|
29
|
-
isEmailVerified:
|
|
28
|
+
isPhoneVerified: boolean;
|
|
29
|
+
isEmailVerified: boolean;
|
|
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 {
|
|
@@ -70,7 +108,7 @@ export const GetAccountRequest: MessageFns<GetAccountRequest> = {
|
|
|
70
108
|
};
|
|
71
109
|
|
|
72
110
|
function createBaseGetAccountResponse(): GetAccountResponse {
|
|
73
|
-
return { id: "", phone: "", email: "", isPhoneVerified:
|
|
111
|
+
return { id: "", phone: "", email: "", isPhoneVerified: false, isEmailVerified: false, role: 0 };
|
|
74
112
|
}
|
|
75
113
|
|
|
76
114
|
export const GetAccountResponse: MessageFns<GetAccountResponse> = {
|
|
@@ -84,11 +122,11 @@ export const GetAccountResponse: MessageFns<GetAccountResponse> = {
|
|
|
84
122
|
if (message.email !== "") {
|
|
85
123
|
writer.uint32(26).string(message.email);
|
|
86
124
|
}
|
|
87
|
-
if (message.isPhoneVerified !==
|
|
88
|
-
writer.uint32(
|
|
125
|
+
if (message.isPhoneVerified !== false) {
|
|
126
|
+
writer.uint32(32).bool(message.isPhoneVerified);
|
|
89
127
|
}
|
|
90
|
-
if (message.isEmailVerified !==
|
|
91
|
-
writer.uint32(
|
|
128
|
+
if (message.isEmailVerified !== false) {
|
|
129
|
+
writer.uint32(40).bool(message.isEmailVerified);
|
|
92
130
|
}
|
|
93
131
|
if (message.role !== 0) {
|
|
94
132
|
writer.uint32(48).int32(message.role);
|
|
@@ -128,19 +166,19 @@ export const GetAccountResponse: MessageFns<GetAccountResponse> = {
|
|
|
128
166
|
continue;
|
|
129
167
|
}
|
|
130
168
|
case 4: {
|
|
131
|
-
if (tag !==
|
|
169
|
+
if (tag !== 32) {
|
|
132
170
|
break;
|
|
133
171
|
}
|
|
134
172
|
|
|
135
|
-
message.isPhoneVerified = reader.
|
|
173
|
+
message.isPhoneVerified = reader.bool();
|
|
136
174
|
continue;
|
|
137
175
|
}
|
|
138
176
|
case 5: {
|
|
139
|
-
if (tag !==
|
|
177
|
+
if (tag !== 40) {
|
|
140
178
|
break;
|
|
141
179
|
}
|
|
142
180
|
|
|
143
|
-
message.isEmailVerified = reader.
|
|
181
|
+
message.isEmailVerified = reader.bool();
|
|
144
182
|
continue;
|
|
145
183
|
}
|
|
146
184
|
case 6: {
|
|
@@ -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/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 {
|
|
@@ -14,12 +21,52 @@ message GetAccountResponse {
|
|
|
14
21
|
string id = 1;
|
|
15
22
|
string phone = 2;
|
|
16
23
|
string email = 3;
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
bool is_phone_verified = 4;
|
|
25
|
+
bool is_email_verified = 5;
|
|
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
|
+
|