@thestarweb/star-framework-web-runtime 0.0.0-stage → 1.2.3
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/CHANGELOG.md +112 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/mime.js +6 -0
- package/dist/mime.js.map +1 -0
- package/dist/node.js +55 -0
- package/dist/node.js.map +1 -0
- package/dist/package-loader/base-package-loader.js +132 -0
- package/dist/package-loader/base-package-loader.js.map +1 -0
- package/dist/package-loader/default-loader/index.js +17 -0
- package/dist/package-loader/default-loader/index.js.map +1 -0
- package/dist/package-loader/index.js +14 -0
- package/dist/package-loader/index.js.map +1 -0
- package/dist/package-loader/worker-thread/index.js +82 -0
- package/dist/package-loader/worker-thread/index.js.map +1 -0
- package/dist/package-loader/worker-thread/main-thread-ctrl.js +102 -0
- package/dist/package-loader/worker-thread/main-thread-ctrl.js.map +1 -0
- package/dist/package-loader/worker-thread/types.js +14 -0
- package/dist/package-loader/worker-thread/types.js.map +1 -0
- package/dist/package-loader/worker-thread/worker.js +51 -0
- package/dist/package-loader/worker-thread/worker.js.map +1 -0
- package/dist/parse-instances-config.js +80 -0
- package/dist/parse-instances-config.js.map +1 -0
- package/dist/remote-call/const.js +21 -0
- package/dist/remote-call/const.js.map +1 -0
- package/dist/remote-call/remote-call-client.js +76 -0
- package/dist/remote-call/remote-call-client.js.map +1 -0
- package/dist/remote-call/utile/message-port-to-connection.js +150 -0
- package/dist/remote-call/utile/message-port-to-connection.js.map +1 -0
- package/dist/remote-call/utile/remote-message/build.js +30 -0
- package/dist/remote-call/utile/remote-message/build.js.map +1 -0
- package/dist/remote-call/utile/remote-message/json-handle.js +15 -0
- package/dist/remote-call/utile/remote-message/json-handle.js.map +1 -0
- package/dist/remote-call/utile/remote-message/message.js +45 -0
- package/dist/remote-call/utile/remote-message/message.js.map +1 -0
- package/dist/remote-call/utile/remote-message/reader.js +18 -0
- package/dist/remote-call/utile/remote-message/reader.js.map +1 -0
- package/dist/remote-call/utile/remote-message/uint8-array-handle.js +27 -0
- package/dist/remote-call/utile/remote-message/uint8-array-handle.js.map +1 -0
- package/dist/remote-call/utile/remote-message/uint8-handle.js +19 -0
- package/dist/remote-call/utile/remote-message/uint8-handle.js.map +1 -0
- package/dist/remote-call/utile/remote-message/value-handle.js +5 -0
- package/dist/remote-call/utile/remote-message/value-handle.js.map +1 -0
- package/dist/remote-call/utile/remote-message/var-char-handle.js +31 -0
- package/dist/remote-call/utile/remote-message/var-char-handle.js.map +1 -0
- package/dist/remote-call/utile/remote-message/var-uint-handle.js +36 -0
- package/dist/remote-call/utile/remote-message/var-uint-handle.js.map +1 -0
- package/dist/types/config.js +11 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/instance.js +7 -0
- package/dist/types/instance.js.map +1 -0
- package/dist/types/package-info.js +4 -0
- package/dist/types/package-info.js.map +1 -0
- package/dist/types/resolved.js +13 -0
- package/dist/types/resolved.js.map +1 -0
- package/package.json +38 -5
- package/src/index.ts +3 -0
- package/src/mime.ts +5 -0
- package/src/node.ts +49 -0
- package/src/package-loader/base-package-loader.ts +148 -0
- package/src/package-loader/default-loader/index.ts +15 -0
- package/src/package-loader/index.ts +23 -0
- package/src/package-loader/worker-thread/index.ts +81 -0
- package/src/package-loader/worker-thread/main-thread-ctrl.ts +100 -0
- package/src/package-loader/worker-thread/types.ts +16 -0
- package/src/package-loader/worker-thread/worker.ts +49 -0
- package/src/parse-instances-config.ts +83 -0
- package/src/remote-call/const.ts +17 -0
- package/src/remote-call/remote-call-client.ts +95 -0
- package/src/remote-call/utile/message-port-to-connection.ts +134 -0
- package/src/remote-call/utile/remote-message/build.ts +26 -0
- package/src/remote-call/utile/remote-message/json-handle.ts +14 -0
- package/src/remote-call/utile/remote-message/message.ts +57 -0
- package/src/remote-call/utile/remote-message/reader.ts +16 -0
- package/src/remote-call/utile/remote-message/uint8-array-handle.ts +23 -0
- package/src/remote-call/utile/remote-message/uint8-handle.ts +16 -0
- package/src/remote-call/utile/remote-message/value-handle.ts +10 -0
- package/src/remote-call/utile/remote-message/var-char-handle.ts +28 -0
- package/src/remote-call/utile/remote-message/var-uint-handle.ts +32 -0
- package/src/types/config.ts +13 -0
- package/src/types/index.ts +4 -0
- package/src/types/instance.ts +15 -0
- package/src/types/package-info.ts +14 -0
- package/src/types/resolved.ts +42 -0
- package/README.md +0 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
import { parentPort } from "worker_threads";
|
|
6
|
+
/*@ts-ignore*/
|
|
7
|
+
import { __ΩRequestProp, __ΩResponseData, __ΩServerInstance } from "../../types/index.js";
|
|
8
|
+
import { RemoteCallClient } from "../../remote-call/remote-call-client.js";
|
|
9
|
+
/*@ts-ignore*/
|
|
10
|
+
import { __ΩMessage } from "./types.js";
|
|
11
|
+
import { messagePortToConnection } from "../../remote-call/utile/message-port-to-connection.js";
|
|
12
|
+
if (!parentPort) {
|
|
13
|
+
console.error("this code must run in worker");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
class Worker extends RemoteCallClient {
|
|
17
|
+
ins;
|
|
18
|
+
createConnection() {
|
|
19
|
+
const { port1, port2 } = new MessageChannel();
|
|
20
|
+
parentPort.postMessage({ type: 2, port: port2 }, [
|
|
21
|
+
port2,
|
|
22
|
+
]);
|
|
23
|
+
return messagePortToConnection(port1, "main");
|
|
24
|
+
}
|
|
25
|
+
async handleRequest(prop) {
|
|
26
|
+
return await this.ins.onRequest(prop);
|
|
27
|
+
}
|
|
28
|
+
constructor(ins) {
|
|
29
|
+
super();
|
|
30
|
+
this.ins = ins;
|
|
31
|
+
}
|
|
32
|
+
static __type = [() => RemoteCallClient, 'createConnection', () => __ΩRequestProp, 'prop', () => __ΩResponseData, 'handleRequest', () => __ΩServerInstance, 'ins', 'constructor', 'Worker', 'P7!P"0"Pn#2$n%`0&Pn\'2(;"0)5w*'];
|
|
33
|
+
}
|
|
34
|
+
let w;
|
|
35
|
+
parentPort.on("message", __assignType(async (message) => {
|
|
36
|
+
switch (message.type) {
|
|
37
|
+
case 1:
|
|
38
|
+
const module = await import(message.mainFileURL);
|
|
39
|
+
const ins = module.default({
|
|
40
|
+
...message.context,
|
|
41
|
+
innerCall: __assignType((prop) => w.onRequest(prop), [() => __ΩRequestProp, 'prop', '', 'Pn!2""/#']),
|
|
42
|
+
});
|
|
43
|
+
w = new Worker(ins);
|
|
44
|
+
parentPort.postMessage({ type: 3 });
|
|
45
|
+
break;
|
|
46
|
+
case 2:
|
|
47
|
+
w.onConnection(messagePortToConnection(message.port, "worker"));
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
}, [() => __ΩMessage, 'message', '', 'Pn!2""/#']));
|
|
51
|
+
//# sourceMappingURL=worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../../../src/package-loader/worker-thread/worker.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;;mEAOrC,sBAAsB;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;;2BACrB,YAAY;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uDAAuD,CAAC;AAEhG,IAAI,CAAC,UAAU,EAAE,CAAC;IACjB,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC;AAED,MAAM,MAAO,SAAQ,gBAAgB;IAWhB;IAVpB,gBAAgB;QACf,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,IAAI,cAAc,EAAE,CAAC;QAC9C,UAAW,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,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', 'parseInstancesConfig', 'Pn!F2""/#'];
|
|
6
|
+
import { extname, join } from "path";
|
|
7
|
+
import { loadPackage } from "./package-loader/index.js";
|
|
8
|
+
/*@ts-ignore*/
|
|
9
|
+
import { __ΩResolvedServerInstance, __ΩRequestProp, __ΩResponseData, __ΩServerInstanceConfig } from "./types/index.js";
|
|
10
|
+
import { open, stat } from "fs/promises";
|
|
11
|
+
import { MIMEMap } from "./mime.js";
|
|
12
|
+
const abortedReturn = { code: 0, header: {}, data: null };
|
|
13
|
+
export const handleRef = {
|
|
14
|
+
value: async () => ({ code: 404, header: {}, data: null }),
|
|
15
|
+
};
|
|
16
|
+
export async function parseInstancesConfig(instances) {
|
|
17
|
+
handleRef.value = handle;
|
|
18
|
+
const list = await Promise.all(instances.map(__assignType(async (i) => {
|
|
19
|
+
if ("type" in i || "package" in i) {
|
|
20
|
+
return await loadPackage(i);
|
|
21
|
+
}
|
|
22
|
+
return i;
|
|
23
|
+
}, ['i', () => __ΩResolvedServerInstance, '', 'P"2!n"`/#'])));
|
|
24
|
+
const handles = list.filter(__assignType((i) => i, ['i', '', 'P"2!"/"']));
|
|
25
|
+
async function handle(prop) {
|
|
26
|
+
const { url, method, signal, appName } = prop;
|
|
27
|
+
const instance = handles.find(appName
|
|
28
|
+
? __assignType((i) => i.name === appName, ['i', '', 'P"2!"/"']) : __assignType((i) => {
|
|
29
|
+
if (i.matchRequest.host && !i.matchRequest.host.test(url.host))
|
|
30
|
+
return false;
|
|
31
|
+
if (i.matchRequest.prefix) {
|
|
32
|
+
const p = i.matchRequest.prefix.exec(url.pathname);
|
|
33
|
+
if (!p)
|
|
34
|
+
return false;
|
|
35
|
+
prop.context.prefix = p[0];
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
prop.context.prefix = "/";
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
}, ['i', '', 'P"2!"/"']));
|
|
42
|
+
if (instance) {
|
|
43
|
+
if (method === "GET" &&
|
|
44
|
+
!url.pathname.includes("./") &&
|
|
45
|
+
instance.staticFilePath) {
|
|
46
|
+
const path = join(instance.staticFilePath, url.pathname);
|
|
47
|
+
try {
|
|
48
|
+
const s = await stat(path);
|
|
49
|
+
if (s.isFile()) {
|
|
50
|
+
const handle = await open(path, "r");
|
|
51
|
+
const stream = handle.createReadStream();
|
|
52
|
+
stream.on("end", () => handle.close());
|
|
53
|
+
return {
|
|
54
|
+
code: 200,
|
|
55
|
+
header: {
|
|
56
|
+
"content-type": MIMEMap[extname(path).substring(1)] ||
|
|
57
|
+
"application/octet-stream",
|
|
58
|
+
},
|
|
59
|
+
data: stream,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch { }
|
|
64
|
+
}
|
|
65
|
+
if (signal.aborted)
|
|
66
|
+
return abortedReturn;
|
|
67
|
+
try {
|
|
68
|
+
return await instance.onRequest(prop);
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
console.warn(e);
|
|
72
|
+
return { code: 500, header: {}, data: null };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return { code: 404, header: {}, data: null };
|
|
76
|
+
}
|
|
77
|
+
handle.__type = [() => __ΩRequestProp, 'prop', () => __ΩResponseData, 'handle', 'Pn!2"n#`/$'];
|
|
78
|
+
return handle;
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=parse-instances-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-instances-config.js","sourceRoot":"","sources":["../src/parse-instances-config.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;;oGAMjD,kBAAkB;AACzB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,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H,CAAC;gBACF,CAAC;gBAAC,MAAM,CAAC,CAAA,CAAC;YACX,CAAC;YACD,IAAI,MAAM,CAAC,OAAO;gBAAE,OAAO,aAAa,CAAC;YACzC,IAAI,CAAC;gBACJ,OAAO,MAAM,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACvC,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBAChB,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC9C,CAAC;QACF,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC9C,CAAC;;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
export const MethodToCode = {
|
|
6
|
+
GET: 1,
|
|
7
|
+
POST: 2,
|
|
8
|
+
PUT: 3,
|
|
9
|
+
DELETE: 4,
|
|
10
|
+
OPTION: 5,
|
|
11
|
+
WS: 11,
|
|
12
|
+
};
|
|
13
|
+
export const MethodCodeToMethod = Object.fromEntries(Object.entries(MethodToCode).map(__assignType(([k, v]) => [v, k], ['param0', '', 'P"2!"/"'])));
|
|
14
|
+
const __ΩMessageType = ['NewRequest', () => 11, 'StartResponse', () => 21, 'MessageType', 'PC!>"C#>$Bw%'];
|
|
15
|
+
export { __ΩMessageType as __ΩMessageType };
|
|
16
|
+
export var MessageType;
|
|
17
|
+
(function (MessageType) {
|
|
18
|
+
MessageType[MessageType["NewRequest"] = 11] = "NewRequest";
|
|
19
|
+
MessageType[MessageType["StartResponse"] = 21] = "StartResponse";
|
|
20
|
+
})(MessageType || (MessageType = {}));
|
|
21
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../src/remote-call/const.ts"],"names":[],"mappings":";;;;AAEA,MAAM,CAAC,MAAM,YAAY,GAA2B;IACnD,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,EAAE,EAAE,EAAE;CACN,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,WAAW,CACnD,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,cAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,6BAAC,CACP,CAAC;;;AAC/C,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACtB,0DAAe,CAAA;IACf,gEAAkB,CAAA;AACnB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
import { Readable } from "node:stream";
|
|
6
|
+
import { MessageType, MethodCodeToMethod, MethodToCode } from "./const.js";
|
|
7
|
+
import { createMessage, readMessage } from "./utile/remote-message/message.js";
|
|
8
|
+
const __ΩIConnection = ['readable', 'writable', 'signal', '', 'abort', 'IConnection', 'P!4!!4"!4#P$/$4%Mw&y'];
|
|
9
|
+
export class RemoteCallClient {
|
|
10
|
+
async onConnection({ readable, writable, signal }) {
|
|
11
|
+
try {
|
|
12
|
+
const reader = readable.getReader();
|
|
13
|
+
const requestHeader = await reader.read();
|
|
14
|
+
reader.releaseLock();
|
|
15
|
+
if (!requestHeader.value) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const header = readMessage(MessageType.NewRequest, requestHeader.value);
|
|
19
|
+
const data = await this.handleRequest({
|
|
20
|
+
...header,
|
|
21
|
+
appName: header.appName || undefined,
|
|
22
|
+
url: new URL(header.path),
|
|
23
|
+
method: MethodCodeToMethod[header.methodCode],
|
|
24
|
+
body: readable,
|
|
25
|
+
signal,
|
|
26
|
+
}).catch(__assignType((error) => {
|
|
27
|
+
console.error("fail to handle request:", error);
|
|
28
|
+
return { data: null, code: 500, header: {} };
|
|
29
|
+
}, ['error', '', 'P"2!"/"']));
|
|
30
|
+
const writer = writable.getWriter();
|
|
31
|
+
await writer.write(createMessage(MessageType.StartResponse, data));
|
|
32
|
+
if (data.data) {
|
|
33
|
+
writer.releaseLock();
|
|
34
|
+
(data.data instanceof Readable
|
|
35
|
+
? Readable.toWeb(data.data)
|
|
36
|
+
: data.data).pipeTo(writable);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
writer.close();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
console.error(e);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async onRequest({ method, url, header, context, body, signal, appName = "", ip, port }) {
|
|
47
|
+
const { readable, writable, abort } = await this.createConnection();
|
|
48
|
+
signal.addEventListener("abort", __assignType((ev) => {
|
|
49
|
+
abort();
|
|
50
|
+
}, ['ev', '', 'P"2!"/"']));
|
|
51
|
+
const writer = writable.getWriter();
|
|
52
|
+
await writer.write(createMessage(MessageType.NewRequest, {
|
|
53
|
+
methodCode: MethodToCode[method],
|
|
54
|
+
path: url.toString(),
|
|
55
|
+
header,
|
|
56
|
+
context,
|
|
57
|
+
appName,
|
|
58
|
+
ip,
|
|
59
|
+
port,
|
|
60
|
+
}));
|
|
61
|
+
writer.releaseLock();
|
|
62
|
+
body.pipeTo(writable);
|
|
63
|
+
const reader = readable.getReader();
|
|
64
|
+
const responseHeader = await reader.read();
|
|
65
|
+
if (!responseHeader.value)
|
|
66
|
+
throw new Error("no response header return");
|
|
67
|
+
reader.releaseLock();
|
|
68
|
+
const message = readMessage(MessageType.StartResponse, responseHeader.value);
|
|
69
|
+
return {
|
|
70
|
+
...message,
|
|
71
|
+
data: readable,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static __type = [() => __ΩIConnection, 'param0', 'onConnection', 'RequestProp', 'prop', 'ResponseData', 'handleRequest', () => __ΩIConnection, () => __ΩIConnection, 'createConnection', 'onRequest', 'RemoteCallClient', 'Pn!2""0#P"w$2%"w&`0\'=PPn(n)`J0*=P"w$2""0+5w,'];
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=remote-call-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote-call-client.js","sourceRoot":"","sources":["../../src/remote-call/remote-call-client.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;;AAU/E,MAAM,OAAgB,gBAAgB;IACrC,KAAK,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAe;QAC7D,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;YACpC,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC1C,MAAM,CAAC,WAAW,EAAE,CAAC;YACrB,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;gBAC1B,OAAO;YACR,CAAC;YACD,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,CAAC,UAAU,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC;YACxE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC;gBACrC,GAAG,MAAM;gBACT,OA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AAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACpE,MAAM,CAAC,gBAAgB,CAAC,OAAO,eAAE,CAAC,EAAE,EAAE,EAAE;YACvC,KAAK,EAAE,CAAC;QACT,CAAC,yBAAC,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,MAAM,CAAC,KAAK,CACjB,aAAa,CAAC,WAAW,CAAC,UAAU,EAAE;YACrC,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC;YAChC,IAAI,EAAE,GAAG,CAAC,QAAQ,EAAE;YACpB,MAAM;YACN,OAAO;YACP,OAAO;YACP,EAAE;YACF,IAAI;SACJ,CAAC,CACF,CAAC;QACF,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtB,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;QACpC,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,cAAc,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACxE,MAAM,CAAC,WAAW,EAAE,CAAC;QACrB,MAAM,OAAO,GAAG,WAAW,CAC1B,WAAW,CAAC,aAAa,EACzB,cAAc,CAAC,KAAK,CACpB,CAAC;QACF,OAAO;YACN,GAAG,OAAO;YACV,IAAI,EAAE,QAAQ;SACd,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
messagePortToConnection.__type = ['port', 'debugName', 'messagePortToConnection', 'P!2!&2""/#'];
|
|
6
|
+
const Ωt0 = ['$'];
|
|
7
|
+
const Ωt1 = ['W'];
|
|
8
|
+
const Ωt2 = ['W'];
|
|
9
|
+
import { isMarkedAsUntransferable } from "node:worker_threads";
|
|
10
|
+
const __ΩMessageType = ['Message', () => 1, 'ReadyToRead', () => 2, 'WriteClose', () => 3, 'WriteAbort', () => 4, 'ReadCancel', () => 5, 'AbortSignal', () => 6, 'MessageType', 'PC!>"C#>$C%>&C\'>(C)>*C+>,Bw-'];
|
|
11
|
+
var MessageType;
|
|
12
|
+
(function (MessageType) {
|
|
13
|
+
MessageType[MessageType["Message"] = 1] = "Message";
|
|
14
|
+
MessageType[MessageType["ReadyToRead"] = 2] = "ReadyToRead";
|
|
15
|
+
MessageType[MessageType["WriteClose"] = 3] = "WriteClose";
|
|
16
|
+
MessageType[MessageType["WriteAbort"] = 4] = "WriteAbort";
|
|
17
|
+
MessageType[MessageType["ReadCancel"] = 5] = "ReadCancel";
|
|
18
|
+
MessageType[MessageType["AbortSignal"] = 6] = "AbortSignal";
|
|
19
|
+
})(MessageType || (MessageType = {}));
|
|
20
|
+
const __ΩStatus = ['Open', 'Close', 'Abort', 'Status', 'PC!C"C#Bw$'];
|
|
21
|
+
var Status;
|
|
22
|
+
(function (Status) {
|
|
23
|
+
Status[Status["Open"] = 0] = "Open";
|
|
24
|
+
Status[Status["Close"] = 1] = "Close";
|
|
25
|
+
Status[Status["Abort"] = 2] = "Abort";
|
|
26
|
+
})(Status || (Status = {}));
|
|
27
|
+
export function messagePortToConnection(port, debugName) {
|
|
28
|
+
const abortController = new AbortController();
|
|
29
|
+
let writeEnd = false;
|
|
30
|
+
let remoteEnd = false;
|
|
31
|
+
function checkEnd() {
|
|
32
|
+
if (writeEnd && remoteEnd) {
|
|
33
|
+
port.removeEventListener("message", messageHandle);
|
|
34
|
+
port.close();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
checkEnd.__type = ['checkEnd', 'P"/!'];
|
|
38
|
+
let tReady = false;
|
|
39
|
+
let allowWriteCallback;
|
|
40
|
+
const writable = (WritableStream.Ω = [Ωt1], new WritableStream({
|
|
41
|
+
abort: __assignType(function abort(reason) {
|
|
42
|
+
writeEnd = true;
|
|
43
|
+
if (!(reason instanceof ReadableCancel)) {
|
|
44
|
+
port.postMessage({ type: MessageType.WriteAbort });
|
|
45
|
+
}
|
|
46
|
+
checkEnd();
|
|
47
|
+
}, ['reason', 'abort', 'P"2!"/"']),
|
|
48
|
+
close: __assignType(function close() {
|
|
49
|
+
writeEnd = true;
|
|
50
|
+
port.postMessage({ type: MessageType.WriteClose });
|
|
51
|
+
checkEnd();
|
|
52
|
+
}, ['close', 'P"/!']),
|
|
53
|
+
async write(data) {
|
|
54
|
+
if (!tReady) {
|
|
55
|
+
await (Promise.Ω = [Ωt0], new Promise(__assignType((r) => (allowWriteCallback = r), ['r', '', 'P"2!"/"'])));
|
|
56
|
+
}
|
|
57
|
+
port.postMessage({ type: MessageType.Message, data }, data.buffer && !isMarkedAsUntransferable(data.buffer)
|
|
58
|
+
? [data.buffer]
|
|
59
|
+
: []);
|
|
60
|
+
tReady = false;
|
|
61
|
+
},
|
|
62
|
+
}));
|
|
63
|
+
let dataCallback;
|
|
64
|
+
let remoteWriteableStatus = Status.Open;
|
|
65
|
+
function checkRemote(r, reject) {
|
|
66
|
+
switch (remoteWriteableStatus) {
|
|
67
|
+
case Status.Close:
|
|
68
|
+
r.close();
|
|
69
|
+
return true;
|
|
70
|
+
case Status.Abort:
|
|
71
|
+
if (reject)
|
|
72
|
+
reject(new WriteableAbort());
|
|
73
|
+
else
|
|
74
|
+
throw new WriteableAbort();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
checkRemote.__type = ['r', 'd', '', 'reject', 'checkRemote', 'P!2!P"2"$/#2$8"/%'];
|
|
78
|
+
const readable = (ReadableStream.Ω = [Ωt2], new ReadableStream({
|
|
79
|
+
cancel: __assignType(function cancel() {
|
|
80
|
+
port.postMessage({ type: MessageType.ReadCancel });
|
|
81
|
+
}, ['cancel', 'P"/!']),
|
|
82
|
+
pull(controller) {
|
|
83
|
+
if (checkRemote(controller))
|
|
84
|
+
return;
|
|
85
|
+
return new Promise(__assignType((resolve, reject) => {
|
|
86
|
+
port.postMessage({ type: MessageType.ReadyToRead });
|
|
87
|
+
dataCallback = __assignType((data) => {
|
|
88
|
+
if (checkRemote(controller, reject) || !data)
|
|
89
|
+
return;
|
|
90
|
+
controller.enqueue(data);
|
|
91
|
+
resolve();
|
|
92
|
+
dataCallback = undefined;
|
|
93
|
+
}, ['data', '', 'P"2!"/"']);
|
|
94
|
+
}, ['resolve', 'reject', '', 'P"2!"2""/#']));
|
|
95
|
+
},
|
|
96
|
+
}));
|
|
97
|
+
function messageHandle(ev) {
|
|
98
|
+
switch (ev.data.type) {
|
|
99
|
+
case MessageType.Message:
|
|
100
|
+
dataCallback?.(ev.data.data);
|
|
101
|
+
break;
|
|
102
|
+
case MessageType.ReadyToRead:
|
|
103
|
+
tReady = true;
|
|
104
|
+
allowWriteCallback?.();
|
|
105
|
+
break;
|
|
106
|
+
case MessageType.WriteClose:
|
|
107
|
+
remoteEnd = true;
|
|
108
|
+
checkEnd();
|
|
109
|
+
remoteWriteableStatus = Status.Close;
|
|
110
|
+
dataCallback?.(null);
|
|
111
|
+
break;
|
|
112
|
+
case MessageType.WriteAbort:
|
|
113
|
+
remoteEnd = true;
|
|
114
|
+
checkEnd();
|
|
115
|
+
remoteWriteableStatus = Status.Abort;
|
|
116
|
+
dataCallback?.(null);
|
|
117
|
+
break;
|
|
118
|
+
case MessageType.ReadCancel:
|
|
119
|
+
writable.abort(new ReadableCancel());
|
|
120
|
+
writeEnd = true;
|
|
121
|
+
remoteEnd = true;
|
|
122
|
+
checkEnd();
|
|
123
|
+
break;
|
|
124
|
+
case MessageType.AbortSignal:
|
|
125
|
+
abortController.abort();
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
messageHandle.__type = ['ev', 'messageHandle', 'P!2!"/"'];
|
|
130
|
+
port.addEventListener("message", messageHandle);
|
|
131
|
+
port.start();
|
|
132
|
+
return {
|
|
133
|
+
writable,
|
|
134
|
+
readable,
|
|
135
|
+
signal: abortController.signal,
|
|
136
|
+
abort: __assignType(function abort() {
|
|
137
|
+
port.postMessage({ type: MessageType.AbortSignal });
|
|
138
|
+
writeEnd = true;
|
|
139
|
+
remoteEnd = true;
|
|
140
|
+
checkEnd();
|
|
141
|
+
}, ['abort', 'P"/!']),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
class ReadableCancel extends Error {
|
|
145
|
+
static __type = [() => Error, 'ReadableCancel', 'P7!5w"'];
|
|
146
|
+
}
|
|
147
|
+
class WriteableAbort extends Error {
|
|
148
|
+
static __type = [() => Error, 'WriteableAbort', 'P7!5w"'];
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=message-port-to-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-port-to-connection.js","sourceRoot":"","sources":["../../../src/remote-call/utile/message-port-to-connection.ts"],"names":[],"mappings":";;;;;;;;AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;;AAE/D,IAAK,WAOJ;AAPD,WAAK,WAAW;IACf,mDAAW,CAAA;IACX,2DAAe,CAAA;IACf,yDAAc,CAAA;IACd,yDAAc,CAAA;IACd,yDAAc,CAAA;IACd,2DAAe,CAAA;AAChB,CAAC,EAPI,WAAW,KAAX,WAAW,QAOf;;AACD,IAAK,MAIJ;AAJD,WAAK,MAAM;IACV,mCAAI,CAAA;IACJ,qCAAK,CAAA;IACL,qCAAK,CAAA;AACN,CAAC,EAJI,MAAM,KAAN,MAAM,QAIV;AACD,MAAM,UAAU,uBAAuB,CAAC,IAAiB,EAAE,SAAiB;IAC3E,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;IAC9C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,SAAS,QAAQ;QAChB,IAAI,QAAQ,IAAI,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,mBAAmB,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;AAClC,MAAM,cAAe,SAAQ,KAAK"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
buildMessage.__type = ['messageData', 'buildMessage', 'P"2!"/"'];
|
|
6
|
+
import { Buffer } from "node:buffer";
|
|
7
|
+
/*@ts-ignore*/
|
|
8
|
+
import { __ΩValueHandle } from "./value-handle.js";
|
|
9
|
+
const __ΩDataProp = ['T', 'value', () => __ΩValueHandle, 'handle', 'DataProp', 'b!Pe"!I"e"!o#"I$G9w%y'];
|
|
10
|
+
export { __ΩDataProp as __ΩDataProp };
|
|
11
|
+
export class Builder {
|
|
12
|
+
buff;
|
|
13
|
+
offset = 0;
|
|
14
|
+
constructor(length) {
|
|
15
|
+
this.buff = Buffer.alloc(length);
|
|
16
|
+
}
|
|
17
|
+
write(data) {
|
|
18
|
+
this.buff[this.offset++] = data;
|
|
19
|
+
}
|
|
20
|
+
static __type = ['buff', 'offset', function () { return 0; }, 'length', 'constructor', 'data', 'write', 'Builder', '!3!\'3">#P\'2$"0%P\'2&"0\'5w('];
|
|
21
|
+
}
|
|
22
|
+
export function buildMessage(messageData) {
|
|
23
|
+
const buildPre = messageData.map(__assignType((i) => i[1].build(i[0]), ['i', '', 'P"2!"/"']));
|
|
24
|
+
const length = buildPre.reduce(__assignType((acc, pre) => acc + pre.length, ['acc', 'pre', '', 'P"2!"2""/#']), 0);
|
|
25
|
+
// const message = new Uint8Array(length);
|
|
26
|
+
const builder = new Builder(length);
|
|
27
|
+
buildPre.forEach(__assignType((i) => i.fill(builder), ['i', '', 'P"2!"/"']));
|
|
28
|
+
return builder.buff;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../../src/remote-call/utile/remote-message/build.ts"],"names":[],"mappings":";;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;;+BACT,mBAAmB;;;AAI/C,MAAM,OAAO,OAAO;IACnB,IAAI,CAAS;IACb,MAAM,GAAG,CAAC,CAAC;IACX,YAAY,MAAc;QACzB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;IACD,KAAK,CAAC,IAAY;QACjB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;IACjC,CAAC;4DANQ,CAAC;;AASX,MAAM,UAAU,YAAY,CAC3B,WAAc;IAEd,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,cAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,wBAAC,CAAC;IAC1D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,cAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,qCAAE,CAAC,CAAC,CAAC;IAClE,0CAA0C;IAC1C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,QAAQ,CAAC,OAAO,cAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAC,CAAC;IACzC,OAAO,OAAO,CAAC,IAAI,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
import { VarCharHandle } from "./var-char-handle.js";
|
|
6
|
+
export const JSONHandle = {
|
|
7
|
+
build: __assignType(function build(value) {
|
|
8
|
+
const v = JSON.stringify(value);
|
|
9
|
+
return VarCharHandle.build(v);
|
|
10
|
+
}, ['value', 'build', 'P"2!"/"']),
|
|
11
|
+
read: __assignType(function (reader) {
|
|
12
|
+
return JSON.parse(VarCharHandle.read(reader));
|
|
13
|
+
}, ['reader', '', 'P"2!"/"']),
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=json-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json-handle.js","sourceRoot":"","sources":["../../../../src/remote-call/utile/remote-message/json-handle.ts"],"names":[],"mappings":";;;;AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,CAAC,MAAM,UAAU,GAAqB;IAC3C,KAAK,wBAAL,KAAK,CAAC,KAAK;QACV,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChC,OAAO,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,IAAI,eAAE,UAAU,MAAM;QACrB,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/C,CAAC,4BAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
createMessage.__type = ['type', () => __ΩMessageDataType, 'v', 'createMessage', 'P"2!"o""2#"/$'];
|
|
6
|
+
readMessage.__type = ['type', 'message', () => __ΩMessageDataType, 'readMessage', 'P"2!W2""o#"/$'];
|
|
7
|
+
import { MessageType } from "../../const.js";
|
|
8
|
+
import { buildMessage } from "./build.js";
|
|
9
|
+
import { JSONHandle } from "./json-handle.js";
|
|
10
|
+
import { Reader } from "./reader.js";
|
|
11
|
+
import { UInt8Handle } from "./uint8-handle.js";
|
|
12
|
+
/*@ts-ignore*/
|
|
13
|
+
import { __ΩValueHandle } from "./value-handle.js";
|
|
14
|
+
import { VarCharHandle } from "./var-char-handle.js";
|
|
15
|
+
import { VarUIntHandle } from "./var-uint-handle.js";
|
|
16
|
+
const AllTypes = {
|
|
17
|
+
[MessageType.NewRequest]: [
|
|
18
|
+
{ name: "ip", handle: VarCharHandle },
|
|
19
|
+
{ name: "port", handle: VarUIntHandle },
|
|
20
|
+
{ name: "methodCode", handle: UInt8Handle },
|
|
21
|
+
{ name: "appName", handle: VarCharHandle },
|
|
22
|
+
{ name: "path", handle: VarCharHandle },
|
|
23
|
+
{ name: "header", handle: JSONHandle },
|
|
24
|
+
{ name: "context", handle: JSONHandle },
|
|
25
|
+
],
|
|
26
|
+
[MessageType.StartResponse]: [
|
|
27
|
+
{ name: "code", handle: VarUIntHandle },
|
|
28
|
+
{ name: "header", handle: JSONHandle },
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
const __ΩA = ['T', () => AllTypes, 'A', 'b!i"e!!fw#y'];
|
|
32
|
+
const __ΩMessageDataType = ['T', () => __ΩA, () => __ΩA, 'name', () => __ΩValueHandle, 'handle', () => __ΩA, "name", () => __ΩA, 'MessageDataType', 'l[e$!RPde&!o\'"e%!f.(fN#!R!RPde$!o#"e#!fP&4$h"!o%"4&Mqk\':QRb!Pde"!o""gN<!e!!o)"gfw*y'];
|
|
33
|
+
export function createMessage(type, v) {
|
|
34
|
+
const config = AllTypes[type];
|
|
35
|
+
return buildMessage(config.map(__assignType((i) => [v[i.name], i.handle], ['i', '', 'P"2!"/"'])));
|
|
36
|
+
}
|
|
37
|
+
export function readMessage(type, message) {
|
|
38
|
+
const reader = new Reader(message);
|
|
39
|
+
const data = {};
|
|
40
|
+
AllTypes[type]?.forEach(__assignType((i) => {
|
|
41
|
+
data[i.name] = i.handle.read(reader);
|
|
42
|
+
}, ['i', '', 'P"2!"/"']));
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/remote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AM,CAAC,GAAG,cAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAE,CAAS,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAU,wBAAC,CAC1D,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAC1B,IAAO,EACP,OAAmB;IAEnB,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,MAAM,IAAI,GAAQ,EAAE,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,cAAC,CAAC,CAAC,EAAE,EAAE;QAC7B,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,wBAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
export class Reader {
|
|
6
|
+
arr;
|
|
7
|
+
pos;
|
|
8
|
+
constructor(arr, pos = 0) {
|
|
9
|
+
this.arr = arr;
|
|
10
|
+
this.pos = pos;
|
|
11
|
+
}
|
|
12
|
+
static reader(arr, handle, pos = 0) {
|
|
13
|
+
const reader = new Reader(arr, pos);
|
|
14
|
+
return handle.map(__assignType(i => i.read(reader), ['i', '', 'P"2!"/"']));
|
|
15
|
+
}
|
|
16
|
+
static __type = ['arr', 'pos', 'constructor', 'handle', 'reader', 'Reader', 'PW2!:"2":"0#PW2!"2$"2""0%s5w&'];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reader.js","sourceRoot":"","sources":["../../../../src/remote-call/utile/remote-message/reader.ts"],"names":[],"mappings":";;;;AAEA,MAAM,OAAO,MAAM;IAEV;IACA;IAFR,YACQ,GAAe,EACf,MAAM,CAAC;QADP,QAAG,GAAH,GAAG,CAAY;QACf,QAAG,GAAH,GAAG,CAAI;IACZ,CAAC;IACJ,MAAM,CAAC,MAAM,CACZ,GAAe,EACf,MAAS,EACT,GAAG,GAAG,CAAC;QAEL,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,GAAG,EAAC,GAAG,CAAC,CAAC;QACrC,OAAO,MAAM,CAAC,GAAG,cAAC,CAAC,CAAA,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAC,CAAA;IACtC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
import { VarUIntHandle } from "./var-uint-handle.js";
|
|
6
|
+
export const UInt8ArrayHandle = {
|
|
7
|
+
build(value) {
|
|
8
|
+
const lFlag = VarUIntHandle.build(value.length);
|
|
9
|
+
const length = lFlag.length + value.length;
|
|
10
|
+
return {
|
|
11
|
+
length,
|
|
12
|
+
fill: __assignType(function fill(builder) {
|
|
13
|
+
lFlag.fill(builder);
|
|
14
|
+
builder.buff.set(value, builder.offset);
|
|
15
|
+
builder.offset += value.length;
|
|
16
|
+
}, ['builder', 'fill', 'P"2!"/"']),
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
read: __assignType(function (reader) {
|
|
20
|
+
const length = VarUIntHandle.read(reader);
|
|
21
|
+
const end = reader.pos + length;
|
|
22
|
+
const res = reader.arr.subarray(reader.pos, end);
|
|
23
|
+
reader.pos = end;
|
|
24
|
+
return res;
|
|
25
|
+
}, ['reader', '', 'P"2!"/"']),
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=uint8-array-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uint8-array-handle.js","sourceRoot":"","sources":["../../../../src/remote-call/utile/remote-message/uint8-array-handle.ts"],"names":[],"mappings":";;;;AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,MAAM,CAAC,MAAM,gBAAgB,GAA4B;IACxD,KAAK,CAAC,KAAK;QACV,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3C,OAAO;YACN,MAAM;YACN,IAAI,wBAAJ,IAAI,CAAC,OAAO;gBACX,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACpB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;gBACvC,OAAO,CAAC,MAAM,IAAE,KAAK,CAAC,MAAM,CAAC;YAC9B,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,eAAE,UAAU,MAAM;QACpB,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC;QAChC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;QAChD,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC;QACjB,OAAO,GAAG,CAAC;IACb,CAAC,4BAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function __assignType(fn, args) {
|
|
2
|
+
fn.__type = args;
|
|
3
|
+
return fn;
|
|
4
|
+
}
|
|
5
|
+
import { Reader } from "./reader.js";
|
|
6
|
+
export const UInt8Handle = {
|
|
7
|
+
build(value) {
|
|
8
|
+
return {
|
|
9
|
+
length: 1,
|
|
10
|
+
fill: __assignType(function fill(builder) {
|
|
11
|
+
builder.buff[builder.offset++] = value;
|
|
12
|
+
}, ['builder', 'fill', 'P"2!"/"']),
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
read: __assignType(function read(reader) {
|
|
16
|
+
return reader.arr[reader.pos++];
|
|
17
|
+
}, [() => Reader, 'reader', 'read', 'PP7!2""/#']),
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=uint8-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uint8-handle.js","sourceRoot":"","sources":["../../../../src/remote-call/utile/remote-message/uint8-handle.ts"],"names":[],"mappings":";;;;AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,MAAM,WAAW,GAAwB;IAC/C,KAAK,CAAC,KAAK;QACV,OAAO;YACN,MAAM,EAAE,CAAC;YACT,IAAI,wBAAJ,IAAI,CAAC,OAAO;gBACX,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,KAAK,CAAC;YACxC,CAAC;SACD,CAAC;IACH,CAAC;IACD,IAAI,wBAAJ,IAAI,CAAC,MAAc;QAClB,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,CAAC;CACD,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Builder } from "./build.js";
|
|
2
|
+
import { Reader } from "./reader.js";
|
|
3
|
+
const __ΩValueHandle = ['T', 'value', 'length', () => Builder, 'builder', 'fill', 'build', () => Reader, 'reader', 'read', 'ValueHandle', 'b!PPe#!2"P\'4#9PP7$2%$1&M1\'PP7(2)e#!1*Mw+y'];
|
|
4
|
+
export { __ΩValueHandle as __ΩValueHandle };
|
|
5
|
+
//# sourceMappingURL=value-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-handle.js","sourceRoot":"","sources":["../../../../src/remote-call/utile/remote-message/value-handle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|