Members
(constant) FORBIDDEN_BUILTINS
- Description:
- Host Node built-ins that must never be opened via box.allowed_modules.
Note: bare 'fs' is the Gingee sandboxed module (modules/fs.js), not host fs —
host fs is blocked because it is not on the allowed list and is not a gingee module under node:fs.
Host Node built-ins that must never be opened via box.allowed_modules.
Note: bare 'fs' is the Gingee sandboxed module (modules/fs.js), not host fs —
host fs is blocked because it is not on the allowed list and is not a gingee module under node:fs.
(constant) Redis
- Description:
- Redis cache adapter.
Connection config uses the same shape as queue.redis / scheduler.redis:
nested under cache.redis, with optional url or host/port/password/db.
Accepts full cache section from cache_service.init (provider, prefix, redis, …)
or a bare redis options object (tests / legacy).
Redis cache adapter.
Connection config uses the same shape as queue.redis / scheduler.redis:
nested under cache.redis, with optional url or host/port/password/db.
Accepts full cache section from cache_service.init (provider, prefix, redis, …)
or a bare redis options object (tests / legacy).
(constant) path
- Description:
- App worker process entry (forked by worker_manager).
Runs sandboxed server scripts for one app or an isolation group.
Messages in:
{ type: 'init', workerKey, apps: [...], ... }
{ type: 'http_script', requestId, appName, ... }
{ type: 'shutdown' }
Messages out:
{ type: 'ready', workerKey }
{ type: 'http_result', requestId, ... } // buffered
{ type: 'stream_start'|'stream_chunk'|'stream_end'|'stream_error', requestId, ... }
{ type: 'log', level, message }
App worker process entry (forked by worker_manager).
Runs sandboxed server scripts for one app or an isolation group.
Messages in:
{ type: 'init', workerKey, apps: [...], ... }
{ type: 'http_script', requestId, appName, ... }
{ type: 'shutdown' }
Messages out:
{ type: 'ready', workerKey }
{ type: 'http_result', requestId, ... } // buffered
{ type: 'stream_start'|'stream_chunk'|'stream_end'|'stream_error', requestId, ... }
{ type: 'log', level, message }
workerState :object|null
Type:
Methods
createMemoryDriver(opts)
Parameters:
| Name |
Type |
Description |
opts |
object
|
Properties
| Name |
Type |
Attributes |
Description |
onReady |
function
|
|
(job) => void when a job is ready to process |
logger |
object
|
|
|
dlqMax |
number
|
<optional>
|
max dead-letter entries retained |
|
createRedisDriver(opts)
Parameters:
| Name |
Type |
Description |
opts |
object
|
Properties
| Name |
Type |
Attributes |
Description |
redis |
object
|
|
ioredis connection options or url |
keyPrefix |
string
|
|
|
onReady |
function
|
|
(job) => void |
logger |
object
|
|
|
pollMs |
number
|
<optional>
|
|
|
deadLetter(job, erropt)
- Description:
Parameters:
| Name |
Type |
Attributes |
Description |
job |
object
|
|
|
err |
Error
|
string
|
<optional>
|
|
deadLetter(job, erropt)
- Description:
- Permanent failure → DLQ list + job hash.
Parameters:
| Name |
Type |
Attributes |
Description |
job |
object
|
|
|
err |
Error
|
string
|
<optional>
|
|
fail()
- Deprecated:
(async) init(config, logger)
Parameters:
| Name |
Type |
Description |
config |
object
|
full cache section or redis connection object |
logger |
object
|
|
isPathInside(candidatePath, boundaryPath) → {boolean}
- Description:
- Returns true if `candidatePath` is the same as, or a descendant of, `boundaryPath`.
Safer than String.startsWith on resolved paths: rejects sibling directories that
only share a string prefix (e.g. `/web/app1` vs `/web/app10` or `C:\web\app1` vs
`C:\web\app1_evil`).
Parameters:
| Name |
Type |
Description |
candidatePath |
string
|
Absolute or relative path to test. |
boundaryPath |
string
|
Absolute or relative confinement root. |
Returns:
-
Type
-
boolean
listPending(optsopt) → {Promise.<Array.<object>>}
- Description:
- Jobs not yet completed (delayed timers + ready). Admin / Glade live view.
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
appName |
string
|
<optional>
|
|
limit |
number
|
<optional>
|
|
|
Returns:
-
Type
-
Promise.<Array.<object>>
listPending(optsopt) → {Promise.<Array.<object>>}
- Description:
- Ready list + delayed ZSET jobs (shared across nodes). Admin / Glade live view.
Parameters:
| Name |
Type |
Attributes |
Description |
opts |
object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
appName |
string
|
<optional>
|
|
limit |
number
|
<optional>
|
|
|
Returns:
-
Type
-
Promise.<Array.<object>>
loadJsonFile(filePath) → {object|array|string|number|boolean|null}
- Description:
- Read and parse a JSON file. Purges require.cache for the path when present so
repeated loads (reload) see disk changes. Throws a clear SyntaxError-style message
on invalid JSON (does not crash the process by itself).
Parameters:
| Name |
Type |
Description |
filePath |
string
|
absolute path |
Returns:
-
Type
-
object
|
array
|
string
|
number
|
boolean
|
null
loadOptional(loader, packageName, featureLabel) → {any}
- Description:
- Load an optional npm package with a clear operator-facing error.
Used when packages live under package.json `optionalDependencies` (or may be
omitted via `npm install --omit=optional`).
Prefer a **static** loader so Jest/bundlers can resolve and mock the package:
loadOptional(() => require('pdfmake'), 'pdfmake', 'PDF generation')
Parameters:
| Name |
Type |
Description |
loader |
function
|
zero-arg function that calls require('pkg') |
packageName |
string
|
npm package name (for error text / npm install hint) |
featureLabel |
string
|
human feature (e.g. 'PostgreSQL', 'PDF') |
Returns:
module.exports of the package
-
Type
-
any
pendingCounts() → {Promise.<{pending: number, delayed: number}>}
Returns:
-
Type
-
Promise.<{pending: number, delayed: number}>
pendingCounts() → {Promise.<{pending: number, delayed: number}>}
Returns:
-
Type
-
Promise.<{pending: number, delayed: number}>
requireOptional()
- Deprecated:
- Prefer
loadOptional with a static `() => require('pkg')` loader
so Jest mocks apply. Kept for call sites that only need a string require.
resolveRedisConnection(config) → {Object|Object}
- Description:
- Resolve ioredis constructor args from cache config.
Prefers nested `config.redis`; falls back to top-level host/port/url for legacy flat configs.
Parameters:
| Name |
Type |
Description |
config |
object
|
|
Returns:
-
Type
-
Object
|
Object
retryDlq(jobId) → {Promise.<(object|null)>}
- Description:
- Remove from DLQ and re-enqueue with attempt 1.
Parameters:
| Name |
Type |
Description |
jobId |
string
|
|
Returns:
enqueue result
-
Type
-
Promise.<(object|null)>
(async) runHttpScript(msg)
Parameters:
| Name |
Type |
Description |
msg |
object
|
|
waitForResponseSettle()
- Description:
- Wait until response is completed/ended (or timeout).
Covers fire-and-forget `gingee(...)` without await.