Dependency Management
Section titled “Dependency Management”The Dependency Management API lets you inspect which npm modules ship with the container runtime, verify whether the modules referenced by a script are already installed, and install new ones on demand. Use these endpoints when a script needs packages that are not pre-bundled, or when you want to confirm ahead of time that a workload will resolve every import.
All requests target the execution service running inside the container. The hostname follows the pattern {projectId}-{containerId}-exec-1.{server}.containers.hoody.com.
List Bundled Dependencies
Section titled “List Bundled Dependencies”Returns the npm modules that are pre-installed in the container image, along with a flag indicating whether every bundled module is currently available.
GET /api/v1/exec/dependencies/bundled
Section titled “GET /api/v1/exec/dependencies/bundled”This endpoint takes no parameters.
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/dependencies/bundled" \ -H "Authorization: Bearer $HOODY_TOKEN"import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });await client.exec.dependencies.listBundled();{ "total": 42, "packages": [ { "name": "lodash", "version": "4.17.21" }, { "name": "axios", "version": "1.6.2" } ], "allAvailable": true}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2025-01-15T12:00:00.000Z", "details": { "message": "Invalid parameter format" }}| 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", "details": {}}Check Dependencies
Section titled “Check Dependencies”Checks whether the modules referenced by a script are installed. You can submit the source code directly or supply a comma-separated list of module names. The response lists the modules that are installed, the ones that are missing, and either a summary message or per-module detail entries.
POST /api/v1/exec/dependencies/check
Section titled “POST /api/v1/exec/dependencies/check”This endpoint takes no query, path, or header parameters.
Request Body
Section titled “Request Body”| Name | Type | Required | Description |
|---|---|---|---|
code | string | No | Source code to inspect for module references. |
modules | string | No | Comma-separated list of module names to check. |
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/dependencies/check" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "code": "import axios from \"axios\";\nimport _ from \"lodash\";\nexport default { axios, _ };", "modules": "axios,lodash,dayjs" }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });await client.exec.dependencies.check({ "code": "import axios from \"axios\";\nimport _ from \"lodash\";\nexport default { axios, _ };", "modules": "axios,lodash,dayjs"});{ "total": 3, "installed": [ { "name": "axios", "version": "1.6.2" }, { "name": "lodash", "version": "4.17.21" } ], "missing": ["dayjs"], "details": [ { "module": "axios", "status": "installed" }, { "module": "lodash", "status": "installed" }, { "module": "dayjs", "status": "missing" } ]}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2025-01-15T12:00:00.000Z", "details": { "message": "Invalid parameter format" }}| 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", "details": {}}Install Dependencies
Section titled “Install Dependencies”Installs one or more npm modules inside the container. Submit a single module spec or an array of specs; the runtime installs them in sequence. By default, modules that are already present are reported as already-installed — set force to true to reinstall them.
POST /api/v1/exec/dependencies/install
Section titled “POST /api/v1/exec/dependencies/install”This endpoint takes no query, path, or header parameters.
Request Body
Section titled “Request Body”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
modules | string | array | 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 | false | When true, reinstall modules that are already present instead of reporting them as already-installed. |
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/dependencies/install" \ -H "Authorization: Bearer $HOODY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "modules": ["dayjs@1.11.10", "pino@8.17.2"], "force": false }'import { HoodyClient } from 'hoody-sdk';
const client = new HoodyClient({ baseURL: 'https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com', token: process.env.HOODY_TOKEN });await client.exec.dependencies.install({ "modules": ["dayjs@1.11.10", "pino@8.17.2"], "force": false});{ "total": 2, "installed": 2, "failed": 0, "installedModules": ["dayjs@1.11.10", "pino@8.17.2"], "failedModules": [], "details": [ { "module": "dayjs@1.11.10", "status": "installed", "version": "1.11.10" }, { "module": "pino@8.17.2", "status": "installed", "version": "8.17.2" } ]}{ "error": "VALIDATION_ERROR", "code": "VALIDATION_ERROR", "timestamp": "2025-01-15T12:00:00.000Z", "details": { "message": "modules must be a non-empty string or array" }}| 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", "details": {}}