@rlanz/socket 0.0.1-9 → 0.1.1
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/README.md +562 -556
- package/build/{base_channel-DPOnqned.d.ts → base_channel-CasBQV5I.d.ts} +7 -25
- package/build/{chunk-QNOOQXYY.js → chunk-3FY7EIZF.js} +252 -200
- package/build/chunk-3FY7EIZF.js.map +1 -0
- package/build/{chunk-6PJ4ALJD.js → chunk-DM3UQMWW.js} +5 -3
- package/build/chunk-DM3UQMWW.js.map +1 -0
- package/build/chunk-NUPBNOP3.js +61 -0
- package/build/chunk-NUPBNOP3.js.map +1 -0
- package/build/{chunk-YVC7IMDN.js → chunk-OAI6SAER.js} +2 -2
- package/build/chunk-YSW4MNFR.js +7 -0
- package/build/chunk-YSW4MNFR.js.map +1 -0
- package/build/{framework-B8pJ4cCA.d.ts → framework-Cb71JA5f.d.ts} +1 -1
- package/build/{index-DjBYUhFR.d.ts → index-DCPtfkJL.d.ts} +1 -1
- package/build/index.d.ts +3 -2
- package/build/providers/socket_provider.d.ts +3 -2
- package/build/providers/socket_provider.js +312 -130
- package/build/providers/socket_provider.js.map +1 -1
- package/build/services/socket.d.ts +3 -2
- package/build/shared_types-B11CaOr5.d.ts +26 -0
- package/build/{socket_service-BcC9ASCE.d.ts → socket_service-C2YRbhrO.d.ts} +1 -1
- package/build/src/assembler_hook.js +54 -30
- package/build/src/assembler_hook.js.map +1 -1
- package/build/src/client/index.d.ts +3 -8
- package/build/src/client/index.js +3 -2
- package/build/src/client/react.d.ts +3 -8
- package/build/src/client/react.js +4 -3
- package/build/src/client/react.js.map +1 -1
- package/build/src/client/types.d.ts +18 -13
- package/build/src/client/vue.d.ts +3 -8
- package/build/src/client/vue.js +4 -3
- package/build/src/client/vue.js.map +1 -1
- package/build/src/decorators.d.ts +2 -1
- package/build/src/health_check.d.ts +3 -2
- package/build/src/otel.d.ts +1 -0
- package/build/src/otel.js +211 -27
- package/build/src/otel.js.map +1 -1
- package/build/src/types.d.ts +2 -1
- package/package.json +31 -7
- package/build/chunk-6PJ4ALJD.js.map +0 -1
- package/build/chunk-D3HUBCBW.js +0 -18
- package/build/chunk-D3HUBCBW.js.map +0 -1
- package/build/chunk-QNOOQXYY.js.map +0 -1
- /package/build/{chunk-YVC7IMDN.js.map → chunk-OAI6SAER.js.map} +0 -0
|
@@ -3,6 +3,7 @@ import { IncomingMessage } from 'node:http';
|
|
|
3
3
|
import { MiddlewareAsClass } from '@adonisjs/core/types/http';
|
|
4
4
|
import { HttpContext } from '@adonisjs/core/http';
|
|
5
5
|
import { TransportFactory } from '@boringnode/bus/types/main';
|
|
6
|
+
import './shared_types-B11CaOr5.js';
|
|
6
7
|
|
|
7
8
|
declare const PRESENCE_DATA_KEY = "__rlanzSocketPresence";
|
|
8
9
|
type PresenceSocketData = Record<string, unknown> & {
|
|
@@ -99,26 +100,6 @@ interface SocketRetryQueueConfig {
|
|
|
99
100
|
retryInterval?: Duration | false;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
/**
|
|
103
|
-
* Types shared between the server and the client.
|
|
104
|
-
*/
|
|
105
|
-
/**
|
|
106
|
-
* Message sent by the client to a channel.
|
|
107
|
-
*/
|
|
108
|
-
interface ChannelMessage {
|
|
109
|
-
channel: string;
|
|
110
|
-
event: string;
|
|
111
|
-
data?: unknown;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Channel handler acknowledgement response.
|
|
115
|
-
*/
|
|
116
|
-
interface ChannelAck<T = unknown> {
|
|
117
|
-
ok: boolean;
|
|
118
|
-
data?: T;
|
|
119
|
-
error?: string;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
103
|
interface RawSocket {
|
|
123
104
|
id: string;
|
|
124
105
|
data: Record<string, unknown>;
|
|
@@ -232,10 +213,6 @@ interface MiddlewareConstructor<User = unknown> {
|
|
|
232
213
|
* Middleware, either a function, an instance, or a container-resolved class.
|
|
233
214
|
*/
|
|
234
215
|
type Middleware<User = unknown> = MiddlewareFn<User> | MiddlewareClass<User> | MiddlewareConstructor<User>;
|
|
235
|
-
/** Extracts the server-to-client event map declared by a channel instance. */
|
|
236
|
-
type ChannelServerEventsOf<T> = T extends {
|
|
237
|
-
readonly $serverEvents: infer Events;
|
|
238
|
-
} ? Events : unknown;
|
|
239
216
|
/**
|
|
240
217
|
* Package configuration.
|
|
241
218
|
*/
|
|
@@ -303,6 +280,11 @@ interface SocketConfig<User = unknown> {
|
|
|
303
280
|
* Maximum accepted channel name length in characters.
|
|
304
281
|
*/
|
|
305
282
|
maxChannelNameLength?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Maximum time spent waiting for socket handlers and subscription hooks during shutdown.
|
|
285
|
+
* Internal socket state is forcibly released after this deadline.
|
|
286
|
+
*/
|
|
287
|
+
shutdownTimeout?: Duration;
|
|
306
288
|
};
|
|
307
289
|
/**
|
|
308
290
|
* Optional transport used to synchronize broadcasts between SocketService instances.
|
|
@@ -491,4 +473,4 @@ interface BaseChannelConstructor {
|
|
|
491
473
|
middlewares?: Middleware<any>[];
|
|
492
474
|
}
|
|
493
475
|
|
|
494
|
-
export { type AuthenticatedSocket as A, BaseChannel as B, type
|
|
476
|
+
export { type AuthenticatedSocket as A, BaseChannel as B, type ChannelOptions as C, type Duration as D, type Middleware as M, PresenceManager as P, type RawSocket as R, type SocketAuthenticationHandler as S, type SocketConfig as a, type MiddlewareClass as b, type MiddlewareConstructor as c, type MiddlewareContext as d, type MiddlewareFn as e, type PresenceInfo as f, type PresenceMember as g, type SocketAuthenticationResult as h, type SocketEvents as i, type SocketHealthSnapshot as j, type SocketHttpMiddleware as k, type SocketOriginResolver as l, type SocketOriginValues as m, SocketResponseError as n, type SocketRetryQueueConfig as o, type SocketServiceStatus as p, type SocketTransportConfig as q, type SocketUpgradeContext as r, type BaseChannelConstructor as s, type ChannelMiddlewareRunnerFactory as t, type ChannelMatch as u, type PresenceData as v };
|