@ciganov/contracts 1.1.0 → 1.1.2
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.11.6
|
|
5
|
-
// protoc
|
|
5
|
+
// protoc v6.33.2
|
|
6
6
|
// source: google/protobuf/field_mask.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.FieldMask = exports.GOOGLE_PROTOBUF_PACKAGE_NAME = exports.protobufPackage = void 0;
|
package/dist/gen/user.d.ts
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package account.v1;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
service AccountService {
|
|
7
|
+
rpc GetAccount(GetAccountRequest) returns (GetAccountResponse);
|
|
8
|
+
rpc InitEmailChange(InitEmailChangeRequest) returns (InitEmailChangeResponse);
|
|
9
|
+
rpc ConfirmEmailChange(ConfirmEmailChangeRequest) returns (ConfirmEmailChangeResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message GetAccountRequest {
|
|
13
|
+
string id = 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message GetAccountResponse {
|
|
17
|
+
string id = 1;
|
|
18
|
+
string email = 2;
|
|
19
|
+
Role role = 3;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message InitEmailChangeRequest {
|
|
23
|
+
string email = 1;
|
|
24
|
+
string user_id = 2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
message InitEmailChangeResponse {
|
|
28
|
+
bool ok = 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message ConfirmEmailChangeRequest {
|
|
32
|
+
string email = 1;
|
|
33
|
+
string code = 2;
|
|
34
|
+
string user_id = 3;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message ConfirmEmailChangeResponse {
|
|
38
|
+
bool ok = 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
enum Role {
|
|
43
|
+
USER = 0;
|
|
44
|
+
ADMIN = 1;
|
|
45
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
|
|
7
|
+
service AuthService {
|
|
8
|
+
rpc SendOtp(SendOtpRequest) returns (SendOtpResponse);
|
|
9
|
+
rpc VerifyOtp(VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
10
|
+
|
|
11
|
+
rpc GetSessionByToken(GetSessionByTokenRequest) returns(GetSessionByTokenResponse);
|
|
12
|
+
rpc RefreshToken(RefreshTokenRequest) returns (google.protobuf.Empty);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message SendOtpRequest {
|
|
16
|
+
string identifier = 1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message SendOtpResponse {
|
|
20
|
+
bool ok = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message VerifyOtpRequest {
|
|
24
|
+
string identifier = 1;
|
|
25
|
+
string code = 2;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message VerifyOtpResponse {
|
|
29
|
+
string token = 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message GetSessionByTokenRequest {
|
|
33
|
+
string token = 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message GetSessionByTokenResponse {
|
|
37
|
+
optional Session session = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message Session {
|
|
41
|
+
string id = 1;
|
|
42
|
+
string token = 2;
|
|
43
|
+
string user_id = 3;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
message RefreshTokenRequest {
|
|
47
|
+
string token = 1;
|
|
48
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package user.v1;
|
|
4
|
+
|
|
5
|
+
service UserService {
|
|
6
|
+
rpc GetMe(GetMeRequest) returns (GetMeResponse);
|
|
7
|
+
|
|
8
|
+
rpc CreateUser(CreateUserRequest) returns (CreateUserResponse);
|
|
9
|
+
|
|
10
|
+
rpc PatchUser(PatchUserRequest) returns (PatchUserResponse);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
message GetMeRequest {
|
|
14
|
+
string id = 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message GetMeResponse {
|
|
18
|
+
User user = 1;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
message CreateUserRequest {
|
|
22
|
+
string id = 1;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message CreateUserResponse {
|
|
26
|
+
bool ok = 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message PatchUserRequest {
|
|
30
|
+
User user = 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message PatchUserResponse {
|
|
34
|
+
bool ok = 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message User {
|
|
38
|
+
string id = 1;
|
|
39
|
+
optional string display_name = 2;
|
|
40
|
+
optional string bio = 3;
|
|
41
|
+
string email = 4;
|
|
42
|
+
optional int32 success_rate = 5;
|
|
43
|
+
optional int32 lose_amount = 6;
|
|
44
|
+
optional string avatar = 7;
|
|
45
|
+
}
|
package/dist/proto/paths.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PROTO_PATHS = void 0;
|
|
4
4
|
const node_path_1 = require("node:path");
|
|
5
5
|
exports.PROTO_PATHS = {
|
|
6
|
-
AUTH: (0, node_path_1.join)(__dirname, '
|
|
7
|
-
ACCOUNT: (0, node_path_1.join)(__dirname, '
|
|
8
|
-
USER: (0, node_path_1.join)(__dirname, '
|
|
6
|
+
AUTH: (0, node_path_1.join)(__dirname, './contracts/auth.proto'),
|
|
7
|
+
ACCOUNT: (0, node_path_1.join)(__dirname, './contracts/account.proto'),
|
|
8
|
+
USER: (0, node_path_1.join)(__dirname, './contracts/user.proto')
|
|
9
9
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciganov/contracts",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Protobuf definitions and generated ts types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"generate": "mkdir -p ./lib/gen && protoc -I ./proto ./proto/*.proto --ts_proto_out=./lib/gen --ts_proto_opt=nestJs=true,package=omit",
|
|
9
|
-
"build": "tsc -p tsconfig.build.json"
|
|
8
|
+
"generate": "mkdir -p ./lib/gen && protoc -I ./lib/proto/contracts ./lib/proto/contracts/*.proto --ts_proto_out=./lib/gen --ts_proto_opt=nestJs=true,package=omit",
|
|
9
|
+
"build": "tsc -p tsconfig.build.json && npx cpy 'lib/proto/**/*.proto' 'dist/proto' --parents"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist"
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@nestjs/microservices": "^11.1.11",
|
|
19
|
+
"cpy-cli": "^7.0.0",
|
|
19
20
|
"rxjs": "^7.8.2",
|
|
20
21
|
"ts-proto": "^2.10.1"
|
|
21
22
|
},
|