install/unarchive: add support for various fields

This commit is contained in:
Girish Ramakrishnan
2024-12-10 17:30:23 +01:00
parent 9a155491cb
commit fbe334e7d7
4 changed files with 62 additions and 16 deletions
+5
View File
@@ -185,6 +185,9 @@ async function install(req, res, next) {
if ('enableTurn' in data && typeof data.enableTurn !== 'boolean') return next(new HttpError(400, 'enableTurn must be boolean'));
if ('cpuQuota' in data && data.cpuQuota !== 'number') return next(new HttpError(400, 'cpuQuota is not a number'));
if ('operators' in req.body && typeof req.body.operators !== 'object') return next(new HttpError(400, 'operators must be an object'));
let [error, result] = await safe(appstore.downloadManifest(data.appStoreId, data.manifest));
if (error) return next(BoxError.toHttpError(error));
@@ -195,6 +198,8 @@ async function install(req, res, next) {
data.appStoreId = result.appStoreId;
data.manifest = result.manifest;
delete data.archive; // internally used for archive code path
[error, result] = await safe(apps.install(data, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));