aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
authorJohn Livingston <38844060+JohnXLivingston@users.noreply.github.com>2021-12-03 10:14:01 +0100
committerGitHub <noreply@github.com>2021-12-03 10:14:01 +0100
commit3a1157a68a70e90df21f743ea15154805649b8e5 (patch)
tree16cf8151e6717f9025f53aec28c3a85c003377fb /shared
parent37cb07eae26b1b73b118e256df71243ae298fa72 (diff)
downloadPeerTube-3a1157a68a70e90df21f743ea15154805649b8e5.tar.gz
PeerTube-3a1157a68a70e90df21f743ea15154805649b8e5.tar.zst
PeerTube-3a1157a68a70e90df21f743ea15154805649b8e5.zip
CLI: plugins install command accept a --plugin-version parameter. (#4599)
* CLI: plugins install command accept a --plugin-version parameter. * Unit tests for plugins install --plugin-version. * Fix linting. * Styling Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'shared')
-rw-r--r--shared/extra-utils/server/plugins-command.ts5
-rw-r--r--shared/models/plugins/server/api/install-plugin.model.ts1
2 files changed, 4 insertions, 2 deletions
diff --git a/shared/extra-utils/server/plugins-command.ts b/shared/extra-utils/server/plugins-command.ts
index b944475a2..9bf24afff 100644
--- a/shared/extra-utils/server/plugins-command.ts
+++ b/shared/extra-utils/server/plugins-command.ts
@@ -158,15 +158,16 @@ export class PluginsCommand extends AbstractCommand {
158 install (options: OverrideCommandOptions & { 158 install (options: OverrideCommandOptions & {
159 path?: string 159 path?: string
160 npmName?: string 160 npmName?: string
161 pluginVersion?: string
161 }) { 162 }) {
162 const { npmName, path } = options 163 const { npmName, path, pluginVersion } = options
163 const apiPath = '/api/v1/plugins/install' 164 const apiPath = '/api/v1/plugins/install'
164 165
165 return this.postBodyRequest({ 166 return this.postBodyRequest({
166 ...options, 167 ...options,
167 168
168 path: apiPath, 169 path: apiPath,
169 fields: { npmName, path }, 170 fields: { npmName, path, pluginVersion },
170 implicitToken: true, 171 implicitToken: true,
171 defaultExpectedStatus: HttpStatusCode.OK_200 172 defaultExpectedStatus: HttpStatusCode.OK_200
172 }) 173 })
diff --git a/shared/models/plugins/server/api/install-plugin.model.ts b/shared/models/plugins/server/api/install-plugin.model.ts
index 5a268ebe1..a1d009a00 100644
--- a/shared/models/plugins/server/api/install-plugin.model.ts
+++ b/shared/models/plugins/server/api/install-plugin.model.ts
@@ -1,4 +1,5 @@
1export interface InstallOrUpdatePlugin { 1export interface InstallOrUpdatePlugin {
2 npmName?: string 2 npmName?: string
3 pluginVersion?: string
3 path?: string 4 path?: string
4} 5}