diff --git a/test/server/managers/plugins/Template/index.js b/test/server/managers/plugins/Template/index.js new file mode 100644 index 00000000..eea8bb34 --- /dev/null +++ b/test/server/managers/plugins/Template/index.js @@ -0,0 +1,36 @@ +/** + * Called on initialization of the plugin + * + * @param {import('../../../server/managers/PluginManager').PluginContext} context + */ +module.exports.init = async (context) => { + context.Logger.info('[TemplatePlugin] plugin initialized') + // Can be used to initialize plugin config and/or setup Database hooks +} + +/** + * Called when an extension action is triggered + * + * @param {import('../../../server/managers/PluginManager').PluginContext} context + * @param {string} actionName + * @param {string} target + * @param {Object} data + * @returns {Promise} + */ +module.exports.onAction = async (context, actionName, target, data) => { + context.Logger.info('[TemplatePlugin] plugin onAction', actionName, target, data) + return true +} + +/** + * Called when the plugin config page is saved + * + * @param {import('../../../server/managers/PluginManager').PluginContext} context + * @param {Object} config + * @returns {Promise} + */ +module.exports.onConfigSave = async (context, config) => { + context.Logger.info('[TemplatePlugin] plugin onConfigSave', config) + // Maintener is responsible for validating and saving the config to their `pluginInstance` + return true +} diff --git a/test/server/managers/plugins/Template/manifest.json b/test/server/managers/plugins/Template/manifest.json new file mode 100644 index 00000000..069f32c4 --- /dev/null +++ b/test/server/managers/plugins/Template/manifest.json @@ -0,0 +1,20 @@ +{ + "id": "e6205690-916c-4add-9a2b-2548266996eg", + "name": "Template", + "version": "1.0.0", + "owner": "advplyr", + "repositoryUrl": "https://github.com/advplr/abs-report-for-review-plugin", + "documentationUrl": "https://audiobookshelf.org/guides", + "description": "This is a minimal template for an abs plugin", + "extensions": [], + "config": {}, + "localization": {}, + "releases": [ + { + "version": "1.0.0", + "changelog": "Initial release", + "timestamp": "2022-01-01T00:00:00Z", + "downloadUrl": "" + } + ] +}