umami-api-js 0.0.4 → 0.1.0
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 +183 -70
- package/dist/index.js +162 -68
- package/dist/namespaces/Admin.d.ts +5 -14
- 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 +28 -0
- package/dist/namespaces/Links.js +25 -0
- package/dist/namespaces/Me.d.ts +44 -0
- package/dist/namespaces/Me.js +21 -0
- package/dist/namespaces/Pixels.d.ts +25 -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 +27 -27
- 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 +25 -25
- package/dist/namespaces/Teams.js +37 -37
- package/dist/namespaces/Users.d.ts +15 -18
- 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 +13 -13
- package/dist/namespaces/Websites.js +19 -19
- package/package.json +7 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { API, Filters, GenericRequestParameters, Timestamps } from "../index.js";
|
|
2
|
-
/**
|
|
2
|
+
/** Operations around Sessions and Session data: https://umami.is/docs/api/sessions */
|
|
3
3
|
export declare namespace Sessions {
|
|
4
4
|
interface GenericSession {
|
|
5
5
|
id: string;
|
|
@@ -17,13 +17,13 @@ export declare namespace Sessions {
|
|
|
17
17
|
visits: number;
|
|
18
18
|
views: number;
|
|
19
19
|
}
|
|
20
|
-
/** Gets website session details within a given time range: https://umami.is/docs/api/sessions
|
|
21
|
-
function
|
|
20
|
+
/** Gets website session details within a given time range: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessions (TODO UNTESTED) */
|
|
21
|
+
function get_WEBSITEID_Sessions(this: API, websiteId: string, parameters: Filters & Timestamps & GenericRequestParameters): Promise<(GenericSession & {
|
|
22
22
|
hostname: string;
|
|
23
23
|
createdAt: Date;
|
|
24
24
|
})[]>;
|
|
25
|
-
/** Gets summarized website session statistics: https://umami.is/docs/api/sessions
|
|
26
|
-
function
|
|
25
|
+
/** Gets summarized website session statistics: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionsstats (TODO UNTESTED) */
|
|
26
|
+
function get_WEBSITEID_SessionsStats(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
|
|
27
27
|
/** Pages hits */
|
|
28
28
|
pageviews: {
|
|
29
29
|
value: number;
|
|
@@ -45,18 +45,18 @@ export declare namespace Sessions {
|
|
|
45
45
|
value: number;
|
|
46
46
|
};
|
|
47
47
|
}>;
|
|
48
|
-
/** Get collected count of sessions by hour of weekday: https://umami.is/docs/api/sessions
|
|
49
|
-
function
|
|
48
|
+
/** Get collected count of sessions by hour of weekday: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionsweekly (TODO UNTESTED) */
|
|
49
|
+
function get_WEBSITEID_SessionsWeekly(this: API, websiteId: string, parameters: Filters & Timestamps & {
|
|
50
50
|
timezone: string;
|
|
51
51
|
}): Promise<number[][]>;
|
|
52
|
-
/** Gets session details for a individual session: https://umami.is/docs/api/sessions
|
|
53
|
-
function
|
|
52
|
+
/** Gets session details for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionid (TODO UNTESTED) */
|
|
53
|
+
function get_WEBSITEID_Sessions_SESSIONID(this: API, websiteId: string, sessionId: string): Promise<GenericSession & {
|
|
54
54
|
distinctId: string;
|
|
55
55
|
events: number;
|
|
56
56
|
totaltime: number;
|
|
57
57
|
}>;
|
|
58
|
-
/** Gets session activity for a individual session: https://umami.is/docs/api/sessions
|
|
59
|
-
function
|
|
58
|
+
/** Gets session activity for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionidactivity (TODO UNTESTED) */
|
|
59
|
+
function get_WEBSITEID_Sessions_SESSIONID_Activity(this: API, websiteId: string, sessionId: string, parameters: Timestamps): Promise<{
|
|
60
60
|
createdAt: Date;
|
|
61
61
|
urlPath: string;
|
|
62
62
|
urlQuery: string;
|
|
@@ -67,8 +67,8 @@ export declare namespace Sessions {
|
|
|
67
67
|
visitId: string;
|
|
68
68
|
hasData: number;
|
|
69
69
|
}[]>;
|
|
70
|
-
/** Gets session properties for a individual session: https://umami.is/docs/api/sessions
|
|
71
|
-
function
|
|
70
|
+
/** Gets session properties for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionidproperties (TODO UNTESTED) */
|
|
71
|
+
function get_WEBSITEID_Sessions_SESSIONID_Properties(this: API, websiteId: string, sessionId: string): Promise<{
|
|
72
72
|
websiteId: string;
|
|
73
73
|
sessionid: string;
|
|
74
74
|
dataKey: string;
|
|
@@ -78,13 +78,13 @@ export declare namespace Sessions {
|
|
|
78
78
|
dateValue: Date | null;
|
|
79
79
|
createdAt: Date;
|
|
80
80
|
}[]>;
|
|
81
|
-
/** Gets session data counts by property name: https://umami.is/docs/api/sessions
|
|
82
|
-
function
|
|
81
|
+
/** Gets session data counts by property name: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsession-dataproperties (TODO UNTESTED) */
|
|
82
|
+
function get_WEBSITEID_SessiondataProperties(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
|
|
83
83
|
propertyName: string;
|
|
84
84
|
total: number;
|
|
85
85
|
}[]>;
|
|
86
|
-
/** Gets session data counts for a given property: https://umami.is/docs/api/sessions
|
|
87
|
-
function
|
|
86
|
+
/** Gets session data counts for a given property: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsession-datavalues (TODO UNTESTED) */
|
|
87
|
+
function get_WEBSITEID_SessiondataValues(this: API, websiteId: string, parameters: Filters & Timestamps & {
|
|
88
88
|
propertyName: string;
|
|
89
89
|
}): Promise<{
|
|
90
90
|
value: string;
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Operations around Sessions and Session data: https://umami.is/docs/api/sessions */
|
|
2
2
|
export var Sessions;
|
|
3
3
|
(function (Sessions) {
|
|
4
|
-
/** Gets website session details within a given time range: https://umami.is/docs/api/sessions
|
|
5
|
-
async function
|
|
4
|
+
/** Gets website session details within a given time range: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessions (TODO UNTESTED) */
|
|
5
|
+
async function get_WEBSITEID_Sessions(websiteId, parameters) {
|
|
6
6
|
const response = await this.request("get", ["websites", websiteId, "sessions"], parameters);
|
|
7
7
|
return response.data;
|
|
8
8
|
}
|
|
9
|
-
Sessions.
|
|
10
|
-
/** Gets summarized website session statistics: https://umami.is/docs/api/sessions
|
|
11
|
-
async function
|
|
9
|
+
Sessions.get_WEBSITEID_Sessions = get_WEBSITEID_Sessions;
|
|
10
|
+
/** Gets summarized website session statistics: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionsstats (TODO UNTESTED) */
|
|
11
|
+
async function get_WEBSITEID_SessionsStats(websiteId, parameters) {
|
|
12
12
|
return await this.request("get", ["websites", websiteId, "sessions"], parameters);
|
|
13
13
|
}
|
|
14
|
-
Sessions.
|
|
15
|
-
/** Get collected count of sessions by hour of weekday: https://umami.is/docs/api/sessions
|
|
16
|
-
async function
|
|
14
|
+
Sessions.get_WEBSITEID_SessionsStats = get_WEBSITEID_SessionsStats;
|
|
15
|
+
/** Get collected count of sessions by hour of weekday: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionsweekly (TODO UNTESTED) */
|
|
16
|
+
async function get_WEBSITEID_SessionsWeekly(websiteId, parameters) {
|
|
17
17
|
return await this.request("get", ["websites", websiteId, "sessions", "weekly"], parameters);
|
|
18
18
|
}
|
|
19
|
-
Sessions.
|
|
20
|
-
/** Gets session details for a individual session: https://umami.is/docs/api/sessions
|
|
21
|
-
async function
|
|
19
|
+
Sessions.get_WEBSITEID_SessionsWeekly = get_WEBSITEID_SessionsWeekly;
|
|
20
|
+
/** Gets session details for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionid (TODO UNTESTED) */
|
|
21
|
+
async function get_WEBSITEID_Sessions_SESSIONID(websiteId, sessionId) {
|
|
22
22
|
return await this.request("get", ["websites", websiteId, "sessions", sessionId]);
|
|
23
23
|
}
|
|
24
|
-
Sessions.
|
|
25
|
-
/** Gets session activity for a individual session: https://umami.is/docs/api/sessions
|
|
26
|
-
async function
|
|
24
|
+
Sessions.get_WEBSITEID_Sessions_SESSIONID = get_WEBSITEID_Sessions_SESSIONID;
|
|
25
|
+
/** Gets session activity for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionidactivity (TODO UNTESTED) */
|
|
26
|
+
async function get_WEBSITEID_Sessions_SESSIONID_Activity(websiteId, sessionId, parameters) {
|
|
27
27
|
return await this.request("get", ["websites", websiteId, "sessions", sessionId, "activity"], parameters);
|
|
28
28
|
}
|
|
29
|
-
Sessions.
|
|
30
|
-
/** Gets session properties for a individual session: https://umami.is/docs/api/sessions
|
|
31
|
-
async function
|
|
29
|
+
Sessions.get_WEBSITEID_Sessions_SESSIONID_Activity = get_WEBSITEID_Sessions_SESSIONID_Activity;
|
|
30
|
+
/** Gets session properties for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionidproperties (TODO UNTESTED) */
|
|
31
|
+
async function get_WEBSITEID_Sessions_SESSIONID_Properties(websiteId, sessionId) {
|
|
32
32
|
return await this.request("get", ["websites", websiteId, "sessions", sessionId, "activity", "properties"]);
|
|
33
33
|
}
|
|
34
|
-
Sessions.
|
|
35
|
-
/** Gets session data counts by property name: https://umami.is/docs/api/sessions
|
|
36
|
-
async function
|
|
34
|
+
Sessions.get_WEBSITEID_Sessions_SESSIONID_Properties = get_WEBSITEID_Sessions_SESSIONID_Properties;
|
|
35
|
+
/** Gets session data counts by property name: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsession-dataproperties (TODO UNTESTED) */
|
|
36
|
+
async function get_WEBSITEID_SessiondataProperties(websiteId, parameters) {
|
|
37
37
|
return await this.request("get", ["websites", websiteId, "session-data", "properties"], parameters);
|
|
38
38
|
}
|
|
39
|
-
Sessions.
|
|
40
|
-
/** Gets session data counts for a given property: https://umami.is/docs/api/sessions
|
|
41
|
-
async function
|
|
39
|
+
Sessions.get_WEBSITEID_SessiondataProperties = get_WEBSITEID_SessiondataProperties;
|
|
40
|
+
/** Gets session data counts for a given property: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsession-datavalues (TODO UNTESTED) */
|
|
41
|
+
async function get_WEBSITEID_SessiondataValues(websiteId, parameters) {
|
|
42
42
|
return await this.request("get", ["websites", websiteId, "session-data", "values"], parameters);
|
|
43
43
|
}
|
|
44
|
-
Sessions.
|
|
44
|
+
Sessions.get_WEBSITEID_SessiondataValues = get_WEBSITEID_SessiondataValues;
|
|
45
45
|
})(Sessions || (Sessions = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { API, GenericObject, GenericRequestParameters, TeamRole } from "../index.js";
|
|
2
|
-
/**
|
|
2
|
+
/** Operations around Team management: https://umami.is/docs/api/teams */
|
|
3
3
|
export declare namespace Teams {
|
|
4
4
|
interface GenericTeam extends GenericObject {
|
|
5
5
|
name: string;
|
|
@@ -15,52 +15,52 @@ export declare namespace Teams {
|
|
|
15
15
|
username: string;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
/** Returns all teams: https://umami.is/docs/api/teams
|
|
19
|
-
function
|
|
18
|
+
/** Returns all teams: https://umami.is/docs/api/teams#get-apiteams (TODO UNTESTED) */
|
|
19
|
+
function get(this: API, parameters?: Omit<GenericRequestParameters, "search">): Promise<(GenericTeam & {
|
|
20
20
|
members: TeamMember[];
|
|
21
21
|
_count: {
|
|
22
22
|
websites: number;
|
|
23
23
|
members: number;
|
|
24
24
|
};
|
|
25
25
|
})[]>;
|
|
26
|
-
/** Creates a team: https://umami.is/docs/api/teams
|
|
27
|
-
function
|
|
28
|
-
/** Join a team: https://umami.is/docs/api/teams
|
|
29
|
-
function
|
|
30
|
-
/** Get a team: https://umami.is/docs/api/teams
|
|
31
|
-
function
|
|
26
|
+
/** Creates a team: https://umami.is/docs/api/teams#post-apiteams (TODO UNTESTED) */
|
|
27
|
+
function post(this: API, name: string): Promise<[GenericTeam, Omit<TeamMember, "user">]>;
|
|
28
|
+
/** Join a team: https://umami.is/docs/api/teams#post-apiteamsjoin (TODO UNTESTED) */
|
|
29
|
+
function postJoin(this: API, accessCode: string): Promise<Omit<TeamMember, "user">>;
|
|
30
|
+
/** Get a team: https://umami.is/docs/api/teams#get-apiteamsteamid (TODO UNTESTED) */
|
|
31
|
+
function get_TEAMID(this: API, teamId: string): Promise<GenericTeam & {
|
|
32
32
|
members: Omit<TeamMember, "user">[];
|
|
33
33
|
}>;
|
|
34
|
-
/** Update a team: https://umami.is/docs/api/teams
|
|
35
|
-
function
|
|
34
|
+
/** Update a team: https://umami.is/docs/api/teams#post-apiteamsteamid (TODO UNTESTED) */
|
|
35
|
+
function post_TEAMID(this: API, teamId: string, parameters: {
|
|
36
36
|
/** The team's name */
|
|
37
37
|
name?: string;
|
|
38
38
|
/** The team's access code */
|
|
39
39
|
accessCode?: string;
|
|
40
40
|
}): Promise<GenericTeam>;
|
|
41
|
-
/** Delete a team: https://umami.is/docs/api/teams
|
|
42
|
-
function
|
|
41
|
+
/** Delete a team: https://umami.is/docs/api/teams#delete-apiteamsteamid (TODO UNTESTED) */
|
|
42
|
+
function delete_TEAMID(this: API, teamId: string): Promise<{
|
|
43
43
|
ok: boolean;
|
|
44
44
|
}>;
|
|
45
|
-
/** Get all users that belong to a team: https://umami.is/docs/api/teams
|
|
46
|
-
function
|
|
47
|
-
/** Add a user to a team: https://umami.is/docs/api/teams
|
|
48
|
-
function
|
|
45
|
+
/** Get all users that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusers (TODO UNTESTED) */
|
|
46
|
+
function get_TEAMID_Users(this: API, teamId: string, parameters: GenericRequestParameters): Promise<TeamMember[]>;
|
|
47
|
+
/** Add a user to a team: https://umami.is/docs/api/teams#post-apiteamsteamidusers (TODO UNTESTED) */
|
|
48
|
+
function post_TEAMID_Users(this: API, teamId: string, parameters: {
|
|
49
49
|
/** ID of user to be added */
|
|
50
50
|
userId: string;
|
|
51
51
|
/** Team role for user */
|
|
52
52
|
role: TeamRole;
|
|
53
53
|
}): Promise<Omit<TeamMember, "user">>;
|
|
54
|
-
/** Get a user belonging to a team: https://umami.is/docs/api/teams
|
|
55
|
-
function
|
|
56
|
-
/** Update a user's role on a team: https://umami.is/docs/api/teams
|
|
57
|
-
function
|
|
58
|
-
/** Remove a user from a team: https://umami.is/docs/api/teams
|
|
59
|
-
function
|
|
54
|
+
/** Get a user belonging to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
55
|
+
function get_TEAMID_Users_USERID(this: API, teamId: string, userId: string): Promise<Omit<TeamMember, "user">>;
|
|
56
|
+
/** Update a user's role on a team: https://umami.is/docs/api/teams#post-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
57
|
+
function post_TEAMID_Users_USERID(this: API, teamId: string, userId: string, role: TeamRole): Promise<Omit<TeamMember, "user">>;
|
|
58
|
+
/** Remove a user from a team: https://umami.is/docs/api/teams#delete-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
59
|
+
function delete_TEAMID_Users_USERID(this: API, teamId: string, userId: string): Promise<{
|
|
60
60
|
ok: boolean;
|
|
61
61
|
}>;
|
|
62
|
-
/** Get all websites that belong to a team: https://umami.is/docs/api/teams
|
|
63
|
-
function
|
|
62
|
+
/** Get all websites that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidwebsites (TODO UNTESTED) */
|
|
63
|
+
function get_TEAMID_Websites(this: API, teamId: string, parameters: GenericRequestParameters): Promise<(GenericObject & {
|
|
64
64
|
name: string;
|
|
65
65
|
domain: string;
|
|
66
66
|
shareId: string;
|
package/dist/namespaces/Teams.js
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Operations around Team management: https://umami.is/docs/api/teams */
|
|
2
2
|
export var Teams;
|
|
3
3
|
(function (Teams) {
|
|
4
|
-
/** Returns all teams: https://umami.is/docs/api/teams
|
|
5
|
-
async function
|
|
4
|
+
/** Returns all teams: https://umami.is/docs/api/teams#get-apiteams (TODO UNTESTED) */
|
|
5
|
+
async function get(parameters) {
|
|
6
6
|
const response = await this.request("get", ["teams"], parameters);
|
|
7
7
|
return response.data;
|
|
8
8
|
}
|
|
9
|
-
Teams.
|
|
10
|
-
/** Creates a team: https://umami.is/docs/api/teams
|
|
11
|
-
async function
|
|
9
|
+
Teams.get = get;
|
|
10
|
+
/** Creates a team: https://umami.is/docs/api/teams#post-apiteams (TODO UNTESTED) */
|
|
11
|
+
async function post(name) {
|
|
12
12
|
return await this.request("post", ["teams"], { name });
|
|
13
13
|
}
|
|
14
|
-
Teams.
|
|
15
|
-
/** Join a team: https://umami.is/docs/api/teams
|
|
16
|
-
async function
|
|
14
|
+
Teams.post = post;
|
|
15
|
+
/** Join a team: https://umami.is/docs/api/teams#post-apiteamsjoin (TODO UNTESTED) */
|
|
16
|
+
async function postJoin(accessCode) {
|
|
17
17
|
return await this.request("post", ["teams", "join"], { accessCode });
|
|
18
18
|
}
|
|
19
|
-
Teams.
|
|
20
|
-
/** Get a team: https://umami.is/docs/api/teams
|
|
21
|
-
async function
|
|
19
|
+
Teams.postJoin = postJoin;
|
|
20
|
+
/** Get a team: https://umami.is/docs/api/teams#get-apiteamsteamid (TODO UNTESTED) */
|
|
21
|
+
async function get_TEAMID(teamId) {
|
|
22
22
|
return await this.request("get", ["teams", teamId]);
|
|
23
23
|
}
|
|
24
|
-
Teams.
|
|
25
|
-
/** Update a team: https://umami.is/docs/api/teams
|
|
26
|
-
async function
|
|
24
|
+
Teams.get_TEAMID = get_TEAMID;
|
|
25
|
+
/** Update a team: https://umami.is/docs/api/teams#post-apiteamsteamid (TODO UNTESTED) */
|
|
26
|
+
async function post_TEAMID(teamId, parameters) {
|
|
27
27
|
return await this.request("post", ["teams", teamId], parameters);
|
|
28
28
|
}
|
|
29
|
-
Teams.
|
|
30
|
-
/** Delete a team: https://umami.is/docs/api/teams
|
|
31
|
-
async function
|
|
29
|
+
Teams.post_TEAMID = post_TEAMID;
|
|
30
|
+
/** Delete a team: https://umami.is/docs/api/teams#delete-apiteamsteamid (TODO UNTESTED) */
|
|
31
|
+
async function delete_TEAMID(teamId) {
|
|
32
32
|
return await this.request("delete", ["teams", teamId]);
|
|
33
33
|
}
|
|
34
|
-
Teams.
|
|
35
|
-
/** Get all users that belong to a team: https://umami.is/docs/api/teams
|
|
36
|
-
async function
|
|
34
|
+
Teams.delete_TEAMID = delete_TEAMID;
|
|
35
|
+
/** Get all users that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusers (TODO UNTESTED) */
|
|
36
|
+
async function get_TEAMID_Users(teamId, parameters) {
|
|
37
37
|
const response = await this.request("get", ["teams", teamId, "users"], parameters);
|
|
38
38
|
return response.data;
|
|
39
39
|
}
|
|
40
|
-
Teams.
|
|
41
|
-
/** Add a user to a team: https://umami.is/docs/api/teams
|
|
42
|
-
async function
|
|
40
|
+
Teams.get_TEAMID_Users = get_TEAMID_Users;
|
|
41
|
+
/** Add a user to a team: https://umami.is/docs/api/teams#post-apiteamsteamidusers (TODO UNTESTED) */
|
|
42
|
+
async function post_TEAMID_Users(teamId, parameters) {
|
|
43
43
|
return await this.request("post", ["teams", teamId, "users"], parameters);
|
|
44
44
|
}
|
|
45
|
-
Teams.
|
|
46
|
-
/** Get a user belonging to a team: https://umami.is/docs/api/teams
|
|
47
|
-
async function
|
|
45
|
+
Teams.post_TEAMID_Users = post_TEAMID_Users;
|
|
46
|
+
/** Get a user belonging to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
47
|
+
async function get_TEAMID_Users_USERID(teamId, userId) {
|
|
48
48
|
return await this.request("get", ["teams", teamId, "users", userId]);
|
|
49
49
|
}
|
|
50
|
-
Teams.
|
|
51
|
-
/** Update a user's role on a team: https://umami.is/docs/api/teams
|
|
52
|
-
async function
|
|
50
|
+
Teams.get_TEAMID_Users_USERID = get_TEAMID_Users_USERID;
|
|
51
|
+
/** Update a user's role on a team: https://umami.is/docs/api/teams#post-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
52
|
+
async function post_TEAMID_Users_USERID(teamId, userId, role) {
|
|
53
53
|
return await this.request("post", ["teams", teamId, "users", userId], { role });
|
|
54
54
|
}
|
|
55
|
-
Teams.
|
|
56
|
-
/** Remove a user from a team: https://umami.is/docs/api/teams
|
|
57
|
-
async function
|
|
55
|
+
Teams.post_TEAMID_Users_USERID = post_TEAMID_Users_USERID;
|
|
56
|
+
/** Remove a user from a team: https://umami.is/docs/api/teams#delete-apiteamsteamidusersuserid (TODO UNTESTED) */
|
|
57
|
+
async function delete_TEAMID_Users_USERID(teamId, userId) {
|
|
58
58
|
return await this.request("delete", ["teams", teamId, "users", userId]);
|
|
59
59
|
}
|
|
60
|
-
Teams.
|
|
61
|
-
/** Get all websites that belong to a team: https://umami.is/docs/api/teams
|
|
62
|
-
async function
|
|
60
|
+
Teams.delete_TEAMID_Users_USERID = delete_TEAMID_Users_USERID;
|
|
61
|
+
/** Get all websites that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidwebsites (TODO UNTESTED) */
|
|
62
|
+
async function get_TEAMID_Websites(teamId, parameters) {
|
|
63
63
|
const response = await this.request("get", ["teams", teamId, "websites"], parameters);
|
|
64
64
|
return response.data;
|
|
65
65
|
}
|
|
66
|
-
Teams.
|
|
66
|
+
Teams.get_TEAMID_Websites = get_TEAMID_Websites;
|
|
67
67
|
})(Teams || (Teams = {}));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { API, GenericObject, GenericRequestParameters, MinimalUser, Role, TeamRole, Website } from "../index.js";
|
|
2
|
-
/**
|
|
2
|
+
/** Operations around User management: https://umami.is/docs/api/users */
|
|
3
3
|
export declare namespace Users {
|
|
4
4
|
interface GenericUser extends MinimalUser {
|
|
5
5
|
role: Role;
|
|
6
6
|
}
|
|
7
|
-
/** Creates a user: https://umami.is/docs/api/users
|
|
8
|
-
function
|
|
7
|
+
/** Creates a user: https://umami.is/docs/api/users#post-apiusers */
|
|
8
|
+
function post(this: API, parameters: {
|
|
9
9
|
/** The user's username */
|
|
10
10
|
username: string;
|
|
11
11
|
/** The user's password */
|
|
@@ -15,12 +15,12 @@ export declare namespace Users {
|
|
|
15
15
|
/** Force a UUID assignment to the user */
|
|
16
16
|
id?: string;
|
|
17
17
|
}): Promise<GenericUser>;
|
|
18
|
-
/** Gets a user by ID: https://umami.is/docs/api/users
|
|
19
|
-
function
|
|
18
|
+
/** Gets a user by ID: https://umami.is/docs/api/users#get-apiusersuserid */
|
|
19
|
+
function get_USERID(this: API, userId: string): Promise<GenericUser & {
|
|
20
20
|
createdAt: Date;
|
|
21
21
|
}>;
|
|
22
|
-
/** Updates a user: https://umami.is/docs/api/users
|
|
23
|
-
function
|
|
22
|
+
/** Updates a user: https://umami.is/docs/api/users#post-apiusersuserid */
|
|
23
|
+
function post_USERID(this: API, userId: string, parameters?: {
|
|
24
24
|
/** The user's username */
|
|
25
25
|
username?: string;
|
|
26
26
|
/** The user's password */
|
|
@@ -30,18 +30,18 @@ export declare namespace Users {
|
|
|
30
30
|
}): Promise<GenericUser & {
|
|
31
31
|
createdAt: Date;
|
|
32
32
|
}>;
|
|
33
|
-
/** Deletes a user: https://umami.is/docs/api/users
|
|
34
|
-
function
|
|
33
|
+
/** Deletes a user: https://umami.is/docs/api/users#delete-apiusersuserid */
|
|
34
|
+
function delete_USERID(this: API, userId: string): Promise<{
|
|
35
35
|
ok: boolean;
|
|
36
36
|
}>;
|
|
37
|
-
/** Gets all websites that belong to a user: https://umami.is/docs/api/users
|
|
38
|
-
function
|
|
39
|
-
includeTeams
|
|
37
|
+
/** Gets all websites that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridwebsites */
|
|
38
|
+
function get_USERID_Websites(this: API, userId: string, parameters?: GenericRequestParameters & {
|
|
39
|
+
includeTeams?: boolean;
|
|
40
40
|
}): Promise<(Website & {
|
|
41
41
|
user: MinimalUser;
|
|
42
42
|
})[]>;
|
|
43
|
-
/** Gets all teams that belong to a user: https://umami.is/docs/api/users
|
|
44
|
-
function
|
|
43
|
+
/** Gets all teams that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridteams */
|
|
44
|
+
function get_USERID_Teams(this: API, userId: string, parameters?: Omit<GenericRequestParameters, "search">): Promise<(GenericObject & {
|
|
45
45
|
name: string;
|
|
46
46
|
accessCode: string;
|
|
47
47
|
logoUrl: string | null;
|
|
@@ -49,10 +49,7 @@ export declare namespace Users {
|
|
|
49
49
|
teamId: string;
|
|
50
50
|
userId: string;
|
|
51
51
|
role: TeamRole;
|
|
52
|
-
user:
|
|
53
|
-
id: string;
|
|
54
|
-
username: string;
|
|
55
|
-
};
|
|
52
|
+
user: MinimalUser;
|
|
56
53
|
}[];
|
|
57
54
|
_count: {
|
|
58
55
|
websites: number;
|
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 = {}));
|