@slack-clone-org/contracts 1.0.3 → 1.0.7
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/proto/paths.d.ts +1 -0
- package/dist/proto/paths.js +1 -0
- package/generated/account.ts +67 -0
- package/generated/auth.ts +18 -1
- package/package.json +1 -1
- package/proto/account.proto +27 -0
- package/proto/auth.proto +12 -1
package/dist/proto/paths.d.ts
CHANGED
package/dist/proto/paths.js
CHANGED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
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 = "auth.v1";
|
|
12
|
+
|
|
13
|
+
export enum GlobalRole {
|
|
14
|
+
USER = 0,
|
|
15
|
+
ADMIN = 1,
|
|
16
|
+
UNRECOGNIZED = -1,
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface GetAccountRequest {
|
|
20
|
+
accountId: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface GetAccountResponse {
|
|
24
|
+
accountId: string;
|
|
25
|
+
phoneNumber: string;
|
|
26
|
+
email: string;
|
|
27
|
+
isPhoneVerified: string;
|
|
28
|
+
isEmailVerified: string;
|
|
29
|
+
role: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
33
|
+
|
|
34
|
+
/** AccountService provides account-related operations. */
|
|
35
|
+
|
|
36
|
+
export interface AccountServiceClient {
|
|
37
|
+
/** GetAccount retrieves account details by account ID. */
|
|
38
|
+
|
|
39
|
+
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** AccountService provides account-related operations. */
|
|
43
|
+
|
|
44
|
+
export interface AccountServiceController {
|
|
45
|
+
/** GetAccount retrieves account details by account ID. */
|
|
46
|
+
|
|
47
|
+
getAccount(
|
|
48
|
+
request: GetAccountRequest,
|
|
49
|
+
): Promise<GetAccountResponse> | Observable<GetAccountResponse> | GetAccountResponse;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function AccountServiceControllerMethods() {
|
|
53
|
+
return function (constructor: Function) {
|
|
54
|
+
const grpcMethods: string[] = ["getAccount"];
|
|
55
|
+
for (const method of grpcMethods) {
|
|
56
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
|
+
GrpcMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
58
|
+
}
|
|
59
|
+
const grpcStreamMethods: string[] = [];
|
|
60
|
+
for (const method of grpcStreamMethods) {
|
|
61
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
62
|
+
GrpcStreamMethod("AccountService", method)(constructor.prototype[method], method, descriptor);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const ACCOUNT_SERVICE_NAME = "AccountService";
|
package/generated/auth.ts
CHANGED
|
@@ -30,6 +30,15 @@ export interface VerifyOtpResponse {
|
|
|
30
30
|
refreshToken: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export interface RefreshRequest {
|
|
34
|
+
refreshToken: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface RefreshResponse {
|
|
38
|
+
accessToken: string;
|
|
39
|
+
refreshToken: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
33
42
|
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
34
43
|
|
|
35
44
|
/** AuthService provides authentication-related operations. */
|
|
@@ -42,6 +51,10 @@ export interface AuthServiceClient {
|
|
|
42
51
|
/** VerifyOtp verifies the provided one-time password. */
|
|
43
52
|
|
|
44
53
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
|
54
|
+
|
|
55
|
+
/** Refresh token */
|
|
56
|
+
|
|
57
|
+
refresh(request: RefreshRequest): Observable<RefreshResponse>;
|
|
45
58
|
}
|
|
46
59
|
|
|
47
60
|
/** AuthService provides authentication-related operations. */
|
|
@@ -54,11 +67,15 @@ export interface AuthServiceController {
|
|
|
54
67
|
/** VerifyOtp verifies the provided one-time password. */
|
|
55
68
|
|
|
56
69
|
verifyOtp(request: VerifyOtpRequest): Promise<VerifyOtpResponse> | Observable<VerifyOtpResponse> | VerifyOtpResponse;
|
|
70
|
+
|
|
71
|
+
/** Refresh token */
|
|
72
|
+
|
|
73
|
+
refresh(request: RefreshRequest): Promise<RefreshResponse> | Observable<RefreshResponse> | RefreshResponse;
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
export function AuthServiceControllerMethods() {
|
|
60
77
|
return function (constructor: Function) {
|
|
61
|
-
const grpcMethods: string[] = ["sendOtp", "verifyOtp"];
|
|
78
|
+
const grpcMethods: string[] = ["sendOtp", "verifyOtp", "refresh"];
|
|
62
79
|
for (const method of grpcMethods) {
|
|
63
80
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
64
81
|
GrpcMethod("AuthService", method)(constructor.prototype[method], method, descriptor);
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package auth.v1;
|
|
4
|
+
|
|
5
|
+
// AccountService provides account-related operations.
|
|
6
|
+
service AccountService {
|
|
7
|
+
// GetAccount retrieves account details by account ID.
|
|
8
|
+
rpc GetAccount (GetAccountRequest) returns (GetAccountResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message GetAccountRequest {
|
|
12
|
+
string account_id = 1;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message GetAccountResponse {
|
|
16
|
+
string account_id = 1;
|
|
17
|
+
string phone_number = 2;
|
|
18
|
+
string email = 3;
|
|
19
|
+
string is_phone_verified = 4;
|
|
20
|
+
string is_email_verified = 5;
|
|
21
|
+
string role = 6;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
enum GlobalRole {
|
|
25
|
+
USER = 0;
|
|
26
|
+
ADMIN = 1;
|
|
27
|
+
}
|
package/proto/auth.proto
CHANGED
|
@@ -8,6 +8,8 @@ service AuthService {
|
|
|
8
8
|
rpc SendOtp (SendOtpRequest) returns (SendOtpResponse);
|
|
9
9
|
// VerifyOtp verifies the provided one-time password.
|
|
10
10
|
rpc VerifyOtp (VerifyOtpRequest) returns (VerifyOtpResponse);
|
|
11
|
+
// Refresh token
|
|
12
|
+
rpc Refresh (RefreshRequest) returns (RefreshResponse);
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
message SendOtpRequest {
|
|
@@ -28,4 +30,13 @@ message VerifyOtpRequest {
|
|
|
28
30
|
message VerifyOtpResponse {
|
|
29
31
|
string access_token = 1;
|
|
30
32
|
string refresh_token = 2;
|
|
31
|
-
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message RefreshRequest {
|
|
36
|
+
string refresh_token = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message RefreshResponse {
|
|
40
|
+
string access_token = 1;
|
|
41
|
+
string refresh_token = 2;
|
|
42
|
+
}
|