@sa2-movie-ticket/contracts 1.0.7 → 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/auth.ts +182 -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/proto/auth.proto +10 -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
|
+
}
|