@platfformx/proto-contracts 1.0.14 → 1.0.16

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.
@@ -43,11 +43,50 @@ export interface OAuthSessionResponse {
43
43
  /** Tokens */
44
44
  export interface TokenRefreshRequest {
45
45
  refreshToken: string;
46
+ userId: string;
46
47
  }
47
48
  export interface TokenRefreshResponse {
48
49
  accessToken: string;
49
50
  refreshToken: string;
50
51
  }
52
+ /** Send otp code */
53
+ export interface SendOtpRequest {
54
+ identifier: string;
55
+ type: string;
56
+ }
57
+ export interface SendOtpResponse {
58
+ ok: boolean;
59
+ }
60
+ export interface VerifyOtpRequest {
61
+ identifier: string;
62
+ type: string;
63
+ code: string;
64
+ }
65
+ export interface VerifyOtpResponse {
66
+ verified: boolean;
67
+ }
68
+ export interface AddIdentifierRequest {
69
+ userId: string;
70
+ identifier: string;
71
+ type: string;
72
+ }
73
+ export interface AddIdentifierResponse {
74
+ ok: boolean;
75
+ }
76
+ /** reset + forgot password */
77
+ export interface ResetPasswordRequest {
78
+ token: string;
79
+ newPassword: string;
80
+ }
81
+ export interface ResetPasswordResponse {
82
+ ok: boolean;
83
+ }
84
+ export interface ForgotPasswordRequest {
85
+ success: boolean;
86
+ }
87
+ export interface ForgotPasswordResponse {
88
+ ok: boolean;
89
+ }
51
90
  export interface UserCredentials {
52
91
  email?: string | undefined;
53
92
  phone?: string | undefined;
@@ -66,12 +105,22 @@ export interface AuthServiceClient {
66
105
  authenticate(request: AuthenticationRequest): Observable<AuthenticationResponse>;
67
106
  authenticateWithOAuth(request: OAuthSessionRequest): Observable<OAuthSessionResponse>;
68
107
  refreshTokens(request: TokenRefreshRequest): Observable<TokenRefreshResponse>;
108
+ sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
109
+ verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
110
+ addIdentifier(request: AddIdentifierRequest): Observable<AddIdentifierResponse>;
111
+ resetPassword(request: ResetPasswordRequest): Observable<ResetPasswordResponse>;
112
+ forgotPassword(request: ForgotPasswordRequest): Observable<ForgotPasswordResponse>;
69
113
  }
70
114
  export interface AuthServiceController {
71
115
  createAccount(request: CreateAccountRequest): Promise<CreateAccountResponse> | Observable<CreateAccountResponse> | CreateAccountResponse;
72
116
  authenticate(request: AuthenticationRequest): Promise<AuthenticationResponse> | Observable<AuthenticationResponse> | AuthenticationResponse;
73
117
  authenticateWithOAuth(request: OAuthSessionRequest): Promise<OAuthSessionResponse> | Observable<OAuthSessionResponse> | OAuthSessionResponse;
74
118
  refreshTokens(request: TokenRefreshRequest): Promise<TokenRefreshResponse> | Observable<TokenRefreshResponse> | TokenRefreshResponse;
119
+ sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
120
+ verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
121
+ addIdentifier(request: AddIdentifierRequest): Promise<AddIdentifierResponse> | Observable<AddIdentifierResponse> | AddIdentifierResponse;
122
+ resetPassword(request: ResetPasswordRequest): Promise<ResetPasswordResponse> | Observable<ResetPasswordResponse> | ResetPasswordResponse;
123
+ forgotPassword(request: ForgotPasswordRequest): Promise<ForgotPasswordResponse> | Observable<ForgotPasswordResponse> | ForgotPasswordResponse;
75
124
  }
76
125
  export declare function AuthServiceControllerMethods(): (constructor: Function) => void;
77
126
  export declare const AUTH_SERVICE_NAME = "AuthService";
@@ -22,7 +22,17 @@ var OAuthProvider;
22
22
  exports.AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
23
23
  function AuthServiceControllerMethods() {
24
24
  return function (constructor) {
25
- const grpcMethods = ["createAccount", "authenticate", "authenticateWithOAuth", "refreshTokens"];
25
+ const grpcMethods = [
26
+ "createAccount",
27
+ "authenticate",
28
+ "authenticateWithOAuth",
29
+ "refreshTokens",
30
+ "sendOtp",
31
+ "verifyOtp",
32
+ "addIdentifier",
33
+ "resetPassword",
34
+ "forgotPassword",
35
+ ];
26
36
  for (const method of grpcMethods) {
27
37
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
28
38
  (0, microservices_1.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.14",
3
+ "version": "1.0.16",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "scripts": {
23
23
  "build": "tsc",
24
- "generate": "mkdirp gen/ts && globstar -- protoc -I=proto proto/**/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,esModuleInterop=true"
24
+ "generate": "mkdirp src/gen/ts && globstar -- protoc -I=proto proto/**/*.proto --ts_proto_out=./src/gen/ts --ts_proto_opt=nestJs=true,esModuleInterop=true"
25
25
  },
26
26
  "keywords": [],
27
27
  "author": "",
@@ -12,6 +12,9 @@ service AuthService {
12
12
 
13
13
  rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
14
14
  rpc AddIdentifier (AddIdentifierRequest) returns (AddIdentifierResponse);
15
+
16
+ rpc ResetPassword (ResetPasswordRequest) returns (ResetPasswordResponse);
17
+ rpc ForgotPassword (ForgotPasswordRequest) returns (ForgotPasswordResponse);
15
18
  }
16
19
 
17
20
  // Create account
@@ -89,6 +92,23 @@ message AddIdentifierResponse{
89
92
  bool ok = 1;
90
93
  }
91
94
 
95
+
96
+ // reset + forgot password
97
+ message ResetPasswordRequest {
98
+ string token = 1;
99
+ string newPassword = 2;
100
+ }
101
+ message ResetPasswordResponse {
102
+ bool ok = 1;
103
+
104
+ }
105
+ message ForgotPasswordRequest {
106
+ bool success = 1;
107
+ }
108
+ message ForgotPasswordResponse {
109
+ bool ok =1;
110
+ }
111
+
92
112
  // Shared
93
113
  enum OAuthProvider {
94
114
  OAUTH_PROVIDER_UNSPECIFIED = 0;
@@ -1,168 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v7.34.0
5
- // source: auth-service/account.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
-
11
- export const protobufPackage = "auth_service.v1";
12
-
13
- export interface GetAccountRequest {
14
- userId: string;
15
- }
16
-
17
- export interface GetAccountResponse {
18
- userId: string;
19
- email?: string | undefined;
20
- phone?: string | undefined;
21
- username?: string | undefined;
22
- isPhoneVerified: boolean;
23
- isEmailVerified: boolean;
24
- }
25
-
26
- export interface InitEmailChangeRequest {
27
- userId: string;
28
- email: string;
29
- }
30
-
31
- export interface InitEmailChangeResponse {
32
- verificationId: string;
33
- }
34
-
35
- export interface InitPhoneChangeRequest {
36
- userId: string;
37
- phone: string;
38
- }
39
-
40
- export interface InitPhoneChangeResponse {
41
- verificationId: string;
42
- }
43
-
44
- export interface ConfirmEmailChangeRequest {
45
- userId: string;
46
- email: string;
47
- verificationId: string;
48
- code: string;
49
- }
50
-
51
- export interface ConfirmEmailChangeResponse {
52
- }
53
-
54
- export interface ConfirmPhoneChangeRequest {
55
- userId: string;
56
- phone: string;
57
- verificationId: string;
58
- code: string;
59
- }
60
-
61
- export interface ConfirmPhoneChangeResponse {
62
- }
63
-
64
- export interface PatchAccountRequest {
65
- userId: string;
66
- username?: string | undefined;
67
- displayName?: string | undefined;
68
- email?: string | undefined;
69
- phone?: string | undefined;
70
- }
71
-
72
- export interface PatchAccountResponse {
73
- userId: string;
74
- username?: string | undefined;
75
- displayName?: string | undefined;
76
- phone?: string | undefined;
77
- email?: string | undefined;
78
- isPhoneVerified: boolean;
79
- isEmailVerified: boolean;
80
- }
81
-
82
- export interface ChangePasswordRequest {
83
- userId: string;
84
- oldPassword: string;
85
- newPasword: string;
86
- }
87
-
88
- export interface ChangePasswordResponse {
89
- }
90
-
91
- export interface LinkOAuthRequest {
92
- userId: string;
93
- oauthToken: string;
94
- }
95
-
96
- export interface LinkOAuthResponse {
97
- }
98
-
99
- export const AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
100
-
101
- export interface AccountServiceClient {
102
- getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
103
-
104
- patchAccount(request: PatchAccountRequest): Observable<PatchAccountResponse>;
105
-
106
- initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
107
-
108
- initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
109
-
110
- confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
111
-
112
- confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
113
-
114
- linkOAuth(request: LinkOAuthRequest): Observable<LinkOAuthResponse>;
115
- }
116
-
117
- export interface AccountServiceController {
118
- getAccount(
119
- request: GetAccountRequest,
120
- ): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
121
-
122
- patchAccount(
123
- request: PatchAccountRequest,
124
- ): Promise<PatchAccountResponse> | Observable<PatchAccountResponse> | PatchAccountResponse;
125
-
126
- initEmailChange(
127
- request: InitEmailChangeRequest,
128
- ): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
129
-
130
- initPhoneChange(
131
- request: InitPhoneChangeRequest,
132
- ): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
133
-
134
- confirmEmailChange(
135
- request: ConfirmEmailChangeRequest,
136
- ): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
137
-
138
- confirmPhoneChange(
139
- request: ConfirmPhoneChangeRequest,
140
- ): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
141
-
142
- linkOAuth(request: LinkOAuthRequest): Promise<LinkOAuthResponse> | Observable<LinkOAuthResponse> | LinkOAuthResponse;
143
- }
144
-
145
- export function AccountServiceControllerMethods() {
146
- return function (constructor: Function) {
147
- const grpcMethods: string[] = [
148
- "getAccount",
149
- "patchAccount",
150
- "initEmailChange",
151
- "initPhoneChange",
152
- "confirmEmailChange",
153
- "confirmPhoneChange",
154
- "linkOAuth",
155
- ];
156
- for (const method of grpcMethods) {
157
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
158
- GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
159
- }
160
- const grpcStreamMethods: string[] = [];
161
- for (const method of grpcStreamMethods) {
162
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
163
- GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
164
- }
165
- };
166
- }
167
-
168
- export const ACCOUNT_SERVICE_NAME = "AccountService";
@@ -1,182 +0,0 @@
1
- // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
- // versions:
3
- // protoc-gen-ts_proto v2.11.8
4
- // protoc v7.34.0
5
- // source: auth-service/auth.proto
6
-
7
- /* eslint-disable */
8
- import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
- import { Observable } from "rxjs";
10
-
11
- export const protobufPackage = "auth_service.v1";
12
-
13
- /** Shared */
14
- export enum OAuthProvider {
15
- OAUTH_PROVIDER_UNSPECIFIED = 0,
16
- OAUTH_PROVIDER_GOOGLE = 1,
17
- OAUTH_PROVIDER_GITHUB = 2,
18
- OAUTH_PROVIDER_TELEGRAM = 3,
19
- UNRECOGNIZED = -1,
20
- }
21
-
22
- /** Create account */
23
- export interface CreateAccountRequest {
24
- credentials: UserCredentials | undefined;
25
- }
26
-
27
- export interface CreateAccountResponse {
28
- userId: string;
29
- accessToken: string;
30
- refreshToken: string;
31
- user: UserProfile | undefined;
32
- }
33
-
34
- /** Authenticate credentials */
35
- export interface AuthenticationRequest {
36
- credentials: UserCredentials | undefined;
37
- }
38
-
39
- export interface AuthenticationResponse {
40
- userId: string;
41
- accessToken: string;
42
- refreshToken: string;
43
- user: UserProfile | undefined;
44
- }
45
-
46
- /** AuthenticateWithOAuth */
47
- export interface OAuthSessionRequest {
48
- provider: OAuthProvider;
49
- token: string;
50
- }
51
-
52
- export interface OAuthSessionResponse {
53
- userId: string;
54
- accessToken: string;
55
- refreshToken: string;
56
- user: UserProfile | undefined;
57
- isNewUser: boolean;
58
- }
59
-
60
- /** Tokens */
61
- export interface TokenRefreshRequest {
62
- refreshToken: string;
63
- userId: string;
64
- }
65
-
66
- export interface TokenRefreshResponse {
67
- accessToken: string;
68
- refreshToken: string;
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
-
101
- export interface UserCredentials {
102
- email?: string | undefined;
103
- phone?: string | undefined;
104
- username?: string | undefined;
105
- password: string;
106
- }
107
-
108
- export interface UserProfile {
109
- email?: string | undefined;
110
- phone?: string | undefined;
111
- username?: string | undefined;
112
- displayName?: string | undefined;
113
- }
114
-
115
- export const AUTH_SERVICE_V1_PACKAGE_NAME = "auth_service.v1";
116
-
117
- export interface AuthServiceClient {
118
- createAccount(request: CreateAccountRequest): Observable<CreateAccountResponse>;
119
-
120
- authenticate(request: AuthenticationRequest): Observable<AuthenticationResponse>;
121
-
122
- authenticateWithOAuth(request: OAuthSessionRequest): Observable<OAuthSessionResponse>;
123
-
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>;
131
- }
132
-
133
- export interface AuthServiceController {
134
- createAccount(
135
- request: CreateAccountRequest,
136
- ): Promise<CreateAccountResponse> | Observable<CreateAccountResponse> | CreateAccountResponse;
137
-
138
- authenticate(
139
- request: AuthenticationRequest,
140
- ): Promise<AuthenticationResponse> | Observable<AuthenticationResponse> | AuthenticationResponse;
141
-
142
- authenticateWithOAuth(
143
- request: OAuthSessionRequest,
144
- ): Promise<OAuthSessionResponse> | Observable<OAuthSessionResponse> | OAuthSessionResponse;
145
-
146
- refreshTokens(
147
- request: TokenRefreshRequest,
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;
157
- }
158
-
159
- export function AuthServiceControllerMethods() {
160
- return function (constructor: Function) {
161
- const grpcMethods: string[] = [
162
- "createAccount",
163
- "authenticate",
164
- "authenticateWithOAuth",
165
- "refreshTokens",
166
- "sendOtp",
167
- "verifyOtp",
168
- "addIdentifier",
169
- ];
170
- for (const method of grpcMethods) {
171
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
172
- GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
173
- }
174
- const grpcStreamMethods: string[] = [];
175
- for (const method of grpcStreamMethods) {
176
- const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
177
- GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
178
- }
179
- };
180
- }
181
-
182
- export const AUTH_SERVICE_NAME = "AuthService";