Removed all traces of sockets, real-time collab and other stuff.

This commit is contained in:
Zef Hemel
2022-03-31 14:28:07 +02:00
parent 4525d60964
commit 859657f8b8
41 changed files with 796 additions and 1691 deletions
+2
View File
@@ -9,6 +9,7 @@ export class Plug<HookT> {
readonly runtimeEnv: RuntimeEnvironment;
grantedPermissions: string[] = [];
name: string;
version: number;
constructor(
system: System<HookT>,
@@ -19,6 +20,7 @@ export class Plug<HookT> {
this.name = name;
this.sandbox = sandboxFactory(this);
this.runtimeEnv = system.runtimeEnv;
this.version = new Date().getTime();
}
async load(manifest: Manifest<HookT>) {
+7 -3
View File
@@ -1,14 +1,18 @@
import { SysCallMapping } from "../system";
import { SyscallContext, SysCallMapping } from "../system";
export function transportSyscalls(
names: string[],
transportCall: (name: string, ...args: any[]) => Promise<any>
transportCall: (
ctx: SyscallContext,
name: string,
...args: any[]
) => Promise<any>
): SysCallMapping {
let syscalls: SysCallMapping = {};
for (let name of names) {
syscalls[name] = (ctx, ...args: any[]) => {
return transportCall(name, ...args);
return transportCall(ctx, name, ...args);
};
}
+2 -2
View File
@@ -14,8 +14,8 @@ export type SystemEvents<HookT> = {
plugUnloaded: (name: string, plug: Plug<HookT>) => void;
};
type SyscallContext = {
plug: Plug<any> | null;
export type SyscallContext = {
plug: Plug<any>;
};
type SyscallSignature = (