@jetpropilots/kronos-client

1.2.20 • Public • Published

JetPro Kronos Client

HTTP client to interact with the Kronos REST API

Installation

npm install @jetpropilots/kronos-client

Configuration

Required ENV VARS

The client requires the following env variables to be set.

  • KRONOS_API
  • KRONOS_API_KEY
  • KRONOS_USERNAME
  • KRONOS_PASSWORD
  • KRONOS_PASSWORD
  • KRONOS_COMPANY

Optional ENV VARS

The client supports the following optional vars to use a proxy

  • PROXY_HOST
  • PROXY_PORT

Usage

Note: authentication is handled implicitly ( assuming the correct environment variables are set). Just call the methods you need and the client will login and refresh as needed.

const client = require('@jetpropilots/kronos-client')

async function main() {
  try {
    const data = await client.jobRequisitions()
    console.log('data', data)
    const first = data.job_requisitions[0]
    const detail = await client.jobRequisition(first.id)
    console.log('detail', detail)

    const employees = await client.getEmployees() // get all employees ( small dtos ... do not have all fields )
    console.log('employees', employees)
    const dto = employees[0] // get first employee for example
    console.log('dto', dto)
    const employee = await client.getEmployee(dto.id) // get full employee
    console.log('employee', employee)
    process.exit(0)
  } catch (e) {
    console.error(e)
    process.exit(-1)
  }
}

main()

Readme

Keywords

none

Package Sidebar

Install

npm i @jetpropilots/kronos-client

Weekly Downloads

0

Version

1.2.20

License

MIT

Unpacked Size

44.1 kB

Total Files

10

Last publish

Collaborators

  • tooanalytical
  • wickdninja