@trash-streamers/contracts 1.1.4 → 1.1.6
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/dist/{src/events → events}/auth/otp-requested.interface.d.ts +1 -1
- package/dist/{src/proto → proto}/paths.d.ts +1 -0
- package/dist/{src/proto → proto}/paths.js +1 -0
- package/package.json +5 -6
- package/proto/users.proto +45 -0
- package/gen/ts/account.ts +0 -127
- package/gen/ts/auth.ts +0 -81
- /package/dist/{src/events → events}/auth/index.d.ts +0 -0
- /package/dist/{src/events → events}/auth/index.js +0 -0
- /package/dist/{src/events → events}/auth/otp-requested.interface.js +0 -0
- /package/dist/{src/events → events}/index.d.ts +0 -0
- /package/dist/{src/events → events}/index.js +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/proto → proto}/index.d.ts +0 -0
- /package/dist/{src/proto → proto}/index.js +0 -0
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trash-streamers/contracts",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"main": "./dist/
|
|
5
|
-
"types": "./dist/
|
|
3
|
+
"version": "1.1.6",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc -p tsconfig.build.json",
|
|
8
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,package=omit"
|
|
8
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./src/gen/ts --ts_proto_opt=nestJs=true,package=omit"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
-
"proto"
|
|
13
|
-
"gen"
|
|
12
|
+
"proto"
|
|
14
13
|
],
|
|
15
14
|
"publishConfig": {
|
|
16
15
|
"access": "public"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package users.v1;
|
|
4
|
+
|
|
5
|
+
service UsersService {
|
|
6
|
+
rpc GetMe (GetMeRequest) returns (GetMeResponse);
|
|
7
|
+
|
|
8
|
+
rpc CreateUser (CreateUserRequest) returns (CreateUserResponse);
|
|
9
|
+
rpc PatchUser (PatchUserRequest) returns (PatchUserResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message GetMeRequest {
|
|
13
|
+
string id = 1;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message GetMeResponse {
|
|
17
|
+
User user = 1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message CreateUserRequest {
|
|
21
|
+
string id = 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message CreateUserResponse {
|
|
25
|
+
bool ok = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message PatchUserRequest {
|
|
29
|
+
string user_id = 1;
|
|
30
|
+
|
|
31
|
+
optional string name = 2;
|
|
32
|
+
optional string avatar = 3;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message PatchUserResponse {
|
|
36
|
+
bool ok = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message User {
|
|
40
|
+
string id = 1;
|
|
41
|
+
optional string name = 2;
|
|
42
|
+
optional string phone = 3;
|
|
43
|
+
optional string email = 4;
|
|
44
|
+
optional string avatar = 5;
|
|
45
|
+
}
|
package/gen/ts/account.ts
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.0
|
|
4
|
-
// protoc v3.21.12
|
|
5
|
-
// source: account.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
|
|
11
|
-
export const protobufPackage = "account.v1";
|
|
12
|
-
|
|
13
|
-
export enum Role {
|
|
14
|
-
USER = 0,
|
|
15
|
-
ADMIN = 1,
|
|
16
|
-
UNRECOGNIZED = -1,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface GetAccountRequest {
|
|
20
|
-
id: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface GetAccountResponse {
|
|
24
|
-
id: string;
|
|
25
|
-
phone: string;
|
|
26
|
-
email: string;
|
|
27
|
-
isPhoneVerified: boolean;
|
|
28
|
-
isEmailVerified: boolean;
|
|
29
|
-
role: Role;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface InitEmailChangeRequest {
|
|
33
|
-
email: string;
|
|
34
|
-
userId: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface InitEmailChangeResponse {
|
|
38
|
-
ok: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface ConfirmEmailChangeRequest {
|
|
42
|
-
email: string;
|
|
43
|
-
code: string;
|
|
44
|
-
userId: string;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface ConfirmEmailChangeResponse {
|
|
48
|
-
ok: boolean;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface InitPhoneChangeRequest {
|
|
52
|
-
phone: string;
|
|
53
|
-
userId: string;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export interface InitPhoneChangeResponse {
|
|
57
|
-
ok: boolean;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface ConfirmPhoneChangeRequest {
|
|
61
|
-
phone: string;
|
|
62
|
-
code: string;
|
|
63
|
-
userId: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface ConfirmPhoneChangeResponse {
|
|
67
|
-
ok: boolean;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
71
|
-
|
|
72
|
-
export interface AccountServiceClient {
|
|
73
|
-
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
74
|
-
|
|
75
|
-
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
76
|
-
|
|
77
|
-
confirmEmailChange(request: ConfirmEmailChangeRequest): Observable<ConfirmEmailChangeResponse>;
|
|
78
|
-
|
|
79
|
-
initPhoneChange(request: InitPhoneChangeRequest): Observable<InitPhoneChangeResponse>;
|
|
80
|
-
|
|
81
|
-
confirmPhoneChange(request: ConfirmPhoneChangeRequest): Observable<ConfirmPhoneChangeResponse>;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export interface AccountServiceController {
|
|
85
|
-
getAccount(
|
|
86
|
-
request: GetAccountRequest,
|
|
87
|
-
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
88
|
-
|
|
89
|
-
initEmailChange(
|
|
90
|
-
request: InitEmailChangeRequest,
|
|
91
|
-
): Promise<InitEmailChangeResponse> | Observable<InitEmailChangeResponse> | InitEmailChangeResponse;
|
|
92
|
-
|
|
93
|
-
confirmEmailChange(
|
|
94
|
-
request: ConfirmEmailChangeRequest,
|
|
95
|
-
): Promise<ConfirmEmailChangeResponse> | Observable<ConfirmEmailChangeResponse> | ConfirmEmailChangeResponse;
|
|
96
|
-
|
|
97
|
-
initPhoneChange(
|
|
98
|
-
request: InitPhoneChangeRequest,
|
|
99
|
-
): Promise<InitPhoneChangeResponse> | Observable<InitPhoneChangeResponse> | InitPhoneChangeResponse;
|
|
100
|
-
|
|
101
|
-
confirmPhoneChange(
|
|
102
|
-
request: ConfirmPhoneChangeRequest,
|
|
103
|
-
): Promise<ConfirmPhoneChangeResponse> | Observable<ConfirmPhoneChangeResponse> | ConfirmPhoneChangeResponse;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export function AccountServiceControllerMethods() {
|
|
107
|
-
return function (constructor: Function) {
|
|
108
|
-
const grpcMethods: string[] = [
|
|
109
|
-
"getAccount",
|
|
110
|
-
"initEmailChange",
|
|
111
|
-
"confirmEmailChange",
|
|
112
|
-
"initPhoneChange",
|
|
113
|
-
"confirmPhoneChange",
|
|
114
|
-
];
|
|
115
|
-
for (const method of grpcMethods) {
|
|
116
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
117
|
-
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
118
|
-
}
|
|
119
|
-
const grpcStreamMethods: string[] = [];
|
|
120
|
-
for (const method of grpcStreamMethods) {
|
|
121
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
122
|
-
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/gen/ts/auth.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
-
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.0
|
|
4
|
-
// protoc v3.21.12
|
|
5
|
-
// source: auth.proto
|
|
6
|
-
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
-
import { Observable } from "rxjs";
|
|
10
|
-
|
|
11
|
-
export const protobufPackage = "auth.v1";
|
|
12
|
-
|
|
13
|
-
export enum AuthType {
|
|
14
|
-
PHONE = 0,
|
|
15
|
-
EMAIL = 1,
|
|
16
|
-
UNRECOGNIZED = -1,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface SendOtpRequest {
|
|
20
|
-
identifier: string;
|
|
21
|
-
type: AuthType;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface SendOtpResponse {
|
|
25
|
-
ok: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface VerifyOtpRequest {
|
|
29
|
-
identifier: string;
|
|
30
|
-
type: AuthType;
|
|
31
|
-
code: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface VerifyOtpResponse {
|
|
35
|
-
accessToken: string;
|
|
36
|
-
refreshToken: string;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface RefreshRequest {
|
|
40
|
-
refreshToken: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export interface RefreshResponse {
|
|
44
|
-
accessToken: string;
|
|
45
|
-
refreshToken: string;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
49
|
-
|
|
50
|
-
export interface AuthServiceClient {
|
|
51
|
-
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
52
|
-
|
|
53
|
-
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
54
|
-
|
|
55
|
-
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface AuthServiceController {
|
|
59
|
-
sendOtp(request: SendOtpRequest): Promise<SendOtpResponse> | Observable<SendOtpResponse> | SendOtpResponse;
|
|
60
|
-
|
|
61
|
-
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
62
|
-
|
|
63
|
-
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export function AuthServiceControllerMethods() {
|
|
67
|
-
return function (constructor: Function) {
|
|
68
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
69
|
-
for (const method of grpcMethods) {
|
|
70
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
71
|
-
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
72
|
-
}
|
|
73
|
-
const grpcStreamMethods: string[] = [];
|
|
74
|
-
for (const method of grpcStreamMethods) {
|
|
75
|
-
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
76
|
-
GrpcStreamMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export const AUTH_SERVICE_NAME = "AuthService";
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|