run linter + wire up checkout
This commit is contained in:
parent
28bbc93f2b
commit
e56b46e889
4 changed files with 18 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
||||||
import {Command} from '@oclif/core'
|
import {Command} from '@oclif/core'
|
||||||
import {tokenFlags} from '../tokenFlags'
|
import {tokenFlags} from '../token-flags'
|
||||||
import {checkin} from '../kingoftime'
|
import {checkin} from '../kingoftime'
|
||||||
|
|
||||||
export default class Checkout extends Command {
|
export default class Checkout extends Command {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {Command, Flags} from '@oclif/core'
|
import {Command} from '@oclif/core'
|
||||||
import {tokenFlags} from '../tokenFlags'
|
import {tokenFlags} from '../token-flags'
|
||||||
|
import {checkout} from '../kingoftime'
|
||||||
|
|
||||||
export default class Checkout extends Command {
|
export default class Checkout extends Command {
|
||||||
static description = 'Check out'
|
static description = 'Check out'
|
||||||
|
@ -12,7 +13,6 @@ export default class Checkout extends Command {
|
||||||
|
|
||||||
public async run(): Promise<void> {
|
public async run(): Promise<void> {
|
||||||
const {flags} = await this.parse(Checkout)
|
const {flags} = await this.parse(Checkout)
|
||||||
console.log(`token: ${flags.token}`)
|
await checkout(flags.token, flags['user-token'])
|
||||||
console.log(`userToken: ${flags.userToken}`)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios'
|
||||||
|
|
||||||
const CHECK_IN_ID = 'qmXXCxw9WEWN3X/YrkMWuQ=='
|
const CHECK_IN_ID = 'qmXXCxw9WEWN3X/YrkMWuQ=='
|
||||||
const CHECK_OUT_ID = 'j8ekmJaw6W3M4w3i6hlSIQ=='
|
const CHECK_OUT_ID = 'j8ekmJaw6W3M4w3i6hlSIQ=='
|
||||||
|
@ -9,16 +9,16 @@ async function kingoftime(operationId: string, token: string, userToken: string)
|
||||||
// url: 'https://s2.kingtime.jp/gateway/bprgateway',
|
// url: 'https://s2.kingtime.jp/gateway/bprgateway',
|
||||||
url: 'https://httpbin.org/anything',
|
url: 'https://httpbin.org/anything',
|
||||||
headers: {
|
headers: {
|
||||||
'Accept': 'application/json, text/javascript, */*; q=0.01'
|
Accept: 'application/json, text/javascript, */*; q=0.01',
|
||||||
},
|
},
|
||||||
data: new URLSearchParams({
|
data: new URLSearchParams({
|
||||||
'id': operationId,
|
id: operationId,
|
||||||
'highAccuracyFlg': 'false',
|
highAccuracyFlg: 'false',
|
||||||
'credential_code': '40',
|
credential_code: '40', // eslint-disable-line camelcase
|
||||||
'user_token': userToken,
|
user_token: userToken, // eslint-disable-line camelcase
|
||||||
'version': '1.4.2',
|
version: '1.4.2',
|
||||||
'token': token
|
token: token,
|
||||||
})
|
}),
|
||||||
})
|
})
|
||||||
console.log(response.data)
|
console.log(response.data)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,11 +7,11 @@ export const tokenFlags = {
|
||||||
token: Flags.string({
|
token: Flags.string({
|
||||||
env: tokenVar,
|
env: tokenVar,
|
||||||
description: `Defaults to the ${tokenVar} environment variable.`,
|
description: `Defaults to the ${tokenVar} environment variable.`,
|
||||||
required: true
|
required: true,
|
||||||
}),
|
}),
|
||||||
'user-token': Flags.string({
|
'user-token': Flags.string({
|
||||||
env: userTokenVar,
|
env: userTokenVar,
|
||||||
description: `Defaults to the ${userTokenVar} environment variable.`,
|
description: `Defaults to the ${userTokenVar} environment variable.`,
|
||||||
required: true
|
required: true,
|
||||||
})
|
}),
|
||||||
}
|
}
|
Loading…
Reference in a new issue