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