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.
@@ -1,5 +1,5 @@
1
1
  import { API, Filters, GenericRequestParameters, Timestamps } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/sessions-api */
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-api#get-apiwebsiteswebsiteidsessions (TODO UNTESTED) */
21
- function getWebsiteSessions(this: API, websiteId: string, parameters: Filters & Timestamps & GenericRequestParameters): Promise<(GenericSession & {
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-api#get-apiwebsiteswebsiteidsessionsstats (TODO UNTESTED) */
26
- function getWebsiteSessionsStats(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
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-api#get-apiwebsiteswebsiteidsessionsweekly (TODO UNTESTED) */
49
- function getWebsiteSessionsWeekly(this: API, websiteId: string, parameters: Filters & Timestamps & {
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-api#get-apiwebsiteswebsiteidsessionssessionid (TODO UNTESTED) */
53
- function getWebsiteSession(this: API, websiteId: string, sessionId: string): Promise<GenericSession & {
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-api#get-apiwebsiteswebsiteidsessionssessionidactivity (TODO UNTESTED) */
59
- function getWebsiteSessionActivity(this: API, websiteId: string, sessionId: string, parameters: Timestamps): Promise<{
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-api#get-apiwebsiteswebsiteidsessionssessionidproperties (TODO UNTESTED) */
71
- function getWebsiteSessionProperties(this: API, websiteId: string, sessionId: string): Promise<{
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-api#get-apiwebsiteswebsiteidsession-dataproperties (TODO UNTESTED) */
82
- function getWebsiteSessionDataProperties(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
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-api#get-apiwebsiteswebsiteidsession-datavalues (TODO UNTESTED) */
87
- function getWebsiteSessionDataValues(this: API, websiteId: string, parameters: Filters & Timestamps & {
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
- /** For endpoints listed on: https://umami.is/docs/api/sessions-api */
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-api#get-apiwebsiteswebsiteidsessions (TODO UNTESTED) */
5
- async function getWebsiteSessions(websiteId, parameters) {
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.getWebsiteSessions = getWebsiteSessions;
10
- /** Gets summarized website session statistics: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsessionsstats (TODO UNTESTED) */
11
- async function getWebsiteSessionsStats(websiteId, parameters) {
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.getWebsiteSessionsStats = getWebsiteSessionsStats;
15
- /** Get collected count of sessions by hour of weekday: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsessionsweekly (TODO UNTESTED) */
16
- async function getWebsiteSessionsWeekly(websiteId, parameters) {
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.getWebsiteSessionsWeekly = getWebsiteSessionsWeekly;
20
- /** Gets session details for a individual session: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsessionssessionid (TODO UNTESTED) */
21
- async function getWebsiteSession(websiteId, sessionId) {
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.getWebsiteSession = getWebsiteSession;
25
- /** Gets session activity for a individual session: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsessionssessionidactivity (TODO UNTESTED) */
26
- async function getWebsiteSessionActivity(websiteId, sessionId, parameters) {
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.getWebsiteSessionActivity = getWebsiteSessionActivity;
30
- /** Gets session properties for a individual session: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsessionssessionidproperties (TODO UNTESTED) */
31
- async function getWebsiteSessionProperties(websiteId, sessionId) {
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.getWebsiteSessionProperties = getWebsiteSessionProperties;
35
- /** Gets session data counts by property name: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsession-dataproperties (TODO UNTESTED) */
36
- async function getWebsiteSessionDataProperties(websiteId, parameters) {
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.getWebsiteSessionDataProperties = getWebsiteSessionDataProperties;
40
- /** Gets session data counts for a given property: https://umami.is/docs/api/sessions-api#get-apiwebsiteswebsiteidsession-datavalues (TODO UNTESTED) */
41
- async function getWebsiteSessionDataValues(websiteId, parameters) {
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.getWebsiteSessionDataValues = getWebsiteSessionDataValues;
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
- /** For endpoints listed on: https://umami.is/docs/api/teams-api */
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-api#get-apiteams (TODO UNTESTED) */
19
- function getTeams(this: API, parameters?: Omit<GenericRequestParameters, "search">): Promise<(GenericTeam & {
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-api#post-apiteams (TODO UNTESTED) */
27
- function createTeam(this: API, name: string): Promise<[GenericTeam, Omit<TeamMember, "user">]>;
28
- /** Join a team: https://umami.is/docs/api/teams-api#post-apiteamsjoin (TODO UNTESTED) */
29
- function joinTeam(this: API, accessCode: string): Promise<Omit<TeamMember, "user">>;
30
- /** Get a team: https://umami.is/docs/api/teams-api#get-apiteamsteamid (TODO UNTESTED) */
31
- function getTeam(this: API, teamId: string): Promise<GenericTeam & {
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-api#post-apiteamsteamid (TODO UNTESTED) */
35
- function updateTeam(this: API, teamId: string, parameters: {
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-api#delete-apiteamsteamid (TODO UNTESTED) */
42
- function deleteTeam(this: API, teamId: string): Promise<{
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-api#get-apiteamsteamidusers (TODO UNTESTED) */
46
- function getTeamUsers(this: API, teamId: string, parameters: GenericRequestParameters): Promise<TeamMember[]>;
47
- /** Add a user to a team: https://umami.is/docs/api/teams-api#post-apiteamsteamidusers (TODO UNTESTED) */
48
- function addTeamUser(this: API, teamId: string, parameters: {
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-api#get-apiteamsteamidusersuserid (TODO UNTESTED) */
55
- function getTeamUser(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-api#post-apiteamsteamidusersuserid (TODO UNTESTED) */
57
- function updateTeamUser(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-api#delete-apiteamsteamidusersuserid (TODO UNTESTED) */
59
- function removeTeamUser(this: API, teamId: string, userId: string): Promise<{
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-api#get-apiteamsteamidwebsites (TODO UNTESTED) */
63
- function getTeamWebsites(this: API, teamId: string, parameters: GenericRequestParameters): Promise<(GenericObject & {
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;
@@ -1,67 +1,67 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/teams-api */
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-api#get-apiteams (TODO UNTESTED) */
5
- async function getTeams(parameters) {
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.getTeams = getTeams;
10
- /** Creates a team: https://umami.is/docs/api/teams-api#post-apiteams (TODO UNTESTED) */
11
- async function createTeam(name) {
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.createTeam = createTeam;
15
- /** Join a team: https://umami.is/docs/api/teams-api#post-apiteamsjoin (TODO UNTESTED) */
16
- async function joinTeam(accessCode) {
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.joinTeam = joinTeam;
20
- /** Get a team: https://umami.is/docs/api/teams-api#get-apiteamsteamid (TODO UNTESTED) */
21
- async function getTeam(teamId) {
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.getTeam = getTeam;
25
- /** Update a team: https://umami.is/docs/api/teams-api#post-apiteamsteamid (TODO UNTESTED) */
26
- async function updateTeam(teamId, parameters) {
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.updateTeam = updateTeam;
30
- /** Delete a team: https://umami.is/docs/api/teams-api#delete-apiteamsteamid (TODO UNTESTED) */
31
- async function deleteTeam(teamId) {
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.deleteTeam = deleteTeam;
35
- /** Get all users that belong to a team: https://umami.is/docs/api/teams-api#get-apiteamsteamidusers (TODO UNTESTED) */
36
- async function getTeamUsers(teamId, parameters) {
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.getTeamUsers = getTeamUsers;
41
- /** Add a user to a team: https://umami.is/docs/api/teams-api#post-apiteamsteamidusers (TODO UNTESTED) */
42
- async function addTeamUser(teamId, parameters) {
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.addTeamUser = addTeamUser;
46
- /** Get a user belonging to a team: https://umami.is/docs/api/teams-api#get-apiteamsteamidusersuserid (TODO UNTESTED) */
47
- async function getTeamUser(teamId, userId) {
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.getTeamUser = getTeamUser;
51
- /** Update a user's role on a team: https://umami.is/docs/api/teams-api#post-apiteamsteamidusersuserid (TODO UNTESTED) */
52
- async function updateTeamUser(teamId, userId, role) {
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.updateTeamUser = updateTeamUser;
56
- /** Remove a user from a team: https://umami.is/docs/api/teams-api#delete-apiteamsteamidusersuserid (TODO UNTESTED) */
57
- async function removeTeamUser(teamId, userId) {
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.removeTeamUser = removeTeamUser;
61
- /** Get all websites that belong to a team: https://umami.is/docs/api/teams-api#get-apiteamsteamidwebsites (TODO UNTESTED) */
62
- async function getTeamWebsites(teamId, parameters) {
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.getTeamWebsites = getTeamWebsites;
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
- /** For endpoints listed on: https://umami.is/docs/api/users-api */
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-api#post-apiusers */
8
- function createUser(this: API, parameters: {
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-api#get-apiusersuserid */
19
- function getUser(this: API, id: string): Promise<GenericUser & {
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-api#post-apiusersuserid */
23
- function updateUser(this: API, id: string, parameters?: {
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-api#delete-apiusersuserid */
34
- function deleteUser(this: API, id: string): Promise<{
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-api#get-apiusersuseridwebsites */
38
- function getUserWebsites(this: API, id: string, parameters: GenericRequestParameters & {
39
- includeTeams: boolean;
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-api#get-apiusersuseridteams */
44
- function getUserTeams(this: API, id: string, parameters?: Omit<GenericRequestParameters, "search">): Promise<(GenericObject & {
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;
@@ -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 = {}));