import React from 'react'; import { Argv } from 'yargs'; import { PrettyRequest, App, ApiMethodLabel } from '../../ui'; import { RootResources } from '@eximchain/dappbot-types/spec/methods'; import { commandFromSampleArgs, describePositionalArgs, fastRender } from '../../services'; import { ArgShape } from '../../cli'; import { Login } from '@eximchain/dappbot-types/spec/methods/auth'; export const commandName = `${RootResources.auth}/login`; export const command = commandFromSampleArgs(commandName, Login.newArgs()); export const desc = 'Login to DappBot.'; export function builder(yargs: Argv) { describePositionalArgs(yargs, Login.newArgs()); } export function handler(args: ArgShape) { fastRender( { let { username, password } = args; return ( API.auth.login.resource({ username, password })} /> ) }} /> ) }