tuix-timesheets-api

0.15.0 • Public • Published

Tuix timesheets api

Description

Api Client for tuix timesheets api project

Installation

npm i tuix-timesheets-api

If you need to use the stagging api client, then use the command

npm i tuix-timesheets-api@staging

Check the available versions in the following link: https://www.npmjs.com/package/tuix-timesheets-api?activeTab=versions

Developing the app

Tested on

node 18
npm  9.6.7

Make an example request :

import { Configuration, ResponseError, TuixTimesheetsClientApi  } from 'tuix-timesheets-api';

const configuration = new Configuration({
  basePath: "https://staging-api-timesheets.tuix.ch",
  apiKey: "Bearer <JWT>"
});

const timesheetAPIClient = new TuixTimesheetsClientApi(configuration);

(async () => {
  try {
    const companies = await timesheetAPIClient.companiesGet()
    console.log({ companies });      
  } catch (error) {
    if(error instanceof ResponseError){    
      console.log(error.response.status, error.response.statusText);
      const data =  await error.response.json()
      console.log(data);      
    }
  }
})()

Readme

Keywords

Package Sidebar

Install

npm i tuix-timesheets-api

Weekly Downloads

198

Version

0.15.0

License

ISC

Unpacked Size

374 kB

Total Files

86

Last publish

Collaborators

  • tuixdevelopment