Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

clockodo

peerigon457MIT25.0.0TypeScript support: included

Unofficial JavaScript/TypeScript SDK for Clockodo

time tracking, api, sdk

readme

Clockodo

Unofficial JavaScript/TypeScript SDK for Clockodo.

Version on NPM Semantically released Monthly downloads on NPM
NPM Bundle size minified NPM Bundle size minified and gzipped
License

Installation and usage

npm install clockodo

For the constructor arguments, you must get the user (email) and clockodo API key from the "My area" section of Clockodo's website.

import { Clockodo } from "clockodo";

const clockodo = new Clockodo({
  client: {
    // You need to add some information about yourself that will be
    // sent along every request,
    // see https://www.clockodo.com/en/api/ "Client identification"
    // PLEASE NOTE: name + ";" + email must not be longer than 50 characters.
    name: "Your application/company",
    email: "technical-contact@your-company.com",
  },
  authentication: {
    user: "test-user@example.com",
    // You can get your API key from https://my.clockodo.com/en/users/editself
    apiKey: "kjfdskj643fgnlksf343kdslm",
  },
});

Config

  • client: Specify a name and an email for the X-Clockodo-External-Application header
  • authentication: Specify a user and an apiKey to authenticate every request
  • baseUrl: Points to the Clockodo API. Defaults to https://my.clockodo.com/api

You can update the configuration later like this:

clockodo.api.config({
  authentication: {
    /* ... */
  },
});

API

We have provided methods for each of the endpoints available by the Clockodo API. In order to provide a seamless API to JavaScript, we renamed the request and response object keys from what you will see in the Clockodo docs by removing special characters and converting to camel casing. If you are interested, you can find the mappings in the mappings.ts file.

For any questions about the different properties please consult the official Clockodo-API.

Some constants are also available for import:

import { AbsenceStatus, AbsenceType, Billability, EntryType } from "clockodo";

console.log(EntryType.Time); // 1
console.log(EntryType.LumpsumValue); // 2
console.log(EntryType.LumpsumService); // 3

console.log(Billability.NotBillable); // 0
console.log(Billability.Billable); // 1
console.log(Billability.Billed); // 2

Checkout models for more constants and TypeScript types.


Get Methods

getAbsence()

Gets a selected absence by its ID.

Example:

await clockodo.getAbsence({ id: 7 });

getUsersAccessCustomersProjects()

Gets a user's (readonly) access rights for customers and projects.

Example:

await clockodo.getUsersAccessCustomersProjects({ usersId: 67325 });

getUsersAccessServices()

Gets a user's (readonly) access rights for services.

Example:

await clockodo.getUsersAccessServices({ usersId: 67325 });

getAbsences()

Gets a list of absences in the provided year

Example:

await clockodo.getAbsences({ year: 2018 });

getClock()

Get currently running entry for the credentials attached to Clockodo object.

Example:

await clockodo.getClock();

getCustomer()

Get specific customer by ID

Example:

await clockodo.getCustomer({ id: 777 });

getCustomers()

Get all customers from all pages.

Example:

await clockodo.getCustomers();
// or
await clockodo.getCustomers({
  // Filter by active flag
  filterActive: true,
});

getCustomersPage()

Get all customers from a specific page.

Example:

await clockodo.getCustomersPage({ page: 2 });

getEntry()

Get an entry by its ID.

Example:

await clockodo.getEntry({ id: 4 });

getEntries()

Get all entries from all pages.

Example:

import { Billability } from "clockodo";

await clockodo.getEntries({
  // timeSince and timeUntil are required
  timeSince: "2017-08-18T00:00:00Z",
  timeUntil: "2018-02-09T00:00:00Z",
  // You can also add additional filters here
  filterBillable: Billability.Billed,
});

getEntriesPage()

Get all entries from a specific page

Example:

await clockodo.getEntriesPage({
  timeSince: "2017-08-18T00:00:00Z",
  timeUntil: "2018-02-09T00:00:00Z",
  page: 2,
});

getEntryGroups()

Get a group of entries defined by your criteria.

Example:

await clockodo.getEntryGroups({
  timeSince: "2017-08-18T00:00:00Z",
  timeUntil: "2018-02-09T00:00:00Z",
  grouping: ["customersId", "projectsId"],
  roundToMinutes: 15,
});

getEntriesTexts()

Retreive all descriptions (and no additional info) entered for time and lump sum entries from all pages.

Example:

await clockodo.getEntriesTexts({ text: "meeting with client" });

getEntriesTextsPage()

Retreive all descriptions from a specific page.

Example:

await clockodo.getEntriesTextsPage({ text: "meeting with client", page: 2 });

getProject()

Get a project by its ID.

Example:

await clockodo.getProject({ id: 1985 });

getProjects()

Get all projects from all pages.

Example:

await clockodo.getProjects();
// or
await clockodo.getProjects({
  // Filter by a specific customer id
  filterCustomersId: 123,
  // Filter by active flag
  filterActive: true,
});

getProjectsPage()

Get all projects from a specific page.

Example:

await clockodo.getProjectsPage({ page: 2 });

getService()

Get a service by its ID.

Example:

await clockodo.getService({ id: 10 });

getServices()

Get list of all services

Example:

await clockodo.getServices();

getTeam()

Get team by id.

Example:

await clockodo.getTeam({ id: 10 });

getTeams()

Get list of all teams.

Example:

await clockodo.getTeams();

getLumpSumService()

Get a lumpsum service by its ID.

Example:

await clockodo.getLumpSumService({ id: 10 });

getLumpSumServices()

Get a list of all lumpsum services

Example:

await clockodo.getLumpSumServices();

getTargethoursRow()

