UNPKG

pandora

Version:
61 lines 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class ServiceRepresentationChainModifier { constructor(representation) { this.representation = representation; } /** * Modify service's name * @param serviceName * @return {ServiceRepresentationChainModifier} */ name(serviceName) { this.representation.serviceName = serviceName; return this; } /** * Modify service's category * @param processName * @return {ServiceRepresentationChainModifier} */ process(processName) { this.representation.category = processName; return this; } /** * Modify service's config * @param configResolver * @return {ServiceRepresentationChainModifier} */ config(configResolver) { if ('function' === typeof configResolver) { this.representation.configResolver = configResolver; return this; } this.representation.config = configResolver; return this; } /** * modify service's dependencies * @param servicesName * @return {ServiceRepresentationChainModifier} */ dependency(servicesName) { this.representation.dependencies = this.representation.dependencies || []; if (Array.isArray(servicesName)) { this.representation.dependencies.push.apply(this.representation.dependencies, servicesName); return this; } this.representation.dependencies.push(servicesName); return this; } /** * Publish this service upon IPC-Hub * @param {boolean} enable */ publish(enable = true) { this.representation.publishToHub = enable; } } exports.ServiceRepresentationChainModifier = ServiceRepresentationChainModifier; //# sourceMappingURL=ServiceRepresentationChainModifier.js.map