|
9 | 9 | this.base = base; |
10 | 10 | }; |
11 | 11 |
|
12 | | - OctoPrintPluginManagerClient.prototype.get = function (refresh, opts) { |
13 | | - console.log( |
14 | | - "Deprecated endpoint OctoPrint.plugin.pluginmanager.get, " + |
15 | | - "please use OctoPrint.plugin.pluginmanager.get*" |
16 | | - ); |
17 | | - var refresh_repo, refresh_notices, refresh_orphans; |
18 | | - if (_.isPlainObject(refresh)) { |
19 | | - refresh_repo = refresh.repo || false; |
20 | | - refresh_notices = refresh.notices || false; |
21 | | - refresh_orphans = refresh.orphans || false; |
22 | | - } else { |
23 | | - refresh_repo = refresh; |
24 | | - refresh_notices = false; |
25 | | - refresh_orphans = false; |
26 | | - } |
27 | | - |
28 | | - var query = []; |
29 | | - if (refresh_repo) query.push("refresh_repository=true"); |
30 | | - if (refresh_notices) query.push("refresh_notices=true"); |
31 | | - if (refresh_orphans) query.push("refresh_orphans=true"); |
32 | | - |
33 | | - return this.base.get( |
34 | | - this.base.getSimpleApiUrl("pluginmanager") + |
35 | | - (query.length ? "?" + query.join("&") : ""), |
36 | | - opts |
37 | | - ); |
38 | | - }; |
39 | | - |
40 | | - OctoPrintPluginManagerClient.prototype.getWithRefresh = function (opts) { |
41 | | - console.log( |
42 | | - "Deprecated endpoint OctoPrint.plugin.pluginmanager.getWithRefresh, " + |
43 | | - "please use OctoPrint.plugin.pluginmanager.get*" |
44 | | - ); |
45 | | - return this.get(true, opts); |
46 | | - }; |
47 | | - |
48 | | - OctoPrintPluginManagerClient.prototype.getWithoutRefresh = function (opts) { |
49 | | - console.log( |
50 | | - "Deprecated endpoint OctoPrint.plugin.pluginmanager.getWithoutRefresh, " + |
51 | | - "please use OctoPrint.plugin.pluginmanager.get*" |
52 | | - ); |
53 | | - return this.get(false, opts); |
54 | | - }; |
55 | | - |
56 | 12 | OctoPrintPluginManagerClient.prototype.getPlugins = function (refresh, opts) { |
57 | 13 | var url = this.base.getBlueprintUrl("pluginmanager") + "plugins"; |
58 | 14 | return this.base.get(url + (refresh ? "?refresh=true" : ""), opts); |
|
0 commit comments