@celljs/ta-exec 4.15.2 → 4.17.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.
|
@@ -32,6 +32,8 @@ export declare class ExecServer implements ExecPeerServer {
|
|
|
32
32
|
/** False when a newer host has taken over; a newer one fences the older ones. */
|
|
33
33
|
admit(peer: ExecPeer, epoch: number): boolean;
|
|
34
34
|
isCurrent(epoch: number | undefined): boolean;
|
|
35
|
-
|
|
35
|
+
/** An upgrade to its path, from a server of another's (`ta serve` at `/api/exec`): checked as its own are. */
|
|
36
|
+
accept(request: IncomingMessage, socket: Duplex, head: Buffer): void;
|
|
37
|
+
protected upgrade(request: IncomingMessage, socket: Duplex, head: Buffer, anyPath?: boolean): void;
|
|
36
38
|
protected matches(token: string): boolean;
|
|
37
39
|
}
|
package/esm/node/exec-server.js
CHANGED
|
@@ -53,10 +53,14 @@ export class ExecServer {
|
|
|
53
53
|
isCurrent(epoch) {
|
|
54
54
|
return epoch === this.epoch;
|
|
55
55
|
}
|
|
56
|
-
upgrade
|
|
56
|
+
/** An upgrade to its path, from a server of another's (`ta serve` at `/api/exec`): checked as its own are. */
|
|
57
|
+
accept(request, socket, head) {
|
|
58
|
+
this.upgrade(request, socket, head, true);
|
|
59
|
+
}
|
|
60
|
+
upgrade(request, socket, head, anyPath = false) {
|
|
57
61
|
var _a, _b;
|
|
58
62
|
const url = new URL((_a = request.url) !== null && _a !== void 0 ? _a : '/', 'http://localhost');
|
|
59
|
-
if (url.pathname !== ExecRpc.PATH) {
|
|
63
|
+
if (!anyPath && url.pathname !== ExecRpc.PATH) {
|
|
60
64
|
WebSocketConnection.refuse(socket, 404, 'Not found.');
|
|
61
65
|
return;
|
|
62
66
|
}
|
|
@@ -32,7 +32,9 @@ export declare class ExecServer implements ExecPeerServer {
|
|
|
32
32
|
/** False when a newer host has taken over; a newer one fences the older ones. */
|
|
33
33
|
admit(peer: ExecPeer, epoch: number): boolean;
|
|
34
34
|
isCurrent(epoch: number | undefined): boolean;
|
|
35
|
-
|
|
35
|
+
/** An upgrade to its path, from a server of another's (`ta serve` at `/api/exec`): checked as its own are. */
|
|
36
|
+
accept(request: IncomingMessage, socket: Duplex, head: Buffer): void;
|
|
37
|
+
protected upgrade(request: IncomingMessage, socket: Duplex, head: Buffer, anyPath?: boolean): void;
|
|
36
38
|
protected matches(token: string): boolean;
|
|
37
39
|
}
|
|
38
40
|
//# sourceMappingURL=exec-server.d.ts.map
|
package/lib/node/exec-server.js
CHANGED
|
@@ -56,10 +56,14 @@ class ExecServer {
|
|
|
56
56
|
isCurrent(epoch) {
|
|
57
57
|
return epoch === this.epoch;
|
|
58
58
|
}
|
|
59
|
-
upgrade
|
|
59
|
+
/** An upgrade to its path, from a server of another's (`ta serve` at `/api/exec`): checked as its own are. */
|
|
60
|
+
accept(request, socket, head) {
|
|
61
|
+
this.upgrade(request, socket, head, true);
|
|
62
|
+
}
|
|
63
|
+
upgrade(request, socket, head, anyPath = false) {
|
|
60
64
|
var _a, _b;
|
|
61
65
|
const url = new URL((_a = request.url) !== null && _a !== void 0 ? _a : '/', 'http://localhost');
|
|
62
|
-
if (url.pathname !== exec_rpc_1.ExecRpc.PATH) {
|
|
66
|
+
if (!anyPath && url.pathname !== exec_rpc_1.ExecRpc.PATH) {
|
|
63
67
|
websocket_connection_1.WebSocketConnection.refuse(socket, 404, 'Not found.');
|
|
64
68
|
return;
|
|
65
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@celljs/ta-exec",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.17.0",
|
|
4
4
|
"description": "Where Ta runs commands and touches files: the ExecEnvironment interface, this machine, and ta exec-server for another one",
|
|
5
5
|
"homepage": "https://github.com/cellbang/ta",
|
|
6
6
|
"bugs": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"watch": "tsc -b -w --preserveWatchOutput"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@celljs/rpc": "4.
|
|
32
|
+
"@celljs/rpc": "4.17.0"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|