umami-api-js 0.0.4 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/index.d.ts +191 -96
- package/dist/index.js +163 -69
- package/dist/namespaces/Admin.d.ts +8 -17
- package/dist/namespaces/Admin.js +4 -10
- package/dist/namespaces/Events.d.ts +15 -15
- package/dist/namespaces/Events.js +22 -22
- package/dist/namespaces/Links.d.ts +26 -0
- package/dist/namespaces/Links.js +25 -0
- package/dist/namespaces/Me.d.ts +38 -0
- package/dist/namespaces/Me.js +21 -0
- package/dist/namespaces/Pixels.d.ts +23 -0
- package/dist/namespaces/Pixels.js +25 -0
- package/dist/namespaces/Realtime.d.ts +3 -3
- package/dist/namespaces/Realtime.js +4 -4
- package/dist/namespaces/Reports.d.ts +28 -30
- package/dist/namespaces/Reports.js +40 -40
- package/dist/namespaces/Sessions.d.ts +17 -17
- package/dist/namespaces/Sessions.js +25 -25
- package/dist/namespaces/Teams.d.ts +29 -33
- package/dist/namespaces/Teams.js +37 -37
- package/dist/namespaces/Users.d.ts +33 -29
- package/dist/namespaces/Users.js +24 -24
- package/dist/namespaces/WebsiteStats.d.ts +18 -18
- package/dist/namespaces/WebsiteStats.js +19 -19
- package/dist/namespaces/Websites.d.ts +19 -22
- package/dist/namespaces/Websites.js +19 -19
- package/package.json +7 -5
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import { API, GenericObject, GenericRequestParameters,
|
|
2
|
-
/**
|
|
1
|
+
import { API, GenericObject, GenericRequestParameters, Teams, Users, Website } from "../index.js";
|
|
2
|
+
/** Operations around admin management: https://umami.is/docs/api/admin */
|
|
3
3
|
export declare namespace Admin {
|
|
4
|
-
/** Returns all users: https://umami.is/docs/api/admin
|
|
4
|
+
/** Returns all users: https://umami.is/docs/api/admin#get-apiadminusers */
|
|
5
5
|
function getUsers(this: API, parameters?: GenericRequestParameters): Promise<(GenericObject & {
|
|
6
6
|
username: string;
|
|
7
|
-
|
|
8
|
-
password: string;
|
|
9
|
-
role: Role;
|
|
7
|
+
role: Users.Role;
|
|
10
8
|
logoUrl: string | null;
|
|
11
9
|
displayName: string | null;
|
|
12
10
|
_count: {
|
|
13
|
-
|
|
14
|
-
websiteUser: number;
|
|
11
|
+
websites: number;
|
|
15
12
|
};
|
|
16
13
|
})[]>;
|
|
17
|
-
/**
|
|
18
|
-
* Returns all websites: https://umami.is/docs/api/admin-api#get-apiadminwebsites
|
|
19
|
-
* @remarks TODO Possibly doesn't work? (throws 400 on my end)
|
|
20
|
-
*/
|
|
14
|
+
/** Returns all websites: https://umami.is/docs/api/admin#get-apiadminwebsites */
|
|
21
15
|
function getWebsites(this: API, parameters?: GenericRequestParameters): Promise<(Website & {
|
|
22
|
-
user: MinimalUser;
|
|
16
|
+
user: Users.MinimalUser;
|
|
23
17
|
/** @remarks TODO Documentation says it can be null but doesn't actually say what else it can be, ***presumed* to be string**, check */
|
|
24
18
|
team: string | null;
|
|
25
19
|
})[]>;
|
|
26
|
-
/**
|
|
27
|
-
* Returns all teams: https://umami.is/docs/api/admin-api#get-apiadminteams
|
|
28
|
-
* @remarks TODO Possibly doesn't work? (throws 404 on my end)
|
|
29
|
-
*/
|
|
20
|
+
/** Returns all teams: https://umami.is/docs/api/admin#get-apiadminteams */
|
|
30
21
|
function getTeams(this: API, parameters?: GenericRequestParameters): Promise<(GenericObject & {
|
|
31
22
|
name: string;
|
|
32
23
|
accessCode: string;
|
package/dist/namespaces/Admin.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Operations around admin management: https://umami.is/docs/api/admin */
|
|
2
2
|
export var Admin;
|
|
3
3
|
(function (Admin) {
|
|
4
|
-
/** Returns all users: https://umami.is/docs/api/admin
|
|
4
|
+
/** Returns all users: https://umami.is/docs/api/admin#get-apiadminusers */
|
|
5
5
|
async function getUsers(parameters) {
|
|
6
6
|
const response = await this.request("get", ["admin", "users"], parameters);
|
|
7
7
|
return response.data;
|
|
8
8
|
}
|
|
9
9
|
Admin.getUsers = getUsers;
|
|
10
|
-
/**
|
|
11
|
-
* Returns all websites: https://umami.is/docs/api/admin-api#get-apiadminwebsites
|
|
12
|
-
* @remarks TODO Possibly doesn't work? (throws 400 on my end)
|
|
13
|
-
*/
|
|
10
|
+
/** Returns all websites: https://umami.is/docs/api/admin#get-apiadminwebsites */
|
|
14
11
|
async function getWebsites(parameters) {
|
|
15
12
|
const response = await this.request("get", ["admin", "websites"], parameters);
|
|
16
13
|
return response.data;
|
|
17
14
|
}
|
|
18
15
|
Admin.getWebsites = getWebsites;
|
|
19
|
-
/**
|
|
20
|
-
* Returns all teams: https://umami.is/docs/api/admin-api#get-apiadminteams
|
|
21
|
-
* @remarks TODO Possibly doesn't work? (throws 404 on my end)
|
|
22
|
-
*/
|
|
16
|
+
/** Returns all teams: https://umami.is/docs/api/admin#get-apiadminteams */
|
|
23
17
|
async function getTeams(parameters) {
|
|
24
18
|
const response = await this.request("get", ["admin", "teams"], parameters);
|
|
25
19
|
return response.data;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { API, Filters, GenericRequestParameters, Timestamps } from "../index.js";
|
|
2
|
-
/**
|
|
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
|
|
5
|
-
function
|
|
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
|
|
27
|
-
function
|
|
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
|
|
41
|
-
function
|
|
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
|
|
51
|
-
function
|
|
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
|
|
58
|
-
function
|
|
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
|
|
64
|
-
function
|
|
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
|
|
74
|
-
function
|
|
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
|
-
/**
|
|
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
|
|
5
|
-
async function
|
|
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.
|
|
10
|
-
/** Gets event-data for a individual event https://umami.is/docs/api/events
|
|
11
|
-
async function
|
|
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.
|
|
15
|
-
/** Gets event data names, properties, and counts: https://umami.is/docs/api/events
|
|
16
|
-
async function
|
|
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.
|
|
20
|
-
/** Gets event data property and value counts within a given time range: https://umami.is/docs/api/events
|
|
21
|
-
async function
|
|
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.
|
|
25
|
-
/** Gets event name and property counts for a website: https://umami.is/docs/api/events
|
|
26
|
-
async function
|
|
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.
|
|
30
|
-
/** Gets event data counts for a given event and property: https://umami.is/docs/api/events
|
|
31
|
-
async function
|
|
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.
|
|
35
|
-
/** Gets aggregated website events, properties, and records within a given time range https://umami.is/docs/api/events
|
|
36
|
-
async function
|
|
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.
|
|
39
|
+
Events.get_WEBSITEID_EventdataStats = get_WEBSITEID_EventdataStats;
|
|
40
40
|
})(Events || (Events = {}));
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { API, DeletionResult, GenericObject, GenericRequestParameters, Users } 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: Users.User["id"];
|
|
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<DeletionResult>;
|
|
26
|
+
}
|
|
@@ -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,38 @@
|
|
|
1
|
+
import { API, GenericObject, TeamRole, Users } 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 */
|
|
5
|
+
function get(this: API): Promise<{
|
|
6
|
+
token: string;
|
|
7
|
+
authKey: string;
|
|
8
|
+
shareToken: string | null;
|
|
9
|
+
user: Users.User;
|
|
10
|
+
}>;
|
|
11
|
+
/** Get all your teams: https://umami.is/docs/api/me#get-apimeteams */
|
|
12
|
+
function getTeams(this: API): Promise<(GenericObject & {
|
|
13
|
+
name: string;
|
|
14
|
+
accessCode: string;
|
|
15
|
+
logoUrl: string | null;
|
|
16
|
+
members: (Omit<GenericObject, "deletedAt"> & {
|
|
17
|
+
teamId: string;
|
|
18
|
+
userId: Users.User["id"];
|
|
19
|
+
role: TeamRole;
|
|
20
|
+
user: Users.MinimalUser;
|
|
21
|
+
})[];
|
|
22
|
+
_count: {
|
|
23
|
+
websites: number;
|
|
24
|
+
members: number;
|
|
25
|
+
};
|
|
26
|
+
})[]>;
|
|
27
|
+
/** Get all your websites: https://umami.is/docs/api/me#get-apimeteams */
|
|
28
|
+
function getWebsites(this: API): Promise<(GenericObject & {
|
|
29
|
+
name: string;
|
|
30
|
+
domain: string;
|
|
31
|
+
shareId: string | null;
|
|
32
|
+
resetAt: Date | null;
|
|
33
|
+
userId: Users.User["id"];
|
|
34
|
+
teamId: string | null;
|
|
35
|
+
createdBy: string;
|
|
36
|
+
user: Users.MinimalUser;
|
|
37
|
+
})[]>;
|
|
38
|
+
}
|
|
@@ -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 */
|
|
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 */
|
|
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 */
|
|
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,23 @@
|
|
|
1
|
+
import { API, DeletionResult, GenericObject, GenericRequestParameters, Users } 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: Users.User["id"];
|
|
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<DeletionResult>;
|
|
23
|
+
}
|
|
@@ -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
|
-
/**
|
|
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
|
|
5
|
-
function
|
|
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
|
-
/**
|
|
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
|
|
5
|
-
async function
|
|
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.
|
|
8
|
+
Realtime.get_WEBSITEID = get_WEBSITEID;
|
|
9
9
|
})(Realtime || (Realtime = {}));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { API, Filters, GenericRequestParameters, NameValue, Report, Timestamps, XTY } from "../index.js";
|
|
2
|
-
/**
|
|
1
|
+
import { API, DeletionResult, Filters, GenericRequestParameters, NameValue, Report, Timestamps, XTY } from "../index.js";
|
|
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
|
|
12
|
-
function
|
|
13
|
-
/** Creates a report: https://umami.is/docs/api/reports
|
|
14
|
-
function
|
|
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
|
|
23
|
-
function
|
|
24
|
-
/** Updates a report: https://umami.is/docs/api/reports
|
|
25
|
-
function
|
|
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,10 @@ 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
|
|
34
|
-
function
|
|
35
|
-
|
|
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 & {
|
|
33
|
+
/** Deletes a report: https://umami.is/docs/api/reports#delete-apireportsreportid (TODO UNTESTED) */
|
|
34
|
+
function delete_REPORTID(this: API, reportId: string): Promise<DeletionResult>;
|
|
35
|
+
/** See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports#post-apireportsattribution (TODO UNTESTED) */
|
|
36
|
+
function postAttribution(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
39
37
|
/** Attribution model */
|
|
40
38
|
model: "firstClick" | "lastClick";
|
|
41
39
|
/** Conversion type */
|
|
@@ -56,8 +54,8 @@ export declare namespace Reports {
|
|
|
56
54
|
visits: number;
|
|
57
55
|
};
|
|
58
56
|
}>;
|
|
59
|
-
/** Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports
|
|
60
|
-
function
|
|
57
|
+
/** Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports#post-apireportsbreakdown (TODO UNTESTED) */
|
|
58
|
+
function postBreakdown(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
61
59
|
fields: ("path" | "title" | "query" | "referrer" | "browser" | "os" | "device" | "country" | "region" | "city" | "hostname" | "tag" | "event")[];
|
|
62
60
|
}): Promise<{
|
|
63
61
|
views: number;
|
|
@@ -68,8 +66,8 @@ export declare namespace Reports {
|
|
|
68
66
|
os: string;
|
|
69
67
|
country: string;
|
|
70
68
|
}[]>;
|
|
71
|
-
/** Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports
|
|
72
|
-
function
|
|
69
|
+
/** Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports#post-apireportsfunnel (TODO UNTESTED) */
|
|
70
|
+
function postFunnel(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
73
71
|
/** Type of event and conversion step */
|
|
74
72
|
steps: {
|
|
75
73
|
type: "path" | "event";
|
|
@@ -86,8 +84,8 @@ export declare namespace Reports {
|
|
|
86
84
|
dropoff: number | null;
|
|
87
85
|
remaining: number;
|
|
88
86
|
}[]>;
|
|
89
|
-
/** Track your goals for pageviews and events: https://umami.is/docs/api/reports
|
|
90
|
-
function
|
|
87
|
+
/** Track your goals for pageviews and events: https://umami.is/docs/api/reports#post-apireportsgoals (TODO UNTESTED) */
|
|
88
|
+
function postGoals(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
91
89
|
/** Conversion type */
|
|
92
90
|
type: ("path" | "event")[];
|
|
93
91
|
/** Conversion step value */
|
|
@@ -96,8 +94,8 @@ export declare namespace Reports {
|
|
|
96
94
|
num: number;
|
|
97
95
|
total: number;
|
|
98
96
|
}>;
|
|
99
|
-
/** Understand how users nagivate through your website: https://umami.is/docs/api/reports
|
|
100
|
-
function
|
|
97
|
+
/** Understand how users nagivate through your website: https://umami.is/docs/api/reports#post-apireportsjourney (TODO UNTESTED) */
|
|
98
|
+
function postJourney(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
101
99
|
/** Number of steps from 3 to 7 */
|
|
102
100
|
steps: number;
|
|
103
101
|
/** Starting step URL or event name */
|
|
@@ -108,8 +106,8 @@ export declare namespace Reports {
|
|
|
108
106
|
items: (string | null)[];
|
|
109
107
|
count: number;
|
|
110
108
|
}[]>;
|
|
111
|
-
/** Measure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports
|
|
112
|
-
function
|
|
109
|
+
/** Measure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports#post-apireportsretention (TODO UNTESTED) */
|
|
110
|
+
function postRetention(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
113
111
|
/** Timezone (ex. America/Los_Angeles) */
|
|
114
112
|
timezone: string;
|
|
115
113
|
}): Promise<{
|
|
@@ -119,8 +117,8 @@ export declare namespace Reports {
|
|
|
119
117
|
returnVisitors: number;
|
|
120
118
|
percentage: number;
|
|
121
119
|
}[]>;
|
|
122
|
-
/** Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports
|
|
123
|
-
function
|
|
120
|
+
/** Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports#post-apireportsrevenue (TODO UNTESTED) */
|
|
121
|
+
function postRevenue(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps & {
|
|
124
122
|
/** Timezone (ex. America/Los_Angeles) */
|
|
125
123
|
timezone: string;
|
|
126
124
|
/** Currency code (ISO 4217) */
|
|
@@ -135,8 +133,8 @@ export declare namespace Reports {
|
|
|
135
133
|
average: number;
|
|
136
134
|
};
|
|
137
135
|
}>;
|
|
138
|
-
/** Track your campaigns through UTM parameters: https://umami.is/docs/api/reports
|
|
139
|
-
function
|
|
136
|
+
/** Track your campaigns through UTM parameters: https://umami.is/docs/api/reports#post-apireportsutm (TODO UNTESTED) */
|
|
137
|
+
function postUTM(this: API, websiteId: string, parameters: ReportType & Filters & Timestamps): Promise<{
|
|
140
138
|
utm_source: UTM[];
|
|
141
139
|
utm_medium: UTM[];
|
|
142
140
|
utm_campaign: UTM[];
|