@sa2-movie-ticket/contracts 1.0.14 → 1.0.16
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 +0 -213
- package/gen/ts/users.ts +485 -0
- package/package.json +1 -1
- package/proto/account.proto +0 -18
- package/proto/users.proto +35 -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"),ACCOUNT:path.join(__dirname,"../../proto/account.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"),USERS:path.join(__dirname,"../../proto/users.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"),ACCOUNT:join(__dirname,"../../proto/account.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"),USERS:join(__dirname,"../../proto/users.proto")};export{t as GRPC_PROTO_PATH};
|
package/gen/ts/account.ts
CHANGED
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
type UntypedServiceImplementation,
|
|
20
20
|
} from "@grpc/grpc-js";
|
|
21
21
|
import { Empty } from "./google/protobuf/empty";
|
|
22
|
-
import { FieldMask } from "./google/protobuf/field_mask";
|
|
23
22
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
24
23
|
|
|
25
24
|
export const protobufPackage = "account.v1";
|
|
@@ -96,22 +95,6 @@ export interface GetAccountRequest {
|
|
|
96
95
|
id: string;
|
|
97
96
|
}
|
|
98
97
|
|
|
99
|
-
export interface UpdateAccountRequest {
|
|
100
|
-
/** The account object containing the new values */
|
|
101
|
-
account:
|
|
102
|
-
| Account
|
|
103
|
-
| undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Specifies which fields in 'account' should be updated.
|
|
106
|
-
* Example: paths: ["email", "phone"]
|
|
107
|
-
*/
|
|
108
|
-
updateMask: string[] | undefined;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface DeleteAccountRequest {
|
|
112
|
-
id: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
98
|
export interface InitEmailChangeRequest {
|
|
116
99
|
id: string;
|
|
117
100
|
newEmail: string;
|
|
@@ -389,146 +372,6 @@ export const GetAccountRequest: MessageFns<GetAccountRequest> = {
|
|
|
389
372
|
},
|
|
390
373
|
};
|
|
391
374
|
|
|
392
|
-
function createBaseUpdateAccountRequest(): UpdateAccountRequest {
|
|
393
|
-
return { account: undefined, updateMask: undefined };
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
export const UpdateAccountRequest: MessageFns<UpdateAccountRequest> = {
|
|
397
|
-
encode(message: UpdateAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
398
|
-
if (message.account !== undefined) {
|
|
399
|
-
Account.encode(message.account, writer.uint32(10).fork()).join();
|
|
400
|
-
}
|
|
401
|
-
if (message.updateMask !== undefined) {
|
|
402
|
-
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).join();
|
|
403
|
-
}
|
|
404
|
-
return writer;
|
|
405
|
-
},
|
|
406
|
-
|
|
407
|
-
decode(input: BinaryReader | Uint8Array, length?: number): UpdateAccountRequest {
|
|
408
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
409
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
410
|
-
const message = createBaseUpdateAccountRequest();
|
|
411
|
-
while (reader.pos < end) {
|
|
412
|
-
const tag = reader.uint32();
|
|
413
|
-
switch (tag >>> 3) {
|
|
414
|
-
case 1: {
|
|
415
|
-
if (tag !== 10) {
|
|
416
|
-
break;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
message.account = Account.decode(reader, reader.uint32());
|
|
420
|
-
continue;
|
|
421
|
-
}
|
|
422
|
-
case 2: {
|
|
423
|
-
if (tag !== 18) {
|
|
424
|
-
break;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
|
|
428
|
-
continue;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
432
|
-
break;
|
|
433
|
-
}
|
|
434
|
-
reader.skip(tag & 7);
|
|
435
|
-
}
|
|
436
|
-
return message;
|
|
437
|
-
},
|
|
438
|
-
|
|
439
|
-
fromJSON(object: any): UpdateAccountRequest {
|
|
440
|
-
return {
|
|
441
|
-
account: isSet(object.account) ? Account.fromJSON(object.account) : undefined,
|
|
442
|
-
updateMask: isSet(object.updateMask)
|
|
443
|
-
? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask))
|
|
444
|
-
: isSet(object.update_mask)
|
|
445
|
-
? FieldMask.unwrap(FieldMask.fromJSON(object.update_mask))
|
|
446
|
-
: undefined,
|
|
447
|
-
};
|
|
448
|
-
},
|
|
449
|
-
|
|
450
|
-
toJSON(message: UpdateAccountRequest): unknown {
|
|
451
|
-
const obj: any = {};
|
|
452
|
-
if (message.account !== undefined) {
|
|
453
|
-
obj.account = Account.toJSON(message.account);
|
|
454
|
-
}
|
|
455
|
-
if (message.updateMask !== undefined) {
|
|
456
|
-
obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
|
|
457
|
-
}
|
|
458
|
-
return obj;
|
|
459
|
-
},
|
|
460
|
-
|
|
461
|
-
create<I extends Exact<DeepPartial<UpdateAccountRequest>, I>>(base?: I): UpdateAccountRequest {
|
|
462
|
-
return UpdateAccountRequest.fromPartial(base ?? ({} as any));
|
|
463
|
-
},
|
|
464
|
-
fromPartial<I extends Exact<DeepPartial<UpdateAccountRequest>, I>>(object: I): UpdateAccountRequest {
|
|
465
|
-
const message = createBaseUpdateAccountRequest();
|
|
466
|
-
message.account = (object.account !== undefined && object.account !== null)
|
|
467
|
-
? Account.fromPartial(object.account)
|
|
468
|
-
: undefined;
|
|
469
|
-
message.updateMask = object.updateMask ?? undefined;
|
|
470
|
-
return message;
|
|
471
|
-
},
|
|
472
|
-
};
|
|
473
|
-
|
|
474
|
-
function createBaseDeleteAccountRequest(): DeleteAccountRequest {
|
|
475
|
-
return { id: "" };
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
export const DeleteAccountRequest: MessageFns<DeleteAccountRequest> = {
|
|
479
|
-
encode(message: DeleteAccountRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
480
|
-
if (message.id !== "") {
|
|
481
|
-
writer.uint32(10).string(message.id);
|
|
482
|
-
}
|
|
483
|
-
return writer;
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
decode(input: BinaryReader | Uint8Array, length?: number): DeleteAccountRequest {
|
|
487
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
488
|
-
const end = length === undefined ? reader.len : reader.pos + length;
|
|
489
|
-
const message = createBaseDeleteAccountRequest();
|
|
490
|
-
while (reader.pos < end) {
|
|
491
|
-
const tag = reader.uint32();
|
|
492
|
-
switch (tag >>> 3) {
|
|
493
|
-
case 1: {
|
|
494
|
-
if (tag !== 10) {
|
|
495
|
-
break;
|
|
496
|
-
}
|
|
497
|
-
|
|
498
|
-
message.id = reader.string();
|
|
499
|
-
continue;
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
503
|
-
break;
|
|
504
|
-
}
|
|
505
|
-
reader.skip(tag & 7);
|
|
506
|
-
}
|
|
507
|
-
return message;
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
fromJSON(object: any): DeleteAccountRequest {
|
|
511
|
-
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
toJSON(message: DeleteAccountRequest): unknown {
|
|
515
|
-
const obj: any = {};
|
|
516
|
-
if (message.id !== "") {
|
|
517
|
-
obj.id = message.id;
|
|
518
|
-
}
|
|
519
|
-
return obj;
|
|
520
|
-
},
|
|
521
|
-
|
|
522
|
-
create<I extends Exact<DeepPartial<DeleteAccountRequest>, I>>(base?: I): DeleteAccountRequest {
|
|
523
|
-
return DeleteAccountRequest.fromPartial(base ?? ({} as any));
|
|
524
|
-
},
|
|
525
|
-
fromPartial<I extends Exact<DeepPartial<DeleteAccountRequest>, I>>(object: I): DeleteAccountRequest {
|
|
526
|
-
const message = createBaseDeleteAccountRequest();
|
|
527
|
-
message.id = object.id ?? "";
|
|
528
|
-
return message;
|
|
529
|
-
},
|
|
530
|
-
};
|
|
531
|
-
|
|
532
375
|
function createBaseInitEmailChangeRequest(): InitEmailChangeRequest {
|
|
533
376
|
return { id: "", newEmail: "" };
|
|
534
377
|
}
|
|
@@ -901,26 +744,6 @@ export const AccountServiceService = {
|
|
|
901
744
|
responseSerialize: (value: Account): Buffer => Buffer.from(Account.encode(value).finish()),
|
|
902
745
|
responseDeserialize: (value: Buffer): Account => Account.decode(value),
|
|
903
746
|
},
|
|
904
|
-
/** Updates specific fields of an account using a FieldMask */
|
|
905
|
-
updateAccount: {
|
|
906
|
-
path: "/account.v1.AccountService/UpdateAccount",
|
|
907
|
-
requestStream: false,
|
|
908
|
-
responseStream: false,
|
|
909
|
-
requestSerialize: (value: UpdateAccountRequest): Buffer => Buffer.from(UpdateAccountRequest.encode(value).finish()),
|
|
910
|
-
requestDeserialize: (value: Buffer): UpdateAccountRequest => UpdateAccountRequest.decode(value),
|
|
911
|
-
responseSerialize: (value: Account): Buffer => Buffer.from(Account.encode(value).finish()),
|
|
912
|
-
responseDeserialize: (value: Buffer): Account => Account.decode(value),
|
|
913
|
-
},
|
|
914
|
-
/** Deletes an account and returns an empty response on success */
|
|
915
|
-
deleteAccount: {
|
|
916
|
-
path: "/account.v1.AccountService/DeleteAccount",
|
|
917
|
-
requestStream: false,
|
|
918
|
-
responseStream: false,
|
|
919
|
-
requestSerialize: (value: DeleteAccountRequest): Buffer => Buffer.from(DeleteAccountRequest.encode(value).finish()),
|
|
920
|
-
requestDeserialize: (value: Buffer): DeleteAccountRequest => DeleteAccountRequest.decode(value),
|
|
921
|
-
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
922
|
-
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
923
|
-
},
|
|
924
747
|
/** init email change */
|
|
925
748
|
initEmailChange: {
|
|
926
749
|
path: "/account.v1.AccountService/InitEmailChange",
|
|
@@ -970,10 +793,6 @@ export const AccountServiceService = {
|
|
|
970
793
|
export interface AccountServiceServer extends UntypedServiceImplementation {
|
|
971
794
|
/** Retrieves a specific account by ID */
|
|
972
795
|
getAccount: handleUnaryCall<GetAccountRequest, Account>;
|
|
973
|
-
/** Updates specific fields of an account using a FieldMask */
|
|
974
|
-
updateAccount: handleUnaryCall<UpdateAccountRequest, Account>;
|
|
975
|
-
/** Deletes an account and returns an empty response on success */
|
|
976
|
-
deleteAccount: handleUnaryCall<DeleteAccountRequest, Empty>;
|
|
977
796
|
/** init email change */
|
|
978
797
|
initEmailChange: handleUnaryCall<InitEmailChangeRequest, Empty>;
|
|
979
798
|
/** confirm email change */
|
|
@@ -1001,38 +820,6 @@ export interface AccountServiceClient extends Client {
|
|
|
1001
820
|
options: Partial<CallOptions>,
|
|
1002
821
|
callback: (error: ServiceError | null, response: Account) => void,
|
|
1003
822
|
): ClientUnaryCall;
|
|
1004
|
-
/** Updates specific fields of an account using a FieldMask */
|
|
1005
|
-
updateAccount(
|
|
1006
|
-
request: UpdateAccountRequest,
|
|
1007
|
-
callback: (error: ServiceError | null, response: Account) => void,
|
|
1008
|
-
): ClientUnaryCall;
|
|
1009
|
-
updateAccount(
|
|
1010
|
-
request: UpdateAccountRequest,
|
|
1011
|
-
metadata: Metadata,
|
|
1012
|
-
callback: (error: ServiceError | null, response: Account) => void,
|
|
1013
|
-
): ClientUnaryCall;
|
|
1014
|
-
updateAccount(
|
|
1015
|
-
request: UpdateAccountRequest,
|
|
1016
|
-
metadata: Metadata,
|
|
1017
|
-
options: Partial<CallOptions>,
|
|
1018
|
-
callback: (error: ServiceError | null, response: Account) => void,
|
|
1019
|
-
): ClientUnaryCall;
|
|
1020
|
-
/** Deletes an account and returns an empty response on success */
|
|
1021
|
-
deleteAccount(
|
|
1022
|
-
request: DeleteAccountRequest,
|
|
1023
|
-
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1024
|
-
): ClientUnaryCall;
|
|
1025
|
-
deleteAccount(
|
|
1026
|
-
request: DeleteAccountRequest,
|
|
1027
|
-
metadata: Metadata,
|
|
1028
|
-
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1029
|
-
): ClientUnaryCall;
|
|
1030
|
-
deleteAccount(
|
|
1031
|
-
request: DeleteAccountRequest,
|
|
1032
|
-
metadata: Metadata,
|
|
1033
|
-
options: Partial<CallOptions>,
|
|
1034
|
-
callback: (error: ServiceError | null, response: Empty) => void,
|
|
1035
|
-
): ClientUnaryCall;
|
|
1036
823
|
/** init email change */
|
|
1037
824
|
initEmailChange(
|
|
1038
825
|
request: InitEmailChangeRequest,
|
package/gen/ts/users.ts
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v4.23.4
|
|
5
|
+
// source: users.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
|
+
|
|
23
|
+
export const protobufPackage = "users.v1";
|
|
24
|
+
|
|
25
|
+
export interface GetUserByIdRequest {
|
|
26
|
+
id: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface CreateUserRequest {
|
|
30
|
+
id: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface UserResponse {
|
|
34
|
+
user: User | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface User {
|
|
38
|
+
id: string;
|
|
39
|
+
name?: string | undefined;
|
|
40
|
+
email?: string | undefined;
|
|
41
|
+
phone?: string | undefined;
|
|
42
|
+
avatar?: string | undefined;
|
|
43
|
+
createdAt?: string | undefined;
|
|
44
|
+
updatedAt?: string | undefined;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function createBaseGetUserByIdRequest(): GetUserByIdRequest {
|
|
48
|
+
return { id: "" };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const GetUserByIdRequest: MessageFns<GetUserByIdRequest> = {
|
|
52
|
+
encode(message: GetUserByIdRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
53
|
+
if (message.id !== "") {
|
|
54
|
+
writer.uint32(10).string(message.id);
|
|
55
|
+
}
|
|
56
|
+
return writer;
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
decode(input: BinaryReader | Uint8Array, length?: number): GetUserByIdRequest {
|
|
60
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
61
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
62
|
+
const message = createBaseGetUserByIdRequest();
|
|
63
|
+
while (reader.pos < end) {
|
|
64
|
+
const tag = reader.uint32();
|
|
65
|
+
switch (tag >>> 3) {
|
|
66
|
+
case 1: {
|
|
67
|
+
if (tag !== 10) {
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
message.id = reader.string();
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
reader.skip(tag & 7);
|
|
79
|
+
}
|
|
80
|
+
return message;
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
fromJSON(object: any): GetUserByIdRequest {
|
|
84
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
toJSON(message: GetUserByIdRequest): unknown {
|
|
88
|
+
const obj: any = {};
|
|
89
|
+
if (message.id !== "") {
|
|
90
|
+
obj.id = message.id;
|
|
91
|
+
}
|
|
92
|
+
return obj;
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
create<I extends Exact<DeepPartial<GetUserByIdRequest>, I>>(base?: I): GetUserByIdRequest {
|
|
96
|
+
return GetUserByIdRequest.fromPartial(base ?? ({} as any));
|
|
97
|
+
},
|
|
98
|
+
fromPartial<I extends Exact<DeepPartial<GetUserByIdRequest>, I>>(object: I): GetUserByIdRequest {
|
|
99
|
+
const message = createBaseGetUserByIdRequest();
|
|
100
|
+
message.id = object.id ?? "";
|
|
101
|
+
return message;
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
function createBaseCreateUserRequest(): CreateUserRequest {
|
|
106
|
+
return { id: "" };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const CreateUserRequest: MessageFns<CreateUserRequest> = {
|
|
110
|
+
encode(message: CreateUserRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
111
|
+
if (message.id !== "") {
|
|
112
|
+
writer.uint32(10).string(message.id);
|
|
113
|
+
}
|
|
114
|
+
return writer;
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
decode(input: BinaryReader | Uint8Array, length?: number): CreateUserRequest {
|
|
118
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
119
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
120
|
+
const message = createBaseCreateUserRequest();
|
|
121
|
+
while (reader.pos < end) {
|
|
122
|
+
const tag = reader.uint32();
|
|
123
|
+
switch (tag >>> 3) {
|
|
124
|
+
case 1: {
|
|
125
|
+
if (tag !== 10) {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message.id = reader.string();
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
reader.skip(tag & 7);
|
|
137
|
+
}
|
|
138
|
+
return message;
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
fromJSON(object: any): CreateUserRequest {
|
|
142
|
+
return { id: isSet(object.id) ? globalThis.String(object.id) : "" };
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
toJSON(message: CreateUserRequest): unknown {
|
|
146
|
+
const obj: any = {};
|
|
147
|
+
if (message.id !== "") {
|
|
148
|
+
obj.id = message.id;
|
|
149
|
+
}
|
|
150
|
+
return obj;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
create<I extends Exact<DeepPartial<CreateUserRequest>, I>>(base?: I): CreateUserRequest {
|
|
154
|
+
return CreateUserRequest.fromPartial(base ?? ({} as any));
|
|
155
|
+
},
|
|
156
|
+
fromPartial<I extends Exact<DeepPartial<CreateUserRequest>, I>>(object: I): CreateUserRequest {
|
|
157
|
+
const message = createBaseCreateUserRequest();
|
|
158
|
+
message.id = object.id ?? "";
|
|
159
|
+
return message;
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
function createBaseUserResponse(): UserResponse {
|
|
164
|
+
return { user: undefined };
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export const UserResponse: MessageFns<UserResponse> = {
|
|
168
|
+
encode(message: UserResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
169
|
+
if (message.user !== undefined) {
|
|
170
|
+
User.encode(message.user, writer.uint32(10).fork()).join();
|
|
171
|
+
}
|
|
172
|
+
return writer;
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
decode(input: BinaryReader | Uint8Array, length?: number): UserResponse {
|
|
176
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
177
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
178
|
+
const message = createBaseUserResponse();
|
|
179
|
+
while (reader.pos < end) {
|
|
180
|
+
const tag = reader.uint32();
|
|
181
|
+
switch (tag >>> 3) {
|
|
182
|
+
case 1: {
|
|
183
|
+
if (tag !== 10) {
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
message.user = User.decode(reader, reader.uint32());
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
reader.skip(tag & 7);
|
|
195
|
+
}
|
|
196
|
+
return message;
|
|
197
|
+
},
|
|
198
|
+
|
|
199
|
+
fromJSON(object: any): UserResponse {
|
|
200
|
+
return { user: isSet(object.user) ? User.fromJSON(object.user) : undefined };
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
toJSON(message: UserResponse): unknown {
|
|
204
|
+
const obj: any = {};
|
|
205
|
+
if (message.user !== undefined) {
|
|
206
|
+
obj.user = User.toJSON(message.user);
|
|
207
|
+
}
|
|
208
|
+
return obj;
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
create<I extends Exact<DeepPartial<UserResponse>, I>>(base?: I): UserResponse {
|
|
212
|
+
return UserResponse.fromPartial(base ?? ({} as any));
|
|
213
|
+
},
|
|
214
|
+
fromPartial<I extends Exact<DeepPartial<UserResponse>, I>>(object: I): UserResponse {
|
|
215
|
+
const message = createBaseUserResponse();
|
|
216
|
+
message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
|
|
217
|
+
return message;
|
|
218
|
+
},
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
function createBaseUser(): User {
|
|
222
|
+
return {
|
|
223
|
+
id: "",
|
|
224
|
+
name: undefined,
|
|
225
|
+
email: undefined,
|
|
226
|
+
phone: undefined,
|
|
227
|
+
avatar: undefined,
|
|
228
|
+
createdAt: undefined,
|
|
229
|
+
updatedAt: undefined,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export const User: MessageFns<User> = {
|
|
234
|
+
encode(message: User, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
235
|
+
if (message.id !== "") {
|
|
236
|
+
writer.uint32(10).string(message.id);
|
|
237
|
+
}
|
|
238
|
+
if (message.name !== undefined) {
|
|
239
|
+
writer.uint32(18).string(message.name);
|
|
240
|
+
}
|
|
241
|
+
if (message.email !== undefined) {
|
|
242
|
+
writer.uint32(26).string(message.email);
|
|
243
|
+
}
|
|
244
|
+
if (message.phone !== undefined) {
|
|
245
|
+
writer.uint32(34).string(message.phone);
|
|
246
|
+
}
|
|
247
|
+
if (message.avatar !== undefined) {
|
|
248
|
+
writer.uint32(42).string(message.avatar);
|
|
249
|
+
}
|
|
250
|
+
if (message.createdAt !== undefined) {
|
|
251
|
+
writer.uint32(50).string(message.createdAt);
|
|
252
|
+
}
|
|
253
|
+
if (message.updatedAt !== undefined) {
|
|
254
|
+
writer.uint32(58).string(message.updatedAt);
|
|
255
|
+
}
|
|
256
|
+
return writer;
|
|
257
|
+
},
|
|
258
|
+
|
|
259
|
+
decode(input: BinaryReader | Uint8Array, length?: number): User {
|
|
260
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
261
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
262
|
+
const message = createBaseUser();
|
|
263
|
+
while (reader.pos < end) {
|
|
264
|
+
const tag = reader.uint32();
|
|
265
|
+
switch (tag >>> 3) {
|
|
266
|
+
case 1: {
|
|
267
|
+
if (tag !== 10) {
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
message.id = reader.string();
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
case 2: {
|
|
275
|
+
if (tag !== 18) {
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
message.name = reader.string();
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
case 3: {
|
|
283
|
+
if (tag !== 26) {
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
message.email = reader.string();
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
case 4: {
|
|
291
|
+
if (tag !== 34) {
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
message.phone = reader.string();
|
|
296
|
+
continue;
|
|
297
|
+
}
|
|
298
|
+
case 5: {
|
|
299
|
+
if (tag !== 42) {
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
message.avatar = reader.string();
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
306
|
+
case 6: {
|
|
307
|
+
if (tag !== 50) {
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
message.createdAt = reader.string();
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
case 7: {
|
|
315
|
+
if (tag !== 58) {
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
message.updatedAt = reader.string();
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
reader.skip(tag & 7);
|
|
327
|
+
}
|
|
328
|
+
return message;
|
|
329
|
+
},
|
|
330
|
+
|
|
331
|
+
fromJSON(object: any): User {
|
|
332
|
+
return {
|
|
333
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
334
|
+
name: isSet(object.name) ? globalThis.String(object.name) : undefined,
|
|
335
|
+
email: isSet(object.email) ? globalThis.String(object.email) : undefined,
|
|
336
|
+
phone: isSet(object.phone) ? globalThis.String(object.phone) : undefined,
|
|
337
|
+
avatar: isSet(object.avatar) ? globalThis.String(object.avatar) : undefined,
|
|
338
|
+
createdAt: isSet(object.createdAt)
|
|
339
|
+
? globalThis.String(object.createdAt)
|
|
340
|
+
: isSet(object.created_at)
|
|
341
|
+
? globalThis.String(object.created_at)
|
|
342
|
+
: undefined,
|
|
343
|
+
updatedAt: isSet(object.updatedAt)
|
|
344
|
+
? globalThis.String(object.updatedAt)
|
|
345
|
+
: isSet(object.updated_at)
|
|
346
|
+
? globalThis.String(object.updated_at)
|
|
347
|
+
: undefined,
|
|
348
|
+
};
|
|
349
|
+
},
|
|
350
|
+
|
|
351
|
+
toJSON(message: User): unknown {
|
|
352
|
+
const obj: any = {};
|
|
353
|
+
if (message.id !== "") {
|
|
354
|
+
obj.id = message.id;
|
|
355
|
+
}
|
|
356
|
+
if (message.name !== undefined) {
|
|
357
|
+
obj.name = message.name;
|
|
358
|
+
}
|
|
359
|
+
if (message.email !== undefined) {
|
|
360
|
+
obj.email = message.email;
|
|
361
|
+
}
|
|
362
|
+
if (message.phone !== undefined) {
|
|
363
|
+
obj.phone = message.phone;
|
|
364
|
+
}
|
|
365
|
+
if (message.avatar !== undefined) {
|
|
366
|
+
obj.avatar = message.avatar;
|
|
367
|
+
}
|
|
368
|
+
if (message.createdAt !== undefined) {
|
|
369
|
+
obj.createdAt = message.createdAt;
|
|
370
|
+
}
|
|
371
|
+
if (message.updatedAt !== undefined) {
|
|
372
|
+
obj.updatedAt = message.updatedAt;
|
|
373
|
+
}
|
|
374
|
+
return obj;
|
|
375
|
+
},
|
|
376
|
+
|
|
377
|
+
create<I extends Exact<DeepPartial<User>, I>>(base?: I): User {
|
|
378
|
+
return User.fromPartial(base ?? ({} as any));
|
|
379
|
+
},
|
|
380
|
+
fromPartial<I extends Exact<DeepPartial<User>, I>>(object: I): User {
|
|
381
|
+
const message = createBaseUser();
|
|
382
|
+
message.id = object.id ?? "";
|
|
383
|
+
message.name = object.name ?? undefined;
|
|
384
|
+
message.email = object.email ?? undefined;
|
|
385
|
+
message.phone = object.phone ?? undefined;
|
|
386
|
+
message.avatar = object.avatar ?? undefined;
|
|
387
|
+
message.createdAt = object.createdAt ?? undefined;
|
|
388
|
+
message.updatedAt = object.updatedAt ?? undefined;
|
|
389
|
+
return message;
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
export type UsersServiceService = typeof UsersServiceService;
|
|
394
|
+
export const UsersServiceService = {
|
|
395
|
+
getUserById: {
|
|
396
|
+
path: "/users.v1.UsersService/GetUserById",
|
|
397
|
+
requestStream: false,
|
|
398
|
+
responseStream: false,
|
|
399
|
+
requestSerialize: (value: GetUserByIdRequest): Buffer => Buffer.from(GetUserByIdRequest.encode(value).finish()),
|
|
400
|
+
requestDeserialize: (value: Buffer): GetUserByIdRequest => GetUserByIdRequest.decode(value),
|
|
401
|
+
responseSerialize: (value: UserResponse): Buffer => Buffer.from(UserResponse.encode(value).finish()),
|
|
402
|
+
responseDeserialize: (value: Buffer): UserResponse => UserResponse.decode(value),
|
|
403
|
+
},
|
|
404
|
+
createUser: {
|
|
405
|
+
path: "/users.v1.UsersService/CreateUser",
|
|
406
|
+
requestStream: false,
|
|
407
|
+
responseStream: false,
|
|
408
|
+
requestSerialize: (value: CreateUserRequest): Buffer => Buffer.from(CreateUserRequest.encode(value).finish()),
|
|
409
|
+
requestDeserialize: (value: Buffer): CreateUserRequest => CreateUserRequest.decode(value),
|
|
410
|
+
responseSerialize: (value: Empty): Buffer => Buffer.from(Empty.encode(value).finish()),
|
|
411
|
+
responseDeserialize: (value: Buffer): Empty => Empty.decode(value),
|
|
412
|
+
},
|
|
413
|
+
} as const;
|
|
414
|
+
|
|
415
|
+
export interface UsersServiceServer extends UntypedServiceImplementation {
|
|
416
|
+
getUserById: handleUnaryCall<GetUserByIdRequest, UserResponse>;
|
|
417
|
+
createUser: handleUnaryCall<CreateUserRequest, Empty>;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export interface UsersServiceClient extends Client {
|
|
421
|
+
getUserById(
|
|
422
|
+
request: GetUserByIdRequest,
|
|
423
|
+
callback: (error: ServiceError | null, response: UserResponse) => void,
|
|
424
|
+
): ClientUnaryCall;
|
|
425
|
+
getUserById(
|
|
426
|
+
request: GetUserByIdRequest,
|
|
427
|
+
metadata: Metadata,
|
|
428
|
+
callback: (error: ServiceError | null, response: UserResponse) => void,
|
|
429
|
+
): ClientUnaryCall;
|
|
430
|
+
getUserById(
|
|
431
|
+
request: GetUserByIdRequest,
|
|
432
|
+
metadata: Metadata,
|
|
433
|
+
options: Partial<CallOptions>,
|
|
434
|
+
callback: (error: ServiceError | null, response: UserResponse) => void,
|
|
435
|
+
): ClientUnaryCall;
|
|
436
|
+
createUser(
|
|
437
|
+
request: CreateUserRequest,
|
|
438
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
439
|
+
): ClientUnaryCall;
|
|
440
|
+
createUser(
|
|
441
|
+
request: CreateUserRequest,
|
|
442
|
+
metadata: Metadata,
|
|
443
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
444
|
+
): ClientUnaryCall;
|
|
445
|
+
createUser(
|
|
446
|
+
request: CreateUserRequest,
|
|
447
|
+
metadata: Metadata,
|
|
448
|
+
options: Partial<CallOptions>,
|
|
449
|
+
callback: (error: ServiceError | null, response: Empty) => void,
|
|
450
|
+
): ClientUnaryCall;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
export const UsersServiceClient = makeGenericClientConstructor(
|
|
454
|
+
UsersServiceService,
|
|
455
|
+
"users.v1.UsersService",
|
|
456
|
+
) as unknown as {
|
|
457
|
+
new (address: string, credentials: ChannelCredentials, options?: Partial<ClientOptions>): UsersServiceClient;
|
|
458
|
+
service: typeof UsersServiceService;
|
|
459
|
+
serviceName: string;
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | bigint | undefined;
|
|
463
|
+
|
|
464
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
465
|
+
: T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>>
|
|
466
|
+
: T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
467
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
468
|
+
: Partial<T>;
|
|
469
|
+
|
|
470
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
471
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
472
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
473
|
+
|
|
474
|
+
function isSet(value: any): boolean {
|
|
475
|
+
return value !== null && value !== undefined;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
export interface MessageFns<T> {
|
|
479
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
480
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
481
|
+
fromJSON(object: any): T;
|
|
482
|
+
toJSON(message: T): unknown;
|
|
483
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
484
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
485
|
+
}
|
package/package.json
CHANGED
package/proto/account.proto
CHANGED
|
@@ -11,12 +11,6 @@ option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/account";
|
|
|
11
11
|
service AccountService {
|
|
12
12
|
// Retrieves a specific account by ID
|
|
13
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
14
|
|
|
21
15
|
// init email change
|
|
22
16
|
rpc InitEmailChange (InitEmailChangeRequest) returns (google.protobuf.Empty);
|
|
@@ -55,18 +49,6 @@ message GetAccountRequest {
|
|
|
55
49
|
string id = 1;
|
|
56
50
|
}
|
|
57
51
|
|
|
58
|
-
message UpdateAccountRequest {
|
|
59
|
-
// The account object containing the new values
|
|
60
|
-
Account account = 1;
|
|
61
|
-
|
|
62
|
-
// Specifies which fields in 'account' should be updated.
|
|
63
|
-
// Example: paths: ["email", "phone"]
|
|
64
|
-
google.protobuf.FieldMask update_mask = 2;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
message DeleteAccountRequest {
|
|
68
|
-
string id = 1;
|
|
69
|
-
}
|
|
70
52
|
|
|
71
53
|
message InitEmailChangeRequest {
|
|
72
54
|
string id = 1;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package users.v1;
|
|
4
|
+
|
|
5
|
+
option go_package = "github.com/sa2-movie-ticket/contracts/gen/go/users";
|
|
6
|
+
|
|
7
|
+
import "google/protobuf/empty.proto";
|
|
8
|
+
|
|
9
|
+
service UsersService {
|
|
10
|
+
rpc GetUserById(GetUserByIdRequest) returns (UserResponse);
|
|
11
|
+
rpc CreateUser(CreateUserRequest) returns (google.protobuf.Empty);
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetUserByIdRequest {
|
|
16
|
+
string id = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message CreateUserRequest {
|
|
20
|
+
string id = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message UserResponse {
|
|
24
|
+
User user = 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message User {
|
|
28
|
+
string id = 1;
|
|
29
|
+
optional string name = 2;
|
|
30
|
+
optional string email = 3;
|
|
31
|
+
optional string phone = 4;
|
|
32
|
+
optional string avatar = 5;
|
|
33
|
+
optional string created_at = 6;
|
|
34
|
+
optional string updated_at = 7;
|
|
35
|
+
}
|