@rustlimited/contracts 1.0.7 → 1.0.8

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/ts/auth.ts CHANGED
@@ -15,19 +15,61 @@ export interface TelegramInitResponse {
15
15
  url: string;
16
16
  }
17
17
 
18
+ export interface GetAuthUrlResponse {
19
+ url: string;
20
+ }
21
+
22
+ export interface ExternalAuthCallbackRequest {
23
+ provider: string;
24
+ query: { [key: string]: string };
25
+ }
26
+
27
+ export interface ExternalAuthCallbackRequest_QueryEntry {
28
+ key: string;
29
+ value: string;
30
+ }
31
+
32
+ export interface LoginWithPasswordRequest {
33
+ login: string;
34
+ password: string;
35
+ }
36
+
37
+ export interface RefreshRequest {
38
+ refreshToken: string;
39
+ }
40
+
41
+ export interface AuthResponse {
42
+ accessToken: string;
43
+ refreshToken: string;
44
+ }
45
+
18
46
  export const AUTH_V1_PACKAGE_NAME = "auth.v1";
19
47
 
20
48
  export interface AuthServiceClient {
21
49
  telegramInit(request: Empty): Observable<TelegramInitResponse>;
50
+
51
+ loginWithPassword(request: LoginWithPasswordRequest): Observable<AuthResponse>;
52
+
53
+ refresh(request: RefreshRequest): Observable<AuthResponse>;
54
+
55
+ externalAuthCallback(request: ExternalAuthCallbackRequest): Observable<AuthResponse>;
22
56
  }
23
57
 
24
58
  export interface AuthServiceController {
25
59
  telegramInit(request: Empty): Promise<TelegramInitResponse> | Observable<TelegramInitResponse> | TelegramInitResponse;
60
+
61
+ loginWithPassword(request: LoginWithPasswordRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
62
+
63
+ refresh(request: RefreshRequest): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
64
+
65
+ externalAuthCallback(
66
+ request: ExternalAuthCallbackRequest,
67
+ ): Promise<AuthResponse> | Observable<AuthResponse> | AuthResponse;
26
68
  }
27
69
 
28
70
  export function AuthServiceControllerMethods() {
29
71
  return function (constructor: Function) {
30
- const grpcMethods: string[] = ["telegramInit"];
72
+ const grpcMethods: string[] = ["telegramInit", "loginWithPassword", "refresh", "externalAuthCallback"];
31
73
  for (const method of grpcMethods) {
32
74
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
75
  GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
package/gen/ts/users.ts CHANGED
@@ -11,7 +11,7 @@ import { Observable } from "rxjs";
11
11
  export const protobufPackage = "users.v1";
12
12
 
13
13
  export interface GetMeRequest {
14
- id: string;
14
+ steamId: string;
15
15
  }
16
16
 
17
17
  export interface GetMeResponse {
@@ -19,7 +19,7 @@ export interface GetMeResponse {
19
19
  }
20
20
 
21
21
  export interface CreateUserRequest {
22
- id: string;
22
+ steamId: string;
23
23
  }
24
24
 
25
25
  export interface CreateUserResponse {
@@ -27,7 +27,7 @@ export interface CreateUserResponse {
27
27
  }
28
28
 
29
29
  export interface PatchUserRequest {
30
- userId: string;
30
+ steamId: string;
31
31
  name?: string | undefined;
32
32
  avatar?: string | undefined;
33
33
  }
@@ -37,11 +37,10 @@ export interface PatchUserResponse {
37
37
  }
38
38
 
39
39
  export interface User {
40
- id: string;
40
+ steamId: string;
41
41
  name?: string | undefined;
42
- phone?: string | undefined;
43
- email?: string | undefined;
44
42
  avatar?: string | undefined;
43
+ balance?: number | undefined;
45
44
  }
46
45
 
47
46
  export const USERS_V1_PACKAGE_NAME = "users.v1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rustlimited/contracts",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/proto/auth.proto CHANGED
@@ -8,12 +8,35 @@ import "google/protobuf/timestamp.proto";
8
8
  service AuthService {
9
9
 
10
10
  rpc TelegramInit (google.protobuf.Empty) returns (TelegramInitResponse);
11
+ rpc LoginWithPassword (LoginWithPasswordRequest) returns (AuthResponse);
12
+ rpc Refresh (RefreshRequest) returns (AuthResponse);
13
+ rpc ExternalAuthCallback (ExternalAuthCallbackRequest) returns (AuthResponse);
11
14
  }
12
15
 
13
-
14
16
 
15
17
  message TelegramInitResponse {
16
18
  string url = 1;
17
19
  }
18
20
 
19
-
21
+ message GetAuthUrlResponse {
22
+ string url = 1;
23
+ }
24
+
25
+ message ExternalAuthCallbackRequest {
26
+ string provider = 1;
27
+ map<string, string> query = 2;
28
+ }
29
+
30
+ message LoginWithPasswordRequest {
31
+ string login = 1;
32
+ string password = 2;
33
+ }
34
+
35
+ message RefreshRequest {
36
+ string refreshToken = 1;
37
+ }
38
+
39
+ message AuthResponse {
40
+ string accessToken = 1;
41
+ string refreshToken = 2;
42
+ }
package/proto/users.proto CHANGED
@@ -9,8 +9,11 @@ service UsersService {
9
9
  rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
10
10
  }
11
11
 
12
+
13
+
14
+
12
15
  message GetMeRequest {
13
- string id = 1;
16
+ string steamId = 1;
14
17
  }
15
18
 
16
19
  message GetMeResponse {
@@ -18,7 +21,7 @@ message GetMeResponse {
18
21
  }
19
22
 
20
23
  message CreateUserRequest {
21
- string id = 1;
24
+ string steamId = 1;
22
25
  }
23
26
 
24
27
  message CreateUserResponse {
@@ -26,7 +29,7 @@ message CreateUserResponse {
26
29
  }
27
30
 
28
31
  message PatchUserRequest {
29
- string user_id = 1;
32
+ string steamId = 1;
30
33
 
31
34
  optional string name = 2;
32
35
  optional string avatar = 3;
@@ -37,9 +40,9 @@ message PatchUserResponse {
37
40
  }
38
41
 
39
42
  message User {
40
- string id = 1;
43
+ string steamId = 1;
44
+
41
45
  optional string name = 2;
42
- optional string phone = 3;
43
- optional string email = 4;
44
- optional string avatar = 5;
46
+ optional string avatar = 3;
47
+ optional int32 balance = 4;
45
48
  }