UNPKG

nx

Version:

The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.

36 lines (35 loc) 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleRecordOutputsHash = handleRecordOutputsHash; exports.handleOutputsHashesMatch = handleOutputsHashesMatch; const outputs_tracking_1 = require("./outputs-tracking"); async function handleRecordOutputsHash(payload) { try { await (0, outputs_tracking_1.recordOutputsHash)(payload.data.outputs, payload.data.hash); return { description: 'recordOutputsHash', response: '{}', }; } catch (e) { return { description: 'recordOutputsHash failed', error: new Error(`Critical error when recording metadata about outputs: '${e.message}'.`), }; } } async function handleOutputsHashesMatch(payload) { try { const res = await (0, outputs_tracking_1.outputsHashesMatch)(payload.data.outputs, payload.data.hash); return { response: JSON.stringify(res), description: 'outputsHashesMatch', }; } catch (e) { return { description: 'outputsHashesMatch failed', error: new Error(`Critical error when verifying the contents of the outputs haven't changed: '${e.message}'.`), }; } }