impreza-mcp 0.32.0 → 0.34.0
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 +618 -590
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -1
- package/dist/server.js +76 -9
- package/dist/server.js.map +1 -1
- package/dist/ui-assets.js +5 -5
- package/package.json +64 -64
package/dist/client.js
CHANGED
|
@@ -116,8 +116,20 @@ export class ImprezaClient {
|
|
|
116
116
|
'User-Agent': `impreza-mcp/${VERSION}`,
|
|
117
117
|
...(init.headers ?? {}),
|
|
118
118
|
},
|
|
119
|
+
// The credentials above are CUSTOM headers. Fetch strips Authorization,
|
|
120
|
+
// Cookie and Proxy-Authorization when a redirect crosses to another
|
|
121
|
+
// origin — it has no idea ours are credentials, so it would carry the
|
|
122
|
+
// customer's key and secret to whatever host a 3xx names. The API
|
|
123
|
+
// answers JSON on every endpoint and never redirects, so we take the
|
|
124
|
+
// redirect ourselves and refuse it.
|
|
125
|
+
redirect: 'manual',
|
|
119
126
|
signal: ctrl.signal,
|
|
120
127
|
});
|
|
128
|
+
if (res.status >= 300 && res.status < 400) {
|
|
129
|
+
throw new Error(`UNEXPECTED_REDIRECT: the API answered HTTP ${res.status} for ${url.pathname}. ` +
|
|
130
|
+
'Refusing to resend your API credentials to the redirect target. ' +
|
|
131
|
+
'Check IMPREZA_BASE_URL, or whether something is intercepting the connection.');
|
|
132
|
+
}
|
|
121
133
|
return res;
|
|
122
134
|
}
|
|
123
135
|
finally {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,mEAAmE;AACnE,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,2DAA2D;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,M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,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACnI,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACvC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,+CAA+C;AAC/C,MAAM,UAAU,SAAS,CAAC,KAAiB;IACzC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC1D,CAAC"}
|
package/dist/server.js
CHANGED
|
@@ -182,14 +182,18 @@ const TOOLS = [
|
|
|
182
182
|
git_ref: { type: 'string', description: 'Branch / tag / commit for git_url (default main).' },
|
|
183
183
|
git_auth_method: { type: 'string', enum: ['none', 'deploy_key', 'pat'], description: 'Private-repo auth for git_url: none (default), deploy_key (SSH), or pat (token).' },
|
|
184
184
|
git_pat: { type: 'string', description: 'Fine-grained, repo-scoped, Contents:Read token (required with git_auth_method=pat).' },
|
|
185
|
-
build_strategy: { type: 'string', enum: ['dockerfile', 'node_npm', 'node_npm_static', 'python_pip', 'php_composer'], description: 'php_composer uses PHP 8.4/Apache and Composer 2, composer.json plus a matching composer.lock, public HTTPS archive dependencies and php_document_root (default public, containing index.php). Non-root runtime, default port 8080 (1024-65535), strict 2xx health. No scripts/plugins, custom repositories, private credentials, asset builds, migrations or .htaccess overrides. python_pip uses Python 3.13, a flat requirements.txt of PyPI packages and an explicit start_command. Non-root build/runtime; default port 8000. No dependency options/includes/URLs/local projects, system package installation or private build credentials. Compose 2.17+ and BuildKit required. node_npm uses the Node 24 npm server recipe. node_npm_static builds dist/index.html with npm and serves static files with Nginx and SPA fallback (build script required, no start script). Runtime variables do not alter browser bundles. Both require package.json and package-lock.json
|
|
185
|
+
build_strategy: { type: 'string', enum: ['dockerfile', 'node_npm', 'node_npm_static', 'python_pip', 'php_composer'], description: 'php_composer uses PHP 8.4/Apache and Composer 2, composer.json plus a matching composer.lock, public HTTPS archive dependencies and php_document_root (default public, containing index.php). Non-root runtime, default port 8080 (1024-65535), strict 2xx health. No scripts/plugins, custom repositories, private credentials, asset builds, migrations or .htaccess overrides. python_pip uses Python 3.13, a flat requirements.txt of PyPI packages and an explicit start_command. Non-root build/runtime; default port 8000. No dependency options/includes/URLs/local projects, system package installation or private build credentials. Compose 2.17+ and BuildKit required. node_npm uses the Node 24 npm server recipe. node_npm_static builds dist/index.html with npm and serves static files with Nginx and SPA fallback (build script required, no start script). Runtime variables do not alter browser bundles. Both require package.json and the selected manager lockfile (package-lock.json for default npm) in project_dir, and Compose 2.17+ with BuildKit. node_npm requires production start; node_npm_static requires build. Select npm workspaces with npm_workspace. build_secrets supplies credentials and node_package_manager selects pinned standalone pnpm/Yarn.' },
|
|
186
186
|
php_document_root: { type: 'string', maxLength: 120, description: 'php_composer only: public subfolder relative to project_dir, containing index.php; default public. Up to 120 ASCII characters and five segments; no hidden/parent/vendor/node_modules segments or symlinks. Saved at creation and inherited by previews/redeploys.' },
|
|
187
187
|
start_command: { type: 'string', minLength: 1, maxLength: 1000, description: 'python_pip only, required: production shell command, one line up to 1000 UTF-8 bytes. Example: exec uvicorn app:app --host 0.0.0.0 --port 8000. PORT and HOST are runtime variables. Do not include credentials. Saved at creation and inherited by previews/redeploys.' },
|
|
188
188
|
require_healthy_start: { type: 'boolean', description: 'node_npm, python_pip or php_composer only. Require an explicit healthcheck_path to become healthy before deployment succeeds, including the first install. Requires agent 0.6.3+. Failed first installs remove containers and preserve volumes; eligible previous releases recover. Omit or false keeps legacy behavior. Saved at creation and inherited by previews/redeploys.' },
|
|
189
189
|
startup_timeout_seconds: { type: 'integer', minimum: 30, maximum: 600, description: 'Required healthy start only: 30-600 second startup observation budget, default 60; build/recovery time is separate.' },
|
|
190
190
|
healthcheck_path: { type: 'string', minLength: 1, maxLength: 200, pattern: '^/(?:[A-Za-z0-9_-][A-Za-z0-9._~-]*(?:/[A-Za-z0-9_-][A-Za-z0-9._~-]*)*/?)?$', description: 'node_npm, python_pip or php_composer only. Optional HTTP path such as /health (200 ASCII characters max). Checks 127.0.0.1 on target_port and requires 2xx without redirects. Omit for /: Python/PHP require 2xx; legacy Node accepts status below 500. Saved at creation; previews and redeploys retain it. A failed replacement recovers a verified healthy previous release; first installs keep the agent startup warning policy.' },
|
|
191
|
+
build_secrets: { type: 'object', maxProperties: 16, additionalProperties: { type: 'string', maxLength: 65536 }, description: 'Private build-only credentials; encrypted, delivered just-in-time to an agent supporting build-secrets-v1. npmrc installs private npm packages; other names mount during build scripts. Build output withheld. Trusted source only. No automatic preview inheritance.' },
|
|
191
192
|
public_build_vars: { type: 'object', maxProperties: 20, additionalProperties: { type: 'string', maxLength: 4096 }, description: 'Public values for npm run build only. Names start with VITE_, NEXT_PUBLIC_ or PUBLIC_; 20 keys max, 128 chars per key, 4 KiB per value, 16 KiB total. Values can appear in bundles/image metadata; never supply secrets. Saved at creation and inherited by previews/redeploys. Separate from runtime vars and npm install.' },
|
|
192
|
-
|
|
193
|
+
python_package_manager: { type: 'string', enum: ['pip', 'uv@0.12.15'], description: 'Pinned uv with pyproject.toml and uv.lock under python_pip. Locked non-editable production install, public PyPI only, no uv workspaces or custom indexes. Omit for pip.' },
|
|
194
|
+
node_package_manager: { type: 'string', maxLength: 40, description: 'Exact pnpm@10/11/12.x.y or yarn@4.x.y pin matching package.json for standalone Node server/static recipes. Omit for npm. Immutable lockfile install; no npm_workspace or custom manager configuration/plugins.' },
|
|
195
|
+
npm_workspace: { type: 'string', minLength: 1, maxLength: 120, description: 'Declared npm workspace relative to project_dir (npm root). Keeps root lockfile and sibling packages. Builds in workspace declaration order; starts selected app. Static output is relative to the workspace.' },
|
|
196
|
+
project_dir: { type: 'string', minLength: 1, maxLength: 120, description: 'Generated npm/Python/PHP recipes only: . (default) or relative app folder with its own package.json and lockfile, requirements.txt for Python, or composer.json/composer.lock for PHP. Use npm_workspace for shared npm roots. No hidden/parent/node_modules segments or symlink path components.' },
|
|
193
197
|
static_output_dir: { type: 'string', minLength: 1, maxLength: 120, description: 'Static npm only: output folder relative to project_dir containing index.html (default dist). No hidden/parent/node_modules segments or symlinks.' },
|
|
194
198
|
static_spa: { type: 'boolean', description: 'Static npm only: true (default) uses index.html for unknown routes; false returns 404.' },
|
|
195
199
|
dockerfile_path: { type: 'string', description: 'Optional Dockerfile path relative to the dir/repo root (default "Dockerfile").' },
|
|
@@ -815,10 +819,11 @@ const TOOLS = [
|
|
|
815
819
|
},
|
|
816
820
|
{
|
|
817
821
|
name: 'impreza_prepare_compose',
|
|
818
|
-
description: 'Review
|
|
822
|
+
description: 'Review Compose YAML before deploying. Public images or local builds and auxiliary files from one retained context_id. No remote build contexts, SSH, aliases, profiles, host privileges or external volumes/networks. Uploaded runtime files require an agent supporting compose-source-files-v1. Returns services, TCP port hints, variable names, changes and blockers without executing project code. Select web_service and target_port explicitly. Original published ports are removed; only the HTTP service joins the proxy and receives a loopback port. Names and volumes become deployment-specific. Use the returned analysis_id as compose_review_id with the same YAML/service/port/context_id in impreza_deploy_custom mode=compose after review. Never paste secrets: reference uppercase vars instead. This is a configuration review, not an executable stored plan or a health check.',
|
|
819
823
|
inputSchema: {
|
|
820
824
|
type: 'object', properties: {
|
|
821
825
|
compose_yaml: { type: 'string', minLength: 1, maxLength: 65536 },
|
|
826
|
+
context_id: { type: 'string', pattern: '^ctx_[a-f0-9]{1,36}$', description: 'Retained source upload for local build contexts and auxiliary files.' },
|
|
822
827
|
web_service: { type: 'string', maxLength: 63 },
|
|
823
828
|
target_port: { type: 'integer', minimum: 1, maximum: 65535 },
|
|
824
829
|
}, required: ['compose_yaml'], additionalProperties: false,
|
|
@@ -826,7 +831,7 @@ const TOOLS = [
|
|
|
826
831
|
},
|
|
827
832
|
{
|
|
828
833
|
"name": "impreza_plan_project",
|
|
829
|
-
"description": "Inspect
|
|
834
|
+
"description": "Inspect a retained upload or capture an HTTPS Git repository at a complete commit SHA. Git credentials are used only for fetching, never saved in the plan; captured bytes consume the account upload quota. Reads bounded tar paths and selected configuration files without executing project code. No submodules, redirects or private network origins. Saves account-owned options for up to 24 hours. Review findings before preparing or deploying. Does not guarantee build success or reserve capacity. Do not put credentials in start_command.",
|
|
830
835
|
"inputSchema": {
|
|
831
836
|
"type": "object",
|
|
832
837
|
"properties": {
|
|
@@ -834,6 +839,11 @@ const TOOLS = [
|
|
|
834
839
|
"type": "string",
|
|
835
840
|
"pattern": "^ctx_[a-f0-9]{1,36}$"
|
|
836
841
|
},
|
|
842
|
+
"git_url": { "type": "string", "maxLength": 1024, "description": "HTTPS repository URL, mutually exclusive with context_id." },
|
|
843
|
+
"git_commit": { "type": "string", "pattern": "^[a-fA-F0-9]{40}$", "description": "Complete commit SHA required with git_url." },
|
|
844
|
+
"git_username": { "type": "string", "maxLength": 100 },
|
|
845
|
+
"git_token": { "type": "string", "maxLength": 4096, "description": "Optional access token used only for this fetch." },
|
|
846
|
+
"npm_workspace": { "type": "string", "minLength": 1, "maxLength": 120 },
|
|
837
847
|
"project_dir": {
|
|
838
848
|
"type": "string",
|
|
839
849
|
"maxLength": 120
|
|
@@ -851,8 +861,9 @@ const TOOLS = [
|
|
|
851
861
|
"maxLength": 120
|
|
852
862
|
}
|
|
853
863
|
},
|
|
854
|
-
"
|
|
855
|
-
"context_id"
|
|
864
|
+
"oneOf": [
|
|
865
|
+
{ "required": ["context_id"], "not": { "required": ["git_url"] } },
|
|
866
|
+
{ "required": ["git_url", "git_commit"], "not": { "required": ["context_id"] } }
|
|
856
867
|
],
|
|
857
868
|
"additionalProperties": false
|
|
858
869
|
}
|
|
@@ -981,6 +992,7 @@ const TOOLS = [
|
|
|
981
992
|
"type": "string",
|
|
982
993
|
"description": "Hostname to use, or omit to propose a managed subdomain. No DNS record is created until apply. Omit with onion=true for onion-only."
|
|
983
994
|
},
|
|
995
|
+
"build_secrets": { "type": "object", "maxProperties": 16, "additionalProperties": { "type": "string", "maxLength": 65536 } },
|
|
984
996
|
"vars": {
|
|
985
997
|
"type": "object",
|
|
986
998
|
"description": "Runtime environment values, encrypted in the prepared record. Do not use reserved system/routing names. Summaries show names only.",
|
|
@@ -1094,6 +1106,7 @@ const TOOLS = [
|
|
|
1094
1106
|
properties: {
|
|
1095
1107
|
package_json: { type: 'string', maxLength: 32768 },
|
|
1096
1108
|
composer_json: { type: 'string', maxLength: 32768 },
|
|
1109
|
+
pyproject_toml: { type: 'string', maxLength: 32768, description: 'uv metadata; advisory only. Requires uv.lock in the uploaded source.' },
|
|
1097
1110
|
requirements_txt: { type: 'string', maxLength: 32768 },
|
|
1098
1111
|
php_document_root: { type: 'string', maxLength: 120, description: 'php_composer only: public subfolder relative to project_dir, containing index.php; default public. Up to 120 ASCII characters and five segments; no hidden/parent/vendor/node_modules segments or symlinks. Saved at creation and inherited by previews/redeploys.' },
|
|
1099
1112
|
start_command: { type: 'string', minLength: 1, maxLength: 1000 },
|
|
@@ -1183,6 +1196,11 @@ const TOOLS = [
|
|
|
1183
1196
|
additionalProperties: false,
|
|
1184
1197
|
},
|
|
1185
1198
|
},
|
|
1199
|
+
{
|
|
1200
|
+
name: 'impreza_rotate_build_secrets',
|
|
1201
|
+
description: 'Replace all existing build credential values for a custom deployment without redeploying. Supply exactly its build_secret_names. Refuses active operations. Values are encrypted and never returned. Explicitly redeploy when ready. Requires a control plane supporting build-secrets-v1.',
|
|
1202
|
+
inputSchema: { type: 'object', properties: { deployment_id: { type: 'string' }, build_secrets: { type: 'object', maxProperties: 16, additionalProperties: { type: 'string', maxLength: 65536 } } }, required: ['deployment_id', 'build_secrets'], additionalProperties: false },
|
|
1203
|
+
},
|
|
1186
1204
|
{
|
|
1187
1205
|
name: 'impreza_set_deployment_vars',
|
|
1188
1206
|
description: "Change a custom app's environment variables — the answer to \"my app needs a different SMTP " +
|
|
@@ -2327,6 +2345,7 @@ const TOOL_ANNOTATIONS = {
|
|
|
2327
2345
|
impreza_api_call: A_READ_EXT,
|
|
2328
2346
|
// Saving vars touches the control plane only; the container sees them on the
|
|
2329
2347
|
// next deploy, so nothing external moves and a repeat lands the same state.
|
|
2348
|
+
impreza_rotate_build_secrets: A_WRITE_IDEM,
|
|
2330
2349
|
impreza_set_deployment_vars: A_WRITE_IDEM,
|
|
2331
2350
|
// Power and rescue interrupt a running machine at the provider.
|
|
2332
2351
|
impreza_cloud_power: A_DESTRUCTIVE_EXT,
|
|
@@ -2863,6 +2882,12 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
2863
2882
|
// ── Account + crypto top-up ──────────────────────────────────────
|
|
2864
2883
|
case 'impreza_account_info':
|
|
2865
2884
|
return toResult(await impreza.get('/v1/account'));
|
|
2885
|
+
case 'impreza_rotate_build_secrets': {
|
|
2886
|
+
const dep = String(args.deployment_id ?? '');
|
|
2887
|
+
if (!/^dpl_[a-f0-9]{1,64}$/.test(dep) || !args.build_secrets || typeof args.build_secrets !== 'object' || Array.isArray(args.build_secrets))
|
|
2888
|
+
throw new Error('Provide deployment_id and a build_secrets object');
|
|
2889
|
+
return toResult(await impreza.post(`/v1/platform/deployments/custom/${encodeURIComponent(dep)}/build-secrets`, { build_secrets: args.build_secrets }));
|
|
2890
|
+
}
|
|
2866
2891
|
case 'impreza_set_deployment_vars': {
|
|
2867
2892
|
const dep = String(args.deployment_id ?? '').trim();
|
|
2868
2893
|
if (!dep)
|
|
@@ -3209,7 +3234,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
3209
3234
|
return toResult(await impreza.del('/v1/platform/deployments/custom/contexts/' + encodeURIComponent(args.context_id)));
|
|
3210
3235
|
case 'impreza_prepare_compose': {
|
|
3211
3236
|
const body = {};
|
|
3212
|
-
for (const field of ['compose_yaml', 'web_service', 'target_port'])
|
|
3237
|
+
for (const field of ['compose_yaml', 'web_service', 'target_port', 'context_id'])
|
|
3213
3238
|
if (args[field] !== undefined)
|
|
3214
3239
|
body[field] = args[field];
|
|
3215
3240
|
return toResult(await impreza.post('/v1/platform/deployments/custom/compose/prepare', body));
|
|
@@ -3248,7 +3273,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
3248
3273
|
}
|
|
3249
3274
|
case 'impreza_prepare_project': {
|
|
3250
3275
|
const body = {};
|
|
3251
|
-
for (const field of ['package_json', 'requirements_txt', 'start_command', 'composer_json', 'php_document_root', 'dockerfile', 'dockerfile_path']) {
|
|
3276
|
+
for (const field of ['package_json', 'pyproject_toml', 'requirements_txt', 'start_command', 'composer_json', 'php_document_root', 'dockerfile', 'dockerfile_path']) {
|
|
3252
3277
|
if (args[field] !== undefined)
|
|
3253
3278
|
body[field] = args[field];
|
|
3254
3279
|
}
|
|
@@ -3829,9 +3854,29 @@ async function deployCustom(args) {
|
|
|
3829
3854
|
throw new Error('Generated builds require Dockerfile mode with a Git or directory source');
|
|
3830
3855
|
if ((args.static_output_dir !== undefined || args.static_spa !== undefined) && args.build_strategy !== 'node_npm_static')
|
|
3831
3856
|
throw new Error('Static options require node_npm_static');
|
|
3857
|
+
if (args.build_secrets !== undefined) {
|
|
3858
|
+
if (args.mode !== 'dockerfile' || !['dockerfile', 'node_npm', 'node_npm_static'].includes(String(args.build_strategy ?? 'dockerfile')))
|
|
3859
|
+
throw new Error('build_secrets requires a Dockerfile or npm source build');
|
|
3860
|
+
}
|
|
3861
|
+
if (args.npm_workspace !== undefined && !['node_npm', 'node_npm_static'].includes(String(args.build_strategy)))
|
|
3862
|
+
throw new Error('npm_workspace requires an npm recipe');
|
|
3832
3863
|
if (args.project_dir !== undefined && !['node_npm', 'node_npm_static', 'python_pip', 'php_composer'].includes(String(args.build_strategy)))
|
|
3833
3864
|
throw new Error('project_dir requires a generated recipe');
|
|
3834
3865
|
const body = { name, agent_id: agentId, mode };
|
|
3866
|
+
if (args.build_secrets !== undefined) {
|
|
3867
|
+
const values = args.build_secrets;
|
|
3868
|
+
if (!values || typeof values !== 'object' || Array.isArray(values) || Object.keys(values).length > 16)
|
|
3869
|
+
throw new Error('build_secrets must be an object of at most 16 strings');
|
|
3870
|
+
let bytes = 0;
|
|
3871
|
+
for (const [key, value] of Object.entries(values)) {
|
|
3872
|
+
if (!/^[A-Za-z][A-Za-z0-9_]{0,63}$/.test(key) || typeof value !== 'string' || !value || value.includes('\0') || Buffer.byteLength(value) > 65536)
|
|
3873
|
+
throw new Error('Invalid build secret name or value');
|
|
3874
|
+
bytes += Buffer.byteLength(value);
|
|
3875
|
+
}
|
|
3876
|
+
if (bytes > 262144)
|
|
3877
|
+
throw new Error('Build secrets exceed 256 KiB');
|
|
3878
|
+
body.build_secrets = values;
|
|
3879
|
+
}
|
|
3835
3880
|
if (args.build_strategy === 'php_composer') {
|
|
3836
3881
|
if (args.php_document_root !== undefined) {
|
|
3837
3882
|
const directory = args.php_document_root;
|
|
@@ -3892,6 +3937,23 @@ async function deployCustom(args) {
|
|
|
3892
3937
|
throw new Error('Public build variables exceed 16 KiB');
|
|
3893
3938
|
body.public_build_vars = vars;
|
|
3894
3939
|
}
|
|
3940
|
+
if (args.python_package_manager !== undefined) {
|
|
3941
|
+
if (typeof args.python_package_manager !== 'string' || !['pip', 'uv@0.12.15'].includes(args.python_package_manager) || args.build_strategy !== 'python_pip')
|
|
3942
|
+
throw new Error('python_package_manager requires python_pip and pip or uv@0.12.15');
|
|
3943
|
+
body.python_package_manager = args.python_package_manager;
|
|
3944
|
+
}
|
|
3945
|
+
if (args.node_package_manager !== undefined) {
|
|
3946
|
+
if (typeof args.node_package_manager !== 'string' || !/^(?:npm|pnpm@(?:10|11|12)\.[0-9]{1,4}\.[0-9]{1,4}|yarn@4\.[0-9]{1,4}\.[0-9]{1,4})$/.test(args.node_package_manager))
|
|
3947
|
+
throw new Error('node_package_manager requires an exact supported pin');
|
|
3948
|
+
if (!['node_npm', 'node_npm_static'].includes(String(args.build_strategy)) || (args.node_package_manager !== 'npm' && args.npm_workspace !== undefined))
|
|
3949
|
+
throw new Error('Pinned pnpm/Yarn requires a standalone Node recipe');
|
|
3950
|
+
body.node_package_manager = args.node_package_manager;
|
|
3951
|
+
}
|
|
3952
|
+
if (args.npm_workspace !== undefined) {
|
|
3953
|
+
if (typeof args.npm_workspace !== 'string')
|
|
3954
|
+
throw new Error('npm_workspace must be a string');
|
|
3955
|
+
body.npm_workspace = args.npm_workspace;
|
|
3956
|
+
}
|
|
3895
3957
|
if (args.project_dir !== undefined) {
|
|
3896
3958
|
if (typeof args.project_dir !== 'string')
|
|
3897
3959
|
throw new Error('project_dir must be a string');
|
|
@@ -3986,9 +4048,14 @@ async function deployCustom(args) {
|
|
|
3986
4048
|
throw new Error('Run impreza_prepare_compose and review the selected service and port first');
|
|
3987
4049
|
if (typeof args.target_port !== 'number' || !Number.isInteger(args.target_port) || args.target_port < 1 || args.target_port > 65535)
|
|
3988
4050
|
throw new Error('Compose target_port must be an integer from 1 to 65535');
|
|
3989
|
-
for (const field of ['image', 'manifest', 'git_url', 'dir', '
|
|
4051
|
+
for (const field of ['image', 'manifest', 'git_url', 'dir', 'dockerfile'])
|
|
3990
4052
|
if (args[field] !== undefined)
|
|
3991
4053
|
throw new Error('Compose cannot be combined with another deployment source');
|
|
4054
|
+
if (args.context_id !== undefined) {
|
|
4055
|
+
if (typeof args.context_id !== 'string' || !/^ctx_[a-f0-9]{1,36}$/.test(args.context_id))
|
|
4056
|
+
throw new Error('Invalid Compose context_id');
|
|
4057
|
+
body.context_id = args.context_id;
|
|
4058
|
+
}
|
|
3992
4059
|
body.compose_yaml = args.compose_yaml;
|
|
3993
4060
|
body.web_service = args.web_service;
|
|
3994
4061
|
body.compose_review_id = args.compose_review_id;
|