]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/server/plugins-command.ts
Introduce videos command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / server / plugins-command.ts
index f06e58a22fda15835acf0be9aa0d7e3d1f94af19..5bed51d1a20edd9ef3c82ab952d404b1cbc52df0 100644 (file)
@@ -15,7 +15,6 @@ import {
   RegisteredServerSettings,
   ResultList
 } from '@shared/models'
-import { buildServerDirectory } from '../miscs'
 import { AbstractCommand, OverrideCommandOptions } from '../shared'
 
 export class PluginsCommand extends AbstractCommand {
@@ -45,6 +44,7 @@ export class PluginsCommand extends AbstractCommand {
         pluginType,
         uninstalled
       },
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -75,6 +75,7 @@ export class PluginsCommand extends AbstractCommand {
 
       path,
       query,
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -88,6 +89,7 @@ export class PluginsCommand extends AbstractCommand {
       ...options,
 
       path,
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -104,6 +106,7 @@ export class PluginsCommand extends AbstractCommand {
 
       path,
       fields: { settings },
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
     })
   }
@@ -117,6 +120,7 @@ export class PluginsCommand extends AbstractCommand {
       ...options,
 
       path,
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -131,6 +135,7 @@ export class PluginsCommand extends AbstractCommand {
       ...options,
 
       path,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -145,6 +150,7 @@ export class PluginsCommand extends AbstractCommand {
       ...options,
 
       path,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -161,6 +167,7 @@ export class PluginsCommand extends AbstractCommand {
 
       path: apiPath,
       fields: { npmName, path },
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -177,6 +184,7 @@ export class PluginsCommand extends AbstractCommand {
 
       path: apiPath,
       fields: { npmName, path },
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -192,6 +200,7 @@ export class PluginsCommand extends AbstractCommand {
 
       path: apiPath,
       fields: { npmName },
+      implicitToken: true,
       defaultExpectedStatus: HttpStatusCode.NO_CONTENT_204
     })
   }
@@ -203,6 +212,7 @@ export class PluginsCommand extends AbstractCommand {
       ...options,
 
       path,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200
     })
   }
@@ -222,6 +232,7 @@ export class PluginsCommand extends AbstractCommand {
 
       path,
       query,
+      implicitToken: false,
       defaultExpectedStatus: HttpStatusCode.OK_200,
       redirects: 0
     })
@@ -240,6 +251,6 @@ export class PluginsCommand extends AbstractCommand {
   }
 
   private getPackageJSONPath (npmName: string) {
-    return buildServerDirectory(this.server, join('plugins', 'node_modules', npmName, 'package.json'))
+    return this.server.serversCommand.buildDirectory(join('plugins', 'node_modules', npmName, 'package.json'))
   }
 }