vortez-io 1.0.2 → 2.0.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 +16 -4
- package/build/Frame.js +1 -1
- package/build/RequestManager.d.ts +15 -14
- package/build/RequestManager.js +6 -0
- package/build/RequestManager.js.map +1 -1
- package/build/VIO.d.ts +133 -11
- package/build/VIO.js +105 -4
- package/build/VIO.js.map +1 -1
- package/build/VIOError.d.ts +6 -0
- package/build/VIOError.js +6 -0
- package/build/VIOError.js.map +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/strict/VIOStrict.d.ts +57 -0
- package/build/strict/VIOStrict.js +56 -0
- package/build/strict/VIOStrict.js.map +1 -0
- package/build/strict/channel/Channel.d.ts +34 -0
- package/build/strict/channel/Channel.js +16 -0
- package/build/strict/channel/Channel.js.map +1 -0
- package/build/strict/channel/EventChannel.d.ts +53 -0
- package/build/strict/channel/EventChannel.js +58 -0
- package/build/strict/channel/EventChannel.js.map +1 -0
- package/build/strict/channel/RequestChannel.d.ts +68 -0
- package/build/strict/channel/RequestChannel.js +96 -0
- package/build/strict/channel/RequestChannel.js.map +1 -0
- package/build/strict/channel/TransportChannel.d.ts +38 -0
- package/build/strict/channel/TransportChannel.js +30 -0
- package/build/strict/channel/TransportChannel.js.map +1 -0
- package/build/support/Isomorphic.d.ts +18 -0
- package/build/support/Isomorphic.js +2 -0
- package/build/support/Isomorphic.js.map +1 -0
- package/build/support/LineParser.js +2 -4
- package/build/support/LineParser.js.map +1 -1
- package/build/support/UTF8Codec.d.ts +2 -7
- package/build/support/UTF8Codec.js +2 -7
- package/build/support/UTF8Codec.js.map +1 -1
- package/build/support/UUID.d.ts +1 -1
- package/build/support/UUID.js +1 -1
- package/build/support/Varint.js +2 -4
- package/build/support/Varint.js.map +1 -1
- package/docs/ARCHITECTURE.md +200 -0
- package/docs/VIOStrict.md +105 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Vortez IO
|
|
1
|
+
# Vortez IO
|
|
2
2
|
|
|
3
|
-
`vortez-io
|
|
3
|
+
`vortez-io` is a small TypeScript library for encoding and decoding the Vortez IO binary frame format used over WebSocket connections. It implements the protocol described in [PROTOCOL.md](PROTOCOL.md) and provides helpers for request/response correlation, event delivery, and strict frame validation.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
- Support for `BINARY`, `JSON`, `LINE`, and `CUSTOM` payload modes
|
|
11
11
|
- Strict protocol validation with typed errors
|
|
12
12
|
- Higher-level typed wrapper via `VIOStrict`
|
|
13
|
+
- Transport-agnostic runtime with a small, composable API surface
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -22,8 +23,7 @@ The library is published from the TypeScript source in this repository and targe
|
|
|
22
23
|
## Quick Start
|
|
23
24
|
|
|
24
25
|
```ts
|
|
25
|
-
import VIO from '
|
|
26
|
-
import VIOError from './build/VIOError.js';
|
|
26
|
+
import VIO, { VIOError } from 'vortez-io';
|
|
27
27
|
|
|
28
28
|
const vio = new VIO({
|
|
29
29
|
setTimeout,
|
|
@@ -66,6 +66,7 @@ The main transport-aware protocol runtime.
|
|
|
66
66
|
- `event(name, data)`: send an event frame
|
|
67
67
|
- `handle(data)`: decode an incoming frame and dispatch it
|
|
68
68
|
- `transport`: event emitter that exposes outgoing frames through `send`
|
|
69
|
+
- `raw(data)`: send transport-level bytes without higher-level framing
|
|
69
70
|
|
|
70
71
|
### `Frame`
|
|
71
72
|
|
|
@@ -80,6 +81,10 @@ Use this when you need direct access to protocol bytes instead of the higher-lev
|
|
|
80
81
|
|
|
81
82
|
Typed wrapper for validating request and event payloads with schemas from `@netfeez/common`.
|
|
82
83
|
|
|
84
|
+
## Architecture Guide
|
|
85
|
+
|
|
86
|
+
For a higher-level view of the runtime layers, message flow, and the role of `VIO`, `Frame`, `RequestManager`, and `VIOStrict`, see [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md).
|
|
87
|
+
|
|
83
88
|
## Protocol Summary
|
|
84
89
|
|
|
85
90
|
The protocol is described in detail in [PROTOCOL.md](PROTOCOL.md). In short:
|
|
@@ -90,6 +95,13 @@ The protocol is described in detail in [PROTOCOL.md](PROTOCOL.md). In short:
|
|
|
90
95
|
- `EVENT` frames use string identifiers
|
|
91
96
|
- `ERROR` frames can be protocol-level (`NONE`) or request-bound (`UUID`)
|
|
92
97
|
|
|
98
|
+
## Documentation Map
|
|
99
|
+
|
|
100
|
+
- [README.md](README.md): project overview, install, and quick start.
|
|
101
|
+
- [PROTOCOL.md](PROTOCOL.md): wire format and protocol rules.
|
|
102
|
+
- [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md): runtime layers and message flow.
|
|
103
|
+
- [docs/VIOStrict.md](docs/VIOStrict.md): typed wrapper example and schema map wiring.
|
|
104
|
+
|
|
93
105
|
## Development
|
|
94
106
|
|
|
95
107
|
```bash
|
package/build/Frame.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module vortez-io
|
|
3
|
-
* @author NetFeez <netfeez.dev@
|
|
3
|
+
* @author NetFeez <netfeez.dev@gmail.com>
|
|
4
4
|
* @license Apache-2.0
|
|
5
5
|
* @description Implements the core Frame structure of the Vortez IO protocol, including encoding and decoding logic for binary frames.
|
|
6
6
|
* The Frame class provides static methods to encode and decode frames according to the protocol specification, handling various frame types, modes, and identifier formats.
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vortez-io
|
|
3
|
+
* @author NetFeez <netfeez.dev@gmail.com>
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
* @description Tracks pending requests, timeouts, and response handling for VIO.
|
|
6
|
+
*/
|
|
1
7
|
import { Events } from "@netfeez/common";
|
|
2
8
|
import VIOError from "./VIOError.js";
|
|
3
9
|
import type Frame from "./Frame.js";
|
|
4
|
-
import type Isomorphic from "./Isomorphic.js";
|
|
5
|
-
export declare class RequestManager<
|
|
6
|
-
protected pending: Map<string, RequestManager.PendingEntry<
|
|
7
|
-
protected setTimeout: Isomorphic.setTimeout<
|
|
8
|
-
protected clearTimeout: Isomorphic.clearTimeout<
|
|
10
|
+
import type Isomorphic from "./support/Isomorphic.js";
|
|
11
|
+
export declare class RequestManager<TimeoutType extends any> extends Events<RequestManager.EventMap> {
|
|
12
|
+
protected pending: Map<string, RequestManager.PendingEntry<TimeoutType>>;
|
|
13
|
+
protected setTimeout: Isomorphic.setTimeout<TimeoutType>;
|
|
14
|
+
protected clearTimeout: Isomorphic.clearTimeout<TimeoutType>;
|
|
9
15
|
protected createUUID: Isomorphic.createUUID;
|
|
10
|
-
constructor(dependencies:
|
|
16
|
+
constructor(dependencies: Isomorphic.DependencyList<TimeoutType>);
|
|
11
17
|
/**
|
|
12
18
|
* Send a request with the given data and return a Promise that resolves with the response or rejects with an error.
|
|
13
19
|
* The method generates a unique UUID for the request, stores the resolve and reject functions in the pending map, and emits a 'send' event with the UUID and data.
|
|
@@ -26,11 +32,6 @@ export declare class RequestManager<T extends any> extends Events<RequestManager
|
|
|
26
32
|
handle(uuid: string, data?: RequestManager.Response, error?: VIOError): void;
|
|
27
33
|
}
|
|
28
34
|
export declare namespace RequestManager {
|
|
29
|
-
interface DEPENDENCIES<T extends any> {
|
|
30
|
-
setTimeout: Isomorphic.setTimeout<T>;
|
|
31
|
-
clearTimeout: Isomorphic.clearTimeout<T>;
|
|
32
|
-
createUUID?: Isomorphic.createUUID;
|
|
33
|
-
}
|
|
34
35
|
namespace Response {
|
|
35
36
|
type Base = {
|
|
36
37
|
mode: Frame.Mode;
|
|
@@ -58,12 +59,12 @@ export declare namespace RequestManager {
|
|
|
58
59
|
* Each entry contains the resolve and reject functions for the Promise associated with the request, as well as a timeout identifier if a timeout mechanism is implemented.
|
|
59
60
|
* The resolve function is called with the response data when a successful response is received, while the reject function is called with an error if an error occurs or if a timeout is reached.
|
|
60
61
|
* The timeout field can be used to store the identifier returned by a setTimeout function, allowing for the implementation of request timeouts where the Promise is rejected if a response is not received within a certain timeframe.
|
|
61
|
-
* @template
|
|
62
|
+
* @template TimeoutType The type of the timeout identifier, which can vary depending on the environment (e.g., NodeJS.Timeout in Node.js or number in browsers).
|
|
62
63
|
*/
|
|
63
|
-
interface PendingEntry<
|
|
64
|
+
interface PendingEntry<TimeoutType> {
|
|
64
65
|
resolve: (value: Response) => void;
|
|
65
66
|
reject: (reason: VIOError) => void;
|
|
66
|
-
timeout:
|
|
67
|
+
timeout: TimeoutType;
|
|
67
68
|
}
|
|
68
69
|
interface SendOptions {
|
|
69
70
|
timeoutMs?: number;
|
package/build/RequestManager.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vortez-io
|
|
3
|
+
* @author NetFeez <netfeez.dev@gmail.com>
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
* @description Tracks pending requests, timeouts, and response handling for VIO.
|
|
6
|
+
*/
|
|
1
7
|
import { Events } from "@netfeez/common";
|
|
2
8
|
import UUID from "./support/UUID.js";
|
|
3
9
|
import VIOError from "./VIOError.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestManager.js","sourceRoot":"","sources":["../src/RequestManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,QAAQ,MAAM,eAAe,CAAC;AAKrC,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"RequestManager.js","sourceRoot":"","sources":["../src/RequestManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,QAAQ,MAAM,eAAe,CAAC;AAKrC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I,CAAC,CAAC;gBAC1B,MAAM,CAAC,KAAK,YAAY,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAC,CAAC;YACpH,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,IAAY,EAAE,IAA8B,EAAE,KAAgB;QACxE,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK;YAAE,OAAO;QAEnB,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEjC,IAAI,KAAK;YAAE,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;;YAC1B,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAExE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;CACJ;AA2CD,eAAe,cAAc,CAAC"}
|
package/build/VIO.d.ts
CHANGED
|
@@ -1,45 +1,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vortez-io
|
|
3
|
+
* @author NetFeez <netfeez.dev@gmail.com>
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
* @description Core transport-agnostic API for sending and receiving VIO frames.
|
|
6
|
+
*/
|
|
1
7
|
import { Events } from "@netfeez/common";
|
|
2
8
|
import RequestManager from "./RequestManager.js";
|
|
3
9
|
import VIOError from "./VIOError.js";
|
|
4
10
|
import Frame from "./Frame.js";
|
|
5
11
|
import LineCodec from "./support/LineParser.js";
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
import type Isomorphic from "./support/Isomorphic.js";
|
|
13
|
+
export declare class VIO<TimeoutType extends any> extends Events<VIO.EventMap> {
|
|
14
|
+
protected mRequest: RequestManager<TimeoutType>;
|
|
8
15
|
vTransport: Events.Emitter<VIO.TransportEventMap>;
|
|
9
|
-
constructor(dependencies:
|
|
16
|
+
constructor(dependencies: Isomorphic.DependencyList<TimeoutType>);
|
|
17
|
+
/**
|
|
18
|
+
* The transport emitter allows you to send raw frames and listen for transport-level events like errors.
|
|
19
|
+
* Use the `request`, `event`, and `raw` methods for higher-level interactions that automatically handle framing and serialization.
|
|
20
|
+
*/
|
|
10
21
|
get transport(): Events<VIO.TransportEventMap>;
|
|
22
|
+
/**
|
|
23
|
+
* Sends a request and returns a promise that resolves with the response or rejects with an error.
|
|
24
|
+
* @param data The data to send in the request. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
25
|
+
* @param options Optional settings for the request, such as timeout duration. The exact options depend on the implementation of the RequestManager.
|
|
26
|
+
* @returns A promise that resolves with the response data or rejects with a VIOError if the request fails or times out.
|
|
27
|
+
* @throws {VIOError} Throws a VIOError if the request fails or if there is an error in processing the response. Make sure to catch these errors when using the `request` method to handle them gracefully in your application.
|
|
28
|
+
*/
|
|
11
29
|
request(data: any, options?: RequestManager.SendOptions): Promise<RequestManager.Response>;
|
|
30
|
+
/**
|
|
31
|
+
* Emits an event with the specified name and data.
|
|
32
|
+
* The data can be a Uint8Array, ArrayBuffer, or any JSON-serializable object.
|
|
33
|
+
* If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
34
|
+
* The event will be framed and sent over the transport.
|
|
35
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
36
|
+
* @param name The name of the event to emit. This should be a string that identifies the event type.
|
|
37
|
+
* @param data The data to send with the event. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
38
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the event. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
39
|
+
*/
|
|
12
40
|
event(name: string, data: any): void;
|
|
41
|
+
/**
|
|
42
|
+
* Sends raw binary data as a frame of type 'RAW'.
|
|
43
|
+
* This method is for advanced use cases where you want to send data without the overhead of framing it as an event or request.
|
|
44
|
+
* The data will be sent as-is, and it's up to the receiving end to interpret it correctly.
|
|
45
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
46
|
+
* @param data The raw binary data to send. This can be a Uint8Array or an ArrayBuffer.
|
|
47
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the raw data. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
48
|
+
*/
|
|
49
|
+
raw(data: ArrayBuffer | Uint8Array): void;
|
|
50
|
+
/**
|
|
51
|
+
* Handles incoming data by decoding it into a frame and processing it based on the frame type.
|
|
52
|
+
* This method should be called whenever new data is received from the transport.
|
|
53
|
+
* It will emit higher-level events like 'event', 'request', and 'response' based on the content of the frame.
|
|
54
|
+
* Make sure to handle any errors that may occur during the decoding and processing of the frame by listening to the 'error' event on this VIO instance.
|
|
55
|
+
* @param data The incoming data to handle. This can be a Uint8Array or an ArrayBuffer containing the raw frame data.
|
|
56
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding or processing the frame. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
57
|
+
*/
|
|
13
58
|
handle(data: ArrayBuffer | Uint8Array): void;
|
|
14
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Handles a raw frame by emitting it as a 'raw' event. This allows users of the VIO class to listen for raw frames directly if they need to process them in a custom way.
|
|
61
|
+
* @param frame The raw frame to handle. This frame will be emitted as-is without any additional processing, so make sure to handle it appropriately in your event listeners.
|
|
62
|
+
* @throws {VIOError} Throws a VIOError if there is an error in processing the raw frame. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
63
|
+
*/
|
|
64
|
+
protected handleRaw(frame: Frame<'RAW'>): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Handles an event frame by decoding its content based on the specified mode and emitting it as an 'event' with the appropriate data.
|
|
67
|
+
* The event will include the name (identifier), mode, and decoded data.
|
|
68
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
69
|
+
* @param frame The event frame to handle. This frame should contain a valid identifier and data that can be decoded according to the specified mode.
|
|
70
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the event data or if the frame has an unknown mode. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
71
|
+
*/
|
|
15
72
|
protected handleEvent(frame: Frame<'EVENT'>): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Handles a request frame by decoding its content based on the specified mode and emitting it as a 'request' with the appropriate data and callback functions for handling the response.
|
|
75
|
+
* The request will include the mode, decoded data, and two callback functions: `done` for sending a successful response and `fail` for sending an error response.
|
|
76
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
77
|
+
* @param frame The request frame to handle. This frame should contain a valid identifier and data that can be decoded according to the specified mode.
|
|
78
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the request data, if the frame has an unknown mode, or if the request frame is missing a UUID. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
79
|
+
*/
|
|
16
80
|
protected handleRequest(frame: Frame<'REQUEST'>): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Handles a response frame by decoding its content based on the specified mode and passing it to the RequestManager to resolve the corresponding request promise.
|
|
83
|
+
* The response will be matched to the original request using the UUID from the frame identifier.
|
|
84
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
85
|
+
* @param frame The response frame to handle. This frame should contain a valid UUID in the identifier and data that can be decoded according to the specified mode.
|
|
86
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the response data, if the frame has an unknown mode, or if the response frame is missing a UUID. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
87
|
+
*/
|
|
17
88
|
protected handleResponse(frame: Frame<'RESPONSE'>): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Handles an error frame by decoding its content based on the specified mode and passing the error information to the RequestManager or emitting it as an 'error' event if the frame does not have a valid identifier.
|
|
91
|
+
* The error will be matched to the original request using the UUID from the frame identifier if available. If the identifier type is 'NONE', the error will be emitted as a general 'error' event.
|
|
92
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
93
|
+
* @param frame The error frame to handle. This frame should contain data that can be decoded according to the specified mode, and may optionally contain a UUID in the identifier for matching it to a request.
|
|
94
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the error data or if the frame has an unknown mode. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
95
|
+
*/
|
|
18
96
|
protected handleError(frame: Frame<'ERROR'>): Promise<void>;
|
|
97
|
+
/**
|
|
98
|
+
* Sends an event frame with the specified name and data, encoding the data according to the specified mode (BINARY, JSON, or LINE).
|
|
99
|
+
* The event will be framed and sent over the transport.
|
|
100
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
101
|
+
* @param name The name of the event to emit. This should be a string that identifies the event type.
|
|
102
|
+
* @param data The data to send with the event. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
103
|
+
* @param mode Optional mode for encoding the data. If not specified, the method will automatically determine the mode based on the type of data provided (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
104
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the event. Make sure to catch these errors by listening
|
|
105
|
+
*/
|
|
19
106
|
protected sendEvent(name: string, data: Uint8Array | ArrayBuffer): void;
|
|
20
107
|
protected sendEvent(name: string, data: LineCodec.ContentMap, mode: 'LINE'): void;
|
|
21
108
|
protected sendEvent(name: string, data: any): void;
|
|
109
|
+
/**
|
|
110
|
+
* Sends a request frame with the specified UUID and data, encoding the data according to the specified mode (BINARY, JSON, or LINE).
|
|
111
|
+
* The request will be framed and sent over the transport, and the UUID will be used to match the response to the original request.
|
|
112
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
113
|
+
* @param uuid The UUID to associate with this request. This should be a unique identifier that can be used to match the response to this request.
|
|
114
|
+
* @param data The data to send with the request. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
115
|
+
* @param mode Optional mode for encoding the data. If not specified, the method will automatically determine the mode based on the type of data provided (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
116
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the request. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
117
|
+
*/
|
|
22
118
|
protected sendRequest(uuid: string, data: Uint8Array | ArrayBuffer): void;
|
|
23
119
|
protected sendRequest(uuid: string, data: LineCodec.ContentMap, mode: 'LINE'): void;
|
|
24
120
|
protected sendRequest(uuid: string, data: any): void;
|
|
121
|
+
/**
|
|
122
|
+
* Sends a response frame with the specified UUID and data, encoding the data according to the specified mode (BINARY, JSON, or LINE).
|
|
123
|
+
* The response will be framed and sent over the transport, and the UUID will be used to match it to the original request.
|
|
124
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
125
|
+
* @param uuid The UUID to associate with this response. This should match the UUID of the original request that this response is for.
|
|
126
|
+
* @param data The data to send with the response. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
127
|
+
* @param mode Optional mode for encoding the data. If not specified, the method will automatically determine the mode based on the type of data provided (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
128
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the response. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
129
|
+
*/
|
|
25
130
|
protected sendResponse(uuid: string, data: Uint8Array | ArrayBuffer): void;
|
|
26
131
|
protected sendResponse(uuid: string, data: LineCodec.ContentMap, mode: 'LINE'): void;
|
|
27
132
|
protected sendResponse(uuid: string, data: any): void;
|
|
133
|
+
/**
|
|
134
|
+
* Sends an error frame with the specified UUID and error information, encoding the error data according to the specified mode (BINARY, JSON, or LINE).
|
|
135
|
+
* The error will be framed and sent over the transport, and the UUID will be used to match it to the original request if applicable.
|
|
136
|
+
* If the UUID is not provided, the error will be sent without an identifier, and it's up to the receiving end to interpret it as a general error.
|
|
137
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
138
|
+
* @param error The VIOError object containing the error information to send.
|
|
139
|
+
* @param uuid Optional UUID to associate with this error. If provided, this should match the UUID of the original request that this error is for. If not provided, the error will be sent without an identifier.
|
|
140
|
+
* @param mode Optional mode for encoding the error data. If not specified, the method will automatically determine the mode based on the type of data in the VIOError (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
141
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the error frame. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
142
|
+
*/
|
|
28
143
|
protected sendError(error: VIOError, uuid?: string): void;
|
|
144
|
+
/**
|
|
145
|
+
* Serializes the given data into a Uint8Array based on the specified mode. If the data is already a Uint8Array or ArrayBuffer, it will be returned as-is with the appropriate mode. If the mode is 'LINE', the data will be encoded using the LineCodec. For other objects, the data will be JSON-stringified and encoded as UTF-8.
|
|
146
|
+
* @param data The data to serialize. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
147
|
+
* @param mode Optional mode for encoding the data. If not specified, the method will automatically determine the mode based on the type of data provided (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
148
|
+
* @returns An object containing the serialized content as a Uint8Array and the final mode used for encoding.
|
|
149
|
+
*/
|
|
29
150
|
protected serialize(data: any, mode?: 'LINE'): {
|
|
30
151
|
content: Uint8Array;
|
|
31
152
|
finalMode: Frame.Mode;
|
|
32
153
|
};
|
|
33
154
|
}
|
|
34
155
|
export declare namespace VIO {
|
|
156
|
+
export interface ErrorContext {
|
|
157
|
+
stage: 'send' | 'recv' | 'connect';
|
|
158
|
+
frameType?: Frame.Type | string;
|
|
159
|
+
uuid?: string;
|
|
160
|
+
info?: any;
|
|
161
|
+
}
|
|
35
162
|
export type TransportEventMap = {
|
|
36
163
|
send: [data: ArrayBuffer];
|
|
37
|
-
'
|
|
38
|
-
stage: 'send' | 'recv' | 'connect';
|
|
39
|
-
frameType?: Frame.Type | string;
|
|
40
|
-
uuid?: string;
|
|
41
|
-
info?: any;
|
|
42
|
-
}];
|
|
164
|
+
'error': [err: Error, context: ErrorContext];
|
|
43
165
|
};
|
|
44
166
|
type EventTuple = ([
|
|
45
167
|
name: string,
|
|
@@ -74,7 +196,7 @@ export declare namespace VIO {
|
|
|
74
196
|
request: requestTuple;
|
|
75
197
|
event: EventTuple;
|
|
76
198
|
error: [error: VIOError];
|
|
77
|
-
raw: [data: Frame];
|
|
199
|
+
raw: [data: Frame<'RAW'>];
|
|
78
200
|
response: [uuid: string, response: RequestManager.Response];
|
|
79
201
|
};
|
|
80
202
|
export {};
|
package/build/VIO.js
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module vortez-io
|
|
3
|
+
* @author NetFeez <netfeez.dev@gmail.com>
|
|
4
|
+
* @license Apache-2.0
|
|
5
|
+
* @description Core transport-agnostic API for sending and receiving VIO frames.
|
|
6
|
+
*/
|
|
1
7
|
import { Events } from "@netfeez/common";
|
|
2
8
|
import RequestManager from "./RequestManager.js";
|
|
3
9
|
import VIOError from "./VIOError.js";
|
|
@@ -14,13 +20,59 @@ export class VIO extends Events {
|
|
|
14
20
|
this.mRequest.on('send', this.sendRequest.bind(this));
|
|
15
21
|
this.vTransport = new Events.Emitter();
|
|
16
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* The transport emitter allows you to send raw frames and listen for transport-level events like errors.
|
|
25
|
+
* Use the `request`, `event`, and `raw` methods for higher-level interactions that automatically handle framing and serialization.
|
|
26
|
+
*/
|
|
17
27
|
get transport() { return this.vTransport; }
|
|
28
|
+
/**
|
|
29
|
+
* Sends a request and returns a promise that resolves with the response or rejects with an error.
|
|
30
|
+
* @param data The data to send in the request. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
31
|
+
* @param options Optional settings for the request, such as timeout duration. The exact options depend on the implementation of the RequestManager.
|
|
32
|
+
* @returns A promise that resolves with the response data or rejects with a VIOError if the request fails or times out.
|
|
33
|
+
* @throws {VIOError} Throws a VIOError if the request fails or if there is an error in processing the response. Make sure to catch these errors when using the `request` method to handle them gracefully in your application.
|
|
34
|
+
*/
|
|
18
35
|
async request(data, options) {
|
|
19
36
|
return this.mRequest.send(data, options);
|
|
20
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Emits an event with the specified name and data.
|
|
40
|
+
* The data can be a Uint8Array, ArrayBuffer, or any JSON-serializable object.
|
|
41
|
+
* If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
42
|
+
* The event will be framed and sent over the transport.
|
|
43
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
44
|
+
* @param name The name of the event to emit. This should be a string that identifies the event type.
|
|
45
|
+
* @param data The data to send with the event. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
46
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the event. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
47
|
+
*/
|
|
21
48
|
event(name, data) {
|
|
22
49
|
this.sendEvent(name, data);
|
|
23
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Sends raw binary data as a frame of type 'RAW'.
|
|
53
|
+
* This method is for advanced use cases where you want to send data without the overhead of framing it as an event or request.
|
|
54
|
+
* The data will be sent as-is, and it's up to the receiving end to interpret it correctly.
|
|
55
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
56
|
+
* @param data The raw binary data to send. This can be a Uint8Array or an ArrayBuffer.
|
|
57
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the raw data. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
58
|
+
*/
|
|
59
|
+
raw(data) {
|
|
60
|
+
const frame = Frame.encode('RAW', 'BINARY', new Uint8Array(data));
|
|
61
|
+
try {
|
|
62
|
+
this.vTransport.emit('send', frame);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
this.vTransport.emit('error', err instanceof Error ? err : new Error(String(err)), { stage: 'send', frameType: 'RAW', info: {} });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Handles incoming data by decoding it into a frame and processing it based on the frame type.
|
|
70
|
+
* This method should be called whenever new data is received from the transport.
|
|
71
|
+
* It will emit higher-level events like 'event', 'request', and 'response' based on the content of the frame.
|
|
72
|
+
* Make sure to handle any errors that may occur during the decoding and processing of the frame by listening to the 'error' event on this VIO instance.
|
|
73
|
+
* @param data The incoming data to handle. This can be a Uint8Array or an ArrayBuffer containing the raw frame data.
|
|
74
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding or processing the frame. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
75
|
+
*/
|
|
24
76
|
handle(data) {
|
|
25
77
|
try {
|
|
26
78
|
const frame = Frame.decode(data);
|
|
@@ -49,9 +101,21 @@ export class VIO extends Events {
|
|
|
49
101
|
this.emit('error', error instanceof VIOError ? error : new VIOError(VIOError.Code.INVALID_DATA, 'Failed to decode frame'));
|
|
50
102
|
}
|
|
51
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Handles a raw frame by emitting it as a 'raw' event. This allows users of the VIO class to listen for raw frames directly if they need to process them in a custom way.
|
|
106
|
+
* @param frame The raw frame to handle. This frame will be emitted as-is without any additional processing, so make sure to handle it appropriately in your event listeners.
|
|
107
|
+
* @throws {VIOError} Throws a VIOError if there is an error in processing the raw frame. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
108
|
+
*/
|
|
52
109
|
async handleRaw(frame) {
|
|
53
110
|
this.emit('raw', frame);
|
|
54
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Handles an event frame by decoding its content based on the specified mode and emitting it as an 'event' with the appropriate data.
|
|
114
|
+
* The event will include the name (identifier), mode, and decoded data.
|
|
115
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
116
|
+
* @param frame The event frame to handle. This frame should contain a valid identifier and data that can be decoded according to the specified mode.
|
|
117
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the event data or if the frame has an unknown mode. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
118
|
+
*/
|
|
55
119
|
async handleEvent(frame) {
|
|
56
120
|
try {
|
|
57
121
|
if (frame.mode == 'BINARY' || frame.mode == 'CUSTOM') {
|
|
@@ -74,6 +138,13 @@ export class VIO extends Events {
|
|
|
74
138
|
this.emit('error', error instanceof VIOError ? error : new VIOError(VIOError.Code.INVALID_DATA, 'Failed to process event data'));
|
|
75
139
|
}
|
|
76
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Handles a request frame by decoding its content based on the specified mode and emitting it as a 'request' with the appropriate data and callback functions for handling the response.
|
|
143
|
+
* The request will include the mode, decoded data, and two callback functions: `done` for sending a successful response and `fail` for sending an error response.
|
|
144
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
145
|
+
* @param frame The request frame to handle. This frame should contain a valid identifier and data that can be decoded according to the specified mode.
|
|
146
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the request data, if the frame has an unknown mode, or if the request frame is missing a UUID. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
147
|
+
*/
|
|
77
148
|
async handleRequest(frame) {
|
|
78
149
|
if (!frame.identifier.id)
|
|
79
150
|
return this.sendError(new VIOError(VIOError.Code.INVALID_HEADER, 'Request frame missing UUID'));
|
|
@@ -105,6 +176,13 @@ export class VIO extends Events {
|
|
|
105
176
|
this.sendError(new VIOError(VIOError.Code.INVALID_DATA, 'Failed to process request data'), uuid);
|
|
106
177
|
}
|
|
107
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Handles a response frame by decoding its content based on the specified mode and passing it to the RequestManager to resolve the corresponding request promise.
|
|
181
|
+
* The response will be matched to the original request using the UUID from the frame identifier.
|
|
182
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
183
|
+
* @param frame The response frame to handle. This frame should contain a valid UUID in the identifier and data that can be decoded according to the specified mode.
|
|
184
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the response data, if the frame has an unknown mode, or if the response frame is missing a UUID. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
185
|
+
*/
|
|
108
186
|
async handleResponse(frame) {
|
|
109
187
|
if (!frame.identifier.id)
|
|
110
188
|
return this.sendError(new VIOError(VIOError.Code.INVALID_HEADER, 'Response frame missing UUID'));
|
|
@@ -129,6 +207,13 @@ export class VIO extends Events {
|
|
|
129
207
|
this.mRequest.handle(frame.identifier.id, undefined, new VIOError(VIOError.Code.INVALID_DATA, 'Failed to process response data'));
|
|
130
208
|
}
|
|
131
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Handles an error frame by decoding its content based on the specified mode and passing the error information to the RequestManager or emitting it as an 'error' event if the frame does not have a valid identifier.
|
|
212
|
+
* The error will be matched to the original request using the UUID from the frame identifier if available. If the identifier type is 'NONE', the error will be emitted as a general 'error' event.
|
|
213
|
+
* Make sure to handle any errors that may occur during the decoding process by listening to the 'error' event on this VIO instance.
|
|
214
|
+
* @param frame The error frame to handle. This frame should contain data that can be decoded according to the specified mode, and may optionally contain a UUID in the identifier for matching it to a request.
|
|
215
|
+
* @throws {VIOError} Throws a VIOError if there is an error in decoding the error data or if the frame has an unknown mode. Make sure to catch these errors by listening to the 'error' event on this VIO instance to handle them gracefully in your application.
|
|
216
|
+
*/
|
|
132
217
|
async handleError(frame) {
|
|
133
218
|
try {
|
|
134
219
|
if (frame.identifier.type === 'NONE') {
|
|
@@ -170,7 +255,7 @@ export class VIO extends Events {
|
|
|
170
255
|
this.vTransport.emit('send', frame);
|
|
171
256
|
}
|
|
172
257
|
catch (err) {
|
|
173
|
-
this.vTransport.emit('
|
|
258
|
+
this.vTransport.emit('error', err instanceof Error ? err : new Error(String(err)), { stage: 'send', frameType: 'EVENT', info: { name } });
|
|
174
259
|
}
|
|
175
260
|
}
|
|
176
261
|
sendRequest(uuid, data, mode) {
|
|
@@ -180,7 +265,7 @@ export class VIO extends Events {
|
|
|
180
265
|
this.vTransport.emit('send', frame);
|
|
181
266
|
}
|
|
182
267
|
catch (err) {
|
|
183
|
-
this.vTransport.emit('
|
|
268
|
+
this.vTransport.emit('error', err instanceof Error ? err : new Error(String(err)), { stage: 'send', frameType: 'REQUEST', uuid, info: {} });
|
|
184
269
|
}
|
|
185
270
|
}
|
|
186
271
|
sendResponse(uuid, data, mode) {
|
|
@@ -190,9 +275,19 @@ export class VIO extends Events {
|
|
|
190
275
|
this.vTransport.emit('send', frame);
|
|
191
276
|
}
|
|
192
277
|
catch (err) {
|
|
193
|
-
this.vTransport.emit('
|
|
278
|
+
this.vTransport.emit('error', err instanceof Error ? err : new Error(String(err)), { stage: 'send', frameType: 'RESPONSE', uuid, info: {} });
|
|
194
279
|
}
|
|
195
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Sends an error frame with the specified UUID and error information, encoding the error data according to the specified mode (BINARY, JSON, or LINE).
|
|
283
|
+
* The error will be framed and sent over the transport, and the UUID will be used to match it to the original request if applicable.
|
|
284
|
+
* If the UUID is not provided, the error will be sent without an identifier, and it's up to the receiving end to interpret it as a general error.
|
|
285
|
+
* Make sure to handle any errors that may occur during the sending process by listening to the 'error' event on the transport emitter.
|
|
286
|
+
* @param error The VIOError object containing the error information to send.
|
|
287
|
+
* @param uuid Optional UUID to associate with this error. If provided, this should match the UUID of the original request that this error is for. If not provided, the error will be sent without an identifier.
|
|
288
|
+
* @param mode Optional mode for encoding the error data. If not specified, the method will automatically determine the mode based on the type of data in the VIOError (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
289
|
+
* @throws {VIOError} Throws a VIOError if there is an error in sending the error frame. Make sure to catch these errors by listening to the 'error' event on the transport emitter to handle them gracefully in your application.
|
|
290
|
+
*/
|
|
196
291
|
sendError(error, uuid) {
|
|
197
292
|
const json = JSON.stringify({ error: error.message, code: error.code });
|
|
198
293
|
const content = UTF8Codec.encode(json);
|
|
@@ -201,9 +296,15 @@ export class VIO extends Events {
|
|
|
201
296
|
this.vTransport.emit('send', frame);
|
|
202
297
|
}
|
|
203
298
|
catch (err) {
|
|
204
|
-
this.vTransport.emit('
|
|
299
|
+
this.vTransport.emit('error', err instanceof Error ? err : new Error(String(err)), { stage: 'send', frameType: 'ERROR', uuid, info: {} });
|
|
205
300
|
}
|
|
206
301
|
}
|
|
302
|
+
/**
|
|
303
|
+
* Serializes the given data into a Uint8Array based on the specified mode. If the data is already a Uint8Array or ArrayBuffer, it will be returned as-is with the appropriate mode. If the mode is 'LINE', the data will be encoded using the LineCodec. For other objects, the data will be JSON-stringified and encoded as UTF-8.
|
|
304
|
+
* @param data The data to serialize. This can be a Uint8Array, ArrayBuffer, or any JSON-serializable object. If you want to send line-based data, pass an object and specify mode: 'LINE'.
|
|
305
|
+
* @param mode Optional mode for encoding the data. If not specified, the method will automatically determine the mode based on the type of data provided (BINARY for Uint8Array/ArrayBuffer, JSON for objects, LINE for line-based data).
|
|
306
|
+
* @returns An object containing the serialized content as a Uint8Array and the final mode used for encoding.
|
|
307
|
+
*/
|
|
207
308
|
serialize(data, mode) {
|
|
208
309
|
if (data instanceof Uint8Array)
|
|
209
310
|
return { content: data, finalMode: 'BINARY' };
|
package/build/VIO.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VIO.js","sourceRoot":"","sources":["../src/VIO.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,cAAc,MAAM,qBAAqB,CAAC;AACjD,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,SAAS,MAAM,yBAAyB,CAAC;AAEhD,MAAM,OAAO,GAAmB,SAAQ,MAAoB;IAC9C,QAAQ,CAAoB;IAC/B,UAAU,CAAwC;IAEzD,YAAmB,YAA4C;QAAG,KAAK,EAAE,CAAC;QACtE,IAAI,CAAC,QAAQ,GAAG,IAAI,cAAc,CAAC,YAAY,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,UAAU,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;IAC3C,CAAC;IACD,IAAW,SAAS,K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AO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QAAC,CAAC;IAC9J,CAAC;IACD;;;;;OAKG;IACO,SAAS,CAAC,IAAS,EAAE,IAAa;QACxC,IAAI,IAAI,YAAY,UAAU;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;QAC9E,IAAI,IAAI,YAAY,WAAW;YAAE,OAAO,EAAE,OAAO,EAAE,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC;QAC/F,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;QACnF,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACxC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAClE,CAAC;CACJ;AA+BD,eAAe,GAAG,CAAC"}
|
package/build/VIOError.d.ts
CHANGED
package/build/VIOError.js
CHANGED
package/build/VIOError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VIOError.js","sourceRoot":"","sources":["../src/VIOError.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAS,SAAQ,KAAK;IACxB,IAAI,GAAW,UAAU,CAAC;IAC1B,IAAI,CAAgB;IAC3B,YAAmB,IAAmB,EAAE,OAAe;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAA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CAAC,EATgB,QAAQ,KAAR,QAAQ,QASxB;AACD,eAAe,QAAQ,CAAC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { VIO, VIO as default } from "./VIO.js";
|
|
2
|
-
export { VIOStrict } from "./VIOStrict.js";
|
|
2
|
+
export { VIOStrict } from "./strict/VIOStrict.js";
|
|
3
3
|
export { VIOError } from "./VIOError.js";
|
|
4
4
|
export { Frame } from "./Frame.js";
|
|
5
|
+
export { Isomorphic } from "./support/Isomorphic.js";
|