@horizon-republic/nestjs-jetstream 2.7.1 → 2.8.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/index.cjs +205 -85
- package/dist/index.d.cts +54 -12
- package/dist/index.d.ts +54 -12
- package/dist/index.js +187 -71
- package/package.json +8 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModuleMetadata, FactoryProvider, Type, Logger, OnApplicationShutdown, DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { MsgHdrs,
|
|
2
|
+
import { MsgHdrs, ConnectionOptions, NatsConnection, Status, Msg } from '@nats-io/transport-node';
|
|
3
|
+
import { StreamConfig, ConsumerConfig, ConsumeOptions, DeliverPolicy, ReplayPolicy, JetStreamManager, JetStreamClient, ConsumerInfo, JsMsg } from '@nats-io/jetstream';
|
|
3
4
|
import { MessageHandler, Server, CustomTransportStrategy, ClientProxy, ReadPacket, WritePacket, BaseRpcContext } from '@nestjs/microservices';
|
|
4
5
|
import { Observable } from 'rxjs';
|
|
5
6
|
|
|
@@ -354,6 +355,12 @@ declare enum StreamKind {
|
|
|
354
355
|
*/
|
|
355
356
|
type SubjectKind = Exclude<StreamKind, StreamKind.Broadcast>;
|
|
356
357
|
|
|
358
|
+
/** Options for one-shot delayed delivery via NATS 2.12 message scheduling. */
|
|
359
|
+
interface ScheduleRecordOptions {
|
|
360
|
+
/** When to deliver the message. Must be in the future. */
|
|
361
|
+
at: Date;
|
|
362
|
+
}
|
|
363
|
+
|
|
357
364
|
/** @internal Grouped pattern lists by stream kind, used for stream/consumer setup. */
|
|
358
365
|
interface PatternsByKind {
|
|
359
366
|
/** Workqueue event patterns. */
|
|
@@ -485,6 +492,7 @@ declare class ConnectionProvider {
|
|
|
485
492
|
* Sequence: drain → wait for close. Falls back to force-close on error.
|
|
486
493
|
*/
|
|
487
494
|
shutdown(): Promise<void>;
|
|
495
|
+
private initJetStreamManager;
|
|
488
496
|
/** Internal: establish the physical connection with reconnect monitoring. */
|
|
489
497
|
private establish;
|
|
490
498
|
/** Subscribe to connection status events and emit hooks. */
|
|
@@ -592,6 +600,8 @@ declare class StreamProvider {
|
|
|
592
600
|
private buildConfig;
|
|
593
601
|
/** Get default config for a stream kind. */
|
|
594
602
|
private getDefaults;
|
|
603
|
+
/** Check if scheduling is enabled for a stream kind via `allow_msg_schedules` override. */
|
|
604
|
+
private isSchedulingEnabled;
|
|
595
605
|
/** Get user-provided overrides for a stream kind. */
|
|
596
606
|
private getOverrides;
|
|
597
607
|
}
|
|
@@ -997,7 +1007,9 @@ declare class JetstreamClient extends ClientProxy {
|
|
|
997
1007
|
* Publish a fire-and-forget event to JetStream.
|
|
998
1008
|
*
|
|
999
1009
|
* Events are published to either the workqueue stream or broadcast stream
|
|
1000
|
-
* depending on the subject prefix.
|
|
1010
|
+
* depending on the subject prefix. When a schedule is present the message
|
|
1011
|
+
* is published to a `_sch` subject within the same stream, with the target
|
|
1012
|
+
* set to the original event subject.
|
|
1001
1013
|
*/
|
|
1002
1014
|
protected dispatchEvent<T = unknown>(packet: ReadPacket): Promise<T>;
|
|
1003
1015
|
/**
|
|
@@ -1023,8 +1035,20 @@ declare class JetstreamClient extends ClientProxy {
|
|
|
1023
1035
|
private buildEventSubject;
|
|
1024
1036
|
/** Build NATS headers merging custom headers with transport headers. */
|
|
1025
1037
|
private buildHeaders;
|
|
1026
|
-
/** Extract data, headers, and
|
|
1038
|
+
/** Extract data, headers, timeout, and schedule from raw packet data or JetstreamRecord. */
|
|
1027
1039
|
private extractRecordData;
|
|
1040
|
+
/**
|
|
1041
|
+
* Build a schedule-holder subject for NATS message scheduling.
|
|
1042
|
+
*
|
|
1043
|
+
* The schedule-holder subject resides in the same stream as the target but
|
|
1044
|
+
* uses a separate `_sch` namespace that is NOT matched by any consumer filter.
|
|
1045
|
+
* NATS holds the message and publishes it to the target subject after the delay.
|
|
1046
|
+
*
|
|
1047
|
+
* Examples:
|
|
1048
|
+
* - `{svc}__microservice.ev.order.reminder` → `{svc}__microservice._sch.order.reminder`
|
|
1049
|
+
* - `broadcast.config.updated` → `broadcast._sch.config.updated`
|
|
1050
|
+
*/
|
|
1051
|
+
private buildScheduleSubject;
|
|
1028
1052
|
private getRpcTimeout;
|
|
1029
1053
|
}
|
|
1030
1054
|
|
|
@@ -1053,6 +1077,8 @@ declare class JetstreamRecord<TData = unknown> {
|
|
|
1053
1077
|
readonly timeout?: number | undefined;
|
|
1054
1078
|
/** Custom message ID for JetStream deduplication. */
|
|
1055
1079
|
readonly messageId?: string | undefined;
|
|
1080
|
+
/** Schedule options for delayed delivery. */
|
|
1081
|
+
readonly schedule?: ScheduleRecordOptions | undefined;
|
|
1056
1082
|
constructor(
|
|
1057
1083
|
/** Message payload. */
|
|
1058
1084
|
data: TData,
|
|
@@ -1061,7 +1087,9 @@ declare class JetstreamRecord<TData = unknown> {
|
|
|
1061
1087
|
/** Per-request RPC timeout override in ms. */
|
|
1062
1088
|
timeout?: number | undefined,
|
|
1063
1089
|
/** Custom message ID for JetStream deduplication. */
|
|
1064
|
-
messageId?: string | undefined
|
|
1090
|
+
messageId?: string | undefined,
|
|
1091
|
+
/** Schedule options for delayed delivery. */
|
|
1092
|
+
schedule?: ScheduleRecordOptions | undefined);
|
|
1065
1093
|
}
|
|
1066
1094
|
/**
|
|
1067
1095
|
* Fluent builder for constructing JetstreamRecord instances.
|
|
@@ -1074,6 +1102,7 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1074
1102
|
private readonly headers;
|
|
1075
1103
|
private timeout;
|
|
1076
1104
|
private messageId;
|
|
1105
|
+
private scheduleOptions;
|
|
1077
1106
|
constructor(data?: TData);
|
|
1078
1107
|
/**
|
|
1079
1108
|
* Set the message payload.
|
|
@@ -1121,6 +1150,20 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1121
1150
|
* @param ms - Timeout in milliseconds. Overrides the global RPC timeout for this request only.
|
|
1122
1151
|
*/
|
|
1123
1152
|
setTimeout(ms: number): this;
|
|
1153
|
+
/**
|
|
1154
|
+
* Schedule one-shot delayed delivery.
|
|
1155
|
+
*
|
|
1156
|
+
* The message is held by NATS and delivered to the event consumer
|
|
1157
|
+
* at the specified time. Requires NATS >= 2.12 and `allow_msg_schedules: true`
|
|
1158
|
+
* on the event stream (via `events: { stream: { allow_msg_schedules: true } }`).
|
|
1159
|
+
*
|
|
1160
|
+
* Only meaningful for events (`client.emit()`). If used with RPC
|
|
1161
|
+
* (`client.send()`), a warning is logged and the schedule is ignored.
|
|
1162
|
+
*
|
|
1163
|
+
* @param date - Delivery time. Must be in the future.
|
|
1164
|
+
* @throws Error if the date is not in the future.
|
|
1165
|
+
*/
|
|
1166
|
+
scheduleAt(date: Date): this;
|
|
1124
1167
|
/**
|
|
1125
1168
|
* Build the immutable {@link JetstreamRecord}.
|
|
1126
1169
|
*
|
|
@@ -1132,10 +1175,10 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1132
1175
|
}
|
|
1133
1176
|
|
|
1134
1177
|
/**
|
|
1135
|
-
* Default JSON codec
|
|
1178
|
+
* Default JSON codec using native `TextEncoder`/`TextDecoder`.
|
|
1136
1179
|
*
|
|
1137
|
-
* Serializes to
|
|
1138
|
-
*
|
|
1180
|
+
* Serializes values to JSON via `JSON.stringify` and encodes the
|
|
1181
|
+
* resulting string into a `Uint8Array`. Decoding reverses the process.
|
|
1139
1182
|
*
|
|
1140
1183
|
* @example
|
|
1141
1184
|
* ```typescript
|
|
@@ -1145,7 +1188,6 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1145
1188
|
* ```
|
|
1146
1189
|
*/
|
|
1147
1190
|
declare class JsonCodec implements Codec {
|
|
1148
|
-
private readonly inner;
|
|
1149
1191
|
encode(data: unknown): Uint8Array;
|
|
1150
1192
|
decode(data: Uint8Array): unknown;
|
|
1151
1193
|
}
|
|
@@ -1365,7 +1407,7 @@ declare const internalName: (name: string) => string;
|
|
|
1365
1407
|
* Build a fully-qualified NATS subject for workqueue events, RPC commands, or ordered events.
|
|
1366
1408
|
*
|
|
1367
1409
|
* @param serviceName - Target service name.
|
|
1368
|
-
* @param kind - Subject kind (
|
|
1410
|
+
* @param kind - Subject kind ({@link StreamKind.Event}, {@link StreamKind.Command}, or {@link StreamKind.Ordered}).
|
|
1369
1411
|
* @param pattern - The message pattern (e.g. `'user.created'`).
|
|
1370
1412
|
* @returns `{serviceName}__microservice.{kind}.{pattern}`
|
|
1371
1413
|
*/
|
|
@@ -1374,7 +1416,7 @@ declare const buildSubject: (serviceName: string, kind: SubjectKind, pattern: st
|
|
|
1374
1416
|
* Build the JetStream stream name for a given service and kind.
|
|
1375
1417
|
*
|
|
1376
1418
|
* @param serviceName - Service name from `forRoot({ name })`.
|
|
1377
|
-
* @param kind - Stream kind (
|
|
1419
|
+
* @param kind - Stream kind ({@link StreamKind}).
|
|
1378
1420
|
* @returns Stream name (e.g. `orders__microservice_ev-stream` or `broadcast-stream`).
|
|
1379
1421
|
*/
|
|
1380
1422
|
declare const streamName: (serviceName: string, kind: StreamKind) => string;
|
|
@@ -1382,7 +1424,7 @@ declare const streamName: (serviceName: string, kind: StreamKind) => string;
|
|
|
1382
1424
|
* Build the JetStream consumer name for a given service and kind.
|
|
1383
1425
|
*
|
|
1384
1426
|
* @param serviceName - Service name from `forRoot({ name })`.
|
|
1385
|
-
* @param kind - Stream kind (
|
|
1427
|
+
* @param kind - Stream kind ({@link StreamKind}).
|
|
1386
1428
|
* @returns Consumer name (e.g. `orders__microservice_ev-consumer`).
|
|
1387
1429
|
*/
|
|
1388
1430
|
declare const consumerName: (serviceName: string, kind: StreamKind) => string;
|
|
@@ -1401,4 +1443,4 @@ declare const isJetStreamRpcMode: (rpc: RpcConfig | undefined) => boolean;
|
|
|
1401
1443
|
/** Check if the RPC config specifies Core mode (default). */
|
|
1402
1444
|
declare const isCoreRpcMode: (rpc: RpcConfig | undefined) => boolean;
|
|
1403
1445
|
|
|
1404
|
-
export { type Codec, type DeadLetterInfo, EventBus, JETSTREAM_CODEC, JETSTREAM_CONNECTION, JETSTREAM_EVENT_BUS, JETSTREAM_OPTIONS, JetstreamClient, type JetstreamFeatureOptions, JetstreamHeader, JetstreamHealthIndicator, type JetstreamHealthStatus, JetstreamModule, type JetstreamModuleAsyncOptions, type JetstreamModuleOptions, JetstreamRecord, JetstreamRecordBuilder, JetstreamStrategy, JsonCodec, MessageKind, type OrderedEventOverrides, PatternPrefix, type RpcConfig, RpcContext, type StreamConsumerOverrides, StreamKind, TransportEvent, type TransportHooks, buildSubject, consumerName, getClientToken, internalName, isCoreRpcMode, isJetStreamRpcMode, streamName, toNanos };
|
|
1446
|
+
export { type Codec, type DeadLetterInfo, EventBus, JETSTREAM_CODEC, JETSTREAM_CONNECTION, JETSTREAM_EVENT_BUS, JETSTREAM_OPTIONS, JetstreamClient, type JetstreamFeatureOptions, JetstreamHeader, JetstreamHealthIndicator, type JetstreamHealthStatus, JetstreamModule, type JetstreamModuleAsyncOptions, type JetstreamModuleOptions, JetstreamRecord, JetstreamRecordBuilder, JetstreamStrategy, JsonCodec, MessageKind, type OrderedEventOverrides, PatternPrefix, type RpcConfig, RpcContext, type ScheduleRecordOptions, type StreamConsumerOverrides, StreamKind, TransportEvent, type TransportHooks, buildSubject, consumerName, getClientToken, internalName, isCoreRpcMode, isJetStreamRpcMode, streamName, toNanos };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ModuleMetadata, FactoryProvider, Type, Logger, OnApplicationShutdown, DynamicModule } from '@nestjs/common';
|
|
2
|
-
import { MsgHdrs,
|
|
2
|
+
import { MsgHdrs, ConnectionOptions, NatsConnection, Status, Msg } from '@nats-io/transport-node';
|
|
3
|
+
import { StreamConfig, ConsumerConfig, ConsumeOptions, DeliverPolicy, ReplayPolicy, JetStreamManager, JetStreamClient, ConsumerInfo, JsMsg } from '@nats-io/jetstream';
|
|
3
4
|
import { MessageHandler, Server, CustomTransportStrategy, ClientProxy, ReadPacket, WritePacket, BaseRpcContext } from '@nestjs/microservices';
|
|
4
5
|
import { Observable } from 'rxjs';
|
|
5
6
|
|
|
@@ -354,6 +355,12 @@ declare enum StreamKind {
|
|
|
354
355
|
*/
|
|
355
356
|
type SubjectKind = Exclude<StreamKind, StreamKind.Broadcast>;
|
|
356
357
|
|
|
358
|
+
/** Options for one-shot delayed delivery via NATS 2.12 message scheduling. */
|
|
359
|
+
interface ScheduleRecordOptions {
|
|
360
|
+
/** When to deliver the message. Must be in the future. */
|
|
361
|
+
at: Date;
|
|
362
|
+
}
|
|
363
|
+
|
|
357
364
|
/** @internal Grouped pattern lists by stream kind, used for stream/consumer setup. */
|
|
358
365
|
interface PatternsByKind {
|
|
359
366
|
/** Workqueue event patterns. */
|
|
@@ -485,6 +492,7 @@ declare class ConnectionProvider {
|
|
|
485
492
|
* Sequence: drain → wait for close. Falls back to force-close on error.
|
|
486
493
|
*/
|
|
487
494
|
shutdown(): Promise<void>;
|
|
495
|
+
private initJetStreamManager;
|
|
488
496
|
/** Internal: establish the physical connection with reconnect monitoring. */
|
|
489
497
|
private establish;
|
|
490
498
|
/** Subscribe to connection status events and emit hooks. */
|
|
@@ -592,6 +600,8 @@ declare class StreamProvider {
|
|
|
592
600
|
private buildConfig;
|
|
593
601
|
/** Get default config for a stream kind. */
|
|
594
602
|
private getDefaults;
|
|
603
|
+
/** Check if scheduling is enabled for a stream kind via `allow_msg_schedules` override. */
|
|
604
|
+
private isSchedulingEnabled;
|
|
595
605
|
/** Get user-provided overrides for a stream kind. */
|
|
596
606
|
private getOverrides;
|
|
597
607
|
}
|
|
@@ -997,7 +1007,9 @@ declare class JetstreamClient extends ClientProxy {
|
|
|
997
1007
|
* Publish a fire-and-forget event to JetStream.
|
|
998
1008
|
*
|
|
999
1009
|
* Events are published to either the workqueue stream or broadcast stream
|
|
1000
|
-
* depending on the subject prefix.
|
|
1010
|
+
* depending on the subject prefix. When a schedule is present the message
|
|
1011
|
+
* is published to a `_sch` subject within the same stream, with the target
|
|
1012
|
+
* set to the original event subject.
|
|
1001
1013
|
*/
|
|
1002
1014
|
protected dispatchEvent<T = unknown>(packet: ReadPacket): Promise<T>;
|
|
1003
1015
|
/**
|
|
@@ -1023,8 +1035,20 @@ declare class JetstreamClient extends ClientProxy {
|
|
|
1023
1035
|
private buildEventSubject;
|
|
1024
1036
|
/** Build NATS headers merging custom headers with transport headers. */
|
|
1025
1037
|
private buildHeaders;
|
|
1026
|
-
/** Extract data, headers, and
|
|
1038
|
+
/** Extract data, headers, timeout, and schedule from raw packet data or JetstreamRecord. */
|
|
1027
1039
|
private extractRecordData;
|
|
1040
|
+
/**
|
|
1041
|
+
* Build a schedule-holder subject for NATS message scheduling.
|
|
1042
|
+
*
|
|
1043
|
+
* The schedule-holder subject resides in the same stream as the target but
|
|
1044
|
+
* uses a separate `_sch` namespace that is NOT matched by any consumer filter.
|
|
1045
|
+
* NATS holds the message and publishes it to the target subject after the delay.
|
|
1046
|
+
*
|
|
1047
|
+
* Examples:
|
|
1048
|
+
* - `{svc}__microservice.ev.order.reminder` → `{svc}__microservice._sch.order.reminder`
|
|
1049
|
+
* - `broadcast.config.updated` → `broadcast._sch.config.updated`
|
|
1050
|
+
*/
|
|
1051
|
+
private buildScheduleSubject;
|
|
1028
1052
|
private getRpcTimeout;
|
|
1029
1053
|
}
|
|
1030
1054
|
|
|
@@ -1053,6 +1077,8 @@ declare class JetstreamRecord<TData = unknown> {
|
|
|
1053
1077
|
readonly timeout?: number | undefined;
|
|
1054
1078
|
/** Custom message ID for JetStream deduplication. */
|
|
1055
1079
|
readonly messageId?: string | undefined;
|
|
1080
|
+
/** Schedule options for delayed delivery. */
|
|
1081
|
+
readonly schedule?: ScheduleRecordOptions | undefined;
|
|
1056
1082
|
constructor(
|
|
1057
1083
|
/** Message payload. */
|
|
1058
1084
|
data: TData,
|
|
@@ -1061,7 +1087,9 @@ declare class JetstreamRecord<TData = unknown> {
|
|
|
1061
1087
|
/** Per-request RPC timeout override in ms. */
|
|
1062
1088
|
timeout?: number | undefined,
|
|
1063
1089
|
/** Custom message ID for JetStream deduplication. */
|
|
1064
|
-
messageId?: string | undefined
|
|
1090
|
+
messageId?: string | undefined,
|
|
1091
|
+
/** Schedule options for delayed delivery. */
|
|
1092
|
+
schedule?: ScheduleRecordOptions | undefined);
|
|
1065
1093
|
}
|
|
1066
1094
|
/**
|
|
1067
1095
|
* Fluent builder for constructing JetstreamRecord instances.
|
|
@@ -1074,6 +1102,7 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1074
1102
|
private readonly headers;
|
|
1075
1103
|
private timeout;
|
|
1076
1104
|
private messageId;
|
|
1105
|
+
private scheduleOptions;
|
|
1077
1106
|
constructor(data?: TData);
|
|
1078
1107
|
/**
|
|
1079
1108
|
* Set the message payload.
|
|
@@ -1121,6 +1150,20 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1121
1150
|
* @param ms - Timeout in milliseconds. Overrides the global RPC timeout for this request only.
|
|
1122
1151
|
*/
|
|
1123
1152
|
setTimeout(ms: number): this;
|
|
1153
|
+
/**
|
|
1154
|
+
* Schedule one-shot delayed delivery.
|
|
1155
|
+
*
|
|
1156
|
+
* The message is held by NATS and delivered to the event consumer
|
|
1157
|
+
* at the specified time. Requires NATS >= 2.12 and `allow_msg_schedules: true`
|
|
1158
|
+
* on the event stream (via `events: { stream: { allow_msg_schedules: true } }`).
|
|
1159
|
+
*
|
|
1160
|
+
* Only meaningful for events (`client.emit()`). If used with RPC
|
|
1161
|
+
* (`client.send()`), a warning is logged and the schedule is ignored.
|
|
1162
|
+
*
|
|
1163
|
+
* @param date - Delivery time. Must be in the future.
|
|
1164
|
+
* @throws Error if the date is not in the future.
|
|
1165
|
+
*/
|
|
1166
|
+
scheduleAt(date: Date): this;
|
|
1124
1167
|
/**
|
|
1125
1168
|
* Build the immutable {@link JetstreamRecord}.
|
|
1126
1169
|
*
|
|
@@ -1132,10 +1175,10 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1132
1175
|
}
|
|
1133
1176
|
|
|
1134
1177
|
/**
|
|
1135
|
-
* Default JSON codec
|
|
1178
|
+
* Default JSON codec using native `TextEncoder`/`TextDecoder`.
|
|
1136
1179
|
*
|
|
1137
|
-
* Serializes to
|
|
1138
|
-
*
|
|
1180
|
+
* Serializes values to JSON via `JSON.stringify` and encodes the
|
|
1181
|
+
* resulting string into a `Uint8Array`. Decoding reverses the process.
|
|
1139
1182
|
*
|
|
1140
1183
|
* @example
|
|
1141
1184
|
* ```typescript
|
|
@@ -1145,7 +1188,6 @@ declare class JetstreamRecordBuilder<TData = unknown> {
|
|
|
1145
1188
|
* ```
|
|
1146
1189
|
*/
|
|
1147
1190
|
declare class JsonCodec implements Codec {
|
|
1148
|
-
private readonly inner;
|
|
1149
1191
|
encode(data: unknown): Uint8Array;
|
|
1150
1192
|
decode(data: Uint8Array): unknown;
|
|
1151
1193
|
}
|
|
@@ -1365,7 +1407,7 @@ declare const internalName: (name: string) => string;
|
|
|
1365
1407
|
* Build a fully-qualified NATS subject for workqueue events, RPC commands, or ordered events.
|
|
1366
1408
|
*
|
|
1367
1409
|
* @param serviceName - Target service name.
|
|
1368
|
-
* @param kind - Subject kind (
|
|
1410
|
+
* @param kind - Subject kind ({@link StreamKind.Event}, {@link StreamKind.Command}, or {@link StreamKind.Ordered}).
|
|
1369
1411
|
* @param pattern - The message pattern (e.g. `'user.created'`).
|
|
1370
1412
|
* @returns `{serviceName}__microservice.{kind}.{pattern}`
|
|
1371
1413
|
*/
|
|
@@ -1374,7 +1416,7 @@ declare const buildSubject: (serviceName: string, kind: SubjectKind, pattern: st
|
|
|
1374
1416
|
* Build the JetStream stream name for a given service and kind.
|
|
1375
1417
|
*
|
|
1376
1418
|
* @param serviceName - Service name from `forRoot({ name })`.
|
|
1377
|
-
* @param kind - Stream kind (
|
|
1419
|
+
* @param kind - Stream kind ({@link StreamKind}).
|
|
1378
1420
|
* @returns Stream name (e.g. `orders__microservice_ev-stream` or `broadcast-stream`).
|
|
1379
1421
|
*/
|
|
1380
1422
|
declare const streamName: (serviceName: string, kind: StreamKind) => string;
|
|
@@ -1382,7 +1424,7 @@ declare const streamName: (serviceName: string, kind: StreamKind) => string;
|
|
|
1382
1424
|
* Build the JetStream consumer name for a given service and kind.
|
|
1383
1425
|
*
|
|
1384
1426
|
* @param serviceName - Service name from `forRoot({ name })`.
|
|
1385
|
-
* @param kind - Stream kind (
|
|
1427
|
+
* @param kind - Stream kind ({@link StreamKind}).
|
|
1386
1428
|
* @returns Consumer name (e.g. `orders__microservice_ev-consumer`).
|
|
1387
1429
|
*/
|
|
1388
1430
|
declare const consumerName: (serviceName: string, kind: StreamKind) => string;
|
|
@@ -1401,4 +1443,4 @@ declare const isJetStreamRpcMode: (rpc: RpcConfig | undefined) => boolean;
|
|
|
1401
1443
|
/** Check if the RPC config specifies Core mode (default). */
|
|
1402
1444
|
declare const isCoreRpcMode: (rpc: RpcConfig | undefined) => boolean;
|
|
1403
1445
|
|
|
1404
|
-
export { type Codec, type DeadLetterInfo, EventBus, JETSTREAM_CODEC, JETSTREAM_CONNECTION, JETSTREAM_EVENT_BUS, JETSTREAM_OPTIONS, JetstreamClient, type JetstreamFeatureOptions, JetstreamHeader, JetstreamHealthIndicator, type JetstreamHealthStatus, JetstreamModule, type JetstreamModuleAsyncOptions, type JetstreamModuleOptions, JetstreamRecord, JetstreamRecordBuilder, JetstreamStrategy, JsonCodec, MessageKind, type OrderedEventOverrides, PatternPrefix, type RpcConfig, RpcContext, type StreamConsumerOverrides, StreamKind, TransportEvent, type TransportHooks, buildSubject, consumerName, getClientToken, internalName, isCoreRpcMode, isJetStreamRpcMode, streamName, toNanos };
|
|
1446
|
+
export { type Codec, type DeadLetterInfo, EventBus, JETSTREAM_CODEC, JETSTREAM_CONNECTION, JETSTREAM_EVENT_BUS, JETSTREAM_OPTIONS, JetstreamClient, type JetstreamFeatureOptions, JetstreamHeader, JetstreamHealthIndicator, type JetstreamHealthStatus, JetstreamModule, type JetstreamModuleAsyncOptions, type JetstreamModuleOptions, JetstreamRecord, JetstreamRecordBuilder, JetstreamStrategy, JsonCodec, MessageKind, type OrderedEventOverrides, PatternPrefix, type RpcConfig, RpcContext, type ScheduleRecordOptions, type StreamConsumerOverrides, StreamKind, TransportEvent, type TransportHooks, buildSubject, consumerName, getClientToken, internalName, isCoreRpcMode, isJetStreamRpcMode, streamName, toNanos };
|