@unyt/datex 0.0.7 → 0.0.9
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/esm/_dnt.shims.d.ts +1 -27
- package/esm/_dnt.shims.d.ts.map +1 -1
- package/esm/_dnt.shims.js +1 -31
- package/esm/datex-core/datex_core_js.internal.d.ts +49 -40
- package/esm/datex-core/datex_core_js.internal.d.ts.map +1 -1
- package/esm/datex-core/datex_core_js.internal.js +143 -125
- package/esm/datex-core/datex_core_js.js +13 -16
- package/esm/datex-core/datex_core_js.wasm +0 -0
- package/esm/datex-core/wasm_url.node.js +1 -0
- package/esm/datex-core.d.ts +6 -0
- package/esm/datex-core.d.ts.map +1 -1
- package/esm/datex-core.js +6 -0
- package/esm/default.d.ts +11 -0
- package/esm/default.d.ts.map +1 -0
- package/esm/default.js +22 -0
- package/esm/deno.json +22 -6
- package/esm/dif/builders.d.ts +5 -0
- package/esm/dif/builders.d.ts.map +1 -1
- package/esm/dif/builders.js +5 -0
- package/esm/dif/core.d.ts +44 -0
- package/esm/dif/core.d.ts.map +1 -0
- package/esm/dif/core.js +56 -0
- package/esm/dif/definitions.d.ts +43 -36
- package/esm/dif/definitions.d.ts.map +1 -1
- package/esm/dif/definitions.js +14 -51
- package/esm/dif/dif-handler.d.ts +17 -0
- package/esm/dif/dif-handler.d.ts.map +1 -1
- package/esm/dif/dif-handler.js +22 -5
- package/esm/dif/display.d.ts +23 -0
- package/esm/dif/display.d.ts.map +1 -1
- package/esm/dif/display.js +25 -4
- package/esm/dif/mod.d.ts +5 -0
- package/esm/dif/mod.d.ts.map +1 -0
- package/esm/dif/mod.js +4 -0
- package/esm/mod.d.ts +12 -5
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +10 -23
- package/esm/network/com-hub.d.ts +30 -0
- package/esm/network/com-hub.d.ts.map +1 -1
- package/esm/network/com-hub.js +32 -0
- package/esm/network/com-interface.d.ts +18 -0
- package/esm/network/com-interface.d.ts.map +1 -1
- package/esm/network/com-interface.js +13 -0
- package/esm/network/interface-impls/base.d.ts +28 -1
- package/esm/network/interface-impls/base.d.ts.map +1 -1
- package/esm/network/interface-impls/base.js +30 -4
- package/esm/network/interface-impls/websocket-client.d.ts +3 -1
- package/esm/network/interface-impls/websocket-client.d.ts.map +1 -1
- package/esm/network/interface-impls/websocket-client.js +3 -1
- package/esm/network/mod.d.ts +9 -0
- package/esm/network/mod.d.ts.map +1 -0
- package/esm/network/mod.js +8 -0
- package/esm/refs/ref.d.ts +3 -0
- package/esm/refs/ref.d.ts.map +1 -1
- package/esm/refs/ref.js +3 -0
- package/esm/runtime/runtime.d.ts +55 -5
- package/esm/runtime/runtime.d.ts.map +1 -1
- package/esm/runtime/runtime.js +49 -3
- package/esm/runtime/special-core-types.d.ts +18 -2
- package/esm/runtime/special-core-types.d.ts.map +1 -1
- package/esm/runtime/special-core-types.js +19 -3
- package/esm/utils/js-runtime-compat/js-runtime-interface.d.ts +10 -0
- package/esm/utils/js-runtime-compat/js-runtime-interface.d.ts.map +1 -0
- package/esm/utils/js-runtime-compat/js-runtime-interface.js +1 -0
- package/esm/utils/js-runtime-compat/js-runtime.d.ts +18 -0
- package/esm/utils/js-runtime-compat/js-runtime.d.ts.map +1 -0
- package/esm/utils/js-runtime-compat/js-runtime.js +43 -0
- package/esm/utils/js-runtime-compat/runtimes/browser.d.ts +8 -0
- package/esm/utils/js-runtime-compat/runtimes/browser.d.ts.map +1 -0
- package/esm/utils/js-runtime-compat/runtimes/browser.js +22 -0
- package/esm/utils/js-runtime-compat/runtimes/deno.d.ts +8 -0
- package/esm/utils/js-runtime-compat/runtimes/deno.d.ts.map +1 -0
- package/esm/utils/js-runtime-compat/runtimes/deno.js +19 -0
- package/esm/utils/js-runtime-compat/runtimes/node.d.ts +8 -0
- package/esm/utils/js-runtime-compat/runtimes/node.d.ts.map +1 -0
- package/esm/utils/js-runtime-compat/runtimes/node.js +21 -0
- package/package.json +7 -19
- package/esm/_dnt.polyfills.d.ts +0 -101
- package/esm/_dnt.polyfills.d.ts.map +0 -1
- package/esm/_dnt.polyfills.js +0 -127
- package/esm/network/interface-impls/websocket-server-deno.d.ts +0 -9
- package/esm/network/interface-impls/websocket-server-deno.d.ts.map +0 -1
- package/esm/network/interface-impls/websocket-server-deno.js +0 -45
package/esm/_dnt.polyfills.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
-
* but instead of using npm to install additional dependencies,
|
|
4
|
-
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
-
*
|
|
6
|
-
* Note that this code might be imported multiple times
|
|
7
|
-
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
-
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
-
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
-
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
-
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
-
*/
|
|
13
|
-
import { createRequire } from "node:module";
|
|
14
|
-
import { type URL } from "node:url";
|
|
15
|
-
declare global {
|
|
16
|
-
interface ImportMeta {
|
|
17
|
-
/** A string representation of the fully qualified module URL. When the
|
|
18
|
-
* module is loaded locally, the value will be a file URL (e.g.
|
|
19
|
-
* `file:///path/module.ts`).
|
|
20
|
-
*
|
|
21
|
-
* You can also parse the string as a URL to determine more information about
|
|
22
|
-
* how the current module was loaded. For example to determine if a module was
|
|
23
|
-
* local or not:
|
|
24
|
-
*
|
|
25
|
-
* ```ts
|
|
26
|
-
* const url = new URL(import.meta.url);
|
|
27
|
-
* if (url.protocol === "file:") {
|
|
28
|
-
* console.log("this module was loaded locally");
|
|
29
|
-
* }
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
url: string;
|
|
33
|
-
/**
|
|
34
|
-
* A function that returns resolved specifier as if it would be imported
|
|
35
|
-
* using `import(specifier)`.
|
|
36
|
-
*
|
|
37
|
-
* ```ts
|
|
38
|
-
* console.log(import.meta.resolve("./foo.js"));
|
|
39
|
-
* // file:///dev/foo.js
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @param specifier The module specifier to resolve relative to `parent`.
|
|
43
|
-
* @param parent The absolute parent module URL to resolve from.
|
|
44
|
-
* @returns The absolute (`file:`) URL string for the resolved module.
|
|
45
|
-
*/
|
|
46
|
-
resolve(specifier: string, parent?: string | URL | undefined): string;
|
|
47
|
-
/** A flag that indicates if the current module is the main module that was
|
|
48
|
-
* called when starting the program under Deno.
|
|
49
|
-
*
|
|
50
|
-
* ```ts
|
|
51
|
-
* if (import.meta.main) {
|
|
52
|
-
* // this was loaded as the main module, maybe do some bootstrapping
|
|
53
|
-
* }
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
main: boolean;
|
|
57
|
-
/** The absolute path of the current module.
|
|
58
|
-
*
|
|
59
|
-
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
60
|
-
*
|
|
61
|
-
* Example:
|
|
62
|
-
* ```
|
|
63
|
-
* // Unix
|
|
64
|
-
* console.log(import.meta.filename); // /home/alice/my_module.ts
|
|
65
|
-
*
|
|
66
|
-
* // Windows
|
|
67
|
-
* console.log(import.meta.filename); // C:\alice\my_module.ts
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
filename: string;
|
|
71
|
-
/** The absolute path of the directory containing the current module.
|
|
72
|
-
*
|
|
73
|
-
* This property is only provided for local modules (ie. using `file://` URLs).
|
|
74
|
-
*
|
|
75
|
-
* * Example:
|
|
76
|
-
* ```
|
|
77
|
-
* // Unix
|
|
78
|
-
* console.log(import.meta.dirname); // /home/alice
|
|
79
|
-
*
|
|
80
|
-
* // Windows
|
|
81
|
-
* console.log(import.meta.dirname); // C:\alice
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
dirname: string;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
type NodeRequest = ReturnType<typeof createRequire>;
|
|
88
|
-
type NodeModule = NonNullable<NodeRequest["main"]>;
|
|
89
|
-
interface ImportMetaPonyfillCommonjs {
|
|
90
|
-
(require: NodeRequest, module: NodeModule): ImportMeta;
|
|
91
|
-
}
|
|
92
|
-
interface ImportMetaPonyfillEsmodule {
|
|
93
|
-
(importMeta: ImportMeta): ImportMeta;
|
|
94
|
-
}
|
|
95
|
-
interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
|
|
96
|
-
}
|
|
97
|
-
export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
|
|
98
|
-
export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
|
|
99
|
-
export declare let import_meta_ponyfill: ImportMetaPonyfill;
|
|
100
|
-
export {};
|
|
101
|
-
//# sourceMappingURL=_dnt.polyfills.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
|
package/esm/_dnt.polyfills.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
|
|
3
|
-
* but instead of using npm to install additional dependencies,
|
|
4
|
-
* this approach manually consolidates cjs/mjs/d.ts into a single file.
|
|
5
|
-
*
|
|
6
|
-
* Note that this code might be imported multiple times
|
|
7
|
-
* (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
|
|
8
|
-
* or Node.js might dynamically clear the cache and then force a require).
|
|
9
|
-
* Therefore, it's important to avoid redundant writes to global objects.
|
|
10
|
-
* Additionally, consider that commonjs is used alongside esm,
|
|
11
|
-
* so the two ponyfill functions are stored independently in two separate global objects.
|
|
12
|
-
*/
|
|
13
|
-
//@ts-ignore
|
|
14
|
-
import { createRequire } from "node:module";
|
|
15
|
-
//@ts-ignore
|
|
16
|
-
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
17
|
-
//@ts-ignore
|
|
18
|
-
import { dirname } from "node:path";
|
|
19
|
-
const defineGlobalPonyfill = (symbolFor, fn) => {
|
|
20
|
-
if (!Reflect.has(globalThis, Symbol.for(symbolFor))) {
|
|
21
|
-
Object.defineProperty(globalThis, Symbol.for(symbolFor), {
|
|
22
|
-
configurable: true,
|
|
23
|
-
get() {
|
|
24
|
-
return fn;
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
export let import_meta_ponyfill_commonjs = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ??
|
|
30
|
-
(() => {
|
|
31
|
-
const moduleImportMetaWM = new WeakMap();
|
|
32
|
-
return (require, module) => {
|
|
33
|
-
let importMetaCache = moduleImportMetaWM.get(module);
|
|
34
|
-
if (importMetaCache == null) {
|
|
35
|
-
const importMeta = Object.assign(Object.create(null), {
|
|
36
|
-
url: pathToFileURL(module.filename).href,
|
|
37
|
-
main: require.main == module,
|
|
38
|
-
resolve: (specifier, parentURL = importMeta.url) => {
|
|
39
|
-
return pathToFileURL((importMeta.url === parentURL
|
|
40
|
-
? require
|
|
41
|
-
: createRequire(parentURL))
|
|
42
|
-
.resolve(specifier)).href;
|
|
43
|
-
},
|
|
44
|
-
filename: module.filename,
|
|
45
|
-
dirname: module.path,
|
|
46
|
-
});
|
|
47
|
-
moduleImportMetaWM.set(module, importMeta);
|
|
48
|
-
importMetaCache = importMeta;
|
|
49
|
-
}
|
|
50
|
-
return importMetaCache;
|
|
51
|
-
};
|
|
52
|
-
})());
|
|
53
|
-
defineGlobalPonyfill("import-meta-ponyfill-commonjs", import_meta_ponyfill_commonjs);
|
|
54
|
-
export let import_meta_ponyfill_esmodule = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ??
|
|
55
|
-
((importMeta) => {
|
|
56
|
-
const resolveFunStr = String(importMeta.resolve);
|
|
57
|
-
const shimWs = new WeakSet();
|
|
58
|
-
//@ts-ignore
|
|
59
|
-
const mainUrl = ("file:///" + process.argv[1].replace(/\\/g, "/"))
|
|
60
|
-
.replace(/\/{3,}/, "///");
|
|
61
|
-
const commonShim = (importMeta) => {
|
|
62
|
-
if (typeof importMeta.main !== "boolean") {
|
|
63
|
-
importMeta.main = importMeta.url === mainUrl;
|
|
64
|
-
}
|
|
65
|
-
if (typeof importMeta.filename !== "string") {
|
|
66
|
-
importMeta.filename = fileURLToPath(importMeta.url);
|
|
67
|
-
importMeta.dirname = dirname(importMeta.filename);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
if (
|
|
71
|
-
// v16.2.0+, v14.18.0+: Add support for WHATWG URL object to parentURL parameter.
|
|
72
|
-
resolveFunStr === "undefined" ||
|
|
73
|
-
// v20.0.0+, v18.19.0+"" This API now returns a string synchronously instead of a Promise.
|
|
74
|
-
resolveFunStr.startsWith("async")
|
|
75
|
-
// enable by --experimental-import-meta-resolve flag
|
|
76
|
-
) {
|
|
77
|
-
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
78
|
-
if (!shimWs.has(importMeta)) {
|
|
79
|
-
shimWs.add(importMeta);
|
|
80
|
-
const importMetaUrlRequire = {
|
|
81
|
-
url: importMeta.url,
|
|
82
|
-
require: createRequire(importMeta.url),
|
|
83
|
-
};
|
|
84
|
-
importMeta.resolve = function resolve(specifier, parentURL = importMeta.url) {
|
|
85
|
-
return pathToFileURL((importMetaUrlRequire.url === parentURL
|
|
86
|
-
? importMetaUrlRequire.require
|
|
87
|
-
: createRequire(parentURL)).resolve(specifier)).href;
|
|
88
|
-
};
|
|
89
|
-
commonShim(importMeta);
|
|
90
|
-
}
|
|
91
|
-
return importMeta;
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
/// native support
|
|
96
|
-
import_meta_ponyfill_esmodule = (importMeta) => {
|
|
97
|
-
if (!shimWs.has(importMeta)) {
|
|
98
|
-
shimWs.add(importMeta);
|
|
99
|
-
commonShim(importMeta);
|
|
100
|
-
}
|
|
101
|
-
return importMeta;
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
return import_meta_ponyfill_esmodule(importMeta);
|
|
105
|
-
}));
|
|
106
|
-
defineGlobalPonyfill("import-meta-ponyfill-esmodule", import_meta_ponyfill_esmodule);
|
|
107
|
-
export let import_meta_ponyfill = ((...args) => {
|
|
108
|
-
const _MODULE = (() => {
|
|
109
|
-
if (typeof require === "function" && typeof module === "object") {
|
|
110
|
-
return "commonjs";
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// eval("typeof import.meta");
|
|
114
|
-
return "esmodule";
|
|
115
|
-
}
|
|
116
|
-
})();
|
|
117
|
-
if (_MODULE === "commonjs") {
|
|
118
|
-
//@ts-ignore
|
|
119
|
-
import_meta_ponyfill = (r, m) => import_meta_ponyfill_commonjs(r, m);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
//@ts-ignore
|
|
123
|
-
import_meta_ponyfill = (im) => import_meta_ponyfill_esmodule(im);
|
|
124
|
-
}
|
|
125
|
-
//@ts-ignore
|
|
126
|
-
return import_meta_ponyfill(...args);
|
|
127
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "../../_dnt.polyfills.js";
|
|
2
|
-
import { ComInterfaceImpl } from "../com-interface.js";
|
|
3
|
-
import type { WebSocketServerInterfaceSetupData } from "../../datex-core/datex_core_js";
|
|
4
|
-
export declare class WebSockerServerDenoInterfaceImpl extends ComInterfaceImpl<WebSocketServerInterfaceSetupData> {
|
|
5
|
-
#private;
|
|
6
|
-
init(): void;
|
|
7
|
-
cleanup(): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=websocket-server-deno.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket-server-deno.d.ts","sourceRoot":"","sources":["../../../src/network/interface-impls/websocket-server-deno.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAExF,qBAAa,gCACT,SAAQ,gBAAgB,CAAC,iCAAiC,CAAC;;IAGlD,IAAI;IAwBE,OAAO;CAMzB"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _WebSockerServerDenoInterfaceImpl_server;
|
|
13
|
-
import "../../_dnt.polyfills.js";
|
|
14
|
-
import * as dntShim from "../../_dnt.shims.js";
|
|
15
|
-
import { ComInterfaceImpl } from "../com-interface.js";
|
|
16
|
-
import { ComHub } from "../com-hub.js";
|
|
17
|
-
export class WebSockerServerDenoInterfaceImpl extends ComInterfaceImpl {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
_WebSockerServerDenoInterfaceImpl_server.set(this, void 0);
|
|
21
|
-
}
|
|
22
|
-
init() {
|
|
23
|
-
__classPrivateFieldSet(this, _WebSockerServerDenoInterfaceImpl_server, dntShim.Deno.serve({
|
|
24
|
-
port: this.setupData.port,
|
|
25
|
-
}, (req) => {
|
|
26
|
-
if (req.headers.get("upgrade") != "websocket") {
|
|
27
|
-
return new dntShim.Response(null, { status: 501 });
|
|
28
|
-
}
|
|
29
|
-
const { socket, response } = dntShim.Deno.upgradeWebSocket(req);
|
|
30
|
-
if (!this.jsComHub.websocket_server_interface_add_socket(this.uuid, socket)) {
|
|
31
|
-
console.error("Failed to add websocket to server interface");
|
|
32
|
-
return new dntShim.Response("Failed to add websocket to server interface", { status: 500 });
|
|
33
|
-
}
|
|
34
|
-
return response;
|
|
35
|
-
}), "f");
|
|
36
|
-
}
|
|
37
|
-
async cleanup() {
|
|
38
|
-
if (__classPrivateFieldGet(this, _WebSockerServerDenoInterfaceImpl_server, "f")) {
|
|
39
|
-
await __classPrivateFieldGet(this, _WebSockerServerDenoInterfaceImpl_server, "f").shutdown();
|
|
40
|
-
__classPrivateFieldSet(this, _WebSockerServerDenoInterfaceImpl_server, undefined, "f");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
_WebSockerServerDenoInterfaceImpl_server = new WeakMap();
|
|
45
|
-
ComHub.registerInterfaceImpl("websocket-server", WebSockerServerDenoInterfaceImpl);
|