@requ1emz/contracts 1.0.18 → 1.0.20
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 +1 -7
- package/gen/notification.ts +73 -0
- package/package.json +1 -1
- package/proto/family.proto +1 -6
- package/proto/notification.proto +35 -0
package/gen/family.ts
CHANGED
|
@@ -10,12 +10,6 @@ import { Observable } from "rxjs";
|
|
|
10
10
|
|
|
11
11
|
export const protobufPackage = "family.v1";
|
|
12
12
|
|
|
13
|
-
export enum ROLE {
|
|
14
|
-
ADMIN = 0,
|
|
15
|
-
MEMBER = 1,
|
|
16
|
-
UNRECOGNIZED = -1,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
13
|
export interface CreateFamilyRequest {
|
|
20
14
|
userId: string;
|
|
21
15
|
name: string;
|
|
@@ -43,7 +37,7 @@ export interface FamilyResponse {
|
|
|
43
37
|
|
|
44
38
|
export interface FamilyMemberDto {
|
|
45
39
|
userId: string;
|
|
46
|
-
role:
|
|
40
|
+
role: string;
|
|
47
41
|
}
|
|
48
42
|
|
|
49
43
|
export const FAMILY_V1_PACKAGE_NAME = "family.v1";
|
|
@@ -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
|
@@ -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
|
+
}
|