Get a specific target hour period for a specific user by its ID (not the ID of the user)

Example:

await clockodo.getTargethoursRow({ id: 1234 });

getTargethours()

Get list of target hours for all users, with option to pass an object with an usersId to filter the history of target hours to a specific user.

Example:

await clockodo.getTargethours();
// or
await clockodo.getTargethours({ usersId: 346923 });

getUser()

Get a co-worker by their ID.

Example:

await clockodo.getUser({ id: 1263 });

getUsers()

Get list of users

Example:

await clockodo.getUsers();

getUserReport()

Get a co-worker by their ID.

Example:

await clockodo.getUserReport({ usersId: 1263, year: 2017 });

getUserReports()

Get an employee/user's report, which contains data such as hours worked and holidays taken.

Example:

await clockodo.getUserReports({ year: 2017, type: 1 });

getNonbusinessGroups()

With this resource you can read all nonbusiness groups. The editing and adding of nonbusiness groups is currently not possible.

Example:

await clockodo.getNonbusinessGroups();

getNonbusinessDays()

With this resource you can read all nonbusiness days. The editing and adding of nonbusiness days is currently not possible.

Example:

await clockodo.getNonbusinessDays({
  nonbusinessgroupsId: 123,
  year: 2021,
});

getAggregatesUsersMe()

With this resource you can read user and company seetings for the logged in user. Editing is currently not possible.

Example:

await clockodo.getAggregatesUsersMe();

Post Methods

addAbsence()

Default behavior adds an absence for the user attached to the credentials given to the clockodo object. To add the absence for another user you can use the usersId option if you have the permissions.

Example:

import { AbsenceType } from "clockodo";

await clockodo.addAbsence({
  dateSince: "2017-08-18T00:00:00Z",
  dateUntil: "2018-02-09T00:00:00Z",
  type: AbsenceType.SpecialLeave,
  note: "elternzeit",
  usersId: 12321,
});

addCustomer()

Adds a customer to the organization.

Example:

await clockodo.addCustomer({ name: "Weyland-Yutani" });

addEntry()

Creates an entry for either the user attached to the Clockodo instance or the passed in usersId. Depending on the type of entry different properties are required:

Type of entry Required properties
Manual time entry customersId, servicesId, billable, timeSince, timeUntil
Lumpsum value entry customersId, servicesId, billable, timeSince, lumpsum
Lumpsum service entry customersId, lumpsumServicesAmount, lumpsumServicesId, billable, timeSince

Example:

import { Billability } from "clockodo";

await clockodo.addEntry({
  customersId: 1,
  servicesId: 2,
  billable: Billability.Billable,
  timeSince: "2018-10-01T00:00:00Z",
  timeUntil: "2018-10-01T03:00:00Z",
});

addProject()

Creates a project for an existing customer.

Example:

await clockodo.addProject({ name: "Clockodo Api Wrapper", customersId: 1 });

addService()

Adds to the list of services offered by your organization.

Example:

await clockodo.addService({ name: "Thinking" });

addTeam()

Creates a new team under your organization.

Example:

await clockodo.addTeam({ name: "Gold Team" });

addUser()

Creates new user in organization.

Example:

import { UserRole } from "clockodo";

await clockodo.addUser({
  name: "Merkel",
  number: "08",
  email: "angela@eu.eu",
  role: UserRole.Owner,
});

startClock()

Start a new running clockodo entry.

Example:

import { Billability } from "clockodo";

await clockodo.startClock({
  customersId: 24,
  servicesId: 7,
  projectsId: 365,
  billable: Billability.Billable,
});

Put methods

changeClockDuration()

Changes the duration of an entry. Because the ID returned by clock methods is just the entry ID, and this function can only be used after an entry is finished, there seems to be no difference from using editEntry().

Example:

await clockodo.changeClockDuration({
  entriesId: 7082,
  duration: 540,
  durationBefore: 300,
});

editAbsence()

Edit existing Clockodo absence.

Example:

await clockodo.editAbsence({ id: 74, note: "I know what he did last summer" });

editCustomer()

Edit existing Clockodo customer.

Example:

await clockodo.editCustomer({ id: 15, name: "The Mystery Gang" });

editEntry()

Changes the values of a Clockodo entry. Unlike changeClockDuration(), editEntry() can seemingly mutate any of the accepted parameters even when the entry is running.

Example:

await clockodo.editEntry({ id: 365, duration: 540 });

editEntryGroup()

Allows for mass edit of entries based on a set of filters.

Example:

import { Billability } from "clockodo";

await clockodo.editEntryGroup({
  timeSince: "2017-08-18T00:00:00Z",
  timeUntil: "2018-02-09T00:00:00Z",
  filterText: "Browsing Reddit",
  billable: Billability.NotBillable,
});

editProject()

Edit existing project.

Example:

await clockodo.editProject({ id: 20, name: "Awesome new project" });

editService()

Edit existing service.

Example:

await clockodo.editService({ id: 23, name: "Room Service" });

editTeam()

Edit existing team.

Example:

await clockodo.editTeam({ id: 6324, name: "New Team Name" });

editUser()

Edit existing user.

Example:

await clockodo.editUser({ id: 33, name: "Moalo Loco" });

Delete methods

deleteCustomer()

Deletes the customer.

Example:

await clockodo.deleteCustomer({ id: 343 });

deleteProject()

Deletes the project.

Example:

await clockodo.deleteProject({ id: 8 });

deleteService()

Deletes the service.

Example:

await clockodo.deleteService({ id: 94 });

deleteUser()

Deletes user.

Example:

await clockodo.deleteUser({ id: 7 });

deleteAbsence()

Deletes absence (go figure).

Example:

await clockodo.deleteAbsence({ id: 31 });

