- Remove ko-fi from funding
95d0783
Thanks @jakobbouchard! - Bump vitest
-
db93efa
Thanks @jakobbouchard! - Update dependencies -
Update dependencies
- The API client now only returns classes. This means that
getWebsite()
will return aWebsite
class, andgetWebsites()
will return an array ofWebsite
classes. This is a breaking change, but it's better for typings, and it's clearer. - Default parameters (user agent, time period, time unit, timezone and metric type) are now defined using environment variables. They cannot be set using functions anymore. This is a breaking change.
- Errors are not caught anymore, so you can handle them yourself. This is a breaking change.
- The package is now bundled using tsup, instead of microbundle. This might break compatibility with some environments, but it's smaller and faster.
- Updated dependencies.
- The website and account functions (except those to get them) have been removed, in favour of classes. This is a breaking change.
- Updated dependencies.
- Uh, after adding husky, the package wouldn't install anymore, so I fixed that!
IMPORTANT: This release cannot be installed due to husky install
being run in the postinstall
script instead of prepare
. As such, please upgrade to the 0.6.1 release ASAP.
WARNING: This release contains a lot of breaking changes due to the fact that Umami's API moved from using IDs to UUIDs for most operations. As such, you should update your code to use UUIDs instead of IDs. Also, some parameters changed from snake_case
to camelCase
, due to changes in the Umami API. Sadly, it's not super consistent, so some items still require snake_case
.
- Hound CI for PRs.
- Convert tests from jest to vitest.
- ESLint, Prettier, Husky.
- Auto-signing version tags.
- Most functions now require the website UUID instead of its ID, per Umami's new API.
- Changing an account's password now requires its UUID instead of its ID.
- Most options now take
camelCase
params instead ofsnake_case
. - Update axios.
getEventsByName(...)
has been removed, since events now use names by default.
- Axios timeout, in case the server is slow.
- Basic tests!
- Makes
returnClasses
required. It's better for typings, and it's clearer.
- Sometimes
_richError
didn't show the options.
- Support for UTM parameters in
getMetrics
.
- Makes
returnClasses
required. It's better for typings, and it's clearer.
- Correctly type the return values with the introduction of
returnClasses
in 0.4.0. - Won't die when
options
is not provided.
Awkward... Forgot to build before publishing...
returnClasses
options in API Client constructor. Enabling this returns classes when getting websites or accounts. Example:
import UmamiAPIClient from "umami-api";
const umami = new UmamiAPIClient("stats.example.com", "admin", "1234");
const website = umami.getWebsite();
website.update({
domain: "test.com",
});
- [BREAKING]
getEventsByName(...)
'sname
parameter has been removed from itsoptions
object, because its uh a bit more logic isn't it? - Now uses
microbundle
for bundling, which should help with compatibility.
changePassword(...)
pointed to the wrong endpoint.
This release contains a small breaking change. And all the available endpoints now!
getEventsByName(...)
β Get events by their name/value. Now with full info!- [Admin only]
createAccount(...)
β Create a user account. updateAccount(...)
β Update account info.username
andis_admin
can only be changed by admins.changePassword(...)
β Change your password.- [Admin only]
getAccount(...)
β Get a user account. - [Admin only]
deleteAccount(...)
β Delete a user account. - All the available API options.
- [BREAKING]
getEventsBy(...)
is gone, since you can request the event type in the regulargetEvents(...)
function now. - Does not check manually for admin rights anymore, since the API does it for us.
This release contains a LOT of breaking changes. Also a lot of new stuff!
static UmamiAPIClient.collect(...)
β Collect pageviews and events without initializing a client.setDefaultUnit(...)
β Set the default unit of time when getting pageviews or events.setDefaultTZ(...)
β Set the default timezone when getting pageviews or events.setDefaultMetricType(...)
β Set the default type when getting metrics.setDefaultUserAgent(...)
β Set the default user agent when callingcollect(...)
on an instance. Does not affect the new static method.getWebsiteBy(...)
β Replaces part of the functionality ofgetWebsite(...)
.
- [BREAKING] Authentication is done directly in the constructor now.
- [BREAKING] There previously were 2 classes, now there is only one.
- [BREAKING] Rename
getPageViews(...)
togetPageviews(...)
- [BREAKING] The
period
parameter is now in the options, to make it optional. This affectsgetStats(...)
,getPageviews(...)
,getEvents(...)
,getEventsBy(...)
andgetMetrics(...)
. - [BREAKING] The
getWebsite(...)
function was split. - Better error messages
getDefaultPeriod(...)
as it's unnecessary.
- Remove explicit return type in
auth(...)
function.
- Lots of JSDoc comments. Not everything is done or typed yet however, especially the new stuff.
- The authentication token gets checked about every hour.
setDefaultPeriod(...)
andgetDefaultPeriod()
β Set and get the default time period. Defaults to24h
.getCurrentUser()
β Get the currently logged in user's info.updateWebsite(...)
β Update a website's name, domain or enable the share URL.getWebsite(...)
β Get a single website, either by specifying a property it has, its ID, or nothing (returns the first website in the list).resetWebsite(...)
β Reset a website by ID.deleteWebsite(...)
β Delete a website by ID.getEventsBy(...)
β Get the total number of events in a time period, filtered by their value or their type.getActiveVisitors(...)
β Get the number of active visitors.getActiveVisitors(...)
β Get the number of active visitors.- [Admin only]
getAccounts(...)
β Get all of the user accounts
- Fix package name in README.
- Fix README instructions.
- Fix
collect(...)
function. It was pointing to the wrong endpoint and needed a "User-Agent" header.
- Initial release