@omnia/tooling-composers
Version:
Provide tooling to work with manifest things.
32 lines (31 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomServiceComposer = void 0;
const models_1 = require("./models");
const Utils_1 = require("./Utils");
const ServiceManifestRegistry_1 = require("./ServiceManifestRegistry");
const ServiceManifestComposer_1 = require("./ServiceManifestComposer");
class CustomServiceComposer extends ServiceManifestComposer_1.ServiceManifestComposer {
constructor(manifestId, manifestTitle, serviceOptions) {
// TODO wait hot reload update not execute composer two times
super(() => { return this; });
this.manifestId = manifestId;
this.manifestTitle = manifestTitle;
if (!Utils_1.Utils.isValidGuid(this.manifestId)) {
throw new Error("Can't register omnia service with id: " + this.manifestId + " must be a valid Guid");
}
let serviceInfo = {
description: serviceOptions.description,
id: manifestId,
serviceType: models_1.ServiceTypes.Custom,
title: manifestTitle,
optionalService: false
};
ServiceManifestRegistry_1.ServiceManifestRegistry.AddService(serviceInfo);
}
runHelm(cmd) {
ServiceManifestRegistry_1.ServiceManifestRegistry.getServiceInfo().helmCommand = cmd;
return this;
}
}
exports.CustomServiceComposer = CustomServiceComposer;