genezio
Version:
Command line utility to interact with Genezio infrastructure.
39 lines (38 loc) • 1.34 kB
JavaScript
import { log } from "../utils/logging.js";
import { TriggerType } from "../projectConfiguration/yaml/models.js";
import colors from "colors";
export var GenezioCommand;
(function (GenezioCommand) {
GenezioCommand["deploy"] = "deploy";
GenezioCommand["local"] = "local";
GenezioCommand["sdk"] = "sdk";
})(GenezioCommand || (GenezioCommand = {}));
export function reportSuccess(classesInfo) {
// print function urls
let printHttpString = "";
classesInfo.forEach((classInfo) => {
classInfo.methods.forEach((method) => {
if (method.type === TriggerType.http) {
printHttpString +=
` - ${classInfo.className}.${method.name}: ${colors.yellow(method.functionUrl)}` +
"\n";
}
});
});
if (printHttpString !== "") {
log.info("");
log.info("HTTP Methods Deployed:");
log.info(printHttpString);
}
}
export function reportSuccessFunctions(functions) {
let functionDeploymentsString = "";
functions.forEach((func) => {
functionDeploymentsString += ` - ${func.name}: ${colors.yellow(func.cloudUrl)}` + "\n";
});
if (functionDeploymentsString !== "") {
log.info("");
log.info("Functions Deployed:");
log.info(functionDeploymentsString);
}
}