mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 02:09:37 +02:00
WIP plugins: update plugin
This commit is contained in:
parent
8d2be0ed7b
commit
b5f919ac8e
24 changed files with 389 additions and 90 deletions
|
@ -85,7 +85,7 @@ function installPlugin (parameters: {
|
|||
npmName?: string
|
||||
expectedStatus?: number
|
||||
}) {
|
||||
const { url, accessToken, npmName, path, expectedStatus = 204 } = parameters
|
||||
const { url, accessToken, npmName, path, expectedStatus = 200 } = parameters
|
||||
const apiPath = '/api/v1/plugins/install'
|
||||
|
||||
return makePostBodyRequest({
|
||||
|
@ -97,6 +97,25 @@ function installPlugin (parameters: {
|
|||
})
|
||||
}
|
||||
|
||||
function updatePlugin (parameters: {
|
||||
url: string,
|
||||
accessToken: string,
|
||||
path?: string,
|
||||
npmName?: string
|
||||
expectedStatus?: number
|
||||
}) {
|
||||
const { url, accessToken, npmName, path, expectedStatus = 200 } = parameters
|
||||
const apiPath = '/api/v1/plugins/update'
|
||||
|
||||
return makePostBodyRequest({
|
||||
url,
|
||||
path: apiPath,
|
||||
token: accessToken,
|
||||
fields: { npmName, path },
|
||||
statusCodeExpected: expectedStatus
|
||||
})
|
||||
}
|
||||
|
||||
function uninstallPlugin (parameters: {
|
||||
url: string,
|
||||
accessToken: string,
|
||||
|
@ -118,6 +137,7 @@ function uninstallPlugin (parameters: {
|
|||
export {
|
||||
listPlugins,
|
||||
installPlugin,
|
||||
updatePlugin,
|
||||
getPlugin,
|
||||
uninstallPlugin,
|
||||
getPluginSettings,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue