@sa2-movie-ticket/contracts 1.0.8 → 1.0.9
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/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/gen/ts/account.ts +659 -0
- package/gen/ts/google/protobuf/empty.ts +86 -0
- package/gen/ts/google/protobuf/field_mask.ts +311 -0
- package/gen/ts/google/protobuf/timestamp.ts +221 -0
- package/package.json +2 -1
- package/proto/account.proto +57 -0
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var path=require('path');var t={AUTH:path.join(__dirname,"../../proto/auth.proto")};exports.GRPC_PROTO_PATH=t;
|
|
1
|
+
'use strict';var path=require('path');var t={AUTH:path.join(__dirname,"../../proto/auth.proto"),ACCOUNT:path.join(__dirname,"../../proto/account.proto")};exports.GRPC_PROTO_PATH=t;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {join}from'path';var t={AUTH:join(__dirname,"../../proto/auth.proto")};export{t as GRPC_PROTO_PATH};
|
|
1
|
+
import {join}from'path';var t={AUTH:join(__dirname,"../../proto/auth.proto"),ACCOUNT:join(__dirname,"../../proto/account.proto")};export{t as GRPC_PROTO_PATH};
|
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v4.23.4
|
|
5
|
+
// source: account.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
import {
|
|
10
|
+
type CallOptions,
|
|
11
|
+
type ChannelCredentials,
|
|
12
|
+
Client,
|
|
13
|
+
type ClientOptions,
|
|
14
|
+
type ClientUnaryCall,
|
|
15
|
+
type handleUnaryCall,
|
|
16
|
+
makeGenericClientConstructor,
|
|
17
|
+
type Metadata,
|
|
18
|
+
type ServiceError,
|
|
19
|
+
type UntypedServiceImplementation,
|
|
20
|
+
} from "@grpc/grpc-js";
|
|
21
|
+
import { Empty } from "./google/protobuf/empty";
|
|
22
|
+
import { FieldMask } from "./google/protobuf/field_mask";
|
|
23
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
24
|
+
|
|
25
|
+
export const protobufPackage = "account.v1";
|
|
26
|
+
|
|
27
|
+
export enum Role {
|
|
28
|
+
/** ROLE_UNSPECIFIED - Best practice: always have an unspecified default */
|
|
29
|
+
ROLE_UNSPECIFIED = 0,
|
|
30
|
+
ROLE_USER = 1,
|
|
31
|
+
ROLE_MODERATOR = 2,
|
|
32
|
+
ROLE_MANAGER = 3,
|
|
33
|
+
ROLE_ADMIN = 4,
|
|
34
|
+
ROLE_SUPER_ADMIN = 5,
|
|
35
|
+
UNRECOGNIZED = -1,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function roleFromJSON(object: any): Role {
|
|
39
|
+
switch (object) {
|
|
40
|
+
case 0:
|
|
41
|
+
case "ROLE_UNSPECIFIED":
|
|
42
|
+
return Role.ROLE_UNSPECIFIED;
|
|
43
|
+
case 1:
|
|
44
|
+
case "ROLE_USER":
|
|
45
|
+
return Role.ROLE_USER;
|
|
46
|
+
case 2:
|
|
47
|
+
case "ROLE_MODERATOR":
|
|
48
|
+
return Role.ROLE_MODERATOR;
|
|
49
|
+
case 3:
|
|
50
|
+
case "ROLE_MANAGER":
|
|
51
|
+
return Role.ROLE_MANAGER;
|
|
52
|
+
case 4:
|
|
53
|
+
case "ROLE_ADMIN":
|
|
54
|
+
return Role.ROLE_ADMIN;
|
|
55
|
+
case 5:
|
|
56
|
+
case "ROLE_SUPER_ADMIN":
|
|
57
|
+
return Role.ROLE_SUPER_ADMIN;
|
|
58
|
+
case -1:
|
|
59
|
+
case "UNRECOGNIZED":
|
|
60
|
+
default:
|
|
61
|
+
return Role.UNRECOGNIZED;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function roleToJSON(object: Role): string {
|
|
66
|
+
switch (object) {
|
|
67
|
+
case Role.ROLE_UNSPECIFIED:
|
|
68
|
+
return "ROLE_UNSPECIFIED";
|
|
69
|
+
case Role.ROLE_USER:
|
|
70
|
+
return "ROLE_USER";
|
|
71
|
+
case Role.ROLE_MODERATOR:
|
|
72
|
+
return "ROLE_MODERATOR";
|
|
73
|
+
case Role.ROLE_MANAGER:
|
|
74
|
+
return "ROLE_MANAGER";
|
|
75
|
+
case Role.ROLE_ADMIN:
|
|
76
|
+
return "ROLE_ADMIN";
|
|
77
|
+
case Role.ROLE_SUPER_ADMIN:
|
|
78
|
+
return "ROLE_SUPER_ADMIN";
|
|
79
|
+
case Role.UNRECOGNIZED:
|
|
80
|
+
default:
|
|
81
|
+
return "UNRECOGNIZED";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface Account {
|
|
86
|
+
id: string;
|
|
87
|
+
email: string;
|
|
88
|
+
phone: string;
|
|
89
|
+
role: Role;
|
|
90
|
+
isPhoneVerified: boolean;
|
|
91
|
+
isEmailVerified: boolean;
|
|
92
|
+
createdAt: Date | undefined;
|
|
93
|
+
updatedAt: Date | undefined;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface GetAccountRequest {
|
|
97
|
+
id: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface UpdateAccountRequest {
|
|
101
|
+
/** The account object containing the new values */
|
|
102
|
+
account:
|
|
103
|
+
| Account
|
|
104
|
+
| undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Specifies which fields in 'account' should be updated.
|
|
107
|
+
* Example: paths: ["email", "phone"]
|
|
108
|
+
*/
|
|
109
|
+
updateMask: string[] | undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface DeleteAccountRequest {
|
|
113
|
+
id: string;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function createBaseAccount(): Account {
|
|
117
|
+
return {
|
|
118
|
+
id: "",
|
|
119
|
+
email: "",
|
|
120
|
+
phone: "",
|
|
121
|
+
role: 0,
|
|
122
|
+
isPhoneVerified: false,
|
|
123
|
+
isEmailVerified: false,
|
|
124
|
+
createdAt: undefined,
|
|
125
|
+
updatedAt: undefined,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const Account: MessageFns<Account> = {
|
|
130
|
+
encode(message: Account, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
131
|
+
if (message.id !== "") {
|
|
132
|
+
writer.uint32(10).string(message.id);
|
|
133
|
+
}
|
|
134
|
+
if (message.email !== "") {
|
|
135
|
+
writer.uint32(18).string(message.email);
|
|
136
|
+
}
|
|
137
|
+
if (message.phone !== "") {
|
|
138
|
+
writer.uint32(26).string(message.phone);
|
|
139
|
+
}
|
|
140
|
+
if (message.role !== 0) {
|
|
141
|
+
writer.uint32(32).int32(message.role);
|
|
142
|
+
}
|
|
143
|
+
if (message.isPhoneVerified !== false) {
|
|
144
|
+
writer.uint32(40).bool(message.isPhoneVerified);
|
|
145
|
+
}
|
|
146
|
+
if (message.isEmailVerified !== false) {
|
|
147
|
+
writer.uint32(48).bool(message.isEmailVerified);
|
|
148
|
+
}
|
|
149
|
+
if (message.createdAt !== undefined) {
|
|
150
|
+
Timestamp.encode(toTimestamp(message.createdAt), writer.uint32(58).fork()).join();
|
|
151
|
+
}
|
|
152
|
+
if (message.updatedAt !== undefined) {
|
|
153
|
+
Timestamp.encode(toTimestamp(message.updatedAt), writer.uint32(66).fork()).join();
|
|
154
|
+
}
|
|
155
|
+
return writer;
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Account {
|
|
159
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
160
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
161
|
+
const message = createBaseAccount();
|
|
162
|
+
while (reader.pos < end) {
|
|
163
|
+
const tag = reader.uint32();
|
|
164
|
+
switch (tag >>> 3) {
|
|
165
|
+
case 1: {
|
|
166
|
+
if (tag !== 10) {
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
message.id = reader.string();
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
case 2: {
|
|
174
|
+
if (tag !== 18) {
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
message.email = reader.string();
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
case 3: {
|
|
182
|
+
if (tag !== 26) {
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
message.phone = reader.string();
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
case 4: {
|
|
190
|
+
if (tag !== 32) {
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
message.role = reader.int32() as any;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
case 5: {
|
|
198
|
+
if (tag !== 40) {
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
message.isPhoneVerified = reader.bool();
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
case 6: {
|
|
206
|
+
if (tag !== 48) {
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
message.isEmailVerified = reader.bool();
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
case 7: {
|
|
214
|
+
if (tag !== 58) {
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
message.createdAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
case 8: {
|
|
222
|
+
if (tag !== 66) {
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
message.updatedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
reader.skip(tag & 7);
|
|
234
|
+
}
|
|
235
|
+
return message;
|
|
236
|
+
},
|
|
237
|
+
|
|
238
|
+
fromJSON(object: any): Account {
|
|
239
|
+
return {
|
|
240
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
241
|
+
email: isSet(object.email) ? globalThis.String(object.email) : "",
|
|
242
|
+
phone: isSet(object.phone) ? globalThis.String(object.phone) : "",
|
|
243
|
+
role: isSet(object.role) ? roleFromJSON(object.role) : 0,
|
|
244
|
+
isPhoneVerified: isSet(object.isPhoneVerified)
|
|
245
|
+
? globalThis.Boolean(object.isPhoneVerified)
|
|
246
|
+
: isSet(object.is_phone_verified)
|
|
247
|
+
? globalThis.Boolean(object.is_phone_verified)
|
|
248
|
+
: false,
|
|
249
|
+
isEmailVerified: isSet(object.isEmailVerified)
|
|
250
|
+
? globalThis.Boolean(object.isEmailVerified)
|
|
251
|
+
: isSet(object.is_email_verified)
|
|
252
|
+
? globalThis.Boolean(object.is_email_verified)
|
|
253
|
+
: false,
|
|
254
|
+
createdAt: isSet(object.createdAt)
|
|
255
|
+
? fromJsonTimestamp(object.createdAt)
|
|
256
|
+
: isSet(object.created_at)
|
|
257
|
+
? fromJsonTimestamp(object.created_at)
|
|
258
|
+
: undefined,
|
|
259
|
+
updatedAt: isSet(object.updatedAt)
|
|
260
|
+
? fromJsonTimestamp(object.updatedAt)
|
|
261
|
+
: isSet(object.updated_at)
|
|
262
|
+
? fromJsonTimestamp(object.updated_at)
|
|
263
|
+
: undefined,
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
toJSON(message: Account): unknown {
|
|
268
|
+
const obj: any = {};
|
|
269
|
+
if (message.id !== "") {
|
|
270
|
+
obj.id = message.id;
|
|
271
|
+
}
|
|
272
|
+
if (message.email !== "") {
|
|
273
|
+
obj.email = message.email;
|
|
274
|
+
}
|
|
275
|
+
if (message.phone !== "") {
|
|
276
|
+
obj.phone = message.phone;
|
|
277
|
+
}
|
|
278
|
+
if (message.role !== 0) {
|
|
279
|
+
obj.role = roleToJSON(message.role);
|
|
280
|
+
}
|
|
281
|
+
if (message.isPhoneVerified !== false) {
|
|
282
|
+
obj.isPhoneVerified = message.isPhoneVerified;
|
|
283
|
+
}
|
|
284
|
+
if (message.isEmailVerified !== false) {
|
|
285
|
+
obj.isEmailVerified = message.isEmailVerified;
|
|
286
|
+
}
|
|
287
|
+
if (message.createdAt !== undefined) {
|
|
288
|
+
obj.createdAt = message.createdAt.toISOString();
|
|
289
|
+
}
|
|
290
|
+
if (message.updatedAt !== undefined) {
|
|
291
|
+
obj.updatedAt = message.updatedAt.toISOString();
|
|
292
|
+
}
|
|
293
|
+
return obj;
|
|
294
|
+
},
|
|
295
|
+
|
|
296
|
+
create<I extends Exact<DeepPartial<Account>, I>>(base?: I): Account {
|
|
297
|
+
return Account.fromPartial(base ?? ({} as any));
|
|
298
|
+
},
|
|
299
|
+
fromPartial<I extends Exact<DeepPartial<Account>, I>>(object: I): Account {
|
|
300
|
+
const message = createBaseAccount();
|
|
301
|
+
message.id = object.id ?? "";
|
|
302
|
+
message.email = object.email ?? "";
|
|
303
|
+
message.phone = object.phone ?? "";
|
|
304
|
+
message.role = object.role ?? 0;
|
|
305
|
+
message.isPhoneVerified = object.isPhoneVerified ?? false;
|
|
306
|
+
message.isEmailVerified = object.isEmailVerified ?? false;
|
|
307
|
+
message.createdAt = object.createdAt ?? undefined;
|
|
308
|
+
message.updatedAt = object.updatedAt ?? undefined;
|
|
309
|
+
return message;
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
function createBaseGetAccountRequest(): GetAccountRequest {
|
|
314
|
+
return { id: "" };
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export const GetAccountRequest: MessageFns<GetAccountRequest> = {
|
|
318
|
+
encode(message: GetAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
319
|
+
if (message.id !== "") {
|
|
320
|
+
writer.uint32(10).string(message.id);
|
|
321
|
+
}
|
|
322
|
+
return writer;
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetAccountRequest {
|
|
326
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
327
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
328
|
+
const message = createBaseGetAccountRequest();
|
|
329
|
+
while (reader.pos < end) {
|
|
330
|
+
const tag = reader.uint32();
|
|
331
|
+
switch (tag >>> 3) {
|
|
332
|
+
case 1: {
|
|
333
|
+
if (tag !== 10) {
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
message.id = reader.string();
|
|
338
|
+
continue;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
reader.skip(tag & 7);
|
|
345
|
+
}
|
|
346
|
+
return message;
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
fromJSON(object: any): GetAccountRequest {
|
|
350
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
toJSON(message: GetAccountRequest): unknown {
|
|
354
|
+
const obj: any = {};
|
|
355
|
+
if (message.id !== "") {
|
|
356
|
+
obj.id = message.id;
|
|
357
|
+
}
|
|
358
|
+
return obj;
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
create<I extends Exact<DeepPartial<GetAccountRequest>, I>>(base?: I): GetAccountRequest {
|
|
362
|
+
return GetAccountRequest.fromPartial(base ?? ({} as any));
|
|
363
|
+
},
|
|
364
|
+
fromPartial<I extends Exact<DeepPartial<GetAccountRequest>, I>>(object: I): GetAccountRequest {
|
|
365
|
+
const message = createBaseGetAccountRequest();
|
|
366
|
+
message.id = object.id ?? "";
|
|
367
|
+
return message;
|
|
368
|
+
},
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
function createBaseUpdateAccountRequest(): UpdateAccountRequest {
|
|
372
|
+
return { account: undefined, updateMask: undefined };
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export const UpdateAccountRequest: MessageFns<UpdateAccountRequest> = {
|
|
376
|
+
encode(message: UpdateAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
377
|
+
if (message.account !== undefined) {
|
|
378
|
+
Account.encode(message.account, writer.uint32(10).fork()).join();
|
|
379
|
+
}
|
|
380
|
+
if (message.updateMask !== undefined) {
|
|
381
|
+
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
|
|
382
|
+
}
|
|
383
|
+
return writer;
|
|
384
|
+
},
|
|
385
|
+
|
|
386
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UpdateAccountRequest {
|
|
387
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
388
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
389
|
+
const message = createBaseUpdateAccountRequest();
|
|
390
|
+
while (reader.pos < end) {
|
|
391
|
+
const tag = reader.uint32();
|
|
392
|
+
switch (tag >>> 3) {
|
|
393
|
+
case 1: {
|
|
394
|
+
if (tag !== 10) {
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
message.account = Account.decode(reader, reader.uint32());
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
case 2: {
|
|
402
|
+
if (tag !== 18) {
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
|
|
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
|
+
fromJSON(object: any): UpdateAccountRequest {
|
|
419
|
+
return {
|
|
420
|
+
account: isSet(object.account) ? Account.fromJSON(object.account) : undefined,
|
|
421
|
+
updateMask: isSet(object.updateMask)
|
|
422
|
+
? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask))
|
|
423
|
+
: isSet(object.update_mask)
|
|
424
|
+
? FieldMask.unwrap(FieldMask.fromJSON(object.update_mask))
|
|
425
|
+
: undefined,
|
|
426
|
+
};
|
|
427
|
+
},
|
|
428
|
+
|
|
429
|
+
toJSON(message: UpdateAccountRequest): unknown {
|
|
430
|
+
const obj: any = {};
|
|
431
|
+
if (message.account !== undefined) {
|
|
432
|
+
obj.account = Account.toJSON(message.account);
|
|
433
|
+
}
|
|
434
|
+
if (message.updateMask !== undefined) {
|
|
435
|
+
obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
|
|
436
|
+
}
|
|
437
|
+
return obj;
|
|
438
|
+
},
|
|
439
|
+
|
|
440
|
+
create<I extends Exact<DeepPartial<UpdateAccountRequest>, I>>(base?: I): UpdateAccountRequest {
|
|
441
|
+
return UpdateAccountRequest.fromPartial(base ?? ({} as any));
|
|
442
|
+
},
|
|
443
|
+
fromPartial<I extends Exact<DeepPartial<UpdateAccountRequest>, I>>(object: I): UpdateAccountRequest {
|
|
444
|
+
const message = createBaseUpdateAccountRequest();
|
|
445
|
+
message.account = (object.account !== undefined && object.account !== null)
|
|
446
|
+
? Account.fromPartial(object.account)
|
|
447
|
+
: undefined;
|
|
448
|
+
message.updateMask = object.updateMask ?? undefined;
|
|
449
|
+
return message;
|
|
450
|
+
},
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
function createBaseDeleteAccountRequest(): DeleteAccountRequest {
|
|
454
|
+
return { id: "" };
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
export const DeleteAccountRequest: MessageFns<DeleteAccountRequest> = {
|
|
458
|
+
encode(message: DeleteAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
459
|
+
if (message.id !== "") {
|
|
460
|
+
writer.uint32(10).string(message.id);
|
|
461
|
+
}
|
|
462
|
+
return writer;
|
|
463
|
+
},
|
|
464
|
+
|
|
465
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DeleteAccountRequest {
|
|
466
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
467
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
468
|
+
const message = createBaseDeleteAccountRequest();
|
|
469
|
+
while (reader.pos < end) {
|
|
470
|
+
const tag = reader.uint32();
|
|
471
|
+
switch (tag >>> 3) {
|
|
472
|
+
case 1: {
|
|
473
|
+
if (tag !== 10) {
|
|
474
|
+
break;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
message.id = reader.string();
|
|
478
|
+
continue;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
reader.skip(tag & 7);
|
|
485
|
+
}
|
|
486
|
+
return message;
|
|
487
|
+
},
|
|
488
|
+
|
|
489
|
+
fromJSON(object: any): DeleteAccountRequest {
|
|
490
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
491
|
+
},
|
|
492
|
+
|
|
493
|
+
toJSON(message: DeleteAccountRequest): unknown {
|
|
494
|
+
const obj: any = {};
|
|
495
|
+
if (message.id !== "") {
|
|
496
|
+
obj.id = message.id;
|
|
497
|
+
}
|
|
498
|
+
return obj;
|
|
499
|
+
},
|
|
500
|
+
|
|
501
|
+
create<I extends Exact<DeepPartial<DeleteAccountRequest>, I>>(base?: I): DeleteAccountRequest {
|
|
502
|
+
return DeleteAccountRequest.fromPartial(base ?? ({} as any));
|
|
503
|
+
},
|
|
504
|
+
fromPartial<I extends Exact<DeepPartial<DeleteAccountRequest>, I>>(object: I): DeleteAccountRequest {
|
|
505
|
+
const message = createBaseDeleteAccountRequest();
|
|
506
|
+
message.id = object.id ?? "";
|
|
507
|
+
return message;
|
|
508
|
+
},
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
export type AccountServiceService = typeof AccountServiceService;
|
|
512
|
+
export const AccountServiceService = {
|
|
513
|
+
/** Retrieves a specific account by ID */
|
|
514
|
+
getAccount: {
|
|
515
|
+
path: "/account.v1.AccountService/GetAccount",
|
|
516
|
+
requestStream: false,
|
|
517
|
+
responseStream: false,
|
|
518
|
+
requestSerialize: (value: GetAccountRequest): Buffer => Buffer.from(GetAccountRequest.encode(value).finish()),
|
|
519
|
+
requestDeserialize: (value: Buffer): GetAccountRequest => GetAccountRequest.decode(value),
|
|
520
|
+
responseSerialize: (value: Account): Buffer => Buffer.from(Account.encode(value).finish()),
|
|
521
|
+
responseDeserialize: (value: Buffer): Account => Account.decode(value),
|
|
522
|
+
},
|
|
523
|
+
/** Updates specific fields of an account using a FieldMask */
|
|
524
|
+
updateAccount: {
|
|
525
|
+
path: "/account.v1.AccountService/UpdateAccount",
|
|
526
|
+
requestStream: false,
|
|
527
|
+
responseStream: false,
|
|
528
|
+
requestSerialize: (value: UpdateAccountRequest): Buffer => Buffer.from(UpdateAccountRequest.encode(value).finish()),
|
|
529
|
+
requestDeserialize: (value: Buffer): UpdateAccountRequest => UpdateAccountRequest.decode(value),
|
|
530
|
+
responseSerialize: (value: Account): Buffer => Buffer.from(Account.encode(value).finish()),
|
|
531
|
+
responseDeserialize: (value: Buffer): Account => Account.decode(value),
|
|
532
|
+
},
|
|
533
|
+
/** Deletes an account and returns an empty response on success */
|
|
534
|
+
deleteAccount: {
|
|
535
|
+
path: "/account.v1.AccountService/DeleteAccount",
|
|
536
|
+
requestStream: false,
|
|
537
|
+
responseStream: false,
|
|
538
|
+
requestSerialize: (value: DeleteAccountRequest): Buffer => Buffer.from(DeleteAccountRequest.encode(value).finish()),
|
|
539
|
+
requestDeserialize: (value: Buffer): DeleteAccountRequest => DeleteAccountRequest.decode(value),
|
|
540
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
541
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
542
|
+
},
|
|
543
|
+
} as const;
|
|
544
|
+
|
|
545
|
+
export interface AccountServiceServer extends UntypedServiceImplementation {
|
|
546
|
+
/** Retrieves a specific account by ID */
|
|
547
|
+
getAccount: handleUnaryCall<GetAccountRequest, Account>;
|
|
548
|
+
/** Updates specific fields of an account using a FieldMask */
|
|
549
|
+
updateAccount: handleUnaryCall<UpdateAccountRequest, Account>;
|
|
550
|
+
/** Deletes an account and returns an empty response on success */
|
|
551
|
+
deleteAccount: handleUnaryCall<DeleteAccountRequest, Empty>;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export interface AccountServiceClient extends Client {
|
|
555
|
+
/** Retrieves a specific account by ID */
|
|
556
|
+
getAccount(
|
|
557
|
+
request: GetAccountRequest,
|
|
558
|
+
callback: (error: ServiceError | null, response: Account) => void,
|
|
559
|
+
): ClientUnaryCall;
|
|
560
|
+
getAccount(
|
|
561
|
+
request: GetAccountRequest,
|
|
562
|
+
metadata: Metadata,
|
|
563
|
+
callback: (error: ServiceError | null, response: Account) => void,
|
|
564
|
+
): ClientUnaryCall;
|
|
565
|
+
getAccount(
|
|
566
|
+
request: GetAccountRequest,
|
|
567
|
+
metadata: Metadata,
|
|
568
|
+
options: Partial<CallOptions>,
|
|
569
|
+
callback: (error: ServiceError | null, response: Account) => void,
|
|
570
|
+
): ClientUnaryCall;
|
|
571
|
+
/** Updates specific fields of an account using a FieldMask */
|
|
572
|
+
updateAccount(
|
|
573
|
+
request: UpdateAccountRequest,
|
|
574
|
+
callback: (error: ServiceError | null, response: Account) => void,
|
|
575
|
+
): ClientUnaryCall;
|
|
576
|
+
updateAccount(
|
|
577
|
+
request: UpdateAccountRequest,
|
|
578
|
+
metadata: Metadata,
|
|
579
|
+
callback: (error: ServiceError | null, response: Account) => void,
|
|
580
|
+
): ClientUnaryCall;
|
|
581
|
+
updateAccount(
|
|
582
|
+
request: UpdateAccountRequest,
|
|
583
|
+
metadata: Metadata,
|
|
584
|
+
options: Partial<CallOptions>,
|
|
585
|
+
callback: (error: ServiceError | null, response: Account) => void,
|
|
586
|
+
): ClientUnaryCall;
|
|
587
|
+
/** Deletes an account and returns an empty response on success */
|
|
588
|
+
deleteAccount(
|
|
589
|
+
request: DeleteAccountRequest,
|
|
590
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
591
|
+
): ClientUnaryCall;
|
|
592
|
+
deleteAccount(
|
|
593
|
+
request: DeleteAccountRequest,
|
|
594
|
+
metadata: Metadata,
|
|
595
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
596
|
+
): ClientUnaryCall;
|
|
597
|
+
deleteAccount(
|
|
598
|
+
request: DeleteAccountRequest,
|
|
599
|
+
metadata: Metadata,
|
|
600
|
+
options: Partial<CallOptions>,
|
|
601
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
602
|
+
): ClientUnaryCall;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export const AccountServiceClient = makeGenericClientConstructor(
|
|
606
|
+
AccountServiceService,
|
|
607
|
+
"account.v1.AccountService",
|
|
608
|
+
) as unknown as {
|
|
609
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): AccountServiceClient;
|
|
610
|
+
service: typeof AccountServiceService;
|
|
611
|
+
serviceName: string;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
615
|
+
|
|
616
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
617
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
618
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
619
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
620
|
+
: Partial<T>;
|
|
621
|
+
|
|
622
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
623
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
624
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
625
|
+
|
|
626
|
+
function toTimestamp(date: Date): Timestamp {
|
|
627
|
+
const seconds = BigInt(Math.trunc(date.getTime() / 1_000));
|
|
628
|
+
const nanos = (date.getTime() % 1_000) * 1_000_000;
|
|
629
|
+
return { seconds, nanos };
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
function fromTimestamp(t: Timestamp): Date {
|
|
633
|
+
let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1_000;
|
|
634
|
+
millis += (t.nanos || 0) / 1_000_000;
|
|
635
|
+
return new globalThis.Date(millis);
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
function fromJsonTimestamp(o: any): Date {
|
|
639
|
+
if (o instanceof globalThis.Date) {
|
|
640
|
+
return o;
|
|
641
|
+
} else if (typeof o === "string") {
|
|
642
|
+
return new globalThis.Date(o);
|
|
643
|
+
} else {
|
|
644
|
+
return fromTimestamp(Timestamp.fromJSON(o));
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
function isSet(value: any): boolean {
|
|
649
|
+
return value !== null && value !== undefined;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
export interface MessageFns<T> {
|
|
653
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
654
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
655
|
+
fromJSON(object: any): T;
|
|
656
|
+
toJSON(message: T): unknown;
|
|
657
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
658
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
659
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v4.23.4
|
|
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
|
+
function createBaseEmpty(): Empty {
|
|
25
|
+
return {};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const Empty: MessageFns<Empty> = {
|
|
29
|
+
encode(_: Empty, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
30
|
+
return writer;
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Empty {
|
|
34
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
35
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
36
|
+
const message = createBaseEmpty();
|
|
37
|
+
while (reader.pos < end) {
|
|
38
|
+
const tag = reader.uint32();
|
|
39
|
+
switch (tag >>> 3) {
|
|
40
|
+
}
|
|
41
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
reader.skip(tag & 7);
|
|
45
|
+
}
|
|
46
|
+
return message;
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
fromJSON(_: any): Empty {
|
|
50
|
+
return {};
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
toJSON(_: Empty): unknown {
|
|
54
|
+
const obj: any = {};
|
|
55
|
+
return obj;
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
create<I extends Exact<DeepPartial<Empty>, I>>(base?: I): Empty {
|
|
59
|
+
return Empty.fromPartial(base ?? ({} as any));
|
|
60
|
+
},
|
|
61
|
+
fromPartial<I extends Exact<DeepPartial<Empty>, I>>(_: I): Empty {
|
|
62
|
+
const message = createBaseEmpty();
|
|
63
|
+
return message;
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
68
|
+
|
|
69
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
70
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
71
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
72
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
73
|
+
: Partial<T>;
|
|
74
|
+
|
|
75
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
76
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
77
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
78
|
+
|
|
79
|
+
export interface MessageFns<T> {
|
|
80
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
81
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
82
|
+
fromJSON(object: any): T;
|
|
83
|
+
toJSON(message: T): unknown;
|
|
84
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
85
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
86
|
+
}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v4.23.4
|
|
5
|
+
// source: google/protobuf/field_mask.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "google.protobuf";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `FieldMask` represents a set of symbolic field paths, for example:
|
|
14
|
+
*
|
|
15
|
+
* paths: "f.a"
|
|
16
|
+
* paths: "f.b.d"
|
|
17
|
+
*
|
|
18
|
+
* Here `f` represents a field in some root message, `a` and `b`
|
|
19
|
+
* fields in the message found in `f`, and `d` a field found in the
|
|
20
|
+
* message in `f.b`.
|
|
21
|
+
*
|
|
22
|
+
* Field masks are used to specify a subset of fields that should be
|
|
23
|
+
* returned by a get operation or modified by an update operation.
|
|
24
|
+
* Field masks also have a custom JSON encoding (see below).
|
|
25
|
+
*
|
|
26
|
+
* # Field Masks in Projections
|
|
27
|
+
*
|
|
28
|
+
* When used in the context of a projection, a response message or
|
|
29
|
+
* sub-message is filtered by the API to only contain those fields as
|
|
30
|
+
* specified in the mask. For example, if the mask in the previous
|
|
31
|
+
* example is applied to a response message as follows:
|
|
32
|
+
*
|
|
33
|
+
* f {
|
|
34
|
+
* a : 22
|
|
35
|
+
* b {
|
|
36
|
+
* d : 1
|
|
37
|
+
* x : 2
|
|
38
|
+
* }
|
|
39
|
+
* y : 13
|
|
40
|
+
* }
|
|
41
|
+
* z: 8
|
|
42
|
+
*
|
|
43
|
+
* The result will not contain specific values for fields x,y and z
|
|
44
|
+
* (their value will be set to the default, and omitted in proto text
|
|
45
|
+
* output):
|
|
46
|
+
*
|
|
47
|
+
* f {
|
|
48
|
+
* a : 22
|
|
49
|
+
* b {
|
|
50
|
+
* d : 1
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
*
|
|
54
|
+
* A repeated field is not allowed except at the last position of a
|
|
55
|
+
* paths string.
|
|
56
|
+
*
|
|
57
|
+
* If a FieldMask object is not present in a get operation, the
|
|
58
|
+
* operation applies to all fields (as if a FieldMask of all fields
|
|
59
|
+
* had been specified).
|
|
60
|
+
*
|
|
61
|
+
* Note that a field mask does not necessarily apply to the
|
|
62
|
+
* top-level response message. In case of a REST get operation, the
|
|
63
|
+
* field mask applies directly to the response, but in case of a REST
|
|
64
|
+
* list operation, the mask instead applies to each individual message
|
|
65
|
+
* in the returned resource list. In case of a REST custom method,
|
|
66
|
+
* other definitions may be used. Where the mask applies will be
|
|
67
|
+
* clearly documented together with its declaration in the API. In
|
|
68
|
+
* any case, the effect on the returned resource/resources is required
|
|
69
|
+
* behavior for APIs.
|
|
70
|
+
*
|
|
71
|
+
* # Field Masks in Update Operations
|
|
72
|
+
*
|
|
73
|
+
* A field mask in update operations specifies which fields of the
|
|
74
|
+
* targeted resource are going to be updated. The API is required
|
|
75
|
+
* to only change the values of the fields as specified in the mask
|
|
76
|
+
* and leave the others untouched. If a resource is passed in to
|
|
77
|
+
* describe the updated values, the API ignores the values of all
|
|
78
|
+
* fields not covered by the mask.
|
|
79
|
+
*
|
|
80
|
+
* If a repeated field is specified for an update operation, new values will
|
|
81
|
+
* be appended to the existing repeated field in the target resource. Note that
|
|
82
|
+
* a repeated field is only allowed in the last position of a `paths` string.
|
|
83
|
+
*
|
|
84
|
+
* If a sub-message is specified in the last position of the field mask for an
|
|
85
|
+
* update operation, then new value will be merged into the existing sub-message
|
|
86
|
+
* in the target resource.
|
|
87
|
+
*
|
|
88
|
+
* For example, given the target message:
|
|
89
|
+
*
|
|
90
|
+
* f {
|
|
91
|
+
* b {
|
|
92
|
+
* d: 1
|
|
93
|
+
* x: 2
|
|
94
|
+
* }
|
|
95
|
+
* c: [1]
|
|
96
|
+
* }
|
|
97
|
+
*
|
|
98
|
+
* And an update message:
|
|
99
|
+
*
|
|
100
|
+
* f {
|
|
101
|
+
* b {
|
|
102
|
+
* d: 10
|
|
103
|
+
* }
|
|
104
|
+
* c: [2]
|
|
105
|
+
* }
|
|
106
|
+
*
|
|
107
|
+
* then if the field mask is:
|
|
108
|
+
*
|
|
109
|
+
* paths: ["f.b", "f.c"]
|
|
110
|
+
*
|
|
111
|
+
* then the result will be:
|
|
112
|
+
*
|
|
113
|
+
* f {
|
|
114
|
+
* b {
|
|
115
|
+
* d: 10
|
|
116
|
+
* x: 2
|
|
117
|
+
* }
|
|
118
|
+
* c: [1, 2]
|
|
119
|
+
* }
|
|
120
|
+
*
|
|
121
|
+
* An implementation may provide options to override this default behavior for
|
|
122
|
+
* repeated and message fields.
|
|
123
|
+
*
|
|
124
|
+
* In order to reset a field's value to the default, the field must
|
|
125
|
+
* be in the mask and set to the default value in the provided resource.
|
|
126
|
+
* Hence, in order to reset all fields of a resource, provide a default
|
|
127
|
+
* instance of the resource and set all fields in the mask, or do
|
|
128
|
+
* not provide a mask as described below.
|
|
129
|
+
*
|
|
130
|
+
* If a field mask is not present on update, the operation applies to
|
|
131
|
+
* all fields (as if a field mask of all fields has been specified).
|
|
132
|
+
* Note that in the presence of schema evolution, this may mean that
|
|
133
|
+
* fields the client does not know and has therefore not filled into
|
|
134
|
+
* the request will be reset to their default. If this is unwanted
|
|
135
|
+
* behavior, a specific service may require a client to always specify
|
|
136
|
+
* a field mask, producing an error if not.
|
|
137
|
+
*
|
|
138
|
+
* As with get operations, the location of the resource which
|
|
139
|
+
* describes the updated values in the request message depends on the
|
|
140
|
+
* operation kind. In any case, the effect of the field mask is
|
|
141
|
+
* required to be honored by the API.
|
|
142
|
+
*
|
|
143
|
+
* ## Considerations for HTTP REST
|
|
144
|
+
*
|
|
145
|
+
* The HTTP kind of an update operation which uses a field mask must
|
|
146
|
+
* be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
|
147
|
+
* (PUT must only be used for full updates).
|
|
148
|
+
*
|
|
149
|
+
* # JSON Encoding of Field Masks
|
|
150
|
+
*
|
|
151
|
+
* In JSON, a field mask is encoded as a single string where paths are
|
|
152
|
+
* separated by a comma. Fields name in each path are converted
|
|
153
|
+
* to/from lower-camel naming conventions.
|
|
154
|
+
*
|
|
155
|
+
* As an example, consider the following message declarations:
|
|
156
|
+
*
|
|
157
|
+
* message Profile {
|
|
158
|
+
* User user = 1;
|
|
159
|
+
* Photo photo = 2;
|
|
160
|
+
* }
|
|
161
|
+
* message User {
|
|
162
|
+
* string display_name = 1;
|
|
163
|
+
* string address = 2;
|
|
164
|
+
* }
|
|
165
|
+
*
|
|
166
|
+
* In proto a field mask for `Profile` may look as such:
|
|
167
|
+
*
|
|
168
|
+
* mask {
|
|
169
|
+
* paths: "user.display_name"
|
|
170
|
+
* paths: "photo"
|
|
171
|
+
* }
|
|
172
|
+
*
|
|
173
|
+
* In JSON, the same mask is represented as below:
|
|
174
|
+
*
|
|
175
|
+
* {
|
|
176
|
+
* mask: "user.displayName,photo"
|
|
177
|
+
* }
|
|
178
|
+
*
|
|
179
|
+
* # Field Masks and Oneof Fields
|
|
180
|
+
*
|
|
181
|
+
* Field masks treat fields in oneofs just as regular fields. Consider the
|
|
182
|
+
* following message:
|
|
183
|
+
*
|
|
184
|
+
* message SampleMessage {
|
|
185
|
+
* oneof test_oneof {
|
|
186
|
+
* string name = 4;
|
|
187
|
+
* SubMessage sub_message = 9;
|
|
188
|
+
* }
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
* The field mask can be:
|
|
192
|
+
*
|
|
193
|
+
* mask {
|
|
194
|
+
* paths: "name"
|
|
195
|
+
* }
|
|
196
|
+
*
|
|
197
|
+
* Or:
|
|
198
|
+
*
|
|
199
|
+
* mask {
|
|
200
|
+
* paths: "sub_message"
|
|
201
|
+
* }
|
|
202
|
+
*
|
|
203
|
+
* Note that oneof type names ("test_oneof" in this case) cannot be used in
|
|
204
|
+
* paths.
|
|
205
|
+
*
|
|
206
|
+
* ## Field Mask Verification
|
|
207
|
+
*
|
|
208
|
+
* The implementation of any API method which has a FieldMask type field in the
|
|
209
|
+
* request should verify the included field paths, and return an
|
|
210
|
+
* `INVALID_ARGUMENT` error if any path is unmappable.
|
|
211
|
+
*/
|
|
212
|
+
export interface FieldMask {
|
|
213
|
+
/** The set of field mask paths. */
|
|
214
|
+
paths: string[];
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function createBaseFieldMask(): FieldMask {
|
|
218
|
+
return { paths: [] };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export const FieldMask: MessageFns<FieldMask> & FieldMaskWrapperFns = {
|
|
222
|
+
encode(message: FieldMask, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
223
|
+
for (const v of message.paths) {
|
|
224
|
+
writer.uint32(10).string(v!);
|
|
225
|
+
}
|
|
226
|
+
return writer;
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
decode(input: BinaryReader | Uint8Array, length?: number): FieldMask {
|
|
230
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
231
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
232
|
+
const message = createBaseFieldMask();
|
|
233
|
+
while (reader.pos < end) {
|
|
234
|
+
const tag = reader.uint32();
|
|
235
|
+
switch (tag >>> 3) {
|
|
236
|
+
case 1: {
|
|
237
|
+
if (tag !== 10) {
|
|
238
|
+
break;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
message.paths.push(reader.string());
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
reader.skip(tag & 7);
|
|
249
|
+
}
|
|
250
|
+
return message;
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
fromJSON(object: any): FieldMask {
|
|
254
|
+
return {
|
|
255
|
+
paths: typeof object === "string"
|
|
256
|
+
? object.split(",").filter(globalThis.Boolean)
|
|
257
|
+
: globalThis.Array.isArray(object?.paths)
|
|
258
|
+
? object.paths.map(globalThis.String)
|
|
259
|
+
: [],
|
|
260
|
+
};
|
|
261
|
+
},
|
|
262
|
+
|
|
263
|
+
toJSON(message: FieldMask): string {
|
|
264
|
+
return message.paths.join(",");
|
|
265
|
+
},
|
|
266
|
+
|
|
267
|
+
create<I extends Exact<DeepPartial<FieldMask>, I>>(base?: I): FieldMask {
|
|
268
|
+
return FieldMask.fromPartial(base ?? ({} as any));
|
|
269
|
+
},
|
|
270
|
+
fromPartial<I extends Exact<DeepPartial<FieldMask>, I>>(object: I): FieldMask {
|
|
271
|
+
const message = createBaseFieldMask();
|
|
272
|
+
message.paths = object.paths?.map((e) => e) || [];
|
|
273
|
+
return message;
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
wrap(paths: string[]): FieldMask {
|
|
277
|
+
const result = createBaseFieldMask();
|
|
278
|
+
result.paths = paths;
|
|
279
|
+
return result;
|
|
280
|
+
},
|
|
281
|
+
|
|
282
|
+
unwrap(message: FieldMask): string[] {
|
|
283
|
+
return message.paths;
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
288
|
+
|
|
289
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
290
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
291
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
292
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
293
|
+
: Partial<T>;
|
|
294
|
+
|
|
295
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
296
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
297
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
298
|
+
|
|
299
|
+
export interface MessageFns<T> {
|
|
300
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
301
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
302
|
+
fromJSON(object: any): T;
|
|
303
|
+
toJSON(message: T): unknown;
|
|
304
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
305
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export interface FieldMaskWrapperFns {
|
|
309
|
+
wrap(paths: string[]): FieldMask;
|
|
310
|
+
unwrap(message: FieldMask): string[];
|
|
311
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.2
|
|
4
|
+
// protoc v4.23.4
|
|
5
|
+
// source: google/protobuf/timestamp.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
9
|
+
|
|
10
|
+
export const protobufPackage = "google.protobuf";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A Timestamp represents a point in time independent of any time zone or local
|
|
14
|
+
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
15
|
+
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
|
16
|
+
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
|
17
|
+
* Gregorian calendar backwards to year one.
|
|
18
|
+
*
|
|
19
|
+
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
|
20
|
+
* second table is needed for interpretation, using a [24-hour linear
|
|
21
|
+
* smear](https://developers.google.com/time/smear).
|
|
22
|
+
*
|
|
23
|
+
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
|
24
|
+
* restricting to that range, we ensure that we can convert to and from [RFC
|
|
25
|
+
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
|
26
|
+
*
|
|
27
|
+
* # Examples
|
|
28
|
+
*
|
|
29
|
+
* Example 1: Compute Timestamp from POSIX `time()`.
|
|
30
|
+
*
|
|
31
|
+
* Timestamp timestamp;
|
|
32
|
+
* timestamp.set_seconds(time(NULL));
|
|
33
|
+
* timestamp.set_nanos(0);
|
|
34
|
+
*
|
|
35
|
+
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
|
36
|
+
*
|
|
37
|
+
* struct timeval tv;
|
|
38
|
+
* gettimeofday(&tv, NULL);
|
|
39
|
+
*
|
|
40
|
+
* Timestamp timestamp;
|
|
41
|
+
* timestamp.set_seconds(tv.tv_sec);
|
|
42
|
+
* timestamp.set_nanos(tv.tv_usec * 1000);
|
|
43
|
+
*
|
|
44
|
+
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
|
45
|
+
*
|
|
46
|
+
* FILETIME ft;
|
|
47
|
+
* GetSystemTimeAsFileTime(&ft);
|
|
48
|
+
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
|
49
|
+
*
|
|
50
|
+
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
|
51
|
+
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
|
52
|
+
* Timestamp timestamp;
|
|
53
|
+
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
|
54
|
+
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
|
55
|
+
*
|
|
56
|
+
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
|
57
|
+
*
|
|
58
|
+
* long millis = System.currentTimeMillis();
|
|
59
|
+
*
|
|
60
|
+
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
|
61
|
+
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
|
62
|
+
*
|
|
63
|
+
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
|
64
|
+
*
|
|
65
|
+
* Instant now = Instant.now();
|
|
66
|
+
*
|
|
67
|
+
* Timestamp timestamp =
|
|
68
|
+
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
|
69
|
+
* .setNanos(now.getNano()).build();
|
|
70
|
+
*
|
|
71
|
+
* Example 6: Compute Timestamp from current time in Python.
|
|
72
|
+
*
|
|
73
|
+
* timestamp = Timestamp()
|
|
74
|
+
* timestamp.GetCurrentTime()
|
|
75
|
+
*
|
|
76
|
+
* # JSON Mapping
|
|
77
|
+
*
|
|
78
|
+
* In JSON format, the Timestamp type is encoded as a string in the
|
|
79
|
+
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
|
80
|
+
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
|
81
|
+
* where {year} is always expressed using four digits while {month}, {day},
|
|
82
|
+
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
83
|
+
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
84
|
+
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
85
|
+
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
|
86
|
+
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
|
87
|
+
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
88
|
+
*
|
|
89
|
+
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
90
|
+
* 01:30 UTC on January 15, 2017.
|
|
91
|
+
*
|
|
92
|
+
* In JavaScript, one can convert a Date object to this format using the
|
|
93
|
+
* standard
|
|
94
|
+
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
95
|
+
* method. In Python, a standard `datetime.datetime` object can be converted
|
|
96
|
+
* to this format using
|
|
97
|
+
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
|
98
|
+
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
|
99
|
+
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
|
100
|
+
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
|
|
101
|
+
* ) to obtain a formatter capable of generating timestamps in this format.
|
|
102
|
+
*/
|
|
103
|
+
export interface Timestamp {
|
|
104
|
+
/**
|
|
105
|
+
* Represents seconds of UTC time since Unix epoch
|
|
106
|
+
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
|
107
|
+
* 9999-12-31T23:59:59Z inclusive.
|
|
108
|
+
*/
|
|
109
|
+
seconds: bigint;
|
|
110
|
+
/**
|
|
111
|
+
* Non-negative fractions of a second at nanosecond resolution. Negative
|
|
112
|
+
* second values with fractions must still have non-negative nanos values
|
|
113
|
+
* that count forward in time. Must be from 0 to 999,999,999
|
|
114
|
+
* inclusive.
|
|
115
|
+
*/
|
|
116
|
+
nanos: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function createBaseTimestamp(): Timestamp {
|
|
120
|
+
return { seconds: 0n, nanos: 0 };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export const Timestamp: MessageFns<Timestamp> = {
|
|
124
|
+
encode(message: Timestamp, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
125
|
+
if (message.seconds !== 0n) {
|
|
126
|
+
if (BigInt.asIntN(64, message.seconds) !== message.seconds) {
|
|
127
|
+
throw new globalThis.Error("value provided for field message.seconds of type int64 too large");
|
|
128
|
+
}
|
|
129
|
+
writer.uint32(8).int64(message.seconds);
|
|
130
|
+
}
|
|
131
|
+
if (message.nanos !== 0) {
|
|
132
|
+
writer.uint32(16).int32(message.nanos);
|
|
133
|
+
}
|
|
134
|
+
return writer;
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
|
|
138
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
139
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
140
|
+
const message = createBaseTimestamp();
|
|
141
|
+
while (reader.pos < end) {
|
|
142
|
+
const tag = reader.uint32();
|
|
143
|
+
switch (tag >>> 3) {
|
|
144
|
+
case 1: {
|
|
145
|
+
if (tag !== 8) {
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
message.seconds = reader.int64() as bigint;
|
|
150
|
+
continue;
|
|
151
|
+
}
|
|
152
|
+
case 2: {
|
|
153
|
+
if (tag !== 16) {
|
|
154
|
+
break;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
message.nanos = reader.int32();
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
reader.skip(tag & 7);
|
|
165
|
+
}
|
|
166
|
+
return message;
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
fromJSON(object: any): Timestamp {
|
|
170
|
+
return {
|
|
171
|
+
seconds: isSet(object.seconds) ? BigInt(object.seconds) : 0n,
|
|
172
|
+
nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0,
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
toJSON(message: Timestamp): unknown {
|
|
177
|
+
const obj: any = {};
|
|
178
|
+
if (message.seconds !== 0n) {
|
|
179
|
+
obj.seconds = message.seconds.toString();
|
|
180
|
+
}
|
|
181
|
+
if (message.nanos !== 0) {
|
|
182
|
+
obj.nanos = Math.round(message.nanos);
|
|
183
|
+
}
|
|
184
|
+
return obj;
|
|
185
|
+
},
|
|
186
|
+
|
|
187
|
+
create<I extends Exact<DeepPartial<Timestamp>, I>>(base?: I): Timestamp {
|
|
188
|
+
return Timestamp.fromPartial(base ?? ({} as any));
|
|
189
|
+
},
|
|
190
|
+
fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(object: I): Timestamp {
|
|
191
|
+
const message = createBaseTimestamp();
|
|
192
|
+
message.seconds = object.seconds ?? 0n;
|
|
193
|
+
message.nanos = object.nanos ?? 0;
|
|
194
|
+
return message;
|
|
195
|
+
},
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
199
|
+
|
|
200
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
201
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
202
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
203
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
204
|
+
: Partial<T>;
|
|
205
|
+
|
|
206
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
207
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
208
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
209
|
+
|
|
210
|
+
function isSet(value: any): boolean {
|
|
211
|
+
return value !== null && value !== undefined;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export interface MessageFns<T> {
|
|
215
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
216
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
217
|
+
fromJSON(object: any): T;
|
|
218
|
+
toJSON(message: T): unknown;
|
|
219
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
220
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
221
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sa2-movie-ticket/contracts",
|
|
3
3
|
"description": "Contracts for movie ticket microservices",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"main": "dist/index.js",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"repository": "sa2-movie-ticket/contracts",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/bun": "latest",
|
|
32
|
+
"protoc": "^29.6.0",
|
|
32
33
|
"ts-proto": "^2.11.2",
|
|
33
34
|
"tsup": "^8.5.1"
|
|
34
35
|
},
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "google/protobuf/field_mask.proto";
|
|
7
|
+
import "google/protobuf/empty.proto";
|
|
8
|
+
|
|
9
|
+
option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/account";
|
|
10
|
+
|
|
11
|
+
service AccountService {
|
|
12
|
+
// Retrieves a specific account by ID
|
|
13
|
+
rpc GetAccount (GetAccountRequest) returns (Account);
|
|
14
|
+
|
|
15
|
+
// Updates specific fields of an account using a FieldMask
|
|
16
|
+
rpc UpdateAccount (UpdateAccountRequest) returns (Account);
|
|
17
|
+
|
|
18
|
+
// Deletes an account and returns an empty response on success
|
|
19
|
+
rpc DeleteAccount (DeleteAccountRequest) returns (google.protobuf.Empty);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum Role {
|
|
23
|
+
ROLE_UNSPECIFIED = 0; // Best practice: always have an unspecified default
|
|
24
|
+
ROLE_USER = 1;
|
|
25
|
+
ROLE_MODERATOR = 2;
|
|
26
|
+
ROLE_MANAGER = 3;
|
|
27
|
+
ROLE_ADMIN = 4;
|
|
28
|
+
ROLE_SUPER_ADMIN = 5;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message Account {
|
|
32
|
+
string id = 1;
|
|
33
|
+
string email = 2;
|
|
34
|
+
string phone = 3;
|
|
35
|
+
Role role = 4;
|
|
36
|
+
bool is_phone_verified = 5;
|
|
37
|
+
bool is_email_verified = 6;
|
|
38
|
+
google.protobuf.Timestamp created_at = 7;
|
|
39
|
+
google.protobuf.Timestamp updated_at = 8;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
message GetAccountRequest {
|
|
43
|
+
string id = 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message UpdateAccountRequest {
|
|
47
|
+
// The account object containing the new values
|
|
48
|
+
Account account = 1;
|
|
49
|
+
|
|
50
|
+
// Specifies which fields in 'account' should be updated.
|
|
51
|
+
// Example: paths: ["email", "phone"]
|
|
52
|
+
google.protobuf.FieldMask update_mask = 2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message DeleteAccountRequest {
|
|
56
|
+
string id = 1;
|
|
57
|
+
}
|