@sync-chat/contracts 1.2.0 → 1.3.0
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/generated/mail/mail.ts +67 -0
- package/package.json +1 -1
- package/proto/mail/mail.proto +26 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.8
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: mail/mail.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "mail.v1";
|
|
12
|
+
|
|
13
|
+
export interface SendVerificationEmailRequest {
|
|
14
|
+
to: string;
|
|
15
|
+
userName: string;
|
|
16
|
+
verificationUrl: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface SendPasswordResetRequest {
|
|
20
|
+
to: string;
|
|
21
|
+
userName: string;
|
|
22
|
+
resetUrl: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface MailResponse {
|
|
26
|
+
success: boolean;
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const MAIL_V1_PACKAGE_NAME = "mail.v1";
|
|
31
|
+
|
|
32
|
+
export interface MailServiceClient {
|
|
33
|
+
sendVerificationEmail(request: SendVerificationEmailRequest): Observable<MailResponse>;
|
|
34
|
+
|
|
35
|
+
resendVerificationEmail(request: SendVerificationEmailRequest): Observable<MailResponse>;
|
|
36
|
+
|
|
37
|
+
sendPasswordReset(request: SendPasswordResetRequest): Observable<MailResponse>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface MailServiceController {
|
|
41
|
+
sendVerificationEmail(
|
|
42
|
+
request: SendVerificationEmailRequest,
|
|
43
|
+
): Promise<MailResponse> | Observable<MailResponse> | MailResponse;
|
|
44
|
+
|
|
45
|
+
resendVerificationEmail(
|
|
46
|
+
request: SendVerificationEmailRequest,
|
|
47
|
+
): Promise<MailResponse> | Observable<MailResponse> | MailResponse;
|
|
48
|
+
|
|
49
|
+
sendPasswordReset(request: SendPasswordResetRequest): Promise<MailResponse> | Observable<MailResponse> | MailResponse;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function MailServiceControllerMethods() {
|
|
53
|
+
return function (constructor: Function) {
|
|
54
|
+
const grpcMethods: string[] = ["sendVerificationEmail", "resendVerificationEmail", "sendPasswordReset"];
|
|
55
|
+
for (const method of grpcMethods) {
|
|
56
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
57
|
+
GrpcMethod("MailService", 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("MailService", method)(constructor.prototype[method], method, descriptor);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export const MAIL_SERVICE_NAME = "MailService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package mail.v1;
|
|
4
|
+
|
|
5
|
+
service MailService {
|
|
6
|
+
rpc SendVerificationEmail (SendVerificationEmailRequest) returns (MailResponse);
|
|
7
|
+
rpc ResendVerificationEmail (SendVerificationEmailRequest) returns (MailResponse);
|
|
8
|
+
rpc SendPasswordReset (SendPasswordResetRequest) returns (MailResponse);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
message SendVerificationEmailRequest {
|
|
12
|
+
string to = 1;
|
|
13
|
+
string user_name = 2;
|
|
14
|
+
string verification_url = 3;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message SendPasswordResetRequest {
|
|
18
|
+
string to = 1;
|
|
19
|
+
string user_name = 2;
|
|
20
|
+
string reset_url = 3;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
message MailResponse {
|
|
24
|
+
bool success = 1;
|
|
25
|
+
string message = 2;
|
|
26
|
+
}
|