Dependency Management
Section titled “Dependency Management”The Dependency Management API lets you inspect which npm packages ship with the Hoody execution environment, audit a script’s require/import statements against that manifest, and install additional modules on demand. Use these endpoints to bootstrap scripts that rely on third-party libraries or to verify coverage before running untrusted code.
List Bundled Dependencies
Section titled “List Bundled Dependencies”GET /api/v1/exec/dependencies/bundled
Section titled “GET /api/v1/exec/dependencies/bundled”Returns the full catalog of npm modules that are pre-installed in the execution environment, along with an aggregate availability flag.
This endpoint takes no parameters.
curl -X GET "https://api.hoody.com/api/v1/exec/dependencies/bundled" \ -H "Authorization: Bearer <token>"const result = await client.exec.dependencies.listBundled();{ "total": 42, "packages": ["lodash", "axios", "dayjs", "uuid"], "allAvailable": true}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2025-01-15T12:00:00.000Z"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
VALIDATION_ERROR | Invalid input | Request parameters failed validation | Check parameter format and requirements |
{ "error": "Internal server error", "code": "ERROR_500", "timestamp": "2025-01-15T12:00:00.000Z"}Check Dependencies
Section titled “Check Dependencies”POST /api/v1/exec/dependencies/check
Section titled “POST /api/v1/exec/dependencies/check”Parses the supplied source code (or an explicit list of module specifiers) and reports which referenced modules are already bundled and which are missing. No modules are installed.
This endpoint takes no path, query, or header parameters.
Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
code | string | No | Source code to scan for require/import references |
modules | string | No | Explicit module specifier or comma-separated list to check |
curl -X POST "https://api.hoody.com/api/v1/exec/dependencies/check" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "code": "const axios = require(\"axios\");\nconst _ = require(\"lodash\");" }'const result = await client.exec.dependencies.check({ code: "const axios = require(\"axios\");\nconst _ = require(\"lodash\");"});{ "total": 2, "installed": ["axios"], "missing": ["lodash"], "message": "1 module(s) missing"}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2025-01-15T12:00:00.000Z"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
VALIDATION_ERROR | Invalid input | Request parameters failed validation | Check parameter format and requirements |
{ "error": "Internal server error", "code": "ERROR_500", "timestamp": "2025-01-15T12:00:00.000Z"}Install Dependencies
Section titled “Install Dependencies”POST /api/v1/exec/dependencies/install
Section titled “POST /api/v1/exec/dependencies/install”Installs one or more npm modules into the execution environment. Modules that are already present are reported as such unless force is set to true.
This endpoint takes no path, query, or header parameters.
Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
modules | string | string[] | Yes | One npm module spec (e.g. "lodash", "axios@1.2.3") or an array of specs. Array form installs every module in sequence. |
force | boolean | No | When true, reinstall modules that are already present instead of reporting them as already-installed. Default: false. |
curl -X POST "https://api.hoody.com/api/v1/exec/dependencies/install" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{ "modules": ["lodash", "axios@1.6.0"], "force": false }'const result = await client.exec.dependencies.install({ modules: ["lodash", "axios@1.6.0"], force: false});{ "total": 2, "installed": 2, "failed": 0, "installedModules": ["lodash", "axios@1.6.0"], "failedModules": [], "details": [ { "module": "lodash", "status": "installed", "version": "4.17.21" }, { "module": "axios@1.6.0", "status": "installed", "version": "1.6.0" } ]}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2025-01-15T12:00:00.000Z"}| Error Code | Title | Description | Resolution |
|---|---|---|---|
VALIDATION_ERROR | Invalid input | Request parameters failed validation | Check parameter format and requirements |
{ "error": "Internal server error", "code": "ERROR_500", "timestamp": "2025-01-15T12:00:00.000Z"}