@cinema-mc/contacts 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +2 -1
- package/gen/account.ts +151 -0
- package/package.json +1 -1
- package/proto/account.proto +68 -0
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PROTO_PATHS = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
exports.PROTO_PATHS = {
|
|
6
|
-
AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto')
|
|
6
|
+
AUTH: (0, path_1.join)(__dirname, '../../proto/auth.proto'),
|
|
7
|
+
ACCOUNT: (0, path_1.join)(__dirname, '../../proto/account.proto')
|
|
7
8
|
};
|
package/gen/account.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: account.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "account.v1";
|
|
12
|
+
|
|
13
|
+
export enum Role {
|
|
14
|
+
USER = 0,
|
|
15
|
+
ADMIN = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GetAccountRequest {
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface GetAccountResponse {
|
|
24
|
+
id: string;
|
|
25
|
+
phone: string;
|
|
26
|
+
email: string;
|
|
27
|
+
isPhoneVerified: boolean;
|
|
28
|
+
isEmailVerified: boolean;
|
|
29
|
+
role: Role;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface InitEmailChangeRequest {
|
|
33
|
+
email: string;
|
|
34
|
+
userId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InitEmailChangeResponse {
|
|
38
|
+
ok: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ConfirmEmailChangeRequest {
|
|
42
|
+
email: string;
|
|
43
|
+
code: string;
|
|
44
|
+
userId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ConfirmEmailChangeResponse {
|
|
48
|
+
ok: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface InitPhoneChangeRequest {
|
|
52
|
+
phone: string;
|
|
53
|
+
userId: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface InitPhoneChangeResponse {
|
|
57
|
+
ok: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface ConfirmPhoneChangeRequest {
|
|
61
|
+
phone: string;
|
|
62
|
+
code: string;
|
|
63
|
+
userId: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ConfirmPhoneChangeResponse {
|
|
67
|
+
ok: boolean;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
71
|
+
|
|
72
|
+
/** Account Service */
|
|
73
|
+
|
|
74
|
+
export interface AccountServiceClient {
|
|
75
|
+
/** Get all account info */
|
|
76
|
+
|
|
77
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
78
|
+
|
|
79
|
+
/** Initiate the process of changing the email address for an account */
|
|
80
|
+
|
|
81
|
+
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
82
|
+
|
|
83
|
+
/** Confirms the email change for an account. */
|
|
84
|
+
|
|
85
|
+
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
86
|
+
|
|
87
|
+
/** Initiate the process of changing the Phone address for an account */
|
|
88
|
+
|
|
89
|
+
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
90
|
+
|
|
91
|
+
/** Confirms the Phone change for an account. */
|
|
92
|
+
|
|
93
|
+
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** Account Service */
|
|
97
|
+
|
|
98
|
+
export interface AccountServiceController {
|
|
99
|
+
/** Get all account info */
|
|
100
|
+
|
|
101
|
+
getAccount(
|
|
102
|
+
request: GetAccountRequest,
|
|
103
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
104
|
+
|
|
105
|
+
/** Initiate the process of changing the email address for an account */
|
|
106
|
+
|
|
107
|
+
initEmailChange(
|
|
108
|
+
request: InitEmailChangeRequest,
|
|
109
|
+
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
110
|
+
|
|
111
|
+
/** Confirms the email change for an account. */
|
|
112
|
+
|
|
113
|
+
confirmEmailChange(
|
|
114
|
+
request: ConfirmEmailChangeRequest,
|
|
115
|
+
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
116
|
+
|
|
117
|
+
/** Initiate the process of changing the Phone address for an account */
|
|
118
|
+
|
|
119
|
+
initPhoneChange(
|
|
120
|
+
request: InitPhoneChangeRequest,
|
|
121
|
+
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
122
|
+
|
|
123
|
+
/** Confirms the Phone change for an account. */
|
|
124
|
+
|
|
125
|
+
confirmPhoneChange(
|
|
126
|
+
request: ConfirmPhoneChangeRequest,
|
|
127
|
+
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function AccountServiceControllerMethods() {
|
|
131
|
+
return function (constructor: Function) {
|
|
132
|
+
const grpcMethods: string[] = [
|
|
133
|
+
"getAccount",
|
|
134
|
+
"initEmailChange",
|
|
135
|
+
"confirmEmailChange",
|
|
136
|
+
"initPhoneChange",
|
|
137
|
+
"confirmPhoneChange",
|
|
138
|
+
];
|
|
139
|
+
for (const method of grpcMethods) {
|
|
140
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
141
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
142
|
+
}
|
|
143
|
+
const grpcStreamMethods: string[] = [];
|
|
144
|
+
for (const method of grpcStreamMethods) {
|
|
145
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
146
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
//Account Service
|
|
6
|
+
service AccountService {
|
|
7
|
+
//Get all account info
|
|
8
|
+
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
9
|
+
// Initiate the process of changing the email address for an account
|
|
10
|
+
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
11
|
+
// Confirms the email change for an account.
|
|
12
|
+
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
13
|
+
// Initiate the process of changing the Phone address for an account
|
|
14
|
+
rpc InitPhoneChange(InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
|
|
15
|
+
// Confirms the Phone change for an account.
|
|
16
|
+
rpc ConfirmPhoneChange(ConfirmPhoneChangeRequest) returns (ConfirmPhoneChangeResponse);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetAccountRequest {
|
|
20
|
+
string id = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message GetAccountResponse {
|
|
24
|
+
string id = 1;
|
|
25
|
+
string phone = 2;
|
|
26
|
+
string email = 3;
|
|
27
|
+
bool is_phone_verified = 4;
|
|
28
|
+
bool is_email_verified = 5;
|
|
29
|
+
Role role = 6;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
message InitEmailChangeRequest {
|
|
34
|
+
string email = 1;
|
|
35
|
+
string user_id = 2;
|
|
36
|
+
}
|
|
37
|
+
message InitEmailChangeResponse {
|
|
38
|
+
bool ok = 1;
|
|
39
|
+
}
|
|
40
|
+
message ConfirmEmailChangeRequest {
|
|
41
|
+
string email = 1;
|
|
42
|
+
string code = 2;
|
|
43
|
+
string user_id = 3;
|
|
44
|
+
}
|
|
45
|
+
message ConfirmEmailChangeResponse {
|
|
46
|
+
bool ok = 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message InitPhoneChangeRequest {
|
|
50
|
+
string phone = 1;
|
|
51
|
+
string user_id = 2;
|
|
52
|
+
}
|
|
53
|
+
message InitPhoneChangeResponse {
|
|
54
|
+
bool ok = 1;
|
|
55
|
+
}
|
|
56
|
+
message ConfirmPhoneChangeRequest {
|
|
57
|
+
string phone = 1;
|
|
58
|
+
string code = 2;
|
|
59
|
+
string user_id = 3;
|
|
60
|
+
}
|
|
61
|
+
message ConfirmPhoneChangeResponse {
|
|
62
|
+
bool ok = 1;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
enum Role {
|
|
66
|
+
USER = 0;
|
|
67
|
+
ADMIN = 1;
|
|
68
|
+
}
|