This commit is contained in:
Adam Millerchip 2023-04-27 00:30:46 +09:00
parent 71078c95a4
commit e6817ffbb2
3 changed files with 15 additions and 13 deletions

View file

@ -3,13 +3,11 @@ import {tokenFlags} from '../token-flags'
import {checkin} from '../kingoftime'
export default class Checkout extends Command {
static description = 'Check in'
static description = 'Check in';
static examples = [
'<%= config.bin %> <%= command.id %>',
]
static examples = ['<%= config.bin %> <%= command.id %>'];
static flags = tokenFlags
static flags = tokenFlags;
public async run(): Promise<void> {
const {flags} = await this.parse(Checkout)

View file

@ -3,13 +3,11 @@ import {tokenFlags} from '../token-flags'
import {checkout} from '../kingoftime'
export default class Checkout extends Command {
static description = 'Check out'
static description = 'Check out';
static examples = [
'<%= config.bin %> <%= command.id %>',
]
static examples = ['<%= config.bin %> <%= command.id %>'];
static flags = tokenFlags
static flags = tokenFlags;
public async run(): Promise<void> {
const {flags} = await this.parse(Checkout)

View file

@ -3,7 +3,11 @@ import axios from 'axios'
const CHECK_IN_ID = 'qmXXCxw9WEWN3X/YrkMWuQ=='
const CHECK_OUT_ID = 'j8ekmJaw6W3M4w3i6hlSIQ=='
async function kingoftime(operationId: string, token: string, userToken: string) {
async function kingoftime(
operationId: string,
token: string,
userToken: string,
) {
const response = await axios({
method: 'post',
// url: 'https://s2.kingtime.jp/gateway/bprgateway',
@ -27,7 +31,9 @@ export async function checkin(token: string, userToken: string): Promise<void> {
await kingoftime(CHECK_IN_ID, token, userToken)
}
export async function checkout(token: string, userToken: string): Promise<void> {
export async function checkout(
token: string,
userToken: string,
): Promise<void> {
await kingoftime(CHECK_OUT_ID, token, userToken)
}