@aepstore-dev/contracts 1.81.0 → 1.82.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/dist/proto/paths.d.ts +2 -0
- package/dist/proto/paths.js +2 -0
- package/gen/notifications.d.ts +70 -0
- package/gen/notifications.js +33 -0
- package/gen/notifications.ts +128 -0
- package/package.json +1 -1
- package/proto/notifications.proto +70 -0
package/dist/proto/paths.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const PROTO_PATHS: {
|
|
|
2
2
|
readonly ACTIVITY: string;
|
|
3
3
|
readonly AUTH: string;
|
|
4
4
|
readonly MAIL: string;
|
|
5
|
+
readonly NOTIFICATIONS: string;
|
|
5
6
|
readonly PAYMENTS: string;
|
|
6
7
|
readonly PRODUCTS: string;
|
|
7
8
|
readonly SUPPORT: string;
|
|
@@ -13,6 +14,7 @@ export declare const PROTO_PACKAGES: {
|
|
|
13
14
|
readonly ACTIVITY: "activity.v1";
|
|
14
15
|
readonly AUTH: "auth.v1";
|
|
15
16
|
readonly MAIL: "mail.v1";
|
|
17
|
+
readonly NOTIFICATIONS: "notifications.v1";
|
|
16
18
|
readonly PAYMENTS: "payments.v1";
|
|
17
19
|
readonly PRODUCTS: "products.v1";
|
|
18
20
|
readonly SUPPORT: "support.v1";
|
package/dist/proto/paths.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.PROTO_PATHS = {
|
|
|
7
7
|
ACTIVITY: (0, path_1.join)(PROTO_DIR, "activity.proto"),
|
|
8
8
|
AUTH: (0, path_1.join)(PROTO_DIR, "auth.proto"),
|
|
9
9
|
MAIL: (0, path_1.join)(PROTO_DIR, "mail.proto"),
|
|
10
|
+
NOTIFICATIONS: (0, path_1.join)(PROTO_DIR, "notifications.proto"),
|
|
10
11
|
PAYMENTS: (0, path_1.join)(PROTO_DIR, "payments.proto"),
|
|
11
12
|
PRODUCTS: (0, path_1.join)(PROTO_DIR, "products.proto"),
|
|
12
13
|
SUPPORT: (0, path_1.join)(PROTO_DIR, "support.proto"),
|
|
@@ -18,6 +19,7 @@ exports.PROTO_PACKAGES = {
|
|
|
18
19
|
ACTIVITY: "activity.v1",
|
|
19
20
|
AUTH: "auth.v1",
|
|
20
21
|
MAIL: "mail.v1",
|
|
22
|
+
NOTIFICATIONS: "notifications.v1",
|
|
21
23
|
PAYMENTS: "payments.v1",
|
|
22
24
|
PRODUCTS: "products.v1",
|
|
23
25
|
SUPPORT: "support.v1",
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "notifications.v1";
|
|
3
|
+
export interface NotificationEntity {
|
|
4
|
+
type: string;
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Notification {
|
|
8
|
+
id: string;
|
|
9
|
+
userId: string;
|
|
10
|
+
/** COMMERCE|PRODUCTS|SUPPORT|ACCOUNT|PREMIUM|SOCIAL */
|
|
11
|
+
category: string;
|
|
12
|
+
type: string;
|
|
13
|
+
isRead: boolean;
|
|
14
|
+
readAt: string;
|
|
15
|
+
createdAt: string;
|
|
16
|
+
entity: NotificationEntity | undefined;
|
|
17
|
+
dataVersion: number;
|
|
18
|
+
dataJson: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ListNotificationsRequest {
|
|
21
|
+
userId: string;
|
|
22
|
+
category: string;
|
|
23
|
+
type: string;
|
|
24
|
+
/** empty|true|false */
|
|
25
|
+
isRead: string;
|
|
26
|
+
page: number;
|
|
27
|
+
limit: number;
|
|
28
|
+
}
|
|
29
|
+
export interface NotificationsListResponse {
|
|
30
|
+
items: Notification[];
|
|
31
|
+
total: number;
|
|
32
|
+
page: number;
|
|
33
|
+
limit: number;
|
|
34
|
+
unreadCount: number;
|
|
35
|
+
}
|
|
36
|
+
export interface GetUnreadCountRequest {
|
|
37
|
+
userId: string;
|
|
38
|
+
category: string;
|
|
39
|
+
}
|
|
40
|
+
export interface UnreadCountResponse {
|
|
41
|
+
unreadCount: number;
|
|
42
|
+
}
|
|
43
|
+
export interface MarkNotificationReadRequest {
|
|
44
|
+
userId: string;
|
|
45
|
+
notificationId: string;
|
|
46
|
+
}
|
|
47
|
+
export interface MarkAllNotificationsReadRequest {
|
|
48
|
+
userId: string;
|
|
49
|
+
category: string;
|
|
50
|
+
type: string;
|
|
51
|
+
}
|
|
52
|
+
export interface MarkAllNotificationsReadResponse {
|
|
53
|
+
updatedCount: number;
|
|
54
|
+
unreadCount: number;
|
|
55
|
+
}
|
|
56
|
+
export declare const NOTIFICATIONS_V1_PACKAGE_NAME = "notifications.v1";
|
|
57
|
+
export interface NotificationsServiceClient {
|
|
58
|
+
listNotifications(request: ListNotificationsRequest): Observable<NotificationsListResponse>;
|
|
59
|
+
getUnreadCount(request: GetUnreadCountRequest): Observable<UnreadCountResponse>;
|
|
60
|
+
markNotificationRead(request: MarkNotificationReadRequest): Observable<Notification>;
|
|
61
|
+
markAllNotificationsRead(request: MarkAllNotificationsReadRequest): Observable<MarkAllNotificationsReadResponse>;
|
|
62
|
+
}
|
|
63
|
+
export interface NotificationsServiceController {
|
|
64
|
+
listNotifications(request: ListNotificationsRequest): Promise<NotificationsListResponse> | Observable<NotificationsListResponse> | NotificationsListResponse;
|
|
65
|
+
getUnreadCount(request: GetUnreadCountRequest): Promise<UnreadCountResponse> | Observable<UnreadCountResponse> | UnreadCountResponse;
|
|
66
|
+
markNotificationRead(request: MarkNotificationReadRequest): Promise<Notification> | Observable<Notification> | Notification;
|
|
67
|
+
markAllNotificationsRead(request: MarkAllNotificationsReadRequest): Promise<MarkAllNotificationsReadResponse> | Observable<MarkAllNotificationsReadResponse> | MarkAllNotificationsReadResponse;
|
|
68
|
+
}
|
|
69
|
+
export declare function NotificationsServiceControllerMethods(): (constructor: Function) => void;
|
|
70
|
+
export declare const NOTIFICATIONS_SERVICE_NAME = "NotificationsService";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.10.1
|
|
5
|
+
// protoc v7.35.1
|
|
6
|
+
// source: notifications.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.NOTIFICATIONS_SERVICE_NAME = exports.NOTIFICATIONS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.NotificationsServiceControllerMethods = NotificationsServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "notifications.v1";
|
|
13
|
+
exports.NOTIFICATIONS_V1_PACKAGE_NAME = "notifications.v1";
|
|
14
|
+
function NotificationsServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"listNotifications",
|
|
18
|
+
"getUnreadCount",
|
|
19
|
+
"markNotificationRead",
|
|
20
|
+
"markAllNotificationsRead",
|
|
21
|
+
];
|
|
22
|
+
for (const method of grpcMethods) {
|
|
23
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
24
|
+
(0, microservices_1.GrpcMethod)("NotificationsService", method)(constructor.prototype[method], method, descriptor);
|
|
25
|
+
}
|
|
26
|
+
const grpcStreamMethods = [];
|
|
27
|
+
for (const method of grpcStreamMethods) {
|
|
28
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
29
|
+
(0, microservices_1.GrpcStreamMethod)("NotificationsService", method)(constructor.prototype[method], method, descriptor);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.NOTIFICATIONS_SERVICE_NAME = "NotificationsService";
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.10.1
|
|
4
|
+
// protoc v7.35.1
|
|
5
|
+
// source: notifications.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "notifications.v1";
|
|
12
|
+
|
|
13
|
+
export interface NotificationEntity {
|
|
14
|
+
type: string;
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Notification {
|
|
19
|
+
id: string;
|
|
20
|
+
userId: string;
|
|
21
|
+
/** COMMERCE|PRODUCTS|SUPPORT|ACCOUNT|PREMIUM|SOCIAL */
|
|
22
|
+
category: string;
|
|
23
|
+
type: string;
|
|
24
|
+
isRead: boolean;
|
|
25
|
+
readAt: string;
|
|
26
|
+
createdAt: string;
|
|
27
|
+
entity: NotificationEntity | undefined;
|
|
28
|
+
dataVersion: number;
|
|
29
|
+
dataJson: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface ListNotificationsRequest {
|
|
33
|
+
userId: string;
|
|
34
|
+
category: string;
|
|
35
|
+
type: string;
|
|
36
|
+
/** empty|true|false */
|
|
37
|
+
isRead: string;
|
|
38
|
+
page: number;
|
|
39
|
+
limit: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface NotificationsListResponse {
|
|
43
|
+
items: Notification[];
|
|
44
|
+
total: number;
|
|
45
|
+
page: number;
|
|
46
|
+
limit: number;
|
|
47
|
+
unreadCount: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface GetUnreadCountRequest {
|
|
51
|
+
userId: string;
|
|
52
|
+
category: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface UnreadCountResponse {
|
|
56
|
+
unreadCount: number;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface MarkNotificationReadRequest {
|
|
60
|
+
userId: string;
|
|
61
|
+
notificationId: string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface MarkAllNotificationsReadRequest {
|
|
65
|
+
userId: string;
|
|
66
|
+
category: string;
|
|
67
|
+
type: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface MarkAllNotificationsReadResponse {
|
|
71
|
+
updatedCount: number;
|
|
72
|
+
unreadCount: number;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export const NOTIFICATIONS_V1_PACKAGE_NAME = "notifications.v1";
|
|
76
|
+
|
|
77
|
+
export interface NotificationsServiceClient {
|
|
78
|
+
listNotifications(request: ListNotificationsRequest): Observable<NotificationsListResponse>;
|
|
79
|
+
|
|
80
|
+
getUnreadCount(request: GetUnreadCountRequest): Observable<UnreadCountResponse>;
|
|
81
|
+
|
|
82
|
+
markNotificationRead(request: MarkNotificationReadRequest): Observable<Notification>;
|
|
83
|
+
|
|
84
|
+
markAllNotificationsRead(request: MarkAllNotificationsReadRequest): Observable<MarkAllNotificationsReadResponse>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface NotificationsServiceController {
|
|
88
|
+
listNotifications(
|
|
89
|
+
request: ListNotificationsRequest,
|
|
90
|
+
): Promise<NotificationsListResponse> | Observable<NotificationsListResponse> | NotificationsListResponse;
|
|
91
|
+
|
|
92
|
+
getUnreadCount(
|
|
93
|
+
request: GetUnreadCountRequest,
|
|
94
|
+
): Promise<UnreadCountResponse> | Observable<UnreadCountResponse> | UnreadCountResponse;
|
|
95
|
+
|
|
96
|
+
markNotificationRead(
|
|
97
|
+
request: MarkNotificationReadRequest,
|
|
98
|
+
): Promise<Notification> | Observable<Notification> | Notification;
|
|
99
|
+
|
|
100
|
+
markAllNotificationsRead(
|
|
101
|
+
request: MarkAllNotificationsReadRequest,
|
|
102
|
+
):
|
|
103
|
+
| Promise<MarkAllNotificationsReadResponse>
|
|
104
|
+
| Observable<MarkAllNotificationsReadResponse>
|
|
105
|
+
| MarkAllNotificationsReadResponse;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function NotificationsServiceControllerMethods() {
|
|
109
|
+
return function (constructor: Function) {
|
|
110
|
+
const grpcMethods: string[] = [
|
|
111
|
+
"listNotifications",
|
|
112
|
+
"getUnreadCount",
|
|
113
|
+
"markNotificationRead",
|
|
114
|
+
"markAllNotificationsRead",
|
|
115
|
+
];
|
|
116
|
+
for (const method of grpcMethods) {
|
|
117
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
118
|
+
GrpcMethod("NotificationsService", method)(constructor.prototype[method], method, descriptor);
|
|
119
|
+
}
|
|
120
|
+
const grpcStreamMethods: string[] = [];
|
|
121
|
+
for (const method of grpcStreamMethods) {
|
|
122
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
123
|
+
GrpcStreamMethod("NotificationsService", method)(constructor.prototype[method], method, descriptor);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export const NOTIFICATIONS_SERVICE_NAME = "NotificationsService";
|
package/package.json
CHANGED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package notifications.v1;
|
|
4
|
+
|
|
5
|
+
service NotificationsService {
|
|
6
|
+
rpc ListNotifications(ListNotificationsRequest) returns (NotificationsListResponse);
|
|
7
|
+
rpc GetUnreadCount(GetUnreadCountRequest) returns (UnreadCountResponse);
|
|
8
|
+
rpc MarkNotificationRead(MarkNotificationReadRequest) returns (Notification);
|
|
9
|
+
rpc MarkAllNotificationsRead(MarkAllNotificationsReadRequest) returns (MarkAllNotificationsReadResponse);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
message NotificationEntity {
|
|
13
|
+
string type = 1;
|
|
14
|
+
string id = 2;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message Notification {
|
|
18
|
+
string id = 1;
|
|
19
|
+
string user_id = 2;
|
|
20
|
+
string category = 3; // COMMERCE|PRODUCTS|SUPPORT|ACCOUNT|PREMIUM|SOCIAL
|
|
21
|
+
string type = 4;
|
|
22
|
+
bool is_read = 5;
|
|
23
|
+
string read_at = 6;
|
|
24
|
+
string created_at = 7;
|
|
25
|
+
NotificationEntity entity = 8;
|
|
26
|
+
int32 data_version = 9;
|
|
27
|
+
string data_json = 10;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message ListNotificationsRequest {
|
|
31
|
+
string user_id = 1;
|
|
32
|
+
string category = 2;
|
|
33
|
+
string type = 3;
|
|
34
|
+
string is_read = 4; // empty|true|false
|
|
35
|
+
int32 page = 5;
|
|
36
|
+
int32 limit = 6;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message NotificationsListResponse {
|
|
40
|
+
repeated Notification items = 1;
|
|
41
|
+
int32 total = 2;
|
|
42
|
+
int32 page = 3;
|
|
43
|
+
int32 limit = 4;
|
|
44
|
+
int32 unread_count = 5;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
message GetUnreadCountRequest {
|
|
48
|
+
string user_id = 1;
|
|
49
|
+
string category = 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message UnreadCountResponse {
|
|
53
|
+
int32 unread_count = 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message MarkNotificationReadRequest {
|
|
57
|
+
string user_id = 1;
|
|
58
|
+
string notification_id = 2;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
message MarkAllNotificationsReadRequest {
|
|
62
|
+
string user_id = 1;
|
|
63
|
+
string category = 2;
|
|
64
|
+
string type = 3;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
message MarkAllNotificationsReadResponse {
|
|
68
|
+
int32 updated_count = 1;
|
|
69
|
+
int32 unread_count = 2;
|
|
70
|
+
}
|