@platfformx/proto-contracts 1.1.3 → 1.1.5

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.
@@ -1,22 +1,14 @@
1
1
  import { Observable } from "rxjs";
2
2
  export declare const protobufPackage = "auth_service.v1";
3
- export declare enum Role {
4
- USER = 0,
5
- ADMIN = 1,
6
- UNRECOGNIZED = -1
7
- }
8
3
  /** Get account */
9
- export interface GetAccountRequest {
4
+ export interface GetProfileRequest {
10
5
  userId: string;
11
6
  }
12
- export interface GetAccountResponse {
13
- userId: string;
14
- email?: string | undefined;
15
- phone?: string | undefined;
16
- username?: string | undefined;
17
- isPhoneVerified: boolean;
18
- isEmailVerified: boolean;
19
- role: Role;
7
+ export interface GetProfileResponse {
8
+ id: string;
9
+ firstName?: string | undefined;
10
+ lastName?: string | undefined;
11
+ picture?: string | undefined;
20
12
  }
21
13
  /** init + change email */
22
14
  export interface InitEmailChangeRequest {
@@ -81,7 +73,7 @@ export interface LinkOAuthResponse {
81
73
  }
82
74
  export declare const AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
83
75
  export interface AccountServiceClient {
84
- getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
76
+ getProfile(request: GetProfileRequest): Observable<GetProfileResponse>;
85
77
  updateProfile(request: UpdateProfileRequest): Observable<UpdateProfileRequest>;
86
78
  initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
87
79
  initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
@@ -90,7 +82,7 @@ export interface AccountServiceClient {
90
82
  linkOAuth(request: LinkOAuthRequest): Observable<LinkOAuthResponse>;
91
83
  }
92
84
  export interface AccountServiceController {
93
- getAccount(request: GetAccountRequest): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
85
+ getProfile(request: GetProfileRequest): Promise<GetProfileResponse> | Observable<GetProfileResponse> | GetProfileResponse;
94
86
  updateProfile(request: UpdateProfileRequest): Promise<UpdateProfileRequest> | Observable<UpdateProfileRequest> | UpdateProfileRequest;
95
87
  initEmailChange(request: InitEmailChangeRequest): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
96
88
  initPhoneChange(request: InitPhoneChangeRequest): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
@@ -5,22 +5,16 @@
5
5
  // protoc v7.34.0
6
6
  // source: auth-service/account.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.ACCOUNT_SERVICE_NAME = exports.AUTH_SERVICE_V1_PACKAGE_NAME = exports.Role = exports.protobufPackage = void 0;
8
+ exports.ACCOUNT_SERVICE_NAME = exports.AUTH_SERVICE_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
9
  exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
12
  exports.protobufPackage = "auth_service.v1";
13
- var Role;
14
- (function (Role) {
15
- Role[Role["USER"] = 0] = "USER";
16
- Role[Role["ADMIN"] = 1] = "ADMIN";
17
- Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
18
- })(Role || (exports.Role = Role = {}));
19
13
  exports.AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
20
14
  function AccountServiceControllerMethods() {
21
15
  return function (constructor) {
22
16
  const grpcMethods = [
23
- "getAccount",
17
+ "getProfile",
24
18
  "updateProfile",
25
19
  "initEmailChange",
26
20
  "initPhoneChange",
@@ -7,12 +7,30 @@ export declare enum OAuthProvider {
7
7
  OAUTH_PROVIDER_TELEGRAM = 3,
8
8
  UNRECOGNIZED = -1
9
9
  }
10
+ export declare enum Role {
11
+ USER = 0,
12
+ ADMIN = 1,
13
+ UNRECOGNIZED = -1
14
+ }
15
+ /** Get auth account data */
16
+ export interface GetAuthAccountRequest {
17
+ userId: string;
18
+ }
19
+ export interface GetAuthAccountResponse {
20
+ id: string;
21
+ email?: string | undefined;
22
+ phone?: string | undefined;
23
+ username?: string | undefined;
24
+ isPhoneVerified: boolean;
25
+ isEmailVerified: boolean;
26
+ role: Role;
27
+ }
10
28
  /** Create account */
11
29
  export interface CreateAccountRequest {
12
30
  credentials: UserCredentials | undefined;
13
31
  }
14
32
  export interface CreateAccountResponse {
15
- userId: string;
33
+ id: string;
16
34
  accessToken: string;
17
35
  refreshToken: string;
18
36
  user: UserProfile | undefined;
@@ -22,7 +40,7 @@ export interface AuthenticationRequest {
22
40
  credentials: UserCredentialsLogin | undefined;
23
41
  }
24
42
  export interface AuthenticationResponse {
25
- userId: string;
43
+ id: string;
26
44
  accessToken: string;
27
45
  refreshToken: string;
28
46
  user: UserProfile | undefined;
@@ -120,6 +138,7 @@ export interface AuthServiceClient {
120
138
  authenticate(request: AuthenticationRequest): Observable<AuthenticationResponse>;
121
139
  authenticateWithOAuth(request: OAuthSessionRequest): Observable<OAuthSessionResponse>;
122
140
  logout(request: LogoutRequest): Observable<LogoutResponse>;
141
+ getAuthAccount(request: GetAuthAccountRequest): Observable<GetAuthAccountResponse>;
123
142
  refreshTokens(request: TokenRefreshRequest): Observable<TokenRefreshResponse>;
124
143
  confirmAccount(request: ConfirmAccountRequest): Observable<ConfirmAccountResponse>;
125
144
  resendVerification(request: ResendVerificationRequest): Observable<ResendVerificationResponse>;
@@ -132,6 +151,7 @@ export interface AuthServiceController {
132
151
  authenticate(request: AuthenticationRequest): Promise<AuthenticationResponse> | Observable<AuthenticationResponse> | AuthenticationResponse;
133
152
  authenticateWithOAuth(request: OAuthSessionRequest): Promise<OAuthSessionResponse> | Observable<OAuthSessionResponse> | OAuthSessionResponse;
134
153
  logout(request: LogoutRequest): Promise<LogoutResponse> | Observable<LogoutResponse> | LogoutResponse;
154
+ getAuthAccount(request: GetAuthAccountRequest): Promise<GetAuthAccountResponse> | Observable<GetAuthAccountResponse> | GetAuthAccountResponse;
135
155
  refreshTokens(request: TokenRefreshRequest): Promise<TokenRefreshResponse> | Observable<TokenRefreshResponse> | TokenRefreshResponse;
136
156
  confirmAccount(request: ConfirmAccountRequest): Promise<ConfirmAccountResponse> | Observable<ConfirmAccountResponse> | ConfirmAccountResponse;
137
157
  resendVerification(request: ResendVerificationRequest): Promise<ResendVerificationResponse> | Observable<ResendVerificationResponse> | ResendVerificationResponse;
@@ -5,7 +5,7 @@
5
5
  // protoc v7.34.0
6
6
  // source: auth-service/auth.proto
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.AUTH_SERVICE_NAME = exports.AUTH_SERVICE_V1_PACKAGE_NAME = exports.OAuthProvider = exports.protobufPackage = void 0;
8
+ exports.AUTH_SERVICE_NAME = exports.AUTH_SERVICE_V1_PACKAGE_NAME = exports.Role = exports.OAuthProvider = exports.protobufPackage = void 0;
9
9
  exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
@@ -18,6 +18,12 @@ var OAuthProvider;
18
18
  OAuthProvider[OAuthProvider["OAUTH_PROVIDER_TELEGRAM"] = 3] = "OAUTH_PROVIDER_TELEGRAM";
19
19
  OAuthProvider[OAuthProvider["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
20
  })(OAuthProvider || (exports.OAuthProvider = OAuthProvider = {}));
21
+ var Role;
22
+ (function (Role) {
23
+ Role[Role["USER"] = 0] = "USER";
24
+ Role[Role["ADMIN"] = 1] = "ADMIN";
25
+ Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
26
+ })(Role || (exports.Role = Role = {}));
21
27
  exports.AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
22
28
  function AuthServiceControllerMethods() {
23
29
  return function (constructor) {
@@ -26,6 +32,7 @@ function AuthServiceControllerMethods() {
26
32
  "authenticate",
27
33
  "authenticateWithOAuth",
28
34
  "logout",
35
+ "getAuthAccount",
29
36
  "refreshTokens",
30
37
  "confirmAccount",
31
38
  "resendVerification",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,6 +7,8 @@ service AuthService {
7
7
  rpc Authenticate (AuthenticationRequest) returns (AuthenticationResponse);
8
8
  rpc AuthenticateWithOAuth (OAuthSessionRequest) returns (OAuthSessionResponse);
9
9
  rpc Logout (LogoutRequest) returns (LogoutResponse);
10
+ rpc GetAuthAccount (GetAuthAccountRequest) returns (GetAuthAccountResponse);
11
+
10
12
  rpc RefreshTokens (TokenRefreshRequest) returns (TokenRefreshResponse);
11
13
 
12
14
  rpc ConfirmAccount (ConfirmAccountRequest) returns (ConfirmAccountResponse);
@@ -19,13 +21,30 @@ service AuthService {
19
21
 
20
22
  }
21
23
 
24
+
25
+ // Get auth account data
26
+ message GetAuthAccountRequest {
27
+ string user_id = 1;
28
+ }
29
+
30
+ message GetAuthAccountResponse {
31
+ string id = 1;
32
+ optional string email = 2;
33
+ optional string phone = 3;
34
+ optional string username = 4;
35
+ bool is_phone_verified = 5;
36
+ bool is_email_verified = 6;
37
+ Role role = 7;
38
+ }
39
+
40
+
22
41
  // Create account
23
42
  message CreateAccountRequest {
24
43
  UserCredentials credentials = 1;
25
44
  }
26
45
 
27
46
  message CreateAccountResponse {
28
- string user_id = 1;
47
+ string id = 1;
29
48
  string access_token = 2;
30
49
  string refresh_token = 3;
31
50
  UserProfile user = 4;
@@ -37,7 +56,7 @@ message AuthenticationRequest {
37
56
  }
38
57
 
39
58
  message AuthenticationResponse {
40
- string user_id = 1;
59
+ string id = 1;
41
60
  string access_token = 2;
42
61
  string refresh_token = 3;
43
62
  UserProfile user = 4;
@@ -165,3 +184,8 @@ message UserProfile {
165
184
  optional string display_name = 4;
166
185
  }
167
186
 
187
+ enum Role {
188
+ USER = 0;
189
+ ADMIN = 1;
190
+ }
191
+
@@ -1,9 +1,9 @@
1
1
  syntax = "proto3";
2
2
 
3
- package auth_service.v1;
3
+ package users_service.v1;
4
4
 
5
5
  service AccountService {
6
- rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
6
+ rpc GetProfile (GetProfileRequest) returns (GetProfileResponse);
7
7
  rpc UpdateProfile (UpdateProfileRequest) returns (UpdateProfileRequest);
8
8
  rpc InitEmailChange (InitEmailChangeRequest) returns (InitEmailChangeResponse);
9
9
  rpc InitPhoneChange (InitPhoneChangeRequest) returns (InitPhoneChangeResponse);
@@ -14,20 +14,16 @@ service AccountService {
14
14
 
15
15
 
16
16
  // Get account
17
- message GetAccountRequest {
18
- string user_id = 1;
19
- }
17
+ message GetProfileRequest {
18
+ string user_id = 1;
20
19
 
21
- message GetAccountResponse {
22
- string user_id = 1;
23
- optional string email = 2;
24
- optional string phone = 3;
25
- optional string username = 4;
26
- bool is_phone_verified = 5;
27
- bool is_email_verified = 6;
28
- Role role = 7;
29
20
  }
30
-
21
+ message GetProfileResponse {
22
+ string id = 1;
23
+ optional string first_name = 2;
24
+ optional string last_name = 3;
25
+ optional string picture = 4;
26
+ }
31
27
 
32
28
  // init + change email
33
29
  message InitEmailChangeRequest {
@@ -106,9 +102,3 @@ message LinkOAuthRequest {
106
102
  message LinkOAuthResponse {
107
103
 
108
104
  }
109
-
110
- enum Role {
111
- USER = 0;
112
- ADMIN = 1;
113
- }
114
-