morbo-cli
Version:
… All tech debt is vermin in the eyes of Morbo!
20 lines (19 loc) • 1.22 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var graphql_request_1 = require("graphql-request");
function sendReport(payload, _a) {
var morboServerUri = _a.morboServerUri, projectId = _a.projectId;
if (!morboServerUri || !projectId)
return;
var createReportMutation = "\n mutation createReportMutation(\n $items: [ReportitemsReportItem!],\n $fileStats: Json,\n $projectId: ID,\n $linesOfCode: Int\n ) {\n createReport(\n items: $items,\n fileStats: $fileStats,\n projectId: $projectId,\n linesOfCode: $linesOfCode\n ) {\n id\n fileStats\n linesOfCode\n items {\n id\n commitData {\n id\n }\n }\n }\n }\n ";
var createReportVariables = {
projectId: projectId,
items: payload.results,
fileStats: JSON.stringify(payload.fileStats),
linesOfCode: payload.linesOfCode,
};
graphql_request_1.request(morboServerUri, createReportMutation, createReportVariables).then(function (data) {
console.log('🛸 Report transmitted sucessfully!');
});
}
exports.default = sendReport;