@api.global/typedsocket 6.0.0 → 6.2.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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.clienttagreconciler.d.ts +51 -0
- package/dist_ts/classes.clienttagreconciler.js +290 -0
- package/dist_ts/classes.nativebyteerror.js +26 -0
- package/dist_ts/{nativebytes.manager.d.ts → classes.nativebytemanager.d.ts} +8 -3
- package/dist_ts/classes.nativebytemanager.js +2343 -0
- package/dist_ts/{typedsocket.classes.typedsocket.d.ts → classes.typedsocket.d.ts} +21 -21
- package/dist_ts/{typedsocket.classes.typedsocket.js → classes.typedsocket.js} +123 -260
- package/dist_ts/{typedsocket.tags.d.ts → classes.typedsockettagpolicymanager.d.ts} +9 -2
- package/dist_ts/classes.typedsockettagpolicymanager.js +549 -0
- package/dist_ts/{nativebytes.constants.js → constants.nativebytes.js} +1 -1
- package/dist_ts/{nativebytes.codec.d.ts → helpers.nativebytecodec.d.ts} +1 -1
- package/dist_ts/helpers.nativebytecodec.js +328 -0
- package/dist_ts/helpers.websocket.d.ts +8 -0
- package/dist_ts/helpers.websocket.js +13 -0
- package/dist_ts/index.d.ts +9 -8
- package/dist_ts/index.js +6 -6
- package/dist_ts/interfaces.diagnostics.d.ts +73 -0
- package/dist_ts/interfaces.diagnostics.js +2 -0
- package/dist_ts/{nativebytes.types.d.ts → interfaces.nativebytes.d.ts} +2 -2
- package/dist_ts/interfaces.nativebytes.js +2 -0
- package/dist_ts/plugins.js +14 -0
- package/package.json +1 -1
- package/readme.hints.md +26 -1
- package/readme.md +120 -55
- package/dist_ts/nativebytes.codec.js +0 -328
- package/dist_ts/nativebytes.errors.js +0 -26
- package/dist_ts/nativebytes.manager.js +0 -2308
- package/dist_ts/nativebytes.types.js +0 -2
- package/dist_ts/typedsocket.plugins.js +0 -14
- package/dist_ts/typedsocket.tags.js +0 -521
- /package/dist_ts/{nativebytes.errors.d.ts → classes.nativebyteerror.d.ts} +0 -0
- /package/dist_ts/{nativebytes.constants.d.ts → constants.nativebytes.d.ts} +0 -0
- /package/dist_ts/{typedsocket.plugins.d.ts → plugins.d.ts} +0 -0
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import * as plugins from './
|
|
2
|
-
import { NativeByteManager } from './
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as plugins from './plugins.js';
|
|
2
|
+
import { NativeByteManager } from './classes.nativebytemanager.js';
|
|
3
|
+
export { toClientWebSocketCloseCode } from './helpers.websocket.js';
|
|
4
|
+
export { TYPEDSOCKET_MAX_RETAINED_CLIENT_TAG_MUTATIONS, TYPEDSOCKET_MAX_RETAINED_CLIENT_TAG_MUTATIONS_PER_NAME, } from './classes.clienttagreconciler.js';
|
|
5
|
+
import type { TTypedSocketDiagnosticEvent } from './interfaces.diagnostics.js';
|
|
6
|
+
import type { INativeByteAuthorizationAdapter, INativeByteCreateVirtualStreamOptions, TNativeByteCapabilityMode } from './interfaces.nativebytes.js';
|
|
7
|
+
import type { ITypedSocketClientTagPolicy } from './classes.typedsockettagpolicymanager.js';
|
|
5
8
|
export type TTypedSocketSide = 'server' | 'client';
|
|
6
9
|
export type TConnectionStatus = 'new' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting';
|
|
7
10
|
export declare const TYPEDSOCKET_MAX_TEXT_FRAME_BYTES: number;
|
|
@@ -17,8 +20,6 @@ export declare const TYPEDSOCKET_MAX_REQUEST_TIMEOUT_MS: number;
|
|
|
17
20
|
export declare const TYPEDSOCKET_MAX_CONNECTION_RESTORE_TIMEOUT_MS = 10000;
|
|
18
21
|
export declare const TYPEDSOCKET_MAX_RECONNECT_RETRIES = 100;
|
|
19
22
|
export declare const TYPEDSOCKET_MAX_RECONNECT_BACKOFF_MS = 60000;
|
|
20
|
-
export declare const TYPEDSOCKET_MAX_RETAINED_CLIENT_TAG_MUTATIONS_PER_NAME = 8;
|
|
21
|
-
export declare const TYPEDSOCKET_MAX_RETAINED_CLIENT_TAG_MUTATIONS = 64;
|
|
22
23
|
export declare const TYPEDSOCKET_MAX_PENDING_SERVER_REQUESTS_PER_PEER = 64;
|
|
23
24
|
export declare const TYPEDSOCKET_MAX_PENDING_SERVER_REQUESTS = 1024;
|
|
24
25
|
export declare const TYPEDSOCKET_MAX_RETAINED_SERVER_INTERESTS_PER_PEER = 8;
|
|
@@ -150,7 +151,13 @@ export declare class TypedSocket {
|
|
|
150
151
|
readonly nativeBytes: NativeByteManager;
|
|
151
152
|
readonly webSocketTransportOwner: plugins.IWebSocketTransportOwner;
|
|
152
153
|
statusSubject: plugins.smartrx.rxjs.Subject<TConnectionStatus>;
|
|
154
|
+
/**
|
|
155
|
+
* Structured diagnostics: why a connection was closed, denied, or retried.
|
|
156
|
+
* Never completes, mirroring statusSubject; subscribers own unsubscription.
|
|
157
|
+
*/
|
|
158
|
+
readonly diagnosticsSubject: plugins.smartrx.rxjs.Subject<TTypedSocketDiagnosticEvent>;
|
|
153
159
|
private connectionStatus;
|
|
160
|
+
private reconnectExhaustedReported;
|
|
154
161
|
private websocket;
|
|
155
162
|
private connectionGeneration;
|
|
156
163
|
private clientConnectionState;
|
|
@@ -163,14 +170,7 @@ export declare class TypedSocket {
|
|
|
163
170
|
private abortSignalListener?;
|
|
164
171
|
private stopListeners;
|
|
165
172
|
private pendingRequests;
|
|
166
|
-
private
|
|
167
|
-
private clientTagRevisions;
|
|
168
|
-
private desiredClientTags;
|
|
169
|
-
private clientTagDesiredMutationQueues;
|
|
170
|
-
private clientTagMutationSequence;
|
|
171
|
-
private clientTagMutationTails;
|
|
172
|
-
private retainedClientTagMutations;
|
|
173
|
-
private retainedClientTagMutationsByName;
|
|
173
|
+
private readonly clientTagReconciler;
|
|
174
174
|
private smartServeRef;
|
|
175
175
|
private serverTypedRouters;
|
|
176
176
|
private detachProtocolRouters;
|
|
@@ -235,6 +235,13 @@ export declare class TypedSocket {
|
|
|
235
235
|
* Updates connection status and notifies subscribers
|
|
236
236
|
*/
|
|
237
237
|
private updateStatus;
|
|
238
|
+
/**
|
|
239
|
+
* Diagnostics must never disturb transport code paths: subscriber errors
|
|
240
|
+
* are swallowed here.
|
|
241
|
+
*/
|
|
242
|
+
private emitDiagnostic;
|
|
243
|
+
private emitConnectionClosedDiagnostic;
|
|
244
|
+
private emitTagDenialDiagnostic;
|
|
238
245
|
/**
|
|
239
246
|
* Sends a request to the server and waits for response (client-side)
|
|
240
247
|
*/
|
|
@@ -283,13 +290,6 @@ export declare class TypedSocket {
|
|
|
283
290
|
* @client-only
|
|
284
291
|
*/
|
|
285
292
|
removeTag(name: string): Promise<void>;
|
|
286
|
-
private retainClientTagMutation;
|
|
287
|
-
private setDesiredClientTag;
|
|
288
|
-
private settleDesiredClientTag;
|
|
289
|
-
private serializeClientTagMutation;
|
|
290
|
-
private submitDesiredClientTag;
|
|
291
|
-
private requireTagMutationSuccess;
|
|
292
|
-
private applyClientTagMutation;
|
|
293
293
|
/**
|
|
294
294
|
* Resolves the exact SmartServe transport peer for one incoming TypedRequest.
|
|
295
295
|
* Server handlers can pass their TypedTools argument without type assertions.
|