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.
- package/README.md +3 -2
- package/dist/index.d.ts +191 -96
- package/dist/index.js +163 -69
- package/dist/namespaces/Admin.d.ts +8 -17
- package/dist/namespaces/Admin.js +4 -10
- package/dist/namespaces/Events.d.ts +15 -15
- package/dist/namespaces/Events.js +22 -22
- package/dist/namespaces/Links.d.ts +26 -0
- package/dist/namespaces/Links.js +25 -0
- package/dist/namespaces/Me.d.ts +38 -0
- package/dist/namespaces/Me.js +21 -0
- package/dist/namespaces/Pixels.d.ts +23 -0
- package/dist/namespaces/Pixels.js +25 -0
- package/dist/namespaces/Realtime.d.ts +3 -3
- package/dist/namespaces/Realtime.js +4 -4
- package/dist/namespaces/Reports.d.ts +28 -30
- package/dist/namespaces/Reports.js +40 -40
- package/dist/namespaces/Sessions.d.ts +17 -17
- package/dist/namespaces/Sessions.js +25 -25
- package/dist/namespaces/Teams.d.ts +29 -33
- package/dist/namespaces/Teams.js +37 -37
- package/dist/namespaces/Users.d.ts +33 -29
- package/dist/namespaces/Users.js +24 -24
- package/dist/namespaces/WebsiteStats.d.ts +18 -18
- package/dist/namespaces/WebsiteStats.js +19 -19
- package/dist/namespaces/Websites.d.ts +19 -22
- package/dist/namespaces/Websites.js +19 -19
- package/package.json +7 -5
package/dist/namespaces/Users.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
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
|
|
5
|
-
async function
|
|
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.
|
|
9
|
-
/** Gets a user by ID: https://umami.is/docs/api/users
|
|
10
|
-
async function
|
|
11
|
-
return await this.request("get", ["users",
|
|
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.
|
|
14
|
-
/** Updates a user: https://umami.is/docs/api/users
|
|
15
|
-
async function
|
|
16
|
-
return await this.request("post", ["users",
|
|
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.
|
|
19
|
-
/** Deletes a user: https://umami.is/docs/api/users
|
|
20
|
-
async function
|
|
21
|
-
return await this.request("delete", ["users",
|
|
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.
|
|
24
|
-
/** Gets all websites that belong to a user: https://umami.is/docs/api/users
|
|
25
|
-
async function
|
|
26
|
-
const response = await this.request("get", ["users",
|
|
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.
|
|
30
|
-
/** Gets all teams that belong to a user: https://umami.is/docs/api/users
|
|
31
|
-
async function
|
|
32
|
-
const response = await this.request("get", ["users",
|
|
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.
|
|
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
|
-
/**
|
|
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:
|
|
22
|
+
pageviews: number;
|
|
23
23
|
/** Number of unique visitors */
|
|
24
|
-
visitors:
|
|
24
|
+
visitors: number;
|
|
25
25
|
/** Number of unique visits */
|
|
26
|
-
visits:
|
|
26
|
+
visits: number;
|
|
27
27
|
/** Number of visitors who only visit a single page */
|
|
28
|
-
bounces:
|
|
28
|
+
bounces: number;
|
|
29
29
|
/** Time spent on the website */
|
|
30
|
-
totaltime:
|
|
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
|
|
34
|
-
function
|
|
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
|
|
38
|
-
function
|
|
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
|
|
43
|
-
function
|
|
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
|
|
59
|
-
function
|
|
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
|
|
64
|
-
function
|
|
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
|
|
84
|
-
function
|
|
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
|
-
/**
|
|
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
|
|
5
|
-
async function
|
|
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.
|
|
9
|
-
/** Gets events within a given time range: https://umami.is/docs/api/website-stats
|
|
10
|
-
async function
|
|
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.
|
|
14
|
-
/** Gets metrics for a given time range: https://umami.is/docs/api/website-stats
|
|
15
|
-
async function
|
|
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.
|
|
19
|
-
/** Gets expanded metrics for a given time range: https://umami.is/docs/api/website-stats
|
|
20
|
-
async function
|
|
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.
|
|
24
|
-
/** Gets pageviews within a given time range: https://umami.is/docs/api/website-stats
|
|
25
|
-
async function
|
|
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.
|
|
29
|
-
/** Gets summarized website statistics: https://umami.is/docs/api/website-stats
|
|
30
|
-
async function
|
|
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.
|
|
33
|
+
WebsiteStats.get_WEBSITEID_Stats = get_WEBSITEID_Stats;
|
|
34
34
|
})(WebsiteStats || (WebsiteStats = {}));
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { API, GenericRequestParameters,
|
|
2
|
-
/**
|
|
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
|
|
5
|
-
function
|
|
6
|
-
|
|
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
|
|
11
|
-
function
|
|
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
|
|
24
|
-
function
|
|
25
|
-
/** Updates a website: https://umami.is/docs/api/websites
|
|
26
|
-
function
|
|
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
|
|
29
|
+
name?: string;
|
|
29
30
|
/** The full domain of the tracked website */
|
|
30
|
-
domain
|
|
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
|
|
35
|
-
function
|
|
36
|
-
|
|
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
|
-
/**
|
|
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
|
|
5
|
-
async function
|
|
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.
|
|
10
|
-
/** Creates a website: https://umami.is/docs/api/websites
|
|
11
|
-
async function
|
|
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.
|
|
15
|
-
/** Gets a website by ID: https://umami.is/docs/api/websites
|
|
16
|
-
async function
|
|
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.
|
|
20
|
-
/** Updates a website: https://umami.is/docs/api/websites
|
|
21
|
-
async function
|
|
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.
|
|
25
|
-
/** Deletes a website: https://umami.is/docs/api/websites
|
|
26
|
-
async function
|
|
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.
|
|
30
|
-
/** Resets a website by removing all data related to the website: https://umami.is/docs/api/websites
|
|
31
|
-
async function
|
|
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.
|
|
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.
|
|
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://
|
|
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/
|
|
32
|
-
"
|
|
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.
|
|
36
|
+
"typescript": "^5.9.3"
|
|
35
37
|
}
|
|
36
38
|
}
|