@nodetool-ai/sandbox-runtime 0.0.0-stage → 0.8.9-beta.2
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/README.md +24 -2
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/host-access-gate.d.ts +24 -0
- package/dist/host-access-gate.d.ts.map +1 -0
- package/dist/host-access-gate.js +31 -0
- package/dist/host-access-gate.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +318 -0
- package/dist/index.js.map +1 -0
- package/dist/js-sandbox-worker/engine.d.ts +4 -0
- package/dist/js-sandbox-worker/engine.d.ts.map +1 -0
- package/dist/js-sandbox-worker/engine.js +82 -0
- package/dist/js-sandbox-worker/engine.js.map +1 -0
- package/dist/js-sandbox-worker/host.d.ts +136 -0
- package/dist/js-sandbox-worker/host.d.ts.map +1 -0
- package/dist/js-sandbox-worker/host.js +482 -0
- package/dist/js-sandbox-worker/host.js.map +1 -0
- package/dist/js-sandbox-worker/interpreter.d.ts +276 -0
- package/dist/js-sandbox-worker/interpreter.d.ts.map +1 -0
- package/dist/js-sandbox-worker/interpreter.js +1318 -0
- package/dist/js-sandbox-worker/interpreter.js.map +1 -0
- package/dist/js-sandbox-worker/protocol.d.ts +168 -0
- package/dist/js-sandbox-worker/protocol.d.ts.map +1 -0
- package/dist/js-sandbox-worker/protocol.js +217 -0
- package/dist/js-sandbox-worker/protocol.js.map +1 -0
- package/dist/js-sandbox-worker/worker-entry.d.ts +26 -0
- package/dist/js-sandbox-worker/worker-entry.d.ts.map +1 -0
- package/dist/js-sandbox-worker/worker-entry.js +308 -0
- package/dist/js-sandbox-worker/worker-entry.js.map +1 -0
- package/dist/limits.d.ts +77 -0
- package/dist/limits.d.ts.map +1 -0
- package/dist/limits.js +56 -0
- package/dist/limits.js.map +1 -0
- package/dist/sandbox-bootstrap-modules.d.ts +54 -0
- package/dist/sandbox-bootstrap-modules.d.ts.map +1 -0
- package/dist/sandbox-bootstrap-modules.js +104 -0
- package/dist/sandbox-bootstrap-modules.js.map +1 -0
- package/dist/sandbox-bytes.d.ts +43 -0
- package/dist/sandbox-bytes.d.ts.map +1 -0
- package/dist/sandbox-bytes.js +61 -0
- package/dist/sandbox-bytes.js.map +1 -0
- package/dist/sandbox-canvas-api.d.ts +30 -0
- package/dist/sandbox-canvas-api.d.ts.map +1 -0
- package/dist/sandbox-canvas-api.js +81 -0
- package/dist/sandbox-canvas-api.js.map +1 -0
- package/dist/sandbox-constants.d.ts +5 -0
- package/dist/sandbox-constants.d.ts.map +1 -0
- package/dist/sandbox-constants.js +13 -0
- package/dist/sandbox-constants.js.map +1 -0
- package/dist/sandbox-json-transport.d.ts +107 -0
- package/dist/sandbox-json-transport.d.ts.map +1 -0
- package/dist/sandbox-json-transport.js +324 -0
- package/dist/sandbox-json-transport.js.map +1 -0
- package/dist/timeline-capture.d.ts +21 -0
- package/dist/timeline-capture.d.ts.map +1 -0
- package/dist/timeline-capture.js +564 -0
- package/dist/timeline-capture.js.map +1 -0
- package/dist/utils/type-guards.d.ts +26 -0
- package/dist/utils/type-guards.d.ts.map +1 -0
- package/dist/utils/type-guards.js +44 -0
- package/dist/utils/type-guards.js.map +1 -0
- package/package.json +138 -4
- package/vendor/README.md +17 -0
- package/vendor/quickjs/LICENSE +21 -0
- package/vendor/quickjs/PROVENANCE.json +8 -0
- package/vendor/quickjs/adapter/fetch.d.ts +56 -0
- package/vendor/quickjs/adapter/fetch.js +140 -0
- package/vendor/quickjs/createTimeInterval.d.ts +9 -0
- package/vendor/quickjs/createTimeInterval.js +22 -0
- package/vendor/quickjs/createVirtualFileSystem.d.ts +13 -0
- package/vendor/quickjs/createVirtualFileSystem.js +191 -0
- package/vendor/quickjs/index.d.ts +77 -0
- package/vendor/quickjs/index.js +77 -0
- package/vendor/quickjs/loadAsyncQuickJs.d.ts +12 -0
- package/vendor/quickjs/loadAsyncQuickJs.js +66 -0
- package/vendor/quickjs/loadQuickJs.d.ts +12 -0
- package/vendor/quickjs/loadQuickJs.js +73 -0
- package/vendor/quickjs/modules/assert.d.ts +2 -0
- package/vendor/quickjs/modules/assert.js +47 -0
- package/vendor/quickjs/modules/buffer.d.ts +2 -0
- package/vendor/quickjs/modules/buffer.js +106 -0
- package/vendor/quickjs/modules/build/test-lib.js +2 -0
- package/vendor/quickjs/modules/events.d.ts +2 -0
- package/vendor/quickjs/modules/events.js +4 -0
- package/vendor/quickjs/modules/fs.d.ts +2 -0
- package/vendor/quickjs/modules/fs.js +76 -0
- package/vendor/quickjs/modules/fs_promises.d.ts +2 -0
- package/vendor/quickjs/modules/fs_promises.js +328 -0
- package/vendor/quickjs/modules/module.d.ts +2 -0
- package/vendor/quickjs/modules/module.js +33 -0
- package/vendor/quickjs/modules/nodeCompatibility/headers.d.ts +2 -0
- package/vendor/quickjs/modules/nodeCompatibility/headers.js +58 -0
- package/vendor/quickjs/modules/nodeCompatibility/request.d.ts +2 -0
- package/vendor/quickjs/modules/nodeCompatibility/request.js +5 -0
- package/vendor/quickjs/modules/nodeCompatibility/response.d.ts +2 -0
- package/vendor/quickjs/modules/nodeCompatibility/response.js +5 -0
- package/vendor/quickjs/modules/path.d.ts +2 -0
- package/vendor/quickjs/modules/path.js +504 -0
- package/vendor/quickjs/modules/process.d.ts +2 -0
- package/vendor/quickjs/modules/process.js +309 -0
- package/vendor/quickjs/modules/punycode.d.ts +2 -0
- package/vendor/quickjs/modules/punycode.js +443 -0
- package/vendor/quickjs/modules/querystring.d.ts +2 -0
- package/vendor/quickjs/modules/querystring.js +15 -0
- package/vendor/quickjs/modules/string_decoder.d.ts +2 -0
- package/vendor/quickjs/modules/string_decoder.js +223 -0
- package/vendor/quickjs/modules/timers.d.ts +2 -0
- package/vendor/quickjs/modules/timers.js +10 -0
- package/vendor/quickjs/modules/timers_promises.d.ts +2 -0
- package/vendor/quickjs/modules/timers_promises.js +40 -0
- package/vendor/quickjs/modules/url.d.ts +2 -0
- package/vendor/quickjs/modules/url.js +104 -0
- package/vendor/quickjs/modules/util.d.ts +2 -0
- package/vendor/quickjs/modules/util.js +233 -0
- package/vendor/quickjs/package.json +3 -0
- package/vendor/quickjs/sandbox/asyncVersion/createAsyncEvalCodeFunction.d.ts +4 -0
- package/vendor/quickjs/sandbox/asyncVersion/createAsyncEvalCodeFunction.js +76 -0
- package/vendor/quickjs/sandbox/asyncVersion/createAsyncValidateCodeFunction.d.ts +3 -0
- package/vendor/quickjs/sandbox/asyncVersion/createAsyncValidateCodeFunction.js +22 -0
- package/vendor/quickjs/sandbox/asyncVersion/executeAsyncSandboxFunction.d.ts +12 -0
- package/vendor/quickjs/sandbox/asyncVersion/executeAsyncSandboxFunction.js +9 -0
- package/vendor/quickjs/sandbox/asyncVersion/getAsyncModuleLoader.d.ts +4 -0
- package/vendor/quickjs/sandbox/asyncVersion/getAsyncModuleLoader.js +30 -0
- package/vendor/quickjs/sandbox/asyncVersion/modulePathNormalizerAsync.d.ts +2 -0
- package/vendor/quickjs/sandbox/asyncVersion/modulePathNormalizerAsync.js +12 -0
- package/vendor/quickjs/sandbox/asyncVersion/prepareAsyncNodeCompatibility.d.ts +3 -0
- package/vendor/quickjs/sandbox/asyncVersion/prepareAsyncNodeCompatibility.js +11 -0
- package/vendor/quickjs/sandbox/asyncVersion/prepareAsyncSandbox.d.ts +4 -0
- package/vendor/quickjs/sandbox/asyncVersion/prepareAsyncSandbox.js +10 -0
- package/vendor/quickjs/sandbox/expose/expose.d.ts +3 -0
- package/vendor/quickjs/sandbox/expose/expose.js +155 -0
- package/vendor/quickjs/sandbox/expose/isES2015Class.d.ts +1 -0
- package/vendor/quickjs/sandbox/expose/isES2015Class.js +4 -0
- package/vendor/quickjs/sandbox/expose/isObject.d.ts +1 -0
- package/vendor/quickjs/sandbox/expose/isObject.js +4 -0
- package/vendor/quickjs/sandbox/expose/pendingHostPromises.d.ts +6 -0
- package/vendor/quickjs/sandbox/expose/pendingHostPromises.js +40 -0
- package/vendor/quickjs/sandbox/getMaxIntervalAmount.d.ts +8 -0
- package/vendor/quickjs/sandbox/getMaxIntervalAmount.js +12 -0
- package/vendor/quickjs/sandbox/getMaxTimeoutAmount.d.ts +8 -0
- package/vendor/quickjs/sandbox/getMaxTimeoutAmount.js +12 -0
- package/vendor/quickjs/sandbox/handleEvalError.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleEvalError.js +21 -0
- package/vendor/quickjs/sandbox/handleToNative/handleToNative.d.ts +9 -0
- package/vendor/quickjs/sandbox/handleToNative/handleToNative.js +153 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/index.d.ts +10 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/index.js +36 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeArrayBuffer.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeArrayBuffer.js +4 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeBuffer.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeBuffer.js +16 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeDate.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeDate.js +16 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeError.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeError.js +18 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeHeaders.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeHeaders.js +17 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeMap.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeMap.js +18 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeSet.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeSet.js +16 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeURLSearchParams.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeURLSearchParams.js +17 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeUrl.d.ts +2 -0
- package/vendor/quickjs/sandbox/handleToNative/serializer/serializeUrl.js +17 -0
- package/vendor/quickjs/sandbox/helper.d.ts +2 -0
- package/vendor/quickjs/sandbox/helper.js +14 -0
- package/vendor/quickjs/sandbox/provide/provideConsole.d.ts +6 -0
- package/vendor/quickjs/sandbox/provide/provideConsole.js +53 -0
- package/vendor/quickjs/sandbox/provide/provideEnv.d.ts +3 -0
- package/vendor/quickjs/sandbox/provide/provideEnv.js +10 -0
- package/vendor/quickjs/sandbox/provide/provideFs.d.ts +4 -0
- package/vendor/quickjs/sandbox/provide/provideFs.js +159 -0
- package/vendor/quickjs/sandbox/provide/provideHttp.d.ts +9 -0
- package/vendor/quickjs/sandbox/provide/provideHttp.js +42 -0
- package/vendor/quickjs/sandbox/provide/provideTimingFunctions.d.ts +7 -0
- package/vendor/quickjs/sandbox/provide/provideTimingFunctions.js +119 -0
- package/vendor/quickjs/sandbox/setupFileSystem.d.ts +3 -0
- package/vendor/quickjs/sandbox/setupFileSystem.js +13 -0
- package/vendor/quickjs/sandbox/syncVersion/createEvalCodeFunction.d.ts +4 -0
- package/vendor/quickjs/sandbox/syncVersion/createEvalCodeFunction.js +76 -0
- package/vendor/quickjs/sandbox/syncVersion/createValidateCodeFunction.d.ts +3 -0
- package/vendor/quickjs/sandbox/syncVersion/createValidateCodeFunction.js +22 -0
- package/vendor/quickjs/sandbox/syncVersion/executeSandboxFunction.d.ts +12 -0
- package/vendor/quickjs/sandbox/syncVersion/executeSandboxFunction.js +9 -0
- package/vendor/quickjs/sandbox/syncVersion/getModuleLoader.d.ts +4 -0
- package/vendor/quickjs/sandbox/syncVersion/getModuleLoader.js +30 -0
- package/vendor/quickjs/sandbox/syncVersion/modulePathNormalizer.d.ts +2 -0
- package/vendor/quickjs/sandbox/syncVersion/modulePathNormalizer.js +12 -0
- package/vendor/quickjs/sandbox/syncVersion/prepareNodeCompatibility.d.ts +3 -0
- package/vendor/quickjs/sandbox/syncVersion/prepareNodeCompatibility.js +11 -0
- package/vendor/quickjs/sandbox/syncVersion/prepareSandbox.d.ts +4 -0
- package/vendor/quickjs/sandbox/syncVersion/prepareSandbox.js +10 -0
- package/vendor/quickjs/types/CodeFunctionInput.d.ts +12 -0
- package/vendor/quickjs/types/CodeFunctionInput.js +1 -0
- package/vendor/quickjs/types/ErrorResponse.d.ts +9 -0
- package/vendor/quickjs/types/ErrorResponse.js +1 -0
- package/vendor/quickjs/types/LoadQuickJsOptions.d.ts +3 -0
- package/vendor/quickjs/types/LoadQuickJsOptions.js +1 -0
- package/vendor/quickjs/types/OkResponse.d.ts +4 -0
- package/vendor/quickjs/types/OkResponse.js +1 -0
- package/vendor/quickjs/types/OkResponseCheck.d.ts +3 -0
- package/vendor/quickjs/types/OkResponseCheck.js +1 -0
- package/vendor/quickjs/types/Prettify.d.ts +3 -0
- package/vendor/quickjs/types/Prettify.js +1 -0
- package/vendor/quickjs/types/RuntimeOptions.d.ts +87 -0
- package/vendor/quickjs/types/RuntimeOptions.js +1 -0
- package/vendor/quickjs/types/SandboxEvalCode.d.ts +5 -0
- package/vendor/quickjs/types/SandboxEvalCode.js +1 -0
- package/vendor/quickjs/types/SandboxFunction.d.ts +16 -0
- package/vendor/quickjs/types/SandboxFunction.js +1 -0
- package/vendor/quickjs/types/SandboxOptions.d.ts +152 -0
- package/vendor/quickjs/types/SandboxOptions.js +1 -0
- package/vendor/quickjs/types/SandboxValidateCode.d.ts +9 -0
- package/vendor/quickjs/types/SandboxValidateCode.js +1 -0
- package/vendor/quickjs/types/Serializer.d.ts +2 -0
- package/vendor/quickjs/types/Serializer.js +1 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { IFs, NestedDirectoryJSON } from 'memfs';
|
|
2
|
+
import type { JSModuleLoader, JSModuleLoaderAsync, JSModuleNormalizer, JSModuleNormalizerAsync } from 'quickjs-emscripten-core';
|
|
3
|
+
import type { Prettify } from './Prettify.js';
|
|
4
|
+
import type { RuntimeOptions } from './RuntimeOptions.js';
|
|
5
|
+
export type SandboxBaseOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The maximum time in milliseconds a script can run.
|
|
8
|
+
* Unset or set to 0 for unlimited execution time.
|
|
9
|
+
*/
|
|
10
|
+
executionTimeout?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Set the max stack size for this runtime, in bytes. To remove the limit, set to 0.
|
|
13
|
+
*/
|
|
14
|
+
maxStackSize?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Set the max memory this runtime can allocate. To remove the limit, set to -1
|
|
17
|
+
*/
|
|
18
|
+
memoryLimit?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Mount a virtual file system
|
|
21
|
+
* @link https://github.com/streamich/memfs
|
|
22
|
+
*/
|
|
23
|
+
mountFs?: NestedDirectoryJSON | IFs;
|
|
24
|
+
/**
|
|
25
|
+
* Mount custom node_modules in a virtual file system
|
|
26
|
+
* @link https://github.com/streamich/memfs
|
|
27
|
+
*/
|
|
28
|
+
nodeModules?: NestedDirectoryJSON;
|
|
29
|
+
/**
|
|
30
|
+
* Enable file capabilities
|
|
31
|
+
* If enabled, the package node:fs becomes available
|
|
32
|
+
*/
|
|
33
|
+
allowFs?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Allow code to make http(s) calls.
|
|
36
|
+
* When enabled, the global fetch will be available
|
|
37
|
+
*/
|
|
38
|
+
allowFetch?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The custom fetch adapter provided as host function in the QuickJS runtime
|
|
41
|
+
*/
|
|
42
|
+
fetchAdapter?: typeof fetch;
|
|
43
|
+
/**
|
|
44
|
+
* Includes test framework
|
|
45
|
+
* If enabled, the packages chai and mocha become available
|
|
46
|
+
* They are registered global
|
|
47
|
+
*/
|
|
48
|
+
enableTestUtils?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Per default, the console log inside of QuickJS is passed to the host console log.
|
|
51
|
+
* Here, you can customize the handling and provide your own logging methods.
|
|
52
|
+
*/
|
|
53
|
+
console?: {
|
|
54
|
+
log?: (message?: unknown, ...optionalParams: unknown[]) => void;
|
|
55
|
+
error?: (message?: unknown, ...optionalParams: unknown[]) => void;
|
|
56
|
+
warn?: (message?: unknown, ...optionalParams: unknown[]) => void;
|
|
57
|
+
info?: (message?: unknown, ...optionalParams: unknown[]) => void;
|
|
58
|
+
debug?: (message?: unknown, ...optionalParams: unknown[]) => void;
|
|
59
|
+
trace?: (message?: unknown, ...optionalParams: unknown[]) => void;
|
|
60
|
+
assert?: (condition?: boolean, ...data: unknown[]) => void;
|
|
61
|
+
count?: (label?: string) => void;
|
|
62
|
+
countReset?: (label?: string) => void;
|
|
63
|
+
dir?: (item?: unknown, options?: object) => void;
|
|
64
|
+
dirxml?: (...data: unknown[]) => void;
|
|
65
|
+
group?: (...label: unknown[]) => void;
|
|
66
|
+
groupCollapsed?: (...label: unknown[]) => void;
|
|
67
|
+
groupEnd?: () => void;
|
|
68
|
+
table?: (tabularData?: unknown, properties?: string[]) => void;
|
|
69
|
+
time?: (label?: string) => void;
|
|
70
|
+
timeEnd?: (label?: string) => void;
|
|
71
|
+
timeLog?: (label?: string, ...data: unknown[]) => void;
|
|
72
|
+
clear?: () => void;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Key-value list of ENV vars, which should be available in QuickJS
|
|
76
|
+
* It is not limited to primitives like string and numbers.
|
|
77
|
+
* Objects, arrays and functions can be provided as well.
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```js
|
|
81
|
+
* // in config
|
|
82
|
+
* {
|
|
83
|
+
* env: {
|
|
84
|
+
* My_ENV: 'my var'
|
|
85
|
+
* }
|
|
86
|
+
* }
|
|
87
|
+
*
|
|
88
|
+
* // inside of QuickJS
|
|
89
|
+
* console.log(env.My_ENV) // outputs: my var
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
env?: Record<string, unknown>;
|
|
93
|
+
/**
|
|
94
|
+
* The object is synchronized between host and guest system.
|
|
95
|
+
* This means, the values on the host, can be set by the guest system
|
|
96
|
+
*/
|
|
97
|
+
dangerousSync?: Record<string, unknown>;
|
|
98
|
+
/**
|
|
99
|
+
* As the timeout function is injected from host to client, in theory the client could create a massive amount of timeouts, which are executed by the host.
|
|
100
|
+
* This might impact the host.
|
|
101
|
+
* Because of this, the maximum concurrent running timeouts is limited by this option.
|
|
102
|
+
*
|
|
103
|
+
* @default 10
|
|
104
|
+
*/
|
|
105
|
+
maxTimeoutCount?: number;
|
|
106
|
+
/**
|
|
107
|
+
* As the interval function is injected from host to client, in theory the client could create a massive amount of intervals, which are executed by the host.
|
|
108
|
+
* This might impact the host.
|
|
109
|
+
* Because of this, the maximum concurrent running intervals is limited by this option.
|
|
110
|
+
*
|
|
111
|
+
* @default 10
|
|
112
|
+
*/
|
|
113
|
+
maxIntervalCount?: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* The sandbox options for regular sync QuickJS webassembly
|
|
117
|
+
*/
|
|
118
|
+
export type SandboxOptions = Prettify<SandboxBaseOptions & {
|
|
119
|
+
/**
|
|
120
|
+
* A function which returns a custom module loader
|
|
121
|
+
* @param fs
|
|
122
|
+
* @param _runtimeOptions
|
|
123
|
+
* @returns JSModuleLoader
|
|
124
|
+
*/
|
|
125
|
+
getModuleLoader?: (fs: IFs, _runtimeOptions: RuntimeOptions) => JSModuleLoader;
|
|
126
|
+
/**
|
|
127
|
+
* A function to transform modules paths from imports before sent to the module loader
|
|
128
|
+
* @param baseName
|
|
129
|
+
* @param requestedName
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
modulePathNormalizer?: JSModuleNormalizer;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* The sandbox options for async QuickJS webassembly
|
|
136
|
+
*/
|
|
137
|
+
export type SandboxAsyncOptions = Prettify<SandboxBaseOptions & {
|
|
138
|
+
/**
|
|
139
|
+
* A function which returns a custom module loader
|
|
140
|
+
* @param fs
|
|
141
|
+
* @param _runtimeOptions
|
|
142
|
+
* @returns JSModuleLoaderAsync
|
|
143
|
+
*/
|
|
144
|
+
getModuleLoader?: (fs: IFs, _runtimeOptions: RuntimeOptions) => JSModuleLoaderAsync;
|
|
145
|
+
/**
|
|
146
|
+
* A function to transform modules paths from imports before sent to the module loader
|
|
147
|
+
* @param baseName
|
|
148
|
+
* @param requestedName
|
|
149
|
+
* @returns
|
|
150
|
+
*/
|
|
151
|
+
modulePathNormalizer?: JSModuleNormalizerAsync;
|
|
152
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContextEvalOptions } from 'quickjs-emscripten-core';
|
|
2
|
+
import type { ErrorResponse } from './ErrorResponse.js';
|
|
3
|
+
import type { OkResponseCheck } from './OkResponseCheck.js';
|
|
4
|
+
import type { Prettify } from './Prettify.js';
|
|
5
|
+
export type SandboxValidateCode = (code: string, filename?: string, options?: Prettify<Omit<ContextEvalOptions, 'type'> & {
|
|
6
|
+
executionTimeout?: number;
|
|
7
|
+
maxStackSize?: number;
|
|
8
|
+
memoryLimit?: number;
|
|
9
|
+
}>) => Promise<OkResponseCheck | ErrorResponse>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|