@bymax-one/nest-realtime 1.2.7 → 1.2.9
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/CHANGELOG.md +150 -1
- package/README.md +5 -3
- package/dist/internal/index.cjs +194 -499
- package/dist/internal/index.d.cts +83 -6
- package/dist/internal/index.d.ts +83 -6
- package/dist/internal/index.mjs +195 -501
- package/dist/react/index.cjs +0 -2
- package/dist/react/index.d.cts +2 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.mjs +0 -2
- package/dist/shared/index.d.cts +2 -1
- package/dist/shared/index.d.ts +2 -1
- package/dist/websocket/index.cjs +17 -288
- package/dist/websocket/index.d.cts +6 -3
- package/dist/websocket/index.d.ts +6 -3
- package/dist/websocket/index.mjs +18 -289
- package/package.json +5 -4
|
@@ -822,6 +822,11 @@ interface ITransport {
|
|
|
822
822
|
disconnect(connectionId: string, reason?: string): Promise<void>;
|
|
823
823
|
/** Lifecycle hook — called on NestJS bootstrap. */
|
|
824
824
|
onModuleInit?(): Promise<void>;
|
|
825
|
+
/**
|
|
826
|
+
* Lifecycle hook — called before NestJS closes the HTTP server on shutdown. A transport that
|
|
827
|
+
* holds open responses ends them here.
|
|
828
|
+
*/
|
|
829
|
+
beforeApplicationShutdown?(): Promise<void>;
|
|
825
830
|
/** Lifecycle hook — called on NestJS shutdown. */
|
|
826
831
|
onApplicationShutdown?(): Promise<void>;
|
|
827
832
|
}
|
|
@@ -957,8 +962,14 @@ declare class ReauthenticationService implements OnModuleInit, OnApplicationShut
|
|
|
957
962
|
* cycle revalidates the connection and tries again.
|
|
958
963
|
*/
|
|
959
964
|
private revoke;
|
|
960
|
-
/**
|
|
965
|
+
/**
|
|
966
|
+
* Evict the positive-cache entry, optionally start the failure event, then disconnect. The
|
|
967
|
+
* event is a notification: it is started first, so its local delivery precedes the disconnect,
|
|
968
|
+
* but the revocation never waits for it. A failure to send it is logged.
|
|
969
|
+
*/
|
|
961
970
|
private handleFailure;
|
|
971
|
+
/** Send the failure event without waiting for it; a rejection, or a throw, is only logged. */
|
|
972
|
+
private notify;
|
|
962
973
|
}
|
|
963
974
|
|
|
964
975
|
/**
|
|
@@ -1189,6 +1200,7 @@ interface RegisterSseConnectionParams {
|
|
|
1189
1200
|
* `takeUntil`) before unregistering. See `docs/technical_specification.md` §6.1.
|
|
1190
1201
|
*/
|
|
1191
1202
|
declare class SseTransport implements ITransport {
|
|
1203
|
+
#private;
|
|
1192
1204
|
private readonly connections;
|
|
1193
1205
|
private readonly rooms;
|
|
1194
1206
|
private readonly replayBuffer;
|
|
@@ -1203,8 +1215,18 @@ declare class SseTransport implements ITransport {
|
|
|
1203
1215
|
readonly kind: "sse";
|
|
1204
1216
|
private readonly logger;
|
|
1205
1217
|
constructor(connections: ConnectionRegistry, rooms: RoomRegistry, replayBuffer: EventReplayBuffer, idGen: EventIdGenerator, heartbeat: HeartbeatService, auth: IConnectionAuthenticator, pubsub: IRealtimePubSub, hooks: IConnectionLifecycleHooks, options: BymaxRealtimeModuleOptions, instanceId: string, offlineQueue?: IOfflineQueueStorage | undefined);
|
|
1206
|
-
/**
|
|
1218
|
+
/**
|
|
1219
|
+
* Tear down every SSE connection and stop heartbeat before the HTTP server closes.
|
|
1220
|
+
*
|
|
1221
|
+
* Nest awaits the HTTP server's close before it runs `onApplicationShutdown`, and the server
|
|
1222
|
+
* does not finish closing while a response is open, so the streams have to be ended here, before
|
|
1223
|
+
* the close, for the later shutdown hooks to run.
|
|
1224
|
+
*/
|
|
1225
|
+
beforeApplicationShutdown(): Promise<void>;
|
|
1226
|
+
/** The same teardown, for a caller that runs only this hook; it finds nothing left to close. */
|
|
1207
1227
|
onApplicationShutdown(): Promise<void>;
|
|
1228
|
+
/** Whether shutdown has begun, after which a new stream is refused because nothing would end it. */
|
|
1229
|
+
get shuttingDown(): boolean;
|
|
1208
1230
|
/** The resolved heartbeat interval for this transport. */
|
|
1209
1231
|
get heartbeatMs(): number;
|
|
1210
1232
|
/** Whether the `connection:established` event should be emitted on connect. */
|
|
@@ -1385,6 +1407,8 @@ declare class SseSubscriptionHandler {
|
|
|
1385
1407
|
* written to the server log.
|
|
1386
1408
|
*/
|
|
1387
1409
|
handle(req: SseRequest, res: SseResponse): Promise<Observable<MessageEvent>>;
|
|
1410
|
+
/** Refuse a new stream with a 503 once shutdown has begun. */
|
|
1411
|
+
private refuseDuringShutdown;
|
|
1388
1412
|
private openStream;
|
|
1389
1413
|
/**
|
|
1390
1414
|
* Authenticate ahead of the route, from a guard: with an interceptor registered Nest commits
|
|
@@ -1549,8 +1573,29 @@ declare class RedisRealtimePubSub implements IRealtimePubSub {
|
|
|
1549
1573
|
* while the subscriber connection is down, and after the last handler has unsubscribed.
|
|
1550
1574
|
*/
|
|
1551
1575
|
isSubscribed(): boolean;
|
|
1552
|
-
/**
|
|
1576
|
+
/**
|
|
1577
|
+
* JSON-encodes the message and PUBLISHes it to the configured channel, if the client can publish.
|
|
1578
|
+
* ioredis queues a command issued while it cannot and sends it, late, when the connection
|
|
1579
|
+
* returns, and never gives up on one waiting behind a peer that does not answer, so a revocation
|
|
1580
|
+
* would wait out the whole outage and then be sent after its caller was told it failed. It is
|
|
1581
|
+
* refused at once instead, and never handed to the client.
|
|
1582
|
+
*/
|
|
1553
1583
|
publish(message: RealtimePubSubMessage): Promise<void>;
|
|
1584
|
+
/**
|
|
1585
|
+
* A host client built with lazyConnect waits for its first command to connect, and that command
|
|
1586
|
+
* would be refused; connecting it is what the command would have done. Its failures show as its
|
|
1587
|
+
* status.
|
|
1588
|
+
*/
|
|
1589
|
+
private connectLazyClient;
|
|
1590
|
+
/**
|
|
1591
|
+
* Resolves once the publishing client's first connection attempt is over, however it ended:
|
|
1592
|
+
* ready, closed (to retry or to give up), or ended with no close when its connector fails. The
|
|
1593
|
+
* client is created just before the application boots, so for its first milliseconds it is still
|
|
1594
|
+
* connecting, and an emit from another provider's start-up hook would be refused for it. A
|
|
1595
|
+
* client that answers nothing is given up on after the deadline.
|
|
1596
|
+
*/
|
|
1597
|
+
private publisherSettled;
|
|
1598
|
+
private cannotPublish;
|
|
1554
1599
|
/**
|
|
1555
1600
|
* Lazily creates the single shared subscribe client on first call; returns an async
|
|
1556
1601
|
* unsubscribe that quits the client when the last handler is removed. Concurrent
|
|
@@ -1565,6 +1610,12 @@ declare class RedisRealtimePubSub implements IRealtimePubSub {
|
|
|
1565
1610
|
/** Lazily create the single shared subscribe client (idempotent under concurrent calls). */
|
|
1566
1611
|
private ensureSubscriber;
|
|
1567
1612
|
private createSubscriber;
|
|
1613
|
+
/**
|
|
1614
|
+
* Settles the boot against the first SUBSCRIBE. An error reply is the server refusing, which
|
|
1615
|
+
* fails the boot; any other failure, an error event or a close or a rejection that is not an
|
|
1616
|
+
* error reply, is the connection failing, which lets the boot go on unready.
|
|
1617
|
+
*/
|
|
1618
|
+
private negotiate;
|
|
1568
1619
|
private confirm;
|
|
1569
1620
|
/** A server that was reached and refused the SUBSCRIBE after boot: it stays unsubscribed. */
|
|
1570
1621
|
private refused;
|
|
@@ -1737,6 +1788,31 @@ declare function composeRoomId(prefix: keyof typeof ROOM_PREFIXES, ...parts: str
|
|
|
1737
1788
|
/** Describe a thrown or rejected value without throwing: `.message` on `null`, or `String()` on a prototype-less object, would. */
|
|
1738
1789
|
declare function describeError(reason: unknown): string;
|
|
1739
1790
|
|
|
1791
|
+
/**
|
|
1792
|
+
* @fileoverview The error every coded failure of this library is built with.
|
|
1793
|
+
* @layer utils
|
|
1794
|
+
*/
|
|
1795
|
+
|
|
1796
|
+
/** An error that carries one of the library's stable codes as a property. */
|
|
1797
|
+
type CodedError = Error & {
|
|
1798
|
+
readonly code: RealtimeErrorCode;
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* Builds an error whose stable code is both the lead of its message and a `code` property.
|
|
1802
|
+
* Deriving the two from one value keeps them from disagreeing, and the property is what a caller
|
|
1803
|
+
* branches on without parsing text. A plain `Error` rather than a class: a class is a different
|
|
1804
|
+
* class in each bundle of the package, so `instanceof` would not be reliable across them.
|
|
1805
|
+
*
|
|
1806
|
+
* @param code - The stable error code to carry.
|
|
1807
|
+
* @param detail - What went wrong, after the code.
|
|
1808
|
+
* @param options - `who`: the class that raises it, shown in brackets before the code. `cause`: the
|
|
1809
|
+
* failure underneath, whatever was thrown; it is kept when the key is present.
|
|
1810
|
+
*/
|
|
1811
|
+
declare function realtimeError(code: RealtimeErrorCode, detail: string, options?: {
|
|
1812
|
+
readonly who?: string;
|
|
1813
|
+
readonly cause?: unknown;
|
|
1814
|
+
}): CodedError;
|
|
1815
|
+
|
|
1740
1816
|
/**
|
|
1741
1817
|
* @fileoverview The error a call rejects with when it could not reach what it was asked to act on.
|
|
1742
1818
|
* @layer utils
|
|
@@ -1745,14 +1821,14 @@ declare function describeError(reason: unknown): string;
|
|
|
1745
1821
|
/**
|
|
1746
1822
|
* Builds the rejection for a call whose effect did not happen, such as a revocation that never
|
|
1747
1823
|
* reached its connection. The stable code leads the message, as it does in the other errors this
|
|
1748
|
-
* library raises, and the original failure travels as `cause`.
|
|
1824
|
+
* library raises, is also the `code` property, and the original failure travels as `cause`.
|
|
1749
1825
|
*
|
|
1750
1826
|
* @param code - The stable error code to carry.
|
|
1751
1827
|
* @param who - The class that raises it, shown in brackets.
|
|
1752
1828
|
* @param what - What could not be reached.
|
|
1753
1829
|
* @param cause - The failure underneath, whatever was thrown.
|
|
1754
1830
|
*/
|
|
1755
|
-
declare function unavailableError(code: RealtimeErrorCode, who: string, what: string, cause: unknown):
|
|
1831
|
+
declare function unavailableError(code: RealtimeErrorCode, who: string, what: string, cause: unknown): CodedError;
|
|
1756
1832
|
|
|
1757
1833
|
/**
|
|
1758
1834
|
* @fileoverview Makes a delivery path's failure visible without failing the call that used it.
|
|
@@ -1867,4 +1943,5 @@ declare const RESERVED_EVENT_NAMES: {
|
|
|
1867
1943
|
/** Union of reserved event name values. */
|
|
1868
1944
|
type ReservedEventName = (typeof RESERVED_EVENT_NAMES)[keyof typeof RESERVED_EVENT_NAMES];
|
|
1869
1945
|
|
|
1870
|
-
export {
|
|
1946
|
+
export { BymaxRealtimeModule, ConnectionRegistry, EventIdGenerator, EventReplayBuffer, HeartbeatService, InMemoryPubSub, OfflineQueueDeliveryService, REALTIME_AUTHENTICATOR_TOKEN, REALTIME_ERROR_CODES, REALTIME_HOOKS_TOKEN, REALTIME_INSTANCE_ID_TOKEN, REALTIME_OFFLINE_QUEUE_TOKEN, REALTIME_OPTIONS_TOKEN, REALTIME_PRESENCE_TOKEN, REALTIME_PUBSUB_TOKEN, REALTIME_TRANSPORT_TOKEN, RESERVED_EVENT_NAMES, ROOM_PREFIXES, RealtimePubSubSubscriber, RealtimeService, ReauthenticationService, RedisOfflineQueue, RedisRealtimePubSub, RoomRegistry, SseSubscriptionHandler, SseTransport, assertIdentityIsNotBlank, composeForRoot, composeForRootAsync, composeRoomId, createSseController, describeError, parseCookieHeader, realtimeError, reportDeliveryFailure, resolveAuthTenant, sseWiring, unavailableError };
|
|
1947
|
+
export type { AuthenticationResult, BymaxRealtimeModuleAsyncOptions, BymaxRealtimeModuleOptions, BymaxRealtimeModuleOptionsFactory, CodedError, ConnectionAuthContext, ConnectionEventMeta, CorsConfig, DeliveryFailure, IConnectionAuthenticator, IConnectionLifecycleHooks, IOfflineQueueStorage, IPresenceStorage, IRealtimePubSub, ITransport, OfflineQueuedEvent, PublicConnectionMeta, RealtimeErrorCode, RealtimeEvent, RealtimePubSubMessage, ReauthenticationPolicy, RedisOfflineQueueOptions, RedisRealtimePubSubOptions, ReservedEventName, RoomPrefix, SseOptions, SseRealtimeModuleAsyncOptions, SseRealtimeModuleOptions, TransportMode, TransportRegistration, TransportWiring, WebSocketOptions, WebSocketRealtimeModuleAsyncOptions, WebSocketRealtimeModuleOptions };
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -822,6 +822,11 @@ interface ITransport {
|
|
|
822
822
|
disconnect(connectionId: string, reason?: string): Promise<void>;
|
|
823
823
|
/** Lifecycle hook — called on NestJS bootstrap. */
|
|
824
824
|
onModuleInit?(): Promise<void>;
|
|
825
|
+
/**
|
|
826
|
+
* Lifecycle hook — called before NestJS closes the HTTP server on shutdown. A transport that
|
|
827
|
+
* holds open responses ends them here.
|
|
828
|
+
*/
|
|
829
|
+
beforeApplicationShutdown?(): Promise<void>;
|
|
825
830
|
/** Lifecycle hook — called on NestJS shutdown. */
|
|
826
831
|
onApplicationShutdown?(): Promise<void>;
|
|
827
832
|
}
|
|
@@ -957,8 +962,14 @@ declare class ReauthenticationService implements OnModuleInit, OnApplicationShut
|
|
|
957
962
|
* cycle revalidates the connection and tries again.
|
|
958
963
|
*/
|
|
959
964
|
private revoke;
|
|
960
|
-
/**
|
|
965
|
+
/**
|
|
966
|
+
* Evict the positive-cache entry, optionally start the failure event, then disconnect. The
|
|
967
|
+
* event is a notification: it is started first, so its local delivery precedes the disconnect,
|
|
968
|
+
* but the revocation never waits for it. A failure to send it is logged.
|
|
969
|
+
*/
|
|
961
970
|
private handleFailure;
|
|
971
|
+
/** Send the failure event without waiting for it; a rejection, or a throw, is only logged. */
|
|
972
|
+
private notify;
|
|
962
973
|
}
|
|
963
974
|
|
|
964
975
|
/**
|
|
@@ -1189,6 +1200,7 @@ interface RegisterSseConnectionParams {
|
|
|
1189
1200
|
* `takeUntil`) before unregistering. See `docs/technical_specification.md` §6.1.
|
|
1190
1201
|
*/
|
|
1191
1202
|
declare class SseTransport implements ITransport {
|
|
1203
|
+
#private;
|
|
1192
1204
|
private readonly connections;
|
|
1193
1205
|
private readonly rooms;
|
|
1194
1206
|
private readonly replayBuffer;
|
|
@@ -1203,8 +1215,18 @@ declare class SseTransport implements ITransport {
|
|
|
1203
1215
|
readonly kind: "sse";
|
|
1204
1216
|
private readonly logger;
|
|
1205
1217
|
constructor(connections: ConnectionRegistry, rooms: RoomRegistry, replayBuffer: EventReplayBuffer, idGen: EventIdGenerator, heartbeat: HeartbeatService, auth: IConnectionAuthenticator, pubsub: IRealtimePubSub, hooks: IConnectionLifecycleHooks, options: BymaxRealtimeModuleOptions, instanceId: string, offlineQueue?: IOfflineQueueStorage | undefined);
|
|
1206
|
-
/**
|
|
1218
|
+
/**
|
|
1219
|
+
* Tear down every SSE connection and stop heartbeat before the HTTP server closes.
|
|
1220
|
+
*
|
|
1221
|
+
* Nest awaits the HTTP server's close before it runs `onApplicationShutdown`, and the server
|
|
1222
|
+
* does not finish closing while a response is open, so the streams have to be ended here, before
|
|
1223
|
+
* the close, for the later shutdown hooks to run.
|
|
1224
|
+
*/
|
|
1225
|
+
beforeApplicationShutdown(): Promise<void>;
|
|
1226
|
+
/** The same teardown, for a caller that runs only this hook; it finds nothing left to close. */
|
|
1207
1227
|
onApplicationShutdown(): Promise<void>;
|
|
1228
|
+
/** Whether shutdown has begun, after which a new stream is refused because nothing would end it. */
|
|
1229
|
+
get shuttingDown(): boolean;
|
|
1208
1230
|
/** The resolved heartbeat interval for this transport. */
|
|
1209
1231
|
get heartbeatMs(): number;
|
|
1210
1232
|
/** Whether the `connection:established` event should be emitted on connect. */
|
|
@@ -1385,6 +1407,8 @@ declare class SseSubscriptionHandler {
|
|
|
1385
1407
|
* written to the server log.
|
|
1386
1408
|
*/
|
|
1387
1409
|
handle(req: SseRequest, res: SseResponse): Promise<Observable<MessageEvent>>;
|
|
1410
|
+
/** Refuse a new stream with a 503 once shutdown has begun. */
|
|
1411
|
+
private refuseDuringShutdown;
|
|
1388
1412
|
private openStream;
|
|
1389
1413
|
/**
|
|
1390
1414
|
* Authenticate ahead of the route, from a guard: with an interceptor registered Nest commits
|
|
@@ -1549,8 +1573,29 @@ declare class RedisRealtimePubSub implements IRealtimePubSub {
|
|
|
1549
1573
|
* while the subscriber connection is down, and after the last handler has unsubscribed.
|
|
1550
1574
|
*/
|
|
1551
1575
|
isSubscribed(): boolean;
|
|
1552
|
-
/**
|
|
1576
|
+
/**
|
|
1577
|
+
* JSON-encodes the message and PUBLISHes it to the configured channel, if the client can publish.
|
|
1578
|
+
* ioredis queues a command issued while it cannot and sends it, late, when the connection
|
|
1579
|
+
* returns, and never gives up on one waiting behind a peer that does not answer, so a revocation
|
|
1580
|
+
* would wait out the whole outage and then be sent after its caller was told it failed. It is
|
|
1581
|
+
* refused at once instead, and never handed to the client.
|
|
1582
|
+
*/
|
|
1553
1583
|
publish(message: RealtimePubSubMessage): Promise<void>;
|
|
1584
|
+
/**
|
|
1585
|
+
* A host client built with lazyConnect waits for its first command to connect, and that command
|
|
1586
|
+
* would be refused; connecting it is what the command would have done. Its failures show as its
|
|
1587
|
+
* status.
|
|
1588
|
+
*/
|
|
1589
|
+
private connectLazyClient;
|
|
1590
|
+
/**
|
|
1591
|
+
* Resolves once the publishing client's first connection attempt is over, however it ended:
|
|
1592
|
+
* ready, closed (to retry or to give up), or ended with no close when its connector fails. The
|
|
1593
|
+
* client is created just before the application boots, so for its first milliseconds it is still
|
|
1594
|
+
* connecting, and an emit from another provider's start-up hook would be refused for it. A
|
|
1595
|
+
* client that answers nothing is given up on after the deadline.
|
|
1596
|
+
*/
|
|
1597
|
+
private publisherSettled;
|
|
1598
|
+
private cannotPublish;
|
|
1554
1599
|
/**
|
|
1555
1600
|
* Lazily creates the single shared subscribe client on first call; returns an async
|
|
1556
1601
|
* unsubscribe that quits the client when the last handler is removed. Concurrent
|
|
@@ -1565,6 +1610,12 @@ declare class RedisRealtimePubSub implements IRealtimePubSub {
|
|
|
1565
1610
|
/** Lazily create the single shared subscribe client (idempotent under concurrent calls). */
|
|
1566
1611
|
private ensureSubscriber;
|
|
1567
1612
|
private createSubscriber;
|
|
1613
|
+
/**
|
|
1614
|
+
* Settles the boot against the first SUBSCRIBE. An error reply is the server refusing, which
|
|
1615
|
+
* fails the boot; any other failure, an error event or a close or a rejection that is not an
|
|
1616
|
+
* error reply, is the connection failing, which lets the boot go on unready.
|
|
1617
|
+
*/
|
|
1618
|
+
private negotiate;
|
|
1568
1619
|
private confirm;
|
|
1569
1620
|
/** A server that was reached and refused the SUBSCRIBE after boot: it stays unsubscribed. */
|
|
1570
1621
|
private refused;
|
|
@@ -1737,6 +1788,31 @@ declare function composeRoomId(prefix: keyof typeof ROOM_PREFIXES, ...parts: str
|
|
|
1737
1788
|
/** Describe a thrown or rejected value without throwing: `.message` on `null`, or `String()` on a prototype-less object, would. */
|
|
1738
1789
|
declare function describeError(reason: unknown): string;
|
|
1739
1790
|
|
|
1791
|
+
/**
|
|
1792
|
+
* @fileoverview The error every coded failure of this library is built with.
|
|
1793
|
+
* @layer utils
|
|
1794
|
+
*/
|
|
1795
|
+
|
|
1796
|
+
/** An error that carries one of the library's stable codes as a property. */
|
|
1797
|
+
type CodedError = Error & {
|
|
1798
|
+
readonly code: RealtimeErrorCode;
|
|
1799
|
+
};
|
|
1800
|
+
/**
|
|
1801
|
+
* Builds an error whose stable code is both the lead of its message and a `code` property.
|
|
1802
|
+
* Deriving the two from one value keeps them from disagreeing, and the property is what a caller
|
|
1803
|
+
* branches on without parsing text. A plain `Error` rather than a class: a class is a different
|
|
1804
|
+
* class in each bundle of the package, so `instanceof` would not be reliable across them.
|
|
1805
|
+
*
|
|
1806
|
+
* @param code - The stable error code to carry.
|
|
1807
|
+
* @param detail - What went wrong, after the code.
|
|
1808
|
+
* @param options - `who`: the class that raises it, shown in brackets before the code. `cause`: the
|
|
1809
|
+
* failure underneath, whatever was thrown; it is kept when the key is present.
|
|
1810
|
+
*/
|
|
1811
|
+
declare function realtimeError(code: RealtimeErrorCode, detail: string, options?: {
|
|
1812
|
+
readonly who?: string;
|
|
1813
|
+
readonly cause?: unknown;
|
|
1814
|
+
}): CodedError;
|
|
1815
|
+
|
|
1740
1816
|
/**
|
|
1741
1817
|
* @fileoverview The error a call rejects with when it could not reach what it was asked to act on.
|
|
1742
1818
|
* @layer utils
|
|
@@ -1745,14 +1821,14 @@ declare function describeError(reason: unknown): string;
|
|
|
1745
1821
|
/**
|
|
1746
1822
|
* Builds the rejection for a call whose effect did not happen, such as a revocation that never
|
|
1747
1823
|
* reached its connection. The stable code leads the message, as it does in the other errors this
|
|
1748
|
-
* library raises, and the original failure travels as `cause`.
|
|
1824
|
+
* library raises, is also the `code` property, and the original failure travels as `cause`.
|
|
1749
1825
|
*
|
|
1750
1826
|
* @param code - The stable error code to carry.
|
|
1751
1827
|
* @param who - The class that raises it, shown in brackets.
|
|
1752
1828
|
* @param what - What could not be reached.
|
|
1753
1829
|
* @param cause - The failure underneath, whatever was thrown.
|
|
1754
1830
|
*/
|
|
1755
|
-
declare function unavailableError(code: RealtimeErrorCode, who: string, what: string, cause: unknown):
|
|
1831
|
+
declare function unavailableError(code: RealtimeErrorCode, who: string, what: string, cause: unknown): CodedError;
|
|
1756
1832
|
|
|
1757
1833
|
/**
|
|
1758
1834
|
* @fileoverview Makes a delivery path's failure visible without failing the call that used it.
|
|
@@ -1867,4 +1943,5 @@ declare const RESERVED_EVENT_NAMES: {
|
|
|
1867
1943
|
/** Union of reserved event name values. */
|
|
1868
1944
|
type ReservedEventName = (typeof RESERVED_EVENT_NAMES)[keyof typeof RESERVED_EVENT_NAMES];
|
|
1869
1945
|
|
|
1870
|
-
export {
|
|
1946
|
+
export { BymaxRealtimeModule, ConnectionRegistry, EventIdGenerator, EventReplayBuffer, HeartbeatService, InMemoryPubSub, OfflineQueueDeliveryService, REALTIME_AUTHENTICATOR_TOKEN, REALTIME_ERROR_CODES, REALTIME_HOOKS_TOKEN, REALTIME_INSTANCE_ID_TOKEN, REALTIME_OFFLINE_QUEUE_TOKEN, REALTIME_OPTIONS_TOKEN, REALTIME_PRESENCE_TOKEN, REALTIME_PUBSUB_TOKEN, REALTIME_TRANSPORT_TOKEN, RESERVED_EVENT_NAMES, ROOM_PREFIXES, RealtimePubSubSubscriber, RealtimeService, ReauthenticationService, RedisOfflineQueue, RedisRealtimePubSub, RoomRegistry, SseSubscriptionHandler, SseTransport, assertIdentityIsNotBlank, composeForRoot, composeForRootAsync, composeRoomId, createSseController, describeError, parseCookieHeader, realtimeError, reportDeliveryFailure, resolveAuthTenant, sseWiring, unavailableError };
|
|
1947
|
+
export type { AuthenticationResult, BymaxRealtimeModuleAsyncOptions, BymaxRealtimeModuleOptions, BymaxRealtimeModuleOptionsFactory, CodedError, ConnectionAuthContext, ConnectionEventMeta, CorsConfig, DeliveryFailure, IConnectionAuthenticator, IConnectionLifecycleHooks, IOfflineQueueStorage, IPresenceStorage, IRealtimePubSub, ITransport, OfflineQueuedEvent, PublicConnectionMeta, RealtimeErrorCode, RealtimeEvent, RealtimePubSubMessage, ReauthenticationPolicy, RedisOfflineQueueOptions, RedisRealtimePubSubOptions, ReservedEventName, RoomPrefix, SseOptions, SseRealtimeModuleAsyncOptions, SseRealtimeModuleOptions, TransportMode, TransportRegistration, TransportWiring, WebSocketOptions, WebSocketRealtimeModuleAsyncOptions, WebSocketRealtimeModuleOptions };
|