From 0a03b0134eb064cd9c412e5a5c0b9641b0774af1 Mon Sep 17 00:00:00 2001 From: Nathan Fiscaletti Date: Tue, 15 Mar 2022 12:34:00 -0500 Subject: [PATCH] updates --- index.js | 5 +++++ lib/action-manager.js | 2 +- lib/receiver-manager.js | 2 +- notes.txt | 5 +---- templates/action.template.js | 2 +- templates/receiver.template.js | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 0000000..8c49947 --- /dev/null +++ b/index.js @@ -0,0 +1,5 @@ +const Peer = require(`./lib/peer`); +const Receiver = require(`./lib/receiver`); +const Action = require(`./lib/action`); + +module.exports = { Peer, Receiver, Action }; \ No newline at end of file diff --git a/lib/action-manager.js b/lib/action-manager.js index 5e3bbb3..bf4d2d8 100644 --- a/lib/action-manager.js +++ b/lib/action-manager.js @@ -11,7 +11,7 @@ class ActionManager extends ModuleManager { return new Promise((resolve, reject) => { try { const requirePath = this.pathsFor(name).requirePath; - const actionClass = require(path.relative(__dirname, requirePath))(require(`./action`)); + const actionClass = require(path.relative(__dirname, requirePath))(require(`../`)); const action = new actionClass(); action.name = name; resolve(action); diff --git a/lib/receiver-manager.js b/lib/receiver-manager.js index 14badcc..6d406c7 100644 --- a/lib/receiver-manager.js +++ b/lib/receiver-manager.js @@ -12,7 +12,7 @@ class ReceiverManager extends ModuleManager { return new Promise((resolve, reject) => { try { const requirePath = this.pathsFor(name).requirePath; - const receiverClass = require(path.relative(__dirname, requirePath))(Reciever); + const receiverClass = require(path.relative(__dirname, requirePath))(require(`../`)); const receiver = new receiverClass(); receiver.name = name; resolve(receiver); diff --git a/notes.txt b/notes.txt index 76f0bbc..48d40e9 100644 --- a/notes.txt +++ b/notes.txt @@ -15,16 +15,13 @@ To Do: fix tables when output is plain or json Rate limitting per peer notifications - ?? Commands for Schemas ?? - $ coattail action schema --action --peer - $ coattail token purge move colors to class or consts key rotation tls without hostname verification service stop command based on pwd non-headless coattail instances in service status don't show instance path unsubscribe functionality - add access to coattail api + transmit log messages when remotely executing an action Other Project Ideas: diff --git a/templates/action.template.js b/templates/action.template.js index 44224ac..4c6050d 100644 --- a/templates/action.template.js +++ b/templates/action.template.js @@ -1,4 +1,4 @@ -module.exports = (Action) => class extends Action { +module.exports = (Coattail) => class extends Coattail.Action { async perform(input) { // Perform action and return output. return { ...input }; diff --git a/templates/receiver.template.js b/templates/receiver.template.js index 2b20597..3c6eec8 100644 --- a/templates/receiver.template.js +++ b/templates/receiver.template.js @@ -1,4 +1,4 @@ -module.exports = (Receiver) => class extends Receiver { +module.exports = (Coattail) => class extends Coattail.Receiver { async onReceived(input) { // Handle input }