@requ1emz/contracts 1.0.19 → 1.0.21
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/family.ts +17 -1
- package/gen/notification.ts +73 -0
- package/package.json +1 -1
- package/proto/family.proto +11 -0
- package/proto/notification.proto +35 -0
package/gen/family.ts
CHANGED
|
@@ -28,6 +28,16 @@ export interface GetFamilyRequest {
|
|
|
28
28
|
userId: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
export interface InviteUserRequest {
|
|
32
|
+
adminId: string;
|
|
33
|
+
familyId: string;
|
|
34
|
+
invitedUserId: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface InviteUserResponse {
|
|
38
|
+
status: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
export interface FamilyResponse {
|
|
32
42
|
id: string;
|
|
33
43
|
name: string;
|
|
@@ -48,6 +58,8 @@ export interface FamilyServiceClient {
|
|
|
48
58
|
deleteFamily(request: DeleteFamilyRequest): Observable<DeleteFamilyResponse>;
|
|
49
59
|
|
|
50
60
|
getFamily(request: GetFamilyRequest): Observable<FamilyResponse>;
|
|
61
|
+
|
|
62
|
+
inviteUser(request: InviteUserRequest): Observable<InviteUserResponse>;
|
|
51
63
|
}
|
|
52
64
|
|
|
53
65
|
export interface FamilyServiceController {
|
|
@@ -58,11 +70,15 @@ export interface FamilyServiceController {
|
|
|
58
70
|
): Promise<DeleteFamilyResponse> | Observable<DeleteFamilyResponse> | DeleteFamilyResponse;
|
|
59
71
|
|
|
60
72
|
getFamily(request: GetFamilyRequest): Promise<FamilyResponse> | Observable<FamilyResponse> | FamilyResponse;
|
|
73
|
+
|
|
74
|
+
inviteUser(
|
|
75
|
+
request: InviteUserRequest,
|
|
76
|
+
): Promise<InviteUserResponse> | Observable<InviteUserResponse> | InviteUserResponse;
|
|
61
77
|
}
|
|
62
78
|
|
|
63
79
|
export function FamilyServiceControllerMethods() {
|
|
64
80
|
return function (constructor: Function) {
|
|
65
|
-
const grpcMethods: string[] = ["createFamily", "deleteFamily", "getFamily"];
|
|
81
|
+
const grpcMethods: string[] = ["createFamily", "deleteFamily", "getFamily", "inviteUser"];
|
|
66
82
|
for (const method of grpcMethods) {
|
|
67
83
|
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
84
|
GrpcMethod("FamilyService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -0,0 +1,73 @@
|
|
|
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: notification.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "notification";
|
|
12
|
+
|
|
13
|
+
export interface GetNotificationsRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface GetNotificationsResponse {
|
|
18
|
+
notifications: NotificationItem[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface NotificationItem {
|
|
22
|
+
id: string;
|
|
23
|
+
type: string;
|
|
24
|
+
status: string;
|
|
25
|
+
payload: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface RespondRequest {
|
|
30
|
+
notificationId: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
action: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface RespondResponse {
|
|
36
|
+
success: boolean;
|
|
37
|
+
status: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const NOTIFICATION_PACKAGE_NAME = "notification";
|
|
41
|
+
|
|
42
|
+
export interface NotificationServiceClient {
|
|
43
|
+
getNotifications(request: GetNotificationsRequest): Observable<GetNotificationsResponse>;
|
|
44
|
+
|
|
45
|
+
respondToNotification(request: RespondRequest): Observable<RespondResponse>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface NotificationServiceController {
|
|
49
|
+
getNotifications(
|
|
50
|
+
request: GetNotificationsRequest,
|
|
51
|
+
): Promise<GetNotificationsResponse> | Observable<GetNotificationsResponse> | GetNotificationsResponse;
|
|
52
|
+
|
|
53
|
+
respondToNotification(
|
|
54
|
+
request: RespondRequest,
|
|
55
|
+
): Promise<RespondResponse> | Observable<RespondResponse> | RespondResponse;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function NotificationServiceControllerMethods() {
|
|
59
|
+
return function (constructor: Function) {
|
|
60
|
+
const grpcMethods: string[] = ["getNotifications", "respondToNotification"];
|
|
61
|
+
for (const method of grpcMethods) {
|
|
62
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
63
|
+
GrpcMethod("NotificationService", method)(constructor.prototype[method], method, descriptor);
|
|
64
|
+
}
|
|
65
|
+
const grpcStreamMethods: string[] = [];
|
|
66
|
+
for (const method of grpcStreamMethods) {
|
|
67
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
68
|
+
GrpcStreamMethod("NotificationService", method)(constructor.prototype[method], method, descriptor);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const NOTIFICATION_SERVICE_NAME = "NotificationService";
|
package/package.json
CHANGED
package/proto/family.proto
CHANGED
|
@@ -6,6 +6,7 @@ service FamilyService {
|
|
|
6
6
|
rpc CreateFamily (CreateFamilyRequest) returns (FamilyResponse);
|
|
7
7
|
rpc DeleteFamily (DeleteFamilyRequest) returns (DeleteFamilyResponse);
|
|
8
8
|
rpc GetFamily (GetFamilyRequest) returns (FamilyResponse);
|
|
9
|
+
rpc InviteUser (InviteUserRequest) returns (InviteUserResponse);
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
message CreateFamilyRequest {
|
|
@@ -26,6 +27,16 @@ message GetFamilyRequest {
|
|
|
26
27
|
string user_id = 1;
|
|
27
28
|
}
|
|
28
29
|
|
|
30
|
+
message InviteUserRequest {
|
|
31
|
+
string admin_id = 1;
|
|
32
|
+
string family_id = 2;
|
|
33
|
+
string invited_user_id = 3;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
message InviteUserResponse {
|
|
37
|
+
bool status = 1;
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
message FamilyResponse {
|
|
30
41
|
string id = 1;
|
|
31
42
|
string name = 2;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package notification;
|
|
4
|
+
|
|
5
|
+
service NotificationService {
|
|
6
|
+
rpc GetNotifications (GetNotificationsRequest) returns (GetNotificationsResponse);
|
|
7
|
+
rpc RespondToNotification (RespondRequest) returns (RespondResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message GetNotificationsRequest {
|
|
11
|
+
string user_id = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message GetNotificationsResponse {
|
|
15
|
+
repeated NotificationItem notifications = 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message NotificationItem {
|
|
19
|
+
string id = 1;
|
|
20
|
+
string type = 2;
|
|
21
|
+
string status = 3;
|
|
22
|
+
string payload = 4;
|
|
23
|
+
string created_at = 5;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
message RespondRequest {
|
|
27
|
+
string notification_id = 1;
|
|
28
|
+
string user_id = 2;
|
|
29
|
+
string action = 3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
message RespondResponse {
|
|
33
|
+
bool success = 1;
|
|
34
|
+
string status = 2;
|
|
35
|
+
}
|