File tree Expand file tree Collapse file tree 1 file changed +67
-1
lines changed
Expand file tree Collapse file tree 1 file changed +67
-1
lines changed Original file line number Diff line number Diff line change 1- import events from './events' ;
1+ import events from './events' ;
22import appStorage from './appStorage' ;
33
44/** Report rate limits in ms for different events */
@@ -1656,6 +1656,72 @@ class ApiClient {
16561656 } ) ;
16571657 }
16581658
1659+ /**
1660+ * Uninstalls a plugin
1661+ * @param {String } Id
1662+ * @param {String } Version
1663+ */
1664+ uninstallPluginByVersion ( id , version ) {
1665+ if ( ! id ) {
1666+ throw new Error ( 'null Id' ) ;
1667+ }
1668+
1669+ if ( ! version ) {
1670+ throw new Error ( 'null Version' ) ;
1671+ }
1672+
1673+ const url = this . getUrl ( `Plugins/${ id } /${ version } ` ) ;
1674+
1675+ return this . ajax ( {
1676+ type : 'DELETE' ,
1677+ url
1678+ } ) ;
1679+ }
1680+
1681+ /**
1682+ * Enables a plugin
1683+ * @param {String } Id
1684+ * @param {String } Version
1685+ */
1686+ enablePlugin ( id , version ) {
1687+ if ( ! id ) {
1688+ throw new Error ( 'null Id' ) ;
1689+ }
1690+
1691+ if ( ! version ) {
1692+ throw new Error ( 'null Id' ) ;
1693+ }
1694+
1695+ const url = this . getUrl ( `Plugins/${ id } /${ version } /Enable` ) ;
1696+
1697+ return this . ajax ( {
1698+ type : 'POST' ,
1699+ url
1700+ } ) ;
1701+ }
1702+
1703+ /**
1704+ * Disables a plugin
1705+ * @param {String } Id
1706+ * @param {String } Version
1707+ */
1708+ disablePlugin ( id , version ) {
1709+ if ( ! id ) {
1710+ throw new Error ( 'null Id' ) ;
1711+ }
1712+
1713+ if ( ! version ) {
1714+ throw new Error ( 'null Version' ) ;
1715+ }
1716+
1717+ const url = this . getUrl ( `Plugins/${ id } /${ version } /Disable` ) ;
1718+
1719+ return this . ajax ( {
1720+ type : 'POST' ,
1721+ url
1722+ } ) ;
1723+ }
1724+
16591725 /**
16601726 * Removes a virtual folder
16611727 * @param {String } name
You can’t perform that action at this time.
0 commit comments