aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/server/plugins.ts22
1 files changed, 21 insertions, 1 deletions
diff --git a/shared/extra-utils/server/plugins.ts b/shared/extra-utils/server/plugins.ts
index 6cd7cd17a..1da313ab7 100644
--- a/shared/extra-utils/server/plugins.ts
+++ b/shared/extra-utils/server/plugins.ts
@@ -85,7 +85,7 @@ function installPlugin (parameters: {
85 npmName?: string 85 npmName?: string
86 expectedStatus?: number 86 expectedStatus?: number
87}) { 87}) {
88 const { url, accessToken, npmName, path, expectedStatus = 204 } = parameters 88 const { url, accessToken, npmName, path, expectedStatus = 200 } = parameters
89 const apiPath = '/api/v1/plugins/install' 89 const apiPath = '/api/v1/plugins/install'
90 90
91 return makePostBodyRequest({ 91 return makePostBodyRequest({
@@ -97,6 +97,25 @@ function installPlugin (parameters: {
97 }) 97 })
98} 98}
99 99
100function updatePlugin (parameters: {
101 url: string,
102 accessToken: string,
103 path?: string,
104 npmName?: string
105 expectedStatus?: number
106}) {
107 const { url, accessToken, npmName, path, expectedStatus = 200 } = parameters
108 const apiPath = '/api/v1/plugins/update'
109
110 return makePostBodyRequest({
111 url,
112 path: apiPath,
113 token: accessToken,
114 fields: { npmName, path },
115 statusCodeExpected: expectedStatus
116 })
117}
118
100function uninstallPlugin (parameters: { 119function uninstallPlugin (parameters: {
101 url: string, 120 url: string,
102 accessToken: string, 121 accessToken: string,
@@ -118,6 +137,7 @@ function uninstallPlugin (parameters: {
118export { 137export {
119 listPlugins, 138 listPlugins,
120 installPlugin, 139 installPlugin,
140 updatePlugin,
121 getPlugin, 141 getPlugin,
122 uninstallPlugin, 142 uninstallPlugin,
123 getPluginSettings, 143 getPluginSettings,