aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/cli.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-16 09:04:35 +0200
committerChocobozzz <me@florianbigard.com>2021-07-20 15:27:18 +0200
commit89d241a79c262b9775c233b73cff080043ebb5e6 (patch)
treecb3b6cb431d25d891ef4e02f66c61d252d17048f /server/tools/cli.ts
parentd23dd9fbfc4d26026352c10f81d2795ceaf2908a (diff)
downloadPeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.gz
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.tar.zst
PeerTube-89d241a79c262b9775c233b73cff080043ebb5e6.zip
Shorter server command names
Diffstat (limited to 'server/tools/cli.ts')
-rw-r--r--server/tools/cli.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/tools/cli.ts b/server/tools/cli.ts
index 163ed62d1..7d5eb72ed 100644
--- a/server/tools/cli.ts
+++ b/server/tools/cli.ts
@@ -15,8 +15,8 @@ const config = require('application-config')(configName)
15const version = require('../../../package.json').version 15const version = require('../../../package.json').version
16 16
17async function getAdminTokenOrDie (server: ServerInfo, username: string, password: string) { 17async function getAdminTokenOrDie (server: ServerInfo, username: string, password: string) {
18 const token = await server.loginCommand.getAccessToken(username, password) 18 const token = await server.login.getAccessToken(username, password)
19 const me = await server.usersCommand.getMyInfo({ token }) 19 const me = await server.users.getMyInfo({ token })
20 20
21 if (me.role !== UserRole.ADMINISTRATOR) { 21 if (me.role !== UserRole.ADMINISTRATOR) {
22 console.error('You must be an administrator.') 22 console.error('You must be an administrator.')
@@ -160,7 +160,7 @@ async function buildVideoAttributesFromCommander (server: ServerInfo, command: C
160 Object.assign(videoAttributes, booleanAttributes) 160 Object.assign(videoAttributes, booleanAttributes)
161 161
162 if (options.channelName) { 162 if (options.channelName) {
163 const videoChannel = await server.channelsCommand.get({ channelName: options.channelName }) 163 const videoChannel = await server.channels.get({ channelName: options.channelName })
164 164
165 Object.assign(videoAttributes, { channelId: videoChannel.id }) 165 Object.assign(videoAttributes, { channelId: videoChannel.id })
166 166
@@ -187,10 +187,10 @@ function buildServer (url: string): ServerInfo {
187} 187}
188 188
189async function assignToken (server: ServerInfo, username: string, password: string) { 189async function assignToken (server: ServerInfo, username: string, password: string) {
190 const bodyClient = await server.loginCommand.getClient() 190 const bodyClient = await server.login.getClient()
191 const client = { id: bodyClient.client_id, secret: bodyClient.client_secret } 191 const client = { id: bodyClient.client_id, secret: bodyClient.client_secret }
192 192
193 const body = await server.loginCommand.login({ client, user: { username, password } }) 193 const body = await server.login.login({ client, user: { username, password } })
194 194
195 server.accessToken = body.access_token 195 server.accessToken = body.access_token
196} 196}