@arbiwallet/contracts 1.0.7 → 1.0.9

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.
package/gen/auth.ts CHANGED
@@ -28,13 +28,15 @@ export interface AppleAuthRequest {
28
28
  identityToken: string;
29
29
  }
30
30
 
31
- export interface PhoneRequestCodeRequest {
32
- phone: string;
31
+ export interface ContactCodeRequest {
32
+ contact: string;
33
+ isAuth: boolean;
33
34
  }
34
35
 
35
- export interface PhoneVerifyCodeRequest {
36
- phone: string;
36
+ export interface ContactVerifyRequest {
37
+ contact: string;
37
38
  code: string;
39
+ isAuth: boolean;
38
40
  }
39
41
 
40
42
  export interface RefreshTokenRequest {
@@ -71,9 +73,9 @@ export interface AuthServiceClient {
71
73
 
72
74
  appleAuth(request: AppleAuthRequest): Observable<AuthTokensResponse>;
73
75
 
74
- requestPhoneCode(request: PhoneRequestCodeRequest): Observable<MessageResponse>;
76
+ requestContactCode(request: ContactCodeRequest): Observable<MessageResponse>;
75
77
 
76
- verifyPhoneCode(request: PhoneVerifyCodeRequest): Observable<AuthTokensResponse>;
78
+ verifyContactCode(request: ContactVerifyRequest): Observable<AuthTokensResponse>;
77
79
 
78
80
  refreshToken(request: RefreshTokenRequest): Observable<AccessTokenResponse>;
79
81
 
@@ -95,12 +97,12 @@ export interface AuthServiceController {
95
97
  request: AppleAuthRequest,
96
98
  ): Promise<AuthTokensResponse> | Observable<AuthTokensResponse> | AuthTokensResponse;
97
99
 
98
- requestPhoneCode(
99
- request: PhoneRequestCodeRequest,
100
+ requestContactCode(
101
+ request: ContactCodeRequest,
100
102
  ): Promise<MessageResponse> | Observable<MessageResponse> | MessageResponse;
101
103
 
102
- verifyPhoneCode(
103
- request: PhoneVerifyCodeRequest,
104
+ verifyContactCode(
105
+ request: ContactVerifyRequest,
104
106
  ): Promise<AuthTokensResponse> | Observable<AuthTokensResponse> | AuthTokensResponse;
105
107
 
106
108
  refreshToken(
@@ -118,8 +120,8 @@ export function AuthServiceControllerMethods() {
118
120
  "telegramAuth",
119
121
  "googleAuth",
120
122
  "appleAuth",
121
- "requestPhoneCode",
122
- "verifyPhoneCode",
123
+ "requestContactCode",
124
+ "verifyContactCode",
123
125
  "refreshToken",
124
126
  "logout",
125
127
  "getMe",
@@ -13,11 +13,13 @@ export const protobufPackage = "notification";
13
13
  export interface EmailVerificationCodeRequest {
14
14
  email: string;
15
15
  code: string;
16
+ isAuth: boolean;
16
17
  }
17
18
 
18
19
  export interface PhoneVerificationCodeRequest {
19
20
  phone: string;
20
21
  code: string;
22
+ isAuth: boolean;
21
23
  }
22
24
 
23
25
  export interface NotificationResultResponse {
package/gen/user.ts ADDED
@@ -0,0 +1,57 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v7.34.0
5
+ // source: user.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+
11
+ export const protobufPackage = "user";
12
+
13
+ export interface GetUserRequest {
14
+ id: number;
15
+ }
16
+
17
+ export interface UserResponse {
18
+ id: number;
19
+ email?: string | undefined;
20
+ phone?: string | undefined;
21
+ telegramId?: string | undefined;
22
+ telegramUsername?: string | undefined;
23
+ appleSub?: string | undefined;
24
+ registrationType: string;
25
+ firstName?: string | undefined;
26
+ lastName?: string | undefined;
27
+ avatar?: string | undefined;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ }
31
+
32
+ export const USER_PACKAGE_NAME = "user";
33
+
34
+ export interface UserServiceClient {
35
+ getUser(request: GetUserRequest): Observable<UserResponse>;
36
+ }
37
+
38
+ export interface UserServiceController {
39
+ getUser(request: GetUserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
40
+ }
41
+
42
+ export function UserServiceControllerMethods() {
43
+ return function (constructor: Function) {
44
+ const grpcMethods: string[] = ["getUser"];
45
+ for (const method of grpcMethods) {
46
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
47
+ GrpcMethod("UserService", method)(constructor.prototype[method], method, descriptor);
48
+ }
49
+ const grpcStreamMethods: string[] = [];
50
+ for (const method of grpcStreamMethods) {
51
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
52
+ GrpcStreamMethod("UserService", method)(constructor.prototype[method], method, descriptor);
53
+ }
54
+ };
55
+ }
56
+
57
+ export const USER_SERVICE_NAME = "UserService";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arbiwallet/contracts",
3
3
  "descriptions": "Generate and manage smart contracts for ArbiWallet",
4
- "version": "1.0.7",
4
+ "version": "1.0.9",
5
5
  "scripts": {
6
6
  "generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit"
7
7
  },
package/proto/auth.proto CHANGED
@@ -5,8 +5,8 @@ service AuthService {
5
5
  rpc TelegramAuth (TelegramAuthRequest) returns (AuthTokensResponse);
6
6
  rpc GoogleAuth (GoogleAuthRequest) returns (AuthTokensResponse);
7
7
  rpc AppleAuth (AppleAuthRequest) returns (AuthTokensResponse);
8
- rpc RequestPhoneCode (PhoneRequestCodeRequest) returns (MessageResponse);
9
- rpc VerifyPhoneCode (PhoneVerifyCodeRequest) returns (AuthTokensResponse);
8
+ rpc RequestContactCode (ContactCodeRequest) returns (MessageResponse);
9
+ rpc VerifyContactCode (ContactVerifyRequest) returns (AuthTokensResponse);
10
10
  rpc RefreshToken (RefreshTokenRequest) returns (AccessTokenResponse);
11
11
  rpc Logout (RefreshTokenRequest) returns (MessageResponse);
12
12
  rpc GetMe (AccessTokenRequest) returns (MeResponse);
@@ -30,13 +30,15 @@ message AppleAuthRequest {
30
30
  string identity_token = 1;
31
31
  }
32
32
 
33
- message PhoneRequestCodeRequest {
34
- string phone = 1;
33
+ message ContactCodeRequest {
34
+ string contact = 1;
35
+ bool is_auth = 2;
35
36
  }
36
37
 
37
- message PhoneVerifyCodeRequest {
38
- string phone = 1;
38
+ message ContactVerifyRequest {
39
+ string contact = 1;
39
40
  string code = 2;
41
+ bool is_auth = 3;
40
42
  }
41
43
 
42
44
  message RefreshTokenRequest {
@@ -9,11 +9,13 @@ service NotificationService {
9
9
  message EmailVerificationCodeRequest {
10
10
  string email = 1;
11
11
  string code = 2;
12
+ bool is_auth = 3;
12
13
  }
13
14
 
14
15
  message PhoneVerificationCodeRequest {
15
16
  string phone = 1;
16
17
  string code = 2;
18
+ bool is_auth = 3;
17
19
  }
18
20
 
19
21
  message NotificationResultResponse {
@@ -0,0 +1,25 @@
1
+ syntax = "proto3";
2
+ package user;
3
+
4
+ service UserService {
5
+ rpc GetUser (GetUserRequest) returns (UserResponse);
6
+ }
7
+
8
+ message GetUserRequest {
9
+ int32 id = 1;
10
+ }
11
+
12
+ message UserResponse {
13
+ int32 id = 1;
14
+ optional string email = 2;
15
+ optional string phone = 3;
16
+ optional string telegram_id = 4;
17
+ optional string telegram_username = 5;
18
+ optional string apple_sub = 6;
19
+ string registration_type = 7;
20
+ optional string first_name = 8;
21
+ optional string last_name = 9;
22
+ optional string avatar = 10;
23
+ string created_at = 11;
24
+ string updated_at = 12;
25
+ }