alwaysai
Version:
The alwaysAI command-line interface (CLI)
38 lines • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAppReleaseHistoryCliLeaf = void 0;
const alwayscli_1 = require("@alwaysai/alwayscli");
const cli_inputs_1 = require("../../cli-inputs");
const release_1 = require("../../components/release");
const util_1 = require("../../util");
exports.getAppReleaseHistoryCliLeaf = (0, alwayscli_1.CliLeaf)({
name: 'list',
description: 'Retrieve information about the application release',
namedInputs: {
yes: cli_inputs_1.yesCliInput,
project: (0, alwayscli_1.CliStringInput)({
description: 'Project ID',
required: true
})
},
async action(_, opts) {
const { yes, project } = opts;
const releaseHistory = await (0, release_1.fetchAppReleaseHistoryComponent)({
yes,
project
});
if (releaseHistory.length === 0) {
(0, util_1.echo)(`No releases found for project ${project}`);
return;
}
const releaseHistoryTable = releaseHistory.reduce((acc, release) => {
const { version, hash, name, created_at, size } = release;
const sizeWithUnits = size + ' B';
acc[version] = { name, hash, created_at, size: sizeWithUnits };
return acc;
}, []);
(0, util_1.echo)(`Retrieved application history for project ${project}`);
console.table(releaseHistoryTable);
}
});
//# sourceMappingURL=list.js.map