umami-api-js 0.0.4 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,36 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/users-api */
1
+ /** Operations around User management: https://umami.is/docs/api/users */
2
2
  export var Users;
3
3
  (function (Users) {
4
- /** Creates a user: https://umami.is/docs/api/users-api#post-apiusers */
5
- async function createUser(parameters) {
4
+ /** Creates a user: https://umami.is/docs/api/users#post-apiusers */
5
+ async function post(parameters) {
6
6
  return await this.request("post", ["users"], parameters);
7
7
  }
8
- Users.createUser = createUser;
9
- /** Gets a user by ID: https://umami.is/docs/api/users-api#get-apiusersuserid */
10
- async function getUser(id) {
11
- return await this.request("get", ["users", id]);
8
+ Users.post = post;
9
+ /** Gets a user by ID: https://umami.is/docs/api/users#get-apiusersuserid */
10
+ async function get_USERID(userId) {
11
+ return await this.request("get", ["users", userId]);
12
12
  }
13
- Users.getUser = getUser;
14
- /** Updates a user: https://umami.is/docs/api/users-api#post-apiusersuserid */
15
- async function updateUser(id, parameters) {
16
- return await this.request("post", ["users", id], parameters);
13
+ Users.get_USERID = get_USERID;
14
+ /** Updates a user: https://umami.is/docs/api/users#post-apiusersuserid */
15
+ async function post_USERID(userId, parameters) {
16
+ return await this.request("post", ["users", userId], parameters);
17
17
  }
18
- Users.updateUser = updateUser;
19
- /** Deletes a user: https://umami.is/docs/api/users-api#delete-apiusersuserid */
20
- async function deleteUser(id) {
21
- return await this.request("delete", ["users", id]);
18
+ Users.post_USERID = post_USERID;
19
+ /** Deletes a user: https://umami.is/docs/api/users#delete-apiusersuserid */
20
+ async function delete_USERID(userId) {
21
+ return await this.request("delete", ["users", userId]);
22
22
  }
23
- Users.deleteUser = deleteUser;
24
- /** Gets all websites that belong to a user: https://umami.is/docs/api/users-api#get-apiusersuseridwebsites */
25
- async function getUserWebsites(id, parameters) {
26
- const response = await this.request("get", ["users", id, "websites"], parameters);
23
+ Users.delete_USERID = delete_USERID;
24
+ /** Gets all websites that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridwebsites */
25
+ async function get_USERID_Websites(userId, parameters) {
26
+ const response = await this.request("get", ["users", userId, "websites"], parameters);
27
27
  return response.data;
28
28
  }
29
- Users.getUserWebsites = getUserWebsites;
30
- /** Gets all teams that belong to a user: https://umami.is/docs/api/users-api#get-apiusersuseridteams */
31
- async function getUserTeams(id, parameters) {
32
- const response = await this.request("get", ["users", id, "teams"], parameters);
29
+ Users.get_USERID_Websites = get_USERID_Websites;
30
+ /** Gets all teams that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridteams */
31
+ async function get_USERID_Teams(userId, parameters) {
32
+ const response = await this.request("get", ["users", userId, "teams"], parameters);
33
33
  return response.data;
34
34
  }
35
- Users.getUserTeams = getUserTeams;
35
+ Users.get_USERID_Teams = get_USERID_Teams;
36
36
  })(Users || (Users = {}));
@@ -1,5 +1,5 @@
1
1
  import { API, Filters, Timestamps, XTY } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/website-stats-api */
2
+ /** Operations around Website statistics: https://umami.is/docs/api/website-stats */
3
3
  export declare namespace WebsiteStats {
4
4
  /**
5
5
  * The unit parameter buckets the data returned
@@ -19,28 +19,28 @@ export declare namespace WebsiteStats {
19
19
  }
20
20
  interface Stats {
21
21
  /** Pages hits */
22
- pageviews: string;
22
+ pageviews: number;
23
23
  /** Number of unique visitors */
24
- visitors: string;
24
+ visitors: number;
25
25
  /** Number of unique visits */
26
- visits: string;
26
+ visits: number;
27
27
  /** Number of visitors who only visit a single page */
28
- bounces: string;
28
+ bounces: number;
29
29
  /** Time spent on the website */
30
- totaltime: string;
30
+ totaltime: number;
31
31
  }
32
32
  type MetricsTypes = "path" | "entry" | "exit" | "title" | "query" | "referrer" | "channel" | "domain" | "country" | "region" | "city" | "browser" | "os" | "device" | "language" | "screen" | "event" | "hostname" | "tag";
33
- /** Gets the number of active users on a website: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidactive (TODO UNTESTED) */
34
- function getWebsiteActiveVisitors(this: API, websiteId: string): Promise<{
33
+ /** Gets the number of active users on a website: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidactive (TODO UNTESTED) */
34
+ function get_WEBSITEID_Active(this: API, websiteId: string): Promise<{
35
35
  visitors: number;
36
36
  }>;
37
- /** Gets events within a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteideventsseries (TODO UNTESTED) */
38
- function getWebsiteEvents(this: API, websiteId: string, parameters: Timestamps & Units & Filters & {
37
+ /** Gets events within a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteideventsseries (TODO UNTESTED) */
38
+ function get_WEBSITEID_EventsSeries(this: API, websiteId: string, parameters: Timestamps & Units & Filters & {
39
39
  /** Timezone (ex. America/Los_Angeles) */
40
40
  timezone: string;
41
41
  }): Promise<XTY[]>;
42
- /** Gets metrics for a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidmetrics (TODO UNTESTED) */
43
- function getWebsiteMetrics(this: API, websiteId: string, parameters: Timestamps & Units & Filters & {
42
+ /** Gets metrics for a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidmetrics (TODO UNTESTED) */
43
+ function get_WEBSITEID_Metrics(this: API, websiteId: string, parameters: Timestamps & Units & Filters & {
44
44
  /** Timezone (ex. America/Los_Angeles) */
45
45
  timezone: string;
46
46
  /** Metrics type */
@@ -55,13 +55,13 @@ export declare namespace WebsiteStats {
55
55
  /** Number of visitors */
56
56
  y: number;
57
57
  }[]>;
58
- /** Gets expanded metrics for a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidmetricsexpanded (TODO UNTESTED) */
59
- function getWebsiteMetricsExpanded(this: API, ...args: Parameters<typeof getWebsiteMetrics>): Promise<(Stats & {
58
+ /** Gets expanded metrics for a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidmetricsexpanded (TODO UNTESTED) */
59
+ function get_WEBSITEID_MetricsExpanded(this: API, ...args: Parameters<typeof get_WEBSITEID_Metrics>): Promise<(Stats & {
60
60
  /** Unique value, depending on metric type */
61
61
  name: string;
62
62
  })[]>;
63
- /** Gets pageviews within a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidpageviews (TODO UNTESTED) */
64
- function getWebsitePageviews(this: API, websiteId: string, parameters: Timestamps & Units & Filters & {
63
+ /** Gets pageviews within a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidpageviews (TODO UNTESTED) */
64
+ function get_WEBSITEID_Pageviews(this: API, websiteId: string, parameters: Timestamps & Units & Filters & {
65
65
  /** Timezone (ex. America/Los_Angeles) */
66
66
  timezone: string;
67
67
  /** Comparison value `prev` | `yoy` */
@@ -80,8 +80,8 @@ export declare namespace WebsiteStats {
80
80
  y: number;
81
81
  }[];
82
82
  }>;
83
- /** Gets summarized website statistics: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidstats (TODO UNTESTED) */
84
- function getWebsiteStats(this: API, websiteId: string, parameters: Timestamps & Filters & Units & {
83
+ /** Gets summarized website statistics: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidstats (TODO UNTESTED) */
84
+ function get_WEBSITEID_Stats(this: API, websiteId: string, parameters: Timestamps & Filters & Units & {
85
85
  /** Timezone (ex. America/Los_Angeles) */
86
86
  timezone: string;
87
87
  }): Promise<Stats & {
@@ -1,34 +1,34 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/website-stats-api */
1
+ /** Operations around Website statistics: https://umami.is/docs/api/website-stats */
2
2
  export var WebsiteStats;
3
3
  (function (WebsiteStats) {
4
- /** Gets the number of active users on a website: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidactive (TODO UNTESTED) */
5
- async function getWebsiteActiveVisitors(websiteId) {
4
+ /** Gets the number of active users on a website: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidactive (TODO UNTESTED) */
5
+ async function get_WEBSITEID_Active(websiteId) {
6
6
  return await this.request("get", ["websites", websiteId, "active"]);
7
7
  }
8
- WebsiteStats.getWebsiteActiveVisitors = getWebsiteActiveVisitors;
9
- /** Gets events within a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteideventsseries (TODO UNTESTED) */
10
- async function getWebsiteEvents(websiteId, parameters) {
8
+ WebsiteStats.get_WEBSITEID_Active = get_WEBSITEID_Active;
9
+ /** Gets events within a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteideventsseries (TODO UNTESTED) */
10
+ async function get_WEBSITEID_EventsSeries(websiteId, parameters) {
11
11
  return await this.request("get", ["websites", websiteId, "events", "series"], parameters);
12
12
  }
13
- WebsiteStats.getWebsiteEvents = getWebsiteEvents;
14
- /** Gets metrics for a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidmetrics (TODO UNTESTED) */
15
- async function getWebsiteMetrics(websiteId, parameters) {
13
+ WebsiteStats.get_WEBSITEID_EventsSeries = get_WEBSITEID_EventsSeries;
14
+ /** Gets metrics for a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidmetrics (TODO UNTESTED) */
15
+ async function get_WEBSITEID_Metrics(websiteId, parameters) {
16
16
  return await this.request("get", ["websites", websiteId, "metrics"], parameters);
17
17
  }
18
- WebsiteStats.getWebsiteMetrics = getWebsiteMetrics;
19
- /** Gets expanded metrics for a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidmetricsexpanded (TODO UNTESTED) */
20
- async function getWebsiteMetricsExpanded(...args) {
18
+ WebsiteStats.get_WEBSITEID_Metrics = get_WEBSITEID_Metrics;
19
+ /** Gets expanded metrics for a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidmetricsexpanded (TODO UNTESTED) */
20
+ async function get_WEBSITEID_MetricsExpanded(...args) {
21
21
  return await this.request("get", ["websites", args[0], "metrics", "expanded"], args[1]);
22
22
  }
23
- WebsiteStats.getWebsiteMetricsExpanded = getWebsiteMetricsExpanded;
24
- /** Gets pageviews within a given time range: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidpageviews (TODO UNTESTED) */
25
- async function getWebsitePageviews(websiteId, parameters) {
23
+ WebsiteStats.get_WEBSITEID_MetricsExpanded = get_WEBSITEID_MetricsExpanded;
24
+ /** Gets pageviews within a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidpageviews (TODO UNTESTED) */
25
+ async function get_WEBSITEID_Pageviews(websiteId, parameters) {
26
26
  return await this.request("get", ["websites", websiteId, "pageviews"], parameters);
27
27
  }
28
- WebsiteStats.getWebsitePageviews = getWebsitePageviews;
29
- /** Gets summarized website statistics: https://umami.is/docs/api/website-stats-api#get-apiwebsiteswebsiteidstats (TODO UNTESTED) */
30
- async function getWebsiteStats(websiteId, parameters) {
28
+ WebsiteStats.get_WEBSITEID_Pageviews = get_WEBSITEID_Pageviews;
29
+ /** Gets summarized website statistics: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidstats (TODO UNTESTED) */
30
+ async function get_WEBSITEID_Stats(websiteId, parameters) {
31
31
  return await this.request("get", ["websites", websiteId, "stats"], parameters);
32
32
  }
33
- WebsiteStats.getWebsiteStats = getWebsiteStats;
33
+ WebsiteStats.get_WEBSITEID_Stats = get_WEBSITEID_Stats;
34
34
  })(WebsiteStats || (WebsiteStats = {}));
@@ -1,14 +1,15 @@
1
- import { API, GenericRequestParameters, MinimalUser, Website } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/websites-api */
1
+ import { API, DeletionResult, GenericRequestParameters, Users, Website } from "../index.js";
2
+ /** Operations around Website management and statistics: https://umami.is/docs/api/websites */
3
3
  export declare namespace Websites {
4
- /** Returns all user websites: https://umami.is/docs/api/websites-api#get-apiwebsites (TODO UNTESTED) */
5
- function getWebsites(this: API, parameters: GenericRequestParameters & {
6
- includeTeams: boolean;
4
+ /** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites */
5
+ function get(this: API, parameters?: GenericRequestParameters & {
6
+ /** Set to true if you want to include websites where you are the team owner */
7
+ includeTeams?: boolean;
7
8
  }): Promise<(Website & {
8
- user: MinimalUser;
9
+ user: Users.MinimalUser;
9
10
  })[]>;
10
- /** Creates a website: https://umami.is/docs/api/websites-api#post-apiwebsites (TODO UNTESTED) */
11
- function createWebsite(this: API, parameters: {
11
+ /** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites */
12
+ function post(this: API, parameters: {
12
13
  /** The name of the website in Umami */
13
14
  name: string;
14
15
  /** The full domain of the tracked website */
@@ -20,23 +21,19 @@ export declare namespace Websites {
20
21
  /** Force a UUID assignment to the website */
21
22
  id?: string;
22
23
  }): Promise<Website>;
23
- /** Gets a website by ID: https://umami.is/docs/api/websites-api#get-apiwebsiteswebsiteid (TODO UNTESTED) */
24
- function getWebsite(this: API, websiteId: string): Promise<Website>;
25
- /** Updates a website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteid (TODO UNTESTED) */
26
- function updateWebsite(this: API, websiteId: string, parameters: {
24
+ /** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid */
25
+ function get_WEBSITEID(this: API, websiteId: string): Promise<Website>;
26
+ /** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid */
27
+ function post_WEBSITEID(this: API, websiteId: string, parameters: {
27
28
  /** The name of the website in Umami */
28
- name: string;
29
+ name?: string;
29
30
  /** The full domain of the tracked website */
30
- domain: string;
31
+ domain?: string;
31
32
  /** A unique string to enable a share url. Set `null` to unshare */
32
33
  shareId?: string | null;
33
34
  }): Promise<Website>;
34
- /** Deletes a website: https://umami.is/docs/api/websites-api#delete-apiwebsiteswebsiteid (TODO UNTESTED) */
35
- function deleteWebsite(this: API, websiteId: string): Promise<{
36
- ok: boolean;
37
- }>;
38
- /** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteidreset (TODO UNTESTED) */
39
- function resetWebsite(this: API, websiteId: string): Promise<{
40
- ok: boolean;
41
- }>;
35
+ /** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid */
36
+ function delete_WEBSITEID(this: API, websiteId: string): Promise<DeletionResult>;
37
+ /** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset */
38
+ function post_WEBSITEID_Reset(this: API, websiteId: string): Promise<DeletionResult>;
42
39
  }
@@ -1,35 +1,35 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/websites-api */
1
+ /** Operations around Website management and statistics: https://umami.is/docs/api/websites */
2
2
  export var Websites;
3
3
  (function (Websites) {
4
- /** Returns all user websites: https://umami.is/docs/api/websites-api#get-apiwebsites (TODO UNTESTED) */
5
- async function getWebsites(parameters) {
4
+ /** Returns all user websites: https://umami.is/docs/api/websites#get-apiwebsites */
5
+ async function get(parameters) {
6
6
  const response = await this.request("get", ["websites"], parameters);
7
7
  return response.data;
8
8
  }
9
- Websites.getWebsites = getWebsites;
10
- /** Creates a website: https://umami.is/docs/api/websites-api#post-apiwebsites (TODO UNTESTED) */
11
- async function createWebsite(parameters) {
9
+ Websites.get = get;
10
+ /** Creates a website: https://umami.is/docs/api/websites#post-apiwebsites */
11
+ async function post(parameters) {
12
12
  return await this.request("post", ["websites"], parameters);
13
13
  }
14
- Websites.createWebsite = createWebsite;
15
- /** Gets a website by ID: https://umami.is/docs/api/websites-api#get-apiwebsiteswebsiteid (TODO UNTESTED) */
16
- async function getWebsite(websiteId) {
14
+ Websites.post = post;
15
+ /** Gets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid */
16
+ async function get_WEBSITEID(websiteId) {
17
17
  return await this.request("get", ["websites", websiteId]);
18
18
  }
19
- Websites.getWebsite = getWebsite;
20
- /** Updates a website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteid (TODO UNTESTED) */
21
- async function updateWebsite(websiteId, parameters) {
19
+ Websites.get_WEBSITEID = get_WEBSITEID;
20
+ /** Updates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid */
21
+ async function post_WEBSITEID(websiteId, parameters) {
22
22
  return await this.request("post", ["websites", websiteId], parameters);
23
23
  }
24
- Websites.updateWebsite = updateWebsite;
25
- /** Deletes a website: https://umami.is/docs/api/websites-api#delete-apiwebsiteswebsiteid (TODO UNTESTED) */
26
- async function deleteWebsite(websiteId) {
24
+ Websites.post_WEBSITEID = post_WEBSITEID;
25
+ /** Deletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid */
26
+ async function delete_WEBSITEID(websiteId) {
27
27
  return await this.request("delete", ["websites", websiteId]);
28
28
  }
29
- Websites.deleteWebsite = deleteWebsite;
30
- /** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites-api#post-apiwebsiteswebsiteidreset (TODO UNTESTED) */
31
- async function resetWebsite(websiteId) {
29
+ Websites.delete_WEBSITEID = delete_WEBSITEID;
30
+ /** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset */
31
+ async function post_WEBSITEID_Reset(websiteId) {
32
32
  return await this.request("post", ["websites", websiteId, "reset"]);
33
33
  }
34
- Websites.resetWebsite = resetWebsite;
34
+ Websites.post_WEBSITEID_Reset = post_WEBSITEID_Reset;
35
35
  })(Websites || (Websites = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "umami-api-js",
3
- "version": "0.0.4",
3
+ "version": "0.1.1",
4
4
  "description": "Package to easily access the umami api!",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "type": "git",
20
20
  "url": "https://codeberg.org/Taevas/umami-api-js"
21
21
  },
22
- "homepage": "https://codeberg.org/Taevas/umami-api-js",
22
+ "homepage": "https://umami-api-js.taevas.xyz/",
23
23
  "keywords": [
24
24
  "umami",
25
25
  "api",
@@ -28,9 +28,11 @@
28
28
  ],
29
29
  "license": "Unlicense",
30
30
  "devDependencies": {
31
- "@types/node": "^24.3.1",
32
- "dotenv": "^17.2.2",
31
+ "@types/chai": "^5.2.3",
32
+ "@types/node": "^24.9.2",
33
+ "chai": "^6.2.0",
34
+ "dotenv": "^17.2.3",
33
35
  "typedoc": "^0.28.14",
34
- "typescript": "^5.9.2"
36
+ "typescript": "^5.9.3"
35
37
  }
36
38
  }