chore: auto-generate protobuf files [skip ci]

This commit is contained in:
github-actions[bot]
2026-04-16 06:49:25 +00:00
parent 64a51f1b52
commit a55fc96a6d
5 changed files with 1585 additions and 0 deletions

View File

@@ -0,0 +1,190 @@
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.6
// protoc v4.25.9
// source: notifications/notifications.proto
/* eslint-disable */
import type { Metadata } from "@grpc/grpc-js";
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
import { wrappers } from "protobufjs";
import { Observable } from "rxjs";
import { Struct } from "../google/protobuf/struct";
import { Timestamp } from "../google/protobuf/timestamp";
export const protobufPackage = "notifications.v1";
/** Структура самого уведомления */
export interface Notification {
id: string;
userId: string;
/** Например: "SYSTEM_ALERT", "NEW_MESSAGE", "TASK_ASSIGNED" */
type: string;
/** Заголовок (опционально) */
title: string;
/** Текст уведомления */
text: string;
/** Любая динамическая JSON-нагрузка (например, { "task_id": 123 }) */
payload: { [key: string]: any } | undefined;
isRead: boolean;
createdAt: Timestamp | undefined;
}
export interface GetNotificationsRequest {
/** ID пользователя запрашивающего данные (Gateway берет это из JWT) */
userId: string;
/** Для пагинации (например, 20) */
limit: number;
/** Для пагинации (например, 0) */
offset: number;
/** Фильтр: получить только непрочитанные */
unreadOnly?: boolean | undefined;
}
export interface GetNotificationsResponse {
/** Массив уведомлений */
notifications: Notification[];
/** Общее количество (для UI пагинации) */
totalCount: number;
}
export interface GetUnreadCountRequest {
userId: string;
}
export interface GetUnreadCountResponse {
count: number;
}
export interface MarkAsReadRequest {
userId: string;
notificationId: string;
}
export interface MarkAsReadResponse {
success: boolean;
}
export interface MarkAllAsReadRequest {
userId: string;
}
export interface MarkAllAsReadResponse {
success: boolean;
/** Сколько уведомлений было обновлено */
updatedCount: number;
}
export interface SendNotificationRequest {
/** Кому отправляем (если пусто — можно сделать бродкаст, но лучше отдельный метод) */
userId: string;
type: string;
title: string;
text: string;
/** Метаданные для UI (ссылки, ID сущностей) */
payload: { [key: string]: any } | undefined;
}
export interface SendNotificationResponse {
success: boolean;
/** ID созданного уведомления в Postgres */
notificationId: string;
}
export const NOTIFICATIONS_V1_PACKAGE_NAME = "notifications.v1";
wrappers[".google.protobuf.Struct"] = { fromObject: Struct.wrap, toObject: Struct.unwrap } as any;
/**
* -----------------------------------------------------------------------------
* Сервис Уведомлений
* -----------------------------------------------------------------------------
*/
export interface NotificationServiceClient {
/** Получить список уведомлений пользователя с пагинацией */
getUserNotifications(request: GetNotificationsRequest, metadata?: Metadata): Observable<GetNotificationsResponse>;
/** Получить количество непрочитанных уведомлений (для бейджика на иконке) */
getUnreadCount(request: GetUnreadCountRequest, metadata?: Metadata): Observable<GetUnreadCountResponse>;
/** Отметить конкретное уведомление как прочитанное */
markAsRead(request: MarkAsReadRequest, metadata?: Metadata): Observable<MarkAsReadResponse>;
/** Отметить все уведомления пользователя как прочитанные */
markAllAsRead(request: MarkAllAsReadRequest, metadata?: Metadata): Observable<MarkAllAsReadResponse>;
/** Отправить уведомление (CRM/ERP вызывает этот метод, а NestJS уже кидает в RabbitMQ) */
sendNotification(request: SendNotificationRequest, metadata?: Metadata): Observable<SendNotificationResponse>;
}
/**
* -----------------------------------------------------------------------------
* Сервис Уведомлений
* -----------------------------------------------------------------------------
*/
export interface NotificationServiceController {
/** Получить список уведомлений пользователя с пагинацией */
getUserNotifications(
request: GetNotificationsRequest,
metadata?: Metadata,
): Promise<GetNotificationsResponse> | Observable<GetNotificationsResponse> | GetNotificationsResponse;
/** Получить количество непрочитанных уведомлений (для бейджика на иконке) */
getUnreadCount(
request: GetUnreadCountRequest,
metadata?: Metadata,
): Promise<GetUnreadCountResponse> | Observable<GetUnreadCountResponse> | GetUnreadCountResponse;
/** Отметить конкретное уведомление как прочитанное */
markAsRead(
request: MarkAsReadRequest,
metadata?: Metadata,
): Promise<MarkAsReadResponse> | Observable<MarkAsReadResponse> | MarkAsReadResponse;
/** Отметить все уведомления пользователя как прочитанные */
markAllAsRead(
request: MarkAllAsReadRequest,
metadata?: Metadata,
): Promise<MarkAllAsReadResponse> | Observable<MarkAllAsReadResponse> | MarkAllAsReadResponse;
/** Отправить уведомление (CRM/ERP вызывает этот метод, а NestJS уже кидает в RabbitMQ) */
sendNotification(
request: SendNotificationRequest,
metadata?: Metadata,
): Promise<SendNotificationResponse> | Observable<SendNotificationResponse> | SendNotificationResponse;
}
export function NotificationServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = [
"getUserNotifications",
"getUnreadCount",
"markAsRead",
"markAllAsRead",
"sendNotification",
];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("NotificationService", method)(constructor.prototype[method], method, descriptor);
}
const grpcStreamMethods: string[] = [];
for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcStreamMethod("NotificationService", method)(constructor.prototype[method], method, descriptor);
}
};
}
export const NOTIFICATION_SERVICE_NAME = "NotificationService";