1.2.19 • Published 11 months ago

@jetpropilots/kronos-client v1.2.19

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

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()
1.2.18

11 months ago

1.2.19

11 months ago

1.2.16

1 year ago

1.2.17

11 months ago

1.2.15

1 year ago

1.2.9

2 years ago

1.2.12

1 year ago

1.2.13

1 year ago

1.2.10

2 years ago

1.2.14

1 year ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.2.1

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago