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,8 +1,8 @@
1
1
  import { API, Filters, GenericRequestParameters, Timestamps } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/events-api */
2
+ /** Operations around Events and Event data: https://umami.is/docs/api/events */
3
3
  export declare namespace Events {
4
- /** Gets website event details within a given time range: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevents (TODO UNTESTED) */
5
- function getWebsiteEvents(this: API, websiteId: string, parameters: Filters & Timestamps & GenericRequestParameters): Promise<{
4
+ /** Gets website event details within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevents (TODO UNTESTED) */
5
+ function get_WEBSITEID_Events(this: API, websiteId: string, parameters: Filters & Timestamps & GenericRequestParameters): Promise<{
6
6
  id: string;
7
7
  websiteId: string;
8
8
  sessionId: string;
@@ -23,8 +23,8 @@ export declare namespace Events {
23
23
  eventName: string;
24
24
  hasData: number;
25
25
  }[]>;
26
- /** Gets event-data for a individual event https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-dataeventid (TODO UNTESTED) */
27
- function getWebsiteEventData(this: API, websiteId: string, eventId: string): Promise<{
26
+ /** Gets event-data for a individual event: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataeventid (TODO UNTESTED) */
27
+ function get_WEBSITEID_Eventdata_EVENTID(this: API, websiteId: string, eventId: string): Promise<{
28
28
  websiteId: string;
29
29
  sessionId: string;
30
30
  eventId: string;
@@ -37,8 +37,8 @@ export declare namespace Events {
37
37
  dataType: number;
38
38
  createdAt: Date;
39
39
  }[]>;
40
- /** Gets event data names, properties, and counts: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-dataevents (TODO UNTESTED) */
41
- function getWebsiteEventsData(this: API, websiteId: string, parameters: Filters & Timestamps & {
40
+ /** Gets event data names, properties, and counts: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataevents (TODO UNTESTED) */
41
+ function get_WEBSITEID_EventdataEvents(this: API, websiteId: string, parameters: Filters & Timestamps & {
42
42
  /** Event name filter */
43
43
  event?: string;
44
44
  }): Promise<{
@@ -47,21 +47,21 @@ export declare namespace Events {
47
47
  dataType: number;
48
48
  total: number;
49
49
  }[]>;
50
- /** Gets event data property and value counts within a given time range: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-datafields (TODO UNTESTED) */
51
- function getWebsiteEventsDataFields(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
50
+ /** Gets event data property and value counts within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datafields (TODO UNTESTED) */
51
+ function get_WEBSITEID_EventdataFields(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
52
52
  propertyName: string;
53
53
  dataType: number;
54
54
  value: string;
55
55
  total: number;
56
56
  }[]>;
57
- /** Gets event name and property counts for a website: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-dataproperties (TODO UNTESTED) */
58
- function getWebsiteEventsDataProperties(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
57
+ /** Gets event name and property counts for a website: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataproperties (TODO UNTESTED) */
58
+ function get_WEBSITEID_EventdataProperties(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
59
59
  eventName: string;
60
60
  propertyName: string;
61
61
  total: number;
62
62
  }[]>;
63
- /** Gets event data counts for a given event and property: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-datavalues (TODO UNTESTED) */
64
- function getWebsiteEventsDataValues(this: API, websiteId: string, parameters: Filters & Timestamps & {
63
+ /** Gets event data counts for a given event and property: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datavalues (TODO UNTESTED) */
64
+ function get_WEBSITEID_EventdataValues(this: API, websiteId: string, parameters: Filters & Timestamps & {
65
65
  /** Event name filter */
66
66
  event: string;
67
67
  /** Property name */
@@ -70,8 +70,8 @@ export declare namespace Events {
70
70
  value: string;
71
71
  total: number;
72
72
  }>;
73
- /** Gets aggregated website events, properties, and records within a given time range https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-datastats (TODO UNTESTED) */
74
- function getWebsiteEventsDataStats(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
73
+ /** Gets aggregated website events, properties, and records within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datastats (TODO UNTESTED) */
74
+ function get_WEBSITEID_EventdataStats(this: API, websiteId: string, parameters: Filters & Timestamps): Promise<{
75
75
  events: number;
76
76
  properties: number;
77
77
  records: number;
@@ -1,40 +1,40 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/events-api */
1
+ /** Operations around Events and Event data: https://umami.is/docs/api/events */
2
2
  export var Events;
3
3
  (function (Events) {
4
- /** Gets website event details within a given time range: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevents (TODO UNTESTED) */
5
- async function getWebsiteEvents(websiteId, parameters) {
4
+ /** Gets website event details within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevents (TODO UNTESTED) */
5
+ async function get_WEBSITEID_Events(websiteId, parameters) {
6
6
  const response = await this.request("get", ["websites", websiteId, "events"], parameters);
7
7
  return response.data;
8
8
  }
9
- Events.getWebsiteEvents = getWebsiteEvents;
10
- /** Gets event-data for a individual event https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-dataeventid (TODO UNTESTED) */
11
- async function getWebsiteEventData(websiteId, eventId) {
9
+ Events.get_WEBSITEID_Events = get_WEBSITEID_Events;
10
+ /** Gets event-data for a individual event: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataeventid (TODO UNTESTED) */
11
+ async function get_WEBSITEID_Eventdata_EVENTID(websiteId, eventId) {
12
12
  return await this.request("get", ["websites", websiteId, "event-data", eventId]);
13
13
  }
14
- Events.getWebsiteEventData = getWebsiteEventData;
15
- /** Gets event data names, properties, and counts: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-dataevents (TODO UNTESTED) */
16
- async function getWebsiteEventsData(websiteId, parameters) {
14
+ Events.get_WEBSITEID_Eventdata_EVENTID = get_WEBSITEID_Eventdata_EVENTID;
15
+ /** Gets event data names, properties, and counts: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataevents (TODO UNTESTED) */
16
+ async function get_WEBSITEID_EventdataEvents(websiteId, parameters) {
17
17
  return await this.request("get", ["websites", websiteId, "event-data", "events"], parameters);
18
18
  }
19
- Events.getWebsiteEventsData = getWebsiteEventsData;
20
- /** Gets event data property and value counts within a given time range: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-datafields (TODO UNTESTED) */
21
- async function getWebsiteEventsDataFields(websiteId, parameters) {
19
+ Events.get_WEBSITEID_EventdataEvents = get_WEBSITEID_EventdataEvents;
20
+ /** Gets event data property and value counts within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datafields (TODO UNTESTED) */
21
+ async function get_WEBSITEID_EventdataFields(websiteId, parameters) {
22
22
  return await this.request("get", ["websites", websiteId, "event-data", "fields"], parameters);
23
23
  }
24
- Events.getWebsiteEventsDataFields = getWebsiteEventsDataFields;
25
- /** Gets event name and property counts for a website: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-dataproperties (TODO UNTESTED) */
26
- async function getWebsiteEventsDataProperties(websiteId, parameters) {
24
+ Events.get_WEBSITEID_EventdataFields = get_WEBSITEID_EventdataFields;
25
+ /** Gets event name and property counts for a website: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataproperties (TODO UNTESTED) */
26
+ async function get_WEBSITEID_EventdataProperties(websiteId, parameters) {
27
27
  return await this.request("get", ["websites", websiteId, "event-data", "properties"], parameters);
28
28
  }
29
- Events.getWebsiteEventsDataProperties = getWebsiteEventsDataProperties;
30
- /** Gets event data counts for a given event and property: https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-datavalues (TODO UNTESTED) */
31
- async function getWebsiteEventsDataValues(websiteId, parameters) {
29
+ Events.get_WEBSITEID_EventdataProperties = get_WEBSITEID_EventdataProperties;
30
+ /** Gets event data counts for a given event and property: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datavalues (TODO UNTESTED) */
31
+ async function get_WEBSITEID_EventdataValues(websiteId, parameters) {
32
32
  return await this.request("get", ["websites", websiteId, "event-data", "values"], parameters);
33
33
  }
34
- Events.getWebsiteEventsDataValues = getWebsiteEventsDataValues;
35
- /** Gets aggregated website events, properties, and records within a given time range https://umami.is/docs/api/events-api#get-apiwebsiteswebsiteidevent-datastats (TODO UNTESTED) */
36
- async function getWebsiteEventsDataStats(websiteId, parameters) {
34
+ Events.get_WEBSITEID_EventdataValues = get_WEBSITEID_EventdataValues;
35
+ /** Gets aggregated website events, properties, and records within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datastats (TODO UNTESTED) */
36
+ async function get_WEBSITEID_EventdataStats(websiteId, parameters) {
37
37
  return await this.request("get", ["websites", websiteId, "event-data", "stats"], parameters);
38
38
  }
39
- Events.getWebsiteEventsDataStats = getWebsiteEventsDataStats;
39
+ Events.get_WEBSITEID_EventdataStats = get_WEBSITEID_EventdataStats;
40
40
  })(Events || (Events = {}));
@@ -0,0 +1,28 @@
1
+ import { API, GenericObject, GenericRequestParameters } from "../index.js";
2
+ /** Operations around Links management: https://umami.is/docs/api/links */
3
+ export declare namespace Links {
4
+ interface Link extends GenericObject {
5
+ name: string;
6
+ url: string;
7
+ slug: string;
8
+ userId: string;
9
+ teamid: string | null;
10
+ }
11
+ /** Returns all user links: https://umami.is/docs/api/links#get-apilinks (TODO UNTESTED) */
12
+ function get(this: API, parameters?: GenericRequestParameters): Promise<Link[]>;
13
+ /** Gets a link by ID: https://umami.is/docs/api/links#get-apilinkslinkid (TODO UNTESTED) */
14
+ function get_LINKID(this: API, linkId: Link["id"]): Promise<Link>;
15
+ /** Updates a link: https://umami.is/docs/api/links#post-apilinkslinkid (TODO UNTESTED) */
16
+ function post_LINKID(this: API, linkId: Link["id"], parameters: {
17
+ /** The link's name */
18
+ name?: string;
19
+ /** The link's destination URL */
20
+ url?: string;
21
+ /** The link's URL slug, **with a minimum of 8 characters** */
22
+ slug?: string;
23
+ }): Promise<Link>;
24
+ /** Deletes a link: https://umami.is/docs/api/links#delete-apilinkslinkid (TODO UNTESTED) */
25
+ function delete_LINKID(this: API, linkId: Link["id"]): Promise<{
26
+ ok: boolean;
27
+ }>;
28
+ }
@@ -0,0 +1,25 @@
1
+ /** Operations around Links management: https://umami.is/docs/api/links */
2
+ export var Links;
3
+ (function (Links) {
4
+ /** Returns all user links: https://umami.is/docs/api/links#get-apilinks (TODO UNTESTED) */
5
+ async function get(parameters) {
6
+ const response = await this.request("get", ["links"], parameters);
7
+ return response.data;
8
+ }
9
+ Links.get = get;
10
+ /** Gets a link by ID: https://umami.is/docs/api/links#get-apilinkslinkid (TODO UNTESTED) */
11
+ async function get_LINKID(linkId) {
12
+ return await this.request("get", ["links", linkId]);
13
+ }
14
+ Links.get_LINKID = get_LINKID;
15
+ /** Updates a link: https://umami.is/docs/api/links#post-apilinkslinkid (TODO UNTESTED) */
16
+ async function post_LINKID(linkId, parameters) {
17
+ return await this.request("post", ["links", linkId], parameters);
18
+ }
19
+ Links.post_LINKID = post_LINKID;
20
+ /** Deletes a link: https://umami.is/docs/api/links#delete-apilinkslinkid (TODO UNTESTED) */
21
+ async function delete_LINKID(linkId) {
22
+ return await this.request("delete", ["links", linkId]);
23
+ }
24
+ Links.delete_LINKID = delete_LINKID;
25
+ })(Links || (Links = {}));
@@ -0,0 +1,44 @@
1
+ import { API, GenericObject, MinimalUser, Role, TeamRole } from "../index.js";
2
+ /** All information about your session: https://umami.is/docs/api/me */
3
+ export declare namespace Me {
4
+ /** Get information based on your auth token: https://umami.is/docs/api/me#get-apime (TODO UNTESTED) */
5
+ function get(this: API): Promise<{
6
+ token: string;
7
+ authKey: string;
8
+ shareToken: string | null;
9
+ user: {
10
+ id: string;
11
+ username: string;
12
+ role: Role;
13
+ createdAt: Date;
14
+ isAdmin: boolean;
15
+ };
16
+ }>;
17
+ /** Get all your teams: https://umami.is/docs/api/me#get-apimeteams (TODO UNTESTED) */
18
+ function getTeams(this: API): Promise<(GenericObject & {
19
+ name: string;
20
+ accessCode: string;
21
+ logoUrl: string | null;
22
+ members: (Omit<GenericObject, "deletedAt"> & {
23
+ teamId: string;
24
+ userId: string;
25
+ role: TeamRole;
26
+ user: MinimalUser;
27
+ })[];
28
+ _count: {
29
+ websites: number;
30
+ members: number;
31
+ };
32
+ })[]>;
33
+ /** Get all your websites: https://umami.is/docs/api/me#get-apimeteams (TODO UNTESTED) */
34
+ function getWebsites(this: API): Promise<(GenericObject & {
35
+ name: string;
36
+ domain: string;
37
+ shareId: string | null;
38
+ resetAt: Date | null;
39
+ userId: string;
40
+ teamId: string | null;
41
+ createdBy: string;
42
+ user: MinimalUser;
43
+ })[]>;
44
+ }
@@ -0,0 +1,21 @@
1
+ /** All information about your session: https://umami.is/docs/api/me */
2
+ export var Me;
3
+ (function (Me) {
4
+ /** Get information based on your auth token: https://umami.is/docs/api/me#get-apime (TODO UNTESTED) */
5
+ async function get() {
6
+ return await this.request("get", ["me"]);
7
+ }
8
+ Me.get = get;
9
+ /** Get all your teams: https://umami.is/docs/api/me#get-apimeteams (TODO UNTESTED) */
10
+ async function getTeams() {
11
+ const response = await this.request("get", ["me", "teams"]);
12
+ return response.data;
13
+ }
14
+ Me.getTeams = getTeams;
15
+ /** Get all your websites: https://umami.is/docs/api/me#get-apimeteams (TODO UNTESTED) */
16
+ async function getWebsites() {
17
+ const response = await this.request("get", ["me", "websites"]);
18
+ return response.data;
19
+ }
20
+ Me.getWebsites = getWebsites;
21
+ })(Me || (Me = {}));
@@ -0,0 +1,25 @@
1
+ import { API, GenericObject, GenericRequestParameters } from "../index.js";
2
+ /** Operations around Pixels management: https://umami.is/docs/api/pixels */
3
+ export declare namespace Pixels {
4
+ interface Pixel extends GenericObject {
5
+ name: string;
6
+ slug: string;
7
+ userId: string;
8
+ teamid: string | null;
9
+ }
10
+ /** Returns all user pixels: https://umami.is/docs/api/pixels#get-apipixels (TODO UNTESTED) */
11
+ function get(this: API, parameters?: GenericRequestParameters): Promise<Pixel[]>;
12
+ /** Gets a pixel by ID: https://umami.is/docs/api/pixels#get-apipixelspixelid (TODO UNTESTED) */
13
+ function get_PIXELID(this: API, pixelId: Pixel["id"]): Promise<Pixel>;
14
+ /** Updates a pixel: https://umami.is/docs/api/pixels#post-apipixelspixelid (TODO UNTESTED) */
15
+ function post_PIXELID(this: API, pixelId: Pixel["id"], parameters: {
16
+ /** The pixel's name */
17
+ name?: string;
18
+ /** The pixel's URL slug, **with a minimum of 8 characters** */
19
+ slug?: string;
20
+ }): Promise<Pixel>;
21
+ /** Deletes a pixel: https://umami.is/docs/api/pixels#delete-apipixelspixelid (TODO UNTESTED) */
22
+ function delete_PIXELID(this: API, pixelId: Pixel["id"]): Promise<{
23
+ ok: boolean;
24
+ }>;
25
+ }
@@ -0,0 +1,25 @@
1
+ /** Operations around Pixels management: https://umami.is/docs/api/pixels */
2
+ export var Pixels;
3
+ (function (Pixels) {
4
+ /** Returns all user pixels: https://umami.is/docs/api/pixels#get-apipixels (TODO UNTESTED) */
5
+ async function get(parameters) {
6
+ const response = await this.request("get", ["pixels"], parameters);
7
+ return response.data;
8
+ }
9
+ Pixels.get = get;
10
+ /** Gets a pixel by ID: https://umami.is/docs/api/pixels#get-apipixelspixelid (TODO UNTESTED) */
11
+ async function get_PIXELID(pixelId) {
12
+ return await this.request("get", ["pixels", pixelId]);
13
+ }
14
+ Pixels.get_PIXELID = get_PIXELID;
15
+ /** Updates a pixel: https://umami.is/docs/api/pixels#post-apipixelspixelid (TODO UNTESTED) */
16
+ async function post_PIXELID(pixelId, parameters) {
17
+ return await this.request("post", ["pixels", pixelId], parameters);
18
+ }
19
+ Pixels.post_PIXELID = post_PIXELID;
20
+ /** Deletes a pixel: https://umami.is/docs/api/pixels#delete-apipixelspixelid (TODO UNTESTED) */
21
+ async function delete_PIXELID(pixelId) {
22
+ return await this.request("delete", ["pixels", pixelId]);
23
+ }
24
+ Pixels.delete_PIXELID = delete_PIXELID;
25
+ })(Pixels || (Pixels = {}));
@@ -1,8 +1,8 @@
1
1
  import { API } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/realtime-api */
2
+ /** Realtime data for your website: https://umami.is/docs/api/realtime */
3
3
  export declare namespace Realtime {
4
- /** Realtime stats within the last 30 minutes: https://umami.is/docs/api/realtime-api#get-apirealtimewebsiteid (TODO UNTESTED) */
5
- function getRealtime(this: API, websiteId: string): Promise<{
4
+ /** Realtime stats within the last 30 minutes: https://umami.is/docs/api/realtime#get-apirealtimewebsiteid (TODO UNTESTED) */
5
+ function get_WEBSITEID(this: API, websiteId: string): Promise<{
6
6
  countries: {
7
7
  [k: string]: number;
8
8
  };
@@ -1,9 +1,9 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/realtime-api */
1
+ /** Realtime data for your website: https://umami.is/docs/api/realtime */
2
2
  export var Realtime;
3
3
  (function (Realtime) {
4
- /** Realtime stats within the last 30 minutes: https://umami.is/docs/api/realtime-api#get-apirealtimewebsiteid (TODO UNTESTED) */
5
- async function getRealtime(websiteId) {
4
+ /** Realtime stats within the last 30 minutes: https://umami.is/docs/api/realtime#get-apirealtimewebsiteid (TODO UNTESTED) */
5
+ async function get_WEBSITEID(websiteId) {
6
6
  return await this.request("post", ["realtime", websiteId]);
7
7
  }
8
- Realtime.getRealtime = getRealtime;
8
+ Realtime.get_WEBSITEID = get_WEBSITEID;
9
9
  })(Realtime || (Realtime = {}));
@@ -1,5 +1,5 @@
1
1
  import { API, Filters, GenericRequestParameters, NameValue, Report, Timestamps, XTY } from "../index.js";
2
- /** For endpoints listed on: https://umami.is/docs/api/reports-api */
2
+ /** Using reports throught the api: https://umami.is/docs/api/reports */
3
3
  export declare namespace Reports {
4
4
  type ReportType = {
5
5
  type: "attribution" | "breakdown" | "funnel" | "goal" | "journey" | "retention" | "revenue" | "utm";
@@ -8,10 +8,10 @@ export declare namespace Reports {
8
8
  utm: string;
9
9
  views: number;
10
10
  }
11
- /** Get all reports by website ID: https://umami.is/docs/api/reports-api#get-apireports (TODO UNTESTED) */
12
- function getReports(this: API, websiteId: string, parameters: ReportType & Omit<GenericRequestParameters, "search">): Promise<Report[]>;
13
- /** Creates a report: https://umami.is/docs/api/reports-api#post-apireports (TODO UNTESTED) */
14
- function createReport(this: API, websiteId: string, parameters: ReportType & {
11
+ /** Get all reports by website ID: https://umami.is/docs/api/reports#get-apireports (TODO UNTESTED) */
12
+ function get(this: API, websiteId: string, parameters: ReportType & Omit<GenericRequestParameters, "search">): Promise<Report[]>;
13
+ /** Creates a report: https://umami.is/docs/api/reports#post-apireports (TODO UNTESTED) */
14
+ function post(this: API, websiteId: string, parameters: ReportType & {
15
15
  /** Name of report */
16
16
  name: string;
17
17
  /** Description of report */
@@ -19,10 +19,10 @@ export declare namespace Reports {
19
19
  /** Parameters for report */
20
20
  parameters?: any;
21
21
  }): Promise<Report>;
22
- /** Gets a report by ID: https://umami.is/docs/api/reports-api#get-apireportsreportid (TODO UNTESTED) */
23
- function getReport(this: API, reportId: string): Promise<Report>;
24
- /** Updates a report: https://umami.is/docs/api/reports-api#post-apireportsreportid (TODO UNTESTED) */
25
- function updateReport(this: API, reportId: string, websiteId: string, parameters: ReportType & {
22
+ /** Gets a report by ID: https://umami.is/docs/api/reports#get-apireportsreportid (TODO UNTESTED) */
23
+ function get_REPORTID(this: API, reportId: string): Promise<Report>;
24
+ /** Updates a report: https://umami.is/docs/api/reports#post-apireportsreportid (TODO UNTESTED) */
25
+ function post_REPORTID(this: API, reportId: string, websiteId: string, parameters: ReportType & {
26
26
  /** Name of report */
27
27
  name: string;
28
28
  /** Description of report */
@@ -30,12 +30,12 @@ export declare namespace Reports {
30
30
  /** Parameters for report */
31
31
  parameters?: any;
32
32
  }): Promise<Report>;
33
- /** Deletes a report: https://umami.is/docs/api/reports-api#delete-apireportsreportid (TODO UNTESTED) */
34
- function deleteReport(this: API, reportId: string): Promise<{
33
+ /** Deletes a report: https://umami.is/docs/api/reports#delete-apireportsreportid (TODO UNTESTED) */
34
+ function delete_REPORTID(this: API, reportId: string): Promise<{
35
35
  ok: boolean;
36
36
  }>;
37
- /** See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports-api#post-apireportsattribution (TODO UNTESTED) */
38
- function getReportsAttribution(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
37
+ /** See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports#post-apireportsattribution (TODO UNTESTED) */
38
+ function postAttribution(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
39
39
  /** Attribution model */
40
40
  model: "firstClick" | "lastClick";
41
41
  /** Conversion type */
@@ -56,8 +56,8 @@ export declare namespace Reports {
56
56
  visits: number;
57
57
  };
58
58
  }>;
59
- /** Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports-api#post-apireportsbreakdown (TODO UNTESTED) */
60
- function getReportsBreakdown(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
59
+ /** Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports#post-apireportsbreakdown (TODO UNTESTED) */
60
+ function postBreakdown(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
61
61
  fields: ("path" | "title" | "query" | "referrer" | "browser" | "os" | "device" | "country" | "region" | "city" | "hostname" | "tag" | "event")[];
62
62
  }): Promise<{
63
63
  views: number;
@@ -68,8 +68,8 @@ export declare namespace Reports {
68
68
  os: string;
69
69
  country: string;
70
70
  }[]>;
71
- /** Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports-api#post-apireportsfunnel (TODO UNTESTED) */
72
- function getReportsFunnel(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
71
+ /** Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports#post-apireportsfunnel (TODO UNTESTED) */
72
+ function postFunnel(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
73
73
  /** Type of event and conversion step */
74
74
  steps: {
75
75
  type: "path" | "event";
@@ -86,8 +86,8 @@ export declare namespace Reports {
86
86
  dropoff: number | null;
87
87
  remaining: number;
88
88
  }[]>;
89
- /** Track your goals for pageviews and events: https://umami.is/docs/api/reports-api#post-apireportsgoals (TODO UNTESTED) */
90
- function getReportsGoals(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
89
+ /** Track your goals for pageviews and events: https://umami.is/docs/api/reports#post-apireportsgoals (TODO UNTESTED) */
90
+ function postGoals(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
91
91
  /** Conversion type */
92
92
  type: ("path" | "event")[];
93
93
  /** Conversion step value */
@@ -96,8 +96,8 @@ export declare namespace Reports {
96
96
  num: number;
97
97
  total: number;
98
98
  }>;
99
- /** Understand how users nagivate through your website: https://umami.is/docs/api/reports-api#post-apireportsjourney (TODO UNTESTED) */
100
- function getReportsJourney(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
99
+ /** Understand how users nagivate through your website: https://umami.is/docs/api/reports#post-apireportsjourney (TODO UNTESTED) */
100
+ function postJourney(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
101
101
  /** Number of steps from 3 to 7 */
102
102
  steps: number;
103
103
  /** Starting step URL or event name */
@@ -108,8 +108,8 @@ export declare namespace Reports {
108
108
  items: (string | null)[];
109
109
  count: number;
110
110
  }[]>;
111
- /** Measure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports-api#post-apireportsretention (TODO UNTESTED) */
112
- function getReportsRetention(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
111
+ /** Measure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports#post-apireportsretention (TODO UNTESTED) */
112
+ function postRetention(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
113
113
  /** Timezone (ex. America/Los_Angeles) */
114
114
  timezone: string;
115
115
  }): Promise<{
@@ -119,8 +119,8 @@ export declare namespace Reports {
119
119
  returnVisitors: number;
120
120
  percentage: number;
121
121
  }[]>;
122
- /** Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports-api#post-apireportsrevenue (TODO UNTESTED) */
123
- function getReportsRevenue(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
122
+ /** Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports#post-apireportsrevenue (TODO UNTESTED) */
123
+ function postRevenue(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
124
124
  /** Timezone (ex. America/Los_Angeles) */
125
125
  timezone: string;
126
126
  /** Currency code (ISO 4217) */
@@ -135,8 +135,8 @@ export declare namespace Reports {
135
135
  average: number;
136
136
  };
137
137
  }>;
138
- /** Track your campaigns through UTM parameters: https://umami.is/docs/api/reports-api#post-apireportsutm (TODO UNTESTED) */
139
- function getReportsUTM(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps): Promise<{
138
+ /** Track your campaigns through UTM parameters: https://umami.is/docs/api/reports#post-apireportsutm (TODO UNTESTED) */
139
+ function postUTM(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps): Promise<{
140
140
  utm_source: UTM[];
141
141
  utm_medium: UTM[];
142
142
  utm_campaign: UTM[];
@@ -1,70 +1,70 @@
1
- /** For endpoints listed on: https://umami.is/docs/api/reports-api */
1
+ /** Using reports throught the api: https://umami.is/docs/api/reports */
2
2
  export var Reports;
3
3
  (function (Reports) {
4
- /** Get all reports by website ID: https://umami.is/docs/api/reports-api#get-apireports (TODO UNTESTED) */
5
- async function getReports(websiteId, parameters) {
4
+ /** Get all reports by website ID: https://umami.is/docs/api/reports#get-apireports (TODO UNTESTED) */
5
+ async function get(websiteId, parameters) {
6
6
  const response = await this.request("get", ["reports"], { websiteId, ...parameters });
7
7
  return response.data;
8
8
  }
9
- Reports.getReports = getReports;
10
- /** Creates a report: https://umami.is/docs/api/reports-api#post-apireports (TODO UNTESTED) */
11
- async function createReport(websiteId, parameters) {
9
+ Reports.get = get;
10
+ /** Creates a report: https://umami.is/docs/api/reports#post-apireports (TODO UNTESTED) */
11
+ async function post(websiteId, parameters) {
12
12
  return await this.request("post", ["reports"], { websiteId, ...parameters });
13
13
  }
14
- Reports.createReport = createReport;
15
- /** Gets a report by ID: https://umami.is/docs/api/reports-api#get-apireportsreportid (TODO UNTESTED) */
16
- async function getReport(reportId) {
14
+ Reports.post = post;
15
+ /** Gets a report by ID: https://umami.is/docs/api/reports#get-apireportsreportid (TODO UNTESTED) */
16
+ async function get_REPORTID(reportId) {
17
17
  return await this.request("get", ["reports", reportId]);
18
18
  }
19
- Reports.getReport = getReport;
20
- /** Updates a report: https://umami.is/docs/api/reports-api#post-apireportsreportid (TODO UNTESTED) */
21
- async function updateReport(reportId, websiteId, parameters) {
19
+ Reports.get_REPORTID = get_REPORTID;
20
+ /** Updates a report: https://umami.is/docs/api/reports#post-apireportsreportid (TODO UNTESTED) */
21
+ async function post_REPORTID(reportId, websiteId, parameters) {
22
22
  return await this.request("get", ["reports", reportId], { websiteId, ...parameters });
23
23
  }
24
- Reports.updateReport = updateReport;
25
- /** Deletes a report: https://umami.is/docs/api/reports-api#delete-apireportsreportid (TODO UNTESTED) */
26
- async function deleteReport(reportId) {
24
+ Reports.post_REPORTID = post_REPORTID;
25
+ /** Deletes a report: https://umami.is/docs/api/reports#delete-apireportsreportid (TODO UNTESTED) */
26
+ async function delete_REPORTID(reportId) {
27
27
  return await this.request("delete", ["reports", reportId]);
28
28
  }
29
- Reports.deleteReport = deleteReport;
30
- /** See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports-api#post-apireportsattribution (TODO UNTESTED) */
31
- async function getReportsAttribution(websiteId, parameters) {
29
+ Reports.delete_REPORTID = delete_REPORTID;
30
+ /** See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports#post-apireportsattribution (TODO UNTESTED) */
31
+ async function postAttribution(websiteId, parameters) {
32
32
  return await this.request("post", ["reports", "attribution"], { websiteId, ...parameters });
33
33
  }
34
- Reports.getReportsAttribution = getReportsAttribution;
35
- /** Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports-api#post-apireportsbreakdown (TODO UNTESTED) */
36
- async function getReportsBreakdown(websiteId, parameters) {
34
+ Reports.postAttribution = postAttribution;
35
+ /** Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports#post-apireportsbreakdown (TODO UNTESTED) */
36
+ async function postBreakdown(websiteId, parameters) {
37
37
  return await this.request("post", ["reports", "breakdown"], { websiteId, ...parameters });
38
38
  }
39
- Reports.getReportsBreakdown = getReportsBreakdown;
40
- /** Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports-api#post-apireportsfunnel (TODO UNTESTED) */
41
- async function getReportsFunnel(websiteId, parameters) {
39
+ Reports.postBreakdown = postBreakdown;
40
+ /** Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports#post-apireportsfunnel (TODO UNTESTED) */
41
+ async function postFunnel(websiteId, parameters) {
42
42
  return await this.request("post", ["reports", "funnel"], { websiteId, ...parameters });
43
43
  }
44
- Reports.getReportsFunnel = getReportsFunnel;
45
- /** Track your goals for pageviews and events: https://umami.is/docs/api/reports-api#post-apireportsgoals (TODO UNTESTED) */
46
- async function getReportsGoals(websiteId, parameters) {
44
+ Reports.postFunnel = postFunnel;
45
+ /** Track your goals for pageviews and events: https://umami.is/docs/api/reports#post-apireportsgoals (TODO UNTESTED) */
46
+ async function postGoals(websiteId, parameters) {
47
47
  return await this.request("post", ["reports", "goals"], { websiteId, ...parameters });
48
48
  }
49
- Reports.getReportsGoals = getReportsGoals;
50
- /** Understand how users nagivate through your website: https://umami.is/docs/api/reports-api#post-apireportsjourney (TODO UNTESTED) */
51
- async function getReportsJourney(websiteId, parameters) {
49
+ Reports.postGoals = postGoals;
50
+ /** Understand how users nagivate through your website: https://umami.is/docs/api/reports#post-apireportsjourney (TODO UNTESTED) */
51
+ async function postJourney(websiteId, parameters) {
52
52
  return await this.request("post", ["reports", "journey"], { websiteId, ...parameters });
53
53
  }
54
- Reports.getReportsJourney = getReportsJourney;
55
- /** Measure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports-api#post-apireportsretention (TODO UNTESTED) */
56
- async function getReportsRetention(websiteId, parameters) {
54
+ Reports.postJourney = postJourney;
55
+ /** Measure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports#post-apireportsretention (TODO UNTESTED) */
56
+ async function postRetention(websiteId, parameters) {
57
57
  return await this.request("post", ["reports", "retention"], { websiteId, ...parameters });
58
58
  }
59
- Reports.getReportsRetention = getReportsRetention;
60
- /** Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports-api#post-apireportsrevenue (TODO UNTESTED) */
61
- async function getReportsRevenue(websiteId, parameters) {
59
+ Reports.postRetention = postRetention;
60
+ /** Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports#post-apireportsrevenue (TODO UNTESTED) */
61
+ async function postRevenue(websiteId, parameters) {
62
62
  return await this.request("post", ["reports", "revenue"], { websiteId, ...parameters });
63
63
  }
64
- Reports.getReportsRevenue = getReportsRevenue;
65
- /** Track your campaigns through UTM parameters: https://umami.is/docs/api/reports-api#post-apireportsutm (TODO UNTESTED) */
66
- async function getReportsUTM(websiteId, parameters) {
64
+ Reports.postRevenue = postRevenue;
65
+ /** Track your campaigns through UTM parameters: https://umami.is/docs/api/reports#post-apireportsutm (TODO UNTESTED) */
66
+ async function postUTM(websiteId, parameters) {
67
67
  return await this.request("post", ["reports", "utm"], { websiteId, ...parameters });
68
68
  }
69
- Reports.getReportsUTM = getReportsUTM;
69
+ Reports.postUTM = postUTM;
70
70
  })(Reports || (Reports = {}));