@platfformx/proto-contracts 1.0.13 → 1.0.14

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.
@@ -60,6 +60,7 @@ export interface OAuthSessionResponse {
60
60
  /** Tokens */
61
61
  export interface TokenRefreshRequest {
62
62
  refreshToken: string;
63
+ userId: string;
63
64
  }
64
65
 
65
66
  export interface TokenRefreshResponse {
@@ -67,6 +68,36 @@ export interface TokenRefreshResponse {
67
68
  refreshToken: string;
68
69
  }
69
70
 
71
+ /** Send otp code */
72
+ export interface SendOtpRequest {
73
+ identifier: string;
74
+ type: string;
75
+ }
76
+
77
+ export interface SendOtpResponse {
78
+ ok: boolean;
79
+ }
80
+
81
+ export interface VerifyOtpRequest {
82
+ identifier: string;
83
+ type: string;
84
+ code: string;
85
+ }
86
+
87
+ export interface VerifyOtpResponse {
88
+ verified: boolean;
89
+ }
90
+
91
+ export interface AddIdentifierRequest {
92
+ userId: string;
93
+ identifier: string;
94
+ type: string;
95
+ }
96
+
97
+ export interface AddIdentifierResponse {
98
+ ok: boolean;
99
+ }
100
+
70
101
  export interface UserCredentials {
71
102
  email?: string | undefined;
72
103
  phone?: string | undefined;
@@ -91,6 +122,12 @@ export interface AuthServiceClient {
91
122
  authenticateWithOAuth(request: OAuthSessionRequest): Observable<OAuthSessionResponse>;
92
123
 
93
124
  refreshTokens(request: TokenRefreshRequest): Observable<TokenRefreshResponse>;
125
+
126
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
127
+
128
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
129
+
130
+ addIdentifier(request: AddIdentifierRequest): Observable<AddIdentifierResponse>;
94
131
  }
95
132
 
96
133
  export interface AuthServiceController {
@@ -109,11 +146,27 @@ export interface AuthServiceController {
109
146
  refreshTokens(
110
147
  request: TokenRefreshRequest,
111
148
  ): Promise<TokenRefreshResponse> | Observable<TokenRefreshResponse> | TokenRefreshResponse;
149
+
150
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
151
+
152
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
153
+
154
+ addIdentifier(
155
+ request: AddIdentifierRequest,
156
+ ): Promise<AddIdentifierResponse> | Observable<AddIdentifierResponse> | AddIdentifierResponse;
112
157
  }
113
158
 
114
159
  export function AuthServiceControllerMethods() {
115
160
  return function (constructor: Function) {
116
- const grpcMethods: string[] = ["createAccount", "authenticate", "authenticateWithOAuth", "refreshTokens"];
161
+ const grpcMethods: string[] = [
162
+ "createAccount",
163
+ "authenticate",
164
+ "authenticateWithOAuth",
165
+ "refreshTokens",
166
+ "sendOtp",
167
+ "verifyOtp",
168
+ "addIdentifier",
169
+ ];
117
170
  for (const method of grpcMethods) {
118
171
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
119
172
  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.13",
3
+ "version": "1.0.14",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,6 +7,11 @@ service AuthService {
7
7
  rpc Authenticate (AuthenticationRequest) returns (AuthenticationResponse);
8
8
  rpc AuthenticateWithOAuth (OAuthSessionRequest) returns (OAuthSessionResponse);
9
9
  rpc RefreshTokens (TokenRefreshRequest) returns (TokenRefreshResponse);
10
+
11
+ rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
12
+
13
+ rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
14
+ rpc AddIdentifier (AddIdentifierRequest) returns (AddIdentifierResponse);
10
15
  }
11
16
 
12
17
  // Create account
@@ -48,6 +53,7 @@ message OAuthSessionResponse {
48
53
  // Tokens
49
54
  message TokenRefreshRequest {
50
55
  string refresh_token = 1;
56
+ string user_id = 2;
51
57
  }
52
58
 
53
59
  message TokenRefreshResponse {
@@ -55,6 +61,34 @@ message TokenRefreshResponse {
55
61
  string refresh_token = 2;
56
62
  }
57
63
 
64
+ // Send otp code
65
+ message SendOtpRequest {
66
+ string identifier = 1;
67
+ string type = 2;
68
+ }
69
+ message SendOtpResponse {
70
+ bool ok = 1;
71
+ }
72
+
73
+ message VerifyOtpRequest {
74
+ string identifier = 1;
75
+ string type = 2;
76
+ string code = 3;
77
+ }
78
+ message VerifyOtpResponse {
79
+ bool verified = 1;
80
+ }
81
+
82
+
83
+ message AddIdentifierRequest {
84
+ string user_id = 1;
85
+ string identifier = 2;
86
+ string type = 3;
87
+ }
88
+ message AddIdentifierResponse{
89
+ bool ok = 1;
90
+ }
91
+
58
92
  // Shared
59
93
  enum OAuthProvider {
60
94
  OAUTH_PROVIDER_UNSPECIFIED = 0;