@platfformx/proto-contracts 1.0.2 → 1.0.4

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.
@@ -10,17 +10,19 @@ import { Observable } from "rxjs";
10
10
 
11
11
  export const protobufPackage = "auth_service.v1";
12
12
 
13
- export interface RegisterRequest {
14
- credentials?: RegisterCredentials | undefined;
13
+ export interface CreateAccountRequest {
14
+ credentials?: UserCredentials | undefined;
15
15
  oauthToken?: string | undefined;
16
16
  }
17
17
 
18
- export interface RegisterResponse {
18
+ export interface CreateAccountResponse {
19
19
  userId: string;
20
+ accessToken: string;
21
+ refreshToken: string;
20
22
  }
21
23
 
22
24
  export interface AuthenticationRequest {
23
- credentials?: AuthCredentials | undefined;
25
+ credentials?: UserCredentials | undefined;
24
26
  oauthToken?: string | undefined;
25
27
  }
26
28
 
@@ -30,19 +32,14 @@ export interface AuthenticationResponse {
30
32
  user: UserInfo | undefined;
31
33
  }
32
34
 
33
- export interface RegisterCredentials {
34
- email?: string | undefined;
35
- phone?: string | undefined;
36
- password: string;
37
- }
38
-
39
- export interface AuthCredentials {
35
+ export interface UserCredentials {
40
36
  email?: string | undefined;
41
37
  phone?: string | undefined;
42
38
  username?: string | undefined;
43
39
  password: string;
44
40
  }
45
41
 
42
+ /** Токены */
46
43
  export interface TokenRefreshRequest {
47
44
  refreshToken: string;
48
45
  }
@@ -63,7 +60,7 @@ export interface UserInfo {
63
60
  export const AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
64
61
 
65
62
  export interface AuthServiceClient {
66
- register(request: RegisterRequest): Observable<RegisterResponse>;
63
+ createAccount(request: CreateAccountRequest): Observable<CreateAccountResponse>;
67
64
 
68
65
  authenticate(request: AuthenticationRequest): Observable<AuthenticationResponse>;
69
66
 
@@ -71,7 +68,9 @@ export interface AuthServiceClient {
71
68
  }
72
69
 
73
70
  export interface AuthServiceController {
74
- register(request: RegisterRequest): Promise<RegisterResponse> | Observable<RegisterResponse> | RegisterResponse;
71
+ createAccount(
72
+ request: CreateAccountRequest,
73
+ ): Promise<CreateAccountResponse> | Observable<CreateAccountResponse> | CreateAccountResponse;
75
74
 
76
75
  authenticate(
77
76
  request: AuthenticationRequest,
@@ -84,7 +83,7 @@ export interface AuthServiceController {
84
83
 
85
84
  export function AuthServiceControllerMethods() {
86
85
  return function (constructor: Function) {
87
- const grpcMethods: string[] = ["register", "authenticate", "refreshTokens"];
86
+ const grpcMethods: string[] = ["createAccount", "authenticate", "refreshTokens"];
88
87
  for (const method of grpcMethods) {
89
88
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
90
89
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "publishConfig": {
@@ -37,9 +37,9 @@ message AuthenticationResponse {
37
37
 
38
38
 
39
39
  message UserCredentials {
40
- string email = 1;
41
- string phone = 2;
42
- string username = 3;
40
+ optional string email = 1;
41
+ optional string phone = 2;
42
+ optional string username = 3;
43
43
  string password = 4;
44
44
  }
45
45