@meocinema/contracts 1.0.8 → 1.0.10
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/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/gen/account.ts +941 -0
- package/package.json +1 -1
- package/proto/account.proto +71 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
package/gen/account.ts
ADDED
|
@@ -0,0 +1,941 @@
|
|
|
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: account.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "account.v1";
|
|
11
|
+
|
|
12
|
+
export enum Role {
|
|
13
|
+
USER = 0,
|
|
14
|
+
ADMIN = 1,
|
|
15
|
+
UNRECOGNIZED = -1,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function roleFromJSON(object: any): Role {
|
|
19
|
+
switch (object) {
|
|
20
|
+
case 0:
|
|
21
|
+
case "USER":
|
|
22
|
+
return Role.USER;
|
|
23
|
+
case 1:
|
|
24
|
+
case "ADMIN":
|
|
25
|
+
return Role.ADMIN;
|
|
26
|
+
case -1:
|
|
27
|
+
case "UNRECOGNIZED":
|
|
28
|
+
default:
|
|
29
|
+
return Role.UNRECOGNIZED;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function roleToJSON(object: Role): string {
|
|
34
|
+
switch (object) {
|
|
35
|
+
case Role.USER:
|
|
36
|
+
return "USER";
|
|
37
|
+
case Role.ADMIN:
|
|
38
|
+
return "ADMIN";
|
|
39
|
+
case Role.UNRECOGNIZED:
|
|
40
|
+
default:
|
|
41
|
+
return "UNRECOGNIZED";
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface GetAccountRequest {
|
|
46
|
+
id: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GetAccountResponse {
|
|
50
|
+
id: string;
|
|
51
|
+
phone: string;
|
|
52
|
+
email: string;
|
|
53
|
+
isPhoneVerified: boolean;
|
|
54
|
+
isEmailVerified: boolean;
|
|
55
|
+
role: Role;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface InitEmailChangeRequest {
|
|
59
|
+
email: string;
|
|
60
|
+
userId: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface InitEmailChangeResponse {
|
|
64
|
+
ok: boolean;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ConfirmEmailChangeRequest {
|
|
68
|
+
email: string;
|
|
69
|
+
code: string;
|
|
70
|
+
userId: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface ConfirmEmailChangeResponse {
|
|
74
|
+
ok: boolean;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface InitPhoneChangeRequest {
|
|
78
|
+
phone: string;
|
|
79
|
+
userId: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface InitPhoneChangeResponse {
|
|
83
|
+
ok: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ConfirmPhoneChangeRequest {
|
|
87
|
+
phone: string;
|
|
88
|
+
code: string;
|
|
89
|
+
userId: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ConfirmPhoneChangeResponse {
|
|
93
|
+
ok: boolean;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function createBaseGetAccountRequest(): GetAccountRequest {
|
|
97
|
+
return { id: "" };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const GetAccountRequest: MessageFns<GetAccountRequest> = {
|
|
101
|
+
encode(message: GetAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
102
|
+
if (message.id !== "") {
|
|
103
|
+
writer.uint32(10).string(message.id);
|
|
104
|
+
}
|
|
105
|
+
return writer;
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetAccountRequest {
|
|
109
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
110
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
111
|
+
const message = createBaseGetAccountRequest();
|
|
112
|
+
while (reader.pos < end) {
|
|
113
|
+
const tag = reader.uint32();
|
|
114
|
+
switch (tag >>> 3) {
|
|
115
|
+
case 1: {
|
|
116
|
+
if (tag !== 10) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
message.id = reader.string();
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
reader.skip(tag & 7);
|
|
128
|
+
}
|
|
129
|
+
return message;
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
fromJSON(object: any): GetAccountRequest {
|
|
133
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
toJSON(message: GetAccountRequest): unknown {
|
|
137
|
+
const obj: any = {};
|
|
138
|
+
if (message.id !== "") {
|
|
139
|
+
obj.id = message.id;
|
|
140
|
+
}
|
|
141
|
+
return obj;
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
create<I extends Exact<DeepPartial<GetAccountRequest>, I>>(base?: I): GetAccountRequest {
|
|
145
|
+
return GetAccountRequest.fromPartial(base ?? ({} as any));
|
|
146
|
+
},
|
|
147
|
+
fromPartial<I extends Exact<DeepPartial<GetAccountRequest>, I>>(object: I): GetAccountRequest {
|
|
148
|
+
const message = createBaseGetAccountRequest();
|
|
149
|
+
message.id = object.id ?? "";
|
|
150
|
+
return message;
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
function createBaseGetAccountResponse(): GetAccountResponse {
|
|
155
|
+
return { id: "", phone: "", email: "", isPhoneVerified: false, isEmailVerified: false, role: 0 };
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export const GetAccountResponse: MessageFns<GetAccountResponse> = {
|
|
159
|
+
encode(message: GetAccountResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
160
|
+
if (message.id !== "") {
|
|
161
|
+
writer.uint32(10).string(message.id);
|
|
162
|
+
}
|
|
163
|
+
if (message.phone !== "") {
|
|
164
|
+
writer.uint32(18).string(message.phone);
|
|
165
|
+
}
|
|
166
|
+
if (message.email !== "") {
|
|
167
|
+
writer.uint32(26).string(message.email);
|
|
168
|
+
}
|
|
169
|
+
if (message.isPhoneVerified !== false) {
|
|
170
|
+
writer.uint32(32).bool(message.isPhoneVerified);
|
|
171
|
+
}
|
|
172
|
+
if (message.isEmailVerified !== false) {
|
|
173
|
+
writer.uint32(40).bool(message.isEmailVerified);
|
|
174
|
+
}
|
|
175
|
+
if (message.role !== 0) {
|
|
176
|
+
writer.uint32(48).int32(message.role);
|
|
177
|
+
}
|
|
178
|
+
return writer;
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetAccountResponse {
|
|
182
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
183
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
184
|
+
const message = createBaseGetAccountResponse();
|
|
185
|
+
while (reader.pos < end) {
|
|
186
|
+
const tag = reader.uint32();
|
|
187
|
+
switch (tag >>> 3) {
|
|
188
|
+
case 1: {
|
|
189
|
+
if (tag !== 10) {
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
message.id = reader.string();
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
case 2: {
|
|
197
|
+
if (tag !== 18) {
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message.phone = reader.string();
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
case 3: {
|
|
205
|
+
if (tag !== 26) {
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
message.email = reader.string();
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
case 4: {
|
|
213
|
+
if (tag !== 32) {
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
message.isPhoneVerified = reader.bool();
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
case 5: {
|
|
221
|
+
if (tag !== 40) {
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
message.isEmailVerified = reader.bool();
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
228
|
+
case 6: {
|
|
229
|
+
if (tag !== 48) {
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
message.role = reader.int32() as any;
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
reader.skip(tag & 7);
|
|
241
|
+
}
|
|
242
|
+
return message;
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
fromJSON(object: any): GetAccountResponse {
|
|
246
|
+
return {
|
|
247
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
248
|
+
phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
|
|
249
|
+
email: isSet(object.email) ? globalThis.String(object.email) : "",
|
|
250
|
+
isPhoneVerified: isSet(object.isPhoneVerified) ? globalThis.Boolean(object.isPhoneVerified) : false,
|
|
251
|
+
isEmailVerified: isSet(object.isEmailVerified) ? globalThis.Boolean(object.isEmailVerified) : false,
|
|
252
|
+
role: isSet(object.role) ? roleFromJSON(object.role) : 0,
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
toJSON(message: GetAccountResponse): unknown {
|
|
257
|
+
const obj: any = {};
|
|
258
|
+
if (message.id !== "") {
|
|
259
|
+
obj.id = message.id;
|
|
260
|
+
}
|
|
261
|
+
if (message.phone !== "") {
|
|
262
|
+
obj.phone = message.phone;
|
|
263
|
+
}
|
|
264
|
+
if (message.email !== "") {
|
|
265
|
+
obj.email = message.email;
|
|
266
|
+
}
|
|
267
|
+
if (message.isPhoneVerified !== false) {
|
|
268
|
+
obj.isPhoneVerified = message.isPhoneVerified;
|
|
269
|
+
}
|
|
270
|
+
if (message.isEmailVerified !== false) {
|
|
271
|
+
obj.isEmailVerified = message.isEmailVerified;
|
|
272
|
+
}
|
|
273
|
+
if (message.role !== 0) {
|
|
274
|
+
obj.role = roleToJSON(message.role);
|
|
275
|
+
}
|
|
276
|
+
return obj;
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
create<I extends Exact<DeepPartial<GetAccountResponse>, I>>(base?: I): GetAccountResponse {
|
|
280
|
+
return GetAccountResponse.fromPartial(base ?? ({} as any));
|
|
281
|
+
},
|
|
282
|
+
fromPartial<I extends Exact<DeepPartial<GetAccountResponse>, I>>(object: I): GetAccountResponse {
|
|
283
|
+
const message = createBaseGetAccountResponse();
|
|
284
|
+
message.id = object.id ?? "";
|
|
285
|
+
message.phone = object.phone ?? "";
|
|
286
|
+
message.email = object.email ?? "";
|
|
287
|
+
message.isPhoneVerified = object.isPhoneVerified ?? false;
|
|
288
|
+
message.isEmailVerified = object.isEmailVerified ?? false;
|
|
289
|
+
message.role = object.role ?? 0;
|
|
290
|
+
return message;
|
|
291
|
+
},
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
function createBaseInitEmailChangeRequest(): InitEmailChangeRequest {
|
|
295
|
+
return { email: "", userId: "" };
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export const InitEmailChangeRequest: MessageFns<InitEmailChangeRequest> = {
|
|
299
|
+
encode(message: InitEmailChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
300
|
+
if (message.email !== "") {
|
|
301
|
+
writer.uint32(10).string(message.email);
|
|
302
|
+
}
|
|
303
|
+
if (message.userId !== "") {
|
|
304
|
+
writer.uint32(18).string(message.userId);
|
|
305
|
+
}
|
|
306
|
+
return writer;
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitEmailChangeRequest {
|
|
310
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
311
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
312
|
+
const message = createBaseInitEmailChangeRequest();
|
|
313
|
+
while (reader.pos < end) {
|
|
314
|
+
const tag = reader.uint32();
|
|
315
|
+
switch (tag >>> 3) {
|
|
316
|
+
case 1: {
|
|
317
|
+
if (tag !== 10) {
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
message.email = reader.string();
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
case 2: {
|
|
325
|
+
if (tag !== 18) {
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
message.userId = reader.string();
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
reader.skip(tag & 7);
|
|
337
|
+
}
|
|
338
|
+
return message;
|
|
339
|
+
},
|
|
340
|
+
|
|
341
|
+
fromJSON(object: any): InitEmailChangeRequest {
|
|
342
|
+
return {
|
|
343
|
+
email: isSet(object.email) ? globalThis.String(object.email) : "",
|
|
344
|
+
userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
|
|
345
|
+
};
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
toJSON(message: InitEmailChangeRequest): unknown {
|
|
349
|
+
const obj: any = {};
|
|
350
|
+
if (message.email !== "") {
|
|
351
|
+
obj.email = message.email;
|
|
352
|
+
}
|
|
353
|
+
if (message.userId !== "") {
|
|
354
|
+
obj.userId = message.userId;
|
|
355
|
+
}
|
|
356
|
+
return obj;
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
create<I extends Exact<DeepPartial<InitEmailChangeRequest>, I>>(base?: I): InitEmailChangeRequest {
|
|
360
|
+
return InitEmailChangeRequest.fromPartial(base ?? ({} as any));
|
|
361
|
+
},
|
|
362
|
+
fromPartial<I extends Exact<DeepPartial<InitEmailChangeRequest>, I>>(object: I): InitEmailChangeRequest {
|
|
363
|
+
const message = createBaseInitEmailChangeRequest();
|
|
364
|
+
message.email = object.email ?? "";
|
|
365
|
+
message.userId = object.userId ?? "";
|
|
366
|
+
return message;
|
|
367
|
+
},
|
|
368
|
+
};
|
|
369
|
+
|
|
370
|
+
function createBaseInitEmailChangeResponse(): InitEmailChangeResponse {
|
|
371
|
+
return { ok: false };
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export const InitEmailChangeResponse: MessageFns<InitEmailChangeResponse> = {
|
|
375
|
+
encode(message: InitEmailChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
376
|
+
if (message.ok !== false) {
|
|
377
|
+
writer.uint32(8).bool(message.ok);
|
|
378
|
+
}
|
|
379
|
+
return writer;
|
|
380
|
+
},
|
|
381
|
+
|
|
382
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitEmailChangeResponse {
|
|
383
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
384
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
385
|
+
const message = createBaseInitEmailChangeResponse();
|
|
386
|
+
while (reader.pos < end) {
|
|
387
|
+
const tag = reader.uint32();
|
|
388
|
+
switch (tag >>> 3) {
|
|
389
|
+
case 1: {
|
|
390
|
+
if (tag !== 8) {
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
message.ok = reader.bool();
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
reader.skip(tag & 7);
|
|
402
|
+
}
|
|
403
|
+
return message;
|
|
404
|
+
},
|
|
405
|
+
|
|
406
|
+
fromJSON(object: any): InitEmailChangeResponse {
|
|
407
|
+
return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
toJSON(message: InitEmailChangeResponse): unknown {
|
|
411
|
+
const obj: any = {};
|
|
412
|
+
if (message.ok !== false) {
|
|
413
|
+
obj.ok = message.ok;
|
|
414
|
+
}
|
|
415
|
+
return obj;
|
|
416
|
+
},
|
|
417
|
+
|
|
418
|
+
create<I extends Exact<DeepPartial<InitEmailChangeResponse>, I>>(base?: I): InitEmailChangeResponse {
|
|
419
|
+
return InitEmailChangeResponse.fromPartial(base ?? ({} as any));
|
|
420
|
+
},
|
|
421
|
+
fromPartial<I extends Exact<DeepPartial<InitEmailChangeResponse>, I>>(object: I): InitEmailChangeResponse {
|
|
422
|
+
const message = createBaseInitEmailChangeResponse();
|
|
423
|
+
message.ok = object.ok ?? false;
|
|
424
|
+
return message;
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
function createBaseConfirmEmailChangeRequest(): ConfirmEmailChangeRequest {
|
|
429
|
+
return { email: "", code: "", userId: "" };
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
export const ConfirmEmailChangeRequest: MessageFns<ConfirmEmailChangeRequest> = {
|
|
433
|
+
encode(message: ConfirmEmailChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
434
|
+
if (message.email !== "") {
|
|
435
|
+
writer.uint32(10).string(message.email);
|
|
436
|
+
}
|
|
437
|
+
if (message.code !== "") {
|
|
438
|
+
writer.uint32(18).string(message.code);
|
|
439
|
+
}
|
|
440
|
+
if (message.userId !== "") {
|
|
441
|
+
writer.uint32(26).string(message.userId);
|
|
442
|
+
}
|
|
443
|
+
return writer;
|
|
444
|
+
},
|
|
445
|
+
|
|
446
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmEmailChangeRequest {
|
|
447
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
448
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
449
|
+
const message = createBaseConfirmEmailChangeRequest();
|
|
450
|
+
while (reader.pos < end) {
|
|
451
|
+
const tag = reader.uint32();
|
|
452
|
+
switch (tag >>> 3) {
|
|
453
|
+
case 1: {
|
|
454
|
+
if (tag !== 10) {
|
|
455
|
+
break;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
message.email = reader.string();
|
|
459
|
+
continue;
|
|
460
|
+
}
|
|
461
|
+
case 2: {
|
|
462
|
+
if (tag !== 18) {
|
|
463
|
+
break;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
message.code = reader.string();
|
|
467
|
+
continue;
|
|
468
|
+
}
|
|
469
|
+
case 3: {
|
|
470
|
+
if (tag !== 26) {
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
message.userId = reader.string();
|
|
475
|
+
continue;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
reader.skip(tag & 7);
|
|
482
|
+
}
|
|
483
|
+
return message;
|
|
484
|
+
},
|
|
485
|
+
|
|
486
|
+
fromJSON(object: any): ConfirmEmailChangeRequest {
|
|
487
|
+
return {
|
|
488
|
+
email: isSet(object.email) ? globalThis.String(object.email) : "",
|
|
489
|
+
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
490
|
+
userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
|
|
491
|
+
};
|
|
492
|
+
},
|
|
493
|
+
|
|
494
|
+
toJSON(message: ConfirmEmailChangeRequest): unknown {
|
|
495
|
+
const obj: any = {};
|
|
496
|
+
if (message.email !== "") {
|
|
497
|
+
obj.email = message.email;
|
|
498
|
+
}
|
|
499
|
+
if (message.code !== "") {
|
|
500
|
+
obj.code = message.code;
|
|
501
|
+
}
|
|
502
|
+
if (message.userId !== "") {
|
|
503
|
+
obj.userId = message.userId;
|
|
504
|
+
}
|
|
505
|
+
return obj;
|
|
506
|
+
},
|
|
507
|
+
|
|
508
|
+
create<I extends Exact<DeepPartial<ConfirmEmailChangeRequest>, I>>(base?: I): ConfirmEmailChangeRequest {
|
|
509
|
+
return ConfirmEmailChangeRequest.fromPartial(base ?? ({} as any));
|
|
510
|
+
},
|
|
511
|
+
fromPartial<I extends Exact<DeepPartial<ConfirmEmailChangeRequest>, I>>(object: I): ConfirmEmailChangeRequest {
|
|
512
|
+
const message = createBaseConfirmEmailChangeRequest();
|
|
513
|
+
message.email = object.email ?? "";
|
|
514
|
+
message.code = object.code ?? "";
|
|
515
|
+
message.userId = object.userId ?? "";
|
|
516
|
+
return message;
|
|
517
|
+
},
|
|
518
|
+
};
|
|
519
|
+
|
|
520
|
+
function createBaseConfirmEmailChangeResponse(): ConfirmEmailChangeResponse {
|
|
521
|
+
return { ok: false };
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export const ConfirmEmailChangeResponse: MessageFns<ConfirmEmailChangeResponse> = {
|
|
525
|
+
encode(message: ConfirmEmailChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
526
|
+
if (message.ok !== false) {
|
|
527
|
+
writer.uint32(8).bool(message.ok);
|
|
528
|
+
}
|
|
529
|
+
return writer;
|
|
530
|
+
},
|
|
531
|
+
|
|
532
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmEmailChangeResponse {
|
|
533
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
534
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
535
|
+
const message = createBaseConfirmEmailChangeResponse();
|
|
536
|
+
while (reader.pos < end) {
|
|
537
|
+
const tag = reader.uint32();
|
|
538
|
+
switch (tag >>> 3) {
|
|
539
|
+
case 1: {
|
|
540
|
+
if (tag !== 8) {
|
|
541
|
+
break;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
message.ok = reader.bool();
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
549
|
+
break;
|
|
550
|
+
}
|
|
551
|
+
reader.skip(tag & 7);
|
|
552
|
+
}
|
|
553
|
+
return message;
|
|
554
|
+
},
|
|
555
|
+
|
|
556
|
+
fromJSON(object: any): ConfirmEmailChangeResponse {
|
|
557
|
+
return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
|
|
558
|
+
},
|
|
559
|
+
|
|
560
|
+
toJSON(message: ConfirmEmailChangeResponse): unknown {
|
|
561
|
+
const obj: any = {};
|
|
562
|
+
if (message.ok !== false) {
|
|
563
|
+
obj.ok = message.ok;
|
|
564
|
+
}
|
|
565
|
+
return obj;
|
|
566
|
+
},
|
|
567
|
+
|
|
568
|
+
create<I extends Exact<DeepPartial<ConfirmEmailChangeResponse>, I>>(base?: I): ConfirmEmailChangeResponse {
|
|
569
|
+
return ConfirmEmailChangeResponse.fromPartial(base ?? ({} as any));
|
|
570
|
+
},
|
|
571
|
+
fromPartial<I extends Exact<DeepPartial<ConfirmEmailChangeResponse>, I>>(object: I): ConfirmEmailChangeResponse {
|
|
572
|
+
const message = createBaseConfirmEmailChangeResponse();
|
|
573
|
+
message.ok = object.ok ?? false;
|
|
574
|
+
return message;
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
function createBaseInitPhoneChangeRequest(): InitPhoneChangeRequest {
|
|
579
|
+
return { phone: "", userId: "" };
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export const InitPhoneChangeRequest: MessageFns<InitPhoneChangeRequest> = {
|
|
583
|
+
encode(message: InitPhoneChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
584
|
+
if (message.phone !== "") {
|
|
585
|
+
writer.uint32(10).string(message.phone);
|
|
586
|
+
}
|
|
587
|
+
if (message.userId !== "") {
|
|
588
|
+
writer.uint32(18).string(message.userId);
|
|
589
|
+
}
|
|
590
|
+
return writer;
|
|
591
|
+
},
|
|
592
|
+
|
|
593
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitPhoneChangeRequest {
|
|
594
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
595
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
596
|
+
const message = createBaseInitPhoneChangeRequest();
|
|
597
|
+
while (reader.pos < end) {
|
|
598
|
+
const tag = reader.uint32();
|
|
599
|
+
switch (tag >>> 3) {
|
|
600
|
+
case 1: {
|
|
601
|
+
if (tag !== 10) {
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
message.phone = reader.string();
|
|
606
|
+
continue;
|
|
607
|
+
}
|
|
608
|
+
case 2: {
|
|
609
|
+
if (tag !== 18) {
|
|
610
|
+
break;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
message.userId = reader.string();
|
|
614
|
+
continue;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
618
|
+
break;
|
|
619
|
+
}
|
|
620
|
+
reader.skip(tag & 7);
|
|
621
|
+
}
|
|
622
|
+
return message;
|
|
623
|
+
},
|
|
624
|
+
|
|
625
|
+
fromJSON(object: any): InitPhoneChangeRequest {
|
|
626
|
+
return {
|
|
627
|
+
phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
|
|
628
|
+
userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
|
|
629
|
+
};
|
|
630
|
+
},
|
|
631
|
+
|
|
632
|
+
toJSON(message: InitPhoneChangeRequest): unknown {
|
|
633
|
+
const obj: any = {};
|
|
634
|
+
if (message.phone !== "") {
|
|
635
|
+
obj.phone = message.phone;
|
|
636
|
+
}
|
|
637
|
+
if (message.userId !== "") {
|
|
638
|
+
obj.userId = message.userId;
|
|
639
|
+
}
|
|
640
|
+
return obj;
|
|
641
|
+
},
|
|
642
|
+
|
|
643
|
+
create<I extends Exact<DeepPartial<InitPhoneChangeRequest>, I>>(base?: I): InitPhoneChangeRequest {
|
|
644
|
+
return InitPhoneChangeRequest.fromPartial(base ?? ({} as any));
|
|
645
|
+
},
|
|
646
|
+
fromPartial<I extends Exact<DeepPartial<InitPhoneChangeRequest>, I>>(object: I): InitPhoneChangeRequest {
|
|
647
|
+
const message = createBaseInitPhoneChangeRequest();
|
|
648
|
+
message.phone = object.phone ?? "";
|
|
649
|
+
message.userId = object.userId ?? "";
|
|
650
|
+
return message;
|
|
651
|
+
},
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
function createBaseInitPhoneChangeResponse(): InitPhoneChangeResponse {
|
|
655
|
+
return { ok: false };
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export const InitPhoneChangeResponse: MessageFns<InitPhoneChangeResponse> = {
|
|
659
|
+
encode(message: InitPhoneChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
660
|
+
if (message.ok !== false) {
|
|
661
|
+
writer.uint32(8).bool(message.ok);
|
|
662
|
+
}
|
|
663
|
+
return writer;
|
|
664
|
+
},
|
|
665
|
+
|
|
666
|
+
decode(input: BinaryReader | Uint8Array, length?: number): InitPhoneChangeResponse {
|
|
667
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
668
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
669
|
+
const message = createBaseInitPhoneChangeResponse();
|
|
670
|
+
while (reader.pos < end) {
|
|
671
|
+
const tag = reader.uint32();
|
|
672
|
+
switch (tag >>> 3) {
|
|
673
|
+
case 1: {
|
|
674
|
+
if (tag !== 8) {
|
|
675
|
+
break;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
message.ok = reader.bool();
|
|
679
|
+
continue;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
reader.skip(tag & 7);
|
|
686
|
+
}
|
|
687
|
+
return message;
|
|
688
|
+
},
|
|
689
|
+
|
|
690
|
+
fromJSON(object: any): InitPhoneChangeResponse {
|
|
691
|
+
return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
|
|
692
|
+
},
|
|
693
|
+
|
|
694
|
+
toJSON(message: InitPhoneChangeResponse): unknown {
|
|
695
|
+
const obj: any = {};
|
|
696
|
+
if (message.ok !== false) {
|
|
697
|
+
obj.ok = message.ok;
|
|
698
|
+
}
|
|
699
|
+
return obj;
|
|
700
|
+
},
|
|
701
|
+
|
|
702
|
+
create<I extends Exact<DeepPartial<InitPhoneChangeResponse>, I>>(base?: I): InitPhoneChangeResponse {
|
|
703
|
+
return InitPhoneChangeResponse.fromPartial(base ?? ({} as any));
|
|
704
|
+
},
|
|
705
|
+
fromPartial<I extends Exact<DeepPartial<InitPhoneChangeResponse>, I>>(object: I): InitPhoneChangeResponse {
|
|
706
|
+
const message = createBaseInitPhoneChangeResponse();
|
|
707
|
+
message.ok = object.ok ?? false;
|
|
708
|
+
return message;
|
|
709
|
+
},
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
function createBaseConfirmPhoneChangeRequest(): ConfirmPhoneChangeRequest {
|
|
713
|
+
return { phone: "", code: "", userId: "" };
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
export const ConfirmPhoneChangeRequest: MessageFns<ConfirmPhoneChangeRequest> = {
|
|
717
|
+
encode(message: ConfirmPhoneChangeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
718
|
+
if (message.phone !== "") {
|
|
719
|
+
writer.uint32(10).string(message.phone);
|
|
720
|
+
}
|
|
721
|
+
if (message.code !== "") {
|
|
722
|
+
writer.uint32(18).string(message.code);
|
|
723
|
+
}
|
|
724
|
+
if (message.userId !== "") {
|
|
725
|
+
writer.uint32(26).string(message.userId);
|
|
726
|
+
}
|
|
727
|
+
return writer;
|
|
728
|
+
},
|
|
729
|
+
|
|
730
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmPhoneChangeRequest {
|
|
731
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
732
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
733
|
+
const message = createBaseConfirmPhoneChangeRequest();
|
|
734
|
+
while (reader.pos < end) {
|
|
735
|
+
const tag = reader.uint32();
|
|
736
|
+
switch (tag >>> 3) {
|
|
737
|
+
case 1: {
|
|
738
|
+
if (tag !== 10) {
|
|
739
|
+
break;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
message.phone = reader.string();
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
case 2: {
|
|
746
|
+
if (tag !== 18) {
|
|
747
|
+
break;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
message.code = reader.string();
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
case 3: {
|
|
754
|
+
if (tag !== 26) {
|
|
755
|
+
break;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
message.userId = reader.string();
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
763
|
+
break;
|
|
764
|
+
}
|
|
765
|
+
reader.skip(tag & 7);
|
|
766
|
+
}
|
|
767
|
+
return message;
|
|
768
|
+
},
|
|
769
|
+
|
|
770
|
+
fromJSON(object: any): ConfirmPhoneChangeRequest {
|
|
771
|
+
return {
|
|
772
|
+
phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
|
|
773
|
+
code: isSet(object.code) ? globalThis.String(object.code) : "",
|
|
774
|
+
userId: isSet(object.userId) ? globalThis.String(object.userId) : "",
|
|
775
|
+
};
|
|
776
|
+
},
|
|
777
|
+
|
|
778
|
+
toJSON(message: ConfirmPhoneChangeRequest): unknown {
|
|
779
|
+
const obj: any = {};
|
|
780
|
+
if (message.phone !== "") {
|
|
781
|
+
obj.phone = message.phone;
|
|
782
|
+
}
|
|
783
|
+
if (message.code !== "") {
|
|
784
|
+
obj.code = message.code;
|
|
785
|
+
}
|
|
786
|
+
if (message.userId !== "") {
|
|
787
|
+
obj.userId = message.userId;
|
|
788
|
+
}
|
|
789
|
+
return obj;
|
|
790
|
+
},
|
|
791
|
+
|
|
792
|
+
create<I extends Exact<DeepPartial<ConfirmPhoneChangeRequest>, I>>(base?: I): ConfirmPhoneChangeRequest {
|
|
793
|
+
return ConfirmPhoneChangeRequest.fromPartial(base ?? ({} as any));
|
|
794
|
+
},
|
|
795
|
+
fromPartial<I extends Exact<DeepPartial<ConfirmPhoneChangeRequest>, I>>(object: I): ConfirmPhoneChangeRequest {
|
|
796
|
+
const message = createBaseConfirmPhoneChangeRequest();
|
|
797
|
+
message.phone = object.phone ?? "";
|
|
798
|
+
message.code = object.code ?? "";
|
|
799
|
+
message.userId = object.userId ?? "";
|
|
800
|
+
return message;
|
|
801
|
+
},
|
|
802
|
+
};
|
|
803
|
+
|
|
804
|
+
function createBaseConfirmPhoneChangeResponse(): ConfirmPhoneChangeResponse {
|
|
805
|
+
return { ok: false };
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
export const ConfirmPhoneChangeResponse: MessageFns<ConfirmPhoneChangeResponse> = {
|
|
809
|
+
encode(message: ConfirmPhoneChangeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
810
|
+
if (message.ok !== false) {
|
|
811
|
+
writer.uint32(8).bool(message.ok);
|
|
812
|
+
}
|
|
813
|
+
return writer;
|
|
814
|
+
},
|
|
815
|
+
|
|
816
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ConfirmPhoneChangeResponse {
|
|
817
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
818
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
819
|
+
const message = createBaseConfirmPhoneChangeResponse();
|
|
820
|
+
while (reader.pos < end) {
|
|
821
|
+
const tag = reader.uint32();
|
|
822
|
+
switch (tag >>> 3) {
|
|
823
|
+
case 1: {
|
|
824
|
+
if (tag !== 8) {
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
message.ok = reader.bool();
|
|
829
|
+
continue;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
reader.skip(tag & 7);
|
|
836
|
+
}
|
|
837
|
+
return message;
|
|
838
|
+
},
|
|
839
|
+
|
|
840
|
+
fromJSON(object: any): ConfirmPhoneChangeResponse {
|
|
841
|
+
return { ok: isSet(object.ok) ? globalThis.Boolean(object.ok) : false };
|
|
842
|
+
},
|
|
843
|
+
|
|
844
|
+
toJSON(message: ConfirmPhoneChangeResponse): unknown {
|
|
845
|
+
const obj: any = {};
|
|
846
|
+
if (message.ok !== false) {
|
|
847
|
+
obj.ok = message.ok;
|
|
848
|
+
}
|
|
849
|
+
return obj;
|
|
850
|
+
},
|
|
851
|
+
|
|
852
|
+
create<I extends Exact<DeepPartial<ConfirmPhoneChangeResponse>, I>>(base?: I): ConfirmPhoneChangeResponse {
|
|
853
|
+
return ConfirmPhoneChangeResponse.fromPartial(base ?? ({} as any));
|
|
854
|
+
},
|
|
855
|
+
fromPartial<I extends Exact<DeepPartial<ConfirmPhoneChangeResponse>, I>>(object: I): ConfirmPhoneChangeResponse {
|
|
856
|
+
const message = createBaseConfirmPhoneChangeResponse();
|
|
857
|
+
message.ok = object.ok ?? false;
|
|
858
|
+
return message;
|
|
859
|
+
},
|
|
860
|
+
};
|
|
861
|
+
|
|
862
|
+
export interface AccountService {
|
|
863
|
+
GetAccount(request: GetAccountRequest): Promise<GetAccountResponse>;
|
|
864
|
+
InitEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse>;
|
|
865
|
+
ConfirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse>;
|
|
866
|
+
InitPhoneChange(request: InitPhoneChangeRequest): Promise<InitPhoneChangeResponse>;
|
|
867
|
+
ConfirmPhoneChange(request: ConfirmPhoneChangeRequest): Promise<ConfirmPhoneChangeResponse>;
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
export const AccountServiceServiceName = "account.v1.AccountService";
|
|
871
|
+
export class AccountServiceClientImpl implements AccountService {
|
|
872
|
+
private readonly rpc: Rpc;
|
|
873
|
+
private readonly service: string;
|
|
874
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
875
|
+
this.service = opts?.service || AccountServiceServiceName;
|
|
876
|
+
this.rpc = rpc;
|
|
877
|
+
this.GetAccount = this.GetAccount.bind(this);
|
|
878
|
+
this.InitEmailChange = this.InitEmailChange.bind(this);
|
|
879
|
+
this.ConfirmEmailChange = this.ConfirmEmailChange.bind(this);
|
|
880
|
+
this.InitPhoneChange = this.InitPhoneChange.bind(this);
|
|
881
|
+
this.ConfirmPhoneChange = this.ConfirmPhoneChange.bind(this);
|
|
882
|
+
}
|
|
883
|
+
GetAccount(request: GetAccountRequest): Promise<GetAccountResponse> {
|
|
884
|
+
const data = GetAccountRequest.encode(request).finish();
|
|
885
|
+
const promise = this.rpc.request(this.service, "GetAccount", data);
|
|
886
|
+
return promise.then((data) => GetAccountResponse.decode(new BinaryReader(data)));
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
InitEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse> {
|
|
890
|
+
const data = InitEmailChangeRequest.encode(request).finish();
|
|
891
|
+
const promise = this.rpc.request(this.service, "InitEmailChange", data);
|
|
892
|
+
return promise.then((data) => InitEmailChangeResponse.decode(new BinaryReader(data)));
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
ConfirmEmailChange(request: ConfirmEmailChangeRequest): Promise<ConfirmEmailChangeResponse> {
|
|
896
|
+
const data = ConfirmEmailChangeRequest.encode(request).finish();
|
|
897
|
+
const promise = this.rpc.request(this.service, "ConfirmEmailChange", data);
|
|
898
|
+
return promise.then((data) => ConfirmEmailChangeResponse.decode(new BinaryReader(data)));
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
InitPhoneChange(request: InitPhoneChangeRequest): Promise<InitPhoneChangeResponse> {
|
|
902
|
+
const data = InitPhoneChangeRequest.encode(request).finish();
|
|
903
|
+
const promise = this.rpc.request(this.service, "InitPhoneChange", data);
|
|
904
|
+
return promise.then((data) => InitPhoneChangeResponse.decode(new BinaryReader(data)));
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
ConfirmPhoneChange(request: ConfirmPhoneChangeRequest): Promise<ConfirmPhoneChangeResponse> {
|
|
908
|
+
const data = ConfirmPhoneChangeRequest.encode(request).finish();
|
|
909
|
+
const promise = this.rpc.request(this.service, "ConfirmPhoneChange", data);
|
|
910
|
+
return promise.then((data) => ConfirmPhoneChangeResponse.decode(new BinaryReader(data)));
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
interface Rpc {
|
|
915
|
+
request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
919
|
+
|
|
920
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
921
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
922
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
923
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
924
|
+
: Partial<T>;
|
|
925
|
+
|
|
926
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
927
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
928
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
929
|
+
|
|
930
|
+
function isSet(value: any): boolean {
|
|
931
|
+
return value !== null && value !== undefined;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
export interface MessageFns<T> {
|
|
935
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
936
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
937
|
+
fromJSON(object: any): T;
|
|
938
|
+
toJSON(message: T): unknown;
|
|
939
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
940
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
941
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
service AccountService {
|
|
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
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetAccountRequest {
|
|
16
|
+
string id = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetAccountResponse {
|
|
20
|
+
string id = 1;
|
|
21
|
+
string phone = 2;
|
|
22
|
+
string email = 3;
|
|
23
|
+
|
|
24
|
+
bool is_phone_verified = 4;
|
|
25
|
+
bool is_email_verified = 5;
|
|
26
|
+
|
|
27
|
+
Role role = 6;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message InitEmailChangeRequest {
|
|
31
|
+
string email = 1;
|
|
32
|
+
string user_id = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message InitEmailChangeResponse {
|
|
36
|
+
bool ok = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message ConfirmEmailChangeRequest {
|
|
40
|
+
string email = 1;
|
|
41
|
+
string code = 2;
|
|
42
|
+
string user_id = 3;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message ConfirmEmailChangeResponse {
|
|
46
|
+
bool ok = 1;
|
|
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
|
+
|
|
68
|
+
enum Role {
|
|
69
|
+
USER = 0;
|
|
70
|
+
ADMIN = 1;
|
|
71
|
+
}
|