From 151806b621571d0c31d9e446cf02d0d583cd96d5 Mon Sep 17 00:00:00 2001 From: Tony133 Date: Sun, 5 May 2024 15:18:04 +0200 Subject: [PATCH] chore: add public api annotation on microservices --- packages/microservices/ctx-host/base-rpc.context.ts | 3 +++ packages/microservices/ctx-host/kafka.context.ts | 3 +++ packages/microservices/ctx-host/mqtt.context.ts | 3 +++ packages/microservices/ctx-host/nats.context.ts | 3 +++ packages/microservices/ctx-host/redis.context.ts | 3 +++ packages/microservices/ctx-host/rmq.context.ts | 3 +++ packages/microservices/ctx-host/tcp.context.ts | 3 +++ .../microservices/record-builders/mqtt.record-builder.ts | 9 +++++++++ .../microservices/record-builders/nats.record-builder.ts | 6 ++++++ .../microservices/record-builders/rmq.record-builder.ts | 9 +++++++++ packages/microservices/server/server-grpc.ts | 3 +++ packages/microservices/server/server-kafka.ts | 3 +++ packages/microservices/server/server-mqtt.ts | 3 +++ packages/microservices/server/server-nats.ts | 3 +++ packages/microservices/server/server-redis.ts | 3 +++ packages/microservices/server/server-rmq.ts | 3 +++ packages/microservices/server/server-tcp.ts | 3 +++ packages/microservices/server/server.ts | 3 +++ 18 files changed, 69 insertions(+) diff --git a/packages/microservices/ctx-host/base-rpc.context.ts b/packages/microservices/ctx-host/base-rpc.context.ts index 0c8d4703a72..0f51ab077b2 100644 --- a/packages/microservices/ctx-host/base-rpc.context.ts +++ b/packages/microservices/ctx-host/base-rpc.context.ts @@ -1,3 +1,6 @@ +/** + * @publicApi + */ export class BaseRpcContext { constructor(protected readonly args: T) {} diff --git a/packages/microservices/ctx-host/kafka.context.ts b/packages/microservices/ctx-host/kafka.context.ts index 4ba1663c85e..5361ae53de0 100644 --- a/packages/microservices/ctx-host/kafka.context.ts +++ b/packages/microservices/ctx-host/kafka.context.ts @@ -10,6 +10,9 @@ type KafkaContextArgs = [ producer: Producer, ]; +/** + * @publicApi + */ export class KafkaContext extends BaseRpcContext { constructor(args: KafkaContextArgs) { super(args); diff --git a/packages/microservices/ctx-host/mqtt.context.ts b/packages/microservices/ctx-host/mqtt.context.ts index 3b953516a50..e9919b11caf 100644 --- a/packages/microservices/ctx-host/mqtt.context.ts +++ b/packages/microservices/ctx-host/mqtt.context.ts @@ -2,6 +2,9 @@ import { BaseRpcContext } from './base-rpc.context'; type MqttContextArgs = [string, Record]; +/** + * @publicApi + */ export class MqttContext extends BaseRpcContext { constructor(args: MqttContextArgs) { super(args); diff --git a/packages/microservices/ctx-host/nats.context.ts b/packages/microservices/ctx-host/nats.context.ts index c67c1696619..dc3fe92d861 100644 --- a/packages/microservices/ctx-host/nats.context.ts +++ b/packages/microservices/ctx-host/nats.context.ts @@ -2,6 +2,9 @@ import { BaseRpcContext } from './base-rpc.context'; type NatsContextArgs = [string, any]; +/** + * @publicApi + */ export class NatsContext extends BaseRpcContext { constructor(args: NatsContextArgs) { super(args); diff --git a/packages/microservices/ctx-host/redis.context.ts b/packages/microservices/ctx-host/redis.context.ts index d8422561905..ad5fa7e3f5f 100644 --- a/packages/microservices/ctx-host/redis.context.ts +++ b/packages/microservices/ctx-host/redis.context.ts @@ -2,6 +2,9 @@ import { BaseRpcContext } from './base-rpc.context'; type RedisContextArgs = [string]; +/** + * @publicApi + */ export class RedisContext extends BaseRpcContext { constructor(args: RedisContextArgs) { super(args); diff --git a/packages/microservices/ctx-host/rmq.context.ts b/packages/microservices/ctx-host/rmq.context.ts index 38abefe7ff4..da791a64fb9 100644 --- a/packages/microservices/ctx-host/rmq.context.ts +++ b/packages/microservices/ctx-host/rmq.context.ts @@ -2,6 +2,9 @@ import { BaseRpcContext } from './base-rpc.context'; type RmqContextArgs = [Record, any, string]; +/** + * @publicApi + */ export class RmqContext extends BaseRpcContext { constructor(args: RmqContextArgs) { super(args); diff --git a/packages/microservices/ctx-host/tcp.context.ts b/packages/microservices/ctx-host/tcp.context.ts index 1f1c6a28d1a..2b74dc89919 100644 --- a/packages/microservices/ctx-host/tcp.context.ts +++ b/packages/microservices/ctx-host/tcp.context.ts @@ -3,6 +3,9 @@ import { BaseRpcContext } from './base-rpc.context'; type TcpContextArgs = [TcpSocket, string]; +/** + * @publicApi + */ export class TcpContext extends BaseRpcContext { constructor(args: TcpContextArgs) { super(args); diff --git a/packages/microservices/record-builders/mqtt.record-builder.ts b/packages/microservices/record-builders/mqtt.record-builder.ts index b21c4ccbee0..41c0f25a21f 100644 --- a/packages/microservices/record-builders/mqtt.record-builder.ts +++ b/packages/microservices/record-builders/mqtt.record-builder.ts @@ -1,3 +1,6 @@ +/** + * @publicApi + */ export interface MqttRecordOptions { /** * The QoS @@ -26,6 +29,9 @@ export interface MqttRecordOptions { }; } +/** + * @publicApi + */ export class MqttRecord { constructor( public readonly data: TData, @@ -33,6 +39,9 @@ export class MqttRecord { ) {} } +/** + * @publicApi + */ export class MqttRecordBuilder { private options?: MqttRecordOptions; diff --git a/packages/microservices/record-builders/nats.record-builder.ts b/packages/microservices/record-builders/nats.record-builder.ts index 249241f1f84..6d6c14642cc 100644 --- a/packages/microservices/record-builders/nats.record-builder.ts +++ b/packages/microservices/record-builders/nats.record-builder.ts @@ -1,3 +1,6 @@ +/** + * @publicApi + */ export class NatsRecord { constructor( public readonly data: TData, @@ -5,6 +8,9 @@ export class NatsRecord { ) {} } +/** + * @publicApi + */ export class NatsRecordBuilder { private headers?: any; diff --git a/packages/microservices/record-builders/rmq.record-builder.ts b/packages/microservices/record-builders/rmq.record-builder.ts index 63967313351..2cbbdbd55db 100644 --- a/packages/microservices/record-builders/rmq.record-builder.ts +++ b/packages/microservices/record-builders/rmq.record-builder.ts @@ -1,3 +1,6 @@ +/** + * @publicApi + */ export interface RmqRecordOptions { expiration?: string | number; userId?: string; @@ -16,6 +19,9 @@ export interface RmqRecordOptions { appId?: string; } +/** + * @publicApi + */ export class RmqRecord { constructor( public readonly data: TData, @@ -23,6 +29,9 @@ export class RmqRecord { ) {} } +/** + * @publicApi + */ export class RmqRecordBuilder { private options?: RmqRecordOptions; diff --git a/packages/microservices/server/server-grpc.ts b/packages/microservices/server/server-grpc.ts index 2b81b9268ed..6a3c6941476 100644 --- a/packages/microservices/server/server-grpc.ts +++ b/packages/microservices/server/server-grpc.ts @@ -42,6 +42,9 @@ interface GrpcCall { emit: Function; } +/** + * @publicApi + */ export class ServerGrpc extends Server implements CustomTransportStrategy { public readonly transportId = Transport.GRPC; diff --git a/packages/microservices/server/server-kafka.ts b/packages/microservices/server/server-kafka.ts index 397bb049643..8fcbb0e446b 100644 --- a/packages/microservices/server/server-kafka.ts +++ b/packages/microservices/server/server-kafka.ts @@ -36,6 +36,9 @@ import { Server } from './server'; let kafkaPackage: any = {}; +/** + * @publicApi + */ export class ServerKafka extends Server implements CustomTransportStrategy { public readonly transportId = Transport.KAFKA; diff --git a/packages/microservices/server/server-mqtt.ts b/packages/microservices/server/server-mqtt.ts index 8e6ff3b8357..a7818a37f28 100644 --- a/packages/microservices/server/server-mqtt.ts +++ b/packages/microservices/server/server-mqtt.ts @@ -26,6 +26,9 @@ import { Server } from './server'; let mqttPackage: any = {}; +/** + * @publicApi + */ export class ServerMqtt extends Server implements CustomTransportStrategy { public readonly transportId = Transport.MQTT; diff --git a/packages/microservices/server/server-nats.ts b/packages/microservices/server/server-nats.ts index 73206ee773b..e9c376b1292 100644 --- a/packages/microservices/server/server-nats.ts +++ b/packages/microservices/server/server-nats.ts @@ -13,6 +13,9 @@ import { Server } from './server'; let natsPackage = {} as any; +/** + * @publicApi + */ export class ServerNats extends Server implements CustomTransportStrategy { public readonly transportId = Transport.NATS; diff --git a/packages/microservices/server/server-redis.ts b/packages/microservices/server/server-redis.ts index ea4c2fe1a41..cc6f53d69af 100644 --- a/packages/microservices/server/server-redis.ts +++ b/packages/microservices/server/server-redis.ts @@ -19,6 +19,9 @@ type Redis = any; let redisPackage = {} as any; +/** + * @publicApi + */ export class ServerRedis extends Server implements CustomTransportStrategy { public readonly transportId = Transport.REDIS; diff --git a/packages/microservices/server/server-rmq.ts b/packages/microservices/server/server-rmq.ts index 74e54e98cb6..c0ea0bd8ff4 100644 --- a/packages/microservices/server/server-rmq.ts +++ b/packages/microservices/server/server-rmq.ts @@ -36,6 +36,9 @@ let rmqPackage: any = {}; const INFINITE_CONNECTION_ATTEMPTS = -1; +/** + * @publicApi + */ export class ServerRMQ extends Server implements CustomTransportStrategy { public readonly transportId = Transport.RMQ; diff --git a/packages/microservices/server/server-tcp.ts b/packages/microservices/server/server-tcp.ts index 655fcd00388..b76a21c11f5 100644 --- a/packages/microservices/server/server-tcp.ts +++ b/packages/microservices/server/server-tcp.ts @@ -26,6 +26,9 @@ import { import { TcpOptions } from '../interfaces/microservice-configuration.interface'; import { Server } from './server'; +/** + * @publicApi + */ export class ServerTCP extends Server implements CustomTransportStrategy { public readonly transportId = Transport.TCP; diff --git a/packages/microservices/server/server.ts b/packages/microservices/server/server.ts index 8a88a129655..076900054f3 100644 --- a/packages/microservices/server/server.ts +++ b/packages/microservices/server/server.ts @@ -34,6 +34,9 @@ import { ConsumerSerializer } from '../interfaces/serializer.interface'; import { IdentitySerializer } from '../serializers/identity.serializer'; import { transformPatternToRoute } from '../utils'; +/** + * @publicApi + */ export abstract class Server { protected readonly messageHandlers = new Map(); protected readonly logger: LoggerService = new Logger(Server.name);