kot-sdk
v0.1.28
Published
Node.js SDK for King of Time Web API
Downloads
18
Maintainers
Readme
King of Time (KOT) SDK
Unofficial Node.js API client for King of Time Web API.
You can find the official web api spec here.
Supported Features
These are the list of supported features.
- [ ] Token service
- [ ] Company
- [ ] Admin
- [ ] Employee
- [x] Get
- [x] List
- [ ] Working
- [ ] Daily
- [ ] Record
- [x] Post record
- [ ] Schedule
- [ ] Record
- [ ] Monthly
- [ ] Record
- [ ] Schedule
- [ ] Yearly
- [ ] Daily
Please help me!
Install
You can install this SDK by npm
:
$ npm install kot-sdk
or by yarn
:
$ yarn add kot-sdk
Basic Usage
import Kot from 'kot-sdk'
const client = new Kot({token: 'YOUR_ACCESS_TOKEN'})
(async () => {
const employee = await client.employee.get({employeeCode: 100})
})()
Options
The list of the options are described below:
| Option | Description | Type | Default |
|-------------|--------------------------------------|-------------------------------------|------------------|
| baseURL
| Base URL of the King of Time Web API | https://api.kingtime.jp/v1.0
| |
| timeout
| Timeout in milliseconds. | 1000
(1
second) | |
| userAgent
| User Agent HTTP header value | KOT SDK/<RELEASE_VERSION>
| |
Note that this can be configured in multiple ways.
1. On instance creation
Pass as args as below:
const client = new Kot({
baseUrl: "https://my-proxy.com"
})
2. With method
Configure each configuration by the Kot
classes' method setXXX
:
const client = new Kot().setTimeout(10000)
Author
License
kot-sdk
is released under the BSD 3-Clause License. See details LICENSE.