contracts/gen/ts/category.ts
2026-04-05 08:59:26 +03:00

52 lines
1.6 KiB
TypeScript

// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
// versions:
// protoc-gen-ts_proto v2.11.0
// protoc v6.33.4
// source: category.proto
/* eslint-disable */
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
import { Observable } from "rxjs";
import { Empty } from "./google/protobuf/empty";
export const protobufPackage = "category.v1";
export interface GetAllCategoriesResponse {
categories: Category[];
}
export interface Category {
id: string;
title: string;
slug: string;
}
export const CATEGORY_V1_PACKAGE_NAME = "category.v1";
export interface CategoryServiceClient {
getAllCategories(request: Empty): Observable<GetAllCategoriesResponse>;
}
export interface CategoryServiceController {
getAllCategories(
request: Empty,
): Promise<GetAllCategoriesResponse> | Observable<GetAllCategoriesResponse> | GetAllCategoriesResponse;
}
export function CategoryServiceControllerMethods() {
return function (constructor: Function) {
const grpcMethods: string[] = ["getAllCategories"];
for (const method of grpcMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
}
const grpcStreamMethods: string[] = [];
for (const method of grpcStreamMethods) {
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
GrpcStreamMethod("CategoryService", method)(constructor.prototype[method], method, descriptor);
}
};
}
export const CATEGORY_SERVICE_NAME = "CategoryService";