UNPKG

balena-sdk

Version:
23 lines (22 loc) 828 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getOsUpdateHelper = void 0; const device_actions_service_1 = require("../device-actions-service"); const OS_UPDATE_ACTION_NAME = 'resinhup'; const getOsUpdateHelper = function (deviceUrlsBase, request) { const deviceActionsService = new device_actions_service_1.DeviceActionsService(deviceUrlsBase, request); const startOsUpdate = (uuid, targetOsVersion, deviceActionsApiVersion) => { return deviceActionsService.startAction({ uuid, actionName: OS_UPDATE_ACTION_NAME, deviceActionsApiVersion, params: { target_version: targetOsVersion, }, }); }; return { startOsUpdate, }; }; exports.getOsUpdateHelper = getOsUpdateHelper;