/** * @author Martin Karkowski * @email m.karkowski@zema.de * @create date 2021-02-09 10:12:37 * @modify date 2021-02-09 10:15:07 * @desc [description] */ import { hostname } from "os"; import { join, resolve } from "path"; import { createFile } from "../../../lib/helpers/fileMethods"; const name = hostname(); const config = { functions: [], packages: [ { nameOfPackage: "bridgeLayer", defaultInstances: [ { options: { identifier: ("wamo-" + name + "-bridge").toLowerCase(), params: "http://localhost:7000", type: "AdditionalBridgeModule" }, selector: "AdditionalBridgeModule" } ], autostart: {}, path: "dist\\modules\\bridge\\src\\bridge.package.js" }, { nameOfPackage: "beckhoffPackage", defaultInstances: [ { options: { identifier: name, params: [ { port: 48898, amsPortSource: 32905, amsPortTarget: 851, timeout: 5000, amsNetIdTarget: "1.1.1.1.1.1", amsNetIdSource: "2.2.2.2.2.2", host: "localhost", twinCatVersion: 3 } ], type: "BeckhoffPlc" }, selector: "BeckhoffPlc" } ], autostart: {}, path: "dist\\modules\\mod-Beckhoff-PLC-Interface\\src\\beckhoff.package.js" }, { nameOfPackage: "mqttBrokerPackage", defaultInstances: [ { options: { identifier: ("wamo-" + name + "-mqtt-broker").toLowerCase(), params: [], type: "MQTTBrokerModule" }, selector: "MQTTBrokerModule" } ], autostart: {}, path: "dist\\modules\\mqtt-broker\\src\\mqtt.broker.package.js" } ] }; const pubSubConfig = { nameOfPackage: "pubsubPackage", defaultInstances: [ { options: { identifier: "pub-sub-system", params: [], type: "PubSubModule" } } ], autostart: {}, path: "dist\\modules\\pub-sub\\src\\pub-sub.package.js" }; // Define the Filename for the Configuration const filename: string = join( resolve(process.cwd()), "config", "settings.json" ); createFile(filename, JSON.stringify(config, undefined, 4)).then(() => console.log("Created Configuartion in", filename) );