aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/cli.ts
diff options
context:
space:
mode:
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}