deleteEntry()

Deletes a single entry by ID

Example:

await clockodo.deleteEntry({ id: 543512 });

deleteTeam()

Deletes a team by ID

Example:

await clockodo.deleteTeam({ id: 764 });

deleteEntryGroup()

Deletes one or more entries based on a series of filters that builds an "entry group".

Example:

await clockodo.deleteEntryGroup({
  timeSince: "2017-08-18T00:00:00Z",
  timeUntil: "2018-02-09T00:00:00Z",
  text: "chilin everyday",
});

register()

Creates a new clockodo account.

Example:

await clockodo.register({
  companiesName: "Acme Corporation",
  name: "Road Runner",
  email: "runner@acme.com",
});

stopClock()

Stops a running clock/entry.

Example for self:

await clockodo.stopClock({ entriesId: 7082 });

Example for another user (needs requesting user to be owner):

await clockodo.stopClock({ entriesId: 7082, usersId: 123 });

Development

To run integration tests you need to create an .env by copying the .env.example and entering credentials of a dev-user, as you don't want to mess up your real clockodo data.

License

MIT

Sponsors

changelog

25.0.0 (2025-03-07)

chore

  • Add @peerigon/configs for linting (b71843c)
  • Refactor and update (#161) (859e894)
  • Switch TypeScript lib option to "es2021" (faa5b7c)
  • Use TypeScript config from @peerigon/configs (b8aa1be)

BREAKING CHANGES

  • The TypeScript target has now been set to ES2022. The package must be transpiled for older runtimes.
  • editCustomer() and editLumpsumService() return a type now instead of implicit any
  • Throw TypeError instead of Error where appropiate
  • We expect String.prototype.replaceAll to be present. According to MDN, that's baseline.
  • Changed api config method to a setter and getter property
  • Removed Axios options from api methods. We plan to remove Axios in the future. You can pass headers instead of Axios options as third parameter to post, put and delete now.
  • Updated TypeScript which might affect the generated code.
  • Updated Faker and mocks. This will change the produced mock data in case you snapshotted it.

25.0.0-beta.3 (2025-03-07)

Features

24.2.0 (2025-03-07)

Features

24.1.0 (2025-03-07)

Features

  • Add year filter for holidays-quota query (#149) (5a643a0)

25.0.0-beta.2 (2025-02-08)

chore

  • Add @peerigon/configs for linting (b71843c)
  • Switch TypeScript lib option to "es2021" (faa5b7c)
  • Use TypeScript config from @peerigon/configs (b8aa1be)

BREAKING CHANGES

  • The TypeScript target has now been set to ES2022. The package must be transpiled for older runtimes.
  • editCustomer() and editLumpsumService() return a type now instead of implicit any
  • Throw TypeError instead of Error where appropiate
  • We expect String.prototype.replaceAll to be present. According to MDN, that's baseline.

25.0.0-beta.1 (2025-02-07)

chore

BREAKING CHANGES

  • Changed api config method to a setter and getter property
  • Removed Axios options from api methods. We plan to remove Axios in the future. You can pass headers instead of Axios options as third parameter to post, put and delete now.
  • Updated TypeScript which might affect the generated code.
  • Updated Faker and mocks. This will change the produced mock data in case you snapshotted it.

24.0.0 (2025-02-07)

chore

BREAKING CHANGES

  • Dropped official Node 16 support. We don't know of an actual breaking change, but you're on your own now :)

23.5.1 (2023-12-05)

Bug Fixes

  • set default holidayscount and target hours (b1d0bfb)
  • set default holidayscount and target hours (#153) (98c5f15)

23.5.0 (2023-12-04)

Features

  • added users default holidaycount and targethours (2439f40)
  • added users default holidaycount and targethours (#137) (e96713d)

23.4.0 (2023-12-04)

Features

23.3.0 (2023-11-29)

Features

23.2.0 (2023-11-29)

Features

23.1.0 (2023-11-29)

Features

  • Add surcharge model and api request handlers (#124) (4447bc2)

23.0.0 (2023-11-21)

Bug Fixes

  • Rename HolidaysQuota and HolidaysCarryover (#145) (16543bf)

BREAKING CHANGES

  • We've renamed HolidayscarryRow to HolidaysCarryover and HolidaysquotaRow to HolidaysQuota and adjusted all method names accordingly to make the naming more consistent.

22.2.0 (2023-11-06)

Features

  • Use v3 API for services and lumpsum services (#131) (1a8ba9d)

22.1.0 (2023-11-06)

Features

  • Add testData property to targethoursRow (#140) (9c2e511)

22.0.0 (2023-10-24)

Features

  • Replace deactivate... with delete... (67e0b33)

BREAKING CHANGES

  • There are no deactivate... methods anymore. In order to deactivate a customer, project, ..., you need to call edit... with active: false.

21.15.0 (2023-10-24)

Features

  • Add overtimecarry endpoint (db9aca4)
  • added overtimecarry model and api request (b062946)

21.14.0 (2023-10-24)

Features

  • Add holidaysquota and holidayscarry endpoints (f342c2f), closes #31

21.13.0 (2023-10-16)

Features

  • expand workTimes model with new property (828a6e7)

21.12.0 (2023-09-26)

Features

  • nonbusinessgroupsId is now optional for getNonbusinessDays (fe6384a)
  • nonbusinessgroupsId is now optional for the getNonbusinessDays API call (cf98a8c)

21.11.0 (2023-09-14)

Features

21.10.4 (2023-09-13)

Bug Fixes

  • Incorrect pagination types (d5ddd74)
  • Incorrect pagination types (412d610)

21.10.3 (2023-09-13)

Bug Fixes

  • Incorrect AccessToCustomersProjects type (a3c9574)
  • make top-level props accept false (3c31fa3)

21.10.2 (2023-09-13)

Bug Fixes

  • Incorrect type of company.worktimeForceBreaks (2c699dd)
  • move comments (f281997)
  • use work time force breaks enum (3a7b396)

21.10.1 (2023-09-12)

Bug Fixes

21.10.0 (2023-09-12)

Features

  • Add upcoming allowEntryOverlaps to company type (5b76f64)
  • Add upcoming allowEntryOverlaps to company type (73ee73c)

21.9.0 (2023-09-06)

Features

  • adjust absence, targethours and nonbusinessday APIs to handle multiple ids at once (b571c21)
  • Support filtering by multiple ids (567bb22)

21.8.0 (2023-09-06)

Features

  • edit test for omitted billable feature (d8689ad)
  • support default configured billable (da085fa)
  • Support omitting billable from startClock() (6b73818)

21.7.0 (2023-08-09)

Features

  • expose nonbusiness group model (eb4e568)

21.6.0 (2023-07-28)

Bug Fixes

  • make mocks more consistent (1fd9177)

Features

21.5.1 (2023-07-19)

Bug Fixes

  • Incorrect absence and user types (91a00b8)

21.5.0 (2023-07-11)

Bug Fixes

  • Remove status from required properties of addWorkTimesChangeRequest() (40bd5cd)
  • Remove status from required properties of addWorkTimesChangeRequest() (65dbd8e)

Features

  • add optional param to type (d4cb3c6)
  • Improve types of getTargethours() (3ecfb8f)

21.4.0 (2023-07-10)

Features

  • add boss prop to user model (dcc7e15)
  • Add boss reference to user model (aa66df7)

21.3.0 (2023-07-10)

Bug Fixes

  • Use v2 endpoint for entrygroups (and adjust types) (1647db4)

Features

  • update entrygroups endpoints (82ff3b4)

21.2.0 (2023-06-07)

Bug Fixes

  • rename workTimeEditLock prop (4d83f26)

Features

  • add status prop to change request model (315a4a0)

21.1.0 (2023-06-01)

Features

  • add withdrawWorkTimeChangeRequest method (#105) (1b5eade)

21.0.1 (2023-04-11)

Bug Fixes

21.0.0 (2023-04-11)

Bug Fixes

  • add approvedImmediately=false case (2cb939b)
  • add comment (781c6a1)
  • add mock functions export (53c38a4)
  • add mocks for workTimes (6752007)
  • change error message to have type correctly (2f2c88e)
  • correct return type of approve/decline (671d4c0)
  • Improve AddWorkTimesChangeRequestReturnType type (0620097)
  • Incorrect param type of addWorkTimesChangeRequest() (18fddb1)
  • make mock generation slimmer (09016c9)
  • reflect concept changes (8ba8355)
  • return single mock instead of array (fee1ff2)
  • update user mock (1a4864e)

Features

  • add workTimeEditLock prop to User (89c3c86)
  • Add workTimes API methods (#101) (8bbca40)
  • add workTimes types (4c8f6e4)
  • expand change request return type (d337cc3)
  • Expose team types (952f700)
  • Improve workTimes mocks (3499590)
  • Introduce special IsoDate and IsoUtcDateTime types (6fe88e2)
  • parametrize user mock's workTimeEditLock (f976f7f)
  • Update Node (40f81b6)

BREAKING CHANGES

  • Removed official Node 14 support. We don't know of an actual breaking change for Node 14, but it might happen in future releases.

21.0.0-beta.1 (2023-04-11)

Bug Fixes

  • add approvedImmediately=false case (2cb939b)
  • add comment (781c6a1)
  • add mock functions export (53c38a4)
  • add mocks for workTimes (6752007)
  • change error message to have type correctly (2f2c88e)
  • correct return type of approve/decline (671d4c0)
  • Improve AddWorkTimesChangeRequestReturnType type (0620097)
  • Incorrect param type of addWorkTimesChangeRequest() (18fddb1)
  • make mock generation slimmer (09016c9)
  • reflect concept changes (8ba8355)
  • return single mock instead of array (fee1ff2)
  • update user mock (1a4864e)

Features

  • add workTimeEditLock prop to User (89c3c86)
  • Add workTimes API methods (#101) (8bbca40)
  • add workTimes types (4c8f6e4)
  • expand change request return type (d337cc3)
  • Expose team types (952f700)
  • Improve workTimes mocks (3499590)
  • Introduce special IsoDate and IsoUtcDateTime types (6fe88e2)
  • parametrize user mock's workTimeEditLock (f976f7f)
  • Update Node (40f81b6)

BREAKING CHANGES

  • Removed official Node 14 support. We don't know of an actual breaking change for Node 14, but it might happen in future releases.

20.0.0 (2023-04-06)

Bug Fixes

BREAKING CHANGES

  • moduleTargetHours and moduleUserReports have been replaced by moduleWorkTime

20.0.0-beta.11 (2023-03-23)

Bug Fixes

20.0.0-beta.10 (2023-03-23)

Features

  • parametrize user mock's workTimeEditLock (f976f7f)

20.0.0-beta.9 (2023-03-23)

Bug Fixes

  • correct return type of approve/decline (671d4c0)

20.0.0-beta.8 (2023-03-23)

Bug Fixes

  • add approvedImmediately=false case (2cb939b)

20.0.0-beta.7 (2023-03-23)

Bug Fixes

Features

  • add workTimeEditLock prop to User (89c3c86)

20.0.0-beta.6 (2023-03-22)

Features

  • expand change request return type (d337cc3)

20.0.0-beta.5 (2023-03-08)

Bug Fixes

  • Improve AddWorkTimesChangeRequestReturnType type (0620097)

20.0.0-beta.4 (2023-03-08)

Bug Fixes

  • Incorrect param type of addWorkTimesChangeRequest() (18fddb1)

20.0.0-beta.3 (2023-03-01)

Bug Fixes

  • add mock functions export (53c38a4)

20.0.0-beta.2 (2023-02-22)

Features

20.0.0-beta.1 (2023-02-21)

Features

  • Expose team types (952f700)
  • Improve workTimes mocks (3499590)
  • Introduce special IsoDate and IsoUtcDateTime types (6fe88e2)
  • Update Node (40f81b6)

BREAKING CHANGES

  • Removed official Node 14 support. We don't know of an actual breaking change for Node 14, but it might happen in future releases.

19.2.0-beta.6 (2023-02-20)

Bug Fixes

  • reflect concept changes (8ba8355)

19.2.0-beta.5 (2023-02-20)

Bug Fixes

  • return single mock instead of array (fee1ff2)

19.2.0-beta.4 (2023-02-20)

Bug Fixes

  • change error message to have type correctly (2f2c88e)

19.2.0-beta.3 (2023-02-20)

Bug Fixes

  • make mock generation slimmer (09016c9)

19.2.0-beta.2 (2023-02-17)

Bug Fixes

  • add mocks for workTimes (6752007)

19.2.0-beta.1 (2023-02-16)

Features

19.1.2 (2023-02-10)

Bug Fixes

  • make absenceFixedCredit providable (89f892f)

19.1.1-beta.1 (2023-02-09)

Bug Fixes

  • make absenceFixedCredit providable (3b7288c)

19.1.0 (2023-02-08)

Bug Fixes

  • use PUT for splitting entries at midnight (998e004)
  • use PUT for splitting entries at midnight (bc8ab24)

Features

  • Add splitAllEntriesAtMidnight functionality (58ae7be)

18.3.0-beta.1 (2022-12-20)

Features

  • Add splitAllEntriesAtMidnight functionality (58ae7be)

19.0.0 (2022-12-21)

chore

  • Update faker dependency (e89d79f)

BREAKING CHANGES

  • Since faker has been updated, it might break your tests

18.2.0 (2022-12-14)

Bug Fixes

  • refine access rights type (8a51f3b)

Features

  • Add AbsenceType.SickSelfWithSicknessBenefit (785442a)

18.1.1-beta.1 (2022-10-25)

Bug Fixes

  • refine access rights type (8a51f3b)

18.1.0 (2022-10-17)

Bug Fixes

  • correct ProjectsParams - filter-active type (47a2f13)
  • Incorrect filterActive type (b4bd9f9)

Features

  • Improve typing of start/stop clock response (ada7721)

18.1.0-beta.2 (2022-10-17)

Bug Fixes

  • correct ProjectsParams - filter-active type (47a2f13)
  • Incorrect filterActive type (b4bd9f9)

18.1.0-beta.1 (2022-10-12)

Features

  • Improve typing of start/stop clock response (ada7721)

18.0.0 (2022-08-08)

Features

  • Add max length for external application header (733d59b)
  • Refactor paginated endpoints (3e29d27)

BREAKING CHANGES

  • The external application header now has a max length of 50 characters.
  • getCustomers(), getProjects(), getEntries(), getEntriesTexts() won't return a paging property anymore since pages are now requested automatically.
  • We've also improved some typings for these endpoints which might break your TypeScript build.

18.0.0-beta.1 (2022-08-04)

Features

  • Add max length for external application header (733d59b)
  • Refactor paginated endpoints (3e29d27)

BREAKING CHANGES

  • The external application header now has a max length of 50 characters.
  • getCustomers(), getProjects(), getEntries(), getEntriesTexts() won't return a paging property anymore since pages are now requested automatically.
  • We've also improved some typings for these endpoints which might break your TypeScript build.

17.0.0 (2022-07-13)

Bug Fixes

  • Missing null types in WorktimeRegulation (5c47cdd)

chore

  • Remove deprecated NO_WORKTIME_REGULATIONS_ID (62003cd)

Features

  • Add worktimeRegulationCountryPresets to mock package (cad211f)
  • Improve worktimeRegulation typing (49c2662)

BREAKING CHANGES

  • NO_WORKTIME_REGULATIONS_ID has been renamed to NO_WORKTIME_REGULATIONS_ID_FOR_USER

16.0.0 (2022-07-05)

Bug Fixes

  • Broken imports in mock generators (ef41b8f)

Features

  • Add possibility to generate mocks on a single day (7578654)

BREAKING CHANGES

  • createAbsenceMocks() and createTargethoursRowMocks() may produce different mock data now.

15.0.0 (2022-06-29)

Bug Fixes

  • Inconsistency in mock function naming (4c1d34d)

BREAKING CHANGES

  • createAbsencesMocks and createNonbusinessDaysMocks have been renamed (see commit)

14.0.1 (2022-06-27)

Bug Fixes

  • Improve TypeScript abence types (2a08354)

14.0.0 (2022-06-24)

Bug Fixes

  • Ensure that absences mocks don't overlap (aba5a34)
  • Improve absence mocks (6373fe2)

chore

  • Refactor date handling in mocks (6f7d28f)

Features

BREAKING CHANGES

  • We improved the way how dates are generated in our mocks. E.g. absences mocks and targethours mocks now won't have overlaps. However, due to these changes, you might see in your test snapshots (only if you're using our mock functions which aren't public anyway)

13.1.0 (2022-06-20)

Bug Fixes

  • Deprecate NO_WORKTIME_REGULATIONS_ID (4e3d487)

Features

  • Add nonbusinessgroupsId to user (d794d26)
  • Add createNonbusinessDaysMocks() (167c080)

13.0.0 (2022-06-09)

chore

  • Update dependencies (645afaa)

  • Drop CommonJS support (2227583)

  • Drop official Node v12 support (97381ac)
  • Remove deprecated cache feature (512d749)

BREAKING CHANGES

  • Dropped CommonJS support. This module is now published as an ES Module. There will be no CJS build anymore.
  • Dropped official Node v12 support. It may still work, though.
  • The cache plugin has been removed. It has been deprecated for quite some time now and will be discontinued.
  • These updates include breaking changes of upstream dependencies. There's a low risk of a breaking change in one of these.

13.0.0-beta.1 (2022-06-08)

chore

  • Update dependencies (645afaa)

  • Drop CommonJS support (2227583)

  • Drop official Node v12 support (97381ac)
  • Remove deprecated cache feature (512d749)

BREAKING CHANGES

  • Dropped CommonJS support. This module is now published as an ES Module. There will be no CJS build anymore.
  • Dropped official Node v12 support. It may still work, though.
  • The cache plugin has been removed. It has been deprecated for quite some time now and will be discontinued.
  • These updates include breaking changes of upstream dependencies. There's a low risk of a breaking change in one of these.

12.1.0 (2022-05-03)

Features

  • Expose access and nonbusinessday models (e499f95)

12.0.0 (2022-04-19)

Features

  • Use v2 routes for customers and projects (f5d8b43)

BREAKING CHANGES

  • projects has been removed from the Customer type

12.0.0-beta.1 (2022-04-12)

Features

  • Use v2 routes for customers and projects (f5d8b43)

BREAKING CHANGES

  • projects has been removed from the Customer type

11.0.0 (2022-04-07)

  • Merge pull request #82 from peerigon/missing-api-endpoints (1ba235b), closes #82

BREAKING CHANGES

  • We removed all task related endpoints and also getSearchTexts() since these were deprecated for quite a while now.
  • Fixed some incorrect return typings. You might see type errors in your TypeScript project.

10.3.1 (2022-04-02)

Bug Fixes

  • Replace deprecated faker functions (33d3ed6)

10.3.0 (2022-04-02)

Features

10.2.0 (2022-03-30)

Features

10.1.6 (2022-03-11)

Bug Fixes

10.1.5 (2022-03-11)

Bug Fixes

  • Incorrect entry mocks implementation (3840ab6)

10.1.4 (2022-03-11)

Bug Fixes

10.1.3 (2022-03-10)

Bug Fixes

10.1.2 (2022-03-10)

Bug Fixes

  • Incorrect absence typings (563c0c5)

10.1.1 (2022-03-05)

Bug Fixes

  • Incorrect userReport typings (5440658)

10.1.0 (2022-01-02)

Features

  • Add functions for parsing csv entries (21c7176)

10.0.0 (2021-12-15)

Bug Fixes

  • Downgrade map-obj to CJS version (8cd26ae)
  • Incorrect typing of "offset" (a8f5752)
  • Issues with Turkish locale (5831bbc)

BREAKING CHANGES

  • The mapping algorithm to map camelCase to snake_case and vice versa has been changed. There is a slight chance that some keys might be mapped differently (although our tests did not reveal anything like that).

10.0.0-beta.3 (2021-12-09)

Bug Fixes

  • Downgrade map-obj to CJS version (8cd26ae)

10.0.0-beta.2 (2021-12-08)

Bug Fixes

  • Incorrect typing of "offset" (a8f5752)

10.0.0-beta.1 (2021-12-08)

Bug Fixes

  • Issues with Turkish locale (5831bbc)

BREAKING CHANGES

  • The mapping algorithm to map camelCase to snake_case and vice versa has been changed. There is a slight chance that some keys might be mapped differently (although our tests did not reveal anything like that).

9.7.2 (2021-11-30)

Bug Fixes

  • Incorrect typing of countReductionUsed (6671c9f)

9.7.1 (2021-11-28)

Bug Fixes

  • Improve UserReport typings (f3c7c56)

9.7.0 (2021-11-13)

Features

  • Add getNonbusinessGroups() and getNonbusinessDays() (ba034ef)

9.6.1 (2021-11-12)

Bug Fixes

  • Incorrect TypeScript typings of addAbsence() (ded0d1d)

9.6.0 (2021-11-01)

Features

  • Add getAggregatesUsersMe() (c6385e1)
  • Improve targethours typings (3b063ab)

9.5.2 (2021-10-24)

Bug Fixes

  • TypeScript: Incorrect absence types (e0f2136)

9.5.1 (2021-10-11)

Bug Fixes

  • Incorrect Entry and LumpsumService mocks (12cc74a)

9.5.0 (2021-10-09)

Features

9.4.0 (2021-10-09)

Bug Fixes

  • Unrecognized package exports in TypeScript (1d41301)

Features

  • Expose a way to set the faker seed (726f8e5)

9.3.0 (2021-10-09)

Features

9.2.0 (2021-10-08)

Features

9.1.1 (2021-09-17)

Bug Fixes

9.1.0 (2021-09-14)

Features

9.0.0 (2021-09-13)

Bug Fixes

  • Correct more types (323bed5)
  • Correct type attribution (f895fa9)
  • Improve types (9266392)
  • Improve types and wording (3f79891)
  • Make header required and use it in integration tests (a028311)
  • Repair Tests (865aede)
  • Repair Unit Tests (8da6020)
  • Revert incorrect typing of timeClockedSince (cc4d797)
  • TimeEntry typing of timeClockedSince property (770f47a)

chore

  • Remove internals folder (994550a)

Features

  • Add API v2 changes (0f8bc56)
  • Add proper native ESM support (2846a94)
  • Do not use class properties as methods anymore (a0d04c3)
  • Introduce enums (0515034)
  • Publish beta version (1446e55)
  • Publish beta version (000369a)
  • Publish beta version (2018711)
  • remove offset property (bbf047b)
  • Remove Promise<> type from returnTypes (d6f4c15)
  • Switch to MIT license (dd07fb1)
  • Use new endpoints in code, remove old ones (d3495f4)

BREAKING CHANGES

  • Methods on Clockodo and Api instances won't be bound to the instance anymore.
  • The return types are not wrapped in Promise<> types anymore. You may need to update your types.
  • Switch to MIT license
  • All files inside internals have been moved up to the src directory. This change might break your app in case you've used deep package imports.
  • Depending on your build and runtime configuration, this change might break your path resolution.

9.0.0-beta.2 (2021-09-13)

chore

  • Remove internals folder (994550a)

Features

  • Do not use class properties as methods anymore (a0d04c3)
  • Remove Promise<> type from returnTypes (d6f4c15)
  • Switch to MIT license (dd07fb1)

BREAKING CHANGES

  • Methods on Clockodo and Api instances won't be bound to the instance anymore.
  • The return types are not wrapped in Promise<> types anymore. You may need to update your types.
  • Switch to MIT license
  • All files inside internals have been moved up to the src directory. This change might break your app in case you've used deep package imports.

9.0.0-beta.1 (2021-09-13)

Features

  • Add proper native ESM support (2846a94)

BREAKING CHANGES

  • Depending on your build and runtime configuration, this change might break your path resolution.

8.1.0-beta.14 (2021-06-02)

Bug Fixes

  • Revert incorrect typing of timeClockedSince (cc4d797)

8.1.0-beta.13 (2021-06-02)

Bug Fixes

  • TimeEntry typing of timeClockedSince property (770f47a)

8.1.0-beta.12 (2021-05-31)

Features

8.1.0-beta.11 (2021-05-31)

Features

8.1.0-beta.10 (2021-05-31)

Features

8.1.0-beta.9 (2021-05-25)

Features

8.1.0-beta.8 (2021-05-25)

Features

8.1.0-beta.7 (2021-05-19)

Features

8.1.0-beta.6 (2021-05-07)

Bug Fixes

  • Make header required and use it in integration tests (a028311)
  • Repair Tests (865aede)

8.1.0-beta.5 (2021-05-05)

Bug Fixes

8.1.0-beta.4 (2021-04-30)

Bug Fixes

  • Correct type attribution (f895fa9)

8.1.0-beta.3 (2021-04-29)

Bug Fixes

8.1.0-beta.2 (2021-04-27)

Bug Fixes

  • Improve types and wording (3f79891)

8.1.0-beta.1 (2021-04-27)

Bug Fixes

Features

  • Use new endpoints in code, remove old ones (d3495f4)

8.0.7 (2021-04-16)

Bug Fixes

  • typescript: Make restricted project properties optional (936f134)
  • typescript: revenueFactor can be null (d0f8965)

8.0.6 (2021-03-01)

Bug Fixes

  • Wrong URL being used in getSearchTexts() (#64) (32931b7)

8.0.5 (2021-02-12)

Bug Fixes

  • Wrong package configuration (f696320)

8.0.4 (2021-02-12)

Bug Fixes

  • exports-fields in package.json (cbb45ab)

8.0.3 (2021-02-11)

Bug Fixes

  • Enable CORS for login requests (8e6859e)

8.0.2 (2021-02-10)

Bug Fixes

8.0.1 (2021-02-10)

Bug Fixes

  • Broken plugin import statements (b0fa5ac)

8.0.0 (2021-02-10)

Bug Fixes

Features

  • Add cookie authentication support (9fc6276)
  • Add ESM support (c09e86c)
  • Add getLumpSumServices() (cc344e0)
  • Enable ISO UTC date times for all requests (6905d6b)
  • Refactor public interface (2c23de4), closes #50 #50

BREAKING CHANGES

  • clockodo is now available as CommonJS and ECMAScript module. Although very unlikely, this might cause issues depending on your specific setup.
  • All timestamps are now returned as ISO UTC. You don't need the user's time zone to interpret the times correctly now.
  • Some return types have been updated and corrected. This might result in TypeScript errors.
  • The Clockodo constructor arguments have changed a little bit. Check out the documentation for correct usage.

7.0.0 (2020-12-03)

Bug Fixes

  • billable not required when calling addEntry() with a lumpsum entry (f422119)
  • Incorrect addEntry() params (1603410)
  • Make billable required again for addEntry() (dda2bc8)
  • typo (6c4810c)
  • Types: Make running-propety in return types optional (7b83d14)
  • Required params in addLumpSumEntry (fae42f8)

chore

  • Drop official support for Node 8 (668decf)

Features

  • Improve query and property mapping (6dadcd0), closes #52 #60
  • Merge addLumpEntry with addEntry() (825b72e)

  • Update esLint and use lint-staged + prettier (74abf23)

BREAKING CHANGES

  • The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
  • Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
  • The Clockodo class uses arrow functions as methods.
  • addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
  • addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
  • The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.

7.0.0-beta.8 (2020-12-01)

Features

BREAKING CHANGES

  • The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.

7.0.0-beta.7 (2020-09-16)

chore

  • Drop official support for Node 8 (668decf)

Features

  • Improve query and property mapping (6dadcd0), closes #52 #60
  • Merge addLumpEntry with addEntry() (825b72e)

  • Update esLint and use lint-staged + prettier (74abf23)

BREAKING CHANGES

  • The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.
  • Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.
  • The Clockodo class uses arrow functions as methods.
  • addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.
  • addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.
  • The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.

7.0.0-beta.8 (2020-12-01)

Features

BREAKING CHANGES

  • The mapping between camelCase and snake_case has been streamlined and improved. You might observe different behavior if you relied on the previous (buggy) implementation.

7.0.0-beta.7 (2020-09-16)

chore

  • Drop official support for Node 8 (668decf)

BREAKING CHANGES

  • Our test pipeline does not execute our tests for Node 8 anymore. There is no breaking change we know of but we don't guarantee that it will work on Node 8.

7.0.0-beta.6 (2020-09-16)

  • Update esLint and use lint-staged + prettier (74abf23)

BREAKING CHANGES

  • The Clockodo class uses arrow functions as methods.

7.0.0-beta.5 (2020-09-14)

Bug Fixes

  • Make billable required again for addEntry() (dda2bc8)

7.0.0-beta.4 (2020-09-14)

Bug Fixes

  • billable not required when calling addEntry() with a lumpsum entry (f422119)
  • Types: Make running-propety in return types optional (7b83d14)

7.0.0-beta.3 (2020-09-14)

Features

  • Merge addLumpEntry with addEntry() (825b72e)

BREAKING CHANGES

  • addLumpEntry() has been removed. You can use addEntry() to create a recurring lump sum entry.

7.0.0-beta.2 (2020-09-14)

Bug Fixes

  • Incorrect addEntry() params (1603410)

BREAKING CHANGES

  • addEntry() actually requires different params based on what type of entry you want to create. If you want to create a time entry, you need to pass timeUntil. If you want to create a lump sum entry, you need to pass a lumpSum.

7.0.0-beta.1 (2020-09-14)

Bug Fixes

  • Required params in addLumpSumEntry (fae42f8)

BREAKING CHANGES

  • The required params of addLumpSumEntry() where not correct. The actual required params are: "customersId", "lumpSumsAmount", "lumpSumsId", "billable", "timeSince". These need to be passed as first argument. All additional params need to be passed as second argument.

6.0.2 (2020-09-14)

Bug Fixes

6.0.2-beta.1 (2020-09-08)

Bug Fixes

6.0.1 (2020-07-13)

Bug Fixes

  • Add plugins to npm package (65a14ad)

6.0.0 (2020-07-10)

Features

BREAKING CHANGES

  • Adjust all keys to match clockodos rest-api

5.0.0 (2020-07-10)

Features

  • Reduce bundle size by making caching optional (b307bec)

BREAKING CHANGES

  • The cacheTime option has been removed and replaced by a plugin interface. See README for more details.

4.1.0 (2020-01-31)

Features

  • api: introduce optional request caching (a13ca28)
  • api: introduce optional request caching (71d6d09)

4.0.1 (2020-01-31)

Bug Fixes

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

4.0.0 (2020-01-24)

Bug Fixes

  • Change id type from string to number (0513722)

BREAKING CHANGES

  • Clockodo REST API uses type number for ids.

3.2.0 (2019-12-17)

3.1.6 (2019-09-23)

3.1.5 (2019-08-28)

3.1.4 (2019-06-28)

3.1.3 (2019-05-28)

Bug Fixes

  • removes dangerous and unneeded dependencies (6436399)

3.1.2 (2019-05-28)

Bug Fixes

3.1.1 (2018-10-24)

3.1.0 (2018-10-24)

Features

3.0.0 (2018-10-17)

  • Conversion to Typescript (#16) (1bedec1), closes #16

Bug Fixes

  • fixes outdate files option in package.json (4a9f98e)

Features

  • adding function parameter types (#21) (f3c2499)
  • Adds remaining endpoint methods and alters old method signatures (#14) (fb82c71), closes #12

BREAKING CHANGES

  • 2.0.0 was missing all of the code in its publication due to an outdated files value.
  • Method Signature structure has been completely changed, and Node 6 support is dropped.

  • fix: addresses security vulnerabilities. Also adds jsdoc-to-markdown dev dependency

  • fix: jsdoc-to-markdown should just be used globally. removed dependency

  • changes method signatures, adds useless jsdoc

  • feat: creates config for typescript

  • feat: converts files to typescript (and required changes that comes with the transformation)

  • fix: fixes tests and the bugs revealed from them

  • fix: updates integration test

  • fix: adds nock teardown in case it is influencing other test files

  • feat: upgrades min supported version to Node 8

  • chore: sets automatic generation of types files to false as I see no benefit

  • Method signatures have been changed to objects.

2.0.0 (2018-10-17)

  • Conversion to Typescript (#16) (1bedec1), closes #16

Features

  • adding function parameter types (#21) (f3c2499)
  • Adds remaining endpoint methods and alters old method signatures (#14) (fb82c71), closes #12

BREAKING CHANGES

  • Method Signature structure has been completely changed, and Node 6 support is dropped.

  • fix: addresses security vulnerabilities. Also adds jsdoc-to-markdown dev dependency

  • fix: jsdoc-to-markdown should just be used globally. removed dependency

  • changes method signatures, adds useless jsdoc

  • feat: creates config for typescript

  • feat: converts files to typescript (and required changes that comes with the transformation)

  • fix: fixes tests and the bugs revealed from them

  • fix: updates integration test

  • fix: adds nock teardown in case it is influencing other test files

  • feat: upgrades min supported version to Node 8

  • chore: sets automatic generation of types files to false as I see no benefit

  • Method signatures have been changed to objects.

1.1.1 (2018-05-09)

1.1.0 (2018-04-25)

Features

  • Adds startClock, stopClock, and changeClockDuration (5db9894)

1.0.0 (2018-04-18)

Features