diff --git a/lib/EnvoyAPI.js b/lib/EnvoyAPI.js index a9958fc..8692181 100644 --- a/lib/EnvoyAPI.js +++ b/lib/EnvoyAPI.js @@ -362,6 +362,24 @@ class EnvoyAPI { return EnvoyAPI.getDataFromBody(body); } + /** + * Fetches a plugin install. + * + * @param {number} installId + * @returns {Promise<{}>} + */ + async getPluginInstall(installId) { + return new Promise((resolve, reject) => { + this.request({ + method: 'GET', + url: `/api/v2/plugin-services/installs/${installId}`, + }).then(body => resolve(EnvoyAPI.getDataFromBody(body))) + .catch((error) => { + EnvoyAPI.safeRequestsError(error).catch((err) => reject(err)); + }); + }); + } + /** * Gets the plugin install's config. *