@astrale-os/kernel-client 0.6.0-beta.82 → 0.6.0-beta.84
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/client/admission.js +1 -9
- package/dist/client/client.js +3 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/routing-control.d.ts +11 -3
- package/dist/client/routing-control.js +18 -3
- package/dist/errors/stale-route-error.d.ts +14 -3
- package/dist/errors/stale-route-error.js +15 -3
- package/dist/errors/transport-error.d.ts +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/introspection.js +10 -6
- package/dist/schema/schema.d.ts +3 -0
- package/dist/schema/schema.js +13 -2
- package/dist/session/bound.js +10 -1
- package/dist/session/content.js +4 -27
- package/dist/session/context/index.d.ts +1 -1
- package/dist/session/context/index.js +1 -1
- package/dist/session/context/limits.d.ts +1 -0
- package/dist/session/context/limits.js +1 -0
- package/dist/session/discovery/bundle.js +1 -1
- package/dist/session/discovery/discovery.d.ts +12 -4
- package/dist/session/discovery/discovery.js +28 -19
- package/dist/session/discovery/index.d.ts +8 -1
- package/dist/session/discovery/index.js +5 -8
- package/dist/session/discovery/legacy/index.d.ts +38 -0
- package/dist/session/discovery/legacy/index.js +38 -0
- package/dist/session/discovery/legacy/intrinsic.d.ts +33 -0
- package/dist/session/discovery/legacy/intrinsic.js +67 -0
- package/dist/session/discovery/legacy/projection.d.ts +8 -0
- package/dist/session/discovery/legacy/projection.js +17 -0
- package/dist/session/discovery/{publication.d.ts → legacy/publication.d.ts} +8 -5
- package/dist/session/discovery/{publication.js → legacy/publication.js} +13 -60
- package/dist/session/discovery/release.d.ts +29 -0
- package/dist/session/discovery/release.js +81 -0
- package/dist/session/discovery/response.d.ts +3 -0
- package/dist/session/discovery/response.js +59 -0
- package/dist/session/discovery/snapshot.d.ts +9 -2
- package/dist/session/discovery/snapshot.js +2 -2
- package/dist/session/discovery/transport.d.ts +1 -3
- package/dist/session/exchange/options.d.ts +13 -10
- package/dist/session/exchange/options.js +6 -5
- package/dist/session/exchange/presentation.d.ts +3 -2
- package/dist/session/index.d.ts +1 -1
- package/dist/session/reference.d.ts +3 -6
- package/dist/session/reference.js +0 -4
- package/dist/session/routing/dispatch.js +36 -37
- package/dist/session/session.d.ts +18 -3
- package/dist/session/session.js +21 -10
- package/dist/session/session.typecheck.js +14 -3
- package/dist/transport/auto/transport.d.ts +0 -1
- package/dist/transport/auto/transport.js +0 -2
- package/dist/transport/http/response.d.ts +1 -1
- package/dist/transport/http/response.js +2 -6
- package/dist/transport/http/transport.d.ts +5 -3
- package/dist/transport/http/transport.js +40 -19
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/transport.d.ts +10 -2
- package/dist/transport/websocket/transport.d.ts +0 -3
- package/dist/transport/websocket/transport.js +1 -16
- package/package.json +6 -7
|
@@ -14,7 +14,6 @@ const DEFAULT_MAXIMUM_BUFFERED_STREAM_ITEMS = 256;
|
|
|
14
14
|
export class WebSocketTransport {
|
|
15
15
|
url;
|
|
16
16
|
connectionUrl;
|
|
17
|
-
codecName;
|
|
18
17
|
WebSocketConstructor;
|
|
19
18
|
timeoutMs;
|
|
20
19
|
maximumRequestBytes;
|
|
@@ -35,7 +34,6 @@ export class WebSocketTransport {
|
|
|
35
34
|
}
|
|
36
35
|
this.url = normalizeUrl(options.url);
|
|
37
36
|
this.connectionUrl = this.url;
|
|
38
|
-
this.codecName = admitCodecName(options.codec);
|
|
39
37
|
this.WebSocketConstructor = admitWebSocket(options.websocket);
|
|
40
38
|
this.timeoutMs = positiveInteger(options.timeoutMs ?? DEFAULT_TIMEOUT_MS, 'timeoutMs');
|
|
41
39
|
this.maximumRequestBytes = positiveInteger(options.maximumRequestBytes ?? DEFAULT_MAXIMUM_REQUEST_BYTES, 'maximumRequestBytes');
|
|
@@ -49,10 +47,7 @@ export class WebSocketTransport {
|
|
|
49
47
|
throw invocationFailure('WebSocketTransport is closed.', 'closed');
|
|
50
48
|
}
|
|
51
49
|
const timeoutMs = positiveInteger(options.timeoutMs ?? this.timeoutMs, 'timeoutMs');
|
|
52
|
-
const codec =
|
|
53
|
-
if (this.stopped) {
|
|
54
|
-
throw invocationFailure('WebSocketTransport is closed.', 'closed');
|
|
55
|
-
}
|
|
50
|
+
const codec = codecs.json;
|
|
56
51
|
const request = protocol.decodeRequest({
|
|
57
52
|
version: protocol.VERSION,
|
|
58
53
|
requestId: this.nextRequestId(),
|
|
@@ -106,9 +101,6 @@ export class WebSocketTransport {
|
|
|
106
101
|
this.nextId = id === Number.MAX_SAFE_INTEGER ? 1 : id + 1;
|
|
107
102
|
return id;
|
|
108
103
|
}
|
|
109
|
-
codec() {
|
|
110
|
-
return this.codecName === 'msgpack' ? codecs.loadMsgpack() : Promise.resolve(codecs.json);
|
|
111
|
-
}
|
|
112
104
|
}
|
|
113
105
|
function normalizeUrl(input) {
|
|
114
106
|
if (typeof input !== 'string')
|
|
@@ -132,13 +124,6 @@ function normalizeUrl(input) {
|
|
|
132
124
|
}
|
|
133
125
|
return parsed.toString();
|
|
134
126
|
}
|
|
135
|
-
function admitCodecName(input) {
|
|
136
|
-
if (input === undefined || input === 'json')
|
|
137
|
-
return 'json';
|
|
138
|
-
if (input === 'msgpack')
|
|
139
|
-
return input;
|
|
140
|
-
throw new TypeError('codec must be "json" or "msgpack".');
|
|
141
|
-
}
|
|
142
127
|
function admitWebSocket(input) {
|
|
143
128
|
const implementation = input ?? (typeof WebSocket === 'undefined' ? undefined : WebSocket);
|
|
144
129
|
if (typeof implementation !== 'function') {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrale-os/kernel-client",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.84",
|
|
4
4
|
"description": "Universal Client — protocol-first, transport-agnostic",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrale",
|
|
@@ -65,14 +65,13 @@
|
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@astrale-os/kernel-core": "0.9.0-beta.
|
|
69
|
-
"@astrale-os/kernel-dsl": "0.2.0-beta.
|
|
70
|
-
"@astrale-os/kernel-protocol": "0.5.0-beta.
|
|
71
|
-
"@tanstack/pacer": "0.20.1"
|
|
72
|
-
"msgpackr": "^2.0.5"
|
|
68
|
+
"@astrale-os/kernel-core": "0.9.0-beta.63",
|
|
69
|
+
"@astrale-os/kernel-dsl": "0.2.0-beta.45",
|
|
70
|
+
"@astrale-os/kernel-protocol": "0.5.0-beta.69",
|
|
71
|
+
"@tanstack/pacer": "0.20.1"
|
|
73
72
|
},
|
|
74
73
|
"devDependencies": {
|
|
75
|
-
"@astrale-os/kernel-server": "0.5.0-beta.
|
|
74
|
+
"@astrale-os/kernel-server": "0.5.0-beta.71",
|
|
76
75
|
"@astrale/typescript-config": "npm:@jsr/astrale__typescript-config@~1.1.0",
|
|
77
76
|
"@types/node": "^22.0.0",
|
|
78
77
|
"typescript": "7.0.2",
|