@platfformx/proto-contracts 1.0.22 → 1.1.0

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,6 +1,5 @@
1
1
  import { Observable } from "rxjs";
2
2
  export declare const protobufPackage = "auth_service.v1";
3
- /** Shared */
4
3
  export declare enum OAuthProvider {
5
4
  OAUTH_PROVIDER_UNSPECIFIED = 0,
6
5
  OAUTH_PROVIDER_GOOGLE = 1,
@@ -48,20 +47,12 @@ export interface TokenRefreshResponse {
48
47
  accessToken: string;
49
48
  refreshToken: string;
50
49
  }
51
- /** Send otp code */
52
- export interface SendOtpRequest {
50
+ export interface ConfirmAccountRequest {
53
51
  identifier: string;
54
- type: string;
55
- }
56
- export interface SendOtpResponse {
57
- ok: boolean;
58
- }
59
- export interface VerifyOtpRequest {
60
- identifier: string;
61
- type: string;
62
- code: string;
52
+ type?: string | undefined;
53
+ code?: string | undefined;
63
54
  }
64
- export interface VerifyOtpResponse {
55
+ export interface ConfirmAccountResponse {
65
56
  verified: boolean;
66
57
  }
67
58
  export interface AddIdentifierRequest {
@@ -74,8 +65,9 @@ export interface AddIdentifierResponse {
74
65
  }
75
66
  /** reset + forgot password */
76
67
  export interface ResetPasswordRequest {
77
- token: string;
78
68
  newPassword: string;
69
+ token?: string | undefined;
70
+ sms?: SmsCredentialsReset | undefined;
79
71
  }
80
72
  export interface ResetPasswordResponse {
81
73
  ok: boolean;
@@ -87,6 +79,10 @@ export interface ForgotPasswordRequest {
87
79
  export interface ForgotPasswordResponse {
88
80
  ok: boolean;
89
81
  }
82
+ export interface SmsCredentialsReset {
83
+ phone: string;
84
+ otp: string;
85
+ }
90
86
  export interface UserCredentials {
91
87
  email?: string | undefined;
92
88
  phone?: string | undefined;
@@ -110,22 +106,20 @@ export interface AuthServiceClient {
110
106
  authenticate(request: AuthenticationRequest): Observable<AuthenticationResponse>;
111
107
  authenticateWithOAuth(request: OAuthSessionRequest): Observable<OAuthSessionResponse>;
112
108
  refreshTokens(request: TokenRefreshRequest): Observable<TokenRefreshResponse>;
113
- sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
114
- verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
115
- addIdentifier(request: AddIdentifierRequest): Observable<AddIdentifierResponse>;
109
+ confirmAccount(request: ConfirmAccountRequest): Observable<ConfirmAccountResponse>;
116
110
  resetPassword(request: ResetPasswordRequest): Observable<ResetPasswordResponse>;
117
111
  forgotPassword(request: ForgotPasswordRequest): Observable<ForgotPasswordResponse>;
112
+ addIdentifier(request: AddIdentifierRequest): Observable<AddIdentifierResponse>;
118
113
  }
119
114
  export interface AuthServiceController {
120
115
  createAccount(request: CreateAccountRequest): Promise<CreateAccountResponse> | Observable<CreateAccountResponse> | CreateAccountResponse;
121
116
  authenticate(request: AuthenticationRequest): Promise<AuthenticationResponse> | Observable<AuthenticationResponse> | AuthenticationResponse;
122
117
  authenticateWithOAuth(request: OAuthSessionRequest): Promise<OAuthSessionResponse> | Observable<OAuthSessionResponse> | OAuthSessionResponse;
123
118
  refreshTokens(request: TokenRefreshRequest): Promise<TokenRefreshResponse> | Observable<TokenRefreshResponse> | TokenRefreshResponse;
124
- sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
125
- verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
126
- addIdentifier(request: AddIdentifierRequest): Promise<AddIdentifierResponse> | Observable<AddIdentifierResponse> | AddIdentifierResponse;
119
+ confirmAccount(request: ConfirmAccountRequest): Promise<ConfirmAccountResponse> | Observable<ConfirmAccountResponse> | ConfirmAccountResponse;
127
120
  resetPassword(request: ResetPasswordRequest): Promise<ResetPasswordResponse> | Observable<ResetPasswordResponse> | ResetPasswordResponse;
128
121
  forgotPassword(request: ForgotPasswordRequest): Promise<ForgotPasswordResponse> | Observable<ForgotPasswordResponse> | ForgotPasswordResponse;
122
+ addIdentifier(request: AddIdentifierRequest): Promise<AddIdentifierResponse> | Observable<AddIdentifierResponse> | AddIdentifierResponse;
129
123
  }
130
124
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
131
125
  export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -10,7 +10,6 @@ exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
10
10
  /* eslint-disable */
11
11
  const microservices_1 = require("@nestjs/microservices");
12
12
  exports.protobufPackage = "auth_service.v1";
13
- /** Shared */
14
13
  var OAuthProvider;
15
14
  (function (OAuthProvider) {
16
15
  OAuthProvider[OAuthProvider["OAUTH_PROVIDER_UNSPECIFIED"] = 0] = "OAUTH_PROVIDER_UNSPECIFIED";
@@ -27,11 +26,10 @@ function AuthServiceControllerMethods() {
27
26
  "authenticate",
28
27
  "authenticateWithOAuth",
29
28
  "refreshTokens",
30
- "sendOtp",
31
- "verifyOtp",
32
- "addIdentifier",
29
+ "confirmAccount",
33
30
  "resetPassword",
34
31
  "forgotPassword",
32
+ "addIdentifier",
35
33
  ];
36
34
  for (const method of grpcMethods) {
37
35
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platfformx/proto-contracts",
3
- "version": "1.0.22",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,13 +8,13 @@ service AuthService {
8
8
  rpc AuthenticateWithOAuth (OAuthSessionRequest) returns (OAuthSessionResponse);
9
9
  rpc RefreshTokens (TokenRefreshRequest) returns (TokenRefreshResponse);
10
10
 
11
- rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
12
-
13
- rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
14
- rpc AddIdentifier (AddIdentifierRequest) returns (AddIdentifierResponse);
15
-
11
+ rpc ConfirmAccount (ConfirmAccountRequest) returns (ConfirmAccountResponse);
12
+
16
13
  rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse);
17
14
  rpc ForgotPassword (ForgotPasswordRequest) returns (ForgotPasswordResponse);
15
+
16
+ rpc AddIdentifier (AddIdentifierRequest) returns (AddIdentifierResponse);
17
+
18
18
  }
19
19
 
20
20
  // Create account
@@ -63,21 +63,14 @@ message TokenRefreshResponse {
63
63
  string refresh_token = 2;
64
64
  }
65
65
 
66
- // Send otp code
67
- message SendOtpRequest {
68
- string identifier = 1;
69
- string type = 2;
70
- }
71
- message SendOtpResponse {
72
- bool ok = 1;
73
- }
74
-
75
- message VerifyOtpRequest {
66
+ message ConfirmAccountRequest {
76
67
  string identifier = 1;
77
- string type = 2;
78
- string code = 3;
68
+ oneof confirm_method {
69
+ string type = 2;
70
+ string code = 3;
71
+ }
79
72
  }
80
- message VerifyOtpResponse {
73
+ message ConfirmAccountResponse {
81
74
  bool verified = 1;
82
75
  }
83
76
 
@@ -94,8 +87,11 @@ message AddIdentifierResponse{
94
87
 
95
88
  // reset + forgot password
96
89
  message ResetPasswordRequest {
97
- string token = 1;
98
- string newPassword = 2;
90
+ string newPassword = 1;
91
+ oneof reset_method {
92
+ string token = 2;
93
+ SmsCredentialsReset sms = 3;
94
+ }
99
95
  }
100
96
  message ResetPasswordResponse {
101
97
  bool ok = 1;
@@ -112,6 +108,11 @@ message ForgotPasswordResponse {
112
108
  }
113
109
 
114
110
  // Shared
111
+
112
+ message SmsCredentialsReset {
113
+ string phone = 1;
114
+ string otp = 2;
115
+ }
115
116
  enum OAuthProvider {
116
117
  OAUTH_PROVIDER_UNSPECIFIED = 0;
117
118
  OAUTH_PROVIDER_GOOGLE = 1;